Content Management Server 2001 Site Stager

On This Page

About Site Stager About Site Stager
How Can I Use Site Stager? How Can I Use Site Stager?
How Does Site Stager Work? How Does Site Stager Work?
Important Considerations for Site Programmers Important Considerations for Site Programmers
Staging Run-Time Help Staging Run-Time Help
Structure of the Destination Directory Structure of the Destination Directory
Location of the Site Stager Log Files Location of the Site Stager Log Files

About Site Stager

One of the advantages of Microsoft Content Management Server 2001 is its ability to publish dynamically-generated Web site content. However, there may be times when a static HTML or Active Server Pages (ASP) version of the same content would be useful. Microsoft Content Management Server 2001 (MSCMS 2001) Site Stager is an application that converts MSCMS 2001 content, navigation, and links to static HTML or ASP for deployment on any Web server.

How Can I Use Site Stager?

You can use MSCMS 2001 Site Stager to make an HTML or ASP copy of your Web site available for multiple platforms.

Because you can select the parts of an MSCMS 2001 site you want processed, you can set up more than one version of the Web site to meet the specific information needs of various audiences, and automatically update these sites at regular intervals.

You can also use Site Stager to maintain separate publishing and browsing environments which frees resources for publishing and content management activity. Separating publishing and browsing also has security advantages because of reduced traffic on the Web server.

Granting access to remote staging machines

We recommend that access to the NR/System/Staging IIS virtual directory be restricted so only authorized machines can access it. This directory is globally accessible by default and poses a significant security risk*.* To grant access to remote staging machines, follow this procedure.

  1. Open the IIS Manager and select the Web site's NR/System/Staging directory.

  2. Right-click the Staging folder and select Properties.

  3. Click the Directory Security tab.

  4. Click Edit in the "IP address and domain name restrictions frame."

  5. Click Add and select any machines that will be running Site Stager.

How Does Site Stager Work?

On activation of a Site Stager profile, Site Stager navigates an MSCMS 2001 Web site, converting dynamic MSCMS 2001 pages into static HTML files. The HTML files, along with linked elements such as graphics, are organized in a directory structure that mirrors the MSCMS 2001 site's channel hierarchy.

Profiles

Site Stager profiles determine the time at which staging is to occur, the frequency of staging, and which channels to stage.

Important Considerations for Site Programmers

If your MSCMS 2001 system will be staged sometime in the future, you need to consider the following when developing and using the system.

