Commit Method

This method commits changes for a project.

Syntax

ReplicationProject.Commit

Remarks

You must have Site Server Publishing administrator privileges on the server to call this method.

You must use this method to initialize a new project. There are a number of required parameters and properties that you must set before you can call the Commit method. All of the parameters and properties are described in the Parameters topic. The required parameters and properties are described in the following table.

Required Parameters and Properties for Push Projects
Name Description
ReplicationMethod Set this property to "SENDINET" for Push projects.
Destination This parameter is a list of the names of all servers to receive the replication. Can be Empty ("") if there is no destination. If creating a project using routes, it must be the name of the route. The list cannot exceed 4096 characters. Microsoft recommends that you use the ReplicationProject.AddDestination, ReplicationProject.EnumDestination, and ReplicationProject.RemoveDestination methods to add, list, and remove a destination, respectively.
LocalDirectory This property is the (Unicode) name of the local directory used to send or receive the content. Cannot be Empty ("").
Flags This property is a long array of bitmapped values (see the Flags appendix)
Required Parameters and Properties for Pull Projects
Name Description
ReplicationMethod Set this property to "PULL"  for Pull projects.
RootUrl This parameter is the URL from which to pull data; for example, “http://www.microsoft.com/”.
LocalDirectory This property is the name of the local directory to store the information. Cannot be Empty ("").
Depth This parameter is the depth of the replication. For HTTP, this is the number of times to follow links from the root page. For FTP, this is the depth to go in the directory structure.

Example

The following example specifies that the new project MyProject pulls Web pages from http://www.microsoft.com/ to C:\LocalCopy, going as much as three levels deep.

Option Explicit
On Error Resume Next

const CREATE_NEW_PROJECT = 1

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

'Create new pull project, FromMS
dim ReplProject
set ReplProject = ReplServer.OpenProject("FromMS", CREATE_NEW_PROJECT)
ReplProject.ReplicationMethod = "PULL"
ReplProject.Put("RootUrl", "http://www.microsoft.com/")
ReplProject.LocalDirectory = "C:\LocalCopy"
ReplProject.Put("Depth", "3"
ReplProject.Commit

'Release objects
set ReplProject = Nothing
set ReplServer  = Nothing

See Also

ReplicationServer.OpenProject


© 1997-1998 Microsoft Corporation. All rights reserved.