It's all about the answers!

Ask a question

Reading the list of project Area


0
1
m sawires (1462268) | asked Aug 19 '09, 11:55 a.m.
Hello,
I'd like to know how to read a list of project area once I have a repository connection.
It looks like I need to use the api "fetchCompleteItems" but how should I initialize the list of itemHandle to return

repo.itemManager().fetchCompleteItems(projectAreaList, IItemManager.DEFAULT, monitor);


Any help is welcome. Thanks

12 answers



permanent link
Kevin Gu (17131) | answered Dec 28 '11, 2:55 a.m.
JAZZ DEVELOPER
Hi,
Thanks for replay..

findProcessArea method is throwing error when I give ProjectArea name as String. I suppose it needs areaURI in string format.
I tried with different options

URI.create("https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/_cgoIABWmEeGnN4lxE3OfSw"))
other than UUID i give project name then it is giving error invalied URI.
https://radhikabandari.in.ibm.com:9443/ccm/projectareaname
https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/projectareaname

Any help..

Regards,
Radhika


Hi,

Here is parameter description:
Returns the process area for the given URI. URIs have been chosen for future extensibility. Currently only hierarchical URIs are supported. Only the path segment of the hierarchical URI is considered. The first segment should be the name of a project area, the following segments should be the names of team areas.

You could pass new URI(ProjectAreaName), e.g. new URI("prj1").

Kevin
Jazz Foundation Process Team

permanent link
radhika bandari (10675) | answered Dec 23 '11, 6:45 a.m.
Hi,
Thanks for replay..

findProcessArea method is throwing error when I give ProjectArea name as String. I suppose it needs areaURI in string format.
I tried with different options

URI.create("https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/_cgoIABWmEeGnN4lxE3OfSw"))
other than UUID i give project name then it is giving error invalied URI.
https://radhikabandari.in.ibm.com:9443/ccm/projectareaname
https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/projectareaname

Any help..

Regards,
Radhika

permanent link
Henry Armburg Jennings (13076) | answered Dec 23 '11, 5:28 a.m.
Sorry Radhika, I don't know what the server libraries are, I just use anything that ships with the JPJC library which I suppose is designed for clients.

permanent link
Kevin Gu (17131) | answered Dec 23 '11, 5:26 a.m.
JAZZ DEVELOPER
Hi,

I need to work with server libraries only. I am not supposed use client libraries com.ibm.team.process.client.ProcessClient;
com.ibm.team.process.client.IProcessItemService...because I will be deploying the plugin on server.
Can you please suggest me some code using server libraries.

Thank you,
Radhika


Hi Radhika,

I think Martha has already provided the answer, IProcessService is exactly a server side service, what you need to do are:

1. Define your own service that extends AbstractService.
2. Add com.ibm.team.process.internal.common.service.IProcessService as prerequisite.
3. Call getService(IProcessService.class) in your own service, and then follow Martha's instruction to get project area information.

Kevin
Jazz Foundation Process Team

permanent link
radhika bandari (10675) | answered Dec 22 '11, 11:12 p.m.
Hi,

I need to work with server libraries only. I am not supposed use client libraries com.ibm.team.process.client.ProcessClient;
com.ibm.team.process.client.IProcessItemService...because I will be deploying the plugin on server.
Can you please suggest me some code using server libraries.

Thank you,
Radhika

permanent link
Martha (Ruby) Andrews (3.0k44251) | answered Dec 22 '11, 6:04 p.m.
JAZZ DEVELOPER
Hello Sam,

Try using IProcessService#findProcessArea(String, String[])
The first argument is simply the name of the project. The second argument is the array of properties you want the project area to have. This will return the project area, not its handle.
See the javadoc on the method for more details.

Martha
Jazz Developer, Process Team

URI.create("https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/_cgoIABWmEeGnN4lxE3OfSw"

thats the wrong URI.. they never will include the server address..

you may have to look thru the source to get the right URI syntax.

Sam

permanent link
Henry Armburg Jennings (13076) | answered Dec 22 '11, 8:46 a.m.
Hi Radhika,

You shouldn't need to find the project area by its full URI. Connecting to the repository should get you the ITeamRepository object for "https://radhikabandari.in.ibm.com:9443/ccm" and then it looks like this is the UUID of the project area "_cgoIABWmEeGnN4lxE3OfSw" so search for the project area by UUID. Here is a method that I wrote which gets it by name, I'm sure you could pass it the UUID instead of the name:

    public static IProjectArea getProjectArea(ITeamRepository repo,IProgressMonitor monitor,String projectAreaName) throws TeamRepositoryException{


IProcessItemService service = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class);
List projectAreas = service.findAllProjectAreas(null, monitor);

int projectAreasSize = projectAreas.size();
for(int i = 0; i < projectAreasSize; i++){
IProjectArea projectArea = (IProjectArea)projectAreas.get(i);
if(projectArea.getName().equals(projectAreaName)){
System.out.println("Found " + projectAreaName);
IProjectArea desiredProject = projectArea;
return desiredProject;
}
else if(i + 1 == projectAreasSize){
System.out.println("Failed to find '" + projectAreaName + "'");
return null;
}
}
return null;
}


Let me know if it works,

Henry

permanent link
sam detweiler (12.5k6195201) | answered Dec 22 '11, 8:26 a.m.
URI.create("https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/_cgoIABWmEeGnN4lxE3OfSw"

thats the wrong URI.. they never will include the server address..

you may have to look thru the source to get the right URI syntax.

Sam

permanent link
radhika bandari (10675) | answered Dec 22 '11, 6:55 a.m.
Hi,

I want to get the projectAreaHandle of a specific project using plan java code(Serve libraries only, need to deploy Operation advisor in server).
I tried below code

IProcessService IPS = getService(IProcessService.class);
IProcessServerService processService = getService(IProcessServerService.class);
String uri = processService.getURIForProcessArea(ipah1);
System.out.println("URI........."+uri);
IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();
IProjectArea projectArea2 = (IProjectArea)iac.findProcessAreaByURI(URI.create("https://radhikabandari.in.ibm.com:9443/ccm/process/project-areas/_cgoIABWmEeGnN4lxE3OfSw"), ItemProfile.PROJECT_AREA_FULL, monitor);

The method findProcessAreaByURI() is returning null.
Any help would be appreciated.

Thanks & Regards
Radhika

permanent link
m sawires (1462268) | answered Aug 19 '09, 12:33 p.m.
I think I got it using

IProcessItemService client = (IProcessItemService) repo.getClientLibrary(IProcessItemService.class);


List projectAreas = client.findAllProjectAreas(IProcessClientService.ALL_PROPERTIES, null);

Your answer


Register or 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.