Previous in Contents Next in Contents

The Refresh Cycle and the Channel Agent

The refresh cycle is a generic phrase used to describe what happens when the Refresh method is invoked on a Channel or Project object.  When this occurs, it is said that the refresh cycle for the channel or project has begun.  During this cycle, a Channel object runs a script called a Channel Agent. It does this using an Active Scripting Host. This process is similar to the one used with the Windows Scripting Host (WSH) and the Active Server Pages (ASP) system of Microsoft® Internet Information Server (IIS) version 3.0 and later. In the case of the channel scripting host, four dispinterfaces to objects are passed to the namespace for the executing script (agent). They are listed below along with a brief description.  It is through these interfaces that the script may update the data stored in the objects defined within the channel.  The script has unfettered access to the objects and can create, delete, and modify any and all information stored in the properties and collections of the objects.

Intrinsic Namespace Interfaces

channel

This name specifies an IChannel dispinterface on the Channel object running the refresh cycle.  The channel runs its refresh cycle, and passes its IDispatch interface to the script.

project

This name specifies the IProject dispinterface to the current Project object. This interface is passed to the Refresh method directly or indirectly. See the Project Class.

options

This name specifies a dispinterface to the class Dictionary object referred to by the name RefreshOptions on the Channel object. This collection is used to pass refresh option information to the agent for the refresh cycle.  Option information can be, for example, which file system directories to look for new or updated content, which databases to query, etc.  The options collection is simply a Dictionary object and can store any information to pass to the agent at runtime.  Of course, to be useful, the corresponding channel agent must be expecting a predefined set of options and values. 

util

This name specifies a dispinterface to an object with methods that perform routine tasks useful within an agent, such as recursively setting the DeleteOnRefresh property on all items and channels, etc.  Examples of use can be found in the various channel agents that come with the Active Channel Server system.

Any agent script can access these interfaces using the names listed above intrinsically, just as an ASP page script can access the Request interface within an ASP page by name.   The diagram below shows the relationships of the channel, the project, and the refresh options during the refresh cycle.

Scheduling Refresh Cycles for Automatic Execution

An instance of the Task class can be used to schedule a routine refresh cycle on a given project using the Task Scheduler administrative tool that comes with Site Server 3.0 and later versions of Microsoft® Windows NT®.  These tasks appear in the "Scheduled Tasks" section in the administrative tools menu.

Project vs Channel Refresh

Each Channel object can have its own agent and refresh options configured. Normally, you would configure the main channels of a project with various refresh channel agents and then schedule a task with the Task Scheduler administrative tool.  During each refresh cycle, the Refresh method is invoked on the Project object. When this occurs, the RefreshAll method is then invoked on the top-level channel. This sets off a recursive invocation of the RefreshAll method on all Channel objects in the content hierarchy for the project. Hence, the entire project and all of its subordinate Channel objects have the refresh cycle.


© 1997-2000 Microsoft Corporation. All rights reserved.