本文整理汇总了Java中com.ibm.team.repository.common.TeamRepositoryException类的典型用法代码示例。如果您正苦于以下问题:Java TeamRepositoryException类的具体用法?Java TeamRepositoryException怎么用?Java TeamRepositoryException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TeamRepositoryException类属于com.ibm.team.repository.common包,在下文中一共展示了TeamRepositoryException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setAttributeForWorkItem
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@SuppressWarnings("restriction")
public void setAttributeForWorkItem(IWorkItem targetWorkItem, String attributeId, String valueId) throws TeamRepositoryException {
IProjectAreaHandle paHandle = targetWorkItem.getProjectArea();
IAttribute attribute = workItemServer.findAttribute(paHandle, attributeId, monitor);
Identifier<IAttribute> identifier = WorkItemAttributes.getPropertyIdentifier(attribute.getIdentifier());
if(valueId != null) {
if (WorkItemAttributes.RESOLUTION.equals(identifier)) {
ResolutionHelpers.setResolution(targetWorkItem, valueId, workItemServer, monitor);
} else if (WorkItemAttributes.STATE.equals(identifier)) {
StateHelpers.setState(targetWorkItem, valueId, workItemServer, monitor);
} else if (WorkItemAttributes.CATEGORY.equals(identifier)) {
CategoryHelpers.setCategory(targetWorkItem, valueId, workItemServer, monitor);
} else if (WorkItemAttributes.TARGET.equals(identifier)) {
TargetHelpers.setTarget(targetWorkItem, valueId, workItemServer);
} else if (WorkItemAttributes.VERSION.equals(identifier)) {
FoundInHelpers.setFoundIn(targetWorkItem, valueId, workItemServer, monitor);
} else if(EnumerationHelpers.isValidEnumerationLiteral(attribute)) {
EnumerationHelpers.setEnumerationLiteral(targetWorkItem, attributeId, valueId, workItemServer, monitor);
}
}
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:23,代码来源:AttributeHelpers.java
示例2: execute
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
public void execute() throws IOException, URISyntaxException, AuthenticationException {
String pa = restRequest.getParameterValue("project-area");
Map<String, JsonElement> typeMap = new TreeMap<String, JsonElement>();
try {
IProjectAreaHandle targetArea = ProjectAreaHelpers.getProjectArea(pa, parentService);
if(targetArea == null) {
response.setStatus(400);
return;
}
IWorkItemServer serverService = parentService.getService(IWorkItemServer.class);
List<IWorkItemType> types = WorkItemTypeHelpers.getWorkItemTypes(targetArea, serverService, new NullProgressMonitor());
for(IWorkItemType type : types) {
JsonObject typeObject = new JsonObject();
typeObject.addProperty("id", type.getIdentifier());
typeObject.addProperty("name", type.getDisplayName());
typeMap.put(type.getDisplayName(), typeObject);
}
} catch (TeamRepositoryException e) {
response.setStatus(500);
}
response.getWriter().write(new Gson().toJson(typeMap.values()));
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:23,代码来源:ProjectAreaTypeService.java
示例3: addResolutionsAsValues
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
static List<AttributeValue> addResolutionsAsValues(IProjectAreaHandle pa,
IWorkItemServer workItemServer, IProgressMonitor monitor) throws TeamRepositoryException {
List<AttributeValue> values = new ArrayList<AttributeValue>();
ICombinedWorkflowInfos workFlowInfo = workItemServer.findCachedCombinedWorkflowInfos(pa);
if (workFlowInfo == null) {
workFlowInfo = workItemServer.findCombinedWorkflowInfos(pa, monitor);
}
Identifier<IResolution>[] arridentifier = workFlowInfo.getAllResolutionIds();
int n = arridentifier.length;
int n2 = 0;
while (n2 < n) {
Identifier<IResolution> resolutionId = arridentifier[n2];
String name = workFlowInfo.getResolutionName(resolutionId);
String id = resolutionId.getStringIdentifier();
values.add(new AttributeValue(id, name));
++n2;
}
return values;
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:20,代码来源:ResolutionHelpers.java
示例4: getCurrentValueRepresentation
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@SuppressWarnings("restriction")
public AttributeValue getCurrentValueRepresentation(IAttribute attribute, IWorkItem workItem) throws TeamRepositoryException {
IAuditableServer auditSrv = workItemServer.getAuditableServer();
Object attributeValue = attribute.getValue(auditSrv, workItem, monitor);
Identifier<IAttribute> identifier = WorkItemAttributes.getPropertyIdentifier(attribute.getIdentifier());
AttributeValue value = new AttributeValue("", "");
if(attributeValue != null) {
if (WorkItemAttributes.RESOLUTION.equals(identifier)) {
value = ResolutionHelpers.getResolution(attributeValue, workItem, workItemServer, monitor);
} else if (WorkItemAttributes.STATE.equals(identifier)) {
value = StateHelpers.getState(attributeValue, workItem, workItemServer, monitor);
} else if (WorkItemAttributes.CATEGORY.equals(identifier)) {
value = CategoryHelpers.getCategory(attributeValue, workItemServer, teamRawService, monitor);
} else if (WorkItemAttributes.TARGET.equals(identifier)) {
value = TargetHelpers.getTarget(attributeValue, auditSrv, teamRawService, monitor);
} else if (WorkItemAttributes.VERSION.equals(identifier)) {
value = FoundInHelpers.getFoundIn(attributeValue, teamRawService);
} else if(EnumerationHelpers.isValidEnumerationLiteral(attribute)) {
value = EnumerationHelpers.getEnumerationLiteral(attribute, attributeValue, workItemServer, monitor);
}
}
return value;
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:25,代码来源:AttributeHelpers.java
示例5: getAvailableOptionsPresentations
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@SuppressWarnings("restriction")
public List<AttributeValue> getAvailableOptionsPresentations(IAttribute attribute, IWorkItem workItem) throws TeamRepositoryException {
IProjectAreaHandle pa = workItem.getProjectArea();
List<AttributeValue> values;
Identifier<IAttribute> identifier = WorkItemAttributes.getPropertyIdentifier(attribute.getIdentifier());
if (WorkItemAttributes.RESOLUTION.equals(identifier)) {
values = ResolutionHelpers.addResolutionsAsValues(pa, workItemServer, monitor);
} else if (WorkItemAttributes.STATE.equals(identifier)) {
values = StateHelpers.addStatesAsValues(pa, workItem, workItemServer, monitor);
} else if (WorkItemAttributes.CATEGORY.equals(identifier)) {
values = CategoryHelpers.addCategoriesAsValues(pa, workItemServer, monitor);
} else if (WorkItemAttributes.TARGET.equals(identifier)) {
values = TargetHelpers.addTargetsAsValues(pa, workItemServer, monitor);
} else if (WorkItemAttributes.VERSION.equals(identifier)) {
values = FoundInHelpers.addFoundInAsValues(pa, workItemServer, monitor);
} else if(EnumerationHelpers.isValidEnumerationLiteral(attribute)) {
values = EnumerationHelpers.addEnumerationLiteralsAsValues(attribute, workItemServer, monitor);
} else {
return null;
}
return values;
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:24,代码来源:AttributeHelpers.java
示例6: addTargetsAsValues
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@SuppressWarnings("restriction")
static List<AttributeValue> addTargetsAsValues(IProjectAreaHandle pa,
IWorkItemServer workItemServer, IProgressMonitor monitor) throws TeamRepositoryException {
IAuditableServer auditSrv = workItemServer.getAuditableServer();
List<AttributeValue> values = new ArrayList<AttributeValue>();
List<IDevelopmentLine> developmentLines = auditSrv.resolveAuditablesPermissionAware(Arrays.asList((
auditSrv.resolveAuditable(pa, ItemProfile.PROJECT_AREA_DEFAULT, monitor)).getDevelopmentLines()), ItemProfile.DEVELOPMENT_LINE_DEFAULT, monitor);
if (!developmentLines.isEmpty()) {
for (IDevelopmentLine curDevLine : developmentLines) {
List<IIteration> iterations = IterationsHelper.findAllIterations(auditSrv, curDevLine.getIterations(), ItemProfile.ITERATION_DEFAULT, false, monitor);
for (IIteration curIter : iterations) {
String name = curIter.getName();
String path = IterationsHelper.createIterationPath(curIter, auditSrv, monitor);
values.add(new AttributeValue(path, name));
}
}
}
return values;
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:20,代码来源:TargetHelpers.java
示例7: addStatesAsValues
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
static List<AttributeValue> addStatesAsValues(IProjectAreaHandle pa, IWorkItem wi,
IWorkItemServer workItemServer, IProgressMonitor monitor) throws TeamRepositoryException {
List<AttributeValue> values = new ArrayList<AttributeValue>();
IWorkItemType type = workItemServer.findWorkItemType(pa, wi.getWorkItemType(), monitor);
IWorkflowInfo workFlowInfo = workItemServer.findCachedWorkflowInfo(wi);
if (workFlowInfo == null) {
workFlowInfo = workItemServer.findWorkflowInfo(wi, monitor);
}
Identifier<IState>[] identifiers = workFlowInfo.getAllStateIds();
int n = identifiers.length;
int n2 = 0;
while (n2 < n) {
Identifier<IState> stateId = identifiers[n2];
String id = stateId.getStringIdentifier();
String name = workFlowInfo.getStateName(stateId) + " (" + type.getDisplayName() + ")";
values.add(new AttributeValue(id, name));
++n2;
}
return values;
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:22,代码来源:StateHelpers.java
示例8: handleAttachments
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的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
示例9: applyMappingsToWorkItems
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
/**
* Apply the the specified attribute mappings to all affected work item
* @param mappedWorkItems all work items involved into the move workflow
* @param mappingDefinitions the mapping definition provided by the user
* @throws TeamRepositoryException if anything fails
*/
private void applyMappingsToWorkItems(List<WorkItemMoveMapper> mappedWorkItems,
Collection<AttributeDefinition> mappingDefinitions) throws TeamRepositoryException {
AttributeHelpers attributeHelpers = new AttributeHelpers(service, workItemServer, monitor);
Map<Integer, HashMap<String, String>> attributeMap = getAttributesByWorkItem(mappingDefinitions);
for(WorkItemMoveMapper mappedWorkItem : mappedWorkItems) {
IWorkItem sourceWorkItem = mappedWorkItem.getSourceWorkItem();
IWorkItem targetWorkItem = mappedWorkItem.getTargetWorkItem();
HashMap<String, String> attributes = attributeMap.get(sourceWorkItem.getId());
if(attributes != null) {
for(Entry<String, String> attribute : attributes.entrySet()) {
attributeHelpers.setAttributeForWorkItem(targetWorkItem, attribute.getKey(), attribute.getValue());
}
}
}
}
开发者ID:jazz-community,项目名称:rtc-workitem-bulk-mover-service,代码行数:24,代码来源:WorkItemMover.java
示例10: getDefaultProjectName
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
private String getDefaultProjectName(IAttribute attribute) {
String result = "";
try {
@SuppressWarnings("unchecked")
Identifier<ILiteral> identifier =
(Identifier<ILiteral>) attribute.getDefaultValue(
(com.ibm.team.workitem.common.IAuditableCommon) getTeamRepository().getClientLibrary(
com.ibm.team.workitem.common.IAuditableCommon.class), this.getWorkItem(),
new org.eclipse.core.runtime.NullProgressMonitor());
if (identifier != null) {
result = identifier.getStringIdentifier();
}
} catch (TeamRepositoryException e) {
}
return result;
}
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:17,代码来源:BisonProjectMapping.java
示例11: resolveCategoryId
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
protected ICategoryHandle resolveCategoryId(CategoryId id) throws TeamRepositoryException {
ITeamRepository teamRepository = getTeamRepository();
IWorkItemClient workItemClient = (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
String subtreePattern = id.getSubtreePattern();
List<String> path = Arrays.asList(subtreePattern.split("/"));
ICategoryHandle category = null;
try {
category = workItemClient.findCategoryByNamePath(getWorkItem().getProjectArea(), path, null);
} catch (Exception e) {
String message =
"RTCClient: setWorkItemCategory() - findCategoryByNamePath() failed for categoryName '" + subtreePattern
+ "'!!" + e + ":" + e.getMessage();
throw new TeamRepositoryException(message, e);
}
if (category == null) {
throw new TeamRepositoryException(
"RTCClient: modifyWorkItemWorkingCopyWithoutSave() - findCategoryByNamePath() failed for categoryName '"
+ subtreePattern + "'!!");
}
return category;
}
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:27,代码来源:CategoryMapping.java
示例12: getAllCustomValues
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
public Map<String, String> getAllCustomValues(IAttribute attribute) {
IWorkItemCommon fWorkItemCommon = (IWorkItemCommon) getTeamRepository().getClientLibrary(IWorkItemCommon.class);
// Iterate the enumeration literals and create
IAttributeHandle attributeHandle = (IAttributeHandle) attribute.getItemHandle();
IEnumeration<? extends ILiteral> targetEnumeration;
Map<String, String> map = new HashMap<String, String>();
try {
targetEnumeration = fWorkItemCommon.resolveEnumeration(attributeHandle, null);
List<? extends ILiteral> literals = targetEnumeration.getEnumerationLiterals();
for (ILiteral targetLiteral : literals) {
map.put(targetLiteral.getIdentifier2().getStringIdentifier(), targetLiteral.getName());
}
} catch (TeamRepositoryException e) {
LOGGER.log(Level.SEVERE, "Problem while collecting value literals of enumeration", e);
}
return map;
}
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:19,代码来源:MappingAdapter.java
示例13: saveAttachements
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的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
示例14: prepareTargetLink
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的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
示例15: prepareTargetValue
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@Override
public void prepareTargetValue(IWorkItem target, IAttribute targetAttribute, IAttribute sourceAttribute, T sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
Key<Collection<String>> requiredAttributesKey= new Key<Collection<String>>("RequiredAttributes_" + target.getItemId().getUuidValue());
Collection<String> requiredAttributes= context.get(requiredAttributesKey);
if (requiredAttributes == null) {
requiredAttributes= context.targetContext.workItemClient.findRequiredAttributes(target, null, monitor);
context.set(requiredAttributesKey, requiredAttributes);
}
Key<T> key= new Key<T>(getClass().getName() + targetAttribute.getIdentifier());
T targetValue= context.get(key);
if (targetValue == null) {
targetValue= (T)targetAttribute.getNullValue(context.targetContext.auditableClient, monitor);
if (requiredAttributes.contains(targetAttribute.getIdentifier())) {
targetValue= getNonNullValue(target, targetAttribute, context, monitor, targetValue);
}
context.set(key, targetValue);
}
if (targetValue != null) {
setValue(target, targetAttribute, targetValue);
}
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:24,代码来源:ValueSetProcessor.java
示例16: getMapping
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
public String getMapping(IWorkItem target, IAttribute targetAttribute, String sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
Key<List<IWorkItemType>> key= new Key<List<IWorkItemType>>(context.targetContext.teamRepository.getId().getUuidValue() + context.targetContext.projectArea.getItemId().getUuidValue() + targetAttribute.getIdentifier());
List<IWorkItemType> workItemTypes= context.get(key);
if (workItemTypes == null) {
workItemTypes= context.targetContext.workItemClient.findWorkItemTypes(context.targetContext.projectArea, monitor);
}
for (IWorkItemType workItemType : workItemTypes) {
if (workItemType.getIdentifier().equals(sourceValue)) {
return workItemType.getIdentifier();
}
}
if ("com.ibm.team.apt.workItemType.epic".equals(sourceValue)) {
// Epic is mapped to Plan Item in RTC legacy PA
return "rtc.planItem.v2";
}
return null;
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:21,代码来源:WorkItemTypeProcessor.java
示例17: prepareTargetValue
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@Override
public void prepareTargetValue(IWorkItem target, IAttribute attribute, IAttribute sourceAttribute, String sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
IWorkflowInfo workflowInfo= context.targetContext.workItemClient.findWorkflowInfo(target, monitor);
for (Identifier<IResolution> resolution : workflowInfo.getAllResolutionIds()) {
String targetValue= resolution.getStringIdentifier();
if (targetValue.equals(sourceValue)) {
setValue(target, attribute, resolution.getStringIdentifier());
return;
}
String workflowScope= workflowInfo.getIdentifier() + ".resolution.";
if (targetValue.startsWith(workflowScope)) {
targetValue= targetValue.substring(workflowScope.length());
}
if (sourceValue.startsWith(workflowScope)) {
sourceValue= sourceValue.substring(workflowScope.length());
}
if (WorkflowInfo.stripOffPrefix(targetValue, 'r').equals(WorkflowInfo.stripOffPrefix(sourceValue, 'r'))) {
setValue(target, attribute, resolution.getStringIdentifier());
return;
}
}
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:26,代码来源:ResolutionProcessor.java
示例18: getMapping
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
public IContributorHandle getMapping(IContributor sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
Key<IContributorHandle> key= new Key<IContributorHandle>(sourceValue.getItemId().getUuidValue());
IContributorHandle target= context.get(key);
if (target == null) {
try {
target= context.targetContext.contributorManager.fetchContributorByUserId(sourceValue.getUserId(), monitor);
} catch (ItemNotFoundException e) {
// ignore
}
if (target == null) {
target= getDefaultValue(sourceValue, context, monitor);
}
context.set(key, target);
}
return target;
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:17,代码来源:ContributorProcessor.java
示例19: prepareTargetValue
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
@Override
public void prepareTargetValue(IWorkItem target, IAttribute attribute, IAttribute sourceAttribute, String sourceValue, EvaluationContext context, IProgressMonitor monitor) throws TeamRepositoryException {
IWorkflowInfo workflowInfo= context.targetContext.workItemClient.findWorkflowInfo(target, monitor);
for (Identifier<IState> state : workflowInfo.getAllStateIds()) {
String targetValue= state.getStringIdentifier();
if (targetValue.equals(sourceValue)) {
setValue(target, attribute, state.getStringIdentifier());
return;
}
String workflowScope= workflowInfo.getIdentifier() + ".state.";
if (targetValue.startsWith(workflowScope)) {
targetValue= targetValue.substring(workflowScope.length());
}
if (sourceValue.startsWith(workflowScope)) {
sourceValue= sourceValue.substring(workflowScope.length());
}
if (WorkflowInfo.stripOffPrefix(targetValue, 's').equals(WorkflowInfo.stripOffPrefix(sourceValue, 's'))) {
setValue(target, attribute, state.getStringIdentifier());
return;
}
}
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:26,代码来源:StateProcessor.java
示例20: copyTargets
import com.ibm.team.repository.common.TeamRepositoryException; //导入依赖的package包/类
private void copyTargets(List<WorkItemWorkingCopy> workingCopies, String message, SubMonitor monitor) throws TeamRepositoryException {
BatchIterator<WorkItemWorkingCopy> iterator= new BatchIterator<WorkItemWorkingCopy>(workingCopies, 25);
int counter= 0;
while (iterator.hasNext()) {
Collection<WorkItemWorkingCopy> batch= iterator.next();
for (WorkItemWorkingCopy target : batch) {
XMLString copiedFromCommentText= XMLString.createFromXMLText("Copied from " + createTextLink((IWorkItem)fContext.targetContext.getPair(target.getWorkItem())));
IComment comment= target.getWorkItem().getComments().createComment(fContext.targetContext.auditableClient.getUser(), copiedFromCommentText);
target.getWorkItem().getComments().append(comment);
}
SubMonitor saveMonitor= monitor.newChild(batch.size());
saveMonitor.setTaskName(message + " (" + (counter + batch.size()) + " of " + workingCopies.size() + ")");
fContext.targetContext.workingCopyManager.save(batch.toArray(new WorkItemWorkingCopy[batch.size()]), saveMonitor);
saveMonitor.done();
counter+= 25;
}
}
开发者ID:sandy081,项目名称:Copy-Work-Items,代码行数:18,代码来源:CopyWorkItemsJob.java
注:本文中的com.ibm.team.repository.common.TeamRepositoryException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论