Problem creating new repository workspace client
Accepted answer
One possibility to create a new workspace from an existing one is to call:
com.ibm.team.scm.client.internal.WorkspaceManager.createWorkspace(IContributorHandle, String, String, IWorkspaceConnection, IWorkspaceConnection, IProgressMonitor).
The first IWorkspaceConnection parameter represents your flow target, the second represents the workspace you wish to copy.
With the original call posted here, you would need to explicitly add components with com.ibm.team.scm.client.IFlowNodeConnection.IComponentOpFactory.addComponent(IComponentHandle, boolean) and com.ibm.team.scm.client.IFlowNodeConnection.applyComponentOperations(List, IProgressMonitor).
...
List<IComponentAdditionOp> componentOps = new ArrayList<IComponentAdditionOp>(components.size());
componentOps.add(myNewWKSP.componentOpFactory().addComponent(components.get(0), false));
myNewWKSP.applyComponentOperations(componentOps, monitor);
...
com.ibm.team.scm.client.internal.WorkspaceManager.createWorkspace(IContributorHandle, String, String, IWorkspaceConnection, IWorkspaceConnection, IProgressMonitor).
The first IWorkspaceConnection parameter represents your flow target, the second represents the workspace you wish to copy.
With the original call posted here, you would need to explicitly add components with com.ibm.team.scm.client.IFlowNodeConnection.IComponentOpFactory.addComponent(IComponentHandle, boolean) and com.ibm.team.scm.client.IFlowNodeConnection.applyComponentOperations(List, IProgressMonitor).
...
List<IComponentAdditionOp> componentOps = new ArrayList<IComponentAdditionOp>(components.size());
componentOps.add(myNewWKSP.componentOpFactory().addComponent(components.get(0), false));
myNewWKSP.applyComponentOperations(componentOps, monitor);
...
Comments
Yehiel Glass
Nov 11 '13, 11:32 a.m.Hi ,
I thoght to copy the workspace, but I don't know what is the parameter for IAuditableHandle :
com.ibm.team.scm.client.IWorkspaceManager.copyWorkspace(IAuditableHandle arg0, IWorkspaceConnection arg1, String arg2, String arg3, IProgressMonitor arg4)
Maybe you know what is the IAuditableHandle arg0 ?