blob: dda3a1a8001deb6dcf2a4db2a5dd76d129ed4bf5 [file] [log] [blame]
diff --git a/features/org.eclipse.osee.core.server.external.feature/feature.xml b/features/org.eclipse.osee.core.server.external.feature/feature.xml
index 0eb95c6d0c..683b9d4a63 100644
--- a/features/org.eclipse.osee.core.server.external.feature/feature.xml
+++ b/features/org.eclipse.osee.core.server.external.feature/feature.xml
@@ -1076,20 +1076,6 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.osee.framework.core.dsl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.core.dsl.integration"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
<plugin
id="org.eclipse.osee.framework.resource.management"
download-size="0"
diff --git a/features/org.eclipse.osee.core.server.feature/feature.xml b/features/org.eclipse.osee.core.server.feature/feature.xml
index 56e23e30f1..f072155677 100644
--- a/features/org.eclipse.osee.core.server.feature/feature.xml
+++ b/features/org.eclipse.osee.core.server.feature/feature.xml
@@ -552,20 +552,6 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.osee.framework.core.dsl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.core.dsl.integration"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
<plugin
id="org.eclipse.osee.framework.core.model"
download-size="0"
diff --git a/features/org.eclipse.osee.framework.feature/feature.xml b/features/org.eclipse.osee.framework.feature/feature.xml
index 834bf6f182..2d6a2585bd 100644
--- a/features/org.eclipse.osee.framework.feature/feature.xml
+++ b/features/org.eclipse.osee.framework.feature/feature.xml
@@ -239,34 +239,6 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.osee.framework.access"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.access.provider"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.core.dsl.integration"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.core.dsl"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
<plugin
id="org.eclipse.osee.framework.branch.gantt"
download-size="0"
diff --git a/features/org.eclipse.osee.framework.ui.feature/feature.xml b/features/org.eclipse.osee.framework.ui.feature/feature.xml
index 3d717212ae..f07e988c3e 100644
--- a/features/org.eclipse.osee.framework.ui.feature/feature.xml
+++ b/features/org.eclipse.osee.framework.ui.feature/feature.xml
@@ -31,7 +31,6 @@
<import plugin="org.eclipse.osee.framework.jdk.core"/>
<import plugin="org.eclipse.osee.framework.logging"/>
<import plugin="org.eclipse.osee.framework.plugin.core"/>
- <import plugin="org.eclipse.osee.framework.access"/>
<import plugin="org.eclipse.osee.framework.ui.plugin"/>
<import plugin="org.eclipse.osee.framework.ui.swt"/>
<import plugin="org.eclipse.ui.intro"/>
@@ -58,7 +57,6 @@
<import plugin="org.eclipse.zest.layouts"/>
<import plugin="org.eclipse.gef"/>
<import plugin="org.eclipse.osee.ote.define"/>
- <import plugin="org.eclipse.osee.framework.core.dsl"/>
<import plugin="org.eclipse.xtext.ui"/>
<import plugin="org.eclipse.ui.editors" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.ui.shared"/>
@@ -70,7 +68,6 @@
<import plugin="org.eclipse.xtext"/>
<import plugin="org.eclipse.core.commands"/>
<import plugin="org.eclipse.core.jobs"/>
- <import plugin="org.eclipse.osee.framework.core.dsl.integration"/>
<import plugin="org.eclipse.swt"/>
<import plugin="org.eclipse.osgi"/>
<import plugin="org.eclipse.jdt.core"/>
@@ -140,18 +137,4 @@
version="0.0.0"
unpack="false"/>
- <plugin
- id="org.eclipse.osee.framework.core.dsl.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.osee.framework.core.dsl.ui.integration"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
diff --git a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
index 1875dc5b13..4a5c885fc2 100644
--- a/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.api/META-INF/MANIFEST.MF
@@ -66,11 +66,14 @@ Import-Package: com.fasterxml.jackson.annotation,
org.eclipse.nebula.widgets.xviewer.core.model,
org.eclipse.osee.activity.api,
org.eclipse.osee.framework.core,
+ org.eclipse.osee.framework.core.access,
+ org.eclipse.osee.framework.core.access.context,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.enums.token,
org.eclipse.osee.framework.core.event,
org.eclipse.osee.framework.core.model,
+ org.eclipse.osee.framework.core.model.access,
org.eclipse.osee.framework.core.model.change,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.core.util.result,
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/AtsApi.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/AtsApi.java
index 5cb4cdfd1b..f1cd52214c 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/AtsApi.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/AtsApi.java
@@ -15,6 +15,7 @@ package org.eclipse.osee.ats.api;
import java.util.Collection;
import java.util.List;
+import org.eclipse.osee.ats.api.access.IAtsAccessService;
import org.eclipse.osee.ats.api.agile.IAgileService;
import org.eclipse.osee.ats.api.agile.IAgileSprintHtmlOperation;
import org.eclipse.osee.ats.api.ai.IAtsActionableItemService;
@@ -56,6 +57,7 @@ import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsWorkStateFactory;
import org.eclipse.osee.framework.core.OseeApi;
+import org.eclipse.osee.framework.core.access.IAccessControlService;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
@@ -200,6 +202,11 @@ public interface AtsApi extends OseeApi, IAtsEarnedValueServiceProvider, IAtsWor
IAtsServerEndpointProvider getServerEndpoints();
+ IAtsAccessService getAtsAccessService();
+
+ @Override
+ IAccessControlService getAccessControlService();
+
default void reloadServerAndClientCaches() {
getServerEndpoints().getConfigEndpoint().getWithPend();
getConfigService().getConfigurationsWithPend();
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/access/AtsAccessContextTokens.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/access/AtsAccessContextTokens.java
index 9ea5544367..598b2b9962 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/access/AtsAccessContextTokens.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/access/AtsAccessContextTokens.java
@@ -20,8 +20,8 @@ import org.eclipse.osee.framework.core.data.AccessContextToken;
*/
public final class AtsAccessContextTokens {
- public static final AccessContextToken DENY_CONTEXT =
- AccessContextToken.valueOf(4870045005030602805L, "ats.branchobject.deny");
+ public static final AccessContextToken ATS_BRANCH_READ =
+ AccessContextToken.valueOf(4870045005030602805L, "ats.branch.read");
private AtsAccessContextTokens() {
// Branch Object Contexts;
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxActionableItem.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxActionableItem.java
index 8ed5867c63..94151a1d4c 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxActionableItem.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxActionableItem.java
@@ -16,6 +16,7 @@ package org.eclipse.osee.ats.api.config.tx;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.config.Csci;
import org.eclipse.osee.ats.api.config.WorkType;
+import org.eclipse.osee.framework.core.data.AccessContextToken;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.AccessContextToken;
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxTeamDef.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxTeamDef.java
index 7c0430c899..228dd6fe43 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxTeamDef.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/config/tx/IAtsConfigTxTeamDef.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.ats.api.query.NextRelease;
import org.eclipse.osee.ats.api.query.ReleasedOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.framework.core.data.AccessContextToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.AccessContextToken;
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsUserGroups.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsUserGroups.java
index 477883d8ed..b69ccc26f3 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsUserGroups.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/data/AtsUserGroups.java
@@ -22,8 +22,8 @@ import org.eclipse.osee.framework.core.data.UserGroupArtifactToken;
public class AtsUserGroups {
public static IUserGroupArtifactToken AtsAddAttrColumns =
- UserGroupArtifactToken.valueOf(10847751L, "AtsAddAttrColumns");
- public static IUserGroupArtifactToken AtsAdmin = UserGroupArtifactToken.valueOf(136750L, "AtsAdmin");
- public static IUserGroupArtifactToken AtsTempAdmin = UserGroupArtifactToken.valueOf(5367074L, "AtsTempAdmin");
+ UserGroupArtifactToken.valueOf(10847751L, "Ats Add Attr Columns");
+ public static IUserGroupArtifactToken AtsAdmin = UserGroupArtifactToken.valueOf(136750L, "Ats Admin");
+ public static IUserGroupArtifactToken AtsTempAdmin = UserGroupArtifactToken.valueOf(5367074L, "AtsTemp Admin");
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/demo/DemoArtifactToken.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/demo/DemoArtifactToken.java
index e590012b0a..8b7e88dd22 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/demo/DemoArtifactToken.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/demo/DemoArtifactToken.java
@@ -43,6 +43,17 @@ public final class DemoArtifactToken {
public static final ArtifactToken SystemReqArtifact = ArtifactToken.valueOf(45454545, "System Req Artifact", DemoBranches.SAW_Bld_1, CoreArtifactTypes.SystemRequirementMsWord);
public static final ArtifactToken EventsSwReq = ArtifactToken.valueOf(200090, "Events", DemoBranches.SAW_Bld_1, CoreArtifactTypes.SoftwareRequirementMsWord);
+ //////////////////////////////////
+ // Software Requirements
+ //////////////////////////////////
+ public static final ArtifactToken CollaborativeRobotEvents = ArtifactToken.valueOf(200092, "Collaborative robot events", DemoBranches.SAW_Bld_2);
+ public static final ArtifactToken VirtualFixes = ArtifactToken.valueOf(200095, "VirtualFixes", DemoBranches.SAW_PL_Access_Baseline_Test);
+
+ //////////////////////////////////
+ // System Requirements
+ //////////////////////////////////
+ public static final ArtifactToken PerformanceRequirements = ArtifactToken.valueOf(200112, "Performance Requirements", DemoBranches.SAW_Bld_2);
+
//////////////////////////////////
// Impl Details Configuration
//////////////////////////////////
@@ -154,6 +165,10 @@ public final class DemoArtifactToken {
public static final ArtifactToken SAW_NoBranch_Req_TeamWf = ArtifactToken.valueOf(5564873, DemoWorkflowTitles.SAW_NO_BRANCH_REQT_CHANGES_FOR_DIAGRAM_VIEW, COMMON, AtsDemoOseeTypes.DemoReqTeamWorkflow);
public static final ArtifactToken SAW_NoBranch_Test_TeamWf = ArtifactToken.valueOf(11548766, DemoWorkflowTitles.SAW_NO_BRANCH_REQT_CHANGES_FOR_DIAGRAM_VIEW, COMMON, AtsDemoOseeTypes.DemoTestTeamWorkflow);
+ public static final ArtifactToken SAW_Access_Control_Req_TeamWf = ArtifactToken.valueOf(32482, "SAW Access Ctrl Test - Req", AtsDemoOseeTypes.DemoReqTeamWorkflow);
+ public static final ArtifactToken SAW_Access_Control_Code_TeamWf = ArtifactToken.valueOf(32483, "SAW Access Ctrl Test - Code", AtsDemoOseeTypes.DemoCodeTeamWorkflow);
+ public static final ArtifactToken SAW_Access_Control_Test_TeamWf = ArtifactToken.valueOf(32484, "SAW Access Ctrl Test - Test", AtsDemoOseeTypes.DemoTestTeamWorkflow);
+
//////////////////////////////////
// RD Agile Configuration
//////////////////////////////////
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
index d8f64f4ff0..0756cd4007 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IRelationResolver.java
@@ -17,6 +17,7 @@ import java.util.Collection;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.framework.core.access.context.IParentProvider;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
@@ -27,7 +28,7 @@ import org.eclipse.osee.framework.core.enums.DeletionFlag;
/**
* @author Donald G. Dunne
*/
-public interface IRelationResolver {
+public interface IRelationResolver extends IParentProvider {
Collection<ArtifactToken> getRelated(ArtifactId artifact, RelationTypeSide relationType);
@@ -68,8 +69,6 @@ public interface IRelationResolver {
Collection<ArtifactToken> getChildren(ArtifactId artifact);
- ArtifactToken getParent(ArtifactId artifact);
-
int getRelatedCount(ArtifactToken artifact, RelationTypeSide relationTypeSide);
Collection<Long> getRelatedIds(ArtifactId artifact, RelationTypeSide relationTypeSide);
diff --git a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
index 9c7b174179..88b8532604 100644
--- a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
@@ -39,6 +39,7 @@ Import-Package: com.fasterxml.jackson.annotation,
org.osgi.service.event
Bundle-Vendor: Eclipse Open System Engineering Environment
Export-Package: org.eclipse.osee.ats.core.access,
+ org.eclipse.osee.ats.core.access.demo,
org.eclipse.osee.ats.core.agile,
org.eclipse.osee.ats.core.agile.operations,
org.eclipse.osee.ats.core.ai,
diff --git a/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.task.autogen.xml b/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.task.autogen.xml
deleted file mode 100644
index b299df7545..0000000000
--- a/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.task.autogen.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true">
- <implementation class="org.eclipse.osee.ats.core.task.TaskAutoGenArtifactChecks"/>
- <service>
- <provide interface="org.eclipse.osee.framework.core.access.IArtifactCheck"/>
- </service>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.xml b/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.xml
deleted file mode 100644
index 726d59dea4..0000000000
--- a/plugins/org.eclipse.osee.ats.core/OSGI-INF/artifact.check.provider.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true">
- <implementation class="org.eclipse.osee.ats.core.access.AtsArtifactChecks"/>
- <service>
- <provide interface="org.eclipse.osee.framework.core.access.IArtifactCheck"/>
- </service>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/tx/AtsConfigTxTeamDef.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/tx/AtsConfigTxTeamDef.java
index 60b66ba11b..0e8a922487 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/tx/AtsConfigTxTeamDef.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/tx/AtsConfigTxTeamDef.java
@@ -35,6 +35,7 @@ import org.eclipse.osee.ats.api.query.ReleasedOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.framework.core.data.AccessContextToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.AccessContextToken;
import org.eclipse.osee.framework.core.data.BranchToken;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsChangeSet.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsChangeSet.java
index 67af55270a..5fb1a5a78d 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AbstractAtsChangeSet.java
@@ -32,6 +32,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.util.AtsRelationChange.RelationOperation;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
+import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -180,6 +181,11 @@ public abstract class AbstractAtsChangeSet implements IAtsChangeSet {
@Override
public ArtifactToken createArtifact(ArtifactToken token) {
+ ArtifactTypeToken typeToken = token.getArtifactType();
+ if (typeToken.isInvalid()) {
+ throw new OseeArgumentException("Artifact Type Token %s is invalid for artifact creation",
+ typeToken.toStringWithId());
+ }
return createArtifact(token.getArtifactType(), token.getName(), token.getId());
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsApiImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsApiImpl.java
index bfb1b6b0bd..b8435ba257 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsApiImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsApiImpl.java
@@ -20,6 +20,7 @@ import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.AtsApi;
import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.access.IAtsAccessService;
import org.eclipse.osee.ats.api.agile.IAgileSprintHtmlOperation;
import org.eclipse.osee.ats.api.ai.IAtsActionableItemService;
import org.eclipse.osee.ats.api.column.IAtsColumnService;
@@ -59,6 +60,7 @@ import org.eclipse.osee.ats.api.workflow.ITeamWorkflowProvidersLazy;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateFactory;
import org.eclipse.osee.ats.api.workflow.state.IAtsWorkStateFactory;
+import org.eclipse.osee.ats.core.access.AtsAccessService;
import org.eclipse.osee.ats.core.config.TeamDefinitionServiceImpl;
import org.eclipse.osee.ats.core.internal.column.ev.AtsColumnService;
import org.eclipse.osee.ats.core.internal.log.AtsLogFactory;
@@ -131,6 +133,7 @@ public abstract class AtsApiImpl extends OseeApiBase implements AtsApi {
protected IAtsTaskSetDefinitionProviderService taskSetDefinitionProviderService;
protected IAtsNotificationService notificationService;
protected List<INewActionPageAttributeFactoryProvider> attributeFactoryProviders = new LinkedList<>();
+ protected IAtsAccessService atsAccessService;
Collection<IAgileSprintHtmlOperation> agileSprintHtmlReportOperations = new LinkedList<>();
@@ -588,4 +591,12 @@ public abstract class AtsApiImpl extends OseeApiBase implements AtsApi {
return notificationService;
}
+ @Override
+ public IAtsAccessService getAtsAccessService() {
+ if (atsAccessService == null) {
+ atsAccessService = new AtsAccessService(this);
+ }
+ return atsAccessService;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.ide.demo/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.ide.demo/META-INF/MANIFEST.MF
index 9bfbad256c..abaefc8b42 100644
--- a/plugins/org.eclipse.osee.ats.ide.demo/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.ide.demo/META-INF/MANIFEST.MF
@@ -13,6 +13,8 @@ Require-Bundle: org.eclipse.ui,
Import-Package: javax.ws.rs.core,
org.eclipse.core.filesystem,
org.eclipse.osee.ats.api,
+ org.eclipse.osee.ats.core.access,
+ org.eclipse.osee.ats.core.access.demo,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.core.model,
org.eclipse.osee.ats.core.model.impl,
@@ -43,13 +45,16 @@ Import-Package: javax.ws.rs.core,
org.eclipse.osee.client.demo,
org.eclipse.osee.define.ide.traceability,
org.eclipse.osee.define.ide.traceability.data,
- org.eclipse.osee.framework.access,
+ org.eclipse.osee.framework.core,
+ org.eclipse.osee.framework.core.access,
+ org.eclipse.osee.framework.core.access.context,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.enums.token,
org.eclipse.osee.framework.core.exception,
org.eclipse.osee.framework.core.model,
+ org.eclipse.osee.framework.core.model.access,
org.eclipse.osee.framework.core.model.type,
org.eclipse.osee.framework.core.operation,
org.eclipse.osee.framework.core.util,
diff --git a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/artifact/DemoTeamWorkflows.java b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/artifact/DemoTeamWorkflows.java
index da49ec6343..43015ff8ac 100644
--- a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/artifact/DemoTeamWorkflows.java
+++ b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/artifact/DemoTeamWorkflows.java
@@ -45,8 +45,8 @@ public class DemoTeamWorkflows implements ITeamWorkflowProvider {
@Override
public String getBranchName(IAtsTeamWorkflow teamWf, String defaultBranchName) {
try {
- if (teamWf.getTeamDefinition().getName().contains("SAW Test")) {
- return "SAW Test - " + defaultBranchName;
+ if (teamWf.getTeamDefinition().getName().contains("SAW Code")) {
+ return "SAW Code - " + defaultBranchName;
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd10SetupAndImportReqs.java b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd10SetupAndImportReqs.java
index 1d3935e452..edf741ed24 100644
--- a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd10SetupAndImportReqs.java
+++ b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd10SetupAndImportReqs.java
@@ -21,12 +21,13 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Level;
+import org.eclipse.osee.ats.api.data.AtsArtifactToken;
import org.eclipse.osee.ats.api.demo.DemoArtifactToken;
import org.eclipse.osee.ats.ide.demo.config.DemoDbUtil;
import org.eclipse.osee.ats.ide.demo.internal.Activator;
import org.eclipse.osee.ats.ide.demo.internal.AtsApiService;
+import org.eclipse.osee.ats.ide.demo.internal.OseeApiService;
import org.eclipse.osee.ats.ide.util.AtsUtilClient;
-import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -37,6 +38,8 @@ import org.eclipse.osee.framework.core.enums.CoreArtifactTokens;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.CoreUserGroups;
+import org.eclipse.osee.framework.core.enums.DemoBranches;
import org.eclipse.osee.framework.core.enums.DemoUsers;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.operation.IOperation;
@@ -99,12 +102,35 @@ public class Pdd10SetupAndImportReqs implements IPopulateDemoDatabase {
demoDbTraceabilityTx(demoDbTraceability, SAW_Bld_1);
demoDbTraceability.execute();
+ // Note: SAW_Bld_1 is created during orcs dbinit in CreateDemoBranches
+ BranchManager.setAssociatedArtifactId(SAW_Bld_1, AtsArtifactToken.AtsCmBranch);
+
createNewBaselineBranch(SAW_Bld_1, SAW_Bld_2);
+ BranchManager.setAssociatedArtifactId(SAW_Bld_2, AtsArtifactToken.AtsCmBranch);
createNewBaselineBranch(SAW_Bld_2, SAW_Bld_3);
+ BranchManager.setAssociatedArtifactId(SAW_Bld_3, AtsArtifactToken.AtsCmBranch);
+
+ // Note: CIS_Bld_1 is created during orcs dbinit in CreateDemoBranches
+ BranchManager.setAssociatedArtifactId(DemoBranches.CIS_Bld_1, AtsArtifactToken.AtsCmBranch);
+
+ // Note: PL branches are created in CreateDemoBranches
+ BranchManager.setAssociatedArtifactId(DemoBranches.SAW_PL, AtsArtifactToken.AtsCmBranch);
+ setBaselineAccessControl(DemoBranches.SAW_PL);
+
+ BranchManager.setAssociatedArtifactId(DemoBranches.SAW_PL_Hardening_Branch, AtsArtifactToken.AtsCmBranch);
+ setBaselineAccessControl(DemoBranches.SAW_PL_Hardening_Branch);
configureRequirementsForImplDetails();
}
+ private void setBaselineAccessControl(BranchToken branch) {
+ OseeApiService.get().getAccessControlService().removePermissions(branch);
+ ArtifactToken kayJones = UserManager.getUserByArtId(DemoUsers.Kay_Jones);
+ OseeApiService.get().getAccessControlService().setPermission(kayJones, branch, PermissionEnum.FULLACCESS);
+ OseeApiService.get().getAccessControlService().setPermission(CoreUserGroups.Everyone, branch,
+ PermissionEnum.READ);
+ }
+
private void configureRequirementsForImplDetails() {
SkynetTransaction transaction =
@@ -196,8 +222,8 @@ public class Pdd10SetupAndImportReqs implements IPopulateDemoDatabase {
try {
childBranch = BranchManager.createBaselineBranch(srcBranch, destBranch);
- AccessControlManager.setPermission(UserManager.getUser(DemoUsers.Joe_Smith), childBranch,
- PermissionEnum.FULLACCESS);
+ AtsApiService.get().getAccessControlService().setPermission(UserManager.getUser(DemoUsers.Joe_Smith),
+ childBranch, PermissionEnum.FULLACCESS);
// need to update the branch type;
ConnectionHandler.runPreparedUpdate(UPDATE_BRANCH_TYPE, BranchType.BASELINE, childBranch);
diff --git a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd95CreateDemoEVConfigAndWorkPackages.java b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd95CreateDemoEVConfigAndWorkPackages.java
index 99403ebb12..d0f8b52b27 100644
--- a/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd95CreateDemoEVConfigAndWorkPackages.java
+++ b/plugins/org.eclipse.osee.ats.ide.demo/src/org/eclipse/osee/ats/ide/demo/populate/Pdd95CreateDemoEVConfigAndWorkPackages.java
@@ -182,7 +182,7 @@ public class Pdd95CreateDemoEVConfigAndWorkPackages {
// create country
createCountry(countryEp, country);
- // create and relate programs
+ // create and relate programs; these calls ensure that the static tokens are loaded and thus related to proper parents
DemoInsertion.getInsertions();
DemoInsertionActivity.getActivities();
for (DemoProgram program : country.getPrograms()) {
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.ide.integration.tests/META-INF/MANIFEST.MF
index 52f3464345..9913462a03 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/META-INF/MANIFEST.MF
@@ -29,6 +29,7 @@ Import-Package: com.fasterxml.jackson.core,
org.eclipse.nebula.widgets.xviewer.util,
org.eclipse.osee.account.rest.model,
org.eclipse.osee.ats.core.access,
+ org.eclipse.osee.ats.core.access.demo,
org.eclipse.osee.ats.core.column,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.core.query,
@@ -47,7 +48,6 @@ Import-Package: com.fasterxml.jackson.core,
org.eclipse.osee.ats.core.workflow.transition,
org.eclipse.osee.ats.core.workflow.util,
org.eclipse.osee.ats.ide,
- org.eclipse.osee.ats.ide.access,
org.eclipse.osee.ats.ide.actions,
org.eclipse.osee.ats.ide.actions.wizard,
org.eclipse.osee.ats.ide.branch,
@@ -91,8 +91,8 @@ Import-Package: com.fasterxml.jackson.core,
org.eclipse.osee.ats.ide.world.search,
org.eclipse.osee.client.test.framework,
org.eclipse.osee.define.api,
- org.eclipse.osee.framework.access,
org.eclipse.osee.framework.core,
+ org.eclipse.osee.framework.core.access,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.client.server,
org.eclipse.osee.framework.core.data,
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/OSGI-INF/ats.api.ide.ref.xml b/plugins/org.eclipse.osee.ats.ide.integration.tests/OSGI-INF/ats.api.ide.ref.xml
deleted file mode 100644
index d55db6c17a..0000000000
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/OSGI-INF/ats.api.ide.ref.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
- <implementation class="org.eclipse.osee.ats.ide.integration.tests.AtsApiService"/>
- <reference bind="setAtsApiIde" cardinality="1..1" interface="org.eclipse.osee.ats.ide.util.AtsApiIde" name="AtsApiIde" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/AtsIdeIntegrationTestSuite.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/AtsIdeIntegrationTestSuite.java
index 22d61eb048..239c96015f 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/AtsIdeIntegrationTestSuite.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/AtsIdeIntegrationTestSuite.java
@@ -16,6 +16,7 @@ package org.eclipse.osee.ats.ide.integration;
import org.eclipse.osee.ats.ide.integration.tests.AtsTest_AllAts_Suite;
import org.eclipse.osee.ats.ide.integration.tests.DemoDbPopulateSuite;
import org.eclipse.osee.ats.ide.integration.tests.DirtyArtifactCacheTest;
+import org.eclipse.osee.ats.ide.integration.tests.framework.access.FrameworkAccess_Suite;
import org.eclipse.osee.ats.ide.integration.tests.framework.skynet.core.artifact.SkyentCoreArtifact_Suite;
import org.eclipse.osee.ats.ide.integration.tests.framework.ui.skynet.FrameworkUiSkynetTest_Suite;
import org.eclipse.osee.ats.ide.integration.tests.framework.ui.skynet.dialog.FrameworkUiSkynetTest_Dialog_Suite;
@@ -36,6 +37,7 @@ import org.junit.runners.Suite;
@Suite.SuiteClasses({
DbInitTest.class,
DemoDbPopulateSuite.class,
+ FrameworkAccess_Suite.class,
SkyentCoreArtifact_Suite.class,
AtsTest_AllAts_Suite.class,
FrameworkUiSkynetTest_Suite.class,
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/AtsBranchAccessManagerTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/AtsBranchAccessManagerTest.java
index 410e18014d..26e64990b6 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/AtsBranchAccessManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/AtsBranchAccessManagerTest.java
@@ -14,24 +14,26 @@
package org.eclipse.osee.ats.ide.integration.tests.ats.access;
import static org.eclipse.osee.framework.core.enums.DemoBranches.SAW_Bld_1;
-import java.util.Arrays;
import java.util.Collection;
-import org.eclipse.osee.ats.api.data.AtsRelationTypes;
-import org.eclipse.osee.ats.api.demo.DemoActionableItems;
+import org.eclipse.osee.ats.api.access.AtsAccessContextTokens;
+import org.eclipse.osee.ats.api.access.IAtsAccessService;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.demo.DemoArtifactToken;
import org.eclipse.osee.ats.api.demo.DemoWorkType;
-import org.eclipse.osee.ats.ide.access.AtsBranchAccessManager;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.core.access.AtsAccessService;
+import org.eclipse.osee.ats.core.access.demo.DemoAtsAccessContextTokens;
+import org.eclipse.osee.ats.ide.demo.DemoUtil;
import org.eclipse.osee.ats.ide.integration.tests.AtsApiService;
import org.eclipse.osee.ats.ide.integration.tests.util.DemoTestUtil;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
-import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.AccessContextToken;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
import org.junit.Test;
/**
@@ -41,7 +43,7 @@ public class AtsBranchAccessManagerTest {
@Test
public void testIsApplicable() {
- AtsBranchAccessManager mgr = new AtsBranchAccessManager();
+ AtsAccessService mgr = new AtsAccessService(AtsApiService.get());
Assert.assertFalse(mgr.isApplicable(AtsApiService.get().getAtsBranch()));
Assert.assertFalse(mgr.isApplicable(SAW_Bld_1));
@@ -55,94 +57,63 @@ public class AtsBranchAccessManagerTest {
Assert.assertTrue(mgr.isApplicable(branch));
}
- @Before
- @After
- public void cleanup() {
- TeamWorkFlowArtifact teamArt =
- (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Requirements);
- SkynetTransaction transaction = TransactionManager.createTransaction(AtsApiService.get().getAtsBranch(),
- "testGetContextIdArtifact cleanup");
- Artifact teamDefArt = AtsApiService.get().getQueryServiceIde().getArtifact(teamArt.getTeamDefinition());
- teamDefArt.deleteAttributes(CoreAttributeTypes.AccessContextId);
- teamDefArt.persist(transaction);
- for (Artifact art : teamDefArt.getRelatedArtifacts(AtsRelationTypes.TeamActionableItem_ActionableItem)) {
- art.deleteAttributes(CoreAttributeTypes.AccessContextId);
- art.persist(transaction);
- }
- teamArt.deleteAttributes(CoreAttributeTypes.AccessContextId);
- teamArt.persist(transaction);
- transaction.execute();
- }
-
- /**
- * Test method for
- * {@link org.eclipse.osee.ats.ide.access.AtsBranchAccessManager#getContextId(org.eclipse.osee.framework.skynet.core.artifact.Artifact)}
- * {@link org.eclipse.osee.ats.ide.access.AtsBranchAccessManager#getEventFilters()}.
- * {@link org.eclipse.osee.ats.ide.access.AtsBranchAccessManager#handleArtifactEvent(org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent, org.eclipse.osee.framework.skynet.core.event.model.Sender)}
- */
@Test
- public void testGetContextIdBranch() throws Exception {
- AtsBranchAccessManager mgr = new AtsBranchAccessManager();
- TeamWorkFlowArtifact teamArt =
- (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Requirements);
-
- // confirm that no context id returned
- Assert.assertEquals(0, mgr.getContextId(teamArt.getWorkingBranch(), false).size());
-
- String teamDefContextId1 = "1234";
- String teamDefContextId2 = "2345";
- Artifact teamDefArt = AtsApiService.get().getQueryServiceIde().getArtifact(teamArt.getTeamDefinition());
- teamDefArt.setAttributeValues(CoreAttributeTypes.AccessContextId,
- Arrays.asList(teamDefContextId1, teamDefContextId2));
- teamDefArt.persist(getClass().getSimpleName());
-
- Assert.assertEquals(2, mgr.getContextId(teamArt.getWorkingBranch(), false).size());
-
- String aiContextId = "6789";
- Artifact aiArt = AtsApiService.get().getQueryServiceIde().getArtifact(
- AtsApiService.get().getActionableItemService().getActionableItems(
- Arrays.asList(DemoActionableItems.SAW_Requirements.getName())).iterator().next());
- aiArt.setAttributeValues(CoreAttributeTypes.AccessContextId, Arrays.asList(aiContextId));
- aiArt.persist(getClass().getSimpleName());
+ public void testGetContextIds() throws Exception {
+ IAtsAccessService accessService = AtsApiService.get().getAtsAccessService();
+ TeamWorkFlowArtifact teamArt = DemoUtil.getButtonWDoesntWorkOnSituationPageWf();
+ IAtsTeamDefinition teamDef = teamArt.getTeamDefinition();
+ IAtsActionableItem ai = teamArt.getActionableItems().iterator().next();
+
+ // confirm that deny context id is returned cause no branch
+ Collection<AccessContextToken> contextIds = accessService.getContextIds(teamArt.getWorkingBranch(), false);
+ Assert.assertEquals(1, contextIds.size());
+ Assert.assertTrue(contextIds.contains(AtsAccessContextTokens.ATS_BRANCH_READ));
+
+ // create branch
+ IAtsChangeSet changes = AtsApiService.get().createChangeSet(getClass().getSimpleName() + " - set target ver");
+ IAtsVersion ver = AtsApiService.get().getVersionService().getVersionById(DemoArtifactToken.CIS_Bld_1);
+ AtsApiService.get().getVersionService().setTargetedVersion(teamArt, ver, changes);
+ changes.execute();
+ AtsApiService.get().getBranchServiceIde().createWorkingBranch_Create(teamArt, true);
+
+ // confirm 0 contexts
+ contextIds = accessService.getContextIds(teamArt.getWorkingBranch(), false);
+ Assert.assertEquals(0, contextIds.size());
+
+ // set 2 on team def
+ AtsApiService.get().getAtsAccessService().setContextIds(teamDef, DemoAtsAccessContextTokens.DEMO_CODE_CONTEXT,
+ DemoAtsAccessContextTokens.DEMO_TEST_CONTEXT);
+
+ // 2 returned
+ contextIds = accessService.getContextIds(teamArt.getWorkingBranch(), false);
+ Assert.assertEquals(2, contextIds.size());
+ Assert.assertTrue(contextIds.contains(DemoAtsAccessContextTokens.DEMO_CODE_CONTEXT));
+ Assert.assertTrue(contextIds.contains(DemoAtsAccessContextTokens.DEMO_TEST_CONTEXT));
+
+ // set 1 on ai
+ AtsApiService.get().getAtsAccessService().setContextIds(ai, DemoAtsAccessContextTokens.DEMO_SYSTEMS_CONTEXT);
+
+ // only 1 cause AI overrides Team Def
+ contextIds = accessService.getContextIds(teamArt.getWorkingBranch(), false);
+ Assert.assertEquals(1, contextIds.size());
+ Assert.assertTrue(contextIds.contains(DemoAtsAccessContextTokens.DEMO_SYSTEMS_CONTEXT));
- Assert.assertEquals(1, mgr.getContextId(teamArt.getWorkingBranch(), false).size());
+ // set 1 on workflow
+ AtsApiService.get().getAtsAccessService().setContextIds(teamArt,
+ DemoAtsAccessContextTokens.DEMO_REQUIREMENT_CONTEXT);
- String teamContextId1 = "1234";
- String teamContextId2 = "2345";
- String teamContextId3 = "3456";
- teamArt.setAttributeValues(CoreAttributeTypes.AccessContextId,
- Arrays.asList(teamContextId1, teamContextId2, teamContextId3));
- teamArt.persist(getClass().getSimpleName());
+ // only 1 cause workflow overrides AI and Team Def
+ contextIds = accessService.getContextIds(teamArt.getWorkingBranch(), false);
+ Assert.assertEquals(1, contextIds.size());
+ Assert.assertTrue(contextIds.contains(DemoAtsAccessContextTokens.DEMO_REQUIREMENT_CONTEXT));
- AtsApiService.get().clearCaches();
+ // cleanup
+ changes = AtsApiService.get().createChangeSet(getClass().getSimpleName() + " - cleanup");
+ changes.deleteAttributes((ArtifactId) teamArt, CoreAttributeTypes.AccessContextId);
+ changes.deleteAttributes(teamDef, CoreAttributeTypes.AccessContextId);
+ changes.deleteAttributes(ai, CoreAttributeTypes.AccessContextId);
+ changes.execute();
- Assert.assertEquals(3, mgr.getContextId(teamArt.getWorkingBranch(), false).size());
}
- /**
- * Test method for {
- *
- * @param useCache TODO@link org.eclipse.osee.ats.ide.access.AtsBranchAccessManager#convertAccessAttributeToGuid
- */
- @Test
- public void testConvertAccessAttributeToGuid() throws Exception {
- AtsBranchAccessManager mgr = new AtsBranchAccessManager();
- TeamWorkFlowArtifact teamArt =
- (TeamWorkFlowArtifact) DemoTestUtil.getUncommittedActionWorkflow(DemoWorkType.Requirements);
-
- // confirm that no context id returned
- Assert.assertEquals(0, mgr.getContextId(teamArt.getWorkingBranch()).size());
-
- String teamDefContextId1 = "16546, this is the name";
- Artifact teamDefArt = AtsApiService.get().getQueryServiceIde().getArtifact(teamArt.getTeamDefinition());
- teamDefArt.setAttributeValues(CoreAttributeTypes.AccessContextId, Arrays.asList(teamDefContextId1));
- teamDefArt.persist(getClass().getSimpleName());
-
- mgr.clearCache();
-
- Collection<AccessContextToken> contextIds = mgr.getContextId(teamArt.getWorkingBranch());
- Assert.assertEquals(1, contextIds.size());
- AccessContextToken contextId = contextIds.iterator().next();
- Assert.assertEquals(Long.valueOf(16546), contextId.getId());
- }
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/UserGroupImplTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/UserGroupImplTest.java
index 3d530e383e..e46a689d96 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/UserGroupImplTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/access/UserGroupImplTest.java
@@ -27,7 +27,7 @@ public class UserGroupImplTest {
@Test
public void test() {
- // Joe Smith is no admin by default, but is temp admin
+ // Joe Smith is not admin by default, but is temp admin
Assert.assertFalse(UserGroupService.get(AtsUserGroups.AtsAdmin).isCurrentUserMember());
Assert.assertTrue(UserGroupService.get(AtsUserGroups.AtsTempAdmin).isCurrentUserMember());
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/ActionableItemResourceTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/ActionableItemResourceTest.java
index 1f1b041ec4..4dec693a37 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/ActionableItemResourceTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/ActionableItemResourceTest.java
@@ -33,12 +33,12 @@ public class ActionableItemResourceTest extends AbstractRestTest {
@Test
public void testAtsAisRestCall() {
- testActionableItemUrl("/ats/ai", 68, false);
+ testActionableItemUrl("/ats/ai", 70, false);
}
@Test
public void testAtsAisDetailsRestCall() {
- testActionableItemUrl("/ats/ai/details", 68, true);
+ testActionableItemUrl("/ats/ai/details", 70, true);
}
@Test
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/TeamResourceTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/TeamResourceTest.java
index f1b20480f7..53fe7c96fa 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/TeamResourceTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/config/TeamResourceTest.java
@@ -33,13 +33,13 @@ public class TeamResourceTest extends AbstractRestTest {
@Test
public void testAtsTeamsRestCall() {
- JsonNode team = testTeamUrl("/ats/team", 25, false);
+ JsonNode team = testTeamUrl("/ats/team", 27, false);
Assert.assertFalse(team.has("version"));
}
@Test
public void testAtsTeamsDetailsRestCall() {
- JsonNode team = testTeamUrl("/ats/team/details", 25, true);
+ JsonNode team = testTeamUrl("/ats/team/details", 27, true);
Assert.assertEquals(3, team.get("version").size());
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
index ee827d37aa..b738594cae 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionEndpointImplTest.java
@@ -93,7 +93,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
"Title", "SAW"//
);
- getFirstAndCount(target, 3);
+ getFirstAndCount(target, 4);
}
@Test
@@ -113,7 +113,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
"Team", codeWfId, //
"StateType", StateType.Working.name()//
);
- getAndCountWorkItems(target, 4);
+ getAndCountWorkItems(target, 5);
}
@Test
@@ -122,7 +122,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
"Team", codeWfId, //
"Assignee", "4444", //
"Assignee", "3333");
- getAndCountWorkItems(target, 4);
+ getAndCountWorkItems(target, 5);
}
@Test
@@ -131,13 +131,13 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
"Team", codeWfId, //
"Originator", "3333" //
);
- getAndCountWorkItems(target, 4);
+ getAndCountWorkItems(target, 5);
}
@Test
public void testQueryTeam() {
WebTarget target = createWebTarget("Team", codeWfId);
- getFirstAndCount(target, 4);
+ getFirstAndCount(target, 5);
}
@Test
@@ -148,7 +148,7 @@ public class AtsActionEndpointImplTest extends AbstractRestTest {
"Priority", "3", //
"StateType", StateType.Working.name() //
);
- getFirstAndCount(target, 2);
+ getFirstAndCount(target, 3);
}
public TeamWorkFlowArtifact getCodeWorkflow() {
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsProductLineEndpointTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsProductLineEndpointTest.java
index c5ec9ae52d..edc3a93b5d 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsProductLineEndpointTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsProductLineEndpointTest.java
@@ -34,7 +34,7 @@ public class AtsProductLineEndpointTest extends AbstractRestTest {
String path = "ats/ple/branches/";
WebTarget target = jaxRsApi.newTargetQuery(path + "/baseline");
- testActionRestCall(target, 1);
+ testActionRestCall(target, 2);
}
private JsonNode testActionRestCall(WebTarget target, int size) {
@@ -43,4 +43,4 @@ public class AtsProductLineEndpointTest extends AbstractRestTest {
Assert.assertEquals(size, arrayNode.size());
return arrayNode.get(0);
}
-}
\ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/AtsProgramServiceTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/AtsProgramServiceTest.java
index 735070718c..7570f2896d 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/AtsProgramServiceTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/AtsProgramServiceTest.java
@@ -138,7 +138,7 @@ public class AtsProgramServiceTest {
public void testGetTeamDefinition() {
assertEquals("SAW SW", programService.getTeamDefinition(sawProgram).getName());
- assertEquals(6, programService.getTeamDefs(sawProgram).size());
+ assertEquals(8, programService.getTeamDefs(sawProgram).size());
assertEquals(1, programService.getTeamDefs(sawProgram, WorkType.Code).size());
@@ -147,7 +147,7 @@ public class AtsProgramServiceTest {
@Test
public void testGetAIs() {
- assertEquals(6, programService.getAis(sawProgram).size());
+ assertEquals(8, programService.getAis(sawProgram).size());
assertEquals(1, programService.getAis(sawProgram, WorkType.Code).size());
@@ -157,7 +157,7 @@ public class AtsProgramServiceTest {
@Test
public void testGetWorkType() {
Collection<IAtsTeamWorkflow> workflows = programService.getWorkflows(sawProgram, WorkType.Code);
- assertEquals(4, workflows.size());
+ assertEquals(5, workflows.size());
IAtsTeamWorkflow codeTeamWf = workflows.iterator().next();
assertEquals(WorkType.Code, programService.getWorkType(codeTeamWf));
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java
index 4088f9a80e..92f9eecfcd 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/util/CreateActionUsingAllActionableItemsTest.java
@@ -50,7 +50,7 @@ public class CreateActionUsingAllActionableItemsTest {
SevereLoggingMonitor monitor = TestUtil.severeLoggingStart();
ActionResult action = CreateActionUsingAllActionableItems.createActionWithAllAis();
if (TestUtil.isDemoDb()) {
- Assert.assertEquals("Should be 21 workflows created", 21, action.getTeams().size());
+ Assert.assertEquals("Should be 23 workflows created", 23, action.getTeams().size());
} else {
Assert.assertEquals("Should be 34 workflows created", 34, action.getTeams().size());
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/transition/TransitionManagerTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/transition/TransitionManagerTest.java
index d485434b92..4eca2998dd 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/transition/TransitionManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/workflow/transition/TransitionManagerTest.java
@@ -97,11 +97,10 @@ public class TransitionManagerTest {
@org.junit.Test
public void testHandleTransitionValidation__NoAwas() {
AtsTestUtil.cleanupAndReset("TransitionManagerTest-A");
- TransitionHelper helper =
- new TransitionHelper(getClass().getSimpleName(), EMPTY_AWAS, AtsTestUtil.getImplementStateDef().getName(),
- Arrays.asList(AtsApiService.get().getUserService().getCurrentUser()), null,
- AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(),
- TransitionOption.None);
+ TransitionHelper helper = new TransitionHelper(getClass().getSimpleName(), EMPTY_AWAS,
+ AtsTestUtil.getImplementStateDef().getName(),
+ Arrays.asList(AtsApiService.get().getUserService().getCurrentUser()), null,
+ AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -112,8 +111,7 @@ public class TransitionManagerTest {
public void testHandleTransitionValidation__ToStateNotNull() {
TransitionHelper helper = new TransitionHelper(getClass().getSimpleName(), Arrays.asList(AtsTestUtil.getTeamWf()),
null, Arrays.asList(AtsApiService.get().getUserService().getCurrentUser()), null,
- AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(),
- TransitionOption.None);
+ AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -124,8 +122,7 @@ public class TransitionManagerTest {
public void testHandleTransitionValidation__InvalidToState() {
TransitionHelper helper = new TransitionHelper(getClass().getSimpleName(), Arrays.asList(AtsTestUtil.getTeamWf()),
"InvalidStateName", Arrays.asList(AtsApiService.get().getUserService().getCurrentUser()), null,
- AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(),
- TransitionOption.None);
+ AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(), TransitionOption.None);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
transMgr.handleTransitionValidation(results);
@@ -143,8 +140,7 @@ public class TransitionManagerTest {
TransitionHelper helper = new TransitionHelper(getClass().getSimpleName(), Arrays.asList(teamArt),
AtsTestUtil.getImplementStateDef().getName(),
Arrays.asList(AtsApiService.get().getUserService().getCurrentUser()), null,
- AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(),
- TransitionOption.None);
+ AtsApiService.get().createChangeSet(getClass().getSimpleName()), AtsApiService.get(), TransitionOption.None);
helper.setExecuteChanges(true);
TransitionManager transMgr = new TransitionManager(helper);
TransitionResults results = new TransitionResults();
@@ -156,8 +152,7 @@ public class TransitionManagerTest {
// Un-Assign Joe Smith
results.clear();
Assert.assertFalse(helper.isOverrideAssigneeCheck());
- teamArt.getStateMgr().setAssignee(
- AtsApiService.get().getUserService().getUserByToken(DemoUsers.Alex_Kay));
+ teamArt.getStateMgr().setAssignee(AtsApiService.get().getUserService().getUserByToken(DemoUsers.Alex_Kay));
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.contains(AtsTestUtil.getTeamWf(), TransitionResult.MUST_BE_ASSIGNED));
@@ -165,8 +160,7 @@ public class TransitionManagerTest {
results.clear();
helper.addTransitionOption(TransitionOption.OverrideAssigneeCheck);
Assert.assertTrue(helper.isOverrideAssigneeCheck());
- teamArt.getStateMgr().setAssignee(
- AtsApiService.get().getUserService().getUserByToken(DemoUsers.Alex_Kay));
+ teamArt.getStateMgr().setAssignee(AtsApiService.get().getUserService().getUserByToken(DemoUsers.Alex_Kay));
transMgr.handleTransitionValidation(results);
Assert.assertTrue(results.isEmpty());
@@ -174,14 +168,12 @@ public class TransitionManagerTest {
results.clear();
helper.removeTransitionOption(TransitionOption.OverrideAssigneeCheck);
Assert.assertFalse(helper.isOverrideAssigneeCheck());
- teamArt.getStateMgr().setAssignee(
- AtsApiService.get().getUserService().getUserByToken(SystemUser.UnAssigned));
+ teamArt.getStateMgr().setAssignee(AtsApiService.get().getUserService().getUserByToken(SystemUser.UnAssigned));
transMgr.handleTransitionValidation(results);
Assert.assertTrue(getResultsAndDebug(results, teamArt, helper), results.isEmpty());
// cleanup test
- teamArt.getStateMgr().setAssignee(
- AtsApiService.get().getUserService().getUserByToken(SystemUser.UnAssigned));
+ teamArt.getStateMgr().setAssignee(AtsApiService.get().getUserService().getUserByToken(SystemUser.UnAssigned));
}
private String getResultsAndDebug(TransitionResults results, TeamWorkFlowArtifact teamArt, TransitionHelper helper) {
@@ -365,6 +357,7 @@ public class TransitionManagerTest {
TransitionResults results = new TransitionResults();
when(teamWf.isTeamWorkflow()).thenReturn(true);
+ when(teamWf.getId()).thenReturn(4353454L);
// validate that if rule exists and is working, then transition with tasks is ok
when(teamWf.getStateDefinition()).thenReturn(toStateDef);
@@ -512,8 +505,8 @@ public class TransitionManagerTest {
// validate that can transition cause review completed
changes = AtsApiService.get().createChangeSet(getClass().getSimpleName());
- Result result = AtsApiService.get().getReviewService().transitionDecisionTo(decArt,
- DecisionReviewState.Completed, AtsApiService.get().getUserService().getCurrentUser(), false, changes);
+ Result result = AtsApiService.get().getReviewService().transitionDecisionTo(decArt, DecisionReviewState.Completed,
+ AtsApiService.get().getUserService().getCurrentUser(), false, changes);
Assert.assertTrue(result.getText(), result.isTrue());
changes.execute();
results.clear();
@@ -674,9 +667,9 @@ public class TransitionManagerTest {
// transition workflow to cancelled - peer review not cancelled
changes.clear();
- TransitionHelper transHelper = new TransitionHelper("Transition Team Workflow Review", Arrays.asList(teamArt),
- "Cancelled", new ArrayList<AtsUser>(), "", changes, AtsApiService.get(),
- TransitionOption.OverrideAssigneeCheck);
+ TransitionHelper transHelper =
+ new TransitionHelper("Transition Team Workflow Review", Arrays.asList(teamArt), "Cancelled",
+ new ArrayList<AtsUser>(), "", changes, AtsApiService.get(), TransitionOption.OverrideAssigneeCheck);
transHelper.setTransitionUser(AtsApiService.get().getUserService().getCurrentUser());
TransitionManager mgr = new TransitionManager(transHelper);
results = mgr.handleAll();
@@ -687,8 +680,7 @@ public class TransitionManagerTest {
results.clear();
changes.clear();
transHelper = new TransitionHelper("Transition Team Workflow Review", Arrays.asList(peerReview), "Cancelled",
- new ArrayList<AtsUser>(), "", changes, AtsApiService.get(),
- TransitionOption.OverrideAssigneeCheck);
+ new ArrayList<AtsUser>(), "", changes, AtsApiService.get(), TransitionOption.OverrideAssigneeCheck);
transHelper.setTransitionUser(AtsApiService.get().getUserService().getCurrentUser());
mgr = new TransitionManager(transHelper);
results = mgr.handleAll();
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsConfigQueryImplTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsConfigQueryImplTest.java
index 1007a83cda..f2e88de4aa 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsConfigQueryImplTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsConfigQueryImplTest.java
@@ -58,10 +58,10 @@ public class AtsConfigQueryImplTest {
public void test() {
IAtsConfigQuery query = queryService.createQuery(AtsArtifactTypes.TeamDefinition);
ResultSet<IAtsTeamDefinition> teamDefs = query.getConfigObjectResultSet();
- assertEquals(25, teamDefs.size());
+ assertEquals(27, teamDefs.size());
Collection<ArtifactToken> resultArtifacts = query.getArtifacts();
- assertEquals(25, resultArtifacts.size());
+ assertEquals(27, resultArtifacts.size());
query.andAttr(CoreAttributeTypes.Name, DemoArtifactToken.SAW_Code.getName());
IAtsTeamDefinition teamDef =
@@ -73,7 +73,7 @@ public class AtsConfigQueryImplTest {
query = queryService.createQuery(AtsArtifactTypes.ActionableItem);
ResultSet<IAtsActionableItem> ais = query.getConfigObjectResultSet();
- assertEquals(68, ais.size());
+ assertEquals(70, ais.size());
}
@Test
@@ -105,7 +105,7 @@ public class AtsConfigQueryImplTest {
IAtsConfigQuery query =
queryService.createQuery(AtsArtifactTypes.TeamDefinition).andProgram(DemoArtifactToken.SAW_Program.getId());
ResultSet<IAtsTeamDefinition> teamDefs = query.getConfigObjectResultSet();
- assertEquals(6, teamDefs.size());
+ assertEquals(8, teamDefs.size());
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsQueryImplTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsQueryImplTest.java
index b41602821b..7f912bd98d 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsQueryImplTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/AtsQueryImplTest.java
@@ -60,7 +60,7 @@ public class AtsQueryImplTest {
// test by type
IAtsQuery query = queryService.createQuery(WorkItemType.TeamWorkflow);
- assertEquals(28, query.getResults().size());
+ assertEquals(31, query.getResults().size());
query = queryService.createQuery(WorkItemType.Task);
assertEquals(50, query.getResults().size());
@@ -68,18 +68,18 @@ public class AtsQueryImplTest {
// assignee
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andAssignee(atsApi.getUserService().getUserByUserId("3333"));
- assertEquals(8, query.getResults().size());
+ assertEquals(10, query.getResults().size());
// team
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andTeam(Arrays.asList(30013695L));
- assertEquals(4, query.getResults().size());
+ assertEquals(5, query.getResults().size());
// ai
query = queryService.createQuery(WorkItemType.TeamWorkflow);
ArtifactId ai = atsApi.getQueryService().getArtifactByName(AtsArtifactTypes.ActionableItem, "SAW Requirements");
query.andActionableItem(Arrays.asList(ai.getId()));
- assertEquals(5, query.getResults().size());
+ assertEquals(6, query.getResults().size());
// by ids (hijack two workflows from previous search)
List<Long> ids = new LinkedList<>();
@@ -100,11 +100,11 @@ public class AtsQueryImplTest {
// by state type
query = queryService.createQuery(WorkItemType.WorkItem);
query.andStateType(StateType.Working);
- assertEquals(92, query.getResults().size());
+ assertEquals(95, query.getResults().size());
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andStateType(StateType.Working);
- assertEquals(24, query.getResults().size());
+ assertEquals(27, query.getResults().size());
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andStateType(StateType.Completed);
@@ -112,23 +112,23 @@ public class AtsQueryImplTest {
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andStateType(StateType.Completed, StateType.Working);
- assertEquals(28, query.getResults().size());
+ assertEquals(31, query.getResults().size());
// by version
query = queryService.createQuery(WorkItemType.TeamWorkflow);
ArtifactId version = atsApi.getQueryService().getArtifactByName(AtsArtifactTypes.Version, "SAW_Bld_2");
query.andVersion(version.getId());
- assertEquals(17, query.getResults().size());
+ assertEquals(20, query.getResults().size());
// by assignee
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andAssignee(joeSmith);
- assertEquals(8, query.getResults().size());
+ assertEquals(10, query.getResults().size());
// by originator
query = queryService.createQuery(WorkItemType.TeamWorkflow);
query.andOriginator(joeSmith);
- assertEquals(28, query.getResults().size());
+ assertEquals(31, query.getResults().size());
// by favorite
query = queryService.createQuery(WorkItemType.TeamWorkflow);
@@ -152,8 +152,8 @@ public class AtsQueryImplTest {
IAtsInsertion insertion = programService.getInsertion(activity); // COMM
IAtsProgram program = programService.getProgram(insertion); // SAW Program
- IAtsTeamWorkflow codeWf = AtsApiService.get().getWorkItemService().getTeamWf(
- DemoTestUtil.getCommittedActionWorkflow(DemoWorkType.Code));
+ IAtsTeamWorkflow codeWf =
+ AtsApiService.get().getWorkItemService().getTeamWf(DemoTestUtil.getCommittedActionWorkflow(DemoWorkType.Code));
IAtsTask codeTask = (IAtsTask) AtsApiService.get().getQueryService().createQuery(WorkItemType.Task).andAttr(
CoreAttributeTypes.Name, "Create test plan").getItems().iterator().next();
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/MyWorldSearchItemTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/MyWorldSearchItemTest.java
index 9ba6ff0de2..bc64ea7fa0 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/MyWorldSearchItemTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/MyWorldSearchItemTest.java
@@ -38,15 +38,15 @@ public class MyWorldSearchItemTest {
AtsUser currentUser = AtsApiService.get().getUserService().getCurrentUser();
MyWorldSearchItem search = new MyWorldSearchItem("Search", currentUser);
Collection<Artifact> results = search.performSearchGetResults();
- DemoTestUtil.assertTypes(results, 12, IAtsWorkItem.class);
- DemoTestUtil.assertTypes(results, 8, IAtsTeamWorkflow.class);
+ DemoTestUtil.assertTypes(results, 14, IAtsWorkItem.class);
+ DemoTestUtil.assertTypes(results, 10, IAtsTeamWorkflow.class);
DemoTestUtil.assertTypes(results, 2, IAtsDecisionReview.class);
DemoTestUtil.assertTypes(results, 2, IAtsPeerToPeerReview.class);
search = new MyWorldSearchItem("Search",
AtsApiService.get().getUserService().getUserByUserId(DemoUsers.Kay_Jones.getUserId()));
results = search.performSearchGetResults();
- DemoTestUtil.assertTypes(results, 13, IAtsWorkItem.class);
+ DemoTestUtil.assertTypes(results, 14, IAtsWorkItem.class);
DemoTestUtil.assertTypes(results, 1, IAtsPeerToPeerReview.class);
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/NextVersionSearchItemTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/NextVersionSearchItemTest.java
index b6e49d4255..3b5fd8ba0a 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/NextVersionSearchItemTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/NextVersionSearchItemTest.java
@@ -33,11 +33,11 @@ public class NextVersionSearchItemTest {
@Test
public void testByTeam() {
- IAtsTeamDefinition teamDef = AtsApiService.get().getTeamDefinitionService().getTeamDefinitions(
- Arrays.asList("SAW SW")).iterator().next();
+ IAtsTeamDefinition teamDef =
+ AtsApiService.get().getTeamDefinitionService().getTeamDefinitions(Arrays.asList("SAW SW")).iterator().next();
NextVersionSearchItem search = new NextVersionSearchItem(teamDef, LoadView.WorldEditor);
Collection<Artifact> results = search.performSearchGetResults();
- DemoTestUtil.assertTypes(results, 17, IAtsTeamWorkflow.class);
+ DemoTestUtil.assertTypes(results, 20, IAtsTeamWorkflow.class);
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/VersionTargetedForTeamSearchItemTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/VersionTargetedForTeamSearchItemTest.java
index 680899bdb4..ee55467f8c 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/VersionTargetedForTeamSearchItemTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/VersionTargetedForTeamSearchItemTest.java
@@ -37,7 +37,7 @@ public class VersionTargetedForTeamSearchItemTest {
VersionTargetedForTeamSearchItem search =
new VersionTargetedForTeamSearchItem(null, version, false, LoadView.WorldEditor);
Collection<Artifact> results = search.performSearchGetResults();
- DemoTestUtil.assertTypes(results, 17, IAtsTeamWorkflow.class);
+ DemoTestUtil.assertTypes(results, 20, IAtsTeamWorkflow.class);
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/WorldSearchItemTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/WorldSearchItemTest.java
index 7409eeef00..824d9f5959 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/WorldSearchItemTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/world/search/WorldSearchItemTest.java
@@ -66,7 +66,7 @@ public class WorldSearchItemTest {
data.setTeamDefIds(Arrays.asList(DemoArtifactToken.SAW_Code.getId()));
WorldSearchItem search = new WorldSearchItem(data);
Collection<Artifact> results = search.performSearch(SearchType.Search);
- Assert.assertEquals(4, results.size());
+ Assert.assertEquals(5, results.size());
}
@Test
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/framework/ui/skynet/FrameworkUiSkynetTest_Suite.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/framework/ui/skynet/FrameworkUiSkynetTest_Suite.java
index 20eaf228b8..4295d8585b 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/framework/ui/skynet/FrameworkUiSkynetTest_Suite.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/framework/ui/skynet/FrameworkUiSkynetTest_Suite.java
@@ -23,8 +23,8 @@ import org.junit.runners.Suite;
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({ //
- OpenBlamsTest.class, //
LinkUtilTest.class, //
+ OpenBlamsTest.class, //
WordTemplateProcessorTest.class //
})
public class FrameworkUiSkynetTest_Suite {
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/util/DbInitTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/util/DbInitTest.java
index 66aac55362..b96379bd9d 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/util/DbInitTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/util/DbInitTest.java
@@ -81,7 +81,7 @@ public class DbInitTest {
UserManager.setSetting(UserManager.DOUBLE_CLICK_SETTING_KEY_EDIT, "false");
UserManager.getUser().saveSettings();
- UserGroupService.get(CoreUserGroups.DefaultArtifactEditor).addMember(UserManager.getUser());
+ UserGroupService.get(CoreUserGroups.DefaultArtifactEditor).addMember(UserManager.getUser(), true);
}
diff --git a/plugins/org.eclipse.osee.ats.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.ide/META-INF/MANIFEST.MF
index e52095a4c0..a5f56ffeb2 100644
--- a/plugins/org.eclipse.osee.ats.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.ide/META-INF/MANIFEST.MF
@@ -23,7 +23,6 @@ Require-Bundle: org.eclipse.gef,
org.junit,
org.apache.commons.httpclient
Export-Package: org.eclipse.osee.ats.ide,
- org.eclipse.osee.ats.ide.access,
org.eclipse.osee.ats.ide.actions,
org.eclipse.osee.ats.ide.actions.wizard,
org.eclipse.osee.ats.ide.branch,
@@ -136,16 +135,12 @@ Import-Package: com.fasterxml.jackson.annotation,
org.eclipse.osee.ats.ide.search,
org.eclipse.osee.define.ide.traceability,
org.eclipse.osee.define.ide.traceability.report,
- org.eclipse.osee.framework.access,
org.eclipse.osee.framework.core,
org.eclipse.osee.framework.core.access,
+ org.eclipse.osee.framework.core.access.event,
org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.client.server,
org.eclipse.osee.framework.core.data,
- org.eclipse.osee.framework.core.dsl.integration,
- org.eclipse.osee.framework.core.dsl.integration.util,
- org.eclipse.osee.framework.core.dsl.oseeDsl,
- org.eclipse.osee.framework.core.dsl.ui.integration.operations,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.enums.token,
org.eclipse.osee.framework.core.event,
diff --git a/plugins/org.eclipse.osee.ats.ide/OSGI-INF/ats.cm.access.xml b/plugins/org.eclipse.osee.ats.ide/OSGI-INF/ats.cm.access.xml
deleted file mode 100644
index 25c93e9bb1..0000000000
--- a/plugins/org.eclipse.osee.ats.ide/OSGI-INF/ats.cm.access.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop">
- <implementation class="org.eclipse.osee.ats.ide.access.internal.AtsCmAccessControlProxy"/>
- <service>
- <provide interface="org.eclipse.osee.framework.core.services.CmAccessControl"/>
- <provide interface="org.eclipse.osee.framework.core.model.access.HasAccessModel"/>
- </service>
- <reference bind="setAccessModelInterpreter" cardinality="1..1" interface="org.eclipse.osee.framework.core.dsl.integration.AccessModelInterpreter" name="AccessModelInterpreter" policy="static"/>
- <reference bind="setEventService" cardinality="1..1" interface="org.eclipse.osee.framework.skynet.core.event.OseeEventService" name="OseeEventService" policy="static"/>
- <reference cardinality="1..1" interface="org.eclipse.core.resources.IWorkspace" name="IWorkspace" policy="static"/>
-</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/AtsBranchAccessManager.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/AtsBranchAccessManager.java
deleted file mode 100644
index 9461ecc8cd..0000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/AtsBranchAccessManager.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2004, 2007 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.access;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import org.eclipse.osee.ats.api.access.AtsAccessContextTokens;
-import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.ide.internal.Activator;
-import org.eclipse.osee.ats.ide.internal.AtsApiService;
-import org.eclipse.osee.ats.ide.util.AtsUtilClient;
-import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
-import org.eclipse.osee.framework.access.AccessControlManager;
-import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.AccessContextToken;
-import org.eclipse.osee.framework.core.dsl.integration.RoleContextProvider;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.GUID;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.UserManager;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCache;
-import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
-import org.eclipse.osee.framework.skynet.core.event.filter.ArtifactTypeEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.filter.IEventFilter;
-import org.eclipse.osee.framework.skynet.core.event.listener.IArtifactEventListener;
-import org.eclipse.osee.framework.skynet.core.event.model.ArtifactEvent;
-import org.eclipse.osee.framework.skynet.core.event.model.EventBasicGuidArtifact;
-import org.eclipse.osee.framework.skynet.core.event.model.Sender;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/**
- * This class will return access context ids related to editing artifacts stored on a team workflow's working branch.
- * <br>
- * <br>
- * Access control can be called frequently, thus a cache is used. Events will clear cache as necessary.<br>
- * <br>
- * Access is determined from "Access Context Id" value stored on Team Workflow, if not there, then Actionable Items, if
- * not there, then Team Defs.
- *
- * @author Donald G. Dunne
- */
-public class AtsBranchAccessManager implements IArtifactEventListener, EventHandler {
-
- // Cache to store branch id to context id list so don't have to re-compute
- private static final Map<BranchId, Collection<AccessContextToken>> branchIdToContextIdCache = new HashMap<>(50);
-
- private final RoleContextProvider roleContextProvider;
- private volatile long cacheUpdated = 0;
-
- public AtsBranchAccessManager() {
- // Available for osgi instantiation
- this(null);
- }
-
- public AtsBranchAccessManager(RoleContextProvider roleContextProvider) {
- this.roleContextProvider = roleContextProvider;
- }
-
- /**
- * True if not common branch and branch's associated artifact is a Team Workflow artifact
- */
- public boolean isApplicable(BranchId objectBranch) {
- boolean result = false;
- try {
- if (AtsApiService.get().getAtsBranch().notEqual(objectBranch)) {
- Artifact associatedArtifact = BranchManager.getAssociatedArtifact(objectBranch);
- if (associatedArtifact.isValid()) {
- result = associatedArtifact.isOfType(AtsArtifactTypes.AtsArtifact);
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.INFO, "Error determining access applicibility", ex);
- }
- return result;
- }
-
- public Collection<AccessContextToken> getContextId(BranchId branch) {
- return getContextId(branch, true);
- }
-
- public Collection<AccessContextToken> getContextId(BranchId branch, boolean useCache) {
- if (useCache && branchIdToContextIdCache.containsKey(branch)) {
- return branchIdToContextIdCache.get(branch);
- }
- Collection<AccessContextToken> contextIds = new ArrayList<>();
-
- if (branch.isInvalid()) {
- contextIds.add(AtsAccessContextTokens.DENY_CONTEXT);
-
- return contextIds;
- }
-
- branchIdToContextIdCache.put(branch, contextIds);
- try {
- // don't access control common branch artifacts...yet
- if (AtsApiService.get().getAtsBranch().notEqual(branch)) {
- // do this check first since role will supersede others
- if (roleContextProvider != null) {
- contextIds.addAll(roleContextProvider.getContextId(UserManager.getUser()));
- }
-
- if (contextIds.isEmpty()) {
- // Else, get from associated artifact
- Artifact assocArtifact = BranchManager.getAssociatedArtifact(branch);
- if (assocArtifact.isOfType(AtsArtifactTypes.TeamWorkflow)) {
- contextIds.addAll(internalGetFromWorkflow((TeamWorkFlowArtifact) assocArtifact));
- } else {
- contextIds.add(AtsAccessContextTokens.DENY_CONTEXT);
- }
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, "Exception obtaining Branch Access Context Id; Deny returned", ex);
- contextIds.add(AtsAccessContextTokens.DENY_CONTEXT);
- }
- return contextIds;
- }
-
- /**
- * Provided for testing purposes only.
- */
- public Collection<AccessContextToken> internalGetFromWorkflow(IAtsTeamWorkflow teamWf) {
- Set<AccessContextToken> contextIds = new HashSet<>();
- try {
- contextIds.addAll(getFromArtifact(AtsApiService.get().getQueryServiceIde().getArtifact(teamWf)));
- if (contextIds.isEmpty()) {
- for (IAtsActionableItem aia : AtsApiService.get().getActionableItemService().getActionableItems(
- teamWf)) {
- Artifact artifact = AtsApiService.get().getQueryServiceIde().getArtifact(aia);
- if (artifact != null) {
- contextIds.addAll(getFromArtifact(artifact));
- }
- if (!contextIds.isEmpty()) {
- return contextIds;
- }
- }
- if (contextIds.isEmpty()) {
- Artifact artifact =
- AtsApiService.get().getQueryServiceIde().getArtifact(teamWf.getTeamDefinition());
- if (artifact != null) {
- contextIds.addAll(getFromArtifact(artifact));
- }
- }
- }
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, "Exception obtaining Branch Access Context Id; Deny returned", ex);
- return Arrays.asList(AtsAccessContextTokens.DENY_CONTEXT);
- }
- return contextIds;
- }
-
- /**
- * Recursively check artifact and all default hierarchy parents
- */
- private Collection<AccessContextToken> getFromArtifact(Artifact artifact) {
- Set<AccessContextToken> contextIds = new HashSet<>();
- try {
- for (String id : artifact.getAttributesToStringList(CoreAttributeTypes.AccessContextId)) {
- // Do not use getOrCreateId here cause name represents where context ids came from
- // Cache above will take care of this not being created on each access request call.
- contextIds.add(AccessContextToken.valueOf(convertAccessAttributeToContextId(id, artifact),
- "From [" + artifact.getArtifactTypeName() + "]" + artifact.toStringWithId() + " as [" + id + "]"));
- }
- if (contextIds.isEmpty() && artifact.getParent() != null) {
- contextIds.addAll(getFromArtifact(artifact.getParent()));
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return contextIds;
- }
-
- /**
- * ATS "Access Context Id" attribute value can be stored as "id" or "id,name" for easy reading. This method strips
- * ,name out so only id is returned.
- */
- private Long convertAccessAttributeToContextId(String value, Artifact art) {
- String idStr = value.split(",")[0];
- if (Strings.isNumeric(idStr)) {
- return Long.valueOf(idStr);
- } else if (GUID.isValid(idStr)) {
- return roleContextProvider.getContextGuidToIdMap().get(idStr);
- }
- throw new OseeArgumentException("Invalid access value [%s] on artifact %s", value, art.toStringWithId());
- }
-
- /**
- * Need to process artifact events for Common branch Team Workflows, Actionable Items and Team Definitions in case
- * Access Context Id attribute is edited.
- */
- @Override
- public List<? extends IEventFilter> getEventFilters() {
- return getAtsObjectEventFilters();
- }
-
- private static final List<IEventFilter> atsObjectEventFilter = new ArrayList<>(2);
- private static final ArtifactTypeEventFilter atsArtifactTypesFilter = new ArtifactTypeEventFilter(
- AtsArtifactTypes.TeamWorkflow, AtsArtifactTypes.TeamDefinition, AtsArtifactTypes.ActionableItem);
-
- private synchronized static List<IEventFilter> getAtsObjectEventFilters() {
- try {
- if (atsObjectEventFilter.isEmpty()) {
- atsObjectEventFilter.add(AtsUtilClient.getAtsBranchFilter());
- atsObjectEventFilter.add(atsArtifactTypesFilter);
- }
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return atsObjectEventFilter;
- }
-
- /**
- * Since multiple events of same artifact type can come through, only clear cache every one second
- */
- public synchronized void clearCache() {
- long now = new Date().getTime();
- if (now - cacheUpdated > 1000) {
- branchIdToContextIdCache.clear();
- }
- }
-
- @Override
- public void handleArtifactEvent(ArtifactEvent artifactEvent, Sender sender) {
- for (EventBasicGuidArtifact guidArt : artifactEvent.getArtifacts()) {
- if (guidArt.getArtifactType().matches(AtsArtifactTypes.ActionableItem, AtsArtifactTypes.TeamDefinition)) {
- clearCache();
- return;
- }
- try {
- if (guidArt.getArtifactType().inheritsFrom(AtsArtifactTypes.TeamWorkflow)) {
- TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) ArtifactCache.getActive(guidArt);
- if (teamArt != null && teamArt.getWorkingBranch().isValid()) {
- branchIdToContextIdCache.remove(teamArt.getWorkingBranch());
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- }
- }
-
- @Override
- public void handleEvent(Event event) {
- try {
- clearCache();
- } catch (Exception ex) {
- OseeLog.log(AccessControlManager.class, Level.SEVERE, ex);
- }
- }
-
- public static void clearCaches() {
- branchIdToContextIdCache.clear();
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsAccessOseeDslProvider.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsAccessOseeDslProvider.java
deleted file mode 100644
index e34d5b0f1c..0000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsAccessOseeDslProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2004, 2007 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.access.internal;
-
-import org.eclipse.osee.ats.api.data.AtsArtifactToken;
-import org.eclipse.osee.framework.core.dsl.ui.integration.operations.AbstractOseeDslProvider;
-import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
-
-/**
- * @author Roberto E. Escobar
- */
-public class AtsAccessOseeDslProvider extends AbstractOseeDslProvider {
-
- public AtsAccessOseeDslProvider(String locationUri) {
- super(locationUri);
- }
-
- private Artifact getStorageArtifact() {
- try {
- return ArtifactQuery.getArtifactFromToken(AtsArtifactToken.AtsCmAccessControl);
- } catch (OseeCoreException ex) {
- return null;
- }
- }
-
- @Override
- protected String getModelFromStorage() {
- Artifact storageArtifact = getStorageArtifact();
- if (storageArtifact != null) {
- return storageArtifact.getSoleAttributeValue(CoreAttributeTypes.GeneralStringData);
- } else {
- return Strings.EMPTY_STRING;
- }
- }
-
- @Override
- protected void saveModelToStorage(String model) {
- Artifact artifact = getStorageArtifact();
- if (artifact != null) {
- artifact.setSoleAttributeFromString(CoreAttributeTypes.GeneralStringData, model);
- artifact.persist(getClass().getSimpleName());
- }
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControl.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControl.java
deleted file mode 100644
index b03d7c097e..0000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControl.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2004, 2007 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0
- * which is available at https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * Boeing - initial API and implementation
- **********************************************************************/
-
-package org.eclipse.osee.ats.ide.access.internal;
-
-import java.util.Collection;
-import java.util.Collections;
-import org.eclipse.osee.ats.ide.access.AtsBranchAccessManager;
-import org.eclipse.osee.ats.ide.internal.AtsApiService;
-import org.eclipse.osee.framework.core.data.ArtifactToken;
-import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.AccessContextToken;
-import org.eclipse.osee.framework.core.services.CmAccessControl;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * ATS currently only provides access control for artifacts on a Team Workflow's working branch.
- *
- * @author Roberto E. Escobar
- * @author Donald G. Dunne
- */
-public class AtsCmAccessControl implements CmAccessControl {
-
- private final AtsBranchAccessManager atsBranchAccessManager;
-
- public AtsCmAccessControl(AtsBranchAccessManager atsBranchObjectManager) {
- this.atsBranchAccessManager = atsBranchObjectManager;
- }
-
- @Override
- public boolean isApplicable(ArtifactToken user, Object object) {
- boolean result = false;
- if (object != null) {
- if (object instanceof Artifact && !AtsApiService.get().getQueryServiceIde().getArtifact(
- object).isOnBranch(AtsApiService.get().getAtsBranch())) {
- result = atsBranchAccessManager.isApplicable(
- AtsApiService.get().getQueryServiceIde().getArtifact(object).getBranch());
- }
- if (object instanceof BranchId) {
- result = atsBranchAccessManager.isApplicable((BranchId) object);
- }
- }
- return result;
- }
-
- @Override
- public Collection<? extends AccessContextToken> getContextId(ArtifactToken user, Object object) {
- if (object != null) {
- if (object instanceof Artifact && !AtsApiService.get().getQueryServiceIde().getArtifact(
- object).isOnBranch(AtsApiService.get().getAtsBranch())) {
- return atsBranchAccessManager.getContextId(
- AtsApiService.get().getQueryServiceIde().getArtifact(object).getBranch());
- }
- if (object instanceof BranchId) {
- return atsBranchAccessManager.getContextId((BranchId) object);
- }
- }
- return Collections.emptyList();
- }
-}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControlProxy.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControlProxy.java
deleted file mode 100644
index e8e1150a1b..0000000000
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/access/internal/AtsCmAccessControlProxy.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*********************************************************************
- * Copyright (c) 2004, 2007 Boeing
- *
- * This program and the accompanying materials are made
- * available under the terms of the Eclipse Public License 2.0