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

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

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

0 votes



2 answers

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

0 votes


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

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
× 10,951

Question asked: Aug 05 '11, 7:38 a.m.

Question was seen: 4,831 times

Last updated: Aug 05 '11, 7:38 a.m.

Confirmation Cancel Confirm