This method runs the refresh cycle on the Channel object.
VBScript Syntax
IChannel.Refresh IProject
Parameters
IProject
An IProject dispinterface (VT_DISPATCH)
Return Value
None
Remarks
The Refresh method runs the refresh cycle for this Channel object. When the method executes, it checks the RefreshType property value. If the string is not "userscript", "custom", "manual" or "none", it checks the appropriate registry location for a key that matches the string (case is ignored). When found, it finds the agent's corresponding "Script Name" named value. It then gets the "Script Language" named value that holds the corresponding scripting language identifier. Using these two values, it creates an Active Scripting Host to execute the agent. It passes four dispinterfaces to the host so that they appear within the namespace of the agent script. These interfaces and their corresponding namespace names are listed in the table below.
Namespace name | dispinterface |
channel | The IChannel interface for the Channel object. |
project | The IProject dispinterface passed to the method as an argument. |
options | The dispinterface on the Dictionary object referred to by the RefreshOptions collection. |
util | A dispinterface on a "utility" object. |
If the RefreshType property is set to "userscript" or "custom," the process is the same, except that the file parsed and executed is pointed to by the RefreshScript property. If the RefreshType property value is "manual" or "none" no refresh cycle occurs.
The registry keys used by the Refresh method are all found under the key:
HKLM\Software\Microsoft\Site Server\3.0\Active Channel\Active Channel Agents\.
Example
VBScript
Set IProject = CreateObject("push.project.1")
Set IChannel = IProject.Channel
IChannel.RefreshType = "File System"
IChannel.RefreshOptions("directory") = "c:\channelcontent\"
IChannel.RefreshOptions("matchcriteria") = Array("*.asp","*.htm","*.doc")
' before
wscript.echo "before refresh"
wscript.echo IChannel.GetCDFString IProject
IChannel.Refresh IProject
' channel has the filesystem agent refresh it
wscript.echo "after refresh"
wscript.echo IChannel.GetCDFString IProject
See Also