Copies all the project content of the source project to the target project.
null
and has to be persisted prior to call. null
and has to be persisted prior to call. DateShiftTypes
specifying how dates in the source project should be shifted to dates in the target project; cannot be null
. Please see documentation in DateShiftTypes
class for more details. null
. IProject
, and also both projects have to have the start date set, otherwise an CollaborationException
will be thrown. The copied project will be stored permanently. No Store
method will be required to call on the copied object. Security is mapped isomorphically from the source project to the target project. Thus if the ProjectMember role in the source project has access level i on object O, and object O is copied to object O', then the ProjectMember role in the target project will have access level i on object O'. Similarly with the ProjectGuest role. Example code:
// get the projects IProject sourceProject = projectManager.GetProject(sourceProjectID); IProject targetProject = projectManager.GetProject(targetProjectID); //use DateShiftType of NONE for no date conversions DateShiftType dateShiftType = DateShiftType.NONE; //use the default timezone- see docs for other options TimeZone timezone = TimeZone.CurrentTimeZone; try { projectManager.CopyProjectContent(sourceProject, targetProject, dateShiftType, timezone); } catch (Exception e) { if (e instanceof MultipleObjectException) { //get the source exception from each exception MultipleObjectException multException = (MultipleObjectException) e; int[] ids = multException.ObjectIds; //loop through the exceptions find the cause exception, e.g. Exception causeException = multException.GetCauseException(ids[i]); } else { //deal with other exceptions...... } }
Exception Type | Condition |
---|---|
PermissionDeniedException | The user is not a Project Leader in both the source and target project. |
InvalidOperationException | if either of the projects have not yet been stored or have already been removed. |
CollaborationException | if the method call resulted in an error, or if the user does not have Read access to one of the projects. |
MultipleObjectException | if errors occurred while copying. Each source exception can be retrieved from this exception. The exception should never happen unless source project content is being accessed concurrently with this copy operation. |
SoapException | if there is a communication problem during the execution of the remote method call. |
IProjectManager Interface | Plumtree.Remote.PRC.Collaboration.Project Namespace