Click to Rate and Give Feedback
MSDN
MSDN Library
Technical Articles
 Best Practices: Developing Solution...
Microsoft Content Management Server 2002 Technical Articles
Best Practices: Developing Solutions Using the Content Management Server 2002 Connector for SharePoint Technologies
 

Charles Morris
Microsoft Corporation

March 2004

Applies to:
   Microsoft® Content Management Server 2002
   Microsoft Office SharePoint™ Portal Server 2003
   Microsoft Windows® SharePoint Services

Summary: Learn best practices for developing with the Microsoft Content Management Server (MCMS) 2002 Connector for SharePoint Technologies. In addition, explore specific topics on using the MCMS Page Listing Web Part, document library placeholder, and search integration. (21 printed pages)

Contents

Introduction
General Best Practices
Using the MCMS Web Parts
Adding SharePoint Documents to MCMS Sites
Using SharePoint Portal Server Search with MCMS Sites
Improving Performance
Conclusion

Introduction

As businesses evolve, streamlining processes across organizational boundaries becomes much more important. For example, you might have a solution based on Microsoft® Windows® SharePoint™ Services and Microsoft Office SharePoint Portal Server 2003 that helps your organization collaborate on the development of editorial content. Alternatively, you might develop a solution based on Microsoft Content Management Server 2002 (MCMS) that helps your organization publish content to various Web sites. Problems can arise if the process of transferring the content from the collaboration environment to the Web publishing environment becomes disjointed and error-prone. As a developer, you are often the one who has to help improve the process.

Using the Microsoft Content Management Server 2002 Connector for SharePoint Technologies software and documentation, you can integrate MCMS with Windows SharePoint Services and SharePoint Portal Server 2003 to streamline your processes.

To help guide your development efforts, this article offers developer best practices for implementing the MCMS Connector for SharePoint Technologies. The functionality of the MCMS Connector for SharePoint Technologies can be classified into three broad categories:

  1. Publishing MCMS content on SharePoint sites.
  2. Publishing document or form library content from Windows SharePoint Services or SharePoint Portal Server to MCMS sites, and scheduling automatic updates so that the MCMS sites match the library content.
  3. Using the search engine in SharePoint Portal Server to crawl and search the contents of an MCMS Web site for inclusion in a content index.
    Note   The guidance and sample code in this article assumes that you have basic MCMS, Windows SharePoint Services, and SharePoint Portal Server 2003 usage and development knowledge.

For more information, see MCMS 2002 Connector for SharePoint Technologies Help and the article Best Practices: Implementing a Sample Scenario Using the Content Management Server 2002 Connector for SharePoint Technologies.

General Best Practices

So just how do you get started, now that you understand the capabilities of the MCMS Connector for SharePoint Technologies and have some project requirements?

This section describes how you set up MCMS Connector for SharePoint Technologies for multiple developers, suggests security considerations for your development, and offers sample data that you can use to give you a head start in creating your own project.

Setting Up a Multi-Developer Environment

Having a stable and efficient development process is crucial to developing projects in teams with MCMS Connector for SharePoint Technologies. Because the MCMS Connector for SharePoint Technologies is an integration of MCMS and SharePoint Portal Server, which are both based on Microsoft ASP.NET, your development environment should reflect best practices for managing ASP.NET development projects.

Following is a basic approach to establishing your multi-developer environment.

  1. Set up MCMS. For more information, see the article Microsoft Content Management Server 2002 Developers Guide.

    After you set up MCMS, you have the following:

    • A central build server computer running MCMS, Microsoft Visual Studio® .NET, and Microsoft Visual SourceSafe® server.
    • Client computers for the developers, running MCMS and configured to use the shared Microsoft Visual SourceSafe repository on the build server.
    • An MCMS-enabled ASP.NET project checked into Visual SourceSafe and synchronized on all developer computers.
    • Mapped IIS_CMS directories on the developers' client computers that downloaded the source from Visual SourceSafe.
  2. Install SharePoint Portal Server on the build server computer. For more information, see the article Installing SharePoint Portal Server 2003 on a Server with Windows SharePoint Services on Microsoft TechNet.
    Note   This computer needs to be configured to run all components (Web, index, search, and job components) for SharePoint Portal Server 2003.
  3. Install MCMS Connector for SharePoint Technologies on the build server. For more information, see the Microsoft Content Management Server 2002 Connector for SharePoint Technologies Installation Guide.
  4. Install each developer computer as a front-end Web server for SharePoint Portal Server, sharing databases with those created during the initial portal creation in step 2. For more information, see the topic "Configure additional front-end Web servers" in the section "Deploying a Large Server Farm" (Sample Deployment Scenarios) in the Microsoft Office SharePoint Portal Server 2003 Administrator's Guide.
  5. Install and configure MCMS Connector for SharePoint Technologies on each developer computer as described in the Microsoft Content Management Server 2002 Connector for SharePoint Technologies Installation Guide.
  6. Enable the shared ASP.NET project to work with the MCMS Connector for SharePoint Technologies using the process described in "Using the Sample Data" later in this article.
  7. Configure excluded paths and required user accounts on one of the computers as described in the Microsoft Content Management Server 2002 Connector for SharePoint Technologies Installation Guide.