Most of the following points must be read by your site's navigation programmers and page template designers before staging occurs for the first time.

  1. You must apply the ResolveURL() method to all references (URLs) external to the MSCMS 2001 system, in order for Site Stager to stage all content properly. (The ResolveURL() method is part of the MSCMS 2001 Publishing Application Program Interface (API). For further information about the API, see the MSCMS 2001 Site Programmer's Guide.)

    The ResolveURL() method will be automatically applied to any URLs generated by the Publishing API, but any URLs that are manually coded and need to be staged (with the exception of the URL used as an HTML form's "action" attribute) must be explicitly tagged with ResolveURL(). Note that if a referenced HTML file contains a link to a resource that needs to be staged, the HTML file must be converted to ASP, and then ResolveURL() applied to the link.

  2. If you are using the template switching feature of MSCMS 2001, you must do browser detection using client-side scripting rather than server-side scripting.

  3. To stage the target of an external link posting (a redirect), the creator of a redirect template must insert ResolveURL in the redirect as follows (being especially careful with the placement of quotation marks). Note that the target URL can be hard-coded into the redirect tag as shown below, or the template can be programmed to insert the URL based on author input.

<meta http-equiv="refresh" content="0; url=<%=AutoSession.ResolveURL("https://www.someco.com")%>">

  1. Any references (URLs) outside the firewall the MSCMS 2001 system resides behind must be fully qualified, and the URLs must be accessible from the server serving the staged site. (For more information, see Chapter 3, "Setting up Publishing: Assigning Publishing Rights.")

  2. ASP scripts should be written to use references (URLs) provided by the Publishing API "as is." For example, scripts should not be used to manipulate the URLs returned by the Publishing API.

  3. The output HTML pages generated by server-side scripts are staged, rather than the scripts themselves. For samples of staging scripts, refer to Chapter 10, "Developing for MSCMS 2001 Site Stager" in the MSCMS 2001 Site Programmer's Guide.

  4. To successfully stage the product of a script that contains an MSCMS 2001 mode check, "Or Autosession.IsModeStaging" must be added to the mode check. For example,

If Autosession.IsModePublished Then

becomes

<pre IsFakePre="true" xmlns="https://www.w3.org/1999/xhtml">

If Autosession.IsModePublished Or Autosession.IsModeStaging Then

(For further information, see the *MSCMS 2001 Site Programmer's Guide*.)
  1. To prevent staging of dynamic resources such as Subscription, query (for example, What's New), and login pages (none of which will function in the context of a staged site), surround references to them with the following check:

<%If Not Autosession.IsModeStaging Then%> code for dynamic resource <%End If%>

(For further information, see the *MSCMS 2001* *Site Programmer's Guide*.)
  1. To stage ActiveX objects or Java Applets referenced in MSCMS 2001 templates and server system files, the objects or classes must be packaged in CAB or JAR files respectively. In the case of server system files, ResolveURL() must be applied to the references, unless the files are stored in an MSCMS 2001 resource gallery.

    For JAR files stored in a Resource Gallery to function properly within MSCMS 2001 and to be re-usable, the file name must be the same as the name of its initial class. (For specific examples of using ResolveURL() with such references, see the MSCMS 2001 Site Programmer's Guide.)

  2. To stage forms, the URL of the form's action parameter must be fully qualified, and ResolveURL() from the Autosession object must not be applied to that URL. (For further information, see the MSCMS 2001 Site Programmer's Guide.)

  3. For successful staging, navigation templates must not contain any code that creates an Autosession using CreateObject(). Rely on the Authenticate.inc file to supply an Autosession object to work with. (For further information, see the MSCMS 2001 Site Programmer's Guide.)

  4. If you use Response.Redirect to redirect browsers, the URL to which you are redirecting should not be a relative URL. Rather, it should use a full path, such as /files/recent/headline.html. Redirecting to relative URLs will lock the Site Stager in an infinite loop. 

  5. If redirecting to URLs returned by MSCMS 2001 properties, such as Posting.URL, you must manually modify the URL before redirecting to it. This is necessary because in the Staging Autosession mode, MSCMS 2001 wraps staging tags (<NCOMPASSSTAGINGSERVER>...</NCOMPASSSTAGINGSERVER>) around all URLs it generates. The files included with the server include a VBScript function to strip off staging tags. The StripOffStagingTags function in the Server\IIS_NR\shared\TemplateSwitching.inc file can be used to make generated URLs compatible with redirects. The following example shows how this is done. See Chapter 10 of the MSCMS 2001 Site Programmer's Guide for a code sample.

  6. For links in template HTML to targets external to your MSCMS 2001 system, where those targets themselves contain one or more links, ResolveURL() must not be applied to the links in the template HTML. (If it is, Site Stager stages the targets of those links but without highly specialized coding or scripting, so any links in the staged targets themselves won't work. Not applying ResolveURL() to such links in template HTML allows browsers to follow the links to a "live" version of the target for any such link, complete with functioning links.)

Staging Run-Time Help

The run-time Help file (Subscribe.htm) that ships with MSCMS 2001 works with a non-staged MSCMS 2001 Web site. When a site is staged, this Help file does not serve any function, because it has been designed for a non-staged site and refers to subscribing to channels.

Subscribe.htm is on the server in the httpread/Help/ directory. The staged Web site Help file should be stored in this directory as well.

To prevent staging or displaying an non-applicable Help file, you can create a staged Web site Help file, then implement a simple If statement in the files that contain links to the Help files:

<%If AutoSession.IsModeStaging Then%>
' code for staged version of Help file
<%Else%>
' code for standard run-time Help file
<%End If%>

If the mode is not staging, the URL for the production Help file is returned; if the mode is staging, the URL for the staged Help file is returned with ResolveURL() applied to it.

Structure of the Destination Directory

Several new directories are created automatically in the destination directory to help Site Stager accomplish its job. Do not delete or change any files in this directory.

Logs directory

The logs directory keeps logs that track the file downloads and directory creation and is used internally by Site Stager. Do not change any files in this directory.

Temp directory

The temp directory is where all files are downloaded to before moving to their final destination.

<resources> directory

In the profile Properties dialog box, if you chose to "Store Resources Separately" from the pages, this directory will hold those resources. For the site to be exposed properly, a virtual path must be created that points to this directory, must be a subdirectory of the destination directory. The virtual path and the name of the resource directory are by default '/resources' and 'resources' respectively and are configured with the Staging Profile property dialog (displayed when editing a Staging Profile).

<channels> directory

This directory stores the staged HTML content. It also stores resources, if the option to "Store Resources Separately" was not chosen.

Location of the Site Stager Log Files

The default location is a subdirectory named "Site Stager Logs" within the MSCMS 2001 folder. The log files can be opened with a text editor for viewing.

You can set the location of Site Stager log files.

Log file names

A log file is created every time the Site Stager activates a profile either automatically or manually. Errors occurring during the session are recorded in the log file. The name of each log file is based on the details of the profile's session, including the profile's name and the time at which it was activated:

profile name_year_month_day_hours_minutes_seconds_{GUID}.log