RTC approval
hi me name is kim.
I'm styding server -side of RTC API
i know create approval through contributor-id but
i'd like to find contributor-id through contributor-name
and then i'd like to create approval through contributor-id
i can't find contributorManager of server-side...
this is my client approval source.
String user = "KIM";
IContributorHandle contributorHandle = null;
IContributorManager ctm = repo.contributorManager();
List<IContributor> contributors = ctm.fetchAllContributors(monitor);
for (IContributor contributor : contributors) {
if (contributor.getName().equals(user)) {
contributorHandle = (IContributorHandle) contributor
.getItemHandle();
}
}
IApprovals approvals = workItem.getApprovals();
IApprovalDescriptor descriptor = approvals.createDescriptor(
WorkItemApprovals.APPROVAL_TYPE.getIdentifier(),"comment");
IApproval approval = approvals.createApproval(descriptor,contributorHandle);
approvals.add(approval);
One answer
Kim, the Server side API looks like this:
IContributorService contributorService = getService(IContributorService.class);
IContributorHandle approver = contributorService.fetchContributorByUserId(getApproverFromOwner(newState.getOwner()));
There seems to be no fetch for all contributors. You would have to get the project area and the team areas or another service to get all contributors.
You can use the Eclipse Plugin Development environment to search the SDK for information such as contributor handles returned by a call.
IContributorService contributorService = getService(IContributorService.class);
IContributorHandle approver = contributorService.fetchContributorByUserId(getApproverFromOwner(newState.getOwner()));
There seems to be no fetch for all contributors. You would have to get the project area and the team areas or another service to get all contributors.
You can use the Eclipse Plugin Development environment to search the SDK for information such as contributor handles returned by a call.