From 6c8917408da36279fb0a0dd0fe48365e74c11dbd Mon Sep 17 00:00:00 2001 From: Lukas Steiger Date: Wed, 3 Jul 2019 15:46:12 +0200 Subject: [PATCH] add Unset Rank feature, upgrade dependencies - v1.5.2 --- feature/feature.xml | 2 +- feature/pom.xml | 2 +- plugin/META-INF/MANIFEST.MF | 6 +-- plugin/pom.xml | 2 +- .../WorkItemBulkMoverService.java | 10 ++--- .../bulkMover/WorkItemMover.java | 13 +++++-- .../bulkMover/helpers/AttributeHelpers.java | 38 +++++++++---------- .../bulkMover/helpers/EnumerationHelpers.java | 1 + .../bulkMover/helpers/PrimitiveHelpers.java | 4 +- .../bulkMover/helpers/RankHelpers.java | 18 +++++++++ .../bulkMover/helpers/StateHelpers.java | 1 + .../services/InfoService.java | 24 +++--------- .../services/MoveService.java | 19 +++++++--- .../services/ProjectAreaService.java | 15 ++++---- .../services/ProjectAreaTypeService.java | 13 ++++--- pom.xml | 12 +++--- test/pom.xml | 2 +- update-site/pom.xml | 2 +- 18 files changed, 100 insertions(+), 84 deletions(-) create mode 100644 plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/RankHelpers.java diff --git a/feature/feature.xml b/feature/feature.xml index 946e307..af95e2e 100644 --- a/feature/feature.xml +++ b/feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/feature/pom.xml b/feature/pom.xml index 757e1bb..b36f2ad 100644 --- a/feature/pom.xml +++ b/feature/pom.xml @@ -7,7 +7,7 @@ com.siemens.bt.jazz.services.WorkItemBulkMover com.siemens.bt.jazz.services.WorkItemBulkMover.parent - 1.5.0-SNAPSHOT + 1.5.2-SNAPSHOT ../ diff --git a/plugin/META-INF/MANIFEST.MF b/plugin/META-INF/MANIFEST.MF index c02dc8b..7dba4d9 100644 --- a/plugin/META-INF/MANIFEST.MF +++ b/plugin/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: com.siemens.bt.jazz.services.WorkItemBulkMover Bundle-SymbolicName: com.siemens.bt.jazz.services.WorkItemBulkMover;singleton:=true -Bundle-Version: 1.5.0.qualifier +Bundle-Version: 1.5.2.qualifier Bundle-Vendor: VENDOR Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: @@ -31,8 +31,8 @@ Require-Bundle: com.ibm.team.jfs.app.error, com.ibm.team.process.common, com.ibm.team.process.service -Bundle-ClassPath: target/dependency/gson-2.7.jar, - target/dependency/com.siemens.bt.jazz.services.base-2.0.1-SNAPSHOT.jar, +Bundle-ClassPath: target/dependency/gson-2.8.5.jar, + target/dependency/com.siemens.bt.jazz.services.base-3.0.3-SNAPSHOT.jar, . Import-Package: com.ibm.team.jfs.app, com.ibm.team.jfs.app.http.util, diff --git a/plugin/pom.xml b/plugin/pom.xml index eabc81d..8433dc8 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -7,7 +7,7 @@ com.siemens.bt.jazz.services.WorkItemBulkMover com.siemens.bt.jazz.services.WorkItemBulkMover.parent - 1.5.0-SNAPSHOT + 1.5.2-SNAPSHOT ../ diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/WorkItemBulkMoverService.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/WorkItemBulkMoverService.java index 4f9ef2f..1460bb4 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/WorkItemBulkMoverService.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/WorkItemBulkMoverService.java @@ -1,19 +1,17 @@ package com.siemens.bt.jazz.services.WorkItemBulkMover; -import com.ibm.team.jfs.app.http.util.HttpConstants.HttpMethod; import com.siemens.bt.jazz.services.WorkItemBulkMover.services.InfoService; import com.siemens.bt.jazz.services.WorkItemBulkMover.services.MoveService; import com.siemens.bt.jazz.services.WorkItemBulkMover.services.ProjectAreaService; import com.siemens.bt.jazz.services.WorkItemBulkMover.services.ProjectAreaTypeService; import com.siemens.bt.jazz.services.base.BaseService; -import com.siemens.bt.jazz.services.base.router.factory.RestFactory; public class WorkItemBulkMoverService extends BaseService implements IWorkItemBulkMoverService { public WorkItemBulkMoverService() { super(); - router.addService(HttpMethod.POST, "info", new RestFactory(InfoService.class)); - router.addService(HttpMethod.POST, "move", new RestFactory(MoveService.class)); - router.addService(HttpMethod.GET, "project-areas", new RestFactory(ProjectAreaService.class)); - router.addService(HttpMethod.GET, "types", new RestFactory(ProjectAreaTypeService.class)); + router.get("info", InfoService.class); + router.post("move", MoveService.class); + router.get("project-areas", ProjectAreaService.class); + router.get("types", ProjectAreaTypeService.class); } } diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/WorkItemMover.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/WorkItemMover.java index ec54321..31288a8 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/WorkItemMover.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/WorkItemMover.java @@ -17,6 +17,7 @@ import com.ibm.team.workitem.service.internal.WorkItemWrapper; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.AttributeHelpers; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.CategoryHelpers; +import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.RankHelpers; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.WorkItemTypeHelpers; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.models.*; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.operations.BulkMoveOperation; @@ -47,12 +48,12 @@ public WorkItemMover(TeamRawService parentService) { * @throws TeamRepositoryException if anything with RTC goes wrong */ @SuppressWarnings("restriction") - public MovePreparationResult PrepareMove(List sourceWorkItems, IProjectAreaHandle targetArea, List mappingDefinitions, Map typeMap) throws TeamRepositoryException { + public MovePreparationResult PrepareMove(List sourceWorkItems, IProjectAreaHandle targetArea, List mappingDefinitions, Map typeMap, boolean removeRank) throws TeamRepositoryException { // run the bulk movement operation BulkMoveOperation oper = new BulkMoveOperation(targetArea, service); oper.run(sourceWorkItems, workItemServer, monitor); - // get the workitems involved into the move operation + // get the work items involved into the move operation List workItems = oper.getMappedWorkItems(); if(workItems.size() < sourceWorkItems.size()) { List mappedIds = new ArrayList(); @@ -79,6 +80,10 @@ public MovePreparationResult PrepareMove(List sourceWorkItems, IProje } WorkItemTypeHelpers.setWorkItemType(entry.getSourceWorkItem(), entry.getTargetWorkItem(), sourceType, targetType, workItemServer, monitor); + + if(removeRank) { + RankHelpers.unsetRank(entry.getTargetWorkItem(), workItemServer); + } } if(mappingDefinitions != null && mappingDefinitions.size() > 0) { @@ -277,8 +282,8 @@ private boolean isTargetRequiredButValueUnassigned(boolean isRequired, IAttribut return isRequired && AttributeTypes.CATEGORY.equals(attribute.getAttributeType()) && CategoryHelpers.isArchivedOrUnassigned(targetValue, service); } - private boolean areBothNullButRequired(boolean isReuqired, Object sourceValue, Object targetValue) { - return sourceValue == null && targetValue == null && isReuqired; + private boolean areBothNullButRequired(boolean isRequired, Object sourceValue, Object targetValue) { + return sourceValue == null && targetValue == null && isRequired; } private boolean areValuesEqual(Object sourceValue, Object targetValue) { diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/AttributeHelpers.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/AttributeHelpers.java index f8a1e42..97ffd1a 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/AttributeHelpers.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/AttributeHelpers.java @@ -95,27 +95,25 @@ public AttributeValue getCurrentValueRepresentation(IAttribute attribute, IWorkI JsonPrimitive nullPrim = null; AttributeValue value = new AttributeValue(attribute.getIdentifier(), nullPrim); - if(attribute != null) { - String type = attribute.getAttributeType(); - Object attributeValue = attribute.getValue(auditSrv, workItem, monitor); - Identifier identifier = WorkItemAttributes.getPropertyIdentifier(attribute.getIdentifier()); + String type = attribute.getAttributeType(); + Object attributeValue = attribute.getValue(auditSrv, workItem, monitor); + Identifier identifier = WorkItemAttributes.getPropertyIdentifier(attribute.getIdentifier()); - 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 (AttributeTypes.CATEGORY.equals(type)) { - value = CategoryHelpers.getCategory(attributeValue, workItemServer, teamRawService, monitor); - } else if (AttributeTypes.ITERATION.equals(type)) { - value = TargetHelpers.getTarget(attributeValue, auditSrv, teamRawService, monitor); - } else if (AttributeTypes.DELIVERABLE.equals(type)) { - value = FoundInHelpers.getFoundIn(attributeValue, teamRawService); - } else if (EnumerationHelpers.isValidEnumerationLiteral(attribute)) { - value = EnumerationHelpers.getEnumerationLiteral(attribute, attributeValue, workItemServer, monitor); - } else if (isPrimitiveCustomAttributeType(attribute)) { - value = PrimitiveHelpers.getPrimitive(workItem, attribute); - } + 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 (AttributeTypes.CATEGORY.equals(type)) { + value = CategoryHelpers.getCategory(attributeValue, workItemServer, teamRawService, monitor); + } else if (AttributeTypes.ITERATION.equals(type)) { + value = TargetHelpers.getTarget(attributeValue, auditSrv, teamRawService, monitor); + } else if (AttributeTypes.DELIVERABLE.equals(type)) { + value = FoundInHelpers.getFoundIn(attributeValue, teamRawService); + } else if (EnumerationHelpers.isValidEnumerationLiteral(attribute)) { + value = EnumerationHelpers.getEnumerationLiteral(attribute, attributeValue, workItemServer, monitor); + } else if (isPrimitiveCustomAttributeType(attribute)) { + value = PrimitiveHelpers.getPrimitive(workItem, attribute); } } return value; diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/EnumerationHelpers.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/EnumerationHelpers.java index 4710e7d..91247fc 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/EnumerationHelpers.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/EnumerationHelpers.java @@ -19,6 +19,7 @@ static boolean isValidEnumerationLiteral(IAttribute attribute) { static AttributeValue getEnumerationLiteral(IAttribute attribute, Object t_val, IWorkItemServer workItemServer, IProgressMonitor monitor) throws TeamRepositoryException { + //noinspection unchecked Identifier lit = (Identifier)t_val; IEnumeration enumeration = workItemServer.resolveEnumeration(attribute, monitor); List list = enumeration.getEnumerationLiterals(false); diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/PrimitiveHelpers.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/PrimitiveHelpers.java index 4b23a88..7bf0df7 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/PrimitiveHelpers.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/PrimitiveHelpers.java @@ -11,9 +11,9 @@ import java.sql.Timestamp; -public final class PrimitiveHelpers { +final class PrimitiveHelpers { - public static AttributeValue getPrimitive(IWorkItem workItem, IAttribute attribute) { + static AttributeValue getPrimitive(IWorkItem workItem, IAttribute attribute) { Object val = workItem.getValue(attribute); JsonPrimitive primitivo; if(val == null) { diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/RankHelpers.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/RankHelpers.java new file mode 100644 index 0000000..2a21b03 --- /dev/null +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/RankHelpers.java @@ -0,0 +1,18 @@ +package com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers; + +import com.ibm.team.repository.common.TeamRepositoryException; +import com.ibm.team.workitem.common.model.IAttribute; +import com.ibm.team.workitem.common.model.IWorkItem; +import com.ibm.team.workitem.service.IWorkItemServer; + +public final class RankHelpers { + private static final String RANK_ATTR_ID = "com.ibm.team.apt.attribute.planitem.newRanking._pm7NmRYUEd6L1tNIGdz5qQ"; + + public static void unsetRank(IWorkItem wi, IWorkItemServer wiSrv) throws TeamRepositoryException { + IAttribute attr = wiSrv.findAttribute(wi.getProjectArea(), RANK_ATTR_ID, null); + if(wi.hasAttribute(attr)) { + Object existing = wi.getValue(attr); + wi.removeCustomAttribute(attr); + } + } +} diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/StateHelpers.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/StateHelpers.java index 1a6d9c5..f98975d 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/StateHelpers.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/bulkMover/helpers/StateHelpers.java @@ -39,6 +39,7 @@ static void setState(IWorkItem workItem, String stateId, for(Identifier state : allWorkflowStates) { String id = state.getStringIdentifier(); if(id.equals(stateId)) { + //noinspection deprecation workItem.setState2(state); } } diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/InfoService.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/InfoService.java index d78a073..6c0b42e 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/InfoService.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/InfoService.java @@ -1,37 +1,25 @@ package com.siemens.bt.jazz.services.WorkItemBulkMover.services; import com.google.gson.Gson; -import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.ibm.team.process.common.IProjectAreaHandle; -import com.ibm.team.repository.common.TeamRepositoryException; import com.ibm.team.repository.service.TeamRawService; -import com.ibm.team.workitem.common.model.IWorkItemType; -import com.ibm.team.workitem.service.IWorkItemServer; -import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.WorkItemTypeHelpers; -import com.siemens.bt.jazz.services.WorkItemBulkMover.helpers.ProjectAreaHelpers; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; -import com.siemens.bt.jazz.services.base.rest.RestRequest; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; import org.apache.commons.logging.Log; -import org.apache.http.auth.AuthenticationException; -import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.Platform; import org.osgi.framework.Version; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -import java.net.URISyntaxException; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; public class InfoService extends AbstractRestService { - public InfoService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public InfoService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService, PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); } - public void execute() throws IOException, URISyntaxException, AuthenticationException { + public void execute() throws IOException { Version v = Platform.getBundle("com.siemens.bt.jazz.services.WorkItemBulkMover").getVersion(); JsonObject statusObject = new JsonObject(); statusObject.addProperty("version", v.toString()); diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/MoveService.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/MoveService.java index eedcf67..62c911b 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/MoveService.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/MoveService.java @@ -13,8 +13,9 @@ import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.models.TypeMappingEntry; import com.siemens.bt.jazz.services.WorkItemBulkMover.helpers.ProjectAreaHelpers; import com.siemens.bt.jazz.services.WorkItemBulkMover.helpers.WorkItemHelpers; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; -import com.siemens.bt.jazz.services.base.rest.RestRequest; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; import com.siemens.bt.jazz.services.base.utils.RequestReader; import org.apache.commons.logging.Log; import org.eclipse.core.runtime.IProgressMonitor; @@ -36,8 +37,9 @@ public class MoveService extends AbstractRestService { private Type typeMappingCollectionType; private Type resultsType; - public MoveService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public MoveService(Log log, HttpServletRequest request, HttpServletResponse response, + RestRequest restRequest, TeamRawService parentService, PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); this.workItemServer = parentService.getService(IWorkItemServer.class); this.monitor = new NullProgressMonitor(); this.gson = new GsonBuilder().serializeNulls().create(); @@ -52,7 +54,8 @@ public void execute() throws IOException { WorkItemMover mover = new WorkItemMover(parentService); boolean isMoved = false; boolean previewOnly = false; - boolean skipEmail = false; + boolean skipEmail = false; // 'false' to ensure backward compatibility + boolean removeRank = false; // 'false' to ensure backward compatibility String error = null; Collection moveResults = null; @@ -60,6 +63,7 @@ public void execute() throws IOException { JsonObject workItemData = RequestReader.readAsJson(request); JsonPrimitive previewPrimitive = workItemData.getAsJsonPrimitive("previewOnly"); JsonPrimitive skipEmailPrimitive = workItemData.getAsJsonPrimitive("skipEmail"); + JsonPrimitive removeRankPrimitive = workItemData.getAsJsonPrimitive("removeRank"); JsonPrimitive targetPA = workItemData.getAsJsonPrimitive("targetProjectArea"); JsonArray workItemJson = workItemData.getAsJsonArray("workItems"); JsonArray typeMappingJson = workItemData.getAsJsonArray("typeMapping"); @@ -71,6 +75,9 @@ public void execute() throws IOException { if(skipEmailPrimitive != null) { skipEmail = skipEmailPrimitive.getAsBoolean(); } + if(removeRankPrimitive != null) { + removeRank = removeRankPrimitive.getAsBoolean(); + } // map client data to model Collection clientWorkItemList = gson.fromJson(workItemJson, workItemIdCollectionType); List clientMappingDefinitions = gson.fromJson(attributesJson, attributesCollectionType); @@ -88,7 +95,7 @@ public void execute() throws IOException { IProjectAreaHandle targetArea = ProjectAreaHelpers.getProjectArea(targetPA.getAsString(), parentService); // prepare movement and track fields to be changed - MovePreparationResult preparationResult = mover.PrepareMove(items, targetArea, clientMappingDefinitions, typeMap); + MovePreparationResult preparationResult = mover.PrepareMove(items, targetArea, clientMappingDefinitions, typeMap, removeRank); // store attribute based observations to be able to return this information to the end user moveResults = preparationResult.getAttributeDefinitions(); diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaService.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaService.java index 4a261e8..dd27bba 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaService.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaService.java @@ -9,24 +9,23 @@ import com.ibm.team.repository.service.IRepositoryItemService; import com.ibm.team.repository.service.TeamRawService; import com.siemens.bt.jazz.services.WorkItemBulkMover.rtc.models.ProjectArea; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; -import com.siemens.bt.jazz.services.base.rest.RestRequest; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; import org.apache.commons.logging.Log; -import org.apache.http.auth.AuthenticationException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.net.URISyntaxException; import java.util.*; public class ProjectAreaService extends AbstractRestService { - public ProjectAreaService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public ProjectAreaService(Log log, HttpServletRequest request, HttpServletResponse response, + RestRequest restRequest, TeamRawService parentService, PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); } - public void execute() throws IOException, URISyntaxException, AuthenticationException { + public void execute() { Gson googleJson = new Gson(); String ignoredProjectAreas = restRequest.getParameterValue("ignore"); List ignorePrjAreaList; diff --git a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaTypeService.java b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaTypeService.java index 9e89b91..d720c31 100644 --- a/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaTypeService.java +++ b/plugin/src/main/java/com/siemens/bt/jazz/services/WorkItemBulkMover/services/ProjectAreaTypeService.java @@ -10,10 +10,10 @@ import com.ibm.team.workitem.service.IWorkItemServer; import com.siemens.bt.jazz.services.WorkItemBulkMover.bulkMover.helpers.WorkItemTypeHelpers; import com.siemens.bt.jazz.services.WorkItemBulkMover.helpers.ProjectAreaHelpers; -import com.siemens.bt.jazz.services.base.rest.AbstractRestService; -import com.siemens.bt.jazz.services.base.rest.RestRequest; +import com.siemens.bt.jazz.services.base.rest.parameters.PathParameters; +import com.siemens.bt.jazz.services.base.rest.parameters.RestRequest; +import com.siemens.bt.jazz.services.base.rest.service.AbstractRestService; import org.apache.commons.logging.Log; -import org.apache.http.auth.AuthenticationException; import org.eclipse.core.runtime.NullProgressMonitor; import javax.servlet.http.HttpServletRequest; @@ -25,11 +25,12 @@ import java.util.TreeMap; public class ProjectAreaTypeService extends AbstractRestService { - public ProjectAreaTypeService(Log log, HttpServletRequest request, HttpServletResponse response, RestRequest restRequest, TeamRawService parentService) { - super(log, request, response, restRequest, parentService); + public ProjectAreaTypeService(Log log, HttpServletRequest request, HttpServletResponse response, + RestRequest restRequest, TeamRawService parentService, PathParameters pathParameters) { + super(log, request, response, restRequest, parentService, pathParameters); } - public void execute() throws IOException, URISyntaxException, AuthenticationException { + public void execute() throws IOException, URISyntaxException { String pa = restRequest.getParameterValue("project-area"); Map typeMap = new TreeMap(); try { diff --git a/pom.xml b/pom.xml index 8331956..fd2e588 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ com.siemens.bt.jazz.services.WorkItemBulkMover com.siemens.bt.jazz.services.WorkItemBulkMover.parent - 1.5.0-SNAPSHOT + 1.5.2-SNAPSHOT pom UTF-8 - 1.0.0 + 1.4.0 1.6 1.6 @@ -24,12 +24,12 @@ com.siemens.bt.jazz.services.base com.siemens.bt.jazz.services.base - 2.0.1-SNAPSHOT + 3.0.3-SNAPSHOT com.google.code.gson gson - 2.7 + 2.8.5 @@ -45,7 +45,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.0.0 + 3.1.1 copy-dependencies-init @@ -72,7 +72,7 @@ - + linux diff --git a/test/pom.xml b/test/pom.xml index 0103b53..ffefdba 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -6,7 +6,7 @@ com.siemens.bt.jazz.services.WorkItemBulkMover com.siemens.bt.jazz.services.WorkItemBulkMover.parent - 1.5.0-SNAPSHOT + 1.5.2-SNAPSHOT ../ diff --git a/update-site/pom.xml b/update-site/pom.xml index ce07026..7a96153 100644 --- a/update-site/pom.xml +++ b/update-site/pom.xml @@ -7,7 +7,7 @@ com.siemens.bt.jazz.services.WorkItemBulkMover com.siemens.bt.jazz.services.WorkItemBulkMover.parent - 1.5.0-SNAPSHOT + 1.5.2-SNAPSHOT ../