Jaa


CReplicationProject.Commit Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Commits changes that have been made to a Commerce Server Staging (CSS) project.

void Commit()

Remarks

You must have CSS administrator rights on the project to call this method.

You must use the Commit method to initialize a new project. The required properties that you must set before you can call this method vary based on the project type, as described in the following sections.

For information about additional properties that you can set, see the CReplicationProject.Put method and CSS API Flags.

The CReplicationProject.Commit method corresponds to the COM method named ReplicationProject.Commit.

Required Properties for Web Content Projects

The following table summarizes the parameters and properties that must be defined for Web content projects. Use the AddDestination, EnumDestination, and RemoveDestination methods to add, list, and remove a destination, respectively.

Name

Description

Destination

Specifies the names of all destinations to receive the content files. A destination can be a server name, a route name, or a directory. This property can be an empty string ("") if there are no destinations. The list cannot exceed 4096 characters.

LocalDirectory

Specifies the absolute path of the source directory that contains the files to be replicated and the endpoint directory where files will be transmitted. The directory path must be specified in the form: <drive>:\<path>.

This property cannot be empty.

Required Properties for IIS Metabase Projects

The following table summarizes the parameters and properties that must be defined for Internet Information Services (IIS) metabase projects.

Name

Description

Destination

Specifies the names of all endpoint servers to receive the IIS metabase files. For endpoint servers, this property is an empty string ("") because there are no destinations. The list cannot exceed 4096 characters.

LocalDirectory

Specifies the name of the Web site from which the IIS metabase will be replicated. This property cannot be empty.

MetabaseReplication

Specifies whether the project is defined to update the IIS metabase (YES) or not (NO). Use the Put method to set a value for this property.

Required Properties for Business Data Projects

The following table summarizes the parameters and properties that must be defined for business data projects.

Name

Description

BusinessDataProject

Specifies a Boolean value that indicates whether the project is used to stage business data.

BusinessDataProjectXml

Specifies a string that contains the full path of the file that contains the XML configuration for the business data project.

Destination

Specifies the names of all destinations that will receive business data content. A destination can be a server name, a route name, or a directory. The list cannot exceed 4096 characters. This property cannot be an empty string ("").

The destination for an endpoint server is the absolute path of the directory that corresponds to the Commerce Server site to be updated.

LocalDirectory

Specifies the absolute path of the directory to use to temporarily store data that is staged. This property cannot be empty.

Example

The following example creates a new project named FromMS, sets the project's LocalDirectory property, adds the destination MyDest to the project, and commits the changes.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");

  // Create a new project, FromMS
  CReplicationProject replicationProject;
  replicationProject = (CReplicationProject)replicationServer.OpenProject("FromMS", CSS_PROJECT_CREATION.CREATE_NEW_PROJECT);
  replicationProject.set_LocalDirectory(@"C:\LocalCopy");
  replicationProject.AddDestination("MyDest");
  replicationProject.Commit();

See Also

Other Resources

Projects

Routes

What are the Staging Project Options?

What Network Topologies does Staging Support?

How to Create and Modify a Staging Project

CReplicationServer.OpenProject Method

CReplicationProject Class