Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2017-07-26 17:37:28 -0400
committerDonald Dunne2017-08-01 12:26:51 -0400
commit41442a4322fe2d68171b6f8a2d56c6aab8106678 (patch)
treedfec49f284f2e7bf2d2f5017f9b47f1f2899eafa
parentc5b472372637010c432efe65b5e5fbd2f8261f4d (diff)
downloadorg.eclipse.osee-41442a4322fe2d68171b6f8a2d56c6aab8106678.tar.gz
org.eclipse.osee-41442a4322fe2d68171b6f8a2d56c6aab8106678.tar.xz
org.eclipse.osee-41442a4322fe2d68171b6f8a2d56c6aab8106678.zip
refinement: Remove AtsUtilClient.getAtsId method
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java3
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/walker/ActionWalkerView.java2
6 files changed, 14 insertions, 24 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
index 6caf69abed..1640eb9234 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsUtilClient.java
@@ -27,7 +27,6 @@ import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.enums.Active;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.jdk.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -111,15 +110,6 @@ public class AtsUtilClient {
return results;
}
- public static String getAtsId(Artifact art) throws OseeCoreException {
- String toReturn = art.getSoleAttributeValueAsString(AtsAttributeTypes.AtsId, AtsUtilCore.DEFAULT_ATS_ID_VALUE);
- Conditions.checkNotNull("AtsId", "AtsId");
- if (AtsUtilCore.DEFAULT_ATS_ID_VALUE.equals(toReturn)) {
- toReturn = art.getGuid();
- }
- return toReturn;
- }
-
public static Artifact getFromToken(ArtifactToken token) {
Artifact toReturn = null;
try {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
index 8759d9c1f5..a34c768c5c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/WfeRelationsHyperlinkComposite.java
@@ -18,7 +18,6 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.ActionableItems;
import org.eclipse.osee.ats.internal.Activator;
@@ -131,8 +130,9 @@ public class WfeRelationsHyperlinkComposite extends Composite {
editor.getToolkit().createLabel(this,
prefix + " \"" + thisArt.getArtifactTypeName() + "\" " + action + getCompletedCancelledString(
art) + " \"" + art.getArtifactTypeName() + "\" ");
- Hyperlink link = editor.getToolkit().createHyperlink(this, String.format("\"%s\" - %s",
- art.getName().length() < 60 ? art.getName() : art.getName().substring(0, 60), AtsUtilClient.getAtsId(art)),
+ Hyperlink link = editor.getToolkit().createHyperlink(this,
+ String.format("\"%s\" - %s", art.getName().length() < 60 ? art.getName() : art.getName().substring(0, 60),
+ AtsClientService.get().getAtsId(art)),
SWT.NONE);
link.addHyperlinkListener(new IHyperlinkListener() {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
index 837b422077..3f67db9e62 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsDeleteManager.java
@@ -23,7 +23,6 @@ import org.eclipse.jface.dialogs.MessageDialogWithToggle;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.artifact.AbstractAtsArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.editor.WorkflowEditor;
import org.eclipse.osee.ats.internal.Activator;
@@ -140,7 +139,7 @@ public class AtsDeleteManager {
allDeleteArts.add(deleteArt);
final Set<Artifact> relatedArts = new HashSet<>(30);
delBuilder.append(String.format("\n<b>Selected</b>:[%s][%s][%s]", deleteArt.getArtifactTypeName(),
- AtsUtilClient.getAtsId(deleteArt), deleteArt.getName()) + "\n");
+ AtsClientService.get().getAtsId(deleteArt), deleteArt.getName()) + "\n");
if (deleteArt.isOfType(AtsArtifactTypes.Action)) {
for (IAtsTeamWorkflow art : AtsClientService.get().getWorkItemService().getTeams(deleteArt)) {
((AbstractWorkflowArtifact) art).atsDelete(relatedArts, ignoredArts);
@@ -150,8 +149,9 @@ public class AtsDeleteManager {
((AbstractWorkflowArtifact) deleteArt).atsDelete(relatedArts, ignoredArts);
for (Artifact loopArt : relatedArts) {
if (!loopArt.equals(deleteArt)) {
- delBuilder.append(String.format(AHTML.addSpace(4) + "<b>Related</b>:[%s][%s][%s]",
- loopArt.getArtifactTypeName(), AtsUtilClient.getAtsId(loopArt), loopArt.getName()) + "\n");
+ delBuilder.append(
+ String.format(AHTML.addSpace(4) + "<b>Related</b>:[%s][%s][%s]", loopArt.getArtifactTypeName(),
+ AtsClientService.get().getAtsId(loopArt), loopArt.getName()) + "\n");
}
}
}
@@ -162,8 +162,9 @@ public class AtsDeleteManager {
if (actionArt != null && !allDeleteArts.contains(actionArt) && allDeleteArts.containsAll(
AtsClientService.get().getWorkItemService().getTeams(actionArt))) {
relatedArts.add(actionArt);
- delBuilder.append(String.format(AHTML.addSpace(4) + "<b>Related</b>:[%s][%s][%s]",
- actionArt.getArtifactTypeName(), AtsUtilClient.getAtsId(actionArt), actionArt.getName()) + "\n");
+ delBuilder.append(
+ String.format(AHTML.addSpace(4) + "<b>Related</b>:[%s][%s][%s]", actionArt.getArtifactTypeName(),
+ AtsClientService.get().getAtsId(actionArt), actionArt.getName()) + "\n");
}
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
index af2ae1eb61..e23aa921e1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ArtifactValidationRule.java
@@ -14,7 +14,7 @@ import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.validation.IOseeValidator;
@@ -29,7 +29,7 @@ public class ArtifactValidationRule extends AbstractValidationRule {
private String getStatusMessage(Artifact itemChecked, IStatus status) throws OseeCoreException {
String link =
XResultDataUI.getHyperlink(String.format("%s:[%s]", itemChecked.getArtifactTypeName(), itemChecked.getName()),
- AtsUtilClient.getAtsId(itemChecked), itemChecked.getBranch());
+ AtsClientService.get().getAtsId(itemChecked), itemChecked.getBranch());
return String.format("%s: %s", link, status.getMessage());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
index b12483bb89..048ce4c530 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/validate/ValidationReportOperation.java
@@ -21,7 +21,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
import org.eclipse.osee.ats.core.client.IAtsClient;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.util.AtsUtilClient;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsBranchManager;
@@ -152,7 +151,7 @@ public class ValidationReportOperation extends AbstractOperation {
}
public static String getRequirementHyperlink(Artifact art) throws OseeCoreException {
- String atsId = AtsUtilClient.getAtsId(art);
+ String atsId = AtsClientService.get().getAtsId(art);
String linkName = String.format("%s(%s)", art.getName(), atsId);
return XResultDataUI.getHyperlink(linkName, atsId, art.getBranch());
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/walker/ActionWalkerView.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/walker/ActionWalkerView.java
index 4c3a6ae1d1..8516032dd9 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/walker/ActionWalkerView.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/walker/ActionWalkerView.java
@@ -163,7 +163,7 @@ public class ActionWalkerView extends GenericViewPart implements IPartListener,
if (parentArtifact != null && parentArtifact.isOfType(AtsArtifactTypes.TeamWorkflow)) {
artifact = ((TeamWorkFlowArtifact) parentArtifact).getParentActionArtifact();
} else {
- OseeLog.log(Activator.class, Level.SEVERE, "Unknown parent " + AtsUtilClient.getAtsId(art));
+ OseeLog.log(Activator.class, Level.SEVERE, "Unknown parent " + AtsClientService.get().getAtsId(art));
}
}
}

Back to the top