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


Michael Baylis
IBM CICS TS System Tester

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.



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

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

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

} catch (FileSystemException e) {
// TODO Auto-generated catch block

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.