Now you can start creating custom views to the MCMS Page Listing Web Part, building MCMS templates that leverage the document library placeholder, or building pages that integrate search. You can build and test integrated pages on individual developer client computers, and then check them into the build server according to standard development processes.

Note   The configuration described in this section is intended as guidance for typical scenarios. In some cases, you might need a variation; for example, if your development team is mobile, it may not be realistic to have a shared set of SQL Server™ databases. In this case, consider setting up a stand-alone development environment within a Microsoft® Virtual PC 2004 environment that you can easily replicate for new members of the team. The downsides to this approach are increased hardware requirements and increased complexity in keeping a central copy of the build up to date.

Considering Security

From a security perspective, consider the following when you set up MCMS Connector for SharePoint Technologies:

  • Enable Integrated Windows Authentication in the Microsoft Internet Information Services (IIS) settings of the Web site that hosts the MCMS and SharePoint sites to help ensure users are always authenticated. Do not enable anonymous access because you do not have access to the MCMS Web Parts or MCMS Web Author without being authenticated.
  • Configure the ASP.NET project to use Microsoft Windows authentication in the web.config file as described in the Microsoft Content Management Server 2002 Connector for SharePoint Technologies Installation Guide.
  • Add developers into groups in the Template Designer role using the MCMS Site Manager to enable them to create and edit templates using Visual Studio .NET.
  • Add developers who need to create user groups to test their work to the Administrators role in MCMS. By restricting the number of MCMS administrators, you can help ensure that developers work within specific areas of the site while maintaining control over the user groups being created.
  • Add developers to the Reader site group to the SharePoint site. Depending on the nature of development tasks, you can grant greater permissions, for example, you can add a developer who adds or configures Web Parts to the Web Designer site group.

Using the Sample Data

When you create MCMS templates that share the SharePoint Portal Server look and feel, start with a copy of a sample template and then add your custom layout and functionality.

Note   While this section is about using the sample data, you can apply all of the steps described to any new or existing MCMS ASP.NET application.

What is the Sample Data?

The sample data installed with the MCMS Connector for SharePoint Technologies consists of sample MCMS templates and an associated ASP.NET project. There is also sample content to give you an idea of how the templates might be used. This section walks through the code in the sample data. You can find the templates in the path /Templates/CmsSharePointConnector within the Template Gallery structure, while the ASP.NET project containing the template files and associated resources and controls is installed by default to MCMSInstallDirectory\Server\Sample Data\CmsSharePointConnector.

The templates in the sample data illustrate several concepts, as shown in the following table.

Table 1. Templates to use and what they create

Use this To create
News or Press Release templates within the Internal template gallery and their associated template files. An MCMS template with the look and feel of a SharePoint Portal Server page.
Connected templates for News or Press Releases (and associated template files) in the Internal and External template galleries. "Internal" and "external" versions of templates.
News or Press Release templates within the Internal template gallery, and their associated template files. Short Title and Summary Image placeholders with the MCMS Page Listing Web Part.
InternalSearch.aspx or ExternalSearch.aspx pages. A search page using SearchInputControl.
InternalSearchResults.aspx or ExternalSearchResults.aspx pages. Search results pages using SearchResultControl.

One of the key concepts the sample data illustrates is the ability to create MCMS templates that look like they are SharePoint Portal Server pages. In this way, you can provide a seamless user experience so that users do not feel like they are leaving one site and entering another when browsing between SharePoint Portal Server pages and MCMS pages.

To make MCMS pages look like SharePoint Portal Server pages, you insert SharePoint Portal Server controls into MCMS templates for header and navigation, while using the main content area for MCMS placeholder controls.

The following figure shows an MCMS page with the default SharePoint Portal Server look and feel.

Figure 1. MCMS page that looks like SharePoint Portal Server

The sample data also shows how to publish an external version of the content that is designed with the Internet-facing corporate branding. You use MCMS connected pages and templates to create a second layout so that content is shared with the internal version. However, if the content and/or properties style sheets to be applied are different for internal and external versions, you do not use MCMS connected pages. The style sheets and transformed HTML are stored within the placeholder and connected pages share the underlying placeholder data. For an example, see the article Best Practices: Implementing a Sample Scenario Using the Content Management Server 2002 Connector for SharePoint Technologies.

You deploy the Internet site to a separate read-only production server farm. Because the Internet templates do not use SharePoint Portal Server controls, and because the document library placeholder is not used for authoring, you do not need to install SharePoint Portal Server on those servers. You can install SharePoint Portal Server on separate servers for search and query processing.

