當前位置: 首頁>>代碼示例>>Java>>正文


Java IWorkItemReferences類代碼示例

本文整理匯總了Java中com.ibm.team.workitem.common.model.IWorkItemReferences的典型用法代碼示例。如果您正苦於以下問題:Java IWorkItemReferences類的具體用法?Java IWorkItemReferences怎麽用?Java IWorkItemReferences使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IWorkItemReferences類屬於com.ibm.team.workitem.common.model包,在下文中一共展示了IWorkItemReferences類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleAttachments

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
/**
    * make sure that all attachments will be moved to the new project area
    * @param sourceWorkItem the original work item to which the attachments have belonged to
    * @param targetWorkItem work item object is it will be available in the target pa after movement
    * @param workItemCommon common service
    * @param progressMonitor progress monitor
    * @throws TeamRepositoryException whenever an attachment can't be moved
    */
@Override
protected void handleAttachments(IWorkItem sourceWorkItem, IWorkItem targetWorkItem, IWorkItemCommon workItemCommon,
		IProgressMonitor progressMonitor) throws TeamRepositoryException {
	ILinkServiceLibrary lsl = (ILinkServiceLibrary) this.service.getService(ILinkService.class)
               .getServiceLibrary(ILinkServiceLibrary.class);
	IWorkItemReferences references = workItemCommon.resolveWorkItemReferences(sourceWorkItem, monitor);
       for (IReference attachmentReference : references.getReferences(WorkItemEndPoints.ATTACHMENT)) {
           if (!attachmentReference.isItemReference()) continue;
           IAttachmentHandle attachmentHandle = (IAttachmentHandle)((IItemReference)attachmentReference)
                   .getReferencedItem();
           IAttachment attachment = workItemCommon.getAuditableCommon()
                   .resolveAuditable(attachmentHandle, IAttachment.SMALL_PROFILE, monitor);
           if (commitChanges) {
               this.moveAttachment(targetWorkItem, workItemCommon, attachment);
               continue;
           }
           this.checkAttachmentReferences(attachmentReference, lsl.findLinksBySource(attachmentReference), sourceWorkItem);
           this.checkAttachmentReferences(attachmentReference, lsl.findLinksByTarget(attachmentReference), sourceWorkItem);
       }
}
 
開發者ID:jazz-community,項目名稱:rtc-workitem-bulk-mover-service,代碼行數:29,代碼來源:BulkMoveOperation.java

示例2: saveAttachements

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
public void saveAttachements(IWorkItem workItem) {
  IWorkItemCommon common = (IWorkItemCommon) repo.getClientLibrary(IWorkItemCommon.class);
  IWorkItemReferences workitemReferences;
  try {
    workitemReferences = common.resolveWorkItemReferences(workItem, null);
    List<IReference> references = workitemReferences.getReferences(WorkItemEndPoints.ATTACHMENT);
    for (IReference iReference : references) {
      IAttachmentHandle attachHandle = (IAttachmentHandle) iReference.resolve();
      IAuditableClient auditableClient = (IAuditableClient) repo.getClientLibrary(IAuditableClient.class);
      IAttachment attachment = auditableClient.resolveAuditable(attachHandle, IAttachment.DEFAULT_PROFILE, null);
      saveAttachment(workItem.getId(), attachment);
    }
  } catch (TeamRepositoryException | IOException e) {
    LOGGER.warning("Cannot download attachement for WorkItem " + workItem.getId() + "(" + e.getMessage() + ")");
  }
}
 
開發者ID:rtcTo,項目名稱:rtc2jira,代碼行數:17,代碼來源:AttachmentHandler.java

