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

com.ibm.team.repository.client

 Hi,
We are trying to develop a plugin, and that needs to get members by user id. 
But its not working serverside.

i add: 
"import com.ibm.team.repository.client.ITeamRepository" in advisor.java
and i add
com.ibm.team.repository.client in dependencies

and i want to use this codes:
ITeamRepository teamRepository = (ITeamRepository) currentOwner.getOrigin();
IContributorHandle User = teamRepository.contributorManager().fetchContributorByUserId("sample UI", null);

it isnt give any error but export plugin and restart tomcat its not working. 
delete adding and codes. try again export and restart its working.

do you have any idea? please help me

0 votes

Comments

also, you can never use and .client methods in a plugin. those are client side only.

the design is

com.ibm.team.xxx.client  --- client only
com.ibm.team.xxx.common --- client/and/or server
com.ibm.team.xxx.service  --- server only



3 answers

Permanent link
in the advisor plugin, the AdvisableOperation operation, parameter contains other objects

operation.getProcessArea().getMembers();

has a list of all the members of this project.
in the data is a link to the Auditable service

IAuditableCommon iac = ((ISaveParameter) data).getSaveOperationParameter().getAuditableCommon();

using the audiatble object and the contributor handles,  you can retrieve the contributor records to get their info.


0 votes


Permanent link
hi sam,
thanks for your answer, but i need to use "fetchContributorByUserId" or other way to search and get by user id

my imports:

package methodologyadvisor;

import java.util.List;

import org.eclipse.core.runtime.IProgressMonitor;

import services.GetConstraint;
import services.GetConstraintProxy;
import services.GetConstraintServiceLocator;
import services.IdealRule;

import java.rmi.RemoteException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.xml.rpc.ServiceException;

import com.ibm.team.links.common.IReference;
import com.ibm.team.links.common.registry.IEndPointDescriptor;
import com.ibm.team.process.common.IProcessConfigurationElement;
import com.ibm.team.process.common.advice.AdvisableOperation;
import com.ibm.team.process.common.advice.IAdvisorInfo;
import com.ibm.team.process.common.advice.IAdvisorInfoCollector;
import com.ibm.team.process.common.advice.runtime.IOperationAdvisor;
import com.ibm.team.repository.client.ITeamRepository;
import com.ibm.team.repository.common.IAuditable;
import com.ibm.team.repository.common.IContributor;
import com.ibm.team.repository.common.IContributorHandle;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.repository.service.AbstractService;
import com.ibm.team.repository.service.IRepositoryItemService;
import com.ibm.team.workitem.common.IAuditableCommon;
import com.ibm.team.workitem.common.ISaveParameter;
import com.ibm.team.workitem.common.model.IApproval;
import com.ibm.team.workitem.common.model.IApprovalDescriptor;
import com.ibm.team.workitem.common.model.IApprovals;
import com.ibm.team.workitem.common.model.IWorkItem;
import com.ibm.team.workitem.common.model.IWorkItemHandle;
import com.ibm.team.workitem.common.model.WorkItemApprovals;
import com.ibm.team.workitem.common.model.IWorkItemReferences;

0 votes

Comments

see my answer to your other question


Permanent link
 the solution: 

0 votes

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
× 70

Question asked: Dec 23 '13, 7:28 a.m.

Question was seen: 6,104 times

Last updated: May 21 '15, 8:08 a.m.

Confirmation Cancel Confirm