Preparing an MCMS Website for Search with SharePoint - The Connector SearchMetaTagGenerator Control
(Page 2 of 4 )
The last modification we need to do is to add a control that ships with MCMS Connector for SharePoint Technologies. The SearchMetaTagGenerator outputs standard and/or custom page properties. In addition, we can use it to control what properties are output and even add our own custom properties. Adding the SearchMetaTagGenerator control to your templates is very easy. Let's add it to our Plant.aspx template:
- Open the Plant.aspx file in Design view.
- In the Toolbox, select the Content ManagementServer tab, and drag the SearchMetaTagGenerator to the top of our template.
If you don't see the SearchMetaTagGenerator in the Toolbox and you've installed the MCMS Connector for SharePoint Technologies, right-click on the Toolbox and select Add/Remove Items. In the Customize ToolBox dialog, click Browse, navigate to the Microsoft Content Management Server\Server\bin\ directory, and select the Microsoft.ContentManagement.SharePoint. WebControls.dll assembly. Finally click OK in the Customize ToolBox dialog. You should now see the additional controls in your Toolbox.
If you haven't installed the MCMS Connector for SharePoint Technologies, refer to Appendix B, MCMS Connector for SharePoint Technologies, for download and installation information.
- Click the SearchMetaTagGenerator control we just added, and in the property window, select one of the following PropertyTypes:
- CustomProperties: Generates META tags for custom page properties.
- StandardProperties: Generates META tags for standard page properties (such as DisplayName, DisplayPath).
- CustomAndStandardProperties: Generates META tags for both custom and standard page properties (default).
- PropertiesFromXMLFile: Generates META tags for the properties specified in the SearchPropertyCollection.xml file. More on this in just a moment.
- For now, let's chose the CustomAndStandardProperties property type.

- Because the Visual Studio .NET designer won't allow us to drop controls into the <head></head> portion of the page, we need to move the code declaration of the SearchMetaTagGenerator control from the body of the page to the heading. Switch to HTML view, find the SearchMetaTagGenerator control we just added, and move it up between the <head> and </head> tags.
- As with any changes, we should now rebuild the Tropical Green project.
- Open a browser, and navigate through the site to a plant posting in the plant catalog section of the site. Take a moment to view the source of the posting you navigate to. Notice all the extra META tags that have been added. Here's an example:

Notice the FIRSTSAVEDBY property listed at the top of the META tags. This is a custom property that has been added to the posting. It is added to the META tags because we selected the CustomAndStandardProperties property type in the
SearchMetaTagGenerator control. The other META tags are the standard properties generated by the SearchMetaTagGenerator control.
When rendered, any posting implemented with the Plant template will contain META tags in the <HEAD> portion of the page for each of the page's custom properties and standard properties.
One of the items available to us in the PropertyType field is PropertiesFromXMLFile. This option allows us to specify exactly which properties will be exported as META tags using an XML file located at MicrosoftContentManagementServer\Server\IIS_CMS\ WssIntegration\SearchPropertyCollection.xml.
Once you have specified which properties you want to use, including custom properties you've added, you need to tell SharePoint to index these properties in the crawl. The console application SearchPropertiesSetup.exe included with MCMS Connector will tell SharePoint about the updated XML file. Run it using the following syntax:
SearchPropertiesSetup.exe file "<path to file>\SearchPropertyCollection.xml"
The SearchPropertiesSetup.exe utility can be found in the following location:
<install drive>:\Program Files\MCMS 2002 Connector for SharePoint
Technologies\WSS\bin\.
Go ahead and execute the SearchPropertiesSetup.exe utility as above because our custom search solution will use one of the META tags it generates.
If you change the SearchPropertyCollection.xml file, you will need to re-execute the
SearchPropertiesSetup.exe utility.
The MCMS Connector for SharePoint Technologies includes a help file with instructions on how to modify the XML file. Be aware that a Microsoft Support Knowledge Base article exists addressing an error in the help file instructions. The MSKB article A problem occurs when you add the SearchMetaTagGenerator control to a template in Content Management Server 2002 Connector for SharePoint Technologies (#872932) contains corrected instructions.
Our Tropical Green site is now configured to allow guests to visit the site, our templates have been modified to be more SPS search friendly, and we have included additional metadata in the <HEAD> section of all our rendered postings. Let's proceed to create a content source in SharePoint to index our site.
Next: Configuring SharePoint Portal Server Search >>
More Windows Scripting Articles
More By PACKT Publishing
|
This article is excerpted from chapter five of the book Advanced Microsoft Content Management Server Development, written by Lim Mei Ying et al. (PACKT, 2005; ISBN: 1904811531). Check it out today at your favorite bookstore. Buy this book now.
|
|