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

How do I automate Repository / Workspace / Component for sharing a project in Jazz source control programatically?

 Hello,

I'm trying automate sharing a project in Jazz source control programmatically.
(See question: https://jazz.net/forum/questions/127723).
I found that I can call the standard Eclipse Wizard :
Shell shell = ...
IProject myProject = ...
org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard.shareProjects(shell, new IProject[] { myProject });
	
	

or the IBM specific one 

IWorkbench workbench = ...;
com.ibm.team.internal.filesystem.ui.wizards.sharing.SharingWizard sharingWizardRTC = new SharingWizard();
sharingWizardRTC.init(workbench, myProject);
WizardDialog dialog = new WizardDialog(shell, sharingWizardRTC);
dialog.open();

But I'd like to automate que Repository / Workspace / Component selection, and don't know how.
Any idea ?

0 votes



One answer

Permanent link
All code I have is described in
https://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/
https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/
https://rsjazz.wordpress.com/2013/09/30/delivering-change-sets-and-baselines-to-a-stream-using-the-plain-java-client-libraries/
https://rsjazz.wordpress.com/2013/10/15/extracting-an-archive-into-jazz-scm-using-the-plain-java-client-libraries/

The 3rd post shares files from a zip file directly into RTC SCM. This should be very similar, if the files are on disk.

0 votes

Comments

 Well,


I know how to do it using the plain java clients library. But from my own plugin/pluglet in Eclipse.
I'm not trying to extend the RTC Client in Eclipse. So I don't have an object from wich I can get a ITeamReposiry from the "getOrigin" method.

My exact use case is :
I have an eclipse project already shared in RTC an loaded in my eclipse workspace. My pluglet is to automate a bunch of operations I have to do on multiples RTC Components. One of the operation consist in creating a new Eclipse project and add it to the component.
I have a handle on the already shared project, an org.eclipse.core.resources.IProject. I don't know how to extract sharing details that I can see on the property page "Jazz Source Control", and then share my new eclipse project in the same repository/workspace/component.

I hope it's possible :)

If you are in a plain RTC, it comes down to using the Plain Java Client Libraries and/or the RTC SDK. If you (your Eclipse) are not connected to the repository, you will have to connect yourself and handle all the stuff the RTC SCM Eclipse extension handles.

PS, if you open a new question on an answered question (which you should not) and don't specify your new question accordingly (which you should) you should not wonder if the answers you get are in the context of the existing question/answer.

Please create your own question next time.

Another option would be to use the RTC SCM command line from within your context. It also would need to connect to the repository and require the URL, a user name and a password.

I think my question is exactly the same as the first one : automate in Eclipse the Sharing of a project.

I added some code to help other developers to do it.
Since my answer is not full automated (need to manually select component in a wizard), I'm asking for a more precise answer.

If it is a follow-up question to the answer, then it sometimes is appropriate to post the follow-up question as a comment to that answer (although it becomes less likely you'll get an answer, because some posters only look for "unanswered questions).   It is never appropriate to post a follow-up question as an "answer" to a previous question.

showing 5 of 6 show 1 more comments

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

Question asked: Sep 04 '15, 7:33 a.m.

Question was seen: 3,011 times

Last updated: Sep 11 '15, 9:00 p.m.

Confirmation Cancel Confirm