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

How to create reference of ITeamRepository, IProjectArea and IProgressMonitor

 Hi All,
I am following this link "https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/" 
I am getting trouble in main method. It is asking me to create objects of TeamRepository, IProjectArea and IProgressMonitor.
for IProgressMonitor I found following way to create object.
"IProgressMonitor monitor = new NullProgressMonitor();"
but I am unable to figure out how to create objects of ITeamRepository and IProjectArea.
can anyone please tell me how can I do this in this context.


Thanks

0 votes



3 answers

Permanent link
See the code for main in https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ or download any code attached to any of the client API example e.g. https://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ or look into https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation the Plain-Java Client section or look into the snippets that come with the Plain Java API for example code for the basics needed in main. 

0 votes

Comments

How to create a project area is described here: https://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/ which is actually the post that is mentioned to be read in the one you mention and that shows how to create a project area and also shows the other code you are missing. Usually you don't create them, but you search for them as explained in other posts in the blog.


Permanent link
but I am unable to figure out how to create objects of ITeamRepository and IProjectArea.
If you are using Plain Java API, you obtain the ITeamRepository instance logging in to the repository:
ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repoURI);
repo.registerLoginHandler(new LoginHandler(userId, password));
repo.login(monitor);
You can refer to https://jazz.net/wiki/bin/view/Main/BuildJavaProgrammingExamples#First_things_First_Connecting_to for a fully Java client example.
Once you got the repo connection, you can obtain a IProjectArea instance from a project area name using the repository client services:
IProcessClientService processClient = (IProcessClientService) repo.getClientLibrary(IProcessClientService.class);
URI uri = URI.create(prjAreaName.replaceAll(" ", "%20"));
IProjectArea prjArea = (IProjectArea) processClient.findProcessArea(uri, IProcessClientService.ALL_PROPERTIES, monitor);
You will find a lot of examples on
wiki as well as on forum! And on Ralph Schoon's blog, too ;)
Cheers.

0 votes


Permanent link
 Hi,
I looked into some example to learn how to create ITeamRepository and IProjectArea object. 
In many example I seen them declared exact same way "SEC Servizi" mentioned in his answer. That was useful. Example provided on "https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/" link I tried to run it.
 
I figured that new three components will be created but as my code is not running properly I am unable to see its output.
Could anybody please tell me what happens when we run this code.


0 votes

Comments

This is an iterative process.

  1. You set up your environment for debugging.
  2.  You start with the snippets that come with the Plain Java Client Libraries
  3. You download examples that work and have a description how they work
  4. You play around with the examples in debug mode and understand how they work
  5. You get adventurous and start your own examples based on the existing code

This is something you have to do on your own. Doing this on the forum, if you have not even understood the very basics is just not possible.



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,953

Question asked: Jul 29 '15, 6:39 a.m.

Question was seen: 4,752 times

Last updated: Jul 30 '15, 3:14 a.m.

Confirmation Cancel Confirm