Tuesday 8 April 2008

Steps to Install Custom Help Pages to SharePoint


  • Manifest.xml file defines the available help items and its relationship in the help collection. Every object, like help topic, help category, image, CSS, JS is represented as helpItem in the manifest file. HelpItem types currently available
    • HelpCategory: Represents a group of topics. Generally the help topics are grouped into category and sub-category. A help category can have one or more subcategory or help topics.
    • HelpTopic: Represents a single help page in the application, e.g. Customize Web Parts.
    • HelpContext: Represents a help context. This is used to provide context sensitive help for pages. For example MS_WSS_ItemLevelPermissions.
    • HelpImage: Represents an image. The images used in the help pages, help topic, are represented as helpImages. The help system fetches the corresponding image display when we request a help topic.
    • HelpCss: Represents the *.css file used in the help pages. We have no need to include this as usual in the *.htm pages. The help system does this for us.
    • HelpScript: Represents the *.js files used in the help pages. It works the same as helpCss.


    • Other elements include <lcid>: The locale Id of the help collection. 1003 is for English.
    • <rootCategory>: The root category for the help collection. This helpItem is parent for all the main categories in the help collection.
    • <helpItem>: Represents each help item in the help collection.
    • <parent>: The parent help item for this help Item. An help item can have more than one parent, so that the help item can participate in more than one help category. The sort order specifies, the position of the help item when it is displayed under this parent.
    • <relatedItemsPointingToMe>: This element is used to achieve two different functionalities. One is to display list of helpItems, help topics, in the "See also" section. The other one is to map an HelpContext Item.
  • Metadata Files - For every helpItem element in the manifest file, there is one metadata file, which describes the helpItem. This metadata files tell whether the helpItem is a helpCategory, helpTopic, helpImage, or helpContext. In the metadata, the filename really doesn't mater, only the extension and the content matter. But generally the filename will be the combination of Id and extension. The id value should match with the helpItem's Id value otherwise the help collection will not be installed properly. The name is used to display in the help category and help topics.
  • Content Files - Every helpTopic, HelpImage, HelpCss, and HelpScript in the help collection have a corresponding content file. For helpTopic it is a *.htm file. HelpContext and HelpCategory will not have any content files. We do not need to do anything special for including the CSS and JS files. If it is part of the help collection, it will be added to the page when we request for a particular help topic by the SharePoint help system. The HTM file should not be defined as the conventional *.htm file. Rather the file should only contain the content and should not contain the HTML or body element. the real HTML file is constructed by the SharePoint help system and this content is included as part of the generated HTML file and rendered to the client.


  • Set Up the Folder Structure as follows:

  • Once files are set up and displayed as in the image, we need to create a CAB file for SharePoint to recognise:
    • Set up a command prompt to run from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN:
      • cabarc -r -p n MS.OSS.HC.cab *.* (where MS.OSS.HC should be replaced with the name of the help collection you are trying to install). I copied all installation applications to my desktop to make things easier and pointed the cmd there.
      • Copy the .cab file to the 12hive\HCCab\1033 folder


  • Create the HelpMap.xml file - Context sensitive help in SharePoint is implemented using:
    • Helpmap file for each helpcollection
    • HelpContext help item, and
    • Associating the helpcontext with an helptopic


    The helpmap files reside in the 12hive\TEMPLATE\XML\HELP folder. The following extract is from Oss.xml file, which is the helpmap file Office SharePoint Server help collection:


    <helpmaps>
    <helpmap>
    <key>AboutGroups</key>
    <collectionId>MS.OSS.manifest</collectionId>
    <contextId>MS.OSS.AboutGroups</contextId>
    </helpmap>
    <helpmap>
    <key>AboutSubsites</key>
    <collectionId>MS.OSS.manifest</collectionId>
    <contextId>MS.OSS.AboutSubsites</contextId>
    </helpmap>
    <!-- other help mapgs -->
    <helpmaps>


    • The Key element represents the helpcontextkey, the CollectionId element represents the helpcollection to which the helpcontext belongs to. And the ContextID is used to define Helpcontext helpitem in the manifest file and helpcontext metadata.
    • Copy the helpmap xml file to 12hive\TEMPLATE\XML\HELP folder
  • In order for SharePoint to recognise that you want your new hel page collection to be displayed when the user clicks on the hel button you need to override the helpcontext key declaration in the javascript file - core.js as follows:
  • Install the CAB file to install the HELP collection to the Portal
    • Once we have the CAB file, we can use the HCINSTAL.EXE, which is available in <12Hive>\Bin directory. We can either install one or all the help collection. The CAB file can be placed anywhere and the path can be given as an argument to hcinstal.exe. But we can place the CAB file in the <12hive>\HCCab\1033 folder and use the following command to install the help collection.
    • Hcinstal.exe /act InstallAllHCs (Once again this should point to the correct directory - C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
    • The above console application returns 4 if the help collection is installed properly. If nothing is done, this will return 32. When something is wrong with the help content, it will return 256.
    • If the commands have worked Go to the Central Administration site -> view all site content -> helpFold (document library). This is document library which is populated when we install the help content. The help content is placed in a different folder like, manifest, metadata, content for each locale. You should see your installed help files in the folders.


    References: http://www.codeproject.com/KB/sharepoint/CustomHelpPages_SP2007.aspx



Zootmastaflex

Zootmastaflex
The Queen of RockStars!