Share via


Code Practices

This topic describes how Microsoft® Windows® SharePoint™ Services interacts with other technologies to provide features for a SharePoint site. Third-party software developers can use this information to extend Windows SharePoint Services for interaction with a vendor application. Developers can extend Windows SharePoint Services features to perform the following tasks:

  • Interpret e-mail alert headers for use in a messaging application.
  • Implement a client application for discussions in Windows SharePoint Services.
  • Integrate a rich chart control for graphs used in issues lists.
  • Customize the XML manifest file of the site template contained in an .fwp file that is produced by the Microsoft SharePoint Migration Tool (smigrate.exe).
  • Provide access to portal areas from a Windows SharePoint Services site.

E-mail alert headers

The SMTP header in the e-mail message for an alert contains information about the originating context of the alert that can be used in a messaging application that is compatible with Windows SharePoint Services. This information in the SMTP headers is contained either as regular headers or as X-headers. When the messaging application (Win32 client) processes the incoming mail, it extracts the relevant information from these special headers.

A messaging application can process the information listed in the following table.

Header Description
From The encoded name of the originating server for the alert.
X-AlertServerType An ASCII string that uniquely identifies the server type and determines the type of icon that is displayed in the UI of the messaging application for alerts from the server.
X-AlertId An ASCII string that uniquely identifies the alert.
X-AlertTitle An ASCII or UTF-8 B64 encoded string containing the name for the alert.
X-AlertWebUrl An ASCII or UTF-8 B64 encoded string containing the URL for the Web site in which the alert originates. After the server is verified, this URL provides a link for the user to navigate to the Web site.
X-AlertWebSoap An ASCII or UTF-8 B64 encoded string containing the SOAP URL for the Web service providing an alert summary. This header is used to retrieve alert information from the server.
Message-ID A string containing an ID for the message that signals to the application that it has received a special alert e-mail communication. The ID starts with the GUID 3BD50098E401463AA228377848493927.

The application can handle alert e-mail messages differently from the regular e-mail messages in the following ways:

  • Alerts can be inspected for X-header information when the user opens or deletes them, or when the alerts are idle.
  • A specific icon can be displayed in the UI to indicate that an alert e-mail message has arrived.
  • The tools displayed for alert e-mail messages within the preview pane of the application can be different than those for regular mail. For example, alert messages might have a special action or rule associated with them.

Discussion bar

When Microsoft Office 2003 is installed on the client computer, clicking Discuss on the shortcut menu for a document in a document library opens the discussion bar control in Microsoft Internet Explorer, which provides options for discussing the document. Clicking Discuss directs to DiscBar.aspx, which in turn calls into OWSCLT.DLL, a DLL that is installed in the Local_Drive:\Program Files\Microsoft Office\OFFICE11 folder on the client as part of Office installation.

Note  This control can be installed separately from Office applications through advanced customization during installation of Office 2003.

The DiscBar.aspx file creates an OWS.DiscussionBar.1 control and calls the following methods and property:

  • ShowBar() opens the discussion bar.
  • HideBar() closes the discussion bar.
  • AddDiscussionServer(FriendlyName As String, ServerAddress As String, SetAsDefault As Boolean, Prompt As Boolean) adds the specified server as an option in the Discussion Options dialog box.
  • UseDocServer returns a Boolean value that indicates whether the server of the active document has been selected for discussions.

If Office is not installed, clicking Discuss opens a dialog box stating that the user cannot discuss the document because a discussion client that is compatible with Microsoft Windows SharePoint Services has not been installed.

For the various actions that a user takes through a UI, the discussion bar posts commands to OWSSVR.DLL. Requests like the following are posted from the discussion bar:

POST /_vti_bin/owssvr.dll?UL=1&ACT=1&BUILD=5510&STRMVER=4&URL=http://Server_Name/default.aspx

The response passes binary data back to the client computer.

