Click here to Skip to main content
Click here to Skip to main content

MCMS Placeholder Content Web Part

, 22 Jan 2005 CPOL
Rate this:
Please Sign up or sign in to vote.
Display content from a Content Management Server placeholder in a WSS site.

Introduction

This web part displays content from a Content Management Server (MCMS) page placeholder in a Windows SharePoint Services (WSS) site or a SharePoint Portal Server (SPS) site. No actual placeholder content is stored in the web part. If the placeholder is updated with new content in the MCMS site, the web part will automatically show the new content in the WSS site.

Background

There are several ways to pull content from MCMS in a WSS site. Off the shelf so to speak, Microsoft provides the free MCMS Connector for SharePoint Technologies. It comes with a MCMS Page Listing web part that displays a summary list of pages in a particular channel. If your requirements are anything more complicated than that, you will need to write your own custom code.

The simplest approach is to use the Page Viewer web part. It displays any web page content in an IFrame. With the entire web page loaded with its own navigation and everything, it does not provide users an UI experience that the content is part of your WSS site.

If the MCMS site is located in the same box as your WSS site, code your heart out with MCMS API in your web part. As this is the exception rather than the norm in a production environment, you may need to resort to Web Service or custom IFrame development to display just the placeholder content, not the entire MCMS page.

MCMS Web Service is indeed a very good approach though you may run into some authentication issues with a web part calling the web service. Windows Integrated Authentication will not work for the web service as far as I know. If you have a SPS site, I would use SPS' Single Sign-On (SSO) service to authenticate.

Using the IFrame route, this web part calls a custom MCMS page which renders the content of a specific placeholder of your choice into an IFrame. The IFrame automatically adjusts its height based on the length of the content so that no scroll bars will show.

Installation

  1. Web Part

    On the WSS server, run SharePoint Services administration tool Stsadm.exe to install package MCMSWebPartsPackage.cab. Alternatively, you can rebuild the package using the source files included. To install the package, run the following command:

    Stsadm.exe -o addwppack -filename c:\MCMSWebPartsPackage.cab

    Modify web.config to mark the web part as safe:

    <SafeControls>
        .....
        <SafeControl Assembly= "QuestechSystems.MCMSWebParts, 
            Version=1.0.0.0, Culture=neutral, 
            PublicKeyToken=a877c88baf21ba83" 
            Namespace="QuestechSystems.MCMSWebParts" TypeName="*" />
    </SafeControls>

    The "MCMS Placeholder Content" web part should now appear in the Virtual Server Web Part Gallery.

  2. MCMS WssIntegration

    On the MCMS server, copy directory WssIntegration to the root of your MCMS site. Open Visual Studio. Include directory in your MCMS project. Rebuild project.

Usage

The "MCMS Placeholder Content" comes with its own custom tool pane with the following properties:

  1. MCMS Site URL - URL to your MCMS site. For example http://woodgrovenet, http://server/woodgrovenet. The server can be a remote server obviously.
  2. Page - This is the posting display path. It will be automatically populated after you select a placeholder using the Select Placeholder dialog.
  3. Placeholder - This is the name of the placeholder. It will be automatically populated after you select a Placeholder using the Select Placeholder dialog.
  4. Select Page & Placeholder - Clicking this button will open a Select Placeholder dialog. This dialog allows you to select a Posting and the Placeholder in it that you want to render the content.

You may also want to change the web part title in the Appearance section to fit the placeholder you selected.

Remarks

  1. The web part stores the posting path, posting GUID and placeholder name. It uses the posting GUID and placeholder name to retrieve the placeholder content. If the posting is moved to another channel, the web part will still be able to locate the moved posting and renders the placeholder content. However, the posting path displayed in the custom toolpane will not be correct.
  2. The web part renders the raw content of a placeholder. Placeholders like XmlPlaceholder will not be rendered properly.
  3. The web part will render the unpublished view of the placeholder when you are editing or designing a WSS page.
  4. If you only have one MCMS site to pull content from, you can modify GetSiteUrlDefaultValue() in RenderMCMSPlaceholderTool.cs to always display the specific MCMS Site URL.
  5. All hyperlinks in the rendered placeholder content will open up in the main page, not inside the IFrame.
  6. Scroll bars in the IFrame may appear in non-IE Windows browsers. I only tested it in Windows IE.
  7. If the placeholder content uses custom CSS styles, it will not be rendered in the web part like it does in the MCMS site. In the web.config file of your MCMS site, add the appSettings key SiteCssHrefForWss with the HREF of your site stylesheet. For example, if the MCMS site is the WoodgroveNet site:
    <add key="QuestechSystems.SiteCssHrefForWss" 
                value="/WoodgroveNet/Style/styles.css" />

History

  • V1.0 - 2004.12.11 - Base.
  • V1.1 - 2005.01.15 - Resolved cross-site security problems when CMS and WSS sites are on different servers.
  • V1.2 - 2005.01.22 - Added option to insert stylesheet reference when rendering placeholder content (see remark 7 above).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Stephen Huen
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.
 
Experience and expertise in SharePoint 2013 / 2010 / 2007.
 
Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.
 
Proven experience working effectively in a team environment and a self-managed environment.
Follow on   LinkedIn

Comments and Discussions

 
QuestionI can't find the project? Pinmembersarama30-Mar-08 19:36 
GeneralHelp Needed | SharePoint Web part and MCMS PinmemberDavendra19-May-06 3:47 
GeneralRe: Help Needed | SharePoint Web part and MCMS PinmemberStephen Huen19-May-06 8:58 
GeneralRe: Help Needed | SharePoint Web part and MCMS PinmemberDavendra21-May-06 20:38 
QuestionCan this use Forms authentication? Pinmemberdiver726-Jan-06 10:07 
GeneralMCMS 2002 and VStudio 2003 does not work PinsussEdilberto Sánchez Forero7-Jul-05 16:23 
GeneralRe: MCMS 2002 and VStudio 2003 does not work PinmemberStephen Huen7-Jul-05 16:55 
GeneralRe: MCMS 2002 and VStudio 2003 does not work PinsussEdilberto Sánchez Forero7-Jul-05 17:37 
GeneralRe: MCMS 2002 and VStudio 2003 does not work PinmemberStephen Huen7-Jul-05 18:18 
GeneralHaving problems Pinmembermilesowen12-Jan-05 16:24 
GeneralRe: Having problems PinmemberStephen Huen12-Jan-05 17:13 
GeneralRe: Having problems Pinmembermilesowen13-Jan-05 4:06 
GeneralRe: Having problems PinmemberStephen Huen13-Jan-05 20:36 
GeneralRe: Having problems PinmemberStephen Huen13-Jan-05 20:38 
GeneralRe: Having problems Pinmembermilesowen14-Jan-05 2:29 
GeneralRe: Having problems PinmemberStephen Huen15-Jan-05 16:14 
GeneralRe: Having problems Pinmembermilesowen17-Jan-05 6:25 
GeneralRe: Having problems Pinmembermilesowen17-Jan-05 11:53 
GeneralRe: Having problems PinmemberStephen Huen17-Jan-05 16:47 
GeneralRe: Having problems PinmemberStephen Huen22-Jan-05 13:17 
Generalthis is good Pinmemberjkoos2-Jan-05 14:00 
Generalgreat - thanks Pinmembermeron18-Dec-04 22:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.1411022.1 | Last Updated 22 Jan 2005
Article Copyright 2004 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid