It's all about the answers!

Ask a question

Given an IProject can I determine if it is shared in RTC


Michael Baylis (1832719) | asked Aug 05 '11, 7:38 a.m.
Hi,
I am writing a eclipse plugin that will be passed an IFile and IProject. I would like to determine if the project is shared in RTC SCM, if so, what is the ITeamRepository, the workspace repository, the component.

From this information I will be able to retrieve related files that may not be loaded into the eclipse workspace.

Once I know the relevant ITeamRepository, the workspace repo and the component, I can take it from there, so just the start bit would be appreciated please.

Cheers,

Michael Baylis
IBM CICS TS System Tester
Hursley

2 answers



permanent link
Michael Baylis (1832719) | answered Aug 11 '11, 4:56 a.m.
please Jazz peps, could you lend a hand?

I've come to the conclusion that the entry path must be via the eclipse team apis, but struggling to see the way in.

Cheers

Michael

permanent link
Michael Baylis (1832719) | answered Aug 11 '11, 10:18 a.m.
Found it:-

		IShareable shareable = (IShareable)modelFile.getAdapter(IShareable.class);

if (shareable == null) {
return;
}

IProject project = modelFile.getProject();
RepositoryProvider provider = RepositoryProvider.getProvider(project);
if (provider == null) {
return;
}

try {
IShare share = shareable.getShare(new NullProgressMonitor());

System.out.println("Boo");
} catch (FileSystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}


IShare contains the information I require

I'm a happy bunny. :D

Your answer


Register or 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.