Creating/Upgrading a Project Based on the Sample Data

We can use the sample project provided with the MCMS Connector for SharePoint Technologies for guidance when creating a new ASP.NET project or upgrading an existing one.

Note   If you are creating a new project, use the Content Management Server Project template available from Visual Studio .NET.

After an MCMS-enabled ASP.NET project is available, you can take the following steps. If you are using a multi-developer setup, one developer can make these changes and check them in for the rest of the developers to use.

  1. Add references to the Microsoft.SharePoint, Microsoft.SharePoint.Portal and System.EnterpriseServices assemblies. This provides access to the SharePoint Portal Server navigation and other dynamic properties on MCMS templates.
  2. Copy the <trust level ="Full" originUrl="" /> declaration from the sample's web.config file into your own if necessary, as well as the three <add assembly...> tags which refer to Microsoft.ContentManagement.SharePoint assemblies.
  3. Copy user controls from the sample project into your own project. The following table lists the controls (and corresponding code-behind files) that you can copy and add to your project.

    Table 2. List of controls and corresponding code-behind files for project use

    Control Description
    /Console/CmsSpsConsole.ascx An MCMS Web Author console that is designed to match the SharePoint Portal Server look and feel and fits into the left navigation column. It does not provide any more functionality than the default MCMS console.
    /UserControls/HeadTags.ascx (optional) A control that outputs the value of channel custom properties into individual <meta> tags. It also contains the MCMS control responsible for outputting indexing properties (RobotMetaTag).
    /UserControls/PostingDescription.ascx (optional) A control that enables the author to edit the description of the MCMS page from within the authoring view, instead of having to open the Page Properties dialog box.

    Next, you can create templates based on the ones in the sample data in your project.

  4. In Visual Studio .NET, copy the template file and code-behind from the sample data and add it into your project using the Add Existing Item command in Visual Studio .NET.
  5. Rename the template according to its new use.
  6. Modify the namespace definition and class name to the new template file name in the code-behind file and then modify the <Inherits> tag within the template file to match.
  7. In the code-behind file, remove the code from the Page_Load method and the initialization of the LocalizationResourceManager variable in the OnInit method.
  8. In the template file, within the table cell with the class ms-bodyareaframe, remove the layout of the sample data template file by deleting the <table>...</table> tag.
  9. Add your own layout, content and placeholders to the body area of the page.
  10. Optionally, you can add the HeadTags and PostingDescription user controls to the template file if you want to use their functionality.
  11. Add an MCMS template with placeholder definitions and then bind the template file to the template, as you do when creating any MCMS template.
    Note   If you want to keep the layout of the SharePoint Portal Server page, you keep the entire body area.

Working with Customized SharePoint Sites

If your SharePoint site has a customized look and feel that you want to bring to the MCMS templates, keep three considerations in mind:

  • You can achieve many look and feel changes by customizing the style sheets on the SharePoint site. You can transfer these changes into MCMS templates by linking them into the ASP.NET template files.
Note   Be sure that the <link> tag for the custom style sheet comes after the default tag, because the selectors in the style sheet applied last are used.
  • You can customize the navigation structure of the SharePoint site. These changes are automatically updated in MCMS templates with the SharePoint Portal Server structure because the MCMS templates use SharePoint Portal Server controls to generate the links.
  • You can establish a process that ensures that changes are built and tested on both the SharePoint site and MCMS templates.

For information about customizing the navigation of a SharePoint site, see "Change the portal site structure" in the Microsoft Office SharePoint Portal Server 2003 Administrator's Guide.

For information about customizing the design of a SharePoint site, see the article Using FrontPage 2003 to Design Customized Web Sites Created with Microsoft Office SharePoint Portal Server 2003.

Using the MCMS Web Parts

You can use the MCMS Web Parts that are part of the MCMS Connector for SharePoint Technologies to enable the portal site to display MCMS content as well as personalized information relevant to the creation and approval of MCMS pages. To customize the MCMS Page Listing Web Part, you can do the following:

  • Design the channel structure to change what the MCMS Page Listing Web Part displays.
  • Add a title and summary image to the listings in the Web Part.
  • Create customized views for the MCMS Page Listing Web Part beyond the standard three views that are enabled by default.

Designing Channel Structure for the MCMS Page Listing Web Part

In some cases, you may want to design the channel structure with the MCMS Connector for SharePoint Technologies in mind.

Note   It is not necessary to modify the MCMS channel structure when using the MCMS Page Listing Web Part.

Because the Page Listing Web Part lists all of the pages within a channel, the list can grow very large if there are many pages. Although the Web Part provides automatic paging, there are cases where it is desirable to keep a smaller number of pages within the listing. For example, you can use the Page Listing Web Part to display the latest news headlines by creating a "News Headlines" channel and channels for older stories. In this scenario, users create new pages in the "News Headlines" channel. A workflow event handler automatically moves old pages to other channels. In this example, you control the number of pages within the channel, which gives you greater control over the performance and usability of the Web Part.