The following parameters are passed:

  • UL — Any valid number.
  • ACT — Can contain one of the following values:
    Value Constant
    0 ACTION_ENUMTHREADSFROMURL
    1 ACTION_ADDCOMMENT
    2 ACTION_EDITCOMMENT
    3 ACTION_REMOVECOMMENT
    4 ACTION_GETCAPABILITY
    5 ACTION_SUBSCRIBE
    6 ACTION_CLOSECOMMENT
    7 ACTION_CLOSETHREAD
    8 ACTION_ACTIVATECOMMENT
    The **ACTION\_ENUMTHREADSFROMURL**, **ACTION\_REMOVECOMMENT**, and **ACTION\_GETCAPABILITY** values require a GET instead of a POST.
  • STRMVER — version number of the binary data returned to the client. The client and server versions must be identical.
  • URL — URL of the document being discussed.
  • BUILD — build number of Windows SharePoint Services.

Rich charts

If Microsoft Office 2003 English Web Parts and Components is installed on the server, the report generator for an issues list creates rich charts for report types. When a user clicks one of the report types on the Report page (reporthome.aspx), the user is directed to reportrich.aspx, which displays the chart. If the package is not installed, the user is instead directed to report.aspx and a rich chart is not displayed.

Third-party developers can add a custom reportrich.aspx file to the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033 folder to provide rich charts for issues lists. The functionality of a custom reportrich.aspx file will be called automatically when users select a report type on the Report page.

manifest.xml file of smigrate.exe

When the Microsoft SharePoint Migration Tool (smigrate.exe) that ships with Windows SharePoint Services is used to migrate a site, it produces a cabinet file (.cab) with an .fwp extension to back up the site, and then uses this .fwp file to restore the site. Developers can modify the backed-up site template before the site is restored by changing the file extension of the .fwp file to .cab and extracting the manifest.xml file. After changes are made to the manifest.xml file, the .fwp file can be repackaged and the site can be restored by using smigrate.exe.

Portal areas

When a SharePoint site is linked to a portal, additional commands are added to the UI that provide access to areas of the portal. The following table describes these commands and shows their URLs.

UI Command Description URL
Add to My Links Appears on the shortcut menu for a document or in the Actions area for a list or document library and adds a link to the document, list, or library from the My Site home page of the portal. For a document, the IconUrl parameter specifies the URL of the icon that is used to represent the document. Because the request being made is a post, any parameter specified on the page is also posted. Parameters that can be specified on the page include, for example, the list type or list title fields such as ListTitle, ListViewUrl, ReturnUrl, BaseType, or ServerTemplate. http://Server_Name/_vti_bin/portalapi.aspx?cmd=PinToMyPage[&IconUrl=/_layouts/images/icdoc.gif]
Submit to Portal Area Appears on the shortcut menu for a document and submits the document to a portal area. The IconUrl parameter specifies the URL of the icon that is used to represent the document. Because the request being made is a post, any parameter specified on the page is also posted. Parameters that can be specified on the page include, for example, the list type or list title fields such as ListTitle, ListViewUrl, ListDescription, and ReturnUrl. http://Server_Name/_vti_bin/portalapi.aspx?cmd=Categorize&IconUrl=/_layouts/images/icdoc.gif
Select a portal area for this [list/document library] Appears on the Customize page for a list or document library and associates the list or library with an area. Because the request being made is a post, any parameter specified on the page is also posted. Parameters that can be specified on the page include, for example, the list type or list title fields such as ListTitle, ListViewUrl, ListDescription, and ReturnUrl. http://Server_Name/_vti_bin/portalapi.aspx?Cmd=Categorize
Search for "Value" on Portal_Name Appears on the Search Results page of a site-level search (searchresults.aspx) and extends the search to the entire portal. http://Server_Name/_vti_bin/portalapi.aspx?Cmd=Search&SearchString=Value
User_Name When the name of a user is clicked in the UI, a page that displays the profile of the user (Public.aspx) opens instead of the standard Windows SharePoint Services display form for user information (UserDisp.aspx). http://Server_Name/MySite/Public.aspx?
accountname=DOMAIN%5cUser_Alias &Source=http%3a%2f%2fServer_Name%3a80%2fsites%2fSite_Name%2f_layouts %2f1033%2fUserDisp.aspx%3fID%3d1%26Force%3dTrue
&ReturnUrl=http://Server_Name/sites/Site_Name/File_Name.aspx