Plumtree EDK (Enterprise Web Development Kit) 5.4.0

IProjectManager.CopyProjectMetaData Method 

Copies the basic meta-data, and all IRole objects from the source project to the target project.

IProject CopyProjectMetaData(
   IProject sourceProject,
   IProject targetProject
);

Parameters

sourceProject
The source project to copy from; cannot be null.
targetProject
The target project to copy to; cannot be null.

Return Value

The target project after copied from source project.

Remarks

Prior to the call, the source project has to be a persisted IProject, and the target project can be persisted or not. Note that this is different from CopyProjectContent method where both sourceProject and targetProject have to be stored prior to the call.

The user needs to be a Project Leader in the target project, and has READ access in the source project.

The method will copy all of the following: project description, all IRole objects, and start date information, if the target project's start date is not set and the source project's start date is available.

The target project after copied from source project will be returned.

The copied project will be stored permanently. No Store method will be required to call on the copied object. WARNING: The old roles in the target project will be overwritten with the copied roles from the source project.

Note that this method does not copy the project content, only the project meta-data. To copy the project content, use CopyProjectContent method.

Example code:

//Sample code for copying projects
// get the projects - note that the targetProject does not have to be stored
IProject sourceProject = projectManager.getProject(sourceProjectID);
IProject targetProject = projectManager.getProject(targetProjectID);
projectManager.CopyProjectMetaData(sourceProject, targetProject);

Exceptions

Exception Type Condition
InvalidOperationException if the source project has not yet been stored or if either of the projects have already been removed.
CollaborationException The user is not a Project Leader in the target project, or if the method call resulted in an error
SoapException if there is a communication problem during the execution of the remote method call.

See Also

IProjectManager Interface | Plumtree.Remote.PRC.Collaboration.Project Namespace