It's all about the answers!

Ask a question

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


Jérôme RAULINE (2112) | asked Sep 04 '15, 7:33 a.m.
converted to question Sep 11 '15, 8:54 p.m. by Geoffrey Clemm (30.0k23035)
 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 ?

One answer



permanent link
Ralph Schoon (59.7k23643) | answered Sep 04 '15, 7:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

Comments
Jérôme RAULINE commented Sep 04 '15, 9:19 a.m. | edited Sep 11 '15, 8:56 p.m.

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


Ralph Schoon commented Sep 04 '15, 9:30 a.m. | edited Sep 11 '15, 8:56 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Ralph Schoon commented Sep 04 '15, 9:33 a.m. | edited Sep 11 '15, 8:56 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Ralph Schoon commented Sep 04 '15, 9:38 a.m. | edited Sep 11 '15, 8:57 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Jérôme RAULINE commented Sep 04 '15, 9:50 a.m. | edited Sep 11 '15, 8:56 p.m.

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.


Geoffrey Clemm commented Sep 11 '15, 9:00 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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 to post your answer.