It's all about the answers!

Ask a question

Problem creating new repository workspace client


Yehiel Glass (25528386) | asked Nov 04 '13, 11:19 a.m.
retagged Dec 16 '13, 4:15 p.m. by David Lafreniere (4.3k7)

Hello,

When I create new repository workspace (client side), the workspace is created but without component.

What am I missing?

IWorkspaceConnection myNewWKSP = wm.createWorkspace(LogedInUser, "pluginWorkspace", "Merge detector" , monitor);

Thanks,

Yehiel


Comments
Yehiel Glass commented 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 :

Open Declaration 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 ?

Accepted answer


permanent link
Sonia Dimitrov (27149) | answered Dec 17 '13, 1:01 p.m.
JAZZ DEVELOPER
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);

      ...
Yehiel Glass selected this answer as the correct answer

Your answer


Register or to post your answer.