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

Is it possible to implement SCM command line using Java API?

 Hi all,
 I am using the SCM commands in my Java Program for Login to repository, fetching streams for eg  
code for Login to repository 
String Logincommand="cmd /c D:/RTC502DEV/IBM/TeamConcert/jazz/scmtools/eclipse/lscm login -r "+repositoryURI+ " -u " +userId+ " -P " +password;
Process pro=Runtime.getRuntime().exec(Logincommand);
BufferedReader r = new BufferedReader(new InputStreamReader(pro.getInputStream()));
String line;
while (true) {
       line = r.readLine();
       if (line == null) {break; }
System.out.println(line);}
From above eg. we can Login to repository. from same Logic we can also get the List of Streams of specific project.
Now I want to fetch the ichangeset Handle details like UUID ,Item Id ,state id etc. by using SCM commands. in java program . Is it  Possible to get that details using scm commands.

0 votes

Comments

The LSCM command is designed to be called using a shell or command window. My assumption is, that you will have to do that and parse the data that is returned in the standard out. There might be a way to call LSCM directly from the libraries, but I have never attempted to do that and don't have specific suggestions at the moment. I would likely try to find the main method that is called from looking at the libraries in Eclipse and try where that leads me.



2 answers

Permanent link

 Hi shweta,

While excecuting lscm show status using using java api, it is returning null. Can you tell me what am i missing.

0 votes


Permanent link
The Java API can be used to access such data. See https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ and the related posts.
You can cal LSCM or the SCM commandline as a process and then you can parse the text output see the LSCM reference.

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,927
× 113

Question asked: Jan 20 '16, 4:43 a.m.

Question was seen: 3,849 times

Last updated: Jan 22 '20, 12:25 a.m.

Confirmation Cancel Confirm