Copies all project content from the source project to the target project.
null and must be persisted prior to call. null and must be persisted prior to call. DateShiftTypes specifying how dates in the source project should be shifted to in the target project; cannot be null. See documentation in the Calendar.DateShiftTypes class for more details. null. IProject, and both projects must have the start date set, otherwise an CollaborationException will be thrown. The copied project will be stored permanently. No Store method is required on the copied object. Security is mapped isomorphically from the source project to the target project. For example, 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 | One or both of the projects has not yet been stored or have already been removed. |
| CollaborationException | The method call resulted in an error, or the user does not have Read access to one of the projects. |
| MultipleObjectException | 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 | There was a communication problem during the execution of the remote method call. |
IProjectManager Interface | Plumtree.Remote.PRC.Collaboration.Project Namespace