示例3: prepareTargetLink

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
@Override
public void prepareTargetLink(final IWorkItemReferences targetReferences, IEndPointDescriptor endPoint, IReference sourceValue, final EvaluationContext context, final IProgressMonitor monitor) throws TeamRepositoryException {
	IWorkItemHandle sourceHandle= (IWorkItemHandle)((IItemReference)sourceValue).getReferencedItem();
	IWorkItemHandle targetHandle= context.sourceContext.getPair(sourceHandle);
	if (targetHandle == null) {
		return;
	}

	for (IReference reference : targetReferences.getReferences(endPoint)) {
		if (((IItemReference)reference).getReferencedItem().sameItemId(sourceHandle)) {
			return;
		}
	}

	targetReferences.add(endPoint, IReferenceFactory.INSTANCE.createReferenceToItem(targetHandle));
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:17,代碼來源:WorkItemLinkProcessor.java

示例4: copyLinks

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
private void copyLinks(List<WorkItemWorkingCopy> targets, SubMonitor linksMonitor) throws TeamRepositoryException {
	if (fContext.configuration.copyLinks || fContext.configuration.copyAttachments) {
		int counter= 1;
		for (WorkItemWorkingCopy target : targets) {
			SubMonitor singleMonitor= linksMonitor.newChild(1);
			String preparingMessage= "Copying links " + (fContext.configuration.copyAttachments ? "with attachments " : "");
			singleMonitor.setTaskName(preparingMessage + "(" + counter + " of " + targets.size() + ")");

			IWorkItemReferences sourceReferences= fContext.sourceContext.workingCopyManager.getWorkingCopy(fContext.targetContext.getPair(target.getWorkItem())).getReferences();
			IWorkItemReferences targetReferences= target.getReferences();
			for (IEndPointDescriptor endPoint : getEndPointsToCopy(sourceReferences)) {
				updateEndPoint(sourceReferences, targetReferences, endPoint, singleMonitor);
			}
			fContext.sourceContext.itemResolver.execute(singleMonitor);
			fContext.targetContext.itemResolver.execute(singleMonitor);

			if (!targetReferences.getChangedReferenceTypes().isEmpty()) {
				target.save(linksMonitor.newChild(1));
			}
			counter++;
		}
		linksMonitor.done();
	}
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:25,代碼來源:CopyWorkItemsJob.java

示例5: copyAttachments

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
private void copyAttachments(IWorkItemReferences targetReferences, IAttachment sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
	File file= new File(sourceValue.getName());
	OutputStream stream;
	try {
		stream= new FileOutputStream(file);
	} catch (FileNotFoundException e) {
		throw new TeamRepositoryException(e);
	}
	context.sourceContext.contentManager.retrieveContent(sourceValue.getContent(), stream, SubMonitor.convert(monitor, 1));
	targetReferences.add(WorkItemEndPoints.ATTACHMENT, com.ibm.team.workitem.rcp.ui.internal.util.Utils.createReference(file));
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:12,代碼來源:AttachmentProcessor.java

示例6: getEndPointsToCopy

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
private List<IEndPointDescriptor> getEndPointsToCopy(IWorkItemReferences sourceReferences) {
	if (fContext.configuration.copyLinks) {
		List<IEndPointDescriptor> all= new ArrayList<IEndPointDescriptor>(sourceReferences.getTypes());
		if (!fContext.configuration.copyAttachments) {
			all.remove(WorkItemEndPoints.ATTACHMENT);
		}
		return all;
	}
	return Collections.singletonList(WorkItemEndPoints.ATTACHMENT);
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:11,代碼來源:CopyWorkItemsJob.java

示例7: updateEndPoint

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
private void updateEndPoint(IWorkItemReferences source, IWorkItemReferences target, IEndPointDescriptor endPoint, IProgressMonitor monitor) throws TeamRepositoryException {
	ILinkProcessor processor= LinkProcessors.getProcessor(endPoint);
	if (processor != null) {
		for (IReference reference : source.getReferences(endPoint)) {
			processor.prepareTargetLink(target, endPoint, reference, fContext, monitor);
		}
	}
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:9,代碼來源:CopyWorkItemsJob.java

示例8: prepareTargetLink

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
@Override
public void prepareTargetLink(IWorkItemReferences targetReferences, IEndPointDescriptor endPoint, IReference sourceValue, EvaluationContext context, IProgressMonitor progressMonitor) throws TeamRepositoryException {
	targetReferences.add(endPoint, IReferenceFactory.INSTANCE.createReferenceFromURI(sourceValue.createURI()));
}
 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:5,代碼來源:URILinkProcessor.java

示例9: getWorkItemReferences

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
/**
    * Make sure that all work item references are being resolved properly
    * @param workItem the work item for which we will be resolving all its references
    * @param workItemCommon common service
    * @param monitor progress monitor
    * @return list of resolved references
    * @throws TeamRepositoryException in case of an error
    */
@Override
protected IWorkItemReferences getWorkItemReferences(IWorkItem workItem, IWorkItemCommon workItemCommon,
		IProgressMonitor monitor) throws TeamRepositoryException {
	return workItemCommon.resolveWorkItemReferences(workItem, null);
}
 
開發者ID:jazz-community,項目名稱:rtc-workitem-bulk-mover-service,代碼行數:14,代碼來源:BulkMoveOperation.java

示例10: prepareTargetLink

import com.ibm.team.workitem.common.model.IWorkItemReferences; //導入依賴的package包/類
public void prepareTargetLink(IWorkItemReferences targetReferences, IEndPointDescriptor endPoint, IReference sourceValue, EvaluationContext context, IProgressMonitor progressMonitor) throws TeamRepositoryException; 
開發者ID:sandy081,項目名稱:Copy-Work-Items,代碼行數:2,代碼來源:ILinkProcessor.java


注:本文中的com.ibm.team.workitem.common.model.IWorkItemReferences類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。