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
|
3 answers
the solution:
|
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;
|
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. |
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.
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