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

How do you access and use the IWorkspaceConnectionInteropAdapter interface?

Hello Michael,

could you please explain how to access and use the IWorkspaceConnectionInteropAdapter interface in more detail?

Thanks, Thorsten

0 votes



One answer

Permanent link
Here's how you get the adapter from a workspace connection.

IWorkspaceConnection workspace = ???;
IWorkspaceConnectionInteropAdapter op = (IWorkspaceConnectionInteropAdapter)workspace.getAdapter(IWorkspaceConnectionInteropAdapter.class);

Once you have the adapter, you can use it to import a change set with a specified date and author.

0 votes

Comments

Hello Michael,

I understand how to get the IWorkspaceConnectionInteropAdapter-object now, but I am unable to use the call of the method

IWorkspaceConnectionInteropAdapter.importChangeSet()

, which combines the calls

IWorkspaceConnection.createChangeSet()
:
IWorkspaceConnection.commit()

, because I need to create and commit new folders within the same change set - i.e. after I have created the change set but before I have finally committed the changed file. I do not want to create extra change sets just to add new folders. But as far as I understood I cannot pass more than one object in the collection of IConfigurationOp in the configOps-parameter of the importChangeSet() method that would allow me to commit / import both new folders and new file (contents) at the same time, right?

Thorsten,

The configOps collection of importChangeSet is the same collection that would be passed to IWorkspaceConnection#commit so you can certainly create new folders and files as well as change existing files.

I have now passed the IConfigurationOp-objects in an ArrayList for both files and folders (if required) to the importChangeSet() method, but I finally get a

java.lang.ArrayStoreException
    at org.eclipse.emf.common.util.BasicEList.toArray(BasicEList.java:286)
    at org.eclipse.emf.ecore.util.EcoreEList.toArray(EcoreEList.java:238)
    at com.ibm.team.scm.client.internal.FlowNodeConnection.compareTo(FlowNodeConnection.java:979)
    at com.ibm.team.scm.client.internal.FlowNodeConnection.compareTo(FlowNodeConnection.java:954)
:

when I call the method

            IChangeHistorySyncReport changeSetSync = targetWorkspace.compareTo(
                    targetStream,
                    WorkspaceComparisonFlags.CHANGE_SET_COMPARISON_ONLY,
                    currentChangeSet.changes(), monitor);

with targetStream being the target stream I finally want to deliver my change sets to and currentChangeSet the change set returned by

             IImportChangeSetResult.getChangeSet();

This is the call

            ComponentHandle componentHandles[] = (ComponentHandle[]) excludedComponents.toArray(new ComponentHandle[excludedComponents.size()]);

so I guess the currentChangeSet.changes()-List contains objects of different types (i. e. changed files and folders).

The list that is passed to the compareTo method is supposed to be a list of components to be excluded from the comparison. It appears you are passing the changes fro a change set instead.

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,936
× 411

Question asked: Feb 14 '14, 10:13 a.m.

Question was seen: 5,427 times

Last updated: Feb 19 '14, 2:09 p.m.

Confirmation Cancel Confirm