It's all about the answers!

Ask a question

How to create reference of ITeamRepository, IProjectArea and IProgressMonitor


vikrant kamble (1321185) | asked Jul 29 '15, 6:39 a.m.
 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

3 answers



permanent link
Ralph Schoon (60.5k33643) | answered Jul 29 '15, 8:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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. 

Comments
Ralph Schoon commented Jul 29 '15, 9:42 a.m. | edited Jul 29 '15, 9:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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
SEC Servizi (97122652) | answered Jul 29 '15, 9:31 a.m.
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.

permanent link
vikrant kamble (1321185) | answered Jul 30 '15, 2:24 a.m.
edited Jul 30 '15, 2:31 a.m.
 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.



Comments
Ralph Schoon commented Jul 30 '15, 3:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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