It's all about the answers!

Ask a question

how can i search,get or fetch members by user id? RTC 402 plugin


Hakki Bozkurt (1631328) | asked Dec 24 '13, 5:00 a.m.
 Hi,

I need a solution without: 
IContributorHandle UserICon = teamRepository.contributorManager().fetchContributorByUserId(UserId, null);

Can somebody help me to this issue?

with code sample please.

Accepted answer


permanent link
sam detweiler (12.5k6195201) | answered Dec 24 '13, 6:46 a.m.
edited Dec 24 '13, 7:10 a.m.
Because the plugin extends AbstractService you have access to the getService() method.

so you can load the IContributor service.
import com.ibm.team.repository.common.service.IContributorService;

IContributorService varname = getService(IContributorService.class);

now you have access to all the fetch methods u want.

note that in your plugin xml, you must declare
"com.ibm.team.repository.common.service.IContributorService" as a required service, or you cannot load it.

amazing what u can find by looking at the plugin.xml for the repository.service plugin in the sdk.

folder (for example) rtc 4.0.3 gm/RTC-SDK-4.0.3/plugins/com.ibm.team.repository.service_1.2.1400.v20130511_2355


<prerequisites>
 <optionalService interface="com.ibm.team.repository.common.service.IContributorService"/>
</prerequisites>


Hakki Bozkurt selected this answer as the correct answer

Comments
Hakki Bozkurt commented Dec 24 '13, 7:27 a.m.
its working!

thank you for precious answer and help!

maybe, you can save my job :)

One other answer



permanent link
Deepthi Gogineni (613) | answered Oct 21 '19, 4:44 p.m.

 Hi all, i am in same situation.In my RTC 6.0.1/6.0.3 SDK i dont see com.ibm.team.repository.workitem.service,com.ibm.team.repository.service,com.ibm.team.repository.common.service .Can you please direct me what am i supposed to do?

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.