Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2020-02-14 06:12:26 +0000
committerRyan D. Brooks2020-12-15 21:40:36 +0000
commit1c8758523fd8ec307e00c662e8de14d1d32358e7 (patch)
tree8cfd359cf5b295983fa5c5e25d71316c641a7075
parent941c8705eadf5f63fc16dc5f54e6b59876dc06fc (diff)
downloadorg.eclipse.osee-1c8758523fd8ec307e00c662e8de14d1d32358e7.tar.gz
org.eclipse.osee-1c8758523fd8ec307e00c662e8de14d1d32358e7.tar.xz
org.eclipse.osee-1c8758523fd8ec307e00c662e8de14d1d32358e7.zip
refactor[TW16547]: Remove IAtsStoreService.isHistorical
- Both the client and the server implementations of this ATS api - method first load the artifact and then call isHistorical on - that artifact. However, this is useless because the artifact - loading used never returns historical artifacts. Even the ATS - api from the start doesn't include a transaction parameter needed - to perform a historical load. Removing this method eases a future - commit to improve null safety in ats.rest. Change-Id: Ia5cf4e688776600ce82be2b5088af67d49762683
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/rule/validate/OrphanAndDuplicateParentValidationRule.java19
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java9
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/internal/AtsStoreService.java10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java12
5 files changed, 9 insertions, 44 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
index 3ca980eeff6..0931079a2aa 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsStoreService.java
@@ -87,8 +87,6 @@ public interface IAtsStoreService {
boolean isProductionDb();
- boolean isHistorical(IAtsObject atsObject);
-
JdbcService getJdbcService();
default Map<ArtifactId, ArtifactTypeToken> getArtifactTypes(Collection<ArtifactId> artIds, OrcsTokenService tokenService) {
@@ -101,7 +99,6 @@ public interface IAtsStoreService {
return artIdToType;
}
- boolean isHistorical(ArtifactId artifact);
boolean isReadOnly(IAtsWorkItem workItem);
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/rule/validate/OrphanAndDuplicateParentValidationRule.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/rule/validate/OrphanAndDuplicateParentValidationRule.java
index 8253c80e055..f28aa6eff1f 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/rule/validate/OrphanAndDuplicateParentValidationRule.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/rule/validate/OrphanAndDuplicateParentValidationRule.java
@@ -33,15 +33,13 @@ public class OrphanAndDuplicateParentValidationRule extends AbstractValidationRu
@Override
public void validate(ArtifactToken artifact, XResultData results) {
try {
- if (!atsApi.getStoreService().isHistorical(artifact)) {
- int count =
- atsApi.getRelationResolver().getRelatedCount(artifact, CoreRelationTypes.DefaultHierarchical_Parent);
- if (count == 0) {
- logError(artifact, "is orphaned (no parent on Default Hierarchy).", results);
- } else if (count > 1) {
- logError(artifact, String.format("has %s parents (duplicate parents on Default Hierarchy).", count),
- results);
- }
+ int count =
+ atsApi.getRelationResolver().getRelatedCount(artifact, CoreRelationTypes.DefaultHierarchical_Parent);
+ if (count == 0) {
+ logError(artifact, "is orphaned (no parent on Default Hierarchy).", results);
+ } else if (count > 1) {
+ logError(artifact, String.format("has %s parents (duplicate parents on Default Hierarchy).", count),
+ results);
}
} catch (Exception ex) {
String errStr =
@@ -59,5 +57,4 @@ public class OrphanAndDuplicateParentValidationRule extends AbstractValidationRu
public String getRuleTitle() {
return "Orphan / Duplicate Parent Validation Checks";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
index 28fc84cad17..15e2a6dc3e7 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/editor/tab/workflow/header/WfeHeaderComposite.java
@@ -101,7 +101,6 @@ public class WfeHeaderComposite extends Composite {
new WfeTeamAndIdsHeader(this, SWT.NONE, workItem, editor);
createTargetVersionAndAssigneeHeader(this, currentStateXWidgetPage, editor.getToolkit());
- createLatestHeader(this, editor.getToolkit());
if (workItem.isTeamWorkflow()) {
actionableItemHeader = new WfeActionableItemHeader(this, editor.getToolkit(), workItem, editor);
}
@@ -214,14 +213,6 @@ public class WfeHeaderComposite extends Composite {
}
}
- private void createLatestHeader(Composite comp, XFormToolkit toolkit) {
- if (AtsApiService.get().getStoreService().isHistorical(workItem)) {
- Label label = toolkit.createLabel(comp,
- "This is a historical version of this " + workItem.getArtifactTypeName() + " and can not be edited; Select \"Open Latest\" to view/edit latest version.");
- label.setForeground(Displays.getSystemColor(SWT.COLOR_RED));
- }
- }
-
private void createAnnotationsHeader(Composite comp, XFormToolkit toolkit) {
try {
if (AttributeAnnotationManager.getAnnotations((Artifact) workItem.getStoreObject()).size() > 0) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/internal/AtsStoreService.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/internal/AtsStoreService.java
index bf879d9f2c9..c8271d80984 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/internal/AtsStoreService.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/internal/AtsStoreService.java
@@ -214,16 +214,6 @@ public class AtsStoreService implements IAtsStoreService {
}
@Override
- public boolean isHistorical(IAtsObject atsObject) {
- return AtsApiService.get().getQueryServiceIde().getArtifact(atsObject).isHistorical();
- }
-
- @Override
- public boolean isHistorical(ArtifactId artifact) {
- return AtsApiService.get().getQueryServiceIde().getArtifact(artifact).isHistorical();
- }
-
- @Override
public void clearCaches(IAtsWorkItem workItem) {
((WorkItem) workItem).clearCaches();
((AbstractWorkflowArtifact) workItem.getStoreObject()).clearCaches();
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
index e0980810abd..93c0a60d843 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsStoreServiceImpl.java
@@ -207,16 +207,6 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
}
@Override
- public boolean isHistorical(IAtsObject atsObject) {
- return ((ArtifactReadable) atsApi.getQueryService().getArtifact(atsObject)).isHistorical();
- }
-
- @Override
- public boolean isHistorical(ArtifactId artifact) {
- return ((ArtifactReadable) atsApi.getQueryService().getArtifact(artifact)).isHistorical();
- }
-
- @Override
public boolean isReadOnly(IAtsWorkItem workItem) {
throw new UnsupportedOperationException("unsupported on server");
}
@@ -228,7 +218,7 @@ public class AtsStoreServiceImpl implements IAtsStoreService {
@Override
public void reloadArts(Collection<ArtifactToken> artifacts) {
- // do needed on server, but don't exception
+ // not needed on server, but don't exception
}
@Override

Back to the top