当前位置: 首页>>代码示例>>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;未经允许,请勿转载。