It's all about the answers!

Ask a question

com.ibm.team.repository.client


Hakki Bozkurt (1631126) | asked Dec 23 '13, 7:28 a.m.
 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


Comments
sam detweiler commented Dec 23 '13, 11:34 a.m.

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
sam detweiler (12.5k6189201) | answered Dec 23 '13, 11:32 a.m.
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.



permanent link
Hakki Bozkurt (1631126) | answered Dec 24 '13, 3:35 a.m.
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;

Comments
sam detweiler commented Dec 24 '13, 6:47 a.m.

see my answer to your other question


Your answer


Register or to post your answer.