Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2020-02-22 00:09:55 +0000
committerRyan D. Brooks2020-12-15 21:40:29 +0000
commit07c8a8974fcb71794b223539b886d0736a106733 (patch)
treeee60c3eba740dd9605808e1be9997c4452bb1e75
parentcf0d8bc8feff3e6321346274c266ed214431596d (diff)
downloadorg.eclipse.osee-07c8a8974fcb71794b223539b886d0736a106733.tar.gz
org.eclipse.osee-07c8a8974fcb71794b223539b886d0736a106733.tar.xz
org.eclipse.osee-07c8a8974fcb71794b223539b886d0736a106733.zip
refactor[TW16579]: Use AttributeTypeGeneric with ats column
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsAttributeValueColumn.java37
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java13
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractWorkflowVersionDateColumn.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AtsAttributeValueColumnFactory.java6
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/CategoryColumn.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/NumericColumn.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeColumn.java10
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeValueColumn.java11
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewerUtil.java13
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSEE-INF/atsConfig/views.json30
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java7
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java16
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/OrcsTokenService.java7
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/AttributeColumn.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/IAttributeColumn.java6
16 files changed, 84 insertions, 103 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsAttributeValueColumn.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsAttributeValueColumn.java
index c857f9c689e..783eed11c85 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsAttributeValueColumn.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/AtsAttributeValueColumn.java
@@ -15,45 +15,41 @@ package org.eclipse.osee.ats.api.config;
import org.eclipse.osee.ats.api.column.AtsValueColumn;
import org.eclipse.osee.ats.api.util.ColumnType;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
* @author Donald G. Dunne
*/
public class AtsAttributeValueColumn extends AtsValueColumn {
- private long attrTypeId;
- private String attrTypeName;
+
+ private AttributeTypeGeneric<?> attributeType;
public AtsAttributeValueColumn() {
// For JaxRs Instantiation
}
- public AtsAttributeValueColumn(AttributeTypeToken attributeType, String id, String name, int width, String align, boolean show, ColumnType sortDataType, boolean multiColumnEditable, String description, Boolean actionRollup, Boolean inheritParent) {
+ public AtsAttributeValueColumn(AttributeTypeGeneric<?> attributeType, String id, String name, int width, String align, boolean show, ColumnType sortDataType, boolean multiColumnEditable, String description, Boolean actionRollup, Boolean inheritParent) {
super(id, name, width, align, show, sortDataType, multiColumnEditable, description, actionRollup, inheritParent);
- this.attrTypeId = attributeType.getId();
- this.attrTypeName = attributeType.getName();
- }
-
- public long getAttrTypeId() {
- return attrTypeId;
+ this.attributeType = attributeType;
}
- public void setAttrTypeId(long attrTypeId) {
- this.attrTypeId = attrTypeId;
+ public AtsAttributeValueColumn(AttributeTypeGeneric<?> attributeType) {
+ // For JaxRs Instantiation
+ this.attributeType = attributeType;
}
- public String getAttrTypeName() {
- return attrTypeName;
+ public AttributeTypeGeneric<?> getAttributeType() {
+ return attributeType;
}
- public void setAttrTypeName(String attrTypeName) {
- this.attrTypeName = attrTypeName;
+ public void setAttributeType(AttributeTypeGeneric<?> attributeType) {
+ this.attributeType = attributeType;
}
@Override
public String toString() {
- return "AtsAttributeValueColumn [name=" + getName() + ", namespace=" + getNamespace() + ", attrTypeId=" + attrTypeId + ", attrTypeName=" + attrTypeName + "]";
+ return "AtsAttributeValueColumn [name=" + getName() + ", namespace=" + getNamespace() + ", attributeType=" + attributeType + "]";
}
@Override
@@ -61,10 +57,9 @@ public class AtsAttributeValueColumn extends AtsValueColumn {
String result = null;
if (Strings.isValid(super.getId())) {
result = super.getId();
- } else if (Strings.isValid(attrTypeName)) {
- result = attrTypeName;
+ } else if (attributeType != null) {
+ result = attributeType.getName();
}
return result;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
index 3d4f3999844..2cf197cd093 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/column/AtsAttributeValueColumnHandler.java
@@ -45,7 +45,7 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
@Override
public String getColumnText(IAtsObject atsObject) {
- return getColumnText(atsObject, column.getAttrTypeId(), isActionRollup(), isInheritParent(), atsApi);
+ return getColumnText(atsObject, column.getAttributeType(), isActionRollup(), isInheritParent(), atsApi);
}
private Boolean isInheritParent() {
@@ -58,7 +58,7 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
return actionRollup == null ? false : actionRollup;
}
- public static String getColumnText(IAtsObject atsObject, long attrTypeId, boolean isActionRollup, boolean isInheritParent, AtsApi atsApi) {
+ public static String getColumnText(IAtsObject atsObject, AttributeTypeToken attributeType, boolean isActionRollup, boolean isInheritParent, AtsApi atsApi) {
try {
if (atsApi.getStoreService().isDeleted(atsObject)) {
return "<deleted>";
@@ -66,7 +66,6 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
if (atsObject instanceof IAtsWorkItem) {
IAtsWorkItem workItem = (IAtsWorkItem) atsObject;
- AttributeTypeToken attributeType = atsApi.tokenService().getAttributeType(attrTypeId);
String result = atsApi.getAttributeResolver().getAttributesToStringUniqueList(workItem, attributeType, ";");
if (Strings.isValid(result)) {
return result;
@@ -83,7 +82,7 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
Set<String> strs = new HashSet<>();
strs.add(atsObject.getName());
for (IAtsTeamWorkflow team : teams) {
- String str = getColumnText(team, attrTypeId, isActionRollup, isInheritParent, atsApi);
+ String str = getColumnText(team, attributeType, isActionRollup, isInheritParent, atsApi);
if (Strings.isValid(str)) {
strs.add(str);
}
@@ -96,12 +95,8 @@ public class AtsAttributeValueColumnHandler implements IAtsColumn {
return "";
}
- public static String getColumnText(IAtsObject atsObject, AttributeTypeToken attributeType, boolean isActionRollup, boolean inheritParent, AtsApi atsApi) {
- return getColumnText(atsObject, attributeType.getId(), isActionRollup, inheritParent, atsApi);
- }
-
@Override
public String toString() {
- return "AtsAttributeValueColumnHandler [attrType=" + column.getAttrTypeName() + "]";
+ return "AtsAttributeValueColumnHandler [attrType=" + column.getAttributeType() + "]";
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractWorkflowVersionDateColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractWorkflowVersionDateColumn.java
index f0a47c351a1..e999c031381 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractWorkflowVersionDateColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AbstractWorkflowVersionDateColumn.java
@@ -28,8 +28,8 @@ import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.xviewer.column.XViewerAtsAttributeValueColumn;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -43,7 +43,7 @@ import org.eclipse.osee.framework.ui.skynet.util.LogUtil;
*/
public abstract class AbstractWorkflowVersionDateColumn extends XViewerAtsAttributeValueColumn {
- public AbstractWorkflowVersionDateColumn(String id, AttributeTypeToken attributeType) {
+ public AbstractWorkflowVersionDateColumn(String id, AttributeTypeGeneric<?> attributeType) {
super(attributeType, id, attributeType.getUnqualifiedName(), 80, XViewerAlign.Left, false, SortDataType.Date,
true, "");
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AtsAttributeValueColumnFactory.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AtsAttributeValueColumnFactory.java
index 3b9b986957d..f7292941ab6 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AtsAttributeValueColumnFactory.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/AtsAttributeValueColumnFactory.java
@@ -27,8 +27,7 @@ public class AtsAttributeValueColumnFactory {
AtsAttributeValueColumn col = new AtsAttributeValueColumn();
col.setName(inCol.getName());
col.setNamespace(namespace);
- col.setAttrTypeId(inCol.getAttributeType().getId());
- col.setAttrTypeName(inCol.getAttributeType().getName());
+ col.setAttributeType(inCol.getAttributeType());
ColumnAlign colAlign = AtsEditors.getColumnAlign(inCol.getAlign());
col.setAlign(colAlign);
col.setColumnMultiEdit(inCol.isMultiColumnEditable());
@@ -42,5 +41,4 @@ public class AtsAttributeValueColumnFactory {
return col;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/CategoryColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/CategoryColumn.java
index e610c8dfd6e..8af1c2e9432 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/CategoryColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/CategoryColumn.java
@@ -17,7 +17,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.ide.util.xviewer.column.XViewerAtsAttributeValueColumn;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
/**
* @author Donald G. Dunne
@@ -40,7 +40,7 @@ public class CategoryColumn extends XViewerAtsAttributeValueColumn {
return category3;
}
- public CategoryColumn(AttributeTypeToken attributeType) {
+ public CategoryColumn(AttributeTypeGeneric<?> attributeType) {
super(attributeType, 80, XViewerAlign.Left, false, SortDataType.String, true, "");
setActionRollup(true);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/NumericColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/NumericColumn.java
index cc206099c8f..d874d1b50b4 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/NumericColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/NumericColumn.java
@@ -17,7 +17,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.ide.util.xviewer.column.XViewerAtsAttributeValueColumn;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
/**
* @author Donald G. Dunne
@@ -35,7 +35,7 @@ public class NumericColumn extends XViewerAtsAttributeValueColumn {
return numeric2;
}
- public NumericColumn(AttributeTypeToken attributeType) {
+ public NumericColumn(AttributeTypeGeneric<?> attributeType) {
super(attributeType, 40, XViewerAlign.Left, false, SortDataType.Float, true, "");
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeColumn.java
index 731ce077771..439ea0be507 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeColumn.java
@@ -16,7 +16,7 @@ package org.eclipse.osee.ats.ide.util.xviewer.column;
import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.IAttributeColumn;
@@ -25,7 +25,7 @@ import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.IAttri
*/
public class XViewerAtsAttributeColumn extends XViewerAtsColumn implements IAttributeColumn {
- private AttributeTypeToken attributeType;
+ private AttributeTypeGeneric<?> attributeType;
/**
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
@@ -51,19 +51,19 @@ public class XViewerAtsAttributeColumn extends XViewerAtsColumn implements IAttr
super();
}
- public XViewerAtsAttributeColumn(AttributeTypeToken attributeType, String id, String name, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ public XViewerAtsAttributeColumn(AttributeTypeGeneric<?> attributeType, String id, String name, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
super(id, name, width, align, show, sortDataType, multiColumnEditable,
Strings.isValid(description) ? description : attributeType.getDescription());
this.attributeType = attributeType;
}
@Override
- public AttributeTypeToken getAttributeType() {
+ public AttributeTypeGeneric<?> getAttributeType() {
return attributeType;
}
@Override
- public void setAttributeType(AttributeTypeToken attributeType) {
+ public void setAttributeType(AttributeTypeGeneric<?> attributeType) {
this.attributeType = attributeType;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeValueColumn.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeValueColumn.java
index 0d366e9d67a..d95227f7823 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeValueColumn.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/xviewer/column/XViewerAtsAttributeValueColumn.java
@@ -35,13 +35,12 @@ import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.AtsEditors;
import org.eclipse.osee.ats.ide.util.PromptChangeUtil;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
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.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.util.LogUtil;
@@ -62,18 +61,18 @@ public class XViewerAtsAttributeValueColumn extends XViewerAtsAttributeColumn im
String booleanNotSetShow = null;
List<String> multiLineColumns = Arrays.asList(AtsColumnId.Notes.getId());
- public XViewerAtsAttributeValueColumn(AttributeTypeToken attributeType, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ public XViewerAtsAttributeValueColumn(AttributeTypeGeneric<?> attributeType, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
super(attributeType, attributeType.getName(), attributeType.getUnqualifiedName(), width, align, show,
sortDataType, multiColumnEditable, description);
}
- public XViewerAtsAttributeValueColumn(AttributeTypeToken attributeType, String id, String name, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ public XViewerAtsAttributeValueColumn(AttributeTypeGeneric<?> attributeType, String id, String name, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
super(attributeType, id, name, width, align, show, sortDataType, multiColumnEditable, description);
}
public XViewerAtsAttributeValueColumn(AtsAttributeValueColumn column) {
- super(AttributeTypeManager.getAttributeType(column.getAttrTypeId()), column.getId(), column.getName(),
- column.getWidth(), AtsEditors.getXViewerAlign(column.getAlign()), column.isVisible(), getSortDataType(column),
+ super(column.getAttributeType(), column.getId(), column.getName(), column.getWidth(),
+ AtsEditors.getXViewerAlign(column.getAlign()), column.isVisible(), getSortDataType(column),
column.isColumnMultiEdit(), column.getDescription());
setInheritParent(column.isInheritParent());
setActionRollup(column.isActionRollup());
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewerUtil.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewerUtil.java
index 26f0f417f51..512a56ab3bc 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewerUtil.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewerUtil.java
@@ -21,16 +21,16 @@ import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.ats.api.config.AtsAttributeValueColumn;
import org.eclipse.osee.ats.api.data.AtsUserGroups;
+import org.eclipse.osee.ats.api.data.AtsTypeTokenProvider;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.internal.AtsApiService;
import org.eclipse.osee.ats.ide.util.AtsEditors;
import org.eclipse.osee.ats.ide.util.xviewer.column.XViewerAtsAttributeValueColumn;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.IUserGroupArtifactToken;
-import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist;
import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
/**
@@ -72,7 +72,7 @@ public class WorldXViewerUtil {
try {
if (AtsApiService.get().getUserService().getCurrentUser().getUserGroups().contains(
AtsUserGroups.AtsAddAttrColumns)) {
- for (AttributeTypeToken attributeType : AttributeTypeManager.getAllTypes()) {
+ for (AttributeTypeGeneric<?> attributeType : AttributeTypeManager.getAllTypes()) {
if (attributeType.getName().startsWith("ats.")) {
factory.registerColumns(SkynetXViewerFactory.getAttributeColumn(attributeType));
}
@@ -96,12 +96,7 @@ public class WorldXViewerUtil {
List<XViewerAtsAttributeValueColumn> configColumns = new ArrayList<>();
for (AtsAttributeValueColumn column : columns) {
try {
- AttributeTypeToken attrType = null;
- try {
- attrType = AttributeTypeManager.getAttributeType(column.getAttrTypeId());
- } catch (OseeTypeDoesNotExist ex) {
- continue;
- }
+ AttributeTypeGeneric<?> attrType = column.getAttributeType();
XViewerAtsAttributeValueColumn valueColumn = new XViewerAtsAttributeValueColumn(attrType, column.getWidth(),
AtsEditors.getXViewerAlign(column.getAlign()), column.isVisible(),
SortDataType.valueOf(column.getSortDataType()), column.isColumnMultiEdit(), column.getDescription());
diff --git a/plugins/org.eclipse.osee.ats.rest/OSEE-INF/atsConfig/views.json b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/atsConfig/views.json
index 1bbac686f7f..7e367bbde62 100644
--- a/plugins/org.eclipse.osee.ats.rest/OSEE-INF/atsConfig/views.json
+++ b/plugins/org.eclipse.osee.ats.rest/OSEE-INF/atsConfig/views.json
@@ -4,8 +4,7 @@
"name": "Legacy PCR Id",
"id": "ats.Legacy PCR Id",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
- "attrTypeId": 1152921504606847219,
- "attrTypeName": "ats.Legacy PCR Id",
+ "attributeType": 1152921504606847219,
"width": 40,
"align": "Left",
"visible": false,
@@ -20,8 +19,7 @@
"name": "Points Numeric",
"id": "ats.Points Numeric",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
- "attrTypeId": 1728793301637070003,
- "attrTypeName": "ats.Points Numeric",
+ "attributeType": 1728793301637070003,
"width": 40,
"align": "Left",
"visible": false,
@@ -32,8 +30,7 @@
"actionRollup": false
}, {
"align": "Left",
- "attrTypeId": 1728793301637070003,
- "attrTypeName": "ats.Points Numeric",
+ "attributeType": 1728793301637070003,
"columnMultiEdit": true,
"description": "Numeric Point Value",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -42,8 +39,7 @@
"width": 40
}, {
"align": "Left",
- "attrTypeId": 6025996821081174931,
- "attrTypeName": "ats.IPT",
+ "attributeType": 6025996821081174931,
"columnMultiEdit": true,
"description": "Integrated Product Team",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -53,8 +49,7 @@
"inheritParent": true
}, {
"align": "Left",
- "attrTypeId": 1152922093379125418,
- "attrTypeName": "ats.Originating PCR Id",
+ "attributeType": 1152922093379125418,
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -63,8 +58,7 @@
"width": 60
}, {
"align": "Left",
- "attrTypeId": 1152922093378076842,
- "attrTypeName": "ats.Duplicated PCR Id",
+ "attributeType": 1152922093378076842,
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -73,8 +67,7 @@
"width": 60
}, {
"align": "Left",
- "attrTypeId": 1152921949227188394,
- "attrTypeName": "ats.Applicable To Program",
+ "attributeType": 1152921949227188394,
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -83,8 +76,7 @@
"width": 60
}, {
"align": "Left",
- "attrTypeId": 1152922093379715242,
- "attrTypeName": "ats.Rationale",
+ "attributeType": 1152922093379715242,
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -93,8 +85,7 @@
"width": 100
}, {
"align": "Left",
- "attrTypeId": 1152922093370736810,
- "attrTypeName": "ats.PCR Tool Id",
+ "attributeType": 1152922093370736810,
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
@@ -103,9 +94,8 @@
"width": 60
}, {
"align": "Left",
- "attrTypeId": 2421093774890249189,
+ "attributeType": 2421093774890249189,
"name": "Unplanned Work",
- "attrTypeName": "ats.Unplanned Work",
"columnMultiEdit": true,
"description": "",
"namespace": "org.eclipse.osee.ats.WorldXViewer",
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
index fa2a8956bdf..73422f7a56a 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/AtsConfigEndpointImpl.java
@@ -35,7 +35,7 @@ import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactImage;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.TransactionId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -145,7 +145,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
List<AtsAttributeValueColumn> columns = new LinkedList<>();
for (String id : sortedIds) {
- AttributeTypeToken attrType = idToToken.get(id);
+ AttributeTypeGeneric<?> attrType = idToToken.get(id);
ColumnAlign columnAlign = ColumnAlign.Left;
SortDataType sortDataType = SortDataType.String;
int width = 60;
@@ -168,8 +168,7 @@ public final class AtsConfigEndpointImpl implements AtsConfigEndpointApi {
}
AtsAttributeValueColumn valueColumn = new AtsAttributeValueColumn();
- valueColumn.setAttrTypeId(attrType.getId());
- valueColumn.setAttrTypeName(attrType.getName());
+ valueColumn.setAttributeType(attrType);
valueColumn.setWidth(width);
valueColumn.setAlign(columnAlign);
valueColumn.setVisible(true);
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
index 041555ef60d..2662688eafb 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/config/UpdateAtsConfiguration.java
@@ -29,13 +29,13 @@ import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreBranches;
import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.enums.SystemUser;
-import org.eclipse.osee.framework.core.util.JsonUtil;
import org.eclipse.osee.framework.core.util.OseeInf;
import org.eclipse.osee.framework.jdk.core.result.XResultData;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.jaxrs.JaxRsApi;
import org.eclipse.osee.orcs.OrcsApi;
import org.eclipse.osee.orcs.data.ArtifactReadable;
import org.eclipse.osee.orcs.data.AttributeReadable;
@@ -52,10 +52,12 @@ public class UpdateAtsConfiguration {
private final AtsApi atsApi;
private final OrcsApi orcsApi;
+ private final JaxRsApi jaxRsApi;
public UpdateAtsConfiguration(AtsApi atsApi, OrcsApi orcsApi) {
this.atsApi = atsApi;
this.orcsApi = orcsApi;
+ this.jaxRsApi = orcsApi.jaxRsApi();
}
public XResultData createUpdateConfig(XResultData rd) {
@@ -84,7 +86,7 @@ public class UpdateAtsConfiguration {
try {
AtsViews databaseViews = getConfigViews();
for (String viewsJson : getViewsJsonStrings()) {
- AtsViews atsViews = JsonUtil.readValue(viewsJson, AtsViews.class);
+ AtsViews atsViews = orcsApi.jaxRsApi().readValue(viewsJson, AtsViews.class);
// merge any new default view items to current database view items
List<AtsAttributeValueColumn> toAdd = new LinkedList<>();
for (AtsAttributeValueColumn defaultView : atsViews.getAttrColumns()) {
@@ -96,7 +98,7 @@ public class UpdateAtsConfiguration {
found = true;
break;
}
- if (!found && dbView.getAttrTypeName().equals(defaultView.getAttrTypeName())) {
+ if (!found && dbView.getAttributeType().equals(defaultView.getAttributeType())) {
found = true;
break;
}
@@ -135,13 +137,13 @@ public class UpdateAtsConfiguration {
}
private String getViewsAttrValue(AtsViews defaultViews) {
- return VIEWS_EQUAL_KEY + JsonUtil.toJson(defaultViews);
+ return VIEWS_EQUAL_KEY + jaxRsApi.toJson(defaultViews);
}
private void createUpdateColorColumnAttributes() {
ColorColumns columns = new ColorColumns();
columns.addColumn(ColorTeamColumn.getColor());
- String colorColumnsJson = JsonUtil.toJson(columns);
+ String colorColumnsJson = jaxRsApi.toJson(columns);
atsApi.setConfigValue(COLOR_COLUMN_KEY, colorColumnsJson);
}
@@ -166,7 +168,7 @@ public class UpdateAtsConfiguration {
String viewsStr = atsApi.getConfigValue(VIEWS_KEY);
AtsViews views = null;
if (Strings.isValid(viewsStr)) {
- views = JsonUtil.readValue(viewsStr, AtsViews.class);
+ views = orcsApi.jaxRsApi().readValue(viewsStr, AtsViews.class);
} else {
views = new AtsViews();
}
@@ -177,7 +179,7 @@ public class UpdateAtsConfiguration {
String colorStr = atsApi.getConfigValue(COLOR_COLUMN_KEY);
ColorColumns columns = null;
if (Strings.isValid(colorStr)) {
- columns = JsonUtil.readValue(colorStr, ColorColumns.class);
+ columns = jaxRsApi.readValue(colorStr, ColorColumns.class);
} else {
columns = new ColorColumns();
}
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/OrcsTokenService.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/OrcsTokenService.java
index c8e163d5c8d..aaa7e5d63be 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/OrcsTokenService.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/OrcsTokenService.java
@@ -25,6 +25,8 @@ import org.eclipse.osee.framework.core.data.RelationTypeJoin;
import org.eclipse.osee.framework.core.data.RelationTypeToken;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import java.util.Collection;
+
/**
* @author Ryan D. Brooks
*/
@@ -118,6 +120,11 @@ public interface OrcsTokenService {
void registerRelationType(RelationTypeToken relationType);
/**
+ * @return all registered attribute types
+ */
+ Collection<AttributeTypeGeneric<?>> getAttributeTypes();
+
+ /**
* Get Iterable List of ids of Attributes that are taggable
*/
Iterable<AttributeTypeGeneric<?>> getTaggedAttrs();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
index 98af2f5a33c..28c740d1c77 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/SkynetXViewerFactory.java
@@ -26,6 +26,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.customize.IXViewerCustomizations;
import org.eclipse.nebula.widgets.xviewer.customize.XViewerCustomizations;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -51,7 +52,7 @@ public abstract class SkynetXViewerFactory extends XViewerFactory {
public SkynetXViewerFactory(String namespace, IOseeTreeReportProvider reportProvider) {
super(namespace);
this.reportProvider = reportProvider;
- for (AttributeTypeToken attributeType : AttributeTypeManager.getAllTypes()) {
+ for (AttributeTypeGeneric<?> attributeType : AttributeTypeManager.getAllTypes()) {
attrColumns.add(getAttributeColumn(attributeType));
}
}
@@ -80,7 +81,7 @@ public abstract class SkynetXViewerFactory extends XViewerFactory {
}
}
- public static XViewerColumn getAttributeColumn(AttributeTypeToken attributeType) {
+ public static XViewerColumn getAttributeColumn(AttributeTypeGeneric<?> attributeType) {
return new AttributeColumn("attribute." + attributeType.getName(), attributeType.getName(), attributeType, 75,
XViewerAlign.Left, false, XViewerAttributeSortDataType.get(attributeType), false, null);
}
@@ -127,14 +128,14 @@ public abstract class SkynetXViewerFactory extends XViewerFactory {
// Add attribute types used next
for (AttributeTypeToken attributeType : attrTypesUsed) {
if (!attrNames.contains(attributeType.getName())) {
- columns.add(getAttributeColumn(attributeType));
+ columns.add(getAttributeColumn(AttributeTypeManager.getAttributeType(attributeType.getId())));
attrNames.add(attributeType.getName());
}
}
// Add remainder last
for (AttributeTypeToken attributeType : attributeTypes) {
if (!attrNames.contains(attributeType.getName())) {
- columns.add(getAttributeColumn(attributeType));
+ columns.add(getAttributeColumn(AttributeTypeManager.getAttributeType(attributeType.getId())));
attrNames.add(attributeType.getName());
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/AttributeColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/AttributeColumn.java
index 6d7aec4737b..b8d2b46822f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/AttributeColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/AttributeColumn.java
@@ -19,7 +19,7 @@ import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.util.XViewerException;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
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.change.Change;
@@ -30,7 +30,7 @@ import org.eclipse.osee.framework.skynet.core.conflict.Conflict;
*/
public class AttributeColumn extends XViewerValueColumn implements IAttributeColumn {
- private AttributeTypeToken attributeType;
+ private AttributeTypeGeneric<?> attributeType;
/**
* XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
@@ -55,7 +55,7 @@ public class AttributeColumn extends XViewerValueColumn implements IAttributeCol
super(xViewer, xml);
}
- public AttributeColumn(String id, String name, AttributeTypeToken attributeType, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ public AttributeColumn(String id, String name, AttributeTypeGeneric<?> attributeType, int width, XViewerAlign align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
super(id, name, width, align, show, sortDataType, multiColumnEditable, description);
this.attributeType = attributeType;
}
@@ -78,12 +78,12 @@ public class AttributeColumn extends XViewerValueColumn implements IAttributeCol
}
@Override
- public AttributeTypeToken getAttributeType() {
+ public AttributeTypeGeneric<?> getAttributeType() {
return attributeType;
}
@Override
- public void setAttributeType(AttributeTypeToken attributeType) {
+ public void setAttributeType(AttributeTypeGeneric<?> attributeType) {
this.attributeType = attributeType;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/IAttributeColumn.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/IAttributeColumn.java
index 9d4759c85a1..d3bba2171a6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/IAttributeColumn.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xviewer/skynet/column/IAttributeColumn.java
@@ -13,15 +13,15 @@
package org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
/**
* @author Donald G. Dunne
*/
public interface IAttributeColumn {
- AttributeTypeToken getAttributeType();
+ AttributeTypeGeneric<?> getAttributeType();
- void setAttributeType(AttributeTypeToken attributeType);
+ void setAttributeType(AttributeTypeGeneric<?> attributeType);
} \ No newline at end of file

Back to the top