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

IContributorHandle to IContributor

Hi,

I tried several ways to find a client that will give me IContributor from an IContributorHandle. I tried different clients(e.g. IWorkItemClient, IProcessClientService) using getClientLibrary() the function.

It would be very helpful if someone can let me know which cilent interface to use to achieve it.

Thanks.

Regards,
Abhishek

0 votes


Accepted answer

Permanent link
Hi
Every handle class has a corresponding Item class where the 'full info' is available (handle is just some sort of pointer). You can use the IItemManager (ITeamRepository#itemManager()) to resolve a handle to an item (e.g. from IContributorHandle to IContributor).

Regards

Marcel
Jazz Work Item team
Ralph Schoon selected this answer as the correct answer

0 votes

Comments

ITeamRepository belongs to the client libraries. How do you do it on the server side ?

PB


One other answer

Permanent link
 Example code:

IProgressMonitor monitor = new SysoutProgressMonitor();
repo = login(monitor);

System.out.println("Admin: " + repo.contributorManager().fetchContributorByUserId("admin", monitor).getDetails().toString());

ILicenseAdminService licAdminService = (ILicenseAdminService) ((TeamRepository) repo).getServiceInterface(ILicenseAdminService.class);

List<IContributorLicenseType> lList = new ArrayList<IContributorLicenseType>(Arrays.asList(licAdminService.getLicenseTypes()));

for (Iterator<IContributorLicenseType> itContributor = lList.iterator(); itContributor.hasNext();) {
IContributorLicenseType iLT = itContributor.next();
System.out.println("Nome: " + iLT.getName() + ", " + iLT.getId() + " " + lList.size());
IContributorHandle[] iCH = licAdminService.getLicensedContributors(iLT.getId());

for (int i = 0; i < iCH.length; i++) {
IContributor contributor = (IContributor) repo.itemManager().fetchCompleteItem(iCH[i], IItemManager.DEFAULT, monitor);
System.out.println("User name: " + contributor.getName());
}
}

0 votes

Comments

A lot of those basic quastions are answered in this post: https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ and in other posts on that blog.

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

Question asked: May 29 '09, 1:33 a.m.

Question was seen: 9,609 times

Last updated: Jan 27 '15, 8:45 a.m.

Confirmation Cancel Confirm