The solution described in the article Best Practices: Implementing a Sample Scenario Using the Content Management Server 2002 Connector for SharePoint Technologies illustrates another approach using connected pages to solve this issue.

Adding Titles and Summary Images to the MCMS Page Listing Web Part

If the SharePoint portal uses the MCMS Page Listing Web Part, you can enable users to associate a custom image and title with the MCMS pages within the listing. This provides greater flexibility to content contributors as well as a richer experience for portal users.

The MCMS Page Listing Web Part includes three different views: the Basic view, the Summary view, and the Detailed view. By default, each view uses the DisplayName property of the MCMS page as the link to the page. Adding a Short Title field enables content contributors to enter a specific title for the page link independent of the display name. This is useful because the width available to the links within the Web Part is often wider than the width of dynamic MCMS navigation that uses the Display Name field.

If you use the Summary view of the Web Part, adding a Summary Image field allows content contributors to provide a visual hook to increase the richness of the listing.

The following figure shows the custom fields displayed within the Summary view.

Figure 2. Short Title and Summary Image in MCMS Page Listing Web Part

To implement this functionality, you add placeholders named Short Title and Summary Image to the templates of any MCMS page you are listing within the MCMS Page Listing Web Part. The Short Title placeholder is bound to an HtmlPlaceholderDefinition and the Summary Image placeholder is bound to an ImagePlaceholderDefinition.

Consider the following points when using this capability:

  • If the template has a Short Title placeholder, the MCMS Connector for SharePoint Technologies always uses the value of the placeholder. To avoid blank titles, you can require that the placeholder is filled by using the MCMS workflow events. For more information about using workflow events, see "Writing Workflow Event Handlers" in the Microsoft Content Management Server 2002 Developers Guide.
  • Because the Description property of the MCMS page is also displayed by the Summary view, you can make it easier for content contributors to edit the property by allowing them to edit it from within the authoring view of the page instead of having to navigate to the Page Properties dialog box. To do this, use the PostingDescription.ascx user control in the sample data.
  • To improve consistency on the site, consider creating MCMS resource galleries dedicated for summary images. Ideally, summary images are 60 x 60 pixels or smaller and less than 4 KB.
  • Train MCMS content contributors to use and review these special placeholders. To make it easier for review, you can insert a section on the MCMS template that displays the contents of the Short Title and Summary Image placeholders while the page is in Unpublished mode. For more information about MCMS modes, see "Working with MCMS Modes" in the Microsoft Content Management Server 2002 Developers Guide.

Creating Custom Views for the Page Listing Web Part

The MCMS Connector for SharePoint Technologies provides the ability to create custom views for the MCMS Page Listing Web Part. You create custom views by creating a .NET class that implements the IPageListing interface found in the Microsoft.ContentManagement.SharePoint.Dialogs assembly. After the custom views are deployed into the Global Assembly Cache, you make changes to the web.config file so that these views are available to the SharePoint site.

For more information about creating custom views, see "Customizing Views for MCMS Page Listing Web Part" in MCMS Connector for SharePoint Technologies Help.

Custom views can be used to display specific properties of the MCMS pages that are shown within the Page Listing Web Part views as well as modify how the pages are laid out. For example, you can create a view similar to the detailed view showing values held in MCMS custom properties for the page.

When building custom views, consider the following:

  • Because the Web Part uses the MCMS Publishing API, an assembly containing custom views must be deployed to servers running MCMS 2002.
  • Build custom views in a project separate from the MCMS Web project to provide greater modularity and flexibility in deployment options.
  • You can create a maximum of three custom views for the MCMS Page Listing Web Part.
  • Inform users what each custom view represents because the views cannot be renamed from Custom1, Custom2, and Custom3 in the Web Part Tool Pane selection drop-down.
  • If you display values in the page listing that may contain incorrect or empty data, such as custom property values or data held in placeholders, be sure that your code handles cases where that field is not available. Alternatively, consider customizing the MCMS workflow to ensure that those cases are prevented.

For more information about creating custom Web Part views, see "Creating Custom MCMS Page Listing Web Part Views" in the MCMS Connector for SharePoint Technologies Tutorials.

Adding SharePoint Documents to MCMS Sites

MCMS Connector for SharePoint Technologies enables content contributors to add document library content to MCMS pages using the Web Author. The basic use of this feature enables users to add documents in SharePoint libraries to MCMS Web pages as attachments. This section looks at strategies for enabling XML-based content authoring and metadata publishing using the same feature.

Enabling XML-Based Content Authoring

By using MCMS Connector for SharePoint Technologies with Microsoft Office InfoPath™ 2003, you can enable XML-based content authoring for MCMS.

Note   Users can create XML-based content in Microsoft Office Word 2003; however, Word does not provide the same level of control over the schema as InfoPath, nor the same strong integration with SharePoint Form Libraries.

