Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2013-11-14 11:47:40 -0500
committerRoberto E. Escobar2013-11-25 18:45:45 -0500
commit2df533bcff7abd33fb59b17a6ffcbcea96b259d8 (patch)
tree983a8cceb9f986d7b098e081f6644c1b33fa667a
parent36fca032d160199d6b964ed5046015ae7fb83f99 (diff)
downloadorg.eclipse.osee-2df533bcff7abd33fb59b17a6ffcbcea96b259d8.tar.gz
org.eclipse.osee-2df533bcff7abd33fb59b17a6ffcbcea96b259d8.tar.xz
org.eclipse.osee-2df533bcff7abd33fb59b17a6ffcbcea96b259d8.zip
feature[ats_S5JDQ]: Implement ATS transition on server
-rw-r--r--features/org.eclipse.osee.x.server.feature/feature.xml25
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java9
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/notify/IAtsNotificationServiceProvider.java21
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactory.java46
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactoryProvider.java19
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/ITeamWorkflowProvider.java)16
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProviders.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/ITeamWorkflowProviders.java)3
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java19
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinitionServiceProvider.java22
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java17
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java3
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkData.java6
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java20
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAttribute.java5
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java8
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java4
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IAtsStateFactory.java2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IStateManagerProvider.java21
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java4
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java2
-rw-r--r--plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/artifact/DemoTeamWorkflows.java15
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch51
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java28
-rw-r--r--plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java10
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCacheTest.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImplTest.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.notify.service.xml1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java25
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java23
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/config/AtsConfigCacheProvider.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/notify/AtsNotificationServiceImpl.java8
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCache.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCacheProvider.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AttributeWrapper.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/LoadAtsWorkDefinitionCacheCallable.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java69
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java43
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java4
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java11
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java30
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java7
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java64
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java89
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java6
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsWorkData.java16
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/log/ArtifactLog.java96
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java21
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkData.java15
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java12
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImplTest.java219
-rw-r--r--plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/InternalWorkDefTestSuite.java23
-rw-r--r--plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml2
-rw-r--r--plugins/org.eclipse.osee.ats.core/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java15
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogFactory.java22
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogHtml.java3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogWriter.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java1
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManagerWriter.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java5
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ArtifactIdWrapper.java43
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java17
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AttributeIdWrapper.java32
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/CacheProvider.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/CacheProvider.java)2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImpl.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java)21
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionCache.java (renamed from plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCache.java)3
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/WorkflowManagerCore.java18
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/log/AtsLogStoreProvider.java74
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/state/StateManagerUtility.java51
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java19
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java81
-rw-r--r--plugins/org.eclipse.osee.ats.dsl/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.impl.test/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.impl/pom.xml4
-rw-r--r--plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsWorkDefinitionServiceImpl.java1
-rw-r--r--plugins/org.eclipse.osee.ats.parent/pom.xml5
-rw-r--r--plugins/org.eclipse.osee.ats.reports.burndown/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF31
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.attribute.resolver.xml8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.server.service.xml14
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.user.service.xml8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.workdef.store.service.xml8
-rw-r--r--plugins/org.eclipse.osee.ats.rest/OSGI-INF/atsui.rest.application.xml10
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java13
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java198
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsUiApplication.java63
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/IAtsServer.java45
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionPage.java272
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionResource.java117
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionUtility.java162
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsResourceTokens.java51
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsUiResource.java63
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/StateResource.java139
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/ats.html23
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsAction.html67
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsCore.css38
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewAction.html71
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewActionValues.html19
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsState.html6
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsTransition.html13
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsValues.html3
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsWidget.html4
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/notify/AtsNotificationServiceImpl.java57
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUser.java149
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUserServiceImpl.java152
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsArtifactConfigCache.java95
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java193
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java71
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java193
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsReviewServiceImpl.java71
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsUtilRest.java31
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsWorkDefinitionCacheProvider.java41
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeTypeToXWidgetName.java73
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeWrapper.java54
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/JaxRsExceptionMapper.java61
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/LoadAtsWorkDefinitionCacheCallable.java32
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/TeamWorkflowProvider.java34
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workdef/AtsWorkDefinitionStoreImpl.java78
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java43
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionableItem.java110
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsConfigObject.java115
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsWorkItemServiceImpl.java197
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/DecisionReview.java22
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Goal.java22
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/IArtifactProvider.java23
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/PeerToPeerReview.java25
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Task.java22
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamDefinition.java374
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamWorkflow.java49
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Version.java150
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkData.java137
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItem.java198
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemFactory.java162
-rw-r--r--plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/TeamWorkflowProviderAdapter.java17
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/OriginatorColumn.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorOutlinePage.java7
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java6
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java15
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/XCancellationReasonTextWidget.java2
-rw-r--r--plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockArtifact.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java15
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java2
-rw-r--r--plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/PageCreator.java6
-rw-r--r--plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/StringOptionsRule.java63
-rw-r--r--plugins/org.eclipse.osee.x.server.parent/pom.xml3
172 files changed, 5868 insertions, 519 deletions
diff --git a/features/org.eclipse.osee.x.server.feature/feature.xml b/features/org.eclipse.osee.x.server.feature/feature.xml
index c2059e0e21..69d3f35eaf 100644
--- a/features/org.eclipse.osee.x.server.feature/feature.xml
+++ b/features/org.eclipse.osee.x.server.feature/feature.xml
@@ -103,12 +103,33 @@
install-size="0"
version="0.0.0"
unpack="false"/>
-
+
<plugin
id="org.eclipse.osee.template.engine"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
-
+
+ <plugin
+ id="org.eclipse.osee.ats.core"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osee.ats.dsl"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.osee.ats.impl"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
index 6507f90ed0..fb659c463f 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsObject.java
@@ -22,4 +22,6 @@ public interface IAtsObject extends Identifiable<String>, HasDescription {
String toStringWithId();
+ Object getStoreObject();
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
index b71b152c45..5c10792383 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/IAtsWorkItem.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.osee.ats.api;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
-import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workflow.HasAssignees;
import org.eclipse.osee.ats.api.workflow.HasWorkData;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
-import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -28,7 +27,7 @@ public interface IAtsWorkItem extends IAtsObject, HasWorkData, HasAssignees {
String getAtsId();
- void setAtsId(String atsId) throws OseeCoreException;
+ void setAtsId(String atsId, IAtsChangeSet changes) throws OseeCoreException;
IAtsTeamWorkflow getParentTeamWorkflow() throws OseeCoreException;
@@ -40,12 +39,8 @@ public interface IAtsWorkItem extends IAtsObject, HasWorkData, HasAssignees {
IAtsStateDefinition getStateDefinition() throws OseeCoreException;
- IAtsLogItem getStateStartedData(IStateToken state) throws OseeCoreException;
-
boolean isTask();
boolean isTeamWorkflow();
- String getTypeName();
-
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/notify/IAtsNotificationServiceProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/notify/IAtsNotificationServiceProvider.java
new file mode 100644
index 0000000000..731cdccdd5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/notify/IAtsNotificationServiceProvider.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.notify;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IAtsNotificationServiceProvider {
+
+ IAtsNotificationService getNotifyService() throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactory.java
new file mode 100644
index 0000000000..3e44b9a0f3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactory.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.team;
+
+import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.workflow.IAtsGoal;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IAtsWorkItemFactory {
+
+ IAtsTeamWorkflow getTeamWf(Object artifact) throws OseeCoreException;
+
+ IAtsWorkItem getWorkItem(Object object) throws OseeCoreException;
+
+ IAtsTask getTask(Object artifact) throws OseeCoreException;
+
+ IAtsAbstractReview getReview(Object artifact) throws OseeCoreException;
+
+ IAtsGoal getGoal(Object artifact) throws OseeCoreException;
+
+ IAtsTeamDefinition getTeamDef(Object artifact) throws OseeCoreException;
+
+ IAtsActionableItem getActionableItem(Object aiArt) throws OseeCoreException;
+
+ IAtsConfigObject getConfigObject(Object artifact) throws OseeCoreException;
+
+ IAtsVersion getVersion(Object artifact) throws OseeCoreException;
+
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactoryProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactoryProvider.java
new file mode 100644
index 0000000000..f99ab33cca
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsWorkItemFactoryProvider.java
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.team;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IAtsWorkItemFactoryProvider {
+
+ IAtsWorkItemFactory getWorkItemFactory();
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/ITeamWorkflowProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java
index ecff4cd7b6..92fb273bb1 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/ITeamWorkflowProvider.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProvider.java
@@ -8,14 +8,12 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow;
+package org.eclipse.osee.ats.api.team;
import java.util.Collection;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
-import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -43,13 +41,13 @@ public interface ITeamWorkflowProvider {
* Notification that a teamWorkflow is being duplicated. This allows the extension to do necessary changes to
* duplicated workflow.
*/
- public void teamWorkflowDuplicating(TeamWorkFlowArtifact teamArt, TeamWorkFlowArtifact dupTeamArt) throws OseeCoreException;
+ public void teamWorkflowDuplicating(IAtsTeamWorkflow teamWf, IAtsTeamWorkflow dupTeamWf) throws OseeCoreException;
/**
* Notification that a teamWorkflow was created. This allows the extension to do necessary initial tasks after the
* team workflow artifact is created. All changes made to dupTeamArt will be persisted after this call.
*/
- public void teamWorkflowCreated(TeamWorkFlowArtifact teamArt);
+ public void teamWorkflowCreated(IAtsTeamWorkflow teamWf);
public String getWorkflowDefinitionId(IAtsWorkItem workItem) throws OseeCoreException;
@@ -58,14 +56,14 @@ public interface ITeamWorkflowProvider {
/**
* Assigned or computed Id that will show at the top of the editor
*/
- public String getPcrId(TeamWorkFlowArtifact teamArt) throws OseeCoreException;
+ public String getPcrId(IAtsTeamWorkflow teamWf) throws OseeCoreException;
/**
* 5-9 character short name for UI and display purposes
*/
- public String getArtifactTypeShortName(TeamWorkFlowArtifact teamArt);
+ public String getArtifactTypeShortName(IAtsTeamWorkflow teamWf);
- public String getBranchName(TeamWorkFlowArtifact teamArt);
+ public String getBranchName(IAtsTeamWorkflow teamWf);
- public boolean isResponsibleFor(AbstractWorkflowArtifact awa);
+ public boolean isResponsibleFor(IAtsWorkItem workItem);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/ITeamWorkflowProviders.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProviders.java
index 1a10fca420..3f4ec189cd 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/ITeamWorkflowProviders.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/ITeamWorkflowProviders.java
@@ -8,10 +8,9 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.team;
+package org.eclipse.osee.ats.api.team;
import java.util.List;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
index 1063607822..05f9311e74 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/util/IAtsChangeSet.java
@@ -11,6 +11,9 @@
package org.eclipse.osee.ats.api.util;
import java.util.Collection;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -34,4 +37,20 @@ public interface IAtsChangeSet {
boolean isEmpty();
+ void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException;
+
+ void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String value) throws OseeCoreException;
+
+ void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException;
+
+ void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException;
+
+ <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value) throws OseeCoreException;
+
+ <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr) throws OseeCoreException;
+
+ void deleteAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException;
+
+ boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType);
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinitionServiceProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinitionServiceProvider.java
new file mode 100644
index 0000000000..925a0ddec1
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAtsWorkDefinitionServiceProvider.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.workdef;
+
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IAtsWorkDefinitionServiceProvider {
+
+ public IAtsWorkDefinitionService getWorkDefService() throws OseeStateException, OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
index 5887b03aa5..bbf49a5fb5 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workdef/IAttributeResolver.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.api.workdef;
import java.util.Collection;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -51,4 +52,20 @@ public interface IAttributeResolver {
<T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value) throws OseeCoreException;
+ void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes) throws OseeCoreException;
+
+ void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String reason, IAtsChangeSet changes) throws OseeCoreException;
+
+ void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException;
+
+ void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException;
+
+ void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException;
+
+ <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value, IAtsChangeSet changes) throws OseeCoreException;
+
+ <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr, IAtsChangeSet changes) throws OseeCoreException;
+
+ IAttributeType getAttributeType(String atrributeName);
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
index f3b8eee2d4..d741da936d 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsBranchService.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.ats.api.workflow;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -21,4 +22,6 @@ public interface IAtsBranchService {
boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+ IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException;
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkData.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkData.java
index d00bb62a94..1f3b243c3b 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkData.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkData.java
@@ -54,4 +54,10 @@ public interface IAtsWorkData {
public void setCancelledBy(IAtsUser cancelledBy) throws OseeCoreException;
+ public String getArtifactTypeName() throws OseeCoreException;
+
+ public IAtsUser getCreatedBy() throws OseeCoreException;
+
+ public Date getCreatedDate() throws OseeCoreException;
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
index 9f1aa4af1a..b243e7aaf1 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAtsWorkItemService.java
@@ -11,16 +11,12 @@
package org.eclipse.osee.ats.api.workflow;
import java.util.Collection;
-import java.util.List;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
-import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
@@ -48,20 +44,16 @@ public interface IAtsWorkItemService {
IStateToken getCurrentState(IAtsWorkItem workItem) throws OseeCoreException;
- Collection<IAtsTask> getTasks(IAtsTeamWorkflow atsObject, IStateToken relatedToState) throws OseeCoreException;
+ Collection<IAtsTask> getTasks(IAtsTeamWorkflow teamWf, IStateToken relatedToState) throws OseeCoreException;
- Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow atsObject) throws OseeCoreException;
+ Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow teamWf) throws OseeCoreException;
- Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow atsObject, IStateToken state) throws OseeCoreException;
+ Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow teamWf, IStateToken state) throws OseeCoreException;
- Collection<IAtsTask> getTasks(IAtsTeamWorkflow iAtsTeamWorkflow) throws OseeCoreException;
+ Collection<IAtsTask> getTasks(IAtsTeamWorkflow teamWf) throws OseeCoreException;
IAtsTeamWorkflow getFirstTeam(IAtsAction action) throws OseeCoreException;
- boolean isReadOnly(IAtsWorkItem workItem);
-
- boolean isAccessControlWrite(IAtsWorkItem workItem);
-
String getCurrentStateName(IAtsWorkItem workItem);
void clearImplementersCache(IAtsWorkItem workItem);
@@ -70,10 +62,8 @@ public interface IAtsWorkItemService {
Collection<IAtsTask> getTaskArtifacts(IAtsWorkItem workItem) throws OseeCoreException;
- void transitioned(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, List<? extends IAtsUser> updatedAssigees, IAtsChangeSet changes) throws OseeCoreException;
-
Collection<ITransitionListener> getTransitionListeners();
- ILogStorageProvider getLogStorageProvider(IAtsWorkItem workItem);
+ String getTargetedVersionStr(IAtsTeamWorkflow teamWf) throws OseeCoreException;
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAttribute.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAttribute.java
index f794e68059..74eea1d58b 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAttribute.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/IAttribute.java
@@ -12,6 +12,9 @@ package org.eclipse.osee.ats.api.workflow;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+/**
+ * @author Donald G Dunne
+ */
public interface IAttribute<T> {
public T getValue() throws OseeCoreException;
@@ -21,4 +24,6 @@ public interface IAttribute<T> {
public void delete() throws OseeCoreException;
public void setValue(T value) throws OseeCoreException;
+
+ public int getId();
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java
index fc22c77eca..348e503c82 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/IAtsLogFactory.java
@@ -13,6 +13,8 @@ package org.eclipse.osee.ats.api.workflow.log;
import java.util.Date;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -22,10 +24,12 @@ public interface IAtsLogFactory {
IAtsLogItem newLogItem(LogType type, Date date, IAtsUser user, String state, String msg) throws OseeCoreException;
- IAtsLog getLogLoaded(IAtsWorkItem workItem);
+ IAtsLog getLogLoaded(IAtsWorkItem workItem, IAttributeResolver attrResolver);
- void writeToStore(IAtsWorkItem workItem);
+ void writeToStore(IAtsWorkItem workItem, IAttributeResolver attrResolver, IAtsChangeSet changes);
IAtsLog getLog();
+ ILogStorageProvider getLogProvider(IAtsWorkItem workItem, IAttributeResolver attrResolver);
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java
index 708854f58b..580dcb675f 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/log/ILogStorageProvider.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.api.workflow.log;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
/**
* @author Donald G. Dunne
@@ -19,11 +20,10 @@ public interface ILogStorageProvider {
String getLogXml();
- IStatus saveLogXml(String xml);
+ IStatus saveLogXml(String xml, IAtsChangeSet changes);
String getLogTitle();
String getLogId();
- String getNameFromUserId(String userId);
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IAtsStateFactory.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IAtsStateFactory.java
index 06d6a25edc..cf1bf3d930 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IAtsStateFactory.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IAtsStateFactory.java
@@ -21,7 +21,7 @@ public interface IAtsStateFactory {
IAtsStateManager getStateManager(IAtsWorkItem workItem) throws OseeCoreException;
- IAtsStateManager getStateManager(IAtsWorkItem workItem, boolean inDb);
+ IAtsStateManager getStateManager(IAtsWorkItem workItem, boolean load);
void writeToStore(IAtsWorkItem workItem, IAtsChangeSet changes) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IStateManagerProvider.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IStateManagerProvider.java
new file mode 100644
index 0000000000..247737992d
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/state/IStateManagerProvider.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.api.workflow.state;
+
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IStateManagerProvider {
+
+ IAtsStateManager getStateManager(IAtsWorkItem workItem);
+}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java
index f88d1d9913..a852d153b8 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/ITransitionHelper.java
@@ -66,4 +66,8 @@ public interface ITransitionHelper {
public Collection<ITransitionListener> getTransitionListeners();
+ public IAtsUser getTransitionUser() throws OseeCoreException;
+
+ public void setTransitionUser(IAtsUser user) throws OseeCoreException;
+
}
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
index 1ac44dce69..540a0373da 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/workflow/transition/TransitionResults.java
@@ -96,7 +96,7 @@ public class TransitionResults {
appendResultsString(sb, results);
for (IAtsWorkItem workItem : workItemToResults.keySet()) {
sb.append("\n");
- sb.append(workItem.getTypeName());
+ sb.append(workItem.getWorkData().getArtifactTypeName());
sb.append(" [");
sb.append(workItem.getAtsId());
sb.append("] Titled [");
diff --git a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/artifact/DemoTeamWorkflows.java b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/artifact/DemoTeamWorkflows.java
index 21ba0b0447..78b5b6315e 100644
--- a/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/artifact/DemoTeamWorkflows.java
+++ b/plugins/org.eclipse.osee.ats.client.demo/src/org/eclipse/osee/ats/client/demo/artifact/DemoTeamWorkflows.java
@@ -13,13 +13,14 @@ package org.eclipse.osee.ats.client.demo.artifact;
import java.util.Collection;
import java.util.logging.Level;
import org.eclipse.osee.ats.actions.wizard.TeamWorkflowProviderAdapter;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.client.demo.DemoArtifactTypes;
import org.eclipse.osee.ats.client.demo.internal.Activator;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -47,21 +48,21 @@ public class DemoTeamWorkflows extends TeamWorkflowProviderAdapter {
}
@Override
- public String getPcrId(TeamWorkFlowArtifact teamArt) {
+ public String getPcrId(IAtsTeamWorkflow teamWf) {
return "";
}
@Override
- public String getBranchName(TeamWorkFlowArtifact teamArt) {
+ public String getBranchName(IAtsTeamWorkflow teamWf) {
return null;
}
@Override
- public boolean isResponsibleFor(AbstractWorkflowArtifact awa) {
+ public boolean isResponsibleFor(IAtsWorkItem workItem) {
try {
- TeamWorkFlowArtifact teamArt = awa.getParentTeamWorkflow();
- if (teamArt != null) {
- return (teamArt.isOfType(DemoArtifactTypes.DemoCodeTeamWorkflow) || teamArt.isOfType(DemoArtifactTypes.DemoReqTeamWorkflow) || teamArt.isOfType(DemoArtifactTypes.DemoTestTeamWorkflow));
+ TeamWorkFlowArtifact teamWf = (TeamWorkFlowArtifact) workItem.getParentTeamWorkflow();
+ if (teamWf != null) {
+ return (teamWf.isOfType(DemoArtifactTypes.DemoCodeTeamWorkflow) || teamWf.isOfType(DemoArtifactTypes.DemoReqTeamWorkflow) || teamWf.isOfType(DemoArtifactTypes.DemoTestTeamWorkflow));
}
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch b/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch
index 6ce7ed4269..7b63c99747 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/AtsClient_Integration_TestSuite.launch
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<setAttribute key="additional_plugins">
-<setEntry value="org.eclipse.osee.ats.client.integration.tests:0.15.0.qualifier:default:true"/>
-<setEntry value="org.eclipse.osee.client.integration.tests:0.15.0.qualifier:default:true"/>
-<setEntry value="org.eclipse.osee.client.test.framework:0.15.0.qualifier:default:true"/>
+<setEntry value="org.eclipse.osee.ats.client.integration.tests:0.16.0.qualifier:default:true"/>
+<setEntry value="org.eclipse.osee.client.integration.tests:0.16.0.qualifier:default:true"/>
+<setEntry value="org.eclipse.osee.client.test.framework:0.16.0.qualifier:default:true"/>
</setAttribute>
<booleanAttribute key="append.args" value="true"/>
<booleanAttribute key="askclear" value="false"/>
@@ -41,17 +41,62 @@
<stringAttribute key="product" value="org.eclipse.osee.framework.ui.product.osee"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
<setAttribute key="selected_features">
+<setEntry value="de.itemis.xtext.antlr.feature:default"/>
+<setEntry value="de.itemis.xtext.antlr.sdk:default"/>
+<setEntry value="de.itemis.xtext.antlr.source.feature:default"/>
+<setEntry value="org.eclipse.cvs.source:default"/>
+<setEntry value="org.eclipse.cvs:default"/>
+<setEntry value="org.eclipse.e4.rcp.source:default"/>
+<setEntry value="org.eclipse.e4.rcp:default"/>
+<setEntry value="org.eclipse.emf.common:default"/>
+<setEntry value="org.eclipse.emf.compare:default"/>
+<setEntry value="org.eclipse.emf.ecore:default"/>
+<setEntry value="org.eclipse.equinox.p2.core.feature.source:default"/>
+<setEntry value="org.eclipse.equinox.p2.core.feature:default"/>
+<setEntry value="org.eclipse.equinox.p2.extras.feature.source:default"/>
+<setEntry value="org.eclipse.equinox.p2.extras.feature:default"/>
+<setEntry value="org.eclipse.equinox.p2.rcp.feature.source:default"/>
+<setEntry value="org.eclipse.equinox.p2.rcp.feature:default"/>
+<setEntry value="org.eclipse.equinox.p2.user.ui.source:default"/>
+<setEntry value="org.eclipse.equinox.p2.user.ui:default"/>
+<setEntry value="org.eclipse.help.source:default"/>
+<setEntry value="org.eclipse.help:default"/>
+<setEntry value="org.eclipse.jdt.source:default"/>
+<setEntry value="org.eclipse.jdt:default"/>
+<setEntry value="org.eclipse.nebula.widgets.ganttchart.feature:default"/>
+<setEntry value="org.eclipse.nebula.widgets.xviewer.feature:default"/>
<setEntry value="org.eclipse.osee.ats.client.demo.feature:default"/>
<setEntry value="org.eclipse.osee.ats.feature:default"/>
<setEntry value="org.eclipse.osee.client.demo.feature:default"/>
<setEntry value="org.eclipse.osee.client.feature:default"/>
+<setEntry value="org.eclipse.osee.core.feature:default"/>
+<setEntry value="org.eclipse.osee.core.plugin.feature:default"/>
<setEntry value="org.eclipse.osee.core.runtime.feature:default"/>
<setEntry value="org.eclipse.osee.core.ui.feature:default"/>
<setEntry value="org.eclipse.osee.define.feature:default"/>
<setEntry value="org.eclipse.osee.external.feature:default"/>
<setEntry value="org.eclipse.osee.framework.feature:default"/>
<setEntry value="org.eclipse.osee.framework.ui.feature:default"/>
+<setEntry value="org.eclipse.platform.source:default"/>
+<setEntry value="org.eclipse.platform:default"/>
+<setEntry value="org.eclipse.rcp.source:default"/>
+<setEntry value="org.eclipse.rcp:default"/>
<setEntry value="org.eclipse.sdk:default"/>
+<setEntry value="org.eclipse.xtend.sdk:default"/>
+<setEntry value="org.eclipse.xtext.docs:default"/>
+<setEntry value="org.eclipse.xtext.examples.source:default"/>
+<setEntry value="org.eclipse.xtext.examples:default"/>
+<setEntry value="org.eclipse.xtext.runtime.source:default"/>
+<setEntry value="org.eclipse.xtext.runtime:default"/>
+<setEntry value="org.eclipse.xtext.sdk:default"/>
+<setEntry value="org.eclipse.xtext.ui.source:default"/>
+<setEntry value="org.eclipse.xtext.ui:default"/>
+<setEntry value="org.eclipse.xtext.xbase.lib.source:default"/>
+<setEntry value="org.eclipse.xtext.xbase.lib:default"/>
+<setEntry value="org.eclipse.xtext.xbase.source:default"/>
+<setEntry value="org.eclipse.xtext.xbase:default"/>
+<setEntry value="org.eclipse.xtext.xtext.ui.source:default"/>
+<setEntry value="org.eclipse.xtext.xtext.ui:default"/>
</setAttribute>
<booleanAttribute key="show_selected_only" value="true"/>
<stringAttribute key="timestamp" value="1354263054730"/>
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
index 3b063f9294..2ddced2e71 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotificationManagerTest.java
@@ -97,10 +97,11 @@ public class AtsNotificationManagerTest {
UserManager.getUser(DemoUsers.Alex_Kay).persist(getClass().getSimpleName());
// reset the originator
+ AtsChangeSet changes = new AtsChangeSet("Change Originator");
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay), false,
- new Date());
+ new Date(), changes);
// persist will kick event which will log the notification event and send
- teamArt.persist("Change originator");
+ changes.execute();
// verify notification exists now
Assert.assertEquals(1, mgr.getNotificationEvents().size());
@@ -113,7 +114,7 @@ public class AtsNotificationManagerTest {
// reset the originator back to joe smith
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith), false,
- new Date());
+ new Date(), changes);
// persist will kick event which will log the notification event and send
teamArt.persist("Change originator");
AtsNotificationManager.setInTest(true);
@@ -128,7 +129,7 @@ public class AtsNotificationManagerTest {
// reset the originator
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay), false,
- new Date());
+ new Date(), changes);
// persist will kick event which will log the notification event and send
teamArt.persist("Change originator");
@@ -141,7 +142,7 @@ public class AtsNotificationManagerTest {
// reset the originator back to joe smith
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Joe_Smith), false,
- new Date());
+ new Date(), changes);
// persist will kick event which will log the notification event and send
teamArt.persist("Change originator");
AtsNotificationManager.setInTest(true);
@@ -156,7 +157,7 @@ public class AtsNotificationManagerTest {
// reset the originator
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay), false,
- new Date());
+ new Date(), changes);
// persist will kick event which will log the notification event and send
teamArt.persist("Change originator");
@@ -291,10 +292,10 @@ public class AtsNotificationManagerTest {
// set originator as Alex Kay
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName() + " - set originator");
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay), false,
- new Date());
-
- AtsChangeSet.execute(getClass().getSimpleName() + " - set originator", teamArt);
+ new Date(), changes);
+ changes.execute();
// set alex kay having valid email address
User user = UserManager.getUser(DemoUsers.Alex_Kay);
@@ -304,7 +305,7 @@ public class AtsNotificationManagerTest {
// verify no notification events yet
Assert.assertEquals(0, mgr.getNotificationEvents().size());
- AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ changes.reset(getClass().getSimpleName());
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Completed, AtsClientService.get().getUserAdmin().getCurrentUser(),
changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
@@ -334,9 +335,10 @@ public class AtsNotificationManagerTest {
// set originator as Alex Kay
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
+ AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName() + " - set originator");
teamArt.setCreatedBy(AtsClientService.get().getUserAdmin().getUserFromToken(DemoUsers.Alex_Kay), false,
- new Date());
- AtsChangeSet.execute(getClass().getSimpleName() + " - set originator", teamArt);
+ new Date(), changes);
+ changes.execute();
// set alex kay having valid email address
User user = UserManager.getUser(DemoUsers.Alex_Kay);
@@ -346,7 +348,7 @@ public class AtsNotificationManagerTest {
// verify no notification events yet
Assert.assertEquals(0, mgr.getNotificationEvents().size());
- AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
+ changes.reset(getClass().getSimpleName());
Result result =
AtsTestUtil.transitionTo(AtsTestUtilState.Cancelled, AtsClientService.get().getUserAdmin().getCurrentUser(),
changes, TransitionOption.OverrideAssigneeCheck, TransitionOption.OverrideTransitionValidityCheck);
diff --git a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
index c41b6226a8..3171ad60b7 100644
--- a/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
+++ b/plugins/org.eclipse.osee.ats.client.integration.tests/src/org/eclipse/osee/ats/client/integration/tests/ats/core/client/notify/AtsNotifyUsersTest.java
@@ -110,7 +110,7 @@ public class AtsNotifyUsersTest {
AtsChangeSet changes = new AtsChangeSet(getClass().getSimpleName());
TeamWorkFlowArtifact teamArt = AtsTestUtil.getTeamWf();
teamArt.setName(AtsNotifyUsersTest.class.getSimpleName() + "-testNotify");
- teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail));
+ teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail), changes);
List<User> assignees = new ArrayList<User>();
assignees.addAll(Arrays.asList(inactiveSteve, alex_NoValidEmail, jason_ValidEmail, kay_ValidEmail,
joeSmith_CurrentUser));
@@ -129,11 +129,11 @@ public class AtsNotifyUsersTest {
event.getDescription());
notifyManager.clear();
- teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve));
+ teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve), changes);
teamArt.persist(getClass().getSimpleName());
AtsNotificationManager.notify(teamArt, AtsNotifyType.Originator);
Assert.assertEquals(0, notifyManager.getNotificationEvents().size());
- teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail));
+ teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail), changes);
teamArt.persist(getClass().getSimpleName());
notifyManager.clear();
@@ -198,13 +198,13 @@ public class AtsNotifyUsersTest {
event.getDescription());
notifyManager.clear();
- teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve));
+ teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(inactiveSteve), changes);
teamArt.persist(getClass().getSimpleName());
StateManagerUtility.initializeStateMachine(teamArt.getStateMgr(), TeamState.Completed, null,
AtsClientService.get().getUserAdmin().getCurrentUser(), changes);
AtsNotificationManager.notify(teamArt, AtsNotifyType.Completed);
Assert.assertEquals(0, notifyManager.getNotificationEvents().size());
- teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail));
+ teamArt.internalSetCreatedBy(AtsClientService.get().getUserAdmin().getUserFromOseeUser(kay_ValidEmail), changes);
teamArt.persist(getClass().getSimpleName());
notifyManager.clear();
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCacheTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCacheTest.java
index 214d288b35..405a7a0067 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCacheTest.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCacheTest.java
@@ -16,8 +16,8 @@ import static org.mockito.Mockito.when;
import org.eclipse.osee.ats.api.IAtsConfigObject;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
+import org.eclipse.osee.ats.core.util.CacheProvider;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
diff --git a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImplTest.java b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImplTest.java
index 4302733638..7c83da3e81 100644
--- a/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImplTest.java
+++ b/plugins/org.eclipse.osee.ats.core.client.test/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImplTest.java
@@ -23,6 +23,7 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
@@ -31,8 +32,9 @@ import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
-import org.eclipse.osee.ats.core.client.team.ITeamWorkflowProviders;
+import org.eclipse.osee.ats.core.util.CacheProvider;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionAdminImpl;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.junit.Before;
diff --git a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
index c907ea660e..acd5196619 100644
--- a/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core.client/META-INF/MANIFEST.MF
@@ -103,7 +103,6 @@ Export-Package: org.eclipse.osee.ats.core.client,
org.eclipse.osee.ats.core.client.util,
org.eclipse.osee.ats.core.client.validator,
org.eclipse.osee.ats.core.client.workflow,
- org.eclipse.osee.ats.core.client.workflow.log,
org.eclipse.osee.ats.core.client.workflow.note,
org.eclipse.osee.ats.core.client.workflow.stateitem,
org.eclipse.osee.ats.core.client.workflow.transition
diff --git a/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.notify.service.xml b/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.notify.service.xml
index bb016d7ea9..20a39865c1 100644
--- a/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.notify.service.xml
+++ b/plugins/org.eclipse.osee.ats.core.client/OSGI-INF/ats.notify.service.xml
@@ -2,6 +2,7 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.core.client.internal.notify.AtsNotificationServiceImpl">
<implementation class="org.eclipse.osee.ats.core.client.internal.notify.AtsNotificationServiceImpl"/>
<service>
+ <provide interface="org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider"/>
<provide interface="org.eclipse.osee.ats.api.notify.IAtsNotificationService"/>
</service>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
index 65c2ebaf83..24f0d7a635 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/IAtsClient.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
import org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider;
+import org.eclipse.osee.ats.core.client.internal.IArtifactProvider;
import org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactServiceProvider;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.config.IActionableItemFactory;
@@ -40,7 +41,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
* @author Donald G. Dunne
*/
-public interface IAtsClient extends IAttributeResolverProvider, IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsConfigProvider, ITeamDefinitionFactory, IActionableItemFactory, IVersionFactory, IAtsQueryService, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
+public interface IAtsClient extends IAttributeResolverProvider, IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemArtifactServiceProvider, IAtsWorkItemServiceProvider, IAtsConfigProvider, ITeamDefinitionFactory, IActionableItemFactory, IArtifactProvider, IVersionFactory, IAtsQueryService, IAtsVersionServiceProvider, IAtsEarnedValueServiceProvider {
<T extends IAtsConfigObject> Artifact storeConfigObject(T configObject, IAtsChangeSet changes) throws OseeCoreException;
@@ -51,6 +52,7 @@ public interface IAtsClient extends IAttributeResolverProvider, IAtsReviewServic
/**
* @return corresponding Artifact or null if not found
*/
+ @Override
Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException;
AbstractWorkflowArtifact getWorkflowArtifact(IAtsObject atsObject) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
index 23b2a8cf0e..e568e8518b 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionArtifact.java
@@ -77,4 +77,9 @@ public class ActionArtifact extends Artifact implements IAtsAction {
setSoleAttributeFromString(AtsAttributeTypes.AtsId, atsId);
}
+ @Override
+ public Object getStoreObject() {
+ return this;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
index 637f71ec4c..d11ba29da8 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/action/ActionManager.java
@@ -21,9 +21,9 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -31,7 +31,6 @@ import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.ChangeType;
import org.eclipse.osee.ats.core.client.workflow.ChangeTypeUtil;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.util.Conditions;
@@ -79,8 +78,6 @@ public class ActionManager {
TeamWorkFlowArtifact teamWf =
createTeamWorkflow(actionArt, teamDef, actionableItems, leads, changes, createdDate, createdBy,
newActionListener);
-
- AtsCore.getLogFactory().writeToStore(teamWf);
changes.add(teamWf);
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
index 1066e7f4c7..2014c7e053 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/AtsClientImpl.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.ats.api.ev.IAtsEarnedValueService;
import org.eclipse.osee.ats.api.query.IAtsQuery;
import org.eclipse.osee.ats.api.review.IAtsReviewService;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.api.user.IAtsUserService;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.version.IAtsVersion;
@@ -53,14 +54,11 @@ import org.eclipse.osee.ats.core.client.internal.store.TeamDefinitionArtifactWri
import org.eclipse.osee.ats.core.client.internal.store.VersionArtifactReader;
import org.eclipse.osee.ats.core.client.internal.store.VersionArtifactWriter;
import org.eclipse.osee.ats.core.client.internal.user.AtsUserAdminImpl;
-import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionAdminImpl;
-import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkDefinitionCacheProvider;
import org.eclipse.osee.ats.core.client.internal.workdef.AtsWorkItemArtifactProviderImpl;
import org.eclipse.osee.ats.core.client.internal.workflow.AtsAttributeResolverServiceImpl;
import org.eclipse.osee.ats.core.client.internal.workflow.AtsWorkItemServiceImpl;
import org.eclipse.osee.ats.core.client.search.AtsArtifactQuery;
-import org.eclipse.osee.ats.core.client.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AtsBranchServiceImpl;
@@ -68,6 +66,9 @@ import org.eclipse.osee.ats.core.config.IActionableItemFactory;
import org.eclipse.osee.ats.core.config.IAtsConfig;
import org.eclipse.osee.ats.core.config.ITeamDefinitionFactory;
import org.eclipse.osee.ats.core.config.IVersionFactory;
+import org.eclipse.osee.ats.core.util.CacheProvider;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionAdminImpl;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.util.Conditions;
@@ -154,7 +155,7 @@ public class AtsClientImpl implements IAtsClient {
new AtsWorkDefinitionAdminImpl(workDefCacheProvider, workItemService, workDefService, teamWorkflowProvider,
attributeResolverService);
branchService = new AtsBranchServiceImpl();
- reviewService = new AtsReviewServiceImpl();
+ reviewService = new AtsReviewServiceImpl(this);
started = true;
}
@@ -367,13 +368,17 @@ public class AtsClientImpl implements IAtsClient {
@Override
public Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException {
Artifact results = null;
- if (atsObject instanceof Artifact) {
- results = (Artifact) atsObject;
+ if (atsObject.getStoreObject() != null) {
+ results = (Artifact) atsObject.getStoreObject();
} else {
- try {
- results = AtsArtifactQuery.getArtifactFromId(atsObject.getGuid());
- } catch (ArtifactDoesNotExist ex) {
- // do nothing
+ if (atsObject instanceof Artifact) {
+ results = (Artifact) atsObject;
+ } else {
+ try {
+ results = AtsArtifactQuery.getArtifactFromId(atsObject.getGuid());
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing
+ }
}
}
return results;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java
new file mode 100644
index 0000000000..105e98c59e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/IArtifactProvider.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.client.internal;
+
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IArtifactProvider {
+
+ Artifact getArtifact(IAtsObject atsObject) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/config/AtsConfigCacheProvider.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/config/AtsConfigCacheProvider.java
index 3835bd3a5b..b628811eb3 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/config/AtsConfigCacheProvider.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/config/AtsConfigCacheProvider.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.ats.core.client.internal.config;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactStore;
+import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.framework.core.data.LazyObject;
/**
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/notify/AtsNotificationServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/notify/AtsNotificationServiceImpl.java
index 8e7d5b53d5..4380ccfb72 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/notify/AtsNotificationServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/notify/AtsNotificationServiceImpl.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.notify.AtsNotificationEvent;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
@@ -28,7 +29,7 @@ import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
/**
* @author Donald G. Dunne
*/
-public class AtsNotificationServiceImpl implements IAtsNotificationService {
+public class AtsNotificationServiceImpl implements IAtsNotificationService, IAtsNotificationServiceProvider {
public AtsNotificationServiceImpl() {
}
@@ -66,4 +67,9 @@ public class AtsNotificationServiceImpl implements IAtsNotificationService {
notifyUsers, notifyTypes);
}
+ @Override
+ public IAtsNotificationService getNotifyService() {
+ return this;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
index 6a22635c43..2800709b2d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/review/AtsReviewServiceImpl.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.ats.core.client.internal.review;
import java.util.Collection;
import java.util.Date;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
import org.eclipse.osee.ats.api.review.IAtsReviewService;
@@ -20,18 +21,32 @@ import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.client.internal.IArtifactProvider;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
import org.eclipse.osee.ats.core.client.review.ValidateReviewManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+/**
+ * @author Donald G Dunne
+ */
public class AtsReviewServiceImpl implements IAtsReviewService {
+ private final IArtifactProvider artifactProvider;
+
+ public AtsReviewServiceImpl(IArtifactProvider artifactProvider) {
+ this.artifactProvider = artifactProvider;
+ }
+
@Override
public boolean isValidationReviewRequired(IAtsWorkItem workItem) throws OseeCoreException {
- return ((AbstractWorkflowArtifact) workItem).isValidationRequired();
+ boolean required = false;
+ if (workItem.isTeamWorkflow()) {
+ required =
+ artifactProvider.getArtifact(workItem).getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, false);
+ }
+ return required;
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCache.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCache.java
index af2cdb8133..7c2eca942a 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCache.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionCache.java
@@ -12,8 +12,8 @@ package org.eclipse.osee.ats.core.client.internal.store;
import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
+import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
index 8fa4d33d69..b3831170e4 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/store/AtsVersionServiceImpl.java
@@ -22,13 +22,13 @@ import org.eclipse.osee.ats.api.version.IAtsVersion;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.IAtsVersionAdmin;
import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
import org.eclipse.osee.ats.core.client.internal.IAtsArtifactStore;
import org.eclipse.osee.ats.core.client.internal.config.AtsArtifactConfigCache;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
+import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.jdk.core.type.Identity;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
index ac51550859..ed975c4dca 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/user/AtsUser.java
@@ -144,4 +144,9 @@ public class AtsUser implements IAtsUser {
return String.format("[%s][%s]", getName(), getGuid());
}
+ @Override
+ public Object getStoreObject() {
+ return user;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCacheProvider.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCacheProvider.java
index e8625a5524..dd6f3e38d8 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCacheProvider.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCacheProvider.java
@@ -13,7 +13,8 @@ package org.eclipse.osee.ats.core.client.internal.workdef;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
+import org.eclipse.osee.ats.core.util.CacheProvider;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.framework.core.data.LazyObject;
/**
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AttributeWrapper.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AttributeWrapper.java
index 4b8b70b485..2d6d3d7be4 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AttributeWrapper.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AttributeWrapper.java
@@ -45,4 +45,9 @@ public class AttributeWrapper<T> implements IAttribute<T> {
attr.setValue(value);
}
+ @Override
+ public int getId() {
+ return attr.getId();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/LoadAtsWorkDefinitionCacheCallable.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/LoadAtsWorkDefinitionCacheCallable.java
index 7e7c5b7da6..8102d24829 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/LoadAtsWorkDefinitionCacheCallable.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/LoadAtsWorkDefinitionCacheCallable.java
@@ -15,6 +15,7 @@ import java.util.logging.Level;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
import org.eclipse.osee.ats.core.client.internal.Activator;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
import org.eclipse.osee.framework.core.util.XResultData;
import org.eclipse.osee.framework.logging.OseeLog;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
index 4d42c66062..afc2c7e64c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsAttributeResolverServiceImpl.java
@@ -15,6 +15,7 @@ import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workflow.IAttribute;
@@ -62,6 +63,7 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
return getAttributeType(attributeName).getDescription();
}
+ @Override
public AttributeType getAttributeType(String attributeName) {
try {
return AttributeTypeManager.getType(attributeName);
@@ -138,4 +140,71 @@ public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
attributeById.delete();
}
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.deleteSoleAttribute(workItem, attributeType);
+ } else {
+ deleteSoleAttribute(workItem, attributeType);
+ }
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String value, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.setSoleAttributeValue(workItem, attributeType, value);
+ } else {
+ setSoleAttributeValue(workItem, attributeType, value);
+ }
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.setSoleAttributeValue(workItem, attributeType, value);
+ } else {
+ setSoleAttributeValue(workItem, attributeType, value);
+ }
+ }
+
+ @Override
+ public void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.addAttribute(workItem, attributeType, value);
+ } else {
+ AtsClientService.get().getArtifact(workItem).addAttribute(attributeType, value);
+ }
+ }
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.deleteAttribute(workItem, attributeType, value);
+ } else {
+ AtsClientService.get().getArtifact(workItem).deleteAttribute(attributeType, value);
+ }
+ }
+
+ @Override
+ public <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.setValue(workItem, attr, attributeType, value);
+ } else {
+ @SuppressWarnings("unchecked")
+ Attribute<T> attribute = (Attribute<T>) attr.getData();
+ attribute.setValue(value);
+ }
+ }
+
+ @Override
+ public <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes != null) {
+ changes.deleteAttribute(workItem, attr);
+ } else {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ Attribute<?> attribute = (Attribute<?>) attr.getData();
+ Attribute<?> attributeById = artifact.getAttributeById(attribute.getId(), false);
+ attributeById.delete();
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
index c9e39bc80e..75f21def9d 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workflow/AtsWorkItemServiceImpl.java
@@ -11,13 +11,9 @@
package org.eclipse.osee.ats.core.client.internal.workflow;
import java.util.Collection;
-import java.util.List;
-import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsObject;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.WidgetResult;
@@ -26,9 +22,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
-import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
-import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.internal.IAtsWorkItemArtifactService;
import org.eclipse.osee.ats.core.client.review.ReviewManager;
@@ -36,18 +30,14 @@ import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.validator.AtsXWidgetValidateManagerClient;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AtsWorkData;
-import org.eclipse.osee.ats.core.client.workflow.log.ArtifactLog;
import org.eclipse.osee.ats.core.client.workflow.transition.TransitionListeners;
-import org.eclipse.osee.framework.access.AccessControlManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.util.Conditions;
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.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-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;
@@ -174,30 +164,6 @@ public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
}
@Override
- public boolean isReadOnly(IAtsWorkItem workItem) {
- boolean readOnly = true;
- try {
- Artifact artifact = AtsClientService.get().getArtifact(workItem);
- readOnly = artifact.isReadOnly();
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return readOnly;
- }
-
- @Override
- public boolean isAccessControlWrite(IAtsWorkItem workItem) {
- boolean isWrite = false;
- try {
- Artifact artifact = AtsClientService.get().getArtifact(workItem);
- isWrite = AccessControlManager.hasPermission(artifact, PermissionEnum.WRITE);
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return isWrite;
- }
-
- @Override
public String getCurrentStateName(IAtsWorkItem workItem) {
return ((AbstractWorkflowArtifact) workItem).getCurrentStateName();
}
@@ -222,18 +188,13 @@ public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
}
@Override
- public void transitioned(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, List<? extends IAtsUser> updatedAssigees, IAtsChangeSet changes) throws OseeCoreException {
- ((AbstractWorkflowArtifact) workItem).transitioned(fromState, toState, updatedAssigees, changes);
- }
-
- @Override
public Collection<ITransitionListener> getTransitionListeners() {
return TransitionListeners.getListeners();
}
@Override
- public ILogStorageProvider getLogStorageProvider(IAtsWorkItem workItem) {
- return new ArtifactLog(((AbstractWorkflowArtifact) workItem));
+ public String getTargetedVersionStr(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsClientService.get().getAtsVersionService().getTargetedVersion(teamWf).getName();
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
index 88b8324882..69ea04ae3c 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewDefinitionManager.java
@@ -66,14 +66,14 @@ public class DecisionReviewDefinitionManager extends TransitionAdapter {
} else {
decArt =
DecisionReviewManager.createNewDecisionReview(teamArt, revDef.getBlockingType(), revDef.getReviewTitle(),
- revDef.getRelatedToState(), revDef.getDescription(), revDef.getOptions(), users, createdDate, createdBy, changes);
+ revDef.getRelatedToState(), revDef.getDescription(), revDef.getOptions(), users, createdDate, createdBy,
+ changes);
}
decArt.getLog().addLog(LogType.Note, null, String.format("Review [%s] auto-generated", revDef.getName()),
AtsCore.getUserService().getCurrentUser().getUserId());
for (IReviewProvider provider : ReviewProviders.getAtsReviewProviders()) {
provider.reviewCreated(decArt);
}
- AtsCore.getLogFactory().writeToStore(decArt);
changes.add(decArt);
return decArt;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
index 41b3156e79..69a1f3ea78 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/DecisionReviewManager.java
@@ -27,7 +27,6 @@ import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
@@ -99,7 +98,6 @@ public class DecisionReviewManager {
}
reviewArt.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, estimateHours);
reviewArt.getStateMgr().updateMetrics(reviewArt.getStateDefinition(), stateHoursSpent, statePercentComplete, true);
- AtsCore.getLogFactory().writeToStore(reviewArt);
return Result.TrueResult;
}
@@ -126,7 +124,6 @@ public class DecisionReviewManager {
reviewArt.setSoleAttributeValue(AtsAttributeTypes.Decision, decision ? "Yes" : "No");
reviewArt.getStateMgr().updateMetrics(reviewArt.getStateDefinition(), stateHoursSpent, statePercentComplete, true);
- AtsCore.getLogFactory().writeToStore(reviewArt);
return Result.TrueResult;
}
@@ -149,7 +146,6 @@ public class DecisionReviewManager {
}
// ensure assignees are as requested
decRev.getStateMgr().setAssignees(assignees);
- AtsCore.getLogFactory().writeToStore(decRev);
changes.add(decRev);
return decRev;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
index 94bb41d702..172a59e22f 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/PeerReviewDefinitionManager.java
@@ -73,7 +73,7 @@ public class PeerReviewDefinitionManager extends TransitionAdapter {
for (IReviewProvider provider : ReviewProviders.getAtsReviewProviders()) {
provider.reviewCreated(peerArt);
}
- AtsCore.getLogFactory().writeToStore(peerArt);
+ changes.add(peerArt);
return peerArt;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
index a59a28a363..629b5b7252 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/review/role/UserRoleManager.java
@@ -20,7 +20,6 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
@@ -257,6 +256,5 @@ public class UserRoleManager {
awa.getStateMgr().setMetrics(awa.getStateDefinition(), hoursSpent,
awa.getStateMgr().getPercentComplete(awa.getCurrentStateName()), true,
AtsClientService.get().getUserAdmin().getCurrentUser(), new Date());
- AtsCore.getLogFactory().writeToStore(awa);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
index 4ced79e6a8..4bfd8d9d63 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/AbstractTaskableArtifact.java
@@ -24,9 +24,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.util.AtsTaskCache;
@@ -65,14 +63,6 @@ public abstract class AbstractTaskableArtifact extends AbstractWorkflowArtifact
}
}
- @Override
- public void transitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
- super.transitioned(fromState, toState, toAssignees, changes);
- for (TaskArtifact taskArt : getTaskArtifacts()) {
- taskArt.parentWorkFlowTransitioned(fromState, toState, toAssignees, changes);
- }
- }
-
public Collection<TaskArtifact> getTaskArtifacts() throws OseeCoreException {
return AtsTaskCache.getTaskArtifacts(this);
}
@@ -126,7 +116,6 @@ public abstract class AbstractTaskableArtifact extends AbstractWorkflowArtifact
if (Strings.isValid(relatedToState)) {
taskArt.setSoleAttributeValue(AtsAttributeTypes.RelatedToState, relatedToState);
}
- AtsCore.getLogFactory().writeToStore(taskArt);
AtsTaskCache.decache(this);
changes.add(taskArt);
return taskArt;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
index 0f35358a0d..2b2824b279 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskArtifact.java
@@ -10,31 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.client.task;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.LogType;
-import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
-import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
import org.eclipse.osee.ats.core.client.action.ActionArtifact;
-import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.workflow.state.TeamState;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
-import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.model.Branch;
-import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -67,25 +56,6 @@ public class TaskArtifact extends AbstractWorkflowArtifact implements IAtsTask,
}
}
- public Result parentWorkFlowTransitioned(IAtsStateDefinition fromState, IAtsStateDefinition toState, Collection<? extends IAtsUser> toAssignees, IAtsChangeSet changes) throws OseeCoreException {
- if (toState.getName().equals(TeamState.Cancelled.getName()) && isInWork()) {
- TransitionHelper helper =
- new TransitionHelper("Transition to Cancelled", Arrays.asList(this), TaskStates.Cancelled.getName(), null,
- "Parent Cancelled", changes, TransitionOption.None);
- TransitionManager transitionMgr = new TransitionManager(helper);
- TransitionResults results = transitionMgr.handleAll();
-
- if (!results.isEmpty()) {
- return new Result("Transition Error %s", results.toString());
- }
- } else if (fromState.getName().equals(TeamState.Cancelled.getName()) && isCancelled()) {
- Result result =
- TaskManager.transitionToInWork(this, AtsClientService.get().getUserAdmin().getCurrentUser(), 99, 0, changes);
- return result;
- }
- return Result.TrueResult;
- }
-
@Override
public double getManHrsPerDayPreference() throws OseeCoreException {
return getParentAWA().getManHrsPerDayPreference();
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
index c7e6d75046..2a920929a1 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/task/TaskManager.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.internal.AtsClientService;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -58,7 +57,6 @@ public class TaskManager {
taskArt.getStateMgr().setAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
}
taskArt.getStateMgr().updateMetrics(taskArt.getStateDefinition(), additionalHours, 100, true);
- AtsCore.getLogFactory().writeToStore(taskArt);
if (estimatedHours > 0.0) {
taskArt.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, estimatedHours);
}
@@ -93,7 +91,6 @@ public class TaskManager {
}
if (taskArt.getStateMgr().getPercentComplete(taskArt.getCurrentStateName()) != percentComplete || additionalHours > 0) {
taskArt.getStateMgr().updateMetrics(taskArt.getStateDefinition(), additionalHours, percentComplete, true);
- AtsCore.getLogFactory().writeToStore(taskArt);
}
if (changes != null) {
taskArt.saveSMA(changes);
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
index e27663d220..b26cc49ea6 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowArtifact.java
@@ -100,11 +100,6 @@ public class TeamWorkFlowArtifact extends AbstractTaskableArtifact implements IA
}
@Override
- public boolean isValidationRequired() throws OseeCoreException {
- return getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, false);
- }
-
- @Override
public String getEditorTitle() throws OseeCoreException {
try {
if (getTeamDefinition().isTeamUsesVersions()) {
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
index 88ca0d7485..03590b5de0 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/team/TeamWorkFlowManager.java
@@ -24,17 +24,17 @@ import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.internal.Activator;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
import org.eclipse.osee.ats.core.workflow.state.TeamState;
import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
@@ -203,7 +203,6 @@ public class TeamWorkFlowManager {
}
teamArt.setSoleAttributeValue(AtsAttributeTypes.EstimatedHours, hourEstimate);
teamArt.getStateMgr().setMetrics(TeamState.Analyze, stateHoursSpent, statePercentComplete, true, user, date);
- AtsCore.getLogFactory().writeToStore(teamArt);
return Result.TrueResult;
}
@@ -215,7 +214,6 @@ public class TeamWorkFlowManager {
}
}
teamArt.getStateMgr().setMetrics(TeamState.Authorize, stateHoursSpent, statePercentComplete, true, user, date);
- AtsCore.getLogFactory().writeToStore(teamArt);
return Result.TrueResult;
}
@@ -227,7 +225,6 @@ public class TeamWorkFlowManager {
}
}
teamArt.getStateMgr().setMetrics(TeamState.Implement, stateHoursSpent, statePercentComplete, true, user, date);
- AtsCore.getLogFactory().writeToStore(teamArt);
return Result.TrueResult;
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
index af906490ef..7ff8188818 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/util/AtsChangeSet.java
@@ -16,11 +16,15 @@ import java.util.concurrent.CopyOnWriteArrayList;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.util.IExecuteListener;
+import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.client.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
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.artifact.Attribute;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionManager;
@@ -75,7 +79,7 @@ public class AtsChangeSet implements IAtsChangeSet {
AtsCore.getStateFactory().writeToStore(workItem, this);
}
if (workItem.getLog().isDirty()) {
- AtsCore.getLogFactory().writeToStore(workItem);
+ AtsCore.getLogFactory().writeToStore(workItem, AtsClientService.get().getAttributeResolver(), this);
}
}
}
@@ -150,4 +154,62 @@ public class AtsChangeSet implements IAtsChangeSet {
}
changes.execute();
}
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ artifact.deleteSoleAttribute(attributeType);
+ add(artifact);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String value) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ artifact.setSoleAttributeValue(attributeType, value);
+ add(artifact);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ artifact.setSoleAttributeValue(attributeType, value);
+ add(artifact);
+ }
+
+ @Override
+ public void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ artifact.addAttribute(attributeType, value);
+ add(artifact);
+ }
+
+ @Override
+ public void deleteAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ artifact.deleteAttribute(attributeType, value);
+ add(artifact);
+ }
+
+ @Override
+ public <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ @SuppressWarnings("unchecked")
+ Attribute<T> attribute = (Attribute<T>) attr.getData();
+ attribute.setValue(value);
+ add(artifact);
+ }
+
+ @Override
+ public <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr) throws OseeCoreException {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ Attribute<?> attribute = (Attribute<?>) attr.getData();
+ attribute.delete();
+ add(artifact);
+ }
+
+ @Override
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) {
+ Artifact artifact = AtsClientService.get().getArtifact(workItem);
+ return artifact.getAttributeTypes().contains(attributeType);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
index 4aa8bd723b..dbbd209808 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AbstractWorkflowArtifact.java
@@ -61,6 +61,7 @@ import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.services.CmAccessControl;
import org.eclipse.osee.framework.core.services.HasCmAccessControl;
+import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.core.util.IGroupExplorerProvider;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
@@ -98,11 +99,14 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
}
public void initializeNewStateMachine(List<? extends IAtsUser> assignees, Date createdDate, IAtsUser createdBy, IAtsChangeSet changes) throws OseeCoreException {
+ Conditions.checkNotNull(createdDate, "createdDate");
+ Conditions.checkNotNull(createdBy, "createdBy");
+ Conditions.checkNotNull(changes, "changes");
IAtsStateDefinition startState = getWorkDefinition().getStartState();
StateManagerUtility.initializeStateMachine(getStateMgr(), startState, assignees,
(createdBy == null ? AtsClientService.get().getUserAdmin().getCurrentUser() : createdBy), changes);
IAtsUser user = createdBy == null ? AtsClientService.get().getUserAdmin().getCurrentUser() : createdBy;
- setCreatedBy(user, true, createdDate);
+ setCreatedBy(user, true, createdDate, changes);
TransitionManager.logStateStartedEvent(this, startState, createdDate, user);
}
@@ -144,10 +148,6 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
return 0;
}
- public boolean isValidationRequired() throws OseeCoreException {
- return false;
- }
-
@Override
public String getDescription() {
return "";
@@ -336,11 +336,7 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
getSmaArtifactsOneLevel(this, artifacts);
for (Artifact artifact : artifacts) {
if (artifact instanceof AbstractWorkflowArtifact) {
- AbstractWorkflowArtifact awa = (AbstractWorkflowArtifact) artifact;
changes.add(artifact);
- if (awa.getLog().isDirty()) {
- AtsCore.getLogFactory().writeToStore(awa);
- }
}
}
} catch (Exception ex) {
@@ -406,7 +402,7 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
@Override
public IAtsLog getLog() {
if (atsLog == null || atsLogTransactionNumber != getTransactionNumber()) {
- atsLog = AtsCore.getLogFactory().getLogLoaded(this);
+ atsLog = AtsCore.getLogFactory().getLogLoaded(this, AtsClientService.get().getAttributeResolver());
atsLogTransactionNumber = getTransactionNumber();
}
return atsLog;
@@ -489,17 +485,27 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
return false;
}
+
}
- public void setCreatedBy(IAtsUser user, boolean logChange, Date date) throws OseeCoreException {
+ public void setCreatedBy(IAtsUser user, boolean logChange, Date date, IAtsChangeSet changes) throws OseeCoreException {
if (logChange) {
logCreatedByChange(user, date);
}
- if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- setSoleAttributeValue(AtsAttributeTypes.CreatedBy, user.getUserId());
- }
- if (isAttributeTypeValid(AtsAttributeTypes.CreatedDate)) {
- setSoleAttributeValue(AtsAttributeTypes.CreatedDate, date);
+ if (changes == null) {
+ if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
+ setSoleAttributeValue(AtsAttributeTypes.CreatedBy, user.getUserId());
+ }
+ if (isAttributeTypeValid(AtsAttributeTypes.CreatedDate)) {
+ setSoleAttributeValue(AtsAttributeTypes.CreatedDate, date);
+ }
+ } else {
+ if (changes.isAttributeTypeValid(this, AtsAttributeTypes.CreatedBy)) {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.CreatedBy, user.getUserId());
+ }
+ if (changes.isAttributeTypeValid(this, AtsAttributeTypes.CreatedDate)) {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.CreatedDate, date);
+ }
}
AtsNotificationManager.notify(this, AtsNotifyType.Originator);
}
@@ -512,33 +518,19 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
"Changed by " + AtsClientService.get().getUserAdmin().getCurrentUser().getName(), date, user.getUserId());
getLog().internalResetOriginator(user);
}
- AtsCore.getLogFactory().writeToStore(this);
}
- public void setCreatedBy(IAtsUser user, boolean logChange) throws OseeCoreException {
- Date date = new Date();
- if (logChange) {
- logCreatedByChange(user, date);
- }
- if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- setSoleAttributeValue(AtsAttributeTypes.CreatedBy, user.getUserId());
- }
- AtsNotificationManager.notify(this, AtsNotifyType.Originator);
- }
-
- public void internalSetCreatedBy(IAtsUser user) throws OseeCoreException {
+ public void internalSetCreatedBy(IAtsUser user, IAtsChangeSet changes) throws OseeCoreException {
getLog().internalResetOriginator(user);
- AtsCore.getLogFactory().writeToStore(this);
- if (isAttributeTypeValid(AtsAttributeTypes.CreatedBy)) {
- setSoleAttributeValue(AtsAttributeTypes.CreatedBy, user.getUserId());
+ if (changes.isAttributeTypeValid(this, AtsAttributeTypes.CreatedBy)) {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.CreatedBy, user.getUserId());
}
}
- public void internalSetCreatedDate(Date date) throws OseeCoreException {
+ public void internalSetCreatedDate(Date date, IAtsChangeSet changes) throws OseeCoreException {
getLog().internalResetCreatedDate(date);
- AtsCore.getLogFactory().writeToStore(this);
- if (isAttributeTypeValid(AtsAttributeTypes.CreatedDate)) {
- setSoleAttributeValue(AtsAttributeTypes.CreatedDate, date);
+ if (changes.isAttributeTypeValid(this, AtsAttributeTypes.CreatedDate)) {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.CreatedDate, date);
}
}
@@ -578,8 +570,12 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
return reason;
}
- public void setCancellationReason(String reason) throws OseeCoreException {
- setSoleAttributeValue(AtsAttributeTypes.CancelledReason, reason);
+ public void setCancellationReason(String reason, IAtsChangeSet changes) throws OseeCoreException {
+ if (changes == null) {
+ setSoleAttributeValue(AtsAttributeTypes.CancelledReason, reason);
+ } else {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.CancelledReason, reason);
+ }
}
public String getCancelledFromState() throws OseeCoreException {
@@ -614,15 +610,6 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
return getLog().getStateEvent(LogType.StateCancelled, stateName);
}
- @Override
- public IAtsLogItem getStateStartedData(IStateToken state) throws OseeCoreException {
- return getStateStartedData(state.getName());
- }
-
- public IAtsLogItem getStateStartedData(String stateName) throws OseeCoreException {
- return getLog().getStateEvent(LogType.StateEntered, stateName);
- }
-
public String getCompletedFromState() throws OseeCoreException {
String fromState = getSoleAttributeValue(AtsAttributeTypes.CompletedFromState, null);
if (!Strings.isValid(fromState)) {
@@ -774,13 +761,13 @@ public abstract class AbstractWorkflowArtifact extends AbstractAtsArtifact imple
}
@Override
- public void setAtsId(String atsId) throws OseeCoreException {
- setSoleAttributeFromString(AtsAttributeTypes.AtsId, atsId);
+ public void setAtsId(String atsId, IAtsChangeSet changes) throws OseeCoreException {
+ changes.setSoleAttributeValue(this, AtsAttributeTypes.AtsId, atsId);
}
@Override
- public String getTypeName() {
- return getArtifactTypeName();
+ public Object getStoreObject() {
+ return this;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
index 14202bb9c1..a0b5532635 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsBranchServiceImpl.java
@@ -14,6 +14,7 @@ import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -31,4 +32,9 @@ public class AtsBranchServiceImpl implements IAtsBranchService {
return AtsBranchManagerCore.isWorkingBranchInWork(teamWf);
}
+ @Override
+ public Branch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return AtsBranchManagerCore.getWorkingBranch((TeamWorkFlowArtifact) teamWf);
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsWorkData.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsWorkData.java
index 4844c6d120..8ec9f9a856 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsWorkData.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/AtsWorkData.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -113,4 +114,19 @@ public class AtsWorkData implements IAtsWorkData {
awa.setSoleAttributeValue(AtsAttributeTypes.CompletedDate, cancelledBy);
}
+ @Override
+ public IAtsUser getCreatedBy() throws OseeCoreException {
+ return AtsCore.getUserService().getUserById(awa.getSoleAttributeValue(AtsAttributeTypes.CreatedBy, ""));
+ }
+
+ @Override
+ public Date getCreatedDate() throws OseeCoreException {
+ return awa.getSoleAttributeValue(AtsAttributeTypes.CreatedDate);
+ }
+
+ @Override
+ public String getArtifactTypeName() throws OseeCoreException {
+ return awa.getArtifactTypeName();
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/log/ArtifactLog.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/log/ArtifactLog.java
deleted file mode 100644
index 9431ad1c44..0000000000
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/log/ArtifactLog.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Boeing.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Boeing - initial API and implementation
- *******************************************************************************/
-package org.eclipse.osee.ats.core.client.workflow.log;
-
-import java.lang.ref.WeakReference;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.user.IAtsUser;
-import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
-import org.eclipse.osee.ats.core.AtsCore;
-import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-/**
- * @author Donald G. Dunne
- */
-public class ArtifactLog implements ILogStorageProvider {
- private final WeakReference<Artifact> artifactRef;
-
- public ArtifactLog(Artifact artifact) {
- this.artifactRef = new WeakReference<Artifact>(artifact);
- }
-
- @Override
- public String getLogXml() {
- try {
- return getArtifact().getSoleAttributeValue(AtsAttributeTypes.Log, "");
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return "getLogXml exception " + ex.getLocalizedMessage();
- }
- }
-
- @Override
- public IStatus saveLogXml(String xml) {
- try {
- getArtifact().setSoleAttributeValue(AtsAttributeTypes.Log, xml);
- return Status.OK_STATUS;
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "saveLogXml exception " + ex.getLocalizedMessage());
- }
- }
-
- public Artifact getArtifact() throws OseeStateException {
- if (artifactRef.get() == null) {
- throw new OseeStateException("Artifact has been garbage collected");
- }
- return artifactRef.get();
- }
-
- @Override
- public String getLogTitle() {
- try {
- return "History for \"" + getArtifact().getArtifactTypeName() + "\" - " + getLogId() + " - titled \"" + getArtifact().getName() + "\"";
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- return "getLogTitle exception " + ex.getLocalizedMessage();
- }
- }
-
- @Override
- public String getLogId() {
- try {
- return AtsUtilCore.getAtsId(getArtifact());
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return "unknown";
- }
-
- @Override
- public String getNameFromUserId(String userId) {
- String name = "unknown (" + userId + ")";
- IAtsUser user = AtsCore.getUserService().getUserById(userId);
- if (user != null) {
- name = user.getName();
- }
- return name;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
index f84d425b89..36ec539f55 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/workflow/transition/TransitionHelperAdapter.java
@@ -11,17 +11,21 @@
package org.eclipse.osee.ats.core.client.workflow.transition;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
/**
* @author Donald G. Dunne
*/
public abstract class TransitionHelperAdapter implements ITransitionHelper {
+ IAtsUser transitionUser;
+
@Override
public boolean isPrivilegedEditEnabled() {
return false;
@@ -49,7 +53,7 @@ public abstract class TransitionHelperAdapter implements ITransitionHelper {
@Override
public boolean isSystemUser() throws OseeCoreException {
- return AtsCoreUsers.isAtsCoreUser(AtsCore.getUserService().getCurrentUser());
+ return AtsCoreUsers.isAtsCoreUser(getTransitionUser());
}
@Override
@@ -57,4 +61,19 @@ public abstract class TransitionHelperAdapter implements ITransitionHelper {
return workItem.getStateMgr().getAssignees().contains(AtsCoreUsers.GUEST_USER) || workItem.getStateMgr().getAssignees().contains(
AtsCoreUsers.SYSTEM_USER);
}
+
+ @Override
+ public IAtsUser getTransitionUser() throws OseeStateException, OseeCoreException {
+ IAtsUser user = transitionUser;
+ if (user == null) {
+ user = AtsCore.getUserService().getCurrentUser();
+ }
+ return user;
+ }
+
+ @Override
+ public void setTransitionUser(IAtsUser user) throws OseeCoreException {
+ transitionUser = user;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/pom.xml b/plugins/org.eclipse.osee.ats.core.test/pom.xml
index ef4db2a8a8..bf28dcfe36 100644
--- a/plugins/org.eclipse.osee.ats.core.test/pom.xml
+++ b/plugins/org.eclipse.osee.ats.core.test/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.server.parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.server.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.core.test</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
index 484ad092f5..b45fd2ca4c 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockAtsUser.java
@@ -127,4 +127,9 @@ public class MockAtsUser implements IAtsUser {
return toString();
}
+ @Override
+ public Object getStoreObject() {
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkData.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkData.java
index 0a5ba05720..af2f69fb01 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkData.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkData.java
@@ -14,6 +14,7 @@ import java.util.Date;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
* @author Donald G. Dunne
@@ -131,4 +132,18 @@ public class MockWorkData implements IAtsWorkData {
this.StateType = StateType;
}
+ @Override
+ public IAtsUser getCreatedBy() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public Date getCreatedDate() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public String getArtifactTypeName() throws OseeCoreException {
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
index 4baab70602..363cd81ea0 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/mock/MockWorkItem.java
@@ -13,14 +13,13 @@ package org.eclipse.osee.ats.core.mock;
import java.util.List;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
-import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
-import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.core.internal.state.StateManager;
import org.eclipse.osee.ats.core.util.AtsUserGroup;
@@ -136,17 +135,12 @@ public class MockWorkItem implements IAtsWorkItem {
}
@Override
- public IAtsLogItem getStateStartedData(IStateToken state) {
- return null;
- }
-
- @Override
public IAtsWorkDefinition getWorkDefinition() {
return null;
}
@Override
- public void setAtsId(String atsId) {
+ public void setAtsId(String atsId, IAtsChangeSet changes) {
this.atsId = atsId;
}
@@ -161,7 +155,7 @@ public class MockWorkItem implements IAtsWorkItem {
}
@Override
- public String getTypeName() {
+ public Object getStoreObject() {
return null;
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
index d30b9da764..f10179bb96 100644
--- a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/users/CoreAtsUsersTest.java
@@ -232,5 +232,10 @@ public class CoreAtsUsersTest {
public String toStringWithId() {
return String.format("[%s][%s]", getName(), getGuid());
}
+
+ @Override
+ public Object getStoreObject() {
+ return null;
+ }
};
}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImplTest.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImplTest.java
new file mode 100644
index 0000000000..3a5f767663
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImplTest.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.workdef;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.when;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionStore;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.ats.core.util.CacheProvider;
+import org.eclipse.osee.framework.core.util.XResultData;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Test case for {@link AtsWorkDefinitionAdminImpl}
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsWorkDefinitionAdminImplTest {
+
+ private static final String MyPeerToPeerWorkDefId = "myPeerToPeerWorkDef";
+
+ // @formatter:off
+ @Mock IAtsTeamDefinition topTeamDef;
+ @Mock IAtsTeamDefinition projTeamDef;
+ @Mock IAtsTeamDefinition featureTeamDef;
+ @Mock IAtsWorkItemService workItemService;
+ @Mock IAtsWorkDefinitionService workDefinitionService;
+ @Mock IAtsWorkDefinitionStore workDefinitionStore;
+ @Mock IAtsActionableItem actionableItem;
+ @Mock IAtsPeerToPeerReview peerReview;
+ @Mock XResultData resultData;
+ @Mock IAtsTeamWorkflow teamWf;
+ @Mock IAtsWorkDefinition defaultPeerToPeerWorkDef;
+ @Mock IAtsWorkDefinition myPeerToPeerWorkDef;
+ @Mock ITeamWorkflowProviders teamWorkflowProviders;
+ @Mock CacheProvider<AtsWorkDefinitionCache> cacheProvider;
+ @Mock IAttributeResolver attributeResolver;
+
+ private AtsWorkDefinitionAdminImpl workDefAmin;
+
+ // @formatter:on
+
+ @Before
+ public void setup() throws Exception {
+ MockitoAnnotations.initMocks(this);
+ when(topTeamDef.getParentTeamDef()).thenReturn(null);
+ when(projTeamDef.getParentTeamDef()).thenReturn(topTeamDef);
+ when(featureTeamDef.getParentTeamDef()).thenReturn(projTeamDef);
+ // always return default when requested
+ when(
+ workDefinitionService.getWorkDef(eq(IAtsWorkDefinitionAdmin.PeerToPeerDefaultWorkflowDefinitionId),
+ any(XResultData.class))).thenReturn(defaultPeerToPeerWorkDef);
+ // always return myPeerToPeerWorkDef when requested
+ when(workDefinitionService.getWorkDef(eq(MyPeerToPeerWorkDefId), any(XResultData.class))).thenReturn(
+ myPeerToPeerWorkDef);
+
+ AtsWorkDefinitionCache cache = new AtsWorkDefinitionCache();
+ when(cacheProvider.get()).thenReturn(cache);
+
+ when(peerReview.getGuid()).thenReturn(MyPeerToPeerWorkDefId);
+
+ workDefAmin =
+ new AtsWorkDefinitionAdminImpl(cacheProvider, workItemService, workDefinitionService, teamWorkflowProviders,
+ attributeResolver);
+ }
+
+ @Test
+ public void testGetDefaultPeerToPeerWorkflowDefinitionMatch() throws OseeCoreException {
+ assertEquals(defaultPeerToPeerWorkDef,
+ workDefAmin.getDefaultPeerToPeerWorkflowDefinitionMatch().getWorkDefinition());
+ }
+
+ /**
+ * When peerReview has no WorkDefinition attribute set, then default peer review WorkDefinition is returned
+ */
+ @Test
+ public void testGetWorkDefinitionForPeerToPeerReview_deafault() throws Exception {
+ when(workItemService.getAttributeValues(peerReview, AtsAttributeTypes.WorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+
+ IWorkDefinitionMatch match = workDefAmin.getWorkDefinitionForPeerToPeerReview(peerReview);
+
+ assertEquals(defaultPeerToPeerWorkDef, match.getWorkDefinition());
+ }
+
+ /**
+ * Test that peer review WorkDefinition id comes from teamDefinition hierarchy
+ */
+ @Test
+ public void testGetWorkDefinitionForPeerToPeerReviewNotYetCreated() throws Exception {
+ when(teamWf.getTeamDefinition()).thenReturn(topTeamDef);
+ when(workItemService.getAttributeValues(topTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+
+ IWorkDefinitionMatch match = workDefAmin.getWorkDefinitionForPeerToPeerReviewNotYetCreated(teamWf);
+
+ assertEquals(defaultPeerToPeerWorkDef, match.getWorkDefinition());
+ }
+
+ /**
+ * When peerReview WorkDefinition attribute is set, then that WorkDefinition is returned instead of default
+ */
+ @Test
+ public void testGetWorkDefinitionForPeerToPeerReviewIAtsTeamWorkflowIAtsPeerToPeerReview__fromReview() throws Exception {
+ List<Object> attrValues = new ArrayList<Object>();
+ attrValues.add(MyPeerToPeerWorkDefId);
+ when(workItemService.getAttributeValues(peerReview, AtsAttributeTypes.WorkflowDefinition)).thenReturn(attrValues);
+
+ IWorkDefinitionMatch match = workDefAmin.getWorkDefinitionForPeerToPeerReview(peerReview);
+
+ assertEquals(myPeerToPeerWorkDef, match.getWorkDefinition());
+ }
+
+ /**
+ * Test that stand alone peer WorkDefinition comes from actionableItem's Team Definition hierarchy
+ */
+ @Test
+ public void testGetWorkDefinitionForPeerToPeerReviewNotYetCreatedAndStandalone() throws Exception {
+ when(teamWf.getTeamDefinition()).thenReturn(featureTeamDef);
+ List<Object> attrValues = new ArrayList<Object>();
+ attrValues.add(MyPeerToPeerWorkDefId);
+ when(workItemService.getAttributeValues(topTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ attrValues);
+ when(actionableItem.getTeamDefinitionInherited()).thenReturn(topTeamDef);
+ when(topTeamDef.getRelatedPeerWorkDefinition()).thenReturn(MyPeerToPeerWorkDefId);
+
+ IWorkDefinitionMatch match =
+ workDefAmin.getWorkDefinitionForPeerToPeerReviewNotYetCreatedAndStandalone(actionableItem);
+
+ assertEquals(myPeerToPeerWorkDef, match.getWorkDefinition());
+ }
+
+ /**
+ * When no team definition in team definition hierarchy has a Peer WorkDefinition defined, return No-Match<br>
+ * When top team definition has a Peer WorkDefinition defined, return it's value.
+ */
+ @Test
+ public void testGetPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse() throws Exception {
+ // Setup all teamDefinitions to not have values defined
+ when(workItemService.getAttributeValues(topTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+ when(workItemService.getAttributeValues(projTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+ when(workItemService.getAttributeValues(featureTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+
+ // Test that no-match is returned
+ IWorkDefinitionMatch peerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse =
+ workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(topTeamDef);
+ assertFalse(peerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse.isMatched());
+ assertFalse(workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(projTeamDef).isMatched());
+ assertFalse(workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(featureTeamDef).isMatched());
+
+ // Setup that top team definition has WorkDefinition defined
+ List<Object> attrValues = new ArrayList<Object>();
+ attrValues.add(MyPeerToPeerWorkDefId);
+ when(workItemService.getAttributeValues(topTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ attrValues);
+ when(workDefinitionService.getWorkDef(eq(MyPeerToPeerWorkDefId), any(XResultData.class))).thenReturn(
+ myPeerToPeerWorkDef);
+ when(topTeamDef.getRelatedPeerWorkDefinition()).thenReturn(MyPeerToPeerWorkDefId);
+
+ // Test that match is returned
+ peerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse =
+ workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(topTeamDef);
+ assertTrue(peerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse.isMatched());
+ assertTrue(workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(projTeamDef).isMatched());
+ assertTrue(workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(featureTeamDef).isMatched());
+ assertEquals(
+ myPeerToPeerWorkDef,
+ workDefAmin.getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(featureTeamDef).getWorkDefinition());
+ }
+
+ @Test
+ public void testGetWorkDefinitionIAtsWorkItem() throws Exception {
+ when(workItemService.getParentTeamWorkflow(peerReview)).thenReturn(teamWf);
+ when(teamWf.getTeamDefinition()).thenReturn(topTeamDef);
+ when(workItemService.getAttributeValues(topTeamDef, AtsAttributeTypes.RelatedPeerWorkflowDefinition)).thenReturn(
+ Collections.emptyList());
+ when(
+ workDefinitionService.getWorkDef(Matchers.eq(IAtsWorkDefinitionAdmin.PeerToPeerDefaultWorkflowDefinitionId),
+ (XResultData) Matchers.anyObject())).thenReturn(defaultPeerToPeerWorkDef);
+
+ IWorkDefinitionMatch match = workDefAmin.getWorkDefinition(peerReview);
+ assertEquals(defaultPeerToPeerWorkDef, match.getWorkDefinition());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/InternalWorkDefTestSuite.java b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/InternalWorkDefTestSuite.java
new file mode 100644
index 0000000000..0ef7a4d1b8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core.test/src/org/eclipse/osee/ats/core/workdef/InternalWorkDefTestSuite.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.workdef;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({AtsWorkDefinitionAdminImplTest.class})
+/**
+ * @author Donald G. Dunne
+ */
+public class InternalWorkDefTestSuite {
+ // TestSuite
+}
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 1abd21cdec..1e76509f4a 100644
--- a/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.core/META-INF/MANIFEST.MF
@@ -34,7 +34,6 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.dsl,
org.eclipse.osee.ats.dsl.atsDsl,
org.eclipse.osee.ats.dsl.atsDsl.impl,
- org.eclipse.osee.framework.core.client,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
@@ -46,7 +45,7 @@ Import-Package: com.google.inject,
org.eclipse.osee.framework.jdk.core.util,
org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.framework.logging,
- org.eclipse.osee.framework.plugin.core.util,
+ org.eclipse.osee.orcs.data,
org.eclipse.xtext.resource,
org.osgi.framework
Bundle-Vendor: Eclipse Open System Engineering Environment
diff --git a/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml b/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
index 9d0e4ffec6..a673ed3872 100644
--- a/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
+++ b/plugins/org.eclipse.osee.ats.core/OSGI-INF/ats.core.xml
@@ -4,8 +4,8 @@
<reference bind="setAtsAttributeResolver" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAttributeResolver" name="IAttributeResolver" policy="static"/>
<reference bind="setAtsWorkDefService" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService" name="IAtsWorkDefinitionService" policy="static"/>
<reference bind="setAtsUserService" cardinality="1..1" interface="org.eclipse.osee.ats.api.user.IAtsUserService" name="IAtsUserService" policy="static"/>
- <reference bind="setAtsNotificationService" cardinality="1..1" interface="org.eclipse.osee.ats.api.notify.IAtsNotificationService" name="IAtsNotificationService" policy="static"/>
<reference bind="setAtsWorkItemServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider" name="IAtsWorkItemServiceProvider" policy="static"/>
<reference bind="setAtsReviewServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider" name="IAtsReviewServiceProvider" policy="static"/>
<reference bind="setAtsBranchServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider" name="IAtsBranchServiceProvider" policy="static"/>
+ <reference bind="setAtsNotificationServiceProvider" cardinality="1..1" interface="org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider" name="IAtsNotificationServiceProvider" policy="static"/>
</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.core/pom.xml b/plugins/org.eclipse.osee.ats.core/pom.xml
index 371cde674c..166dc63568 100644
--- a/plugins/org.eclipse.osee.ats.core/pom.xml
+++ b/plugins/org.eclipse.osee.ats.core/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.server.parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.server.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.core</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
index ef8d78f018..62be67b706 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/AtsCore.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core;
import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider;
import org.eclipse.osee.ats.api.review.IAtsReviewService;
import org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider;
import org.eclipse.osee.ats.api.user.IAtsUserService;
@@ -38,12 +39,13 @@ import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
*/
public class AtsCore {
+ public static final String PLUGIN_ID = "org.eclipse.osee.ats.core";
private static IAtsColumnUtilities columnUtilities;
private static IAtsLogFactory logFactory;
private static IAtsStateFactory stateFactory;
private static IAttributeResolver attrResolver;
private static IAtsWorkDefinitionService workDefService;
- private static IAtsNotificationService notifyService;
+ private static IAtsNotificationServiceProvider notifyServiceProvider;
private static IAtsUserService userService;
private static Boolean started = null;
private static IAtsWorkItemServiceProvider workItemServiceProvider;
@@ -58,8 +60,8 @@ public class AtsCore {
AtsCore.workDefService = workDefService;
}
- public static void setAtsNotificationService(IAtsNotificationService notifyService) {
- AtsCore.notifyService = notifyService;
+ public static void setAtsNotificationServiceProvider(IAtsNotificationServiceProvider notifyServiceProvider) {
+ AtsCore.notifyServiceProvider = notifyServiceProvider;
}
public static void setAtsWorkItemServiceProvider(IAtsWorkItemServiceProvider workItemServiceProvider) {
@@ -83,9 +85,10 @@ public class AtsCore {
Conditions.checkNotNull(workDefService, "IAtsWorkDefinitionService");
Conditions.checkNotNull(workItemServiceProvider, "IAtsWorkItemServiceProvider");
Conditions.checkNotNull(attrResolver, "IAttributeResolver");
- Conditions.checkNotNull(notifyService, "IAtsNotificationService");
+ Conditions.checkNotNull(notifyServiceProvider, "IAtsNotificationService");
Conditions.checkNotNull(branchServiceProvider, "IAtsBranchServiceProvider");
Conditions.checkNotNull(reviewServiceProvider, "IAtsReviewServiceProvider");
+ System.out.println("ATS - AtsCore started");
started = true;
}
@@ -110,9 +113,9 @@ public class AtsCore {
return workDefService;
}
- public static IAtsNotificationService getNotifyService() throws OseeStateException {
+ public static IAtsNotificationService getNotifyService() throws OseeCoreException {
checkStarted();
- return notifyService;
+ return notifyServiceProvider.getNotifyService();
}
public static IAtsUserService getUserService() throws OseeStateException {
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogFactory.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogFactory.java
index 3d8ab74bf0..264396f0f2 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogFactory.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogFactory.java
@@ -13,12 +13,14 @@ package org.eclipse.osee.ats.core.internal.log;
import java.util.Date;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogFactory;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
import org.eclipse.osee.ats.api.workflow.log.LogType;
-import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.workflow.log.AtsLogStoreProvider;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
/**
@@ -32,9 +34,9 @@ public class AtsLogFactory implements IAtsLogFactory {
}
@Override
- public IAtsLog getLogLoaded(IAtsWorkItem workItem) {
+ public IAtsLog getLogLoaded(IAtsWorkItem workItem, IAttributeResolver attrResolver) {
IAtsLog log = getLog();
- AtsLogReader reader = new AtsLogReader(log, AtsCore.getWorkItemService().getLogStorageProvider(workItem));
+ AtsLogReader reader = new AtsLogReader(log, getLogProvider(workItem, attrResolver));
reader.load();
return log;
}
@@ -45,11 +47,15 @@ public class AtsLogFactory implements IAtsLogFactory {
}
@Override
- public void writeToStore(IAtsWorkItem workItem) {
- ILogStorageProvider storageProvider = AtsCore.getWorkItemService().getLogStorageProvider(workItem);
- AtsLogWriter writer = new AtsLogWriter(workItem.getLog(), storageProvider);
- writer.save();
- getLogLoaded(workItem);
+ public void writeToStore(IAtsWorkItem workItem, IAttributeResolver attrResolver, IAtsChangeSet changes) {
+ AtsLogWriter writer = new AtsLogWriter(workItem.getLog(), getLogProvider(workItem, attrResolver));
+ writer.save(changes);
+ getLogLoaded(workItem, attrResolver);
+ }
+
+ @Override
+ public ILogStorageProvider getLogProvider(IAtsWorkItem workItem, IAttributeResolver attrResolver) {
+ return new AtsLogStoreProvider(workItem, attrResolver);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogHtml.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogHtml.java
index 883a9e39da..a0435712b9 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogHtml.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogHtml.java
@@ -15,6 +15,7 @@ import java.util.List;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
@@ -64,7 +65,7 @@ public class AtsLogHtml {
private String getUserName(String userId) {
String name = userId;
if (storeProvider != null) {
- String userName = storeProvider.getNameFromUserId(userId);
+ String userName = AtsCore.getUserService().getUserById(userId).getName();
if (Strings.isValid(userName)) {
name = userName;
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogWriter.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogWriter.java
index 97eb9006a1..f3b7cc8e69 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogWriter.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/log/AtsLogWriter.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.internal.log;
import java.util.regex.Pattern;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
@@ -39,7 +40,7 @@ public class AtsLogWriter {
this.storageProvider = storageProvider;
}
- public void save() {
+ public void save(IAtsChangeSet changes) {
try {
Document doc = Jaxp.newDocumentNamespaceAware();
Element rootElement = doc.createElement(ATS_LOG_TAG);
@@ -53,7 +54,7 @@ public class AtsLogWriter {
element.setAttribute("msg", item.getMsg());
rootElement.appendChild(element);
}
- storageProvider.saveLogXml(Jaxp.getDocumentXml(doc));
+ storageProvider.saveLogXml(Jaxp.getDocumentXml(doc), changes);
} catch (Exception ex) {
OseeLog.log(AtsCore.class, OseeLevel.SEVERE_POPUP, "Can't create ats log document", ex);
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
index 342a866cf4..1183370a7d 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManager.java
@@ -605,6 +605,7 @@ public class StateManager implements IAtsStateManager {
@Override
public void setPercentCompleteValue(Integer percentComplete) {
this.percentCompleteValue = percentComplete;
+ setDirty(true);
}
@Override
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManagerWriter.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManagerWriter.java
index 5cbe31f90d..553e45fd72 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManagerWriter.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/internal/state/StateManagerWriter.java
@@ -42,20 +42,19 @@ public class StateManagerWriter {
String currentStateName = stateMgr.getCurrentStateName();
attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.CurrentState,
- AtsWorkStateFactory.toXml(stateMgr, currentStateName));
+ AtsWorkStateFactory.toXml(stateMgr, currentStateName), changes);
removeCurrentStateAttributeIfExists(currentStateName, changes);
writeStatesToStore(changes);
StateType stateType = workItem.getWorkDefinition().getStateByName(currentStateName).getStateType();
- attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.CurrentStateType, stateType.name());
- if (stateMgr.getPercentCompleteValue() != null) {
- attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.PercentComplete,
- stateMgr.getPercentCompleteValue());
- } else {
- attrResolver.deleteSoleAttribute(workItem, AtsAttributeTypes.PercentComplete);
+ attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.CurrentStateType, stateType.name(), changes);
+ Integer percentCompleteValue = stateMgr.getPercentCompleteValue();
+ if (percentCompleteValue == null) {
+ percentCompleteValue = 0;
}
+ attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.PercentComplete, percentCompleteValue, changes);
}
private void writeStatesToStore(IAtsChangeSet changes) throws OseeCoreException {
@@ -65,7 +64,7 @@ public class StateManagerWriter {
// Else, doesn't exist yet, create
if (!updated) {
attrResolver.addAttribute(workItem, AtsAttributeTypes.State,
- AtsWorkStateFactory.toXml(workItem.getStateMgr(), stateName));
+ AtsWorkStateFactory.toXml(workItem.getStateMgr(), stateName), changes);
}
}
}
@@ -76,7 +75,7 @@ public class StateManagerWriter {
for (IAttribute<String> attr : attrs) {
WorkStateImpl storedState = AtsWorkStateFactory.getFromXml(attr.getValue());
if (stateName.equals(storedState.getName())) {
- attrResolver.deleteAttribute(workItem, attr);
+ attrResolver.deleteAttribute(workItem, attr, changes);
}
}
}
@@ -88,7 +87,7 @@ public class StateManagerWriter {
WorkStateImpl storedState = AtsWorkStateFactory.getFromXml(attr.getValue());
if (stateName.equals(storedState.getName())) {
attrResolver.setValue(workItem, attr, AtsAttributeTypes.State,
- AtsWorkStateFactory.toXml(workItem.getStateMgr(), stateName));
+ AtsWorkStateFactory.toXml(workItem.getStateMgr(), stateName), changes);
return true;
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
index c34eec3953..91c805fe28 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/model/impl/AtsObject.java
@@ -79,4 +79,9 @@ public class AtsObject extends FullyNamedIdentity<String> implements IAtsObject
return true;
}
+ @Override
+ public Object getStoreObject() {
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
index 4ed5205996..65608a1215 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/users/AbstractAtsUser.java
@@ -118,4 +118,9 @@ public abstract class AbstractAtsUser implements IAtsUser {
return String.format("[%s][%s]", getName(), getGuid());
}
+ @Override
+ public Object getStoreObject() {
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ArtifactIdWrapper.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ArtifactIdWrapper.java
new file mode 100644
index 0000000000..2803503c6b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/ArtifactIdWrapper.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.util;
+
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.orcs.data.ArtifactId;
+
+/**
+ * @author Donald G Dunne
+ */
+public class ArtifactIdWrapper implements ArtifactId {
+
+ private final IAtsObject atsObject;
+
+ public ArtifactIdWrapper(IAtsObject atsObject) {
+ this.atsObject = atsObject;
+ }
+
+ @Override
+ public String getGuid() {
+ return atsObject.getGuid();
+ }
+
+ @Override
+ public boolean matches(Identity<?>... identities) {
+ return atsObject.matches(identities);
+ }
+
+ @Override
+ public String getName() {
+ return atsObject.getName();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
index 6d4f6d7c6e..1728b1a19e 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AtsUtilCore.java
@@ -10,6 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.ats.core.util;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.orcs.data.ArtifactId;
+import org.eclipse.osee.orcs.data.AttributeId;
/**
* @author Donald G. Dunne
@@ -18,6 +24,10 @@ public class AtsUtilCore {
public final static double DEFAULT_HOURS_PER_WORK_DAY = 8;
+ public IOseeBranch getAtsBranchToken() {
+ return CoreBranches.COMMON;
+ }
+
public static boolean isInTest() {
return Boolean.valueOf(System.getProperty("osee.isInTest"));
}
@@ -38,4 +48,11 @@ public class AtsUtilCore {
}
}
+ public static ArtifactId toArtifactId(IAtsWorkItem workItem) {
+ return new ArtifactIdWrapper(workItem);
+ }
+
+ public static AttributeId toAttributeId(IAttribute<?> attr) {
+ return new AttributeIdWrapper(attr);
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AttributeIdWrapper.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AttributeIdWrapper.java
new file mode 100644
index 0000000000..ba422e3c6b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/AttributeIdWrapper.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.util;
+
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.orcs.data.AttributeId;
+
+/**
+ * @author Donald G Dunne
+ */
+public class AttributeIdWrapper implements AttributeId {
+
+ private final IAttribute<?> attribute;
+
+ public AttributeIdWrapper(IAttribute<?> attribute) {
+ this.attribute = attribute;
+ }
+
+ @Override
+ public int getLocalId() {
+ return attribute.getId();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/CacheProvider.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/CacheProvider.java
index 7b4dab0cb7..54f0de0b00 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/CacheProvider.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/util/CacheProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.internal;
+package org.eclipse.osee.ats.core.util;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImpl.java
index b36eb0aca6..7fade0d763 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionAdminImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionAdminImpl.java
@@ -8,7 +8,7 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.internal.workdef;
+package org.eclipse.osee.ats.core.workdef;
import java.util.Collection;
import java.util.List;
@@ -19,6 +19,8 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
@@ -30,11 +32,8 @@ import org.eclipse.osee.ats.api.workflow.IAtsGoal;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
-import org.eclipse.osee.ats.core.client.internal.Activator;
-import org.eclipse.osee.ats.core.client.internal.CacheProvider;
-import org.eclipse.osee.ats.core.client.team.ITeamWorkflowProviders;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
-import org.eclipse.osee.ats.core.workdef.WorkDefinitionMatch;
+import org.eclipse.osee.ats.core.internal.Activator;
+import org.eclipse.osee.ats.core.util.CacheProvider;
import org.eclipse.osee.framework.core.exception.MultipleAttributesExist;
import org.eclipse.osee.framework.core.util.Conditions;
import org.eclipse.osee.framework.core.util.XResultData;
@@ -48,9 +47,9 @@ import org.eclipse.osee.framework.logging.OseeLog;
public class AtsWorkDefinitionAdminImpl implements IAtsWorkDefinitionAdmin {
private final CacheProvider<AtsWorkDefinitionCache> cacheProvider;
- private final IAtsWorkItemService workItemService;
private final IAtsWorkDefinitionService workDefinitionService;
private final ITeamWorkflowProviders teamWorkflowProviders;
+ private final IAtsWorkItemService workItemService;
private final IAttributeResolver attributeResolver;
public AtsWorkDefinitionAdminImpl(CacheProvider<AtsWorkDefinitionCache> workDefCacheProvider, IAtsWorkItemService workItemService, IAtsWorkDefinitionService workDefinitionService, ITeamWorkflowProviders teamWorkflowProviders, IAttributeResolver attributeResolver) {
@@ -347,9 +346,8 @@ public class AtsWorkDefinitionAdminImpl implements IAtsWorkDefinitionAdmin {
@Override
public IWorkDefinitionMatch getWorkDefinitionForPeerToPeerReviewNotYetCreatedAndStandalone(IAtsActionableItem actionableItem) throws OseeCoreException {
Conditions.notNull(actionableItem, AtsWorkDefinitionAdminImpl.class.getSimpleName());
- IWorkDefinitionMatch match = new WorkDefinitionMatch();
- IAtsTeamDefinition teamDefinitionInherited = actionableItem.getTeamDefinitionInherited();
- match = getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(teamDefinitionInherited);
+ IWorkDefinitionMatch match =
+ getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(actionableItem.getTeamDefinitionInherited());
if (!match.isMatched()) {
match = getDefaultPeerToPeerWorkflowDefinitionMatch();
}
@@ -360,7 +358,7 @@ public class AtsWorkDefinitionAdminImpl implements IAtsWorkDefinitionAdmin {
* @return WorkDefinitionMatch of teamDefinition configured with RelatedPeerWorkflowDefinition attribute with recurse
* up to top teamDefinition or will return no match
*/
- protected IWorkDefinitionMatch getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(IAtsTeamDefinition teamDefinition) throws OseeCoreException {
+ public IWorkDefinitionMatch getPeerToPeerWorkDefinitionFromTeamDefinitionAttributeValueRecurse(IAtsTeamDefinition teamDefinition) throws OseeCoreException {
Conditions.notNull(teamDefinition, AtsWorkDefinitionAdminImpl.class.getSimpleName());
IWorkDefinitionMatch match = new WorkDefinitionMatch();
String workDefId = teamDefinition.getRelatedPeerWorkDefinition();
@@ -420,5 +418,4 @@ public class AtsWorkDefinitionAdminImpl implements IAtsWorkDefinitionAdmin {
public Collection<String> getAllValidStateNames() {
return workDefinitionService.getAllValidStateNames();
}
-
}
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCache.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionCache.java
index 3604a7ad8a..9da03bf5fe 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/workdef/AtsWorkDefinitionCache.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workdef/AtsWorkDefinitionCache.java
@@ -8,14 +8,13 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.ats.core.client.internal.workdef;
+package org.eclipse.osee.ats.core.workdef;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
-import org.eclipse.osee.ats.core.workdef.WorkDefinitionMatch;
/**
* @author Donald G. Dunne
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/WorkflowManagerCore.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/WorkflowManagerCore.java
index 2abc3ff7e7..731bea80b2 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/WorkflowManagerCore.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/WorkflowManagerCore.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.core.workflow;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.RuleDefinitionOption;
import org.eclipse.osee.ats.core.AtsCore;
@@ -22,12 +23,13 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
public class WorkflowManagerCore {
public static boolean isEditable(IAtsWorkItem workItem, IAtsStateDefinition stateDef, boolean privilegedEditEnabled) throws OseeCoreException {
- // must be writeable
- return !AtsCore.getWorkItemService().isReadOnly(workItem) &&
- // and access control writeable
- AtsCore.getWorkItemService().isAccessControlWrite(workItem) &&
- // and current state
- (stateDef == null || AtsCore.getWorkDefService().isInState(workItem, stateDef)) &&
+ return isEditable(workItem, stateDef, privilegedEditEnabled, AtsCore.getUserService().getCurrentUser(),
+ AtsCore.getUserService().isAtsAdmin());
+ }
+
+ public static boolean isEditable(IAtsWorkItem workItem, IAtsStateDefinition stateDef, boolean privilegedEditEnabled, IAtsUser currentUser, boolean isAtsAdmin) throws OseeCoreException {
+ // must be current state
+ return (stateDef == null || AtsCore.getWorkDefService().isInState(workItem, stateDef)) &&
// and one of these
//
// page is define to allow anyone to edit
@@ -37,9 +39,9 @@ public class WorkflowManagerCore {
// privileged edit mode is on
privilegedEditEnabled ||
// current user is assigned
- AtsCore.getUserService().isAssigneeMe(workItem) ||
+ workItem.getStateMgr().getAssignees().contains(currentUser) ||
// current user is ats admin
- AtsCore.getUserService().isAtsAdmin());
+ isAtsAdmin);
}
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/log/AtsLogStoreProvider.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/log/AtsLogStoreProvider.java
new file mode 100644
index 0000000000..b49663340b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/log/AtsLogStoreProvider.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.core.workflow.log;
+
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workflow.log.ILogStorageProvider;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsLogStoreProvider implements ILogStorageProvider {
+
+ private final IAttributeResolver attrResolver;
+ private final IAtsWorkItem workItem;
+
+ public AtsLogStoreProvider(IAtsWorkItem workItem, IAttributeResolver attrResolver) {
+ this.workItem = workItem;
+ this.attrResolver = attrResolver;
+ }
+
+ @Override
+ public String getLogXml() {
+ try {
+ return attrResolver.getSoleAttributeValue(workItem, AtsAttributeTypes.Log, "");
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ return "getLogXml exception " + ex.getLocalizedMessage();
+ }
+ }
+
+ @Override
+ public IStatus saveLogXml(String xml, IAtsChangeSet changes) {
+ try {
+ attrResolver.setSoleAttributeValue(workItem, AtsAttributeTypes.Log, xml, changes);
+ return Status.OK_STATUS;
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ return new Status(IStatus.ERROR, AtsCore.PLUGIN_ID, "saveLogXml exception " + ex.getLocalizedMessage());
+ }
+ }
+
+ @Override
+ public String getLogTitle() {
+ try {
+ return "History for \"" + workItem.getWorkData().getArtifactTypeName() + "\" - " + getLogId() + " - titled \"" + workItem.getName() + "\"";
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ return "getLogTitle exception " + ex.getLocalizedMessage();
+ }
+ }
+
+ @Override
+ public String getLogId() {
+ return workItem.getAtsId();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/state/StateManagerUtility.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/state/StateManagerUtility.java
index 466af81ffd..85c203a137 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/state/StateManagerUtility.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/state/StateManagerUtility.java
@@ -14,10 +14,13 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
+import java.util.logging.Level;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.util.IExecuteListener;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
import org.eclipse.osee.ats.api.workdef.IStateToken;
@@ -25,16 +28,23 @@ import org.eclipse.osee.ats.api.workflow.IAttribute;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.LogType;
import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.internal.state.StateManager;
+import org.eclipse.osee.ats.core.internal.state.StateManagerReader;
+import org.eclipse.osee.ats.core.internal.state.StateManagerWriter;
import org.eclipse.osee.ats.core.model.impl.WorkStateImpl;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.DateUtil;
+import org.eclipse.osee.framework.logging.OseeLog;
/**
* @author Donald G Dunne
*/
public class StateManagerUtility {
+ private static IExecuteListener postPersistExecutionListener;
+
/**
* Initializes state machine and sets the current state to stateName
*/
@@ -86,6 +96,46 @@ public class StateManagerUtility {
return Result.FalseResult;
}
+ public static void writeToStore(IAtsWorkItem workItem, IAtsStateManager stateMgr, IAttributeResolver attrResolver, IAtsChangeSet changes) throws OseeCoreException {
+ StateManagerWriter writer = new StateManagerWriter(workItem, (StateManager) stateMgr, attrResolver, changes);
+ writer.writeToStore();
+ changes.addExecuteListener(getPostPersistExecutionListener(attrResolver));
+ }
+
+ public static void postPersistNotifyReset(IAtsWorkItem workItem, IAtsStateManager stateMgr, IAttributeResolver attrResolver) throws OseeCoreException {
+ AtsCore.getNotifyService().notify(workItem, stateMgr.getAssigneesAdded(), AtsNotifyType.Assigned);
+ load(workItem, stateMgr, attrResolver);
+ }
+
+ public static void load(IAtsWorkItem workItem, IAtsStateManager stateMgr, IAttributeResolver attrResolver) throws OseeCoreException {
+ StateManager stateManager = (StateManager) stateMgr;
+ stateManager.clear();
+ StateManagerReader reader = new StateManagerReader(workItem, stateManager, attrResolver);
+ reader.load();
+ }
+
+ public static IExecuteListener getPostPersistExecutionListener(final IAttributeResolver attrResolver) {
+ if (postPersistExecutionListener == null) {
+ postPersistExecutionListener = new IExecuteListener() {
+
+ @Override
+ public void changesStored(IAtsChangeSet changes) {
+ for (Object obj : changes.getObjects()) {
+ if (obj instanceof IAtsWorkItem) {
+ try {
+ StateManagerUtility.postPersistNotifyReset((IAtsWorkItem) obj,
+ ((IAtsWorkItem) obj).getStateMgr(), attrResolver);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsCore.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ }
+ };
+ }
+ return postPersistExecutionListener;
+ }
+
public static String getCompletedDateByState(IAtsWorkItem workItem, IAtsStateDefinition state) throws OseeCoreException {
IAtsLogItem stateEvent = workItem.getLog().getStateEvent(LogType.StateComplete, state.getName());
if (stateEvent != null && stateEvent.getDate() != null) {
@@ -93,5 +143,4 @@ public class StateManagerUtility {
}
return "";
}
-
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java
index be863af9ec..c811d65371 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelper.java
@@ -38,7 +38,7 @@ public class TransitionHelper extends TransitionHelperAdapter {
private final Collection<? extends IAtsUser> toAssignees;
private String toStateName;
private final IAtsChangeSet changes;
- private boolean executeChanges;
+ private boolean executeChanges = false;
public TransitionHelper(String name, Collection<? extends IAtsWorkItem> awas, String toStateName, Collection<? extends IAtsUser> toAssignees, String cancellationReason, IAtsChangeSet changes, TransitionOption... transitionOption) {
this.name = name;
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java
index bbfe9a9ca7..6bb857f246 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionHelperAdapter.java
@@ -11,16 +11,19 @@
package org.eclipse.osee.ats.core.workflow.transition;
import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
/**
* @author Donald G. Dunne
*/
public abstract class TransitionHelperAdapter implements ITransitionHelper {
+ IAtsUser transitionUser;
@Override
public boolean isPrivilegedEditEnabled() {
@@ -49,7 +52,7 @@ public abstract class TransitionHelperAdapter implements ITransitionHelper {
@Override
public boolean isSystemUser() throws OseeCoreException {
- return AtsCoreUsers.isAtsCoreUser(AtsCore.getUserService().getCurrentUser());
+ return AtsCoreUsers.isAtsCoreUser(getTransitionUser());
}
@Override
@@ -63,4 +66,18 @@ public abstract class TransitionHelperAdapter implements ITransitionHelper {
return false;
}
+ @Override
+ public IAtsUser getTransitionUser() throws OseeStateException, OseeCoreException {
+ IAtsUser user = transitionUser;
+ if (user == null) {
+ user = AtsCore.getUserService().getCurrentUser();
+ }
+ return user;
+ }
+
+ @Override
+ public void setTransitionUser(IAtsUser user) throws OseeCoreException {
+ transitionUser = user;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
index 633d653ac5..548924cda1 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/workflow/transition/TransitionManager.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
@@ -30,6 +31,7 @@ import org.eclipse.osee.ats.api.workdef.WidgetResult;
import org.eclipse.osee.ats.api.workflow.IAtsTask;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionHelper;
import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
import org.eclipse.osee.ats.api.workflow.transition.TransitionResult;
@@ -126,7 +128,8 @@ public class TransitionManager {
// Validate Editable
boolean stateIsEditable =
WorkflowManagerCore.isEditable(workItem, workItem.getStateDefinition(),
- helper.isPrivilegedEditEnabled());
+ helper.isPrivilegedEditEnabled(), helper.getTransitionUser(),
+ AtsCore.getUserService().isAtsAdmin());
boolean currentlyUnAssigned =
workItem.getStateMgr().getAssignees().contains(AtsCoreUsers.UNASSIGNED_USER);
workItem.getStateMgr().validateNoBootstrapUser();
@@ -254,16 +257,16 @@ public class TransitionManager {
IAtsUser transitionUser = getTransitionAsUser();
// Log transition
if (fromState.getStateType().isCancelledState()) {
- logWorkflowUnCancelledEvent(workItem, toState);
+ logWorkflowUnCancelledEvent(workItem, toState, helper.getChangeSet());
} else if (fromState.getStateType().isCompletedState()) {
- logWorkflowUnCompletedEvent(workItem, toState);
+ logWorkflowUnCompletedEvent(workItem, toState, helper.getChangeSet());
}
if (toState.getStateType().isCancelledState()) {
logWorkflowCancelledEvent(workItem, fromState, toState, completedCancellationReason,
- transitionDate, transitionUser);
+ transitionDate, transitionUser, helper.getChangeSet());
} else if (toState.getStateType().isCompletedState()) {
logWorkflowCompletedEvent(workItem, fromState, toState, completedCancellationReason,
- transitionDate, transitionUser);
+ transitionDate, transitionUser, helper.getChangeSet());
} else {
logStateCompletedEvent(workItem, workItem.getStateMgr().getCurrentStateName(),
completedCancellationReason, transitionDate, transitionUser);
@@ -286,9 +289,6 @@ public class TransitionManager {
}
}
- AtsCore.getWorkItemService().transitioned(workItem, fromState, toState, updatedAssigees,
- helper.getChangeSet());
-
// Notify extension points of transition
for (ITransitionListener listener : helper.getTransitionListeners()) {
listener.transitioned(workItem, fromState, toState, updatedAssigees, helper.getChangeSet());
@@ -304,7 +304,7 @@ public class TransitionManager {
new TransitionResult(String.format("Exception while transitioning [%s]", helper.getName()), ex));
}
}
- if (results.isEmpty()) {
+ if (results.isEmpty() && helper.isExecuteChanges()) {
helper.getChangeSet().execute();
}
} catch (Exception ex) {
@@ -414,74 +414,73 @@ public class TransitionManager {
}
}
- public static void logWorkflowCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
+ public static void logWorkflowCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy, IAtsChangeSet changes) throws OseeCoreException {
workItem.getLog().addLog(LogType.StateCancelled, fromState.getName(), reason, cancelDate, cancelBy.getUserId());
if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
- AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledBy, cancelBy.getUserId());
- AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledDate, cancelDate);
- AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledReason, reason);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledBy, cancelBy.getUserId(),
+ changes);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledDate, cancelDate, changes);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledReason, reason, changes);
AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CancelledFromState,
- fromState.getName());
+ fromState.getName(), changes);
}
- validateUpdatePercentComplete(workItem, toState);
- AtsCore.getLogFactory().writeToStore(workItem);
+ validateUpdatePercentComplete(workItem, toState, changes);
}
- public static void logWorkflowUnCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ public static void logWorkflowUnCancelledEvent(IAtsWorkItem workItem, IAtsStateDefinition toState, IAtsChangeSet changes) throws OseeCoreException {
if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledBy);
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledDate);
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledReason);
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledFromState);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledBy, changes);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledDate, changes);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledReason, changes);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CancelledFromState, changes);
}
- validateUpdatePercentComplete(workItem, toState);
- AtsCore.getLogFactory().writeToStore(workItem);
+ validateUpdatePercentComplete(workItem, toState, changes);
}
- private void logWorkflowCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy) throws OseeCoreException {
+ private void logWorkflowCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition fromState, IAtsStateDefinition toState, String reason, Date cancelDate, IAtsUser cancelBy, IAtsChangeSet changes) throws OseeCoreException {
workItem.getLog().addLog(LogType.StateComplete, fromState.getName(), Strings.isValid(reason) ? reason : "",
cancelDate, cancelBy.getUserId());
if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
- AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedBy, cancelBy.getUserId());
- AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedDate, cancelDate);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedBy, cancelBy.getUserId(),
+ changes);
+ AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedDate, cancelDate, changes);
AtsCore.getAttrResolver().setSoleAttributeValue(workItem, AtsAttributeTypes.CompletedFromState,
- fromState.getName());
+ fromState.getName(), changes);
}
- validateUpdatePercentComplete(workItem, toState);
- AtsCore.getLogFactory().writeToStore(workItem);
+ validateUpdatePercentComplete(workItem, toState, changes);
}
- public static void logWorkflowUnCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition toState) throws OseeCoreException {
+ public static void logWorkflowUnCompletedEvent(IAtsWorkItem workItem, IAtsStateDefinition toState, IAtsChangeSet changes) throws OseeCoreException {
if (AtsCore.getAttrResolver().isAttributeTypeValid(workItem, AtsAttributeTypes.CreatedBy)) {
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedBy);
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedDate);
- AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedFromState);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedBy, changes);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedDate, changes);
+ AtsCore.getAttrResolver().deleteSoleAttribute(workItem, AtsAttributeTypes.CompletedFromState, changes);
}
- validateUpdatePercentComplete(workItem, toState);
- AtsCore.getLogFactory().writeToStore(workItem);
+ validateUpdatePercentComplete(workItem, toState, changes);
}
- private static void validateUpdatePercentComplete(IAtsWorkItem workItem, IAtsStateDefinition toState) {
- Integer percent = workItem.getStateMgr().getPercentCompleteValue();
+ private static void validateUpdatePercentComplete(IAtsWorkItem workItem, IAtsStateDefinition toState, IAtsChangeSet changes) {
+ IAtsStateManager stateMgr = workItem.getStateMgr();
+ Integer percent = stateMgr.getPercentCompleteValue();
if (percent == null) {
percent = 0;
}
if (toState.getStateType().isCompletedOrCancelledState() && percent != 100) {
- workItem.getStateMgr().setPercentCompleteValue(100);
+ stateMgr.setPercentCompleteValue(100);
+ changes.add(workItem);
} else if (toState.getStateType().isWorkingState() && percent == 100) {
- workItem.getStateMgr().setPercentCompleteValue(0);
+ stateMgr.setPercentCompleteValue(0);
+ changes.add(workItem);
}
}
private void logStateCompletedEvent(IAtsWorkItem workItem, String fromStateName, String reason, Date date, IAtsUser user) throws OseeCoreException {
workItem.getLog().addLog(LogType.StateComplete, fromStateName, Strings.isValid(reason) ? reason : "", date,
user.getUserId());
- AtsCore.getLogFactory().writeToStore(workItem);
}
public static void logStateStartedEvent(IAtsWorkItem workItem, IStateToken state, Date date, IAtsUser user) throws OseeCoreException {
workItem.getLog().addLog(LogType.StateEntered, state.getName(), "", date, user.getUserId());
- AtsCore.getLogFactory().writeToStore(workItem);
}
/**
diff --git a/plugins/org.eclipse.osee.ats.dsl/pom.xml b/plugins/org.eclipse.osee.ats.dsl/pom.xml
index defb6dff44..d119a7d335 100644
--- a/plugins/org.eclipse.osee.ats.dsl/pom.xml
+++ b/plugins/org.eclipse.osee.ats.dsl/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.server.parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.server.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.dsl</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.impl.test/pom.xml b/plugins/org.eclipse.osee.ats.impl.test/pom.xml
index 434c4664c8..95f0b618b0 100644
--- a/plugins/org.eclipse.osee.ats.impl.test/pom.xml
+++ b/plugins/org.eclipse.osee.ats.impl.test/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.server.parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.server.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.impl.test</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.impl/pom.xml b/plugins/org.eclipse.osee.ats.impl/pom.xml
index 13093d4e7c..41deabb7cb 100644
--- a/plugins/org.eclipse.osee.ats.impl/pom.xml
+++ b/plugins/org.eclipse.osee.ats.impl/pom.xml
@@ -5,9 +5,9 @@
<parent>
<groupId>org.eclipse.osee</groupId>
- <artifactId>org.eclipse.osee.ats.parent</artifactId>
+ <artifactId>org.eclipse.osee.x.server.parent</artifactId>
<version>0.16.0-SNAPSHOT</version>
- <relativePath>../../plugins/org.eclipse.osee.ats.parent</relativePath>
+ <relativePath>../../plugins/org.eclipse.osee.x.server.parent</relativePath>
</parent>
<artifactId>org.eclipse.osee.ats.impl</artifactId>
diff --git a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsWorkDefinitionServiceImpl.java b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsWorkDefinitionServiceImpl.java
index 30f814b35f..2f3a69d592 100644
--- a/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsWorkDefinitionServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.impl/src/org/eclipse/osee/ats/impl/internal/AtsWorkDefinitionServiceImpl.java
@@ -73,6 +73,7 @@ public class AtsWorkDefinitionServiceImpl implements IAtsWorkDefinitionService {
Conditions.checkNotNull(workDefStore, "IAtsWorkDefinitionStore");
Conditions.checkNotNull(attrResolver, "IAttributeResolver");
Conditions.checkNotNull(userService, "IAtsWorkDefinitionStore");
+ System.out.println("ATS - AtsWorkDefinitionServiceImpl started");
}
public void stop() {
diff --git a/plugins/org.eclipse.osee.ats.parent/pom.xml b/plugins/org.eclipse.osee.ats.parent/pom.xml
index 0845a3f1a2..986cc974e4 100644
--- a/plugins/org.eclipse.osee.ats.parent/pom.xml
+++ b/plugins/org.eclipse.osee.ats.parent/pom.xml
@@ -22,14 +22,9 @@
<module>../../plugins/org.eclipse.osee.ats.mocks</module>
<module>../../plugins/org.eclipse.osee.ats.help.ui</module>
<module>../../plugins/org.eclipse.osee.ats</module>
- <module>../../plugins/org.eclipse.osee.ats.core</module>
- <module>../../plugins/org.eclipse.osee.ats.core.test</module>
<module>../../plugins/org.eclipse.osee.ats.core.client</module>
<module>../../plugins/org.eclipse.osee.ats.core.client.test</module>
- <module>../../plugins/org.eclipse.osee.ats.dsl</module>
<module>../../plugins/org.eclipse.osee.ats.dsl.ui</module>
- <module>../../plugins/org.eclipse.osee.ats.impl</module>
- <module>../../plugins/org.eclipse.osee.ats.impl.test</module>
<module>../../plugins/org.eclipse.osee.ats.reports</module>
<module>../../plugins/org.eclipse.osee.ats.reports.burndown</module>
diff --git a/plugins/org.eclipse.osee.ats.reports.burndown/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.reports.burndown/META-INF/MANIFEST.MF
index c93b204440..9163581b04 100644
--- a/plugins/org.eclipse.osee.ats.reports.burndown/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.reports.burndown/META-INF/MANIFEST.MF
@@ -21,7 +21,6 @@ Import-Package: org.eclipse.core.runtime,
org.eclipse.osee.ats.core.client.config,
org.eclipse.osee.ats.core.client.team,
org.eclipse.osee.ats.core.client.workflow,
- org.eclipse.osee.ats.core.client.workflow.log,
org.eclipse.osee.ats.core.config,
org.eclipse.osee.ats.reports,
org.eclipse.osee.framework.core.data,
diff --git a/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
index 8bc9aeff72..66ec29914a 100644
--- a/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats.rest/META-INF/MANIFEST.MF
@@ -12,16 +12,45 @@ Import-Package: com.google.common.cache;version="[11.0,15)",
com.lowagie.text.rtf.table;version="2.1.7",
javax.ws.rs,
javax.ws.rs.core,
+ javax.ws.rs.ext;version="1.1.1",
+ org.apache.commons.lang,
org.eclipse.core.runtime,
+ org.eclipse.osee.ats.api,
+ org.eclipse.osee.ats.api.ai,
+ org.eclipse.osee.ats.api.commit,
org.eclipse.osee.ats.api.data,
+ org.eclipse.osee.ats.api.notify,
+ org.eclipse.osee.ats.api.review,
+ org.eclipse.osee.ats.api.team,
+ org.eclipse.osee.ats.api.user,
+ org.eclipse.osee.ats.api.util,
+ org.eclipse.osee.ats.api.version,
+ org.eclipse.osee.ats.api.workdef,
+ org.eclipse.osee.ats.api.workflow,
+ org.eclipse.osee.ats.api.workflow.log,
+ org.eclipse.osee.ats.api.workflow.state,
+ org.eclipse.osee.ats.api.workflow.transition,
+ org.eclipse.osee.ats.core,
+ org.eclipse.osee.ats.core.config,
+ org.eclipse.osee.ats.core.model.impl,
+ org.eclipse.osee.ats.core.util,
+ org.eclipse.osee.ats.core.workdef,
+ org.eclipse.osee.ats.core.workflow.log,
+ org.eclipse.osee.ats.core.workflow.state,
+ org.eclipse.osee.ats.core.workflow.transition,
org.eclipse.osee.framework.core.data,
org.eclipse.osee.framework.core.enums,
org.eclipse.osee.framework.core.exception,
+ org.eclipse.osee.framework.core.model,
+ org.eclipse.osee.framework.core.model.cache,
org.eclipse.osee.framework.core.server,
org.eclipse.osee.framework.core.util,
org.eclipse.osee.framework.jdk.core.type,
org.eclipse.osee.framework.jdk.core.util,
+ org.eclipse.osee.framework.logging,
org.eclipse.osee.logger,
org.eclipse.osee.orcs,
org.eclipse.osee.orcs.data,
- org.eclipse.osee.orcs.search
+ org.eclipse.osee.orcs.search,
+ org.eclipse.osee.orcs.transaction,
+ org.eclipse.osee.template.engine
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.attribute.resolver.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.attribute.resolver.xml
new file mode 100644
index 0000000000..2be3f798b8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.attribute.resolver.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ats.rest.internal.util.AtsAttributeResolverServiceImpl">
+ <implementation class="org.eclipse.osee.ats.rest.internal.util.AtsAttributeResolverServiceImpl"/>
+ <service>
+ <provide interface="org.eclipse.osee.ats.api.workdef.IAttributeResolver"/>
+ </service>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.server.service.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.server.service.xml
new file mode 100644
index 0000000000..1428f2f12c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.server.service.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ats.rest.internal.AtsServerImpl">
+ <implementation class="org.eclipse.osee.ats.rest.internal.AtsServerImpl"/>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+ <reference bind="setWorkDefService" cardinality="1..1" interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService" name="IAtsWorkDefinitionService" policy="static"/>
+ <reference bind="setUserService" cardinality="1..1" interface="org.eclipse.osee.ats.api.user.IAtsUserService" name="IAtsUserService" policy="static"/>
+ <service>
+ <provide interface="org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider"/>
+ <provide interface="org.eclipse.osee.ats.core.config.IAtsConfigProvider"/>
+ </service>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.user.service.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.user.service.xml
new file mode 100644
index 0000000000..4df610aadc
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.user.service.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" name="org.eclipse.osee.ats.rest.internal.user.AtsUserServiceImpl">
+ <implementation class="org.eclipse.osee.ats.rest.internal.user.AtsUserServiceImpl"/>
+ <service>
+ <provide interface="org.eclipse.osee.ats.api.user.IAtsUserService"/>
+ </service>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.workdef.store.service.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.workdef.store.service.xml
new file mode 100644
index 0000000000..dc0b4c9484
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/ats.workdef.store.service.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.rest.internal.workdef.AtsWorkDefinitionStoreImpl">
+ <implementation class="org.eclipse.osee.ats.rest.internal.workdef.AtsWorkDefinitionStoreImpl"/>
+ <service>
+ <provide interface="org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionStore"/>
+ </service>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/OSGI-INF/atsui.rest.application.xml b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/atsui.rest.application.xml
new file mode 100644
index 0000000000..d778b32026
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/OSGI-INF/atsui.rest.application.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.osee.ats.rest.internal.AtsUiApplication">
+ <implementation class="org.eclipse.osee.ats.rest.internal.AtsUiApplication"/>
+ <service>
+ <provide interface="javax.ws.rs.core.Application"/>
+ </service>
+ <property name="context.name" type="String" value="atsui"/>
+ <reference bind="setOrcsApi" cardinality="1..1" interface="org.eclipse.osee.orcs.OrcsApi" name="OrcsApi" policy="static"/>
+ <reference bind="setLogger" cardinality="1..1" interface="org.eclipse.osee.logger.Log" name="Log" policy="static"/>
+</scr:component>
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
index fa5d5c5a95..858f75f7a9 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsApplication.java
@@ -13,11 +13,15 @@ package org.eclipse.osee.ats.rest.internal;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
+import org.eclipse.osee.ats.rest.internal.action.ActionResource;
+import org.eclipse.osee.ats.rest.internal.action.AtsResourceTokens;
import org.eclipse.osee.ats.rest.internal.build.report.resources.BuildTraceReportResource;
import org.eclipse.osee.ats.rest.internal.resources.ProgramResource;
import org.eclipse.osee.ats.rest.internal.resources.ProgramsResource;
+import org.eclipse.osee.ats.rest.internal.util.JaxRsExceptionMapper;
import org.eclipse.osee.logger.Log;
import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.template.engine.OseeTemplateTokens;
/**
* @author John Misinco
@@ -52,4 +56,13 @@ public class AtsApplication extends Application {
return classes;
}
+ @Override
+ public Set<Object> getSingletons() {
+ AtsResourceTokens.register(orcsApi.getResourceRegistry());
+ OseeTemplateTokens.register(orcsApi.getResourceRegistry());
+ Set<Object> singletons = new HashSet<Object>();
+ singletons.add(new JaxRsExceptionMapper(orcsApi.getResourceRegistry()));
+ singletons.add(new ActionResource(orcsApi));
+ return singletons;
+ }
}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
new file mode 100644
index 0000000000..ce7dfc9955
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsServerImpl.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal;
+
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
+import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
+import org.eclipse.osee.ats.api.user.IAtsUserService;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionAdmin;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.ats.core.config.IAtsConfig;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionAdminImpl;
+import org.eclipse.osee.ats.rest.internal.notify.AtsNotificationServiceImpl;
+import org.eclipse.osee.ats.rest.internal.util.AtsArtifactConfigCache;
+import org.eclipse.osee.ats.rest.internal.util.AtsAttributeResolverServiceImpl;
+import org.eclipse.osee.ats.rest.internal.util.AtsBranchServiceImpl;
+import org.eclipse.osee.ats.rest.internal.util.AtsReviewServiceImpl;
+import org.eclipse.osee.ats.rest.internal.util.AtsUtilRest;
+import org.eclipse.osee.ats.rest.internal.util.AtsWorkDefinitionCacheProvider;
+import org.eclipse.osee.ats.rest.internal.util.TeamWorkflowProvider;
+import org.eclipse.osee.ats.rest.internal.workitem.AtsWorkItemServiceImpl;
+import org.eclipse.osee.ats.rest.internal.workitem.WorkItemFactory;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.enums.SystemUser;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.search.QueryFactory;
+
+/**
+ * @author Donald G Dunne
+ */
+public class AtsServerImpl implements IAtsServer {
+
+ public static String PLUGIN_ID = "org.eclipse.osee.ats.rest";
+ private static OrcsApi orcsApi;
+ private static IAtsWorkItemFactory workItemFactory;
+ private static AtsServerImpl instance;
+ private static IAtsWorkDefinitionService workDefService;
+ private static IAtsUserService userService;
+ private static IAtsNotificationService notifyService;
+ private IAtsWorkItemService workItemService;
+ private IAtsBranchService branchService;
+ private IAtsReviewService reviewService;
+ private IAtsWorkDefinitionAdmin workDefAdmin;
+ private AtsWorkDefinitionCacheProvider workDefCacheProvider;
+ private TeamWorkflowProvider teamWorkflowProvider;
+ private AtsAttributeResolverServiceImpl attributeResolverService;
+ private IAtsConfig config;
+ private static Boolean started = null;
+
+ public static AtsServerImpl get() {
+ checkStarted();
+ return instance;
+ }
+
+ public void setOrcsApi(OrcsApi orcsApi) {
+ AtsServerImpl.orcsApi = orcsApi;
+ }
+
+ public static void setWorkDefService(IAtsWorkDefinitionService workDefService) {
+ AtsServerImpl.workDefService = workDefService;
+ }
+
+ public static void setUserService(IAtsUserService userService) {
+ AtsServerImpl.userService = userService;
+ }
+
+ public void start() throws OseeCoreException {
+ Conditions.checkNotNull(orcsApi, "OrcsApi");
+ Conditions.checkNotNull(workDefService, "IAtsWorkDefinitionService");
+ Conditions.checkNotNull(userService, "IAtsUserService");
+ instance = this;
+ workItemFactory = new WorkItemFactory();
+ notifyService = new AtsNotificationServiceImpl();
+
+ workItemService = new AtsWorkItemServiceImpl(workItemFactory, this);
+ branchService = new AtsBranchServiceImpl(orcsApi);
+ reviewService = new AtsReviewServiceImpl(this, workItemService);
+ workDefCacheProvider = new AtsWorkDefinitionCacheProvider(workDefService);
+
+ teamWorkflowProvider = new TeamWorkflowProvider();
+ attributeResolverService = new AtsAttributeResolverServiceImpl();
+ attributeResolverService.setOrcsApi(orcsApi);
+ workDefAdmin =
+ new AtsWorkDefinitionAdminImpl(workDefCacheProvider, workItemService, workDefService, teamWorkflowProvider,
+ attributeResolverService);
+
+ config = new AtsArtifactConfigCache(orcsApi);
+ System.out.println("ATS - AtsServerImpl started");
+ started = true;
+ }
+
+ private static void checkStarted() throws OseeStateException {
+ if (started == null) {
+ throw new OseeStateException("AtsServer did not start");
+ }
+ }
+
+ @Override
+ public OrcsApi getOrcsApi() throws OseeCoreException {
+ checkStarted();
+ return orcsApi;
+ }
+
+ @Override
+ public IAtsWorkItemFactory getWorkItemFactory() throws OseeCoreException {
+ checkStarted();
+ return workItemFactory;
+ }
+
+ @Override
+ public IAtsWorkDefinitionService getWorkDefService() throws OseeCoreException {
+ checkStarted();
+ return workDefService;
+ }
+
+ @Override
+ public IAtsUserService getUserService() throws OseeCoreException {
+ checkStarted();
+ return userService;
+ }
+
+ @Override
+ public ArtifactReadable getArtifact(IAtsObject atsObject) throws OseeCoreException {
+ checkStarted();
+ ArtifactReadable result = null;
+ if (atsObject.getStoreObject() != null) {
+ result = (ArtifactReadable) atsObject.getStoreObject();
+ } else {
+ result =
+ orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andGuid(atsObject.getGuid()).getResults().getExactlyOne();
+ }
+ return result;
+ }
+
+ @Override
+ public IAtsNotificationService getNotifyService() throws OseeCoreException {
+ checkStarted();
+ return notifyService;
+ }
+
+ @Override
+ public IAtsWorkItemService getWorkItemService() throws OseeStateException {
+ checkStarted();
+ return workItemService;
+ }
+
+ @Override
+ public IAtsBranchService getBranchService() {
+ return branchService;
+ }
+
+ @Override
+ public IAtsReviewService getReviewService() {
+ return reviewService;
+ }
+
+ public ArtifactReadable getArtifactByGuid(String guid) throws OseeCoreException {
+ checkStarted();
+ return orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andGuid(guid).getResults().getExactlyOne();
+ }
+
+ @SuppressWarnings("unchecked")
+ public ArtifactReadable getCurrentUser() throws OseeCoreException {
+ QueryFactory query = orcsApi.getQueryFactory(null);
+ return query.fromBranch(CoreBranches.COMMON).andIds(SystemUser.OseeSystem).getResults().getExactlyOne();
+ }
+
+ public IAtsWorkDefinitionAdmin getWorkDefAdmin() {
+ return workDefAdmin;
+ }
+
+ public IAttributeResolver getAttributeResolver() {
+ return attributeResolverService;
+ }
+
+ @Override
+ public IAtsConfig getAtsConfig() throws OseeStateException {
+ checkStarted();
+ return config;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsUiApplication.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsUiApplication.java
new file mode 100644
index 0000000000..b7b0eddafc
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/AtsUiApplication.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.ws.rs.core.Application;
+import org.eclipse.osee.ats.rest.internal.action.AtsResourceTokens;
+import org.eclipse.osee.ats.rest.internal.action.AtsUiResource;
+import org.eclipse.osee.ats.rest.internal.util.JaxRsExceptionMapper;
+import org.eclipse.osee.logger.Log;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.template.engine.OseeTemplateTokens;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsUiApplication extends Application {
+
+ private static OrcsApi orcsApi;
+ private static Log logger;
+
+ public void setOrcsApi(OrcsApi orcsApi) {
+ AtsUiApplication.orcsApi = orcsApi;
+ }
+
+ public static OrcsApi getOrcsApi() {
+ return orcsApi;
+ }
+
+ public static Log getLogger() {
+ return logger;
+ }
+
+ public void setLogger(Log logger) {
+ AtsUiApplication.logger = logger;
+ }
+
+ @Override
+ public Set<Class<?>> getClasses() {
+ Set<Class<?>> classes = new HashSet<Class<?>>();
+ return classes;
+ }
+
+ @Override
+ public Set<Object> getSingletons() {
+ AtsResourceTokens.register(orcsApi.getResourceRegistry());
+ OseeTemplateTokens.register(orcsApi.getResourceRegistry());
+ Set<Object> singletons = new HashSet<Object>();
+ singletons.add(new JaxRsExceptionMapper(orcsApi.getResourceRegistry()));
+ singletons.add(new AtsUiResource(orcsApi));
+ return singletons;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/IAtsServer.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/IAtsServer.java
new file mode 100644
index 0000000000..31510fb61e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/IAtsServer.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal;
+
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationServiceProvider;
+import org.eclipse.osee.ats.api.review.IAtsReviewServiceProvider;
+import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
+import org.eclipse.osee.ats.api.user.IAtsUserService;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionServiceProvider;
+import org.eclipse.osee.ats.api.workflow.IAtsBranchServiceProvider;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemServiceProvider;
+import org.eclipse.osee.ats.core.config.IAtsConfigProvider;
+import org.eclipse.osee.ats.rest.internal.workitem.IArtifactProvider;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IAtsServer extends IAtsConfigProvider, IAtsNotificationServiceProvider, IAtsReviewServiceProvider, IAtsBranchServiceProvider, IAtsWorkItemServiceProvider, IAtsWorkDefinitionServiceProvider, IArtifactProvider {
+
+ OrcsApi getOrcsApi() throws OseeCoreException;
+
+ IAtsWorkItemFactory getWorkItemFactory() throws OseeCoreException;
+
+ IAtsUserService getUserService() throws OseeCoreException;
+
+ @Override
+ ArtifactReadable getArtifact(IAtsObject atsObject) throws OseeCoreException;
+
+ @Override
+ IAtsNotificationService getNotifyService() throws OseeCoreException;
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionPage.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionPage.java
new file mode 100644
index 0000000000..ad24bde068
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionPage.java
@@ -0,0 +1,272 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.action;
+
+import java.io.IOException;
+import java.rmi.activation.Activator;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workdef.IAtsCompositeLayoutItem;
+import org.eclipse.osee.ats.api.workdef.IAtsLayoutItem;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.ats.rest.internal.action.ActionUtility.ActionLoadLevel;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.data.AttributeReadable;
+import org.eclipse.osee.template.engine.PageCreator;
+import org.eclipse.osee.template.engine.PageFactory;
+import org.eclipse.osee.template.engine.StringOptionsRule;
+
+/**
+ * @author Donald G Dunne
+ */
+public class ActionPage {
+
+ private String pageTemplate;
+ private final ActionLoadLevel actionLoadLevel;
+ private PageCreator page;
+ private IAtsWorkItem workItem;
+ private final IResourceRegistry registry;
+ private final String title;
+ private final ArtifactReadable action;
+
+ public ActionPage(IResourceRegistry registry, ArtifactReadable action, String title, ActionLoadLevel actionLoadLevel) {
+ this.registry = registry;
+ this.action = action;
+ this.title = title;
+ this.actionLoadLevel = actionLoadLevel;
+ }
+
+ private IAtsWorkItem getWorkItem() {
+ if (workItem == null) {
+ workItem = AtsServerImpl.get().getWorkItemFactory().getWorkItem(action);
+ }
+ return workItem;
+ }
+
+ public PageCreator getPage() {
+ if (page == null) {
+ page = PageFactory.newPageCreator(registry, "pageTitle", title);
+ }
+ return page;
+ }
+
+ public String generate() throws Exception {
+ IAtsWorkItem workItem = getWorkItem();
+ Conditions.checkNotNull(workItem, "workItem");
+ PageCreator page = getPage();
+
+ page.readKeyValuePairs(AtsResourceTokens.AtsValuesHtml);
+ page.addKeyValuePair("title", action.getSoleAttributeAsString(AtsAttributeTypes.Title, ""));
+ page.addKeyValuePair("description", action.getSoleAttributeAsString(AtsAttributeTypes.Description, ""));
+ page.addKeyValuePair("team", getTeamStr(action));
+ page.addKeyValuePair("ais", getAIStr(action));
+ page.addKeyValuePair("state", AtsCore.getWorkItemService().getCurrentStateName(workItem));
+ page.addKeyValuePair("assignees", getAssigneesStr(workItem, action));
+ page.addKeyValuePair("id", workItem.getGuid());
+ page.addKeyValuePair("atsId", workItem.getAtsId());
+ page.addKeyValuePair("originator", getCreatedByStr(workItem, action));
+ page.addKeyValuePair("priority", action.getSoleAttributeAsString(AtsAttributeTypes.PriorityType, ""));
+ page.addKeyValuePair("changeType", action.getSoleAttributeAsString(AtsAttributeTypes.ChangeType, ""));
+ page.addKeyValuePair("needBy", action.getSoleAttributeAsString(AtsAttributeTypes.NeedBy, ""));
+ page.addKeyValuePair("workflow", action.getArtifactType().toString());
+ page.addKeyValuePair("createdDate", workItem.getWorkData().getCreatedDate().toString());
+ page.addKeyValuePair("version", getVersion(workItem));
+ page.addKeyValuePair("workDef", getWorkDefStr(workItem));
+ page.addKeyValuePair("guid", workItem.getGuid());
+ if (page.getValue("transition") == null) {
+ page.addKeyValuePair("transition", "");
+ }
+
+ addStates(page, workItem, action);
+ addDebug(page, workItem, action);
+
+ return page.realizePage(AtsResourceTokens.AtsActionHtml);
+ }
+
+ private String getWorkDefStr(IAtsWorkItem workItem) {
+ String results = "<only on full>";
+ if (isShowHeaderFull()) {
+ results = workItem.getWorkDefinition().getName();
+ }
+ return results;
+ }
+
+ private String getAssigneesStr(IAtsWorkItem workItem, ArtifactReadable action) {
+ String results = "";
+ if (isShowHeaderFull()) {
+ results = workItem.getStateMgr().getAssigneesStr();
+ } else {
+ results = action.getSoleAttributeAsString(AtsAttributeTypes.CurrentState);
+ }
+ return results;
+ }
+
+ private String getTeamStr(ArtifactReadable action) {
+ String results = action.getSoleAttributeAsString(AtsAttributeTypes.TeamDefinition);
+ if (isShowHeaderFull()) {
+ results = AtsServerImpl.get().getArtifactByGuid(results).getName();
+ }
+ return results;
+ }
+
+ private String getAIStr(ArtifactReadable action) {
+ String results = action.getSoleAttributeAsString(AtsAttributeTypes.ActionableItem);
+ if (isShowHeaderFull()) {
+ results = AtsServerImpl.get().getArtifactByGuid(results).getName();
+ }
+ return results;
+ }
+
+ private String getCreatedByStr(IAtsWorkItem workItem, ArtifactReadable action) {
+ String results = action.getSoleAttributeAsString(AtsAttributeTypes.CreatedBy);
+ if (isShowHeaderFull()) {
+ results = workItem.getWorkData().getCreatedBy().getName();
+ }
+ return results;
+ }
+
+ public void addTransitionStates() throws OseeCoreException {
+ IAtsWorkItem workItem = getWorkItem();
+ PageCreator transPage = new PageCreator(registry);
+ transPage.addKeyValuePair("guid", workItem.getGuid());
+ StringOptionsRule rule = new StringOptionsRule("ToStateList", "ToStateList");
+ for (IAtsStateDefinition state : workItem.getStateDefinition().getToStates()) {
+ rule.getOptions().add(state.getName());
+ }
+ transPage.addSubstitution(rule);
+ String defaultToStateValue = "";
+ IAtsStateDefinition defaultToState = workItem.getStateDefinition().getDefaultToState();
+ if (defaultToState != null) {
+ defaultToStateValue = "value=\"" + defaultToState.getName() + "\"";
+ }
+ transPage.addKeyValuePair("defaultToStateValue", defaultToStateValue);
+
+ PageCreator page = getPage();
+ page.addKeyValuePair("transition", transPage.realizePage(AtsResourceTokens.TransitionHtml));
+ }
+
+ private String getVersion(IAtsWorkItem workItem) {
+ String version = "<on full load>";
+ if (isShowHeaderFull()) {
+ try {
+ IAtsTeamWorkflow teamWf = workItem.getParentTeamWorkflow();
+ String str = AtsCore.getWorkItemService().getTargetedVersionStr(teamWf);
+ if (Strings.isValid(str)) {
+ version = str;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ version = "exception: " + ex.getLocalizedMessage();
+ }
+ }
+ return version;
+ }
+
+ private void addStates(PageCreator page, IAtsWorkItem workItem, ArtifactReadable action) throws Exception {
+ StringBuilder statesSb = new StringBuilder();
+ if (isShowStates()) {
+ IAtsWorkDefinition workDefinition = workItem.getWorkDefinition();
+ Collection<String> visitedStates = workItem.getStateMgr().getVisitedStateNames();
+ List<IAtsStateDefinition> statesOrderedByOrdinal =
+ AtsCore.getWorkDefService().getStatesOrderedByOrdinal(workDefinition);
+ for (int index = statesOrderedByOrdinal.size() - 1; index >= 0; index--) {
+ IAtsStateDefinition state = statesOrderedByOrdinal.get(index);
+ if (visitedStates.contains(state.getName())) {
+ String stateHtmlTemplate = getStateHtmlTemplate();
+
+ String stateName = state.getName();
+ if (stateName.equals(workItem.getStateMgr().getCurrentStateName())) {
+ stateName = "CURRENT STATE => " + stateName;
+ }
+ stateHtmlTemplate = stateHtmlTemplate.replace("TITLE", stateName);
+
+ StringBuilder widgets = new StringBuilder();
+ addWidgets(widgets, workItem, state.getLayoutItems());
+ stateHtmlTemplate = stateHtmlTemplate.replace("WIDGETS", widgets.toString());
+
+ statesSb.append(stateHtmlTemplate);
+ }
+ }
+ }
+ page.addKeyValuePair("states", statesSb.toString());
+ }
+
+ private boolean isShowStates() {
+ return (actionLoadLevel == ActionLoadLevel.STATE);
+ }
+
+ private boolean isShowHeaderFull() {
+ return (actionLoadLevel == ActionLoadLevel.HEADER_FULL);
+ }
+
+ private void addWidgets(StringBuilder sb, IAtsWorkItem workItem, Collection<IAtsLayoutItem> items) {
+ addLayoutItems(sb, workItem, items);
+ }
+
+ private void addLayoutItems(StringBuilder sb, IAtsWorkItem workItem, Collection<IAtsLayoutItem> items) {
+ for (IAtsLayoutItem layout : items) {
+ if (layout instanceof IAtsCompositeLayoutItem) {
+ addWidgets(sb, workItem, ((IAtsCompositeLayoutItem) layout).getaLayoutItems());
+ } else {
+ addWidget(sb, workItem, (IAtsWidgetDefinition) layout);
+ }
+ }
+ }
+
+ private void addWidget(StringBuilder sb, IAtsWorkItem workItem, IAtsWidgetDefinition layout) {
+ sb.append("<tr><td>");
+ sb.append(layout.getName());
+ sb.append(": ");
+ try {
+ sb.append(AtsCore.getAttrResolver().getAttributesToStringList(workItem,
+ AtsCore.getAttrResolver().getAttributeType(layout.getAtrributeName())));
+ } catch (OseeCoreException ex) {
+ sb.append("exception: " + ex.getLocalizedMessage());
+ }
+ sb.append("</td></tr>");
+ }
+
+ private String getStateHtmlTemplate() throws IOException {
+ if (pageTemplate == null) {
+ pageTemplate = Lib.inputStreamToString(ActionPage.class.getResource("html/atsState.html").openStream());
+ }
+ return pageTemplate;
+ }
+
+ private static void addDebug(PageCreator page, IAtsWorkItem workItem, ArtifactReadable artifact) {
+ StringBuilder sb = new StringBuilder();
+ try {
+ for (AttributeReadable<?> attr : artifact.getAttributes()) {
+ sb.append(String.format("%s [%s]\n", attr.getAttributeType(),
+ AHTML.textToHtml(String.valueOf(attr.getValue()))));
+ }
+ } catch (OseeCoreException ex) {
+ sb.append("exception: " + ex.getLocalizedMessage());
+ }
+ page.addKeyValuePair("debug", sb.toString());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionResource.java
new file mode 100644
index 0000000000..6524c09d24
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionResource.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.action;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.ats.rest.internal.action.ActionUtility.ActionLoadLevel;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactId;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+@Path("action")
+public final class ActionResource {
+ private final OrcsApi orcsApi;
+ private final IResourceRegistry registry;
+
+ public ActionResource(OrcsApi orcsApi) {
+ this.orcsApi = orcsApi;
+ registry = orcsApi.getResourceRegistry();
+ }
+
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String get() throws Exception {
+ return AHTML.simplePage("Action Resource");
+ }
+
+ /**
+ * @param guid of action to display
+ * @return html representation of the action
+ */
+ @Path("{id}")
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getAction(@PathParam("id") String guid) throws Exception {
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(guid);
+ return ActionUtility.displayAction(registry, action, "Action - " + guid, ActionLoadLevel.HEADER);
+ }
+
+ /**
+ * @param guid of action to display
+ * @return html representation of the action w/ all ids resolved
+ */
+ @Path("{id}/full")
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getActionFull(@PathParam("id") String guid) throws Exception {
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(guid);
+ return ActionUtility.displayAction(registry, action, "Action - " + guid, ActionLoadLevel.HEADER_FULL);
+ }
+
+ /**
+ * @param guid of action to operate on
+ * @return StateResource for the give action
+ */
+ @Path("{id}/state")
+ public StateResource transitionAction(@PathParam("id") String guid) throws Exception {
+ return new StateResource(orcsApi, guid);
+ }
+
+ /**
+ * @param form containing information to create a new action
+ * @param form.ats_title - title of new action
+ * @param form.desc - description of the action
+ * @param form.actionableItems - actionable item name
+ * @param form.changeType - Improvement, Refinement, Problem, Support
+ * @param form.priority - 1-5
+ * @param uriInfo
+ * @return html representation of action created
+ * @throws Exception
+ */
+ @POST
+ @Consumes("application/x-www-form-urlencoded")
+ public Response addOrUpdateAction(MultivaluedMap<String, String> form, @Context UriInfo uriInfo) throws Exception {
+ // get parameters
+ String query = uriInfo.getPath();
+ System.out.println("query [" + query + "]");
+ String title = form.getFirst("ats_title");
+ String description = form.getFirst("desc");
+ String actionableItemName = form.getFirst("actionableItems");
+ String changeType = form.getFirst("changeType");
+ String priority = form.getFirst("priority");
+
+ // create action
+ ArtifactId actionId =
+ ActionUtility.createAction(orcsApi, title, description, actionableItemName, changeType, priority);
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(actionId.getGuid());
+
+ String htmlStr =
+ ActionUtility.displayAction(registry, action, "Action Created - " + action.getGuid(), ActionLoadLevel.HEADER);
+ return Response.status(200).entity(htmlStr).build();
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionUtility.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionUtility.java
new file mode 100644
index 0000000000..85042cf27a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/ActionUtility.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.action;
+
+import static org.eclipse.osee.framework.core.enums.CoreBranches.COMMON;
+import java.util.Date;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.ats.rest.internal.util.AtsUtilRest;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.ResultSet;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactId;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.transaction.TransactionBuilder;
+import org.eclipse.osee.orcs.transaction.TransactionFactory;
+
+public class ActionUtility {
+
+ public static enum ActionLoadLevel {
+ HEADER,
+ HEADER_FULL,
+ STATE
+ }
+
+ public static ArtifactId createAction(OrcsApi orcsApi, String title, String description, String actionableItemName, String changeType, String priority) throws OseeCoreException {
+ TransactionFactory txFactory = orcsApi.getTransactionFactory(AtsUtilRest.getApplicationContext());
+ ArtifactReadable currentUser = AtsServerImpl.get().getCurrentUser();
+ TransactionBuilder tx = txFactory.createTransaction(COMMON, currentUser, "Create ATS Action");
+ ArtifactId action = tx.createArtifact(AtsArtifactTypes.Action, title);
+ tx.setSoleAttributeFromString(action, AtsAttributeTypes.Description, description);
+ tx.setSoleAttributeFromString(action, AtsAttributeTypes.ChangeType, changeType);
+ tx.setSoleAttributeFromString(action, AtsAttributeTypes.PriorityType, priority);
+
+ ArtifactReadable ai = getActionableItem(orcsApi, actionableItemName);
+ ArtifactReadable teamDef = getTeamDefinition(orcsApi, ai);
+
+ ArtifactId teamWf = tx.createArtifact(getTeamWfArtifactType(null), title);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.Description, description);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.ActionableItem, ai.getGuid());
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.ChangeType, changeType);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.PriorityType, priority);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.TeamDefinition, teamDef.getGuid());
+
+ String workDefinitionName = getWorkDefinitionName(orcsApi, teamDef);
+ ArtifactReadable workDef = getWorkDefinition(orcsApi, workDefinitionName);
+ String startState = getStartState(workDef);
+ String assignees = getAssigneesStorageString(orcsApi, teamDef);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.CurrentState,
+ String.format("%s;%s;;", startState, assignees));
+
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.CurrentStateType, StateType.Working.name());
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.CreatedBy,
+ AtsServerImpl.get().getUserService().getCurrentUser().getUserId());
+ Date createdDate = new Date();
+ tx.setSoleAttributeValue(teamWf, AtsAttributeTypes.CreatedDate, createdDate);
+ String log = getLog(AtsServerImpl.get().getUserService().getCurrentUser(), startState, createdDate);
+ tx.setSoleAttributeFromString(teamWf, AtsAttributeTypes.Log, log);
+
+ // Add relation between Action and TeamWf
+ tx.relate(action, AtsRelationTypes.ActionToWorkflow_WorkFlow, teamWf);
+
+ tx.commit();
+
+ return teamWf;
+ }
+
+ private static String getAssigneesStorageString(OrcsApi orcsApi, ArtifactReadable teamDef) throws OseeCoreException {
+ StringBuilder sb = new StringBuilder();
+ for (ArtifactReadable lead : teamDef.getRelated(AtsRelationTypes.TeamLead_Lead)) {
+ sb.append("<");
+ sb.append(lead.getSoleAttributeAsString(CoreAttributeTypes.UserId));
+ sb.append(">");
+ }
+ return sb.toString();
+ }
+
+ private static String getStartState(ArtifactReadable workDef) throws OseeCoreException {
+ String workDefContents = workDef.getSoleAttributeAsString(AtsAttributeTypes.DslSheet);
+ Matcher m = Pattern.compile("startState \"(.*)\"").matcher(workDefContents);
+ if (m.find()) {
+ return m.group(1);
+ }
+ return null;
+ }
+
+ // TODO Need to check extensions to get correct type
+ private static IArtifactType getTeamWfArtifactType(ArtifactReadable teamDef) {
+ return AtsArtifactTypes.TeamWorkflow;
+ }
+
+ public static ResultSet<ArtifactReadable> getAis(OrcsApi orcsApi) throws OseeCoreException {
+ return orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(COMMON).andIsOfType(
+ AtsArtifactTypes.ActionableItem).getResults();
+ }
+
+ private static ArtifactReadable getActionableItem(OrcsApi orcsApi, String actionableItemName) throws OseeCoreException {
+ ArtifactReadable ai =
+ orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(COMMON).andIsOfType(
+ AtsArtifactTypes.ActionableItem).andNameEquals(actionableItemName).getResults().getExactlyOne();
+ return ai;
+ }
+
+ private static ArtifactReadable getTeamDefinition(OrcsApi orcsApi, ArtifactReadable ai) throws OseeCoreException {
+ return ai.getRelated(AtsRelationTypes.TeamActionableItem_Team).getExactlyOne();
+ }
+
+ private static ArtifactReadable getWorkDefinition(OrcsApi orcsApi, String workDefinitionName) throws OseeCoreException {
+ return orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(CoreBranches.COMMON).andIsOfType(
+ AtsArtifactTypes.WorkDefinition).andNameEquals(workDefinitionName).getResults().getExactlyOne();
+ }
+
+ private static String getWorkDefinitionName(OrcsApi orcsApi, ArtifactReadable teamDef) throws OseeCoreException {
+ String workDefName = teamDef.getSoleAttributeAsString(AtsAttributeTypes.WorkflowDefinition, null);
+ if (Strings.isValid(workDefName)) {
+ return workDefName;
+ }
+
+ ArtifactReadable parentTeamDef =
+ teamDef.getRelated(CoreRelationTypes.Default_Hierarchical__Parent).getExactlyOne();
+ if (parentTeamDef == null) {
+ return "WorkDef_Team_Default";
+ }
+ return getWorkDefinitionName(orcsApi, parentTeamDef);
+ }
+
+ // TODO Move AtsLog and AtsLogItem to shared bundle
+ private static String getLog(IAtsUser currentUser, String startState, Date createdDate) throws OseeCoreException {
+ String log =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><AtsLog><Item date=\"INSERT_DATE\" msg=\"\" state=\"\" type=\"Originated\" userId=\"INSERT_USER_NAME\"/><Item date=\"INSERT_DATE\" msg=\"\" state=\"INSERT_STATE_NAME\" type=\"StateEntered\" userId=\"INSERT_USER_NAME\"/></AtsLog>";
+ log = log.replaceAll("INSERT_DATE", String.valueOf(createdDate.getTime()));
+ log = log.replaceAll("INSERT_USER_NAME", currentUser.getUserId());
+ log = log.replaceAll("INSERT_STATE_NAME", startState);
+ return log;
+ }
+
+ public static String displayAction(IResourceRegistry registry, ArtifactReadable action, String title, ActionLoadLevel actionLoadLevel) throws Exception {
+ ActionPage page = new ActionPage(registry, action, title, actionLoadLevel);
+ return page.generate();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsResourceTokens.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsResourceTokens.java
new file mode 100644
index 0000000000..244459602f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsResourceTokens.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osee.ats.rest.internal.action;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.jdk.core.type.ClassBasedResourceToken;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.type.ResourceToken;
+import org.eclipse.osee.template.engine.OseeTemplateTokens;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public final class AtsResourceTokens {
+ private static final List<ResourceToken> tokens = new ArrayList<ResourceToken>();
+
+ // @formatter:off
+ public static final ResourceToken AtsValuesHtml = createToken(0x400000000000000EL, "atsValues.html");
+ public static final ResourceToken AtsActionHtml = createToken(0x400000000000000FL, "atsAction.html");
+ public static final ResourceToken AtsHtml = createToken(0x4000000000000010L, "ats.html");
+ public static final ResourceToken AtsNewActionHtml = createToken(0x4000000000000011L, "atsNewAction.html");
+ public static final ResourceToken AtsNewActionValuesHtml = createToken(0x4000000000000012L, "atsNewActionValues.html");
+ public static final ResourceToken AtsCoreCss = createToken(0x4000000000000013L, "atsCore.css");
+ public static final ResourceToken TransitionHtml = createToken(0x4000000000000014L, "atsTransition.html");
+ // @formatter:on
+
+ private static ResourceToken createToken(Long uuid, String name) {
+ ResourceToken token = new ClassBasedResourceToken(uuid, name, AtsResourceTokens.class, "html/");
+ tokens.add(token);
+ return token;
+ }
+
+ public static void register(IResourceRegistry registry) {
+ OseeTemplateTokens.register(registry);
+ registry.registerAll(tokens);
+ }
+
+ private AtsResourceTokens() {
+ // Constants
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsUiResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsUiResource.java
new file mode 100644
index 0000000000..d262884031
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/AtsUiResource.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.action;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.template.engine.AppendableRule;
+import org.eclipse.osee.template.engine.IdentifiableOptionsRule;
+import org.eclipse.osee.template.engine.PageCreator;
+import org.eclipse.osee.template.engine.PageFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+@Path("action")
+public final class AtsUiResource {
+ private final OrcsApi orcsApi;
+ private final IResourceRegistry registry;
+
+ public AtsUiResource(OrcsApi orcsApi) {
+ this.orcsApi = orcsApi;
+ registry = orcsApi.getResourceRegistry();
+ }
+
+ /**
+ * @return resource name
+ */
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String get() throws Exception {
+ return AHTML.simplePage("ATS UI Resource");
+ }
+
+ /**
+ * @return html5 action entry page
+ */
+ @Path("NewAction")
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getNewSource() throws Exception {
+ PageCreator page = PageFactory.newPageCreator(registry, AtsResourceTokens.AtsValuesHtml);
+ page.readKeyValuePairs(AtsResourceTokens.AtsNewActionValuesHtml);
+ AppendableRule rule =
+ new IdentifiableOptionsRule<ArtifactReadable>("ActionableItemDataList", ActionUtility.getAis(orcsApi),
+ "actionableItemList");
+ page.addSubstitution(rule);
+ return page.realizePage(AtsResourceTokens.AtsNewActionHtml);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/StateResource.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/StateResource.java
new file mode 100644
index 0000000000..b076ec0b59
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/StateResource.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.action;
+
+import java.util.Collections;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionOption;
+import org.eclipse.osee.ats.api.workflow.transition.TransitionResults;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionHelper;
+import org.eclipse.osee.ats.core.workflow.transition.TransitionManager;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.ats.rest.internal.action.ActionUtility.ActionLoadLevel;
+import org.eclipse.osee.ats.rest.internal.util.AtsChangeSet;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+@Path("state")
+public final class StateResource {
+ private final IResourceRegistry registry;
+ private IAtsWorkItem workItem;
+ private final String guid;
+
+ public StateResource(OrcsApi orcsApi, String guid) {
+ this.guid = guid;
+ registry = orcsApi.getResourceRegistry();
+ }
+
+ /**
+ * @return html representation of action with states
+ */
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getStates() throws Exception {
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(guid);
+ return ActionUtility.displayAction(registry, action, "Action - " + guid, ActionLoadLevel.STATE);
+ }
+
+ /**
+ * @param guid
+ * @return html representation w/ transition ui
+ */
+ @Path("trans")
+ @GET
+ @Produces(MediaType.TEXT_HTML)
+ public String getTransition(@PathParam("id") String guid) throws Exception {
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(guid);
+ ActionPage page = new ActionPage(registry, action, "Action - " + guid, ActionLoadLevel.STATE);
+ page.addTransitionStates();
+ return page.generate();
+
+ }
+
+ /**
+ * @param form containing information to transition action
+ * @param form.guid of action to transition
+ * @param form.operation - transition
+ * @param form.toState - name of state to transition to
+ * @param form.reason - reason if this transition is a cancel
+ * @param form.asUserId - userId of user performing transition
+ * @param uriInfo
+ * @return html representation of action after transition
+ */
+ @POST
+ @Consumes("application/x-www-form-urlencoded")
+ public Response addOrUpdateAction(MultivaluedMap<String, String> form, @Context UriInfo uriInfo) throws Exception {
+ String htmlStr;
+
+ // get parameters
+ String query = uriInfo.getPath();
+ System.out.println("query [" + query + "]");
+ String guid = form.getFirst("guid");
+ String operation = form.getFirst("operation");
+ String toState = form.getFirst("toState");
+ Conditions.checkNotNull(toState, "toState");
+ String reason = form.getFirst("reason");
+ Conditions.checkNotNull(reason, "reason");
+ String asUserId = form.getFirst("asUserId");
+ Conditions.checkNotNull(asUserId, "asUserId");
+
+ if (operation.equals("transition")) {
+ ArtifactReadable action = AtsServerImpl.get().getArtifactByGuid(guid);
+ workItem = AtsServerImpl.get().getWorkItemFactory().getWorkItem(action);
+
+ AtsChangeSet changes = new AtsChangeSet("Cancel Action");
+ TransitionHelper helper =
+ new TransitionHelper("Transition " + guid, Collections.singleton(workItem), toState,
+ workItem.getAssignees(), reason, changes, TransitionOption.None);
+ IAtsUser asAtsUser = AtsCore.getUserService().getUserById(asUserId);
+ helper.setTransitionUser(asAtsUser);
+ TransitionManager mgr = new TransitionManager(helper);
+ TransitionResults results = mgr.handleAll();
+ if (!results.isEmpty()) {
+ throw new OseeArgumentException(results.toString());
+ }
+ if (!changes.isEmpty()) {
+ changes.execute();
+ }
+
+ // reload before display
+ action = AtsServerImpl.get().getArtifactByGuid(guid);
+ htmlStr =
+ ActionUtility.displayAction(registry, action, "Action Transitioned - " + action.getGuid(),
+ ActionLoadLevel.HEADER_FULL);
+ } else {
+ throw new OseeCoreException("Unhandled operation [%s]", operation);
+ }
+ return Response.status(200).entity(htmlStr).build();
+
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/ats.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/ats.html
new file mode 100644
index 0000000000..ea2a222914
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/ats.html
@@ -0,0 +1,23 @@
+<?include path="4000000000000000 pageDeclaration.html"?>
+<head>
+ <meta name="author" content="Donald G. Dunne" />
+ <title>OSEE ATS - New Action</title>
+ <style>
+ <?include path="4000000000000013 atsCore.css"?>
+ </style>
+ <script>
+ <?include path="4000000000000002 oseeCore.js"?>
+ </script>
+</head>
+
+<body>
+
+<div id="atsNavigator">
+ <h2 id="navHeader">Navigator</h2>
+ <ul id="navList">
+ <?navListItems?>
+ </ul>
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsAction.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsAction.html
new file mode 100644
index 0000000000..8782621877
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsAction.html
@@ -0,0 +1,67 @@
+<?include path="4000000000000000 pageDeclaration.html"?>
+<head>
+ <meta name="author" content="Donald G. Dunne" />
+ <title>OSEE ATS</title>
+ <style>
+ <?include path="4000000000000013 atsCore.css"?>
+ </style>
+ <script>
+ <?include path="4000000000000002 oseeCore.js"?>
+ </script>
+</head>
+
+<body>
+
+<div id="atsBody">
+ <b><?pageTitle?></b></br>
+
+<table border="1" cellpadding="3" cellspacing="0" width="100%">
+ <tr><td>
+
+ <table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>
+ <td><font color="black" face="Arial" size="-1"> <b>Title: </b></font><?title?></td>
+ </tr></table>
+
+ <table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Current State: </b></font><?state?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Created: </b></font><?createdDate?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Originator: </b></font><?originator?></td>
+ </tr></table>
+
+ <table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Team: </b></font><?team?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Id: </b></font><?id?></td>
+ <td><font color="black" face="Arial" size="-1"><b>ATS Id: </b></font><?atsId?></td>
+ </tr></table>
+
+ <table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Targeted Version: </b></font><?version?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Assignees: </b></font><?assignees?></td>
+ </tr></table>
+
+ <table border="0" cellpadding="3" cellspacing="0" width="100%"><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Change Type: </b></font><?changeType?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Priority: </b></font><?priority?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Need By: </b></font><?needBy?></td>
+ </tr><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Workflow: </b></font><?workflow?></td>
+ <td><font color="black" face="Arial" size="-1"><b>Workflow Definition: </b></font><?workDef?></td>
+
+ </tr><tr>
+ <td><font color="black" face="Arial" size="-1"><b>Actionable Item(s): </b></font><?ais?></td>
+ </tr></table>
+
+
+</td></tr>
+</table>
+<?transition?>
+</div>
+
+<table border="1" cellpadding="3" cellspacing="0" width="100%">
+ <tr><td>
+ <?states?>
+ </td></tr>
+</table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsCore.css b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsCore.css
new file mode 100644
index 0000000000..a100cee735
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsCore.css
@@ -0,0 +1,38 @@
+ #atsNavigator {
+ background-color:#C3CCDB;
+ height:850px;
+ width:300px;
+ float:left;
+ border:1px solid black
+ }
+ #navHeader {
+ text-align:center
+ }
+ #divHeader {
+ width:851px;
+ background-color:#98B8EB
+ }
+ #divHeaderTitle {
+ margin-bottom:0;
+ height:30px;
+ width:850px;
+ text-align:center;
+ border:1px solid black
+ }
+ #divFooter {
+ background-color:#98B8EB;
+ width:850px;
+ clear:both;
+ text-align:center;
+ border:1px solid black
+ }
+ #atsBodyOld {
+ background-color:#C3CCDB;
+ height:400px;
+ width:850px;
+ float:left;
+ border:1px solid black
+ }
+ p.clear {
+ clear:both;
+ } \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewAction.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewAction.html
new file mode 100644
index 0000000000..d67acc3178
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewAction.html
@@ -0,0 +1,71 @@
+<?include path="4000000000000000 pageDeclaration.html"?>
+<head>
+ <meta name="author" content="Donald G. Dunne" />
+ <title>OSEE ATS</title>
+ <style>
+ <?include path="4000000000000013 atsCore.css"?>
+ </style>
+ <script>
+ <?include path="4000000000000002 oseeCore.js"?>
+ </script>
+</head>
+
+<body>
+
+<div id="atsBody">
+<b>Create a New Action</b>
+<form id="oseeAppForm">
+ <?widgets?>
+ <?ActionableItemDataList?>
+ <br/><br/>
+ <input type="button" id="createButton" value="Create" />
+</form>
+</div>
+
+<script>
+ function createAction() {
+ post_with_parms("/ats/action", getParams());
+ }
+
+ function getParams() {
+ var params = new Object();
+ var form = document.getElementById("oseeAppForm");
+ var inputElements = form.getElementsByTagName("input");
+
+ for(var i = 0; i < inputElements.length; i++) {
+ var inputElement = inputElements[i];
+ var id = inputElement.getAttribute("id");
+ if (id == null) {
+ console.log(inputElement);
+ console.log("has no id");
+ } else {
+ params[id] = inputElement.value;
+ }
+ }
+ return params;
+ }
+ document.onmousedown=checkRightClick;
+ function checkRightClick(e) {
+ var rightclick;
+ if (!e) var e = window.event;
+ if (e.which) rightclick = (e.which == 3);
+ else if (e.button) rightclick = (e.button == 2);
+ if (rightclick) {
+ populateTestData();
+ }
+ }
+ function populateTestData() {
+ document.getElementById('ats_title').value = 'This is my title';
+ document.getElementById('desc').value = 'This is my description';
+ document.getElementById("actionableItems").value = 'SAW Code';
+ document.getElementById("changeType").value = 'Improvement';
+ }
+
+
+ var button = document.getElementById("createButton");
+ button.addEventListener("click", createAction);
+ button.addEventListener("click", populateTestData);
+</script>
+
+</body>
+</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewActionValues.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewActionValues.html
new file mode 100644
index 0000000000..89168bf76e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsNewActionValues.html
@@ -0,0 +1,19 @@
+<?widgets?>
+ <label>Title</label> <input type="text" id="ats_title" name="title"/><br/>
+ <label>Description</label> <input type="text" id="desc" /><br/>
+ <label>Actionable Item</label> <input placeholder="type to filter" type="text" id="actionableItems" list="actionableItemList" /><br/>
+ <label>Change Type</label>
+ <select>
+ <option value="Improvement">Improvement</option>
+ <option value="Problem">Problem</option>
+ <option value="Refinement">Refinement</option>
+ <option value="Support">Support</option>
+ </select><br />
+ <label>Priority</label>
+ <input type="radio" name="priority" value="1">1 (High)
+ <input type="radio" name="priority" value="2">2
+ <input type="radio" name="priority" value="3">3
+ <input type="radio" name="priority" value="4">4
+ <input type="radio" name="priority" value="5">5 (Low)<br/>
+ <label>Deadline</label> <input type="date" name="deadline">
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsState.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsState.html
new file mode 100644
index 0000000000..6b863bb65a
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsState.html
@@ -0,0 +1,6 @@
+
+<table border="1" align="center" bgcolor="#FFFFF0" cellpadding="3" cellspacing="0" width="95%">
+ <tr><td align="center" colspan="3">TITLE</td></tr>
+ <tr><td>WIDGETS</td></tr>
+</table>
+</br>
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsTransition.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsTransition.html
new file mode 100644
index 0000000000..104a7f26d5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsTransition.html
@@ -0,0 +1,13 @@
+ </br>
+ <form action="/ats/action/<?guid?>/state" method="post">
+ <input type="hidden" name="operation" value="transition">
+ <input type="hidden" name="guid" value="<?guid?>">
+ <button name="transitionButton">Transition</button>
+ <label>To State</label> <input placeholder="type to filter" type="text" name="toState" <?defaultToStateValue?> id="toState" list="ToStateList" />
+ <label>As User Id: </label><input type="text" name="asUserId" value="Joe Smith">
+ <label>Cancel Reason: </label> <input type="text" name="reason" value="because">
+ </form>
+ </br>
+
+ <?ToStateList?>
+ \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsValues.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsValues.html
new file mode 100644
index 0000000000..f2022fa103
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsValues.html
@@ -0,0 +1,3 @@
+<?divFooter?>
+ <div id="divFooter">Copyright @ Eclipse.org</div>
+
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsWidget.html b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsWidget.html
new file mode 100644
index 0000000000..0eb5f1ef90
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/action/html/atsWidget.html
@@ -0,0 +1,4 @@
+
+<table width="95%">
+ WIDGETS
+</table>
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/notify/AtsNotificationServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/notify/AtsNotificationServiceImpl.java
new file mode 100644
index 0000000000..82f4cafdb7
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/notify/AtsNotificationServiceImpl.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.notify;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.notify.AtsNotificationEvent;
+import org.eclipse.osee.ats.api.notify.AtsNotifyType;
+import org.eclipse.osee.ats.api.notify.IAtsNotificationService;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsNotificationServiceImpl implements IAtsNotificationService {
+
+ public AtsNotificationServiceImpl() {
+ }
+
+ @Override
+ public void addNotificationEvent(AtsNotificationEvent notificationEvent) throws OseeCoreException {
+ // TODO - feature[ats_<QPLVQ>]: Add notification for ATS cancel to the server
+ }
+
+ @Override
+ public void clear() {
+ // TODO - feature[ats_<QPLVQ>]: Add notification for ATS cancel to the server
+ }
+
+ @Override
+ public List<AtsNotificationEvent> getNotificationEvents() throws OseeCoreException {
+ // TODO - feature[ats_<QPLVQ>]: Add notification for ATS cancel to the server
+ return Collections.emptyList();
+ }
+
+ @Override
+ public void sendNotifications() {
+ // TODO - feature[ats_<QPLVQ>]: Add notification for ATS cancel to the server
+ }
+
+ @Override
+ public void notify(IAtsWorkItem workItem, Collection<? extends IAtsUser> notifyUsers, AtsNotifyType... notifyTypes) throws OseeCoreException {
+ // TODO - feature[ats_<QPLVQ>]: Add notification for ATS cancel to the server
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUser.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUser.java
new file mode 100644
index 0000000000..ae62f8d390
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUser.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.user;
+
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.jdk.core.type.Identity;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsUser implements IAtsUser {
+
+ private final ArtifactReadable user;
+
+ public AtsUser(ArtifactReadable user) {
+ this.user = user;
+ }
+
+ @Override
+ public String getName() {
+ return user.getName();
+ }
+
+ @Override
+ public String getGuid() {
+ return user.getGuid();
+ }
+
+ @Override
+ public String getDescription() {
+ return user.getName();
+ }
+
+ @Override
+ public int compareTo(Object other) {
+ int result = other != null ? -1 : 1;
+ if (other instanceof IAtsUser) {
+ String otherName = ((IAtsUser) other).getName();
+ String thisName = user != null ? getName() : null;
+ if (thisName == null && otherName == null) {
+ result = 0;
+ } else if (thisName != null && otherName == null) {
+ result = 1;
+ } else if (thisName != null && otherName != null) {
+ result = thisName.compareTo(otherName);
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 0;
+ int userIdHashCode = 0;
+ try {
+ userIdHashCode = (getUserId() == null) ? 0 : getUserId().hashCode();
+ } catch (OseeCoreException ex) {
+ // Do nothing;
+ }
+ result = prime * result + userIdHashCode;
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ try {
+ String objUserId = null;
+ if (obj instanceof IAtsUser) {
+ objUserId = ((IAtsUser) obj).getUserId();
+ } else {
+ return false;
+ }
+ String thisUserId = getUserId();
+ if (thisUserId == null) {
+ if (objUserId != null) {
+ return false;
+ }
+ } else if (!thisUserId.equals(objUserId)) {
+ return false;
+ }
+ } catch (OseeCoreException ex) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String getUserId() throws OseeCoreException {
+ return user.getSoleAttributeAsString(CoreAttributeTypes.UserId);
+ }
+
+ @Override
+ public String getEmail() throws OseeCoreException {
+ return user.getSoleAttributeAsString(CoreAttributeTypes.Email, "");
+ }
+
+ @Override
+ public boolean isActive() throws OseeCoreException {
+ return user.getSoleAttributeValue(CoreAttributeTypes.Active, false);
+ }
+
+ @Override
+ public String toString() {
+ try {
+ return String.format("%s (%s)", getName(), getUserId());
+ } catch (Exception ex) {
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ @Override
+ public boolean matches(Identity<?>... identities) {
+ for (Identity<?> identity : identities) {
+ if (equals(identity)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String toStringWithId() {
+ return String.format("[%s][%s]", getName(), getGuid());
+ }
+
+ @Override
+ public Object getStoreObject() {
+ return user;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUserServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUserServiceImpl.java
new file mode 100644
index 0000000000..d718bd378c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/user/AtsUserServiceImpl.java
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.user;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.user.IAtsUserService;
+import org.eclipse.osee.ats.rest.internal.util.AtsUtilRest;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.enums.SystemUser;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * Non-artifact base user service
+ *
+ * @author Donald G Dunne
+ */
+public class AtsUserServiceImpl implements IAtsUserService {
+
+ private static OrcsApi orcsApi;
+
+ public static void setOrcsApi(OrcsApi orcsApi) {
+ AtsUserServiceImpl.orcsApi = orcsApi;
+ }
+
+ public void start() throws OseeCoreException {
+ Conditions.checkNotNull(orcsApi, "OrcsApi");
+ System.out.println("ATS - AtsUserService started");
+ }
+
+ @Override
+ public IAtsUser getCurrentUser() throws OseeCoreException {
+ return getUserById(SystemUser.OseeSystem.getUserId());
+ }
+
+ @Override
+ public IAtsUser getUserById(String userId) throws OseeCoreException {
+ IAtsUser atsUser = null;
+ if (Strings.isValid(userId)) {
+ ArtifactReadable userArt =
+ orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(CoreBranches.COMMON).andIsOfType(
+ CoreArtifactTypes.User).and(CoreAttributeTypes.UserId,
+ org.eclipse.osee.framework.core.enums.Operator.EQUAL, userId).getResults().getExactlyOne();
+ if (userArt != null) {
+ atsUser = new AtsUser(userArt);
+ }
+ }
+ return atsUser;
+ }
+
+ @Override
+ public Collection<IAtsUser> getUsersByUserIds(Collection<String> userIds) throws OseeCoreException {
+ List<IAtsUser> users = new LinkedList<IAtsUser>();
+ for (String userId : userIds) {
+ IAtsUser user = getUserById(userId);
+ if (user != null) {
+ users.add(user);
+ }
+ }
+ return users;
+ }
+
+ @Override
+ public IAtsUser getUserByName(String name) throws OseeCoreException {
+ IAtsUser atsUser = null;
+ if (Strings.isValid(name)) {
+ ArtifactReadable userArt =
+ orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(CoreBranches.COMMON).andIsOfType(
+ CoreArtifactTypes.User).and(CoreAttributeTypes.Name,
+ org.eclipse.osee.framework.core.enums.Operator.EQUAL, name).getResults().getExactlyOne();
+ if (userArt != null) {
+ atsUser = new AtsUser(userArt);
+ }
+ }
+ return atsUser;
+ }
+
+ @Override
+ public boolean isUserIdValid(String userId) throws OseeCoreException {
+ return getUserById(userId) != null;
+ }
+
+ @Override
+ public boolean isUserNameValid(String name) throws OseeCoreException {
+ return getUserByName(name) != null;
+ }
+
+ @Override
+ public String getUserIdByName(String name) throws OseeCoreException {
+ String userId = null;
+ IAtsUser userByName = getUserByName(name);
+ if (userByName != null) {
+ userId = userByName.getUserId();
+ }
+ return userId;
+ }
+
+ @Override
+ public boolean isAtsAdmin() {
+ boolean admin = false;
+ try {
+ ArtifactReadable atsAdminGroup =
+ orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(CoreBranches.COMMON).andIsOfType(
+ CoreArtifactTypes.UserGroup).and(CoreAttributeTypes.Name,
+ org.eclipse.osee.framework.core.enums.Operator.EQUAL, "AtsAdmin").getResults().getExactlyOne();
+ if (atsAdminGroup != null) {
+ ArtifactReadable currentUserArt = getCurrentUserArt();
+ for (ArtifactReadable adminArt : atsAdminGroup.getRelated(CoreRelationTypes.Users_User)) {
+ if (adminArt.equals(currentUserArt)) {
+ admin = true;
+ break;
+ }
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsUserServiceImpl.class, Level.SEVERE, ex);
+ }
+ return admin;
+ }
+
+ @Override
+ public boolean isAssigneeMe(IAtsWorkItem workItem) throws OseeCoreException {
+ return workItem.getStateMgr().getAssignees().contains(getCurrentUser());
+ }
+
+ public static ArtifactReadable getCurrentUserArt() throws OseeCoreException {
+ // TODO Switch to real user
+ return orcsApi.getQueryFactory(AtsUtilRest.getApplicationContext()).fromBranch(CoreBranches.COMMON).andIsOfType(
+ CoreArtifactTypes.User).and(CoreAttributeTypes.UserId, org.eclipse.osee.framework.core.enums.Operator.EQUAL,
+ SystemUser.OseeSystem.getUserId()).getResults().getExactlyOne();
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsArtifactConfigCache.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsArtifactConfigCache.java
new file mode 100644
index 0000000000..c4a8354820
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsArtifactConfigCache.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.core.config.AtsConfigCache;
+import org.eclipse.osee.ats.core.config.IAtsConfig;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.util.XResultData;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsArtifactConfigCache implements IAtsConfig {
+
+ private final OrcsApi orcsApi;
+ private final AtsConfigCache cache;
+
+ public AtsArtifactConfigCache(OrcsApi orcsApi) {
+ this.orcsApi = orcsApi;
+ cache = new AtsConfigCache();
+ }
+
+ @Override
+ public <A extends IAtsConfigObject> List<A> getByTag(String tag, Class<A> clazz) throws OseeCoreException {
+ return cache.getByTag(tag, clazz);
+ }
+
+ @Override
+ public <A extends IAtsConfigObject> A getSoleByTag(String tag, Class<A> clazz) throws OseeCoreException {
+ return cache.getSoleByTag(tag, clazz);
+ }
+
+ @Override
+ public <A extends IAtsConfigObject> List<A> get(Class<A> clazz) throws OseeCoreException {
+ return cache.get(clazz);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <A extends IAtsConfigObject> A getSoleByGuid(String guid, Class<A> clazz) throws OseeCoreException {
+ A result = cache.getSoleByGuid(guid, clazz);
+ if (result == null) {
+ ArtifactReadable artifact =
+ orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andGuid(guid).getResults().getOneOrNull();
+ if (artifact != null) {
+ result = (A) AtsServerImpl.get().getWorkItemFactory().getConfigObject(artifact);
+ if (result != null) {
+ cache.cache(result);
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public IAtsConfigObject getSoleByGuid(String guid) throws OseeCoreException {
+ IAtsConfigObject result = cache.getSoleByGuid(guid);
+ if (result == null) {
+ ArtifactReadable artifact =
+ orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andGuid(guid).getResults().getOneOrNull();
+ if (artifact != null) {
+ result = AtsServerImpl.get().getWorkItemFactory().getConfigObject(artifact);
+ if (result != null) {
+ cache.cache(result);
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public void getReport(XResultData rd) throws OseeCoreException {
+ throw new OseeStateException("Not Implemented");
+ }
+
+ @Override
+ public void invalidate(IAtsConfigObject configObject) throws OseeCoreException {
+ cache.invalidate(configObject);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
new file mode 100644
index 0000000000..c1b2a29c3f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsAttributeResolverServiceImpl.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.rmi.activation.Activator;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
+import org.eclipse.osee.ats.api.workdef.IAttributeResolver;
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.AttributeReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeResolverServiceImpl implements IAttributeResolver {
+
+ private static OrcsApi orcsApi;
+
+ public void setOrcsApi(OrcsApi orcsApi) {
+ AtsAttributeResolverServiceImpl.orcsApi = orcsApi;
+ }
+
+ public void start() throws OseeCoreException {
+ Conditions.checkNotNull(orcsApi, "OrcsApi");
+ System.out.println("ATS - AtsAttributeResolverServiceImpl started");
+ }
+
+ @Override
+ public boolean isAttributeNamed(String attributeName) {
+ return getAttributeType(attributeName) != null;
+ }
+
+ @Override
+ public String getUnqualifiedName(String attributeName) {
+ return getAttributeType(attributeName).getUnqualifiedName();
+ }
+
+ @Override
+ public void setXWidgetNameBasedOnAttributeName(String attributeName, IAtsWidgetDefinition widgetDef) {
+ try {
+ if (!Strings.isValid(widgetDef.getXWidgetName())) {
+ widgetDef.setXWidgetName(AttributeTypeToXWidgetName.getXWidgetName(orcsApi, getAttributeType(attributeName)));
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsAttributeResolverServiceImpl.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public String getDescription(String attributeName) {
+ return getAttributeType(attributeName).getDescription();
+ }
+
+ @Override
+ public IAttributeType getAttributeType(String attributeName) {
+ IAttributeType attrType = null;
+ try {
+ for (IAttributeType type : orcsApi.getOrcsTypes(null).getAttributeTypes().getAll()) {
+ if (type.getName().equals(attributeName)) {
+ attrType = type;
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return attrType;
+ }
+
+ @Override
+ public <T> T getSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, T defaultReturnValue) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(workItem).getSoleAttributeValue(attributeType, defaultReturnValue);
+
+ }
+
+ @Override
+ public Collection<String> getAttributesToStringList(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(workItem).getAttributeValues(attributeType);
+ }
+
+ @Override
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(workItem).isAttributeTypeValid(attributeType);
+ }
+
+ @Override
+ public String getSoleAttributeValueAsString(IAtsWorkItem workItem, IAttributeType attributeType, String defaultValue) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(workItem).getSoleAttributeValue(attributeType, defaultValue).toString();
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ // Sets on Server need to be through transaction
+ throw new OseeStateException(
+ "Invalid: Must use setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes)");
+ }
+
+ @Override
+ public int getAttributeCount(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(workItem).getAttributeCount(attributeType);
+ }
+
+ @Override
+ public void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ // Sets on Server need to be through transaction
+ throw new OseeStateException("Not Implemented");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T> Collection<IAttribute<T>> getAttributes(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ Collection<IAttribute<T>> attrs = new ArrayList<IAttribute<T>>();
+ for (AttributeReadable<Object> attr : AtsServerImpl.get().getArtifact(workItem).getAttributes(attributeType)) {
+ attrs.add(new AttributeWrapper<T>((AttributeReadable<T>) attr));
+ }
+ return attrs;
+ }
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ // Sets on Server need to be through transaction
+ throw new OseeStateException(
+ "Invalid: Must use deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes)");
+ }
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes) throws OseeCoreException {
+ changes.deleteSoleAttribute(workItem, attributeType);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String value, IAtsChangeSet changes) throws OseeCoreException {
+ changes.setSoleAttributeValue(workItem, attributeType, value);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ changes.setSoleAttributeValue(workItem, attributeType, value);
+ }
+
+ @Override
+ public void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ changes.addAttribute(workItem, attributeType, value);
+ }
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value, IAtsChangeSet changes) throws OseeCoreException {
+ changes.deleteAttribute(workItem, attributeType, value);
+ }
+
+ @Override
+ public <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value, IAtsChangeSet changes) throws OseeCoreException {
+ changes.setValue(workItem, attr, attributeType, value);
+ }
+
+ @Override
+ public <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr, IAtsChangeSet changes) throws OseeCoreException {
+ changes.deleteAttribute(workItem, attr);
+ }
+
+ @Override
+ public <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr) throws OseeCoreException { // Sets on Server need to be through transaction
+ throw new OseeStateException(
+ "Invalid: Must use deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes)");
+ }
+
+ @Override
+ public <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value) throws OseeCoreException {
+ // Sets on Server need to be through transaction
+ throw new OseeStateException(
+ "Invalid: Must use deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType, IAtsChangeSet changes)");
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
new file mode 100644
index 0000000000..cff5ddf178
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsBranchServiceImpl.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import org.eclipse.osee.ats.api.workflow.IAtsBranchService;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.BranchArchivedState;
+import org.eclipse.osee.framework.core.enums.BranchState;
+import org.eclipse.osee.framework.core.enums.BranchType;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.cache.BranchFilter;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsBranchServiceImpl implements IAtsBranchService {
+
+ private final OrcsApi orcsApi;
+
+ public AtsBranchServiceImpl(OrcsApi orcsApi) {
+ this.orcsApi = orcsApi;
+ }
+
+ @Override
+ public boolean isBranchInCommit(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ IOseeBranch branch = getBranch(teamWf);
+ Branch branch2 = orcsApi.getBranchCache().get(branch);
+ return branch2.getBranchState() == BranchState.COMMIT_IN_PROGRESS;
+ }
+
+ @Override
+ public boolean isWorkingBranchInWork(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ boolean inWork = false;
+ IOseeBranch branch = getBranch(teamWf);
+ if (branch != null) {
+ Branch branch2 = orcsApi.getBranchCache().get(branch);
+ if (branch2 != null) {
+ BranchState state = branch2.getBranchState();
+ inWork = state == BranchState.CREATED || state == BranchState.MODIFIED;
+ }
+ }
+ return inWork;
+ }
+
+ @Override
+ public IOseeBranch getBranch(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ IOseeBranch results = null;
+ ArtifactReadable artifact =
+ orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andGuid(teamWf.getGuid()).getResults().getExactlyOne();
+ for (Branch branch : orcsApi.getBranchCache().getBranches(
+ new BranchFilter(BranchArchivedState.UNARCHIVED, BranchType.WORKING))) {
+ if (branch.getAssociatedArtifactId() == artifact.getLocalId()) {
+ results = branch;
+ }
+ }
+ return results;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
new file mode 100644
index 0000000000..c403ee621f
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsChangeSet.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.util.IExecuteListener;
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.util.AtsUtilCore;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeArgumentException;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactId;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+import org.eclipse.osee.orcs.transaction.TransactionBuilder;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsChangeSet implements IAtsChangeSet {
+
+ private String comment;
+ private final Set<Object> objects = new HashSet<Object>();
+ private final Set<Object> deleteObjects = new HashSet<Object>();
+ private TransactionBuilder transaction;
+ private final Set<IExecuteListener> listeners = new HashSet<IExecuteListener>();
+
+ public AtsChangeSet(String comment) {
+ this.comment = comment;
+ }
+
+ @Override
+ public void add(Object obj) throws OseeCoreException {
+ Conditions.checkNotNull(obj, "object");
+ objects.add(obj);
+ }
+
+ public TransactionBuilder getTxFactory() throws OseeCoreException {
+ if (transaction == null) {
+ transaction =
+ AtsServerImpl.get().getOrcsApi().getTransactionFactory(null).createTransaction(AtsUtilRest.getAtsBranch(),
+ AtsServerImpl.get().getCurrentUser(), comment);
+ }
+ return transaction;
+ }
+
+ public IAtsStateManager getStateMgr(IAtsWorkItem workItem) {
+ return workItem.getStateMgr();
+ }
+
+ @Override
+ public void execute() throws OseeCoreException {
+ Conditions.checkNotNull(comment, "comment");
+ if (objects.isEmpty() && deleteObjects.isEmpty()) {
+ throw new OseeArgumentException("objects/deleteObjects cannot be empty");
+ }
+ for (Object obj : new CopyOnWriteArrayList<Object>(objects)) {
+ if (obj instanceof IAtsWorkItem) {
+ IAtsWorkItem workItem = (IAtsWorkItem) obj;
+ IAtsStateManager stateMgr = getStateMgr(workItem);
+ if (stateMgr.isDirty()) {
+ AtsCore.getStateFactory().writeToStore(workItem, this);
+ }
+ if (workItem.getLog().isDirty()) {
+ AtsCore.getLogFactory().writeToStore(workItem, AtsCore.getAttrResolver(), this);
+ }
+ }
+ }
+ for (Object obj : deleteObjects) {
+ if (obj instanceof IAtsWorkItem) {
+ ArtifactReadable artifact = AtsServerImpl.get().getArtifact((IAtsWorkItem) obj);
+ getTxFactory().deleteArtifact(artifact);
+ } else {
+ throw new OseeArgumentException("AtsChangeSet: Unhandled deleteObject type: " + obj);
+ }
+ }
+ transaction.commit();
+ for (IExecuteListener listener : listeners) {
+ listener.changesStored(this);
+ }
+ }
+
+ public static void execute(String comment, Object object, Object... objects) throws OseeCoreException {
+ AtsChangeSet changes = new AtsChangeSet(comment);
+ changes.add(object);
+ for (Object obj : objects) {
+ changes.add(obj);
+ }
+ changes.execute();
+ }
+
+ @Override
+ public Set<Object> getObjects() {
+ return objects;
+ }
+
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+
+ @Override
+ public void clear() {
+ objects.clear();
+ }
+
+ public void reset(String comment) {
+ clear();
+ this.comment = comment;
+ this.transaction = null;
+ this.objects.clear();
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return objects.isEmpty();
+ }
+
+ @Override
+ public void deleteSoleAttribute(IAtsWorkItem workItem, IAttributeType attributeType) throws OseeCoreException {
+ getTxFactory().deleteSoleAttribute(AtsUtilCore.toArtifactId(workItem), attributeType);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, String value) throws OseeCoreException {
+ getTxFactory().setSoleAttributeValue(AtsUtilCore.toArtifactId(workItem), attributeType, value);
+ }
+
+ @Override
+ public void setSoleAttributeValue(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ getTxFactory().setSoleAttributeValue(AtsUtilCore.toArtifactId(workItem), attributeType, value);
+ }
+
+ @Override
+ public void addAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ getTxFactory().createAttribute(AtsUtilCore.toArtifactId(workItem), attributeType, value);
+ }
+
+ @Override
+ public void deleteAttribute(IAtsWorkItem workItem, IAttributeType attributeType, Object value) throws OseeCoreException {
+ getTxFactory().deleteAttributesWithValue(AtsUtilCore.toArtifactId(workItem), attributeType, value);
+ }
+
+ @Override
+ public <T> void setValue(IAtsWorkItem workItem, IAttribute<String> attr, IAttributeType attributeType, T value) throws OseeCoreException {
+ ArtifactId artifactId = AtsUtilCore.toArtifactId(workItem);
+ getTxFactory().setAttributeById(artifactId, AtsUtilCore.toAttributeId(attr), value);
+ }
+
+ @Override
+ public <T> void deleteAttribute(IAtsWorkItem workItem, IAttribute<T> attr) throws OseeCoreException {
+ getTxFactory().deleteByAttributeId(AtsUtilCore.toArtifactId(workItem), AtsUtilCore.toAttributeId(attr));
+ }
+
+ @Override
+ public void addExecuteListener(IExecuteListener listener) {
+ listeners.add(listener);
+ }
+
+ @Override
+ public void addToDelete(Object obj) throws OseeCoreException {
+ Conditions.checkNotNull(obj, "object");
+ deleteObjects.add(obj);
+ }
+
+ @Override
+ public void addAll(Object... objects) throws OseeCoreException {
+ for (Object obj : objects) {
+ this.objects.add(obj);
+ }
+ }
+
+ @Override
+ public boolean isAttributeTypeValid(IAtsWorkItem workItem, IAttributeType attributeType) {
+ ArtifactReadable artifact = AtsServerImpl.get().getArtifact(workItem);
+ return artifact.getValidAttributeTypes().contains(attributeType);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsReviewServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsReviewServiceImpl.java
new file mode 100644
index 0000000000..de573d4f25
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsReviewServiceImpl.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
+import org.eclipse.osee.ats.api.review.IAtsReviewService;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.ReviewBlockType;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.ats.rest.internal.workitem.IArtifactProvider;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsReviewServiceImpl implements IAtsReviewService {
+
+ private final IArtifactProvider artifactProvider;
+ private final IAtsWorkItemService workItemService;
+
+ public AtsReviewServiceImpl(IArtifactProvider artifactProvider, IAtsWorkItemService workItemService) {
+ this.artifactProvider = artifactProvider;
+ this.workItemService = workItemService;
+ }
+
+ @Override
+ public boolean isValidationReviewRequired(IAtsWorkItem workItem) throws OseeCoreException {
+ boolean required = false;
+ if (workItem.isTeamWorkflow()) {
+ required =
+ artifactProvider.getArtifact(workItem).getSoleAttributeValue(AtsAttributeTypes.ValidationRequired, false);
+ }
+ return required;
+ }
+
+ @Override
+ public IAtsDecisionReview createValidateReview(IAtsTeamWorkflow teamWf, boolean force, Date transitionDate, IAtsUser transitionUser, IAtsChangeSet changes) throws OseeCoreException {
+ // TODO Implement this
+ throw new OseeStateException("Not Implemented Yet");
+ }
+
+ @Override
+ public Collection<IAtsAbstractReview> getReviewsFromCurrentState(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ return workItemService.getReviews(teamWf, workItemService.getCurrentState(teamWf));
+ }
+
+ @Override
+ public ReviewBlockType getReviewBlockType(IAtsAbstractReview review) throws OseeCoreException {
+ String blockStr =
+ artifactProvider.getArtifact(review).getSoleAttributeAsString(AtsAttributeTypes.ReviewBlocks,
+ ReviewBlockType.None.name());
+ return ReviewBlockType.valueOf(blockStr);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsUtilRest.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsUtilRest.java
new file mode 100644
index 0000000000..7f0bd14642
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsUtilRest.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreBranches;
+import org.eclipse.osee.orcs.ApplicationContext;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsUtilRest {
+
+ // TODO use real application context
+ public static ApplicationContext getApplicationContext() {
+ return null;
+ }
+
+ public static IOseeBranch getAtsBranch() {
+ return CoreBranches.COMMON;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsWorkDefinitionCacheProvider.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsWorkDefinitionCacheProvider.java
new file mode 100644
index 0000000000..073d90f6c9
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AtsWorkDefinitionCacheProvider.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.core.util.CacheProvider;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
+import org.eclipse.osee.framework.core.data.LazyObject;
+
+/**
+ * Thread safe loading of ATS Config Objects
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsWorkDefinitionCacheProvider extends LazyObject<AtsWorkDefinitionCache> implements CacheProvider<AtsWorkDefinitionCache> {
+
+ private final IAtsWorkDefinitionService workDefinitionService;
+
+ public AtsWorkDefinitionCacheProvider(IAtsWorkDefinitionService workDefinitionService) {
+ super();
+ this.workDefinitionService = workDefinitionService;
+ }
+
+ @Override
+ protected FutureTask<AtsWorkDefinitionCache> createLoaderTask() {
+ Callable<AtsWorkDefinitionCache> newCallable = new LoadAtsWorkDefinitionCacheCallable(workDefinitionService);
+ FutureTask<AtsWorkDefinitionCache> newTask = new FutureTask<AtsWorkDefinitionCache>(newCallable);
+ return newTask;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeTypeToXWidgetName.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeTypeToXWidgetName.java
new file mode 100644
index 0000000000..9cb5f21471
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeTypeToXWidgetName.java
@@ -0,0 +1,73 @@
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+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.Collections;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.EnumEntry;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AttributeTypeToXWidgetName {
+
+ public static String getXWidgetName(OrcsApi orcsApi, IAttributeType attributeType) throws OseeCoreException {
+ int minOccurrence = orcsApi.getOrcsTypes(null).getAttributeTypes().getMinOccurrences(attributeType);
+ int maxOccurrence = orcsApi.getOrcsTypes(null).getAttributeTypes().getMaxOccurrences(attributeType);
+ String xWidgetName = "";
+ String baseType = orcsApi.getOrcsTypes(null).getAttributeTypes().getBaseAttributeTypeId(attributeType);
+ if (baseType != null) {
+ baseType = baseType.toLowerCase();
+ if (attributeType.equals(CoreAttributeTypes.AccessContextId)) {
+ xWidgetName = "XTextFlatDam";
+ } else if (baseType.contains("enum")) {
+ if (maxOccurrence == 1) {
+ xWidgetName =
+ "XComboDam(" + Collections.toString(",", getEnumerationValues(orcsApi, attributeType)) + ")";
+ } else {
+ xWidgetName =
+ "XSelectFromMultiChoiceDam(" + Collections.toString(",", getEnumerationValues(orcsApi, attributeType)) + ")";
+ }
+ } else if (baseType.contains("boolean")) {
+ if (minOccurrence == 1) {
+ xWidgetName = "XCheckBoxDam";
+ } else {
+ xWidgetName = "XComboBooleanDam";
+ }
+ } else if (baseType.contains("date")) {
+ xWidgetName = "XDateDam";
+ } else if (baseType.contains("integer")) {
+ xWidgetName = "XIntegerDam";
+ } else if (baseType.contains("floating")) {
+ xWidgetName = "XFloatDam";
+ } else if (baseType.contains("binary")) {
+ xWidgetName = "XLabelDam";
+ } else if (baseType.contains("branchreference")) {
+ xWidgetName = "XBranchSelectWidget";
+ } else if (baseType.contains("artifactreference")) {
+ xWidgetName = "XListDropViewWithSave";
+ } else if (baseType.contains("string")) {
+ if (maxOccurrence == 1) {
+ xWidgetName = "XTextDam";
+ } else {
+ xWidgetName = "XStackedDam";
+ }
+ } else {
+ xWidgetName = "XStackedDam";
+ }
+ }
+ return xWidgetName;
+ }
+
+ private static Collection<String> getEnumerationValues(OrcsApi orcsApi, IAttributeType attributeType) {
+ List<String> values = new ArrayList<String>();
+ for (EnumEntry entry : orcsApi.getOrcsTypes(null).getAttributeTypes().getEnumType(attributeType).values()) {
+ values.add(entry.getName());
+ }
+ return values;
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeWrapper.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeWrapper.java
new file mode 100644
index 0000000000..29e214e817
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/AttributeWrapper.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import org.eclipse.osee.ats.api.workflow.IAttribute;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.orcs.data.AttributeReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AttributeWrapper<T> implements IAttribute<T> {
+
+ private final AttributeReadable<T> attr;
+
+ public AttributeWrapper(AttributeReadable<T> attr) {
+ this.attr = attr;
+ }
+
+ @Override
+ public T getValue() throws OseeCoreException {
+ return attr.getValue();
+ }
+
+ @Override
+ public Object getData() {
+ return attr;
+ }
+
+ @Override
+ public void delete() throws OseeCoreException {
+ throw new OseeStateException("Not valid call for server");
+ }
+
+ @Override
+ public void setValue(T value) throws OseeCoreException {
+ throw new OseeStateException("Not valid call for server");
+ }
+
+ @Override
+ public int getId() {
+ return attr.getLocalId();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/JaxRsExceptionMapper.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/JaxRsExceptionMapper.java
new file mode 100644
index 0000000000..9ce9132f7b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/JaxRsExceptionMapper.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import static org.eclipse.osee.template.engine.OseeTemplateTokens.ExceptionHtml;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.eclipse.osee.framework.jdk.core.type.IResourceRegistry;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.template.engine.PageFactory;
+
+/**
+ * @author Ryan D. Brooks
+ */
+@Provider
+public final class JaxRsExceptionMapper implements ExceptionMapper<Exception> {
+ private final IResourceRegistry registry;
+ private static final int NumOfCharsInTypicalStackTrace = 2200;
+
+ public JaxRsExceptionMapper(IResourceRegistry registry) {
+ this.registry = registry;
+ }
+
+ /**
+ * Create valid xhtml exception page that includes the full stack trace and return a reasonable error page even if
+ * page creation fails too.
+ */
+ @Override
+ public Response toResponse(Exception ex) {
+ return Response.serverError().entity(exceptionToHtml(ex)).type(MediaType.TEXT_HTML_TYPE).build();
+ }
+
+ String exceptionToHtml(Exception ex) {
+ String html;
+
+ try {
+ String exStr = Lib.exceptionToString(ex);
+ html = PageFactory.realizePage(registry, ExceptionHtml, "title", ex.toString(), "stacktrace", exStr);
+ } catch (Exception ex1) {
+ StringBuilder strB = new StringBuilder(NumOfCharsInTypicalStackTrace);
+ strB.append("<pre>\n");
+ strB.append(StringEscapeUtils.escapeHtml(Lib.exceptionToString(ex)));
+ strB.append("\n\nAddtional exception while reporting first exception:\n");
+ strB.append(StringEscapeUtils.escapeHtml(Lib.exceptionToString(ex1)));
+ strB.append("\n</pre>");
+ html = strB.toString();
+ }
+ return html;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/LoadAtsWorkDefinitionCacheCallable.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/LoadAtsWorkDefinitionCacheCallable.java
new file mode 100644
index 0000000000..8b4d29ddd3
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/LoadAtsWorkDefinitionCacheCallable.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.concurrent.Callable;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionService;
+import org.eclipse.osee.ats.core.workdef.AtsWorkDefinitionCache;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LoadAtsWorkDefinitionCacheCallable implements Callable<AtsWorkDefinitionCache> {
+
+ public LoadAtsWorkDefinitionCacheCallable(IAtsWorkDefinitionService workDefinitionService) {
+ super();
+ }
+
+ @Override
+ public AtsWorkDefinitionCache call() throws Exception {
+ AtsWorkDefinitionCache cache = new AtsWorkDefinitionCache();
+ return cache;
+ }
+
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/TeamWorkflowProvider.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/TeamWorkflowProvider.java
new file mode 100644
index 0000000000..957b1eae85
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/util/TeamWorkflowProvider.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.util;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProviders;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowProvider implements ITeamWorkflowProviders {
+
+ @Override
+ public Iterator<ITeamWorkflowProvider> iterator() {
+ return getTeamWorkflowProviders().iterator();
+ }
+
+ @Override
+ public List<ITeamWorkflowProvider> getTeamWorkflowProviders() {
+ return Collections.emptyList();
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workdef/AtsWorkDefinitionStoreImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workdef/AtsWorkDefinitionStoreImpl.java
new file mode 100644
index 0000000000..06a18850ab
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workdef/AtsWorkDefinitionStoreImpl.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workdef;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinitionStore;
+import org.eclipse.osee.ats.rest.internal.util.AtsUtilRest;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.enums.TokenDelimiterMatch;
+import org.eclipse.osee.framework.core.util.Conditions;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.orcs.OrcsApi;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkDefinitionStoreImpl implements IAtsWorkDefinitionStore {
+
+ private static OrcsApi orcsApi;
+
+ public static void setOrcsApi(OrcsApi orcsApi) {
+ AtsWorkDefinitionStoreImpl.orcsApi = orcsApi;
+ }
+
+ public void start() throws OseeCoreException {
+ Conditions.checkNotNull(orcsApi, "OrcsApi");
+ System.out.println("ATS - AtsWorkDefinitionStoreImpl started");
+ }
+
+ @Override
+ public List<Pair<String, String>> getWorkDefinitionStrings() throws OseeCoreException {
+ List<Pair<String, String>> nameToWorkDefStr = new ArrayList<Pair<String, String>>(15);
+ for (ArtifactReadable workDefArt : orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andTypeEquals(
+ AtsArtifactTypes.WorkDefinition).getResults()) {
+ nameToWorkDefStr.add(new Pair<String, String>(workDefArt.getName(), loadWorkDefinitionFromArtifact(workDefArt)));
+ }
+ return nameToWorkDefStr;
+ }
+
+ @Override
+ public String loadWorkDefinitionString(String workDefId) throws OseeCoreException {
+ return loadWorkDefinitionFromArtifact(workDefId);
+ }
+
+ @Override
+ public boolean isWorkDefinitionExists(String workDefId) throws OseeCoreException {
+ return loadWorkDefinitionString(workDefId) != null;
+ }
+
+ private String loadWorkDefinitionFromArtifact(String name) throws OseeCoreException {
+ ArtifactReadable artifact =
+ orcsApi.getQueryFactory(null).fromBranch(AtsUtilRest.getAtsBranch()).andTypeEquals(
+ AtsArtifactTypes.WorkDefinition).and(CoreAttributeTypes.Name, name, TokenDelimiterMatch.EXACT).getResults().getExactlyOne();
+ return loadWorkDefinitionFromArtifact(artifact);
+ }
+
+ private String loadWorkDefinitionFromArtifact(ArtifactReadable artifact) throws OseeCoreException {
+ String modelText = null;
+ if (artifact != null) {
+ modelText = artifact.getSoleAttributeAsString(AtsAttributeTypes.DslSheet);
+ }
+ return modelText;
+ };
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java
new file mode 100644
index 0000000000..48e4288fb5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AbstractReview.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class AbstractReview extends WorkItem implements IAtsAbstractReview {
+
+ public AbstractReview(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public Set<IAtsActionableItem> getActionableItems() throws OseeCoreException {
+ Set<IAtsActionableItem> ais = new HashSet<IAtsActionableItem>();
+ for (Object aiGuidObj : artifact.getAttributeValues(AtsAttributeTypes.ActionableItem)) {
+ String aiGuid = (String) aiGuidObj;
+ ArtifactReadable aiArt = AtsServerImpl.get().getArtifactByGuid(aiGuid);
+ IAtsActionableItem ai = AtsServerImpl.get().getWorkItemFactory().getActionableItem(aiArt);
+ ais.add(ai);
+ }
+ return ais;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionableItem.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionableItem.java
new file mode 100644
index 0000000000..a747e0f35e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/ActionableItem.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.rmi.activation.Activator;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.core.config.TeamDefinitions;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.ResultSet;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public class ActionableItem extends AtsConfigObject implements IAtsActionableItem {
+
+ public ActionableItem(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public Collection<IAtsActionableItem> getChildrenActionableItems() {
+ Set<IAtsActionableItem> children = new HashSet<IAtsActionableItem>();
+ try {
+ for (ArtifactReadable childArt : artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Child)) {
+ IAtsActionableItem childTeamDef = AtsServerImpl.get().getWorkItemFactory().getActionableItem(childArt);
+ children.add(childTeamDef);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return children;
+ }
+
+ @Override
+ public IAtsActionableItem getParentActionableItem() {
+ IAtsActionableItem parent = null;
+ try {
+ ResultSet<ArtifactReadable> related = artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Parent);
+ if (!related.isEmpty()) {
+ parent = AtsServerImpl.get().getWorkItemFactory().getActionableItem(related.iterator().next());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return parent;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinition() {
+ IAtsTeamDefinition teamDef = null;
+ try {
+ ResultSet<ArtifactReadable> related = artifact.getRelated(AtsRelationTypes.TeamActionableItem_Team);
+ if (!related.isEmpty()) {
+ teamDef = AtsServerImpl.get().getWorkItemFactory().getTeamDef(related.iterator().next());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return teamDef;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinitionInherited() {
+ return TeamDefinitions.getImpactedTeamDef(this);
+ }
+
+ @Override
+ public void setParentActionableItem(IAtsActionableItem parentActionableItem) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setParentActionableItem not implemented");
+ }
+
+ @Override
+ public void setTeamDefinition(IAtsTeamDefinition teamDef) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setTeamDefinition not implemented");
+ }
+
+ @Override
+ public void setActionable(boolean actionable) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setActionable not implemented");
+ }
+
+ @Override
+ public void setActive(boolean active) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "ActionableItem.setActive not implemented");
+ }
+
+ @Override
+ public String getTypeName() {
+ return "Actionable Item";
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsConfigObject.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsConfigObject.java
new file mode 100644
index 0000000000..b051647c66
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsConfigObject.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.rmi.activation.Activator;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.IRelationTypeSide;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public abstract class AtsConfigObject extends org.eclipse.osee.ats.core.model.impl.AtsObject implements IAtsConfigObject {
+ protected final ArtifactReadable artifact;
+
+ public AtsConfigObject(ArtifactReadable artifact) {
+ super(artifact.getGuid(), artifact.getName());
+ this.artifact = artifact;
+ }
+
+ public void setFullName(String fullName) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setFullName not implemented");
+ }
+
+ public abstract String getTypeName();
+
+ public String getFullName() {
+ return getTypeName();
+ }
+
+ public void setActionable(boolean actionable) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setActionable not implemented");
+ }
+
+ public boolean isActionable() {
+ return getAttributeValue(AtsAttributeTypes.Actionable, false);
+ }
+
+ @SuppressWarnings("unchecked")
+ protected <T> T getAttributeValue(IAttributeType attributeType, Object defaultValue) {
+ T value = null;
+ try {
+ value = (T) artifact.getSoleAttributeValue(attributeType, defaultValue);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return value;
+ }
+
+ public void setActive(boolean active) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setActive not implemented");
+ }
+
+ public boolean isActive() {
+ return getAttributeValue(AtsAttributeTypes.Active, false);
+ }
+
+ public Collection<String> getStaticIds() {
+ Collection<String> results = Collections.emptyList();
+ try {
+ results = artifact.getAttributeValues(CoreAttributeTypes.StaticId);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return results;
+ }
+
+ public Collection<IAtsUser> getLeads() {
+ return getRelatedUsers(AtsRelationTypes.TeamLead_Lead);
+ }
+
+ public Collection<IAtsUser> getSubscribed() {
+ return getRelatedUsers(AtsRelationTypes.SubscribedUser_User);
+ }
+
+ Collection<IAtsUser> getRelatedUsers(IRelationTypeSide relation) {
+ Set<IAtsUser> results = new HashSet<IAtsUser>();
+ try {
+ for (ArtifactReadable userArt : artifact.getRelated(relation)) {
+ IAtsUser lead = AtsServerImpl.get().getUserService().getUserById(userArt.getGuid());
+ results.add(lead);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return results;
+ }
+
+ @Override
+ public Object getStoreObject() {
+ return artifact;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsWorkItemServiceImpl.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsWorkItemServiceImpl.java
new file mode 100644
index 0000000000..58b3bdaf24
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/AtsWorkItemServiceImpl.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IStateToken;
+import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workdef.WidgetResult;
+import org.eclipse.osee.ats.api.workflow.IAtsAction;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkItemService;
+import org.eclipse.osee.ats.api.workflow.transition.ITransitionListener;
+import org.eclipse.osee.ats.core.workflow.state.SimpleTeamState;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkItemServiceImpl implements IAtsWorkItemService {
+
+ private final IAtsWorkItemFactory workItemFactory;
+ private final IArtifactProvider artifactProvider;
+
+ public AtsWorkItemServiceImpl(IAtsWorkItemFactory workItemFactory, IArtifactProvider artifactProvider) {
+ this.workItemFactory = workItemFactory;
+ this.artifactProvider = artifactProvider;
+ }
+
+ @Override
+ public IAtsWorkData getWorkData(IAtsWorkItem workItem) throws OseeCoreException {
+ return new WorkData(workItemFactory.getWorkItem(workItem), artifactProvider.getArtifact(workItem));
+ }
+
+ @Override
+ public IArtifactType getArtifactType(IAtsWorkItem workItem) throws OseeCoreException {
+ return artifactProvider.getArtifact(workItem).getArtifactType();
+ }
+
+ @Override
+ public Collection<Object> getAttributeValues(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException {
+ return AtsServerImpl.get().getArtifact(atsObject).getAttributeValues(attributeType);
+ }
+
+ @Override
+ public boolean isOfType(IAtsWorkItem workItem, IArtifactType matchType) throws OseeCoreException {
+ return artifactProvider.getArtifact(workItem).getArtifactType().matches(matchType);
+ }
+
+ @Override
+ public IAtsTeamWorkflow getParentTeamWorkflow(IAtsWorkItem workItem) throws OseeCoreException {
+ return workItemFactory.getWorkItem(workItem).getParentTeamWorkflow();
+ }
+
+ @Override
+ public int getTransactionNumber(IAtsWorkItem workItem) throws OseeCoreException {
+ return artifactProvider.getArtifact(workItem).getTransaction();
+ }
+
+ @Override
+ public Collection<IAtsTeamWorkflow> getTeams(IAtsAction action) throws OseeCoreException {
+ List<IAtsTeamWorkflow> teams = new ArrayList<IAtsTeamWorkflow>();
+ for (ArtifactReadable art : AtsServerImpl.get().getArtifact(action).getRelated(
+ AtsRelationTypes.ActionToWorkflow_WorkFlow)) {
+ teams.add(AtsServerImpl.get().getWorkItemFactory().getTeamWf(art));
+ }
+ return teams;
+ }
+
+ @Override
+ public IStateToken getCurrentState(IAtsWorkItem workItem) throws OseeCoreException {
+ return new SimpleTeamState(getCurrentStateName(workItem), StateType.valueOf(AtsServerImpl.get().getArtifact(
+ workItem).getSoleAttributeValue(AtsAttributeTypes.CurrentStateType, "")));
+ }
+
+ @Override
+ public Collection<IAtsTask> getTasks(IAtsTeamWorkflow teamWf, IStateToken state) throws OseeCoreException {
+ final List<IAtsTask> tasks = new ArrayList<IAtsTask>();
+ for (ArtifactReadable art : AtsServerImpl.get().getArtifact(teamWf).getRelated(AtsRelationTypes.TeamWfToTask_Task)) {
+ String relatedState = art.getSoleAttributeValue(AtsAttributeTypes.RelatedToState, "");
+ if (state.getName().equals(relatedState)) {
+ tasks.add(AtsServerImpl.get().getWorkItemFactory().getTask(art));
+ }
+ }
+ return tasks;
+ }
+
+ @Override
+ public Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ final List<IAtsAbstractReview> reviews = new ArrayList<IAtsAbstractReview>();
+ for (ArtifactReadable art : AtsServerImpl.get().getArtifact(teamWf).getRelated(
+ AtsRelationTypes.TeamWorkflowToReview_Review)) {
+ reviews.add(AtsServerImpl.get().getWorkItemFactory().getReview(art));
+ }
+ return reviews;
+ }
+
+ @Override
+ public Collection<IAtsAbstractReview> getReviews(IAtsTeamWorkflow teamWf, IStateToken state) throws OseeCoreException {
+ final List<IAtsAbstractReview> reviews = new ArrayList<IAtsAbstractReview>();
+ for (ArtifactReadable art : AtsServerImpl.get().getArtifact(teamWf).getRelated(
+ AtsRelationTypes.TeamWorkflowToReview_Review)) {
+ String relatedState = art.getSoleAttributeValue(AtsAttributeTypes.RelatedToState, "");
+ if (state.getName().equals(relatedState)) {
+ reviews.add(AtsServerImpl.get().getWorkItemFactory().getReview(art));
+ }
+ }
+ return reviews;
+ }
+
+ @Override
+ public Collection<IAtsTask> getTasks(IAtsTeamWorkflow teamWf) throws OseeCoreException {
+ final List<IAtsTask> tasks = new ArrayList<IAtsTask>();
+ for (ArtifactReadable art : AtsServerImpl.get().getArtifact(teamWf).getRelated(AtsRelationTypes.TeamWfToTask_Task)) {
+ tasks.add(AtsServerImpl.get().getWorkItemFactory().getTask(art));
+ }
+ return tasks;
+ }
+
+ @Override
+ public IAtsTeamWorkflow getFirstTeam(IAtsAction action) throws OseeCoreException {
+ IAtsTeamWorkflow team = null;
+ Collection<IAtsTeamWorkflow> teams = getTeams(action);
+ if (!teams.isEmpty()) {
+ team = teams.iterator().next();
+ }
+ return team;
+ }
+
+ @Override
+ public String getCurrentStateName(IAtsWorkItem workItem) throws OseeCoreException {
+ return artifactProvider.getArtifact(workItem).getSoleAttributeValue(AtsAttributeTypes.CurrentState, "").replaceAll(
+ ";.*$", "");
+ }
+
+ @Override
+ public void clearImplementersCache(IAtsWorkItem workItem) {
+ // do nothing; no cache on server
+ }
+
+ @Override
+ public Collection<WidgetResult> validateWidgetTransition(IAtsWorkItem workItem, IAtsStateDefinition toStateDef) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public Collection<IAtsTask> getTaskArtifacts(IAtsWorkItem workItem) throws OseeCoreException {
+ if (workItem.isTeamWorkflow()) {
+ return getTasks((IAtsTeamWorkflow) workItem);
+ }
+ return java.util.Collections.emptyList();
+ }
+
+ @Override
+ public Collection<ITransitionListener> getTransitionListeners() {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public String getTargetedVersionStr(IAtsTeamWorkflow teamWf) {
+ String version = "";
+ try {
+ ArtifactReadable art =
+ artifactProvider.getArtifact(teamWf).getRelated(AtsRelationTypes.TeamWorkflowTargetedForVersion_Version).getOneOrNull();
+ if (art != null) {
+ version = art.getName();
+ }
+ } catch (OseeCoreException ex) {
+ version = "exception: " + ex;
+ }
+ return version;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/DecisionReview.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/DecisionReview.java
new file mode 100644
index 0000000000..5c0ed36e1b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/DecisionReview.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import org.eclipse.osee.ats.api.review.IAtsDecisionReview;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class DecisionReview extends AbstractReview implements IAtsDecisionReview {
+
+ public DecisionReview(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Goal.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Goal.java
new file mode 100644
index 0000000000..f0a1193a24
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Goal.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import org.eclipse.osee.ats.api.workflow.IAtsGoal;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class Goal extends WorkItem implements IAtsGoal {
+
+ public Goal(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/IArtifactProvider.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/IArtifactProvider.java
new file mode 100644
index 0000000000..05ed735d2b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/IArtifactProvider.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import org.eclipse.osee.ats.api.IAtsObject;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public interface IArtifactProvider {
+
+ ArtifactReadable getArtifact(IAtsObject atsObject) throws OseeCoreException;
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/PeerToPeerReview.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/PeerToPeerReview.java
new file mode 100644
index 0000000000..0bec999e68
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/PeerToPeerReview.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import org.eclipse.osee.ats.api.review.IAtsPeerToPeerReview;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public class PeerToPeerReview extends AbstractReview implements IAtsPeerToPeerReview {
+
+ public PeerToPeerReview(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Task.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Task.java
new file mode 100644
index 0000000000..ddd4f393e6
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Task.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class Task extends WorkItem implements IAtsTask {
+
+ public Task(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamDefinition.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamDefinition.java
new file mode 100644
index 0000000000..16ab511eb8
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamDefinition.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.rmi.activation.Activator;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.TeamDefinitionOptions;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.version.VersionLockedType;
+import org.eclipse.osee.ats.api.version.VersionReleaseType;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.ResultSet;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.util.Result;
+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.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public class TeamDefinition extends AtsConfigObject implements IAtsTeamDefinition {
+
+ public TeamDefinition(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public String getTypeName() {
+ return "Team Definition";
+ }
+
+ @Override
+ public Collection<IAtsActionableItem> getActionableItems() {
+ Set<IAtsActionableItem> ais = new HashSet<IAtsActionableItem>();
+ try {
+ for (Object aiGuidObj : artifact.getAttributeValues(AtsAttributeTypes.ActionableItem)) {
+ String aiGuid = (String) aiGuidObj;
+ ArtifactReadable aiArt = AtsServerImpl.get().getArtifactByGuid(aiGuid);
+ IAtsActionableItem ai = AtsServerImpl.get().getWorkItemFactory().getActionableItem(aiArt);
+ ais.add(ai);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return ais;
+ }
+
+ @Override
+ public void setParentTeamDef(IAtsTeamDefinition parentTeamDef) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setParentTeamDef not implemented");
+ }
+
+ @Override
+ public IAtsTeamDefinition getParentTeamDef() {
+ IAtsTeamDefinition parent = null;
+ try {
+ ResultSet<ArtifactReadable> related = artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Parent);
+ if (!related.isEmpty()) {
+ parent = AtsServerImpl.get().getWorkItemFactory().getTeamDef(related.iterator().next());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return parent;
+ }
+
+ @Override
+ public Collection<IAtsTeamDefinition> getChildrenTeamDefinitions() {
+ Set<IAtsTeamDefinition> children = new HashSet<IAtsTeamDefinition>();
+ try {
+ for (ArtifactReadable childArt : artifact.getRelated(CoreRelationTypes.Default_Hierarchical__Child)) {
+ IAtsTeamDefinition childTeamDef = AtsServerImpl.get().getWorkItemFactory().getTeamDef(childArt);
+ children.add(childTeamDef);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return children;
+ }
+
+ @Override
+ public Collection<IAtsUser> getLeads(Collection<IAtsActionableItem> actionableItems) {
+ return null;
+ }
+
+ @Override
+ public Collection<IAtsUser> getMembers() {
+ return getRelatedUsers(AtsRelationTypes.TeamMember_Member);
+ }
+
+ @Override
+ public Collection<IAtsUser> getMembersAndLeads() {
+ Set<IAtsUser> results = new HashSet<IAtsUser>();
+ results.addAll(getLeads());
+ results.addAll(getMembers());
+ return results;
+ }
+
+ @Override
+ public Collection<IAtsUser> getPrivilegedMembers() {
+ return getRelatedUsers(AtsRelationTypes.PrivilegedMember_Member);
+ }
+
+ @Override
+ public void setAllowCommitBranch(boolean allowCommitBranch) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setAllowCommitBranch not implemented");
+ }
+
+ @Override
+ public boolean isAllowCommitBranch() {
+ boolean set = false;
+ try {
+ set = artifact.getSoleAttributeValue(AtsAttributeTypes.AllowCommitBranch, false);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return set;
+ }
+
+ @Override
+ public Result isAllowCommitBranchInherited() {
+ if (!isAllowCommitBranch()) {
+ return new Result(false, "Team Definition [" + this + "] not configured to allow branch commit.");
+ }
+ if (!Strings.isValid(getBaslineBranchGuid())) {
+ return new Result(false, "Parent Branch not configured for Team Definition [" + this + "]");
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public void setAllowCreateBranch(boolean allowCreateBranch) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setAllowCreateBranch not implemented");
+ }
+
+ @Override
+ public boolean isAllowCreateBranch() {
+ boolean set = false;
+ try {
+ set = artifact.getSoleAttributeValue(AtsAttributeTypes.AllowCreateBranch, false);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return set;
+ }
+
+ @Override
+ public Result isAllowCreateBranchInherited() {
+ if (!isAllowCreateBranch()) {
+ return new Result(false, "Branch creation disabled for Team Definition [" + this + "]");
+ }
+ if (!Strings.isValid(getBaslineBranchGuid())) {
+ return new Result(false, "Parent Branch not configured for Team Definition [" + this + "]");
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public void setBaselineBranchGuid(String parentBranchGuid) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setBaselineBranchGuid not implemented");
+ }
+
+ @Override
+ public String getBaslineBranchGuid() {
+ return getAttributeValue(AtsAttributeTypes.BaselineBranchGuid, false);
+ }
+
+ @Override
+ public String getTeamBranchGuid() {
+ String guid = getBaslineBranchGuid();
+ if (GUID.isValid(guid)) {
+ return guid;
+ } else {
+ IAtsTeamDefinition parentTeamDef = getParentTeamDef();
+ if (parentTeamDef instanceof TeamDefinition) {
+ return parentTeamDef.getTeamBranchGuid();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public String getCommitFullDisplayName() {
+ return getName();
+ }
+
+ @Override
+ public boolean isTeamUsesVersions() throws OseeCoreException {
+ return getTeamDefinitionHoldingVersions() != null;
+ }
+
+ @Override
+ public IAtsVersion getNextReleaseVersion() {
+ IAtsVersion result = null;
+ for (IAtsVersion version : getVersions()) {
+ if (version.isNextVersion()) {
+ result = version;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinitionHoldingVersions() throws OseeCoreException {
+ IAtsTeamDefinition teamDef = null;
+ if (getVersions().size() > 0) {
+ teamDef = this;
+ } else {
+ IAtsTeamDefinition parentTda = getParentTeamDef();
+ if (parentTda != null) {
+ teamDef = parentTda.getTeamDefinitionHoldingVersions();
+ }
+ }
+ return teamDef;
+ }
+
+ @Override
+ public IAtsVersion getVersion(String name) {
+ IAtsVersion result = null;
+ for (IAtsVersion version : getVersions()) {
+ if (version.getName().equals(name)) {
+ result = version;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersions() {
+ Set<IAtsVersion> results = new HashSet<IAtsVersion>();
+ try {
+ for (ArtifactReadable verArt : artifact.getRelated(AtsRelationTypes.TeamDefinitionToVersion_Version)) {
+ IAtsVersion version = (IAtsVersion) AtsCore.getAtsConfig().getSoleByGuid(verArt.getGuid());
+ results.add(version);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return results;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersions(VersionReleaseType releaseType, VersionLockedType lockedType) {
+ return org.eclipse.osee.framework.jdk.core.util.Collections.setIntersection(getVersionsReleased(releaseType),
+ getVersionsLocked(lockedType));
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsFromTeamDefHoldingVersions(VersionReleaseType releaseType, VersionLockedType lockedType) throws OseeCoreException {
+ IAtsTeamDefinition teamDef = getTeamDefinitionHoldingVersions();
+ if (teamDef == null) {
+ return new ArrayList<IAtsVersion>();
+ }
+ return teamDef.getVersions(releaseType, lockedType);
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsLocked(VersionLockedType lockType) {
+ ArrayList<IAtsVersion> versions = new ArrayList<IAtsVersion>();
+ for (IAtsVersion version : getVersions()) {
+ if (version.isVersionLocked() && (lockType == VersionLockedType.Locked || lockType == VersionLockedType.Both)) {
+ versions.add(version);
+ } else if ((!version.isVersionLocked() && lockType == VersionLockedType.UnLocked) || lockType == VersionLockedType.Both) {
+ versions.add(version);
+ }
+ }
+ return versions;
+ }
+
+ @Override
+ public Collection<IAtsVersion> getVersionsReleased(VersionReleaseType releaseType) {
+ ArrayList<IAtsVersion> versions = new ArrayList<IAtsVersion>();
+ for (IAtsVersion version : getVersions()) {
+ if (version.isReleased() && (releaseType == VersionReleaseType.Released || releaseType == VersionReleaseType.Both)) {
+ versions.add(version);
+ } else if ((!version.isReleased() && releaseType == VersionReleaseType.UnReleased) || releaseType == VersionReleaseType.Both) {
+ versions.add(version);
+ }
+ }
+ return versions;
+ }
+
+ @Override
+ public void setWorkflowDefinition(String workflowDefinitionName) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setWorkflowDefinition not implemented");
+ }
+
+ @Override
+ public String getWorkflowDefinition() {
+ return getAttributeValue(AtsAttributeTypes.WorkflowDefinition, "");
+ }
+
+ @Override
+ public String getRelatedTaskWorkDefinition() {
+ return getAttributeValue(AtsAttributeTypes.RelatedTaskWorkDefinition, "");
+ }
+
+ @Override
+ public void setRelatedTaskWorkDefinition(String name) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setRelatedTaskWorkDefinition not implemented");
+ }
+
+ @Override
+ public void initialize(String fullname, String description, Collection<IAtsUser> leads, Collection<IAtsUser> members, Collection<IAtsActionableItem> actionableItems, TeamDefinitionOptions... teamDefinitionOptions) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setActionable not implemented");
+ }
+
+ @Override
+ public String getRelatedPeerWorkDefinition() {
+ return getAttributeValue(AtsAttributeTypes.RelatedPeerWorkflowDefinition, "");
+ }
+
+ @Override
+ public void setRelatedPeerWorkDefinition(String relatedPeerWorkDefinition) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setRelatedPeerWorkDefinition not implemented");
+ }
+
+ @Override
+ public void addRule(String rule) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.addRule not implemented");
+ }
+
+ @Override
+ public Collection<String> getRules() {
+ Collection<String> rules = new ArrayList<String>();
+ try {
+ rules = artifact.getAttributeValues(AtsAttributeTypes.RuleDefinition);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return rules;
+ }
+
+ @Override
+ public boolean hasRule(String rule) {
+ boolean result = false;
+ for (String rule2 : getRules()) {
+ if (rule.equals(rule2)) {
+ result = true;
+ break;
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public void removeRule(String rule) {
+ OseeLog.log(TeamDefinition.class, Level.SEVERE, "TeamDefinition.setActionable not implemented");
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamWorkflow.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamWorkflow.java
new file mode 100644
index 0000000000..d59dfb92d5
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/TeamWorkflow.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class TeamWorkflow extends WorkItem implements IAtsTeamWorkflow {
+
+ public TeamWorkflow(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public Set<IAtsActionableItem> getActionableItems() throws OseeCoreException {
+ Set<IAtsActionableItem> ais = new HashSet<IAtsActionableItem>();
+ for (Object aiGuidObj : artifact.getAttributeValues(AtsAttributeTypes.ActionableItem)) {
+ String aiGuid = (String) aiGuidObj;
+ ArtifactReadable aiArt = AtsServerImpl.get().getArtifactByGuid(aiGuid);
+ IAtsActionableItem ai = AtsServerImpl.get().getWorkItemFactory().getActionableItem(aiArt);
+ ais.add(ai);
+ }
+ return ais;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDefinition() throws OseeCoreException {
+ String teamDefGuid = artifact.getSoleAttributeValue(AtsAttributeTypes.TeamDefinition);
+ ArtifactReadable teamDefArt = AtsServerImpl.get().getArtifactByGuid(teamDefGuid);
+ IAtsTeamDefinition teamDef = AtsServerImpl.get().getWorkItemFactory().getTeamDef(teamDefArt);
+ return teamDef;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Version.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Version.java
new file mode 100644
index 0000000000..316824472b
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/Version.java
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.api.commit.ICommitConfigArtifact;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class Version extends AtsConfigObject implements IAtsVersion {
+
+ public Version(ArtifactReadable artifact) {
+ super(artifact);
+ }
+
+ @Override
+ public List<IAtsVersion> getParallelVersions() {
+ return null;
+ }
+
+ @Override
+ public void getParallelVersions(Set<ICommitConfigArtifact> configArts) {
+ }
+
+ @Override
+ public void setParallelVersions(List<IAtsVersion> parallelVersions) {
+ }
+
+ @Override
+ public String getBaslineBranchGuid() {
+ return null;
+ }
+
+ @Override
+ public String getBaselineBranchGuidInherited() {
+ return null;
+ }
+
+ @Override
+ public void setBaselineBranchGuid(String parentBranchGuid) {
+ }
+
+ @Override
+ public String getCommitFullDisplayName() {
+ return null;
+ }
+
+ @Override
+ public Result isAllowCreateBranchInherited() {
+ return null;
+ }
+
+ @Override
+ public boolean isAllowCreateBranch() {
+ return false;
+ }
+
+ @Override
+ public void setAllowCreateBranch(boolean allow) {
+ }
+
+ @Override
+ public boolean isAllowCommitBranch() {
+ return false;
+ }
+
+ @Override
+ public void setAllowCommitBranch(boolean allow) {
+ }
+
+ @Override
+ public Result isAllowCommitBranchInherited() {
+ return null;
+ }
+
+ @Override
+ public Date getReleaseDate() {
+ return null;
+ }
+
+ @Override
+ public void setReleaseDate(Date date) {
+ }
+
+ @Override
+ public void setReleasedDate(Date Date) {
+ }
+
+ @Override
+ public Boolean isReleased() {
+ return null;
+ }
+
+ @Override
+ public void setReleased(boolean released) {
+ }
+
+ @Override
+ public Date getEstimatedReleaseDate() {
+ return null;
+ }
+
+ @Override
+ public void setEstimatedReleasedDate(Date date) {
+ }
+
+ @Override
+ public boolean isLocked() {
+ return false;
+ }
+
+ @Override
+ public Boolean isVersionLocked() {
+ return null;
+ }
+
+ @Override
+ public void setLocked(boolean locked) {
+ }
+
+ @Override
+ public void setVersionLocked(boolean locked) {
+ }
+
+ @Override
+ public Boolean isNextVersion() {
+ return null;
+ }
+
+ @Override
+ public void setNextVersion(boolean nextVersion) {
+ }
+
+ @Override
+ public String getTypeName() {
+ return null;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkData.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkData.java
new file mode 100644
index 0000000000..7348de12b9
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkData.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.Date;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.workdef.StateType;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+public class WorkData implements IAtsWorkData {
+
+ private final ArtifactReadable artifact;
+ private final IAtsWorkItem workItem;
+
+ public WorkData(IAtsWorkItem workItem, ArtifactReadable artifact) {
+ this.workItem = workItem;
+ this.artifact = artifact;
+ }
+
+ @Override
+ public boolean isCompleted() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CurrentStateType).equals(StateType.Completed.name());
+ }
+
+ @Override
+ public IAtsUser getCompletedBy() throws OseeCoreException {
+ return AtsServerImpl.get().getUserService().getUserById(
+ artifact.getSoleAttributeValue(AtsAttributeTypes.CompletedBy, ""));
+ }
+
+ @Override
+ public Date getCompletedDate() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CompletedDate);
+ }
+
+ @Override
+ public boolean isCancelled() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CurrentStateType).equals(StateType.Cancelled.name());
+ }
+
+ @Override
+ public IAtsUser getCancelledBy() throws OseeCoreException {
+ return AtsServerImpl.get().getUserService().getUserById(
+ artifact.getSoleAttributeValue(AtsAttributeTypes.CancelledBy, ""));
+ }
+
+ @Override
+ public Date getCancelledDate() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CancelledDate);
+ }
+
+ @Override
+ public boolean isCompletedOrCancelled() throws OseeCoreException {
+ return isCompleted() || isCancelled();
+ }
+
+ @Override
+ public boolean isInWork() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CurrentStateType).equals(StateType.Working.name());
+ }
+
+ @Override
+ public String getCompletedFromState() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CompletedFromState);
+ }
+
+ @Override
+ public String getCancelledFromState() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CancelledFromState);
+ }
+
+ @Override
+ public void setCompletedFromState(String string) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setCancelledFromState(String string) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setStateType(StateType StateType) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setCompletedDate(Date completedDate) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setCancelledDate(Date cancelledDate) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setCompletedBy(IAtsUser completedBy) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public void setCancelledBy(IAtsUser cancelledBy) throws OseeCoreException {
+ throw new OseeStateException("Not implemented yet");
+ }
+
+ @Override
+ public String getArtifactTypeName() throws OseeCoreException {
+ return artifact.getArtifactType().getName();
+ }
+
+ @Override
+ public IAtsUser getCreatedBy() throws OseeCoreException {
+ return AtsCore.getUserService().getUserById(artifact.getSoleAttributeValue(AtsAttributeTypes.CreatedBy, ""));
+ }
+
+ @Override
+ public Date getCreatedDate() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(AtsAttributeTypes.CreatedDate);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItem.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItem.java
new file mode 100644
index 0000000000..f9ca95e93c
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItem.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.rmi.activation.Activator;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.data.AtsRelationTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.user.IAtsUser;
+import org.eclipse.osee.ats.api.util.IAtsChangeSet;
+import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
+import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
+import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.api.workflow.IAtsWorkData;
+import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
+import org.eclipse.osee.ats.api.workflow.state.IAtsStateManager;
+import org.eclipse.osee.ats.core.AtsCore;
+import org.eclipse.osee.ats.core.model.impl.AtsObject;
+import org.eclipse.osee.ats.rest.internal.AtsServerImpl;
+import org.eclipse.osee.framework.core.data.ResultSet;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G Dunne
+ */
+public class WorkItem extends AtsObject implements IAtsWorkItem {
+
+ protected final ArtifactReadable artifact;
+ public static final int TRANSACTION_SENTINEL = -1;
+ private IAtsStateManager stateMgr;
+ private IAtsLog atsLog;
+ private IAtsWorkData workData;
+ private IWorkDefinitionMatch match;
+
+ public WorkItem(ArtifactReadable artifact) {
+ super(artifact.getName(), artifact.getGuid());
+ this.artifact = artifact;
+ }
+
+ @Override
+ public String getDescription() {
+ try {
+ return artifact.getSoleAttributeAsString(AtsAttributeTypes.Description, "");
+ } catch (OseeCoreException ex) {
+ OseeLog.log(WorkItem.class, Level.SEVERE, ex);
+ return "exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ @Override
+ public IAtsWorkData getWorkData() {
+ if (workData == null) {
+ workData = new WorkData(this, artifact);
+ }
+ return workData;
+ }
+
+ @Override
+ public List<IAtsUser> getAssignees() throws OseeCoreException {
+ return getStateMgr().getAssignees();
+ }
+
+ @Override
+ public List<IAtsUser> getImplementers() throws OseeCoreException {
+ throw new OseeStateException("Not implemented");
+ }
+
+ @Override
+ public String getAtsId() {
+ try {
+ return artifact.getSoleAttributeAsString(AtsAttributeTypes.AtsId, getGuid());
+ } catch (OseeCoreException ex) {
+ return null;
+ }
+ }
+
+ @Override
+ public void setAtsId(String atsId, IAtsChangeSet changes) throws OseeCoreException {
+ throw new OseeStateException("Not implemented");
+ }
+
+ @Override
+ public IAtsTeamWorkflow getParentTeamWorkflow() throws OseeCoreException {
+ ArtifactReadable teamArt = null;
+ if (isTeamWorkflow()) {
+ teamArt = artifact;
+ } else if (isReview()) {
+ ResultSet<ArtifactReadable> results = artifact.getRelated(AtsRelationTypes.TeamWorkflowToReview_Team);
+ if (!results.isEmpty()) {
+ teamArt = results.iterator().next();
+ }
+ } else if (isTask()) {
+ ResultSet<ArtifactReadable> results = artifact.getRelated(AtsRelationTypes.TeamWfToTask_TeamWf);
+ if (!results.isEmpty()) {
+ teamArt = results.iterator().next();
+ }
+ }
+ return AtsServerImpl.get().getWorkItemFactory().getTeamWf(teamArt);
+ }
+
+ private boolean isReview() {
+ return this instanceof IAtsAbstractReview;
+ }
+
+ @Override
+ public IAtsStateManager getStateMgr() {
+ if (stateMgr == null) {
+ try {
+ stateMgr = AtsCore.getStateFactory().getStateManager(this, true);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(WorkItem.class, Level.SEVERE, ex);
+ }
+ }
+ return stateMgr;
+ }
+
+ @Override
+ public IAtsLog getLog() {
+ if (atsLog == null) {
+ try {
+ atsLog = AtsCore.getLogFactory().getLogLoaded(this, AtsServerImpl.get().getAttributeResolver());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(WorkItem.class, Level.SEVERE, ex);
+ }
+ }
+ return atsLog;
+ }
+
+ @Override
+ public IAtsWorkDefinition getWorkDefinition() {
+ if (match == null) {
+ match = getWorkDefinitionMatch();
+ if (match == null) {
+ return null;
+ }
+ if (!match.isMatched()) {
+ OseeLog.log(Activator.class, Level.SEVERE, match.toString());
+ return null;
+ }
+ }
+ return match.getWorkDefinition();
+ }
+
+ public IWorkDefinitionMatch getWorkDefinitionMatch() {
+ if (match == null) {
+ try {
+ match = AtsServerImpl.get().getWorkDefAdmin().getWorkDefinition(this);
+ } catch (Exception ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+ return match;
+ }
+
+ @Override
+ public IAtsStateDefinition getStateDefinition() {
+ if (getStateMgr().getCurrentStateName() == null) {
+ return null;
+ }
+ return getWorkDefinition().getStateByName(getStateMgr().getCurrentStateName());
+ }
+
+ public IAtsStateDefinition getStateDefinitionByName(String name) {
+ return getWorkDefinition().getStateByName(name);
+ }
+
+ @Override
+ public boolean isTask() {
+ return this instanceof IAtsTask;
+ }
+
+ @Override
+ public boolean isTeamWorkflow() {
+ return this instanceof IAtsTeamWorkflow;
+ }
+
+ @Override
+ public Object getStoreObject() {
+ return artifact;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemFactory.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemFactory.java
new file mode 100644
index 0000000000..25b71e39aa
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/workitem/WorkItemFactory.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.rest.internal.workitem;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.api.IAtsConfigObject;
+import org.eclipse.osee.ats.api.IAtsWorkItem;
+import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.review.IAtsAbstractReview;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.IAtsWorkItemFactory;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.api.workflow.IAtsGoal;
+import org.eclipse.osee.ats.api.workflow.IAtsTask;
+import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.orcs.data.ArtifactReadable;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkItemFactory implements IAtsWorkItemFactory {
+
+ @Override
+ public IAtsTeamWorkflow getTeamWf(Object artifact) throws OseeCoreException {
+ IAtsTeamWorkflow team = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.TeamWorkflow)) {
+ team = new TeamWorkflow((ArtifactReadable) artifact);
+ }
+ }
+ return team;
+ }
+
+ @Override
+ public IAtsWorkItem getWorkItem(Object artifact) {
+ IAtsWorkItem workItem = null;
+ try {
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.TeamWorkflow)) {
+ workItem = getTeamWf(artifact);
+ } else if (artRead.isOfType(AtsArtifactTypes.PeerToPeerReview) || artRead.isOfType(AtsArtifactTypes.DecisionReview)) {
+ workItem = getReview(artRead);
+ } else if (artRead.isOfType(AtsArtifactTypes.Task)) {
+ workItem = getTask(artRead);
+ } else if (artRead.isOfType(AtsArtifactTypes.Goal)) {
+ workItem = getGoal(artRead);
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(WorkItemFactory.class, Level.SEVERE, ex);
+ }
+ return workItem;
+ }
+
+ @Override
+ public IAtsConfigObject getConfigObject(Object artifact) throws OseeCoreException {
+ IAtsConfigObject configObject = null;
+ try {
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.Version)) {
+ configObject = getVersion(artifact);
+ } else if (artRead.isOfType(AtsArtifactTypes.TeamDefinition)) {
+ configObject = getTeamDef(artRead);
+ } else if (artRead.isOfType(AtsArtifactTypes.ActionableItem)) {
+ configObject = getActionableItem(artRead);
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(WorkItemFactory.class, Level.SEVERE, ex);
+ }
+ return configObject;
+ }
+
+ @Override
+ public IAtsVersion getVersion(Object artifact) {
+ IAtsVersion version = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.Version)) {
+ version = new Version((ArtifactReadable) artifact);
+ }
+ }
+ return version;
+ }
+
+ @Override
+ public IAtsGoal getGoal(Object artifact) throws OseeCoreException {
+ IAtsGoal goal = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.Goal)) {
+ goal = new Goal((ArtifactReadable) artifact);
+ }
+ }
+ return goal;
+ }
+
+ @Override
+ public IAtsTask getTask(Object artifact) throws OseeCoreException {
+ IAtsTask task = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.Task)) {
+ task = new Task((ArtifactReadable) artifact);
+ }
+ }
+ return task;
+ }
+
+ @Override
+ public IAtsAbstractReview getReview(Object artifact) throws OseeCoreException {
+ IAtsAbstractReview review = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.PeerToPeerReview)) {
+ review = new PeerToPeerReview(artRead);
+ } else {
+ review = new DecisionReview(artRead);
+ }
+ }
+ return review;
+ }
+
+ @Override
+ public IAtsTeamDefinition getTeamDef(Object artifact) throws OseeCoreException {
+ IAtsTeamDefinition teamDef = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.TeamDefinition)) {
+ teamDef = new TeamDefinition((ArtifactReadable) artifact);
+ }
+ }
+ return teamDef;
+ }
+
+ @Override
+ public IAtsActionableItem getActionableItem(Object artifact) throws OseeCoreException {
+ IAtsActionableItem ai = null;
+ if (artifact instanceof ArtifactReadable) {
+ ArtifactReadable artRead = (ArtifactReadable) artifact;
+ if (artRead.isOfType(AtsArtifactTypes.ActionableItem)) {
+ ai = new ActionableItem((ArtifactReadable) artifact);
+ }
+ }
+ return ai;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
index 62414e8c1a..aa88a4b205 100644
--- a/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -106,7 +106,6 @@ Import-Package: com.google.inject,
org.eclipse.osee.ats.core.client.util,
org.eclipse.osee.ats.core.client.validator,
org.eclipse.osee.ats.core.client.workflow,
- org.eclipse.osee.ats.core.client.workflow.log,
org.eclipse.osee.ats.core.client.workflow.note,
org.eclipse.osee.ats.core.client.workflow.stateitem,
org.eclipse.osee.ats.core.client.workflow.transition,
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/TeamWorkflowProviderAdapter.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/TeamWorkflowProviderAdapter.java
index 6668920950..d98b87a7a6 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/TeamWorkflowProviderAdapter.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/TeamWorkflowProviderAdapter.java
@@ -14,9 +14,8 @@ import java.util.Collection;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.ai.IAtsActionableItem;
import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
import org.eclipse.osee.ats.api.workflow.IAtsTeamWorkflow;
-import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -25,49 +24,43 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
*/
public abstract class TeamWorkflowProviderAdapter implements ITeamWorkflowProvider {
- @SuppressWarnings("unused")
@Override
public boolean isResponsibleForTeamWorkflowCreation(IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems) throws OseeCoreException {
return false;
}
- @SuppressWarnings("unused")
@Override
public IArtifactType getTeamWorkflowArtifactType(IAtsTeamDefinition teamDef, Collection<IAtsActionableItem> actionableItems) throws OseeCoreException {
return null;
}
- @SuppressWarnings("unused")
@Override
- public void teamWorkflowDuplicating(TeamWorkFlowArtifact teamArt, TeamWorkFlowArtifact dupTeamArt) throws OseeCoreException {
+ public void teamWorkflowDuplicating(IAtsTeamWorkflow teamWf, IAtsTeamWorkflow dupTeamArt) throws OseeCoreException {
// provided for subclass implementation
}
@Override
- public void teamWorkflowCreated(TeamWorkFlowArtifact teamArt) {
+ public void teamWorkflowCreated(IAtsTeamWorkflow teamWf) {
// provided for subclass implementation
}
- @SuppressWarnings("unused")
@Override
public String getWorkflowDefinitionId(IAtsWorkItem workItem) throws OseeCoreException {
return null;
}
- @SuppressWarnings("unused")
@Override
public String getRelatedTaskWorkflowDefinitionId(IAtsTeamWorkflow teamWf) throws OseeCoreException {
return null;
}
- @SuppressWarnings("unused")
@Override
- public String getPcrId(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ public String getPcrId(IAtsTeamWorkflow teamWf) throws OseeCoreException {
return null;
}
@Override
- public String getArtifactTypeShortName(TeamWorkFlowArtifact teamArt) {
+ public String getArtifactTypeShortName(IAtsTeamWorkflow teamWf) {
return null;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/OriginatorColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/OriginatorColumn.java
index cd35844721..ec9d778937 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/OriginatorColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/OriginatorColumn.java
@@ -12,6 +12,7 @@ package org.eclipse.osee.ats.column;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.nebula.widgets.xviewer.IAltLeftClickProvider;
@@ -23,6 +24,7 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -113,11 +115,13 @@ public class OriginatorColumn extends XViewerAtsColumn implements IXViewerValueC
int result = ld.open();
if (result == 0) {
IAtsUser selectedUser = AtsClientService.get().getUserAdmin().getUserFromOseeUser(ld.getSelection());
+ AtsChangeSet changes = new AtsChangeSet("ATS Prompt Change Originator");
for (AbstractWorkflowArtifact awa : awas) {
- awa.setCreatedBy(selectedUser, true);
+ awa.setCreatedBy(selectedUser, true, new Date(), changes);
+ changes.add(awa);
}
if (persist) {
- Artifacts.persistInTransaction("ATS Prompt Change Originator", awas);
+ changes.execute();
}
return true;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorOutlinePage.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorOutlinePage.java
index cbce9878b3..90145b9b55 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorOutlinePage.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorOutlinePage.java
@@ -33,6 +33,7 @@ import org.eclipse.osee.ats.api.workdef.IAtsPeerReviewDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsStateDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWidgetDefinition;
import org.eclipse.osee.ats.api.workdef.IAtsWorkDefinition;
+import org.eclipse.osee.ats.api.workdef.IWorkDefinitionMatch;
import org.eclipse.osee.ats.api.workdef.WidgetOption;
import org.eclipse.osee.ats.artifact.WorkflowManager;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -399,12 +400,12 @@ public class SMAEditorOutlinePage extends ContentOutlinePage {
private void getChildrenFromWorkDefinitionMatch(Object element, List<Object> items) {
try {
items.addAll(AtsClientService.get().getWorkDefinitionAdmin().getStatesOrderedByOrdinal(
- ((WorkDefinitionMatch) element).getWorkDefinition()));
+ ((IWorkDefinitionMatch) element).getWorkDefinition()));
} catch (OseeStateException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
- items.add(new WrappedPercentWeight(((WorkDefinitionMatch) element).getWorkDefinition()));
- items.add(new WrappedTrace(((WorkDefinitionMatch) element).getTrace()));
+ items.add(new WrappedPercentWeight(((IWorkDefinitionMatch) element).getWorkDefinition()));
+ items.add(new WrappedTrace(((IWorkDefinitionMatch) element).getTrace()));
}
private void getUsersFromDecisionReviewOpt(IAtsDecisionReviewOption revOpt, List<Object> items) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java
index bb265c6591..e2326f035a 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java
@@ -19,6 +19,7 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.artifact.WorkflowManager;
import org.eclipse.osee.ats.column.DeadlineColumn;
import org.eclipse.osee.ats.column.TeamColumn;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
@@ -27,7 +28,6 @@ import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.client.workflow.ChangeTypeUtil;
import org.eclipse.osee.ats.core.client.workflow.PriorityUtil;
-import org.eclipse.osee.ats.core.client.workflow.log.ArtifactLog;
import org.eclipse.osee.ats.core.client.workflow.note.NoteItem;
import org.eclipse.osee.ats.core.column.AssigneeColumn;
import org.eclipse.osee.ats.core.util.HoursSpentUtil;
@@ -35,6 +35,7 @@ import org.eclipse.osee.ats.core.util.PercentCompleteTotalUtil;
import org.eclipse.osee.ats.core.workflow.log.AtsLogUtility;
import org.eclipse.osee.ats.editor.widget.ReviewInfoXWidget;
import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.util.Overview;
import org.eclipse.osee.ats.workdef.StateXWidgetPage;
@@ -116,7 +117,8 @@ public class SMAPrint extends Action {
getTaskHtml(resultData);
}
resultData.addRaw(AHTML.newline());
- resultData.addRaw(AtsLogUtility.getHtml(sma.getLog(), new ArtifactLog(sma)));
+ resultData.addRaw(AtsLogUtility.getHtml(sma.getLog(),
+ AtsCore.getLogFactory().getLogProvider(sma, AtsClientService.get().getAttributeResolver())));
XResultData rd = new XResultData();
rd.addRaw(AHTML.beginMultiColumnTable(100, 1));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
index dada345f85..0f944a682f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPromptChangeStatus.java
@@ -16,7 +16,6 @@ import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
@@ -118,7 +117,6 @@ public class SMAPromptChangeStatus {
workItem.getStateMgr().addAssignee(AtsClientService.get().getUserAdmin().getCurrentUser());
}
workItem.getStateMgr().updateMetrics(workItem.getStateDefinition(), hours, percent, true);
- AtsCore.getLogFactory().writeToStore(workItem);
changes.add(workItem);
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
index a2c6ab2c48..4f0def966b 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
@@ -364,7 +364,7 @@ public class SMAWorkFlowSection extends SectionPart {
}
sb.append(" - ");
sb.append(DateUtil.getMMDDYYHHMM(sma.getCompletedDate()));
- IAtsLogItem item = sma.getStateStartedData(statePageName);
+ IAtsLogItem item = sma.getStateMgr().getStateStartedData(statePageName);
if (item != null) {
sb.append(" by ");
sb.append(AtsLogUtility.getUserName(item.getUserId()));
@@ -375,7 +375,7 @@ public class SMAWorkFlowSection extends SectionPart {
}
sb.append(" - ");
sb.append(DateUtil.getMMDDYYHHMM(sma.internalGetCancelledDate()));
- IAtsLogItem item = sma.getStateStartedData(statePageName);
+ IAtsLogItem item = sma.getStateMgr().getStateStartedData(statePageName);
if (item != null) {
sb.append(" by ");
sb.append(AtsLogUtility.getUserName(item.getUserId()));
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
index 7c27edd167..704e7ae8cc 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -39,6 +39,7 @@ import org.eclipse.osee.ats.api.workdef.IStateToken;
import org.eclipse.osee.ats.api.workdef.StateType;
import org.eclipse.osee.ats.api.workflow.log.IAtsLogItem;
import org.eclipse.osee.ats.api.workflow.log.LogType;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.branch.AtsBranchManagerCore;
import org.eclipse.osee.ats.core.client.review.AbstractReviewArtifact;
import org.eclipse.osee.ats.core.client.review.AtsReviewCache;
@@ -46,9 +47,9 @@ import org.eclipse.osee.ats.core.client.review.defect.ReviewDefectManager;
import org.eclipse.osee.ats.core.client.review.role.UserRoleManager;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsTaskCache;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.log.ArtifactLog;
import org.eclipse.osee.ats.core.config.AtsVersionService;
import org.eclipse.osee.ats.core.config.TeamDefinitions;
import org.eclipse.osee.ats.core.users.AtsCoreUsers;
@@ -301,8 +302,9 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
stateDef.getName(), XResultDataUI.getHyperlink(artifact)));
if (stateDef.getStateType() == StateType.Working) {
awa.setSoleAttributeFromString(AtsAttributeTypes.CurrentStateType, StateType.Working.name());
- TransitionManager.logWorkflowUnCompletedEvent(awa, stateDef);
- TransitionManager.logWorkflowUnCancelledEvent(awa, stateDef);
+ AtsChangeSet changes = new AtsChangeSet(ValidateAtsDatabase.class.getSimpleName());
+ TransitionManager.logWorkflowUnCompletedEvent(awa, stateDef, changes);
+ TransitionManager.logWorkflowUnCancelledEvent(awa, stateDef, changes);
awa.persist(transaction);
results.log(artifact, "testCompletedCancelledStateAttributesSet", "FIXED");
} else {
@@ -1147,7 +1149,7 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
}
for (IStateToken state : Arrays.asList(TeamState.Completed, TeamState.Cancelled)) {
if (awa.isInState(state)) {
- IAtsLogItem logItem = awa.getStateStartedData(state);
+ IAtsLogItem logItem = awa.getStateMgr().getStateStartedData(state);
if (logItem == null) {
try {
results.log(
@@ -1178,7 +1180,8 @@ public class ValidateAtsDatabase extends WorldXNavigateItemAction {
}
}
// Generate html log which will exercise all the conversions
- AtsLogUtility.getHtml(awa.getLog(), new ArtifactLog(awa), true);
+ AtsLogUtility.getHtml(awa.getLog(),
+ AtsCore.getLogFactory().getLogProvider(awa, AtsCore.getAttrResolver()), true);
// Verify that all users are resolved
for (IAtsLogItem logItem : awa.getLog().getLogItems()) {
if (logItem.getUserId() == null) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
index 2645e14122..01c8c703ee 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DuplicateWorkflowBlam.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.data.AtsRelationTypes;
import org.eclipse.osee.ats.api.team.CreateTeamOption;
+import org.eclipse.osee.ats.api.team.ITeamWorkflowProvider;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.workflow.log.LogType;
import org.eclipse.osee.ats.core.AtsCore;
@@ -32,7 +33,6 @@ import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowManager;
import org.eclipse.osee.ats.core.client.util.AtsChangeSet;
import org.eclipse.osee.ats.core.client.util.AtsUtilCore;
-import org.eclipse.osee.ats.core.client.workflow.ITeamWorkflowProvider;
import org.eclipse.osee.ats.editor.SMAEditor;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
@@ -44,8 +44,6 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
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.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -155,8 +153,7 @@ public class DuplicateWorkflowBlam extends AbstractBlam {
private void handleCreateDuplicate(Collection<TeamWorkFlowArtifact> teamArts, boolean duplicateTasks, String title) throws OseeCoreException {
Set<TeamWorkFlowArtifact> newTeamArts = new HashSet<TeamWorkFlowArtifact>();
- SkynetTransaction transaction =
- TransactionManager.createTransaction(AtsUtil.getAtsBranch(), "Duplicate Workflow");
+ AtsChangeSet changes = new AtsChangeSet("Duplicate Workflow");
for (TeamWorkFlowArtifact teamArt : teamArts) {
TeamWorkFlowArtifact dupArt =
(TeamWorkFlowArtifact) teamArt.duplicate(AtsUtil.getAtsBranch(), Arrays.asList(AtsAttributeTypes.AtsId));
@@ -166,26 +163,24 @@ public class DuplicateWorkflowBlam extends AbstractBlam {
dupArt.addRelation(AtsRelationTypes.ActionToWorkflow_Action, teamArt.getParentActionArtifact());
dupArt.getLog().addLog(LogType.Note, null, "Workflow duplicated from " + teamArt.getAtsId(),
AtsCore.getUserService().getCurrentUser().getUserId());
- AtsCore.getLogFactory().writeToStore(dupArt);
+ changes.add(dupArt);
if (duplicateTasks) {
for (TaskArtifact taskArt : teamArt.getTaskArtifacts()) {
TaskArtifact dupTaskArt = (TaskArtifact) taskArt.duplicate(AtsUtil.getAtsBranch());
dupTaskArt.getLog().addLog(LogType.Note, null, "Task duplicated from " + taskArt.getAtsId(),
AtsCore.getUserService().getCurrentUser().getUserId());
- AtsCore.getLogFactory().writeToStore(dupTaskArt);
dupArt.addRelation(AtsRelationTypes.TeamWfToTask_Task, dupTaskArt);
- dupArt.persist(transaction);
+ changes.add(dupTaskArt);
}
}
newTeamArts.add(dupArt);
- dupArt.persist(transaction);
// Notify all extension points that workflow is being duplicated in case they need to add, remove
// attributes or relations
for (ITeamWorkflowProvider teamExtension : TeamWorkFlowManager.getTeamWorkflowProviders()) {
teamExtension.teamWorkflowDuplicating(teamArt, dupArt);
}
}
- transaction.execute();
+ changes.execute();
for (TeamWorkFlowArtifact newTeamArt : newTeamArts) {
SMAEditor.editArtifact(newTeamArt);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
index aa927c959c..d3cde70c57 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
@@ -24,7 +24,6 @@ import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
import org.eclipse.osee.ats.api.notify.AtsNotifyType;
import org.eclipse.osee.ats.api.user.IAtsUser;
import org.eclipse.osee.ats.api.util.IAtsChangeSet;
-import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.notify.AtsNotificationManager;
import org.eclipse.osee.ats.core.client.task.AbstractTaskableArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
@@ -152,7 +151,8 @@ public class ExcelAtsTaskArtifactExtractor {
public void processRow(String[] row) throws OseeCoreException {
rowNum++;
monitor.setTaskName("Processing Row " + rowNum);
- TaskArtifact taskArt = ((AbstractTaskableArtifact) sma).createNewTask("", createdDate, createdBy, null, changes);
+ TaskArtifact taskArt =
+ ((AbstractTaskableArtifact) sma).createNewTask("", createdDate, createdBy, null, changes);
monitor.subTask("Validating...");
boolean valid = validateRow(row);
@@ -275,7 +275,6 @@ public class ExcelAtsTaskArtifactExtractor {
}
sma.getStateMgr().updateMetrics(sma.getStateDefinition(), hours,
sma.getStateMgr().getPercentComplete(sma.getCurrentStateName()), true);
- AtsCore.getLogFactory().writeToStore(sma);
}
}
@@ -293,7 +292,6 @@ public class ExcelAtsTaskArtifactExtractor {
}
int percentInt = percent.intValue();
sma.getStateMgr().updateMetrics(sma.getStateDefinition(), 0, percentInt, true);
- AtsCore.getLogFactory().writeToStore(sma);
}
}
@@ -334,7 +332,7 @@ public class ExcelAtsTaskArtifactExtractor {
OseeLog.logf(Activator.class, Level.SEVERE,
"Invalid Originator \"%s\" for row %d\nSetting to current user.", userName, rowNum);
}
- taskArt.internalSetCreatedBy(user);
+ taskArt.internalSetCreatedBy(user, changes);
}
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
index 49558dfbff..6428992574 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
@@ -17,11 +17,11 @@ import java.util.List;
import java.util.logging.Level;
import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
import org.eclipse.osee.ats.api.workflow.log.IAtsLog;
+import org.eclipse.osee.ats.core.AtsCore;
import org.eclipse.osee.ats.core.client.artifact.AbstractAtsArtifact;
import org.eclipse.osee.ats.core.client.task.TaskArtifact;
import org.eclipse.osee.ats.core.client.team.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.ats.core.client.workflow.log.ArtifactLog;
import org.eclipse.osee.ats.core.util.AtsObjects;
import org.eclipse.osee.ats.core.workflow.log.AtsLogUtility;
import org.eclipse.osee.ats.internal.Activator;
@@ -254,7 +254,8 @@ public class Overview {
public void addLog(AbstractWorkflowArtifact artifact) throws OseeCoreException {
IAtsLog artifactLog = artifact.getLog();
if (artifactLog != null && artifactLog.getLogItems().size() > 0) {
- AtsLogUtility.getTable(artifactLog, new ArtifactLog(artifact));
+ AtsLogUtility.getTable(artifactLog,
+ AtsCore.getLogFactory().getLogProvider(artifact, AtsCore.getAttrResolver()));
}
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/XCancellationReasonTextWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/XCancellationReasonTextWidget.java
index f535c0bde2..1c2cf4a06d 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/XCancellationReasonTextWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/XCancellationReasonTextWidget.java
@@ -50,7 +50,7 @@ public class XCancellationReasonTextWidget extends XText implements IArtifactWid
@Override
public void saveToArtifact() throws OseeCoreException {
if (Strings.isValid(getText())) {
- sma.setCancellationReason(getText());
+ sma.setCancellationReason(getText(), null);
}
}
diff --git a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockArtifact.java b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockArtifact.java
index e4ed05b86b..5690889846 100644
--- a/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockArtifact.java
+++ b/plugins/org.eclipse.osee.display.presenter.mocks/src/org/eclipse/osee/display/presenter/mocks/MockArtifact.java
@@ -284,4 +284,9 @@ public class MockArtifact implements ArtifactReadable {
return null;
}
+ @Override
+ public <T> T getSoleAttributeValue(IAttributeType attributeType, T defaultValue) throws OseeCoreException {
+ return null;
+ }
+
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
index 21d1734535..62816d1040 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManager.java
@@ -31,6 +31,8 @@ public interface AttributeManager extends AttributeContainer {
<T> T getSoleAttributeValue(IAttributeType attributeType) throws OseeCoreException;
+ <T> T getSoleAttributeValue(IAttributeType attributeType, T defaultValue) throws OseeCoreException;
+
String getSoleAttributeAsString(IAttributeType attributeType) throws OseeCoreException;
String getSoleAttributeAsString(IAttributeType attributeType, String defaultValue) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
index 548ee49650..82e9d0b1fb 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/AttributeManagerImpl.java
@@ -232,6 +232,21 @@ public abstract class AttributeManagerImpl extends BaseIdentity<String> implemen
}
@Override
+ public <T> T getSoleAttributeValue(IAttributeType attributeType, T defaultValue) throws OseeCoreException {
+ T value = defaultValue;
+ Attribute<T> attribute = null;
+ try {
+ attribute = getSoleAttribute(attributeType);
+ } catch (AttributeDoesNotExist ex) {
+ // do nothing
+ }
+ if (attribute != null) {
+ value = attribute.getValue();
+ }
+ return value;
+ }
+
+ @Override
public <T> void setSoleAttributeValue(IAttributeType attributeType, T value) throws OseeCoreException {
Attribute<T> attribute = getOrCreateSoleAttribute(attributeType);
attribute.setValue(value);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
index 35fab92ef3..dcf19e5652 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/proxy/impl/ArtifactReadOnlyImpl.java
@@ -127,6 +127,11 @@ public class ArtifactReadOnlyImpl extends AbstractProxied<Artifact> implements A
}
@Override
+ public <T> T getSoleAttributeValue(IAttributeType attributeType, T defaultValue) throws OseeCoreException {
+ return getProxiedObject().getSoleAttributeValue(attributeType, defaultValue);
+ }
+
+ @Override
public String getSoleAttributeAsString(IAttributeType attributeType) throws OseeCoreException {
return getProxiedObject().getSoleAttributeAsString(attributeType);
}
diff --git a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
index 7e55290776..920c4dd457 100644
--- a/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
+++ b/plugins/org.eclipse.osee.orcs/src/org/eclipse/osee/orcs/data/ArtifactReadable.java
@@ -45,6 +45,8 @@ public interface ArtifactReadable extends ArtifactId, HasLocalId, HasBranch, Has
<T> T getSoleAttributeValue(IAttributeType attributeType) throws OseeCoreException;
+ <T> T getSoleAttributeValue(IAttributeType attributeType, T defaultValue) throws OseeCoreException;
+
String getSoleAttributeAsString(IAttributeType attributeType) throws OseeCoreException;
String getSoleAttributeAsString(IAttributeType attributeType, String defaultValue) throws OseeCoreException;
diff --git a/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/PageCreator.java b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/PageCreator.java
index 90cadc2174..c5ee19c5bd 100644
--- a/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/PageCreator.java
+++ b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/PageCreator.java
@@ -71,7 +71,11 @@ public final class PageCreator {
}
public String getValue(String ruleName) {
- return substitutions.get(ruleName).toString();
+ AppendableRule appendableRule = substitutions.get(ruleName);
+ if (appendableRule != null) {
+ return appendableRule.toString();
+ }
+ return null;
}
public void readKeyValuePairs(ResourceToken valuesResource) {
diff --git a/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/StringOptionsRule.java b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/StringOptionsRule.java
new file mode 100644
index 0000000000..c76d7ea628
--- /dev/null
+++ b/plugins/org.eclipse.osee.template.engine/src/org/eclipse/osee/template/engine/StringOptionsRule.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.template.engine;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StringOptionsRule extends AppendableRule {
+ private final String listId;
+ private final List<String> options = new ArrayList<String>();
+
+ protected String getListId() {
+ return listId;
+ }
+
+ public StringOptionsRule(String ruleName) {
+ this(ruleName, null);
+ }
+
+ public StringOptionsRule(String ruleName, String listId) {
+ super(ruleName);
+ this.listId = listId;
+ }
+
+ @Override
+ public void applyTo(Appendable appendable) throws IOException {
+ if (listId == null) {
+ appendOptions(appendable);
+ } else {
+ appendable.append("\n<datalist id=\"");
+ appendable.append(listId);
+ appendable.append("\">\n");
+ appendOptions(appendable);
+ appendable.append("</datalist>\n");
+ }
+ }
+
+ private void appendOptions(Appendable appendable) throws IOException {
+ for (String option : getOptions()) {
+ appendable.append("<option value=\"");
+ appendable.append(option);
+ appendable.append("\" guid=\"");
+ appendable.append(option);
+ appendable.append("\">\n");
+ }
+ }
+
+ public List<String> getOptions() {
+ return options;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.x.server.parent/pom.xml b/plugins/org.eclipse.osee.x.server.parent/pom.xml
index 4d55fc8124..e3c56b0348 100644
--- a/plugins/org.eclipse.osee.x.server.parent/pom.xml
+++ b/plugins/org.eclipse.osee.x.server.parent/pom.xml
@@ -38,6 +38,9 @@
<module>../../plugins/org.eclipse.osee.ats.view.web</module>
<module>../../plugins/org.eclipse.osee.ats.presenter</module>
<module>../../plugins/org.eclipse.osee.ats.rest</module>
+ <module>../../plugins/org.eclipse.osee.ats.dsl</module>
+ <module>../../plugins/org.eclipse.osee.ats.core</module>
+ <module>../../plugins/org.eclipse.osee.ats.impl</module>
<module>../../plugins/org.eclipse.osee.ats.presenter.test</module>
<module>../../plugins/org.eclipse.osee.database</module>

Back to the top