次の方法で共有


CReplicationProject.Put Method

Sets the value of a property for a Commerce Server Staging (CSS) project.

void Put(string propName, object propValue)

Parameters

  • propName
    The name of the property to set. Property names are not case-sensitive. The following table lists valid property names.

    Property name

    Description

    AfterReceiveScript

    Specifies the path and file name of a script to run after content is received.

    AfterSendScript

    Specifies the path and file name of a script to run after content is sent.

    BeforeReceiveScript

    Specifies the path and file name of a script to run before content is received.

    BeforeSendScript

    Specifies the path and file name of a script to run before content is sent.

    BusinessProject

    Specifies whether the project is to stage business data (1) or not (0).

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option is required only for business data staging projects.

    CreateVirtualRoot

    Specifies whether the Web content project will be staged to a virtual root directory (YES) or not (NO).

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects.

    Comments

    Contains comments for the staging project.

    Destination

    Specifies the destinations for the project. A destination can be a server name, a route name, or a directory. Multiple destinations may be specified. For a project to be staged, at least one destination must be specified for the project that is defined on the source staging server.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    Route names and directories cannot be specified for Internet Information Services (IIS) metabase projects.

    This property may be empty depending on the project type.

    ExcludeDir

    Specifies a directory to exclude from staging.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects. You define this option only on the source staging server.

    Filter

    Specifies the filters to use to include or exclude specific assets, such as files or directories, in a Web content staging project. The following options are available for specifying filters:

    +<filter>Includes the file or directory filter.
    -<filter>Excludes the file or directory filter.
    \Applies the filter to directories.
    ...\Applies the filter to all subdirectories.
    <filter>A file or directory filter that can use wildcard characters.

    For example, the following filter will include text1.txt, exclude all .exe files in the project root directory, exclude the directory dir1, and include all .jpg files in the whole directory tree.

    "Filter", +"text1.txt" –"*.exe" –"dir1\" +"...\*.jpg""
    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option is applicable only to Web content staging projects. You define filters only on the source staging server.

    Flags

    Specifies a bitmask that enables or disables one or more flags. For a list of flag values, see CSS API Flags.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    Most flags apply only to Web content staging projects.

    LocalDirectory

    For Web content and business data projects, specifies the path of a directory. The directory must be specified in the form <drive>:\<path>, for example, Put("LocalDirectory", @"C:\NewDirectory").

    For Web content projects, this property specifies the source directory that contains the files to be replicated and the endpoint directory where files will be transmitted.

    For IIS metabase projects, this property specifies the name of the Web site from which the IIS metabase will be replicated.

    For business data projects, this property specifies the directory to use to temporarily store data that is staged.

    MailTo

    Specifies the e-mail address that will receive notifications when a staging project succeeds or fails, for example, CSSAdmin@adventure-works.com.

    MailToFail

    Specifies the e-mail address that will receive notifications when a staging project fails, for example, CSSAdmin@adventure-works.com.

    MailToSuccess

    Specifies the e-mail address that will receive notifications when a staging project succeeds, for example, CSSAdmin@adventure-works.com.

    MapUrl

    Specifies the URL to which the destination maps. This is comparable to specifying the Virtual directory to be assigned to the project option in the user interface.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option apply only to Web content projects.

    MetabaseReplication

    Specifies whether the project is defined to update the IIS metabase (YES) or not (NO).

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option is required only for IIS metabase staging projects.

    SkipLockedFiles

    Specifies how CSS will manage the replication of locked files. If this option is set to YES, CSS will skip the replication of files locked on the source or overwrite a file on the target if it is locked or currently being used. If this option is set to NO and files are being used, the replication will fail.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects. You define this option only on the source staging server.

    TransactionMethod

    Specifies whether to enable transactional staging (YES) or not (NO).

    When you set this option, the endpoint server maintains a copy of the Web content for each project that is staged on that server. Enable this option in case you want to revert to the original Web content. When you enable this option, you must make sure that you have sufficient disk space to support the storage of Web content projects. If, for example, you decide to keep three rollbacks, you must have enough hard disk space for at least three versions of the content.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects. You define this option only on endpoint servers. If you enable this option, use the SetGlobal command (RollbacksToKeep parameter)to define the number of rollbacks to keep on the server.

    Username

    Specifies the user name of the default authentication account to use when authenticating against other CSS servers, for example, contoso\CSSUser.

    VRootAttributes

    Specifies the user rights that are set on the virtual directory. Valid user rights are the following:

    • R=Allow read access.

    • W=Allow write access.

    • E=Allow execute access.

    • S=Allow script access.

    • B=Allow directory browsing.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects.

    VRootWebSiteName

    Specifies the relative path of the physical directory to map to the virtual directory of the Web site defined for the project. Make sure that you include the slash mark (/) at the start of the path.

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects.

    WaitApply

    Specifies whether timed release is enabled (YES) or disabled (NO).

    Dd327894.alert_note(en-US,CS.90).gifNote:
    This option applies only to Web content staging projects and to projects that are defined on an endpoint server.
  • propValue
    The new property value.

Remarks

You must have CSS administrator rights to execute this method.

Properties are not set for the project until they are committed by calling the Commit method on the CReplicationProject object.

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

Example

The following example sets the LocalDirectory property to C:\NewDirectory for the project named MyProject.

CReplicationServer replicationServer = new CReplicationServer();
  replicationServer.Initialize("");
  CReplicationProject replicationProject;
  replicationProject = (CReplicationProject)replicationServer.OpenProject("MyProject", CSS_PROJECT_CREATION.OPEN_EXISTING_PROJECT);
  replicationProject.Put("LocalDirectory", @"C:\NewDirectory");
  replicationProject.Commit();

See Also

Other Resources

Projects

Routes

How to Create and Modify a Staging Project

CReplicationProject.Get Method

CReplicationProject Class