There are numerous advantages to using XML-based authoring over HTML-based authoring:

  • Content can be managed as XML within SharePoint and reused in MCMS and other applications.
  • Content is stored in MCMS in a structured and reusable format and can be reused easily in other applications.
  • You can separate the content collaboration and Web content publishing processes, the first managed by SharePoint Portal Server and the second by MCMS.
  • Users can use the rich text formatting and data validation capabilities of InfoPath.

When a user selects an XML-based document by using the document library placeholder, the content is stored within the placeholder in the ContentXml property. The user also selects an Extensible Stylesheet Language (XSL) style sheet from choices you set. If the document from the document library is not XML (for example, .doc, .xls, and so on), the content is stored as a binary object in the MCMS Content Repository.

Note   Properties retrieved from the document library of any type of document, XML-based or otherwise, are stored as XML in MCMS.

To develop and deploy a solution with XML-based authoring

  1. Design the schema for the structured content.
  2. InfoPath form designers design a form for content input including data validation to ensure that the correct content is entered.
  3. Create the XSL style sheet to transform the content into HTML as a separate view in InfoPath. Make the style sheet available as Content Style Sheets as described in "SharePoint Library Placeholder Style Sheet Catalogs" in MCMS Connector for SharePoint Technologies Help.
  4. InfoPath form designers publish the template into SharePoint form libraries.
  5. Use the Document Updater tool to synchronize document library changes into the MCMS site.

After you deploy the solution, users can create content.

To create content

  1. Users develop the content within the SharePoint form library, using the collaboration features and Microsoft Office System integration.
  2. Users set a property on the document within the document library to indicate the document is ready to publish, for example, the Status property can be set to Final. You can implement an event handler for the document library that notifies the Web publisher. For more information about implementing event handlers for a document library, see Handling Document Library Events in the Microsoft SharePoint Products and Technologies 2003 Software Development Kit.
  3. The Web publisher uses the document library placeholder within the MCMS Web Author to select and extract the content of the document. The Web publisher also selects a content style sheet to transform and display the content as HTML. You can configure MCMS-based workflow if necessary. For more information, see "Managing Site Structure and Workflow" in MCMS 2002 Help.
  4. Synchronize updates to the MCMS site using the Document Updater tool.

Enabling Document Metadata Publishing

In addition to displaying content, the MCMS Connector for SharePoint Technologies also provides the ability to publish document properties from a document library on an MCMS Web site. Properties captured within SharePoint libraries can be reused within the MCMS published content to provide contextual data to help browsers understand the content, or to provide enhanced metadata for advanced search capabilities.

When a user selects a document by using the document library placeholder, the document properties are stored as XML within the placeholder. They are displayed by a Properties style sheet the user selects from among choices you set.

When you are deciding when to use document properties from a document library as opposed to MCMS custom properties to hold metadata content, consider the following:

  • Do not duplicate metadata in document properties from a document library and MCMS custom properties because the data is already replicated within the document library placeholder in MCMS custom properties.
  • If the metadata is relevant to the document content itself and is published to the MCMS Web site, use document properties in the document library. If the metadata is used for searching, use a simple control to convert the properties into meta tags. This topic is covered in detail in "Making Document Properties Available for Web Search" later in this article. If the metadata is not used for searching, then you use a property style sheet to transform the properties into HTML.
  • If the metadata is only relevant to the version of the content published on the Web, you use MCMS custom properties. You can easily search on these properties by using the SearchMetaTagGenerator control.

Creating Document Library Placeholder Style Sheets

The document library placeholder transforms the content or properties of documents retrieved from a document library using XSL. You can create custom XSL style sheets to customize how the content or properties are displayed on the page.

Develop your custom style sheets against sample XML documents that do not reside in MCMS. This is recommended because the placeholder caches the HTML resulting from the XSL transformation when the document is updated or synchronized to avoid the performance penalty of calculating XSL transformations on every page request. Simply changing the XSL style sheet on the hard disk does not refresh the HTML that is shown in the MCMS page.

To create a custom style sheet

  1. Acquire a copy of sample content or property XML by writing the value of SharePointDocumentPlaceholder.ContentXml or SharePointDocumentPlaceholder.PropertyXml to a file.
  2. Create a new XSL style sheet file.
  3. Create a simple ASP.NET page that loads the sample XML and transforms it using the XSL style sheet. You use this page to test your XSL style sheet as it is developed. For more information about transforming XML, see XSLT Transformations with the XslTransform Class in the .NET Framework Developer's Guide.
  4. To verify that the style sheet works in the MCMS template, add the style sheet to a catalog and select it from a document library placeholder.
    Note   For more information about creating content and property style sheets, see "Creating Custom Style Sheets" in MCMS Connector for SharePoint Technologies Tutorials.

When you implement an XML-based content authoring scenario using InfoPath 2003, you can use InfoPath as a designer and its ability to create multiple views. For example, you may have one view that users see while inputting data into the form, and another used to display the content for browsing.

