O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Advanced Microsoft Content Management Server Development

Book Description

Key Features

  • Learn directly from recognized community experts
  • Extensive coverage of the Publishing API (PAPI)
  • Get Sharepoint and MCMS working together
  • InfoPath, RSS and hot topics covered

Book Description

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.

What you will learn

  • Extensive coverage of the Publishing API (PAPI)
  • Managing Channels and Postings with the PAPI
  • Managing Templates, Template Galleries, Resources, and Users with the PAPI
  • Getting Sharepoint and MCMS to work together
  • Publishing content between MCMS and SharePoint
  • Preparing postings for search indexing
  • Creating Sharepoint Web Parts to display MCMS data
  • Creating powerful custom Placeholder Controls
  • Adding validation to Placeholder Controls
  • Combining InfoPath, Web Services and MCMS's robust content repository
  • Using RSS to syndicate content from your site, and display content from other sites
  • Staging static versions of your pages
  • A further 60 pages of invaluable MCMS tips and tricks

Who this book is for

This book is written for developers who want to the skills to fully exploit the power of MCMS and SPS. The book presumes a working knowledge of MCMS, the .NET Framework and familiarity with the C# language. All the code examples are in C#.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Advanced Microsoft Content Management Server Development
    1. Table of Contents
    2. Advanced Microsoft Content Management Server Development
    3. Credits
    4. About the Authors
      1. Shared Acknowledgements
    5. About the Reviewers
    6. Introduction
      1. What This Book Covers
      2. What You Need for This Book
      3. Conventions
      4. Reader Feedback
      5. Customer Support
        1. Downloading the Example Code for the Book
        2. Errata
        3. Questions
    7. 1. Building CMS Explorer
      1. A Central Administrative Tool: CMS Explorer
      2. Creating the Workspace
      3. The Four MCMS Publishing Modes
        1. Determining the Current Publishing Mode
        2. Changing the MCMS Publishing Mode
          1. The Ugly URL Querystring Specifies the Publishing Mode
          2. Toggling Modes with CmsHttpContext
          3. Toggling Modes with CmsApplicationContext
          4. Adding Querystring Parameters to the URL with CmsHttpContext.PropagateParameter()
      4. Specifying the Parent Container
      5. Rendering Collections in a DataGrid
        1. Displaying Only Selected Properties in the DataGrid
          1. Considerations for Template Galleries and Resource Galleries
        2. Adding Custom Columns to the DataGrid
        3. Building an Edit Menu
        4. Building the Toolbar
          1. The Up Button
          2. The Refresh Button
          3. The DropDownList
          4. The Channels Button
          5. The Templates Button
          6. The Resources Button
        5. The Completed User Interface
      6. Using Reflection to List Properties and their Values
      7. Updating Property Values
      8. Summary
    8. 2. Managing Channels and Postings with the PAPI
      1. Managing Channels and Postings
        1. Creating Channels
          1. Validating Names
          2. Testing the Create Channel Dialog
      2. Creating Postings
        1. Connected Postings
      3. Copying Postings
      4. Moving Postings
      5. Summary
    9. 3. Managing Templates, Template Galleries, and Resources
      1. Managing Template Galleries and Templates
        1. Creating Template Galleries
        2. Creating Templates
          1. Submitting the Template
          2. Creating Custom Property Definitions
          3. Creating Placeholder Definitions
          4. Creating Connected Templates
        3. Copying Templates
        4. Moving Template Galleries and Templates
      2. Managing Resources
        1. Creating Resources
        2. Replacing Resources
      3. Deleting Objects
      4. Summary
    10. 4. Preparing Postings for Search Indexing
      1. Influencing Search Engines with the ROBOTS META Tag
        1. The RobotMetaTag Control and Channel Rendering Scripts
      2. Outputting META Tags
        1. Using <%= %> within Template Files
        2. Pulling META Tag Content from Custom Properties
          1. Using Literal Controls
          2. Overriding the Render Method of a Web User Control
      3. Configuring Templates to Allow Postings to Return Accurate Last Modified Time
        1. Dealing with Output Caching
      4. Increasing Search Accuracy by Generating Search Engine Specific Pages
        1. Interrogating the User Agent
        2. Hiding Navigational Elements
        3. Creating a Posting/Channel Listing User Control
      5. Tips for Search Engine Optimization
        1. Design and Navigation Considerations
          1. Frames
          2. Flash Content
          3. Image Maps and JavaScript Navigation
        2. Adding Details to the Title Tag
        3. Using META Tags
          1. Choosing your Keywords and Density
          2. Description
      6. Summary
    11. 5. Searching MCMS with SharePoint
      1. MCMS Search Options
      2. Microsoft SharePoint Portal Server Search
      3. Preparing the MCMS Site for Indexing
        1. Disabling Channel Names to Host Header Names Mapping
        2. Assigning a Search Account
        3. Enable Guest Access for Tropical Green
        4. Output Caching and Last-Modified Dates of Postings
        5. The Connector SearchMetaTagGenerator Control
      4. Configuring SharePoint Portal Server Search
        1. Creating a New Content Source
          1. Creating a Content Source with the MCMS Connector Utility
            1. Creating a New Search Scope
          2. Creating a Content Source Manually
        2. Search Rights for the MCMS Application Pool Account
      5. Adding a Search Page to the MCMS Site
        1. Searching with the MCMS SharePoint Connector
        2. Building a Custom Search Implementation
          1. About the SharePoint Portal Server Query Service
          2. Building a Search Input Control
          3. The Advanced Search and Results Page
            1. Building the Microsoft SQL Full-Text Query
            2. Building the MSQuery XML String
      6. Summary
    12. 6. Publishing Content Between MCMS and SharePoint
      1. Using MCMS and SharePoint Together
      2. Joining MCMS and SharePoint in a Single Solution
      3. Using SharePoint to Display MCMS Content
        1. The MCMS Connector for SharePoint Technologies
          1. Installing the MCMS Connector Web Parts
          2. MCMS Page Listing Web Part
            1. A Custom View for the MCMS Page Listing Web Part
          3. The MCMS Pages in Production Web Part
          4. The MCMS Pages Waiting for Approval Web Part
        2. Limitations of the MCMS Connector for SharePoint
      4. Using MCMS to Display SharePoint Content
        1. The MCMS Connector for SharePoint Technologies
          1. Using the SharePoint Document Placeholder
        2. Limitations of the MCMS Connector for SharePoint
          1. A Placeholder Control to Display SharePoint List Contents
      5. Summary
    13. 7. Building SharePoint Web Parts
      1. The SharePoint MCMS Navigation Control
      2. Preparing the Development Environment
      3. Creating the Web Part Project
      4. Creating the Web Part
      5. Defining Custom Properties for the Web Part
      6. Developing Custom Properties for the Web Part
      7. Building the Data Layer
      8. Building the Presentation Layer
      9. Web Part Deployment
        1. Preparing the Web Part Description (.DWP) File
        2. Preparing the Web Part Manifest File
        3. Creating the Deployment Project
        4. Executing the Deployment
        5. Right-Click Deployment of Web Part CAB Files
      10. Adding Our Web Part to a Page
      11. Configuring the Web Part
      12. Debugging the Web Part
      13. Summary
    14. 8. Useful Placeholder Controls
      1. Before We Begin
      2. A Date-Time Picker Placeholder Control
        1. The DateTimePickerPlaceholderControl Class
        2. Loading the Controls for Authoring
        3. Retrieving Saved Content
        4. Saving the Date and Time
        5. Validating the Date and Time
        6. Presenting the Selected Date and Time
        7. The Date and Time Picker Dialog
        8. Adding the Placeholder Control to a Template File
      3. A Placeholder Control for Multiple Attachments
        1. The MultipleAttachmentPlaceholderControl Class
        2. Generating the Table of Attachments
        3. Deleting Attachments
        4. Reusing the Insert Attachment Dialog
          1. Calling the Dialog
          2. Returning Values from the Dialog
            1. Client-Side Script for All Types of Placeholder Controls
            2. Passing Attachment Information to the Placeholder Control
            3. Generating the WBC_setThinEditIEAttachment() Method
        5. Saving the List of Attachments
        6. Retrieving Saved Content
          1. Preparing Arrays for Storing Information about the Attachments
          2. Retrieving Previously Saved XML
          3. Extracting Information about the Attachments from the XML
          4. Populating the Table with the Saved Attachments
        7. Displaying the Attachments
        8. Using the MultipleAttachmentPlaceholderControl
      4. An Image Rotator Placeholder Control
        1. The ImageRotatorPlaceholderControl Class
        2. Specifying the Resource Gallery
        3. Loading the TextBox
        4. Saving the Selected Resource Gallery Path
        5. Loading Previously Saved Values
        6. Rotating Images Randomly
        7. Using the Image Rotator Placeholder Control
      5. A Placeholder Control to Store All HTML Tags
        1. The AllTagsHtmlPlaceholderControl Class
        2. Saving All Kinds of Tags
          1. Escaping Tags
          2. UnEscaping Tags
        3. Loading Content for Authoring and Presentation
        4. Using the AllTagsHtmlPlaceholderControl
      6. A DataGrid Placeholder Control
        1. The DataGridPlaceholderControl Class
        2. Loading the DataGrid for Authoring
        3. Retrieving Placeholder Content
        4. Saving the Modified XML
        5. Adding a Row
        6. Deleting a Row
        7. Editing a Row
        8. Updating a Row
        9. Displaying the XML in Presentation Mode
        10. Using the DataGrid Placeholder Control
        11. Turning Off the Leave Warning Alert
      7. Summary
    15. 9. Validating Placeholder Controls
      1. Limitations of the ASP.NET Validation Controls
      2. The MCMSValidators Project
      3. Validating the HtmlPlaceholderControl
        1. Retrieving the Current Value of the HtmlPlaceholderControl
        2. Checking for an Empty HtmlPlaceholderControl
          1. Matching Tags with Regular Expressions
        3. Building the Required HTML Placeholder Validator
          1. Overriding the ControlPropertiesValid() Method
          2. Overriding the OnPreRender() Method
          3. Overriding the AddAttributesToRender() Method
          4. Overriding the EvaluateIsValid() Method
        4. Adding the Custom Validator to the Template File
      4. Preventing Pages with Invalid Content from Being Saved
        1. Save New Page with Validation
        2. Save and Exit with Validation
        3. Save with Validation
        4. Adding the Modified Buttons to the Authoring Console
      5. Implementing Server-Side Validation
        1. The HtmlPlaceholderControl with Validation
        2. The RequiredHTMLPHValidator with Server-Side Validation
          1. Checking the Length of Text Entered
          2. Canceling the Save Operation
      6. Validating the SingleImagePlaceholderControl
        1. Retrieving the Value of the SingleImagePlaceholderControl
        2. Checking for an Empty SingleImagePlaceholderControl
        3. The RequiredImagePHValidator
      7. Validating the SingleAttachmentPlaceholderControl
        1. Stored Values of the SingleAttachmentPlaceholderControl
        2. Checking for an Empty SingleAttachmentPlaceholderControl
        3. The RequiredAttachmentPHValidator
      8. Summary
    16. 10. Staging Static Pages
      1. Site Stager in Brief
        1. Installing Site Stager
        2. Defining the Destination User
        3. The Site Stager Administration Dialog
        4. Creating a Staging Profile
        5. Running a Job
        6. Scheduling a Profile
        7. Deleting a Profile
      2. The ASP.NET Stager Application
        1. The DotNetSiteStager Project
        2. Configuring Stager Settings
        3. Recording Messages to a Log File
        4. Logging in as the ‘Stage As’ User
        5. Revealing Hidden Postings
        6. Staging Channels and Postings
          1. Getting the Start Channel
          2. Iterating Through the Channel Tree
          3. Issuing an HTTP Request
          4. Getting Responses and Creating Files
        7. Staging Attachments
          1. Collecting a List of Attachments to Download
          2. Scanning Pages for Attachments
          3. Storing Information about the Attachments to a List
          4. Enhancing the Searches.GetByUrl() Method
          5. Downloading the Attachments
        8. Running the DotNetSiteStager
        9. Suggested Improvements
      3. Summary
    17. 11. InfoPath with MCMS Web Services
      1. Project Overview
      2. What are ASP.NET Web Services?
      3. Creating the MCMS Web Service Project
      4. Creating the Business Layer
        1. Maintaining Custom Properties
        2. Creating the Lightweight Template Class
        3. Maintaining Placeholder Values
        4. Maintaining Placeholder Collections
        5. Creating an Object to Maintain Postings
      5. Creating the ASP.NET Web Service
        1. The GetPosting() Web Method
        2. Configuring IIS Security
        3. Testing the Web Service
        4. The SavePosting() Web Method
      6. Preparing the InfoPath Environment
      7. Creating the InfoPath Document
      8. Creating the Controls in InfoPath
      9. Cleaning up the Generated Form
      10. Testing the InfoPath Form
        1. Saving the InfoPath Form
      11. Possible Enhancements to this Solution
      12. Summary
    18. 12. MCMS and RSS
      1. Looking Ahead
      2. The Structure of an RSS Feed
      3. Providing Content as an RSS Feed
        1. Creating the RSS Feed
        2. Defining Global Settings in the Web.config
        3. Testing the RSS Feed
        4. Testing the RSS Feed in an Aggregator
      4. Aggregating an RSS Feed into MCMS
        1. Creating the Placeholder Control
        2. Setting up the Authoring Interface
        3. Retrieving and Parsing the RSS Feed
        4. Rendering the RSS Feed in Presentation Mode
        5. Adding the Control to a Template
          1. Creating the Placeholder Definition in the Template
          2. Adding the RSS Reader Placeholder to the Template
          3. Testing the Template
        6. Possible Enhancements
          1. Enhancements to the RSS Feed Generator
          2. Enhancements to the RSS Aggregator Placeholder Control
      5. Summary
    19. 13. Essential How-Tos, Tips, and Tricks
      1. Tip #1: How to Revert a Posting to a Previous Version
        1. The Revert Page to Previous Version Dialog
          1. How to Get and Sort a List of Page Revisions
          2. Programming the Button that Triggers the Page Reversion Process
            1. Accessing the ItemCommand() Event Handler of the DataGrid
            2. Retrieving the Selected Revision
            3. Triggering the Page Reversion Process
            4. Rolling Back When the Reversion Process is Unsuccessful
            5. Refreshing the Parent Window
          3. Copying Content from One Placeholder to Another
          4. Copying Custom Property Values
        2. Adding the New Action to the Web Author Console
      2. Tip #2: How to Change a Posting’s Template
        1. The Change Template Dialog
        2. Creating a Copy of the Posting Based on the New Template
        3. Adding the Change Template Button to the Web Author Console
      3. Tip #3: How to Build a Recycle Bin
        1. Creating a Recycle Bin Channel
        2. Deleting the Posting
        3. Restoring the Posting
          1. The Recycle Bin Dialog
          2. Listing All Deleted Items in the Recycle Bin
          3. Restoring a Deleted Item
          4. Permanently Deleting Items from the Bin
          5. Adding the Recycle Bin Button to the Web Author Console
      4. Tip #4: How to Deal with Links to Deleted Resources
        1. What Happens When Resources Used by Postings Get Deleted
        2. Detecting When Placeholder Content has Changed
        3. Identifying Links to Deleted Resources
        4. Removing Links from ImagePlaceholders and AttachmentPlaceholders
        5. Removing Links from HtmlPlaceholders
          1. Handling Images
          2. Handling Attachments
      5. Tip #5: How to Generate a Resource Dependency Report
        1. The FindResources Project
        2. Walking the Tree
        3. Scanning Placeholder Content for Resources
        4. Generating the Report
      6. Tip #6: How to Update Posting Properties Directly from a Template File
        1. Designing the Web User Control
        2. Getting the Posting’s Display Name
        3. Hiding the Web User Control in Published Mode
        4. Capturing the Posting’s Save Event
      7. Tip #7: How to Re-write Unfriendly URLs as Friendly URLs
        1. An HttpModule to Intercept All Requests
        2. Converting Unfriendly URLs to Friendly URLs
        3. Handling Unfriendly URLs Caused by Postbacks
        4. Activating the HttpModule
      8. Tip #8: How to Export Resource Gallery Items using the Site Deployment API
        1. The SDAPIResourceExport Project
        2. Setting Export Parameters
        3. Collecting Resources
        4. Creating the Service Posting
        5. Starting the Export Process
      9. Tip #9: How to Configure the Position and Size of the Web Author Console Dialogs
      10. Tip #10: How to Get Frames and IFrames to Work Correctly in a Template File
        1. When the Frame or IFrame Links to Another Site
        2. When the MCMS Page is Embedded Within a Frame or IFrame of Another Website
      11. Summary
    20. A. Setting up MCMS and SPS on the Same Virtual Server
      1. SharePoint and MCMS-Managed URLs
      2. Creating a New Virtual Server
      3. Creating a New SharePoint Portal
      4. Creating a New MCMS Web Entry Point
      5. Configuring SharePoint to Allow MCMS Requests
      6. Trust Settings for MCMS Web Applications
      7. Verifying that SharePoint and MCMS are Functioning Correctly
      8. Summary
    21. B. MCMS Connector for SharePoint Technologies
      1. Installation
      2. Leveraging SharePoint Portal Search within an MCMS Site
      3. Integrating MCMS Content into a Portal site
      4. Publishing SharePoint Document Library Documents within an MCMS Site
      5. Additional Utilities Included
      6. MCMS Connector Sample Data, Project, and Documentation
      7. Summary
    22. C. Installing the Tropical Green Website
      1. Downloading the Sample Code
      2. Creating the TropicalGreen Web Application
        1. Adding the CMS Virtual Directory
      3. Importing the Site Deployment Object File
      4. Creating the Guest Account
      5. Checking the Server Configuration
      6. Setting www.tropicalgreen.net to Execute Locally
      7. Configuring the Browser to Bypass the Proxy
      8. Testing the Tropical Green Website
    23. Index