Book Image

Advanced Microsoft Content Management Server Development

Book Image

Advanced Microsoft Content Management Server Development

Overview of this book

Microsoft Content Management Server 2002 is a dynamic web publishing system with which you can build websites quickly and cost-efficiently. MCMS provides the administration, authoring, and data management functionality, and you provide the website interface, logic, and workflow. Microsoft SharePoint Portal Server (SPS) also features in the book. SPS 2003 enables enterprises to deploy an intelligent portal that seamlessly connects users, teams, and knowledge so that people can take advantage of relevant information across business processes to help them work more efficiently.You've mastered the basics of MCMS, and setup your own MCMS installation. You've only scratched the surface. This book is your gateway to squeezing every penny from your investment in MCMS and SPS, and making these two applications work together to provide an outstanding richness of content delivery and easy maintainability. As a developer, the Publishing API (PAPI) is at the heart of your work with MCMS, and this book starts by taking you on the most detailed tour of the PAPI you will find anywhere. As a live example, a component that reveals the structure of your MCMS site is created, taking you through how to manage the common elements of MCMS programmatically. Getting SharePoint and MCMS to work together is the next stop in the book. You will see how to use SharePoint's search engine to search MCMS content, publish content between the two systems, and create SharePoint Web Parts to draw content from MCMS.To ease your everyday work with MCMS, there are chapters on placeholder validation, and some useful custom placeholders for common MCMS tasks, such as a date-time picker, a placeholder for multiple attachments, and a DataGrid placeholder among others. There are a number of ways to consume MCMS content from the outside world, and we look at two exciting ways here; RSS and InfoPath/Web Services. The InfoPath solution provides another interface to MCMS content that allows content authors to concentrate on content and not the presentation. The book is rounded off with a number of must-have MCMS tips and tricks. Revert a posting to a previous version Change a postingÔø???s template Build a recycle bin Deal with links to deleted resources Update a postingÔø???s properties directly from a template file Re-write ugly URLs to friendly URLs Export resource gallery items using the site deployment API (SDAPI) Configure the position and size of the Web Author Console Dialogs Get frames and IFrames to work correctly in a template file
Table of Contents (21 chapters)
Advanced Microsoft Content Management Server Development
Credits
About the Authors
About the Reviewers
Index

Creating the Workspace


Let’s start by creating a work area for the CMS Explorer tool. Create a new Visual C# MCMS Web Application Project in Visual Studio .NET.

  1. 1. Name the new project CMSExplorer.

  2. 2. Get the Styles.css file from the book’s code download. Select Project | Add Existing Item and add it to the CMSExplorer project.

  3. 3. Create a new folder and name it images. Download the image files for this tutorial from the code download section of the book’s companion website and add them to the project.

  4. 4. Right-click the CMSExplorer project in the Solution Explorer and select Properties. Click Designer Defaults. Set the Page Layout field to Flow. This will set the default layout to flow instead of grid for all web forms created in the project. Click OK.

  5. 5. Right-click the Console folder and select Delete.

  6. 6. Add a new web form to the CMSExplorer project, and name it default.aspx.

  7. 7. In Design view, drag and drop the Styles.css file from Solution Explorer onto the form. This applies the stylesheet to the page.

  8. 8. Switch to HTML view. Add the table below between the <form> tags to provide the basic structure of the page. We use a litCurrentContainer Literal control to display the name of the current container. The lblPublishingMode Label will be used later to display the current publishing mode.

    <table cellSpacing="0" cellPadding="0">
    <tr>
      <td>
        <table>
        <tr>
          <td valign="top">
            <asp:Image runat="server" ID="imgTitle"></asp:Image>
          </td>
          <td valign="center">
            <h1>
              <asp:Literal ID="litCurrentContainer" runat="server"/>
            </h1>
          </td>
        </tr>
        </table>
        <asp:Label ID="lblPublishingMode" runat="server"
             CssClass="BodyText"/>
      </td>
    </tr>
    
    <tr>
      <td width="100%" bgcolor="#cccccc">(Space for Toolbar)</td>
    </tr>
    
    <tr>
      <td>(Space for DataGrid)</td>
    </tr>
    </table>
  9. 9. Toggle to Design view. Double-click on the form to get to its code-behind file. Above the namespace declaration, import the Microsoft.ContentManagement.Publishing namespace.

    							//MCMS PAPI
    							using Microsoft.ContentManagement.Publishing;
    
    namespace CMSExplorer
    {
      /// <summary>
      /// Summary description for _default.
      /// </summary>
      public class _default : System.Web.UI.Page
      {
    
        . . . code continues . . .
      }
    }