The process for extracting the XSL style sheet from the InfoPath form (.xsn) is detailed in the topic "Content Style Sheets" in MCMS Connector for SharePoint Technologies Help. Although you can reuse much of the XSL code produced by InfoPath, you need to "extract" the relevant sections so that it can be used in the context of an MCMS template to avoid complications, such as duplicated <html> or <body> tags.

Note   Word XML schema (WordML) documents can use the default style sheet, wordnethtml.xsl, to transform the content into HTML. However, using this transformation heavily on the site can affect performance, as detailed in the "Performance Considerations" later in this article.

Configuring Style Sheet Catalogs

A style sheet catalog is an XML file containing a list of the style sheets from which users can choose a layout for a document library placeholder. By default, a document library placeholder control uses the default catalog (site-wide), unless it is overridden using the RenderingTemplateCatalogUrl property indicating a catalog designed specifically for that particular placeholder instance.

You can configure style sheet catalogs in two ways:

  • Modify the default catalog so that it is appropriate for your site. You use a default catalog if there is a set of style sheets that apply to multiple placeholder instances and templates, for example, if all documents are displayed as attachments.
  • Create custom catalogs. You use custom catalogs designed specifically for each placeholder if a specific style sheet is required by a certain document. Also, use custom catalogs to minimize the chance of a user selecting the incorrect style sheet. You can also restrict style sheets to specific SharePoint libraries.

For more information about designing and building style sheet catalogs, see the article Best Practices: Implementing a Sample Scenario Using the Content Management Server 2002 Connector for SharePoint Technologies.

Extending the Document Library Placeholder

You can extend the document library placeholder to have more control over the placeholder, for example to display both the content and properties of XML-based documents. You can also extend the placeholder to define how it displays on the page, for example to display content in the main area of the page and properties in a sidebar. You can achieve these types of customization in two ways, by accessing a placeholder in code, or by creating a custom placeholder control.

You access the placeholder in code if the behavior or layout is used only on one template. You also use this method if data in the placeholder is displayed in separate parts of the page.

To access a placeholder programmatically

  1. Within the code in the MCMS template file, hide the placeholder control for the document library in non-authoring modes by setting its Visible property to false.
  2. Insert the values of PropertiesHtml or ContentHtml into Literal controls placed appropriately on the template file.
For more information, see "Working with MCMS Modes" in the Microsoft Content Management Server 2002 Developers Guide.

You create a custom placeholder control if the layout or behavior is reused on several templates.

To create a custom placeholder control

  1. Create a class that derives from SharePointDocumentPlaceholderControl class.
  2. Override LoadPlaceholderContentForPresentation so that it displays PropertiesHtml or ContentHtml in the new layout.
  3. Override CreatePresentationChildControls so that the controls used for presentation are properly instantiated and initialized.
  4. Add the new placeholder control to an MCMS template file.

Accessing the SharePoint Library Placeholder in Code

By accessing a SharePointDocumentPlaceholder, you can get or set properties in the MCMS content repository. You may need to access the placeholder if it is necessary to retrieve and display content from an external data source based on the value of a document property. By accessing the placeholder object that holds the document data within MCMS, you can use PropertiesXML to control that behavior.

You can make bulk programmatic changes to properties on the placeholder such as updating KeepSynchronized, ContentXslRenderingTemplateUrl, or PropertiesXslRenderingTemplateUrl. As with other MCMS placeholders, to make changes to the placeholder programmatically, you must ensure that MCMS is in update mode. For more information, see Microsoft Content Management Server 2002 Developers Guide.

Note   In a file using the SharePointDocumentPlaceholder object, you need to have project references to Microsoft.ContentManagement.SharePoint.Placeholders and Microsoft.ContentManagement.RepositoryInterfaces.

The following example is from a template that has a document library placeholder named "SpsDocPh." The following code shows how to access the placeholder.

SharePointDocumentPlaceholder spsDoc =
    thisPosting.Placeholders["SpsDocPh"] as SharePointDocumentPlaceholder; 
if (spsDoc != null) 
{
    // Use SharePointDocumentPlaceholder properties and methods here
}
Note   You cannot set ContentXml, ContentHtml, PropertiesXml, PropertiesHtml because these properties are set when the user adds a document from the document library to the placeholder.

For more information, see "SharePointDocumentPlaceholder Class" in MCMS Connector for SharePoint Technologies Help.

Using SharePoint Portal Server Search with MCMS Sites

The MCMS Connector for SharePoint Technologies provides search capabilities to an MCMS site in two ways. First, it includes the server controls SearchInputControl and the SearchResultControl. You use SearchInputControl to create a text box for the search query on MCMS templates, and to provide an advanced search mode that enables property-based searches. You use SearchResultControl to create a search results template. Second, MCMS Connector for SharePoint Technologies provides a framework for index and querying standard and custom MCMS properties.

