It's all about the answers!

Ask a question

IContributorHandle to IContributor


Abhishek Minde (7121912) | asked May 29 '09, 1:33 a.m.
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

Accepted answer


permanent link
Marcel Bihr, Jazz Work Item team (1.4k) | answered May 29 '09, 10:19 a.m.
JAZZ DEVELOPER
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

Comments
Pierre-Benoit Besse commented Nov 28 '12, 3:45 a.m.

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

PB

One other answer



permanent link
Rafael Pirolla (1649) | answered Jan 27 '15, 8:30 a.m.
edited Jan 27 '15, 8:31 a.m.
 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());
}
}

Comments
Ralph Schoon commented Jan 27 '15, 8:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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