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

What is the java API to check the loaded project in sandbox belong to which RTC component.

Hello,

I have project loaded from RTC component into my sandbox (Project Explorer) and
I want java code to find out the RTC component details -( names, number of baselines).

0 votes


Accepted answer

Permanent link

-Files/folders in Eclipse are of type:org.eclipse.core.resources.IResource

-You can adapt these to an IShareable using:
   IShareable shareable = (IShareable) fileResource.getAdapter(IShareable.class);

-You can figure out which IShare (which is the share root folder) a given file belongs to using the following: (Note: This is normally n Eclipse Project folder)
   IShare share = shareable .getShare(monitor);

-From an IShare, you can get the ISharingDescriptor using the code below. This can give you the repository, workspace context, and component.
ISharingDescriptor sharingDescriptor = share.getSharingDescriptor();

-Most of the other API that you may want can be found in IWorkspaceConnection, as shown below. This will have API for retrieving the list of components (see: #getComponents()) or list of baselines (see: #getBaselinesInHistory()).
   ScmPlatform.getWorkspaceManager(repo).getWorkspaceConnection(workspaceHandle, monitor);

Swapnil Sahu selected this answer as the correct answer

0 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
× 1,202
× 56
× 38
× 14

Question asked: Jul 04 '17, 12:43 a.m.

Question was seen: 2,654 times

Last updated: Jul 05 '17, 2:30 p.m.

Confirmation Cancel Confirm