Second, MCMS Connector for SharePoint Technologies makes it possible for content contributors to use the Page Properties dialog box to set the properties Web Robots Can Crawl Links and Web Robots Can Index This Page, which determine the behavior of the index management server component for each page. To enable this behavior for content contributors, you must add the RobotMetaTag control (in the Microsoft.ContentManagement.WebControls namespace) to the <head> section of each template.

Note   By default, the RobotMetaTag control is added to new templates created in Visual Studio .NET.

Using Standard Search Controls

You can drag and drop SearchInputControl and SearchResultControl onto MCMS templates to add search functionality. Consider the following best practices:

  • Display SearchInputControl in simple or advanced mode by setting the value of the querystring parameter Mode to simp or adv. For example:
    ?Mode=simp
    
  • Add SearchInputControl to the same place in each MCMS template and set Mode to simp so that the control appears the same on each template.
  • Include SearchInputControl on the search results template to enable users to conduct another search while reviewing results and to serve as the destination for the Advanced Search link. On the search results page, position SearchInputControl so that it may expand in advanced mode. You set the Advanced Search link by setting the value of the SearchResultPage property of the SearchInputControl.

For more information, see "Using SharePoint Portal Server Search with Content Management Server" in MCMS Connector for SharePoint Technologies Tutorials.

Using Advanced Search Functionality

By implementing advanced search functionality, you enable users to search for MCMS pages based on property values in addition to standard free-text. This can help users to increase the accuracy and relevance of the search results that they receive. For example, a news site might store the category of each article in an MCMS custom property.

When deciding on the appropriate use of property-based search capabilities, consider the following:

  • Do not expose properties into <meta> tags unless they are required for advanced search because they add to the download size of the page.
  • Be selective in exposing properties of pages published externally because, as <meta> tags, anyone can view them even if advanced search is disabled. For example, you might not want to publish any property that exposes a user name (such as CreatedBy) because that poses a security risk.
  • Document properties extracted from the document library and stored in the PropertiesXml property of a document library placeholder are not automatically exposed for property-based search. For information about making these properties available for search, see "Exposing SharePoint Library Document Properties" later in this article.
  • Use a consistent set of custom properties across all MCMS templates to minimize the number of properties that need to be exposed by advanced search.
  • Remember that if a page does not contain the property on which a user searches, it does not appear in the search results.

To enable property-based search

  1. Add the SearchMetaTagGenerator control from the Visual Studio .NET Toolbox to MCMS templates that are included in search results. This control outputs a list of properties into the HTML source generated by the template.
  2. List which properties are searchable in the SearchPropertyCollection.xml file, installed by default in the following path: MCMS_Install directory\Server\IIS_CMS\WssIntegration.
  3. Run SearchPropertiesSetup to set the index management server component to crawl the properties listed in SearchPropertyCollection.xml for inclusion in the content index. SearchPropertiesSetup is installed by default in the following path: MCMS Connector for SharePoint Technologies Intall directory\WSS\Bin.

For more information, see "Adding Searchable Properties to an MCMS Template" in MCMS Connector for SharePoint Technologies Help.

The following table shows the standard properties SearchMetaTagGenerator adds as <meta> tags.

Table 3. Standard properties added as <meta> tags by SearchMetaTagGenerator

Property Example
CreatedBy "WinNT://domain/administrator"
CreatedDate "9/18/2003"
Description "This is a sample page"
DisplayName The display name of the page, for example "External News"
DisplayPath "/Channels/CmsSharePointConnector/External/External News"
ExpiryDate "1/1/3000"
GUID The unique identifier for the page, for example "{5706D8ED-13C3-46F3-933A-B1FA2127DDAE}"
IsImportant Whether the page "False"
LastApprovedDeclinedBy "WinNT://domain/administrator"
LastModifiedBy "WinNT://domain/administrator"
LastModifiedDate "11/11/2003"
Name "Sample News Posting"
Path "/Channels/CmsSharePointConnector/External/Sample News Posting"
StartDate "9/18/2003"
Url "/CmsSharePointConnector/External/Sample+News+Posting.htm"

Typically, making all of the standard properties available to search is only useful for content contributors performing searches on an intranet, for example to find a list of pages that were last modified by a certain user.

Exposing Document Properties from a Document Library

Document library properties are not automatically available for searching when using the MCMS Connector for SharePoint Technologies search controls because the controls only search on non-portal content. You can use an XSL style sheet to add the document properties to the content of the page, but then the property values can only be searched upon as free-text.

Note   Use the ASP.NET data cache to store property values to increase performance.

