Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Problem creating new repository workspace client

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

0 votes

Comments

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
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

2 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,932
× 1,202
× 169

Question asked: Nov 04 '13, 11:19 a.m.

Question was seen: 5,177 times

Last updated: Dec 17 '13, 1:01 p.m.

Confirmation Cancel Confirm