To enable property-based searching of document properties

  1. Add the SearchMetaTagGenerator control from the Visual Studio .NET Toolbox to MCMS templates that are included in search results. This control outputs a list of properties into the HTML source generated by the template.
  2. List which properties are searchable in the SearchPropertyCollection.xml file, found at local_drive:\Program Files\Microsoft Content Management Server\Server\IIS_CMS\WssIntegration.
  3. Run SearchPropertiesSetup located in installation_drive:\Program Files\MCMS Connector for SharePoint Technologies\WSS\Bin to set the index management server component to crawl the properties listed in SearchPropertyCollection.xml for inclusion in the content index.
  4. Within the MCMS template file, use the PropertiesXml property of the SharePointDocumentPlaceholder to access the document properties specified from the document library and output them into <meta> tags on the page as shown in the following code.
    // Load PropertiesXml into XML Document.
    XmlDocument propXmlDoc = new XmlDocument();
    propXmlDoc.LoadXml(spsDoc.PropertiesXml);
    
    // Retrieve the description using XPath.
    XmlNamespaceManager nsmgr = new 
        XmlNamespaceManager(propXmlDoc.NameTable);
    nsmgr.AddNamespace("z", "#RowsetSchema");
    
    
    XmlNode propNode = propXmlDoc.DocumentElement.SelectSingleNode("/PropertiesXml/SharePointData/z:row", nsmgr);
    
  5. Create a <meta> tag by inserting text into an ASP.NET Literal control that is inserted into the <head> section of the template, as shown in the following code.
    if (propNode != null)
    {
        string docDesc = 
            propNode.Attributes["ows_SPSDescription"].InnerText;
        litCustomMeta.Text = "<meta name=\"Document Description\" value=\"" + docDesc + "\">";
    }
    

Configuring MCMS Templates for Incremental Content Index Update

The SharePoint Portal Server search component provides the ability to perform incremental updates, in which only content modified since the last update is updated in the content index during the crawl. Using this capability can significantly reduce the amount of time required to crawl content sources. Due to the dynamic nature of MCMS, you need to ensure that SharePoint Portal Server receives the appropriate information to determine if an MCMS page should be updated during an incremental index update.

To update a template so that it reacts correctly to a SharePoint Portal Server incremental index update request

  1. In the template file, retrieve the If-Modified-Since HTTP header from the incoming request, as shown in the following code.
    string modifiedSinceHeader = 
        HttpContext.Current.Request.Headers.Get("If-Modified-Since");
    DateTime modifiedSince = 
        Convert.ToDateTime(modifiedSinceHeader).ToUniversalTime();
    
  2. Compare the value in the HTTP header to the LastModifiedDate of the current MCMS Page.
    • If the MCMS page has been updated, add the LastModifiedDate to the Last-Modified HTTP header of the response so that SharePoint Portal Server applies the correct timestamp to the new index entry, as shown in the following code.
      Response.Cache.SetLastModified(CmsHttpContext.Current.Posting.LastModifiedDate.ToLocalTime());
      
    • If the MCMS page has not been updated since the value in the HTTP header, return status code 304, which informs SharePoint Portal Server that the page has not been modified.
Note   To implement ASP.NET Output Caching, you need to set it programmatically after executing the code above, instead of by using @OutputCache.

For more information about enabling caching with incremental updates, see Microsoft Knowledge Base Article – 832432.

Improving Performance

The following tips can help you achieve optimal performance in solutions using the MCMS Connector for SharePoint Technologies.

Using MCMS-Enabled Web Parts

  • When using the MCMS Page Listing Web Part, keep the total number of pages within the channel that is being listed less than 100. Keep the number of items per page less than 25. When using the Summary view (with images), keep the number of items per page less than 10.
  • Eliminate multiple pages within the MCMS Page Listing Web Part by keeping the number of pages in the channel equal to or less than the number of items per page configured within the Web Part.
  • If you use the Summary Image capabilities of the MCMS Page Listing Web Part, ensure that the images are 60 x 60 pixels or smaller, and less than 4 KB.

Using the Document Library Placeholder

  • Remember that when a page using the SharePointDocumentPlaceholder is requested, the content and/or properties XML are not transformed at run time. The transformed HTML is generated when the page is saved, or when synchronization occurs. It is stored in the placeholder to increase performance.
  • Use ASP.NET output caching at the page or control level for a performance boost.
  • Ask users to save pages through the Web Author console each time they select documents to prevent the page from getting excessively large, because the XML from the document is cached in the ViewState of the page until it is saved.
  • Remember that the server has poor performance when an InfoPath or WordML document is selected, synchronized, or has a new style sheet applied.
  • Do not perform the transformation to change WordML into HTML frequently.

Using Search

  • Configure the majority of index updates to be incremental because the data transferred between the content index and Web servers is greatly reduced.
  • Keep the number of search results returned per page by the SearchResultControl less than 25 to increase performance.

Conclusion

This article demonstrates best practices to help guide your development efforts for implementing the MCMS Connector for SharePoint Technologies. For additional information on implementing a sample scenario for your solution, see the article Best Practices: Implementing a Sample Scenario Using the Content Management Server 2002 Connector for SharePoint Technologies.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker