Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-12-01 16:54:49 +0000
committerafinkbein2008-12-01 16:54:49 +0000
commitf3a551cd85f5f9c9982345d4164dc4749a5be82d (patch)
tree351e1d947a684b9ec8ae74dd585733599213cf78
parent49de4831d5cc6f7a8fb8855c8d321c10e741ba6a (diff)
downloadorg.eclipse.osee-f3a551cd85f5f9c9982345d4164dc4749a5be82d.tar.gz
org.eclipse.osee-f3a551cd85f5f9c9982345d4164dc4749a5be82d.tar.xz
org.eclipse.osee-f3a551cd85f5f9c9982345d4164dc4749a5be82d.zip
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/.classpath7
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/.project28
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/META-INF/MANIFEST.MF66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/build.properties8
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/A.gifbin0 -> 475 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/AI.gifbin0 -> 475 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/Asearch.gifbin0 -> 222 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/C.gifbin0 -> 861 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/D.gifbin0 -> 861 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/MyWorld.gifbin0 -> 475 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/P.gifbin0 -> 858 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/R.gifbin0 -> 863 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/T.gifbin0 -> 862 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/X.gifbin0 -> 866 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/action.gifbin0 -> 864 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/actionRaised.gifbin0 -> 207 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/alert_8_8.gifbin0 -> 173 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/artView.gifbin0 -> 471 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/aspect.gifbin0 -> 472 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/aspectDef.gifbin0 -> 497 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/atsNavigate.gifbin0 -> 497 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/atsPerspective.gifbin0 -> 476 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/blueCheck.gifbin0 -> 100 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/blueX.gifbin0 -> 163 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/branch.gifbin0 -> 127 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/bug.gifbin0 -> 472 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/cancel.gifbin0 -> 215 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/categoryTask.gifbin0 -> 464 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/center.gifbin0 -> 465 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/check.gifbin0 -> 131 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/clear.gifbin0 -> 595 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/collapseAll.gifbin0 -> 157 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/community.gifbin0 -> 937 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/configDef.gifbin0 -> 493 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/copyToClipboard.gifbin0 -> 604 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/cots.gifbin0 -> 864 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/currentState.gifbin0 -> 482 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/down.gifbin0 -> 332 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/downTriangle.gifbin0 -> 77 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/editAction.gifbin0 -> 590 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/email.gifbin0 -> 362 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/error.gifbin0 -> 82 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/expandAll.gifbin0 -> 164 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/export.gifbin0 -> 343 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/favorite.gifbin0 -> 283 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/filter.gifbin0 -> 211 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/folder.gifbin0 -> 916 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/globe.gifbin0 -> 1060 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/globe.jpgbin0 -> 4700 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/globePlus.gifbin0 -> 1048 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/globePlusSelect.gifbin0 -> 1036 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/globeSelect.gifbin0 -> 1045 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/greenBall.gifbin0 -> 1026 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/greenBug.gifbin0 -> 348 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/greenPlus.gifbin0 -> 318 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/group.gifbin0 -> 364 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/home.gifbin0 -> 539 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/hyper.gifbin0 -> 474 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/inHouse.gifbin0 -> 871 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/info.gifbin0 -> 85 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/info2.gifbin0 -> 121 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/metric.gifbin0 -> 870 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/myTasks.gifbin0 -> 88 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newAction.gifbin0 -> 508 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newCategory.gifbin0 -> 216 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newNote.gifbin0 -> 486 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newTask.gifbin0 -> 581 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newWorld.gifbin0 -> 480 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/newWorldSelected.gifbin0 -> 481 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/note.gifbin0 -> 475 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/openId.gifbin0 -> 860 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/openParent.gifbin0 -> 863 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/orangeR_8_8.gifbin0 -> 281 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/order.gifbin0 -> 370 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/personal.gifbin0 -> 863 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/pinEditor.gifbin0 -> 358 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/plan.gifbin0 -> 204 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/print.gifbin0 -> 607 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/product.gifbin0 -> 474 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/productDef.gifbin0 -> 501 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/publish.gifbin0 -> 862 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/rank.gifbin0 -> 475 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/redCheck.gifbin0 -> 125 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/redDot.gifbin0 -> 72 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/redRemove.gifbin0 -> 143 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/red_user.gifbin0 -> 341 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/red_user_sm.gifbin0 -> 319 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/refresh.gifbin0 -> 182 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/relate.gifbin0 -> 160 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/release.gifbin0 -> 468 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/remove.gifbin0 -> 163 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/removeAll.gifbin0 -> 204 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/repository.gifbin0 -> 861 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/reviewer.gifbin0 -> 502 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/role.gifbin0 -> 104 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/route.gifbin0 -> 470 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/sample.gifbin0 -> 983 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/search.gifbin0 -> 870 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/simpleTask.gifbin0 -> 486 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/state.gifbin0 -> 472 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/subscribed.gifbin0 -> 176 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/tanBall.gifbin0 -> 1033 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/task.gifbin0 -> 1008 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/taskSelected.gifbin0 -> 997 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/team.gifbin0 -> 946 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/tool.gifbin0 -> 474 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/up.gifbin0 -> 323 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/user.gifbin0 -> 542 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/userAdd.gifbin0 -> 576 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/user_sm.gifbin0 -> 314 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/users.gifbin0 -> 257 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/users2.gifbin0 -> 597 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/version.gifbin0 -> 477 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/warn.gifbin0 -> 338 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/whiteGear.gifbin0 -> 856 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/whiteT_8_8.gifbin0 -> 449 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/workflow.gifbin0 -> 499 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/world.gifbin0 -> 860 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/yellowBall.gifbin0 -> 1035 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/yellowN_8_8.gifbin0 -> 308 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/yellowT_8_8.gifbin0 -> 474 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/zoom.gifbin0 -> 1848 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/zoom_in.gifbin0 -> 517 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/images/zoom_out.gifbin0 -> 515 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/plugin.xml305
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/Priority.html52
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.html32
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.jpgbin0 -> 33681 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_icons.html49
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.gifbin0 -> 10936 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.jpgbin0 -> 66981 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator_view.html29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.html54
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.jpgbin0 -> 123844 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html43
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html135
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html39
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html44
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/contexts.xml45
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml8
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPGbin0 -> 37341 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml17
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html50
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdfbin0 -> 2136039 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/overview/README.txt3
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/overview/ats_overview.html27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml8
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPGbin0 -> 408866 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPGbin0 -> 25922 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/report_a_bug.html25
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/toc.xml46
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html32
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html41
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpgbin0 -> 133565 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html37
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpgbin0 -> 254740 bytes
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/current_state.html44
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/schema/AtsStateItem.exsd105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/schema/AtsWizardItem.exsd105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java78
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java38
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java113
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java99
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java105
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java67
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java72
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java44
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java200
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java61
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java76
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java180
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java172
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java123
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java213
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java180
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java133
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java69
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java58
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java179
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java325
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java158
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java1441
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java122
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java59
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java249
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewWorkflowManager.java95
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java32
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java34
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java32
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java131
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java100
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java269
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewWorkflowManager.java92
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java125
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java1339
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java358
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskableStateMachineArtifact.java90
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java424
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java600
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java84
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java36
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowManager.java148
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java135
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java53
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsCache.java133
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java144
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/BulkLoadAtsCache.java71
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java70
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java139
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java88
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java74
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java819
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java108
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAHistoryComposite.java66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java940
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java155
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java65
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java103
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java750
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java589
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java46
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java64
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java90
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java93
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java109
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java73
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java89
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java62
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java145
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java64
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java95
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java56
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java80
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java54
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java88
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java65
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java63
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java81
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java136
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/RemainingHoursStat.java93
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java198
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateEstimatedHoursStat.java153
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java151
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java143
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java92
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java118
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalEstimatedHoursStat.java85
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java84
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java84
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java99
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitManagerService.java144
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java160
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java157
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java149
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/SetAsDefaultBranchService.java163
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java187
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowMergeManagerService.java186
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java147
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java35
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java111
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java57
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java67
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsHandleAddReviewRuleStateItem.java82
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java53
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java78
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java66
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparer.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparerDriver.java24
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TxImportedValidateChangeReports.java292
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java368
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReportByHrid.java96
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java358
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java106
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java318
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java264
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java55
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java358
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java1059
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java199
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java39
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksActionHyperItem.java45
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksHyperViewArtifact.java97
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java182
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java101
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java281
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java80
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java114
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/DisplayCurrentOseeEventListeners.java44
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java97
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java198
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java122
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java115
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java45
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java24
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java47
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java110
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java257
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java70
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/OpenChangeReportByIdItem.java109
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java129
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java129
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java38
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/TeamWorkflowSearchWorkflowSearchItem.java278
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAssigneesRelations.java77
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAtsWorkItemDefinitions.java57
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java59
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToTransaction.java71
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java168
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java149
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java124
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java133
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java158
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java151
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java204
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/ITaskEditorProvider.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/IXTaskViewer.java64
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java583
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java384
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorInput.java93
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItem.java71
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItemProvider.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorProvider.java56
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSearchItemProvider.java76
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSimpleProvider.java65
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java485
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewerFactory.java61
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXWidgetActionPage.java112
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java37
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java35
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java48
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java122
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java635
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBulkLoad.java29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java87
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java281
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsNotifyUsers.java126
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPreSaveCacheRemoteEventHandler.java60
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java72
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelation.java115
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsSearchOption.java14
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItem.java437
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java58
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java164
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java60
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java306
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java285
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java56
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java96
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java321
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java446
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/StateManager.java274
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java65
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java53
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/UsersByIds.java50
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionMetrics.java114
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java170
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionTeamMetrics.java120
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java43
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java167
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java263
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java204
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java199
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java84
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java72
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XHyperlabelTeamDefinitionSelection.java73
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java113
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java25
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java37
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java134
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java269
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java101
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java165
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java291
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java56
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java527
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java96
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java74
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java133
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java144
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java109
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java49
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java125
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java185
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListAndTitleDialog.java87
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java58
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java138
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java190
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptionRule.java120
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java73
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java139
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java110
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java146
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java67
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java53
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java52
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java191
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java129
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java100
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java197
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java210
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java45
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java453
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java44
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java67
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCompletedDateColumn.java55
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCreatedDateColumn.java55
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaStateColumn.java50
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java69
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java217
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/DecisionWorkflowDefinition.java102
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/PeerToPeerWorkflowDefinition.java87
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/SimpleWorkflowDefinition.java95
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TaskWorkflowDefinition.java75
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TeamWorkflowDefinition.java136
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddDecisionReviewRule.java134
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddPeerToPeerReviewRule.java114
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewDefectXWidgetWorkItem.java25
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewRolesXWidgetWorkItem.java27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeSoleComboXWidgetWorkItem.java27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeXWidgetWorkItem.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancellationReasonStateWorkItem.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancelledFromStateWorkItem.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCompletedFromStateWorkItem.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDecisionReviewRule.java26
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDefaultWorkflowRule.java27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightPeerToPeerReviewRule.java25
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightRule.java55
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightSimpleWorkflowRule.java25
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java274
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/StateEventType.java13
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAnalyzeWorkPageDefinition.java36
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAuthorizeWorkPageDefinition.java27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCancelledWorkPageDefinition.java26
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCompletedWorkPageDefinition.java29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionCompletedWorkPageDefinition.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionDecisionWorkPageDefinition.java36
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionFollowupWorkPageDefinition.java29
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionPrepareWorkPageDefinition.java36
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsEndorseWorkPageDefinition.java38
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsImplementWorkPageDefinition.java30
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerPrepareWorkPageDefinition.java38
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerReviewWorkPageDefinition.java33
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsSimpleInWorkWorkPageDefinition.java30
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsTaskInWorkPageDefinition.java38
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/AtsDbConfig.java16
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/Diagram.java100
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramFactory.java50
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramNode.java169
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/LoadAIsAndTeamsAction.java366
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueDiagram.java89
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueLink.java97
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueNode.java110
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsMetricsComposite.java310
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java189
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IAtsMetricsProvider.java21
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorParameterProvider.java27
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorProvider.java32
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java164
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java40
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java654
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java207
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java216
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java92
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java88
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java200
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorProvider.java71
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java57
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorUISearchItemProvider.java171
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java187
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewDragAndDrop.java133
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java995
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java257
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java73
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java112
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java218
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtIdSearchItem.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypeSearchItem.java50
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypesSearchItem.java52
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java110
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsUserActivelyAssignedSearch.java91
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java116
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java86
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java131
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java60
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java59
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java71
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java88
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java53
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java73
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java139
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ReviewsSearchItem.java81
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java82
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java102
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TaskSearchWorldSearchItem.java370
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java219
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java131
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java98
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java141
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java128
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java115
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java93
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml1712
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/support/Action Import.xml101
-rw-r--r--0.5.0_20081201/org.eclipse.osee.ats/support/Task Import.xml112
520 files changed, 54001 insertions, 0 deletions
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/.classpath b/0.5.0_20081201/org.eclipse.osee.ats/.classpath
new file mode 100644
index 00000000000..64ed6b3795d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/.project b/0.5.0_20081201/org.eclipse.osee.ats/.project
new file mode 100644
index 00000000000..abda3a60482
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.ats</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/.settings/org.eclipse.jdt.core.prefs b/0.5.0_20081201/org.eclipse.osee.ats/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..a8020f2dc2e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Fri Mar 28 14:00:57 GMT 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/0.5.0_20081201/org.eclipse.osee.ats/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..385a3c30fda
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -0,0 +1,66 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ats Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.ats;singleton:=true
+Bundle-Version: 0.4.0.qualifier
+Bundle-Activator: org.eclipse.osee.ats.AtsPlugin
+Bundle-Vendor: Eclipse.org
+Require-Bundle: org.eclipse.gef,
+ org.eclipse.osee.framework.jdk.core,
+ org.eclipse.ui.forms,
+ org.eclipse.osee.framework.database,
+ org.eclipse.osee.framework.skynet.core,
+ org.eclipse.osee.framework.ui.skynet,
+ org.eclipse.core.resources,
+ org.eclipse.ui.ide,
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.help,
+ org.eclipse.osee.framework.ui.plugin,
+ org.eclipse.osee.framework.ui.swt,
+ org.eclipse.osee.framework.plugin.core,
+ org.eclipse.ui.editors,
+ org.eclipse.zest.layouts,
+ org.eclipse.osee.framework.db.connection
+Bundle-ActivationPolicy: lazy
+Export-Package: org.eclipse.osee.ats,
+ org.eclipse.osee.ats.actions,
+ org.eclipse.osee.ats.actions.wizard,
+ org.eclipse.osee.ats.artifact,
+ org.eclipse.osee.ats.config,
+ org.eclipse.osee.ats.editor,
+ org.eclipse.osee.ats.editor.help,
+ org.eclipse.osee.ats.editor.service,
+ org.eclipse.osee.ats.editor.service.branch,
+ org.eclipse.osee.ats.editor.stateItem,
+ org.eclipse.osee.ats.health,
+ org.eclipse.osee.ats.hyper,
+ org.eclipse.osee.ats.navigate,
+ org.eclipse.osee.ats.operation,
+ org.eclipse.osee.ats.report,
+ org.eclipse.osee.ats.task,
+ org.eclipse.osee.ats.util,
+ org.eclipse.osee.ats.util.Import,
+ org.eclipse.osee.ats.util.widgets,
+ org.eclipse.osee.ats.util.widgets.defect,
+ org.eclipse.osee.ats.util.widgets.dialog,
+ org.eclipse.osee.ats.util.widgets.role,
+ org.eclipse.osee.ats.workflow,
+ org.eclipse.osee.ats.workflow.flow,
+ org.eclipse.osee.ats.workflow.item,
+ org.eclipse.osee.ats.workflow.page,
+ org.eclipse.osee.ats.workflow.vue,
+ org.eclipse.osee.ats.world,
+ org.eclipse.osee.ats.world.search
+Import-Package: javax.mail,
+ javax.mail.internet,
+ org.eclipse.osee.framework.core.client,
+ org.eclipse.osee.framework.core.client.server,
+ org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.core.enums,
+ org.eclipse.osee.framework.core.exception,
+ org.eclipse.osee.framework.db.connection,
+ org.eclipse.osee.framework.db.connection.exception,
+ org.eclipse.osee.framework.db.connection.info,
+ org.eclipse.osee.framework.logging
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/build.properties b/0.5.0_20081201/org.eclipse.osee.ats/build.properties
new file mode 100644
index 00000000000..c121788a44c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ images/,\
+ support/,\
+ reference/
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/A.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/A.gif
new file mode 100644
index 00000000000..f2aac572737
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/A.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/AI.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/AI.gif
new file mode 100644
index 00000000000..5ef59b47402
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/AI.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/Asearch.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/Asearch.gif
new file mode 100644
index 00000000000..fb85678f4f8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/Asearch.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/C.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/C.gif
new file mode 100644
index 00000000000..0d494fd0ef7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/C.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/D.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/D.gif
new file mode 100644
index 00000000000..dbc0f800a1d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/D.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/MyWorld.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/MyWorld.gif
new file mode 100644
index 00000000000..96fea67137f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/MyWorld.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/P.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/P.gif
new file mode 100644
index 00000000000..b99507ab205
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/P.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/R.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/R.gif
new file mode 100644
index 00000000000..0780916eae2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/R.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/T.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/T.gif
new file mode 100644
index 00000000000..2693eb5baff
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/T.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/X.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/X.gif
new file mode 100644
index 00000000000..2b93b3cdc92
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/X.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/action.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/action.gif
new file mode 100644
index 00000000000..6a18beda16c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/action.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/actionRaised.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/actionRaised.gif
new file mode 100644
index 00000000000..0f076926979
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/actionRaised.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/alert_8_8.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/alert_8_8.gif
new file mode 100644
index 00000000000..ee2dac4a90a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/alert_8_8.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/artView.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/artView.gif
new file mode 100644
index 00000000000..9b42afcac6d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/artView.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/aspect.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/aspect.gif
new file mode 100644
index 00000000000..11d750ac0f2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/aspect.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/aspectDef.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/aspectDef.gif
new file mode 100644
index 00000000000..24d19923fc8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/aspectDef.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/atsNavigate.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/atsNavigate.gif
new file mode 100644
index 00000000000..8f529d2e366
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/atsNavigate.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/atsPerspective.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/atsPerspective.gif
new file mode 100644
index 00000000000..37e66066aad
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/atsPerspective.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/blueCheck.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/blueCheck.gif
new file mode 100644
index 00000000000..1d9c323e953
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/blueCheck.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/blueX.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/blueX.gif
new file mode 100644
index 00000000000..d90835fa494
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/blueX.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/branch.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/branch.gif
new file mode 100644
index 00000000000..9c4a6755758
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/branch.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/bug.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/bug.gif
new file mode 100644
index 00000000000..9a738e55054
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/bug.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/cancel.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/cancel.gif
new file mode 100644
index 00000000000..dc47edf0695
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/cancel.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/categoryTask.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/categoryTask.gif
new file mode 100644
index 00000000000..4c882068b69
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/categoryTask.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/center.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/center.gif
new file mode 100644
index 00000000000..6daf9d594b2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/center.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/check.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/check.gif
new file mode 100644
index 00000000000..6b3078b35cf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/check.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/clear.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/clear.gif
new file mode 100644
index 00000000000..af30a42f83d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/clear.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/collapseAll.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/collapseAll.gif
new file mode 100644
index 00000000000..a2d80a9044f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/collapseAll.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/community.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/community.gif
new file mode 100644
index 00000000000..d75b50967f0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/community.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/configDef.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/configDef.gif
new file mode 100644
index 00000000000..d5bde8dca99
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/configDef.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/copyToClipboard.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/copyToClipboard.gif
new file mode 100644
index 00000000000..540860fb103
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/copyToClipboard.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/cots.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/cots.gif
new file mode 100644
index 00000000000..01bbf4c913b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/cots.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/currentState.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/currentState.gif
new file mode 100644
index 00000000000..eb91ded1880
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/currentState.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/down.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/down.gif
new file mode 100644
index 00000000000..072b1844572
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/down.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/downTriangle.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/downTriangle.gif
new file mode 100644
index 00000000000..7ff756c38f4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/downTriangle.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/editAction.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/editAction.gif
new file mode 100644
index 00000000000..a5ac28d4c56
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/editAction.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/email.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/email.gif
new file mode 100644
index 00000000000..2cb69621de8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/email.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/error.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/error.gif
new file mode 100644
index 00000000000..c112416d5ac
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/error.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/expandAll.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/expandAll.gif
new file mode 100644
index 00000000000..0205b29176d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/expandAll.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/export.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/export.gif
new file mode 100644
index 00000000000..d11c996e570
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/export.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/favorite.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/favorite.gif
new file mode 100644
index 00000000000..e96e43ea722
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/favorite.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/filter.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/filter.gif
new file mode 100644
index 00000000000..3d061d77cbe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/filter.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/folder.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/folder.gif
new file mode 100644
index 00000000000..b6858690c89
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/folder.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/globe.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/globe.gif
new file mode 100644
index 00000000000..212a2e8ac37
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/globe.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/globe.jpg b/0.5.0_20081201/org.eclipse.osee.ats/images/globe.jpg
new file mode 100644
index 00000000000..8c094ef5f7d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/globe.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/globePlus.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/globePlus.gif
new file mode 100644
index 00000000000..88b8d1c7411
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/globePlus.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/globePlusSelect.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/globePlusSelect.gif
new file mode 100644
index 00000000000..e2aba082d16
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/globePlusSelect.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/globeSelect.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/globeSelect.gif
new file mode 100644
index 00000000000..04c16b7ee6d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/globeSelect.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/greenBall.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/greenBall.gif
new file mode 100644
index 00000000000..805446ee46e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/greenBall.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/greenBug.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/greenBug.gif
new file mode 100644
index 00000000000..b0dfd3ba982
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/greenBug.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/greenPlus.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/greenPlus.gif
new file mode 100644
index 00000000000..252d7ebcb8c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/greenPlus.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/group.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/group.gif
new file mode 100644
index 00000000000..5ba5b91c5bb
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/group.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/home.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/home.gif
new file mode 100644
index 00000000000..b288f5e78e5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/home.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/hyper.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/hyper.gif
new file mode 100644
index 00000000000..04d053e5248
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/hyper.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/inHouse.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/inHouse.gif
new file mode 100644
index 00000000000..f4eed5b5f2c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/inHouse.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/info.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/info.gif
new file mode 100644
index 00000000000..33cc76e9dc5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/info.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/info2.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/info2.gif
new file mode 100644
index 00000000000..2da001e3e98
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/info2.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/metric.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/metric.gif
new file mode 100644
index 00000000000..3601dd80841
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/metric.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/myTasks.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/myTasks.gif
new file mode 100644
index 00000000000..6d74e802b54
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/myTasks.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newAction.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newAction.gif
new file mode 100644
index 00000000000..9fdd250e994
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newAction.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newCategory.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newCategory.gif
new file mode 100644
index 00000000000..2c59ccbad2b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newCategory.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newNote.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newNote.gif
new file mode 100644
index 00000000000..2e1a393b5c1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newNote.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newTask.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newTask.gif
new file mode 100644
index 00000000000..9d8a4ffb997
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newTask.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newWorld.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newWorld.gif
new file mode 100644
index 00000000000..349018a4c2a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newWorld.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/newWorldSelected.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/newWorldSelected.gif
new file mode 100644
index 00000000000..f1f92c0728d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/newWorldSelected.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/note.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/note.gif
new file mode 100644
index 00000000000..2d8ab53eefd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/note.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/openId.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/openId.gif
new file mode 100644
index 00000000000..f5091346025
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/openId.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/openParent.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/openParent.gif
new file mode 100644
index 00000000000..3c51e519f55
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/openParent.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/orangeR_8_8.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/orangeR_8_8.gif
new file mode 100644
index 00000000000..d3893141160
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/orangeR_8_8.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/order.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/order.gif
new file mode 100644
index 00000000000..42fca3fcc9a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/order.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/personal.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/personal.gif
new file mode 100644
index 00000000000..bce90f6ee96
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/personal.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/pinEditor.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/pinEditor.gif
new file mode 100644
index 00000000000..dfc1dabbb3e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/pinEditor.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/plan.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/plan.gif
new file mode 100644
index 00000000000..94eedf6f929
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/plan.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/print.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/print.gif
new file mode 100644
index 00000000000..045de755326
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/print.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/product.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/product.gif
new file mode 100644
index 00000000000..346a94d0201
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/product.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/productDef.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/productDef.gif
new file mode 100644
index 00000000000..3c8f545dc61
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/productDef.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/publish.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/publish.gif
new file mode 100644
index 00000000000..a031b62c2d3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/publish.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/rank.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/rank.gif
new file mode 100644
index 00000000000..a013d4ed09e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/rank.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/redCheck.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/redCheck.gif
new file mode 100644
index 00000000000..8da601e66d0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/redCheck.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/redDot.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/redDot.gif
new file mode 100644
index 00000000000..532db639899
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/redDot.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/redRemove.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/redRemove.gif
new file mode 100644
index 00000000000..6f647666d32
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/redRemove.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/red_user.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/red_user.gif
new file mode 100644
index 00000000000..f674064cdd4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/red_user.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/red_user_sm.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/red_user_sm.gif
new file mode 100644
index 00000000000..f91ca279748
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/red_user_sm.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/refresh.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/refresh.gif
new file mode 100644
index 00000000000..a063c230aca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/refresh.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/relate.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/relate.gif
new file mode 100644
index 00000000000..870934b6934
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/relate.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/release.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/release.gif
new file mode 100644
index 00000000000..7e31d4303e2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/release.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/remove.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/remove.gif
new file mode 100644
index 00000000000..2cd9c544436
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/remove.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/removeAll.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/removeAll.gif
new file mode 100644
index 00000000000..28a3785aaca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/removeAll.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/repository.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/repository.gif
new file mode 100644
index 00000000000..44d16935949
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/repository.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/reviewer.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/reviewer.gif
new file mode 100644
index 00000000000..f3b67a87f7e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/reviewer.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/role.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/role.gif
new file mode 100644
index 00000000000..f1e585bdf72
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/role.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/route.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/route.gif
new file mode 100644
index 00000000000..8a945332071
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/route.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/sample.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/sample.gif
new file mode 100644
index 00000000000..34fb3c9d8cb
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/sample.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/search.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/search.gif
new file mode 100644
index 00000000000..2e772da925f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/search.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/simpleTask.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/simpleTask.gif
new file mode 100644
index 00000000000..faad0cbbc08
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/simpleTask.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/state.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/state.gif
new file mode 100644
index 00000000000..e45bada95db
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/state.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/subscribed.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/subscribed.gif
new file mode 100644
index 00000000000..9e1b70f295f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/subscribed.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/tanBall.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/tanBall.gif
new file mode 100644
index 00000000000..e1dde912dcb
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/tanBall.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/task.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/task.gif
new file mode 100644
index 00000000000..9f987b6ca2e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/task.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/taskSelected.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/taskSelected.gif
new file mode 100644
index 00000000000..e747b65cb24
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/taskSelected.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/team.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/team.gif
new file mode 100644
index 00000000000..68a0f1e738a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/team.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/tool.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/tool.gif
new file mode 100644
index 00000000000..c4d1c761a14
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/tool.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/up.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/up.gif
new file mode 100644
index 00000000000..07164754e5c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/up.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/user.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/user.gif
new file mode 100644
index 00000000000..79723a4bf1d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/user.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/userAdd.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/userAdd.gif
new file mode 100644
index 00000000000..3fdf0738e4c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/userAdd.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/user_sm.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/user_sm.gif
new file mode 100644
index 00000000000..d2780011574
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/user_sm.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/users.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/users.gif
new file mode 100644
index 00000000000..bb86ad37cc2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/users.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/users2.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/users2.gif
new file mode 100644
index 00000000000..d28c326dea2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/users2.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/version.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/version.gif
new file mode 100644
index 00000000000..91868db39c4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/version.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/warn.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/warn.gif
new file mode 100644
index 00000000000..14009e9974d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/warn.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/whiteGear.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/whiteGear.gif
new file mode 100644
index 00000000000..837074b1536
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/whiteGear.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/whiteT_8_8.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/whiteT_8_8.gif
new file mode 100644
index 00000000000..cede7c6806b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/whiteT_8_8.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/workflow.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/workflow.gif
new file mode 100644
index 00000000000..d4f14922643
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/workflow.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/world.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/world.gif
new file mode 100644
index 00000000000..b88343e5ebf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/world.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/yellowBall.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowBall.gif
new file mode 100644
index 00000000000..07c5346e0c4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowBall.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/yellowN_8_8.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowN_8_8.gif
new file mode 100644
index 00000000000..ec06366b2e9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowN_8_8.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/yellowT_8_8.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowT_8_8.gif
new file mode 100644
index 00000000000..df68897ca1e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/yellowT_8_8.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/zoom.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom.gif
new file mode 100644
index 00000000000..4b0a1212823
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_in.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_in.gif
new file mode 100644
index 00000000000..2ab25e5cb78
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_in.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_out.gif b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_out.gif
new file mode 100644
index 00000000000..11ac62bfe85
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/images/zoom_out.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/plugin.xml b/0.5.0_20081201/org.eclipse.osee.ats/plugin.xml
new file mode 100644
index 00000000000..7082c18ab0b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/plugin.xml
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension-point id="AtsNavigateItem" name="AtsNavigateItem" schema="schema/AtsNavigateItem.exsd"/>
+ <extension-point id="AtsStateItem" name="AtsStateItem" schema="schema/AtsStateItem.exsd"/>
+ <extension-point id="AtsAIandTeamConfig" name="AtsAIandTeamConfig" schema="schema/AtsAIandTeamConfig.exsd"/>
+ <extension-point id="AtsWizardItem" name="AtsWizardItem" schema="schema/AtsWizardItem.exsd"/>
+ <extension-point id="AtsTeamWorkflow" name="AtsTeamWorkflow" schema="schema/AtsTeamWorkflow.exsd"/>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.eclipse.osee.ats.editor.SMAEditor"
+ icon="images/plan.gif"
+ default="false"
+ id="org.eclipse.osee.ats.editor.SMAEditor"
+ name="ATS Workflow Editor"/>
+ <editor
+ class="org.eclipse.osee.ats.task.TaskEditor"
+ default="false"
+ icon="images/task.gif"
+ id="org.eclipse.osee.ats.editor.TaskEditor"
+ name="ATS Task Editor"/>
+ <editor
+ class="org.eclipse.osee.ats.world.WorldEditor"
+ default="false"
+ icon="images/globe.gif"
+ id="org.eclipse.osee.ats.world.WorldEditor"
+ name="ATS World Editor">
+ </editor>
+ </extension>
+ <extension point="org.eclipse.osee.framework.skynet.core.ArtifactFactory">
+ <ArtifactFactory classname="org.eclipse.osee.ats.artifact.AtsArtifactFactory"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.HttpServerRequest">
+ <IHttpServerRequest
+ classname="org.eclipse.osee.ats.util.AtsHttpServerRequest"/>
+ </extension>
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="reference/toc.xml"
+ primary="true"/>
+ </extension>
+ <extension
+ point="org.eclipse.help.contexts">
+ <contexts file="reference/contexts.xml"/>
+ <contexts file="reference/newActionWizard/contexts.xml"/>
+ <contexts file="reference/decision_review_workflow/contexts.xml"/>
+ <contexts
+ file="reference/peer_to_peer_review_workflow/contexts.xml">
+ </contexts>
+ </extension>
+<extension point="org.eclipse.ui.perspectives">
+ <perspective
+ name="ATS"
+ class="org.eclipse.osee.ats.ATSPerspective"
+ fixed="false"
+ id="org.eclipse.osee.ats.ATSPerspective"
+ icon="images/atsPerspective.gif">
+ </perspective>
+</extension>
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
+ <perspectiveShortcut id="org.eclipse.osee.ats.ATSPerspective"/>
+ </perspectiveExtension>
+ <perspectiveExtension targetID="osee.define.PerspectiveFactory">
+ <perspectiveShortcut id="org.eclipse.osee.ats.ATSPerspective"/>
+ </perspectiveExtension>
+ <perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
+ <perspectiveShortcut id="org.eclipse.osee.ats.ATSPerspective"/>
+ </perspectiveExtension>
+ <perspectiveExtension targetID="org.eclipse.osee.ats.ATSPerspective">
+ <perspectiveShortcut id="org.eclipse.jdt.ui.JavaPerspective"/>
+ <perspectiveShortcut id="org.eclipse.ui.resourcePerspective"/>
+ <perspectiveShortcut id="osee.define.PerspectiveFactory"/>
+ </perspectiveExtension>
+ </extension>
+
+ <extension
+ id="org.eclipse.osee.ats"
+ name="ATS"
+ point="org.eclipse.ui.views">
+ <category
+ name="OSEE ATS"
+ id="org.eclipse.osee.ats.category"/>
+ <view
+ class="org.eclipse.osee.ats.navigate.NavigateView"
+ icon="images/atsNavigate.gif"
+ category="org.eclipse.osee.ats.category"
+ name="ATS Navigator"
+ id="org.eclipse.osee.ats.navigate.NavigateView">
+ </view>
+ <view
+ class="org.eclipse.osee.ats.hyper.ActionHyperView"
+ icon="images/hyper.gif"
+ category="org.eclipse.osee.ats.category"
+ name="Action View"
+ id="org.eclipse.osee.ats.hyper.ActionHyperView">
+ </view>
+<!-- Don't allow access to this yet
+ <view
+ class="org.eclipse.osee.ats.hyper.ActionSkyWalker"
+ icon="images/hyper.gif"
+ category="org.eclipse.osee.ats.category"
+ name="Action View"
+ id="org.eclipse.osee.ats.hyper.ActionSkyWalker">
+ </view>
+-->
+>>>>>>> .merge-right.r20369
+ <view
+ class="org.eclipse.osee.ats.hyper.ArtifactHyperView"
+ icon="images/artView.gif"
+ category="org.eclipse.osee.ats.category"
+ name="Artifact View"
+ id="org.eclipse.osee.ats.hyper.ArtifactHyperView">
+ </view>
+ </extension>
+ <extension
+ id="AtsDatabaseConfig"
+ name="AtsDatabaseConfig"
+ point="org.eclipse.osee.framework.database.IDbInitializationTask">
+ <DatabaseTask
+ classname="org.eclipse.osee.ats.config.AtsDatabaseConfig">
+ </DatabaseTask>
+ </extension>
+ <extension
+ point="org.eclipse.osee.ats.AtsStateItem">
+ <AtsStateItem classname="org.eclipse.osee.ats.editor.stateItem.AtsDecisionReviewPrepareStateItem"/>
+ <AtsStateItem classname="org.eclipse.osee.ats.editor.stateItem.AtsDecisionReviewDecisionStateItem"/>
+ <AtsStateItem
+ classname="org.eclipse.osee.ats.editor.stateItem.AtsPeerToPeerReviewPrepareStateItem">
+ </AtsStateItem>
+ <AtsStateItem
+ classname="org.eclipse.osee.ats.editor.stateItem.AtsPeerToPeerReviewReviewStateItem">
+ </AtsStateItem>
+ <AtsStateItem
+ classname="org.eclipse.osee.ats.editor.stateItem.AtsForceAssigneesToTeamLeadsStateItem">
+ </AtsStateItem>
+ <AtsStateItem
+ classname="org.eclipse.osee.ats.editor.stateItem.AtsHandleAddReviewRuleStateItem">
+ </AtsStateItem>
+ </extension>
+ <extension
+ id="ATS_Skynet_Types"
+ name="ATS_Skynet_Types"
+ point="org.eclipse.osee.framework.skynet.core.OseeTypes">
+ <ExcelFile
+ file="support/ATS_Skynet_Types.xml"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.ArtifactTypeImage">
+ <ArtifactImage
+ ArtifactTypeName="Decision Review"
+ ImagePath="images/R.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Action"
+ ImagePath="images/action.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Review"
+ ImagePath="images/R.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Config Definition"
+ ImagePath="images/configDef.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Reviewer"
+ ImagePath="images/reviewer.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Product Impact"
+ ImagePath="images/product.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Product Definition"
+ ImagePath="images/productDef.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Version"
+ ImagePath="images/version.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Aspect Definition"
+ ImagePath="images/aspectDef.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Aspect Impact"
+ ImagePath="images/aspect.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Task"
+ ImagePath="images/task.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Actionable Item"
+ ImagePath="images/AI.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Universal Group"
+ ImagePath="images/group.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Team Workflow"
+ ImagePath="images/workflow.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="User Community"
+ ImagePath="images/community.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="Team Definition"
+ ImagePath="images/team.gif"/>
+ <ArtifactImage
+ ArtifactTypeName="PeerToPeer Review"
+ ImagePath="images/R.gif">
+ </ArtifactImage>
+ </extension>
+ <extension
+ id="TaskMetrics"
+ name="TaskMetrics"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.ats.operation.TaskMetrics">
+ </Operation>
+ </extension>
+ <extension
+ id="ConnectWorkflowToTransaction"
+ name="Connect Workflow To Transaction"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation className="org.eclipse.osee.ats.operation.ConnectWorkflowToTransaction"/>
+ </extension>
+ <extension
+ id="ats"
+ point="org.eclipse.osee.framework.ui.skynet.ArtifactRenderer">
+ <Renderer classname="org.eclipse.osee.ats.editor.AtsRenderer"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.DefaultInitialBranchProvider">
+ <Provider class="org.eclipse.osee.ats.util.TeamBasedDefaultBranchProvider"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.ArtifactAnnotation">
+ <ArtifactAnnotation
+ classname="org.eclipse.osee.ats.util.AtsArtifactAnnotations">
+ </ArtifactAnnotation>
+ <ArtifactAnnotation
+ classname="org.eclipse.osee.ats.artifact.annotation.ReviewAnnotationHandler">
+ </ArtifactAnnotation>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.AtsLib">
+ <AtsLib
+ classname="org.eclipse.osee.ats.util.AtsLib">
+ </AtsLib>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.ui.skynet.XWidgetProvider">
+ <XWidgetProvider
+ classname="org.eclipse.osee.ats.util.widgets.XWidgetProvider">
+ </XWidgetProvider>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.ArtifactCheck">
+ <ArtifactCheck
+ classname="org.eclipse.osee.ats.util.AtsArtifactChecks">
+ </ArtifactCheck>
+ </extension>
+ <extension
+ id="ImportTasksFromSpreadsheet"
+ name="ImportTasksFromSpreadsheet"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.ats.operation.ImportTasksFromSpreadsheet">
+ </Operation>
+ </extension>
+ <extension
+ id="ImportTasksFromSimpleList"
+ name="ImportTasksFromSimpleList"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.ats.operation.ImportTasksFromSimpleList">
+ </Operation>
+ </extension>
+ <extension
+ id="AtsWorkDefinitions"
+ name="AtsWorkDefinitions"
+ point="org.eclipse.osee.framework.ui.skynet.WorkDefinitionProvider">
+ <WorkDefinitionProvider
+ classname="org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions">
+ </WorkDefinitionProvider>
+ </extension>
+ <extension
+ id="ReAssignATSObjectsToUser"
+ name="ReAssignATSObjectsToUser"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.ats.operation.ReAssignATSObjectsToUser">
+ </Operation>
+ </extension>
+ <extension
+ id="AtsWidgetProvider"
+ name="AtsWidgetProvider"
+ point="org.eclipse.osee.framework.ui.skynet.XWidgetProvider">
+ <XWidgetProvider
+ classname="org.eclipse.osee.ats.util.widgets.AtsWidgetProvider">
+ </XWidgetProvider>
+ </extension>
+ <extension
+ id="TranslateImportedValidateChangeReports"
+ name="TranslateImportedValidateChangeReports"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.ats.health.TxImportedValidateChangeReports">
+ </Operation>
+ </extension>
+</plugin>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/Priority.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/Priority.html
new file mode 100644
index 00000000000..0fa30d8aeab
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/Priority.html
@@ -0,0 +1,52 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Priorities for classifying problems</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Priorities for classifying problems</h1>
+
+<Table border><TR><Th>Priority</Th><Th>Description</Th><Th>MIL-STD-498 Description</Th></TR>
+<TR>
+ <TD align=center>1</TD>
+ <TD>Prevents end users from performing an essential task that results in work stoppages. The impact to project cost/schedule requires an immediate resolution and a special release may be necessary.</TD>
+ <TD>a. Prevent the accomplishment of an operational or mission essential capability<br>b. Jeopardize safety, security, or other requirement designated "critical"</TD>
+</TR>
+
+<TR>
+ <TD align=center>2</TD>
+ <TD>Adversely affects end users from performing an essential task. Significant impact to project cost/schedule with resolution needed within 3 weeks.</TD>
+ <TD>a. Adversely affect the accomplishment of an operational or mission essential capability and no work-around solution is known.<br>b. Adversely affect technical, cost, or schedule risks to the project or to life cycle support of the system, and no work-around solution is known</TD>
+</TR>
+
+<TR>
+ <TD align=center>3</TD>
+ <TD>Hinders end users from performing an essential task or a capability is behind schedule. Impact to project cost/schedule with resolution needed within 6 weeks.</TD>
+ <TD>a. Adversely affect the accomplishment of an operational or mission essential capability but a work-around solution is known.<br>b. Adversely affect technical, cost, or schedule risks to the project or to life cycle support of the system, but a work-around solution is known</TD>
+</TR>
+
+<TR>
+ <TD align=center>4</TD>
+ <TD>Minor impact to end users or is a capability being developed per schedule. Can be resolved per normal release schedule.</TD>
+ <TD>a. Result in user/operator inconvenience or annoyance but does not affect a required operational or mission essential capability.<br>b. Result in inconvenience or annoyance for development or support personnel, but does not prevent the accomplishment of those responsibilities.</TD></TR>
+
+<TR>
+ <TD align=center>5</TD>
+ <TD>An inconvenience or annoyance. Can be resolved as schedule and budget permits.</TD>
+ <TD>Any other effect</TD>
+</TR>
+</Table>
+
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.html
new file mode 100644
index 00000000000..81dbb7dee3c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.html
@@ -0,0 +1,32 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Action View</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Action View</h1>
+ <br/>
+ <img src="ats_action_view.jpg"/>
+ <h2>Purpose</h2>
+ Shows a graphical representation of the currently open Action or Team Workflow.
+ <h2>How to do it</h2>
+ Double-click open any Action or Team Workflow. Action View will show parent child
+ relationship between Action and it's children Team Workflows. Cyan outline show currently
+ open editor.
+ <h2>ToolTip</h2>
+ Hover over any object to determine information about current state, assignees and work to be done.
+ <h2>Double-Click / Right-Click</h2>
+ Double-Click to open any object in the ATS Editor or right click for more options.
+
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.jpg b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.jpg
new file mode 100644
index 00000000000..9d42cd75ae9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_action_view.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_icons.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_icons.html
new file mode 100644
index 00000000000..fc95fd6ae71
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_icons.html
@@ -0,0 +1,49 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Icons</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Icons</h1>
+ <br/>
+ <h2>ATS Objects</h2>
+ <br/>
+ <img src="../images/action.gif"/> denotes an Action, the top level object in ATS<br/>
+ <img src="../images/workflow.gif"/> denotes a Team Workflow; moves team through completion of change<br/>
+ <img src="../images/task.gif"/> denotes a Task; lightweight workflow that is performed during Team Workflow states<br/>
+ <img src="../images/version.gif"/> denotes the ATS targeted for release version<br/>
+ <img src="../images/R.gif"/> denotes the ATS review<br/>
+ <br/>
+ <h2>ATS Overlays</h2>
+ <img src="../images/warn.gif"/> warning that something needs to be addressed; open object for more information<br/>
+ <img src="../images/orangeR_8_8.gif"/> released version<br/>
+ <img src="../images/yellowN_8_8.gif"/> next release version<br/>
+ <img src="../images/favorite.gif"/> ATS object marked as user's favorite; select "My Favorites" to load all marked<br/>
+ <img src="../images/subscribed.gif"/> ATS object user desires to receive email upon every state transition<br/>
+ <img src="../images/whiteT_8_8.gif"/> ATS object is obtaining estimated hours, percent complete, hours spent and remaining hours from tasks<br/>
+ <br/>
+ <h2>ATS Operations</h2>
+ <br/>
+ Select <img src="../images/newAction.gif"/> to create a new action<br/>
+ Select <img src="../images/newTask.gif"/> to create a new task<br/>
+ Select <img src="../images/refresh.gif"/> to refresh current view<br/>
+ Select <img src="../images/print.gif"/> to print the ATS Results<br/>
+ Select <img src="../images/email.gif"/> to email the ATS Results to an OSEE user<br/>
+ Select <img src="../images/export.gif"/> to export the ATS Results to CSV file<br/>
+ Select <img src="../images/bug.gif"/> to <A href="report_a_bug.html"/>Report a Bug</A>.<br/>
+ <br/>
+ <h2>ATS Configuration</h2>
+ <img src="../images/team.gif"/> denotes a team configured to do work in ATS<br/>
+ <img src="../images/AI.gif"/> denotes an Actionable Item that a user can create an Action against<br/>
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.gif b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.gif
new file mode 100644
index 00000000000..d5225ac9f7a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.gif
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.jpg b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.jpg
new file mode 100644
index 00000000000..1f1b55f52bc
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator_view.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator_view.html
new file mode 100644
index 00000000000..f94beee9514
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_navigator_view.html
@@ -0,0 +1,29 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Navigator</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Navigator</h1>
+ <br/>
+ <img src="ats_navigator.jpg"/>
+ <h2>Purpose</h2>
+ Central location to launch ATS searches, perform quick navigation and kickoff metrics.
+ <h2>How to do it</h2>
+ Double-click any navigation item to kickoff the corresponding search, action, report.
+ <h2>Filter</h2>
+ Filter out all navigation items that conains the entered text.
+ Select the clear action (<img src="../images/clear.gif"/>) to clear out the text
+ and restore all navigation items.
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.html
new file mode 100644
index 00000000000..212e0c7d2ad
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.html
@@ -0,0 +1,54 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS World View</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS World View</h1>
+ <br/>
+ <img src="ats_world_view.jpg"/>
+ <h2>Purpose</h2>
+ Shows ATS workflow objects including Actions, Team Workflows, Tasks and Reviews that were
+ returned from a search normally performed by the ATS Navigator.
+ <h2>How to do it</h2>
+ Double-click search item from ATS Navigator. ATS World will show that it is loading. Upon
+ return, ATS World will contain all ATS objects from the search. In addition, a plus is shown
+ next to any object. Upon selection, viewer will expand to show all children of the selected
+ object.
+ <h2>Open ATS Action, Team Workflow, Task or Review</h2>
+ Double-click to open any item open in ATS Workflow Editor.
+ <h2>Sorting</h2>
+ Selecting column headers will sort that column. Holding down Ctrl and selecting successive
+ columns will enable multi sort. Re-selecting a column will reverse sort that column.
+ The status label at the bottom will show the columns being sorted and which direction the
+ sort is being performed. To remove all sorting, right-click and select "Remove All Sorting".
+ <h2>Bottom Status Line</h2>
+ The bottom status line will show the total number of objects loaded into the table, the total
+ shown and the total selected. It will also show all the sorts and filters that are enabled.
+ <h2>Top Status Line</h2>
+ The top status line will show the name of the search that populated the ATS World View. A
+ warning icon (<img src="../images/warn.gif"/>) will show if the search returned no objects to show.
+ <h2>Filtering</h2>
+ Bottom right of the ATS World shows a filter box that is a quick way to filter by one or two words.
+ Simply type in a string, press enter and ATS World will only show those loaded objects that where one of the
+ visible cells contains the typed text. This is a case in-sensitive search. Select the clear
+ action (<img src="../images/clear.gif"/>) to clear out the text and restore all loaded actions.
+ <h2>Actions</h2>
+ Select <img src="../images/A.gif"/> to load ATS World with all the actions that you have work to do on.<br/>
+ Select <img src="../images/action.gif"/> to create a new Action.<br/>
+ Select <img src="../images/rank.gif"/> to rank actions by deadline date then by priority and annual cost avoidence.<br/>
+ Select <img src="../images/refresh.gif"/> to refresh the current search.<br/>
+ Select <img src="../..//osee.skynet.gui/images/customize.gif"/> to <A href="../../osee.skynet.gui/reference/table_customization.html"/>Customize Table</A>.<br/>
+ Select <img src="../images/bug.gif"/> to <A href="report_a_bug.html"/>Report a Bug</A>.<br/>
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.jpg b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.jpg
new file mode 100644
index 00000000000..75176a1d039
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/ats_world_view.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html
new file mode 100644
index 00000000000..b43276fa6a8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html
@@ -0,0 +1,43 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Configure ATS for Help</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+<body>
+ <h1>Configure ATS for Help</h1>
+ <h2>Purpose</h2>
+ To configure ATS workflows to use the integrated help system. ATS help useds a combination of widget tooltip, static help pages, dynamic help content configured through extended plugins and built into the VUE workflow diagrams.
+ <h2>How to do it</h2>
+ <ul>
+ <li>Workflow Page Help</li>
+ <li>Workflow Widget Help</li>
+ <ul>
+ <li>Declared tooltip is shown as tooltip when hover over label</li>
+ <li>Double-Click label pops open html dialog if help contextId and pluginId are set</li>
+ <li>Double-Click label pops open tooltip</li>
+ <li>Top down order of obtaining help content</li>
+ <ul>
+ <li>Setting tooltip in IStateItem interface</li>
+ <li>VUE Diagram</li>
+ <ul>
+ <li>in xWidget def: tooltip="put help here"</li>
+ <li>in xWidget def: helpPluginId="osee.ats" helpContextId="atsPriority" help is obtained from Eclipse context.xml declaration within plugin using given context id</li>
+ <li>NOTE: Context Ids can not have . notation.</li>
+ </ul>
+ <li>ATSAttributes.java declarations</li>
+ </ul>
+ </ul>
+ </ul>
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html
new file mode 100644
index 00000000000..dd16b0b6536
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html
@@ -0,0 +1,135 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+<head>
+<title>Configure ATS for Tracking</title>
+<LINK rel="stylesheet" type="text/css"
+ href="../../osee.help/html/style.css">
+</head>
+
+<body>
+<h1>Configure ATS for Tracking</h1>
+<h2>Purpose</h2>
+ATS is used to track any type of change throughout the lifecycle of a
+project. Below are the steps to configure ATS for tracking something
+new.
+<h2>How to do it</h2>
+<ul>
+ <li>Review <a href="../overview/ats_overview.html">ATS
+ Overview</a> to understand ATS Concepts, Terms and Architecture. Pay
+ special attention to ATS Terms</li>
+ <li>Determine what Actionable Items (AIs) need to be available to
+ the user to select from. This can be anything from a single AI for
+ tracking something like a tool or even an activity that needs to be
+ done to a hierarchical decomposition of an entire software product or
+ engineering program.</li>
+ <ul>
+ <li>Considerations:</li>
+ <ul>
+ <li>Item should be in the context of what the user would
+ recognize. eg: OSEE ATS World View versus something unknown to the
+ user such as AtsWorldView.java.</li>
+ <li>Decompose AI into children AI when it is desired to
+ sort/filter/report by that decomposition.</li>
+ </ul>
+ <li>Actionable Item attributes to be configured:</li>
+ <ul>
+ <li>Name: Unique name that the user would identify with.</li>
+ <li>Active: yes (converted to "no" when AI is no longer
+ actionable)</li>
+ </ul>
+ <li>Actionable Item relations to be configured:</li>
+ <ul>
+ <li>TeamActionableItem: relate to Team Definition that is
+ responsible for performing the tasks associated with this AI. NOTE:
+ If this relation is not set, ATS will walk up the Default Hierarchy
+ to find the first AI with this relation.</li>
+ </ul>
+ </ul>
+ <li>Determine the teams that are going to perform the tasks that
+ are associated with the AIs selected by the user.</li>
+ <ul>
+ <li>Considerations:</li>
+ <ul>
+ <li>Use separate teams if certain changes are to be managed by
+ different leads.</li>
+ <li>Use separate teams if one team's completion and releasing is
+ independent of another's.</li>
+ <li>Use separate teams if team members are separate.</li>
+ <li>Use separate teams if different workflows are required for
+ one set of AIs than another.</li>
+ </ul>
+ <li>Team attributes to be configured:</li>
+ <ul>
+ <li>Name: Unique team name that is distinguishable from other
+ teams in a list.</li>
+ <li>Description: Full description of the team and it's scope.</li>
+ <li>Active: yes (converted to "no" when AI is no longer
+ actionable)</li>
+ <li>Team Uses Versions: yes if team workflows are going to use
+ the build management and release capabilities of ATS.</li>
+ <li>Full Nam: Extended name for the team. Expansion of acronym
+ if applicable</li>
+ </ul>
+ <li>Team relations to be configured:</li>
+ <ul>
+ <li>TeamActionableItem: relation to all AIs that this team is
+ responsible for.</li>
+ <li>TeamDefinitionToWorkflowDiagram: WorkflowDiagram
+ (GeneralDocument) artifact that configures the state machine that
+ this team works under. NOTE: If this relation is not set, ATS will
+ walk up the Default Hierarchy to find the first AI with this
+ relation.</li>
+ <li>TeamLead: User(s) that are leading this team. These users
+ will be assigned to the Endorse state of the Team Workflow upon
+ creation of an Action by a user. Providing multiple leads reduces
+ bottlenecks. First lead to handle the Team Workflow wins.</li>
+ <li>TeamMember: User(s) that are members of the team. These
+ users will be shown first as preferred assignees and have the ability
+ to privileged edit a Team Workflow for the team they belong to.</li>
+ </ul>
+ </ul>
+ <li>Choose existing Workflow Diagram or create new Workflow
+ Diagram to be used by the team and relate it to Team Definition (as
+ above).</li>
+ <li>Create version artifacts necessary (if using versions) and
+ relate them to Team Definition (as above)</li>
+ <ul>
+ <li>If branching of artifacts is going to be used (see below), configure versions
+ with their appropriate parent branch id.</li>
+ </ul>
+ <li>Determine if Branching within one of the states in the workflow is desired/required
+ and configure as appropriate.</li>
+ <ul>
+ <li>Considerations:</li>
+ <ul>
+ <li>Branching is necessary if objects to change are stored in OSEE as artifacts.
+ If so, OSEE ATS can create a working branch off the parent branch, allow user
+ to modify artifacts and then commit these changes when complete, reviewed and
+ authorized (as necessary). If objects are stored outside OSEE (eg. code files
+ checked into SVN), this option is not necessary.</li>
+ </ul>
+ <li>Configure ATS workflow for branching:</li>
+ <ul>
+ <li>Create AtsStateItem extension specifying which state the branching will occur.
+ This is normally in the Implement state of a workflow.</li>
+ <li>Create root branch and import documents that will be managed through define
+ and tracked through ATS.</li>
+ <li>Set all Version artifacts "Parent Branch Id" attribute to the branch id
+ of the root branch (or child branches, if using multi-branching)</li>
+ <li>If only a single branch is to be used OR versioning is NOT configured to be
+ used, the "Parent Branch Id" should be s</li>
+ </ul>
+ </ul>
+
+</ul>
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html
new file mode 100644
index 00000000000..7c710ff7e99
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html
@@ -0,0 +1,39 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Create Actionable Items</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+<body>
+ <h1>Create Actionable Items</h1>
+ <h2>Purpose</h2>
+ To create Actionable Items which provide the end user with a selection of things impacted by this Action.
+ <h2>How to do it</h2>
+ <ul>
+ <li>Create Actionable Items</li>
+ <ul>
+ <li>Actionable Item tree can be created to the level at which actions are to be written. Usually a component decomposition. In the case of UIs, create one for each view or window.</li>
+ <li>Attributes</li>
+ <ul>
+ <li>Name:[uniquely recognizable team name]</li>
+ <li>ats.Active:[yes]</li>
+ </ul>
+ <li>Relations</li>
+ <ul>
+ <li>DefaultHeirarchy: Relate to parent team or top level "Actionable Items" artifact"</li>
+ <li>TeamActionableItem: Relate to team responsible for performing tasks. Team can be related to parent and all children will have team by default.
+ </ul>
+ </ul>
+ </ul>
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html
new file mode 100644
index 00000000000..84dc23d7d5f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html
@@ -0,0 +1,44 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Create new Team Definition</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+<body>
+ <h1>Create new Team Definition</h1>
+ <h2>Purpose</h2>
+ To create a new Team Definition that specifies leads and members that are assigned to work on related Actionable Items.
+ <h2>How to do it</h2>
+ <ul>
+ <li>Team Definitions should match company organizational structure.</li>
+ <li>Attributes</li>
+ <ul>
+ <li>Name:[uniquely recognizable team name]</li>
+ <li>ats.Full Name:[optional full name]</li>
+ <li>ats.Description:[desc]</li>
+ <li>ats.Active:[yes]</li>
+ <li>ats.Team Uses Version:[yes if want to use release/build planning]</li>
+ <li></li>
+ <li>Endorse state must have Title, Description, Priority, Deadline, Change Type, Validation</li>
+ <li>Each state must have a unique identifier as the state id</li>
+ </ul>
+ <li>Relations</li>
+ <ul>
+ <li>DefaultHeirarchy: Relate to parent team or top level "Teams"</li>
+ <li>TeamDefinitionToVersion: Relate to current and future VersionArtifacts</li>
+ <li>TeamLead: Relate to one or more team leads. These individuals will have priviledged edit and perform the Endorse state by default.</li>
+ <li>TeamMember: Relate to one or more team members. These individuals will have ability to priviledged edit Workflows created by themselves against the team they belong to.</li>
+ </ul>
+ </ul>
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html
new file mode 100644
index 00000000000..f9b39240b7d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html
@@ -0,0 +1,29 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Create new VUE workflow diagram</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+<body>
+ <h1>Create new VUE workflow diagram</h1>
+ <h2>Purpose</h2>
+ To create a new VUE diagram that ATS uses to move an Action through it's specific workflow.
+ <h2>How to do it</h2>
+ <ul>
+ <li>Diagram must have Endorse and Completed</li>
+ <li>Endorse state must have Title, Description, Priority, Deadline, Change Type, Validation</li>
+ <li>Each state must have a unique identifier as the state id</li>
+ <li>Use "-DAtsUseWorkflowFiles" flag to instruct ATS to use a specified file in the workspace to use (versus a skynet artifact). This helps speed the development of the workflow.</li>
+ <li>If using "-DAtsUseWorkflowFiles" flag, put file path resolution info in AtsWorkFlowFactory.java</li>
+ </ul>
+</body>
+</html>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/contexts.xml b/0.5.0_20081201/org.eclipse.osee.ats/reference/contexts.xml
new file mode 100644
index 00000000000..0fcbb65c01e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/contexts.xml
@@ -0,0 +1,45 @@
+<contexts>
+ <context id="atsPriority" title="ATS Priorities">
+ <description>Priorities for classifying Actions in ATS.</description>
+ <topic href="reference/Priority.html" label="ATS Priorities"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsReportABug" title="Report a Bug">
+ <description>Instructions on using the Bug icons for reporting OSEE bugs.</description>
+ <topic href="reference/report_a_bug.html" label="Reporting a bug in OSEE"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsNavigator" title="Ats Navigator View">
+ <description>Perform ATS navigation capabilities.</description>
+ <topic href="reference/ats_navigator_view.html" label="Ats Navigator View"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsActionView" title="Ats Action View">
+ <description>Show graphical representation of Action and it's children Team Workflows.</description>
+ <topic href="reference/ats_action_view.html" label="Ats Action View"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsWorldView" title="Ats World View">
+ <description>Show loaded Action, Team Workflows, Tasks and Reviews.</description>
+ <topic href="reference/ats_world_view.html" label="Ats World View"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ <topic href="../osee.skynet.gui/reference/table_customization.html" label="Table Customization"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsWorkflowEditorWorkflowTab" title="Ats Wovrkflow Editor - Workflow Tab">
+ <description>Shows states of workflow, alows entry in current state and provides services to perform actions, see metrics and research information about workflow.</description>
+ <topic href="reference/workflow_editor/ats_workflow_editor_workflow_tab.html" label="Ats Workflow Editor - Workflow Tab"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ <topic href="../osee.skynet.gui/reference/spell_check.html" label="Spell Checking"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+ <context id="atsWorkflowEditorTaskTab" title="Ats Wovrkflow Editor - Task Tab">
+ <description>Shows tasks associated with states of workflow. Allows quick editing of task information and allows a quick jump (double-click) to open task in ATS Workflow Editor.</description>
+ <topic href="reference/workflow_editor/ats_workflow_editor_task_tab.html" label="Ats Workflow Editor - Task Tab"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ <topic href="../osee.skynet.gui/reference/table_customization.html" label="Table Customization"/>
+ <topic href="reference/overview/ats_overview.html" label="ATS Overview"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml
new file mode 100644
index 00000000000..db3afa4453d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml
@@ -0,0 +1,8 @@
+<contexts>
+ <context id="decisionReview" title="Decision Review Workflow">
+ <description>Provides description of the Decision review.</description>
+ <topic href="reference/decision_review_workflow/decisionReview.html" label="Decision Review Workflow"/>
+ <topic href="reference/workflow_editor/ats_workflow_editor_workflow_tab.html" label="Ats Workflow Editor - Workflow Tab"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG
new file mode 100644
index 00000000000..986d9d4633e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html
new file mode 100644
index 00000000000..c095dfa2887
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html
@@ -0,0 +1,66 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Decision Review Workflow</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Decision Review Workflow</h1>
+ <h2>Purpose</h2>
+ The Decision Review is a simple review that allows one or multiple users to review something
+ and answer a question. This review can be created, and thus attached, to any reviewable
+ state in ATS. In addition, it can be created automatically to perform simple "validation"
+ type reviews during a workflow.
+ <h2>State Machine</h2>
+ <img src="decisionReview.JPG"/>
+ <h2>How to do it</h2>
+ From any active state, select "Create a Decision Review" in the left column of the workflow editor.
+ This will create the review and attach it to the current state. Then, proceed to "Prepare State"
+ to entering the necessary information required for this review.
+
+
+ <h2>Prepare State</h2>
+ This state allows the user to create the decision review. Enter the required information and transition to
+ Decision to start the review. All transitioned to assignees will be required to perform the review.<br><br>
+ <table border="1">
+ <tr><th>Field</th><th>Description</th></tr>
+ <tr><td>Title</td><td>Enter the question that is to be answered by the reviewers. Example: Do you think we should buy this software?</td></tr>
+ <tr><td>Decision Review Options</td><td>Enter in all the options that are available for selection.<br>
+ Each line is a single decision option in the format: answer;state;&lt;userId&gt;<br><br>
+ Where<br>&nbsp;&nbsp;&nbsp;answer = Yes, No, Mabye, etc...<br>
+ &nbsp;&nbsp;&nbsp;state = Followup or Completed - this will be the state to transition to if the answer is choosen<br>
+ &nbsp;&nbsp;&nbsp;&lt;userId&gt; = userId of the user to assign to the state to transition to.
+ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note: Multiple users can be specified by &lt;userId1&gt;&lt;userId2&gt;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note:UserIds are only valid for Followup state. Completed state has no assignees.</td></tr>
+ <tr><td>Description</td><td>Information necessary to make an informed decision.</td></tr>
+ <tr><td>Blocking Review</td><td>yes if this review must be completed before the parent workflow can transition</td></tr>
+ <tr><td>Need By</td><td>Date the decision must be made.</td></tr>
+ </table>
+
+
+ <h2>Decision State</h2>
+ This state allows the user to review the description or materials and choose their decision.<br><br>
+ <table border="1">
+ <tr><th>Field</th><th>Description</th></tr>
+ <tr><td>Question</td><td>The question to be answered as part of this review.</td></tr>
+ <tr><td>Decision</td><td>The decision made by the user.</td></tr>
+ <tr><td>Resolution</td><td>Any notes or information as to why the decision was made.</td></tr>
+ </table>
+
+ <h2>Followup State</h2>
+ This state allows for followup action to be taken based on the decision.<br><br>
+ <table border="1">
+ <tr><td>Resolution</td><td>Any notes or information as to why the decision was made.</td></tr>
+ </table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml
new file mode 100644
index 00000000000..72f37de7fcd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml
@@ -0,0 +1,17 @@
+<contexts>
+ <context id="new_action_wizard_page_1" title="New Action Wizard">
+ <description>Initiates a new Action. Specify the Title and Impacted Items.</description>
+ <topic label="Title" href="reference/newActionWizard/new_action_wizard_page_1.html#title"/>
+ <topic label="Select Impacted Items" href="reference/newActionWizard/new_action_wizard_page_1.html#impacted"/>
+ <topic label="Filter" href="reference/newActionWizard/new_action_wizard_page_1.html#filter"/>
+ </context>
+ <context id="new_action_wizard_page_2" title="New Action Wizard">
+ <description>Provides details for the new action.</description>
+ <topic label="Description" href="reference/newActionWizard/new_action_wizard_page_2.html#description"/>
+ <topic label="Change Type" href="reference/newActionWizard/new_action_wizard_page_2.html#type"/>
+ <topic label="Priority" href="reference/newActionWizard/new_action_wizard_page_2.html#priority"/>
+ <topic label="Deadline" href="reference/newActionWizard/new_action_wizard_page_2.html#deadline"/>
+ <topic label="Validation Required" href="reference/newActionWizard/new_action_wizard_page_2.html#validation"/>
+ <topic label="User Community" href="reference/newActionWizard/new_action_wizard_page_2.html#comunity"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html
new file mode 100644
index 00000000000..453064fea71
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html
@@ -0,0 +1,29 @@
+<html>
+
+ <head>
+ <title>ATS New Action Wizard</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS New Action Wizard</h1>
+ <br />
+
+ <A name="title">
+ <h2>Title</h2>
+ This text will be the title for the action being created. This is a required field.
+ <br /><br />
+
+ <A name="impacted">
+ <h2>Select Impacted Items</h2>
+ Expand the tree and pick the appropriate item or items associated with this action.
+ <br /><br />
+
+ <A name="filter">
+ <h2>Filter</h2>
+ Removes items from the Impacted Items tree which do not match the specified filter.
+ Clearing the filter will restore the complete list of items in the tree.
+ <br /><br />
+
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html
new file mode 100644
index 00000000000..7f593952241
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html
@@ -0,0 +1,50 @@
+<html>
+
+ <head>
+ <title>ATS New Action Wizard</title>
+ <LINK rel="stylesheet" type="text/css" href="../../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS New Action Wizard</h1>
+ <br />
+
+ <A name="description">
+ <h2>Description</h2>
+ Enter the detailed description for the action.
+ <br /><br />
+
+ <A name="type">
+ <h2>Change Type</h2>
+ Choose the type of change for the action:
+ <ul>
+ <li>Improvement: This action is an improvement to an existing component or functionality, or new functionality for an existing system.
+ <li>Problem: This action describes a problem with existing functionality.
+ <li>Support: This action required user support, no product changes required.
+ </ul>
+ <br /><br />
+
+ <A name="priority">
+ <h2>Priority</h2>
+ Choose the significance of the action. See this <A Href="../Priority.html">table</a>
+ for a description of various priority levels.
+ <br /><br />
+
+ <A name="deadline">
+ <h2>Deadline</h2>
+ Pick a date when this action should be resolved.
+ <br /><br />
+
+ <A name="validation">
+ <h2>Validation Required</h2>
+ Select this checkbox if the action requires validation once it is resolved.
+ <br /><br />
+
+ <A name="community">
+ <h2>User Community</h2>
+ Choose the group or groups affected by this action. Use the ctrl or shift keys
+ to select multiple items.
+ <br /><br />
+
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf
new file mode 100644
index 00000000000..b30a1c679c3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/README.txt b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/README.txt
new file mode 100644
index 00000000000..4d08ca8ed3c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/README.txt
@@ -0,0 +1,3 @@
+OSEE ATS Overview.pdf
+Generated using PDF Machine from
+osee.doc/admin/approach/demos/OSEE ATS Overview.ppt \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/ats_overview.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/ats_overview.html
new file mode 100644
index 00000000000..bc6aaa1d499
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/overview/ats_overview.html
@@ -0,0 +1,27 @@
+<html>
+
+<head>
+<title>ATS Overview</title>
+<LINK rel="stylesheet" type="text/css"
+ href="../../osee.help/html/style.css">
+</head>
+
+<body>
+<h1>ATS Overview</h1>
+<h2>Purpose</h2>
+To give a brief overview of the Action Tracking System (ATS) including
+terms and architecture.
+<h2>Powerpoint Overview</h2>
+<a href="OSEE ATS Overview.pdf">Select to View Overview</a>
+<br><br>
+<h2>Terms</h2>
+<b>Actionable Item (AI)</b> - Item that can be impacted by an Action. AIs are what the user has to select from when creating an Action. Examples: Flight Box, Lab Computer, Code Subsystem.<br><br>
+<b>Team Workflow Definition</b> - Teams are created to perform that work associated with the Action. They are related to the AIs that they are responsible for and are configured with Leads and Members to route the Actions and perform the work. A workflow is configured that the team will follow to perform the work.<br><br>
+<b>Workflow Diagram</b> - State machine that shows the path the Team will follow to perform the work associated with the Action.<br><br>
+<b>Action</b> - Top level grouping object. An Action is written against any number of AIs. The Team Workflows are then created for each team configured to perform work for an AI.<br><br>
+<b>Team Workflow</b> - Instantiation of a Workflow Diagram needed to perform the work. Each team independently moves through their workflow state machine however ATS can be configured such that certain gates must be met from other Teams or outside events before a workflow can continue.<br><br>
+<b>Task</b> - Within states of a Team Workflow, smaller-light-weight Tasks can be created to further separate the work that needs to be completed for that state. Normally, the state can not continue until the Task is completed.<br><br>
+<b>Versions</b> - ATS has built in project/release planning. Versions are created to group Team Workflows (Actions) into Builds and Releases.<br><br>
+</body>
+</html>
+
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml
new file mode 100644
index 00000000000..1164a0c4f18
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml
@@ -0,0 +1,8 @@
+<contexts>
+ <context id="peerToPeerReview" title="Peer To Peer Review Workflow">
+ <description>Provides description of the Peer to Peer review.</description>
+ <topic href="reference/peer_to_peer_review_workflow/peerToPeerReview.html" label="Peer To Peer Review Workflow"/>
+ <topic href="reference/workflow_editor/ats_workflow_editor_workflow_tab.html" label="Ats Workflow Editor - Workflow Tab"/>
+ <topic href="reference/ats_icons.html" label="Ats Icons"/>
+ </context>
+</contexts> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html
new file mode 100644
index 00000000000..93a9e780185
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html
@@ -0,0 +1,66 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Peer To Peer Review Workflow</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Peer To Peer Review Workflow</h1>
+ <h2>Purpose</h2>
+ The Peer To Peer Review is a lightweight review type that enables interactive one-on-one reviews where two people sit
+ at a single computer and review, disposition and resolve the issues as they are found. This review type does not
+ require (but does allow) defects to be logged. This review type can be created as a stand-alone review or attached to
+ any workflow. When attached to a workflow, it is related to a state and can be set as a "blocking" review that will
+ keep the workflow from continuing until the review is completed.
+ <img src="peerToPeerReviewEditor.JPG"/>
+ <h2>State Machine</h2>
+ <img src="peerToPeerReviewStateMachine.JPG"/>
+ <h2>How to do it</h2>
+ <b>Stand-Alone Peer To Peer Review</b> - From ATS Navigator, filter on "peer" and select "New Peer To Peer Review". Enter
+ required fields and select transition to start the review.
+ <br><br>
+ <b>Workflow Related Peer To Peer Review</b> - From any ATS workflow editor, select
+ "Create a Peer To Peer Review" in the left column of the workflow editor.
+ This will create the review and attach it to the current state. Enter
+ required fields and select transition to start the review.
+
+
+ <h2>Prepare State</h2>
+ This state allows the user to create the peer to peer review. Enter the required information and transition to
+ Review to start the review. All review participants will be automatically assigned to the review state upon
+ transition.<br><br>
+ <table border="1">
+ <tr><th>Field</th><th>Description</th></tr>
+ <tr><td>Title</td><td>Enter a descriptive title for this review.</td></tr>
+ <tr><td>Review Roles</td><td>Add roles and select the appropriate user. This review type requires at least one Author and one Reviewer.<br>
+ <tr><td>Location of review materials</td><td>Either enter in a description of review materials or simply drag in files from workspace to
+ be reviewed. If files are dropped in this box, the java package name (if appropriate), filename and a space to enter in the
+ repository version will be provided.</td></tr>
+ <tr><td>Description</td><td>Information necessary to make an informed decision.</td></tr>
+ <tr><td>Blocking Review</td><td>if NOT a stand-alone review, this field will be enabled for entry.
+ select yes if this review must be completed before the parent workflow can transition</td></tr>
+ <tr><td>Need By</td><td>Date the review should be completed.</td></tr>
+ </table>
+
+
+ <h2>Review State</h2>
+ This state allows the users to review the materials, log any defects and allows for the author to resolve and close any defects.<br><br>
+ <table border="1">
+ <tr><th>Field</th><th>Description</th></tr>
+ <tr><td>Review Roles</td><td>Add or remove participants as needed. See Prepare State description for more information.</td></tr>
+ <tr><td>Review Defect</td><td>Defects are not REQUIRED, but can be entered. Defects must be dispositioned and closed before
+ review can be completed</td></tr>
+ <tr><td>Resolution</td><td>Any notes or further information can be entered here.</td></tr>
+ </table>
+
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG
new file mode 100644
index 00000000000..2839752c0ff
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG
new file mode 100644
index 00000000000..414c3f56b3e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/report_a_bug.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/report_a_bug.html
new file mode 100644
index 00000000000..b6dc6f1abf9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/report_a_bug.html
@@ -0,0 +1,25 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>Report a Bug</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>Report a Bug</h1>
+ <h2>Purpose</h2>
+ A quick way to report a bug against a view or editor.
+ <h2>How to do it</h2>
+ Select the bug button (<img src="../images/bug.gif"/>) from the toolbar at the top
+ of the view or editor that has the problem. A wizard will come up to provide guidance
+ through the rest of the steps.
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/toc.xml b/0.5.0_20081201/org.eclipse.osee.ats/reference/toc.xml
new file mode 100644
index 00000000000..39f4c816890
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/toc.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+<toc label="OSEE Action Tracking System (ATS)">
+ <topic label="ATS Overview" href="reference/overview/ats_overview.html" />
+ <topic label="ATS Icons" href="reference/ats_icons.html" />
+ <topic label="ATS Priorities" href="reference/Priority.html" />
+ <topic label="Reporting a Bug" href="reference/report_a_bug.html" />
+ <topic label="ATS Workflow Editor">
+ <topic label="Workflow Editor"
+ href="reference/workflow_editor/ats_workflow_editor.html" />
+ <topic label="Workflow Editor - Workflow Tab"
+ href="reference/workflow_editor/ats_workflow_editor_workflow_tab.html" />
+ <topic label="Workflow Editor - Task Tab"
+ href="reference/workflow_editor/ats_workflow_editor_task_tab.html" />
+ <topic label="Spell Checking"
+ href="PLUGINS_ROOT/org.eclipse.osee.framework.ui.skynet/reference/spell_check.html" />
+ </topic>
+ <topic label="ATS Views">
+ <topic label="Navigator View"
+ href="reference/ats_navigator_view.html" />
+ <topic label="Action View"
+ href="reference/ats_action_view.html" />
+ <topic label="World View" href="reference/ats_world_view.html" />
+ <topic label="Result View"
+ href="PLUGINS_ROOT/org.eclipse.osee.framework.ui.skynet/reference/result_view.html" />
+ </topic>
+ <topic label="ATS Reviews">
+ <topic label="Peer To Peer Review"
+ href="reference/peer_to_peer_review_workflow/peerToPeerReview.html" />
+ <topic label="Decision Review"
+ href="reference/decision_review_workflow/decisionReview.html" />
+ </topic>
+ <topic label="ATS Configuration">
+ <topic label="Create VUE Workflow Diagram"
+ href="reference/configure/create_vue_workflow_diagram.html" />
+ <topic label="Create New Team Definition"
+ href="reference/configure/create_new_team_definition.html" />
+ <topic label="Create New Actionable Item(s)"
+ href="reference/configure/create_new_actionable_items.html" />
+ <topic label="Configure ATS for Tracking"
+ href="reference/configure/configure_ats_for_tracking.html" />
+ <topic label="Configure ATS for Help"
+ href="reference/configure/configure_ats_for_help.html" />
+ </topic>
+ <link toc="PLUGINS_ROOT/org.eclipse.osee.framework.ui.skynet/reference/skynet_toc.xml"/>
+</toc>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html
new file mode 100644
index 00000000000..389d15fd181
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html
@@ -0,0 +1,32 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Workflow Editor</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Workflow Editor</h1>
+ <br/>
+ <img src="ats_workflow_editor_workflow_tab.jpg"/>
+ <h2>Purpose</h2>
+ Show and edit the workflows configured for use in ATS including Team Workflows, Tasks and Reviews.
+ <h2>How to do it</h2>
+ Double-click open any Action or Team Workflow from ATS World, Search results or ATS Results.
+ The editor will be opened allowing view and edit of workflow.
+ <h2><A href="ats_workflow_editor_workflow_tab.html">Workflow Tab</A></h2>
+ Shows states of workflow, alows entry in current state and provides services to perform actions,
+ see metrics and research information about workflow.
+ <h2><A href="ats_workflow_editor_task_tab.html">Task Tab</A></h2>
+ Shows tasks associated with states of workflow. Allows quick editing of task information and
+ allows a quick jump (double-click) to open task in ATS Workflow Editor.
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html
new file mode 100644
index 00000000000..87153c1c5c9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html
@@ -0,0 +1,41 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Workflow Editor - Task Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Workflow Editor - Task Tab</h1>
+ <br/>
+ <img src="ats_workflow_editor_task_tab.jpg"/>
+ <h2>Purpose</h2>
+ Shows tasks associated with states of workflow. Allows quick editing of task information and
+ allows a quick jump (double-click) to open task in ATS Workflow Editor.
+ <h2>How to do it</h2>
+ Select task tab after ATS object is opened in the ATS Editor.
+ <h2>Open Task</h2>
+ Double-click on any task to open in ATS Editor.
+ <h2>Right-click edit</h2>
+ Selecting one or more tasks and right-click produces a menu with selections for editing
+ multiple tasks at a single time.
+ <h2>Alt-Left-Click edit</h2>
+ A quick way to edit a single field in a task is by holding the Alt key down and selecting
+ the cell to edit. This pops up an editor associated with the type of cell selected.
+ <br>
+ <h2>Actions</h2>
+ Select <img src="../../images/currentState.gif"/> to only show tasks related to the current state of the workflow.<br/>
+ Select <img src="../../images/newTask.gif"/> to create a new task.<br/>
+ Select <img src="../../images/redRemove.gif"/> to delete selected task.<br/>
+ Select <img src="../../images/refresh.gif"/> to refresh the current task list.<br/>
+ Select <img src="../../../osee.skynet.gui/images/customize.gif"/> to <A href="../../../osee.skynet.gui/reference/table_customization.html"/>Customize Table</A>.<br/>
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg
new file mode 100644
index 00000000000..42937dcf17d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html
new file mode 100644
index 00000000000..558e1d56843
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html
@@ -0,0 +1,37 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Workflow Editor - Workflow Tab</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Workflow Editor - Workflow Tab</h1>
+ <br/>
+ <img src="ats_workflow_editor_workflow_tab.jpg"/>
+ <h2>Purpose</h2>
+ Shows states of workflow, alows entry in current state and provides services to perform actions,
+ see metrics and research information about workflow.
+ <h2>How to do it</h2>
+ Default tab shown when any ATS object is opened in the ATS Editor.
+ <h2>Current State</h2>
+ Shown in the top status bar and in the main window, the current state is the state of the workflow
+ state machine that is running for this ATS object. These workflows can be configured with 3 or 30
+ state depending on the needs of the program/team that is using it.
+ <A href="current_state.html">More</A>
+ <h2>Other States</h2>
+ Shows states of workflow, alows entry in current state and provides services to perform actions,
+ see metrics and research information about workflow.
+ <h2>Services</h2>
+ Shows tasks associated with states of workflow. Allows quick editing of task information and
+ allows a quick jump (double-click) to open task in ATS Workflow Editor.
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg
new file mode 100644
index 00000000000..05ea2c1b27c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg
Binary files differ
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/current_state.html b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/current_state.html
new file mode 100644
index 00000000000..1bae0ebd5d1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/reference/workflow_editor/current_state.html
@@ -0,0 +1,44 @@
+<html>
+<!--
+ Copyright (c) 2004, 2007 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
+-->
+ <head>
+ <title>ATS Workflow Editor - Current State</title>
+ <LINK rel="stylesheet" type="text/css" href="../../osee.help/html/style.css">
+ </head>
+
+ <body>
+ <h1>ATS Workflow Editor - Current State</h1>
+ <br/>
+ <img src="ats_workflow_editor_workflow_tab.jpg"/>
+ <h2>Purpose</h2>
+ Shows current state information and allows edit to those users that are authorized for edit.
+ <h2>Assignees</h2>
+ Selecting Assignees at the top of the current state allows the current assignee to add/remove
+ the assignees that are allowed to make changes to the current state. Any number of users can
+ be selected.
+ <h2>Data Entry</h2>
+ The state has certain fields that are requested/need to be entered. Red labels denotes a field
+ that is requried for transition for to the next state. A black label denotes a field that is
+ optional for transition to the next state.
+ <h2>Services</h2>
+ On the left resides a list of services that either provide information and/or allow for the entry
+ of information for the givent ATS objects. If the service is black text, there is no ability
+ to edit the information. If the service is blue with underlined (hyperlinked), then the data
+ can be edited through seleciton of the service.
+ <h2>Transition</h2>
+ Select the state to transition to (default is already selected), and choose the assingees
+ that should perform the next state (default is already selected). No data is lost when
+ transitioning to a previous state.
+ <h2>Assignees</h2>
+ If assigned to a state, the Assignees label is hyperlinked in the current state and allows
+ for adding/removing assignees. Any number of users can be assigned to any in-work state.
+ Removing the current user and adding a different user re-assigns the object to that user.
+</body>
+</html> \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd
new file mode 100644
index 00000000000..66aa5e1e408
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.osee.ats" id="AtsAIandTeamConfig" name="AtsAIandTeamConfig"/>
+ </appInfo>
+ <documentation>
+ Allows graphical configuration of teams and actionable items that will be imported into the DB upon database initialization. This is a one-time shot import and does NOT provide for the capability to update and re-import. All configuration after the first database wipe should be done through OSEE&apos;s artifact editors and explorers.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsAIandTeamConfig"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsAIandTeamConfig">
+ <complexType>
+ <attribute name="vueFilename" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="resource"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd
new file mode 100644
index 00000000000..77330b762b4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.osee.ats" id="AtsNavigateItem" name="AtsNavigateItem"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsNavigateItem"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsNavigateItem">
+ <complexType>
+ <attribute name="classname" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.osee.ats.navigate.IAtsNavigateItem"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsStateItem.exsd b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsStateItem.exsd
new file mode 100644
index 00000000000..5a1f3d90806
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsStateItem.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.osee.ats" id="AtsStateItem" name="AtsStateItem"/>
+ </appInfo>
+ <documentation>
+ Allows plugins to manipulate and get events from the different states and widgets that are created as part of any ATS workflow. It also provides for confirmation that transition is valid and certain fuctions regarding branchs.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsStateItem"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsStateItem">
+ <complexType>
+ <attribute name="classname" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.osee.ats.editor.IAtsStateItem"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd
new file mode 100644
index 00000000000..71df02d300d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.osee.ats" id="AtsTeamWorflow" name="AtsTeamWorflow"/>
+ </appInfo>
+ <documentation>
+ This extension point should be used when a plugin wants to configure ATS to use a class that is an extension off TeamWorkflowArtifact class. These methods will provide the capability necessary for ATS to manage the new extensions.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsTeamWorkflow"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsTeamWorkflow">
+ <complexType>
+ <attribute name="classname" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":osee.ats.actions.wizard.IAtsTeamWorkflowCreation"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsWizardItem.exsd b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsWizardItem.exsd
new file mode 100644
index 00000000000..9951168790f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/schema/AtsWizardItem.exsd
@@ -0,0 +1,105 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.osee.ats">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.osee.ats" id="AtsWizardItem" name="AtsWizardItem"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsWizardItem"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="AtsWizardItem">
+ <complexType>
+ <attribute name="classname" type="string" use="required">
+ <annotation>
+ <documentation>
+ Provides the capability for the extension of the ATS New Action wizard. This allows for non-generic fields to be displayed and required. It also provides for the callbacks necessary to ensure that the data is entered properly AND the data gets stored upon wizard completion.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.osee.ats.actions.wizard.IAtsWizardItem"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiInfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="copyright"/>
+ </appInfo>
+ <documentation>
+
+ </documentation>
+ </annotation>
+
+</schema>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java
new file mode 100644
index 00000000000..06d8b0df2e6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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;
+
+import org.eclipse.osee.ats.hyper.ActionHyperView;
+import org.eclipse.osee.ats.hyper.ArtifactHyperView;
+import org.eclipse.osee.ats.navigate.NavigateView;
+import org.eclipse.osee.framework.ui.skynet.ArtifactExplorer;
+import org.eclipse.osee.framework.ui.skynet.branch.BranchView;
+import org.eclipse.osee.framework.ui.skynet.group.GroupExplorer;
+import org.eclipse.osee.framework.ui.skynet.search.QuickSearchView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class ATSPerspective implements IPerspectiveFactory {
+
+ public ATSPerspective() {
+ super();
+ }
+
+ public void createInitialLayout(IPageLayout layout) {
+ defineActions(layout);
+ defineLayout(layout);
+ }
+
+ public void defineActions(IPageLayout layout) {
+
+ // Add "show views".
+ layout.addShowViewShortcut(NavigateView.VIEW_ID);
+ layout.addShowViewShortcut(ActionHyperView.VIEW_ID);
+ // layout.addShowViewShortcut(ActionSkyWalker.VIEW_ID);
+
+ layout.addShowViewShortcut(ArtifactHyperView.VIEW_ID);
+ layout.addShowViewShortcut(ArtifactExplorer.VIEW_ID);
+ layout.addShowViewShortcut(XResultView.VIEW_ID);
+ layout.addShowViewShortcut(BranchView.VIEW_ID);
+ layout.addShowViewShortcut(GroupExplorer.VIEW_ID);
+ layout.addShowViewShortcut(QuickSearchView.VIEW_ID);
+ layout.addShowViewShortcut("osee.admin.AdminView");
+ layout.addShowViewShortcut("org.eclipse.pde.runtime.LogView");
+
+ }
+
+ public void defineLayout(IPageLayout layout) {
+ // Editors are placed for free.
+ String editorArea = layout.getEditorArea();
+
+ // Place navigator and outline to left of
+ // editor area.
+ IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, (float) 0.20, editorArea);
+ left.addView(NavigateView.VIEW_ID);
+ left.addView(GroupExplorer.VIEW_ID);
+ left.addView(ArtifactExplorer.VIEW_ID);
+ left.addView(BranchView.VIEW_ID);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, (float) 0.80, editorArea);
+ right.addView("org.eclipse.pde.runtime.LogView");
+ }
+
+ IFolderLayout botLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, (float) 0.60, NavigateView.VIEW_ID);
+ // botLeft.addView(ActionSkyWalker.VIEW_ID);
+ botLeft.addView(ActionHyperView.VIEW_ID);
+ botLeft.addView(QuickSearchView.VIEW_ID);
+ botLeft.addView(XResultView.VIEW_ID);
+
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java
new file mode 100644
index 00000000000..16288ac1410
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionDebug extends org.eclipse.osee.framework.ui.plugin.util.Debug {
+
+ protected String getPluginName() {
+ return "AtsPlugin";
+ }
+
+ /**
+ * @param debugOn
+ * @param timeStampOn
+ * @param nameSpace
+ */
+ public ActionDebug(boolean debugOn, boolean timeStampOn, String nameSpace) {
+ super(debugOn, timeStampOn, nameSpace);
+ }
+
+ /**
+ * @param debugOn
+ * @param nameSpace
+ */
+ public ActionDebug(boolean debugOn, String nameSpace) {
+ super(debugOn, nameSpace);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java
new file mode 100644
index 00000000000..0e3327a6382
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.util.AtsBranchAccessHandler;
+import org.eclipse.osee.ats.util.AtsPreSaveCacheRemoteEventHandler;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.OseeGroup;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.dbinit.SkynetDbInit;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+
+/**
+ * The main plugin class to be used in the desktop.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsPlugin extends OseeUiActivator {
+ private static AtsPlugin pluginInstance;
+ private static Cursor handCursor;
+ private static Cursor waitCursor;
+ public static ActionDebug debug = new ActionDebug(false, "AtsPlugin");
+ public static final String PLUGIN_ID = "org.eclipse.osee.ats";
+ private static boolean emailEnabled = true;
+ public static Color ACTIVE_COLOR = new Color(null, 206, 212, 241);
+ private static OseeGroup atsAdminGroup = null;
+
+ /**
+ * The constructor.
+ */
+ public AtsPlugin() {
+ super();
+ pluginInstance = this;
+ AtsBranchAccessHandler.getInstance();
+ AtsPreSaveCacheRemoteEventHandler.getInstance();
+ }
+
+ public static boolean isEmailEnabled() {
+ return emailEnabled;
+ }
+
+ public static void setEmailEnabled(boolean enabled) {
+ if (!SkynetDbInit.isDbInit()) System.out.println("Email " + (enabled ? "Enabled" : "Disabled"));
+ emailEnabled = enabled;
+ }
+
+ public static boolean isProductionDb() throws OseeCoreException {
+ return ClientSessionManager.isProductionDataStore();
+ }
+
+ public static Cursor getHandCursor() {
+ if (handCursor == null) handCursor = new Cursor(null, SWT.CURSOR_HAND);
+ return handCursor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.util.plugin.OseePlugin#getPluginName()
+ */
+ @Override
+ protected String getPluginName() {
+ return PLUGIN_ID;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static AtsPlugin getInstance() {
+ return pluginInstance;
+ }
+
+ public static Cursor getWaitCursor() {
+ if (waitCursor == null) waitCursor = new Cursor(null, SWT.CURSOR_WAIT);
+ return waitCursor;
+ }
+
+ public static boolean isAtsAdmin() {
+ try {
+ return getAtsAdminGroup().isCurrentUserMember();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return false;
+ }
+ }
+
+ public static OseeGroup getAtsAdminGroup() {
+ if (atsAdminGroup == null) {
+ atsAdminGroup = new OseeGroup("AtsAdmin");
+ }
+ return atsAdminGroup;
+ }
+
+ public static Branch getAtsBranch() throws OseeCoreException {
+ return BranchManager.getCommonBranch();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java
new file mode 100644
index 00000000000..3a21bbed8b2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions;
+
+import java.util.Arrays;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.NewActionJob;
+import org.eclipse.osee.ats.actions.wizard.NewActionWizard;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.config.BulkLoadAtsCache;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewAction extends Action {
+
+ private final String actionableItem;
+ private String initialDescription;
+
+ public NewAction() {
+ this(null);
+ }
+
+ public NewAction(String actionableItem) {
+ super("Create New Action");
+ this.actionableItem = actionableItem;
+ setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("newAction.gif"));
+ setToolTipText("Create New Action");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ super.run();
+ BulkLoadAtsCache.run(true);
+ NewActionWizard wizard = new NewActionWizard();
+ try {
+ if (actionableItem != null) {
+ wizard.setInitialAias(ActionableItemArtifact.getActionableItems(Arrays.asList(actionableItem)));
+ }
+ if (initialDescription != null) {
+ wizard.setInitialDescription(initialDescription);
+ }
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
+ dialog.create();
+ if (dialog.open() == 0) {
+ Result result = wizard.isActionValid();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ NewActionJob job = null;
+ job =
+ new NewActionJob(wizard.getTitle(), wizard.getDescription(), wizard.getChangeType(),
+ wizard.getPriority(), wizard.getNeedBy(), wizard.getValidation(), wizard.getUserCommunities(),
+ wizard.getSelectedActionableItemArtifacts(), wizard);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * @return the initialDescription
+ */
+ public String getInitialDescription() {
+ return initialDescription;
+ }
+
+ /**
+ * @param initialDescription the initialDescription to set
+ */
+ public void setInitialDescription(String initialDescription) {
+ this.initialDescription = initialDescription;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java
new file mode 100644
index 00000000000..4f7cfe25dc8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions;
+
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewDecisionReviewJob extends Job {
+ private final TeamWorkFlowArtifact teamParent;
+ private final boolean againstCurrentState;
+ private DecisionReviewArtifact decisionReviewArtifact;
+ private final ReviewBlockType reviewBlockType;
+
+ public NewDecisionReviewJob(TeamWorkFlowArtifact teamParent, ReviewBlockType reviewBlockType, boolean againstCurrentState) {
+ super("Creating New Decision Review");
+ this.teamParent = teamParent;
+ this.reviewBlockType = reviewBlockType;
+ this.againstCurrentState = againstCurrentState;
+ }
+
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ decisionReviewArtifact = createNewDecisionReview(teamParent, reviewBlockType, againstCurrentState);
+ decisionReviewArtifact.persistAttributesAndRelations();
+ AtsLib.openAtsAction(decisionReviewArtifact, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ monitor.done();
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "Error creating Decision Review", ex);
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ public static DecisionReviewArtifact createNewDecisionReview(StateMachineArtifact teamParent, ReviewBlockType reviewBlockType, boolean againstCurrentState) throws OseeCoreException {
+ return createNewDecisionReview(teamParent, reviewBlockType,
+ "Should we do this? Yes will require followup, No will not",
+ againstCurrentState ? teamParent.getSmaMgr().getStateMgr().getCurrentStateName() : null,
+ "Enter description of the decision, if any",
+ "Yes;Followup;<" + UserManager.getUser().getUserId() + ">\n" + "No;Completed;", null);
+ }
+
+ public static DecisionReviewArtifact createNewDecisionReview(StateMachineArtifact teamParent, ReviewBlockType reviewBlockType, String title, String relatedToState, String description, String options, Collection<User> assignees) throws OseeCoreException {
+ DecisionReviewArtifact decRev =
+ (DecisionReviewArtifact) ArtifactTypeManager.addArtifact(DecisionReviewArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch(), title);
+
+ if (teamParent != null) {
+ teamParent.addRelation(AtsRelation.TeamWorkflowToReview_Review, decRev);
+ }
+ if (relatedToState != null && !relatedToState.equals("")) {
+ decRev.setSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), relatedToState);
+ }
+ decRev.getSmaMgr().getLog().addLog(LogType.Originated, "", "");
+ if (description != null && !description.equals("")) {
+ decRev.setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), description);
+ }
+ if (options != null && !options.equals("")) {
+ decRev.setSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(), options);
+ }
+ if (reviewBlockType != null) {
+ decRev.setSoleAttributeFromString(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName(), reviewBlockType.name());
+ }
+
+ // Initialize state machine
+ decRev.getSmaMgr().getStateMgr().initializeStateMachine(DecisionReviewArtifact.DecisionReviewState.Prepare.name());
+ decRev.getSmaMgr().getLog().addLog(LogType.StateEntered,
+ DecisionReviewArtifact.DecisionReviewState.Prepare.name(), "");
+ if (assignees != null && assignees.size() > 0) {
+ decRev.getSmaMgr().getStateMgr().setAssignees(assignees);
+ }
+
+ return decRev;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java
new file mode 100644
index 00000000000..94189e1138f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewPeerToPeerReviewJob extends Job {
+
+ private final TeamWorkFlowArtifact teamParent;
+ private final String againstState;
+ private PeerToPeerReviewArtifact peerToPeerReviewArtifact;
+ private final String reviewTitle;
+
+ public NewPeerToPeerReviewJob(TeamWorkFlowArtifact teamParent, String reviewTitle, String againstState) {
+ super("Creating New PeerToPeer Review");
+ this.teamParent = teamParent;
+ this.againstState = againstState;
+ this.reviewTitle = reviewTitle;
+ }
+
+ public NewPeerToPeerReviewJob(TeamWorkFlowArtifact teamParent, String againstState) {
+ super("Creating New PeerToPeer Review");
+ this.teamParent = teamParent;
+ this.againstState = againstState;
+ this.reviewTitle = PeerToPeerReviewArtifact.getDefaultReviewTitle(teamParent.getSmaMgr());
+ }
+
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ peerToPeerReviewArtifact =
+ teamParent.getSmaMgr().getReviewManager().createNewPeerToPeerReview(reviewTitle, againstState, transaction);
+ peerToPeerReviewArtifact.persistAttributesAndRelations(transaction);
+ transaction.execute();
+
+ AtsLib.openAtsAction(peerToPeerReviewArtifact, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ monitor.done();
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "Error creating PeerToPeer Review", ex);
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java
new file mode 100644
index 00000000000..9b0ff3e92ea
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEEFilteredTree;
+
+public class ActionableItemFilter extends ViewerFilter {
+ private String contains = null;
+ private final OSEEFilteredTree treeViewer;
+
+ public ActionableItemFilter(OSEEFilteredTree treeViewer) {
+ this.treeViewer = treeViewer;
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (!isFiltering()) return true;
+ return checkItemAndChildren((ActionableItemArtifact) element);
+ }
+
+ private boolean checkItemAndChildren(ActionableItemArtifact item) {
+ try {
+ boolean show = item.getDescriptiveName().toLowerCase().contains(contains.toLowerCase());
+ if (show) return true;
+ for (Artifact child : item.getChildren()) {
+ show = checkItemAndChildren((ActionableItemArtifact) child);
+ if (show) return true;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return false;
+ }
+
+ /**
+ * @param contains The contains to set.
+ */
+ public void setContains(String contains) {
+ this.contains = contains;
+ if (contains.equals(""))
+ treeViewer.getViewer().collapseAll();
+ else
+ treeViewer.getViewer().expandAll();
+ }
+
+ /**
+ * @return Returns the contains.
+ */
+ public String getContains() {
+ return contains;
+ }
+
+ public boolean isFiltering() {
+ return contains != null && contains.length() > 0;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java
new file mode 100644
index 00000000000..2fca59f90e7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ArtifactSelectWizard extends Wizard {
+
+ private ArtifactSelectWizardPage wizardPage;
+
+ public ArtifactSelectWizard() {
+ }
+
+ public void addPages() {
+ wizardPage = new ArtifactSelectWizardPage();
+ addPage(wizardPage);
+ }
+
+ public boolean performFinish() {
+ return true;
+ }
+
+ @Override
+ public boolean canFinish() {
+ return wizardPage.isPageComplete();
+ }
+
+ public Artifact getSelectedArtifact() {
+ return wizardPage.getSelectedArtifact();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java
new file mode 100644
index 00000000000..96c5ea5a62c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.attribute.TypeValidityManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+
+public class ArtifactSelectWizardPage extends WizardPage {
+
+ private ListViewer artTypeList;
+ private ListViewer artList;
+ private Artifact selectedArtifact;
+ private boolean showArtData = false;
+
+ public ArtifactSelectWizardPage() {
+ super("Select an Artifact");
+ }
+
+ public void createControl(Composite parent) {
+ setTitle("Select an Artifact");
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.numColumns = 2;
+ composite.setLayout(gl);
+ GridData gd = new GridData(GridData.FILL, GridData.FILL, true, true);
+ composite.setLayoutData(gd);
+
+ Composite leftComp = new Composite(composite, SWT.NONE);
+
+ leftComp.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL, GridData.FILL, true, true);
+ leftComp.setLayoutData(gd);
+
+ (new Label(leftComp, SWT.NONE)).setText("Artifact Type");
+
+ try {
+ artTypeList = new ListViewer(leftComp, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
+ artTypeList.setContentProvider(new ArrayContentProvider());
+ artTypeList.setLabelProvider(new ArtTypeLabelProvider());
+
+ gd = new GridData(GridData.FILL, GridData.FILL, true, true);
+ gd.heightHint = 300;
+ gd.widthHint = 200;
+ artTypeList.getControl().setLayoutData(gd);
+ artTypeList.setInput(TypeValidityManager.getValidArtifactTypes(AtsPlugin.getAtsBranch()));
+ artTypeList.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ ArtifactType desc = (ArtifactType) selection.getFirstElement();
+ try {
+ artList.setInput(ArtifactQuery.getArtifactsFromType(desc, AtsPlugin.getAtsBranch()));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ artTypeList.setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return getComparator().compare(((ArtifactType) e1).getName(), ((ArtifactType) e2).getName());
+ }
+ });
+
+ Composite rightComp = new Composite(composite, SWT.NONE);
+
+ rightComp.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL, GridData.FILL, true, true);
+ rightComp.setLayoutData(gd);
+
+ Label lab = new Label(rightComp, SWT.NONE);
+ lab.setText("Artifact (click here for artifact data)");
+ lab.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ lab.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event event) {
+ showArtData = !showArtData;
+ artList.refresh();
+ }
+ });
+
+ artList = new ListViewer(rightComp, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
+ artList.setContentProvider(new ArrayContentProvider());
+ artList.setLabelProvider(new ArtifactDescriptiveLabelProvider());
+
+ artList.setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return getComparator().compare(((Artifact) e1).getDescriptiveName(),
+ ((Artifact) e2).getDescriptiveName());
+ }
+ });
+ gd = new GridData(GridData.FILL, GridData.FILL, true, true);
+ gd.heightHint = 300;
+ gd.widthHint = 200;
+ artList.getControl().setLayoutData(gd);
+ artList.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ selectedArtifact = (Artifact) selection.getFirstElement();
+ }
+ });
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ setControl(composite);
+ }
+
+ public Artifact getSelectedArtifact() {
+ return selectedArtifact;
+ }
+
+ public class ArtifactDescriptiveLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ Artifact art = (Artifact) arg0;
+ if (showArtData)
+ return String.format("%s - (%s %s %s)", art.getDescriptiveName(), art.getArtId(),
+ art.getHumanReadableId(), art.getGuid());
+ else
+ return art.getDescriptiveName();
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+ }
+
+ public class ArtTypeLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ return ((ArtifactType) arg0).getName();
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java
new file mode 100644
index 00000000000..d41fb4052e1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsTeamWorkflow {
+
+ /**
+ * Return true if this class/plugin is responsible for the creation of the Team Workflow that will be created for the
+ * given Team Definition. This should be a light-weight check.
+ *
+ * @param teamDef related to the workflow to be created
+ * @param actionableItems that were selected for the creation
+ * @return true if responsible, false if not
+ * @throws Exception TODO
+ */
+ public boolean isResponsibleForTeamWorkflowCreation(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems) throws OseeCoreException;
+
+ /**
+ * Return the artifact type name for the given parameters. This method will only be called if
+ * isResponsibleForTeamWorkflowCreation returns true.
+ *
+ * @param teamDef related to the workflow to be created
+ * @param actionableItems that were selected for the creation
+ * @return string artifact type name
+ * @throws Exception TODO
+ */
+ public String getTeamWorkflowArtifactName(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems) throws OseeCoreException;
+
+ /**
+ * Notification that a teamWorkflow was created. This allows the extension to do necessary initial tasks after the
+ * team workflow artifact is created.
+ *
+ * @param teamArt
+ */
+ public void teamWorkflowCreated(TeamWorkFlowArtifact teamArt);
+
+ /**
+ * Return a collection of all team workflow artifact type names. These are used by ATS when searching is performed
+ * since there is no "inheritance" in the DB model.
+ *
+ * @return collection of all team workflow artifact type names
+ */
+ public Collection<String> getTeamWorkflowArtifactNames();
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
new file mode 100644
index 00000000000..8a9d2395201
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * Allows the New Action wizard to be extended with custom widgets when the appropriate Actionable Items are selected
+ *
+ * @author Donald G. Dunne
+ */
+public interface IAtsWizardItem {
+
+ /**
+ * Add the desired XWidget declarations to the stringbuffer. Selected AIAs are provided so validation can be done to
+ * determine what (if any) widgets should be added. eg. <XWidget displayName=\"Description\" height=\"80\"
+ * required=\"true\" xwidgetType=\"XText\" fill=\"Vertically\" \"/>");
+ *
+ * @param aias
+ * @param sb
+ * @throws Exception TODO
+ */
+ public void getWizardXWidgetExtensions(Collection<ActionableItemArtifact> aias, StringBuffer sb) throws Exception;
+
+ /**
+ * @param aias
+ * @return true if widgets will be added based on selected aias
+ * @throws Exception TODO
+ */
+ public boolean hasWizardXWidgetExtensions(Collection<ActionableItemArtifact> aias) throws Exception;
+
+ /**
+ * Determine if Action is valid to create based on wizard data entered. hasWizardXWidgetExtenstions will be called to
+ * determine if this method should be called.
+ *
+ * @param wizard
+ * @return result of validation. if true, action will be created; if not, error will popup and action will not be
+ * created
+ */
+ public Result isActionValidToCreate(Collection<ActionableItemArtifact> aias, NewActionWizard wizard);
+
+ /**
+ * Callback with created action upon completion and creation of the action and it's workflows.
+ * hasWizardXWidgetExtenstions will be called to determine if this method should be called.
+ *
+ * @param actionArt
+ * @param wizard
+ * @param transaction TODO
+ * @throws Exception TODO
+ */
+ public void wizardCompleted(ActionArtifact actionArt, NewActionWizard wizard, SkynetTransaction transaction) throws Exception;
+
+ /**
+ * Validation that the data entered is valid and the wizard can be finished. This will be called after every
+ * character is entered, so extensive processing should not be performed during this check. Extensive processing can
+ * be performed during isActionValidToCreate(). hasWizardXWidgetExtenstions will be called to determine if this
+ * method should be called.
+ *
+ * @param wizard
+ * @return true if widget data entered is valid
+ */
+ public Result isWizardXWidgetsComplete(NewActionWizard wizard);
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
new file mode 100644
index 00000000000..e651c8b9fd1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.OseeData;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionJob extends Job {
+ private boolean saveIt = false;
+ private String identifyStateDescription = null;
+ private String title;
+ private final String desc;
+ private final ChangeType changeType;
+ private final PriorityType priority;
+ private final Date needByDate;
+ private final boolean validationRequired;
+ private ActionArtifact actionArt;
+ private final Set<ActionableItemArtifact> actionableItems;
+ private final Collection<String> userComms;
+ private static int ttNum;
+ private final NewActionWizard wizard;
+
+ public NewActionJob(String title, String desc, ChangeType changeType, PriorityType priority, Date needByDate, boolean validationRequired, Collection<String> userComms, Set<ActionableItemArtifact> actionableItems, NewActionWizard wizard) {
+ super("Creating New Action");
+ this.title = title;
+ this.desc = desc;
+ this.changeType = changeType;
+ this.priority = priority;
+ this.needByDate = needByDate;
+ this.validationRequired = validationRequired;
+ this.userComms = userComms;
+ this.actionableItems = actionableItems;
+ this.wizard = wizard;
+ }
+
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ if (title.equals("tt")) title += " " + getAtsDeveloperTTNum();
+ actionArt =
+ createAction(monitor, title, desc, changeType, priority, userComms, validationRequired, needByDate,
+ actionableItems, transaction);
+
+ if (wizard != null) wizard.notifyAtsWizardItemExtensions(actionArt, transaction);
+
+ monitor.subTask("Persisting");
+ transaction.execute();
+
+ // Because this is a job, it will automatically kill any popups that are created during.
+ // Thus, if multiple teams were selected to create, don't popup on openAction or dialog
+ // will exception out when it is killed at the end of this job.
+ AtsLib.openAtsAction(actionArt, AtsOpenOption.OpenAll);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return Status.OK_STATUS;
+ }
+
+ /**
+ * The development of ATS requires quite a few Actions to be created. To facilitate this, getTTNum will retrieve a
+ * persistent number from the filesystem so each action has a different name. By entering "tt" in the title, new
+ * action wizard will be prepopulated with selections and the action name will be created as "tt <number in
+ * atsNumFilename>".
+ *
+ * @return number
+ */
+ public static int getAtsDeveloperTTNum() {
+ File numFile = OseeData.getFile("atsDevNum.txt");
+ if (numFile.exists() && ttNum == 0) {
+ try {
+ ttNum = new Integer(AFile.readFile(numFile).replaceAll("\\s", ""));
+ } catch (NumberFormatException ex) {
+ } catch (NullPointerException ex) {
+ }
+ }
+ ttNum++;
+ AFile.writeFile(numFile, ttNum + "");
+ return ttNum;
+ }
+
+ public static ActionArtifact createAction(IProgressMonitor monitor, String title, String desc, ChangeType changeType, PriorityType priority, Collection<String> userComms, boolean validationRequired, Date needByDate, Collection<ActionableItemArtifact> actionableItems, SkynetTransaction transaction) throws OseeCoreException {
+ // if "tt" is title, this is an action created for development. To
+ // make it easier, all fields are automatically filled in for ATS developer
+
+ if (monitor != null) monitor.subTask("Creating Action");
+ ActionArtifact actionArt =
+ (ActionArtifact) ArtifactTypeManager.addArtifact(ActionArtifact.ARTIFACT_NAME, AtsPlugin.getAtsBranch());
+ ActionArtifact.setArtifactIdentifyData(actionArt, title, desc, changeType, priority, userComms,
+ validationRequired, needByDate);
+
+ // Relate Action to ActionableItems (by guid)
+ for (ActionableItemArtifact aia : actionableItems)
+ actionArt.getActionableItemsDam().addActionableItem(aia);
+
+ // Retrieve Team Definitions corresponding to selected Actionable Items
+ if (monitor != null) monitor.subTask("Creating WorkFlows");
+ Collection<TeamDefinitionArtifact> teams =
+ TeamDefinitionArtifact.getImpactedTeamDefs(actionArt.getActionableItemsDam().getActionableItems());
+ if (teams == null || teams.size() == 0) {
+ StringBuffer sb = new StringBuffer();
+ for (ActionableItemArtifact aia : actionableItems)
+ sb.append("Selected AI \"" + aia + "\" " + aia.getHumanReadableId() + "\n");
+ throw new IllegalArgumentException(
+ "No teams returned for Action's selected Actionable Items\n" + sb.toString());
+ }
+
+ // Create team workflow artifacts
+ for (TeamDefinitionArtifact teamDef : teams) {
+ actionArt.createTeamWorkflow(teamDef, actionableItems, teamDef.getLeads(actionableItems), transaction);
+ }
+ actionArt.persistAttributesAndRelations(transaction);
+ return actionArt;
+
+ }
+
+ /**
+ * @return Returns the identifyStateDescription.
+ */
+ public String getIdentifyStateDescription() {
+ return identifyStateDescription;
+ }
+
+ /**
+ * @param identifyStateDescription The identifyStateDescription to set.
+ */
+ public void setIdentifyStateDescription(String identifyStateDescription) {
+ this.identifyStateDescription = identifyStateDescription;
+ }
+
+ /**
+ * @return Returns the saveIt.
+ */
+ public boolean isSaveIt() {
+ return saveIt;
+ }
+
+ /**
+ * @param saveIt The saveIt to set.
+ */
+ public void setSaveIt(boolean saveIt) {
+ this.saveIt = saveIt;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
new file mode 100644
index 00000000000..a27ee5b3e0c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.widgets.dialog.AITreeContentProvider;
+import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTree;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionPage1 extends WizardPage {
+ private final NewActionWizard wizard;
+ private WorkPage page;
+ private OSEECheckedFilteredTree treeViewer;
+ private static PatternFilter patternFilter = new PatternFilter();
+
+ /**
+ * @param actionWizard
+ */
+ public NewActionPage1(NewActionWizard actionWizard) {
+ super("Create new ATS Action", "Create ATS Action", null);
+ setMessage("Enter title and select impacted items.");
+ this.wizard = actionWizard;
+ }
+
+ private XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget widget) {
+ getContainer().updateButtons();
+ }
+ };
+
+ public void createControl(Composite parent) {
+
+ try {
+ String xWidgetXml =
+ "<WorkPage><XWidget displayName=\"Title\" required=\"true\" xwidgetType=\"XText\" toolTip=\"" + ATSAttributes.TITLE_ATTRIBUTE.getDescription() + "\"/></WorkPage>";
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout(1, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ page = new WorkPage(xWidgetXml, ATSXWidgetOptionResolver.getInstance());
+ page.createBody(null, comp, null, xModListener, true);
+
+ Composite aiComp = new Composite(comp, SWT.NONE);
+ aiComp.setLayout(new GridLayout(1, false));
+ aiComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ (new Label(aiComp, SWT.NONE)).setText("Select Actionable Items:");
+ treeViewer =
+ new OSEECheckedFilteredTree(aiComp,
+ SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, patternFilter);
+ treeViewer.getViewer().getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ treeViewer.getViewer().setContentProvider(new AITreeContentProvider(Active.Active));
+ treeViewer.getViewer().setLabelProvider(new ArtifactLabelProvider());
+ try {
+ treeViewer.getViewer().setInput(ActionableItemArtifact.getTopLevelActionableItems(Active.Active));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ treeViewer.getViewer().setSorter(new ArtifactNameSorter());
+ treeViewer.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ getContainer().updateButtons();
+ }
+ });
+
+ Button deselectAll = new Button(aiComp, SWT.PUSH);
+ deselectAll.setText("De-Select All");
+ deselectAll.addSelectionListener(new SelectionListener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ treeViewer.clearChecked();
+ };
+ });
+
+ setControl(comp);
+ setHelpContexts();
+ if (wizard.getInitialAias() != null) treeViewer.setInitalChecked(wizard.getInitialAias());
+ ((XText) getXWidget("Title")).setFocus();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ private void setHelpContexts() {
+ AtsPlugin.getInstance().setHelp(this.getControl(), "new_action_wizard_page_1");
+ }
+
+ public Set<ActionableItemArtifact> getSelectedActionableItemArtifacts() {
+ Set<ActionableItemArtifact> selected = new HashSet<ActionableItemArtifact>();
+ for (Object obj : treeViewer.getChecked()) {
+ selected.add((ActionableItemArtifact) obj);
+ }
+ return selected;
+ }
+
+ public XWidget getXWidget(String attrName) {
+ if (page == null) throw new IllegalArgumentException("WorkPage == null");
+ return page.getLayoutData(attrName).getXWidget();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (treeViewer.getChecked().size() == 0) return false;
+ try {
+ for (ActionableItemArtifact aia : getSelectedActionableItemArtifacts()) {
+ if (!aia.isActionable()) {
+ AWorkbench.popup("ERROR", ActionableItemArtifact.getNotActionableItemError(aia));
+ return false;
+ }
+ }
+ Collection<TeamDefinitionArtifact> teamDefs =
+ TeamDefinitionArtifact.getImpactedTeamDefs(getSelectedActionableItemArtifacts());
+ if (teamDefs.size() == 0) {
+ AWorkbench.popup("ERROR", "No Teams Associated with selected Actionable Items");
+ return false;
+ }
+ } catch (Exception ex) {
+ AWorkbench.popup("ERROR", ex.getLocalizedMessage());
+ return false;
+ }
+ if (!page.isPageComplete().isTrue()) return false;
+ return true;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java
new file mode 100644
index 00000000000..bc7ade72c32
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XList;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionPage2 extends WizardPage {
+ private WorkPage page;
+ private final NewActionWizard wizard;
+
+ /**
+ * @param wizard -
+ */
+ public NewActionPage2(NewActionWizard wizard) {
+ super("Create new ATS Action", "Create ATS Action", null);
+ this.wizard = wizard;
+ setMessage("Enter description, priority, change type and select Finish.");
+ }
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ if (wizard.getInitialDescription() != null && ((XText) getXWidget("Description")).get().equals("")) ((XText) getXWidget("Description")).set(wizard.getInitialDescription());
+ if (wizard.isTTAction()) handlePopulateWithDebugInfo();
+ wizard.createPage3IfNecessary();
+ ((XText) getXWidget("Description")).getStyledText().setFocus();
+ }
+
+ private final XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget widget) {
+ getContainer().updateButtons();
+ }
+ };
+
+ public void createControl(Composite parent) {
+
+ try {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<WorkPage><XWidget displayName=\"Description\" height=\"80\" required=\"true\" xwidgetType=\"XText\" fill=\"Vertically\" toolTip=\"" + ATSAttributes.DESCRIPTION_ATTRIBUTE.getDescription() + "\"/>");
+ sb.append("<XWidget displayName=\"Change Type\" storageName=\"ats.Change Type\" xwidgetType=\"XCombo(" + ATSXWidgetOptionResolver.OPTIONS_FROM_ATTRIBUTE_VALIDITY + ")\" required=\"true\" horizontalLabel=\"true\" toolTip=\"" + ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getDescription() + "\"/>");
+ sb.append("<XWidget displayName=\"Priority\" storageName=\"ats.Priority\" xwidgetType=\"XCombo(" + ATSXWidgetOptionResolver.OPTIONS_FROM_ATTRIBUTE_VALIDITY + ")\" required=\"true\" horizontalLabel=\"true\"/>");
+ sb.append("<XWidget displayName=\"Deadline\" xwidgetType=\"XDate\" horizontalLabel=\"true\" toolTip=\"" + ATSAttributes.DEADLINE_ATTRIBUTE.getDescription() + "\"/>");
+ sb.append("<XWidget displayName=\"Validation Required\" xwidgetType=\"XCheckBox\" horizontalLabel=\"true\" labelAfter=\"true\" toolTip=\"" + ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getDescription() + "\"/>");
+ sb.append("<XWidget displayName=\"User Community\" storageName=\"ats.User Community\" xwidgetType=\"XList(" + ATSXWidgetOptionResolver.OPTIONS_FROM_ATTRIBUTE_VALIDITY + ")\" required=\"true\" toolTip=\"" + ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getDescription() + "\"/></WorkPage>");
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ page = new WorkPage(sb.toString(), ATSXWidgetOptionResolver.getInstance());
+ page.createBody(null, comp, null, xModListener, true);
+
+ ((XText) getXWidget("Description")).getLabelWidget().addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event event) {
+ if (event.button == 3) {
+ handlePopulateWithDebugInfo();
+ }
+ }
+ });
+
+ setControl(comp);
+ setHelpContexts();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ private void setHelpContexts() {
+ AtsPlugin.getInstance().setHelp(this.getControl(), "new_action_wizard_page_2");
+ }
+
+ public void handlePopulateWithDebugInfo() {
+ ((XText) getXWidget("Description")).set("See title");
+ // Must use skynet attribute name cause these widget uses the OPTIONS_FROM_ATTRIBUTE_VALIDITY
+ ((XList) getXWidget("ats.User Community")).setSelected("Other");
+ ((XCombo) getXWidget("ats.Priority")).set("4");
+ ((XCombo) getXWidget("ats.Change Type")).set("Improvement");
+ }
+
+ public void update() {
+ getContainer().updateButtons();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (page == null || !page.isPageComplete().isTrue()) return false;
+ return true;
+ }
+
+ public XWidget getXWidget(String attrName) {
+ if (page == null) throw new IllegalArgumentException("WorkPage == null");
+ return page.getLayoutData(attrName).getXWidget();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
new file mode 100644
index 00000000000..eb9b449d652
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionPage3 extends WizardPage {
+ private WorkPage page;
+ private Composite comp;
+ private final NewActionWizard wizard;
+ private static Set<IAtsWizardItem> wizardExtensionItems = new HashSet<IAtsWizardItem>();
+
+ /**
+ * @param wizard -
+ */
+ public NewActionPage3(NewActionWizard wizard) {
+ super("Create new ATS Action", "Create ATS Action", null);
+ this.wizard = wizard;
+ setMessage("Enter requested information and select Finish.");
+ getWizardXWidgetExtensions();
+ }
+
+ public void notifyAtsWizardItemExtensions(ActionArtifact action, SkynetTransaction transaction) {
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(wizard.getSelectedActionableItemArtifacts())) item.wizardCompleted(
+ action, wizard, transaction);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private final XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget widget) {
+ getContainer().updateButtons();
+ }
+ };
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ createPage(comp);
+ getShell().layout();
+ }
+
+ public void createPage(Composite comp) {
+ try {
+ if (page == null) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<WorkPage>");
+ // sb.append("<XWidget displayName=\"Description\" height=\"80\" required=\"true\"
+ // xwidgetType=\"XText\" fill=\"Vertically\" toolTip=\""
+ // + ATSAttributes.DESCRIPTION_ATTRIBUTE.getDescription() + "\"/>");
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(wizard.getSelectedActionableItemArtifacts())) item.getWizardXWidgetExtensions(
+ wizard.getSelectedActionableItemArtifacts(), sb);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ sb.append("</WorkPage>");
+
+ page = new WorkPage(sb.toString(), ATSXWidgetOptionResolver.getInstance());
+ page.createBody(null, comp, null, xModListener, true);
+
+ comp.layout();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * createControl is called when wizard is initially created. Create a composite to use when this page is displayed.
+ */
+ public void createControl(Composite parent) {
+
+ comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ setControl(comp);
+ }
+
+ public void update() {
+ getContainer().updateButtons();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (page == null || !page.isPageComplete().isTrue()) return false;
+ // Check wizard extension item validation
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(wizard.getSelectedActionableItemArtifacts())) {
+ Result result = item.isWizardXWidgetsComplete(wizard);
+ if (result.isFalse()) {
+ setErrorMessage(result.getText());
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ setErrorMessage(null);
+ return true;
+ }
+
+ public XWidget getXWidget(String attrName) {
+ if (page == null) throw new IllegalArgumentException("WorkPage == null");
+ return page.getLayoutData(attrName).getXWidget();
+ }
+
+ private static void getWizardXWidgetExtensions() {
+ if (wizardExtensionItems.size() > 0) return;
+
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsWizardItem");
+ if (point == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't access AtsWizardItem extension point", true);
+ return;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String classname = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsWizardItem")) {
+ classname = el.getAttribute("classname");
+ bundleName = el.getContributor().getName();
+ if (classname != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ Class<?> taskClass = bundle.loadClass(classname);
+ Object obj = taskClass.newInstance();
+ wizardExtensionItems.add((IAtsWizardItem) obj);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsWizardItem extension", ex, true);
+ }
+ }
+
+ }
+ }
+ }
+ }
+
+ public static boolean isPage3Necesary(Collection<ActionableItemArtifact> aias) {
+ getWizardXWidgetExtensions();
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(aias)) return true;
+ } catch (Exception ex) {
+ // DO NOTHING
+ }
+ }
+ return false;
+ }
+
+ public Result isActionValid() {
+ getWizardXWidgetExtensions();
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(wizard.getSelectedActionableItemArtifacts())) {
+ Result result = item.isActionValidToCreate(wizard.getSelectedActionableItemArtifacts(), wizard);
+ if (result.isFalse()) return result;
+ }
+ } catch (Exception ex) {
+ // DO NOTHING
+ }
+ }
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
new file mode 100644
index 00000000000..0944a1deeec
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
@@ -0,0 +1,180 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.XList;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XList.XListItem;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionWizard extends Wizard implements INewWizard {
+ private NewActionPage1 page1;
+ private NewActionPage2 page2;
+ private NewActionPage3 page3;
+ private Collection<ActionableItemArtifact> initialAias;
+ private String initialDescription;
+
+ /**
+ * Wizard to create a new action artifact with ONE product
+ */
+ public NewActionWizard() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ /**
+ * (non-Javadoc) Method declared on Wizard.
+ */
+ @Override
+ public void addPages() {
+ page1 = new NewActionPage1(this);
+ addPage(page1);
+ page2 = new NewActionPage2(this);
+ addPage(page2);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return (page3 == null) ? page2.isPageComplete() : page3.isPageComplete();
+ }
+
+ public void createPage3IfNecessary() {
+ if (page3 == null && NewActionPage3.isPage3Necesary(getSelectedActionableItemArtifacts())) {
+ page3 = new NewActionPage3(this);
+ addPage(page3);
+ }
+ }
+
+ public boolean isTTAction() {
+ return getTitle().equals("tt");
+ }
+
+ public String getTitle() {
+ return ((XText) page1.getXWidget("Title")).get();
+ }
+
+ public Set<ActionableItemArtifact> getSelectedActionableItemArtifacts() {
+ return page1.getSelectedActionableItemArtifacts();
+ }
+
+ public String getDescription() {
+ return ((XText) page2.getXWidget("Description")).get();
+ }
+
+ public Set<String> getUserCommunities() {
+ Set<String> items = new HashSet<String>();
+ // Must use skynet attribute name cause this widget uses the OPTIONS_FROM_ATTRIBUTE_VALIDITY
+ for (XListItem item : ((XList) page2.getXWidget("ats.User Community")).getSelected())
+ items.add(item.getName());
+ return items;
+ }
+
+ public PriorityType getPriority() throws OseeCoreException {
+ // Must use skynet attribute name cause this widget uses the OPTIONS_FROM_ATTRIBUTE_VALIDITY
+ return PriorityType.getPriority(((XCombo) page2.getXWidget("ats.Priority")).get());
+ }
+
+ public ChangeType getChangeType() {
+ // Must use skynet attribute name cause this widget uses the OPTIONS_FROM_ATTRIBUTE_VALIDITY
+ return ChangeType.getChangeType(((XCombo) page2.getXWidget("ats.Change Type")).get());
+ }
+
+ public boolean getValidation() {
+ return ((XCheckBox) page2.getXWidget("Validation Required")).get();
+ }
+
+ public Date getNeedBy() {
+ return ((XDate) page2.getXWidget("Deadline")).getDate();
+ }
+
+ public void notifyAtsWizardItemExtensions(ActionArtifact action, SkynetTransaction transaction) {
+ if (page3 != null) {
+ page3.notifyAtsWizardItemExtensions(action, transaction);
+ }
+ }
+
+ public XWidget getExtendedXWidget(String attrName) {
+ if (page3 == null) return null;
+ return page3.getXWidget(attrName);
+ }
+
+ public Result isActionValid() {
+ if (page3 == null) return Result.TrueResult;
+ return page3.isActionValid();
+ }
+
+ /**
+ * @return the initialDescription
+ */
+ public String getInitialDescription() {
+ return initialDescription;
+ }
+
+ /**
+ * @param initialDescription the initialDescription to set
+ */
+ public void setInitialDescription(String initialDescription) {
+ this.initialDescription = initialDescription;
+ }
+
+ /**
+ * @return the initialAias
+ */
+ public Collection<ActionableItemArtifact> getInitialAias() {
+ return initialAias;
+ }
+
+ /**
+ * @param initialAias the initialAias to set
+ */
+ public void setInitialAias(Collection<ActionableItemArtifact> initialAias) {
+ this.initialAias = initialAias;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java
new file mode 100644
index 00000000000..241f4a54bf2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.osee.framework.ui.skynet.ats.NoteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XList;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewNotePage extends WizardPage {
+ public XList typeList;
+ public XText noteText;
+ public XList artifactList;
+ private final NewNoteWizard wizard;
+
+ /**
+ * @param wizard -
+ */
+ public NewNotePage(NewNoteWizard wizard) {
+ super("Create new Note", "Create new Note", null);
+ this.wizard = wizard;
+ }
+
+ public void createControl(Composite parent) {
+ typeList = new XList("Type");
+ typeList.setRequiredEntry(true);
+ typeList.setGrabHorizontal(true);
+ typeList.setRequiredSelected(1, 1);
+ typeList.add(NoteType.getNames());
+ typeList.setVerticalLabel(true);
+ artifactList = new XList("Against Artifact");
+ artifactList.setVerticalLabel(true);
+ artifactList.setRequiredEntry(true);
+ artifactList.setGrabHorizontal(true);
+ artifactList.setRequiredSelected(1, 1);
+ artifactList.add(wizard.getArtifactNames());
+ noteText = new XText("Note");
+ noteText.setRequiredEntry(true);
+ noteText.setVerticalLabel(true);
+ noteText.setFillHorizontally(true);
+ noteText.setFillVertically(true);
+
+ Composite composite = new Composite(parent, SWT.NONE);
+ composite.setLayout(ALayout.getZeroMarginLayout(1, false));
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Composite topC = new Composite(composite, SWT.NONE);
+ topC.setLayout(ALayout.getZeroMarginLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ topC.setLayoutData(gd);
+
+ Composite topCLeft = new Composite(topC, SWT.NONE);
+ topCLeft.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ topCLeft.setLayoutData(gd);
+
+ typeList.createWidgets(topCLeft, 2);
+ typeList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
+ };
+
+ public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
+ update();
+ };
+ });
+
+ Composite topCRight = new Composite(topC, SWT.NONE);
+ topCRight.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ topCRight.setLayoutData(gd);
+
+ artifactList.createWidgets(topCRight, 2);
+ artifactList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
+ };
+
+ public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
+ update();
+ };
+ });
+
+ Composite bottomC = new Composite(composite, SWT.NONE);
+ bottomC.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL_BOTH);
+ bottomC.setLayoutData(gd);
+
+ noteText.createWidgets(bottomC, 2);
+ noteText.addModifyListener(new ModifyListener() {
+ public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
+ update();
+ };
+ });
+
+ setControl(composite);
+ }
+
+ public void update() {
+ getContainer().updateButtons();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (noteText.get().equals("")) {
+ return false;
+ }
+ if (typeList.getSelected().size() == 0) {
+ return false;
+ }
+ if (artifactList.getSelected().size() == 0) {
+ return false;
+ }
+ return true;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java
new file mode 100644
index 00000000000..6669878019f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.actions.wizard;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewNoteWizard extends Wizard {
+ public NewNotePage mainPage;
+ private final Collection<String> artifactNames;
+
+ /**
+ *
+ */
+ public NewNoteWizard(Collection<String> artifactNames) {
+ super();
+ this.artifactNames = artifactNames;
+ setWindowTitle("New Note Wizard");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ }
+
+ /**
+ * (non-Javadoc) Method declared on Wizard.
+ */
+ public void addPages() {
+ mainPage = new NewNotePage(this);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ public Collection<String> getArtifactNames() {
+ return artifactNames;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java
new file mode 100644
index 00000000000..ccd19a67319
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.ats.hyper.IHyperArtifact;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
+
+public abstract class ATSArtifact extends Artifact implements IHyperArtifact, IATSArtifact {
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public ATSArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ public String toString() {
+ return getInternalDescriptiveName();
+ }
+
+ public String getHyperlinkHtml() {
+ return Overview.getOpenHyperlinkHtml(this);
+ }
+
+ /**
+ * Recursively retrieve artifacts and all it's ATS related artifacts such as tasks, notes, subscriptions, etc... for
+ * deletion
+ *
+ * @param deleteArts
+ * @param allRelated
+ * @throws OseeCoreException
+ */
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ deleteArts.add(this);
+ for (Artifact artifact : getRelatedArtifactsAll()) {
+ allRelated.put(artifact, this);
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java
new file mode 100644
index 00000000000..71dc8c23796
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ATSAttributes {
+
+ private final String displayName;
+ private final String storeName;
+ private final String description;
+ private static Map<String, ATSAttributes> attrNameToAttr = new HashMap<String, ATSAttributes>();
+
+ public static final ATSAttributes SW_ENHANCEMENT_ATTRIBUTE =
+ new ATSAttributes("SW Enhancement", "lba.SW Enhancement", "SW Enhancement field from TRAX");
+ public static final ATSAttributes ROLE_ATTRIBUTE = new ATSAttributes("Role");
+ public static final ATSAttributes ACTIONABLE_ITEM_GUID_ATTRIBUTE = new ATSAttributes("Actionable Item");
+ public static final ATSAttributes TEAM_DEFINITION_GUID_ATTRIBUTE = new ATSAttributes("Team Definition");
+ public static final ATSAttributes TITLE_ATTRIBUTE =
+ new ATSAttributes("Title", "Name", "Enter clear and consise title that can be generally understood.");
+ public static final ATSAttributes STATE_ATTRIBUTE = new ATSAttributes("State", "States of workflow state machine.");
+ public static final ATSAttributes CURRENT_STATE_ATTRIBUTE =
+ new ATSAttributes("Current State", "Current state of workflow state machine.");
+ public static final ATSAttributes FULL_NAME_ATTRIBUTE =
+ new ATSAttributes("Full Name", "Expanded and descriptive name.");
+ public static final ATSAttributes DESCRIPTION_ATTRIBUTE = new ATSAttributes("Description", "Detailed explanation.");
+ public static final ATSAttributes CHANGE_TYPE_ATTRIBUTE = new ATSAttributes("Change Type", "Type of change.");
+ public static final ATSAttributes PRIORITY_TYPE_ATTRIBUTE = new ATSAttributes("Priority", "1 = High; 5 = Low");
+ public static final ATSAttributes USER_COMMUNITY_ATTRIBUTE =
+ new ATSAttributes(
+ "User Community",
+ "If working in one of these communities resulted in the creation of this Action, please select. Otherwise, select Other.");
+ public static final ATSAttributes DEADLINE_ATTRIBUTE =
+ new ATSAttributes("Deadline", "ats.Need By", "Hard schedule date that workflow must be completed.");
+ public static final ATSAttributes VALIDATION_REQUIRED_ATTRIBUTE =
+ new ATSAttributes("Validation Required",
+ "If selected, originator will be asked to validate the implementation.");
+ public static final ATSAttributes ACTIVE_ATTRIBUTE = new ATSAttributes("Active", "Active ATS configuration object.");
+ public static final ATSAttributes LOG_ATTRIBUTE = new ATSAttributes("Log");
+ public static final ATSAttributes LOCATION_ATTRIBUTE = new ATSAttributes("Location");
+ public static final ATSAttributes REVIEW_DEFECT_ATTRIBUTE = new ATSAttributes("Review Defect");
+ public static final ATSAttributes STATE_NOTES_ATTRIBUTE = new ATSAttributes("State Notes");
+ public static final ATSAttributes ESTIMATED_HOURS_ATTRIBUTE =
+ new ATSAttributes("Estimated Hours", "Estimated time to complete workflow.");
+ public static final ATSAttributes WEEKLY_BENEFIT_ATTRIBUTE =
+ new ATSAttributes("Weekly Benefit", "Estimated hours saved by changes made.");
+ public static final ATSAttributes PERCENT_REWORK_ATTRIBUTE = new ATSAttributes("Percent Rework");
+ public static final ATSAttributes TASK_USES_RESOLUTION_OPTIONS_ATTRIBUTE =
+ new ATSAttributes("Task Uses Resolution Options",
+ "True if resolution field is driven by option selections versus simple text.");
+ public static final ATSAttributes RESOLUTION_ATTRIBUTE = new ATSAttributes("Resolution", "Implementation details.");
+ public static final ATSAttributes RELATED_TO_STATE_ATTRIBUTE =
+ new ATSAttributes("Related To State", "State of parent workflow this object is related to.");
+ public static final ATSAttributes CANCEL_REASON_ATTRIBUTE =
+ new ATSAttributes("Cancel Reason", "Reason for cancellation of this ATS object.");
+ public static final ATSAttributes SMA_NOTE_ATTRIBUTE =
+ new ATSAttributes("Notes", "ats.SMA Note", "Notes applicable to ATS object");
+ public static final ATSAttributes WORK_PACKAGE_ATTRIBUTE =
+ new ATSAttributes("Work Package", "Designated accounting work package for completing workflow.");
+ public static final ATSAttributes CATEGORY_ATTRIBUTE =
+ new ATSAttributes("Category", "Free text field for categorizing objects.");
+ public static final ATSAttributes CATEGORY2_ATTRIBUTE =
+ new ATSAttributes("Category2", "Free text field for categorizing objects.");
+ public static final ATSAttributes CATEGORY3_ATTRIBUTE =
+ new ATSAttributes("Category3", "Free text field for categorizing objects.");
+ public static final ATSAttributes CANCELLED_FROM_STATE_ATTRIBUTE =
+ new ATSAttributes("Cancelled From State", "State prior to cancellation of workflow.");
+ public static final ATSAttributes RELEASED_ATTRIBUTE =
+ new ATSAttributes("Released", "True if object is in a released state.");
+ public static final ATSAttributes NEXT_VERSION_ATTRIBUTE =
+ new ATSAttributes("Next Version", "True if version artifact is \"Next\" version to be released.");
+ public static final ATSAttributes ACTIONABLE_ATTRIBUTE =
+ new ATSAttributes("Actionable", "True if item can have Action written against or assigned to.");
+ public static final ATSAttributes TEAM_USES_VERSIONS_ATTRIBUTE =
+ new ATSAttributes("Team Uses Versions", "True if Team Workflow uses versioning/releasing option.");
+ public static final ATSAttributes LEGACY_PCR_ID_ATTRIBUTE =
+ new ATSAttributes("Legacy PCR Id",
+ "Field to register problem change report id from legacy items imported into ATS.");
+ public static final ATSAttributes PARENT_BRANCH_ID_ATTRIBUTE =
+ new ATSAttributes("Parent Branch Id", "Parent branch associated with ATS object.");
+ public static final ATSAttributes DECISION_REVIEW_OPTIONS_ATTRIBUTE =
+ new ATSAttributes(
+ "Decision Review Options",
+ "Options available for selection in review. " + "Each line is a separate option. Format: <option name>;<state to transition to>;<assignee>");
+ public static final ATSAttributes DECISION_ATTRIBUTE =
+ new ATSAttributes("Decision", "Option selected during decision review.");
+ public static final ATSAttributes PROBLEM_ATTRIBUTE = new ATSAttributes("Problem", "Problem found during analysis.");
+ public static final ATSAttributes REQUIRES_FOLLOWUP_ATTRIBUTE =
+ new ATSAttributes("Requires Followup", "True if review requires someone to folloup after decision.");
+ public static final ATSAttributes PROPOSED_RESOLUTION_ATTRIBUTE =
+ new ATSAttributes("Proposed Resolution", "Recommended resolution.");
+ public static final ATSAttributes PROBLEM_OVERRIDE_ATTRIBUTE =
+ new ATSAttributes("Problem Override", "Select if Problem is same as Title/Description");
+ public static final ATSAttributes PROPOSED_RESOLUTION_OVERRIDE_ATTRIBUTE =
+ new ATSAttributes("Proposed Resolution Override",
+ "Select if Proposed Resolution is same as Title/Description/Problem");
+ public static final ATSAttributes RESOLUTION_OVERRIDE_ATTRIBUTE =
+ new ATSAttributes("Resolution Override",
+ "Select if Proposed Resolution is same as Title/Description/Problem/Proposed Resolution");
+ // TODO Remove this after 0.5.0 release
+ public static final ATSAttributes BLOCKING_REVIEW_ATTRIBUTE =
+ new ATSAttributes("Blocking Review",
+ "True if workflow should be blocked from contining until review is completed.");
+ public static final ATSAttributes REVIEW_BLOCKS_ATTRIBUTE =
+ new ATSAttributes("Review Blocks", "Review Completion will block it's parent workflow in this manner.");
+ public static final ATSAttributes ESTIMATED_RELEASE_DATE_ATTRIBUTE = new ATSAttributes("Estimated Release Date");
+ public static final ATSAttributes ESTIMATED_COMPLETION_DATE_ATTRIBUTE =
+ new ATSAttributes("Estimated Completion Date");
+ public static final ATSAttributes RELEASE_DATE_ATTRIBUTE = new ATSAttributes("Release Date");
+ public static final ATSAttributes MAN_DAYS_NEEDED_ATTRIBUTE = new ATSAttributes("Man Days Needed");
+
+ protected ATSAttributes(String displayName, String storeName, String description) {
+ this.displayName = displayName;
+ this.storeName = storeName;
+ this.description = description;
+ attrNameToAttr.put(getStoreName(), this);
+ }
+
+ /**
+ * Creates attribute with displayName = "<name>" and storeName = "ats.<name>"
+ *
+ * @param name
+ */
+ private ATSAttributes(String name) {
+ this(name, "ats." + name, null);
+ }
+
+ /**
+ * Creates attribute with displayName = "<displayName>" and storeName = "ats.<displayName>"
+ *
+ * @param name
+ */
+ private ATSAttributes(String displayName, String description) {
+ this(displayName, "ats." + displayName, description);
+ }
+
+ public static ATSAttributes getAtsAttributeByStoreName(String storeName) {
+ return attrNameToAttr.get(storeName);
+ }
+
+ @Override
+ public final boolean equals(Object obj) {
+ return super.equals(obj);
+ }
+
+ /**
+ * @return Returns the displayName.
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ /**
+ * @return Returns the storeName.
+ */
+ public String getStoreName() {
+ return storeName;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
new file mode 100644
index 00000000000..e4843b890cf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
@@ -0,0 +1,325 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ATSLog {
+
+ private final Artifact artifact;
+ private boolean enabled = true;
+ private static String ATS_LOG_TAG = "AtsLog";
+ private static String LOG_ITEM_TAG = "Item";
+ public static enum LogType {
+ None, Originated, StateComplete, StateCancelled, StateEntered, Released, Error, Assign, Note, Metrics;
+
+ public static LogType getType(String type) throws OseeArgumentException {
+ for (Enum<LogType> e : LogType.values()) {
+ if (e.name().equals(type)) return (LogType) e;
+ }
+ throw new OseeArgumentException("Unhandled LogType: \"" + type + "\"");
+ }
+
+ };
+
+ public ATSLog(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ @Override
+ public String toString() {
+ try {
+ return getLogItems().toString();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public String getHtml() throws OseeCoreException {
+ return getHtml(true);
+ }
+
+ public String getHtml(boolean showLog) throws OseeCoreException {
+ if (getLogItems().size() == 0) return "";
+ StringBuffer sb = new StringBuffer();
+ if (showLog) sb.append(AHTML.addSpace(1) + AHTML.getLabelStr(
+ AHTML.LABEL_FONT,
+ "History for \"" + artifact.getArtifactTypeName() + "\" - " + artifact.getHumanReadableId() + " - titled \"" + artifact.getDescriptiveName() + "\""));
+ sb.append(getTable());
+ return sb.toString();
+ }
+
+ private static Pattern LOG_ITEM_PATTERN =
+ Pattern.compile("<Item date=\"(.*?)\" msg=\"(.*?)\" state=\"(.*?)\" type=\"(.*?)\" userId=\"(.*?)\"/>");
+
+ private static Pattern LOG_ITEM_TAG_PATTERN = Pattern.compile("<Item ");
+
+ public List<LogItem> getLogItems() throws OseeCoreException {
+ // System.out.println("getLogItems " + artifact.getHumanReadableId());
+ List<LogItem> logItems = new ArrayList<LogItem>();
+ String xml = artifact.getSoleAttributeValue(ATSAttributes.LOG_ATTRIBUTE.getStoreName(), "");
+ if (!xml.equals("")) {
+ Matcher m = LOG_ITEM_PATTERN.matcher(xml);
+ while (m.find()) {
+ LogItem item = new LogItem(m.group(4), m.group(1), m.group(5), m.group(3), m.group(2));
+ logItems.add(item);
+ }
+
+ Matcher m2 = LOG_ITEM_TAG_PATTERN.matcher(xml);
+ int openTagsFound = 0;
+ while (m2.find())
+ openTagsFound++;
+ if (logItems.size() != openTagsFound) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, String.format(
+ "ATS Log: open tags found %d doesn't match log items parsed %d for %s", openTagsFound,
+ logItems.size(), artifact.getHumanReadableId()));
+ }
+ }
+ return logItems;
+ }
+
+ public Date getLastStatusedDate() throws OseeCoreException {
+ LogItem logItem = getLastEvent(LogType.Metrics);
+ if (logItem == null) return null;
+ return logItem.getDate();
+ }
+
+ public void putLogItems(List<LogItem> items) {
+ try {
+ Document doc = Jaxp.newDocument();
+ Element rootElement = doc.createElement(ATS_LOG_TAG);
+ doc.appendChild(rootElement);
+ for (LogItem item : items) {
+ Element element = doc.createElement(LOG_ITEM_TAG);
+ element.setAttribute("type", item.getType().name());
+ element.setAttribute("date", item.getDate().getTime() + "");
+ element.setAttribute("userId", item.getUser().getUserId());
+ element.setAttribute("state", item.getState());
+ element.setAttribute("msg", item.getMsg());
+ rootElement.appendChild(element);
+ }
+ artifact.setSoleAttributeValue(ATSAttributes.LOG_ATTRIBUTE.getStoreName(), Jaxp.getDocumentXml(doc));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't create ats log document", ex, true);
+ }
+ }
+
+ public List<LogItem> getLogItemsReversed() throws OseeCoreException {
+ List<LogItem> logItems = getLogItems();
+ Collections.reverse(logItems);
+ return logItems;
+ }
+
+ public void setOriginator(User user) throws OseeCoreException {
+ List<LogItem> logItems = getLogItems();
+ for (LogItem item : logItems) {
+ if (item.getType() == LogType.Originated) {
+ item.setUser(user);
+ putLogItems(logItems);
+ return;
+ }
+ }
+ }
+
+ /**
+ * Since originator can be changed, return the date of the first originated log item
+ *
+ * @return Date
+ */
+ public Date getCreationDate() throws OseeCoreException {
+ LogItem logItem = getEvent(LogType.Originated);
+ if (logItem == null) return null;
+ return logItem.getDate();
+ }
+
+ /**
+ * Since originator change be changed, return the last originated event's user
+ *
+ * @return User
+ */
+ public User getOriginator() throws OseeCoreException {
+ LogItem logItem = getLastEvent(LogType.Originated);
+ if (logItem == null) return null;
+ return logItem.getUser();
+ }
+
+ /**
+ * Overwrite the first logItem to match type and state with newItem data
+ *
+ * @param matchType
+ * @param matchState
+ * @param newItem
+ */
+ public void overrideStateItemData(LogType matchType, String matchState, LogItem newItem) throws OseeCoreException {
+ List<LogItem> logItems = getLogItems();
+ for (LogItem item : logItems) {
+ if (item.getType() == matchType && item.getState().equals(matchState)) {
+ item.setUser(newItem.getUser());
+ item.setDate(newItem.getDate());
+ item.setMsg(newItem.getMsg());
+ putLogItems(logItems);
+ return;
+ }
+ }
+ }
+
+ /**
+ * Overwrite the first logItem to match matchType with newItem data
+ *
+ * @param matchType
+ * @param newItem
+ */
+ public void overrideItemData(LogType matchType, LogItem newItem) throws OseeCoreException {
+ List<LogItem> logItems = getLogItems();
+ for (LogItem item : logItems) {
+ if (item.getType() == matchType) {
+ item.setState(newItem.getState());
+ item.setUser(newItem.getUser());
+ item.setDate(newItem.getDate());
+ item.setMsg(newItem.getMsg());
+ putLogItems(logItems);
+ return;
+ }
+ }
+ }
+
+ /**
+ * @param type
+ * @param state name of state or null
+ * @param msg
+ * @throws OseeArgumentException
+ * @throws MultipleAttributesExist
+ */
+ public void addLog(LogType type, String state, String msg) throws OseeCoreException {
+ addLog(type, state, msg, new Date(), UserManager.getUser());
+ }
+
+ /**
+ * @param type
+ * @param state name of state or null
+ * @param msg
+ * @param user
+ * @throws MultipleAttributesExist
+ */
+ public void addLog(LogType type, String state, String msg, User user) throws OseeCoreException {
+ addLog(type, state, msg, new Date(), user);
+ }
+
+ public void addLogItem(LogItem item) throws OseeCoreException {
+ addLog(item.getType(), item.getState(), item.getMsg(), item.getDate(), item.getUser());
+ }
+
+ /**
+ * @param type
+ * @param state name of state or null
+ * @param msg
+ * @param date
+ * @param user
+ * @throws MultipleAttributesExist
+ */
+ public void addLog(LogType type, String state, String msg, Date date, User user) throws OseeCoreException {
+ if (!enabled) return;
+ LogItem logItem = new LogItem(type, date, user, state, msg);
+ List<LogItem> logItems = getLogItems();
+ logItems.add(logItem);
+ putLogItems(logItems);
+ }
+
+ public void clearLog() {
+ putLogItems(new ArrayList<LogItem>());
+ }
+
+ public String getTable() throws OseeCoreException {
+ StringBuilder builder = new StringBuilder();
+ List<LogItem> logItems = getLogItems();
+ builder.append("<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Event</TH>" + "<TH>State</TH><TH>Message</TH><TH>User</TH><TH>Date</TH></THEAD></TR>");
+ for (LogItem item : logItems) {
+ User user = item.getUser();
+ String name = "";
+ if (user != null) {
+ name = user.getName();
+ if (name == null || name.equals("")) {
+ name = user.getName();
+ }
+ }
+ builder.append("<TR>");
+ builder.append("<TD>" + item.getType() + "</TD>");
+ builder.append("<TD>" + (item.getState().equals("") ? "." : item.getState()) + "</TD>");
+ builder.append("<TD>" + (item.getMsg().equals("") ? "." : item.getMsg()) + "</TD>");
+ if (user.equals(UserManager.getUser()))
+ builder.append("<TD bgcolor=\"#CCCCCC\">" + name + "</TD>");
+ else
+ builder.append("<TD>" + name + "</TD>");
+ builder.append("<TD>" + item.getDate(XDate.MMDDYYHHMM) + "</TD>");
+ builder.append("</TR>");
+ }
+ builder.append("</TABLE>");
+ return builder.toString();
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public LogItem getEvent(LogType type) throws OseeCoreException {
+ for (LogItem item : getLogItems())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+ public LogItem getLastEvent(LogType type) throws OseeCoreException {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+ public LogItem getStateEvent(LogType type, String stateName) throws OseeCoreException {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type && item.getState().equals(stateName)) return item;
+ return null;
+ }
+
+ public LogItem getStateEvent(LogType type) throws OseeCoreException {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java
new file mode 100644
index 00000000000..9712cb669c8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.ats.NoteType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ATSNote {
+ private final Artifact artifact;
+ private boolean enabled = true;
+ private static String ATS_NOTE_TAG = "AtsNote";
+ private static String LOG_ITEM_TAG = "Item";
+
+ public ATSNote(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public void addNote(NoteType type, String state, String msg, User user) {
+ addNote(type, state, msg, new Date(), user);
+ }
+
+ public void addNoteItem(NoteItem noteItem) {
+ addNote(noteItem.getType(), noteItem.getState(), noteItem.getMsg(), noteItem.getDate(), noteItem.getUser());
+ }
+
+ public void addNote(NoteType type, String state, String msg, Date date, User user) {
+ if (!enabled) return;
+ NoteItem logItem = new NoteItem(type, state, date.getTime() + "", user, msg);
+ List<NoteItem> logItems = getNoteItems();
+ logItems.add(logItem);
+ saveNoteItems(logItems);
+ }
+
+ public List<NoteItem> getNoteItems() {
+ List<NoteItem> logItems = new ArrayList<NoteItem>();
+ try {
+ String xml = artifact.getSoleAttributeValue(ATSAttributes.STATE_NOTES_ATTRIBUTE.getStoreName(), "");
+ if (!xml.equals("")) {
+ NodeList nodes = Jaxp.readXmlDocument(xml).getElementsByTagName(LOG_ITEM_TAG);
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Element element = (Element) nodes.item(i);
+ User user = UserManager.getUserByUserId(element.getAttribute("userId"));
+ NoteItem item =
+ new NoteItem(element.getAttribute("type"), element.getAttribute("state"),
+ element.getAttribute("date"), user, element.getAttribute("msg"));
+ logItems.add(item);
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return logItems;
+ }
+
+ public void saveNoteItems(List<NoteItem> items) {
+ try {
+ Document doc = Jaxp.newDocument();
+ Element rootElement = doc.createElement(ATS_NOTE_TAG);
+ doc.appendChild(rootElement);
+ for (NoteItem item : items) {
+ Element element = doc.createElement(LOG_ITEM_TAG);
+ element.setAttribute("type", item.getType().name());
+ element.setAttribute("state", item.getState());
+ element.setAttribute("date", item.getDate().getTime() + "");
+ element.setAttribute("userId", item.getUser().getUserId());
+ element.setAttribute("msg", item.getMsg());
+ rootElement.appendChild(element);
+ }
+ artifact.setSoleAttributeValue(ATSAttributes.STATE_NOTES_ATTRIBUTE.getStoreName(), Jaxp.getDocumentXml(doc));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't create ats note document", ex, true);
+ }
+ }
+
+ /**
+ * Display Note Table; If state == null, only display non-state notes Otherwise, show only notes associated with
+ * state
+ *
+ * @param state
+ */
+ public String getTable(String state) {
+ ArrayList<NoteItem> showNotes = new ArrayList<NoteItem>();
+ List<NoteItem> noteItems = getNoteItems();
+ try {
+ if (!artifact.isAttributeTypeValid(ATSAttributes.STATE_NOTES_ATTRIBUTE.getStoreName())) {
+ return "";
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "";
+ }
+
+ for (NoteItem li : noteItems) {
+ if ((state.equals("ALL")) || (state == null && li.getState().equals("")) || (state != null && li.getState().equals(
+ state))) showNotes.add(li);
+ }
+ if (showNotes.size() == 0) return "";
+ StringBuilder builder = new StringBuilder();
+ builder.append("<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Type</TH><TH>State</TH>" + "<TH>Message</TH><TH>User</TH><TH>Date</TH></THEAD></TR>");
+ for (NoteItem note : showNotes) {
+ User user = note.getUser();
+ String name = "";
+ if (user != null) {
+ name = user.getName();
+ if (name == null || name.equals("")) {
+ name = user.getName();
+ }
+ }
+ builder.append("<TR>");
+ builder.append("<TD>" + note.getType() + "</TD>");
+ builder.append("<TD>" + (note.getState().equals("") ? "," : note.getState()) + "</TD>");
+ builder.append("<TD>" + (note.getMsg().equals("") ? "," : note.getMsg()) + "</TD>");
+ if (user.isMe())
+ builder.append("<TD bgcolor=\"#CCCCCC\">" + name + "</TD>");
+ else
+ builder.append("<TD>" + name + "</TD>");
+ builder.append("<TD>" + (new SimpleDateFormat("MM/dd/yyyy h:mm a")).format(note.getDate()) + "</TD>");
+ builder.append("</TR>");
+ }
+ builder.append("</TABLE>");
+ return builder.toString();
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
new file mode 100644
index 00000000000..18775b9999a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
@@ -0,0 +1,1441 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.IAtsTeamWorkflow;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.ats.util.widgets.XActionableItemsDam;
+import org.eclipse.osee.ats.util.widgets.dialog.AICheckTreeDialog;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerCells;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionArtifact extends ATSArtifact implements IWorldViewArtifact {
+
+ public static String ARTIFACT_NAME = "Action";
+ private XActionableItemsDam actionableItemsDam;
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public ActionArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#onInitializationComplete()
+ */
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ actionableItemsDam = new XActionableItemsDam(this);
+ }
+
+ public void resetAttributesOffChildren(SkynetTransaction transaction) throws OseeCoreException {
+ resetActionItemsOffChildren();
+ resetChangeTypeOffChildren();
+ resetPriorityOffChildren();
+ resetUserCommunityOffChildren();
+ resetTitleOffChildren();
+ resetValidationOffChildren();
+ resetDescriptionOffChildren();
+ persistAttributes(transaction);
+ }
+
+ public boolean hasAtsWorldChildren() throws OseeCoreException {
+ return true;
+ }
+
+ /**
+ * Reset Action title only if all children are titled the same
+ */
+ private void resetTitleOffChildren() throws OseeCoreException {
+ String title = "";
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (title.equals(""))
+ title = team.getDescriptiveName();
+ else if (!title.equals(team.getDescriptiveName())) return;
+ }
+ if (!title.equals(getDescriptiveName())) {
+ setDescriptiveName(title);
+ }
+ }
+
+ // Set validation to true if any require validation
+ private void resetValidationOffChildren() throws OseeCoreException {
+ boolean validationRequired = false;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.getSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false)) validationRequired =
+ true;
+ }
+ if (validationRequired != getSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false)) setSoleAttributeValue(
+ ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), validationRequired);
+ }
+
+ /**
+ * Reset Action title only if all children are titled the same
+ */
+ private void resetDescriptionOffChildren() throws OseeCoreException {
+ String desc = "";
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (desc.equals(""))
+ desc = team.getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ else if (!desc.equals(team.getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), ""))) return;
+ }
+ if (!desc.equals(getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), ""))) {
+ setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ }
+ if (desc.equals("")) {
+ deleteSoleAttribute(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+ }
+
+ private Result resetActionItemsOffChildren() throws OseeCoreException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts())
+ if (getTeamWorkFlowArtifacts().size() == 1 || !(new SMAManager(team)).isCancelled()) {
+ aias.addAll(team.getActionableItemsDam().getActionableItems());
+ }
+ return actionableItemsDam.setActionableItems(aias);
+ }
+
+ private void resetChangeTypeOffChildren() throws OseeCoreException {
+ ChangeType changeType = null;
+ Collection<TeamWorkFlowArtifact> teamArts = getTeamWorkFlowArtifacts();
+ if (teamArts.size() == 1)
+ changeType = teamArts.iterator().next().getChangeType();
+ else
+ for (TeamWorkFlowArtifact team : teamArts)
+ if (!(new SMAManager(team)).isCancelled()) {
+ if (changeType == null)
+ changeType = team.getChangeType();
+ // if change type of this team is different than others, can't
+ // change to common type so just return
+ else if (changeType != team.getChangeType()) return;
+ }
+ if (changeType != null && getChangeType() != changeType) setChangeType(changeType);
+ return;
+ }
+
+ private void resetPriorityOffChildren() throws OseeCoreException {
+ PriorityType priorityType = null;
+ Collection<TeamWorkFlowArtifact> teamArts = getTeamWorkFlowArtifacts();
+ if (teamArts.size() == 1)
+ priorityType = teamArts.iterator().next().getPriority();
+ else
+ for (TeamWorkFlowArtifact team : teamArts)
+ if (!(new SMAManager(team)).isCancelled()) {
+ if (priorityType == null)
+ priorityType = team.getPriority();
+ // if change type of this team is different than others, can't
+ // change to common type so just return
+ else if (priorityType != team.getPriority()) return;
+ }
+ if (priorityType != null && getPriority() != priorityType) setPriority(priorityType);
+ return;
+ }
+
+ private void resetUserCommunityOffChildren() throws OseeCoreException {
+ Set<String> userComs = new HashSet<String>();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!(new SMAManager(team)).isCancelled()) {
+ userComs.addAll(team.getAttributesToStringList(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName()));
+ }
+ }
+ setAttributeValues(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName(), userComs);
+ }
+
+ public void setChangeType(ChangeType type) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), type.name());
+ }
+
+ public ChangeType getChangeType() throws OseeCoreException {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ public PriorityType getPriority() throws OseeCoreException {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ public void setPriority(PriorityType type) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), type.getShortName());
+ }
+
+ /**
+ * @return Returns the actionableItemsDam.
+ */
+ public XActionableItemsDam getActionableItemsDam() {
+ return actionableItemsDam;
+ }
+
+ public Collection<TeamWorkFlowArtifact> getTeamWorkFlowArtifacts() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.ActionToWorkflow_WorkFlow, TeamWorkFlowArtifact.class);
+ }
+
+ public String getWorldViewType() throws OseeCoreException {
+ return ARTIFACT_NAME;
+ }
+
+ public String getWorldViewTitle() throws OseeCoreException {
+ return getDescriptiveName();
+ }
+
+ public ChangeType getWorldViewChangeType() throws OseeCoreException {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ public String getWorldViewBranchStatus() throws OseeCoreException {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewBranchStatus().equals("")) sb.append(team.getWorldViewBranchStatus() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewNumberOfTasks() throws OseeCoreException {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewNumberOfTasks().equals("")) sb.append(team.getWorldViewNumberOfTasks() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewState() throws OseeCoreException {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewState();
+ else if (!str.equals(team.getWorldViewState())) return "";
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewActivePoc() throws OseeCoreException {
+ Set<User> pocs = new HashSet<User>();
+ try {
+ // Roll up all assignees
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ pocs.addAll(team.getSmaMgr().getStateMgr().getAssignees());
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return Artifacts.toString("; ", pocs);
+ }
+
+ public String getWorldViewCreatedDateStr() throws OseeCoreException {
+ try {
+ Date date = getWorldViewCreatedDate();
+ if (date == null) return XViewerCells.getCellExceptionString("No Creation Date Found");
+ return XDate.getDateStr(date, XDate.MMDDYYHHMM);
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public Date getWorldViewCreatedDate() throws OseeCoreException {
+ return getTeamWorkFlowArtifacts().iterator().next().getWorldViewCreatedDate();
+ }
+
+ public String getWorldViewID() throws OseeCoreException {
+ return getHumanReadableId();
+ }
+
+ public String getWorldViewPriority() throws OseeCoreException {
+ try {
+ return PriorityType.getPriority(
+ getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), "")).getShortName();
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public Image getAssigneeImage() throws OseeCoreException {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ Image image = team.getAssigneeImage();
+ if (image != null) return image;
+ }
+ return null;
+ }
+
+ public String getWorldViewUserCommunity() throws OseeCoreException {
+ return getAttributesToString(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewActionableItems() throws OseeCoreException {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (ActionableItemArtifact aia : getActionableItemsDam().getActionableItems()) {
+ sb.append(aia.getDescriptiveName() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ super.atsDelete(deleteArts, allRelated);
+ // Delete all products
+ for (TeamWorkFlowArtifact art : getRelatedArtifacts(AtsRelation.ActionToWorkflow_WorkFlow,
+ TeamWorkFlowArtifact.class))
+ art.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewTeam() throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teams = new HashSet<TeamDefinitionArtifact>();
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ teams.add(team.getTeamDefinition());
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return Artifacts.commaArts(teams);
+ }
+
+ public String getWorldViewOriginator() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewOriginator();
+ else if (!str.equals(team.getWorldViewOriginator())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public Date getWorldViewCompletedDate() throws OseeCoreException {
+ Date date = null;
+ // Roll up date if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (date == null)
+ date = team.getWorldViewCompletedDate();
+ else {
+ if (!XDate.getDateStr(date, XDate.MMDDYY).equals(
+ XDate.getDateStr(team.getWorldViewCompletedDate(), XDate.MMDDYY))) return null;
+ }
+ }
+ return date;
+ }
+
+ public Date getWorldViewCancelledDate() throws OseeCoreException {
+ Date date = null;
+ // Roll up date if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (date == null)
+ date = team.getWorldViewCancelledDate();
+ else {
+ if (!XDate.getDateStr(date, XDate.MMDDYY).equals(
+ XDate.getDateStr(team.getWorldViewCancelledDate(), XDate.MMDDYY))) return null;
+ }
+ }
+ return date;
+ }
+
+ public String getWorldViewResolution() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewResolution();
+ else if (!str.equals(team.getWorldViewResolution())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewRemainHours()
+ */
+ public double getWorldViewRemainHours() throws OseeCoreException {
+ double hours = 0;
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewRemainHours();
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewManDaysNeeded()
+ */
+ public double getWorldViewManDaysNeeded() throws OseeCoreException {
+ double hours = 0;
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewManDaysNeeded();
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewEstimatedHours()
+ */
+ public double getWorldViewEstimatedHours() throws OseeCoreException {
+ double hours = 0;
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewEstimatedHours();
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewStatePercentComplete()
+ */
+ public int getWorldViewStatePercentComplete() throws OseeCoreException {
+ if (getTeamWorkFlowArtifacts().size() == 1)
+ return getTeamWorkFlowArtifacts().iterator().next().getWorldViewStatePercentComplete();
+ else {
+ double percent = 0;
+ int items = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (!smaMgr.isCancelled()) {
+ percent += team.getWorldViewStatePercentComplete();
+ items++;
+ }
+ }
+ if (items > 0) {
+ Double rollPercent = percent / items;
+ return rollPercent.intValue();
+ }
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewRelatedToState()
+ */
+ public String getWorldViewRelatedToState() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewNotes()
+ */
+ @Override
+ public String getWorldViewNotes() throws OseeCoreException {
+ String str = "";
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewNotes();
+ else if (!str.equals(team.getWorldViewNotes())) return "";
+ }
+ return str;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewGroups()
+ */
+ @Override
+ public String getWorldViewGroups() throws OseeCoreException {
+ Set<Artifact> groups = new HashSet<Artifact>();
+ groups.addAll(getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__GROUP));
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ groups.addAll(team.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__GROUP));
+ }
+ return Artifacts.toString("; ", groups);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewCategory()
+ */
+ public String getWorldViewCategory() throws OseeCoreException {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewWorkPackage();
+ else if (!str.equals(team.getWorldViewWorkPackage())) return "";
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewWorkPackage() throws OseeCoreException {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewWorkPackage();
+ else if (!str.equals(team.getWorldViewWorkPackage())) return "";
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewCategory2() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewCategory2();
+ else if (!str.equals(team.getWorldViewCategory2())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewCategory3() throws OseeCoreException {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewCategory3();
+ else if (!str.equals(team.getWorldViewCategory3())) return "";
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewVersion()
+ */
+ public String getWorldViewTargetedVersionStr() {
+ Set<String> versions = new HashSet<String>();
+ try {
+ // Roll up version if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewTargetedVersionStr().equals("")) versions.add(team.getWorldViewTargetedVersionStr());
+ }
+ return Collections.toString(",", versions);
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperName()
+ */
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperType()
+ */
+ public String getHyperType() {
+ try {
+ return getArtifactTypeName();
+ } catch (Exception ex) {
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperState()
+ */
+ public String getHyperState() {
+ try {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getHyperState();
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssignee()
+ */
+ public String getHyperAssignee() {
+ try {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getHyperAssignee();
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperImage()
+ */
+ public Image getHyperImage() {
+ return getImage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssigneeImage()
+ */
+ public Image getHyperAssigneeImage() throws OseeCoreException {
+ if (getTeamWorkFlowArtifacts().size() == 1) {
+ return getTeamWorkFlowArtifacts().iterator().next().getHyperAssigneeImage();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperArtifact()
+ */
+ public Artifact getHyperArtifact() {
+ return this;
+ }
+
+ public Result addActionableItems() throws OseeCoreException {
+ final AICheckTreeDialog diag =
+ new AICheckTreeDialog(
+ "Add Impacted Actionable Items",
+ "Select New Impacted Actionable Items\n\n" + "Note: Un-selecting existing items will NOT remove the impact.\n" + "Team Workflow with no impact should be transitioned to Cancelled.",
+ Active.Active);
+
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ aias.addAll(team.getActionableItemsDam().getActionableItems());
+ }
+ diag.setInitialSelections(aias);
+ if (diag.open() != 0) return Result.FalseResult;
+
+ final StringBuffer sb = new StringBuffer();
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+
+ for (ActionableItemArtifact aia : diag.getChecked()) {
+ Result result = addActionableItemToTeamsOrAddTeams(aia, transaction);
+ sb.append(result.getText());
+ }
+ transaction.execute();
+ return new Result(true, sb.toString());
+ }
+
+ public Result addActionableItemToTeamsOrAddTeams(ActionableItemArtifact aia, SkynetTransaction transaction) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (TeamDefinitionArtifact tda : TeamDefinitionArtifact.getImpactedTeamDefs(Arrays.asList(aia))) {
+ boolean teamExists = false;
+ // Look for team workflow that is associated with this tda
+ for (TeamWorkFlowArtifact teamArt : getTeamWorkFlowArtifacts()) {
+ // If found
+ if (teamArt.getTeamDefinition().equals(tda)) {
+ // And workflow doesn't already have this actionable item,
+ // ADD it
+ if (!teamArt.getActionableItemsDam().getActionableItems().contains(aia)) {
+ teamArt.getActionableItemsDam().addActionableItem(aia);
+ teamArt.persistAttributes();
+ sb.append(aia.getDescriptiveName() + " => added to existing team workflow \"" + tda.getDescriptiveName() + "\"\n");
+ teamExists = true;
+ } else {
+ sb.append(aia.getDescriptiveName() + " => already exists in team workflow \"" + tda.getDescriptiveName() + "\"\n");
+ teamExists = true;
+ }
+ }
+ }
+ if (!teamExists) {
+ createTeamWorkflow(tda, Arrays.asList(aia), tda.getLeads(), transaction);
+ sb.append(aia.getDescriptiveName() + " => added team workflow \"" + tda.getDescriptiveName() + "\"\n");
+ }
+ }
+ return new Result(true, sb.toString());
+ }
+
+ public TeamWorkFlowArtifact createTeamWorkflow(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems, Collection<User> assignees, SkynetTransaction transaction) throws OseeCoreException {
+ String teamWorkflowArtifactName = TeamWorkFlowArtifact.ARTIFACT_NAME;
+ IAtsTeamWorkflow teamExt = null;
+
+ // Check if any plugins want to create the team workflow themselves
+ for (IAtsTeamWorkflow teamExtension : TeamWorkflowExtensions.getInstance().getAtsTeamWorkflowExtensions()) {
+ boolean isResponsible = false;
+ try {
+ isResponsible = teamExtension.isResponsibleForTeamWorkflowCreation(teamDef, actionableItems);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.WARNING, ex);
+ }
+ if (isResponsible) {
+ teamWorkflowArtifactName = teamExtension.getTeamWorkflowArtifactName(teamDef, actionableItems);
+ teamExt = teamExtension;
+ }
+ }
+
+ // NOTE: The persist of the workflow will auto-email the assignees
+ TeamWorkFlowArtifact teamArt =
+ createTeamWorkflow(teamDef, actionableItems, assignees, teamWorkflowArtifactName, transaction);
+ // Notify extension that workflow was created
+ if (teamExt != null) teamExt.teamWorkflowCreated(teamArt);
+ return teamArt;
+ }
+
+ public TeamWorkFlowArtifact createTeamWorkflow(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems, Collection<User> assignees, String artifactName, SkynetTransaction transaction) throws OseeCoreException {
+ return createTeamWorkflow(teamDef, actionableItems, assignees, null, null, artifactName, transaction);
+ }
+
+ public TeamWorkFlowArtifact createTeamWorkflow(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems, Collection<User> assignees, String guid, String hrid, String artifactName, SkynetTransaction transaction) throws OseeCoreException {
+
+ // Make sure team doesn't already exist
+ for (TeamWorkFlowArtifact teamArt : getTeamWorkFlowArtifacts()) {
+ if (teamArt.getTeamDefinition().equals(teamDef)) {
+ AWorkbench.popup("ERROR", "Team already exist");
+ throw new IllegalArgumentException(
+ "Team \"" + teamDef + "\" already exists for Action " + getHumanReadableId());
+ }
+ }
+ TeamWorkFlowArtifact teamArt = null;
+ if (guid == null)
+ teamArt = (TeamWorkFlowArtifact) ArtifactTypeManager.addArtifact(artifactName, AtsPlugin.getAtsBranch());
+ else
+ teamArt =
+ (TeamWorkFlowArtifact) ArtifactTypeManager.addArtifact(artifactName, AtsPlugin.getAtsBranch(), guid,
+ hrid);
+ setArtifactIdentifyData(this, teamArt);
+
+ teamArt.getSmaMgr().getLog().addLog(LogType.Originated, "", "");
+
+ // Relate Workflow to ActionableItems (by guid) if team is responsible
+ // for that AI
+ for (ActionableItemArtifact aia : actionableItems)
+ if (aia.getImpactedTeamDefs().contains(teamDef)) teamArt.getActionableItemsDam().addActionableItem(aia);
+
+ // Initialize state machine
+ teamArt.getSmaMgr().getStateMgr().initializeStateMachine(DefaultTeamState.Endorse.name(), assignees);
+ teamArt.getSmaMgr().getLog().addLog(LogType.StateEntered, DefaultTeamState.Endorse.name(), "");
+
+ // Relate WorkFlow to Team Definition (by guid due to relation loading
+ // issues)
+ teamArt.setTeamDefinition(teamDef);
+
+ // Relate Action to WorkFlow
+ addRelation(AtsRelation.ActionToWorkflow_WorkFlow, teamArt);
+
+ teamArt.persistAttributesAndRelations(transaction);
+
+ return teamArt;
+ }
+
+ /**
+ * Set Team Workflow attributes off given action artifact
+ *
+ * @param fromAction
+ * @param toTeam
+ * @throws OseeArgumentException
+ */
+ public static void setArtifactIdentifyData(ActionArtifact fromAction, TeamWorkFlowArtifact toTeam) throws OseeCoreException {
+ String priorityStr = fromAction.getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), "");
+ PriorityType priType = null;
+ if (priorityStr.equals(""))
+ priType = null;
+ else if (!priorityStr.equals(""))
+ priType = PriorityType.getPriority(priorityStr);
+ else
+ throw new OseeArgumentException("Invalid priority => " + priorityStr);
+ setArtifactIdentifyData(toTeam, fromAction.getDescriptiveName(), fromAction.getSoleAttributeValue(
+ ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), ""),
+ ChangeType.getChangeType(fromAction.getSoleAttributeValue(
+ ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), "")), priType,
+ fromAction.getAttributesToStringList(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName()),
+ fromAction.getSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false),
+ fromAction.getSoleAttributeValue(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName(), null, Date.class));
+ }
+
+ /**
+ * Since there is no shared attribute yet, action and workflow arts are all populate with identify data
+ *
+ * @param art
+ */
+ public static void setArtifactIdentifyData(Artifact art, String title, String desc, ChangeType changeType, PriorityType priority, Collection<String> userComms, Boolean validationRequired, Date needByDate) throws OseeCoreException {
+ art.setDescriptiveName(title);
+ if (!desc.equals("")) art.setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ art.setSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), changeType.name());
+ art.setAttributeValues(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName(), userComms);
+ if (priority != null) art.setSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(),
+ priority.getShortName());
+ if (needByDate != null) art.setSoleAttributeValue(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName(), needByDate);
+ if (validationRequired) art.setSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(),
+ true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDecision()
+ */
+ public String getWorldViewDecision() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact#getParentSMArt()
+ */
+ public Artifact getParentAtsArtifact() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() throws OseeCoreException {
+ try {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewValidationRequired()
+ */
+ public String getWorldViewValidationRequiredStr() throws OseeCoreException {
+ try {
+ return String.valueOf(getSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false));
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ @Override
+ public Date getWorldViewEstimatedReleaseDate() throws OseeCoreException {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getWorldViewEstimatedReleaseDate();
+ return null;
+ }
+
+ @Override
+ public String getWorldViewReleaseDateStr() throws OseeCoreException {
+ try {
+ Date date = getWorldViewReleaseDate();
+ if (date == null) return "";
+ return XDate.getDateStr(date, XDate.MMDDYY);
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ @Override
+ public Date getWorldViewEstimatedCompletionDate() throws OseeCoreException {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getWorldViewEstimatedReleaseDate();
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewCancelledDateStr()
+ */
+ public String getWorldViewCancelledDateStr() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewState();
+ else if (!str.equals(team.getWorldViewCancelledDateStr())) return "";
+ }
+ return str;
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ Date date = null;
+ // Roll up date if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (date == null)
+ date = team.getWorldViewReleaseDate();
+ else {
+ if (!XDate.getDateStr(date, XDate.MMDDYY).equals(
+ XDate.getDateStr(team.getWorldViewReleaseDate(), XDate.MMDDYY))) return null;
+ }
+ }
+ return date;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewCompletedDateStr()
+ */
+ public String getWorldViewCompletedDateStr() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewCompletedDateStr();
+ else if (!str.equals(team.getWorldViewCompletedDateStr())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewEstimatedReleaseDateStr()
+ */
+ public String getWorldViewEstimatedReleaseDateStr() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewEstimatedReleaseDateStr();
+ else if (!str.equals(team.getWorldViewEstimatedReleaseDateStr())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewEstimatedCompletionDateStr()
+ */
+ public String getWorldViewEstimatedCompletionDateStr() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewEstimatedCompletionDateStr();
+ else if (!str.equals(team.getWorldViewEstimatedCompletionDateStr())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewRemainHoursValid()
+ */
+ public Result isWorldViewRemainHoursValid() throws OseeCoreException {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.isWorldViewRemainHoursValid().isFalse()) {
+ return team.isWorldViewRemainHoursValid();
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewManDaysNeededValid()
+ */
+ public Result isWorldViewManDaysNeededValid() {
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts())
+ if (team.isWorldViewManDaysNeededValid().isFalse()) return team.isWorldViewManDaysNeededValid();
+ } catch (OseeCoreException ex) {
+ // Do nothing
+ }
+ return Result.TrueResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewChangeTypeStr()
+ */
+ public String getWorldViewChangeTypeStr() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewChangeTypeStr();
+ else if (!str.equals(team.getWorldViewChangeTypeStr())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ public String getWorldViewImplementer() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewImplementer();
+ else if (!str.equals(team.getWorldViewImplementer())) return "";
+ }
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ Date date = null;
+ // Roll up date if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (date == null)
+ date = team.getWorldViewDeadlineDate();
+ else {
+ if (!XDate.getDateStr(date, XDate.MMDDYY).equals(
+ XDate.getDateStr(team.getWorldViewDeadlineDate(), XDate.MMDDYY))) return null;
+ }
+ }
+ return date;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ try {
+ Date date = getWorldViewDeadlineDate();
+ if (date == null) return "";
+ return XDate.getDateStr(date, XDate.MMDDYY);
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() throws OseeCoreException {
+ double hours = 0;
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (!smaMgr.isCompleted() && !smaMgr.isCancelled()) hours += team.getWorldViewWeeklyBenefit();
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewAnnualCostAvoidance()
+ */
+ public double getWorldViewAnnualCostAvoidance() throws OseeCoreException {
+ double hours = 0;
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (!smaMgr.isCompleted() && !smaMgr.isCancelled()) hours += team.getWorldViewAnnualCostAvoidance();
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewAnnualCostAvoidanceValid()
+ */
+ public Result isWorldViewAnnualCostAvoidanceValid() {
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ Result result = team.isWorldViewAnnualCostAvoidanceValid();
+ if (result.isFalse()) return result;
+ }
+ } catch (OseeCoreException ex) {
+ // Do nothing
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public Set<ArtifactAnnotation> getAnnotations() {
+ Set<ArtifactAnnotation> notifications = super.getAnnotations();
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ notifications.addAll(team.getAnnotations());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return notifications;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewDeadlineAlerting()
+ */
+ public Result isWorldViewDeadlineAlerting() {
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ Result result = team.isWorldViewDeadlineAlerting();
+ if (result.isTrue()) return result;
+ }
+ } catch (OseeCoreException ex) {
+ // Do nothing
+ }
+ return Result.FalseResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewLegacyPCR()
+ */
+ public String getWorldViewLegacyPCR() throws OseeCoreException {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewLegacyPCR();
+ else if (!str.equals(team.getWorldViewLegacyPCR())) return "";
+ }
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentReworkStr()
+ */
+ public String getWorldViewPercentReworkStr() {
+ Set<String> reworks = new HashSet<String>();
+ try {
+ // Roll up version if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.getWorldViewPercentRework() > 0) reworks.add(String.valueOf(team.getWorldViewPercentRework()));
+ }
+ return Collections.toString(",", reworks);
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentRework()
+ */
+ public int getWorldViewPercentRework() throws OseeCoreException {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewAuthor()
+ */
+ public String getWorldViewReviewAuthor() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewDecider()
+ */
+ public String getWorldViewReviewDecider() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewModerator()
+ */
+ public String getWorldViewReviewModerator() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewReviewer()
+ */
+ public String getWorldViewReviewReviewer() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentState()
+ */
+ @Override
+ public double getWorldViewHoursSpentState() throws OseeCoreException {
+ double hours = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ hours += team.getWorldViewHoursSpentState();
+ }
+ }
+ return hours;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentStateReview()
+ */
+ @Override
+ public double getWorldViewHoursSpentStateReview() throws OseeCoreException {
+ double hours = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ hours += team.getWorldViewHoursSpentStateReview();
+ }
+ }
+ return hours;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentStateTask()
+ */
+ @Override
+ public double getWorldViewHoursSpentStateTask() throws OseeCoreException {
+ double hours = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ hours += team.getWorldViewHoursSpentStateTask();
+ }
+ }
+ return hours;
+ }
+
+ @Override
+ public double getWorldViewHoursSpentStateTotal() throws OseeCoreException {
+ double hours = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ hours += team.getWorldViewHoursSpentStateTotal();
+ }
+ }
+ return hours;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentTotal()
+ */
+ @Override
+ public double getWorldViewHoursSpentTotal() throws OseeCoreException {
+ double hours = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ hours += team.getWorldViewHoursSpentTotal();
+ }
+ }
+ return hours;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteState()
+ */
+ @Override
+ public int getWorldViewPercentCompleteState() throws OseeCoreException {
+ double percent = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ percent += team.getWorldViewPercentCompleteState();
+ }
+ }
+ if (percent == 0) return 0;
+ Double rollPercent = percent / getTeamWorkFlowArtifacts().size();
+ return rollPercent.intValue();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteStateReview()
+ */
+ @Override
+ public int getWorldViewPercentCompleteStateReview() throws OseeCoreException {
+ double percent = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ percent += team.getWorldViewPercentCompleteStateReview();
+ }
+ }
+ if (percent == 0) return 0;
+ Double rollPercent = percent / getTeamWorkFlowArtifacts().size();
+ return rollPercent.intValue();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteStateTask()
+ */
+ @Override
+ public int getWorldViewPercentCompleteStateTask() throws OseeCoreException {
+ double percent = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ percent += team.getWorldViewPercentCompleteStateTask();
+ }
+ }
+ if (percent == 0) return 0;
+ Double rollPercent = percent / getTeamWorkFlowArtifacts().size();
+ return rollPercent.intValue();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteTotal()
+ */
+ @Override
+ public int getWorldViewPercentCompleteTotal() throws OseeCoreException {
+ double percent = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getSmaMgr().isCancelled()) {
+ percent += team.getWorldViewPercentCompleteTotal();
+ }
+ }
+ if (percent == 0) return 0;
+ Double rollPercent = percent / getTeamWorkFlowArtifacts().size();
+ return rollPercent.intValue();
+ }
+
+ public String getWorldViewLastUpdated() throws OseeCoreException {
+ return XDate.getDateStr(getLastModified(), XDate.MMDDYYHHMM);
+ }
+
+ public String getWorldViewLastStatused() throws OseeCoreException {
+ return "(see children)";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewSWEnhancement()
+ */
+ @Override
+ public String getWorldViewSWEnhancement() {
+ Set<String> strs = new HashSet<String>();
+ try {
+ // Roll up version if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.getWorldViewPercentRework() > 0) strs.add(team.getWorldViewSWEnhancement());
+ }
+ return Collections.toString(",", strs);
+ } catch (OseeCoreException ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewTargetedVersion()
+ */
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ return null;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java
new file mode 100644
index 00000000000..aa97bfb33f3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.StaticIdQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemArtifact extends Artifact {
+
+ public static String ARTIFACT_NAME = "Actionable Item";
+ public static String TOP_AI_STATIC_ID = "osee.ats.TopActionableItem";
+ public static Set<ActionableItemArtifact> EMPTY_SET = new HashSet<ActionableItemArtifact>();
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public ActionableItemArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ public static List<ActionableItemArtifact> getActionableItems(Active active) throws OseeCoreException {
+ return AtsCache.getArtifactsByActive(active, ActionableItemArtifact.class);
+ }
+
+ public static String getNotActionableItemError(ActionableItemArtifact aia) {
+ return "Action can not be written against Actionable Item \"" + aia + "\" (" + aia.getHumanReadableId() + ").\n\nChoose another item.";
+ }
+
+ public static Set<ActionableItemArtifact> getTopLevelActionableItems(Active active) throws OseeCoreException {
+ ActionableItemArtifact topAi = getTopActionableItem();
+ if (topAi == null) return EMPTY_SET;
+ return AtsLib.getActiveSet(Artifacts.getChildrenOfTypeSet(topAi, ActionableItemArtifact.class, false), active,
+ ActionableItemArtifact.class);
+ }
+
+ public Collection<User> getLeads() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamLead_Lead, User.class);
+ }
+
+ public static ActionableItemArtifact getTopActionableItem() throws OseeCoreException {
+ return (ActionableItemArtifact) StaticIdQuery.getSingletonArtifactOrException(
+ ActionableItemArtifact.ARTIFACT_NAME, TOP_AI_STATIC_ID, AtsPlugin.getAtsBranch());
+ }
+
+ public static List<ActionableItemArtifact> getActionableItems() throws OseeCoreException {
+ return AtsCache.getArtifactsByActive(Active.Both, ActionableItemArtifact.class);
+ }
+
+ public boolean isActionable() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.ACTIONABLE_ATTRIBUTE.getStoreName(), false);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItems(Collection<String> actionableItemNames) throws OseeCoreException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (String actionableItemName : actionableItemNames) {
+ aias.addAll(AtsCache.getArtifactsByName(actionableItemName, ActionableItemArtifact.class));
+ }
+ return aias;
+ }
+
+ public static Collection<TeamDefinitionArtifact> getImpactedTeamDefs(Collection<ActionableItemArtifact> aias) throws OseeCoreException {
+ return TeamDefinitionArtifact.getImpactedTeamDefs(aias);
+ }
+
+ public Collection<TeamDefinitionArtifact> getImpactedTeamDefs() throws OseeCoreException {
+ return TeamDefinitionArtifact.getImpactedTeamDefs(Arrays.asList(this));
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamsFromItemAndChildren(ActionableItemArtifact aia) throws OseeCoreException {
+ return TeamDefinitionArtifact.getTeamsFromItemAndChildren(aia);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItemsFromItemAndChildren(ActionableItemArtifact aia) throws OseeCoreException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ getActionableItemsFromItemAndChildren(aia, aias);
+ return aias;
+ }
+
+ public static void getActionableItemsFromItemAndChildren(ActionableItemArtifact aia, Set<ActionableItemArtifact> aiaTeams) throws OseeCoreException {
+ for (Artifact art : aia.getChildren()) {
+ if (art instanceof ActionableItemArtifact) {
+ aiaTeams.add((ActionableItemArtifact) art);
+ for (Artifact childArt : aia.getChildren()) {
+ if (childArt instanceof ActionableItemArtifact) getActionableItemsFromItemAndChildren(
+ (ActionableItemArtifact) childArt, aiaTeams);
+ }
+ }
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java
new file mode 100644
index 00000000000..52fe1bd7232
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AtsArtifactFactory extends ArtifactFactory {
+ private static AtsArtifactFactory factory = null;
+
+ private AtsArtifactFactory(int factoryId) {
+ super(factoryId);
+ }
+
+ public static AtsArtifactFactory getInstance(int factoryId) {
+ if (factory == null) {
+ factory = new AtsArtifactFactory(factoryId);
+ }
+ return factory;
+ }
+
+ public static AtsArtifactFactory getInstance() {
+ return factory;
+ }
+
+ @Override
+ public Artifact getArtifactInstance(String guid, String humandReadableId, String factoryKey, Branch branch, ArtifactType artifactType) {
+ if (factoryKey.equals(ActionArtifact.ARTIFACT_NAME)) return new ActionArtifact(this, guid, humandReadableId,
+ branch, artifactType);
+ if (factoryKey.equals(TaskArtifact.ARTIFACT_NAME)) return new TaskArtifact(this, guid, humandReadableId, branch,
+ artifactType);
+ if (factoryKey.equals(TeamWorkFlowArtifact.ARTIFACT_NAME)) return new TeamWorkFlowArtifact(this, guid,
+ humandReadableId, branch, artifactType);
+ if (factoryKey.equals(TeamDefinitionArtifact.ARTIFACT_NAME)) return new TeamDefinitionArtifact(this, guid,
+ humandReadableId, branch, artifactType);
+ if (factoryKey.equals(VersionArtifact.ARTIFACT_NAME)) return new VersionArtifact(this, guid, humandReadableId,
+ branch, artifactType);
+ if (factoryKey.equals(ActionableItemArtifact.ARTIFACT_NAME)) return new ActionableItemArtifact(this, guid,
+ humandReadableId, branch, artifactType);
+ if (factoryKey.equals(DecisionReviewArtifact.ARTIFACT_NAME)) return new DecisionReviewArtifact(this, guid,
+ humandReadableId, branch, artifactType);
+ if (factoryKey.equals(PeerToPeerReviewArtifact.ARTIFACT_NAME)) return new PeerToPeerReviewArtifact(this, guid,
+ humandReadableId, branch, artifactType);
+ throw new IllegalArgumentException("did not recognize the factory key: " + factoryKey);
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java
new file mode 100644
index 00000000000..14281f6f081
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.XDecisionOptions;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DecisionReviewArtifact extends ReviewSMArtifact implements IReviewArtifact, IWorldViewArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "Decision Review";
+ public XDecisionOptions decisionOptions;
+ public static enum DecisionReviewState {
+ Prepare, Decision, Followup, Completed
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public DecisionReviewArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ decisionOptions = new XDecisionOptions(this);
+ }
+
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException {
+ Collection<TeamWorkFlowArtifact> teamArts =
+ getRelatedArtifacts(AtsRelation.TeamWorkflowToReview_Team, TeamWorkFlowArtifact.class);
+ if (teamArts.size() == 0) throw new OseeStateException(
+ "Decision Review " + getHumanReadableId() + " has no parent workflow");
+ if (teamArts.size() > 1) throw new OseeStateException(
+ "Decision Review " + getHumanReadableId() + " has multiple parent workflows");
+ return teamArts.iterator().next();
+ }
+
+ @Override
+ public String getHelpContext() {
+ return "decisionReview";
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ if (getParentTeamWorkflow() != null)
+ users.addAll(getParentTeamWorkflow().getPrivilegedUsers());
+ else {
+ if (AtsPlugin.isAtsAdmin()) {
+ users.add(UserManager.getUser());
+ }
+ }
+ return users;
+ }
+
+ @Override
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewTeam()
+ */
+ @Override
+ public String getWorldViewTeam() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws OseeCoreException {
+ return getParentTeamWorkflow();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDecision()
+ */
+ @Override
+ public String getWorldViewDecision() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DECISION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ @Override
+ public String getWorldViewDescription() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ @Override
+ public String getWorldViewCategory() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public String getWorldViewCategory2() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public String getWorldViewCategory3() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ if (getParentSMA() == null) return null;
+ return getParentSMA().getWorldViewTargetedVersion();
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma).getParentActionArtifact();
+ else
+ return null;
+ }
+
+ @Override
+ public Collection<User> getImplementers() throws OseeCoreException {
+ return getImplementersByState(DecisionReviewState.Decision.name());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ @Override
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ @Override
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ @Override
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWorkPackage()
+ */
+ @Override
+ public String getWorldViewWorkPackage() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.ats.IReviewArtifact#getArtifact()
+ */
+ public Artifact getArtifact() {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewAuthor()
+ */
+ @Override
+ public String getWorldViewReviewAuthor() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewDecider()
+ */
+ @Override
+ public String getWorldViewReviewDecider() throws OseeCoreException {
+ return Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees(DecisionReviewState.Decision.name()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewModerator()
+ */
+ @Override
+ public String getWorldViewReviewModerator() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewReviewer()
+ */
+ @Override
+ public String getWorldViewReviewReviewer() throws OseeCoreException {
+ return "";
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewWorkflowManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewWorkflowManager.java
new file mode 100644
index 00000000000..fb5cc56e76b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewWorkflowManager.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * Methods in support of programatically transitioning the Decision Review Workflow through it's states. Only to be used
+ * for the DefaultReviewWorkflow of Prepare->Decision->ReWork->Complete
+ *
+ * @author Donald G. Dunne
+ */
+public class DecisionReviewWorkflowManager {
+
+ /**
+ * Quickly transition to a state with minimal metrics and data entered. Should only be used for automated
+ * transitioning for things such as developmental testing and demos.
+ *
+ * @param toState
+ * @param user User to transition to OR null if should use user of current state
+ * @param popup
+ * @return Result
+ * @throws Exception
+ */
+ public static Result transitionTo(DecisionReviewArtifact reviewArt, DecisionReviewArtifact.DecisionReviewState toState, User user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
+ Result result = Result.TrueResult;
+ // If in Prepare state, set data and transition to Decision
+ if (reviewArt.getSmaMgr().getStateMgr().getCurrentStateName().equals(
+ DecisionReviewArtifact.DecisionReviewState.Prepare.name())) {
+ result = setPrepareStateData(reviewArt, 100, 3, .2);
+
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ result =
+ reviewArt.getSmaMgr().transition(DecisionReviewArtifact.DecisionReviewState.Decision.name(),
+ (user != null ? user : reviewArt.getSmaMgr().getStateMgr().getAssignees().iterator().next()),
+ false, transaction);
+ }
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ if (toState == DecisionReviewArtifact.DecisionReviewState.Decision) return Result.TrueResult;
+
+ // If desired to transition to follow-up, then decision is false
+ boolean decision = (toState != DecisionReviewArtifact.DecisionReviewState.Followup);
+
+ result = setDecisionStateData(reviewArt, decision, 100, .2);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+
+ result =
+ reviewArt.getSmaMgr().transition(toState.name(),
+ (user != null ? user : reviewArt.getSmaMgr().getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ return Result.TrueResult;
+ }
+
+ public static Result setPrepareStateData(DecisionReviewArtifact reviewArt, int statePercentComplete, double estimateHours, double stateHoursSpent) throws OseeCoreException {
+ if (!reviewArt.getSmaMgr().getStateMgr().getCurrentStateName().equals(
+ DecisionReviewArtifact.DecisionReviewState.Prepare.name())) return new Result("Action not in Prepare state");
+ reviewArt.setSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), estimateHours);
+ reviewArt.getSmaMgr().getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+ public static Result setDecisionStateData(DecisionReviewArtifact reviewArt, boolean decision, int statePercentComplete, double stateHoursSpent) throws OseeCoreException {
+ if (!reviewArt.getSmaMgr().getStateMgr().getCurrentStateName().equals(
+ DecisionReviewArtifact.DecisionReviewState.Decision.name())) return new Result(
+ "Action not in Decision state");
+ reviewArt.setSoleAttributeValue(ATSAttributes.DECISION_ATTRIBUTE.getStoreName(), decision ? "Yes" : "No");
+ reviewArt.getSmaMgr().getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java
new file mode 100644
index 00000000000..39eb8d05869
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IFavoriteableArtifact {
+
+ public void addFavorite(User u) throws OseeCoreException;
+
+ public void removeFavorite(User u) throws OseeCoreException;
+
+ public boolean isFavorite(User u) throws OseeCoreException;
+
+ public ArrayList<User> getFavorites() throws OseeCoreException;
+
+ public boolean amIFavorite();
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java
new file mode 100644
index 00000000000..bb3aea3295d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import org.eclipse.osee.ats.util.widgets.defect.DefectManager;
+import org.eclipse.osee.ats.util.widgets.role.UserRoleManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IReviewArtifact {
+
+ public boolean isBlocking() throws OseeCoreException;
+
+ public DefectManager getDefectManager();
+
+ public UserRoleManager getUserRoleManager();
+
+ public Artifact getArtifact();
+
+ public Result isUserRoleValid() throws OseeCoreException;
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java
new file mode 100644
index 00000000000..3fcdaa20448
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface ISubscribableArtifact {
+
+ public void addSubscribed(User u) throws OseeCoreException;
+
+ public void removeSubscribed(User u) throws OseeCoreException;
+
+ public boolean isSubscribed(User u) throws OseeCoreException;
+
+ public ArrayList<User> getSubscribed() throws OseeCoreException;
+
+ public boolean amISubscribed();
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java
new file mode 100644
index 00000000000..37a26393e50
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LogItem {
+
+ private Date date;
+ private String msg;
+ private String state;
+ private User user;
+ private LogType type = LogType.None;
+ private String userId;
+
+ /**
+ * @return the userId
+ */
+ public String getUserId() {
+ return userId;
+ }
+
+ public LogItem() {
+ }
+
+ public LogItem(LogType type, Date date, User user, String state, String msg) throws OseeCoreException {
+ this(type.name(), date.getTime() + "", user.getUserId(), state, msg);
+ }
+
+ public LogItem(LogType type, String date, String userId, String state, String msg) throws OseeCoreException {
+ Long l = new Long(date);
+ this.date = new Date(l.longValue());
+ this.msg = msg;
+ this.state = state;
+ this.userId = userId;
+ this.user = UserManager.getUserByUserId(userId);
+ this.type = type;
+ }
+
+ public LogItem(String type, String date, String userId, String state, String msg) throws OseeCoreException {
+ this(LogType.getType(type), date, userId, state, msg);
+ }
+
+ public String toXml() throws OseeCoreException {
+ return "<type>" + type.name() + "</type><date>" + date.getTime() + "</date><user>" + user.getUserId() + "</user><state>" + (state != null ? state : "") + "</state><msg>" + (msg != null ? msg : "") + "</msg>";
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public String getDate(String pattern) {
+ if (pattern != null) return (new SimpleDateFormat(pattern)).format(date);
+ return date.toString();
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ @Override
+ public String toString() {
+ try {
+ return (msg.equals("") ? "" : msg) + " (" + type + ") " + (state.equals("") ? "" : "from " + state + " ") + "by " + user.getUserId() + " on " + getDate(XDate.MMDDYYHHMM) + "\n";
+ } catch (Exception ex) {
+ return (msg.equals("") ? "" : msg) + " (" + type + ") " + (state.equals("") ? "" : "from " + state + " ");
+ }
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public LogType getType() {
+ return type;
+ }
+
+ public void setType(LogType type) {
+ this.type = type;
+ }
+
+ public String toHTML(String labelFont) {
+ return "NOTE (" + type + "): " + msg + " (" + user.getName() + ")";
+ }
+
+ /**
+ * @param user The user to set.
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ /**
+ * @return Returns the state.
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ * @param state The state to set.
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java
new file mode 100644
index 00000000000..80a49ab1cf1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.ats.NoteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+public class NoteItem {
+
+ private Date date;
+ private String state;
+ private String msg;
+ private User user;
+ private NoteType type = NoteType.Other;
+
+ public NoteItem() {
+ }
+
+ public NoteItem(NoteType type, String state, String date, User user, String msg) {
+ Long l = new Long(date);
+ this.date = new Date(l.longValue());
+ this.state = state;
+ this.msg = msg;
+ this.user = user;
+ this.type = type;
+ }
+
+ public NoteItem(String type, String state, String date, User user, String msg) {
+ this(NoteType.getType(type), state, date, user, msg);
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public String getDate(String pattern) {
+ if (pattern != null) return (new SimpleDateFormat(pattern)).format(date);
+ return date.toString();
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String getMsg() {
+ return msg;
+ }
+
+ public void setMsg(String msg) {
+ this.msg = msg;
+ }
+
+ public String toString() {
+ return msg + " (" + type + ") by " + user + " on " + getDate(XDate.MMDDYYHHMM) + "\n";
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public NoteType getType() {
+ return type;
+ }
+
+ public void setType(NoteType type) {
+ this.type = type;
+ }
+
+ public String toHTML() {
+ return "Note: \"" + type + "\" from \"" + user.getName() + "\"" + (state.equals("") ? "" : " for \"" + state + "\" state") + " on " + getDate(XDate.MMDDYYHHMM) + " - " + msg;
+ }
+
+ public String getState() {
+ return state;
+ }
+
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ * @param user the user to set
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java
new file mode 100644
index 00000000000..9d80be2802a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.defect.DefectManager;
+import org.eclipse.osee.ats.util.widgets.role.UserRole;
+import org.eclipse.osee.ats.util.widgets.role.UserRole.Role;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class PeerToPeerReviewArtifact extends ReviewSMArtifact implements IReviewArtifact, IWorldViewArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "PeerToPeer Review";
+ public static enum PeerToPeerReviewState {
+ Prepare, Review, Completed
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public PeerToPeerReviewArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ defectManager = new DefectManager(this);
+ }
+
+ public static String getDefaultReviewTitle(SMAManager smaMgr) {
+ return "Review \"" + smaMgr.getSma().getArtifactTypeName() + "\" titled \"" + smaMgr.getSma().getDescriptiveName() + "\"";
+ }
+
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException {
+ List<TeamWorkFlowArtifact> teams =
+ getRelatedArtifacts(AtsRelation.TeamWorkflowToReview_Team, TeamWorkFlowArtifact.class);
+ if (teams.size() > 0) {
+ return teams.iterator().next();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.ReviewSMArtifact#isUserRoleValid()
+ */
+ @Override
+ public Result isUserRoleValid() throws OseeCoreException {
+ if (getUserRoleManager().getUserRoles(Role.Author).size() <= 0) return new Result("Must have at least one Author");
+ if (getUserRoleManager().getUserRoles(Role.Reviewer).size() <= 0) return new Result(
+ "Must have at least one Reviewer");
+ // If in review state, all roles must have hours spent entered
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(
+ PeerToPeerReviewArtifact.PeerToPeerReviewState.Review.name())) {
+ for (UserRole uRole : userRoleManager.getUserRoles()) {
+ if (uRole.getHoursSpent() == null) return new Result("Hours spent must be entered for each role.");
+ }
+ }
+ return super.isUserRoleValid();
+ }
+
+ @Override
+ public String getHelpContext() {
+ return "peerToPeerReview";
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ if (getParentTeamWorkflow() != null)
+ users.addAll(getParentTeamWorkflow().getPrivilegedUsers());
+ else {
+ if (AtsPlugin.isAtsAdmin()) {
+ users.add(UserManager.getUser());
+ }
+ }
+ return users;
+ }
+
+ @Override
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewTeam()
+ */
+ @Override
+ public String getWorldViewTeam() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws OseeCoreException {
+ return getParentTeamWorkflow();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ @Override
+ public String getWorldViewDescription() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ @Override
+ public String getWorldViewCategory() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public String getWorldViewCategory2() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public String getWorldViewCategory3() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ if (getParentSMA() == null) return null;
+ return getParentSMA().getWorldViewTargetedVersion();
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma).getParentActionArtifact();
+ else
+ return null;
+ }
+
+ @Override
+ public Collection<User> getImplementers() throws OseeCoreException {
+ Collection<User> users = getImplementersByState(PeerToPeerReviewState.Review.name());
+ for (UserRole role : userRoleManager.getUserRoles()) {
+ users.add(role.getUser());
+ }
+ return users;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ @Override
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ @Override
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ @Override
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWorkPackage()
+ */
+ @Override
+ public String getWorldViewWorkPackage() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.ats.IReviewArtifact#getArtifact()
+ */
+ public Artifact getArtifact() {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewAuthor()
+ */
+ @Override
+ public String getWorldViewReviewAuthor() throws OseeCoreException {
+ return Artifacts.toString("; ", getUserRoleManager().getRoleUsers(Role.Author));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewDecider()
+ */
+ @Override
+ public String getWorldViewReviewDecider() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewModerator()
+ */
+ @Override
+ public String getWorldViewReviewModerator() throws OseeCoreException {
+ return Artifacts.toString("; ", getUserRoleManager().getRoleUsers(Role.Moderator));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewReviewer()
+ */
+ @Override
+ public String getWorldViewReviewReviewer() throws OseeCoreException {
+ return Artifacts.toString("; ", getUserRoleManager().getRoleUsers(Role.Reviewer));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewWorkflowManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewWorkflowManager.java
new file mode 100644
index 00000000000..db989965390
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewWorkflowManager.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem;
+import org.eclipse.osee.ats.util.widgets.role.UserRole;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * Methods in support of programatically transitioning the Peer Review Workflow through it's states. Only to be used for
+ * the DefaultReviewWorkflow of Prepare->Review->Complete
+ *
+ * @author Donald G. Dunne
+ */
+public class PeerToPeerReviewWorkflowManager {
+
+ /**
+ * Quickly transition to a state with minimal metrics and data entered. Should only be used for automated transition
+ * for things such as developmental testing and demos.
+ *
+ * @param toState
+ * @param user User to transition to OR null if should use user of current state
+ * @param popup
+ * @param transaction
+ * @return Result
+ * @throws Exception
+ */
+ public static Result transitionTo(PeerToPeerReviewArtifact reviewArt, PeerToPeerReviewArtifact.PeerToPeerReviewState toState, Collection<UserRole> roles, Collection<DefectItem> defects, User user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
+ Result result = setPrepareStateData(reviewArt, roles, "DoThis.java", 100, .2, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ result =
+ reviewArt.getSmaMgr().transition(PeerToPeerReviewArtifact.PeerToPeerReviewState.Review.name(),
+ (user != null ? user : reviewArt.getSmaMgr().getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ if (toState == PeerToPeerReviewArtifact.PeerToPeerReviewState.Review) return Result.TrueResult;
+
+ result = setReviewStateData(reviewArt, roles, defects, 100, .2, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+
+ result =
+ reviewArt.getSmaMgr().transition(DefaultTeamState.Completed.name(),
+ (user != null ? user : reviewArt.getSmaMgr().getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ return Result.TrueResult;
+ }
+
+ public static Result setPrepareStateData(PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, String reviewMaterials, int statePercentComplete, double stateHoursSpent, SkynetTransaction transaction) throws OseeCoreException {
+ if (!reviewArt.getSmaMgr().getStateMgr().getCurrentStateName().equals("Prepare")) return new Result(
+ "Action not in Prepare state");
+ if (roles != null) for (UserRole role : roles)
+ reviewArt.getUserRoleManager().addOrUpdateUserRole(role, false, transaction);
+ reviewArt.setSoleAttributeValue(ATSAttributes.LOCATION_ATTRIBUTE.getStoreName(), reviewMaterials);
+ reviewArt.getSmaMgr().getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+ public static Result setReviewStateData(PeerToPeerReviewArtifact reviewArt, Collection<UserRole> roles, Collection<DefectItem> defects, int statePercentComplete, double stateHoursSpent, SkynetTransaction transaction) throws OseeCoreException {
+ if (roles != null) for (UserRole role : roles)
+ reviewArt.getUserRoleManager().addOrUpdateUserRole(role, false, transaction);
+ if (defects != null) for (DefectItem defect : defects)
+ reviewArt.getDefectManager().addOrUpdateDefectItem(defect, false, transaction);
+ reviewArt.getSmaMgr().getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java
new file mode 100644
index 00000000000..5beb39d0d23
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.util.widgets.XActionableItemsDam;
+import org.eclipse.osee.ats.util.widgets.defect.DefectManager;
+import org.eclipse.osee.ats.util.widgets.role.UserRoleManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class ReviewSMArtifact extends TaskableStateMachineArtifact {
+
+ protected DefectManager defectManager;
+ protected UserRoleManager userRoleManager;
+ private XActionableItemsDam actionableItemsDam;
+ public static enum ReviewBlockType {
+ None, Transition, Commit
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public ReviewSMArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ initializeSMA();
+ };
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#initialize()
+ */
+ @Override
+ protected void initializeSMA() {
+ super.initializeSMA();
+ defectManager = new DefectManager(this);
+ userRoleManager = new UserRoleManager(this);
+ actionableItemsDam = new XActionableItemsDam(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getArtifactSuperTypeName()
+ */
+ @Override
+ public String getArtifactSuperTypeName() {
+ return "Review";
+ }
+
+ public boolean isBlocking() throws OseeCoreException {
+ return getReviewBlockType() != ReviewBlockType.None;
+ }
+
+ public ReviewBlockType getReviewBlockType() throws OseeCoreException {
+ String typeStr = getSoleAttributeValue(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName(), null);
+ if (typeStr == null) {
+ // Check old attribute value
+ if (getSoleAttributeValue(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE.getStoreName(), false) == true) {
+ return ReviewBlockType.Transition;
+ }
+ return ReviewBlockType.None;
+ }
+ return ReviewBlockType.valueOf(typeStr);
+ }
+
+ public DefectManager getDefectManager() {
+ return defectManager;
+ }
+
+ public UserRoleManager getUserRoleManager() {
+ return userRoleManager;
+ }
+
+ public Result isUserRoleValid() throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ public Set<TeamDefinitionArtifact> getCorrespondingTeamDefinitionArtifact() throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ if (getParentTeamWorkflow() != null) teamDefs.add(getParentTeamWorkflow().getTeamDefinition());
+ if (actionableItemsDam.getActionableItems().size() > 0) {
+ teamDefs.addAll(ActionableItemArtifact.getImpactedTeamDefs(actionableItemsDam.getActionableItems()));
+ }
+ return teamDefs;
+ }
+
+ /**
+ * @return the actionableItemsDam
+ */
+ public XActionableItemsDam getActionableItemsDam() {
+ return actionableItemsDam;
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ if (getParentSMA() != null) {
+ return ((TeamWorkFlowArtifact) getParentSMA()).getParentActionArtifact();
+ }
+ return null;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java
new file mode 100644
index 00000000000..48e12291729
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java
@@ -0,0 +1,1339 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsNotifyUsers;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.ats.util.Overview.PreviewStyle;
+import org.eclipse.osee.ats.workflow.item.AtsStatePercentCompleteWeightRule;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.IRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.email.EmailGroup;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerCells;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class StateMachineArtifact extends ATSArtifact implements IWorldViewArtifact, ISubscribableArtifact, IFavoriteableArtifact {
+
+ protected SMAManager smaMgr;
+ private final Set<IRelationEnumeration> smaEditorRelations = new HashSet<IRelationEnumeration>();
+ private final Set<IRelationEnumeration> atsWorldRelations = new HashSet<IRelationEnumeration>();
+ private Collection<User> preSaveStateAssignees;
+ private User preSaveOriginator;
+ public static double MAN_DAY_HOURS = 8;
+ protected WorkFlowDefinition workFlowDefinition;
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public StateMachineArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ @Override
+ public void onBirth() throws OseeCoreException {
+ super.onBirth();
+ setSoleAttributeValue(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(), "");
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ initializeSMA();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.artifact.Artifact#reloadAttributesAndRelations()
+ */
+ @Override
+ public void reloadAttributesAndRelations() throws OseeCoreException {
+ super.reloadAttributesAndRelations();
+ initializeSMA();
+ }
+
+ protected void initializeSMA() {
+ smaMgr = new SMAManager(this);
+ initalizePreSaveCache();
+ }
+
+ public void initalizePreSaveCache() {
+ smaMgr = new SMAManager(this);
+ try {
+ preSaveStateAssignees = smaMgr.getStateMgr().getAssignees();
+ if (smaMgr.getOriginator() == null)
+ preSaveOriginator = UserManager.getUser();
+ else
+ preSaveOriginator = smaMgr.getOriginator();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /**
+ * This method will create an assignee relation for each current assignee. Assignees are related to user artifacts to
+ * speed up ATS searching. This does not persist the artifact.<br>
+ * <br>
+ * The "UnAssigned" user is no longer related due to the performance and event service issues with having a single
+ * user related to > 5000 items. Since these relations are only used for searching, no need to have them for
+ * "UnAssigned".
+ *
+ * @throws OseeCoreException
+ */
+ public void updateAssigneeRelations() throws OseeCoreException {
+ Collection<User> assignees = getSmaMgr().getStateMgr().getAssignees();
+ assignees.remove(UserManager.getUser(SystemUser.UnAssigned));
+ setRelations(CoreRelationEnumeration.Users_User, assignees);
+ }
+
+ public boolean hasAtsWorldChildren() throws OseeCoreException {
+ for (IRelationEnumeration iRelationEnumeration : atsWorldRelations) {
+ if (getRelatedArtifactsCount(iRelationEnumeration) > 0) return true;
+ }
+ return false;
+ }
+
+ public String getHelpContext() {
+ return "atsWorkflowEditorWorkflowTab";
+ }
+
+ public String getArtifactSuperTypeName() {
+ return getArtifactTypeName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ @Override
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ @Override
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ @Override
+ public String getWorldViewDescription() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ @Override
+ public String getWorldViewImplementer() throws OseeCoreException {
+ return Artifacts.toString("; ", getImplementers());
+ }
+
+ public Collection<User> getImplementersByState(String stateName) throws OseeCoreException {
+ Collection<User> users = smaMgr.getStateMgr().getAssignees(stateName);
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateComplete, stateName);
+ if (item != null) {
+ users.add(item.getUser());
+ }
+ return users;
+ }
+
+ public Collection<User> getImplementers() throws OseeCoreException {
+ return Collections.emptyList();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewTeam()
+ */
+ @Override
+ public String getWorldViewTeam() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewGroups()
+ */
+ @Override
+ public String getWorldViewGroups() throws OseeCoreException {
+ return Artifacts.toString("; ", getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__GROUP));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ @Override
+ public double getWorldViewWeeklyBenefit() throws OseeCoreException {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.artifact.Artifact#persistAttributes()
+ */
+ @Override
+ public void onAttributePersist() throws OseeCoreException {
+ // Since multiple ways exist to change the assignees, notification is performed on the persist
+ if (isDeleted()) {
+ return;
+ }
+ try {
+ notifyNewAssigneesAndReset();
+ notifyOriginatorAndReset();
+ updateAssigneeRelations();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /**
+ * Override to apply different algorithm to current section expansion.
+ *
+ * @param page
+ * @return true if section should be expanded
+ * @throws OseeCoreException
+ */
+ public boolean isCurrentSectionExpanded(String stateName) throws OseeCoreException {
+ return smaMgr.getStateMgr().getCurrentStateName().equals(stateName);
+ }
+
+ public void notifyNewAssigneesAndReset() throws OseeCoreException {
+ if (preSaveStateAssignees == null) {
+ preSaveStateAssignees = smaMgr.getStateMgr().getAssignees();
+ return;
+ }
+ Set<User> newAssignees = new HashSet<User>();
+ for (User user : smaMgr.getStateMgr().getAssignees()) {
+ if (!preSaveStateAssignees.contains(user)) {
+ newAssignees.add(user);
+ }
+ }
+ preSaveStateAssignees = smaMgr.getStateMgr().getAssignees();
+ if (newAssignees.size() == 0) return;
+ try {
+ // These will be processed upon save
+ AtsNotifyUsers.notify(this, newAssignees, AtsNotifyUsers.NotifyType.Assigned);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void notifyOriginatorAndReset() throws OseeCoreException {
+ if (preSaveOriginator != null && smaMgr.getOriginator() != null && !smaMgr.getOriginator().equals(
+ preSaveOriginator)) {
+ AtsNotifyUsers.notify(this, AtsNotifyUsers.NotifyType.Originator);
+ }
+ preSaveOriginator = smaMgr.getOriginator();
+ }
+
+ public boolean isValidationRequired() throws OseeCoreException {
+ return false;
+ }
+
+ public abstract Set<User> getPrivilegedUsers() throws OseeCoreException;
+
+ public String getDescription() {
+ return "";
+ }
+
+ public ArrayList<EmailGroup> getEmailableGroups() throws OseeCoreException {
+ ArrayList<EmailGroup> groupNames = new ArrayList<EmailGroup>();
+ ArrayList<String> emails = new ArrayList<String>();
+ emails.add(smaMgr.getOriginator().getEmail());
+ groupNames.add(new EmailGroup("Originator", emails));
+ if (smaMgr.getStateMgr().getAssignees().size() > 0) {
+ emails = new ArrayList<String>();
+ for (User u : smaMgr.getStateMgr().getAssignees())
+ emails.add(u.getEmail());
+ groupNames.add(new EmailGroup("Assignees", emails));
+ }
+ return groupNames;
+ }
+
+ public abstract StateMachineArtifact getParentSMA() throws OseeCoreException;
+
+ public abstract ActionArtifact getParentActionArtifact() throws OseeCoreException;
+
+ public abstract TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException;
+
+ public String getPreviewHtml() throws OseeCoreException {
+ return getPreviewHtml(PreviewStyle.NONE);
+ }
+
+ public String getPreviewHtml(PreviewStyle... styles) throws OseeCoreException {
+ Overview o = new Overview();
+ o.addHeader(this, styles);
+ o.addFooter(this, styles);
+ return o.getPage();
+ }
+
+ @Override
+ public Image getImage() {
+ boolean subscribed = false;
+ boolean favorite = false;
+ try {
+ subscribed = isSubscribed(UserManager.getUser());
+ favorite = isFavorite(UserManager.getUser());
+ } catch (OseeCoreException ex) {
+ // Do nothing
+ }
+ return super.getArtifactType().getImage(subscribed, favorite, getMainAnnotationType());
+ }
+
+ public boolean isUnCancellable() {
+ try {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ if (item == null) throw new IllegalArgumentException("No Cancelled Event");
+ for (WorkPageDefinition toWorkPageDefinition : smaMgr.getWorkFlowDefinition().getToPages(
+ smaMgr.getWorkPageDefinition()))
+ if (toWorkPageDefinition.getPageName().equals(item.getState())) return true;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return false;
+ }
+
+ public boolean isTaskable() throws OseeCoreException {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return false;
+ return true;
+ }
+
+ public boolean showTaskTab() throws OseeCoreException {
+ return isTaskable();
+ }
+
+ public String getEditorTitle() {
+ return getDescriptiveName();
+ }
+
+ public String getWorldViewActionableItems() throws OseeCoreException {
+ return "";
+ }
+
+ /**
+ * Registers relation as part of the SMAEditor isDirty/save tree
+ *
+ * @param side
+ */
+ public void registerSMAEditorRelation(AtsRelation side) {
+ smaEditorRelations.add(side);
+ }
+
+ /**
+ * Registers relation as part of the parent/child hierarchy in ATS World
+ *
+ * @param side
+ */
+ public void registerAtsWorldRelation(AtsRelation side) {
+ atsWorldRelations.add(side);
+ }
+
+ public Image getAssigneeImage() throws OseeCoreException {
+ if (isDeleted()) return null;
+ if (smaMgr.getStateMgr().getAssignees().size() > 0) {
+ if (smaMgr.isAssigneeMe())
+ return AtsPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return ArtifactTypeManager.getType("User").getImage();
+ }
+ return null;
+ }
+
+ /**
+ * @return WorkFlowDefinition
+ */
+ public WorkFlowDefinition getWorkFlowDefinition() throws OseeCoreException {
+ if (workFlowDefinition == null) {
+ try {
+ workFlowDefinition = WorkFlowDefinitionFactory.getWorkFlowDefinition(this);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return workFlowDefinition;
+ }
+
+ public void addSubscribed(User user) throws OseeCoreException {
+ if (!getRelatedArtifacts(AtsRelation.SubscribedUser_User).contains(user)) {
+ addRelation(AtsRelation.SubscribedUser_User, user);
+ persistRelations();
+ }
+
+ }
+
+ public void removeSubscribed(User user) throws OseeCoreException {
+ deleteRelation(AtsRelation.SubscribedUser_User, user);
+ persistRelations();
+ }
+
+ public boolean isSubscribed(User user) throws OseeCoreException {
+ return (getRelatedArtifacts(AtsRelation.SubscribedUser_User).contains(user));
+ }
+
+ public ArrayList<User> getSubscribed() throws OseeCoreException {
+ ArrayList<User> arts = new ArrayList<User>();
+ for (Artifact art : getRelatedArtifacts(AtsRelation.SubscribedUser_User))
+ arts.add((User) art);
+ return arts;
+ }
+
+ public void addFavorite(User user) throws OseeCoreException {
+ if (!getRelatedArtifacts(AtsRelation.FavoriteUser_User).contains(user)) addRelation(
+ AtsRelation.FavoriteUser_User, user);
+ persistRelations();
+ }
+
+ public void removeFavorite(User user) throws OseeCoreException {
+ deleteRelation(AtsRelation.FavoriteUser_User, user);
+ persistRelations();
+ }
+
+ public boolean isFavorite(User user) throws OseeCoreException {
+ return (getRelatedArtifacts(AtsRelation.FavoriteUser_User).contains(user));
+ }
+
+ public ArrayList<User> getFavorites() throws OseeCoreException {
+ ArrayList<User> arts = new ArrayList<User>();
+ for (Artifact art : getRelatedArtifacts(AtsRelation.FavoriteUser_User))
+ arts.add((User) art);
+ return arts;
+ }
+
+ public boolean amISubscribed() {
+ try {
+ return isSubscribed(UserManager.getUser());
+ } catch (OseeCoreException ex) {
+ return false;
+ }
+ }
+
+ public boolean amIFavorite() {
+ try {
+ return isFavorite(UserManager.getUser());
+ } catch (OseeCoreException ex) {
+ return false;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.ATSArtifact#atsDelete(java.util.Set, java.util.Map)
+ */
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ SMAEditor.close(this, true);
+ super.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewType() throws OseeCoreException {
+ return getArtifactTypeName();
+ }
+
+ public String getWorldViewTitle() throws OseeCoreException {
+ return getDescriptiveName();
+ }
+
+ public String getWorldViewState() throws OseeCoreException {
+ return smaMgr.getStateMgr().getCurrentStateName();
+ }
+
+ public String getWorldViewActivePoc() throws OseeCoreException {
+ if (smaMgr.isCancelledOrCompleted()) {
+ if (smaMgr.getSma().getImplementers().size() > 0) {
+ return "(" + Artifacts.toString("; ", smaMgr.getSma().getImplementers()) + ")";
+ }
+ return "";
+ }
+ return Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees());
+ }
+
+ public String getWorldViewCreatedDateStr() throws OseeCoreException {
+ if (getWorldViewCreatedDate() == null) return XViewerCells.getCellExceptionString("No creation date");
+ return new XDate(getWorldViewCreatedDate()).getMMDDYYHHMM();
+ }
+
+ public String getWorldViewCompletedDateStr() throws OseeCoreException {
+ if (smaMgr.isCompleted()) {
+ if (getWorldViewCompletedDate() == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Completed with no date => " + smaMgr.getSma().getHumanReadableId(),
+ true);
+ return XViewerCells.getCellExceptionString("Completed with no date.");
+ }
+ return new XDate(getWorldViewCompletedDate()).getMMDDYYHHMM();
+ }
+ return "";
+ }
+
+ public String getWorldViewCancelledDateStr() throws OseeCoreException {
+ if (smaMgr.isCancelled()) {
+ if (getWorldViewCancelledDate() == null) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE,
+ "Cancelled with no date => " + smaMgr.getSma().getHumanReadableId());
+ return XViewerCells.getCellExceptionString("Cancelled with no date.");
+ }
+ return new XDate(getWorldViewCancelledDate()).getMMDDYYHHMM();
+ }
+ return "";
+ }
+
+ public Date getWorldViewCreatedDate() throws OseeCoreException {
+ return smaMgr.getLog().getCreationDate();
+ }
+
+ public String getWorldViewOriginator() throws OseeCoreException {
+ return smaMgr.getOriginator().getName();
+ }
+
+ public String getWorldViewID() throws OseeCoreException {
+ return getHumanReadableId();
+ }
+
+ public String getWorldViewLegacyPCR() throws OseeCoreException {
+ if (isAttributeTypeValid(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName())) {
+ return getSoleAttributeValue(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), "");
+ }
+ return "";
+ }
+
+ public Date getWorldViewCompletedDate() throws OseeCoreException {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateEntered, DefaultTeamState.Completed.name());
+ if (item != null) return item.getDate();
+ return null;
+ }
+
+ public Date getWorldViewCancelledDate() throws OseeCoreException {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateEntered, DefaultTeamState.Cancelled.name());
+ if (item != null) return item.getDate();
+ return null;
+ }
+
+ public abstract VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException;
+
+ public ChangeType getWorldViewChangeType() throws OseeCoreException {
+ return ChangeType.None;
+ }
+
+ public String getWorldViewChangeTypeStr() throws OseeCoreException {
+ if (getWorldViewChangeType() == null || getWorldViewChangeType() == ChangeType.None)
+ return "";
+ else
+ return getWorldViewChangeType().name();
+ }
+
+ public double getEstimatedHoursFromArtifact() throws OseeCoreException {
+ if (isAttributeTypeValid(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName())) return getSoleAttributeValue(
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), 0.0);
+ return 0;
+ }
+
+ public double getEstimatedHoursFromTasks(String relatedToState) throws OseeCoreException {
+ return smaMgr.getTaskMgr().getEstimatedHours(relatedToState);
+ }
+
+ public double getEstimatedHoursFromTasks() throws OseeCoreException {
+ return smaMgr.getTaskMgr().getEstimatedHours();
+ }
+
+ public double getEstimatedHoursFromReviews() throws OseeCoreException {
+ return smaMgr.getReviewManager().getEstimatedHours();
+ }
+
+ public double getEstimatedHoursFromReviews(String relatedToState) throws OseeCoreException {
+ return smaMgr.getReviewManager().getEstimatedHours(relatedToState);
+ }
+
+ public double getEstimatedHoursTotal(String relatedToState) throws OseeCoreException {
+ return getEstimatedHoursFromArtifact() + getEstimatedHoursFromTasks(relatedToState) + getEstimatedHoursFromReviews(relatedToState);
+ }
+
+ public double getEstimatedHoursTotal() throws OseeCoreException {
+ return getEstimatedHoursFromArtifact() + getEstimatedHoursFromTasks() + getEstimatedHoursFromReviews();
+ }
+
+ public double getWorldViewEstimatedHours() throws OseeCoreException {
+ return getEstimatedHoursTotal();
+ }
+
+ public String getWorldViewUserCommunity() throws OseeCoreException {
+ return "";
+ }
+
+ public String getWorldViewPriority() throws OseeCoreException {
+ return "";
+ }
+
+ public String getWorldViewResolution() throws OseeCoreException {
+ return getAttributesToString(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+
+ public double getRemainHoursFromArtifact() throws OseeCoreException {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return 0;
+ double est = getWorldViewEstimatedHours();
+ if (est == 0) return getWorldViewEstimatedHours();
+ double remain = est - (est * (getPercentCompleteSMATotal() / 100.0));
+ return remain;
+ }
+
+ public double getRemainHoursTotal() throws OseeCoreException {
+ return getRemainHoursFromArtifact() + getRemainFromTasks() + getRemainFromReviews();
+ }
+
+ public double getRemainFromTasks() throws OseeCoreException {
+ return smaMgr.getTaskMgr().getRemainHours();
+ }
+
+ public double getRemainFromReviews() throws OseeCoreException {
+ return smaMgr.getReviewManager().getRemainHours();
+ }
+
+ public double getWorldViewRemainHours() throws OseeCoreException {
+ return getRemainHoursTotal();
+ }
+
+ public Result isWorldViewRemainHoursValid() throws OseeCoreException {
+ if (!isAttributeTypeValid(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName())) return Result.TrueResult;
+ try {
+ Double value = getSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), null);
+ if (value == null) return new Result("Estimated Hours not set.");
+ return Result.TrueResult;
+ } catch (Exception ex) {
+ return new Result(
+ ex.getClass().getName() + ": " + ex.getLocalizedMessage() + "\n\n" + Lib.exceptionToString(ex));
+ }
+ }
+
+ public Result isWorldViewManDaysNeededValid() throws OseeCoreException {
+ Result result = isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result;
+ if (getManDayHrsPreference() == 0) return new Result("Man Day Hours Preference is not set.");
+
+ return Result.TrueResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewManDaysNeeded()
+ */
+ public double getWorldViewManDaysNeeded() throws OseeCoreException {
+ double hrsRemain = getWorldViewRemainHours();
+ double manDaysNeeded = 0;
+ if (hrsRemain != 0) manDaysNeeded = hrsRemain / getManDayHrsPreference();
+ return manDaysNeeded;
+ }
+
+ public double getManDayHrsPreference() {
+ return MAN_DAY_HOURS;
+ }
+
+ public double getWorldViewAnnualCostAvoidance() throws OseeCoreException {
+ return 0;
+ }
+
+ public Result isWorldViewAnnualCostAvoidanceValid() throws OseeCoreException {
+ if (isAttributeTypeValid(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName())) return Result.TrueResult;
+ Result result = isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result;
+ String value = null;
+ try {
+ value = getSoleAttributeValue(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName(), "");
+ if (value == null || value.equals("")) return new Result("Weekly Benefit Hours not set.");
+ double val = new Float(value).doubleValue();
+ if (val == 0) return new Result("Weekly Benefit Hours not set.");
+ } catch (NumberFormatException ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ return new Result("Weekly Benefit value is invalid double \"" + value + "\"");
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ return new Result("Exception calculating cost avoidance. See log for details.");
+ }
+ return Result.TrueResult;
+ }
+
+ public String getWorldViewNotes() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public String getWorldViewWorkPackage() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.WORK_PACKAGE_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public String getWorldViewCategory() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public String getWorldViewCategory2() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY2_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public String getWorldViewCategory3() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY3_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public int getWorldViewStatePercentComplete() throws OseeCoreException {
+ return getPercentCompleteSMAStateTotal(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ public String getWorldViewNumberOfTasks() throws OseeCoreException {
+ int num = getSmaMgr().getTaskMgr().getTaskArtifacts().size();
+ if (num == 0) return "";
+ return String.valueOf(num);
+ }
+
+ public String getWorldViewRelatedToState() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public String getWorldViewTargetedVersionStr() throws OseeCoreException {
+ if (getWorldViewTargetedVersion() == null) {
+ return "";
+ }
+ return getWorldViewTargetedVersion().toString();
+ }
+
+ /**
+ * Return true if this artifact, it's ATS relations and any of the other side artifacts are dirty
+ *
+ * @return true if any object in SMA tree is dirty
+ */
+ public Result isSMAEditorDirty() {
+ return isRelationsAndArtifactsDirty(smaEditorRelations);
+ }
+
+ public void saveSMA(SkynetTransaction transaction) {
+ try {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ getSmaArtifactsOneLevel(this, artifacts);
+ for (Artifact artifact : artifacts)
+ artifact.persistAttributesAndRelations(transaction);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't save artifact " + getHumanReadableId(), ex, true);
+ }
+ }
+
+ public void revertSMA() {
+ try {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ getSmaArtifactsOneLevel(this, artifacts);
+ for (Artifact artifact : artifacts)
+ artifact.reloadAttributesAndRelations();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't revert artifact " + getHumanReadableId(), ex, true);
+ }
+ }
+
+ public static void getSmaArtifactsOneLevel(StateMachineArtifact smaArtifact, Set<Artifact> artifacts) throws OseeCoreException {
+ artifacts.add(smaArtifact);
+ for (IRelationEnumeration side : smaArtifact.getSmaEditorRelations()) {
+ for (Artifact artifact : smaArtifact.getRelatedArtifacts(side)) {
+ artifacts.add(artifact);
+ }
+ }
+ }
+
+ @Override
+ public Date getWorldViewEstimatedReleaseDate() throws OseeCoreException {
+ Date date = getSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ Date parentDate = null;
+ if (getParentSMA() != null) {
+ parentDate = getParentSMA().getWorldViewEstimatedReleaseDate();
+ }
+ if (date == null && parentDate != null) {
+ return parentDate;
+ }
+ return date;
+ }
+
+ @Override
+ public Date getWorldViewEstimatedCompletionDate() throws OseeCoreException {
+ Date date = getSoleAttributeValue(ATSAttributes.ESTIMATED_COMPLETION_DATE_ATTRIBUTE.getStoreName(), null);
+ Date parentDate = null;
+ if (getParentSMA() != null) {
+ parentDate = getParentSMA().getWorldViewEstimatedReleaseDate();
+ }
+ if (date == null && parentDate != null) {
+ return parentDate;
+ }
+ return date;
+ }
+
+ public String getWorldViewEstimatedReleaseDateStr() throws OseeCoreException {
+ if (getWorldViewEstimatedReleaseDate() == null) return "";
+ return new XDate(getWorldViewEstimatedReleaseDate()).getMMDDYYHHMM();
+ }
+
+ public String getWorldViewEstimatedCompletionDateStr() throws OseeCoreException {
+ if (getWorldViewEstimatedCompletionDate() == null) return "";
+ return new XDate(getWorldViewEstimatedCompletionDate()).getMMDDYYHHMM();
+ }
+
+ public abstract Date getWorldViewReleaseDate() throws OseeCoreException;
+
+ public String getWorldViewReleaseDateStr() throws OseeCoreException {
+ if (getWorldViewReleaseDate() == null) return "";
+ return new XDate(getWorldViewReleaseDate()).getMMDDYYHHMM();
+ }
+
+ public boolean isReleased() {
+ try {
+ return getWorldViewReleaseDate() != null;
+ } catch (Exception ex) {
+ return false;
+ }
+ }
+
+ /**
+ * Will be called when status for this SMA has been changed. SMA's can override this to perform tasks.
+ *
+ * @throws Exception TODO
+ */
+ public void statusChanged() throws OseeCoreException {
+ }
+
+ /**
+ * Called at the end of a transition just before transaction manager persist. SMAs can override to perform tasks due
+ * to transition.
+ *
+ * @throws Exception
+ */
+ public void transitioned(WorkPageDefinition fromPage, WorkPageDefinition toPage, Collection<User> toAssignees, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperName()
+ */
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperType()
+ */
+ public String getHyperType() {
+ try {
+ return getArtifactTypeName();
+ } catch (Exception ex) {
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperState()
+ */
+ public String getHyperState() {
+ try {
+ return smaMgr.getStateMgr().getCurrentStateName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssignee()
+ */
+ public String getHyperAssignee() {
+ try {
+ return Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperImage()
+ */
+ public Image getHyperImage() {
+ return getImage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssigneeImage()
+ */
+ public Image getHyperAssigneeImage() throws OseeCoreException {
+ return smaMgr.getAssigneeImage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperArtifact()
+ */
+ public Artifact getHyperArtifact() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDecision()
+ */
+ public String getWorldViewDecision() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact#getParentSMArt()
+ */
+ public Artifact getParentAtsArtifact() throws OseeCoreException {
+ return getParentSMA();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewValidationRequiredStr()
+ */
+ public String getWorldViewValidationRequiredStr() throws OseeCoreException {
+ if (isAttributeTypeValid(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName())) return String.valueOf(getSoleAttributeValue(
+ ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false));
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewDeadlineAlerting()
+ */
+ public Result isWorldViewDeadlineAlerting() throws OseeCoreException {
+ return Result.FalseResult;
+ }
+
+ public int getWorldViewPercentRework() throws OseeCoreException {
+ return 0;
+ }
+
+ public String getWorldViewPercentReworkStr() throws OseeCoreException {
+ int reWork = getWorldViewPercentRework();
+ if (reWork == 0) return "";
+ return String.valueOf(reWork);
+ }
+
+ public static Set<String> getAllSMATypeNames() {
+ Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ artTypeNames.add(TaskArtifact.ARTIFACT_NAME);
+ artTypeNames.add(DecisionReviewArtifact.ARTIFACT_NAME);
+ artTypeNames.add(PeerToPeerReviewArtifact.ARTIFACT_NAME);
+ return artTypeNames;
+ }
+
+ public static List<Artifact> getAllSMATypeArtifacts() throws OseeCoreException {
+ List<Artifact> result = new ArrayList<Artifact>();
+ for (String artType : getAllSMATypeNames()) {
+ result.addAll(ArtifactQuery.getArtifactsFromType(artType, AtsPlugin.getAtsBranch()));
+ }
+ return result;
+ }
+
+ public static List<Artifact> getAllTeamWorkflowArtifacts() throws OseeCoreException {
+ List<Artifact> result = new ArrayList<Artifact>();
+ for (String artType : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames()) {
+ result.addAll(ArtifactQuery.getArtifactsFromType(artType, AtsPlugin.getAtsBranch()));
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ public String getWorldViewBranchStatus() throws OseeCoreException {
+ return "";
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewAuthor()
+ */
+ public String getWorldViewReviewAuthor() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewDecider()
+ */
+ public String getWorldViewReviewDecider() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewModerator()
+ */
+ public String getWorldViewReviewModerator() throws OseeCoreException {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewReviewReviewer()
+ */
+ public String getWorldViewReviewReviewer() throws OseeCoreException {
+ return "";
+ }
+
+ /**
+ * Return hours spent working ONLY the SMA stateName (not children SMAs)
+ *
+ * @param stateName
+ * @return hours
+ */
+ public double getHoursSpentSMAState(String stateName) throws OseeCoreException {
+ return smaMgr.getStateMgr().getHoursSpent(stateName);
+ }
+
+ /**
+ * Return hours spent working ONLY on tasks related to stateName
+ *
+ * @param stateName
+ * @return hours
+ * @throws Exception
+ */
+ public double getHoursSpentSMAStateTasks(String stateName) throws OseeCoreException {
+ return smaMgr.getTaskMgr().getHoursSpent(stateName);
+ }
+
+ /**
+ * Return hours spent working ONLY on reviews related to stateName
+ *
+ * @param stateName
+ * @return hours
+ * @throws Exception
+ */
+ public double getHoursSpentSMAStateReviews(String stateName) throws OseeCoreException {
+ return smaMgr.getReviewManager().getHoursSpent(stateName);
+ }
+
+ /**
+ * Return hours spent working on all things (including children SMAs) related to stateName
+ *
+ * @param stateName
+ * @return hours
+ * @throws Exception
+ */
+ public double getHoursSpentSMAStateTotal(String stateName) throws OseeCoreException {
+ return getHoursSpentSMAState(stateName) + getHoursSpentSMAStateTasks(stateName) + getHoursSpentSMAStateReviews(stateName);
+ }
+
+ @Override
+ public double getWorldViewHoursSpentStateTotal() throws OseeCoreException {
+ return getHoursSpentSMAStateTotal(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /**
+ * Return hours spent working on all things (including children SMAs) for this SMA
+ *
+ * @return hours
+ * @throws Exception
+ */
+ public double getHoursSpentSMATotal() throws OseeCoreException {
+ double hours = 0.0;
+ for (String stateName : smaMgr.getStateMgr().getVisitedStateNames()) {
+ hours += getHoursSpentSMAStateTotal(stateName);
+ }
+ return hours;
+ }
+
+ /**
+ * Return Percent Complete working ONLY the SMA stateName (not children SMAs)
+ *
+ * @param stateName
+ * @return percent
+ */
+ public int getPercentCompleteSMAState(String stateName) throws OseeCoreException {
+ return smaMgr.getStateMgr().getPercentComplete(stateName);
+ }
+
+ /**
+ * Return Percent Complete ONLY on tasks related to stateName. Total Percent / # Tasks
+ *
+ * @param stateName
+ * @return percent
+ * @throws Exception
+ */
+ public int getPercentCompleteSMAStateTasks(String stateName) throws OseeCoreException {
+ return smaMgr.getTaskMgr().getPercentComplete(stateName);
+ }
+
+ /**
+ * Return Percent Complete ONLY on reviews related to stateName. Total Percent / # Reviews
+ *
+ * @param stateName
+ * @return percent
+ * @throws Exception
+ */
+ public int getPercentCompleteSMAStateReviews(String stateName) throws OseeCoreException {
+ return smaMgr.getReviewManager().getPercentComplete(stateName);
+ }
+
+ /**
+ * Return Percent Complete on all things (including children SMAs) related to stateName. Total Percent for state,
+ * tasks and reviews / 1 + # Tasks + # Reviews
+ *
+ * @param stateName
+ * @return percent
+ * @throws Exception
+ */
+ public int getPercentCompleteSMAStateTotal(String stateName) throws OseeCoreException {
+ return getStateMetricsData(stateName).getResultingPercent();
+ }
+
+ /**
+ * Return Percent Complete on all things (including children SMAs) for this SMA<br>
+ * <br>
+ * percent = all state's percents / number of states (minus completed/cancelled)
+ *
+ * @return percent
+ * @throws Exception
+ */
+ public int getPercentCompleteSMATotal() throws OseeCoreException {
+ Map<String, Double> stateToWeightMap = getStatePercentCompleteWeight();
+ if (stateToWeightMap.size() > 0) {
+ // Calculate total percent using configured weighting
+ int percent = 0;
+ for (String stateName : smaMgr.getWorkFlowDefinition().getPageNames()) {
+ if (!stateName.equals(DefaultTeamState.Completed.name()) && !stateName.equals(DefaultTeamState.Cancelled.name())) {
+ Double weight = stateToWeightMap.get(stateName);
+ if (weight == null) {
+ weight = 0.0;
+ }
+ percent += weight * getPercentCompleteSMAStateTotal(stateName);
+ }
+ }
+ return percent;
+ } else {
+ int percent = 0;
+ int numStates = 0;
+ for (String stateName : smaMgr.getWorkFlowDefinition().getPageNames()) {
+ if (!stateName.equals(DefaultTeamState.Completed.name()) && !stateName.equals(DefaultTeamState.Cancelled.name())) {
+ percent += getPercentCompleteSMAStateTotal(stateName);
+ numStates++;
+ }
+ }
+ if (numStates == 0) return 0;
+ return percent / numStates;
+ }
+ }
+
+ // Cache stateToWeight mapping
+ private Map<String, Double> stateToWeight = null;
+
+ public Map<String, Double> getStatePercentCompleteWeight() throws OseeCoreException {
+ if (stateToWeight == null) {
+ stateToWeight = new HashMap<String, Double>();
+ Collection<WorkRuleDefinition> workRuleDefs =
+ smaMgr.getWorkRulesStartsWith(AtsStatePercentCompleteWeightRule.ID);
+ // Log error if multiple of same rule found, but keep going
+ if (workRuleDefs.size() > 1) {
+ OseeLog.log(
+ AtsPlugin.class,
+ Level.SEVERE,
+ "Team Definition has multiple rules of type " + AtsStatePercentCompleteWeightRule.ID + ". Only 1 allowed. Defaulting to first found.");
+ }
+ if (workRuleDefs.size() == 1) {
+ stateToWeight = AtsStatePercentCompleteWeightRule.getStateWeightMap(workRuleDefs.iterator().next());
+ }
+ }
+ return stateToWeight;
+ }
+
+ private StateMetricsData getStateMetricsData(String stateName) throws OseeCoreException {
+ // Add percent and bump objects 1 for state percent
+ int percent = getPercentCompleteSMAState(stateName);
+ int numObjects = 1; // the state itself is one object
+
+ // Add percent for each task and bump objects for each task
+ Collection<TaskArtifact> tasks = smaMgr.getTaskMgr().getTaskArtifacts(stateName);
+ for (TaskArtifact taskArt : tasks)
+ percent += taskArt.getPercentCompleteSMATotal();
+ numObjects += tasks.size();
+
+ // Add percent for each review and bump objects for each review
+ Collection<ReviewSMArtifact> reviews = smaMgr.getReviewManager().getReviews(stateName);
+ for (ReviewSMArtifact reviewArt : reviews)
+ percent += reviewArt.getPercentCompleteSMATotal();
+ numObjects += reviews.size();
+
+ return new StateMetricsData(percent, numObjects);
+ }
+
+ private class StateMetricsData {
+ public int numObjects = 0;
+ public int percent = 0;
+
+ public StateMetricsData(int percent, int numObjects) {
+ this.numObjects = numObjects;
+ this.percent = percent;
+ }
+
+ public int getResultingPercent() {
+ return percent / numObjects;
+ }
+
+ @Override
+ public String toString() {
+ return "Percent: " + getResultingPercent() + " NumObjs: " + numObjects + " Total Percent: " + percent;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentState()
+ */
+ @Override
+ public double getWorldViewHoursSpentState() throws OseeCoreException {
+ return getHoursSpentSMAState(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentStateReview()
+ */
+ @Override
+ public double getWorldViewHoursSpentStateReview() throws OseeCoreException {
+ return getHoursSpentSMAStateReviews(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentStateTask()
+ */
+ @Override
+ public double getWorldViewHoursSpentStateTask() throws OseeCoreException {
+ return getHoursSpentSMAStateTasks(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewHoursSpentTotal()
+ */
+ @Override
+ public double getWorldViewHoursSpentTotal() throws OseeCoreException {
+ return getHoursSpentSMATotal();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteState()
+ */
+ @Override
+ public int getWorldViewPercentCompleteState() throws OseeCoreException {
+ return getPercentCompleteSMAState(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteStateReview()
+ */
+ @Override
+ public int getWorldViewPercentCompleteStateReview() throws OseeCoreException {
+ return getPercentCompleteSMAStateReviews(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteStateTask()
+ */
+ @Override
+ public int getWorldViewPercentCompleteStateTask() throws OseeCoreException {
+ return getPercentCompleteSMAStateTasks(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentCompleteTotal()
+ */
+ @Override
+ public int getWorldViewPercentCompleteTotal() throws OseeCoreException {
+ return getPercentCompleteSMATotal();
+ }
+
+ /**
+ * @return the smaRelations
+ */
+ public Set<IRelationEnumeration> getSmaEditorRelations() {
+ return smaEditorRelations;
+ }
+
+ public Set<IRelationEnumeration> getAtsWorldRelations() {
+ return atsWorldRelations;
+ }
+
+ public String getWorldViewLastUpdated() throws OseeCoreException {
+ return XDate.getDateStr(getLastModified(), XDate.MMDDYYHHMM);
+ }
+
+ public String getWorldViewLastStatused() throws OseeCoreException {
+ return XDate.getDateStr(smaMgr.getLog().getLastStatusedDate(), XDate.MMDDYYHHMM);
+ }
+
+ public String getWorldViewSWEnhancement() throws OseeCoreException {
+ return "";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
new file mode 100644
index 00000000000..30335a7fca4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResolutionOptionRule;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskArtifact extends StateMachineArtifact implements IWorldViewArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "Task";
+
+ public static enum TaskStates {
+ InWork, Completed, Cancelled
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws
+ */
+ public TaskArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#onInitializationComplete()
+ */
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ }
+
+ /**
+ * Allow parent SMA's assignees and all privileged users up Team tree
+ *
+ * @throws OseeCoreException
+ */
+ @Override
+ public Set<User> getPrivilegedUsers() throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ StateMachineArtifact parentSma = getParentSMA();
+ if (parentSma instanceof TeamWorkFlowArtifact) users.addAll(((TeamWorkFlowArtifact) parentSma).getPrivilegedUsers());
+ users.addAll(parentSma.getSmaMgr().getStateMgr().getAssignees());
+ return users;
+ }
+
+ /**
+ * Can only un-cancel task when it's related to an active state
+ */
+ @Override
+ public boolean isUnCancellable() {
+ try {
+ StateMachineArtifact parentSMA = getParentSMA();
+ boolean unCancellable =
+ (parentSMA.getSmaMgr().getStateMgr().getCurrentStateName().equals(getSoleAttributeValue(
+ ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), "")));
+ if (!unCancellable) return false;
+ return super.isUnCancellable();
+ } catch (Exception ex) {
+ // Do Nothing
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isTaskable()
+ */
+ @Override
+ public boolean isTaskable() {
+ return false;
+ }
+
+ public boolean isUsingTaskResolutionOptions() throws OseeCoreException {
+ return (getTaskResolutionOptionDefintions().size() > 0);
+ }
+
+ public List<TaskResOptionDefinition> getTaskResolutionOptionDefintions() throws OseeCoreException {
+ TeamWorkFlowArtifact team = getParentTeamWorkflow();
+ if (team == null) return TaskResolutionOptionRule.EMPTY_TASK_RESOLUTION_OPTIONS;
+ return TaskResolutionOptionRule.getTaskResolutionOptions(team.getSmaMgr().getWorkPageDefinition());
+ }
+
+ public TaskResOptionDefinition getTaskResolutionOptionDefinition(String optionName) throws OseeCoreException {
+ for (TaskResOptionDefinition def : getTaskResolutionOptionDefintions()) {
+ if (def.getName().equals(optionName)) return def;
+ }
+ return null;
+ }
+
+ @Override
+ public String getDescription() {
+ try {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ } catch (Exception ex) {
+ return "Error: " + ex.getLocalizedMessage();
+ }
+ }
+
+ @Override
+ public String getWorldViewRelatedToState() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), "");
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ super.atsDelete(deleteArts, allRelated);
+ }
+
+ @Override
+ public String getWorldViewTeam() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public StateMachineArtifact getParentSMA() throws OseeCoreException {
+ Collection<StateMachineArtifact> smas =
+ getRelatedArtifacts(AtsRelation.SmaToTask_Sma, StateMachineArtifact.class);
+ if (smas.size() > 0) return smas.iterator().next();
+ return null;
+ }
+
+ public Boolean isCancelled() throws OseeCoreException {
+ return smaMgr.isCancelled();
+ }
+
+ public Boolean isInWork() throws OseeCoreException {
+ return (smaMgr.getStateMgr().getCurrentStateName().equals(TaskStates.InWork.name()));
+ }
+
+ public Boolean isCompleted() throws OseeCoreException {
+ return smaMgr.isCompleted();
+ }
+
+ public void transitionToCancelled(String reason, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(DefaultTeamState.Cancelled.name())) return;
+ setSoleAttributeValue(ATSAttributes.CANCEL_REASON_ATTRIBUTE.getStoreName(), reason);
+ Result result = smaMgr.transition(DefaultTeamState.Cancelled.name(), (User) null, persist, transaction);
+ if (result.isFalse()) result.popup();
+ }
+
+ public void transitionToCompleted(boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(DefaultTeamState.Completed.name())) return;
+ // Assign current user if unassigned
+ try {
+ if (smaMgr.getStateMgr().getAssignees().size() == 1 && smaMgr.getStateMgr().getAssignees().contains(
+ UserManager.getUser(SystemUser.UnAssigned))) {
+ smaMgr.getStateMgr().setAssignee(UserManager.getUser());
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ Result result = smaMgr.transition(DefaultTeamState.Completed.name(), (User) null, persist, transaction);
+ if (result.isFalse()) result.popup();
+ }
+
+ public void transitionToInWork(User toUser, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(TaskStates.InWork.name())) return;
+ Result result = smaMgr.transition(TaskStates.InWork.name(), toUser, false, transaction);
+ if (smaMgr.getStateMgr().getPercentComplete() == 100) {
+ smaMgr.getStateMgr().updateMetrics(0, 99, true);
+ }
+ if (persist) smaMgr.getSma().saveSMA(transaction);
+ if (result.isFalse()) result.popup();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#statusChanged()
+ */
+ @Override
+ public void statusChanged() throws OseeCoreException {
+ super.statusChanged();
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ if (smaMgr.getStateMgr().getPercentComplete() == 100 && !isCompleted())
+ transitionToCompleted(false, transaction);
+ else if (smaMgr.getStateMgr().getPercentComplete() != 100 && isCompleted()) {
+ transitionToInWork(UserManager.getUser(), true, transaction);
+ }
+ transaction.execute();
+ }
+
+ public void parentWorkFlowTransitioned(WorkPageDefinition fromWorkPageDefinition, WorkPageDefinition toWorkPageDefinition, Collection<User> toAssignees, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ if (toWorkPageDefinition.getPageName().equals(DefaultTeamState.Cancelled.name()) && isInWork())
+ transitionToCancelled("Parent Cancelled", persist, transaction);
+ else if (fromWorkPageDefinition.getPageName().equals(DefaultTeamState.Cancelled.name()) && isCancelled()) transitionToInWork(
+ UserManager.getUser(), persist, transaction);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ @Override
+ public String getWorldViewDescription() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ @Override
+ public String getWorldViewNumberOfTasks() throws OseeCoreException {
+ return "";
+ }
+
+ @Override
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ if (getParentSMA() instanceof TeamWorkFlowArtifact) return ((TeamWorkFlowArtifact) getParentSMA()).getWorldViewReleaseDate();
+ return getSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ return getParentSMA().getWorldViewTargetedVersion();
+ }
+
+ @Override
+ public double getWorldViewRemainHours() throws OseeCoreException {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return 0;
+ double est = getWorldViewEstimatedHours();
+ if (getWorldViewStatePercentComplete() == 0) return getWorldViewEstimatedHours();
+ double percent = smaMgr.getStateMgr().getPercentComplete(TaskStates.InWork.name());
+ if (percent == 0) return getWorldViewEstimatedHours();
+ double remain = getWorldViewEstimatedHours() - (est * (percent / 100.0));
+ return remain;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentActionArtifact()
+ */
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma).getParentActionArtifact();
+ else
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentTeamWorkflow()
+ */
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma);
+ else
+ return null;
+ }
+
+ @Override
+ public Collection<User> getImplementers() throws OseeCoreException {
+ return getImplementersByState(TaskStates.InWork.name());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ @Override
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ @Override
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ @Override
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isWorldViewAnnualCostAvoidanceValid()
+ */
+ @Override
+ public Result isWorldViewAnnualCostAvoidanceValid() throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewLegacyPCR()
+ */
+ @Override
+ public String getWorldViewLegacyPCR() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma != null) return sma.getWorldViewLegacyPCR();
+ return "";
+ }
+
+ @Override
+ public String getWorldViewSWEnhancement() throws OseeCoreException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma != null) return sma.getWorldViewSWEnhancement();
+ return "";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskableStateMachineArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskableStateMachineArtifact.java
new file mode 100644
index 00000000000..4262cc63a25
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskableStateMachineArtifact.java
@@ -0,0 +1,90 @@
+/*
+ * Created on Jun 11, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.artifact;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class TaskableStateMachineArtifact extends StateMachineArtifact {
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @param artifactType
+ */
+ public TaskableStateMachineArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ registerSMAEditorRelation(AtsRelation.SmaToTask_Task);
+ registerAtsWorldRelation(AtsRelation.SmaToTask_Task);
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public StateMachineArtifact getParentSMA() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ return null;
+ }
+
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ TeamWorkFlowArtifact teamArt = getParentTeamWorkflow();
+ if (teamArt == null) return null;
+ return teamArt.getWorldViewTargetedVersion();
+ }
+
+ @Override
+ public boolean showTaskTab() throws OseeCoreException {
+ return (isTaskable() || smaMgr.isCompleted());
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ super.atsDelete(deleteArts, allRelated);
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts())
+ taskArt.atsDelete(deleteArts, allRelated);
+ }
+
+ @Override
+ public void transitioned(WorkPageDefinition fromPage, WorkPageDefinition toPage, Collection<User> toAssignees, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ super.transitioned(fromPage, toPage, toAssignees, persist, transaction);
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts())
+ taskArt.parentWorkFlowTransitioned(fromPage, toPage, toAssignees, persist, transaction);
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java
new file mode 100644
index 00000000000..a9047d77ad9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java
@@ -0,0 +1,424 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.db.connection.exception.BranchDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BasicArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.StaticIdQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionArtifact extends BasicArtifact {
+
+ public static String ARTIFACT_NAME = "Team Definition";
+ public static String TOP_TEAM_STATIC_ID = "osee.ats.TopTeamDefinition";
+ public static Set<TeamDefinitionArtifact> EMPTY_SET = new HashSet<TeamDefinitionArtifact>();
+ public static enum TeamDefinitionOptions {
+ TeamUsesVersions, RequireTargetedVersion
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public TeamDefinitionArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ }
+
+ public void initialize(String fullname, String description, Collection<User> leads, Collection<User> members, Collection<ActionableItemArtifact> actionableItems, TeamDefinitionOptions... teamDefinitionOptions) throws OseeCoreException {
+ List<Object> teamDefOptions = Collections.getAggregate((Object[]) teamDefinitionOptions);
+
+ setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), description);
+ setSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName(), fullname);
+ for (User user : leads) {
+ addRelation(AtsRelation.TeamLead_Lead, user);
+ // All leads are members
+ addRelation(AtsRelation.TeamMember_Member, user);
+ }
+ for (User user : members) {
+ addRelation(AtsRelation.TeamMember_Member, user);
+ }
+
+ if (teamDefOptions.contains(TeamDefinitionOptions.TeamUsesVersions)) {
+ setSoleAttributeValue(ATSAttributes.TEAM_USES_VERSIONS_ATTRIBUTE.getStoreName(), true);
+ }
+ if (teamDefOptions.contains(TeamDefinitionOptions.RequireTargetedVersion)) {
+ addWorkRule(RuleWorkItemId.atsRequireTargetedVersion.name());
+ }
+
+ // Relate to actionable items
+ for (ActionableItemArtifact aia : actionableItems) {
+ addRelation(AtsRelation.TeamActionableItem_ActionableItem, aia);
+ }
+ AtsCache.cache(this);
+ }
+
+ /**
+ * This method will walk up the TeamDefinition tree until a def is found that configured with versions. This allows
+ * multiple TeamDefinitions to be versioned/released together by having the parent hold the versions. It is not
+ * required that a product configured in ATS uses the versions option. If no parent with versions is found, null is
+ * returned. If boolean "Team Uses Versions" is false, just return cause this team doesn't use versions
+ *
+ * @return parent TeamDefinition that holds the version definitions
+ */
+ public TeamDefinitionArtifact getTeamDefinitionHoldingVersions() throws OseeCoreException {
+ if (!isTeamUsesVersions()) return null;
+ if (getVersionsArtifacts().size() > 0) return this;
+ if (getParent() instanceof TeamDefinitionArtifact) {
+ TeamDefinitionArtifact parentTda = (TeamDefinitionArtifact) getParent();
+ if (parentTda != null) return parentTda.getTeamDefinitionHoldingVersions();
+ }
+ return null;
+ }
+
+ /**
+ * This method will walk up the TeamDefinition tree until a def is found that configured with work flow.
+ *
+ * @return parent TeamDefinition that holds the work flow id attribute
+ */
+ public TeamDefinitionArtifact getTeamDefinitionHoldingWorkFlow() throws OseeCoreException {
+ for (Artifact artifact : getRelatedArtifacts(AtsRelation.WorkItem__Child, Artifact.class)) {
+ if (artifact.getArtifactTypeName().equals(WorkFlowDefinition.ARTIFACT_NAME)) {
+ return this;
+ }
+ }
+ if (getParent() instanceof TeamDefinitionArtifact) {
+ TeamDefinitionArtifact parentTda = (TeamDefinitionArtifact) getParent();
+ if (parentTda != null) return parentTda.getTeamDefinitionHoldingWorkFlow();
+ }
+ return null;
+ }
+
+ public VersionArtifact getNextReleaseVersion() throws OseeCoreException {
+ for (VersionArtifact verArt : getRelatedArtifacts(AtsRelation.TeamDefinitionToVersion_Version,
+ VersionArtifact.class)) {
+ if (verArt.getSoleAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName(), false)) {
+ return verArt;
+ }
+ }
+ return null;
+ }
+
+ public Collection<VersionArtifact> getVersionsFromTeamDefHoldingVersions(VersionReleaseType releaseType) throws OseeCoreException {
+ TeamDefinitionArtifact teamDef = getTeamDefinitionHoldingVersions();
+ if (teamDef == null) return new ArrayList<VersionArtifact>();
+ return teamDef.getVersionsArtifacts(releaseType);
+ }
+
+ public static List<TeamDefinitionArtifact> getTeamDefinitions(Active active) throws OseeCoreException {
+ return AtsCache.getArtifactsByActive(active, TeamDefinitionArtifact.class);
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamTopLevelDefinitions(Active active) throws OseeCoreException {
+ TeamDefinitionArtifact topTeamDef = getTopTeamDefinition();
+ if (topTeamDef == null) return EMPTY_SET;
+ return AtsLib.getActiveSet(Artifacts.getChildrenOfTypeSet(topTeamDef, TeamDefinitionArtifact.class, false),
+ active, TeamDefinitionArtifact.class);
+ }
+
+ public static TeamDefinitionArtifact getTopTeamDefinition() throws OseeCoreException {
+ return (TeamDefinitionArtifact) StaticIdQuery.getSingletonArtifactOrException(
+ TeamDefinitionArtifact.ARTIFACT_NAME, TOP_TEAM_STATIC_ID, AtsPlugin.getAtsBranch());
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamReleaseableDefinitions(Active active) throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (TeamDefinitionArtifact teamDef : getTeamDefinitions(active)) {
+ if (teamDef.getVersionsArtifacts().size() > 0) {
+ teamDefs.add(teamDef);
+ }
+ }
+ return teamDefs;
+ }
+
+ public static Collection<TeamDefinitionArtifact> getImpactedTeamDefs(Collection<ActionableItemArtifact> aias) throws OseeCoreException {
+ Set<TeamDefinitionArtifact> resultTeams = new HashSet<TeamDefinitionArtifact>();
+ for (ActionableItemArtifact aia : aias) {
+ resultTeams.addAll(getImpactedTeamDefInherited(aia));
+ }
+ return resultTeams;
+ }
+
+ private static List<TeamDefinitionArtifact> getImpactedTeamDefInherited(ActionableItemArtifact aia) throws OseeCoreException {
+ if (aia.getRelatedArtifacts(AtsRelation.TeamActionableItem_Team).size() > 0) {
+ return aia.getRelatedArtifacts(AtsRelation.TeamActionableItem_Team, TeamDefinitionArtifact.class);
+ }
+ Artifact parentArt = aia.getParent();
+ if (parentArt instanceof ActionableItemArtifact) return getImpactedTeamDefInherited((ActionableItemArtifact) parentArt);
+ return java.util.Collections.emptyList();
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamsFromItemAndChildren(ActionableItemArtifact aia) throws OseeCoreException {
+ Set<TeamDefinitionArtifact> aiaTeams = new HashSet<TeamDefinitionArtifact>();
+ getTeamFromItemAndChildren(aia, aiaTeams);
+ return aiaTeams;
+ }
+
+ private static void getTeamFromItemAndChildren(ActionableItemArtifact aia, Set<TeamDefinitionArtifact> aiaTeams) throws OseeCoreException {
+ if (aia.getRelatedArtifacts(AtsRelation.TeamActionableItem_Team).size() > 0) {
+ aiaTeams.addAll(aia.getRelatedArtifacts(AtsRelation.TeamActionableItem_Team, TeamDefinitionArtifact.class));
+ }
+ for (Artifact childArt : aia.getChildren()) {
+ if (childArt instanceof ActionableItemArtifact) {
+ getTeamFromItemAndChildren((ActionableItemArtifact) childArt, aiaTeams);
+ }
+ }
+ }
+
+ public double getManDayHrsFromItemAndChildren() {
+ return getManDayHrsFromItemAndChildren(this);
+ }
+
+ public WorkFlowDefinition getWorkFlowDefinition() throws OseeCoreException {
+ Artifact teamDef = getTeamDefinitionHoldingWorkFlow();
+ if (teamDef == null) return null;
+ Artifact workFlowArt = null;
+ for (Artifact artifact : teamDef.getRelatedArtifacts(AtsRelation.WorkItem__Child, Artifact.class)) {
+ if (artifact.getArtifactTypeName().equals(WorkFlowDefinition.ARTIFACT_NAME)) {
+ if (workFlowArt != null) {
+ OseeLog.log(
+ AtsPlugin.class,
+ Level.SEVERE,
+ "Multiple workflows found where only one expected for Team Definition " + getHumanReadableId() + " - " + getDescriptiveName());
+ }
+ workFlowArt = artifact;
+ }
+ }
+ if (workFlowArt == null) {
+ return null;
+ }
+ return (WorkFlowDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(workFlowArt.getDescriptiveName());
+ }
+
+ /**
+ * Return rules associated with team definition . Use SMAManager.getWorkRulesStartsWith to acquire these and work
+ * page rules and workflow rules.
+ *
+ * @param ruleId
+ * @return rule definitions
+ * @throws OseeCoreException
+ */
+ public Collection<WorkRuleDefinition> getWorkRulesStartsWith(String ruleId) throws OseeCoreException {
+ Set<WorkRuleDefinition> workRules = new HashSet<WorkRuleDefinition>();
+ if (ruleId == null || ruleId.equals("")) return workRules;
+ // Get work rules from team definition
+ for (WorkRuleDefinition workRuleDefinition : getWorkRules()) {
+ if (!workRuleDefinition.getId().equals("") && workRuleDefinition.getId().startsWith(ruleId)) {
+ workRules.add(workRuleDefinition);
+ }
+ }
+
+ return workRules;
+ }
+
+ public Collection<WorkRuleDefinition> getWorkRules() throws OseeCoreException {
+ Set<WorkRuleDefinition> workRules = new HashSet<WorkRuleDefinition>();
+ // Get work rules from team definition
+ for (Artifact art : getRelatedArtifacts(CoreRelationEnumeration.WorkItem__Child)) {
+ if (art.getArtifactTypeName().equals(WorkRuleDefinition.ARTIFACT_NAME)) {
+ String id = art.getSoleAttributeValue(WorkItemAttributes.WORK_ID.getAttributeTypeName(), "");
+ if (id != null && !id.equals("")) {
+ workRules.add((WorkRuleDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(id));
+ }
+ }
+ }
+
+ return workRules;
+ }
+
+ /**
+ * If man days hours attribute is set, use it, otherwise, walk up the Team Definition tree. Value used in
+ * calculations.
+ *
+ * @param teamDef
+ * @return number of hours per single person per single day
+ */
+ public double getManDayHrsFromItemAndChildren(TeamDefinitionArtifact teamDef) {
+ try {
+ Double manDaysHrs = teamDef.getSoleAttributeValue(ATSAttributes.MAN_DAYS_NEEDED_ATTRIBUTE.getStoreName(), 0.0);
+ if (manDaysHrs != null && manDaysHrs != 0) return manDaysHrs;
+ if (teamDef.getParent() != null && (teamDef.getParent() instanceof TeamDefinitionArtifact)) return teamDef.getManDayHrsFromItemAndChildren((TeamDefinitionArtifact) teamDef.getParent());
+ return StateMachineArtifact.MAN_DAY_HOURS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return 0.0;
+ }
+
+ /**
+ * Return ONLY leads configured for this TeamDefinitionArtifact. Depending on the use, like creating new actions, the
+ * assignees (or Leads) are determined first from users configured as leads of individual actionable items and only
+ * if that returns no leads, THEN default to using the leads configured for the TeamDefinition. In these cases, use
+ * getLeads(Collection<ActionableItemArtifact>) instead.
+ *
+ * @return users configured as leads for this TeamDefinitionArtifact
+ * @throws OseeCoreException
+ */
+ public Collection<User> getLeads() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamLead_Lead, User.class);
+ }
+
+ /**
+ * Returns leads configured first by ActionableItems and only if this is an empty set, THEN defaults to those
+ * configured by TeamDefinitions. Use getLeads() to only get the leads configured for this TeamDefinitionArtifact.
+ *
+ * @param actionableItems
+ * @return users configured as leads by ActionableItems, then by TeamDefinition
+ */
+ public Collection<User> getLeads(Collection<ActionableItemArtifact> actionableItems) throws OseeCoreException {
+ Set<User> leads = new HashSet<User>();
+ for (ActionableItemArtifact aia : actionableItems) {
+ if (aia.getImpactedTeamDefs().contains(this)) {
+ // If leads are specified for this aia, add them
+ if (aia.getLeads().size() > 0)
+ leads.addAll(aia.getLeads());
+ // Otherwise, add team definition's leads
+ else {
+ for (TeamDefinitionArtifact teamDef : aia.getImpactedTeamDefs()) {
+ leads.addAll(teamDef.getLeads());
+ }
+ }
+ }
+ }
+ if (leads.size() == 0) leads.addAll(getLeads());
+ return leads;
+ }
+
+ public Collection<User> getMembers() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamMember_Member, User.class);
+ }
+
+ public VersionArtifact getVersionArtifact(String name, boolean create) throws OseeCoreException {
+ for (VersionArtifact verArt : getVersionsArtifacts()) {
+ if (verArt.getDescriptiveName().equals(name)) return verArt;
+ }
+ if (create) {
+ return createVersion(name);
+ }
+ return null;
+ }
+
+ public VersionArtifact createVersion(String name) throws OseeCoreException {
+ VersionArtifact versionArt =
+ (VersionArtifact) ArtifactTypeManager.addArtifact(VersionArtifact.ARTIFACT_NAME, AtsPlugin.getAtsBranch(),
+ name);
+ addRelation(AtsRelation.TeamDefinitionToVersion_Version, versionArt);
+ versionArt.persistAttributesAndRelations();
+ AtsCache.cache(versionArt);
+ return versionArt;
+ }
+
+ public Collection<VersionArtifact> getVersionsArtifacts() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamDefinitionToVersion_Version, VersionArtifact.class);
+ }
+
+ public Collection<VersionArtifact> getVersionsArtifacts(VersionReleaseType releaseType) throws OseeCoreException {
+ ArrayList<VersionArtifact> versions = new ArrayList<VersionArtifact>();
+ for (VersionArtifact version : getVersionsArtifacts()) {
+ if (version.isReleased()) {
+ if (releaseType == VersionReleaseType.Released || releaseType == VersionReleaseType.Both) versions.add(version);
+ } else {
+ if (releaseType == VersionReleaseType.UnReleased || releaseType == VersionReleaseType.Both) versions.add(version);
+ }
+ }
+ return versions;
+ }
+
+ public boolean isTeamUsesVersions() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.TEAM_USES_VERSIONS_ATTRIBUTE.getStoreName(), false);
+ }
+
+ public boolean isActionable() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.ACTIONABLE_ATTRIBUTE.getStoreName(), false);
+ }
+
+ public void addWorkRule(String ruleId) throws OseeCoreException {
+ if (!hasWorkRule(ruleId)) {
+ Artifact artifact = WorkItemDefinitionFactory.getWorkItemDefinitionArtifact(ruleId);
+ if (artifact == null)
+ throw new IllegalArgumentException("Rule \"" + ruleId + "\" does not exist.");
+ else {
+ addRelation(CoreRelationEnumeration.WorkItem__Child, artifact);
+ }
+ }
+ }
+
+ public boolean hasWorkRule(String ruleId) throws OseeCoreException {
+ for (Artifact art : getRelatedArtifacts(CoreRelationEnumeration.WorkItem__Child)) {
+ if (art.getDescriptiveName().equals(ruleId)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the branch associated with this team. If this team does not have a branch associated then the parent team
+ * will be asked, this results in a recursive look at parent teams until a parent artifact has a related branch or
+ * the parent of a team is not a team. <br/><br/> If no branch is associated then null will be returned.
+ *
+ * @throws BranchDoesNotExist
+ */
+ public Branch getTeamBranch() throws OseeCoreException {
+ Integer branchId = getSoleAttributeValue(ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName(), null);
+ if (branchId != null && branchId > 0) {
+ return BranchManager.getBranch(branchId);
+ } else {
+ Artifact parent = getParent();
+ if (parent instanceof TeamDefinitionArtifact) {
+ return ((TeamDefinitionArtifact) parent).getTeamBranch();
+ }
+ }
+ return null;
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamDefinitions(Collection<String> teamDefNames) throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (String teamDefName : teamDefNames) {
+ teamDefs.addAll(AtsCache.getArtifactsByName(teamDefName, TeamDefinitionArtifact.class));
+ }
+ return teamDefs;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java
new file mode 100644
index 00000000000..e617295a54e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java
@@ -0,0 +1,600 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.ats.util.widgets.XActionableItemsDam;
+import org.eclipse.osee.ats.util.widgets.dialog.AICheckTreeDialog;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerCells;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkFlowArtifact extends TaskableStateMachineArtifact implements IWorldViewArtifact, IBranchArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "Team Workflow";
+ private XActionableItemsDam actionableItemsDam;
+ public static enum DefaultTeamState {
+ Endorse, Analyze, Authorize, Implement, Completed, Cancelled
+ }
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ */
+ public TeamWorkFlowArtifact(ArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humanReadableId, branch, artifactType);
+ registerSMAEditorRelation(AtsRelation.TeamWorkflowTargetedForVersion_Version);
+ registerAtsWorldRelation(AtsRelation.TeamWorkflowToReview_Review);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getArtifactSuperTypeName()
+ */
+ @Override
+ public String getArtifactSuperTypeName() {
+ return "Team Workflow";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#saveSMA()
+ */
+ @Override
+ public void saveSMA(SkynetTransaction transaction) {
+ super.saveSMA(transaction);
+ try {
+ getParentActionArtifact().resetAttributesOffChildren(transaction);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't reset Action parent of children", ex, true);
+ }
+ }
+
+ @Override
+ public String getDescription() {
+ try {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ } catch (Exception ex) {
+ return "Error: " + ex.getLocalizedMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isValidationRequired()
+ */
+ @Override
+ public boolean isValidationRequired() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), false);
+ }
+
+ @Override
+ public int getWorldViewPercentRework() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.PERCENT_REWORK_ATTRIBUTE.getStoreName(), 0);
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() {
+ Set<User> users = new HashSet<User>();
+ try {
+ addPriviledgedUsersUpTeamDefinitionTree(getTeamDefinition(), users);
+
+ WorkPageDefinition workPageDefinition = smaMgr.getWorkPageDefinition();
+
+ // Add user if allowing privileged edit to all users
+ if (!users.contains(UserManager.getUser()) && (workPageDefinition.hasWorkRule(RuleWorkItemId.atsAllowPriviledgedEditToAll.name()) || getTeamDefinition().hasWorkRule(
+ RuleWorkItemId.atsAllowPriviledgedEditToAll.name()))) {
+ users.add(UserManager.getUser());
+ }
+
+ // Add user if user is team member and rule exists
+ if (!users.contains(UserManager.getUser()) && (workPageDefinition.hasWorkRule(RuleWorkItemId.atsAllowPriviledgedEditToTeamMember.name()) || getTeamDefinition().hasWorkRule(
+ RuleWorkItemId.atsAllowPriviledgedEditToTeamMember.name()))) {
+ if (getTeamDefinition().getMembers().contains(UserManager.getUser())) {
+ users.add(UserManager.getUser());
+ }
+ }
+
+ // Add user if team member is originator and rule exists
+ if (!users.contains(UserManager.getUser()) && (workPageDefinition.hasWorkRule(RuleWorkItemId.atsAllowPriviledgedEditToTeamMemberAndOriginator.name()) || getTeamDefinition().hasWorkRule(
+ RuleWorkItemId.atsAllowPriviledgedEditToTeamMemberAndOriginator.name()))) {
+ if (smaMgr.getOriginator().equals(UserManager.getUser()) && getTeamDefinition().getMembers().contains(
+ UserManager.getUser())) {
+ users.add(UserManager.getUser());
+ }
+ }
+
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return users;
+ }
+
+ private void addPriviledgedUsersUpTeamDefinitionTree(TeamDefinitionArtifact tda, Set<User> users) throws OseeCoreException {
+ users.addAll(tda.getLeads());
+
+ // Walk up tree to get other editors
+ if (tda.getParent() != null && (tda.getParent() instanceof TeamDefinitionArtifact)) {
+ addPriviledgedUsersUpTeamDefinitionTree((TeamDefinitionArtifact) tda.getParent(), users);
+ }
+ }
+
+ @Override
+ public String getEditorTitle() {
+ return getTeamTitle();
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ initializeSMA();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#initializeSMA()
+ */
+ @Override
+ protected void initializeSMA() {
+ super.initializeSMA();
+ actionableItemsDam = new XActionableItemsDam(this);
+ }
+
+ public ChangeType getChangeType() throws OseeCoreException {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ public void setChangeType(ChangeType type) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), type.name());
+ }
+
+ public PriorityType getPriority() throws OseeCoreException {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ public void setPriority(PriorityType type) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), type.getShortName());
+ }
+
+ /**
+ * @return Returns the actionableItemsDam.
+ */
+ public XActionableItemsDam getActionableItemsDam() {
+ return actionableItemsDam;
+ }
+
+ public void setTeamDefinition(TeamDefinitionArtifact tda) throws OseeCoreException {
+ this.setSoleAttributeValue(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), tda.getGuid());
+ }
+
+ public TeamDefinitionArtifact getTeamDefinition() throws OseeCoreException, OseeCoreException {
+ String guid = this.getSoleAttributeValue(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), "");
+ if (guid == null || guid.equals("")) throw new IllegalArgumentException(
+ "TeamWorkflow has no TeamDefinition associated.");
+ return AtsCache.getTeamDefinitionArtifact(guid);
+ }
+
+ public String getTeamTitle() {
+ return "[" + getTeamName() + "] - " + getDescriptiveName();
+ }
+
+ public String getTeamName() {
+ try {
+ return getTeamDefinition().getDescriptiveName();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception: " + ex.getLocalizedMessage() + ". See log for details.";
+ }
+ }
+
+ @Override
+ public String getWorldViewType() throws OseeCoreException {
+ return getTeamName() + " Workflow";
+ }
+
+ @Override
+ public ChangeType getWorldViewChangeType() throws OseeCoreException {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ @Override
+ public String getWorldViewPriority() throws OseeCoreException {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), "")).getShortName();
+ }
+
+ @Override
+ public String getWorldViewUserCommunity() throws OseeCoreException {
+ return getAttributesToString(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ }
+
+ @Override
+ public String getWorldViewActionableItems() throws OseeCoreException {
+ return getActionableItemsDam().getActionableItemsStr();
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws OseeCoreException {
+ super.atsDelete(deleteArts, allRelated);
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviews())
+ reviewArt.atsDelete(deleteArts, allRelated);
+ }
+
+ @Override
+ public String getWorldViewTeam() throws OseeCoreException {
+ return getTeamName();
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws OseeCoreException {
+ Collection<ActionArtifact> arts = getRelatedArtifacts(AtsRelation.ActionToWorkflow_Action, ActionArtifact.class);
+ if (arts.size() == 0) {
+ throw new OseeStateException("Team " + getHumanReadableId() + " has no parent Action");
+ } else if (arts.size() > 1) {
+ throw new OseeStateException("Team " + getHumanReadableId() + " has multiple parent Actions");
+ } else
+ return arts.iterator().next();
+ }
+
+ @Override
+ public String getWorldViewTargetedVersionStr() throws OseeCoreException {
+ Collection<VersionArtifact> verArts =
+ getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Version, VersionArtifact.class);
+ if (verArts.size() == 0) return "";
+ if (verArts.size() > 1) {
+ String errStr =
+ "Workflow " + smaMgr.getSma().getHumanReadableId() + " targeted for multiple versions: " + Artifacts.commaArts(verArts);
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, errStr, null);
+ return XViewerCells.getCellExceptionString(errStr);
+ }
+ VersionArtifact verArt = verArts.iterator().next();
+ if (!smaMgr.isCompleted() && !smaMgr.isCancelled() && verArt.getSoleAttributeValue(
+ ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), false)) {
+ String errStr =
+ "Workflow " + smaMgr.getSma().getHumanReadableId() + " targeted for released version, but not completed: " + verArt;
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, errStr, null);
+ return XViewerCells.getCellExceptionString(errStr);
+ }
+ return verArt.getDescriptiveName();
+ }
+
+ @Override
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException {
+ try {
+ return (VersionArtifact) getRelatedArtifact(AtsRelation.TeamWorkflowTargetedForVersion_Version);
+ } catch (ArtifactDoesNotExist ex) {
+ return null;
+ }
+ }
+
+ @Override
+ public String getHyperName() {
+ return getTeamName();
+ }
+
+ @Override
+ public double getManDayHrsPreference() {
+ try {
+ return getTeamDefinition().getManDayHrsFromItemAndChildren();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return StateMachineArtifact.MAN_DAY_HOURS;
+ }
+
+ public Result addActionableItems() {
+ Result toReturn = Result.FalseResult;
+ AICheckTreeDialog diag =
+ new AICheckTreeDialog(
+ "Add/Remove Impacted Actionable Items",
+ "Select/De-Select Impacted Actionable Items\n\n" + "Note: At least one Actionable Item must remain.\nTeam should be cancelled if no impact exists.",
+ Active.Both);
+
+ try {
+ diag.setInput(getTeamDefinition().getRelatedArtifacts(AtsRelation.TeamActionableItem_ActionableItem,
+ ActionableItemArtifact.class));
+ diag.setInitialSelections(actionableItemsDam.getActionableItems());
+ if (diag.open() != 0) {
+ toReturn = new Result("Add/Remove Cancelled");
+ } else if (diag.getChecked().size() == 0) {
+ toReturn = new Result("At least one actionable item must remain.");
+ } else {
+ Set<ActionableItemArtifact> selectedAlias = new HashSet<ActionableItemArtifact>();
+ for (Object obj : diag.getChecked()) {
+ selectedAlias.add((ActionableItemArtifact) obj);
+ }
+
+ toReturn = actionableItemsTx(AtsPlugin.getAtsBranch(), selectedAlias, null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ toReturn = Result.FalseResult;
+ }
+ return toReturn;
+ }
+
+ public Result convertActionableItems() throws OseeCoreException {
+ Result toReturn = Result.FalseResult;
+ AICheckTreeDialog diag =
+ new AICheckTreeDialog("Convert Impacted Actionable Items",
+ "NOTE: This should NOT be the normal path to changing actionable items.\n\nIf a team has " +
+ //
+ "determined " + "that there is NO impact and that another actionable items IS impacted:\n" +
+ //
+ " 1) Cancel this operation\n" + " 2) Select \"Edit Actionable Items\" to add/remove " +
+ //
+ "impacted items \n" + " which will create new teams as needed.\n" +
+ //
+ " 3) Then cancel the team that has no impacts.\n Doing this will show that the original " +
+ //
+ "team analyzed the impact\n" + " and determined that there was no change.\n\n" + "However, " +
+ //
+ "there are some cases where an impacted item was incorrectly chosen\n" + "and the original team " +
+ //
+ "does not need to do anything, this dialog will purge the\n" + "team from the DB as if it was " +
+ //
+ "never chosen.\n\n" + "Current Actionable Item(s): " + getWorldViewActionableItems() + "\n" +
+ //
+ "Current Team: " + getTeamDefinition().getDescriptiveName() + "\n" +
+ //
+ "Select SINGLE Actionable Item below to convert this workflow to.\n\n" +
+ //
+ "You will be prompted to confirm this conversion.", Active.Both);
+
+ diag.setInput(ActionableItemArtifact.getTopLevelActionableItems(Active.Both));
+ if (diag.open() != 0) return Result.FalseResult;
+ if (diag.getChecked().size() == 0) return new Result("At least one actionable item must must be selected.");
+ if (diag.getChecked().size() > 1) return new Result("Only ONE actionable item can be selected for converts");
+ ActionableItemArtifact selectedAia = diag.getChecked().iterator().next();
+ Collection<TeamDefinitionArtifact> teamDefs =
+ ActionableItemArtifact.getImpactedTeamDefs(Arrays.asList(selectedAia));
+ if (teamDefs.size() != 1) {
+ toReturn = new Result("Single team can not retrieved for " + selectedAia.getDescriptiveName());
+ } else {
+ TeamDefinitionArtifact newTeamDef = teamDefs.iterator().next();
+ if (newTeamDef.equals(getTeamDefinition())) {
+ toReturn =
+ new Result(
+ "Actionable Item selected belongs to same team as currently selected team.\n" + "Use \"Edit Actionable Items\" instaed.");
+ } else {
+ StringBuffer sb = new StringBuffer();
+ sb.append("Converting...");
+ sb.append("\nActionable Item(s): " + getWorldViewActionableItems());
+ sb.append("\nTeam: " + getTeamDefinition().getDescriptiveName());
+ sb.append("\nto\nActionable Item(s): " + selectedAia);
+ sb.append("\nTeam: " + newTeamDef.getDescriptiveName());
+ if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Confirm Convert", sb.toString())) {
+ Set<ActionableItemArtifact> toProcess = new HashSet<ActionableItemArtifact>();
+ toProcess.add(selectedAia);
+ toReturn = actionableItemsTx(AtsPlugin.getAtsBranch(), toProcess, newTeamDef);
+ }
+ }
+ }
+ return toReturn;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentAtsArtifact()
+ */
+ @Override
+ public Artifact getParentAtsArtifact() throws OseeCoreException {
+ return getParentActionArtifact();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ @Override
+ public String getWorldViewDescription() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ /**
+ * If targeted for version exists, return that estimated date. Else, if attribute is set, return that date. Else
+ * null.
+ */
+ @Override
+ public Date getWorldViewEstimatedReleaseDate() throws OseeCoreException {
+ Collection<VersionArtifact> vers =
+ getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Version, VersionArtifact.class);
+ Date date = null;
+ if (vers.size() > 0) {
+ date = vers.iterator().next().getEstimatedReleaseDate();
+ if (date == null) {
+ date = getSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ }
+ } else
+ date = getSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ return date;
+ }
+
+ /**
+ * If targeted for version exists, return that estimated date. Else, if attribute is set, return that date. Else
+ * null.
+ */
+ @Override
+ public Date getWorldViewReleaseDate() throws OseeCoreException {
+ Collection<VersionArtifact> vers =
+ getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Version, VersionArtifact.class);
+ Date date = null;
+ if (vers.size() > 0) {
+ date = vers.iterator().next().getReleaseDate();
+ if (date == null) {
+ date = getSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ }
+ } else
+ date = getSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ return date;
+ }
+
+ @Override
+ public Collection<User> getImplementers() throws OseeCoreException {
+ return getImplementersByState(DefaultTeamState.Implement.name());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ @Override
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException {
+ Date date = getWorldViewDeadlineDate();
+ if (date != null) return new XDate(date).getMMDDYY();
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ @Override
+ public Date getWorldViewDeadlineDate() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName(), null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ @Override
+ public double getWorldViewWeeklyBenefit() throws OseeCoreException {
+ if (isAttributeTypeValid(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName())) return 0;
+ String value = getSoleAttributeValue(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName(), "");
+ if (value == null || value.equals("")) return 0;
+ return new Float(value).doubleValue();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewAnnualCostAvoidance()
+ */
+ @Override
+ public double getWorldViewAnnualCostAvoidance() throws OseeCoreException {
+ double benefit = getWorldViewWeeklyBenefit();
+ double remainHrs = getRemainHoursTotal();
+ return (benefit * 52) - remainHrs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentTeamWorkflow()
+ */
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws OseeCoreException {
+ return this;
+ }
+
+ private Result actionableItemsTx(Branch branch, Set<ActionableItemArtifact> selectedAlias, TeamDefinitionArtifact teamDefinition) throws OseeCoreException {
+ Result workResult = actionableItemsDam.setActionableItems(selectedAlias);
+ if (workResult.isTrue()) {
+ if (teamDefinition != null) setTeamDefinition(teamDefinition);
+ SkynetTransaction transaction = new SkynetTransaction(branch);
+ getParentActionArtifact().resetAttributesOffChildren(transaction);
+ persistAttributes(transaction);
+ transaction.execute();
+ }
+ return workResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ @Override
+ public String getWorldViewBranchStatus() throws OseeCoreException {
+ try {
+ if (getSmaMgr().getBranchMgr().isWorkingBranch())
+ return "Working";
+ else if (getSmaMgr().getBranchMgr().isCommittedBranch()) return "Committed";
+ return "";
+ } catch (Exception ex) {
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact#getArtifact()
+ */
+ public Artifact getArtifact() {
+ return this;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact#getCommitManagerBranch()
+ */
+ public Branch getWorkingBranch() throws OseeCoreException {
+ if (getSmaMgr().getBranchMgr().getWorkingBranch() != null) {
+ return getSmaMgr().getBranchMgr().getWorkingBranch();
+ }
+ return null;
+ }
+
+ @Override
+ public String getWorldViewSWEnhancement() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.SW_ENHANCEMENT_ATTRIBUTE.getStoreName(), "");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
new file mode 100644
index 00000000000..5de379f38f7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.IAtsTeamWorkflow;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowExtensions {
+
+ private static TeamWorkflowExtensions instance = new TeamWorkflowExtensions();
+ private static Set<IAtsTeamWorkflow> teamWorkflowExtensionItems;
+
+ private TeamWorkflowExtensions() {
+ instance = this;
+ }
+
+ public static TeamWorkflowExtensions getInstance() {
+ return instance;
+ }
+
+ public Set<String> getAllTeamWorkflowArtifactNames() {
+ Set<String> artifactNames = new HashSet<String>();
+ artifactNames.add(TeamWorkFlowArtifact.ARTIFACT_NAME);
+ for (IAtsTeamWorkflow ext : getAtsTeamWorkflowExtensions()) {
+ artifactNames.addAll(ext.getTeamWorkflowArtifactNames());
+ }
+ return artifactNames;
+ }
+
+ @SuppressWarnings( {"unchecked"})
+ public Set<IAtsTeamWorkflow> getAtsTeamWorkflowExtensions() {
+ if (teamWorkflowExtensionItems != null) return teamWorkflowExtensionItems;
+ teamWorkflowExtensionItems = new HashSet<IAtsTeamWorkflow>();
+
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsTeamWorkflow");
+ if (point == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't access AtsTeamWorkflow extension point", true);
+ return teamWorkflowExtensionItems;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String classname = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsTeamWorkflow")) {
+ classname = el.getAttribute("classname");
+ bundleName = el.getContributor().getName();
+ if (classname != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ Class taskClass = bundle.loadClass(classname);
+ Object obj = taskClass.newInstance();
+ teamWorkflowExtensionItems.add((IAtsTeamWorkflow) obj);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsTeamWorkflow extension", ex, true);
+ }
+ }
+ }
+ }
+ }
+ return teamWorkflowExtensionItems;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java
new file mode 100644
index 00000000000..d98b83e865f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowLabelProvider extends ArtifactLabelProvider {
+
+ /**
+ *
+ */
+ public TeamWorkflowLabelProvider() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object element) {
+ TeamWorkFlowArtifact wf = (TeamWorkFlowArtifact) element;
+ return wf.getTeamTitle();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowManager.java
new file mode 100644
index 00000000000..c7a4ee30bad
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowManager.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * Methods in support of programatically transitioning the DefaultWorkFlow through it's states. Only to be used for the
+ * DefaultTeamWorkflow of Endorse->Analyze->Auth->Implement->Complete
+ *
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowManager {
+
+ private final SMAManager smaMgr;
+ private final TeamWorkFlowArtifact teamArt;
+
+ public TeamWorkflowManager(TeamWorkFlowArtifact teamArt) {
+ this.teamArt = teamArt;
+ smaMgr = new SMAManager(teamArt);
+ }
+
+ /**
+ * Quickly transition to a state with minimal metrics and data entered. Should only be used for automated transition
+ * for things such as developmental testing and demos.
+ *
+ * @param toState
+ * @param user User to transition to OR null if should use user of current state
+ * @param popup
+ * @param transaction
+ * @return Result
+ * @throws Exception
+ */
+ public Result transitionTo(DefaultTeamState toState, User user, boolean popup, SkynetTransaction transaction) throws OseeCoreException {
+ Result result = setEndorseData(null, 100, .2);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ result =
+ smaMgr.transition(DefaultTeamState.Analyze.name(),
+ (user != null ? user : smaMgr.getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ if (toState == DefaultTeamState.Analyze) return Result.TrueResult;
+
+ result = setAnalyzeData(null, null, 1, 100, .2);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ result =
+ smaMgr.transition(DefaultTeamState.Authorize.name(),
+ (user != null ? user : smaMgr.getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ if (toState == DefaultTeamState.Authorize) return Result.TrueResult;
+
+ result = setAuthorizeData(100, .2);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+
+ result =
+ smaMgr.transition(DefaultTeamState.Implement.name(),
+ (user != null ? user : smaMgr.getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ if (toState == DefaultTeamState.Implement) return Result.TrueResult;
+
+ result =
+ smaMgr.transition(DefaultTeamState.Completed.name(),
+ (user != null ? user : smaMgr.getStateMgr().getAssignees().iterator().next()), false, transaction);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ return Result.TrueResult;
+
+ }
+
+ public Result setEndorseData(String propRes, int statePercentComplete, double stateHoursSpent) throws OseeCoreException {
+ if (!smaMgr.getStateMgr().getCurrentStateName().equals("Endorse")) return new Result(
+ "Action not in Endorse state");
+ if (propRes == null || propRes.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), true);
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName(), propRes);
+ smaMgr.getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+ public Result setAnalyzeData(String problem, String propRes, double hourEstimate, int statePercentComplete, double stateHoursSpent) throws OseeCoreException {
+ if (!smaMgr.getStateMgr().getCurrentStateName().equals("Analyze")) return new Result(
+ "Action not in Analyze state");
+ if (problem == null || problem.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROBLEM_OVERRIDE_ATTRIBUTE.getStoreName(), true);
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROBLEM_ATTRIBUTE.getStoreName(), problem);
+ if (propRes == null || propRes.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), true);
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName(), propRes);
+ teamArt.setSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), hourEstimate);
+ smaMgr.getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+ public Result setAuthorizeData(int statePercentComplete, double stateHoursSpent) throws OseeCoreException {
+ if (!smaMgr.getStateMgr().getCurrentStateName().equals("Authorize")) return new Result(
+ "Action not in Authorize state");
+ smaMgr.getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+ public Result setImplementData(String resolution, int statePercentComplete, double stateHoursSpent) throws OseeCoreException {
+ if (!smaMgr.getStateMgr().getCurrentStateName().equals("Implement")) return new Result(
+ "Action not in Implement state");
+ if (resolution == null || resolution.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), true);
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), resolution);
+ smaMgr.getStateMgr().updateMetrics(stateHoursSpent, statePercentComplete, true);
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java
new file mode 100644
index 00000000000..956bd81a528
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.BasicArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+
+public class VersionArtifact extends BasicArtifact {
+
+ public static String ARTIFACT_NAME = "Version";
+
+ public static enum VersionReleaseType {
+ Released, UnReleased, Both
+ };
+
+ public VersionArtifact(ArtifactFactory parentFactory, String guid, String humandReadableId, Branch branch, ArtifactType artifactType) {
+ super(parentFactory, guid, humandReadableId, branch, artifactType);
+ }
+
+ public TeamDefinitionArtifact getParentTeamDefinition() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamDefinitionToVersion_TeamDefinition, TeamDefinitionArtifact.class).iterator().next();
+ }
+
+ public Boolean isReleased() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), false);
+ }
+
+ public Boolean isNextVersion() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName(), false);
+ }
+
+ @Override
+ public String toString() {
+ return getDescriptiveName();
+ }
+
+ public void setReleased(boolean released) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), released);
+ }
+
+ public void setNextVersion(boolean nextVersion) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName(), nextVersion);
+ }
+
+ public String getFullName() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public void setFullName(String name) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName(), name);
+ }
+
+ public String getDescription() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ }
+
+ public void setDescription(String desc) throws OseeCoreException {
+ setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ }
+
+ public Collection<TeamWorkFlowArtifact> getTargetedForTeamArtifacts() throws OseeCoreException {
+ return getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Workflow, TeamWorkFlowArtifact.class);
+ }
+
+ public String getFullDisplayName() throws OseeCoreException {
+ String str = "";
+ if (!getDescriptiveName().equals(Artifact.UNNAMED)) str += getDescriptiveName();
+ if (!getFullName().equals("")) {
+ if (str.equals(""))
+ str = getFullName();
+ else
+ str += " - " + getFullName();
+ }
+ if (!getDescription().equals("")) {
+ if (str.equals(""))
+ str = getDescription();
+ else
+ str += " - " + getDescription();
+ }
+ return str;
+ }
+
+ public TeamDefinitionArtifact getTeamDefinitionArtifact() throws OseeCoreException {
+ try {
+ return (TeamDefinitionArtifact) getRelatedArtifact(AtsRelation.TeamDefinitionToVersion_TeamDefinition);
+ } catch (ArtifactDoesNotExist ex) {
+ return null;
+ }
+ }
+
+ public Date getEstimatedReleaseDate() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ }
+
+ public Date getReleaseDate() throws OseeCoreException {
+ return getSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), null);
+ }
+
+ public static Set<VersionArtifact> getVersions(Collection<String> teamDefNames) throws OseeCoreException {
+ Set<VersionArtifact> teamDefs = new HashSet<VersionArtifact>();
+ for (String teamDefName : teamDefNames) {
+ teamDefs.add(getSoleVersion(teamDefName));
+ }
+ return teamDefs;
+ }
+
+ /**
+ * Refrain from using this method as Version Artifact names can be changed by the user.
+ *
+ * @param name
+ * @return Version
+ */
+ public static VersionArtifact getSoleVersion(String name) throws OseeCoreException {
+ return AtsCache.getArtifactsByName(name, VersionArtifact.class).iterator().next();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java
new file mode 100644
index 00000000000..81bdcc85e17
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.artifact.annotation;
+
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.IArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation.Type;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ReviewAnnotationHandler implements IArtifactAnnotation {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.annotation.IArtifactAnnotation#getAnnotations(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ public void getAnnotations(Artifact artifact, Set<ArtifactAnnotation> annotations) {
+ if (artifact instanceof StateMachineArtifact) {
+ try {
+ if ((new SMAManager((StateMachineArtifact) artifact)).getReviewManager().getReviews().size() == 0) return;
+ for (ReviewSMArtifact review : (new SMAManager((StateMachineArtifact) artifact)).getReviewManager().getReviews()) {
+ if (!review.getSmaMgr().isCompleted()) {
+ annotations.add(new ArtifactAnnotation(Type.Warning, "ats.Review",
+ "Review(s) open against this workflow."));
+ return;
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsCache.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsCache.java
new file mode 100644
index 00000000000..836c66f66aa
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsCache.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.config;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.MultipleArtifactsExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * Common cache storage for ATS configuration artifacts:<br>
+ * TeamDefinitionArtifact<br>
+ * VersionArtifact<br>
+ * ActionableItemArtifact<br>
+ * All other artifact types will silently not cached
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsCache {
+
+ private final Set<Artifact> cache = new HashSet<Artifact>();
+ private final Map<String, ActionableItemArtifact> guidToActionableItem =
+ new HashMap<String, ActionableItemArtifact>();
+ private final Map<String, TeamDefinitionArtifact> guidToTeamDefinition =
+ new HashMap<String, TeamDefinitionArtifact>();
+ private static final AtsCache instance = new AtsCache();
+ private static List<String> cacheTypes =
+ Arrays.asList(ActionableItemArtifact.ARTIFACT_NAME, TeamDefinitionArtifact.ARTIFACT_NAME,
+ VersionArtifact.ARTIFACT_NAME);
+
+ public static void cache(Artifact artifact) throws OseeCoreException {
+ if (cacheTypes.contains(artifact.getArtifactTypeName())) {
+ instance.cache.add(artifact);
+ if (artifact instanceof TeamDefinitionArtifact) {
+ instance.guidToTeamDefinition.put(artifact.getGuid(), (TeamDefinitionArtifact) artifact);
+ }
+ if (artifact instanceof ActionableItemArtifact) {
+ instance.guidToActionableItem.put(artifact.getGuid(), (ActionableItemArtifact) artifact);
+ }
+ }
+ }
+
+ public static void deCache(Artifact artifact) {
+ instance.cache.remove(artifact);
+ }
+
+ public static ActionableItemArtifact getActionableItemByGuid(String guid) throws OseeCoreException {
+ BulkLoadAtsCache.run(true);
+ ActionableItemArtifact aia = instance.guidToActionableItem.get(guid);
+ if (aia != null) return aia;
+ Artifact art = ArtifactQuery.getArtifactFromId(guid, AtsPlugin.getAtsBranch(), false);
+ if (art != null) {
+ cache(art);
+ return (ActionableItemArtifact) art;
+ }
+ return null;
+ }
+
+ public static TeamDefinitionArtifact getTeamDefinitionArtifact(String guid) throws OseeCoreException {
+ BulkLoadAtsCache.run(true);
+ BulkLoadAtsCache.run(true);
+ TeamDefinitionArtifact teamDef = instance.guidToTeamDefinition.get(guid);
+ if (teamDef != null) return teamDef;
+ Artifact art = ArtifactQuery.getArtifactFromId(guid, AtsPlugin.getAtsBranch(), false);
+ if (art != null) {
+ cache(art);
+ return (TeamDefinitionArtifact) art;
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <A> List<A> getArtifactsByActive(Active active, Class<A> clazz) {
+ BulkLoadAtsCache.run(true);
+ List<A> arts = new ArrayList<A>();
+ for (Artifact art : instance.cache) {
+ try {
+ if (!art.isDeleted() && art.getClass().isAssignableFrom(clazz) && art.isAttributeTypeValid(ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName()) && art.getSoleAttributeValue(
+ ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName(), false)) {
+ arts.add((A) art);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return arts;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <A> List<A> getArtifactsByName(String name, Class<A> clazz) {
+ BulkLoadAtsCache.run(true);
+ List<A> arts = new ArrayList<A>();
+ for (Artifact art : instance.cache) {
+ if (!art.isDeleted() && art.getClass().isAssignableFrom(clazz) && art.getDescriptiveName().equals(name)) {
+ arts.add((A) art);
+ }
+ }
+ return arts;
+ }
+
+ public static <A> A getSoleArtifactByName(String name, Class<A> clazz) throws MultipleArtifactsExist, ArtifactDoesNotExist {
+ BulkLoadAtsCache.run(true);
+ List<A> arts = getArtifactsByName(name, clazz);
+ if (arts.size() == 1) {
+ return (A) arts.iterator().next();
+ }
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java
new file mode 100644
index 00000000000..0c0c196414a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.config;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.StaticIdQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsConfig {
+
+ private static AtsConfig instance = new AtsConfig();
+ public static String FOLDER_ARTIFACT = "Folder";
+ public static String ATS_HEADING = "Action Tracking System";
+ public static String MSA_TOOLS_HEADING = "MSA Tools";
+ public static String WORK_FLOWS_FOLDER = "Work Flows";
+ public static String WORK_RULES_FOLDER = "Work Rules";
+ public static String WORK_WIDGETS_FOLDER = "Work Widgets";
+ public static String WORK_PAGES_FOLDER = "Work Pages";
+ public static String TEAMS_HEADING = "Teams";
+ public static String ACTIONABLE_ITEMS_HEADING = "Actionable Items";
+
+ private AtsConfig() {
+ super();
+ }
+
+ public static AtsConfig getInstance() {
+ return instance;
+ }
+
+ public Artifact getOrCreateWorkRulesFolderArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, WORK_RULES_FOLDER);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(WORK_RULES_FOLDER)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, WORK_RULES_FOLDER);
+ }
+ validateATSHeadingParent(art, transaction);
+ return art;
+ }
+
+ public Artifact getOrCreateWorkPagesFolderArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, WORK_PAGES_FOLDER);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(WORK_PAGES_FOLDER)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, WORK_PAGES_FOLDER);
+ }
+ validateATSHeadingParent(art, transaction);
+ return art;
+ }
+
+ public Artifact getOrCreateWorkWidgetsFolderArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, WORK_WIDGETS_FOLDER);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(WORK_WIDGETS_FOLDER)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, WORK_WIDGETS_FOLDER);
+ }
+ validateATSHeadingParent(art, transaction);
+ return art;
+ }
+
+ public Artifact getOrCreateWorkFlowsFolderArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, WORK_FLOWS_FOLDER);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(WORK_FLOWS_FOLDER)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, WORK_FLOWS_FOLDER);
+ }
+ validateATSHeadingParent(art, transaction);
+ return art;
+ }
+
+ public ActionableItemArtifact getOrCreateActionableItemsHeadingArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art =
+ Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), ActionableItemArtifact.ARTIFACT_NAME,
+ ACTIONABLE_ITEMS_HEADING);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(
+ ActionableItemArtifact.TOP_AI_STATIC_ID)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, ActionableItemArtifact.TOP_AI_STATIC_ID);
+ }
+ validateATSHeadingParent(art, transaction);
+ return (ActionableItemArtifact) art;
+ }
+
+ public TeamDefinitionArtifact getOrCreateTeamsDefinitionArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art =
+ Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), TeamDefinitionArtifact.ARTIFACT_NAME, TEAMS_HEADING);
+ if (!art.getAttributesToStringList(StaticIdQuery.STATIC_ID_ATTRIBUTE).contains(
+ TeamDefinitionArtifact.TOP_TEAM_STATIC_ID)) {
+ art.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, TeamDefinitionArtifact.TOP_TEAM_STATIC_ID);
+ }
+ validateATSHeadingParent(art, transaction);
+ return (TeamDefinitionArtifact) art;
+ }
+
+ private void validateATSHeadingParent(Artifact art, SkynetTransaction transaction) {
+ try {
+ if (!art.hasParent()) {
+ Artifact atsHeadingArtifact = getOrCreateAtsHeadingArtifact(transaction);
+ atsHeadingArtifact.addChild(art);
+ art.persistAttributesAndRelations(transaction);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public Artifact getOrCreateAtsHeadingArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, ATS_HEADING);
+ if (!art.hasParent()) {
+ Artifact rootArt = ArtifactPersistenceManager.getDefaultHierarchyRootArtifact(AtsPlugin.getAtsBranch());
+ rootArt.addChild(art);
+ art.persistAttributesAndRelations(transaction);
+ }
+ return art;
+ }
+
+ // public Artifact getOrCreateMsaToolsHeadingArtifact(SkynetTransaction transaction) throws OseeCoreException {
+ // Artifact art = Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(), FOLDER_ARTIFACT, MSA_TOOLS_HEADING);
+ // if (art.getParent() == null) {
+ // try {
+ // Artifact rootArt = ArtifactPersistenceManager.getDefaultHierarchyRootArtifact(AtsPlugin.getAtsBranch());
+ // rootArt.addChild(art);
+ // art.persistAttributesAndRelations(transaction);
+ // } catch (Exception ex) {
+ // OSEELog.logException(AtsPlugin.class, ex, true);
+ // }
+ // }
+ // return art;
+ // }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
new file mode 100644
index 00000000000..9c4b69aa408
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.config;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.PeerToPeerWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.SimpleWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.TaskWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.database.IDbInitializationTask;
+import org.eclipse.osee.framework.db.connection.OseeConnection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+public class AtsDatabaseConfig implements IDbInitializationTask {
+
+ public void run(OseeConnection connection) throws OseeCoreException {
+ createAtsTopLevelConfigObjects();
+
+ // Configure WorkItemDefinitions
+ configWorkItemDefinitions(WriteType.New, null);
+
+ }
+
+ public static void configWorkItemDefinitions(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+
+ // Import Work Item Definitions
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData,
+ AtsWorkDefinitions.getAtsWorkDefinitions());
+
+ new TeamWorkflowDefinition().config(writeType, null);
+ new TaskWorkflowDefinition().config(writeType, null);
+ new SimpleWorkflowDefinition().config(writeType, null);
+ new DecisionWorkflowDefinition().config(writeType, null);
+ new PeerToPeerWorkflowDefinition().config(writeType, null);
+
+ }
+
+ private void createAtsTopLevelConfigObjects() throws OseeCoreException {
+ SkynetTransaction transaction1 = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ AtsConfig.getInstance().getOrCreateAtsHeadingArtifact(transaction1);
+ transaction1.execute();
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ AtsConfig.getInstance().getOrCreateAtsHeadingArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateActionableItemsHeadingArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateWorkFlowsFolderArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateWorkRulesFolderArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateWorkWidgetsFolderArtifact(transaction);
+ AtsConfig.getInstance().getOrCreateWorkPagesFolderArtifact(transaction);
+ transaction.execute();
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/BulkLoadAtsCache.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/BulkLoadAtsCache.java
new file mode 100644
index 00000000000..068f5380fca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/BulkLoadAtsCache.java
@@ -0,0 +1,71 @@
+/*
+ * Created on Jun 16, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.config;
+
+import java.util.Arrays;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class BulkLoadAtsCache extends org.eclipse.core.runtime.jobs.Job {
+
+ private BulkLoadAtsCache() {
+ super("Bulk Loading ATS Config Artifacts");
+ }
+
+ private static boolean atsTypeDataLoaded = false;
+
+ public static void run(boolean forcePend) {
+ if (atsTypeDataLoaded) return;
+ atsTypeDataLoaded = true;
+ BulkLoadAtsCache job = new BulkLoadAtsCache();
+ job.setPriority(Job.SHORT);
+ job.setSystem(true);
+ job.schedule();
+ try {
+ if (forcePend) job.join();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ OseeLog.log(AtsPlugin.class, Level.INFO, getName());
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (Artifact artifact : RelationManager.getRelatedArtifacts(
+ Arrays.asList(AtsConfig.getInstance().getOrCreateAtsHeadingArtifact(transaction)), 8,
+ CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, AtsRelation.TeamDefinitionToVersion_Version)) {
+ AtsCache.cache(artifact);
+ }
+ transaction.execute();
+ WorkItemDefinitionFactory.loadDefinitions();
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+
+ return Status.OK_STATUS;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java
new file mode 100644
index 00000000000..1e1844d6efe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
+import org.eclipse.osee.framework.ui.skynet.render.Renderer;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AtsRenderer extends Renderer {
+ /**
+ * @param rendererId
+ */
+ public AtsRenderer(String rendererId) {
+ super(rendererId);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.render.IRenderer#newInstance()
+ */
+ @Override
+ public AtsRenderer newInstance() throws OseeCoreException {
+ return new AtsRenderer(getId());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.render.Renderer#edit(org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void edit(Artifact artifact, IProgressMonitor monitor) throws OseeCoreException {
+ try {
+ OseeAts.getAtsLib().openATSAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.render.Renderer#supportsEdit()
+ */
+ @Override
+ public boolean supportsEdit() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.render.IRenderer#isValidFor(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ public int getApplicabilityRating(PresentationType presentationType, Artifact artifact) {
+ if (artifact instanceof IATSArtifact) {
+ return ARTIFACT_TYPE_MATCH;
+ }
+ return NO_MATCH;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java
new file mode 100644
index 00000000000..e153577b720
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class AtsStateItem implements IAtsStateItem {
+
+ public static String ALL_STATE_IDS = "ALL";
+ private static final ArrayList<WorkPageService> EMPTY_SERVICES = new ArrayList<WorkPageService>();
+ private static final Collection<String> EMPTY_STRING = new ArrayList<String>();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#committing(org.eclipse.osee.ats.editor.SMAManager)
+ */
+ public Result committing(SMAManager smaMgr) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getBranchShortName(org.eclipse.osee.ats.editor.SMAManager)
+ */
+ public String getBranchShortName(SMAManager smaMgr) throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ protected String getId() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getIds()
+ */
+ public Collection<String> getIds() throws OseeCoreException {
+ if (getId() == null) return EMPTY_STRING;
+ return Arrays.asList(getId());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToAssignees(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section) throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToStateName(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section) throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getSidebarServices(org.eclipse.osee.ats.editor.SMAManager, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public List<WorkPageService> getSidebarServices(SMAManager smaMgr) throws OseeCoreException {
+ return EMPTY_SERVICES;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getToolbarServices(org.eclipse.osee.ats.editor.SMAManager, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public List<WorkPageService> getToolbarServices(SMAManager smaMgr) throws OseeCoreException {
+ return EMPTY_SERVICES;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#pageCreated(org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.ats.editor.SMAManager, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ public Result pageCreated(FormToolkit toolkit, AtsWorkPage page, SMAManager smaMgr, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#transitioned(org.eclipse.osee.ats.editor.SMAManager, java.lang.String, java.lang.String, java.util.Collection)
+ */
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#transitioning(org.eclipse.osee.ats.editor.SMAManager, java.lang.String, java.lang.String, java.util.Collection)
+ */
+ public Result transitioning(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#widgetModified(org.eclipse.osee.ats.editor.SMAWorkFlowSection, org.eclipse.osee.framework.ui.skynet.widgets.XWidget)
+ */
+ public void widgetModified(SMAWorkFlowSection section, XWidget xWidget) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#xWidgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ public void xWidgetCreated(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#xWidgetCreating(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ public Result xWidgetCreating(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#isAccessControlViaAssigneesEnabledForBranching()
+ */
+ public boolean isAccessControlViaAssigneesEnabledForBranching() throws OseeCoreException {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java
new file mode 100644
index 00000000000..1ede0af246c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStateItems {
+
+ private static List<IAtsStateItem> stateItems = new ArrayList<IAtsStateItem>();
+
+ public List<IAtsStateItem> getStateItems(String stateId) throws OseeCoreException {
+ loadAllStateItems();
+ List<IAtsStateItem> items = new ArrayList<IAtsStateItem>();
+ for (IAtsStateItem item : stateItems)
+ if (item.getIds().contains(AtsStateItem.ALL_STATE_IDS) || item.getIds().contains(stateId)) items.add(item);
+ return items;
+ }
+
+ public List<IAtsStateItem> getCurrentPageStateItems(SMAManager smaMgr) throws OseeCoreException {
+ return getStateItems(smaMgr.getWorkPageDefinition().getId());
+ }
+
+ @SuppressWarnings( {"unchecked"})
+ private void loadAllStateItems() {
+ if (stateItems.size() > 0) return;
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsStateItem");
+ if (point == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't access AtsStateItem extension point", true);
+ return;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String classname = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsStateItem")) {
+ classname = el.getAttribute("classname");
+ bundleName = el.getContributor().getName();
+ if (classname != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ Class taskClass = bundle.loadClass(classname);
+ Object obj = taskClass.newInstance();
+ if (obj == null) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE,
+ "Error Instantiating AtsStateItem extension \"" + classname + "\"", null);
+ } else {
+ stateItems.add((IAtsStateItem) obj);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsStateItem extension", ex, true);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return the stateItems
+ */
+ public static List<IAtsStateItem> getAllStateItems() {
+ return stateItems;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java
new file mode 100644
index 00000000000..5ac05731430
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsStateItem {
+
+ public Result pageCreated(FormToolkit toolkit, AtsWorkPage page, SMAManager smaMgr, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException;
+
+ public Result xWidgetCreating(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException;
+
+ public void xWidgetCreated(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException;
+
+ public void widgetModified(SMAWorkFlowSection section, XWidget xWidget) throws OseeCoreException;
+
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section) throws OseeCoreException;
+
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section) throws OseeCoreException;
+
+ public String getDescription() throws OseeCoreException;
+
+ public String getBranchShortName(SMAManager smaMgr) throws OseeCoreException;
+
+ public boolean isAccessControlViaAssigneesEnabledForBranching() throws OseeCoreException;
+
+ public Collection<String> getIds() throws OseeCoreException;
+
+ public List<WorkPageService> getSidebarServices(SMAManager smaMgr) throws OseeCoreException;
+
+ public List<WorkPageService> getToolbarServices(SMAManager smaMgr) throws OseeCoreException;
+
+ /**
+ * @param smaMgr
+ * @param fromState
+ * @param toState
+ * @param toAssignees
+ * @return Result of operation. If Result.isFalse(), transition will not continue and Result.popup will occur.
+ * @throws Exception TODO
+ */
+ public Result transitioning(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees) throws OseeCoreException;
+
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees, SkynetTransaction transaction) throws OseeCoreException;
+
+ /**
+ * @param smaMgr TODO
+ * @return Result of operation. If Result.isFalse(), commit will not continue and Result.popup will occur.
+ * @throws Exception TODO
+ */
+ public Result committing(SMAManager smaMgr) throws OseeCoreException;
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
new file mode 100644
index 00000000000..2e5fb96a282
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
@@ -0,0 +1,819 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.navigate.VisitedItems;
+import org.eclipse.osee.ats.task.IXTaskViewer;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.world.AtsMetricsComposite;
+import org.eclipse.osee.ats.world.IAtsMetricsProvider;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.access.AccessControlManager;
+import org.eclipse.osee.framework.skynet.core.access.PermissionEnum;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IRelationModifiedEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.skynet.core.relation.RelationModType;
+import org.eclipse.osee.framework.skynet.core.relation.RelationType;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.AttributesComposite;
+import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.skynet.RelationsComposite;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.access.PolicyDialog;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.DetailsBrowserComposite;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.history.RevisionHistoryView;
+import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.part.MultiPageEditorPart;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAEditor extends AbstractArtifactEditor implements IDirtiableEditor, IActionable, IAtsMetricsProvider, IArtifactsPurgedEventListener, IRelationModifiedEventListener, IFrameworkTransactionEventListener, IBranchEventListener, IXTaskViewer {
+ public static final String EDITOR_ID = "org.eclipse.osee.ats.editor.SMAEditor";
+ private SMAManager smaMgr;
+ private int workFlowPageIndex, taskPageIndex, metricsPageIndex, historyPageIndex, relationPageIndex,
+ attributesPageIndex, detailsPageIndex;
+ private SMAWorkFlowTab workFlowTab;
+ private SMATaskComposite taskComposite;
+ private SMAHistoryComposite historyComposite;
+ private RelationsComposite relationsComposite;
+ private AttributesComposite attributesComposite;
+ private AtsMetricsComposite metricsComposite;
+ private final MultiPageEditorPart editor;
+ public static enum PriviledgedEditMode {
+ Off, CurrentState, Global
+ };
+ private PriviledgedEditMode priviledgedEditMode = PriviledgedEditMode.Off;
+ private Action printAction;
+
+ public SMAEditor() {
+ super();
+ editor = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ if (smaMgr.isHistoricalVersion()) {
+ AWorkbench.popup(
+ "Historical Error",
+ "You can not change a historical version of " + smaMgr.getSma().getArtifactTypeName() + ":\n\n" + smaMgr.getSma());
+ } else if (!smaMgr.isAccessControlWrite()) {
+ AWorkbench.popup(
+ "Authentication Error",
+ "You do not have permissions to save " + smaMgr.getSma().getArtifactTypeName() + ":" + smaMgr.getSma());
+ } else {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ if (getActivePage() == attributesPageIndex) {
+ smaMgr.getSma().persistAttributes(transaction);
+ }
+ // Save widget data to artifact
+ workFlowTab.saveXWidgetToArtifact();
+ smaMgr.getSma().saveSMA(transaction);
+ transaction.execute();
+ workFlowTab.refresh();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ onDirtied();
+ }
+
+ OseeNotificationManager.sendNotifications();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ void enableGlobalPrint() {
+ printAction = new SMAPrint(smaMgr, workFlowTab, taskComposite);
+ getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(), printAction);
+ }
+
+ @Override
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ if (smaMgr != null && !smaMgr.getSma().isDeleted() && smaMgr.getSma().isSMAEditorDirty().isTrue()) {
+ smaMgr.getSma().revertSMA();
+ }
+ workFlowTab.dispose();
+ if (taskComposite != null) {
+ taskComposite.disposeTaskComposite();
+ }
+ if (relationsComposite != null) {
+ relationsComposite.disposeRelationsComposite();
+ }
+ if (metricsComposite != null) metricsComposite.disposeComposite();
+
+ super.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ return isDirtyResult().isTrue();
+ }
+
+ public Result isDirtyResult() {
+ if (smaMgr.getSma().isDeleted()) return Result.FalseResult;
+ try {
+ Result result = workFlowTab.isXWidgetDirty();
+ if (result.isTrue()) return result;
+
+ result = ((StateMachineArtifact) ((SMAEditorInput) getEditorInput()).getArtifact()).isSMAEditorDirty();
+ if (result.isTrue()) return result;
+
+ result = smaMgr.getSma().reportIsDirty(true);
+ return result;
+
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return new Result(true, ex.getLocalizedMessage());
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "SMAEditor - " + smaMgr.getSma().getHumanReadableId() + " - " + smaMgr.getSma().getArtifactTypeName() + " named \"" + smaMgr.getSma().getDescriptiveName() + "\"";
+ }
+
+ @Override
+ protected void createPages() {
+ super.createPages();
+ OseeContributionItem.addTo(this, true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ @Override
+ protected void addPages() {
+
+ IEditorInput editorInput = getEditorInput();
+ StateMachineArtifact sma = null;
+ if (editorInput instanceof SMAEditorInput) {
+ SMAEditorInput aei = (SMAEditorInput) editorInput;
+ if (aei.getArtifact() != null) {
+ if (aei.getArtifact() instanceof StateMachineArtifact)
+ sma = (StateMachineArtifact) aei.getArtifact();
+ else
+ throw new IllegalArgumentException("SMAEditorInput artifact must be StateMachineArtifact");
+ }
+ } else
+ throw new IllegalArgumentException("Editor Input not SMAEditorInput");
+
+ if (sma == null) {
+ MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Open Error",
+ "Can't Find Action in DB");
+ return;
+ }
+ try {
+ smaMgr = new SMAManager(sma, this);
+ smaMgr.setEditor(this);
+
+ OseeEventManager.addListener(this);
+
+ setPartName(smaMgr.getSma().getEditorTitle());
+ setContentDescription(priviledgedEditMode != PriviledgedEditMode.Off ? " PRIVILEGED EDIT MODE ENABLED - " + priviledgedEditMode.name() : "");
+ setTitleImage(smaMgr.getSma().getImage());
+
+ // Create WorkFlow tab
+ try {
+ workFlowTab = new SMAWorkFlowTab(smaMgr);
+ workFlowPageIndex = addPage(workFlowTab);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ // Create Tasks tab
+ if (smaMgr.showTaskTab()) {
+ createTaskTab();
+ }
+
+ createHistoryTab();
+ createRelationsTab();
+ createAttributesTab();
+ createDetailsTab();
+ createMetricsTab();
+
+ setActivePage(workFlowPageIndex);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ enableGlobalPrint();
+ }
+
+ private void createHistoryTab() {
+ try {
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ createToolBar(composite);
+ historyComposite = new SMAHistoryComposite(smaMgr, composite, SWT.NONE);
+ historyPageIndex = addPage(composite);
+ setPageText(historyPageIndex, "History");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createTaskTab() {
+ try {
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ ToolBar toolBar = createToolBar(composite);
+ taskComposite = new SMATaskComposite(this, composite, SWT.NONE, toolBar);
+ taskPageIndex = addPage(composite);
+ setPageText(taskPageIndex, "Tasks");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createDetailsTab() {
+ try {
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ createToolBar(composite);
+ new DetailsBrowserComposite(smaMgr.getSma(), composite, SWT.NONE, null);
+ detailsPageIndex = addPage(composite);
+ setPageText(detailsPageIndex, "Details");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createMetricsTab() {
+ try {
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ createToolBar(composite);
+ metricsComposite = new AtsMetricsComposite(this, composite, SWT.NONE);
+ metricsPageIndex = addPage(composite);
+ setPageText(metricsPageIndex, "Metrics");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ }
+
+ private void createAttributesTab() {
+ try {
+ if (!AtsPlugin.isAtsAdmin()) return;
+
+ // Create Attributes tab
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ ToolBar toolBar = createToolBar(composite);
+
+ ToolItem item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("save.gif"));
+ item.setToolTipText("Save attributes changes only");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ smaMgr.getSma().persistAttributes();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(" NOTE: Changes made on this page MUST be saved through save icon on this page");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ attributesComposite = new AttributesComposite(this, composite, SWT.NONE, smaMgr.getSma());
+ attributesPageIndex = addPage(composite);
+ setPageText(attributesPageIndex, "Attributes");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createRelationsTab() {
+ try {
+ // Create Relations tab
+ Composite composite = AtsLib.createCommonPageComposite(getContainer());
+ ToolBar toolBar = createToolBar(composite);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ final ToolItem showAllRelationsItem = new ToolItem(toolBar, SWT.CHECK);
+ showAllRelationsItem.setImage(AtsPlugin.getInstance().getImage("relate.gif"));
+ showAllRelationsItem.setToolTipText("Shows all relations - AtsAdmin only");
+ showAllRelationsItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (showAllRelationsItem.getSelection()) {
+ relationsComposite.getTreeViewer().removeFilter(userRelationsFilter);
+ relationsComposite.refreshArtifact(smaMgr.getSma());
+ } else {
+ relationsComposite.getTreeViewer().addFilter(userRelationsFilter);
+ }
+ relationsComposite.refresh();
+ }
+ });
+ }
+
+ ToolItem item = new ToolItem(toolBar, SWT.CHECK);
+ item.setImage(AtsPlugin.getInstance().getImage("refresh.gif"));
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ relationsComposite.refreshArtifact(smaMgr.getSma());
+ }
+ });
+
+ relationsComposite = new RelationsComposite(this, composite, SWT.NONE, smaMgr.getSma());
+ relationPageIndex = addPage(composite);
+ setPageText(relationPageIndex, "Relations");
+ // Don't allow users to see all relations
+ relationsComposite.getTreeViewer().addFilter(userRelationsFilter);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ }
+
+ private static List<String> filteredRelationTypeNames =
+ Arrays.asList(AtsRelation.ActionToWorkflow_Action.getTypeName(), AtsRelation.SmaToTask_Sma.getTypeName(),
+ AtsRelation.TeamActionableItem_ActionableItem.getTypeName(),
+ AtsRelation.TeamWorkflowTargetedForVersion_Version.getTypeName(),
+ AtsRelation.TeamLead_Lead.getTypeName(), AtsRelation.TeamMember_Member.getTypeName(),
+ AtsRelation.TeamWorkflowToReview_Review.getTypeName(), AtsRelation.WorkItem__Child.getTypeName(),
+ CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD.getTypeName(),
+ CoreRelationEnumeration.Users_Artifact.getTypeName());
+
+ private static ViewerFilter userRelationsFilter = new ViewerFilter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (element instanceof RelationType) {
+ return !filteredRelationTypeNames.contains(((RelationType) element).getTypeName());
+ }
+ return true;
+ }
+ };
+
+ private ToolBar createToolBar(Composite parent) {
+ ToolBar toolBar = AtsLib.createCommonToolBar(parent);
+ SkynetGuiPlugin skynetGuiPlugin = SkynetGuiPlugin.getInstance();
+ ToolItem item;
+
+ OseeAts.addButtonToEditorToolBar(this, SkynetGuiPlugin.getInstance(), toolBar, EDITOR_ID, "ATS Editor");
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(skynetGuiPlugin.getImage("edit.gif"));
+ item.setToolTipText("Show this artifact in the Resource History");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ RevisionHistoryView.open(smaMgr.getSma());
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.SEPARATOR);
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("authenticated.gif"));
+ item.setToolTipText("Access Control");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ PolicyDialog pd = new PolicyDialog(Display.getCurrent().getActiveShell(), smaMgr.getSma());
+ pd.open();
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("dirty.gif"));
+ item.setToolTipText("Show what attribute or relation making editor dirty.");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ Result result = smaMgr.getEditor().isDirtyResult();
+ AWorkbench.popup("Dirty Report", result.isFalse() ? "Not Dirty" : "Dirty -> " + result.getText());
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.SEPARATOR);
+
+ Text artifactInfoLabel = new Text(toolBar.getParent(), SWT.END);
+ artifactInfoLabel.setEditable(false);
+ artifactInfoLabel.setText("Type: \"" + smaMgr.getSma().getArtifactTypeName() + "\" HRID: " + smaMgr.getSma().getHumanReadableId());
+ artifactInfoLabel.setToolTipText("The human readable id and database id for this artifact");
+
+ return toolBar;
+ }
+
+ public void refreshPages() throws OseeCoreException {
+ if (getContainer() == null || getContainer().isDisposed()) return;
+ setTitleImage(smaMgr.getSma().getImage());
+ if (workFlowTab != null) workFlowTab.refresh();
+ if (historyComposite != null) historyComposite.refresh();
+ if (relationsComposite != null) relationsComposite.refreshArtifact(smaMgr.getSma());
+ if (attributesComposite != null) attributesComposite.refreshArtifact(smaMgr.getSma());
+ smaMgr.getEditor().onDirtied();
+ }
+
+ public static void editArtifact(Artifact artifact) {
+ if (artifact.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ }
+ if (artifact instanceof StateMachineArtifact)
+ editArtifact((StateMachineArtifact) artifact);
+ else
+ ArtifactEditor.editArtifact(artifact);
+ }
+
+ public static void editArtifact(final StateMachineArtifact sma) {
+ if (sma.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(new SMAEditorInput(sma), EDITOR_ID);
+ VisitedItems.addVisited(sma);
+ } catch (PartInitException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ }
+
+ @Override
+ public void onDirtied() {
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+
+ public static void close(StateMachineArtifact artifact, boolean save) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorReference editors[] = page.getEditorReferences();
+ for (int j = 0; j < editors.length; j++) {
+ IEditorReference editor = editors[j];
+ if (editor.getPart(false) instanceof SMAEditor) {
+ if (((SMAEditor) editor.getPart(false)).getSmaMgr().getSma().equals(artifact)) {
+ ((SMAEditor) editor.getPart(false)).closeEditor();
+ }
+ }
+ }
+ }
+
+ public void closeEditor() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ AWorkbench.getActivePage().closeEditor(editor, false);
+ }
+ });
+ }
+
+ /**
+ * @return Returns the smaMgr.
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getCurrentStateName()
+ */
+ public String getCurrentStateName() throws OseeCoreException {
+ return smaMgr.getStateMgr().getCurrentStateName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getEditor()
+ */
+ public IDirtiableEditor getEditor() throws OseeCoreException {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getParentSmaMgr()
+ */
+ public SMAManager getParentSmaMgr() throws OseeCoreException {
+ return smaMgr;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTabName()
+ */
+ public String getTabName() throws OseeCoreException {
+ return "Tasks";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTaskArtifacts(java.lang.String)
+ */
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws OseeCoreException {
+ if (stateName == null || stateName.equals(""))
+ return smaMgr.getTaskMgr().getTaskArtifacts();
+ else
+ return smaMgr.getTaskMgr().getTaskArtifacts(stateName);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isTaskable()
+ */
+ public boolean isTaskable() throws OseeCoreException {
+ return smaMgr.isTaskable();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isEditable()
+ */
+ public boolean isTasksEditable() throws OseeCoreException {
+ return smaMgr.getSma().isTaskable();
+ }
+
+ /**
+ * @return the priviledgedEditMode
+ */
+ public PriviledgedEditMode getPriviledgedEditMode() {
+ return priviledgedEditMode;
+ }
+
+ /**
+ * @param priviledgedEditMode the priviledgedEditMode to set s * @throws OseeCoreException
+ */
+ public void setPriviledgedEditMode(PriviledgedEditMode priviledgedEditMode) throws OseeCoreException {
+ this.priviledgedEditMode = priviledgedEditMode;
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ smaMgr.getSma().saveSMA(transaction);
+ transaction.execute();
+ workFlowTab.refresh();
+ }
+
+ /**
+ * @return the isAccessControlWrite
+ * @throws OseeCoreException
+ */
+ public boolean isAccessControlWrite() throws OseeCoreException {
+ return AccessControlManager.getInstance().checkCurrentUserObjectPermission(smaMgr.getSma(), PermissionEnum.WRITE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, org.eclipse.osee.framework.skynet.core.artifact.Branch, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ try {
+ if (smaMgr.isInTransition()) return;
+ if (branchModType == BranchEventType.Added || branchModType == BranchEventType.Deleted || branchModType == BranchEventType.Committed) {
+ if (smaMgr.getBranchMgr().getBranchId() == null || smaMgr.getBranchMgr().getBranchId() != branchId) {
+ return;
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (getContainer() == null || getContainer().isDisposed()) return;
+ try {
+ refreshPages();
+ onDirtied();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.TransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (smaMgr.isInTransition()) return;
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ if (transData.isDeleted(smaMgr.getSma())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ closeEditor();
+ }
+ });
+ } else if (transData.isHasEvent(smaMgr.getSma())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ refreshPages();
+ onDirtied();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ });
+ } else if (smaMgr.getReviewManager().hasReviews()) {
+ try {
+ // If related review has made a change, redraw
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviews()) {
+ if (transData.isHasEvent(reviewArt)) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ refreshPages();
+ onDirtied();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ });
+ }
+ }
+ } catch (Exception ex) {
+ // do nothings
+ }
+ }
+ onDirtied();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener#handleArtifactsPurgedEvent(org.eclipse.osee.framework.skynet.core.event.Sender, java.util.Collection, java.util.Collection)
+ */
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().contains(smaMgr.getSma())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ closeEditor();
+ }
+ });
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.event.IRelationModifiedEventListener#handleRelationModifiedEvent(org.eclipse.osee.framework.skynet.core.event.Sender, org.eclipse.osee.framework.skynet.core.relation.RelationModType, org.eclipse.osee.framework.skynet.core.relation.RelationLink, org.eclipse.osee.framework.skynet.core.artifact.Branch, java.lang.String)
+ */
+ @Override
+ public void handleRelationModifiedEvent(Sender sender, RelationModType relationModType, RelationLink link, Branch branch, String relationType) {
+ try {
+ if (link.getArtifactA().equals(smaMgr.getSma()) || link.getArtifactB().equals(smaMgr.getSma())) {
+ onDirtied();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ats.IActionable#getActionDescription()
+ */
+ @Override
+ public String getActionDescription() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getMetricsArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getMetricsArtifacts() throws OseeCoreException {
+ return Arrays.asList(smaMgr.getSma());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getMetricsVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getMetricsVersionArtifact() throws OseeCoreException {
+ return smaMgr.getSma().getWorldViewTargetedVersion();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#handleRefreshAction()
+ */
+ @Override
+ public void handleRefreshAction() throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isRefreshActionHandled()
+ */
+ @Override
+ public boolean isRefreshActionHandled() throws OseeCoreException {
+ return false;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java
new file mode 100644
index 00000000000..0ce8757acdc
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAEditorInput implements IEditorInput {
+
+ protected Artifact artifact;
+
+ public SMAEditorInput(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public boolean equals(Object obj) {
+ boolean equals = false;
+ if (obj instanceof SMAEditorInput) {
+ SMAEditorInput otherEdInput = (SMAEditorInput) obj;
+
+ equals = (artifact == otherEdInput.artifact);
+ }
+ return equals;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ public boolean exists() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ public String getName() {
+ if (artifact == null) {
+ return "No Artifact Input Provided";
+ }
+ return artifact.getVersionedName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ /**
+ * @param artifact the artifact to set
+ */
+ public void setArtifact(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAHistoryComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAHistoryComposite.java
new file mode 100644
index 00000000000..5def4d7aa7b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAHistoryComposite.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultsComposite;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAHistoryComposite extends Composite {
+
+ private final XResultsComposite xResultsComp;
+ private final SMAManager smaMgr;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public SMAHistoryComposite(SMAManager smaMgr, Composite parent, int style) throws OseeCoreException {
+ super(parent, style);
+ this.smaMgr = smaMgr;
+
+ xResultsComp = new XResultsComposite(this, SWT.BORDER);
+ xResultsComp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 500;
+ xResultsComp.setLayoutData(gd);
+ xResultsComp.setHtmlText(smaMgr.getLog().getHtml(true), smaMgr.getSma().getArtifactTypeName() + " History");
+
+ Label button = new Label(this, SWT.NONE);
+ button.setText(" ");
+ final SMAManager fSmaMgr = smaMgr;
+ button.addListener(SWT.MouseUp, new Listener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ @Override
+ public void handleEvent(Event event) {
+ ArtifactEditor.editArtifact(fSmaMgr.getSma());
+ }
+ });
+ }
+
+ public void refresh() throws OseeCoreException {
+ if (xResultsComp != null && !xResultsComp.isDisposed()) {
+ xResultsComp.setHtmlText(smaMgr.getLog().getHtml(true), smaMgr.getSma().getArtifactTypeName() + " History");
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java
new file mode 100644
index 00000000000..a1b025ea8f0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java
@@ -0,0 +1,940 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ATSLog;
+import org.eclipse.osee.ats.artifact.ATSNote;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.TaskArtifact.TaskStates;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.util.AtsNotifyUsers;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.DeadlineManager;
+import org.eclipse.osee.ats.util.StateManager;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+import org.eclipse.osee.ats.util.widgets.TaskManager;
+import org.eclipse.osee.ats.util.widgets.dialog.AtsPriorityDialog;
+import org.eclipse.osee.ats.util.widgets.dialog.SMAStatusDialog;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskOptionStatusDialog;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.ats.util.widgets.dialog.VersionListDialog;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.access.AccessControlManager;
+import org.eclipse.osee.framework.skynet.core.access.PermissionEnum;
+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.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
+import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ChangeTypeDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.DateSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserCheckTreeDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAManager {
+
+ private final StateMachineArtifact sma;
+ private Collection<User> transitionAssignees;
+ private static String SEPERATOR = "; ";
+ private final TaskManager taskMgr;
+ private final ReviewManager reviewMgr;
+ private final AtsBranchManager branchMgr;
+ private final StateManager stateMgr;
+ private final DeadlineManager deadlineMgr;
+ private SMAEditor editor;
+ private final ATSLog atsLog;
+ private final ATSNote atsNote;
+ private static final AtsStateItems stateItems = new AtsStateItems();
+ private boolean inTransition = false;
+
+ public SMAManager(StateMachineArtifact sma, SMAEditor editor) {
+ super();
+ this.sma = sma;
+ this.editor = editor;
+ stateMgr = new StateManager(this);
+ reviewMgr = new ReviewManager(this);
+ taskMgr = new TaskManager(this);
+ branchMgr = new AtsBranchManager(this);
+ deadlineMgr = new DeadlineManager(this);
+ atsLog = new ATSLog(sma);
+ atsNote = new ATSNote(sma);
+ }
+
+ public SMAManager(StateMachineArtifact sma) {
+ this(sma, null);
+ }
+
+ public void closeEditors(boolean save) {
+ SMAEditor.close(sma, save);
+ }
+
+ public Set<User> getPrivilegedUsers() throws OseeCoreException {
+ return sma.getPrivilegedUsers();
+ }
+
+ public ATSLog getLog() {
+ return atsLog;
+ }
+
+ public ATSNote getNotes() {
+ return atsNote;
+ }
+
+ public String getEditorHeaderString() throws OseeCoreException {
+ if (sma instanceof TeamWorkFlowArtifact)
+ return String.format("Current State: %s Team: %s Created: %s", stateMgr.getCurrentStateName(),
+ ((TeamWorkFlowArtifact) sma).getTeamName(), XDate.getDateStr(atsLog.getCreationDate(), XDate.MMDDYYHHMM));
+ else
+ return String.format("Current State: %s Created: %s", stateMgr.getCurrentStateName(), XDate.getDateStr(
+ atsLog.getCreationDate(), XDate.MMDDYYHHMM));
+ }
+
+ public Result getUserInputNeeded() {
+ return Result.FalseResult;
+ }
+
+ public WorkPageDefinition getWorkPageDefinition() throws OseeCoreException {
+ if (getStateMgr().getCurrentStateName() == null) return null;
+ return sma.getWorkFlowDefinition().getWorkPageDefinitionByName(getStateMgr().getCurrentStateName());
+ }
+
+ public WorkPageDefinition getWorkPageDefinitionByName(String name) throws OseeCoreException {
+ return sma.getWorkFlowDefinition().getWorkPageDefinitionByName(name);
+ }
+
+ public WorkPageDefinition getWorkPageDefinitionById(String id) throws OseeCoreException {
+ return sma.getWorkFlowDefinition().getWorkPageDefinitionById(id);
+ }
+
+ public boolean isHistoricalVersion() {
+ return sma.isHistorical();
+ }
+
+ public List<WorkPageDefinition> getToWorkPages() throws OseeCoreException {
+ return getWorkFlowDefinition().getToPages(getWorkPageDefinition());
+ }
+
+ public List<WorkPageDefinition> getReturnPages() throws OseeCoreException {
+ return getWorkFlowDefinition().getReturnPages(getWorkPageDefinition());
+ }
+
+ public boolean isReturnPage(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return getWorkFlowDefinition().isReturnPage(getWorkPageDefinition(), workPageDefinition);
+ }
+
+ public boolean isAccessControlWrite() throws OseeCoreException {
+ return AccessControlManager.getInstance().checkCurrentUserObjectPermission(sma, PermissionEnum.WRITE);
+ }
+
+ public User getOriginator() throws OseeCoreException {
+ return atsLog.getOriginator();
+ }
+
+ public void setOriginator(User user) throws OseeCoreException {
+ atsLog.addLog(LogType.Originated, "", "Changed by " + UserManager.getUser().getName(), user);
+ }
+
+ /**
+ * @return true if this is a TeamWorkflow and it uses versions
+ */
+ public boolean isTeamUsesVersions() {
+ if (!(getSma() instanceof TeamWorkFlowArtifact)) return false;
+ try {
+ return ((TeamWorkFlowArtifact) getSma()).getTeamDefinition().isTeamUsesVersions();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return false;
+ }
+ }
+
+ /**
+ * Return true if sma is TeamWorkflowArtifact and it's TeamDefinitionArtifact has rule set
+ *
+ * @param ruleId
+ * @return if has rule
+ * @throws OseeCoreException
+ * @throws
+ */
+ public boolean teamDefHasWorkRule(String ruleId) throws OseeCoreException {
+ if (!(getSma() instanceof TeamWorkFlowArtifact)) return false;
+ try {
+ return ((TeamWorkFlowArtifact) getSma()).getTeamDefinition().hasWorkRule(ruleId);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return false;
+ }
+ }
+
+ public boolean workPageHasWorkRule(String ruleId) throws OseeCoreException {
+ return getWorkPageDefinition().hasWorkRule(AtsWorkDefinitions.RuleWorkItemId.atsRequireTargetedVersion.name());
+ }
+
+ public Collection<WorkRuleDefinition> getWorkRulesStartsWith(String ruleId) throws OseeCoreException {
+ Set<WorkRuleDefinition> workRules = new HashSet<WorkRuleDefinition>();
+ if (ruleId == null || ruleId.equals("")) return workRules;
+ if (getSma() instanceof TeamWorkFlowArtifact) {
+ // Get rules from team definition
+ workRules.addAll(((TeamWorkFlowArtifact) getSma()).getTeamDefinition().getWorkRulesStartsWith(ruleId));
+ }
+ // Get work rules from workflow
+ WorkFlowDefinition workFlowDefinition = getWorkFlowDefinition();
+ if (workFlowDefinition != null) {
+ // Get rules from workflow definitions
+ workRules.addAll(getWorkFlowDefinition().getWorkRulesStartsWith(ruleId));
+ }
+ // Add work rules from page
+ for (WorkItemDefinition wid : getWorkPageDefinition().getWorkItems(false)) {
+ if (!wid.getId().equals("") && wid.getId().startsWith(ruleId)) {
+ workRules.add((WorkRuleDefinition) wid);
+ }
+ }
+ return workRules;
+ }
+
+ /**
+ * @return true if this is a TeamWorkflow and the version it's been targeted for has been released
+ */
+ public boolean isReleased() {
+ try {
+ VersionArtifact verArt = getTargetedForVersion();
+ if (verArt != null) return verArt.isReleased();
+ } catch (Exception ex) {
+ // Do Nothing
+ }
+ return false;
+ }
+
+ public VersionArtifact getTargetedForVersion() throws OseeCoreException {
+ return sma.getWorldViewTargetedVersion();
+ }
+
+ public boolean promptChangeAssignees() throws OseeCoreException {
+ return promptChangeAssignees(Arrays.asList(sma));
+ }
+
+ public static boolean promptChangeAssignees(final Collection<? extends StateMachineArtifact> smas) throws OseeCoreException {
+ for (StateMachineArtifact sma : smas) {
+ SMAManager smaMgr = new SMAManager(sma);
+ if (smaMgr.isCompleted()) {
+ AWorkbench.popup("ERROR",
+ "Can't assign completed " + sma.getArtifactTypeName() + " (" + sma.getHumanReadableId() + ")");
+ return false;
+ } else if (smaMgr.isCancelled()) {
+ AWorkbench.popup("ERROR",
+ "Can't assign cancelled " + sma.getArtifactTypeName() + " (" + sma.getHumanReadableId() + ")");
+ return false;
+ }
+ }
+ UserCheckTreeDialog uld = new UserCheckTreeDialog(Display.getCurrent().getActiveShell());
+ uld.setMessage("Select to assign.\nDeSelect to un-assign.");
+ if (smas.size() == 1) {
+ SMAManager smaMgr = new SMAManager(smas.iterator().next());
+ uld.setInitialSelections(smaMgr.getStateMgr().getAssignees());
+ }
+ if (uld.open() != 0) return false;
+ Collection<User> users = uld.getUsersSelected();
+ if (users.size() == 0) {
+ AWorkbench.popup("ERROR", "Must have at least one assignee");
+ return false;
+ }
+ // As a convenience, remove the UnAssigned user if another user is selected
+ if (users.size() > 1) {
+ users.remove(UserManager.getUser(SystemUser.UnAssigned));
+ }
+ for (StateMachineArtifact sma : smas) {
+ sma.getSmaMgr().getStateMgr().setAssignees(users);
+ }
+ return true;
+ }
+
+ public boolean promptChangeOriginator() throws OseeCoreException {
+ return promptChangeOriginator(Arrays.asList(sma));
+ }
+
+ public static boolean promptChangeOriginator(final Collection<? extends StateMachineArtifact> smas) throws OseeCoreException {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New Originator");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = ld.getSelection();
+ for (StateMachineArtifact sma : smas) {
+ SMAManager smaMgr = new SMAManager(sma);
+ smaMgr.setOriginator(selectedUser);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean promptChangeVersion(VersionReleaseType versionReleaseType, boolean persist) throws OseeCoreException {
+ return promptChangeVersion(Arrays.asList((TeamWorkFlowArtifact) sma), versionReleaseType, persist);
+ }
+
+ public static boolean promptChangeVersion(final Collection<? extends TeamWorkFlowArtifact> smas, VersionReleaseType versionReleaseType, final boolean persist) throws OseeCoreException {
+ TeamDefinitionArtifact teamDefHoldingVersions = null;
+ for (TeamWorkFlowArtifact teamArt : smas) {
+ SMAManager smaMgr = new SMAManager(teamArt);
+ if (!teamArt.getTeamDefinition().isTeamUsesVersions()) {
+ AWorkbench.popup("ERROR",
+ "Team \"" + teamArt.getTeamDefinition().getDescriptiveName() + "\" doesn't use versions.");
+ return false;
+ }
+ if (smaMgr.isReleased()) {
+ String error = "Team Workflow\n \"" + teamArt.getDescriptiveName() + "\"\n is already released.";
+ if (AtsPlugin.isAtsAdmin() && !MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),
+ "Change Version", error + "\n\nOverride?")) {
+ return false;
+ } else if (!AtsPlugin.isAtsAdmin()) AWorkbench.popup("ERROR", error);
+ }
+ if (teamDefHoldingVersions != null) {
+ if (teamDefHoldingVersions != teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions()) {
+ AWorkbench.popup("ERROR", "Can't change version on Workflows that have different release version sets.");
+ return false;
+ }
+ }
+ if (teamDefHoldingVersions == null) teamDefHoldingVersions =
+ teamArt.getTeamDefinition().getTeamDefinitionHoldingVersions();
+ }
+ if (teamDefHoldingVersions == null) {
+ AWorkbench.popup("ERROR", "No versions configured for impacted team(s).");
+ return false;
+ }
+ final VersionListDialog vld =
+ new VersionListDialog("Select Version", "Select Version",
+ teamDefHoldingVersions.getVersionsArtifacts(versionReleaseType));
+ if (smas.size() == 1 && smas.iterator().next().getWorldViewTargetedVersion() != null) {
+ Object[] objs = new Object[1];
+ objs[0] = smas.iterator().next().getWorldViewTargetedVersion();
+ vld.setInitialSelections(objs);
+ }
+ int result = vld.open();
+ if (result != 0) {
+ return false;
+ }
+ Object obj = vld.getResult()[0];
+ VersionArtifact newVersion = (VersionArtifact) obj;
+ for (TeamWorkFlowArtifact teamArt : smas) {
+ teamArt.setSoleRelation(AtsRelation.TeamWorkflowTargetedForVersion_Version, newVersion);
+ }
+ if (persist) {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (TeamWorkFlowArtifact teamArt : smas) {
+ teamArt.persistRelations(transaction);
+ }
+ transaction.execute();
+ }
+ return true;
+ }
+
+ public boolean promptChangeType(boolean persist) {
+ if (sma instanceof TeamWorkFlowArtifact) return promptChangeType(Arrays.asList((TeamWorkFlowArtifact) sma),
+ persist);
+ return false;
+ }
+
+ public static boolean promptChangeType(final Collection<? extends TeamWorkFlowArtifact> teams, boolean persist) {
+
+ for (TeamWorkFlowArtifact team : teams) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (smaMgr.isReleased()) {
+ AWorkbench.popup("ERROR", "Team Workflow\n \"" + team.getDescriptiveName() + "\"\n is already released.");
+ return false;
+ }
+ }
+ final ChangeTypeDialog dialog = new ChangeTypeDialog(Display.getCurrent().getActiveShell());
+ try {
+ if (teams.size() == 1) {
+ dialog.setSelected(teams.iterator().next().getChangeType());
+ }
+ if (dialog.open() == 0) {
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+
+ for (TeamWorkFlowArtifact team : teams) {
+ if (team.getChangeType() != dialog.getSelection()) {
+ team.setChangeType(dialog.getSelection());
+ team.saveSMA(transaction);
+ }
+ }
+ transaction.execute();
+ }
+ return true;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't change priority", ex, true);
+ return false;
+ }
+ }
+
+ public boolean promptChangePriority(boolean persist) {
+ if (sma instanceof TeamWorkFlowArtifact) return promptChangePriority(Arrays.asList((TeamWorkFlowArtifact) sma),
+ persist);
+ return false;
+ }
+
+ public static boolean promptChangePriority(final Collection<? extends TeamWorkFlowArtifact> teams, boolean persist) {
+
+ for (TeamWorkFlowArtifact team : teams) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (smaMgr.isReleased()) {
+ AWorkbench.popup("ERROR", "Team Workflow\n \"" + team.getDescriptiveName() + "\"\n is already released.");
+ return false;
+ }
+ }
+ final AtsPriorityDialog ald = new AtsPriorityDialog(Display.getCurrent().getActiveShell());
+ try {
+ if (teams.size() == 1) {
+ ald.setSelected(teams.iterator().next().getPriority());
+ }
+ if (ald.open() == 0) {
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (TeamWorkFlowArtifact team : teams) {
+ if (team.getPriority() != ald.getSelection()) {
+ team.setPriority(ald.getSelection());
+ team.saveSMA(transaction);
+ }
+ }
+ transaction.execute();
+ }
+ return true;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't change priority", ex, true);
+ return false;
+ }
+ }
+
+ public boolean promptChangeStatus(boolean persist) throws OseeCoreException {
+ return promptChangeStatus(Arrays.asList(sma), persist);
+ }
+
+ public static boolean promptChangeStatus(final Collection<? extends StateMachineArtifact> smas, boolean persist) throws OseeCoreException {
+ try {
+ // If task status is being changed, make sure tasks belong to current state
+ for (StateMachineArtifact sma : smas) {
+ if (sma instanceof TaskArtifact) {
+ if (!((TaskArtifact) sma).getWorldViewRelatedToState().equals(
+ ((TaskArtifact) sma).getParentSMA().getSmaMgr().getStateMgr().getCurrentStateName())) {
+ AWorkbench.popup(
+ "ERROR",
+ String.format(
+ "Task work must be done in \"Related to State\" of parent workflow for Task titled: \"%s\".\n\nTask work configured to be done in parent's \"%s\" state.\nParent workflow in \"%s\" state.\n\nEither transition parent workflow or change Task's \"Related to State\".",
+ sma.getDescriptiveName(), ((TaskArtifact) sma).getWorldViewRelatedToState(),
+ ((TaskArtifact) sma).getParentSMA().getSmaMgr().getStateMgr().getCurrentStateName()));
+ return false;
+ }
+ }
+ }
+ // Access resolution options if object is task
+ List<TaskResOptionDefinition> options = null;
+ if (smas.iterator().next() instanceof TaskArtifact) {
+ if (((TaskArtifact) smas.iterator().next()).isUsingTaskResolutionOptions()) {
+ options = ((TaskArtifact) smas.iterator().next()).getTaskResolutionOptionDefintions();
+ }
+ }
+ for (StateMachineArtifact sma : smas) {
+ SMAManager smaMgr = new SMAManager(sma);
+ if (smaMgr.isReleased()) {
+ AWorkbench.popup("ERROR",
+ sma.getArtifactTypeName() + " \"" + sma.getDescriptiveName() + "\"\n is already released.");
+ return false;
+ }
+ }
+ if (options != null) {
+ TaskOptionStatusDialog tsd =
+ new TaskOptionStatusDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Enter State Status",
+ "Select resolution, enter percent complete and number of hours you spent since last status.",
+ true, options, smas);
+ int result = tsd.open();
+ if (result == 0) {
+ double hours = tsd.getHours().getFloat();
+ if (tsd.isSplitHours()) {
+ hours = hours / smas.size();
+ }
+ for (StateMachineArtifact sma : smas) {
+ sma.getSmaMgr().getStateMgr().updateMetrics(hours, tsd.getPercent().getInt(), true);
+ sma.setSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(),
+ tsd.getSelectedOptionDef().getName());
+ sma.statusChanged();
+ }
+ return true;
+ }
+ } else {
+ SMAStatusDialog tsd =
+ new SMAStatusDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Enter State Status",
+ "Enter percent complete and number of hours you spent since last status.", true, smas);
+ int result = tsd.open();
+ if (result == 0) {
+ double hours = tsd.getHours().getFloat();
+ if (tsd.isSplitHours()) {
+ hours = hours / smas.size();
+ }
+ for (StateMachineArtifact sma : smas) {
+ sma.getSmaMgr().getStateMgr().updateMetrics(hours, tsd.getPercent().getInt(), true);
+ sma.statusChanged();
+ }
+ return true;
+ }
+ }
+ } catch (OseeStateException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ return false;
+ }
+
+ public boolean promptChangeFloatAttribute(ATSAttributes atsAttr, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeFloatAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(sma), persist);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeIntegerAttribute(ATSAttributes atsAttr, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeIntegerAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(sma), persist);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangePercentAttribute(ATSAttributes atsAttr, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangePercentAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeBoolean(ATSAttributes atsAttr, String toggleMessage, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeBoolean(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(sma), toggleMessage, persist);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public static boolean promptChangeAttribute(ATSAttributes atsAttr, final Collection<? extends StateMachineArtifact> smas, boolean persist, boolean multiLine) throws OseeCoreException {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(), null,
+ smas, persist, multiLine);
+ }
+
+ public static boolean promptChangeAttribute(ATSAttributes atsAttr, final Artifact sma, boolean persist, boolean multiLine) {
+ try {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist, multiLine);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeAttribute(ATSAttributes atsAttr, final boolean persist, boolean multiLine) {
+ try {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(sma), persist, multiLine);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeDate(ATSAttributes atsAttr, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeDate(atsAttr.getStoreName(), atsAttr.getDisplayName(), sma, persist);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class,
+ "Can't save " + atsAttr.getDisplayName() + " date to artifact " + sma.getHumanReadableId(), ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeReleaseDate() {
+ if (isReleased()) {
+ AWorkbench.popup("ERROR", "Team Workflow\n \"" + sma.getDescriptiveName() + "\"\n is already released.");
+ return false;
+ }
+ try {
+ VersionArtifact verArt = getTargetedForVersion();
+ if (verArt != null) {
+ // prompt that this object is assigned to a version that is targeted
+ // for release xxx - want to change?
+ DateSelectionDialog diag =
+ new DateSelectionDialog(
+ "Select Release Date Date",
+ "Warning: " + sma.getArtifactTypeName() + "'s release date is handled\n" + "by targeted for version \"" + verArt.getDescriptiveName() + "\"\n" + "changing the date here will change the\n" + "date for this entire release.\n\nSelect date to change.\n",
+ verArt.getReleaseDate());
+ if (verArt.getReleaseDate() != null) diag.setSelectedDate(verArt.getReleaseDate());
+ if (diag.open() == 0) {
+ verArt.setSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), diag.getSelectedDate());
+ verArt.persistAttributes();
+ return true;
+ }
+ } else {
+ // prompt that current release is (get from attribute) - want to change?
+ DateSelectionDialog diag =
+ new DateSelectionDialog("Select Release Date", "Select Release Date", sma.getWorldViewReleaseDate());
+ if (getSma().getWorldViewReleaseDate() != null) diag.setSelectedDate(sma.getWorldViewReleaseDate());
+ if (diag.open() == 0) {
+ sma.setSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), diag.getSelectedDate());
+ sma.persistAttributes();
+ return true;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't save release date " + sma.getHumanReadableId(), ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeEstimatedReleaseDate() {
+ try {
+ VersionArtifact verArt = getTargetedForVersion();
+ if (verArt != null) {
+ // prompt that this object is assigned to a version that is targeted for release xxx -
+ // want to change?
+ DateSelectionDialog diag =
+ new DateSelectionDialog(
+ "Select Estimated Release Date Date",
+ "Warning: " + sma.getArtifactTypeName() + "'s estimated release date is handled\n" + "by targeted for version \"" + verArt.getDescriptiveName() + "\"\n" + "changing the date here will change the\n" + "date for this entire release.\n\nSelect date to change.\n",
+ verArt.getEstimatedReleaseDate());
+ if (verArt.getEstimatedReleaseDate() != null) diag.setSelectedDate(verArt.getEstimatedReleaseDate());
+ if (diag.open() == 0) {
+ verArt.setSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(),
+ diag.getSelectedDate());
+ verArt.persistAttributes();
+ return true;
+ }
+ } else {
+ // prompt that current est release is (get from attribute); want to
+ // change
+ DateSelectionDialog diag =
+ new DateSelectionDialog("Select Estimate Release Date", "Select Estimated Release Date",
+ sma.getWorldViewEstimatedReleaseDate());
+ if (getSma().getWorldViewEstimatedReleaseDate() != null) diag.setSelectedDate(sma.getWorldViewEstimatedReleaseDate());
+ if (diag.open() == 0) {
+ sma.setSoleAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(),
+ diag.getSelectedDate());
+ sma.persistAttributes();
+ return true;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't save est release date " + sma.getHumanReadableId(), ex, true);
+ }
+ return false;
+ }
+
+ public WorkFlowDefinition getWorkFlowDefinition() throws OseeCoreException {
+ return sma.getWorkFlowDefinition();
+ }
+
+ public boolean isCompleted() throws OseeCoreException {
+ return (stateMgr.getCurrentStateName().equals(DefaultTeamState.Completed.name()));
+ }
+
+ public boolean isCancelled() throws OseeCoreException {
+ return (stateMgr.getCurrentStateName().equals(DefaultTeamState.Cancelled.name()));
+ }
+
+ public boolean isCancelledOrCompleted() throws OseeCoreException {
+ return isCompleted() || isCancelled();
+ }
+
+ public boolean isCurrentSectionExpanded(String stateName) throws OseeCoreException {
+ return sma.isCurrentSectionExpanded(stateName);
+ }
+
+ public boolean isCurrentState(String stateName) throws OseeCoreException {
+ return stateName.equals(stateMgr.getCurrentStateName());
+ }
+
+ public void setTransitionAssignees(Collection<User> assignees) throws OseeCoreException {
+ if (assignees.contains(UserManager.getUser(SystemUser.NoOne)) || assignees.contains(UserManager.getUser(SystemUser.Guest))) {
+ throw new OseeArgumentException("Can not assign workflow to NoOne or Guest");
+ }
+ if (assignees.size() > 1 && assignees.contains(UserManager.getUser(SystemUser.UnAssigned))) {
+ throw new OseeArgumentException("Can not assign to user and UnAssigned");
+ }
+ transitionAssignees = assignees;
+ }
+
+ public boolean isAssigneeMe() throws OseeCoreException {
+ return stateMgr.getAssignees().contains(UserManager.getUser());
+ }
+
+ public Collection<User> getTransitionAssignees() throws OseeCoreException {
+ if (transitionAssignees != null) {
+ if (transitionAssignees.size() > 0 && transitionAssignees.contains(UserManager.getUser(SystemUser.UnAssigned))) {
+ transitionAssignees.remove(transitionAssignees.contains(UserManager.getUser(SystemUser.UnAssigned)));
+ }
+ if (transitionAssignees.size() > 0) {
+ return transitionAssignees;
+ }
+ }
+ return stateMgr.getAssignees();
+ }
+
+ public String getTransitionAssigneesStr() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (User u : getTransitionAssignees()) {
+ sb.append(u.getName() + SEPERATOR);
+ }
+ return sb.toString().replaceFirst(SEPERATOR + "$", "");
+ }
+
+ public String getAssigneesWasIsStr() throws OseeCoreException {
+ if (isCompleted() || isCancelled()) return "(" + Artifacts.toString("; ",
+ stateMgr.getAssignees(TaskStates.InWork.name())) + ")";
+ return Artifacts.toString("; ", stateMgr.getAssignees());
+ }
+
+ public Image getAssigneeImage() throws OseeCoreException {
+ return getSma().getAssigneeImage();
+ }
+
+ /**
+ * @return Returns the sma.
+ */
+ public StateMachineArtifact getSma() {
+ return sma;
+ }
+
+ /**
+ * @return true if SMA is allowed to have tasks
+ * @throws OseeCoreException
+ */
+ public boolean isTaskable() throws OseeCoreException {
+ return sma.isTaskable();
+ }
+
+ public boolean showTaskTab() throws OseeCoreException {
+ return sma.showTaskTab();
+ }
+
+ /**
+ * @return Returns the taskMgr.
+ */
+ public TaskManager getTaskMgr() {
+ return taskMgr;
+ }
+
+ public Result transition(String toStateName, User toAssignee, boolean persist, SkynetTransaction transaction) {
+ List<User> users = new ArrayList<User>();
+ if (toAssignee != null && !toStateName.equals(DefaultTeamState.Completed.name()) && !toStateName.equals(DefaultTeamState.Cancelled.name())) users.add(toAssignee);
+ return transition(toStateName, users, persist, false, transaction);
+ }
+
+ public Result transitionToCancelled(String reason, boolean persist, SkynetTransaction transaction) {
+ Result result =
+ transition(DefaultTeamState.Cancelled.name(), Arrays.asList(new User[] {}), persist, reason, false,
+ transaction);
+ return result;
+ }
+
+ public Result transition(String toStateName, Collection<User> toAssignees, boolean persist, boolean overrideTransitionCheck, SkynetTransaction transaction) {
+ return transition(toStateName, toAssignees, persist, null, overrideTransitionCheck, transaction);
+ }
+
+ private Result transition(final String toStateName, final Collection<User> toAssignees, final boolean persist, final String cancelReason, boolean overrideTransitionCheck, SkynetTransaction transaction) {
+ try {
+ // Validate assignees
+ if (getStateMgr().getAssignees().contains(UserManager.getUser(SystemUser.NoOne)) || getStateMgr().getAssignees().contains(
+ UserManager.getUser(SystemUser.Guest)) || getStateMgr().getAssignees().contains(
+ UserManager.getUser(SystemUser.UnAssigned))) {
+ return new Result("Can not transition with \"Guest\", \"UnAssigned\" or \"NoOne\" user as assignee.");
+ }
+
+ // Validate toState name
+ final WorkPageDefinition fromWorkPageDefinition = getWorkPageDefinition();
+ final WorkPageDefinition toWorkPageDefinition = getWorkPageDefinitionByName(toStateName);
+ if (toWorkPageDefinition == null) return new Result("Invalid toState \"" + toStateName + "\"");
+
+ // Validate transition from fromPage to toPage
+ if (!overrideTransitionCheck && !getWorkFlowDefinition().getToPages(fromWorkPageDefinition).contains(
+ toWorkPageDefinition)) {
+ String errStr =
+ "Not configured to transition to \"" + toStateName + "\" from \"" + fromWorkPageDefinition.getPageName() + "\"";
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, errStr);
+ return new Result(errStr);
+ }
+
+ // Don't transition with uncommitted branch if this is a commit state
+ if (AtsWorkDefinitions.isAllowCommitBranch(getWorkPageDefinition()) && getBranchMgr().isWorkingBranch()) return new Result(
+ "Working Branch exists. Please commit or delete working branch before transition.");
+
+ // Check extension points for valid transition
+ for (IAtsStateItem item : stateItems.getStateItems(fromWorkPageDefinition.getId())) {
+ Result result = item.transitioning(this, fromWorkPageDefinition.getPageName(), toStateName, toAssignees);
+ if (result.isFalse()) return result;
+ }
+ for (IAtsStateItem item : stateItems.getStateItems(toWorkPageDefinition.getId())) {
+ Result result = item.transitioning(this, fromWorkPageDefinition.getPageName(), toStateName, toAssignees);
+ if (result.isFalse()) return result;
+ }
+ transitionHelper(toAssignees, persist, fromWorkPageDefinition, toWorkPageDefinition, toStateName,
+ cancelReason, transaction);
+ if (persist) {
+ OseeNotificationManager.sendNotifications();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return new Result("Transaction failed " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ private void transitionHelper(Collection<User> toAssignees, boolean persist, WorkPageDefinition fromPage, WorkPageDefinition toPage, String toStateName, String cancelReason, SkynetTransaction transaction) throws OseeCoreException {
+ // Log transition
+ if (toPage.isCancelledPage()) {
+ atsLog.addLog(LogType.StateCancelled, stateMgr.getCurrentStateName(), cancelReason);
+ } else {
+ atsLog.addLog(LogType.StateComplete, stateMgr.getCurrentStateName(), "");
+ }
+ atsLog.addLog(LogType.StateEntered, toStateName, "");
+
+ stateMgr.transitionHelper(toAssignees, persist, fromPage, toPage, toStateName, cancelReason);
+
+ if (getSma().isValidationRequired()) {
+ getReviewManager().createValidateReview(false, transaction);
+ }
+
+ AtsNotifyUsers.notify(sma, AtsNotifyUsers.NotifyType.Subscribed, AtsNotifyUsers.NotifyType.Completed,
+ AtsNotifyUsers.NotifyType.Completed);
+
+ // Persist
+ if (persist) {
+ getSma().persistAttributesAndRelations(transaction);
+ }
+
+ getSma().transitioned(fromPage, toPage, toAssignees, true, transaction);
+
+ // Notify extension points of transition
+ for (IAtsStateItem item : stateItems.getStateItems(fromPage.getId())) {
+ item.transitioned(this, fromPage.getPageName(), toStateName, toAssignees, transaction);
+ }
+ for (IAtsStateItem item : stateItems.getStateItems(toPage.getId())) {
+ item.transitioned(this, fromPage.getPageName(), toStateName, toAssignees, transaction);
+ }
+ }
+
+ /**
+ * @return Returns the editor.
+ */
+ public SMAEditor getEditor() {
+ return editor;
+ }
+
+ /**
+ * @param editor The editor to set.
+ */
+ public void setEditor(SMAEditor editor) {
+ this.editor = editor;
+ }
+
+ /**
+ * @return Returns the branchMgr.
+ */
+ public AtsBranchManager getBranchMgr() {
+ return branchMgr;
+ }
+
+ /**
+ * @return the reviewManager
+ */
+ public ReviewManager getReviewManager() {
+ return reviewMgr;
+ }
+
+ /**
+ * @return the stateItems
+ */
+ public AtsStateItems getStateItems() {
+ return stateItems;
+ }
+
+ /**
+ * @return the inTransition
+ */
+ public boolean isInTransition() {
+ return inTransition;
+ }
+
+ /**
+ * @param inTransition the inTransition to set
+ */
+ public void setInTransition(boolean inTransition) {
+ this.inTransition = inTransition;
+ }
+
+ /**
+ * @return the deadlineMgr
+ */
+ public DeadlineManager getDeadlineMgr() {
+ return deadlineMgr;
+ }
+
+ /**
+ * @return the stateMgr
+ */
+ public StateManager getStateMgr() {
+ return stateMgr;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java
new file mode 100644
index 00000000000..2e17c88dd20
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAPrint.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAPrint extends Action {
+
+ private final SMAManager smaMgr;
+ private final SMATaskComposite taskComposite;
+ private final SMAWorkFlowTab workFlowTab;
+
+ public SMAPrint(SMAManager smaMgr, SMAWorkFlowTab workFlowTab, SMATaskComposite taskComposite) {
+ super();
+ this.smaMgr = smaMgr;
+ this.workFlowTab = workFlowTab;
+ this.taskComposite = taskComposite;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ try {
+ XResultData resultData = new XResultData();
+ resultData.addRaw(AHTML.beginMultiColumnTable(100));
+ resultData.addRaw(AHTML.addRowMultiColumnTable(new String[] {AHTML.getLabelValueStr(AHTML.LABEL_FONT,
+ "Title: ", smaMgr.getSma().getDescriptiveName())}));
+ resultData.addRaw(AHTML.endMultiColumnTable());
+ resultData.addRaw(AHTML.beginMultiColumnTable(100));
+ resultData.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Current State: ",
+ ((IWorldViewArtifact) smaMgr.getSma()).getWorldViewState()),
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Team: ",
+ ((IWorldViewArtifact) smaMgr.getSma()).getWorldViewTeam()),
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Assignees: ",
+ ((IWorldViewArtifact) smaMgr.getSma()).getWorldViewActivePoc()),
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Originator: ",
+ ((IWorldViewArtifact) smaMgr.getSma()).getWorldViewOriginator()),
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Created: ", XDate.getDateStr(
+ smaMgr.getLog().getCreationDate(), XDate.MMDDYYHHMM))
+
+ }));
+ resultData.addRaw(AHTML.endMultiColumnTable());
+ resultData.addRaw(AHTML.beginMultiColumnTable(100));
+ resultData.addRaw(AHTML.addRowMultiColumnTable(new String[] {
+ //
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "Workflow: ", smaMgr.getSma().getArtifactTypeName()),
+ AHTML.getLabelValueStr(AHTML.LABEL_FONT, "HRID: ", smaMgr.getSma().getHumanReadableId()),
+ (smaMgr.getSma().getParentActionArtifact() == null ? "" : AHTML.getLabelValueStr(AHTML.LABEL_FONT,
+ "Action HRID: ", smaMgr.getSma().getParentActionArtifact().getHumanReadableId()))}));
+ resultData.addRaw(AHTML.endMultiColumnTable());
+ if (workFlowTab != null) resultData.addRaw(workFlowTab.getHtml());
+ if (taskComposite != null) resultData.addRaw(taskComposite.getHtml());
+ resultData.addRaw(AHTML.newline());
+ resultData.addRaw(smaMgr.getLog().getHtml());
+ resultData.report(smaMgr.getSma().getDescriptiveName(), Manipulations.RAW_HTML);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java
new file mode 100644
index 00000000000..b06ec8edc7c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.AICheckTreeDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMARelationsHyperlinkComposite extends Composite {
+
+ private final XFormToolkit toolkit;
+ private static AtsRelation sides[] =
+ new AtsRelation[] {AtsRelation.TeamWorkflowToReview_Review, AtsRelation.TeamWorkflowToReview_Team,
+ AtsRelation.Supercedes_Superceded, AtsRelation.Supercedes_Supercedes,
+ AtsRelation.SupportingInfo_SupportedBy, AtsRelation.SupportingInfo_SupportingInfo};
+ private SMAManager smaMgr;
+ private Label actionableItemsLabel;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public SMARelationsHyperlinkComposite(Composite parent, XFormToolkit toolkit, int style) {
+ super(parent, style);
+ this.toolkit = toolkit;
+ }
+
+ public void create(SMAManager smaMgr) throws OseeCoreException {
+ this.smaMgr = smaMgr;
+ setLayout(ALayout.getZeroMarginLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint = 500;
+ setLayoutData(gd);
+ toolkit.adapt(this);
+
+ processArtifact("This", smaMgr.getSma());
+ if (smaMgr.getSma() instanceof ReviewSMArtifact) processReviewArtifact((ReviewSMArtifact) smaMgr.getSma());
+
+ if ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && ((TeamWorkFlowArtifact) smaMgr.getSma()).getParentActionArtifact() != null) {
+ processArtifact("Parent ", ((TeamWorkFlowArtifact) smaMgr.getSma()).getParentActionArtifact());
+ }
+ }
+
+ public static boolean relationExists(StateMachineArtifact smaArt) throws OseeCoreException {
+ for (AtsRelation side : sides) {
+ if (smaArt.getRelatedArtifacts(side).size() > 0) return true;
+ if (smaArt.getParentActionArtifact() != null && smaArt.getParentActionArtifact().getRelatedArtifacts(side).size() > 0) return true;
+ }
+ if ((smaArt instanceof ReviewSMArtifact) && ((ReviewSMArtifact) smaArt).getActionableItemsDam().getActionableItemGuids().size() > 0) return true;
+ return false;
+ }
+
+ private void processArtifact(String name, Artifact thisArt) throws OseeCoreException {
+ for (AtsRelation side : sides) {
+ for (final Artifact art : thisArt.getRelatedArtifacts(side)) {
+ RelationLink rel = thisArt.getRelations(side, art).iterator().next();
+ toolkit.createLabel(
+ this,
+ name + " \"" + thisArt.getArtifactTypeName() + "\" " + rel.getSidePhrasingFor(thisArt) + " \"" + art.getArtifactTypeName() + "\" ");
+ Hyperlink link =
+ toolkit.createHyperlink(
+ this,
+ String.format(
+ "\"%s\" - %s",
+ art.getDescriptiveName().length() < 60 ? art.getDescriptiveName() : art.getDescriptiveName().substring(
+ 0, 60), art.getHumanReadableId()), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ });
+ }
+ }
+ }
+
+ private void processReviewArtifact(final ReviewSMArtifact reviewArt) throws OseeCoreException {
+ if (reviewArt.getActionableItemsDam().getActionableItemGuids().size() == 0) return;
+ actionableItemsLabel = toolkit.createLabel(this, "");
+ Hyperlink link = toolkit.createHyperlink(this, "(Edit)", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ editRelatedActionableItems(reviewArt);
+ }
+ });
+ refreshActionableItemsLabel();
+ }
+
+ private void refreshActionableItemsLabel() throws OseeCoreException {
+ if ((actionableItemsLabel != null) && smaMgr.getSma() instanceof ReviewSMArtifact) actionableItemsLabel.setText("This \"" + ((ReviewSMArtifact) smaMgr.getSma()).getArtifactTypeName() + "\" is review of Actionable Items \"" + ((ReviewSMArtifact) smaMgr.getSma()).getActionableItemsDam().getActionableItemsStr() + "\" ");
+ }
+
+ public void refresh() throws OseeCoreException {
+ refreshActionableItemsLabel();
+ }
+
+ private void editRelatedActionableItems(final ReviewSMArtifact reviewArt) {
+ final AICheckTreeDialog diag =
+ new AICheckTreeDialog("Edit Actionable Items", "Select Actionable Items for this review", Active.Active);
+ try {
+ diag.setInitialSelections(reviewArt.getActionableItemsDam().getActionableItems());
+ if (diag.open() != 0) return;
+ reviewArt.getActionableItemsDam().setActionableItems(diag.getChecked());
+ smaMgr.getEditor().onDirtied();
+ refreshActionableItemsLabel();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java
new file mode 100644
index 00000000000..bc5226b0efe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.task.IXTaskViewer;
+import org.eclipse.osee.ats.task.TaskComposite;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.ToolBar;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMATaskComposite extends Composite {
+
+ private static String HELP_CONTEXT_ID = "atsWorkflowEditorTaskTab";
+ private final TaskComposite taskComposite;
+
+ public SMATaskComposite(IXTaskViewer iXTaskViewer, Composite parent, int style, ToolBar toolBar) throws OseeCoreException {
+ super(parent, style);
+
+ setLayout(new GridLayout(1, true));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+ taskComposite = new TaskComposite(iXTaskViewer, this, style, toolBar);
+ AtsPlugin.getInstance().setHelp(this, HELP_CONTEXT_ID);
+ taskComposite.loadTable();
+ }
+
+ @Override
+ public String toString() {
+ try {
+ return "SMATaskComposite for SMA \"" + taskComposite.getIXTaskViewer().getParentSmaMgr().getSma() + "\"";
+ } catch (Exception ex) {
+ return "SMATaskComposite " + ex.getLocalizedMessage();
+ }
+ }
+
+ public void disposeTaskComposite() {
+ taskComposite.dispose();
+ }
+
+ public String getHtml() {
+ return taskComposite.toHTML(AHTML.LABEL_FONT);
+ }
+
+ /**
+ * @return the xTask
+ */
+ public TaskComposite getTaskComposite() {
+ return taskComposite;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java
new file mode 100644
index 00000000000..e3eea5bdb23
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.stateItem.AtsDebugWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowDebugSection extends SMAWorkFlowSection {
+
+ private Composite workComp;
+ private XFormToolkit toolkit;
+
+ /**
+ * @param parent
+ * @param toolkit
+ * @param style
+ * @param page
+ * @param smaMgr
+ * @throws Exception
+ */
+ public SMAWorkFlowDebugSection(Composite parent, XFormToolkit toolkit, int style, SMAManager smaMgr) throws OseeCoreException {
+ super(parent, toolkit, style, new AtsDebugWorkPage(), smaMgr);
+ }
+
+ @Override
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) throws OseeCoreException {
+ this.toolkit = toolkit;
+ workComp = super.createWorkArea(comp, page, toolkit);
+ toolkit.createLabel(workComp, "ATS Debug Section");
+
+ // Display team definition
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact) {
+ TeamDefinitionArtifact teamDef = ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition();
+ addDebug("Team Definition: " + teamDef);
+ for (WorkRuleDefinition workItemDefinition : teamDef.getWorkRules()) {
+ addDebug(" " + workItemDefinition.toString());
+ }
+ }
+
+ // Display workflows
+ addDebug("WorkflowId: " + smaMgr.getWorkFlowDefinition().getId());
+ if (smaMgr.getWorkFlowDefinition().getParentId() != null && !smaMgr.getWorkFlowDefinition().getParentId().equals(
+ "")) addDebug("Inherit Workflow from Parent Id: " + smaMgr.getWorkFlowDefinition().getParentId());
+ for (WorkRuleDefinition workItemDefinition : smaMgr.getWorkFlowDefinition().getWorkRules()) {
+ addDebug(" " + workItemDefinition.toString());
+ }
+
+ // Display pages
+ for (WorkPageDefinition atsPage : smaMgr.getWorkFlowDefinition().getPagesOrdered()) {
+ addDebug(atsPage.toString());
+ for (WorkItemDefinition wid : atsPage.getWorkItems(true)) {
+ addDebug(" " + wid.toString());
+ }
+ }
+
+ // Button button = toolkit.createButton(workComp, "Return to \"" + item.getState() + "\"",
+ // SWT.PUSH);
+ // button.addListener(SWT.MouseUp, new Listener() {
+ // public void handleEvent(Event event) {
+ // handleUnComplete(fItem.getState());
+ // }
+ // });
+ return workComp;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.SMAWorkFlowSection#createPage(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Section createPage(Composite comp) throws OseeCoreException {
+ Section section = super.createPage(comp);
+ return section;
+ }
+
+ public void addDebug(String str) {
+ toolkit.createText(workComp, str, SWT.MULTI | SWT.WRAP);
+ workComp.layout();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
new file mode 100644
index 00000000000..181c2aba2f3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
@@ -0,0 +1,750 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.service.ServicesArea;
+import org.eclipse.osee.ats.task.TaskComposite;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.widgets.dialog.SMAStatusDialog;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserCheckTreeDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinitionLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinitionViewSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowSection extends SectionPart {
+
+ private XComboViewer transitionToStateCombo;
+ private Button transitionButton;
+ private static String ASSIGNEES = "Assignee(s):";
+ private Label currentAssigneesLabel;
+ private Label transitionAssigneesLabel;
+ protected final SMAManager smaMgr;
+ private final AtsWorkPage atsWorkPage;
+ private final boolean isEditable, isCurrentState, isGlobalEditable;
+ private ServicesArea servicesArea;
+ private final XFormToolkit toolkit;
+ private TaskComposite xTask;
+ public static String TRANSITION_TO_STATE_COMBO = "Transition To State Combo";
+ private Composite mainComp;
+ private DynamicXWidgetLayout dynamicXWidgetLayout;
+
+ public SMAWorkFlowSection(Composite parent, XFormToolkit toolkit, int style, AtsWorkPage page, SMAManager smaMgr) throws OseeCoreException {
+ super(parent, toolkit, style);
+ this.toolkit = toolkit;
+ this.atsWorkPage = page;
+ this.smaMgr = smaMgr;
+ isEditable =
+ !smaMgr.getSma().isReadOnly() && smaMgr.isAccessControlWrite() && smaMgr.isCurrentState(page.getName()) && (smaMgr.getWorkPageDefinition().hasWorkRule(
+ AtsWorkDefinitions.RuleWorkItemId.atsAllowEditToAll.name()) || smaMgr.teamDefHasWorkRule(AtsWorkDefinitions.RuleWorkItemId.atsAllowEditToAll.name()) || smaMgr.getEditor().getPriviledgedEditMode() != SMAEditor.PriviledgedEditMode.Off || smaMgr.isAssigneeMe() || AtsPlugin.isAtsAdmin());
+ isGlobalEditable =
+ !smaMgr.getSma().isReadOnly() && smaMgr.isAccessControlWrite() && smaMgr.getEditor().getPriviledgedEditMode() == SMAEditor.PriviledgedEditMode.Global;
+ isCurrentState = smaMgr.isCurrentState(page.getName());
+ // parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_CYAN));
+ createPage(parent);
+ }
+
+ protected Section createPage(Composite parent) throws OseeCoreException {
+
+ Section section = toolkit.createSection(parent, Section.TWISTIE | Section.TITLE_BAR);
+ section.setText(getCurrentStateTitle());
+ if (smaMgr.isCurrentState(atsWorkPage.getName())) section.setBackground(AtsPlugin.ACTIVE_COLOR);
+ section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ // section.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_MAGENTA));
+
+ mainComp = toolkit.createClientContainer(section, 2);
+ mainComp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
+ // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW));
+ mainComp.layout();
+
+ SMAWorkFlowTab.createStateNotesHeader(mainComp, toolkit, smaMgr, 2, atsWorkPage.getName());
+
+ Composite rightComp = toolkit.createContainer(mainComp, 1);
+ rightComp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
+ // rightComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW));
+
+ Composite workComp = createWorkArea(mainComp, atsWorkPage, toolkit);
+
+ GridData gridData = new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING);
+ gridData.widthHint = 400;
+ workComp.setLayoutData(gridData);
+
+ servicesArea = new ServicesArea(smaMgr);
+ servicesArea.createSidebarServices(rightComp, atsWorkPage, toolkit, this);
+
+ section.layout();
+ section.setExpanded(smaMgr.isCurrentSectionExpanded(atsWorkPage.getName()));
+
+ return section;
+ }
+
+ protected Composite createWorkArea(Composite comp, AtsWorkPage atsWorkPage, XFormToolkit toolkit) throws OseeCoreException {
+
+ Composite workComp = toolkit.createContainer(comp, 1);
+ workComp.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.VERTICAL_ALIGN_BEGINNING));
+ // workComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GREEN));
+
+ if (isEditable) createCurrentPageHeader(workComp, atsWorkPage, toolkit);
+
+ // Add static layoutDatas to atsWorkPage
+ List<DynamicXWidgetLayoutData> staticDatas = new ArrayList<DynamicXWidgetLayoutData>();
+ for (WorkItemDefinition workItemDefinition : atsWorkPage.getWorkPageDefinition().getWorkItems(true)) {
+ if (workItemDefinition instanceof WorkWidgetDefinition) {
+ DynamicXWidgetLayoutData data = ((WorkWidgetDefinition) workItemDefinition).get();
+ data.setDynamicXWidgetLayout(atsWorkPage.getDynamicXWidgetLayout());
+ staticDatas.add(data);
+ }
+ }
+ atsWorkPage.addLayoutDatas(staticDatas);
+
+ // Add dynamic WorkItemDefinitions to atsWorkPage
+ List<DynamicXWidgetLayoutData> dynamicDatas = new ArrayList<DynamicXWidgetLayoutData>();
+ for (WorkItemDefinition workItemDefinition : WorkItemDefinitionFactory.getDynamicWorkItemDefintions(
+ smaMgr.getWorkFlowDefinition(), atsWorkPage.getWorkPageDefinition(), smaMgr)) {
+ if (workItemDefinition instanceof WorkWidgetDefinition) {
+ DynamicXWidgetLayoutData data = ((WorkWidgetDefinition) workItemDefinition).get();
+ data.setDynamicXWidgetLayout(atsWorkPage.getDynamicXWidgetLayout());
+ dynamicDatas.add(data);
+ }
+ }
+ atsWorkPage.addLayoutDatas(dynamicDatas);
+
+ atsWorkPage.setSmaMgr(smaMgr);
+
+ // Create main body
+ dynamicXWidgetLayout =
+ atsWorkPage.createBody(toolkit, workComp, smaMgr.getSma(), xModListener, isEditable || isGlobalEditable);
+
+ // Check extenstion points for page creation
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(atsWorkPage.getId())) {
+ Result result = item.pageCreated(toolkit, atsWorkPage, smaMgr, xModListener, isEditable || isGlobalEditable);
+ if (result.isFalse()) {
+ result.popup();
+ OSEELog.logSevere(AtsPlugin.class, "Error in page creation => " + result.getText(), true);
+ }
+ }
+
+ if (isEditable) createCurrentPageTransitionLine(workComp, atsWorkPage, toolkit);
+
+ return workComp;
+ }
+
+ public Result isXWidgetSavable() throws OseeCoreException {
+ if (dynamicXWidgetLayout == null) return Result.TrueResult;
+ for (XWidget widget : dynamicXWidgetLayout.getXWidgets()) {
+ if (widget instanceof IArtifactWidget) {
+ Result result = widget.isValid();
+ if (result.isFalse()) return result;
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public String toString() {
+ return atsWorkPage + " for " + getSmaMgr().getSma();
+ }
+
+ public Result isXWidgetDirty() throws OseeCoreException {
+ if (dynamicXWidgetLayout == null) return Result.FalseResult;
+ for (XWidget widget : dynamicXWidgetLayout.getXWidgets()) {
+ if (widget instanceof IArtifactWidget) {
+ Result result = ((IArtifactWidget) widget).isDirty();
+ if (result.isTrue()) return result;
+ }
+ }
+ return Result.FalseResult;
+ }
+
+ public void saveXWidgetToArtifact() throws OseeCoreException {
+ for (XWidget widget : dynamicXWidgetLayout.getXWidgets()) {
+ if (widget instanceof IArtifactWidget) ((IArtifactWidget) widget).saveToArtifact();
+ }
+ }
+
+ private String getCurrentStateTitle() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer(atsWorkPage.getName());
+ if (isEditable && (!smaMgr.isCompleted() && !smaMgr.isCancelled())) {
+ sb.append(" - Current State");
+ }
+ if (smaMgr.isCancelled()) {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ if (item == null) {
+ throw new OseeStateException(
+ "ats.Log: Cancelled state has no logItem for " + smaMgr.getSma().getHumanReadableId());
+ }
+ if (item.getState().equals(atsWorkPage.getName())) {
+ sb.append(" - Cancelled");
+ if (!item.getMsg().equals("")) sb.append(" - Reason: " + item.getMsg());
+ }
+ }
+ if (isCurrentState) {
+ if (smaMgr.isCompleted()) {
+ sb.append(" - ");
+ sb.append(smaMgr.getSma().getWorldViewCompletedDateStr());
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateEntered, atsWorkPage.getName());
+ sb.append(" by " + item.getUser().getName());
+ } else if (smaMgr.isCancelled()) {
+ sb.append(" - ");
+ sb.append(smaMgr.getSma().getWorldViewCancelledDateStr());
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateEntered, atsWorkPage.getName());
+ sb.append(" by " + item.getUser().getName());
+ }
+ if (smaMgr.getStateMgr().getAssignees().size() > 0) {
+ sb.append(" assigned to ");
+ sb.append(Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees()));
+ }
+ } else {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateComplete, atsWorkPage.getName());
+ if (item != null) {
+ sb.append(" - State Completed " + item.getDate(XDate.MMDDYYHHMM));
+ sb.append(" by " + item.getUser().getName());
+ }
+ }
+ return sb.toString();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.AbstractFormPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ atsWorkPage.dispose();
+ servicesArea.dispose();
+ }
+
+ final SMAWorkFlowSection fSection = this;
+ final XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget xWidget) {
+ if (smaMgr.getSma().isDeleted()) return;
+ // Notify extensions of widget modified
+ try {
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(atsWorkPage.getId())) {
+ try {
+ item.widgetModified(fSection, xWidget);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ updateTransitionToState();
+ updateTransitionToAssignees();
+ smaMgr.getEditor().onDirtied();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ if (isEditable) {
+ try {
+ if (currentAssigneesLabel != null && !currentAssigneesLabel.isDisposed()) {
+ currentAssigneesLabel.setText(Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees()));
+ currentAssigneesLabel.getParent().layout();
+ }
+ if (transitionAssigneesLabel != null && !transitionAssigneesLabel.isDisposed()) {
+ WorkPageDefinition toWorkPage = (WorkPageDefinition) transitionToStateCombo.getSelected();
+ if (toWorkPage == null)
+ transitionAssigneesLabel.setText("");
+ else
+ transitionAssigneesLabel.setText(smaMgr.getTransitionAssigneesStr());
+ transitionAssigneesLabel.getParent().layout();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex.toString(), ex);
+ }
+ }
+ refreshStateServices();
+ }
+
+ private void createCurrentPageHeader(Composite parent, AtsWorkPage page, XFormToolkit toolkit) throws OseeCoreException {
+ Composite comp = toolkit.createContainer(parent, 3);
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ if (isEditable && !smaMgr.isCancelled() && !smaMgr.isCompleted()) {
+ toolkit.createLabel(comp, "\"" + page.getName() + "\" State ");
+ Hyperlink setAssigneesHyperlinkLabel = toolkit.createHyperlink(comp, ASSIGNEES, SWT.NONE);
+ setAssigneesHyperlinkLabel.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ handleChangeCurrentAssignees();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ });
+ currentAssigneesLabel =
+ toolkit.createLabel(comp, Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees()));
+ currentAssigneesLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ if (smaMgr.getStateMgr().getAssignees().size() == 0) {
+ Label errorLabel = toolkit.createLabel(comp, "Error: State has no assignees");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ } else if (smaMgr.getStateMgr().getAssignees().size() > 0) {
+ Label errorLabel =
+ toolkit.createLabel(comp,
+ "Error: Non-current/Cancelled/Completed state still assigned to " + Artifacts.toString("; ",
+ smaMgr.getStateMgr().getAssignees()));
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ }
+
+ private void handleChangeCurrentAssignees() throws OseeCoreException {
+ if (smaMgr.promptChangeAssignees()) {
+ refresh();
+ smaMgr.getEditor().onDirtied();
+ }
+ }
+
+ private void handleChangeTransitionAssignees() throws OseeCoreException {
+ WorkPageDefinition toWorkPage = (WorkPageDefinition) transitionToStateCombo.getSelected();
+ if (toWorkPage == null) {
+ OSEELog.logException(AtsPlugin.class, "No Transition State Selected", null, true);
+ return;
+ }
+ if (toWorkPage.isCancelledPage() || toWorkPage.isCompletePage()) {
+ AWorkbench.popup("ERROR", "No Assignees in Completed and Cancelled states");
+ return;
+ }
+ UserCheckTreeDialog uld = new UserCheckTreeDialog(Display.getCurrent().getActiveShell());
+ uld.setMessage("Select users to transition to.");
+ uld.setInitialSelections(smaMgr.getTransitionAssignees());
+ if (uld.open() != 0) return;
+ Collection<User> users = uld.getUsersSelected();
+ if (users.size() == 0) {
+ AWorkbench.popup("ERROR", "Must have at least one assignee");
+ return;
+ }
+ smaMgr.setTransitionAssignees(users);
+ refresh();
+ smaMgr.getEditor().onDirtied();
+ }
+
+ private void createCurrentPageTransitionLine(Composite parent, AtsWorkPage atsWorkPage, XFormToolkit toolkit) throws OseeCoreException {
+ Composite comp = toolkit.createContainer(parent, 5);
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ transitionButton = toolkit.createButton(comp, "Transition", SWT.PUSH);
+ transitionButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleTransition();
+ }
+ });
+
+ toolkit.createLabel(comp, "to");
+
+ transitionToStateCombo = new XComboViewer(TRANSITION_TO_STATE_COMBO);
+ transitionToStateCombo.setDisplayLabel(false);
+ ArrayList<Object> allPages = new ArrayList<Object>();
+ for (WorkPageDefinition nextPage : smaMgr.getToWorkPages()) {
+ allPages.add(nextPage);
+ }
+ transitionToStateCombo.setInput(allPages);
+ transitionToStateCombo.setLabelProvider(new WorkPageDefinitionLabelProvider());
+ transitionToStateCombo.setContentProvider(new ArrayContentProvider());
+ transitionToStateCombo.setSorter(new WorkPageDefinitionViewSorter());
+
+ transitionToStateCombo.createWidgets(comp, 1);
+
+ // Set default page from workflow default
+ ArrayList<Object> defaultPage = new ArrayList<Object>();
+ if (atsWorkPage.getDefaultToPage() != null) {
+ defaultPage.add(atsWorkPage.getDefaultToPage());
+ transitionToStateCombo.setSelected(defaultPage);
+ }
+ if (atsWorkPage.isCancelledPage()) {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ if (item != null) {
+ defaultPage.add(smaMgr.getWorkPageDefinitionByName(item.getState()));
+ transitionToStateCombo.setSelected(defaultPage);
+ }
+ }
+ // Update transition based on state items
+ updateTransitionToState();
+
+ transitionToStateCombo.getCombo().setVisibleItemCount(20);
+ transitionToStateCombo.addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ try {
+ updateTransitionToAssignees();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+
+ Hyperlink assigneesLabelLink = toolkit.createHyperlink(comp, ASSIGNEES, SWT.NONE);
+ assigneesLabelLink.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ handleChangeTransitionAssignees();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ });
+ transitionAssigneesLabel = toolkit.createLabel(comp, smaMgr.getTransitionAssigneesStr());
+ transitionAssigneesLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ }
+
+ public void updateTransitionToAssignees() throws OseeCoreException {
+ Collection<User> assignees = null;
+ // Determine if the is an override set of assigness
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(atsWorkPage.getId())) {
+ assignees = item.getOverrideTransitionToAssignees(this);
+ if (assignees != null) break;
+ }
+ // If override set and isn't the same as already selected, update
+ if (assignees != null && !smaMgr.getTransitionAssignees().equals(assignees)) {
+ smaMgr.setTransitionAssignees(assignees);
+ smaMgr.getEditor().onDirtied();
+ }
+ refresh();
+ }
+
+ public void updateTransitionToState() throws OseeCoreException {
+ // Determine if there is a transitionToStateOverride for this page
+ String transitionStateOverride = null;
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(atsWorkPage.getId())) {
+ transitionStateOverride = item.getOverrideTransitionToStateName(this);
+ if (transitionStateOverride != null) break;
+ }
+ if (transitionStateOverride != null) {
+ // Return if override state is same as selected
+ if (((WorkPageDefinition) transitionToStateCombo.getSelected()).getName().equals(transitionStateOverride)) return;
+ // Find page corresponding to override state name
+ for (WorkPageDefinition toWorkPageDefinition : smaMgr.getToWorkPages()) {
+ if (toWorkPageDefinition.getPageName().equals(transitionStateOverride)) {
+ // Reset selection
+ ArrayList<Object> defaultPage = new ArrayList<Object>();
+ defaultPage.add(toWorkPageDefinition);
+ transitionToStateCombo.setSelected(defaultPage);
+ return;
+ }
+ }
+ }
+ }
+
+ public void setTransitionToStateSelection(String stateName) throws OseeCoreException {
+ ArrayList<Object> allPages = new ArrayList<Object>();
+ for (WorkPageDefinition nextPage : smaMgr.getToWorkPages()) {
+ if (nextPage.getPageName().equals(stateName)) allPages.add(nextPage);
+ }
+ transitionToStateCombo.setSelected(allPages);
+ }
+
+ private void handleTransition() {
+
+ try {
+
+ if (smaMgr.getBranchMgr().isWorkingBranch() && !atsWorkPage.isAllowTransitionWithWorkingBranch()) {
+ AWorkbench.popup("ERROR",
+ "Working Branch exists.\n\nPlease commit or delete working branch before transition.");
+ return;
+ }
+
+ smaMgr.setInTransition(true);
+ smaMgr.getEditor().doSave(null);
+
+ // Get transition to state
+ WorkPageDefinition toWorkPageDefinition = (WorkPageDefinition) transitionToStateCombo.getSelected();
+
+ if (toWorkPageDefinition == null) {
+ OSEELog.logException(AtsPlugin.class, "No Transition State Selected", null, true);
+ return;
+ }
+ if (toWorkPageDefinition.getPageName().equals(DefaultTeamState.Cancelled.name())) {
+ EntryDialog cancelDialog = new EntryDialog("Cancellation Reason", "Enter cancellation reason.");
+ if (cancelDialog.open() != 0) return;
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ Result result = smaMgr.transitionToCancelled(cancelDialog.getEntry(), true, transaction);
+ transaction.execute();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ smaMgr.setInTransition(false);
+ smaMgr.getEditor().refreshPages();
+ return;
+ }
+
+ // Validate assignees
+ if (smaMgr.getStateMgr().getAssignees().contains(UserManager.getUser(SystemUser.NoOne)) || smaMgr.getStateMgr().getAssignees().contains(
+ UserManager.getUser(SystemUser.Guest)) || smaMgr.getStateMgr().getAssignees().contains(
+ UserManager.getUser(SystemUser.UnAssigned))) {
+ AWorkbench.popup("ERROR",
+ "Can not transition with \"Guest\", \"UnAssigned\" or \"NoOne\" user as assignee.");
+ return;
+ }
+
+ // Get transition to assignees
+ Collection<User> toAssignees;
+ if (toWorkPageDefinition.isCancelledPage() || toWorkPageDefinition.isCompletePage())
+ toAssignees = new HashSet<User>();
+ else
+ toAssignees = smaMgr.getTransitionAssignees();
+
+ // If this is a return transition, don't require page/tasks to be complete
+ if (!smaMgr.isReturnPage(toWorkPageDefinition)) {
+
+ // Validate XWidgets for transition
+ Result result = atsWorkPage.isPageComplete();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+
+ // Loop through this state's tasks to confirm complete
+ if (smaMgr.isTaskable()) {
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifactsFromCurrentState()) {
+ if (taskArt.isInWork()) {
+ AWorkbench.popup(
+ "Error",
+ "Task Not Complete\n\nTitle: " + taskArt.getDescriptiveName() + "\n\nHRID: " + taskArt.getHumanReadableId());
+ return;
+ }
+ }
+ }
+
+ // Don't transition without targeted version if so configured
+ if (smaMgr.teamDefHasWorkRule(AtsWorkDefinitions.RuleWorkItemId.atsRequireTargetedVersion.name()) || smaMgr.getWorkPageDefinition().hasWorkRule(
+ AtsWorkDefinitions.RuleWorkItemId.atsRequireTargetedVersion.name())) {
+ if (smaMgr.getSma().getWorldViewTargetedVersion() == null && !toWorkPageDefinition.isCancelledPage()) {
+ AWorkbench.popup("Error",
+ "Actions must be targeted for a Version.\nPlease set \"Target Version\" before transition.");
+ return;
+ }
+ }
+
+ // Loop through this state's blocking reviews to confirm complete
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviewsFromCurrentState()) {
+ if (reviewArt.getReviewBlockType() == ReviewBlockType.Transition && !reviewArt.getSmaMgr().isCancelledOrCompleted()) {
+ AWorkbench.popup(
+ "Error",
+ "Blocking Review must be completed before transition.\n\nReview Title: \"" + reviewArt.getDescriptiveName() + "\"\nHRID: " + reviewArt.getHumanReadableId());
+ return;
+ }
+ }
+
+ // Check extension points for valid transition
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(atsWorkPage.getId())) {
+ try {
+ result =
+ item.transitioning(smaMgr, smaMgr.getStateMgr().getCurrentStateName(),
+ toWorkPageDefinition.getPageName(), toAssignees);
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ // Ask for metrics for this page (store in state versus task?)
+ if (!handlePopulateStateMetrics()) return;
+ }
+
+ // Persist must be done prior and separate from transition
+ smaMgr.getSma().persistAttributesAndRelations();
+
+ // Perform transition separate from persist of previous changes to state machine artifact
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ Result result = smaMgr.transition(toWorkPageDefinition.getPageName(), toAssignees, true, false, transaction);
+ transaction.execute();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ smaMgr.setInTransition(false);
+ smaMgr.getEditor().refreshPages();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ } finally {
+ smaMgr.setInTransition(false);
+ }
+ }
+
+ public void refreshStateServices() {
+ if (servicesArea != null) servicesArea.refresh();
+ smaMgr.getEditor().onDirtied();
+ }
+
+ /**
+ * @return Returns the isCurrentState.
+ */
+ public boolean isCurrentState() {
+ return isCurrentState;
+ }
+
+ public boolean handlePopulateStateMetrics() throws OseeCoreException {
+
+ // Page has the ability to override the autofill of the metrics
+ if (!atsWorkPage.isRequireStateHoursSpentPrompt() && smaMgr.getStateMgr().getHoursSpent() == 0) {
+ // First, try to autofill if it's only been < 5 min since creation
+ int minSinceCreation = getCreationToNowDateDeltaMinutes();
+ // System.out.println("minSinceCreation *" + minSinceCreation + "*");
+ float hoursSinceCreation = minSinceCreation / 60;
+ if (hoursSinceCreation < 0.02) hoursSinceCreation = (new Float(0.02)).floatValue();
+ // System.out.println("hoursSinceCreation *" + hoursSinceCreation + "*");
+ if (minSinceCreation < 5) {
+ smaMgr.getStateMgr().updateMetrics(hoursSinceCreation, 100, true);
+ return true;
+ }
+ }
+
+ // Otherwise, open dialog to ask for hours complete
+ String msg =
+ smaMgr.getStateMgr().getCurrentStateName() + " State\n\n" + AtsLib.doubleToStrString(smaMgr.getStateMgr().getHoursSpent()) + " hours already spent on this state.\n" + "Enter the additional number of hours you spent on this state.";
+ SMAStatusDialog tsd =
+ new SMAStatusDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Enter Hours Spent",
+ msg, false, Arrays.asList(smaMgr.getSma()));
+ int result = tsd.open();
+ if (result == 0) {
+ smaMgr.getStateMgr().updateMetrics(tsd.getHours().getFloat(), 100, true);
+ return true;
+ }
+ return false;
+ }
+
+ public int getCreationToNowDateDeltaMinutes() throws OseeCoreException {
+ Date createDate = smaMgr.getLog().getStateEvent(LogType.StateEntered, atsWorkPage.getName()).getDate();
+ long createDateLong = createDate.getTime();
+ Date date = new Date();
+ float diff = (date.getTime() - createDateLong);
+ // System.out.println("diff *" + diff + "*");
+ Float min = diff / 60000;
+ // System.out.println("min *" + min + "*");
+ return min.intValue();
+ }
+
+ /**
+ * @return Returns the xTask.
+ */
+ public TaskComposite getXTask() {
+ return xTask;
+ }
+
+ /**
+ * @return the transitionToStateCombo
+ */
+ public XComboViewer getTransitionToStateCombo() {
+ return transitionToStateCombo;
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ /**
+ * @return the page
+ */
+ public AtsWorkPage getPage() {
+ return atsWorkPage;
+ }
+
+ /**
+ * @return the mainComp
+ */
+ public Composite getMainComp() {
+ return mainComp;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
new file mode 100644
index 00000000000..a2e89f9d358
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
@@ -0,0 +1,589 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.NoteItem;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.service.ServicesArea;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.artifact.annotation.AnnotationComposite;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.HtmlDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowTab extends FormPage implements IActionable {
+ private final SMAManager smaMgr;
+ private final ArrayList<SMAWorkFlowSection> sections = new ArrayList<SMAWorkFlowSection>();
+ private final XFormToolkit toolkit;
+ private static String ORIGINATOR = "Originator:";
+ private static String TEAM_ACTIONABLE_ITEMS = "Team Actionable Items: ";
+ private static String ACTION_ACTIONABLE_ITEMS = "Action Actionable Items: ";
+ private Label origLabel, teamActionableItemLabel, actionActionableItemsLabel;
+ private final List<AtsWorkPage> pages = new ArrayList<AtsWorkPage>();
+ private AtsWorkPage currentAtsWorkPage;
+ private ScrolledForm scrolledForm;
+ private final Integer HEADER_COMP_COLUMNS = 4;
+ private static Map<String, Integer> guidToScrollLocation = new HashMap<String, Integer>();
+ private final TeamWorkFlowArtifact teamWf;
+ private SMARelationsHyperlinkComposite smaRelationsComposite;
+ private IManagedForm managedForm;
+ private Composite body;
+ private Composite atsBody;
+
+ public SMAWorkFlowTab(SMAManager smaMgr) {
+ super(smaMgr.getEditor(), "overview", "Workflow");
+ this.smaMgr = smaMgr;
+ toolkit = smaMgr.getEditor().getToolkit();
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact)
+ teamWf = (TeamWorkFlowArtifact) smaMgr.getSma();
+ else
+ teamWf = null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
+ */
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ this.managedForm = managedForm;
+ try {
+ scrolledForm = managedForm.getForm();
+ scrolledForm.addDisposeListener(new DisposeListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
+ */
+ public void widgetDisposed(DisposeEvent e) {
+ storeScrollLocation();
+ }
+ });
+
+ scrolledForm.setText(getEditorInput().getName());
+ fillBody(managedForm);
+ refreshToolbar();
+
+ if (smaMgr.getSma().getHelpContext() != null) AtsPlugin.getInstance().setHelp(scrolledForm,
+ smaMgr.getSma().getHelpContext());
+
+ } catch (Exception ex) {
+ OSEELog.logException(getClass(), ex, true);
+ }
+ }
+
+ private void refreshToolbar() throws OseeCoreException {
+ if (toolbarArea != null) {
+ toolbarArea.dispose();
+ scrolledForm.getToolBarManager().removeAll();
+ }
+ toolbarArea = new ServicesArea(smaMgr);
+ toolbarArea.createToolbarServices(currentAtsWorkPage, scrolledForm.getToolBarManager());
+
+ OseeAts.addButtonToEditorToolBar(smaMgr.getEditor(), this, AtsPlugin.getInstance(),
+ scrolledForm.getToolBarManager(), SMAEditor.EDITOR_ID, "ATS Editor");
+
+ scrolledForm.updateToolBar();
+ }
+
+ public Result isXWidgetDirty() throws OseeCoreException {
+ for (SMAWorkFlowSection section : sections) {
+ Result result = section.isXWidgetDirty();
+ if (result.isTrue()) return result;
+ }
+ return Result.FalseResult;
+ }
+
+ public Result isXWidgetSavable() throws OseeCoreException {
+ for (SMAWorkFlowSection section : sections) {
+ Result result = section.isXWidgetSavable();
+ if (result.isFalse()) return result;
+ }
+ return Result.TrueResult;
+ }
+
+ public void saveXWidgetToArtifact() throws OseeCoreException {
+ for (SMAWorkFlowSection section : sections) {
+ section.saveXWidgetToArtifact();
+ }
+ }
+
+ @Override
+ public void dispose() {
+ for (SMAWorkFlowSection section : sections)
+ section.dispose();
+ toolbarArea.dispose();
+ toolkit.dispose();
+ }
+
+ public String getActionDescription() {
+ return "Workflow Tab";
+ }
+
+ public final static String normalColor = "#EEEEEE";
+ private final static String activeColor = "#9CCCFF";
+
+ public String getHtml() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (WorkPage wPage : pages) {
+ AtsWorkPage page = (AtsWorkPage) wPage;
+ if (smaMgr.isCurrentState(page.getName()) || smaMgr.getStateMgr().isStateVisited(page.getName())) {
+ sb.append(page.getHtml(smaMgr.isCurrentState(page.getName()) ? activeColor : normalColor));
+ sb.append(AHTML.newline());
+ }
+ }
+ return sb.toString();
+ }
+
+ private void fillBody(IManagedForm managedForm) throws OseeCoreException {
+ body = managedForm.getForm().getBody();
+ GridLayout gridLayout = new GridLayout(1, false);
+ body.setLayout(gridLayout);
+ body.setLayoutData(new GridData(SWT.LEFT, SWT.LEFT, true, false));
+
+ createBody(body);
+ }
+
+ private ServicesArea toolbarArea;
+
+ private void createBody(Composite body) throws OseeCoreException {
+ atsBody = toolkit.createComposite(body);
+ atsBody.setLayoutData(new GridData(GridData.FILL_BOTH));
+ atsBody.setLayout(ALayout.getZeroMarginLayout(1, false));
+
+ Composite headerComp = toolkit.createComposite(atsBody);
+ headerComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ headerComp.setLayout(ALayout.getZeroMarginLayout(1, false));
+ // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ // Display relations
+ try {
+ createTopLineHeader(headerComp, toolkit);
+ createAssigneesLineHeader(headerComp, toolkit);
+ createLatestHeader(headerComp, toolkit);
+ createTeamWorkflowHeader(headerComp, toolkit);
+ createSMANotesHeader(headerComp, toolkit, smaMgr, HEADER_COMP_COLUMNS);
+ createStateNotesHeader(headerComp, toolkit, smaMgr, HEADER_COMP_COLUMNS, null);
+ createAnnotationsHeader(headerComp, toolkit);
+
+ sections.clear();
+ pages.clear();
+
+ if (SMARelationsHyperlinkComposite.relationExists(smaMgr.getSma())) {
+ smaRelationsComposite = new SMARelationsHyperlinkComposite(atsBody, toolkit, SWT.NONE);
+ smaRelationsComposite.create(smaMgr);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ // Only display current or past states
+ for (WorkPageDefinition workPageDefinition : smaMgr.getSma().getWorkFlowDefinition().getPagesOrdered()) {
+ AtsWorkPage atsWorkPage =
+ new AtsWorkPage(smaMgr.getWorkFlowDefinition(), workPageDefinition, null,
+ ATSXWidgetOptionResolver.getInstance());
+ if (smaMgr.isCurrentState(atsWorkPage.getName())) currentAtsWorkPage = atsWorkPage;
+ if (smaMgr.isCurrentState(atsWorkPage.getName()) || smaMgr.getStateMgr().isStateVisited(atsWorkPage.getName())) {
+ // Don't show completed or cancelled state if not currently those state
+ if (atsWorkPage.isCompletePage() && !smaMgr.isCompleted()) continue;
+ if (atsWorkPage.isCancelledPage() && !smaMgr.isCancelled()) continue;
+ SMAWorkFlowSection section = new SMAWorkFlowSection(atsBody, toolkit, SWT.NONE, atsWorkPage, smaMgr);
+ control = section.getMainComp();
+ sections.add(section);
+ managedForm.addPart(section);
+ pages.add(atsWorkPage);
+ }
+ }
+
+ if (AtsPlugin.isAtsAdmin()) {
+ SMAWorkFlowDebugSection section = new SMAWorkFlowDebugSection(atsBody, toolkit, SWT.NONE, smaMgr);
+ control = section.getMainComp();
+ sections.add(section);
+ managedForm.addPart(section);
+ section.getSection().setExpanded(true);
+ }
+
+ atsBody.setFocus();
+ // Jump to scroll location if set
+ Integer selection = guidToScrollLocation.get(smaMgr.getSma().getGuid());
+ if (selection != null) {
+ JumpScrollbarJob job = new JumpScrollbarJob("");
+ job.schedule(500);
+ }
+
+ managedForm.refresh();
+
+ }
+ private Control control = null;
+
+ private void storeScrollLocation() {
+ if (scrolledForm != null) {
+ Integer selection = scrolledForm.getVerticalBar().getSelection();
+ // System.out.println("Storing selection => " + selection);
+ guidToScrollLocation.put(smaMgr.getSma().getGuid(), selection);
+ }
+ }
+
+ private class JumpScrollbarJob extends Job {
+ public JumpScrollbarJob(String name) {
+ super(name);
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ Integer selection = guidToScrollLocation.get(smaMgr.getSma().getGuid());
+ // System.out.println("Restoring selection => " + selection);
+
+ // Find the ScrolledComposite operating on the control.
+ ScrolledComposite sComp = null;
+ if (control == null || control.isDisposed()) return;
+ Composite parent = control.getParent();
+ while (parent != null) {
+ if (parent instanceof ScrolledComposite) {
+ sComp = (ScrolledComposite) parent;
+ break;
+ }
+ parent = parent.getParent();
+ }
+
+ if (sComp != null) {
+ sComp.setOrigin(0, selection);
+ }
+ }
+ });
+ return Status.OK_STATUS;
+
+ }
+ }
+
+ private void createTeamWorkflowHeader(Composite comp, XFormToolkit toolkit) {
+ try {
+ if (!(smaMgr.getSma() instanceof TeamWorkFlowArtifact)) return;
+
+ Composite actionComp = new Composite(comp, SWT.NONE);
+ toolkit.adapt(actionComp);
+ actionComp.setLayout(ALayout.getZeroMarginLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 4;
+ actionComp.setLayoutData(gd);
+
+ // Show Action's AIs
+ if (!smaMgr.isCancelled() && !smaMgr.isCompleted()) {
+ Hyperlink link = toolkit.createHyperlink(actionComp, ACTION_ACTIONABLE_ITEMS, SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ AtsLib.editActionActionableItems(teamWf.getParentActionArtifact());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ link.setToolTipText("Edit Actionable Items for the parent Action (this may add Team Workflows)");
+ if (teamWf.getParentActionArtifact().getActionableItemsDam().getActionableItems().size() == 0) {
+ Label errorLabel =
+ toolkit.createLabel(actionComp,
+ " " + ACTION_ACTIONABLE_ITEMS + "Error: No Actionable Items identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ actionActionableItemsLabel =
+ toolkit.createLabel(actionComp,
+ teamWf.getParentActionArtifact().getActionableItemsDam().getActionableItemsStr());
+ actionActionableItemsLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ } else {
+ if (teamWf.getParentActionArtifact().getActionableItemsDam().getActionableItems().size() == 0) {
+ Label errorLabel =
+ toolkit.createLabel(actionComp,
+ " " + ACTION_ACTIONABLE_ITEMS + "Error: No Actionable Items identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ Label label =
+ toolkit.createLabel(
+ actionComp,
+ " " + ACTION_ACTIONABLE_ITEMS + teamWf.getParentActionArtifact().getActionableItemsDam().getActionableItemsStr());
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ }
+
+ Composite teamComp = new Composite(comp, SWT.NONE);
+ toolkit.adapt(teamComp);
+ teamComp.setLayout(ALayout.getZeroMarginLayout(2, false));
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 4;
+ teamComp.setLayoutData(gd);
+
+ // Show Team Workflow's AIs
+ if (!smaMgr.isCancelled() && !smaMgr.isCompleted()) {
+ Hyperlink link = toolkit.createHyperlink(teamComp, " " + TEAM_ACTIONABLE_ITEMS, SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ AtsLib.editTeamActionableItems(teamWf);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ });
+ link.setToolTipText("Edit Actionable Items for this Team Workflow");
+ if (teamWf.getActionableItemsDam().getActionableItems().size() == 0) {
+ Label errorLabel =
+ toolkit.createLabel(teamComp,
+ " " + TEAM_ACTIONABLE_ITEMS + "Error: No Actionable Items identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ teamActionableItemLabel =
+ toolkit.createLabel(teamComp, teamWf.getActionableItemsDam().getActionableItemsStr());
+ teamActionableItemLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ } else {
+ if (teamWf.getActionableItemsDam().getActionableItems().size() == 0) {
+ Label errorLabel =
+ toolkit.createLabel(teamComp,
+ " " + TEAM_ACTIONABLE_ITEMS + "Error: No Actionable Items identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ Label label =
+ toolkit.createLabel(teamComp,
+ " " + TEAM_ACTIONABLE_ITEMS + teamWf.getActionableItemsDam().getActionableItemsStr());
+ label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createAssigneesLineHeader(Composite comp, XFormToolkit toolkit) throws OseeCoreException {
+ Composite topLineComp = new Composite(comp, SWT.NONE);
+ topLineComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ topLineComp.setLayout(ALayout.getZeroMarginLayout(1, false));
+ toolkit.adapt(topLineComp);
+ Text text = new Text(topLineComp, SWT.WRAP | SWT.NO_TRIM);
+ toolkit.adapt(text, true, true);
+ text.setText(String.format("Assignee(s): %s", Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees())));
+ }
+
+ private void createTopLineHeader(Composite comp, XFormToolkit toolkit) {
+ Composite topLineComp = new Composite(comp, SWT.NONE);
+ topLineComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ topLineComp.setLayout(ALayout.getZeroMarginLayout(8, false));
+ toolkit.adapt(topLineComp);
+ // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ Text text = new Text(topLineComp, SWT.WRAP | SWT.NO_TRIM);
+ toolkit.adapt(text, true, true);
+ try {
+ text.setText(smaMgr.getEditorHeaderString());
+
+ createOriginatorHeader(topLineComp, toolkit);
+
+ toolkit.createLabel(topLineComp, "Action Id:");
+ text = new Text(topLineComp, SWT.NONE);
+ toolkit.adapt(text, true, true);
+ text.setText(smaMgr.getSma().getParentActionArtifact() == null ? "??" : smaMgr.getSma().getParentActionArtifact().getHumanReadableId());
+ } catch (OseeCoreException ex) {
+ // Do nothing
+ }
+
+ toolkit.createLabel(topLineComp, smaMgr.getSma().getArtifactSuperTypeName() + " Id:");
+ text = new Text(topLineComp, SWT.NONE);
+ toolkit.adapt(text, true, true);
+ text.setText(smaMgr.getSma().getHumanReadableId());
+
+ }
+
+ private void createLatestHeader(Composite comp, XFormToolkit toolkit) {
+ if (smaMgr.isHistoricalVersion()) {
+ Label label =
+ toolkit.createLabel(
+ comp,
+ "This is a historical version of this " + smaMgr.getSma().getArtifactTypeName() + " and can not be edited; Select \"Open Latest\" to view/edit latest version.");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ }
+
+ private void createAnnotationsHeader(Composite comp, XFormToolkit toolkit) {
+ if (smaMgr.getSma().getAnnotations().size() > 0) {
+ new AnnotationComposite(toolkit, comp, SWT.None, smaMgr.getSma());
+ }
+ }
+
+ public static void createSMANotesHeader(Composite comp, XFormToolkit toolkit, SMAManager smaMgr, int horizontalSpan) throws OseeCoreException {
+ // Display SMA Note
+ String note = smaMgr.getSma().getSoleAttributeValue(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName(), "");
+ if (!note.equals("")) {
+ createLabelOrHyperlink(comp, toolkit, horizontalSpan, "Note: " + note, false);
+ }
+ }
+
+ public static void createStateNotesHeader(Composite comp, XFormToolkit toolkit, SMAManager smaMgr, int horizontalSpan, String forStateName) throws MultipleAttributesExist {
+ // Display global Notes
+ for (NoteItem noteItem : smaMgr.getNotes().getNoteItems()) {
+ if (forStateName == null || noteItem.getState().equals(forStateName)) {
+ createLabelOrHyperlink(comp, toolkit, horizontalSpan, noteItem.toHTML(), false);
+ }
+ }
+ }
+
+ private static void createLabelOrHyperlink(Composite comp, XFormToolkit toolkit, final int horizontalSpan, final String str, boolean onlyState) {
+ if (str.length() > 150) {
+ Hyperlink label = toolkit.createHyperlink(comp, Strings.truncate(str, 150) + "...", SWT.NONE);
+ label.setToolTipText("click to view all");
+ label.addListener(SWT.MouseUp, new Listener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ */
+ public void handleEvent(Event event) {
+ new HtmlDialog("Note", null, str).open();
+ }
+ });
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = horizontalSpan;
+ label.setLayoutData(gd);
+ } else {
+ Label label = toolkit.createLabel(comp, str);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = horizontalSpan;
+ label.setLayoutData(gd);
+ }
+ }
+
+ private void createOriginatorHeader(Composite comp, XFormToolkit toolkit) throws OseeCoreException {
+ if (!smaMgr.isCancelled() && !smaMgr.isCompleted()) {
+ toolkit.createLabel(comp, " ");
+ Hyperlink link = toolkit.createHyperlink(comp, ORIGINATOR, SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.promptChangeOriginator()) {
+ updateOrigLabel();
+ smaMgr.getEditor().onDirtied();
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ if (smaMgr.getOriginator() == null) {
+ Label errorLabel = toolkit.createLabel(comp, "Error: No originator identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ origLabel = toolkit.createLabel(comp, smaMgr.getOriginator().getName());
+ origLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ } else {
+ if (smaMgr.getOriginator() == null) {
+ Label errorLabel = toolkit.createLabel(comp, "Error: No originator identified.");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ Label origLabel = toolkit.createLabel(comp, " " + ORIGINATOR + smaMgr.getOriginator().getName());
+ origLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ }
+ }
+ }
+
+ public void updateOrigLabel() throws OseeCoreException {
+ origLabel.setText(smaMgr.getOriginator().getName());
+ origLabel.getParent().layout();
+ if (teamWf != null) {
+ teamActionableItemLabel.setText(teamWf.getActionableItemsDam().getActionableItemsStr());
+ actionActionableItemsLabel.setText(teamWf.getActionableItemsDam().getActionableItemsStr());
+ }
+ }
+
+ public void refresh() throws OseeCoreException {
+ if (smaMgr.getEditor() != null && !smaMgr.isInTransition()) {
+ for (SMAWorkFlowSection section : sections) {
+ section.dispose();
+ }
+ atsBody.dispose();
+ createBody(body);
+ refreshToolbar();
+ }
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java
new file mode 100644
index 00000000000..2e1b223f796
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.help;
+
+import org.eclipse.help.IContext;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsHelpContext implements IContext {
+
+ private final DynamicXWidgetLayoutData layoutData;
+
+ public AtsHelpContext(DynamicXWidgetLayoutData layoutData) {
+ this.layoutData = layoutData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.help.IContext#getRelatedTopics()
+ */
+ public IHelpResource[] getRelatedTopics() {
+ return new IHelpResource[] {new WorkAttrHelpResource(layoutData)};
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.help.IContext#getText()
+ */
+ public String getText() {
+ return "The Action Tracking System (ATS) editor provides a common editor for any workflow.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java
new file mode 100644
index 00000000000..5f4086ee316
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.help;
+
+import java.io.File;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkAttrHelpResource implements IHelpResource {
+
+ private final DynamicXWidgetLayoutData layoutData;
+
+ public WorkAttrHelpResource(DynamicXWidgetLayoutData layoutData) {
+ this.layoutData = layoutData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.help.IHelpResource#getHref()
+ */
+ public String getHref() {
+ if (layoutData != null) {
+ File file = AtsPlugin.getInstance().getPluginStoreFile(layoutData.getStorageName() + ".html");
+ String absFile = "file:\\/\\/" + file.getAbsolutePath();
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.heading(1, layoutData.getName()));
+ if (layoutData.getToolTip() != null)
+ sb.append(AHTML.para(layoutData.getToolTip()));
+ else
+ sb.append(AHTML.para("Enter the " + layoutData.getName()));
+ String html = AHTML.simplePage(sb.toString());
+ AFile.writeFile(file, html);
+ System.out.println("Opening file => " + absFile);
+ return absFile;
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.help.IHelpResource#getLabel()
+ */
+ public String getLabel() {
+ if (layoutData != null) return layoutData.getName();
+ return "";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java
new file mode 100644
index 00000000000..1aceb77b99c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.actions.NewDecisionReviewJob;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AddDecisionReviewService extends WorkPageService {
+
+ private Hyperlink link;
+
+ public AddDecisionReviewService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && isCurrentState(page));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Add Decision Review",
+ "Create a Decision Review and attach it to the current state?")) return;
+ NewDecisionReviewJob job = new NewDecisionReviewJob((TeamWorkFlowArtifact) smaMgr.getSma(), null, true);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ });
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Add Decision Review";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java
new file mode 100644
index 00000000000..fa8df82159d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.ArrayList;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.NewNoteWizard;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.ats.NoteType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AddNoteOperation extends WorkPageService {
+
+ Action action;
+
+ public AddNoteOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performAddNote();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("newNote.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Add Note";
+ }
+
+ private void performAddNote() {
+ try {
+ ArrayList<String> artifactNames = new ArrayList<String>();
+ artifactNames.add(smaMgr.getSma().getDescriptiveName() + " - " + smaMgr.getSma().getDescriptiveName());
+ for (WorkPageDefinition workPageDefinition : smaMgr.getWorkFlowDefinition().getPagesOrdered())
+ if (!workPageDefinition.getPageName().equals(DefaultTeamState.Cancelled.name()) && !workPageDefinition.getPageName().equals(
+ DefaultTeamState.Completed.name())) artifactNames.add(workPageDefinition.getPageName());
+ NewNoteWizard noteWizard = new NewNoteWizard(artifactNames);
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), noteWizard);
+ dialog.create();
+ if (dialog.open() == 0) {
+ String selected = noteWizard.mainPage.artifactList.getSelected().iterator().next().getName();
+ String state = "";
+ if (!selected.startsWith(smaMgr.getSma().getDescriptiveName() + " - ")) state = selected;
+ smaMgr.getNotes().addNote(
+ NoteType.getType(noteWizard.mainPage.typeList.getSelected().iterator().next().getName()), state,
+ noteWizard.mainPage.noteText.get(), UserManager.getUser());
+ smaMgr.getEditor().onDirtied();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (action != null) action.setEnabled(smaMgr.getSma().isReadOnly());
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java
new file mode 100644
index 00000000000..70d4c1a2d3c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewPeerToPeerReviewJob;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.widgets.dialog.StateListAndTitleDialog;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AddPeerToPeerReviewService extends WorkPageService {
+
+ private Hyperlink link;
+
+ public AddPeerToPeerReviewService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && isCurrentState(page));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ StateListAndTitleDialog dialog =
+ new StateListAndTitleDialog("Related Review State",
+ "Select state to that review will be associated with.",
+ smaMgr.getWorkFlowDefinition().getPageNames());
+ dialog.setInitialSelections(new Object[] {smaMgr.getStateMgr().getCurrentStateName()});
+ dialog.setReviewTitle(PeerToPeerReviewArtifact.getDefaultReviewTitle(smaMgr));
+ if (dialog.open() == 0) {
+ if (dialog.getReviewTitle() == null || dialog.getReviewTitle().equals("")) {
+ AWorkbench.popup("ERROR", "Must enter review title");
+ return;
+ }
+ NewPeerToPeerReviewJob job =
+ new NewPeerToPeerReviewJob((TeamWorkFlowArtifact) smaMgr.getSma(), dialog.getReviewTitle(),
+ dialog.getSelectedState());
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Add PeerToPeer Review";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java
new file mode 100644
index 00000000000..5b31ff35af2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAdminStat extends WorkPageService {
+
+ private Label label;
+
+ public AtsAdminStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && isCurrentState(page));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ if (AtsPlugin.isAtsAdmin()) {
+ label = toolkit.createLabel(workGroup, "AtsAdmin");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "AtsAdmin";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java
new file mode 100644
index 00000000000..f77d880f259
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class BlockingReview extends WorkPageService {
+
+ private Label label;
+
+ public BlockingReview(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return AtsPlugin.isAtsAdmin() && (smaMgr.getSma() instanceof ReviewSMArtifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ label = toolkit.createLabel(workGroup, "");
+ label.setToolTipText("A blocking review requires the review be completed before the parent workflow has satisfied option.");
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Review Blocks";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ try {
+ if (label != null && !label.isDisposed()) {
+ label.setText(((ReviewSMArtifact) smaMgr.getSma()).isBlocking() ? "Review Blocks " + ((ReviewSMArtifact) smaMgr.getSma()).getReviewBlockType().name() : "Non-Blocking Review");
+ label.setForeground(((ReviewSMArtifact) smaMgr.getSma()).isBlocking() ? Display.getCurrent().getSystemColor(
+ SWT.COLOR_RED) : null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java
new file mode 100644
index 00000000000..5c8ff74d7af
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CopyActionDetailsService extends WorkPageService {
+
+ private Clipboard clipboard;
+
+ public CopyActionDetailsService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performCopy() {
+ if (clipboard == null) this.clipboard = new Clipboard(null);
+ clipboard.setContents(
+ new Object[] {"\"" + smaMgr.getSma().getArtifactTypeName() + "\" - " + smaMgr.getSma().getHumanReadableId() + " - \"" + smaMgr.getSma().getDescriptiveName() + "\""},
+ new Transfer[] {TextTransfer.getInstance()});
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performCopy();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("copyToClipboard.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Copy " + smaMgr.getSma().getArtifactTypeName() + " details to clipboard";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java
new file mode 100644
index 00000000000..8cc9f76f938
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.stateItem.AtsDebugWorkPage;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts.OpenView;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DebugOperations extends WorkPageService {
+
+ public DebugOperations(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return page.getId().equals(AtsDebugWorkPage.PAGE_ID);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ Hyperlink link = toolkit.createHyperlink(workGroup, "Dirty Report", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ Result result = smaMgr.getEditor().isDirtyResult();
+ result.popup(true);
+ }
+
+ });
+ link = toolkit.createHyperlink(workGroup, "Refresh Dirty", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ smaMgr.getEditor().onDirtied();
+ }
+
+ });
+ link = toolkit.createHyperlink(workGroup, "Open VUE Workflow", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ String hrid = smaMgr.getWorkFlowDefinition().getId().replaceFirst("^.* - ", "");
+ if (hrid.length() != 5)
+ AWorkbench.popup("Open Workflow",
+ "Workflow is NOT an artifact\n\n" + smaMgr.getWorkFlowDefinition().getId());
+ else
+ AtsLib.open(hrid, OpenView.ArtifactEditor);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ link = toolkit.createHyperlink(workGroup, "Open Team Definition", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ if (!(smaMgr.getSma() instanceof TeamWorkFlowArtifact)) {
+ AWorkbench.popup("Open Workflow", "Workflow is NOT TeamWorkflowArtifact");
+ } else {
+ try {
+ AtsLib.open(((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getGuid(),
+ OpenView.ArtifactEditor);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Debug Operations";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.DEBUG_PAGE_CATEGORY;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java
new file mode 100644
index 00000000000..503ee4d241d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.ArtifactEmailWizard;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EmailActionService extends WorkPageService {
+
+ public EmailActionService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performEmail() throws OseeCoreException {
+ ArtifactEmailWizard ew = new ArtifactEmailWizard(smaMgr.getSma());
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), ew);
+ dialog.create();
+ dialog.open();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ try {
+ performEmail();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("email.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Email " + smaMgr.getSma().getArtifactSuperTypeName();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java
new file mode 100644
index 00000000000..f2d492aa827
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.artifact.IFavoriteableArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.Favorites;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class FavoriteOperation extends WorkPageService {
+
+ private final SMAManager smaMgr;
+ private Hyperlink link;
+
+ public FavoriteOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ this.smaMgr = smaMgr;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ (new Favorites(smaMgr.getSma())).toggleFavorite();
+ section.refreshStateServices();
+ }
+ });
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Favorite";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.operation.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) link.setText(((IFavoriteableArtifact) smaMgr.getSma()).amIFavorite() ? "Remove Favorite" : "Add Favorite");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java
new file mode 100644
index 00000000000..c6890383d40
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenInArtifactEditorOperation extends WorkPageService {
+
+ public OpenInArtifactEditorOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performOpen() {
+ ArtifactEditor.editArtifact(smaMgr.getSma());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ if (!AtsPlugin.isAtsAdmin()) return null;
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("artifact_editor.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Artifact Editor";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java
new file mode 100644
index 00000000000..932a4f89444
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.Arrays;
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenInAtsWorldOperation extends WorkPageService {
+
+ public OpenInAtsWorldOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.IAtsEditorToolBarService#run()
+ */
+ public void performOpen() {
+ try {
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact) {
+ ActionArtifact actionArt = ((TeamWorkFlowArtifact) smaMgr.getSma()).getParentActionArtifact();
+ WorldEditor.open(new WorldEditorSimpleProvider("Action " + actionArt.getHumanReadableId(),
+ Arrays.asList(actionArt)));
+ return;
+ } else if (smaMgr.getSma() instanceof StateMachineArtifact) {
+ WorldEditor.open(new WorldEditorSimpleProvider(
+ smaMgr.getSma().getArtifactTypeName() + ": " + smaMgr.getSma().getHumanReadableId(),
+ Arrays.asList(smaMgr.getSma())));
+ return;
+ }
+ OSEELog.logSevere(AtsPlugin.class, "Unhandled artifact type " + smaMgr.getSma().getArtifactTypeName(), true);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.toolbar.IAtsEditorToolBarService#createToolbarService(org.eclipse.osee.ats.editor.SMAManager)
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("globe.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open in ATS World Editor";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java
new file mode 100644
index 00000000000..e824966c876
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenInSkyWalkerOperation extends WorkPageService {
+
+ public OpenInSkyWalkerOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performOpen() {
+ SkyWalkerView.exploreArtifact(smaMgr.getSma());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("skywalker.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Sky Walker";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java
new file mode 100644
index 00000000000..a359fde1e5e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenLatestVersion extends WorkPageService {
+
+ public OpenLatestVersion(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page) && smaMgr.getSma().isHistorical();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ Hyperlink link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ Artifact art = ArtifactQuery.getArtifactFromId(smaMgr.getSma().getGuid(), smaMgr.getSma().getBranch());
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Latest";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java
new file mode 100644
index 00000000000..a40967e4c57
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenParent extends WorkPageService {
+
+ public OpenParent(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ @Override
+ public Action createToolbarService() {
+ if (!isParent()) return null;
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ try {
+ AtsLib.openAtsAction(smaMgr.getSma().getParentSMA(), AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("openParent.gif"));
+ return action;
+ }
+
+ private boolean isParent() {
+ try {
+ return smaMgr.getSma().getParentSMA() != null;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Parent";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java
new file mode 100644
index 00000000000..5d8f1441744
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenTeamDefinition extends WorkPageService {
+
+ public OpenTeamDefinition(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performOpen() {
+ try {
+ AtsLib.openAtsAction(((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition(),
+ AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("team.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Team Definition";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java
new file mode 100644
index 00000000000..c20aa03ffa3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenVersionArtifact extends WorkPageService {
+
+ Action action;
+
+ public OpenVersionArtifact(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Targeted for Version";
+ }
+
+ private void performOpen() {
+ try {
+ if (((TeamWorkFlowArtifact) smaMgr.getSma()).getWorldViewTargetedVersion() != null) ArtifactEditor.editArtifact(((TeamWorkFlowArtifact) smaMgr.getSma()).getWorldViewTargetedVersion());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ if (!(smaMgr.getSma() instanceof TeamWorkFlowArtifact)) return null;
+ action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("version.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (action == null) return;
+ boolean enabled = false;
+ try {
+ enabled = ((TeamWorkFlowArtifact) smaMgr.getSma()).getWorldViewTargetedVersion() != null;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ action.setEnabled(enabled);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java
new file mode 100644
index 00000000000..1bd5fb9e408
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.Set;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class PrivilegedEditService extends WorkPageService {
+
+ private Hyperlink link;
+
+ public PrivilegedEditService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.getEditor().getPriviledgedEditMode() != SMAEditor.PriviledgedEditMode.Off) {
+ if (MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Diable Privileged Edit",
+ "Privileged Edit Mode Enabled.\n\nDisable?\n\nNote: (changes will be saved)")) {
+ smaMgr.getEditor().setPriviledgedEditMode(SMAEditor.PriviledgedEditMode.Off);
+ }
+ } else {
+ Set<User> users = smaMgr.getPrivilegedUsers();
+ if (AtsPlugin.isAtsAdmin()) users.add(UserManager.getUser());
+ StringBuffer sb = new StringBuffer();
+ for (User user : users)
+ sb.append(user.getName() + "\n");
+ String buttons[];
+ boolean iAmPrivileged = users.contains(UserManager.getUser());
+ if (iAmPrivileged)
+ buttons = new String[] {"Override and Edit", "Cancel"};
+ else
+ buttons = new String[] {"Cancel"};
+ MessageDialog ed =
+ new MessageDialog(
+ Display.getCurrent().getActiveShell(),
+ "Privileged Edit",
+ null,
+ "The following users have the ability to edit this " + smaMgr.getSma().getArtifactTypeName() + " in case of emergency.\n\n" + sb.toString(),
+ MessageDialog.QUESTION, buttons, 0);
+ int result = ed.open();
+ if (iAmPrivileged && result == 0) smaMgr.getEditor().setPriviledgedEditMode(
+ SMAEditor.PriviledgedEditMode.Global);
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.operation.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link == null || link.isDisposed()) return;
+ if (smaMgr.getEditor().getPriviledgedEditMode() != SMAEditor.PriviledgedEditMode.Off)
+ link.setText("Privileged Edit Enabled - " + smaMgr.getEditor().getPriviledgedEditMode().name());
+ else
+ link.setText("Privileged Edit");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Privileged Edit";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/RemainingHoursStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/RemainingHoursStat.java
new file mode 100644
index 00000000000..0b32a4feded
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/RemainingHoursStat.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class RemainingHoursStat extends WorkPageService {
+
+ private Label label;
+
+ public RemainingHoursStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentNonCompleteCancelledState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ label.setToolTipText(WorldXViewerFactory.Remaining_Hours_Col.getDescription());
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Remaining Hours";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ try {
+ if (label != null && !label.isDisposed()) {
+ Result result = smaMgr.getSma().isWorldViewRemainHoursValid();
+ if (result.isFalse())
+ label.setText("Remaining Hours: Error\n" + result.getText());
+ else
+ label.setText("Remaining Hours: " + AtsLib.doubleToStrString(smaMgr.getSma().getWorldViewRemainHours()));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java
new file mode 100644
index 00000000000..4256214f6fd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.AtsStateItems;
+import org.eclipse.osee.ats.editor.IAtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.branch.CommitWorkingBranchService;
+import org.eclipse.osee.ats.editor.service.branch.CreateWorkingBranchService;
+import org.eclipse.osee.ats.editor.service.branch.DeleteWorkingBranch;
+import org.eclipse.osee.ats.editor.service.branch.SetAsDefaultBranchService;
+import org.eclipse.osee.ats.editor.service.branch.ShowChangeReportService;
+import org.eclipse.osee.ats.editor.service.branch.ShowMergeManagerService;
+import org.eclipse.osee.ats.editor.service.branch.ShowWorkingBranchService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ServicesArea {
+
+ private final SMAManager smaMgr;
+ private final List<WorkPageService> sideBarServices = new ArrayList<WorkPageService>();
+ private final List<WorkPageService> toolBarServices = new ArrayList<WorkPageService>();
+ private final ArrayList<Group> groups = new ArrayList<Group>();
+ public static String STATISTIC_CATEGORY = "Statistics";
+ public static String OPERATION_CATEGORY = "Operation";
+ public static String DEBUG_PAGE_CATEGORY = "Debug";
+
+ public ServicesArea(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ public void dispose() {
+ for (WorkPageService service : sideBarServices)
+ service.dispose();
+ for (WorkPageService service : toolBarServices)
+ service.dispose();
+ }
+
+ public void loadSidebarServices(AtsWorkPage page) throws OseeCoreException {
+ if (sideBarServices.size() == 0) {
+ // Operations
+ sideBarServices.add(new FavoriteOperation(smaMgr));
+ sideBarServices.add(new SubscribedOperation(smaMgr));
+ sideBarServices.add(new OpenLatestVersion(smaMgr));
+ sideBarServices.add(new DebugOperations(smaMgr));
+ sideBarServices.add(new PrivilegedEditService(smaMgr));
+ // Services
+ sideBarServices.add(new AtsAdminStat(smaMgr));
+ sideBarServices.add(new TotalPercentCompleteStat(smaMgr));
+ sideBarServices.add(new TotalEstimatedHoursStat(smaMgr));
+ sideBarServices.add(new TotalHoursSpentStat(smaMgr));
+ sideBarServices.add(new TargetedForVersionState(smaMgr));
+ sideBarServices.add(new StatePercentCompleteStat(smaMgr));
+ sideBarServices.add(new StateEstimatedHoursStat(smaMgr));
+ sideBarServices.add(new StateHoursSpentStat(smaMgr));
+ sideBarServices.add(new RemainingHoursStat(smaMgr));
+ sideBarServices.add(new AddDecisionReviewService(smaMgr));
+ sideBarServices.add(new AddPeerToPeerReviewService(smaMgr));
+ sideBarServices.add(new BlockingReview(smaMgr));
+ // Add page configured branchable state items
+ if (page != null && (page.isAllowCommitBranch() || page.isAllowCreateBranch())) {
+ if (page.isAllowCreateBranch()) sideBarServices.add(new CreateWorkingBranchService(smaMgr));
+ sideBarServices.add(new ShowWorkingBranchService(smaMgr));
+ sideBarServices.add(new SetAsDefaultBranchService(smaMgr));
+ sideBarServices.add(new ShowChangeReportService(smaMgr));
+ sideBarServices.add(new ShowMergeManagerService(smaMgr));
+ if (page.isAllowCommitBranch()) {
+ sideBarServices.add(new CommitWorkingBranchService(smaMgr, false));
+ }
+ if (AtsPlugin.isAtsAdmin()) {
+ sideBarServices.add(new CommitWorkingBranchService(smaMgr, true));
+ }
+ sideBarServices.add(new DeleteWorkingBranch(smaMgr));
+ }
+ // Add state specific items (these can also contain branch items through extending BranchableStateItem class
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ sideBarServices.addAll(item.getSidebarServices(smaMgr));
+ }
+ }
+ }
+
+ public void loadToolbarServices(AtsWorkPage atsWorkPage) throws OseeCoreException {
+ if (toolBarServices.size() == 0) {
+ // Toolbar Services
+ if (atsWorkPage != null && (atsWorkPage.isAllowCommitBranch() || atsWorkPage.isAllowCreateBranch() || smaMgr.getBranchMgr().isCommittedBranch() || smaMgr.getBranchMgr().isWorkingBranch())) {
+ toolBarServices.add(new ShowMergeManagerService(smaMgr));
+ toolBarServices.add(new ShowChangeReportService(smaMgr));
+ }
+ toolBarServices.add(new OpenParent(smaMgr));
+ toolBarServices.add(new EmailActionService(smaMgr));
+ toolBarServices.add(new AddNoteOperation(smaMgr));
+ toolBarServices.add(new ShowNotesOperation(smaMgr));
+ toolBarServices.add(new OpenInAtsWorldOperation(smaMgr));
+ toolBarServices.add(new OpenInArtifactEditorOperation(smaMgr));
+ toolBarServices.add(new OpenInSkyWalkerOperation(smaMgr));
+ toolBarServices.add(new OpenVersionArtifact(smaMgr));
+ toolBarServices.add(new OpenTeamDefinition(smaMgr));
+ toolBarServices.add(new CopyActionDetailsService(smaMgr));
+ for (IAtsStateItem item : AtsStateItems.getAllStateItems()) {
+ toolBarServices.addAll(item.getToolbarServices(smaMgr));
+ }
+ }
+ }
+
+ public void createSidebarServices(Composite comp, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ loadSidebarServices(page);
+ Set<String> categories = new HashSet<String>();
+ for (WorkPageService service : sideBarServices) {
+ if (service.getSidebarCategory() != null) categories.add(service.getSidebarCategory());
+ }
+ createSidebarServicesArea(comp, STATISTIC_CATEGORY, page, toolkit, section);
+ categories.remove(STATISTIC_CATEGORY);
+ createSidebarServicesArea(comp, OPERATION_CATEGORY, page, toolkit, section);
+ categories.remove(OPERATION_CATEGORY);
+ for (String category : categories) {
+ createSidebarServicesArea(comp, category, page, toolkit, section);
+ }
+ }
+
+ public void createToolbarServices(AtsWorkPage page, IToolBarManager toolbarManager) throws OseeCoreException {
+ try {
+ loadToolbarServices(page);
+ for (final WorkPageService service : toolBarServices) {
+ try {
+ Action action = service.createToolbarService();
+ if (action != null) toolbarManager.add(action);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ private void createSidebarServicesArea(Composite comp, String category, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+
+ // Determine services that are in this category and confirm that they should be displayed
+ List<WorkPageService> displayServices = new ArrayList<WorkPageService>();
+ for (WorkPageService service : sideBarServices)
+ if (service.getSidebarCategory() != null && service.getSidebarCategory().equals(category) && service.isShowSidebarService(page)) displayServices.add(service);
+ if (displayServices.size() == 0) return;
+
+ Group workComp = new Group(comp, SWT.NONE);
+ groups.add(workComp);
+ workComp.setText(category);
+ toolkit.adapt(workComp);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginWidth = layout.marginHeight = 7;
+
+ workComp.setLayout(layout);
+ workComp.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL));
+ toolkit.paintBordersFor(workComp);
+
+ for (WorkPageService service : displayServices)
+ service.createSidebarService(workComp, page, toolkit, section);
+
+ }
+
+ public void refresh() {
+ for (WorkPageService stat : sideBarServices)
+ stat.refresh();
+ for (WorkPageService stat : toolBarServices)
+ stat.refresh();
+ for (Group group : groups)
+ if (group != null && !group.isDisposed()) group.layout();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java
new file mode 100644
index 00000000000..9f87bc9299f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowNotesOperation extends WorkPageService {
+
+ /*
+ * This constructor is used for the toolbar service extension
+ */
+ public ShowNotesOperation(final SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performAddNote() {
+ try {
+ String title =
+ "Notes for " + smaMgr.getSma().getHumanReadableId() + " - \"" + smaMgr.getSma().getDescriptiveName() + "\"";
+ Overview logOver = new Overview();
+ logOver.addHtml(AHTML.heading(3, title));
+ logOver.addNotes(smaMgr.getSma(), "ALL");
+ XResultView.getResultView().addResultPage(
+ new XResultPage(title + " - " + XDate.getDateNow(XDate.MMDDYYHHMM), logOver.getPage(),
+ Manipulations.HTML_MANIPULATIONS));
+ AWorkbench.popup("Complete", "Notes in ATS Results");
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performAddNote();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("note.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Show Notes";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateEstimatedHoursStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateEstimatedHoursStat.java
new file mode 100644
index 00000000000..35dbcbbdca6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateEstimatedHoursStat.java
@@ -0,0 +1,153 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.stateItem.AtsDebugWorkPage;
+import org.eclipse.osee.ats.editor.stateItem.AtsLogWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateEstimatedHoursStat extends WorkPageService {
+
+ private Hyperlink link;
+ private Label label;
+ private AtsWorkPage page;
+
+ public StateEstimatedHoursStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return !page.getId().equals(AtsLogWorkPage.PAGE_ID) && !page.getId().equals(AtsDebugWorkPage.PAGE_ID) && !isCompleteCancelledState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ this.page = page;
+ if (!isCompleteCancelledState(page) && smaMgr.isCurrentState(page.getName())) {
+ link = toolkit.createHyperlink(workGroup, "", SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.promptChangeFloatAttribute(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, false)) section.refreshStateServices();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ } else
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Estimated Hours";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (page == null && link != null && !link.isDisposed()) {
+ link.setText("Estimated Hours Error: page == null");
+ return;
+ } else if (page == null && label != null && !label.isDisposed()) {
+ label.setText("Estimated Hours Error: page == null");
+ return;
+ } else if (page == null) return;
+ try {
+ StringBuffer sb =
+ new StringBuffer(String.format(" State Est Hours: %5.2f",
+ smaMgr.getSma().getEstimatedHoursFromArtifact()));
+ boolean breakoutNeeded = false;
+ if (smaMgr.getTaskMgr().hasTaskArtifacts()) {
+ sb.append(String.format("\n Task Est Hours: %5.2f", smaMgr.getSma().getEstimatedHoursFromTasks(
+ page.getName())));
+ breakoutNeeded = true;
+ }
+ if (smaMgr.getReviewManager().hasReviews()) {
+ sb.append(String.format("\n Review Est Hours: %5.2f", smaMgr.getSma().getEstimatedHoursFromReviews(
+ page.getName())));
+ breakoutNeeded = true;
+ }
+ if (breakoutNeeded) {
+ sb.append(String.format("\nTotal State Est Hours: %5.2f", smaMgr.getSma().getEstimatedHoursTotal(
+ page.getName())));
+ setString(sb.toString());
+ } else {
+ setString(String.format("State Estimated Hours: %5.2f", smaMgr.getSma().getEstimatedHoursTotal()));
+ }
+
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void setString(String str) {
+ if (page != null && link != null && !link.isDisposed())
+ link.setText(str);
+ else if (page != null && label != null && !label.isDisposed())
+ label.setText(str);
+ else if (label != null && !label.isDisposed())
+ label.setText("State Hours Spent Error: page == null");
+ else if (link != null && !link.isDisposed()) link.setText("Estimated Hours Spent Error: page == null");
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java
new file mode 100644
index 00000000000..ec03540d542
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.stateItem.AtsDebugWorkPage;
+import org.eclipse.osee.ats.editor.stateItem.AtsLogWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateHoursSpentStat extends WorkPageService {
+
+ private Hyperlink link;
+ private Label label;
+ private AtsWorkPage page;
+
+ public StateHoursSpentStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return !page.getId().equals(AtsLogWorkPage.PAGE_ID) && !page.getId().equals(AtsDebugWorkPage.PAGE_ID) && !isCompleteCancelledState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ this.page = page;
+ if (!isCompleteCancelledState(page) && smaMgr.isCurrentState(page.getName())) {
+ link = toolkit.createHyperlink(workGroup, "", SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.promptChangeStatus(false)) section.refreshStateServices();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ } else
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Hours Spent";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (page == null && link != null && !link.isDisposed()) {
+ link.setText("State Hours Error: page == null");
+ return;
+ } else if (page == null && label != null && !label.isDisposed()) {
+ label.setText("State Hours Error: page == null");
+ return;
+ } else if (page == null) return;
+ try {
+ StringBuffer sb =
+ new StringBuffer(String.format(" State Hours: %5.2f", smaMgr.getStateMgr().getHoursSpent(
+ page.getName())));
+ boolean breakoutNeeded = false;
+ if (smaMgr.getTaskMgr().hasTaskArtifacts()) {
+ sb.append(String.format("\n Task Hours: %5.2f", smaMgr.getTaskMgr().getHoursSpent(page.getName())));
+ breakoutNeeded = true;
+ }
+ if (smaMgr.getReviewManager().hasReviews()) {
+ sb.append(String.format("\n Review Hours: %5.2f", smaMgr.getReviewManager().getHoursSpent(
+ page.getName())));
+ breakoutNeeded = true;
+ }
+ if (breakoutNeeded) {
+ sb.append(String.format("\nTotal State Hours: %5.2f", smaMgr.getSma().getHoursSpentSMAStateTotal(
+ page.getName())));
+ setString(sb.toString());
+ } else {
+ setString(String.format("State Hours Spent: %5.2f", smaMgr.getStateMgr().getHoursSpent(page.getName())));
+ }
+
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void setString(String str) {
+ if (page != null && link != null && !link.isDisposed())
+ link.setText(str);
+ else if (page != null && label != null && !label.isDisposed())
+ label.setText(str);
+ else if (label != null && !label.isDisposed())
+ label.setText("State Hours Spent Error: page == null");
+ else if (link != null && !link.isDisposed()) link.setText("State Hours Spent Error: page == null");
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java
new file mode 100644
index 00000000000..387fb4241ac
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StatePercentCompleteStat extends WorkPageService {
+
+ private Hyperlink link;
+ private AtsWorkPage page;
+
+ public StatePercentCompleteStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentNonCompleteCancelledState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ this.page = page;
+ link = toolkit.createHyperlink(workGroup, "", SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.promptChangeStatus(false)) section.refreshStateServices();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ link.setToolTipText(TOOLTIP);
+ refresh();
+ }
+
+ public static String TOOLTIP = "Calculation: \n State Percent: amount entered by user\n" +
+ //
+ " Task Percent: total percent of all tasks related to state / number of tasks related to state\n" +
+ //
+ " Review Percent: total percent of all reviews related to state / number of reviews related to state\n" +
+ //
+ "Total State Percent: state percent + all task percents + all review percents / 1 + num tasks + num reviews";
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (page == null && link != null && !link.isDisposed()) {
+ link.setText("State Percent Error: page == null");
+ return;
+ } else if (page == null) return;
+
+ try {
+ StringBuffer sb =
+ new StringBuffer(String.format(" State Percent: %d", smaMgr.getStateMgr().getPercentComplete(
+ page.getName())));
+ boolean breakoutNeeded = false;
+ if (smaMgr.getTaskMgr().hasTaskArtifacts()) {
+ sb.append(String.format("\n Task Percent: %d", smaMgr.getTaskMgr().getPercentComplete(
+ page.getName())));
+ breakoutNeeded = true;
+ }
+ if (smaMgr.getReviewManager().hasReviews()) {
+ sb.append(String.format("\n Review Percent: %d", smaMgr.getReviewManager().getPercentComplete(
+ page.getName())));
+ breakoutNeeded = true;
+ }
+ if (breakoutNeeded) {
+ sb.append(String.format("\nTotal State Percent: %d", smaMgr.getSma().getPercentCompleteSMAStateTotal(
+ page.getName())));
+ if (page != null && link != null && !link.isDisposed()) link.setText(sb.toString());
+ } else {
+ if (page != null && link != null && !link.isDisposed()) link.setText(String.format(
+ "State Percent Complete: %d", smaMgr.getStateMgr().getPercentComplete(page.getName())));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Percent Complete";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java
new file mode 100644
index 00000000000..dfcc47db980
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.osee.ats.artifact.ISubscribableArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.Subscribe;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SubscribedOperation extends WorkPageService {
+
+ private Hyperlink link;
+
+ public SubscribedOperation(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ (new Subscribe(smaMgr.getSma())).toggleSubscribe();
+ section.refreshStateServices();
+ }
+ });
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.operation.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) link.setText(((ISubscribableArtifact) smaMgr.getSma()).amISubscribed() ? "Un-Subscribe" : "Subscribe");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Subscribe";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java
new file mode 100644
index 00000000000..0a75f8e7dfc
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TargetedForVersionState extends WorkPageService {
+
+ private Hyperlink link;
+ private Label label;
+
+ public TargetedForVersionState(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ @Override
+ public void refresh() {
+ String str = "Target Version: ";
+ try {
+ if (smaMgr.getTargetedForVersion() != null) {
+ str += smaMgr.getTargetedForVersion().getDescriptiveName();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ str += ex.getLocalizedMessage();
+ }
+ if (link != null && !link.isDisposed())
+ link.setText(str);
+ else if (label != null && !label.isDisposed()) label.setText(str);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName()) && (smaMgr.getSma() instanceof TeamWorkFlowArtifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, final SMAWorkFlowSection section) throws OseeCoreException {
+ if (!smaMgr.isReleased()) {
+ link = toolkit.createHyperlink(workGroup, "", SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ try {
+ if (smaMgr.promptChangeVersion(
+ AtsPlugin.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased, false)) {
+ refresh();
+ section.refreshStateServices();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ } else
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Target Version";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalEstimatedHoursStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalEstimatedHoursStat.java
new file mode 100644
index 00000000000..e9924a5f80b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalEstimatedHoursStat.java
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TotalEstimatedHoursStat extends WorkPageService {
+
+ private Label label;
+
+ public TotalEstimatedHoursStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ label.setToolTipText("Calculation: sum estimated hours for workflow and all tasks and reviews");
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Total Estimated Hours";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ try {
+ if (label != null && !label.isDisposed()) label.setText("Total Estimated Hours: " + AtsLib.doubleToStrString(smaMgr.getSma().getEstimatedHoursTotal()));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java
new file mode 100644
index 00000000000..b2cf42a3a08
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TotalHoursSpentStat extends WorkPageService {
+
+ private Label label;
+
+ public TotalHoursSpentStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Hours Spent";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ try {
+ if (label != null && !label.isDisposed()) label.setText("Total Hours Spent: " + AtsLib.doubleToStrString(smaMgr.getSma().getHoursSpentSMATotal()));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java
new file mode 100644
index 00000000000..081a7a26b2e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TotalPercentCompleteStat extends WorkPageService {
+
+ private Label label;
+
+ public TotalPercentCompleteStat(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ label.setToolTipText("Calculation: sum of percent for all states (including all tasks and reviews) / # statusable states");
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Percent Complete";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageService#refresh()
+ */
+ @Override
+ public void refresh() {
+ try {
+ if (label != null && !label.isDisposed()) label.setText("Total Percent: " + smaMgr.getSma().getPercentCompleteSMATotal());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java
new file mode 100644
index 00000000000..a15cdf9522a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class WorkPageService {
+
+ protected final SMAManager smaMgr;
+ protected final boolean showSidebarService = true;
+
+ public WorkPageService(SMAManager smaMgr) {
+ super();
+ this.smaMgr = smaMgr;
+ }
+
+ public boolean isCurrentState(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName());
+ }
+
+ public boolean isCurrentNonCompleteCancelledState(AtsWorkPage page) throws OseeCoreException {
+ return smaMgr.isCurrentState(page.getName()) && !isCompleteCancelledState(page);
+ }
+
+ public boolean isCompleteCancelledState(AtsWorkPage page) {
+ return page.isCancelledPage() || page.isCompletePage();
+ }
+
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ }
+
+ public Action createToolbarService() {
+ return null;
+ }
+
+ public void dispose() {
+ }
+
+ public void refresh() {
+ }
+
+ public String getSidebarCategory() {
+ return null;
+ }
+
+ protected IHyperlinkListener readOnlyHyperlinkListener = new IHyperlinkListener() {
+ public void linkActivated(org.eclipse.ui.forms.events.HyperlinkEvent e) {
+ if (smaMgr.isHistoricalVersion())
+ AWorkbench.popup(
+ "Historical Error",
+ "You can not change a historical version of " + smaMgr.getSma().getArtifactTypeName() + ":\n\n" + smaMgr.getSma());
+
+ else
+ AWorkbench.popup(
+ "Authentication Error",
+ "You do not have permissions to edit " + smaMgr.getSma().getArtifactTypeName() + ":" + smaMgr.getSma());
+ };
+
+ public void linkEntered(org.eclipse.ui.forms.events.HyperlinkEvent e) {
+ };
+
+ public void linkExited(org.eclipse.ui.forms.events.HyperlinkEvent e) {
+ };
+ };
+
+ public abstract String getName();
+
+ /**
+ * By default, all sidebar services will be have their createSidebarService method called. This method can be
+ * overridden to determine if it should be called.
+ *
+ * @return the showSidebarService
+ * @throws OseeCoreException TODO
+ */
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return showSidebarService;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitManagerService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitManagerService.java
new file mode 100644
index 00000000000..18151ba9e7a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitManagerService.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CommitManagerService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ public CommitManagerService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(page.getName()) && isEnabled()) {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ smaMgr.getBranchMgr().showCommitManager();
+ }
+ });
+
+ }
+ refresh();
+ OseeEventManager.addListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, org.eclipse.osee.framework.skynet.core.artifact.Branch, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.BranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Commit Manager";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ link.setEnabled(isEnabled());
+ link.setUnderlined(isEnabled());
+ }
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ enabled =
+ ((smaMgr.getSma() instanceof IBranchArtifact) && ((IBranchArtifact) smaMgr.getSma()).getWorkingBranch() != null);
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java
new file mode 100644
index 00000000000..0d7e57dd62e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CommitWorkingBranchService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+ private final boolean overrideStateValidation;
+
+ public CommitWorkingBranchService(SMAManager smaMgr, boolean overrideStateValidation) {
+ super(smaMgr);
+ this.overrideStateValidation = overrideStateValidation;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ if (smaMgr.getStateMgr().getCurrentStateName().equals(page.getName())) {
+ link =
+ toolkit.createHyperlink(workGroup,
+ getName() + (overrideStateValidation ? "\nOverride State Validation" : ""), SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ smaMgr.getBranchMgr().commitWorkingBranch(true, overrideStateValidation);
+ }
+ });
+ }
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Commit Working Branch";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch() && !smaMgr.getBranchMgr().isCommittedBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java
new file mode 100644
index 00000000000..907c58c377c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CreateWorkingBranchService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ public CreateWorkingBranchService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, final AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ Result result = smaMgr.getBranchMgr().createWorkingBranch(page.getId(), true);
+ if (result.isFalse()) result.popup();
+ }
+ });
+
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Create Working Branch";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = !smaMgr.getBranchMgr().isWorkingBranch() && !smaMgr.getBranchMgr().isCommittedBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java
new file mode 100644
index 00000000000..6c865bbb85d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DeleteWorkingBranch extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ public DeleteWorkingBranch(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ if (smaMgr.getSma().isReadOnly())
+ link.addHyperlinkListener(readOnlyHyperlinkListener);
+ else
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ smaMgr.getBranchMgr().deleteEmptyWorkingBranch();
+ }
+ });
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Delete Working Branch";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/SetAsDefaultBranchService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/SetAsDefaultBranchService.java
new file mode 100644
index 00000000000..08802bd0b3b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/SetAsDefaultBranchService.java
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SetAsDefaultBranchService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ // Since this service is only going to be added for the Implement state, Location.AllState will
+ // work
+ public SetAsDefaultBranchService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ performService();
+ }
+ });
+
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Set As Default Branch";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = isEnabled();
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ return smaMgr.getBranchMgr().isWorkingBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ private void performService() {
+ smaMgr.getBranchMgr().setAsDefaultBranch();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java
new file mode 100644
index 00000000000..3e74df75dfe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowChangeReportService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ // Since this service is only going to be added for the Implement state, Location.AllState will
+ // work
+ public ShowChangeReportService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ performService();
+ }
+ });
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ private Action toolBarAction;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ toolBarAction = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ performService();
+ }
+ };
+ toolBarAction.setToolTipText(getName());
+ toolBarAction.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("branch_change.gif"));
+ OseeEventManager.addListener(this);
+ refresh();
+ return toolBarAction;
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ super.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Show Change Report";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = isEnabled();
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ if (toolBarAction != null) {
+ toolBarAction.setEnabled(isEnabled());
+ }
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ if (smaMgr.getBranchMgr().isWorkingBranch()) {
+ enabled = true;
+ } else {
+ enabled = smaMgr.getBranchMgr().isCommittedBranch();
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ private void performService() {
+ smaMgr.getBranchMgr().showChangeReport();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowMergeManagerService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowMergeManagerService.java
new file mode 100644
index 00000000000..f5fceb92e15
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowMergeManagerService.java
@@ -0,0 +1,186 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowMergeManagerService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ // Since this service is only going to be added for the Implement state, Location.AllState will
+ // work
+ public ShowMergeManagerService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, getName(), SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ performService();
+ }
+ });
+
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ private Action toolBarAction;
+
+ @Override
+ public Action createToolbarService() {
+ toolBarAction = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ performService();
+ }
+ };
+ toolBarAction.setToolTipText(getName());
+ toolBarAction.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("branch_merge.gif"));
+
+ OseeEventManager.addListener(this);
+ refresh();
+ return toolBarAction;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Show Merge Manager";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = isEnabled();
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ if (toolBarAction != null) {
+ toolBarAction.setEnabled(isEnabled());
+ }
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch() || smaMgr.getBranchMgr().isCommittedBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ private void performService() {
+ smaMgr.getBranchMgr().showMergeManager();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java
new file mode 100644
index 00000000000..060b46701bc
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java
@@ -0,0 +1,147 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.service.branch;
+
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.AtsBranchManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowWorkingBranchService extends WorkPageService implements IBranchEventListener {
+
+ private Hyperlink link;
+
+ public ShowWorkingBranchService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) throws OseeCoreException {
+ return isCurrentState(page);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createSidebarService(org.eclipse.swt.widgets.Group, org.eclipse.osee.ats.workflow.AtsWorkPage, org.eclipse.osee.framework.ui.skynet.XFormToolkit, org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) throws OseeCoreException {
+ link = toolkit.createHyperlink(workGroup, "Show Working Branch", SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ smaMgr.getBranchMgr().showWorkingBranch();
+ }
+ });
+
+ OseeEventManager.addListener(this);
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return AtsBranchManager.BRANCH_CATEGORY;
+ }
+
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ refresh();
+ }
+ });
+
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java
new file mode 100644
index 00000000000..cc57cb35ff3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import org.eclipse.osee.ats.editor.stateItem.AtsLogWorkPage.EmptyWorkFlowDefinition;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDebugWorkPage extends AtsWorkPage {
+
+ public static String PAGE_ID = "ats.Debug";
+
+ /**
+ * @param name
+ * @param id
+ * @param widgetsXml
+ * @param optionResolver
+ */
+ public AtsDebugWorkPage() {
+ super(new EmptyWorkFlowDefinition("ATS Admin Debug", PAGE_ID), new WorkPageDefinition("ATS Admin Debug", PAGE_ID,
+ null), null, null);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java
new file mode 100644
index 00000000000..268c29b06b6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java
@@ -0,0 +1,111 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.util.widgets.DecisionOption;
+import org.eclipse.osee.ats.util.widgets.XDecisionOptions;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboDam;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionReviewDecisionStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ @Override
+ public String getId() {
+ return "osee.ats.decisionReview.Decision";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#xWidgetCreating(org.eclipse.osee.framework.ui.skynet.widgets.XWidget,
+ * org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.ats.workflow.AtsWorkPage,
+ * org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public Result xWidgetCreating(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ if (xWidget.getLabel().equals(ATSAttributes.DECISION_ATTRIBUTE.getDisplayName())) {
+ if (xWidget == null) throw new OseeStateException("Can't retrieve decision review combo widget to set.");
+ XComboDam decisionComboDam = (XComboDam) xWidget;
+ List<String> options = new ArrayList<String>();
+ XDecisionOptions xDecOptions = new XDecisionOptions((StateMachineArtifact) art);
+ for (DecisionOption opt : xDecOptions.getDecisionOptions())
+ options.add(opt.getName());
+ decisionComboDam.setDataStrings(options.toArray(new String[options.size()]));
+ }
+ return Result.TrueResult;
+ }
+
+ @Override
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section) throws OseeCoreException {
+ DecisionOption decisionOption = getDecisionOption(section);
+ if (decisionOption == null) return null;
+ boolean followUpRequired = decisionOption.isFollowupRequired();
+ if (section.getTransitionToStateCombo() == null || section.getTransitionToStateCombo().getSelected() == null) return null;
+ if (followUpRequired)
+ return DecisionReviewArtifact.DecisionReviewState.Followup.name();
+ else
+ return DecisionReviewArtifact.DecisionReviewState.Completed.name();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToAssignees(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ @Override
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section) throws OseeCoreException {
+ DecisionOption decisionOption = getDecisionOption(section);
+ if (decisionOption == null) return null;
+ return decisionOption.getAssignees();
+ }
+
+ private DecisionOption getDecisionOption(SMAWorkFlowSection section) throws OseeCoreException {
+ XWidget xWidget = section.getPage().getLayoutData(ATSAttributes.DECISION_ATTRIBUTE.getStoreName()).getXWidget();
+ XComboDam decisionComboDam = (XComboDam) xWidget;
+ String decision = decisionComboDam.get();
+ if (decision.equals("")) return null;
+ DecisionReviewArtifact decArt = (DecisionReviewArtifact) section.getSmaMgr().getSma();
+ DecisionOption decisionOption = decArt.decisionOptions.getDecisionOption(decision);
+ return decisionOption;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsDecisionReviewDecisionStateItem - Add decision options to review state based on prepare state's entries.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
new file mode 100644
index 00000000000..386e1aeb4d4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.XDecisionOptions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionReviewPrepareStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return "osee.ats.decisionReview.Prepare";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#transitioning(java.lang.String, java.lang.String,
+ * java.util.Collection)
+ */
+ public Result transitioning(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees) throws OseeCoreException {
+ if (fromState.equals(DecisionReviewArtifact.DecisionReviewState.Prepare) && toState.equals(DecisionReviewArtifact.DecisionReviewState.Decision)) {
+ XDecisionOptions decOptions = new XDecisionOptions(smaMgr.getSma());
+ return decOptions.validateDecisionOptions();
+ }
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsDecisionReviewPrepareStateItem - Add validation of decision options prior to transitioning.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
new file mode 100644
index 00000000000..df67ffaeba2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsForceAssigneesToTeamLeadsStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return AtsStateItem.ALL_STATE_IDS;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.AtsStateItem#transitioned(org.eclipse.osee.ats.editor.SMAManager,
+ * java.lang.String, java.lang.String, java.util.Collection)
+ */
+ @Override
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ super.transitioned(smaMgr, fromState, toState, toAssignees, transaction);
+ if ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && (AtsWorkDefinitions.isForceAssigneesToTeamLeads(smaMgr.getWorkPageDefinitionByName(toState)))) {
+ // Set Assignees to all user roles users
+ try {
+ Collection<User> teamLeads = ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getLeads();
+ smaMgr.getStateMgr().setAssignees(teamLeads);
+ smaMgr.getSma().persistAttributes(transaction);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsForceAssigneesToTeamLeadsStateItem";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsHandleAddReviewRuleStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsHandleAddReviewRuleStateItem.java
new file mode 100644
index 00000000000..76418857d2c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsHandleAddReviewRuleStateItem.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.workflow.item.AtsAddDecisionReviewRule;
+import org.eclipse.osee.ats.workflow.item.AtsAddPeerToPeerReviewRule;
+import org.eclipse.osee.ats.workflow.item.StateEventType;
+import org.eclipse.osee.ats.workflow.item.AtsAddDecisionReviewRule.DecisionParameter;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsHandleAddReviewRuleStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ @Override
+ public String getId() {
+ return AtsStateItem.ALL_STATE_IDS;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.AtsStateItem#transitioned(org.eclipse.osee.ats.editor.SMAManager,
+ * java.lang.String, java.lang.String, java.util.Collection)
+ */
+ @Override
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ super.transitioned(smaMgr, fromState, toState, toAssignees, transaction);
+
+ // Create any decision or peerToPeer reviews for transitionTo and transitionFrom
+ for (String ruleId : Arrays.asList(AtsAddDecisionReviewRule.ID, AtsAddPeerToPeerReviewRule.ID)) {
+ for (WorkRuleDefinition workRuleDef : smaMgr.getWorkRulesStartsWith(ruleId)) {
+ StateEventType eventType = AtsAddDecisionReviewRule.getStateEventType(smaMgr, workRuleDef);
+ String forState = workRuleDef.getWorkDataValue(DecisionParameter.forState.name());
+ if (forState == null || forState.equals("")) {
+ continue;
+ }
+ if (eventType != null && toState.equals(forState) && eventType == StateEventType.TransitionTo) {
+ if (ruleId.startsWith(AtsAddDecisionReviewRule.ID)) {
+ DecisionReviewArtifact decArt = AtsAddDecisionReviewRule.createNewDecisionReview(workRuleDef, smaMgr);
+ if (decArt != null) decArt.persistAttributesAndRelations(transaction);
+ } else if (ruleId.startsWith(AtsAddPeerToPeerReviewRule.ID)) {
+ PeerToPeerReviewArtifact peerArt =
+ AtsAddPeerToPeerReviewRule.createNewPeerToPeerReview(workRuleDef, smaMgr, transaction);
+ if (peerArt != null) peerArt.persistAttributesAndRelations(transaction);
+ }
+ }
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsHandleAddReviewRuleStateItem - If AddDecisionReviewRule or AddPeerToPeerReviewRule exists for this state, create review.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
new file mode 100644
index 00000000000..ed19df60a9a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsLogWorkPage extends AtsWorkPage {
+
+ public static String PAGE_ID = "ats.Log";
+
+ public static class EmptyWorkFlowDefinition extends WorkFlowDefinition {
+
+ /**
+ * @param name
+ * @param id
+ * @param parentId
+ */
+ public EmptyWorkFlowDefinition(String name, String id) {
+ super(name, id, null);
+ }
+
+ }
+
+ /**
+ * @param title
+ */
+ public AtsLogWorkPage(String title) {
+ super(new EmptyWorkFlowDefinition(title, PAGE_ID), new WorkPageDefinition(title, PAGE_ID, null), null, null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.workflow.AtsWorkPage#isDisplayService(org.eclipse.osee.ats.editor.service.WorkPageService)
+ */
+ @Override
+ public boolean isDisplayService(WorkPageService service) {
+ return false;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java
new file mode 100644
index 00000000000..7f8563296e7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java
@@ -0,0 +1,78 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboBooleanDam;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboDam;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPeerToPeerReviewPrepareStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ @Override
+ public String getId() {
+ return "osee.ats.peerToPeerReview.Prepare";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.AtsStateItem#xWidgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget,
+ * org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.ats.workflow.AtsWorkPage,
+ * org.eclipse.osee.framework.skynet.core.artifact.Artifact,
+ * org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void xWidgetCreated(XWidget widget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ super.xWidgetCreated(widget, toolkit, page, art, modListener, isEditable);
+ try {
+ if ((art instanceof ReviewSMArtifact) && ((ReviewSMArtifact) art).getParentSMA() == null) {
+ if (widget.getLabel().equals(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE.getDisplayName())) {
+ XComboBooleanDam decisionComboDam = (XComboBooleanDam) widget;
+ decisionComboDam.setEnabled(false);
+ decisionComboDam.setRequiredEntry(false);
+ } else if (widget.getLabel().equals(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getDisplayName())) {
+ XComboDam decisionComboDam = (XComboDam) widget;
+ decisionComboDam.setEnabled(false);
+ decisionComboDam.setRequiredEntry(false);
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsPeerToPeerReviewPrepareStateItem - If stand-alone review, remove blocking review enablement and required entry.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
new file mode 100644
index 00000000000..1ef91c904c3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.editor.stateItem;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.role.UserRole;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPeerToPeerReviewReviewStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return "osee.ats.peerToPeerReview.Review";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.AtsStateItem#transitioned(org.eclipse.osee.ats.editor.SMAManager,
+ * java.lang.String, java.lang.String, java.util.Collection)
+ */
+ @Override
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees, SkynetTransaction transaction) throws OseeCoreException {
+ super.transitioned(smaMgr, fromState, toState, toAssignees, transaction);
+ if (!toState.equals(PeerToPeerReviewArtifact.PeerToPeerReviewState.Review.name())) return;
+ // Set Assignees to all user roles users
+ Set<User> assignees = new HashSet<User>();
+ PeerToPeerReviewArtifact peerArt = (PeerToPeerReviewArtifact) smaMgr.getSma();
+ for (UserRole uRole : peerArt.getUserRoleManager().getUserRoles())
+ assignees.add(uRole.getUser());
+ assignees.addAll(smaMgr.getStateMgr().getAssignees());
+
+ smaMgr.getStateMgr().setAssignees(assignees);
+ smaMgr.getSma().persistAttributes(transaction);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() throws OseeCoreException {
+ return "AtsPeerToPeerReviewReviewStateItem - assign review state to all members of review as per role in prepare state.";
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparer.java
new file mode 100644
index 00000000000..9e971f48e34
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparer.java
@@ -0,0 +1,91 @@
+package org.eclipse.osee.ats.health;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ *
+ * Compares two change reports to see if the match.
+ *
+ * @author Jeff C. Phillips
+ *
+ */
+public class ChangeReportComparer {
+ private static final String ART = "(<ArtChg>.*?</ArtChg>)";
+ private static final String ATTR = "(<AttrChg>.*?</AttrChg>)";
+ private static final String REL = "(<RelChg>.*?</RelChg>)";
+
+ /**
+ * Compares two change report strings by parsing them and comparing each artifact change, attribute change and relation change.
+ * @param changeReport1
+ * @param changeReport2
+ * @return Returns true if the change reports matches else false.
+ */
+ public boolean compare(String changeReport1, String changeReport2){
+ boolean success = true;
+ ArrayList<ArrayList<String>> data1List = parse(changeReport1);
+ ArrayList<ArrayList<String>> data2List = parse(changeReport2);
+
+ if(data1List.size() != data2List.size() || data1List.get(0).size() != data2List.get(0).size() || data1List.get(1).size() != data2List.get(1).size()
+ || data1List.get(2).size() != data2List.get(2).size()){
+ throw new IllegalArgumentException("The change reports must have the same number of items");
+ }
+ try{
+ for(int i = 0; i < data1List.size() ; i++){
+ for(int j = 0; j < data1List.get(i).size() ; j++){
+ if(! data1List.get(i).get(j).equals(data2List.get(i).get(j))){
+ success = false;
+ System.err.println(data1List.get(i).get(j));
+ System.err.println(data2List.get(i).get(j));
+ System.err.println("---------------------------------------------------");
+ }
+ }
+ }}
+ catch(Exception ex){
+ ex.getLocalizedMessage();
+ }
+ return success;
+ }
+
+ /**
+ *
+ * @param changeReportString
+ * @return Returns Three ArrayLists. 0 index for artifact changes, 1 index for attribute changes and 2 index for relation changes.
+ */
+ public ArrayList<ArrayList<String>> parse(String changeReportString) {
+ ArrayList<ArrayList<String>> changeLists = new ArrayList<ArrayList<String>>(3);
+ ArrayList<String> artifactChanges = new ArrayList<String>();
+ ArrayList<String> attrChanges = new ArrayList<String>();
+ ArrayList<String> relChanges = new ArrayList<String>();
+
+ Matcher artChangeMatch = Pattern.compile(ART).matcher(changeReportString);
+
+ while (artChangeMatch.find()) {
+ artifactChanges.add(artChangeMatch.group(0));
+ }
+
+ Matcher attrChangeMatch = Pattern.compile(ATTR).matcher(changeReportString);
+
+ while (attrChangeMatch.find()) {
+ attrChanges.add(attrChangeMatch.group(0));
+ }
+
+ Matcher relChangeMatch = Pattern.compile(REL).matcher(changeReportString);
+
+ while (relChangeMatch.find()) {
+ relChanges.add(relChangeMatch.group(0));
+ }
+
+ Collections.sort(artifactChanges);
+ Collections.sort(attrChanges);
+ Collections.sort(relChanges);
+
+ changeLists.add(artifactChanges);
+ changeLists.add(attrChanges);
+ changeLists.add(relChanges);
+
+ return changeLists;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparerDriver.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparerDriver.java
new file mode 100644
index 00000000000..edeff6cef7b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ChangeReportComparerDriver.java
@@ -0,0 +1,24 @@
+package org.eclipse.osee.ats.health;
+
+/**
+ *
+ * @author Jeff C. Phillips
+ *
+ */
+public class ChangeReportComparerDriver {
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+
+ String string = "<ArtChg><brId>2</brId><artTId>33</artTId><gamma>232122</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>304947</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>DELETED</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>304948</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>DELETED</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189309</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168584</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189310</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168585</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189313</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168588</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189314</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168589</attrId><attrTId>101</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189316</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168590</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189317</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168591</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189320</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168594</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189321</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168595</attrId><attrTId>101</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>227242</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168586</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>227244</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168592</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>228743</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168587</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>228747</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168593</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232069</gamma><artId>22301</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232069</gamma><artId>22301</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166540</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232071</gamma><artId>22230</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232071</gamma><artId>22230</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166042</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232073</gamma><artId>22231</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232073</gamma><artId>22231</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166049</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232077</gamma><artId>22275</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232077</gamma><artId>22275</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166358</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232079</gamma><artId>22229</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232079</gamma><artId>22229</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166035</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232081</gamma><artId>22102</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232081</gamma><artId>22102</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>165146</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232085</gamma><artId>21750</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232085</gamma><artId>21750</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162684</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232087</gamma><artId>21751</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232087</gamma><artId>21751</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162691</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232091</gamma><artId>21645</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232091</gamma><artId>21645</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>161951</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232093</gamma><artId>21647</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232093</gamma><artId>21647</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>161965</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232097</gamma><artId>23637</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232097</gamma><artId>23637</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175358</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232099</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232099</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175361</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232100</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175365</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232102</gamma><artId>23640</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232102</gamma><artId>23640</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175379</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232104</gamma><artId>23643</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232104</gamma><artId>23643</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175400</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232106</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232106</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175333</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232107</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175337</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232109</gamma><artId>23248</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232109</gamma><artId>23248</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>172777</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232111</gamma><artId>23115</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232111</gamma><artId>23115</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>171930</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232113</gamma><artId>22445</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232113</gamma><artId>22445</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>167567</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232115</gamma><artId>22489</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232115</gamma><artId>22489</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>167875</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232117</gamma><artId>22267</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232117</gamma><artId>22267</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166302</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232119</gamma><artId>22269</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232119</gamma><artId>22269</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166316</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232121</gamma><artId>22270</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232121</gamma><artId>22270</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166323</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232123</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194682</attrId><attrTId>107</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232124</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194683</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232125</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194684</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232126</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194685</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232127</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194686</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232128</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194687</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232067</gamma><artId>22300</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232067</gamma><artId>22300</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166533</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232075</gamma><artId>22272</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232075</gamma><artId>22272</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166337</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232083</gamma><artId>21761</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232083</gamma><artId>21761</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162761</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232089</gamma><artId>21704</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232089</gamma><artId>21704</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162363</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232095</gamma><artId>23636</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232095</gamma><artId>23636</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175351</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><RelChg><brId>2</brId><artTId>-1</artTId><gamma>242131</gamma><artId>24162</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><bArtId>26520</bArtId><relId>34657</relId><rat>null</rat><aOrdr>-2</aOrdr><bOrdr>-2</bOrdr><relTId>1</relTId><hist>true</hist></RelChg>";
+ String string2 = "<ArtChg><brId>2</brId><artTId>33</artTId><gamma>232123</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>304947</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>DELETED</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>304948</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>DELETED</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189309</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168584</attrId><attrTId>13</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189310</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168585</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189313</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168588</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189314</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168589</attrId><attrTId>101</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189316</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168590</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189317</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168591</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189320</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168594</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>189321</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168595</attrId><attrTId>101</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>227242</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168586</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>227244</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168592</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>228743</gamma><artId>22592</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168587</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>228747</gamma><artId>22593</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>ARTIFACT_DELETED</mType><cType>OUTGOING</cType><aModType>DELETED</aModType><attrId>168593</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232069</gamma><artId>22301</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232069</gamma><artId>22301</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166540</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232071</gamma><artId>22230</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232071</gamma><artId>22230</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166042</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232073</gamma><artId>22231</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232073</gamma><artId>22231</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166049</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232077</gamma><artId>22275</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232077</gamma><artId>22275</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166358</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232079</gamma><artId>22229</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232079</gamma><artId>22229</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166035</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232081</gamma><artId>22102</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232081</gamma><artId>22102</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>165146</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232085</gamma><artId>21750</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232085</gamma><artId>21750</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162684</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232087</gamma><artId>21751</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232087</gamma><artId>21751</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162691</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232091</gamma><artId>21645</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232091</gamma><artId>21645</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>161951</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232093</gamma><artId>21647</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232093</gamma><artId>21647</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>161965</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232097</gamma><artId>23637</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232097</gamma><artId>23637</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175358</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232099</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232099</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175361</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232100</gamma><artId>23638</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175365</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232102</gamma><artId>23640</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232102</gamma><artId>23640</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175379</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232104</gamma><artId>23643</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232104</gamma><artId>23643</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175400</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232106</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232106</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175333</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232107</gamma><artId>23634</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175337</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232109</gamma><artId>23248</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232109</gamma><artId>23248</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>172777</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232111</gamma><artId>23115</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232111</gamma><artId>23115</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>171930</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232113</gamma><artId>22445</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232113</gamma><artId>22445</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>167567</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>77</artTId><gamma>232115</gamma><artId>22489</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>77</artTId><gamma>232115</gamma><artId>22489</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>167875</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232117</gamma><artId>22267</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232117</gamma><artId>22267</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166302</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232119</gamma><artId>22269</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232119</gamma><artId>22269</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166316</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232121</gamma><artId>22270</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232121</gamma><artId>22270</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166323</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232123</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194682</attrId><attrTId>107</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232124</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194683</attrId><attrTId>12</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232125</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194684</attrId><attrTId>706</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232126</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194685</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232127</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194686</attrId><attrTId>109</attrTId><hist>true</hist></AttrChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232128</gamma><artId>26520</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><aModType>NEW</aModType><attrId>194687</attrId><attrTId>108</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232067</gamma><artId>22300</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232067</gamma><artId>22300</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166533</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232075</gamma><artId>22272</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232075</gamma><artId>22272</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>166337</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232083</gamma><artId>21761</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232083</gamma><artId>21761</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162761</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232089</gamma><artId>21704</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232089</gamma><artId>21704</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>162363</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><ArtChg><brId>2</brId><artTId>33</artTId><gamma>232095</gamma><artId>23636</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><hist>true</hist></ArtChg><AttrChg><brId>2</brId><artTId>33</artTId><gamma>232095</gamma><artId>23636</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>CHANGE</mType><cType>OUTGOING</cType><aModType>CHANGE</aModType><attrId>175351</attrId><attrTId>962</attrTId><hist>true</hist></AttrChg><RelChg><brId>2</brId><artTId>-1</artTId><gamma>232131</gamma><artId>24162</artId><tTranId>4524</tTranId><fTranId>4523</fTranId><mType>NEW</mType><cType>OUTGOING</cType><bArtId>26520</bArtId><relId>34657</relId><rat>null</rat><aOrdr>-2</aOrdr><bOrdr>-2</bOrdr><relTId>1</relTId><hist>true</hist></RelChg>";
+
+
+ ChangeReportComparer comparer = new ChangeReportComparer();
+ System.out.println(comparer.compare(string, string));
+ System.out.println(comparer.compare(string, string2));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TxImportedValidateChangeReports.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TxImportedValidateChangeReports.java
new file mode 100644
index 00000000000..8588713d632
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TxImportedValidateChangeReports.java
@@ -0,0 +1,292 @@
+/*
+ * Created on Nov 17, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.health;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.core.data.OseeInfo;
+import org.eclipse.osee.framework.db.connection.ConnectionHandlerStatement;
+import org.eclipse.osee.framework.db.connection.core.SequenceManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.GeneralData;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TxImportedValidateChangeReports extends AbstractBlam {
+
+ private static final String[] ARTIFACT_ID_ALIASES = new String[] {"artId", "bArtId", "aOrdr", "bOrdr"};
+ private static final String BRANCH_ID_ALIASES = "brId";
+ private static final String GAMMA_ID_ALIASES = "gamma";
+ private static final String[] TRANSACTION_ID_ALIASES = new String[] {"tTranId", "fTranId"};
+ private static final String ARTIFACT_TYPE_ID = "artTId";
+ private static final String ATTRIBUTE_TYPE_ID = "attrTId";
+ private static final String RELATION_TYPE_ID = "relTId";
+ private static final String ATTRIBUTE_ID = "attrId";
+ private static final String RELATION_ID = "relId";
+ private static final String EMPTY_STRING = "";
+
+ private static final String VCR_ROOT_ELEMENT_TAG = ValidateChangeReports.VCR_ROOT_ELEMENT_TAG;
+ private static final String VCR_DB_GUID = ValidateChangeReports.VCR_DB_GUID;
+
+ private static final Matcher NUMERICAL_MATCH = Pattern.compile("\\d+").matcher(EMPTY_STRING);
+ private static final Matcher SOURCE_DB_GUID_MATCHER =
+ Pattern.compile("\\s*<" + VCR_ROOT_ELEMENT_TAG + "\\s*" + VCR_DB_GUID + "=\"(.*?)\"\\s*>").matcher(
+ EMPTY_STRING);
+ private static final Matcher XML_TAGGED_IDS_MATCHER = Pattern.compile("<(.*?)>(\\d+)</(.*?)>").matcher(EMPTY_STRING);
+
+ private Map<String, ImportedId> translatorMap;
+ private String currentDbGuid;
+
+ private void setup(String databaseTargetId) throws OseeDataStoreException {
+ List<ImportedId> importtedIds = getImportedIds();
+ for (ImportedId importedId : importtedIds) {
+ appendResultLine(importedId.getSequence() + "\n");
+ importedId.load(databaseTargetId);
+ }
+
+ this.translatorMap = new HashMap<String, ImportedId>();
+ for (ImportedId translator : importtedIds) {
+ for (String alias : translator.getAliases()) {
+ translatorMap.put(alias, translator);
+ }
+ }
+
+ this.currentDbGuid = OseeInfo.getValue("osee.db.guid");
+ }
+
+ private void cleanUp() {
+ if (translatorMap != null && !translatorMap.isEmpty()) {
+ for (String key : translatorMap.keySet()) {
+ translatorMap.get(key).clear();
+ }
+ translatorMap.clear();
+ }
+ this.currentDbGuid = null;
+ }
+
+ private List<ImportedId> getImportedIds() {
+ List<ImportedId> translators = new ArrayList<ImportedId>();
+ translators.add(new ImportedId(SequenceManager.GAMMA_ID_SEQ, GAMMA_ID_ALIASES));
+ translators.add(new ImportedId(SequenceManager.TRANSACTION_ID_SEQ, TRANSACTION_ID_ALIASES));
+ translators.add(new ImportedId(SequenceManager.BRANCH_ID_SEQ, BRANCH_ID_ALIASES));
+ translators.add(new ImportedId(SequenceManager.ART_TYPE_ID_SEQ, ARTIFACT_TYPE_ID));
+ translators.add(new ImportedId(SequenceManager.ATTR_TYPE_ID_SEQ, ATTRIBUTE_TYPE_ID));
+ translators.add(new ImportedId(SequenceManager.REL_LINK_TYPE_ID_SEQ, RELATION_TYPE_ID));
+ translators.add(new ImportedId(SequenceManager.ART_ID_SEQ, ARTIFACT_ID_ALIASES));
+ translators.add(new ImportedId(SequenceManager.ATTR_ID_SEQ, ATTRIBUTE_ID));
+ translators.add(new ImportedId(SequenceManager.REL_LINK_ID_SEQ, RELATION_ID));
+ return translators;
+ }
+
+ private long translate(String tag, long original) {
+ long toReturn = original;
+ if (Strings.isValid(tag)) {
+ ImportedId importedId = translatorMap.get(tag);
+ if (importedId != null) {
+ toReturn = importedId.getFromCache(original);
+ }
+ }
+ return toReturn;
+ }
+
+ private String getDataDbGuid(String data) {
+ String toReturn = null;
+ SOURCE_DB_GUID_MATCHER.reset(data);
+ if (SOURCE_DB_GUID_MATCHER.find()) {
+ toReturn = SOURCE_DB_GUID_MATCHER.group(1);
+ }
+ return toReturn != null ? toReturn : EMPTY_STRING;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ try {
+ Branch branch = AtsPlugin.getAtsBranch();
+ String databaseTargetId = variableMap.getString("Import Db Id");
+ boolean shouldIncludeItemsWithoutDbId = variableMap.getBoolean("Include items without database id");
+ if (!Strings.isValid(databaseTargetId)) {
+ throw new OseeArgumentException("Invalid database target id");
+ }
+
+ databaseTargetId = databaseTargetId.trim();
+ setup(databaseTargetId);
+
+ SkynetTransaction transaction = new SkynetTransaction(branch);
+ List<Artifact> artifacts =
+ ArtifactQuery.getArtifactsFromTypeAndName(GeneralData.ARTIFACT_TYPE, "VCR_%", branch);
+ for (Artifact artifact : artifacts) {
+ String data = artifact.getSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME);
+ String name = artifact.getDescriptiveName();
+ try {
+ String dataDbGuid = getDataDbGuid(data);
+ if (Strings.isValid(dataDbGuid) || shouldIncludeItemsWithoutDbId) {
+ if (databaseTargetId.equals(dataDbGuid) || shouldIncludeItemsWithoutDbId) {
+ if (!currentDbGuid.equals(dataDbGuid)) {
+ String modified = translateImportedData(data);
+ modified = updateSourceGuid(currentDbGuid, modified);
+ artifact.setSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, modified);
+ artifact.persistAttributes(transaction);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ throw new OseeCoreException(String.format("Error processing [%s]", name), ex);
+ }
+ }
+ transaction.execute();
+ } finally {
+ cleanUp();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ public String getXWidgetsXml() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append("<XWidget xwidgetType=\"XText\" displayName=\"Import Db Id\" defaultValue=\"AAABHL_5XvkAFHT8QsrrPQ\"/>");
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"Include items without database id\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ private static boolean isNumerical(String value) {
+ boolean result = false;
+ if (Strings.isValid(value)) {
+ NUMERICAL_MATCH.reset(value);
+ result = NUMERICAL_MATCH.matches();
+ }
+ return result;
+ }
+
+ private String translateImportedData(String data) {
+ ChangeSet changeSet = new ChangeSet(data);
+ XML_TAGGED_IDS_MATCHER.reset(data);
+ while (XML_TAGGED_IDS_MATCHER.find()) {
+ String tag = XML_TAGGED_IDS_MATCHER.group(3);
+ tag = tag.toLowerCase().trim();
+ String value = XML_TAGGED_IDS_MATCHER.group(2);
+ if (isNumerical(value)) {
+ long original = Long.parseLong(value);
+ long newValue = translate(tag, original);
+ if (original != newValue) {
+ changeSet.replace(XML_TAGGED_IDS_MATCHER.start(2), XML_TAGGED_IDS_MATCHER.end(2),
+ Long.toString(newValue));
+ }
+ }
+ }
+ return changeSet.applyChangesToSelf().toString();
+ }
+
+ private String updateSourceGuid(String currentDbGuid, String data) throws OseeStateException {
+ String toReturn = null;
+ ChangeSet changeSet = new ChangeSet(data);
+ SOURCE_DB_GUID_MATCHER.reset(data);
+ if (SOURCE_DB_GUID_MATCHER.find()) {
+ String id = SOURCE_DB_GUID_MATCHER.group(1);
+ if (!currentDbGuid.equals(id)) {
+ changeSet.replace(SOURCE_DB_GUID_MATCHER.start(1), SOURCE_DB_GUID_MATCHER.end(1), currentDbGuid);
+ toReturn = changeSet.applyChangesToSelf().toString();
+ } else {
+ toReturn = data;
+ }
+ } else {
+ if (!data.contains(VCR_ROOT_ELEMENT_TAG)) {
+ toReturn =
+ String.format("<%s dbGuid=\"%s\">%s</%s>", VCR_ROOT_ELEMENT_TAG, currentDbGuid, data,
+ VCR_ROOT_ELEMENT_TAG);
+ } else {
+ throw new OseeStateException("Error updating dbId");
+ }
+ }
+ return toReturn;
+ }
+ private final class ImportedId {
+ private static final String SELECT_IDS_BY_DB_SOURCE_AND_SEQ_NAME =
+ "SELECT original_id, mapped_id FROM osee_import_source ois, osee_import_map oim, osee_import_index_map oiim WHERE ois.import_id = oim.import_id AND oim.sequence_id = oiim.sequence_id AND oiim.sequence_id = oiim.sequence_id AND ois.db_source_guid = ? AND oim.sequence_name = ?";
+
+ private final String sequenceName;
+ private final Map<Long, Long> originalToMapped;
+ private final Set<String> aliases;
+
+ ImportedId(String sequenceName, String... aliases) {
+ this.sequenceName = sequenceName;
+ this.originalToMapped = new HashMap<Long, Long>();
+ this.aliases = new HashSet<String>();
+ if (aliases != null && aliases.length > 0) {
+ for (String alias : aliases) {
+ this.aliases.add(alias.toLowerCase());
+ }
+ }
+ }
+
+ public void clear() {
+ this.originalToMapped.clear();
+ this.aliases.clear();
+ }
+
+ public boolean hasAliases() {
+ return this.aliases.size() > 0;
+ }
+
+ public Set<String> getAliases() {
+ return this.aliases;
+ }
+
+ public String getSequence() {
+ return this.sequenceName;
+ }
+
+ public Long getFromCache(Long original) {
+ Long newVersion = null;
+ if (original <= 0L) {
+ newVersion = original;
+ } else {
+ newVersion = this.originalToMapped.get(original);
+ }
+ return newVersion;
+ }
+
+ public void load(String sourceDatabaseId) throws OseeDataStoreException {
+ ConnectionHandlerStatement chStmt = new ConnectionHandlerStatement();
+ try {
+ originalToMapped.clear();
+ chStmt.runPreparedQuery(10000, SELECT_IDS_BY_DB_SOURCE_AND_SEQ_NAME, sourceDatabaseId, getSequence());
+ while (chStmt.next()) {
+ originalToMapped.put(chStmt.getLong("original_id"), chStmt.getLong("mapped_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
new file mode 100644
index 00000000000..3ce4927ec28
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateAtsDatabase.java
@@ -0,0 +1,368 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.health;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSLog;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ValidateAtsDatabase extends XNavigateItemAction {
+
+ private final boolean fixAssignees = true;
+ private final boolean fixAttributeValues = false;
+
+ /**
+ * @param parent
+ */
+ public ValidateAtsDatabase(XNavigateItem parent) {
+ super(parent, "Validate ATS Database");
+ }
+
+ public ValidateAtsDatabase() {
+ this(null);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new Report(getName()), true);
+ }
+
+ public class Report extends Job {
+
+ public Report(String name) {
+ super(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final XResultData rd = new XResultData();
+ runIt(monitor, rd);
+ rd.report(getName());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private Collection<Artifact> artifacts;
+ private XResultData xResultData;
+ private IProgressMonitor monitor;
+
+ private void runIt(IProgressMonitor monitor, XResultData xResultData) throws OseeCoreException {
+ this.monitor = monitor;
+ SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
+ OseeLog.registerLoggerListener(monitorLog);
+ this.xResultData = xResultData;
+ monitor.beginTask(getName(), 10);
+ loadAtsBranchArtifacts();
+ monitor.worked(1);
+ testAtsBranchAttributeValues();
+ monitor.worked(1);
+ testAtsActionsHaveTeamWorkflow();
+ monitor.worked(1);
+ testAtsWorkflowsHaveAction();
+ monitor.worked(1);
+ testAtsWorkflowsHaveZeroOrOneVersion();
+ monitor.worked(1);
+ testTasksHaveParentWorkflow();
+ monitor.worked(1);
+ testReviewsHaveParentWorkflowOrActionableItems();
+ monitor.worked(1);
+ testTeamWorkflows();
+ monitor.worked(1);
+ testStateMachineAssignees();
+ monitor.worked(1);
+ testAtsLogs();
+ monitor.worked(1);
+ this.xResultData.reportSevereLoggingMonitor(monitorLog);
+ xResultData.log(monitor, "Completed processing " + artifacts.size() + " artifacts.");
+ }
+
+ public void testTeamWorkflows() throws OseeCoreException {
+ xResultData.log(monitor, "testTeamWorkflows");
+ for (Artifact art : artifacts) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) art;
+ try {
+ if (teamArt.getActionableItemsDam().getActionableItems().size() == 0) {
+ xResultData.logError("TeamWorkflow " + teamArt.getHumanReadableId() + " has 0 ActionableItems");
+ }
+ if (teamArt.getTeamDefinition() == null) {
+ xResultData.logError("TeamWorkflow " + teamArt.getHumanReadableId() + " has no TeamDefinition");
+ }
+ } catch (Exception ex) {
+ xResultData.logError(teamArt.getArtifactTypeName() + " " + teamArt.getHumanReadableId() + " exception testing testTeamWorkflows: " + ex.getLocalizedMessage());
+ }
+ }
+ }
+ }
+
+ public void loadAtsBranchArtifacts() throws OseeCoreException {
+ xResultData.log(monitor, "testLoadAllCommonArtifacts - Started " + XDate.getDateNow(XDate.MMDDYYHHMM));
+ artifacts = ArtifactQuery.getArtifactsFromBranch(AtsPlugin.getAtsBranch(), false);
+ if (xResultData == null) {
+ xResultData = new XResultData();
+ }
+ if (artifacts.size() == 0) {
+ xResultData.logError("Artifact load returned 0 artifacts to check");
+ }
+ xResultData.log(monitor, "testLoadAllCommonArtifacts - Completed " + XDate.getDateNow(XDate.MMDDYYHHMM));
+ }
+
+ public void testAtsBranchAttributeValues() throws OseeCoreException {
+ xResultData.log(monitor, "testAtsBranchAttributeValues");
+ for (Artifact artifact : artifacts) {
+ for (Attribute<?> attr : artifact.getAttributes(false)) {
+ if (attr.getValue() == null) {
+ xResultData.logError("Artifact: " + artifact.getHumanReadableId() + " Types: " + artifact.getArtifactTypeName() + " - Null Attribute: " + attr.getNameValueDescription());
+ if (fixAttributeValues) {
+ attr.delete();
+ }
+ }
+ }
+ if (artifact.isDirty()) artifact.persistAttributes();
+ }
+ }
+
+ public void testAtsActionsHaveTeamWorkflow() throws OseeCoreException {
+ xResultData.log(monitor, "testAtsActionsHaveTeamWorkflow");
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof ActionArtifact) {
+ if (((ActionArtifact) artifact).getTeamWorkFlowArtifacts().size() == 0) {
+ xResultData.logError("Action " + artifact.getHumanReadableId() + " has no Team Workflows\n");
+ }
+ }
+ }
+ }
+
+ public void testAtsWorkflowsHaveAction() throws OseeCoreException {
+ xResultData.log(monitor, "testAtsActionsHaveTeamWorkflow");
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ if (((TeamWorkFlowArtifact) artifact).getParentActionArtifact() == null) {
+ xResultData.logError("Team " + artifact.getHumanReadableId() + " has no parent Action\n");
+ }
+ }
+ }
+ }
+
+ public void testAtsWorkflowsHaveZeroOrOneVersion() throws OseeCoreException {
+ xResultData.log(monitor, "testAtsWorkflowsHaveZeroOrOneVersion");
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
+ if (teamArt.getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Version).size() > 1) {
+ xResultData.logError("Team workflow " + teamArt.getHumanReadableId() + " has " + teamArt.getRelatedArtifacts(
+ AtsRelation.TeamWorkflowTargetedForVersion_Version).size() + " versions");
+ }
+ }
+ }
+
+ }
+
+ public void testTasksHaveParentWorkflow() throws OseeCoreException {
+ xResultData.log(monitor, "testTasksHaveParentWorkflow");
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof TaskArtifact) {
+ TaskArtifact taskArtifact = (TaskArtifact) artifact;
+ if (taskArtifact.getRelatedArtifacts(AtsRelation.SmaToTask_Sma).size() != 1) {
+ xResultData.logError("Task " + taskArtifact.getHumanReadableId() + " has " + taskArtifact.getRelatedArtifacts(
+ AtsRelation.SmaToTask_Sma).size() + " parents.");
+ }
+ }
+ }
+ }
+
+ public void testReviewsHaveParentWorkflowOrActionableItems() throws OseeCoreException {
+ xResultData.log(monitor, "testReviewsHaveParentWorkflowOrActionableItems");
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof ReviewSMArtifact) {
+ ReviewSMArtifact reviewArtifact = (ReviewSMArtifact) artifact;
+ if (reviewArtifact.getRelatedArtifacts(AtsRelation.TeamWorkflowToReview_Team).size() == 0 && reviewArtifact.getActionableItemsDam().getActionableItemGuids().size() == 0) {
+ xResultData.logError("Review " + reviewArtifact.getHumanReadableId() + " has 0 related parents and 0 actionable items.");
+ }
+ }
+ }
+ }
+
+ public void testAtsLogs() throws OseeCoreException {
+ xResultData.log(monitor, "testAtsLogs");
+ for (Artifact art : artifacts) {
+ if (art instanceof StateMachineArtifact) {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ try {
+ ATSLog log = sma.getSmaMgr().getLog();
+ if (log.getOriginator() == null) {
+ try {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " originator == null");
+ } catch (Exception ex) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " exception accessing originator: " + ex.getLocalizedMessage());
+ }
+ }
+ for (String stateName : Arrays.asList("Completed", "Cancelled")) {
+ if (sma.getSmaMgr().getStateMgr().getCurrentStateName().equals(stateName)) {
+ LogItem logItem = log.getStateEvent(LogType.StateEntered, stateName);
+ if (logItem == null) {
+ try {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " state \"" + stateName + "\" logItem == null");
+ } catch (Exception ex) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " exception accessing logItem: " + ex.getLocalizedMessage());
+
+ }
+ }
+ if (logItem.getDate() == null) {
+ try {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " state \"" + stateName + "\" logItem.date == null");
+ } catch (Exception ex) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " exception accessing logItem.date: " + ex.getLocalizedMessage());
+
+ }
+ }
+ }
+ }
+ // Generate html log which will exercise all the conversions
+ log.getHtml();
+ // Verify that all users are resolved
+ for (LogItem logItem : sma.getSmaMgr().getLog().getLogItems()) {
+ if (logItem.getUser() == null) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " user == null for userId \"" + logItem.getUserId() + "\"");
+ }
+ }
+ } catch (Exception ex) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " exception accessing AtsLog: " + ex.getLocalizedMessage());
+ }
+ }
+ }
+ }
+
+ public void testStateMachineAssignees() throws OseeCoreException {
+ xResultData.log(monitor, "testStateMachineAssignees");
+ User unAssignedUser = UserManager.getUser(SystemUser.UnAssigned);
+ User noOneUser = UserManager.getUser(SystemUser.NoOne);
+ for (Artifact art : artifacts) {
+ if (art instanceof StateMachineArtifact) {
+ try {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ SMAManager smaMgr = new SMAManager(sma);
+ if ((smaMgr.isCompleted() || smaMgr.isCancelled()) && smaMgr.getStateMgr().getAssignees().size() > 0) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " cancel/complete with attribute assignees");
+ if (fixAssignees) {
+ smaMgr.getStateMgr().clearAssignees();
+ smaMgr.getSma().persistAttributesAndRelations();
+ xResultData.log(monitor, "Fixed");
+ }
+ }
+ if (smaMgr.getStateMgr().getAssignees().size() > 1 && smaMgr.getStateMgr().getAssignees().contains(
+ unAssignedUser)) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " is unassigned and assigned => " + Artifacts.toString(
+ "; ", smaMgr.getStateMgr().getAssignees()));
+ if (fixAssignees) {
+ smaMgr.getStateMgr().removeAssignee(unAssignedUser);
+ xResultData.log(monitor, "Fixed");
+ }
+ }
+ if (smaMgr.getStateMgr().getAssignees().contains(noOneUser)) {
+ xResultData.logError(art.getHumanReadableId() + " is assigned to NoOne; invalid assignment - MANUAL FIX REQUIRED");
+ }
+ if ((!smaMgr.isCompleted() && !smaMgr.isCancelled()) && smaMgr.getStateMgr().getAssignees().size() == 0) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " In Work without assignees");
+ }
+ if (art instanceof StateMachineArtifact) {
+ List<Artifact> relationAssigned =
+ art.getRelatedArtifacts(CoreRelationEnumeration.Users_User, Artifact.class);
+ if ((smaMgr.isCompleted() || smaMgr.isCancelled()) && relationAssigned.size() > 0) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " cancel/complete with related assignees");
+ if (fixAssignees) {
+ try {
+ ((StateMachineArtifact) art).updateAssigneeRelations();
+ art.persistAttributesAndRelations();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ xResultData.log(monitor, "Fixed");
+ }
+ } else if (smaMgr.getStateMgr().getAssignees().size() != relationAssigned.size()) {
+ // Make sure this isn't just an UnAssigned user issue (don't relate to unassigned user anymore)
+ if (!(smaMgr.getStateMgr().getAssignees().contains(UserManager.getUser(SystemUser.UnAssigned)) && relationAssigned.size() == 0)) {
+ xResultData.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " attribute assignees doesn't match related assignees");
+ if (fixAssignees) {
+ try {
+ ((StateMachineArtifact) art).updateAssigneeRelations();
+ art.persistAttributesAndRelations();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ xResultData.log(monitor, "Fixed");
+ }
+ }
+ }
+ }
+ } catch (OseeCoreException ex) {
+ xResultData.logError("Exception testing assignees: " + ex.getLocalizedMessage());
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReportByHrid.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReportByHrid.java
new file mode 100644
index 00000000000..6da3d84d1a6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReportByHrid.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.health;
+
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.data.OseeInfo;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryCheckDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ValidateChangeReportByHrid extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public ValidateChangeReportByHrid(XNavigateItem parent) {
+ super(parent, "Validate Change Reports by HRID");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ EntryCheckDialog ed = new EntryCheckDialog(getName(), "Enter HRID", "Display Was/Is data in Results View.");
+ if (ed.open() == 0) {
+ String hrid = ed.getEntry();
+ if (hrid != null && !hrid.equals("")) {
+ Jobs.startJob(new Report(getName(), hrid, ed.isChecked()), true);
+ }
+ }
+ }
+
+ public class Report extends Job {
+
+ private final String hrid;
+ private final boolean exportWasIs;
+
+ public Report(String name, String hrid, boolean exportWasIs) {
+ super(name);
+ this.hrid = hrid;
+ this.exportWasIs = exportWasIs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final XResultData rd = new XResultData();
+ try {
+ TeamWorkFlowArtifact teamArt =
+ (TeamWorkFlowArtifact) ArtifactQuery.getArtifactFromId(hrid, AtsPlugin.getAtsBranch());
+ String currentDbGuid = OseeInfo.getValue("osee.db.guid");
+ ValidateChangeReports.changeReportValidated(currentDbGuid, teamArt, rd, exportWasIs);
+ } catch (Exception ex) {
+ rd.logError(ex.getLocalizedMessage());
+ }
+ rd.report(getName());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
new file mode 100644
index 00000000000..1620c45ee38
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ValidateChangeReports.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.health;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.framework.core.data.OseeInfo;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.IHealthStatus;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.skynet.core.SkynetActivator;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.GeneralData;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.change.ArtifactChanged;
+import org.eclipse.osee.framework.skynet.core.change.AttributeChanged;
+import org.eclipse.osee.framework.skynet.core.change.Change;
+import org.eclipse.osee.framework.skynet.core.change.RelationChanged;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeData.KindType;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This test will validate the change report data that is returned for the ATS configured actions with committed
+ * branches. Upon first time run against a newly committed branch, it will generate a "General Data" artifact with the
+ * change report data stored to xml in a "General String Data" attribute. <br>
+ * <br>
+ * Every additional time this validation is run against an already stored change report, the current xml and stored xml
+ * change report will be compared. <br>
+ * <br>
+ * If errors are found, the developer will need to put a breakpoint below to see the was-is values of the change report
+ * data.<br>
+ * <br>
+ * This test also ensures that all change reports can return their historical artifacts by loading and accessing the
+ * descriptive name for each artifact.
+ *
+ * @author Donald G. Dunne
+ */
+public class ValidateChangeReports extends XNavigateItemAction {
+
+ static final String VCR_ROOT_ELEMENT_TAG = "ValidateChangeReport";
+ static final String VCR_DB_GUID = "dbGuid";
+
+ /**
+ * @param parent
+ */
+ public ValidateChangeReports(XNavigateItem parent) {
+ super(parent, "Validate Change Reports");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new Report(getName()), true);
+ }
+
+ public class Report extends Job {
+
+ public Report(String name) {
+ super(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final XResultData rd = new XResultData();
+ runIt(monitor, rd);
+ rd.report(getName());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private void runIt(IProgressMonitor monitor, XResultData xResultData) throws OseeCoreException {
+ String currentDbGuid = OseeInfo.getValue("osee.db.guid");
+ SevereLoggingMonitor monitorLog = new SevereLoggingMonitor();
+ OseeLog.registerLoggerListener(monitorLog);
+ StringBuffer sbFull = new StringBuffer(AHTML.beginMultiColumnTable(100, 1));
+ String[] columnHeaders = new String[] {"HRID", "PCR", "Results"};
+ sbFull.append(AHTML.addHeaderRowMultiColumnTable(columnHeaders));
+ for (String artifactTypeName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames()) {
+ sbFull.append(AHTML.addRowSpanMultiColumnTable(artifactTypeName, columnHeaders.length));
+ try {
+ int x = 1;
+ Collection<Artifact> artifacts =
+ ArtifactQuery.getArtifactsFromType(artifactTypeName, AtsPlugin.getAtsBranch());
+ for (Artifact artifact : artifacts) {
+ String resultStr = "PASS";
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
+ try {
+ String str = String.format("Processing %s/%s - %s", x++, artifacts.size(), artifact);
+ OseeLog.log(AtsPlugin.class, Level.INFO, str);
+ if (monitor != null) {
+ monitor.subTask(str);
+ }
+
+ // Only validate committed branches cause working branches change too much
+ if (!teamArt.getSmaMgr().getBranchMgr().isCommittedBranch()) continue;
+ Result valid = changeReportValidated(currentDbGuid, teamArt, xResultData, false);
+ if (valid.isFalse()) {
+ resultStr = "Error: Not Valid: " + valid.getText();
+ }
+ } catch (Exception ex) {
+ resultStr = "Error: Exception Validating: " + ex.getLocalizedMessage();
+ OseeLog.log(SkynetActivator.class, Level.SEVERE, ex);
+ }
+ sbFull.append(AHTML.addRowMultiColumnTable(teamArt.getHumanReadableId(), teamArt.getSoleAttributeValue(
+ ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), ""), resultStr));
+ }
+ } catch (Exception ex) {
+ sbFull.append(AHTML.addRowSpanMultiColumnTable("Exception: " + ex.getLocalizedMessage(),
+ columnHeaders.length));
+ }
+ }
+ sbFull.append(AHTML.endMultiColumnTable());
+ xResultData.addRaw(sbFull.toString().replaceAll("\n", ""));
+ List<IHealthStatus> stats = new ArrayList<IHealthStatus>(monitorLog.getSevereLogs());
+ for (IHealthStatus stat : stats) {
+ Throwable tr = stat.getException();
+ if (tr != null) {
+ xResultData.logError("Exception: " + Lib.exceptionToString(stat.getException()));
+ }
+ }
+ }
+
+ /**
+ * Return true if current change report is same as stored change report data
+ *
+ * @param teamArt
+ * @return Result.TrueResult if same, else Result.FalseResult with comparison in resultData
+ * @throws ParserConfigurationException
+ */
+ static Result changeReportValidated(final String currentDbGuid, final TeamWorkFlowArtifact teamArt, XResultData resultData, boolean displayWasIs) throws OseeCoreException, ParserConfigurationException {
+ String name = "VCR_" + teamArt.getHumanReadableId();
+ List<Artifact> arts =
+ ArtifactQuery.getArtifactsFromTypeAndName(GeneralData.ARTIFACT_TYPE, name, AtsPlugin.getAtsBranch());
+ String storedChangeReport = null;
+ Artifact artifactForStore = null;
+ if (arts.size() > 1) {
+ throw new OseeStateException("Multiple artifacts found of name \"" + name + "\"");
+ } else if (arts.size() == 1) {
+ artifactForStore = arts.iterator().next();
+ storedChangeReport =
+ artifactForStore.getSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, null);
+ }
+ // Retrieve current
+ ChangeData currentChangeData = teamArt.getSmaMgr().getBranchMgr().getChangeData();
+ // Store
+ if (storedChangeReport == null) {
+ // Reuse same artifact if already exists
+ if (artifactForStore == null) {
+ artifactForStore =
+ ArtifactTypeManager.addArtifact(GeneralData.ARTIFACT_TYPE, AtsPlugin.getAtsBranch(), name);
+ }
+ artifactForStore.setSoleAttributeValue(GeneralData.GENERAL_STRING_ATTRIBUTE_TYPE_NAME, getReport(
+ currentDbGuid, currentChangeData));
+ artifactForStore.persistAttributes();
+ resultData.log("Stored Change Report for " + teamArt.getHumanReadableId());
+ return new Result(true, "Stored Change Report for " + teamArt.getHumanReadableId());
+ }
+ // Else, compare the two and report
+ else {
+ final String currentChangeReport = getReport(currentDbGuid, currentChangeData);
+ final String fStoredChangeReport = storedChangeReport.replaceAll("\n", "");
+ if (isXmlChangeDataEqual(currentChangeReport, fStoredChangeReport)) {
+ resultData.log("Change Report Valid for " + teamArt.getHumanReadableId());
+ } else {
+ resultData.logError("Was/Is Change Report different for " + teamArt.getHumanReadableId());
+ if (displayWasIs) {
+ resultData.log("Was / Is reports displayed in Results View");
+ }
+ if (displayWasIs) {
+ try {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ String prePage = AHTML.simplePageNoPageEncoding(AHTML.textToHtml(fStoredChangeReport));
+ XResultView.getResultView().addResultPage(
+ new XResultPage("Was Change Report for " + teamArt.getHumanReadableId(), prePage));
+
+ String postPage = AHTML.simplePageNoPageEncoding(AHTML.textToHtml(currentChangeReport));
+ XResultView.getResultView().addResultPage(
+ new XResultPage("Is Change Report for " + teamArt.getHumanReadableId(), postPage));
+
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ } catch (Exception ex) {
+ System.err.println(ex.getLocalizedMessage());
+ }
+ }
+ return new Result("FAIL");
+ }
+ }
+ // As another test, ensure that all artifacts can be retrieved and display their name
+ try {
+ for (Artifact art : currentChangeData.getArtifacts(KindType.ArtifactOrRelation, ModificationType.NEW,
+ ModificationType.DELETED, ModificationType.MERGED)) {
+ art.getDescriptiveName();
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Result("Exception accessing name of change report artifacts: " + ex.getLocalizedMessage());
+ }
+ return new Result(true, "PASS");
+ }
+
+ private static String getReport(String dbGuid, ChangeData changeData) throws OseeCoreException, ParserConfigurationException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(String.format("<%s %s=\"%s\">", VCR_ROOT_ELEMENT_TAG, VCR_DB_GUID, dbGuid));
+ for (Change change : changeData.getChanges()) {
+ if (change instanceof RelationChanged) {
+ sb.append(toXml((RelationChanged) change));
+ } else if (change instanceof ArtifactChanged) {
+ sb.append(toXml((ArtifactChanged) change));
+ } else if (change instanceof AttributeChanged) {
+ sb.append(toXml((AttributeChanged) change));
+ }
+ }
+ sb.append(String.format("</%s>", VCR_ROOT_ELEMENT_TAG));
+ String toReturn = sb.toString().replaceAll(">[\\s\\n\\r]+$", ">");
+ return toReturn.replaceAll("\n", "");
+ }
+
+ private static String toXml(RelationChanged change) throws OseeCoreException, ParserConfigurationException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AXml.addTagData("brId", String.valueOf(change.getBranch().getBranchId())));
+ sb.append(AXml.addTagData("artTId", String.valueOf(change.getArtTypeId())));
+ sb.append(AXml.addTagData("gamma", String.valueOf(change.getGamma())));
+ sb.append(AXml.addTagData("artId", String.valueOf(change.getArtId())));
+ sb.append(AXml.addTagData("tTranId", String.valueOf(change.getToTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("fTranId", String.valueOf(change.getFromTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("mType", String.valueOf(change.getModificationType().name())));
+ sb.append(AXml.addTagData("cType", String.valueOf(change.getChangeType().name())));
+ sb.append(AXml.addTagData("bArtId", String.valueOf(change.getBArtId())));
+ sb.append(AXml.addTagData("relId", String.valueOf(change.getRelLinkId())));
+ sb.append(AXml.addTagData("rat", change.getRationale()));
+ sb.append(AXml.addTagData("aOrdr", String.valueOf(change.getLinkOrder())));
+ sb.append(AXml.addTagData("bOrdr", String.valueOf(change.getBLinkOrder())));
+ sb.append(AXml.addTagData("relTId", String.valueOf(change.getRelationType().getRelationTypeId())));
+ sb.append(AXml.addTagData("hist", String.valueOf(change.isHistorical())));
+ return AXml.addTagData("RelChg", sb.toString());
+ }
+
+ private static String toXml(ArtifactChanged change) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AXml.addTagData("brId", String.valueOf(change.getBranch().getBranchId())));
+ sb.append(AXml.addTagData("artTId", String.valueOf(change.getArtTypeId())));
+ sb.append(AXml.addTagData("gamma", String.valueOf(change.getGamma())));
+ sb.append(AXml.addTagData("artId", String.valueOf(change.getArtId())));
+ sb.append(AXml.addTagData("tTranId", String.valueOf(change.getToTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("fTranId", String.valueOf(change.getFromTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("mType", String.valueOf(change.getModificationType().name())));
+ sb.append(AXml.addTagData("cType", String.valueOf(change.getChangeType().name())));
+ sb.append(AXml.addTagData("hist", String.valueOf(change.isHistorical())));
+ return AXml.addTagData("ArtChg", sb.toString());
+ }
+
+ private static String toXml(AttributeChanged change) throws OseeCoreException, ParserConfigurationException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AXml.addTagData("brId", String.valueOf(change.getBranch().getBranchId())));
+ sb.append(AXml.addTagData("artTId", String.valueOf(change.getArtTypeId())));
+ sb.append(AXml.addTagData("gamma", String.valueOf(change.getGamma())));
+ sb.append(AXml.addTagData("artId", String.valueOf(change.getArtId())));
+ sb.append(AXml.addTagData("tTranId", String.valueOf(change.getToTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("fTranId", String.valueOf(change.getFromTransactionId().getTransactionNumber())));
+ sb.append(AXml.addTagData("mType", String.valueOf(change.getModificationType().name())));
+ sb.append(AXml.addTagData("cType", String.valueOf(change.getChangeType().name())));
+ sb.append(AXml.addTagData("aModType", String.valueOf(change.getArtModType().name())));
+ sb.append(AXml.addTagData("attrId", String.valueOf(change.getAttrId())));
+ sb.append(AXml.addTagData("attrTId", String.valueOf(change.getAttrTypeId())));
+ sb.append(AXml.addTagData("hist", String.valueOf(change.isHistorical())));
+ return AXml.addTagData("AttrChg", sb.toString());
+ }
+
+ private static boolean isXmlChangeDataEqual(String data1, String data2) {
+ int checkSum1 = getCheckSum(data1);
+ int checkSum2 = getCheckSum(data2);
+
+ boolean result = checkSum1 == checkSum2;
+ if (!result) {
+ ChangeReportComparer comparer = new ChangeReportComparer();
+ comparer.compare(data1, data2);
+
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, String.format("Checksums not equal - stored:[%s] current:[%s]",
+ checkSum1, checkSum2));
+ }
+ return result;
+ }
+
+ private static int getCheckSum(String data) {
+ int checksum = -1;
+ for (int index = 0; index < data.length(); index++) {
+ char character = data.charAt(index);
+ if (character != '\n' && character != '\t' && character != '\r' && character != ' ') {
+ checksum += character;
+ }
+ }
+ return checksum;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java
new file mode 100644
index 00000000000..70beae383e9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.ArrayList;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.swt.graphics.Image;
+
+public class ActionHyperItem extends HyperViewItem {
+
+ private final IHyperArtifact iHyperartifact;
+
+ public ActionHyperItem(IHyperArtifact iHyperartifact) {
+ super(iHyperartifact.getHyperName());
+ this.iHyperartifact = iHyperartifact;
+ setGuid(iHyperartifact.getGuid());
+ }
+
+ @Override
+ public String toString() {
+ return iHyperartifact.getHyperType() + " - " + iHyperartifact.getHyperName();
+ }
+
+ public void handleDoubleClick(HyperViewItem hyperViewItem) throws OseeCoreException {
+ }
+
+ public void calculateCurrent(Artifact currentArtifact) {
+ setCurrent(currentArtifact.equals(getArtifact()));
+ for (ActionHyperItem childHyperItem : getChildren()) {
+ childHyperItem.calculateCurrent(currentArtifact);
+ }
+ }
+
+ @Override
+ public Image getImage() {
+ if (iHyperartifact.isDeleted()) return null;
+ return iHyperartifact.getHyperImage();
+ }
+
+ @Override
+ public String getTitle() {
+ if (iHyperartifact.isDeleted()) return "Deleted";
+ return iHyperartifact.getHyperName();
+ }
+
+ @Override
+ public String getToolTip() {
+ if (iHyperartifact.isDeleted()) return "";
+ StringBuilder builder = new StringBuilder();
+ builder.append("Type: " + (iHyperartifact).getHyperType());
+ if (iHyperartifact instanceof IHyperArtifact) {
+ if ((iHyperartifact).getHyperState() != null) builder.append("\nState: " + (iHyperartifact).getHyperState());
+ if ((iHyperartifact).getHyperAssignee() != null) builder.append("\nAssignee: " + (iHyperartifact).getHyperAssignee());
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public Image getMarkImage() {
+ if (iHyperartifact.isDeleted()) return null;
+ try {
+ if (iHyperartifact instanceof IHyperArtifact) return (iHyperartifact).getHyperAssigneeImage();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return super.getMarkImage();
+ }
+
+ public ArrayList<ActionHyperItem> getChildren() {
+ ArrayList<ActionHyperItem> children = new ArrayList<ActionHyperItem>();
+ for (HyperViewItem item : getBottom()) {
+ children.add((ActionHyperItem) item);
+ }
+ for (HyperViewItem item : getTop()) {
+ children.add((ActionHyperItem) item);
+ }
+ for (HyperViewItem item : getRight()) {
+ children.add((ActionHyperItem) item);
+ }
+ for (HyperViewItem item : getLeft()) {
+ children.add((ActionHyperItem) item);
+ }
+ return children;
+ }
+
+ public IHyperArtifact getHyperArtifact() {
+ return iHyperartifact;
+ }
+
+ public Artifact getArtifact() {
+ return iHyperartifact.getHyperArtifact();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
new file mode 100644
index 00000000000..82d7e395347
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
@@ -0,0 +1,318 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSArtifact;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.config.BulkLoadAtsCache;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveListener2;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class ActionHyperView extends HyperView implements IPartListener, IActionable, IFrameworkTransactionEventListener, IPerspectiveListener2 {
+
+ public static String VIEW_ID = "org.eclipse.osee.ats.hyper.ActionHyperView";
+ private static String HELP_CONTEXT_ID = "atsActionView";
+ private static ActionHyperItem topAHI;
+ private static ATSArtifact currentArtifact;
+
+ public ActionHyperView() {
+ super();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(this);
+ setNodeColor(whiteColor);
+ setCenterColor(whiteColor);
+ setVerticalSelection(45);
+ }
+
+ @Override
+ public void createPartControl(Composite top) {
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(top)) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().removePerspectiveListener(this);
+ return;
+ }
+ BulkLoadAtsCache.run(false);
+ super.createPartControl(top);
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "SkyWalker");
+ AtsPlugin.getInstance().setHelp(top, HELP_CONTEXT_ID);
+ AtsPlugin.getInstance().setHelp(composite, HELP_CONTEXT_ID);
+ OseeEventManager.addListener(this);
+ }
+
+ public static ActionHyperView getArtifactHyperView() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ IViewReference ivr = page.findViewReference(ActionHyperView.VIEW_ID);
+ if (ivr != null && page.isPartVisible(ivr.getPart(false))) return (ActionHyperView) page.showView(ActionHyperView.VIEW_ID);
+ } catch (PartInitException e1) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error",
+ "Couldn't Get OSEE Hyper View " + e1.getMessage());
+ }
+ return null;
+ }
+
+ @Override
+ public boolean provideBackForwardActions() {
+ return false;
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ super.dispose();
+ }
+
+ @Override
+ public void handleItemDoubleClick(HyperViewItem hvi) throws OseeCoreException {
+ Artifact art = ((ActionHyperItem) hvi).getArtifact();
+ if (art == null) {
+ ((ActionHyperItem) hvi).handleDoubleClick(hvi);
+
+ } else if (art.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ } else {
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ }
+
+ private boolean reviewsCreated = false;
+ private boolean tasksReviewsCreated = false;
+
+ @Override
+ public void display() {
+ try {
+ getContainer().setCursor(new Cursor(null, SWT.NONE));
+ if (currentArtifact == null || currentArtifact.isDeleted()) {
+ return;
+ }
+ reviewsCreated = false;
+ tasksReviewsCreated = false;
+ ATSArtifact topArt = getTopArtifact(currentArtifact);
+ if (topArt == null || topArt.isDeleted()) return;
+ topAHI = new ActionHyperItem(topArt);
+ if (topArt instanceof ActionArtifact) {
+ for (TeamWorkFlowArtifact team : ((ActionArtifact) topArt).getTeamWorkFlowArtifacts()) {
+ ActionHyperItem teamAHI = new ActionHyperItem(team);
+ teamAHI.setRelationToolTip("Team");
+ topAHI.addBottom(teamAHI);
+ for (ReviewSMArtifact rev : team.getSmaMgr().getReviewManager().getReviews()) {
+ reviewsCreated = true;
+ ActionHyperItem reviewAHI = new ActionHyperItem(rev);
+ reviewAHI.setRelationToolTip("Review");
+ teamAHI.addBottom(reviewAHI);
+ addTasksAHIs(reviewAHI, rev);
+ }
+ addTasksAHIs(teamAHI, team);
+ }
+ }
+ if (topArt instanceof ReviewSMArtifact) {
+ addTasksAHIs(topAHI, topArt);
+ }
+
+ if (activeEditorIsActionEditor()) {
+ topAHI.calculateCurrent(currentArtifact);
+ }
+ if (tasksReviewsCreated)
+ setVerticalSelection(50);
+ else if (reviewsCreated)
+ setVerticalSelection(47);
+ else
+ setVerticalSelection(45);
+ create(topAHI);
+ } catch (Exception ex) {
+ clear();
+ }
+ }
+
+ private void addTasksAHIs(ActionHyperItem parentAHI, ATSArtifact artifact) throws OseeCoreException {
+ if (!(artifact instanceof StateMachineArtifact)) return;
+ if (((StateMachineArtifact) artifact).getSmaMgr().getTaskMgr().getTaskArtifacts().size() > 0) {
+ if (artifact instanceof ReviewSMArtifact) tasksReviewsCreated = true;
+ parentAHI.addBottom(new TasksActionHyperItem(
+ ((StateMachineArtifact) artifact).getSmaMgr().getTaskMgr().getTaskArtifacts()));
+ }
+ }
+
+ public ATSArtifact getTopArtifact(ATSArtifact art) throws OseeCoreException {
+ ATSArtifact artifact = art;
+ if (artifact instanceof TaskArtifact) {
+ artifact = ((TaskArtifact) artifact).getParentSMA();
+ }
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ artifact = ((TeamWorkFlowArtifact) artifact).getParentActionArtifact();
+ }
+ if (artifact instanceof ReviewSMArtifact) {
+ if (((ReviewSMArtifact) artifact).getParentActionArtifact() != null) {
+ artifact = ((ReviewSMArtifact) artifact).getParentActionArtifact();
+ }
+ }
+ if (artifact == null) OseeLog.log(AtsPlugin.class, Level.SEVERE, "Unknown parent " + art.getHumanReadableId());
+ return artifact;
+ }
+
+ public boolean activeEditorIsActionEditor() {
+ IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
+ if (page == null) return false;
+ IEditorPart editorPart = page.getActiveEditor();
+ boolean result = (editorPart != null && (editorPart instanceof SMAEditor));
+ return result;
+ }
+
+ public void processWindowActivated() {
+ if (!this.getSite().getPage().isPartVisible(this)) return;
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if (page != null) {
+ IEditorPart editor = page.getActiveEditor();
+ if (editor != null && (editor instanceof SMAEditor)) {
+ currentArtifact = ((SMAEditor) editor).getSmaMgr().getSma();
+ display();
+ } else
+ super.clear();
+ }
+ }
+
+ public void processWindowDeActivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ @Override
+ public void partActivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this))
+ dispose();
+ else
+ processWindowActivated();
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ public String getActionDescription() {
+ if (currentArtifact != null && currentArtifact.isDeleted()) return String.format("Current Artifact - %s - %s",
+ currentArtifact.getGuid(), currentArtifact.getDescriptiveName());
+ return "";
+ }
+
+ @Override
+ protected void clear() {
+ super.clear();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor)
+ */
+ public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
+ processWindowActivated();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
+ processWindowActivated();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference,
+ * java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
+ processWindowActivated();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (currentArtifact == null) return;
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ if (transData.isDeleted(currentArtifact)) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ clear();
+ }
+ });
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ display();
+ }
+ });
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
new file mode 100644
index 00000000000..8b6e207202b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
@@ -0,0 +1,264 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSArtifact;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.SkynetActivator;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerOptions;
+import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveListener2;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionSkyWalker extends SkyWalkerView implements IPartListener, IActionable, IFrameworkTransactionEventListener, IPerspectiveListener2 {
+
+ public static final String VIEW_ID = "org.eclipse.osee.ats.hyper.ActionSkyWalker";
+
+ public ActionSkyWalker() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ sashForm.setWeights(new int[] {99, 1});
+ OseeEventManager.addListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView#createActions()
+ */
+ @Override
+ protected void createActions() {
+ IActionBars bars = getViewSite().getActionBars();
+ // IMenuManager mm = bars.getMenuManager();
+ IToolBarManager tbm = bars.getToolBarManager();
+
+ Action action = new Action() {
+ @Override
+ public void run() {
+ redraw();
+ }
+ };
+ action.setText("Refresh");
+ action.setToolTipText("Refresh");
+ action.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("refresh.gif"));
+ tbm.add(action);
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ super.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView#explore(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ @Override
+ public void explore(Artifact artifact) {
+ if (artifact == null || artifact.isDeleted() || (!(artifact instanceof ATSArtifact))) clear();
+ try {
+ getOptions().setArtifact(artifact);
+ getOptions().setLayout(getOptions().getLayout(SkyWalkerOptions.SPRING_LAYOUT));
+ if (artifact instanceof User)
+ super.explore(artifact);
+ else
+ super.explore(getTopArtifact((ATSArtifact) artifact));
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetActivator.class, Level.SEVERE, ex);
+ clear();
+ }
+ }
+
+ public ATSArtifact getTopArtifact(ATSArtifact art) throws OseeCoreException {
+ ATSArtifact artifact = null;
+ if (art instanceof ActionArtifact)
+ artifact = art;
+ else if (art instanceof TeamWorkFlowArtifact) {
+ artifact = ((TeamWorkFlowArtifact) art).getParentActionArtifact();
+ } else if (art instanceof TaskArtifact) {
+ Artifact parentArtifact = ((TaskArtifact) art).getParentSMA();
+ if (parentArtifact instanceof StateMachineArtifact) {
+ if (parentArtifact instanceof TeamWorkFlowArtifact)
+ artifact = ((TeamWorkFlowArtifact) parentArtifact).getParentActionArtifact();
+ else
+ OSEELog.logSevere(AtsPlugin.class, "Unknown parent " + art.getHumanReadableId(), true);
+ }
+ }
+ return artifact;
+ }
+
+ public boolean activeEditorIsActionEditor() {
+ IWorkbenchPage page = getSite().getWorkbenchWindow().getActivePage();
+ if (page == null) return false;
+ IEditorPart editorPart = page.getActiveEditor();
+ boolean result = (editorPart != null && (editorPart instanceof SMAEditor));
+ return result;
+ }
+
+ public void processWindowActivated() {
+ if (!this.getSite().getPage().isPartVisible(this)) return;
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if (page != null) {
+ IEditorPart editor = page.getActiveEditor();
+ if (editor != null && (editor instanceof SMAEditor)) {
+ explore(((SMAEditor) editor).getSmaMgr().getSma());
+ }
+ clear();
+ }
+ }
+
+ public void processWindowDeActivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ public void partActivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this))
+ dispose();
+ else
+ processWindowActivated();
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ processWindowActivated();
+ }
+
+ @Override
+ public String getActionDescription() {
+ if (getOptions() != null && getOptions().getArtifact() != null && getOptions().getArtifact().isDeleted()) return String.format(
+ "Current Artifact - %s - %s", getOptions().getArtifact().getGuid(),
+ getOptions().getArtifact().getDescriptiveName());
+ return "";
+ }
+
+ public void clear() {
+ System.out.println("clear viewer here");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (sender.isRemote()) return;
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ if (getOptions().getArtifact() == null) return;
+ if (transData.isDeleted(getOptions().getArtifact())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ clear();
+ }
+ });
+ }
+ if (transData.isChanged(getOptions().getArtifact()) || transData.isRelAddedChangedDeleted(getOptions().getArtifact())) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ explore(getOptions().getArtifact());
+ }
+ });
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor)
+ */
+ public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
+ processWindowActivated();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
+ processWindowActivated();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference,
+ * java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
+ processWindowActivated();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java
new file mode 100644
index 00000000000..ebef1564348
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.swt.graphics.Image;
+
+public class ArtifactHyperItem extends HyperViewItem {
+
+ private final Artifact artifact;
+
+ public ArtifactHyperItem(Artifact artifact) {
+ super(artifact.getDescriptiveName());
+ this.artifact = artifact;
+ setImage(artifact.getImage());
+ setGuid(artifact.getGuid());
+
+ }
+
+ @Override
+ public String getToolTip() {
+ String tt =
+ "Type: " + artifact.getArtifactTypeName() + "\n\n" + "Title: " + artifact.getDescriptiveName();
+ return tt;
+ }
+
+ @Override
+ public String getTitle() {
+ return artifact.getArtifactTypeName() + "\n" + artifact.getDescriptiveName();
+ }
+
+ @Override
+ public Image getMarkImage() {
+ return null;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ @Override
+ public String getShortTitle() {
+ String title = getTitle().replaceFirst("State", "");
+ return title;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
new file mode 100644
index 00000000000..942be22e270
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
@@ -0,0 +1,358 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.ActionDebug;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.ArtifactSelectWizard;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveListener2;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartReference;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+public class ArtifactHyperView extends HyperView implements IFrameworkTransactionEventListener, IPartListener, IActionable, IPerspectiveListener2 {
+
+ public static String VIEW_ID = "org.eclipse.osee.ats.hyper.ArtifactHyperView";
+ public static ArtifactHyperItem topAHI;
+ public static Artifact currentArtifact;
+ public ActionDebug debug = new ActionDebug(false, "ArtifactHyperView");
+ private Action pinAction;
+
+ public ArtifactHyperView() {
+ super();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(this);
+ setNodeColor(whiteColor);
+ setCenterColor(whiteColor);
+ defaultZoom.pcRadius += defaultZoom.pcRadiusFactor * 2;
+ defaultZoom.uuRadius += defaultZoom.uuRadiusFactor * 2;
+ defaultZoom.xSeparation += defaultZoom.xSeparationFactor;
+ }
+
+ public static ArtifactHyperView getArtifactHyperView() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ return (ArtifactHyperView) page.showView(ArtifactHyperView.VIEW_ID);
+ } catch (PartInitException e1) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error",
+ "Couldn't Get OSEE Artifact Hyper View " + e1.getMessage());
+ }
+ return null;
+ }
+
+ public static void openArtifact(Artifact artifact) throws PartInitException {
+ getArtifactHyperView().load(artifact);
+ }
+
+ @Override
+ public void createPartControl(Composite top) {
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(top)) {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().removePartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().removePerspectiveListener(this);
+ return;
+ }
+ super.createPartControl(top);
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "ATS Action View");
+ OseeEventManager.addListener(this);
+ }
+
+ @Override
+ public void handleItemDoubleClick(HyperViewItem hvi) {
+ currentArtifact = ((ArtifactHyperItem) hvi).getArtifact();
+ display();
+ }
+
+ public void load(Artifact artifact) {
+ currentArtifact = artifact;
+ display();
+ }
+
+ @Override
+ public void display() {
+ try {
+ if (currentArtifact == null) return;
+ topAHI = new ArtifactHyperItem(currentArtifact);
+ // System.out.println("Artifact "+currentArtifact.getArtifactTypeNameShort());
+ int x = 0;
+ for (RelationLink link : currentArtifact.getRelationsAll(false)) {
+ debug.report("relation " + link.getRelationType().getTypeName());
+
+ // Don't process link if onlyShowRel is populated and doesn't contain link name
+ if (onlyShowRelations.size() > 0) {
+ if (!onlyShowRelations.contains(link.getRelationType().getTypeName())) continue;
+ x++;
+ if (x == 4) x = 0;
+ }
+
+ Artifact otherArt = link.getArtifactB();
+ int otherOrder = link.getBOrder();
+ int thisOrder = link.getAOrder();
+ if (otherArt.equals(currentArtifact)) {
+ otherArt = link.getArtifactA();
+ otherOrder = link.getAOrder();
+ thisOrder = link.getBOrder();
+ }
+ if (!otherArt.isDeleted()) {
+ ArtifactHyperItem ahi = new ArtifactHyperItem(otherArt);
+ String tip = link.getRelationType().getTypeName();
+ if (!link.getRationale().equals("")) tip += "(" + link.getRationale() + ")";
+ ahi.setRelationToolTip(tip);
+ String label =
+ (isShowOrder() ? "(" + thisOrder + ") " : "") + link.getRelationType().getShortName() + (isShowOrder() ? "(" + otherOrder + ") " : "");
+ if (!link.getRationale().equals("")) label += "(" + link.getRationale() + ")";
+ ahi.setRelationLabel(label);
+ ahi.setLink(link);
+ ahi.setRelationDirty(link.isDirty());
+ switch (x) {
+ case 0:
+ topAHI.addBottom(ahi);
+ break;
+ case 1:
+ topAHI.addLeft(ahi);
+ break;
+ case 2:
+ topAHI.addTop(ahi);
+ break;
+ case 3:
+ topAHI.addRight(ahi);
+ break;
+ default:
+ break;
+ }
+ }
+ x++;
+ if (x == 4) x = 0;
+ }
+ create(topAHI);
+ center();
+ } catch (OseeCoreException ex) {
+ clear();
+ }
+ }
+
+ @Override
+ protected void handleRefreshButton() {
+ display();
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ super.dispose();
+ }
+
+ public void handleWindowChange() {
+ if (pinAction.isChecked()) return;
+ if (!this.getSite().getPage().isPartVisible(this)) return;
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ if (page != null) {
+ IEditorPart editor = page.getActiveEditor();
+ if (editor != null && (editor instanceof SMAEditor)) {
+ currentArtifact = ((SMAEditor) editor).getSmaMgr().getSma();
+ load(currentArtifact);
+ }
+ }
+ }
+
+ @Override
+ public void partActivated(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ @Override
+ public void partBroughtToTop(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ @Override
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this))
+ dispose();
+ else
+ handleWindowChange();
+ }
+
+ @Override
+ public void partDeactivated(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ @Override
+ public void partOpened(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+
+ pinAction = new Action("Pin Viewer", Action.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ }
+ };
+ pinAction.setToolTipText("Keep viewer from updating based on open Actions.");
+ pinAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("pinEditor.gif"));
+
+ Action openArtAction = new Action("Open Artifact") {
+
+ @Override
+ public void run() {
+ handleOpenArtifact();
+ }
+ };
+ openArtAction.setToolTipText("Open Artifact");
+ openArtAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("artView.gif"));
+
+ Action openByIdAction = new Action("Open by Id", IAction.AS_PUSH_BUTTON) {
+
+ @Override
+ public void run() {
+ MultipleHridSearchItem gsi = new MultipleHridSearchItem();
+ try {
+ Collection<Artifact> arts = gsi.performSearchGetResults(true);
+ if (arts.size() == 0) {
+ AWorkbench.popup("ERROR", "No Artifacts Found");
+ return;
+ }
+ load(arts.iterator().next());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+ openByIdAction.setToolTipText("Open by Id");
+
+ IMenuManager mm = getViewSite().getActionBars().getMenuManager();
+ mm.add(new Separator());
+ mm.add(openByIdAction);
+
+ IActionBars bars = getViewSite().getActionBars();
+ IToolBarManager tbm = bars.getToolBarManager();
+ tbm.add(new Separator());
+ // tbm.add(homeAction);
+ tbm.add(openArtAction);
+ tbm.add(pinAction);
+ }
+
+ public void handleOpenArtifact() {
+
+ ArtifactSelectWizard selWizard = new ArtifactSelectWizard();
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), selWizard);
+ dialog.create();
+ if (dialog.open() == 0) {
+ load(selWizard.getSelectedArtifact());
+ }
+ }
+
+ public String getActionDescription() {
+ if (currentArtifact != null && currentArtifact.isDeleted()) return String.format("Current Artifact - %s - %s",
+ currentArtifact.getGuid(), currentArtifact.getDescriptiveName());
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor)
+ */
+ public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
+ handleWindowChange();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
+ handleWindowChange();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage,
+ * org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference,
+ * java.lang.String)
+ */
+ public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
+ handleWindowChange();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (sender.isRemote()) return;
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ if (currentArtifact == null) return;
+ if (transData.isDeleted(currentArtifact)) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ clear();
+ }
+ });
+ }
+ if (transData.isRelAddedChangedDeleted(currentArtifact)) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ display();
+ }
+ });
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
new file mode 100644
index 00000000000..ab13014ba42
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
@@ -0,0 +1,1059 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.ArrayList;
+import java.util.Vector;
+import java.util.logging.Level;
+import org.eclipse.draw2d.ChopboxAnchor;
+import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.ConnectionEndpointLocator;
+import org.eclipse.draw2d.Figure;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.Label;
+import org.eclipse.draw2d.LightweightSystem;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.MouseEvent;
+import org.eclipse.draw2d.MouseListener;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.ToolbarLayout;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.ActionDebug;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.OseeDbConnection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+public class HyperView extends ViewPart implements IPartListener {
+
+ private boolean showOrder = false;
+ public static String VIEW_ID = "org.eclipse.osee.ats.hyper.HyperView";
+ private LightweightSystem lws;
+ private HyperViewItem centerSearchItem;
+ private NodeFigure centerFigure;
+ protected Composite composite;
+ private Figure container; // main container Figure to hold others
+ private XYLayout contentsLayout;
+ private final Vector<PolylineConnection> connectors = new Vector<PolylineConnection>(); // PolylineConnection
+ private final Vector<HyperViewItem> backList = new Vector<HyperViewItem>();
+ // List of SearchItems visited
+ private int backListIndex = 0; // Index we are on in backList
+ private HyperViewItem homeSearchItem = null;
+ // private static Canvas canvas;
+ private FigureCanvas canvas;
+ private final Cursor hCursor = null;
+ private Menu popupMenu;
+ private Menu connectPopupMenu;
+ /* Full circle is (2*Math.PI) */
+ private final double quadrant = ((2 * Math.PI) / 4);
+ /* Each quadrant is 90 degrees */
+ private final double oneEighthCircle = quadrant / 2; /* Start 45 degrees off 0 */
+ private final double bottomQuadrantStart = oneEighthCircle;
+ private final double topQuadrantStart = oneEighthCircle + (2 * quadrant);
+ private final double leftQuadrantStart = oneEighthCircle + quadrant;
+ private final double rightQuadrantStart = oneEighthCircle + (3 * quadrant);
+ // private ChopboxAnchor sourceAnchor = null;
+ private boolean dragCenter = false;
+ protected static Color nodeColor = new Color(null, 255, 255, 206);
+ protected static Color centerColor = new Color(null, 106, 219, 255);
+ protected static Color cyanColor = ColorConstants.cyan;
+ protected static Color blackColor = ColorConstants.black;
+ protected static Color whiteColor = ColorConstants.white;
+ private ScrollBar vsb;
+ private ScrollBar hsb;
+ private Action titleAction, backAction, forwardAction, showOrderAction;
+ private Zoom zoom;
+ protected Zoom defaultZoom = new Zoom();
+ private int verticalSelection = 40;
+ private final ActionDebug debug = new ActionDebug(false, "HV");
+ protected ArrayList<String> onlyShowRelations = new ArrayList<String>();
+
+ public class Zoom {
+
+ int pcRadius = 50;
+ int pcRadiusFactor = 5;
+ int uuRadius = 60;
+ int uuRadiusFactor = 20;
+ int uuRadiusSeparation = 13; // left/right
+ int pcRadiusSeparation = 13; // top/bottom
+ int xSeparation = 27;
+ int xSeparationFactor = 20;
+ int ySeparation = 5;
+ int ySeparationFactor = 5;
+ Point dragCenter = null;
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("xR:" + pcRadius);
+ builder.append("yR:" + uuRadius);
+ builder.append(" xRF:" + pcRadiusFactor);
+ builder.append(" yRF:" + uuRadiusFactor);
+ builder.append(" pcRS: " + pcRadiusSeparation);
+ builder.append(" uuRS: " + uuRadiusSeparation);
+ builder.append(" xS: " + xSeparation);
+ builder.append(" yS: " + ySeparation);
+ return builder.toString();
+ }
+ }
+
+ enum RelationEnum {
+ TOP, BOTTOM, BOTTOM2, LEFT, RIGHT
+ };
+
+ public boolean provideBackForwardActions() {
+ return true;
+ }
+
+ public class NodeFigure extends Figure {
+
+ HyperViewItem hvi = null;
+
+ public HyperViewItem getSearchItem() {
+ return hvi;
+ }
+
+ public NodeFigure(Label name, Label infoLabel, HyperViewItem hvi, boolean center) {
+ ToolbarLayout layout = new ToolbarLayout();
+ layout.setVertical(false);
+ setLayoutManager(layout);
+ if (hvi.isCurrent())
+ setBorder(new LineBorder(cyanColor, 3));
+ else
+ setBorder(new LineBorder(blackColor, 1));
+ if (center)
+ setBackgroundColor(centerColor);
+ else
+ setBackgroundColor(nodeColor);
+ setOpaque(true);
+ this.hvi = hvi;
+ if (name != null) {
+ add(name);
+ }
+ if (infoLabel != null) {
+ add(infoLabel);
+ }
+ }
+
+ public HyperViewItem getHvi() {
+ return hvi;
+ }
+
+ }
+
+ // private void moveCenter(int y) {
+ // zoom.centerYOffset+=y;
+ // System.out.println("zoom.centerYOffset *" + zoom.centerYOffset + "*");
+ // }
+ //
+
+ /**
+ * Create HyperView object
+ */
+ public HyperView() {
+ zoom = defaultZoom;
+ }
+
+ public void create(HyperViewItem hvi) {
+ clear();
+ gridLoad(hvi);
+ }
+
+ private void gridLoad(HyperViewItem hvi) {
+ debug.report("gridLoad");
+ /*
+ * If grid already loaded and it was a collection, remove old home and all links associated
+ * with it.
+ */
+ if (homeSearchItem != null) {
+ for (HyperViewItem hyperItem : homeSearchItem.getBottom()) {
+ hyperItem.removeTop(homeSearchItem);
+ }
+ }
+ homeSearchItem = hvi;
+ centerSearchItem = hvi;
+ backListAddSearchItem(homeSearchItem);
+ jumpTo(homeSearchItem);
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize it.
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ debug.report("createPartControl");
+
+ try {
+ if (OseeDbConnection.hasOpenConnection()) {
+ OseeContributionItem.addTo(this, true);
+ }
+ } catch (OseeDataStoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ canvas = new FigureCanvas(parent);
+ canvas.setScrollBarVisibility(FigureCanvas.ALWAYS);
+ vsb = canvas.getVerticalBar();
+ vsb.setIncrement(1);
+ vsb.setSelection(verticalSelection);
+ vsb.addListener(SWT.Selection, new Listener() {
+
+ public void handleEvent(Event event) {
+ refresh();
+ // System.out.println("vScroll " + event);
+ // int v = canvas.getVerticalBar().getSelection();
+ // System.out.println("v *" + v + "*");
+ }
+ });
+ hsb = canvas.getHorizontalBar();
+ hsb.setIncrement(1);
+ hsb.setSelection(40);
+ hsb.addListener(SWT.Selection, new Listener() {
+
+ public void handleEvent(Event event) {
+ refresh();
+ // System.out.println("hScroll " + event);
+ // int h = canvas.getVerticalBar().getSelection();
+ // System.out.println("h *" + h + "*");
+ }
+ });
+ // canvas = new Canvas(top, SWT.NONE);
+ composite = parent;
+ canvas.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+ lws = new LightweightSystem(canvas);
+ container = new Figure();
+ setContainerMouseListener(container);
+ setMouseListener(container);
+ contentsLayout = new XYLayout();
+ container.setLayoutManager(contentsLayout);
+ lws.setContents(container);
+ // canvas.addPaintListener(new PaintListener() {
+ //
+ // public void paintControl(PaintEvent e) {
+ // if (centerSearchItem == null || centerSearchItem.getArtifact() == null
+ // || centerSearchItem.getArtifact().isDeleted())
+ // return;
+ // // refresh();
+ // }
+ // });
+ canvas.layout();
+ composite.layout();
+ createActions();
+
+ }
+
+ private void printBackList(String inStr) {
+ final boolean debug = false;
+ if (!debug) return;
+ StringBuilder builder = new StringBuilder();
+ builder.append(inStr + "backList : [");
+ for (int i = 0; i < backList.size(); i++) {
+ builder.append(i + " ");
+ }
+ builder.append("] index: " + backListIndex);
+ System.err.println(builder.toString());
+ }
+
+ private void backListClearToIndex() {
+ printBackList("pre backListClearToIndex");
+ // Remove any extra items after where we are in backList
+ for (int i = backListIndex + 1; i < backList.size(); i++) {
+ backList.remove(i);
+ }
+ printBackList("post backListClearToIndex");
+ }
+
+ private void backListAddSearchItem(HyperViewItem hvi) {
+ // If we are adding, then any items past backListIndex are
+ // invalid and should be removed
+ printBackList("pre backListAddSearchItem");
+ backListClearToIndex();
+ if (backList.size() > 0) {
+ if ((backList.get(backList.size() - 1)).equals(hvi)) {
+ // System.out.println("same as last; skip");
+ return;
+ }
+ }
+ backList.add(hvi);
+ backListIndex = backList.size() - 1;
+ printBackList("post backListAddSearchItem");
+ }
+
+ // private void backListClear() {
+ // backList.clear();
+ // backListIndex = 0;
+ // }
+
+ public void refresh() {
+ gridDrawCenterItem();
+ }
+
+ protected void clear() {
+ debug.report("gridClear");
+ if (connectors != null) {
+ for (int i = 0; i < connectors.size(); i++) {
+ (connectors.get(i)).erase();
+ }
+ connectors.clear();
+ }
+ if (container != null) container.removeAll();
+ }
+
+ private void gridDrawCenterItem() {
+ clear();
+ Rectangle grid = container.getClientArea();
+ // System.out.println("grid w: " + grid.width + " h:" + grid.height);
+ gridDraw(centerSearchItem, new Point(grid.width / 2, grid.height / 2));
+ }
+
+ private void gridDraw(HyperViewItem hvi, Point center) {
+ debug.report("zoom *" + zoom + "*");
+ // Draw center node
+ if (hvi != null) {
+ debug.report("center x: " + center.x + " y:" + center.y);
+ debug.report("centerFigure *" + hvi.getTitle() + "*");
+ Point useCenter = new Point();
+ if (zoom.dragCenter != null) {
+ useCenter = zoom.dragCenter.getCopy();
+ } else {
+ useCenter = center.getCopy();
+ }
+ // Offset by scroll
+ if (vsb != null) useCenter.y -= (vsb.getSelection() - 40) * 10;
+ if (hsb != null) useCenter.x -= (hsb.getSelection() - 40) * 10;
+ // System.out.println("zoom.dragCenter *" + zoom.dragCenter + "*");
+ // System.out.println("center *" + center + "*");
+ // System.out.println("vsb.getSelection() *" + vsb.getSelection() +
+ // "*");
+ // System.out.println("hsb.getSelection() *" + hsb.getSelection() +
+ // "*");
+ Point nwPoint;
+ Point cPoint;
+ centerFigure = createFigure(centerSearchItem, true);
+ Dimension dim = centerFigure.getPreferredSize();
+ debug.report("dim center w: " + dim.width + " h:" + dim.height);
+ nwPoint = new Point((useCenter.x - dim.width / 2), (useCenter.y - dim.height / 2));
+ cPoint = new Point((nwPoint.x + dim.width / 2), (nwPoint.y + dim.height / 2));
+ debug.report("nwPoint *" + nwPoint + "*");
+ debug.report("cPoint *" + cPoint + "*");
+ contentsLayout.setConstraint(centerFigure, new Rectangle(nwPoint.x, nwPoint.y, -1, -1));
+ // centerFigure.repaint();
+ ChopboxAnchor sourceAnchor = new ChopboxAnchor(centerFigure);
+ setMouseListener(centerFigure);
+ // debug only
+ // drawQuadrant(topQuadrantStart, quadrant);
+ // drawQuadrant(bottomQuadrantStart, quadrant);
+ // drawQuadrant(leftQuadrantStart, quadrant);
+ // drawQuadrant(rightQuadrantStart, quadrant);
+ /*
+ * Bottomren draw from right to left Tops draw from left to right Left draws from low to
+ * high Usedby draws from high to low
+ */
+ // Draw other nodes
+ drawNodes(RelationEnum.TOP, hvi.getTop(), cPoint, sourceAnchor);
+ drawNodes(RelationEnum.BOTTOM, hvi.getBottom(), cPoint, sourceAnchor);
+ drawNodes(RelationEnum.LEFT, hvi.getLeft(), cPoint, sourceAnchor);
+ drawNodes(RelationEnum.RIGHT, hvi.getRight(), cPoint, sourceAnchor);
+ }
+ container.repaint();
+ canvas.layout();
+ composite.layout();
+ }
+
+ /**
+ * Draw figures around center offsetPoint #param relType - relation
+ *
+ * @param hvis - HyperViewItems to show.
+ * @param offsetPoint - x,y to offset figures
+ */
+ private void drawNodes(RelationEnum relType, ArrayList<HyperViewItem> hvis, Point offsetPoint, ChopboxAnchor sourceAnchor) {
+ debug.report("drawNodes");
+ if (hvis.size() == 0) return;
+ final boolean isRight = relType == RelationEnum.RIGHT;
+ final boolean isLeft = relType == RelationEnum.LEFT;
+ final boolean isBottom = relType == RelationEnum.BOTTOM;
+ final boolean isTop = relType == RelationEnum.TOP;
+ debug.report("offsetPoint *" + offsetPoint + "*");
+ double startDegree = 0;
+ if (isRight)
+ startDegree = rightQuadrantStart;
+ else if (isLeft)
+ startDegree = leftQuadrantStart;
+ else if (isTop)
+ startDegree = topQuadrantStart;
+ else if (isBottom) startDegree = bottomQuadrantStart;
+ double degree = 0;
+ Point cPoint = new Point(); // center of figure
+ Point nwPoint = new Point();
+ ArrayList<HyperViewItem> orderedHvis = new ArrayList<HyperViewItem>();
+
+ // if bottomren, reverse order of figures
+ if (isBottom)
+ for (int i = hvis.size() - 1; i >= 0; i--) {
+ HyperViewItem hvi = hvis.get(i);
+ if (hvi.isShow()) orderedHvis.add(hvis.get(i));
+ }
+ else
+ for (HyperViewItem hvi : hvis)
+ if (hvi.isShow()) orderedHvis.add(hvi);
+ final double degreeDiff = quadrant / (orderedHvis.size() + 1);
+ debug.report("quadrant *" + quadrant + "*");
+ debug.report("orderedHvis size *" + orderedHvis.size() + "*");
+ debug.report("degreeDiff *" + degreeDiff + "*");
+
+ // what is sent into constraint as the nw corner
+ int myRadius;
+ if (isBottom || isTop) {
+ myRadius = zoom.pcRadius;
+ } else {
+ myRadius = zoom.uuRadius;
+ }
+ for (int i = 0; i < orderedHvis.size(); i++) {
+ HyperViewItem hvi = orderedHvis.get(i);
+ debug.report("\n");
+ debug.report("HIV " + hvi.getShortTitle());
+ degree = startDegree + degreeDiff + (degreeDiff * i);
+ debug.report("startDegree *" + startDegree + "*");
+ debug.report("degree *" + degree + "*");
+ NodeFigure figure = createFigure(hvi, false);
+ cPoint.x = offsetPoint.x + (int) Math.round((myRadius * Math.cos(degree)));
+ cPoint.y = offsetPoint.y + (int) Math.round((myRadius * Math.sin(degree)));
+ if (debug.isDebug()) drawX(offsetPoint.x, offsetPoint.y - 5, "o");
+ if (debug.isDebug()) drawX(cPoint.x, cPoint.y - 5, "c");
+ Dimension dim = figure.getPreferredSize();
+ debug.report("dim " + relType + " w: " + dim.width + " h:" + dim.height);
+ if (isLeft) {
+ nwPoint.x = cPoint.x - dim.width;
+ nwPoint.y = cPoint.y - (dim.height / 2);
+ } else if (isRight) {
+ nwPoint.x = cPoint.x;
+ nwPoint.y = cPoint.y - (dim.height / 2);
+ } else if (isBottom) {
+ nwPoint.x = cPoint.x - (dim.width / 2);
+ nwPoint.y = cPoint.y;
+ } else if (isTop) {
+ nwPoint.x = cPoint.x - (dim.width / 2);
+ nwPoint.y = cPoint.y - dim.height;
+ }
+ if ((orderedHvis.size() > 1) && (isTop || isBottom)) {
+ if (i < orderedHvis.size() / 2) {
+ myRadius += zoom.pcRadiusSeparation;
+ if (isBottom) {
+ nwPoint.x += zoom.xSeparation;
+ }
+ if (isTop) {
+ nwPoint.x -= zoom.xSeparation;
+ }
+ } else if (i > orderedHvis.size() / 2) {
+ myRadius -= zoom.pcRadiusSeparation;
+ if (isBottom) {
+ nwPoint.x -= zoom.xSeparation;
+ }
+ if (isTop) {
+ nwPoint.x += zoom.xSeparation;
+ }
+ }
+ }
+ if ((orderedHvis.size() > 1) && (isLeft || isRight)) {
+ // int half = orderedFigures.size() / 2;
+ if (i < orderedHvis.size() / 2) {
+ myRadius += zoom.uuRadiusSeparation;
+ } else {
+ myRadius -= zoom.uuRadiusSeparation;
+ }
+ }
+ contentsLayout.setConstraint(figure, new Rectangle(nwPoint.x, nwPoint.y, -1, -1));
+ setMouseListener(figure);
+ /* Draw line to left */
+ ChopboxAnchor targetAnchor = new ChopboxAnchor(figure);
+ drawLine(sourceAnchor, targetAnchor, (figure).getHvi());
+ // .getRelationToolTip(),
+ // ((NodeFigure) figure).getHvi().getRelationLabel(), ((NodeFigure)
+ // figure).getHvi().getRelationDirty());
+
+ debug.report("cPoint *" + cPoint + "*");
+ debug.report("nwPoint *" + nwPoint + "*");
+ debug.report("offsetPoint *" + offsetPoint + "*");
+ ChopboxAnchor thisAnchor = new ChopboxAnchor(figure);
+ if (hvi.getTop().size() > 0) drawNodes(RelationEnum.TOP, hvi.getTop(), cPoint, thisAnchor);
+ if (hvi.getBottom().size() > 0) drawNodes(RelationEnum.BOTTOM, hvi.getBottom(), new Point(
+ (nwPoint.x + dim.width / 2), (nwPoint.y + dim.height / 2)), thisAnchor);
+ if (hvi.getLeft().size() > 0) drawNodes(RelationEnum.LEFT, hvi.getLeft(), cPoint, thisAnchor);
+ if (hvi.getRight().size() > 0) drawNodes(RelationEnum.RIGHT, hvi.getRight(), cPoint, thisAnchor);
+ }
+ }
+
+ /*
+ * Used for debug only drawQuadrant(leftQuadrantStart,quadrant);
+ */
+ // @SuppressWarnings("unused")
+ // private void drawQuadrant(double start, double degrees) {
+ // int cx = 100, cy = 100, r = 100;
+ // int x, y;
+ // double a;
+ // for (a = start; a < start + degrees; a += 0.01) {
+ // x = (int) Math.round(r * Math.cos(a)) + cx;
+ // y = (int) Math.round(r * Math.sin(a)) + cy;
+ // drawX(x, y, "x");
+ // }
+ // double degreeDiff = degrees / 4;
+ // for (int t = 0; t < 3; t += 1) {
+ // x = (int) Math.round(r * Math.cos(start + degreeDiff + (t * degreeDiff))) + cx;
+ // y = (int) Math.round(r * Math.sin(start + degreeDiff + (t * degreeDiff))) + cy;
+ // drawX(x, y + 20, "x");
+ // }
+ // }
+ private void drawX(int x, int y, String str) {
+ Label label = new Label(str, null);
+ Figure figure = new NodeFigure(label, null, new HyperViewItem(""), false);
+ container.add(figure);
+ contentsLayout.setConstraint(figure, new Rectangle(x, y, -1, -1));
+ }
+
+ private void drawLine(ChopboxAnchor source, ChopboxAnchor target, HyperViewItem hvi) {
+ PolylineConnection c = new PolylineConnection();
+ c.setLineWidth(2);
+ if (hvi.isRelationDirty()) c.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ c.setSourceAnchor(source);
+ c.setTargetAnchor(target);
+ setConnectionMouseListener(c, hvi);
+ // Add tooltip
+ if (hvi.getRelationToolTip() != null && !hvi.getRelationToolTip().equals("")) c.setToolTip(new Label(
+ hvi.getRelationToolTip()));
+ // Add label
+
+ ConnectionEndpointLocator targetEndpointLocator = new ConnectionEndpointLocator(c, true);
+ targetEndpointLocator.setVDistance(1);
+ Label targetMultiplicityLabel = new Label(hvi.getRelationLabel());
+ c.add(targetMultiplicityLabel, targetEndpointLocator);
+
+ connectors.add(c);
+ container.add(c);
+ }
+
+ protected void display() {
+ }
+
+ private void createConnectionMenuBar(final HyperViewItem hvi) {
+ if (AtsPlugin.isAtsAdmin()) {
+ if (connectPopupMenu == null || !connectPopupMenu.isVisible()) {
+ // final PolylineConnection c = connection;
+ connectPopupMenu = new Menu(canvas.getShell(), SWT.POP_UP);
+ MenuItem editItem = new MenuItem(connectPopupMenu, SWT.CASCADE);
+ editItem.setText("Delete Link");
+ editItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ if (MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Delete Link",
+ "Delete Link\n\n" + hvi.getLink().toString() + "\n\nAre you sure?")) {
+ Artifact artA = hvi.getLink().getArtifactA();
+ hvi.getLink().delete(true);
+ artA.persistRelations();
+ connectPopupMenu.dispose();
+ connectPopupMenu = null;
+ display();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ connectPopupMenu.setVisible(true);
+ }
+ }
+ }
+
+ private void setConnectionMouseListener(PolylineConnection c, final HyperViewItem hvi) {
+ MouseListener mouseListener = new MouseListener() {
+
+ public void mouseDoubleClicked(MouseEvent e) {
+ debug.report("DoubleClick");
+ }
+
+ public void mousePressed(MouseEvent e) {
+ debug.report("mousePressed");
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ debug.report("mouseReleased");
+ if (e.button == 3) {
+ if (e.getSource() instanceof PolylineConnection) {
+ // PolylineConnection c = (PolylineConnection) e.getSource();
+ createConnectionMenuBar(hvi);
+ }
+ return;
+ }
+ }
+ };
+ c.addMouseListener(mouseListener);
+ }
+
+ private NodeFigure createFigure(HyperViewItem hvi, boolean center) {
+ Label infoLabel = null;
+ String title = hvi.getShortTitle();
+ if (!titleAction.isChecked()) {
+ if (title.length() > 30) {
+ title = title.substring(0, 30);
+ }
+ }
+ Label nameLabel = new Label(title, hvi.getImage());
+ Image markImage = hvi.getMarkImage();
+ if (markImage != null) infoLabel = new Label(null, markImage);
+
+ NodeFigure figure = new NodeFigure(nameLabel, infoLabel, hvi, center);
+ // System.out.println(title + " " + figure.hashCode());
+ container.add(figure);
+ figure.setToolTip(new Label(hvi.getToolTip()));
+ return figure;
+ }
+
+ private void setContainerMouseListener(Figure figure) {
+ MouseListener mouseListener = new MouseListener() {
+
+ public void mouseDoubleClicked(MouseEvent e) {
+ }
+
+ public void mousePressed(MouseEvent e) {
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ if (e.button == 1) {
+ if (dragCenter) {
+ if (zoom.dragCenter == null) {
+ zoom.dragCenter = new Point();
+ }
+ zoom.dragCenter.x = e.x;
+ zoom.dragCenter.y = e.y;
+ refresh();
+ dragCenter = false;
+ if (hCursor != null) {
+ container.setCursor(null);
+ centerFigure.setCursor(null);
+ hCursor.dispose();
+ }
+ }
+ }
+ }
+ };
+ figure.addMouseListener(mouseListener);
+ }
+
+ private void setMouseListener(Figure figure) {
+ MouseListener mouseListener = new MouseListener() {
+
+ public void mouseDoubleClicked(MouseEvent e) {
+ if ((e.button == 1) && e.getSource() instanceof NodeFigure) {
+ NodeFigure nf = (NodeFigure) e.getSource();
+ HyperViewItem si = nf.getSearchItem();
+ try {
+ handleItemDoubleClick(si);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public void mousePressed(MouseEvent e) {
+ }
+
+ public void mouseReleased(MouseEvent e) {
+ // System.out.println("mouseReleased");
+ if (hCursor != null) {
+ container.setCursor(null);
+ centerFigure.setCursor(null);
+ hCursor.dispose();
+ }
+ if (e.getSource() instanceof NodeFigure) {
+ NodeFigure nf = (NodeFigure) e.getSource();
+ HyperViewItem si = nf.getSearchItem();
+ debug.report("Click: " + si.getTitle());
+ if (e.button == 3) {
+ createMenuBar(si);
+ }
+ }
+ }
+ };
+ figure.addMouseListener(mouseListener);
+ }
+
+ public void handleItemDoubleClick(HyperViewItem hvi) throws OseeCoreException {
+ backListAddSearchItem(hvi);
+ jumpTo(hvi);
+ }
+
+ public static void openActionEditor(Artifact artifact) {
+ if (artifact instanceof StateMachineArtifact) {
+ AtsLib.openAtsAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ }
+
+ private void createMenuBar(HyperViewItem hvi) {
+ if (popupMenu == null || !popupMenu.isVisible()) {
+ final HyperViewItem fHvi = hvi;
+ popupMenu = new Menu(canvas.getShell(), SWT.POP_UP);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ MenuItem editItem = new MenuItem(popupMenu, SWT.CASCADE);
+ editItem.setText("Open in Artifact Editor");
+ editItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Artifact a = null;
+ if (fHvi instanceof ArtifactHyperItem)
+ a = ((ArtifactHyperItem) fHvi).getArtifact();
+ else if (fHvi instanceof ActionHyperItem) a = ((ActionHyperItem) fHvi).getArtifact();
+ if (a != null) ArtifactEditor.editArtifact(a);
+ popupMenu.dispose();
+ popupMenu = null;
+ }
+ });
+ MenuItem deleteItem = new MenuItem(popupMenu, SWT.CASCADE);
+ deleteItem.setText("Delete Artifact");
+ deleteItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Artifact art = null;
+ if (fHvi instanceof ArtifactHyperItem)
+ art = ((ArtifactHyperItem) fHvi).getArtifact();
+ else if (fHvi instanceof ActionHyperItem) art = ((ActionHyperItem) fHvi).getArtifact();
+ if (MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Confirm Artifact Deletion?",
+ "\"" + art.getDescriptiveName() + "\"\nguid: " + art.getGuid() + "\n\n Are you sure you want to delete this artifact and it's default-hierarchy children?")) {
+ if (art != null) {
+ if (art instanceof StateMachineArtifact) SMAEditor.close((StateMachineArtifact) art, false);
+ try {
+ art.delete();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ popupMenu.dispose();
+ popupMenu = null;
+ }
+ });
+ }
+
+ MenuItem previewItem = new MenuItem(popupMenu, SWT.CASCADE);
+ previewItem.setText("Open in ATS");
+ previewItem.setEnabled(((fHvi instanceof ArtifactHyperItem) && (((ArtifactHyperItem) fHvi).getArtifact() instanceof StateMachineArtifact)) || ((fHvi instanceof ActionHyperItem) && (((ActionHyperItem) fHvi).getArtifact() instanceof StateMachineArtifact)));
+ previewItem.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Artifact a = null;
+ if (fHvi instanceof ArtifactHyperItem)
+ a = ((ArtifactHyperItem) fHvi).getArtifact();
+ else if (fHvi instanceof ActionHyperItem) a = ((ActionHyperItem) fHvi).getArtifact();
+ if (a != null) openActionEditor(a);
+ }
+ });
+ popupMenu.setVisible(true);
+ }
+ }
+
+ public void jumpTo(HyperViewItem si) {
+ if (homeSearchItem == null) {
+ return;
+ }
+ centerSearchItem = si;
+ refresh();
+ }
+
+ protected void center() {
+ zoom = defaultZoom;
+ vsb.setSelection(verticalSelection);
+ hsb.setSelection(40);
+ refresh();
+ }
+
+ protected void createActions() {
+
+ // Reset Action
+ Action centerAction = new Action() {
+
+ @Override
+ public void run() {
+ center();
+ }
+ };
+ centerAction.setText("Center");
+ centerAction.setToolTipText("Center");
+ centerAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("center.gif"));
+
+ if (provideBackForwardActions()) {
+ // Back Action
+ backAction = new Action() {
+
+ @Override
+ public void run() {
+ printBackList("pre backSelected");
+ if (backList.size() == 0) {
+ return;
+ }
+ if (backListIndex > 0) {
+ backListIndex--;
+ }
+ jumpTo(backList.get(backListIndex));
+ printBackList("post backSelected");
+ }
+ };
+
+ backAction.setText("Back");
+ backAction.setToolTipText("Back");
+ backAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+ ISharedImages.IMG_TOOL_BACK));
+ // Forward Action
+ forwardAction = new Action() {
+
+ @Override
+ public void run() {
+ printBackList("pre forwardSelected");
+ if (backList.size() - 1 > backListIndex) {
+ backListIndex++;
+ jumpTo(backList.get(backListIndex));
+ }
+ printBackList("post forwardSelected");
+ }
+ };
+ forwardAction.setText("Forward");
+ forwardAction.setToolTipText("Forward");
+ forwardAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
+ ISharedImages.IMG_TOOL_FORWARD));
+ }
+ // // Home
+ // Action homeAction = new Action() {
+ //
+ // public void run() {
+ // if (homeSearchItem == null) {
+ // return;
+ // }
+ // vsb.setSelection(verticalSelection);
+ // hsb.setSelection(40);
+ // backListAddSearchItem(homeSearchItem);
+ // jumpTo(homeSearchItem);
+ // }
+ // };
+ // homeAction.setText("Home");
+ // homeAction.setToolTipText("Home");
+ // homeAction.setImageDescriptor(AtsPlugin.getImageDescriptor("home.gif"));
+ // Zoom in
+ Action zoomInAction = new Action() {
+
+ @Override
+ public void run() {
+ if (homeSearchItem == null) {
+ return;
+ }
+ debug.report("zoomInAction");
+ zoom.pcRadius += zoom.pcRadiusFactor;
+ zoom.uuRadius += zoom.uuRadiusFactor;
+ zoom.xSeparation += zoom.xSeparationFactor;
+ refresh();
+
+ }
+ };
+ zoomInAction.setText("Zoom In");
+ zoomInAction.setToolTipText("Zoom In");
+ zoomInAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("zoom_in.gif"));
+ // Zoom Out
+ Action zoomOutAction = new Action() {
+
+ @Override
+ public void run() {
+ if (homeSearchItem == null) {
+ return;
+ }
+ debug.report("zoomOutAction");
+ if (zoom.pcRadius >= zoom.pcRadiusFactor) {
+ zoom.pcRadius -= zoom.pcRadiusFactor;
+ }
+ if (zoom.uuRadius >= zoom.uuRadiusFactor) {
+ zoom.uuRadius -= zoom.uuRadiusFactor;
+ }
+ if (zoom.xSeparation >= zoom.xSeparationFactor) {
+ zoom.xSeparation -= zoom.xSeparationFactor;
+ }
+ refresh();
+ }
+ };
+ zoomOutAction.setText("Zoom Out");
+ zoomOutAction.setToolTipText("Zoom Out");
+ zoomOutAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("zoom_out.gif"));
+
+ titleAction = new Action("Expand Titles", IAction.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ debug.report("expandTitles");
+ refresh();
+ }
+ };
+ titleAction.setToolTipText("Expand Titles");
+
+ Action refreshAction = new Action("Refresh") {
+
+ @Override
+ public void run() {
+ if (homeSearchItem == null) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Refresh Error", "Viewer not loaded, nothing to refresh.");
+ return;
+ }
+ handleRefreshButton();
+ }
+ };
+ refreshAction.setToolTipText("Refresh");
+ refreshAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("refresh.gif"));
+
+ showOrderAction = new Action("Show Order Value", IAction.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ setShowOrder(showOrderAction.isChecked());
+ handleRefreshButton();
+ }
+ };
+ showOrderAction.setToolTipText("Show Order Value");
+
+ IActionBars bars = getViewSite().getActionBars();
+ IMenuManager mm = bars.getMenuManager();
+ mm.add(new Separator());
+ mm.add(titleAction);
+ mm.add(showOrderAction);
+
+ IToolBarManager tbm = bars.getToolBarManager();
+ tbm.add(new Separator());
+ // tbm.add(homeAction);
+ tbm.add(centerAction);
+ tbm.add(zoomInAction);
+ tbm.add(zoomOutAction);
+ if (provideBackForwardActions()) {
+ tbm.add(backAction);
+ tbm.add(forwardAction);
+ }
+ tbm.add(refreshAction);
+
+ }
+
+ protected void handleRefreshButton() {
+ refresh();
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ @Override
+ public void setFocus() {
+ // viewer.getControl().setFocus();
+ }
+
+ public Color getCenterColor() {
+ return centerColor;
+ }
+
+ public void setCenterColor(Color color) {
+ centerColor = color;
+ }
+
+ public Color getNodeColor() {
+ return nodeColor;
+ }
+
+ public void setNodeColor(Color color) {
+ nodeColor = color;
+ }
+
+ public int getVerticalSelection() {
+ return verticalSelection;
+ }
+
+ public void setVerticalSelection(int verticalSelection) {
+ this.verticalSelection = verticalSelection;
+ if (vsb != null) vsb.setSelection(verticalSelection);
+ }
+
+ @Override
+ public void dispose() {
+ }
+
+ public void partActivated(IWorkbenchPart part) {
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this)) {
+ dispose();
+ }
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ }
+
+ public Figure getContainer() {
+ return container;
+ }
+
+ public boolean isShowOrder() {
+ return showOrder;
+ }
+
+ public void setShowOrder(boolean showOrder) {
+ this.showOrder = showOrder;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java
new file mode 100644
index 00000000000..bc161569e1b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.swt.graphics.Image;
+
+public class HyperViewItem {
+
+ private ArrayList<HyperViewItem> bottoms = new ArrayList<HyperViewItem>(); // bottom
+ private ArrayList<HyperViewItem> tops = new ArrayList<HyperViewItem>(); // top
+ private ArrayList<HyperViewItem> lefts = new ArrayList<HyperViewItem>(); // left
+ private ArrayList<HyperViewItem> rights = new ArrayList<HyperViewItem>(); // right
+ private String guid;
+ private final String title;
+ private Image image;
+ private Object data;
+ private String toolTip;
+ private String relationToolTip;
+ private String relationLabel;
+ private boolean relationDirty = false;
+ private boolean highlight = false;
+ private boolean current = false;
+ private boolean show = true;
+ private RelationLink link;
+
+ public HyperViewItem(String title) {
+ this(title, null);
+ }
+
+ public HyperViewItem(String title, Image image) {
+ this.title = title;
+ this.image = image;
+ this.toolTip = title;
+ }
+
+ // lastModified
+ public void clearAllSearchItemLinks() {
+ bottoms.clear();
+ tops.clear();
+ lefts.clear();
+ rights.clear();
+ }
+
+ public Image getMarkImage() {
+ return null;
+ }
+
+ public void addBottom(HyperViewItem si) {
+ bottoms.add(si);
+ }
+
+ public void addTop(HyperViewItem si) {
+ tops.add(si);
+ }
+
+ public void removeTop(HyperViewItem si) {
+ if (tops.contains(si)) {
+ tops.remove(si);
+ }
+ }
+
+ public String getShortTitle() {
+ return title;
+ }
+
+ public void addLeft(HyperViewItem si) {
+ lefts.add(si);
+ }
+
+ public void addRight(HyperViewItem si) {
+ rights.add(si);
+ }
+
+ /**
+ * @return ArrayList of HyperViewItems
+ */
+ public ArrayList<HyperViewItem> getBottom() {
+ return bottoms;
+ }
+
+ /**
+ * @return ArrayList of HyperViewItems
+ */
+ public ArrayList<HyperViewItem> getTop() {
+ return tops;
+ }
+
+ /**
+ * @return ArrayList of HyperViewItems
+ */
+ public ArrayList<HyperViewItem> getLeft() {
+ return lefts;
+ }
+
+ /**
+ * @return ArrayList of HyperViewItems
+ */
+ public ArrayList<HyperViewItem> getRight() {
+ return rights;
+ }
+
+ public Object getData() {
+ return data;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getToolTip() {
+ return toolTip;
+ }
+
+ public void setToolTip(String toolTip) {
+ this.toolTip = toolTip;
+ }
+
+ public boolean isShow() {
+ return show;
+ }
+
+ public void setShow(boolean show) {
+ this.show = show;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public boolean isHighlight() {
+ return highlight;
+ }
+
+ public void setHighlight(boolean highlight) {
+ this.highlight = highlight;
+ }
+
+ public boolean isCurrent() {
+ return current;
+ }
+
+ public void setCurrent(boolean current) {
+ this.current = current;
+ }
+
+ public void setGuid(String guid) {
+ this.guid = guid;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public String getRelationToolTip() {
+ return relationToolTip;
+ }
+
+ public void setRelationToolTip(String relationToolTip) {
+ this.relationToolTip = relationToolTip;
+ }
+
+ public String getRelationLabel() {
+ return relationLabel;
+ }
+
+ public boolean isRelationDirty() {
+ return relationDirty;
+ }
+
+ public void setRelationLabel(String relationLabel) {
+ this.relationLabel = relationLabel;
+ }
+
+ public void setRelationDirty(boolean relationDirty) {
+ this.relationDirty = relationDirty;
+ }
+
+ public RelationLink getLink() {
+ return link;
+ }
+
+ public void setLink(RelationLink link) {
+ this.link = link;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java
new file mode 100644
index 00000000000..81a7c7fac09
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.hyper;
+
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IHyperArtifact {
+
+ public boolean isDeleted();
+
+ public String getHyperName();
+
+ public String getHyperType();
+
+ public String getHyperState();
+
+ public String getGuid();
+
+ public String getHyperAssignee();
+
+ public Image getHyperImage();
+
+ public Image getHyperAssigneeImage() throws Exception;
+
+ public Artifact getHyperArtifact();
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksActionHyperItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksActionHyperItem.java
new file mode 100644
index 00000000000..ea792423d27
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksActionHyperItem.java
@@ -0,0 +1,45 @@
+/*
+ * Created on Jun 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.hyper;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TasksActionHyperItem extends ActionHyperItem {
+
+ private final Collection<TaskArtifact> taskArtifacts;
+
+ /**
+ * @param hyperartifact
+ */
+ public TasksActionHyperItem(Collection<TaskArtifact> taskArtifacts) {
+ super(new TasksHyperViewArtifact(taskArtifacts));
+ this.taskArtifacts = taskArtifacts;
+ setRelationToolTip("Task");
+ }
+
+ @Override
+ public void handleDoubleClick(HyperViewItem hyperViewItem) throws OseeCoreException {
+ super.handleDoubleClick(hyperViewItem);
+ WorldEditor.open(new WorldEditorSimpleProvider("Tasks", taskArtifacts));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.ActionHyperItem#calculateCurrent(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ @Override
+ public void calculateCurrent(Artifact currentArtifact) {
+ setCurrent(taskArtifacts.contains(currentArtifact));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksHyperViewArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksHyperViewArtifact.java
new file mode 100644
index 00000000000..3ce0e190729
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/TasksHyperViewArtifact.java
@@ -0,0 +1,97 @@
+/*
+ * Created on Jun 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.hyper;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TasksHyperViewArtifact implements IHyperArtifact {
+
+ private final Collection<? extends TaskArtifact> taskArts;
+
+ public TasksHyperViewArtifact(Collection<? extends TaskArtifact> taskArts) {
+ this.taskArts = taskArts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getGuid()
+ */
+ @Override
+ public String getGuid() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperArtifact()
+ */
+ @Override
+ public Artifact getHyperArtifact() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssignee()
+ */
+ @Override
+ public String getHyperAssignee() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssigneeImage()
+ */
+ @Override
+ public Image getHyperAssigneeImage()throws OseeCoreException{
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperImage()
+ */
+ @Override
+ public Image getHyperImage() {
+ return taskArts.iterator().next().getImage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperName()
+ */
+ @Override
+ public String getHyperName() {
+ return taskArts.size() + " Tasks";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperState()
+ */
+ @Override
+ public String getHyperState() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperType()
+ */
+ @Override
+ public String getHyperType() {
+ return TaskArtifact.ARTIFACT_NAME;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#isDeleted()
+ */
+ @Override
+ public boolean isDeleted() {
+ return false;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
new file mode 100644
index 00000000000..6a642a73df3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionId;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactCheckTreeDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ArtifactImpactToActionSearchItem extends XNavigateItemAction {
+
+ private static String TITLE = "Search Artifact Impact to Action";
+
+ /**
+ * @param parent
+ */
+ public ArtifactImpactToActionSearchItem(XNavigateItem parent) {
+ super(parent, TITLE);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ EntryDialog ed =
+ new EntryDialog(
+ getName(),
+ "Searching on current default branch \"" + BranchManager.getDefaultBranch().getBranchName() + "\"\n\nEnter Artifact Name (or string) to search (no wildcards)");
+ if (ed.open() == 0) {
+ ActionToArtifactImpactJob job = new ActionToArtifactImpactJob(ed.getEntry());
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ }
+
+ public class ActionToArtifactImpactJob extends Job {
+ private IProgressMonitor monitor;
+ private final String artifactName;
+ private XResultData rd = new XResultData();
+
+ public ActionToArtifactImpactJob(String artifactName) {
+ super("Searching \"" + artifactName + "\"...");
+ this.artifactName = artifactName;
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ this.monitor = monitor;
+ try {
+ getMatrixItems();
+ rd.report(TITLE + " - \"" + artifactName + "\"");
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
+
+ private void getMatrixItems() throws OseeCoreException {
+ final Collection<Artifact> srchArts =
+ ArtifactQuery.getArtifactsFromName("%" + artifactName + "%", BranchManager.getDefaultBranch(), true);
+ final Set<Artifact> processArts = new HashSet<Artifact>();
+ if (srchArts.size() == 0) return;
+ if (srchArts.size() > 1) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ ArtifactCheckTreeDialog dialog = new ArtifactCheckTreeDialog(srchArts);
+ dialog.setTitle(TITLE);
+ dialog.setMessage("Select Artifacts to Search");
+ if (dialog.open() == 0) {
+ processArts.addAll(dialog.getSelection());
+ }
+ }
+ }, true);
+
+ } else {
+ processArts.addAll(srchArts);
+ }
+ int x = 1;
+ rd.log("Artifact Impact to Action for artifact(s) on default branch \"" + BranchManager.getDefaultBranch().getBranchName() + "\"");
+
+ HashCollection<Artifact, TransactionId> transactionMap = ChangeManager.getModifingTransactions(processArts);
+ HashCollection<Artifact, Branch> branchMap = ChangeManager.getModifingBranches(processArts);
+ for (Artifact srchArt : processArts) {
+ String str = String.format("Processing %d/%d - %s ", x++, processArts.size(), srchArt.getDescriptiveName());
+ System.out.println(str);
+ rd.log("\n" + AHTML.bold(srchArt.getDescriptiveName()));
+ monitor.subTask(str);
+ int y = 1;
+ rd.addRaw(AHTML.beginMultiColumnTable(95, 1));
+ rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Status", "HRID", "Title"}));
+
+ // Check for changes on working branches
+ boolean workingBranchesFound = false;
+
+ Collection<Branch> branches = branchMap.getValues(srchArt);
+ if (branches != null) {
+ for (Branch branch : branches) {
+ Artifact assocArt = branch.getAssociatedArtifact();
+ if (assocArt != null && !assocArt.equals(UserManager.getUser(SystemUser.NoOne))) {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(), "Working",
+ assocArt.getHumanReadableId(), assocArt.getDescriptiveName()}));
+ } else {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {"Branch", "", branch.getBranchName()}));
+ }
+ workingBranchesFound = true;
+ }
+ }
+ if (!workingBranchesFound) {
+ rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Working Branches Found", 3));
+ }
+ // Add committed changes
+ boolean committedChanges = false;
+ Collection<TransactionId> transactions = transactionMap.getValues(srchArt);
+ if (transactions != null) {
+ for (TransactionId transactionId : transactions) {
+ String transStr = String.format("Tranaction %d/%d", y++, transactions.size());
+ System.out.println(transStr);
+ monitor.subTask(transStr);
+ if (transactionId.getCommitArtId() > 0) {
+ Artifact assocArt =
+ ArtifactQuery.getArtifactFromId(transactionId.getCommitArtId(),
+ BranchManager.getCommonBranch());
+ if (assocArt instanceof TeamWorkFlowArtifact) {
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(),
+ "Committed", assocArt.getHumanReadableId(), assocArt.getDescriptiveName()}));
+ committedChanges = true;
+ }
+ }
+ }
+ }
+ if (!committedChanges) {
+ rd.addRaw(AHTML.addRowSpanMultiColumnTable("No Impacting Actions Found", 3));
+ }
+ rd.addRaw(AHTML.endMultiColumnTable());
+ }
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
new file mode 100644
index 00000000000..fc9faa6b6b2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.task.TaskEditor;
+import org.eclipse.osee.ats.task.TaskEditorParameterSearchItem;
+import org.eclipse.osee.ats.task.TaskEditorParameterSearchItemProvider;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorParameterSearchItem;
+import org.eclipse.osee.ats.world.WorldEditorParameterSearchItemProvider;
+import org.eclipse.osee.ats.world.WorldEditorUISearchItemProvider;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.ats.world.search.WorldUISearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.LoadView;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateViewItems;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsNavigateComposite extends XNavigateComposite {
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public AtsNavigateComposite(XNavigateViewItems navigateViewItems, Composite parent, int style) {
+ super(navigateViewItems, parent, style);
+ Result result = AtsPlugin.areOSEEServicesAvailable();
+ if (result.isFalse()) {
+ (new Label(parent, SWT.NONE)).setText(result.getText());
+ return;
+ }
+ }
+
+ @Override
+ protected void handleDoubleClick() throws OseeCoreException {
+ IStructuredSelection sel = (IStructuredSelection) filteredTree.getViewer().getSelection();
+ if (!sel.iterator().hasNext()) return;
+ XNavigateItem item = (XNavigateItem) sel.iterator().next();
+ handleDoubleClick(item);
+ }
+
+ @Override
+ protected void handleDoubleClick(XNavigateItem item, TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ if (item instanceof SearchNavigateItem) {
+ WorldSearchItem worldSearchItem = ((SearchNavigateItem) item).getWorldSearchItem();
+ if (worldSearchItem.getLoadView() == LoadView.WorldEditor) {
+ if (worldSearchItem instanceof WorldUISearchItem) {
+ WorldEditor.open(new WorldEditorUISearchItemProvider((WorldUISearchItem) worldSearchItem.copy(), null,
+ tableLoadOptions));
+ } else if (worldSearchItem instanceof WorldEditorParameterSearchItem) {
+ WorldEditor.open(new WorldEditorParameterSearchItemProvider(
+ (WorldEditorParameterSearchItem) worldSearchItem.copy(), null, tableLoadOptions));
+ } else {
+ AWorkbench.popup("ERROR", "Unhandled WorldEditor navigate item");
+ }
+ } else if (worldSearchItem.getLoadView() == LoadView.TaskEditor) {
+ if (worldSearchItem instanceof TaskEditorParameterSearchItem) {
+ TaskEditor.open(new TaskEditorParameterSearchItemProvider(
+ (TaskEditorParameterSearchItem) worldSearchItem.copy()));
+ } else {
+ AWorkbench.popup("ERROR", "Unhandled TaskEditor navigate item");
+ }
+ } else {
+ AWorkbench.popup("ERROR", "Unhandled navigate item");
+ }
+ } else
+ super.handleDoubleClick(item, tableLoadOptions);
+ }
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ if (AtsPlugin.isAtsAdmin()) {
+ for (XNavigateItem item : getItems()) {
+ if (item.getName().equals("Admin")) {
+ filteredTree.getViewer().expandToLevel(item, 1);
+ }
+ }
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
new file mode 100644
index 00000000000..2c40e96ed45
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewAction;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.health.ValidateAtsDatabase;
+import org.eclipse.osee.ats.health.ValidateChangeReportByHrid;
+import org.eclipse.osee.ats.health.ValidateChangeReports;
+import org.eclipse.osee.ats.navigate.EmailTeamsItem.MemberType;
+import org.eclipse.osee.ats.util.DoesNotWorkItem;
+import org.eclipse.osee.ats.world.search.ActionableItemWorldSearchItem;
+import org.eclipse.osee.ats.world.search.ArtIdSearchItem;
+import org.eclipse.osee.ats.world.search.ArtifactTypeSearchItem;
+import org.eclipse.osee.ats.world.search.ArtifactTypesSearchItem;
+import org.eclipse.osee.ats.world.search.AtsAttributeSearchItem;
+import org.eclipse.osee.ats.world.search.GroupWorldSearchItem;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.ats.world.search.MyCompletedSearchItem;
+import org.eclipse.osee.ats.world.search.MyFavoritesSearchItem;
+import org.eclipse.osee.ats.world.search.MyOrigSearchItem;
+import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem;
+import org.eclipse.osee.ats.world.search.MySubscribedSearchItem;
+import org.eclipse.osee.ats.world.search.MyWorldSearchItem;
+import org.eclipse.osee.ats.world.search.NextVersionSearchItem;
+import org.eclipse.osee.ats.world.search.ShowOpenWorkflowsByArtifactType;
+import org.eclipse.osee.ats.world.search.StateWorldSearchItem;
+import org.eclipse.osee.ats.world.search.TaskSearchWorldSearchItem;
+import org.eclipse.osee.ats.world.search.UserCommunitySearchItem;
+import org.eclipse.osee.ats.world.search.UserRelatedToAtsObjectSearch;
+import org.eclipse.osee.ats.world.search.VersionTargetedForTeamSearchItem;
+import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem.ReviewState;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.LoadView;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.blam.BlamOperations;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation;
+import org.eclipse.osee.framework.ui.skynet.util.EmailGroupsAndUserGroups;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.EmailGroupsAndUserGroups.GroupType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemBlam;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateViewItems;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsNavigateViewItems extends XNavigateViewItems {
+ private static AtsNavigateViewItems navigateItems = new AtsNavigateViewItems();
+
+ public AtsNavigateViewItems() {
+ super();
+ }
+
+ public static AtsNavigateViewItems getInstance() {
+ return navigateItems;
+ }
+
+ @Override
+ public List<XNavigateItem> getSearchNavigateItems() {
+ List<XNavigateItem> items = new ArrayList<XNavigateItem>();
+
+ if (AtsPlugin.areOSEEServicesAvailable().isFalse()) {
+ return items;
+ }
+
+ try {
+ User user = UserManager.getUser();
+
+ items.add(new SearchNavigateItem(null, new MyWorldSearchItem("My World", user)));
+ items.add(new SearchNavigateItem(null, new MyFavoritesSearchItem("My Favorites", user)));
+ items.add(new SearchNavigateItem(null, new MyReviewWorkflowItem("My Reviews", user, ReviewState.InWork)));
+ items.add(new VisitedItems(null));
+ items.add(new XNavigateItemAction(null, new NewAction()));
+ items.add(new SearchNavigateItem(null, new MyWorldSearchItem("User's World")));
+
+ XNavigateItem otherItems = new XNavigateItem(null, "Other My Searches");
+ new SearchNavigateItem(otherItems, new MySubscribedSearchItem("My Subscribed", user));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("My Originator - InWork", user,
+ MyOrigSearchItem.OriginatedState.InWork));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("My Originator - All", user,
+ MyOrigSearchItem.OriginatedState.All));
+ new SearchNavigateItem(otherItems, new MyCompletedSearchItem("My Completed", user));
+ new SearchNavigateItem(otherItems, new MyReviewWorkflowItem("My Reviews - All", user, ReviewState.All));
+ items.add(otherItems);
+
+ otherItems = new XNavigateItem(null, "Other User Searches");
+ new SearchNavigateItem(otherItems, new MyWorldSearchItem("User's World"));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("User's Originator - InWork", null,
+ MyOrigSearchItem.OriginatedState.InWork));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("User's Originator - All", null,
+ MyOrigSearchItem.OriginatedState.All));
+ new SearchNavigateItem(otherItems, new MyCompletedSearchItem("User's Completed"));
+ new SearchNavigateItem(otherItems, new MyFavoritesSearchItem("User's Favorites"));
+ new SearchNavigateItem(otherItems, new MySubscribedSearchItem("User's Subscribed"));
+ new SearchNavigateItem(otherItems, new MyReviewWorkflowItem("User's Reviews - InWork", null,
+ ReviewState.InWork));
+ new SearchNavigateItem(otherItems, new MyReviewWorkflowItem("User's Reviews - All", null, ReviewState.All));
+ if (AtsPlugin.isAtsAdmin()) {
+ new SearchNavigateItem(otherItems, new UserRelatedToAtsObjectSearch(
+ "User's All Related Objects - Admin Only", null, false, LoadView.WorldEditor));
+ new SearchNavigateItem(otherItems, new UserRelatedToAtsObjectSearch(
+ "User's All Active Related Objects - Admin Only", null, true, LoadView.WorldEditor));
+ }
+ items.add(otherItems);
+
+ items.add(new SearchNavigateItem(null, new TaskSearchWorldSearchItem()));
+ items.add(new SearchNavigateItem(null, new GroupWorldSearchItem()));
+ items.add(new SearchNavigateItem(null, new TeamWorkflowSearchWorkflowSearchItem()));
+ items.add(new SearchNavigateItem(null, new UserCommunitySearchItem()));
+ items.add(new SearchNavigateItem(null, new ActionableItemWorldSearchItem(null, "Actionable Item Search",
+ false, true, false)));
+
+ XNavigateItem releaseItems = new XNavigateItem(null, "Versions");
+ new MassEditTeamVersionItem("Team Versions", releaseItems, (TeamDefinitionArtifact) null);
+ new SearchNavigateItem(releaseItems, new VersionTargetedForTeamSearchItem(null, null, false,
+ LoadView.WorldEditor));
+ new SearchNavigateItem(releaseItems, new NextVersionSearchItem(null, LoadView.WorldEditor));
+ new ReleaseVersionItem(releaseItems, null);
+ new CreateNewVersionItem(releaseItems, null);
+ new GenerateVersionReportItem(releaseItems);
+ new GenerateFullVersionReportItem(releaseItems);
+ items.add(releaseItems);
+
+ addExtensionPointItems(items);
+
+ XNavigateItem reviewItem = new XNavigateItem(null, "Reviews");
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Open " + DecisionReviewArtifact.ARTIFACT_NAME + "s", DecisionReviewArtifact.ARTIFACT_NAME, false,
+ false));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Workflows Waiting " + DecisionReviewArtifact.ARTIFACT_NAME + "s",
+ DecisionReviewArtifact.ARTIFACT_NAME, false, true));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Open " + PeerToPeerReviewArtifact.ARTIFACT_NAME + "s", PeerToPeerReviewArtifact.ARTIFACT_NAME,
+ false, false));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Workflows Waiting " + PeerToPeerReviewArtifact.ARTIFACT_NAME + "s",
+ PeerToPeerReviewArtifact.ARTIFACT_NAME, false, true));
+ new NewPeerToPeerReviewItem(reviewItem);
+ new GenerateReviewParticipationReport(reviewItem);
+ items.add(reviewItem);
+
+ XNavigateItem stateItems = new XNavigateItem(null, "States");
+ new SearchNavigateItem(stateItems, new StateWorldSearchItem());
+ new SearchNavigateItem(stateItems, new StateWorldSearchItem("Search for Authorize Actions", "Authorize"));
+ items.add(stateItems);
+
+ // Search Items
+ items.add(new OpenChangeReportByIdItem(null));
+ items.add(new SearchNavigateItem(null, new MultipleHridSearchItem()));
+ if (AtsPlugin.isAtsAdmin()) items.add(new SearchNavigateItem(null, new ArtIdSearchItem()));
+ items.add(new SearchNavigateItem(null, new AtsAttributeSearchItem()));
+ items.add(new SearchNavigateItem(null, new AtsAttributeSearchItem("Search ATS Titles", "Name", null)));
+ items.add(new ArtifactImpactToActionSearchItem(null));
+
+ XNavigateItem reportItems = new XNavigateItem(null, "Reports");
+ new FirstTimeQualityMetricReportItem(reportItems);
+ new XNavigateItem(reportItems, "ATS World Reports - Input from Actions in ATS World");
+ // new ExtendedStatusReportItem(atsReportItems, "ATS World Extended Status Report");
+
+ XNavigateItem emailItems = new XNavigateItem(null, "Email");
+ new EmailTeamsItem(emailItems, null, MemberType.Both);
+ new EmailTeamsItem(emailItems, null, MemberType.Leads);
+ new EmailTeamsItem(emailItems, null, MemberType.Members);
+ new EmailGroupsAndUserGroups(emailItems, GroupType.Both);
+ items.add(emailItems);
+
+ items.add(reportItems);
+
+ XNavigateItem importItems = new XNavigateItem(null, "Import");
+ new ImportActionsViaSpreadsheet(importItems);
+ items.add(importItems);
+
+ XNavigateItem blamOperationItems = new XNavigateItem(null, "Blam Operations");
+ for (BlamOperation blamOperation : BlamOperations.getBlamOperationsNameSort()) {
+ new XNavigateItemBlam(blamOperationItems, blamOperation);
+ }
+ items.add(blamOperationItems);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ XNavigateItem adminItems = new XNavigateItem(null, "Admin");
+
+ new UpdateAtsWorkItemDefinitions(adminItems);
+ new UpdateAssigneesRelations(adminItems);
+ new DisplayCurrentOseeEventListeners(adminItems);
+
+ new SearchNavigateItem(adminItems, new ArtifactTypeSearchItem("Show all Actions", "Actions"));
+ new SearchNavigateItem(adminItems,
+ new ArtifactTypeSearchItem("Show all Decision Review", "Decision Review"));
+ new SearchNavigateItem(adminItems, new ArtifactTypeSearchItem("Show all PeerToPeer Review",
+ "PeerToPeer Review"));
+ new SearchNavigateItem(adminItems, new ArtifactTypesSearchItem("Show all Team Workflows",
+ TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames()));
+ new SearchNavigateItem(adminItems, new ArtifactTypeSearchItem("Show all Tasks", "Task"));
+
+ new DoesNotWorkItem(adminItems);
+
+ XNavigateItem healthItems = new XNavigateItem(adminItems, "Health");
+ new ValidateAtsDatabase(healthItems);
+ new ValidateChangeReports(healthItems);
+ new ValidateChangeReportByHrid(healthItems);
+
+ // new ActionNavigateItem(adminItems, new XViewerViewAction());
+ // new ActionNavigateItem(adminItems, new OpenEditorAction());
+ // new CreateBugFixesItem(adminItems);
+
+ items.add(adminItems);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return items;
+ }
+
+ return items;
+ }
+
+ public void addExtensionPointItems(List<XNavigateItem> items) {
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsNavigateItem");
+ if (point == null) OSEELog.logSevere(AtsPlugin.class, "Can't access AtsNavigateItem extension point", true);
+ IExtension[] extensions = point.getExtensions();
+ Map<String, XNavigateItem> nameToNavItem = new HashMap<String, XNavigateItem>();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String classname = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsNavigateItem")) {
+ classname = el.getAttribute("classname");
+ bundleName = el.getContributor().getName();
+ }
+ }
+ if (classname != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ Object obj = bundle.loadClass(classname).newInstance();
+ IAtsNavigateItem task = (IAtsNavigateItem) obj;
+ for (XNavigateItem navItem : task.getNavigateItems()) {
+ nameToNavItem.put(navItem.getName(), navItem);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Error loading AtsNavigateItem extension", ex);
+ }
+ }
+ }
+ // Put in alpha order
+ String[] names = nameToNavItem.keySet().toArray(new String[nameToNavItem.size()]);
+ Arrays.sort(names);
+ for (String name : names) {
+ items.add(nameToNavItem.get(name));
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java
new file mode 100644
index 00000000000..957dab0d220
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.vue.LoadAIsAndTeamsAction;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ConfigureDBForAts extends XNavigateItemAction {
+
+ private final String pluginId;
+
+ public ConfigureDBForAts(XNavigateItem parent, String pluginId) {
+ super(parent, "Admin - Configure DB For ATS");
+ this.pluginId = pluginId;
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Configure DB for ATS",
+ "Configure DB for ATS " + pluginId)) return;
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Configure DB for ATS",
+ "This will break things really bad if ATS is alread configured for this item. Are you sure?")) return;
+
+ Jobs.startJob(new Report(getName()), true);
+ }
+
+ public class Report extends Job {
+
+ public Report(String name) {
+ super(name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ monitor.subTask("Loading Work Item Definitions for " + pluginId);
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(WriteType.New, null,
+ AtsWorkDefinitions.getAtsWorkDefinitions());
+ monitor.subTask("Loading Actionable Items and Teams for " + pluginId);
+ LoadAIsAndTeamsAction.executeForAtsRuntimeConfig(false, pluginId);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java
new file mode 100644
index 00000000000..89eb457eb9c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CreateNewVersionItem extends XNavigateItemAction {
+
+ private final TeamDefinitionArtifact teamDefHoldingVersions;
+
+ /**
+ * @param parent
+ * @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
+ */
+ public CreateNewVersionItem(XNavigateItem parent, TeamDefinitionArtifact teamDefHoldingVersions) {
+ super(parent, "Create New " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + " Version");
+ this.teamDefHoldingVersions = teamDefHoldingVersions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ TeamDefinitionArtifact teamDefHoldingVersions = null;
+ try {
+ teamDefHoldingVersions = getReleaseableTeamDefinitionArtifact();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ if (teamDefHoldingVersions == null) return;
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Create New Version", null, "Enter Version Name",
+ MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ if (ed.open() == 0) {
+ String newVer = ed.getEntry();
+ if (newVer.equals("")) {
+ AWorkbench.popup("ERROR", "Version name can't be blank");
+ return;
+ }
+ for (VersionArtifact verArt : teamDefHoldingVersions.getVersionsArtifacts()) {
+ if (verArt.getDescriptiveName().equals(newVer)) {
+ AWorkbench.popup("ERROR", "Version already exists");
+ return;
+ }
+ }
+
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ createNewVersionItemTx(transaction, teamDefHoldingVersions, newVer);
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public TeamDefinitionArtifact getReleaseableTeamDefinitionArtifact() throws OseeCoreException {
+ if (teamDefHoldingVersions != null) return teamDefHoldingVersions;
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Active));
+ int result = ld.open();
+ if (result == 0) {
+ return (TeamDefinitionArtifact) ld.getResult()[0];
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate#handleTxWork()
+ */
+ private void createNewVersionItemTx( SkynetTransaction transaction, TeamDefinitionArtifact teamDefHoldingVersions, String newVer) throws OseeCoreException {
+ VersionArtifact ver =
+ (VersionArtifact) ArtifactTypeManager.addArtifact(VersionArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch(), newVer);
+ teamDefHoldingVersions.addRelation(AtsRelation.TeamDefinitionToVersion_Version, ver);
+ ver.persistAttributesAndRelations(transaction);
+ ArtifactEditor.editArtifact(ver);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/DisplayCurrentOseeEventListeners.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/DisplayCurrentOseeEventListeners.java
new file mode 100644
index 00000000000..4f18cc0e03c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/DisplayCurrentOseeEventListeners.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DisplayCurrentOseeEventListeners extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public DisplayCurrentOseeEventListeners(XNavigateItem parent) {
+ super(parent, "Display Current OSEE Event Listeners");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ String str = OseeEventManager.getListenerReport();
+ XResultView.getResultView().displayPage(new XResultPage(getName(), str));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java
new file mode 100644
index 00000000000..a5f678de446
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionTreeWithChildrenDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EmailTeamsItem extends XNavigateItemAction {
+
+ private final TeamDefinitionArtifact teamDef;
+ private final Collection<MemberType> memberTypes;
+ public static enum MemberType {
+ Leads, Members, Both
+ };
+
+ /**
+ * @param parent
+ * @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
+ */
+ public EmailTeamsItem(XNavigateItem parent, TeamDefinitionArtifact teamDef, MemberType... memberType) {
+ super(
+ parent,
+ "Email " + (teamDef == null ? "Team " : "\"" + teamDef + "\" Team ") + (Arrays.asList(memberType).contains(
+ MemberType.Both) ? "Leads / Members" : (Arrays.asList(memberType).contains(MemberType.Leads) ? "Leads" : "Members")));
+ memberTypes = Arrays.asList(memberType);
+ this.teamDef = teamDef;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ Collection<TeamDefinitionArtifact> teamDefs = getTeamDefinitions();
+ if (teamDefs.size() == 0) return;
+ Set<String> emails = new HashSet<String>();
+ for (TeamDefinitionArtifact teamDef : teamDefs) {
+ if (memberTypes.contains(MemberType.Members) || memberTypes.contains(MemberType.Both)) {
+ for (User user : teamDef.getRelatedArtifacts(AtsRelation.TeamMember_Member, User.class))
+ if (!user.getEmail().equals("")) emails.add(user.getEmail());
+ }
+ if (memberTypes.contains(MemberType.Leads) || memberTypes.contains(MemberType.Both)) {
+ for (User user : teamDef.getRelatedArtifacts(AtsRelation.TeamLead_Lead, User.class))
+ if (!user.getEmail().equals("")) emails.add(user.getEmail());
+ }
+ }
+ if (emails.size() == 0) {
+ AWorkbench.popup("Error", "No emails configured.");
+ return;
+ }
+ Program.launch("mailto:" + org.eclipse.osee.framework.jdk.core.util.Collections.toString(";", emails));
+ AWorkbench.popup("Complete", "Configured emails openened in local email client.");
+ }
+
+ public Collection<TeamDefinitionArtifact> getTeamDefinitions() throws OseeCoreException {
+ if (teamDef != null) {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ teamDefs.add(teamDef);
+ teamDefs.addAll(Artifacts.getChildrenOfTypeSet(teamDef, TeamDefinitionArtifact.class, true));
+ return teamDefs;
+ }
+ TeamDefinitionTreeWithChildrenDialog ld = new TeamDefinitionTreeWithChildrenDialog(Active.Active);
+ int result = ld.open();
+ if (result == 0) {
+ return ld.getResultAndRecursedTeamDefs();
+ }
+ return java.util.Collections.emptyList();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java
new file mode 100644
index 00000000000..8d3c9772a6c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/FirstTimeQualityMetricReportItem.java
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.VersionMetrics;
+import org.eclipse.osee.ats.util.VersionTeamMetrics;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class FirstTimeQualityMetricReportItem extends XNavigateItemAction {
+
+ private final TeamDefinitionArtifact teamDef;
+ private final String teamDefName;
+
+ public FirstTimeQualityMetricReportItem(XNavigateItem parent, String name, String teamDefName) {
+ super(parent, name);
+ this.teamDefName = teamDefName;
+ this.teamDef = null;
+ }
+
+ public FirstTimeQualityMetricReportItem(XNavigateItem parent) {
+ this(parent, "First Time Quality Metric Report", null);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem#getDescription()
+ */
+ @Override
+ public String getDescription() {
+ return "This report will genereate a metric comprised of:\n\n# of priority 1 and 2 OSEE problem actions orginated between release\n__________________________________\n# of non-support actions in that released";
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ TeamDefinitionArtifact useTeamDef = teamDef;
+ if (useTeamDef == null && teamDefName != null) {
+ useTeamDef = AtsCache.getSoleArtifactByName(teamDefName, TeamDefinitionArtifact.class);
+ }
+ if (useTeamDef == null) {
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ ld.setTitle(getName());
+ try {
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Both));
+ } catch (MultipleAttributesExist ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ int result = ld.open();
+ if (result == 0) {
+ if (ld.getResult().length == 0) {
+ AWorkbench.popup("ERROR", "You must select a team to operate against.");
+ return;
+ }
+ useTeamDef = (TeamDefinitionArtifact) ld.getResult()[0];
+ } else
+ return;
+ } else if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+
+ ReportJob job = new ReportJob(getName(), useTeamDef);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+
+ private class ReportJob extends Job {
+
+ private final TeamDefinitionArtifact teamDef;
+
+ public ReportJob(String title, TeamDefinitionArtifact teamDef) {
+ super(title);
+ this.teamDef = teamDef;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.ReleaseReportJob#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ XResultData resultData = new XResultData();
+ String html = getTeamWorkflowReport(getName(), teamDef, monitor);
+ resultData.addRaw(html);
+ resultData.report(getName(), Manipulations.RAW_HTML);
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ private static String[] HEADER_STRINGS =
+ new String[] {"Version", "StartDate", "RelDate", "Num 1 + 2 Orig During Next Release Cycle",
+ "Num Non-Support Released", "Ratio Orig 1 and 2 Bugs/Number Released"};
+
+ /**
+ * Ratio of # of priority 1 and 2 OSEE problem actions (non-cancelled) that were orginated between a release and the
+ * next release / # of non-support actions released in that release
+ *
+ * @param teamDef
+ * @param monitor
+ * @return report
+ */
+ public static String getTeamWorkflowReport(String title, TeamDefinitionArtifact teamDef, IProgressMonitor monitor) throws OseeCoreException {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.heading(3, title));
+ sb.append(AHTML.beginMultiColumnTable(100, 1));
+ sb.append(AHTML.addRowSpanMultiColumnTable(
+ "This report shows the ratio of 1+2 problem workflows created during next release cycle due to current release over the total non-support workflows during this release.",
+ HEADER_STRINGS.length));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(HEADER_STRINGS));
+ VersionTeamMetrics teamMet = new VersionTeamMetrics(teamDef);
+ Collection<VersionMetrics> verMets = teamMet.getReleasedOrderedVersions();
+ monitor.beginTask("Processing Versions", verMets.size());
+ for (VersionMetrics verMet : verMets) {
+ Date thisReleaseStartDate = verMet.getReleaseStartDate();
+ Date thisReleaseEndDate = verMet.getVerArt().getReleaseDate();
+ Date nextReleaseStartDate = null;
+ Date nextReleaseEndDate = null;
+ VersionMetrics nextVerMet = verMet.getNextVerMetViaReleaseDate();
+ if (nextVerMet != null) {
+ nextReleaseStartDate = nextVerMet.getReleaseStartDate();
+ nextReleaseEndDate = nextVerMet.getVerArt().getReleaseDate();
+ }
+ Integer numOrigDurningNextReleaseCycle = null;
+ if (nextReleaseStartDate != null && nextReleaseEndDate != null) {
+ if (numOrigDurningNextReleaseCycle == null) {
+ numOrigDurningNextReleaseCycle = 0;
+ }
+ Collection<TeamWorkFlowArtifact> arts =
+ teamMet.getWorkflowsOriginatedBetween(nextReleaseStartDate, nextReleaseEndDate);
+ for (TeamWorkFlowArtifact team : arts) {
+ if (!team.getSmaMgr().isCancelled() && team.getChangeType() == ChangeType.Problem && (team.getPriority() == PriorityType.Priority_1 || team.getPriority() == PriorityType.Priority_2)) {
+ numOrigDurningNextReleaseCycle++;
+ }
+ }
+ }
+ Integer numNonSupportReleased = null;
+ if (thisReleaseEndDate != null) {
+ numNonSupportReleased = 0;
+ for (TeamWorkFlowArtifact team : verMet.getTeamWorkFlows(ChangeType.Problem, ChangeType.Improvement)) {
+ if (!team.getSmaMgr().isCancelled()) {
+ numNonSupportReleased++;
+ }
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {
+ verMet.getVerArt().getDescriptiveName(),
+ XDate.getDateStr(thisReleaseStartDate, XDate.MMDDYY),
+ XDate.getDateStr(thisReleaseEndDate, XDate.MMDDYY),
+ numOrigDurningNextReleaseCycle == null ? "N/A" : String.valueOf(numOrigDurningNextReleaseCycle),
+ numNonSupportReleased == null ? "N/A" : String.valueOf(numNonSupportReleased),
+ numOrigDurningNextReleaseCycle == null || numNonSupportReleased == 0 || numNonSupportReleased == null ? "N/A" : AtsLib.doubleToStrString(new Double(
+ numOrigDurningNextReleaseCycle) / numNonSupportReleased)}));
+ monitor.worked(1);
+ }
+ sb.append(AHTML.endMultiColumnTable());
+ return sb.toString();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java
new file mode 100644
index 00000000000..2342b5ec9d5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.VersionReportJob;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class GenerateFullVersionReportItem extends XNavigateItemAction {
+
+ private TeamDefinitionArtifact teamDef;
+ private final String teamDefName;
+
+ public GenerateFullVersionReportItem(XNavigateItem parent) {
+ super(parent, "Generate Full Version Report");
+ this.teamDefName = null;
+ this.teamDef = null;
+ }
+
+ public GenerateFullVersionReportItem(XNavigateItem parent, TeamDefinitionArtifact teamDef) {
+ super(parent, "Generate Full Version Report");
+ this.teamDefName = null;
+ this.teamDef = teamDef;
+ }
+
+ public GenerateFullVersionReportItem(XNavigateItem parent, String teamDefName) {
+ super(parent, "Generate Full Version Report");
+ this.teamDefName = teamDefName;
+ this.teamDef = null;
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ TeamDefinitionArtifact teamDef = getTeamDefinition();
+ if (teamDef == null) return;
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ PublishReportJob job = new PublishReportJob(teamDef);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+
+ public TeamDefinitionArtifact getTeamDefinition() throws OseeCoreException {
+ if (teamDef != null) return teamDef;
+ if (teamDefName != null && !teamDefName.equals("")) {
+ try {
+ TeamDefinitionArtifact teamDef = AtsCache.getSoleArtifactByName(teamDefName, TeamDefinitionArtifact.class);
+ if (teamDef != null) return teamDef;
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing, going to get team below
+ }
+ }
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ try {
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Active));
+ } catch (MultipleAttributesExist ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ int result = ld.open();
+ if (result == 0) {
+ return (TeamDefinitionArtifact) ld.getResult()[0];
+ }
+ return null;
+ }
+
+ private class PublishReportJob extends Job {
+
+ private final TeamDefinitionArtifact teamDef;
+
+ public PublishReportJob(TeamDefinitionArtifact teamDef) {
+ super(teamDef.getDescriptiveName() + " as of " + XDate.getDateNow());
+ this.teamDef = teamDef;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ String html = VersionReportJob.getFullReleaseReport(teamDef, monitor);
+ XResultData rd = new XResultData();
+ rd.addRaw(html);
+ rd.report(getName(), Manipulations.RAW_HTML);
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java
new file mode 100644
index 00000000000..8f280eb8707
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateReviewParticipationReport.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.xviewer.column.XViewerReviewRoleColumn;
+import org.eclipse.osee.ats.util.xviewer.column.XViewerSmaCompletedDateColumn;
+import org.eclipse.osee.ats.util.xviewer.column.XViewerSmaStateColumn;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem;
+import org.eclipse.osee.ats.world.search.MyReviewWorkflowItem.ReviewState;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditorInput;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactNameColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactTypeColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerGuidColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerHridColumn;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Donald G. Dunne
+ */
+public class GenerateReviewParticipationReport extends XNavigateItemAction {
+
+ private final String MASS_XVIEWER_CUSTOMIZE_NAMESPACE = "org.eclipse.osee.ats.ReviewParticipationReport";
+
+ public GenerateReviewParticipationReport(XNavigateItem parent) {
+ super(parent, "Generate Review Participation Report");
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell());
+ int result = ld.open();
+ if (result == 0) {
+ if (ld.getResult().length == 0) {
+ AWorkbench.popup("ERROR", "Must select user");
+ return;
+ }
+ User selectedUser = ld.getSelection();
+ ParticipationReportJob job =
+ new ParticipationReportJob("Review Participation Report - " + selectedUser, selectedUser);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ }
+
+ private class ParticipationReportJob extends Job {
+
+ private final User user;
+
+ public ParticipationReportJob(String title, User user) {
+ super(title);
+ this.user = user;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ MyReviewWorkflowItem srch = new MyReviewWorkflowItem("", user, ReviewState.All);
+ Collection<Artifact> reviewArts = srch.performSearchGetResults();
+ MassArtifactEditorInput input =
+ new MassArtifactEditorInput(getName() + " as of " + XDate.getDateNow(), reviewArts,
+ new ReviewParticipationXViewerFactory(user));
+ MassArtifactEditor.editArtifacts(input);
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ public class ReviewParticipationXViewerFactory extends SkynetXViewerFactory {
+
+ public ReviewParticipationXViewerFactory(User user) {
+ super(MASS_XVIEWER_CUSTOMIZE_NAMESPACE);
+ registerColumn(new XViewerArtifactTypeColumn("Type"));
+ registerColumn(new XViewerHridColumn("ID"));
+ registerColumn(WorldXViewerFactory.Legacy_PCR_Col);
+ registerColumn(new XViewerSmaStateColumn());
+ registerColumn(new XViewerSmaCompletedDateColumn("Completed"));
+ registerColumn(new XViewerReviewRoleColumn(user));
+ registerColumn(WorldXViewerFactory.Related_To_State_Col);
+ registerColumn(new XViewerArtifactNameColumn("Name"));
+ registerColumn(new XViewerGuidColumn("Guid"));
+ registerAllAttributeColumns();
+ }
+
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java
new file mode 100644
index 00000000000..9381aa727f4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.VersionReportJob;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamVersionListDialog;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class GenerateVersionReportItem extends XNavigateItemAction {
+
+ public GenerateVersionReportItem(XNavigateItem parent) {
+ super(parent, "Generate Version Report");
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ TeamVersionListDialog ld = new TeamVersionListDialog(Active.Both);
+ int result = ld.open();
+ if (result == 0) {
+ VersionArtifact verArt = ld.getSelectedVersion();
+ String title =
+ ld.getSelectedTeamDef().getDescriptiveName() + " Version \"" + verArt.getDescriptiveName() + "\" Report";
+ VersionReportJob job = new VersionReportJob(title, verArt);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java
new file mode 100644
index 00000000000..67d6d70bf8b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.List;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsNavigateItem {
+
+ public List<XNavigateItem> getNavigateItems() throws OseeCoreException;
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java
new file mode 100644
index 00000000000..25982ce6cb4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.util.Import.ActionImportWizard;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ImportActionsViaSpreadsheet extends XNavigateItemAction {
+
+ public static String strs[] = new String[] {};
+
+ /**
+ * @param parent
+ */
+ public ImportActionsViaSpreadsheet(XNavigateItem parent) {
+ super(parent, "Import Actions Via Spreadsheet");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ ActionImportWizard actionWizard = new ActionImportWizard();
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), actionWizard);
+ dialog.create();
+ dialog.open();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java
new file mode 100644
index 00000000000..bbe954782ca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MassEditTeamVersionItem extends XNavigateItemAction {
+
+ private final String teamDefName;
+ private final TeamDefinitionArtifact teamDef;
+ private TeamDefinitionArtifact selectedTeamDef;
+
+ public MassEditTeamVersionItem(XNavigateItem parent, String teamDefName) {
+ this("Show Team Versions", parent, teamDefName);
+ }
+
+ public MassEditTeamVersionItem(String name, XNavigateItem parent, String teamDefName) {
+ super(parent, name);
+ this.teamDefName = teamDefName;
+ this.teamDef = null;
+ }
+
+ public MassEditTeamVersionItem(XNavigateItem parent, TeamDefinitionArtifact teamDef) {
+ this("Show Team Versions", parent, teamDef);
+ }
+
+ /**
+ * @param name
+ * @param parent
+ * @param teamDef Team Definition Artifact that is related to versions or null for popup selection
+ */
+ public MassEditTeamVersionItem(String name, XNavigateItem parent, TeamDefinitionArtifact teamDef) {
+ super(parent, name);
+ this.teamDef = teamDef;
+ this.teamDefName = null;
+ }
+
+ private TeamDefinitionArtifact getTeamDefinition() throws OseeCoreException {
+ if (selectedTeamDef != null) return selectedTeamDef;
+ if (teamDef != null) return teamDef;
+ if (teamDefName != null && !teamDefName.equals("")) {
+ try {
+ TeamDefinitionArtifact teamDef = AtsCache.getSoleArtifactByName(teamDefName, TeamDefinitionArtifact.class);
+ if (teamDef != null) return teamDef;
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing, going to get team below
+ }
+ }
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ try {
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Active));
+ } catch (MultipleAttributesExist ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ int result = ld.open();
+ if (result == 0) {
+ return (TeamDefinitionArtifact) ld.getResult()[0];
+ }
+ return null;
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ try {
+ TeamDefinitionArtifact teamDef = getTeamDefinition();
+ if (teamDef == null) return;
+ if (teamDef.getTeamDefinitionHoldingVersions() == null) {
+ AWorkbench.popup("ERROR", "Team is not configured to use versions.");
+ return;
+ }
+ MassArtifactEditor.editArtifacts(getName(), teamDef.getTeamDefinitionHoldingVersions().getVersionsArtifacts());
+ selectedTeamDef = null;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * @param selectedTeamDef the selectedTeamDef to set
+ */
+ public void setSelectedTeamDef(TeamDefinitionArtifact selectedTeamDef) {
+ this.selectedTeamDef = selectedTeamDef;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
new file mode 100644
index 00000000000..940c12625d8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewAction;
+import org.eclipse.osee.ats.config.BulkLoadAtsCache;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.ats.world.search.MyWorldSearchItem;
+import org.eclipse.osee.framework.core.client.ClientSessionManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * Insert the type's description here.
+ *
+ * @see ViewPart
+ * @author Donald G. Dunne
+ */
+public class NavigateView extends ViewPart implements IActionable {
+
+ public static final String VIEW_ID = "org.eclipse.osee.ats.navigate.NavigateView";
+ public static final String HELP_CONTEXT_ID = "atsNavigator";
+ private AtsNavigateComposite xNavComp;
+
+ /**
+ * The constructor.
+ */
+ public NavigateView() {
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+ /*
+ * @see IWorkbenchPart#createPartControl(Composite)
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ BulkLoadAtsCache.run(false);
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(parent)) return;
+
+ OseeContributionItem.addTo(this, false);
+
+ xNavComp = new AtsNavigateComposite(new AtsNavigateViewItems(), parent, SWT.NONE);
+
+ AtsPlugin.getInstance().setHelp(xNavComp, HELP_CONTEXT_ID);
+ createActions();
+ if (savedFilterStr != null) {
+ xNavComp.getFilteredTree().getFilterControl().setText(savedFilterStr);
+ }
+ xNavComp.refresh();
+ xNavComp.getFilteredTree().getFilterControl().setFocus();
+
+ Label label = new Label(xNavComp, SWT.None);
+ String str = getWhoAmI();
+ if (AtsPlugin.isAtsAdmin()) str += " - Admin";
+ if (!str.equals("")) {
+ if (AtsPlugin.isAtsAdmin()) {
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ } else {
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
+ }
+ }
+ label.setText(str);
+ label.setToolTipText(str);
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_CENTER);
+ gridData.heightHint = 15;
+ label.setLayoutData(gridData);
+ }
+
+ private String getWhoAmI() {
+ try {
+ String userName = UserManager.getUser().getName();
+ return String.format("%s - %s:%s", userName, ClientSessionManager.getDataStoreName(),
+ ClientSessionManager.getDataStoreLoginName());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ protected void createActions() {
+ Action myWorldAction = new Action("My World") {
+
+ @Override
+ public void run() {
+ try {
+ xNavComp.handleDoubleClick(new SearchNavigateItem(null, new MyWorldSearchItem("My World",
+ UserManager.getUser())), TableLoadOption.None);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ myWorldAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("MyWorld.gif"));
+ myWorldAction.setToolTipText("My World");
+
+ Action collapseAction = new Action("Collapse All") {
+
+ @Override
+ public void run() {
+ xNavComp.refresh();
+ }
+ };
+ collapseAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("collapseAll.gif"));
+ collapseAction.setToolTipText("Collapse All");
+
+ Action expandAction = new Action("Expand All") {
+
+ @Override
+ public void run() {
+ xNavComp.getFilteredTree().getViewer().expandAll();
+ }
+ };
+ expandAction.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("expandAll.gif"));
+ expandAction.setToolTipText("Expand All");
+
+ Action openByIdAction = new Action("Open by Id") {
+
+ @Override
+ public void run() {
+ try {
+ xNavComp.handleDoubleClick(new SearchNavigateItem(null, new MultipleHridSearchItem()),
+ TableLoadOption.None);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ openByIdAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("openId.gif"));
+ openByIdAction.setToolTipText("Open by Id");
+
+ Action openChangeReportById = new Action("Open Change Report by Id") {
+
+ @Override
+ public void run() {
+ try {
+ xNavComp.handleDoubleClick(new OpenChangeReportByIdItem(null), TableLoadOption.None);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ openChangeReportById.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("branch_change.gif"));
+ openChangeReportById.setToolTipText("Open Change Report by Id");
+
+ IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+ toolbarManager.add(myWorldAction);
+ toolbarManager.add(collapseAction);
+ toolbarManager.add(expandAction);
+ toolbarManager.add(openChangeReportById);
+ toolbarManager.add(openByIdAction);
+ toolbarManager.add(new NewAction());
+
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "ATS Navigator");
+
+ }
+
+ /**
+ * Provided for tests to be able to simulate a double-click
+ *
+ * @param item
+ */
+ public void handleDoubleClick(XNavigateItem item, TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ OseeLog.log(AtsPlugin.class, Level.INFO,
+ "===> Simulating NavigateView Double-Click for \"" + item.getName() + "\"...");
+ xNavComp.handleDoubleClick(item, tableLoadOptions);
+ }
+
+ public static NavigateView getNavigateView() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ return (NavigateView) page.showView(NavigateView.VIEW_ID);
+ } catch (PartInitException e1) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error",
+ "Couldn't Launch OSEE ATS NavigateView " + e1.getMessage());
+ }
+ return null;
+ }
+
+ public String getActionDescription() {
+ IStructuredSelection sel = (IStructuredSelection) xNavComp.getFilteredTree().getViewer().getSelection();
+ if (sel.iterator().hasNext()) return String.format("Currently Selected - %s",
+ ((XNavigateItem) sel.iterator().next()).getName());
+ return "";
+ }
+
+ private static final String INPUT = "filter";
+ private static final String FILTER_STR = "filterStr";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.ViewPart#saveState(org.eclipse.ui.IMemento)
+ */
+ @Override
+ public void saveState(IMemento memento) {
+ super.saveState(memento);
+ memento = memento.createChild(INPUT);
+
+ if (xNavComp != null && xNavComp.getFilteredTree().getFilterControl() != null && !xNavComp.getFilteredTree().isDisposed()) {
+ String filterStr = xNavComp.getFilteredTree().getFilterControl().getText();
+ memento.putString(FILTER_STR, filterStr);
+ }
+ }
+ private String savedFilterStr = null;
+
+ @Override
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ super.init(site, memento);
+ try {
+ if (memento != null) {
+ memento = memento.getChild(INPUT);
+ if (memento != null) {
+ savedFilterStr = memento.getString(FILTER_STR);
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.WARNING, "NavigateView error on init", ex);
+ }
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java
new file mode 100644
index 00000000000..979a31d7391
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Date;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+import org.eclipse.osee.ats.util.widgets.dialog.ActionableItemListDialog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewPeerToPeerReviewItem extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public NewPeerToPeerReviewItem(XNavigateItem parent) {
+ super(parent, "New Stand-alone Peer To Peer Review");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+ final ActionableItemListDialog ld = new ActionableItemListDialog(Active.Both);
+ ld.setMessage("Select Actionable Items to Review\n\nNOTE: To create a review against " + "an Action and Team Workflow\nopen the object in ATS and select the " + "review to create from the editor.");
+ int result = ld.open();
+ if (result == 0) {
+ final EntryDialog ed = new EntryDialog("Peer Review Title", "Enter Peer Review Title");
+ if (ed.open() == 0) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ PeerToPeerReviewArtifact peerArt =
+ ReviewManager.createNewPeerToPeerReview(null, ed.getEntry(), null, UserManager.getUser(),
+ new Date(), transaction);
+ peerArt.getActionableItemsDam().setActionableItems(ld.getSelected());
+ peerArt.persistAttributesAndRelations(transaction);
+ AtsLib.openAtsAction(peerArt, AtsOpenOption.OpenAll);
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/OpenChangeReportByIdItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/OpenChangeReportByIdItem.java
new file mode 100644
index 00000000000..4fdc1471131
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/OpenChangeReportByIdItem.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenChangeReportByIdItem extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ * @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
+ */
+ public OpenChangeReportByIdItem(XNavigateItem parent) {
+ super(parent, "Open Change Report by ID");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ try {
+ final MultipleHridSearchItem srch = new MultipleHridSearchItem();
+ srch.performUI(SearchType.Search);
+ if (srch.isCancelled()) return;
+ String name = "Open Change Report by ID: \"" + srch.getEnteredIds() + "\"";
+ Job openJob = new Job(name) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ Collection<Artifact> artifacts = srch.performSearchGetResults(false);
+ final Set<Artifact> addedArts = new HashSet<Artifact>();
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof ActionArtifact) {
+ for (TeamWorkFlowArtifact team : ((ActionArtifact) artifact).getTeamWorkFlowArtifacts()) {
+ if (team.getSmaMgr().getBranchMgr().isCommittedBranch() || team.getSmaMgr().getBranchMgr().isWorkingBranch()) {
+ addedArts.add(team);
+ }
+ }
+ }
+ }
+ if (addedArts.size() > 0) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (addedArts.size() < 3 || MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),
+ "Open Change Reports",
+ "Opening " + addedArts.size() + " Change Reports?\n\n(may want to run this off-hours)")) {
+ for (Artifact art : addedArts) {
+ ((StateMachineArtifact) art).getSmaMgr().getBranchMgr().showChangeReport();
+ }
+ }
+ }
+ });
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(openJob);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java
new file mode 100644
index 00000000000..f24e3e3881d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.VersionReportJob;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class PublishFullVersionReportItem extends XNavigateItemAction {
+
+ private final TeamDefinitionArtifact teamDef;
+ private String publishToFilename;
+ private final String teamDefName;
+
+ public PublishFullVersionReportItem(XNavigateItem parent, String name, TeamDefinitionArtifact teamDef, String publishToFilename) {
+ super(parent, name);
+ this.teamDef = teamDef;
+ this.teamDefName = null;
+ this.publishToFilename = publishToFilename;
+ }
+
+ public PublishFullVersionReportItem(XNavigateItem parent, String name, String teamDefName, String publishToFilename) {
+ super(parent, name);
+ this.teamDefName = teamDefName;
+ this.teamDef = null;
+ this.publishToFilename = publishToFilename;
+ }
+
+ public PublishFullVersionReportItem(XNavigateItem parent) {
+ this(parent, "Publish Full Version Report", (String) null, null);
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ String usePublishToFilename = publishToFilename;
+ if (usePublishToFilename == null) {
+ final FileDialog dialog = new FileDialog(Display.getCurrent().getActiveShell().getShell(), SWT.SAVE);
+ dialog.setFilterExtensions(new String[] {"*.html"});
+ usePublishToFilename = dialog.open();
+ if (usePublishToFilename == null) return;
+ }
+ TeamDefinitionArtifact useTeamDef = teamDef;
+ if (useTeamDef == null && teamDefName != null) {
+ try {
+ useTeamDef = AtsCache.getSoleArtifactByName(teamDefName, TeamDefinitionArtifact.class);
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing, going to get team below
+ }
+ }
+ if (useTeamDef == null) {
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ ld.setInput(TeamDefinitionArtifact.getTeamDefinitions(Active.Both));
+ int result = ld.open();
+ if (result == 0) {
+ useTeamDef = (TeamDefinitionArtifact) ld.getResult()[0];
+ } else
+ return;
+ } else if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+
+ String title = useTeamDef.getDescriptiveName() + " Version Report";
+ PublishReportJob job = new PublishReportJob(title, teamDef, usePublishToFilename);
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+
+ private class PublishReportJob extends Job {
+
+ private final TeamDefinitionArtifact teamDef;
+ private final String filename;
+
+ public PublishReportJob(String title, TeamDefinitionArtifact teamDef, String filename) {
+ super(title);
+ this.teamDef = teamDef;
+ this.filename = filename;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.ReleaseReportJob#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ String html = VersionReportJob.getFullReleaseReport(teamDef, monitor);
+ AFile.writeFile(filename, html);
+ Program.launch(filename);
+ AWorkbench.popup("Publish Complete", "Data Published To \"" + filename + "\"");
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java
new file mode 100644
index 00000000000..5edbe2a3fca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Date;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.ats.util.widgets.dialog.VersionListDialog;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ReleaseVersionItem extends XNavigateItemAction {
+
+ public static String strs[] = new String[] {};
+ private final TeamDefinitionArtifact teamDefHoldingVersions;
+
+ /**
+ * @param parent
+ * @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
+ */
+ public ReleaseVersionItem(XNavigateItem parent, TeamDefinitionArtifact teamDefHoldingVersions) {
+ super(parent, "Release " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + "Version");
+ this.teamDefHoldingVersions = teamDefHoldingVersions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ TeamDefinitionArtifact teamDefHoldingVersions = getReleaseableTeamDefinitionArtifact();
+ if (teamDefHoldingVersions == null) return;
+ try {
+ VersionListDialog ld =
+ new VersionListDialog("Select Version", "Select Version to Release",
+ teamDefHoldingVersions.getVersionsArtifacts());
+ int result = ld.open();
+ if (result == 0) {
+ VersionArtifact verArt = (VersionArtifact) ld.getResult()[0];
+
+ // Validate team lead status
+ if (!AtsPlugin.isAtsAdmin() && !verArt.getParentTeamDefinition().getLeads().contains(
+ UserManager.getUser())) {
+ AWorkbench.popup("ERROR", "Only lead can release version.");
+ return;
+ }
+ // Validate that all Team Workflows are Completed or Cancelled
+ String errorStr = null;
+ for (TeamWorkFlowArtifact team : verArt.getTargetedForTeamArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (!smaMgr.isCancelled() && !smaMgr.isCompleted()) {
+ errorStr =
+ "All Team Workflows must be either Completed or " + "Cancelled before releasing a version.\n\n" + team.getHumanReadableId() + " - is in the\"" + team.getSmaMgr().getStateMgr().getCurrentStateName() + "\" state.";
+ }
+ }
+ if (errorStr != null) AWorkbench.popup("ERROR", errorStr);
+ if (errorStr != null && !AtsPlugin.isAtsAdmin())
+ return;
+ else if (errorStr != null && !MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Override",
+ "ATS Admin Enabled - Override completed condition and release anyway?")) {
+ return;
+ }
+
+ verArt.setSoleAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), true);
+ verArt.setSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), new Date());
+ verArt.setNextVersion(false);
+ verArt.persistAttributes();
+
+ if (MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Select NEW Next Release Version",
+ "Release Complete.\n\nSelect NEW Next Release Version?")) {
+ ld =
+ new VersionListDialog("Select Next Release Version", "Select New Next Release Version",
+ teamDefHoldingVersions.getVersionsArtifacts());
+ result = ld.open();
+ if (result == 0) {
+ verArt = (VersionArtifact) ld.getResult()[0];
+ verArt.setNextVersion(true);
+ verArt.persistAttributes();
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error releasing version", ex, true);
+ }
+ }
+
+ public TeamDefinitionArtifact getReleaseableTeamDefinitionArtifact() throws OseeCoreException {
+ if (teamDefHoldingVersions != null) return teamDefHoldingVersions;
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ try {
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Active));
+ } catch (MultipleAttributesExist ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ int result = ld.open();
+ if (result == 0) {
+ return (TeamDefinitionArtifact) ld.getResult()[0];
+ }
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java
new file mode 100644
index 00000000000..00dccfb0178
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SearchNavigateItem extends XNavigateItem {
+
+ private final WorldSearchItem wsi;
+
+ /**
+ * @param parent
+ * @param wsi
+ * @throws OseeCoreException
+ */
+ public SearchNavigateItem(XNavigateItem parent, WorldSearchItem wsi) throws OseeCoreException {
+ super(parent, wsi.getName());
+ this.wsi = wsi;
+ }
+
+ public WorldSearchItem getWorldSearchItem() {
+ return wsi;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/TeamWorkflowSearchWorkflowSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/TeamWorkflowSearchWorkflowSearchItem.java
new file mode 100644
index 00000000000..add14637155
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/TeamWorkflowSearchWorkflowSearchItem.java
@@ -0,0 +1,278 @@
+/*
+ * Created on Nov 17, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.navigate;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.util.widgets.XHyperlabelTeamDefinitionSelection;
+import org.eclipse.osee.ats.world.WorldEditorParameterSearchItem;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem.ReleasedOption;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XMembersCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowSearchWorkflowSearchItem extends WorldEditorParameterSearchItem {
+
+ private XHyperlabelTeamDefinitionSelection teamCombo = null;
+ private XCombo releasedCombo = null;
+ private XCombo versionCombo = null;
+ private XMembersCombo assigneeCombo;
+ private XCheckBox includeCompletedCancelledCheckbox;
+
+ public TeamWorkflowSearchWorkflowSearchItem() {
+ super("Team Workflow Search");
+ }
+
+ public TeamWorkflowSearchWorkflowSearchItem(TeamWorkflowSearchWorkflowSearchItem editTeamWorkflowSearchItem) {
+ super(editTeamWorkflowSearchItem);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldSearchItem#copy()
+ */
+ @Override
+ public TeamWorkflowSearchWorkflowSearchItem copy() {
+ return new TeamWorkflowSearchWorkflowSearchItem(this);
+ }
+
+ public TeamWorkflowSearchWorkflowSearchItem copyProvider() {
+ return new TeamWorkflowSearchWorkflowSearchItem(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getParameterXWidgetXml()
+ */
+ @Override
+ public String getParameterXWidgetXml() throws OseeCoreException {
+ return "<xWidgets>" +
+ //
+ "<XWidget xwidgetType=\"XHyperlabelTeamDefinitionSelection\" displayName=\"Team Definitions(s)\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XCombo()\" beginComposite=\"8\" displayName=\"Version\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XCombo(Both,Released,UnReleased)\" displayName=\"Released\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XMembersCombo\" displayName=\"Assignee\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"Include Completed/Cancelled\" defaultValue=\"false\" labelAfter=\"true\" horizontalLabel=\"true\"/>" +
+ //
+ "</xWidgets>";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#performSearchGetResults(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public Collection<? extends Artifact> performSearchGetResults(SearchType searchType) throws OseeCoreException {
+ return new TeamWorldSearchItem("", getSelectedTeamDefinitions(), isIncludeCompletedCancelledCheckbox(), false,
+ false, getSelectedVersionArtifact(), getSelectedUser(), getSelectedReleased()).performSearchGetResults(false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getWorldEditorLabel(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ if (teamDefs.size() > 0) {
+ sb.append(" - Teams: " + org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", teamDefs));
+ }
+ if (getSelectedVersionArtifact() != null) {
+ sb.append(" - Version: " + getSelectedVersionArtifact());
+ }
+ ReleasedOption releaseOption = getSelectedReleased();
+ if (releaseOption != null && releaseOption != ReleasedOption.Both) {
+ sb.append(" - ReleasedOption: " + releaseOption);
+ }
+ if (getSelectedUser() != null) {
+ sb.append(" - Assignee: " + getSelectedUser());
+ }
+ if (isIncludeCompletedCancelledCheckbox()) {
+ sb.append(" - Include Completed/Cancelled");
+ }
+ return "Team Workflows" + sb.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#widgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreated(XWidget widget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ if (widget.getLabel().equals("Assignee")) {
+ assigneeCombo = (XMembersCombo) widget;
+ }
+ if (widget.getLabel().equals("Include Completed/Cancelled")) {
+ includeCompletedCancelledCheckbox = (XCheckBox) widget;
+ }
+ if (widget.getLabel().equals("Version")) {
+ versionCombo = (XCombo) widget;
+ versionCombo.getComboBox().setVisibleItemCount(25);
+ widget.getLabelWidget().setToolTipText("Select Team to populate Version list");
+ }
+ if (widget.getLabel().equals("Released")) {
+ releasedCombo = (XCombo) widget;
+ }
+ if (widget.getLabel().equals("Team Definitions(s)")) {
+ teamCombo = (XHyperlabelTeamDefinitionSelection) widget;
+ teamCombo.addXModifiedListener(new XModifiedListener() {
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (versionCombo != null) {
+ try {
+ Collection<TeamDefinitionArtifact> teamDefArts = getSelectedTeamDefinitions();
+ if (teamDefArts.size() == 0) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ TeamDefinitionArtifact teamDefHoldingVersions =
+ teamDefArts.iterator().next().getTeamDefinitionHoldingVersions();
+ if (teamDefHoldingVersions == null) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ Collection<String> names =
+ Artifacts.artNames(teamDefHoldingVersions.getVersionsArtifacts(VersionReleaseType.Both));
+ if (names.size() == 0) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ versionCombo.setDataStrings(names.toArray(new String[names.size()]));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ private User getSelectedUser() {
+ if (assigneeCombo == null) return null;
+ return assigneeCombo.getUser();
+ }
+
+ private boolean isIncludeCompletedCancelledCheckbox() {
+ if (includeCompletedCancelledCheckbox == null) return false;
+ return includeCompletedCancelledCheckbox.isSelected();
+ }
+
+ private VersionArtifact getSelectedVersionArtifact() throws OseeCoreException {
+ if (versionCombo == null) return null;
+ String versionStr = versionCombo.get();
+ if (versionStr == null || versionStr.equals("")) return null;
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ if (teamDefs.size() > 0) {
+ TeamDefinitionArtifact teamDefHoldingVersions = teamDefs.iterator().next().getTeamDefinitionHoldingVersions();
+ if (teamDefHoldingVersions == null) return null;
+ for (VersionArtifact versionArtifact : teamDefHoldingVersions.getVersionsArtifacts(VersionReleaseType.Both)) {
+ if (versionArtifact.getDescriptiveName().equals(versionStr)) {
+ return versionArtifact;
+ }
+ }
+ }
+ return null;
+ }
+
+ private Collection<TeamDefinitionArtifact> getSelectedTeamDefinitions() throws OseeCoreException {
+ if (teamCombo == null) return java.util.Collections.emptyList();
+ return teamCombo.getSelectedTeamDefintions();
+ }
+
+ private ReleasedOption getSelectedReleased() throws OseeCoreException {
+ if (releasedCombo == null || releasedCombo.get() == null || releasedCombo.get().equals("")) {
+ return ReleasedOption.Both;
+ }
+ return ReleasedOption.valueOf(releasedCombo.get());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener#createXWidgetLayoutData(org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData, org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void createXWidgetLayoutData(DynamicXWidgetLayoutData layoutData, XWidget widget, FormToolkit toolkit, Artifact art, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener#widgetCreating(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreating(XWidget widget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.WorldParameterSearchItem#isParameterSelectionValid()
+ */
+ @Override
+ public Result isParameterSelectionValid() throws OseeCoreException {
+ try {
+ boolean selected = false;
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ if (teamDefs.size() > 0) {
+ selected = true;
+ }
+ VersionArtifact verArt = getSelectedVersionArtifact();
+ if (verArt != null) {
+ selected = true;
+ }
+ User user = getSelectedUser();
+ if (user != null) {
+ selected = true;
+ }
+ boolean includeCompleted = isIncludeCompletedCancelledCheckbox();
+ if (!selected) {
+ return new Result("You must select at least Team, Version or Assignee.");
+ }
+ if (user != null && includeCompleted) {
+ return new Result("Assignee and Include Completed are not compatible selections.");
+ }
+ if (user != null && includeCompleted && verArt == null && teamDefs.size() == 0) {
+ return new Result("You must select at least Team or Version with Include Completed.");
+ }
+ return Result.TrueResult;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Result("Exception: " + ex.getLocalizedMessage());
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getDynamicWidgetLayoutListener()
+ */
+ @Override
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getTargetedVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getTargetedVersionArtifact() throws OseeCoreException {
+ if (versionCombo == null) return null;
+ return getSelectedVersionArtifact();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAssigneesRelations.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAssigneesRelations.java
new file mode 100644
index 00000000000..7fe3237a815
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAssigneesRelations.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UpdateAssigneesRelations extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public UpdateAssigneesRelations(XNavigateItem parent) {
+ super(parent, "Update Assignees Relations");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+
+ final List<String> teamWorkflowNames =
+ Arrays.asList(TeamWorkFlowArtifact.ARTIFACT_NAME, TaskArtifact.ARTIFACT_NAME,
+ DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME);
+ teamWorkflowNames.addAll(TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames());
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+
+ for (String artTypeName : teamWorkflowNames) {
+ System.out.println("Processing artifact type - " + artTypeName);
+ for (Artifact art : ArtifactQuery.getArtifactsFromType(artTypeName, AtsPlugin.getAtsBranch())) {
+ if (art instanceof StateMachineArtifact) {
+ ((StateMachineArtifact) art).updateAssigneeRelations();
+ if (art.isDirty()) {
+ System.out.println("Updated assignee relations for " + art.getHumanReadableId() + " - " + art);
+ }
+ art.persistRelations(transaction);
+ }
+ }
+ }
+ transaction.execute();
+
+ AWorkbench.popup("Completed", "Complete");
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAtsWorkItemDefinitions.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAtsWorkItemDefinitions.java
new file mode 100644
index 00000000000..437d20ddcf6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/UpdateAtsWorkItemDefinitions.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.config.AtsDatabaseConfig;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UpdateAtsWorkItemDefinitions extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public UpdateAtsWorkItemDefinitions(XNavigateItem parent) {
+ super(parent, "Update Ats WorkItemDefinitions");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(),
+ "This could break lots of things, are you SURE?")) return;
+
+ XResultData xResultData = new XResultData();
+ AtsDatabaseConfig.configWorkItemDefinitions(WriteType.Update, xResultData);
+ if (xResultData.isEmpty()) {
+ xResultData.log("Nothing updated");
+ }
+ xResultData.report(getName());
+
+ AWorkbench.popup("Completed", getName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
new file mode 100644
index 00000000000..396bafb5560
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.navigate;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VisitedItems extends XNavigateItemAction {
+
+ public static List<Artifact> visited = new ArrayList<Artifact>();
+
+ public static List<Artifact> getReverseVisited() {
+ List<Artifact> revArts = new ArrayList<Artifact>();
+ for (int x = visited.size(); x <= 0; x--) {
+ revArts.add(visited.get(x));
+ }
+ return revArts;
+ }
+
+ public static void addVisited(Artifact art) {
+ if (!visited.contains(art)) visited.add(art);
+ }
+
+ /**
+ * @param parent
+ */
+ public VisitedItems(XNavigateItem parent) {
+ super(parent, "My Recently Visited");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ WorldEditor.open(new WorldEditorSimpleProvider(getName(), visited, null, tableLoadOptions));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToTransaction.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToTransaction.java
new file mode 100644
index 00000000000..3b07380b98e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToTransaction.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.operation;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.db.connection.ConnectionHandler;
+import org.eclipse.osee.framework.db.connection.ConnectionHandlerStatement;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ConnectWorkflowToTransaction extends AbstractBlam {
+ private static final String SELECT_COMMIT_TRANSACTIONS =
+ "SELECT * FROM osee_tx_details where osee_comment like ? and commit_art_id is null";
+ private static final Pattern hridPattern = Pattern.compile("Commit Branch ([A-Z0-9]{5})[ _]");
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch)
+ */
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws OseeCoreException {
+ monitor.subTask("Aquiring Team Workflows");
+
+ ConnectionHandlerStatement chStmt = new ConnectionHandlerStatement();
+ try {
+ chStmt.runPreparedQuery(200, SELECT_COMMIT_TRANSACTIONS, "Commit Branch%");
+ while (chStmt.next()) {
+ if (monitor.isCanceled()) return;
+ updateWorkflow(chStmt.getString("osee_comment"), chStmt.getInt("transaction_id"));
+ }
+ } finally {
+ chStmt.close();
+ }
+ }
+
+ private void updateWorkflow(String commitComment, int transactionId) throws OseeCoreException {
+ Branch atsBranch = BranchManager.getCommonBranch();
+ Matcher hridMatcher = hridPattern.matcher(commitComment);
+
+ if (hridMatcher.find()) {
+ String hrid = hridMatcher.group(1);
+
+ int artId = ArtifactQuery.getArtifactFromId(hrid, atsBranch).getArtId();
+ ConnectionHandler.runPreparedUpdate("UPDATE osee_tx_details SET commit_art_id = ? where transaction_id = ?",
+ artId, transactionId);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ public String getXWidgetsXml() {
+ return emptyXWidgetsXml;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
new file mode 100644
index 00000000000..534ef5bf81a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSimpleList.java
@@ -0,0 +1,168 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.operation;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TaskableStateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ImportTasksFromSimpleList extends AbstractBlam {
+
+ public static String ASSIGNEES = "Assignees";
+ public static String TASK_IMPORT_TITLES = "Task Import Titles";
+ public static String TEAM_WORKFLOW = "Team Workflow (drop here)";
+ private TaskableStateMachineArtifact taskableStateMachineArtifact;
+
+ public ImportTasksFromSimpleList() throws IOException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ try {
+ List<Artifact> artifacts = variableMap.getArtifacts(TEAM_WORKFLOW);
+ final List<Artifact> assignees = variableMap.getArtifacts(ASSIGNEES);
+ final List<String> titles = new ArrayList<String>();
+ for (String title : variableMap.getString(TASK_IMPORT_TITLES).split("\n")) {
+ title = title.replaceAll("\r", "");
+ if (!title.equals("")) titles.add(title);
+ }
+
+ if (artifacts.size() == 0) {
+ AWorkbench.popup("ERROR", "Must drag in Team Workflow to add tasks.");
+ return;
+ }
+ if (artifacts.size() > 1) {
+ AWorkbench.popup("ERROR", "Only drag ONE Team Workflow.");
+ return;
+ }
+ Artifact artifact = artifacts.iterator().next();
+ if (!(artifact instanceof TeamWorkFlowArtifact)) {
+ AWorkbench.popup("ERROR", "Artifact MUST be Team Workflow");
+ return;
+ }
+ if (titles == null || titles.size() == 0) {
+ AWorkbench.popup("ERROR", "Must enter title(s).");
+ return;
+ }
+ try {
+ final TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ handleCreateTasks(assignees, titles, teamArt, transaction);
+ teamArt.persistAttributesAndRelations(transaction);
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return;
+ }
+
+ SMAEditor.editArtifact(artifact);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ };
+ });
+ }
+
+ private void handleCreateTasks(List<Artifact> assignees, List<String> titles, TeamWorkFlowArtifact teamArt, SkynetTransaction transaction) throws OseeCoreException {
+ for (String title : titles) {
+ TaskArtifact taskArt = teamArt.getSmaMgr().getTaskMgr().createNewTask(title, false);
+ if (assignees != null && assignees.size() > 0) {
+ Set<User> users = new HashSet<User>();
+ for (Artifact art : assignees) {
+ if (art instanceof User) {
+ users.add((User) art);
+ }
+ }
+ taskArt.getSmaMgr().getStateMgr().setAssignees(users);
+ }
+ taskArt.persistAttributesAndRelations(transaction);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#widgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, modListener, isEditable);
+ if (xWidget.getLabel().equals(TEAM_WORKFLOW) && taskableStateMachineArtifact != null) {
+ XListDropViewer viewer = (XListDropViewer) xWidget;
+ viewer.setInput(Arrays.asList(taskableStateMachineArtifact));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ @Override
+ public String getXWidgetsXml() {
+ StringBuffer buffer = new StringBuffer("<xWidgets>");
+ buffer.append("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"" + TEAM_WORKFLOW + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XText\" fill=\"Vertically\" displayName=\"" + TASK_IMPORT_TITLES + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XMembersList\" displayName=\"" + ASSIGNEES + "\" />");
+ buffer.append("</xWidgets>");
+ return buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#getDescriptionUsage()
+ */
+ @Override
+ public String getDescriptionUsage() {
+ return "Import tasks from spreadsheet into given Team Workflow";
+ }
+
+ /**
+ * @return the TaskableStateMachineArtifact
+ */
+ public TaskableStateMachineArtifact getTaskableStateMachineArtifact() {
+ return taskableStateMachineArtifact;
+ }
+
+ /**
+ * @param defaultTeamWorkflowArtifact the defaultTeamWorkflowArtifact to set
+ */
+ public void setTaskableStateMachineArtifact(TaskableStateMachineArtifact taskableStateMachineArtifact) {
+ this.taskableStateMachineArtifact = taskableStateMachineArtifact;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
new file mode 100644
index 00000000000..0661f8198ab
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ImportTasksFromSpreadsheet.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.operation;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TaskableStateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.util.Import.ExcelAtsTaskArtifactExtractor;
+import org.eclipse.osee.ats.util.Import.TaskImportJob;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ImportTasksFromSpreadsheet extends AbstractBlam {
+
+ public static String TASK_IMPORT_SPREADSHEET = "Task Import Spreadsheet";
+ public static String TEAM_WORKFLOW = "Taskable Workflow (drop here)";
+ public static String PERSIST = "Persist";
+ public static String EMAIL_POCS = "Email POCs (if persist)";
+ private TaskableStateMachineArtifact taskableStateMachineArtifact;
+
+ public ImportTasksFromSpreadsheet() throws IOException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#widgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, modListener, isEditable);
+ if (xWidget.getLabel().equals(TEAM_WORKFLOW) && taskableStateMachineArtifact != null) {
+ XListDropViewer viewer = (XListDropViewer) xWidget;
+ viewer.setInput(Arrays.asList(taskableStateMachineArtifact));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ public String getXWidgetsXml() {
+ StringBuffer buffer = new StringBuffer("<xWidgets>");
+ buffer.append("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"" + TEAM_WORKFLOW + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XFileSelectionDialog\" displayName=\"" + TASK_IMPORT_SPREADSHEET + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + PERSIST + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+ buffer.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + EMAIL_POCS + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+ buffer.append("</xWidgets>");
+ return buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#getDescriptionUsage()
+ */
+ @Override
+ public String getDescriptionUsage() {
+ return "Import tasks from spreadsheet into given Team Workflow";
+ }
+
+ /**
+ * @return the TaskableStateMachineArtifact
+ */
+ public TaskableStateMachineArtifact getTaskableStateMachineArtifact() {
+ return taskableStateMachineArtifact;
+ }
+
+ /**
+ * @param taskableStateMachineArtifact the TaskableStateMachineArtifact to set
+ */
+ public void setTaskableStateMachineArtifact(TaskableStateMachineArtifact taskableStateMachineArtifact) {
+ this.taskableStateMachineArtifact = taskableStateMachineArtifact;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.core.runtime.IProgressMonitor, org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction)
+ */
+ @Override
+ public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ try {
+ List<Artifact> artifacts = variableMap.getArtifacts(TEAM_WORKFLOW);
+ String filename = variableMap.getString(TASK_IMPORT_SPREADSHEET);
+ boolean persist = variableMap.getBoolean(PERSIST);
+ boolean emailPocs = variableMap.getBoolean(EMAIL_POCS);
+
+ if (artifacts.size() == 0) {
+ AWorkbench.popup("ERROR", "Must drag in Team Workflow to add tasks.");
+ return;
+ }
+ if (artifacts.size() > 1) {
+ AWorkbench.popup("ERROR", "Only drag ONE Team Workflow.");
+ return;
+ }
+ Artifact artifact = artifacts.iterator().next();
+ if (!(artifact instanceof TeamWorkFlowArtifact)) {
+ AWorkbench.popup("ERROR", "Artifact MUST be Team Workflow");
+ return;
+ }
+ if (filename == null || filename.equals("")) {
+ AWorkbench.popup("ERROR", "Must enter valid filename.");
+ return;
+ }
+ File file = new File(filename);
+ try {
+ //this is odd, but this is passed into the TaskImportJob and the excel extractor, execute() is called after the extractor has been run
+ // SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ Jobs.startJob(new TaskImportJob(file, new ExcelAtsTaskArtifactExtractor(
+ (TeamWorkFlowArtifact) artifact, emailPocs, persist)));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return;
+ }
+
+ SMAEditor.editArtifact(artifact);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ };
+ });
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java
new file mode 100644
index 00000000000..b4936ff53b3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ReAssignATSObjectsToUser.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.operation;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactTypeAndDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactCheckTreeDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ReAssignATSObjectsToUser extends AbstractBlam {
+
+ public static String FROM_ASSIGNEE = "From Assignee";
+ public static String TO_ASSIGNEE = "To Assignee";
+
+ public ReAssignATSObjectsToUser() throws IOException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void runOperation(final VariableMap variableMap, IProgressMonitor monitor) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ try {
+ final User fromUser = variableMap.getUser(FROM_ASSIGNEE);
+ if (fromUser == null) {
+ AWorkbench.popup("ERROR", "Please select From Assignee");
+ return;
+ }
+
+ final User toUser = variableMap.getUser(TO_ASSIGNEE);
+ if (toUser == null) {
+ AWorkbench.popup("ERROR", "Please select To Assignee");
+ return;
+ }
+
+ // Get all things user is directly assigned to
+ Collection<Artifact> assignedToArts =
+ fromUser.getRelatedArtifacts(CoreRelationEnumeration.Users_Artifact, Artifact.class);
+ Set<Artifact> atsArts = new HashSet<Artifact>();
+ for (Artifact assignedArt : assignedToArts) {
+ if (assignedArt instanceof StateMachineArtifact) {
+ atsArts.add(assignedArt);
+ }
+ }
+ if (atsArts.size() == 0) {
+ AWorkbench.popup("ERROR", "Not workflows, tasks or reviews assigned to " + fromUser);
+ return;
+ }
+
+ // Show in list dialog and allow select for ones to change
+ ArtifactCheckTreeDialog dialog =
+ new ArtifactCheckTreeDialog(atsArts, new ArtifactTypeAndDescriptiveLabelProvider());
+ dialog.setTitle("ReAssign ATS Object to User");
+ dialog.setMessage("Select to re-assign to user \"" + toUser);
+ if (dialog.open() != 0) return;
+ final Collection<Artifact> artsToReAssign = dialog.getSelection();
+
+ // Make the changes and persist
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (Artifact artifact : artsToReAssign) {
+ if (artifact instanceof StateMachineArtifact) {
+ ((StateMachineArtifact) artifact).getSmaMgr().getStateMgr().removeAssignee(fromUser);
+ ((StateMachineArtifact) artifact).getSmaMgr().getStateMgr().addAssignee(toUser);
+ }
+ artifact.persistAttributesAndRelations(transaction);
+ }
+ transaction.execute();
+ OseeNotificationManager.sendNotifications();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ };
+ });
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ public String getXWidgetsXml() {
+ StringBuffer buffer = new StringBuffer("<xWidgets>");
+ buffer.append("<XWidget xwidgetType=\"XMembersCombo\" displayName=\"" + FROM_ASSIGNEE + "\" />");
+ buffer.append("<XWidget xwidgetType=\"XMembersCombo\" displayName=\"" + TO_ASSIGNEE + "\" />");
+ buffer.append("</xWidgets>");
+ return buffer.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#getDescriptionUsage()
+ */
+ @Override
+ public String getDescriptionUsage() {
+ return "Re-Assign ATS Workflows, Tasks and Reviews to another user. Enter to and from User and select play. You will be promted to select the ATS Objects to reassign.";
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java
new file mode 100644
index 00000000000..2b37c79d5f7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.operation;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+import java.util.Map.Entry;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact.TaskStates;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.util.widgets.XCurrentStateDam;
+import org.eclipse.osee.ats.util.widgets.XStateDam;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.CountingMap;
+import org.eclipse.osee.framework.jdk.core.type.MutableInteger;
+import org.eclipse.osee.framework.jdk.core.util.io.CharBackedInputStream;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelXmlWriter;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.ui.plugin.util.AIFile;
+import org.eclipse.osee.framework.ui.plugin.util.OseeData;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam;
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class TaskMetrics extends AbstractBlam {
+ private final CountingMap<User> metrics;
+ private final CharBackedInputStream charBak;
+ private final ISheetWriter excelWriter;
+
+ public TaskMetrics() throws IOException {
+ metrics = new CountingMap<User>();
+ charBak = new CharBackedInputStream();
+ excelWriter = new ExcelXmlWriter(charBak.getWriter());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#runOperation(org.eclipse.osee.framework.ui.skynet.blam.VariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws OseeCoreException {
+ try {
+ monitor.beginTask("TaskMetrics", 5);
+ metrics.clear();
+
+ ArtifactType descriptor = variableMap.getArtifactType("Artifact Type");
+
+ List<Artifact> artifacts =
+ ArtifactQuery.getArtifactsFromType(descriptor.getName(), AtsPlugin.getAtsBranch());
+ Set<Artifact> tasks = RelationManager.getRelatedArtifacts(artifacts, 1, AtsRelation.SmaToTask_Task);
+ for (Artifact artifact : tasks) {
+ if (artifact instanceof TaskArtifact) {
+ tallyState((TaskArtifact) artifact);
+ }
+ }
+
+ writeSummary();
+
+ excelWriter.endWorkbook();
+ IFile iFile = OseeData.getIFile("Task_Metrics.xml");
+ AIFile.writeToFile(iFile, charBak);
+ Program.launch(iFile.getLocation().toOSString());
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ private void tallyState(TaskArtifact task) throws OseeCoreException {
+ XStateDam stateDam = new XStateDam(task);
+
+ SMAState state = stateDam.getState(TaskStates.InWork.name(), false);
+ if (state == null) {
+ XCurrentStateDam currentStateDam = new XCurrentStateDam(task);
+ state = currentStateDam.getState(TaskStates.InWork.name(), false);
+ }
+
+ for (User user : state.getAssignees()) {
+ int percentComplete = state.getPercentComplete();
+
+ if (percentComplete == 100) {
+ String resolution = task.getSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), "");
+
+ if (resolution.equals("Complete")) {
+ metrics.put(user, 100);
+ } else {
+ metrics.put(user, 5);
+ }
+ } else {
+ metrics.put(user, percentComplete);
+ }
+ }
+ }
+
+ private void writeSummary() throws IOException {
+ excelWriter.startSheet("task metrics", 6);
+ excelWriter.writeRow("Engineer", "TaskMetric");
+
+ for (Entry<User, MutableInteger> entry : metrics.getCounts()) {
+ User user = entry.getKey();
+ MutableInteger metric = entry.getValue();
+ excelWriter.writeRow(user.getName(), metric.toString());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
+ */
+ @Override
+ public String getXWidgetsXml() {
+ return "<xWidgets><XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"Artifact Type\" keyedBranch=\"common\" defaultValue=\"Lba B3 Test Team Workflow\" /></xWidgets>";
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java
new file mode 100644
index 00000000000..09a2bc85d47
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java
@@ -0,0 +1,158 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.report;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.SelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionTeamDateListDialog extends SelectionDialog {
+
+ XListViewer teamDefList = new XListViewer("Team(s)");
+ XDate dateCombo = new XDate("Date");
+ XListViewer changeTypeList = new XListViewer("Include Change Types");
+ private static ArrayList<Object> selectedTeamDefs;
+ private static Date selectedDate;
+ private static ArrayList<Object> selectedChangeTypes;
+
+ public ActionTeamDateListDialog(Shell parent) {
+ super(parent);
+ setTitle("Select Teams and Date");
+ setMessage("Select Teams and Date");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Composite comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ teamDefList.setLabelProvider(new ArtifactDescriptiveLabelProvider());
+ teamDefList.setContentProvider(new ArrayContentProvider());
+ teamDefList.setSorter(new ArtifactViewerSorter());
+ teamDefList.setGrabHorizontal(true);
+ teamDefList.setMultiSelect(true);
+ teamDefList.createWidgets(comp, 2);
+ if (selectedTeamDefs != null) {
+ ArrayList<Object> sel = new ArrayList<Object>();
+ for (Object obj : selectedTeamDefs)
+ sel.add(obj);
+ teamDefList.setSelected(sel);
+ }
+ Set<Object> objs = new HashSet<Object>();
+ try {
+ for (TeamDefinitionArtifact teamDef : TeamDefinitionArtifact.getTeamDefinitions(Active.Both))
+ objs.add(teamDef);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ teamDefList.setInput(objs);
+ teamDefList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectedTeamDefs = teamDefList.getSelected();
+ };
+ });
+
+ comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ changeTypeList.setLabelProvider(new ChangeType.ChangeTypeLabelProvider());
+ changeTypeList.setContentProvider(new ArrayContentProvider());
+ Collection<Object> types = new ArrayList<Object>();
+ for (ChangeType type : ChangeType.values())
+ types.add(type);
+ changeTypeList.setInput(types);
+ changeTypeList.setGrabHorizontal(true);
+ changeTypeList.setMultiSelect(true);
+ changeTypeList.createWidgets(comp, 2);
+ if (selectedChangeTypes != null) {
+ ArrayList<Object> sel = new ArrayList<Object>();
+ for (Object obj : selectedChangeTypes)
+ sel.add(obj);
+ changeTypeList.setSelected(sel);
+ }
+
+ changeTypeList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectedChangeTypes = changeTypeList.getSelected();
+ };
+ });
+
+ comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ dateCombo.setFormat(XDate.MMDDYY);
+ dateCombo.setRequiredEntry(true);
+ dateCombo.createWidgets(comp, 2);
+ if (selectedDate != null) dateCombo.setDate(selectedDate);
+ dateCombo.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ selectedDate = dateCombo.getDate();
+ };
+ });
+
+ return container;
+ }
+
+ public ArrayList<TeamDefinitionArtifact> getSelectedTeamDefs() {
+ ArrayList<TeamDefinitionArtifact> adas = new ArrayList<TeamDefinitionArtifact>();
+ for (Object obj : selectedTeamDefs)
+ adas.add((TeamDefinitionArtifact) obj);
+ return adas;
+ }
+
+ public Date getSelectedDate() {
+ return selectedDate;
+ }
+
+ public ArrayList<Object> getSelectedChangeTypes() {
+ return selectedChangeTypes;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
new file mode 100644
index 00000000000..52b94f669bf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.report;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.core.enums.ModificationType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeData.KindType;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.HtmlExportTable;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CreateActionArtifactChangeReportJob extends Job {
+ IProgressMonitor monitor;
+ private final Set<TeamWorkFlowArtifact> teamArts;
+ private final String byAttribute;
+
+ public CreateActionArtifactChangeReportJob(String jobName, Set<TeamWorkFlowArtifact> teamArts, String byAttribute) {
+ super(jobName);
+ this.teamArts = teamArts;
+ this.byAttribute = byAttribute;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ return runIt(monitor, getName(), teamArts, byAttribute);
+ }
+
+ public static IStatus runIt(IProgressMonitor monitor, String jobName, Collection<TeamWorkFlowArtifact> teamArts, String byAttribute) {
+ XResultData rd = new XResultData();
+ try {
+ if (teamArts.size() == 0) throw new OseeStateException("No Actions/Workflows Specified");
+ retrieveData(monitor, teamArts, byAttribute, rd);
+ if (rd.toString().equals("")) rd.log("No Problems Found");
+ final String html = rd.getReport(jobName).getManipulatedHtml(Arrays.asList(Manipulations.NONE));
+ final String title = jobName;
+ Displays.ensureInDisplayThread(new Runnable() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ Result result = (new HtmlExportTable(title, html, true, false)).export();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ AWorkbench.popup(
+ title,
+ "Completed " + title + "\n\nFile saved to " + System.getProperty("user.home") + File.separator + "table.csv");
+ }
+ }, true);
+ monitor.done();
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "Failed", ex);
+ }
+ }
+
+ /**
+ * used recursively when originally passed a directory, thus an array of files is accepted
+ *
+ * @throws Exception
+ */
+ private static void retrieveData(IProgressMonitor monitor, Collection<TeamWorkFlowArtifact> teamArts, String byAttribute, XResultData rd) throws OseeCoreException {
+ monitor.subTask("Retrieving Actions");
+
+ int x = 1;
+ rd.addRaw(AHTML.beginMultiColumnTable(95));
+ rd.addRaw(AHTML.addHeaderRowMultiColumnTable(new String[] {"HRID", "Bulld", "UI", byAttribute, "RPCR", "Change"}));
+ for (TeamWorkFlowArtifact teamArt : teamArts) {
+ String rcprId = teamArt.getSoleAttributeValue(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), "");
+ String result =
+ (String.format("Processing %s/%s RPCR %s for \"%s\"", x, teamArts.size(), rcprId,
+ teamArt.getTeamDefinition().getDescriptiveName()));
+ monitor.subTask(result);
+ rd.log("\nRPCR " + rcprId);
+ VersionArtifact verArt = teamArt.getSmaMgr().getTargetedForVersion();
+ processTeam(teamArt, verArt.getDescriptiveName(), byAttribute, rd);
+ x++;
+
+ // System.err.println("Developmental purposes only, don't release with this");
+ // if (x >= 5)
+ // break;
+ }
+ rd.addRaw(AHTML.endMultiColumnTable());
+ }
+
+ private static void processTeam(TeamWorkFlowArtifact teamArt, String buildId, String byAttribute, XResultData rd) throws OseeCoreException {
+ String rpcrNum = teamArt.getSoleAttributeValue(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), "");
+ ChangeData changeData = teamArt.getSmaMgr().getBranchMgr().getChangeData();
+ for (Artifact modArt : changeData.getArtifacts(KindType.Artifact, ModificationType.NEW, ModificationType.CHANGE)) {
+ List<String> attrStrs = modArt.getAttributesToStringList(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ modArt.getDescriptiveName(), attrStr, rpcrNum, "Content"}));
+ }
+ for (Artifact artChg : changeData.getArtifacts(KindType.Artifact, ModificationType.DELETED)) {
+ List<String> attrStrs = artChg.getAttributesToStringList(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ artChg.getDescriptiveName(), attrStr, rpcrNum, "Deleted"}));
+ }
+ for (Artifact artChg : changeData.getArtifacts(KindType.RelationOnly, ModificationType.NEW,
+ ModificationType.CHANGE)) {
+ List<String> attrStrs = artChg.getAttributesToStringList(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ rd.addRaw(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ artChg.getDescriptiveName(), attrStr, rpcrNum, "Relation"}));
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java
new file mode 100644
index 00000000000..e64ef1651d5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.report;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ExtendedStatusReportJob extends Job {
+ private final ArrayList<Artifact> arts;
+
+ public ExtendedStatusReportJob(String title, ArrayList<Artifact> arts) {
+ super("Creating " + title);
+ this.arts = arts;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ return runIt(monitor, getName(), arts);
+ }
+
+ public static IStatus runIt(IProgressMonitor monitor, final String jobName, Collection<? extends Artifact> teamArts) {
+ if (teamArts.size() == 0) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "No Artifacts Returned");
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "No Artifacts Returned", null);
+ }
+ try {
+
+ final String html = AHTML.simplePage(getStatusReport(monitor, jobName, teamArts));
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ XResultView.getResultView().addResultPage(
+ new XResultPage(jobName + " - " + XDate.getDateNow(XDate.MMDDYYHHMM), html,
+ Manipulations.HTML_MANIPULATIONS));
+ AWorkbench.popup("Complete", jobName + " Complete...Results in ATS Results");
+ }
+ });
+ monitor.done();
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
+
+ private static String getStatusReport(IProgressMonitor monitor, String title, Collection<? extends Artifact> teamArts) throws OseeCoreException {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.heading(3, title));
+ sb.append(getStatusReportBody(monitor, title, teamArts));
+ return sb.toString();
+ }
+
+ private static enum Columns {
+ Priority,
+ Change_Type,
+ Team,
+ Type,
+ ActionId,
+ TeamId,
+ TaskId,
+ Title,
+ Analysis,
+ Originator,
+ Assignees,
+ Status_State,
+ Date_Created,
+ Version;
+
+ @Override
+ public String toString() {
+ return name().replaceAll("_", " ");
+ }
+
+ public static String[] getColumnNames() {
+ ArrayList<String> names = new ArrayList<String>();
+ for (Columns col : values()) {
+ names.add(col.toString());
+ }
+ return names.toArray(new String[names.size()]);
+ }
+ };
+
+ private static String getStatusReportBody(IProgressMonitor monitor, String title, Collection<? extends Artifact> arts) throws OseeCoreException {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.beginMultiColumnTable(100, 1));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(Columns.getColumnNames()));
+ int x = 1;
+ for (Artifact art : arts) {
+ if (art instanceof ActionArtifact) {
+ ActionArtifact actionArt = (ActionArtifact) art;
+ String str =
+ String.format("Processing %s/%s \"%s\"", x++ + "", arts.size(), actionArt.getDescriptiveName());
+ System.out.println(str);
+ monitor.subTask(str);
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts()) {
+ addTableRow(sb, team);
+ SMAManager teamSmaMgr = new SMAManager(team);
+ for (TaskArtifact taskArt : teamSmaMgr.getTaskMgr().getTaskArtifacts("Implement")) {
+ addTableRow(sb, taskArt);
+ }
+ }
+ }
+ }
+ sb.append(AHTML.endMultiColumnTable());
+ return sb.toString();
+ }
+
+ private static void addTableRow(StringBuilder sb, StateMachineArtifact sma) throws OseeCoreException {
+ List<String> values = new ArrayList<String>();
+ SMAManager smaMgr = new SMAManager(sma);
+ for (Columns col : Columns.values()) {
+ // System.out.println("col *" + col + "*");
+ if (col == Columns.ActionId)
+ values.add(sma.getParentActionArtifact().getHumanReadableId());
+ else if (col == Columns.TeamId) {
+ if (sma instanceof TeamWorkFlowArtifact)
+ values.add(sma.getHumanReadableId());
+ else
+ values.add(".");
+ } else if (col == Columns.TaskId) {
+ if (sma instanceof TaskArtifact)
+ values.add(((TaskArtifact) sma).getHumanReadableId());
+ else
+ values.add(".");
+ } else if (col == Columns.Team) {
+ if (sma instanceof TeamWorkFlowArtifact)
+ values.add(((TeamWorkFlowArtifact) sma).getTeamName());
+ else
+ values.add(".");
+ } else if (col == Columns.Type)
+ values.add(sma.getArtifactTypeName());
+ else if (col == Columns.Priority) {
+ values.add((sma.getWorldViewPriority().equals("") ? "." : sma.getWorldViewPriority()));
+ } else if (col == Columns.Change_Type) {
+ values.add((sma.getWorldViewChangeType().name().equals("") ? "." : sma.getWorldViewChangeType().name()));
+ } else if (col == Columns.Title)
+ values.add(sma.getDescriptiveName());
+ else if (col == Columns.Analysis) {
+ String desc = sma.getDescription();
+ if (sma instanceof TaskArtifact) {
+ TaskArtifact taskArt = (TaskArtifact) sma;
+ desc =
+ taskArt.getDescription() + " " + taskArt.getSoleAttributeValue(
+ ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), "");
+ }
+ if (desc.matches("^ *$"))
+ values.add(".");
+ else
+ values.add(desc);
+ } else if (col == Columns.Originator) {
+ if (smaMgr.getOriginator() == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't retrieve orig for " + sma.getHumanReadableId(), true);
+ values.add(".");
+ } else
+ values.add(smaMgr.getOriginator().getName());
+ } else if (col == Columns.Assignees)
+ values.add(Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees()));
+ else if (col == Columns.Status_State)
+ values.add(smaMgr.getStateMgr().getCurrentStateName());
+ else if (col == Columns.Date_Created)
+ values.add(sma.getWorldViewCreatedDateStr());
+ else if (col == Columns.Version) {
+ values.add((sma.getWorldViewTargetedVersionStr() == null || sma.getWorldViewTargetedVersionStr().equals("") ? "." : sma.getWorldViewTargetedVersionStr()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(values.toArray(new String[values.size()])));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/ITaskEditorProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/ITaskEditorProvider.java
new file mode 100644
index 00000000000..4eb6227b9ca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/ITaskEditorProvider.java
@@ -0,0 +1,33 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface ITaskEditorProvider {
+
+ public Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException;
+
+ public String getTaskEditorLabel(SearchType searchType) throws OseeCoreException;
+
+ public String getName() throws OseeCoreException;
+
+ public Collection<TableLoadOption> getTableLoadOptions() throws OseeCoreException;
+
+ public void setCustomizeData(CustomizeData customizeData);
+
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions);
+
+ public ITaskEditorProvider copyProvider();
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/IXTaskViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/IXTaskViewer.java
new file mode 100644
index 00000000000..ce94ec7823a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/IXTaskViewer.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IXTaskViewer {
+
+ public enum RelationChangeAction {
+ RemoveTask, AddTask, UpdateTask, ReLoadTable, None
+ };
+
+ public String getTabName() throws OseeCoreException;
+
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws OseeCoreException;
+
+ public IDirtiableEditor getEditor() throws OseeCoreException;
+
+ public boolean isTaskable() throws OseeCoreException;
+
+ public String getCurrentStateName() throws OseeCoreException;
+
+ public SMAManager getParentSmaMgr() throws OseeCoreException;
+
+ /**
+ * Overriding flag to denote if tasks are allowed to be edited. If false, task viewer will disable all right-click
+ * and alt-left-click editing functionality.
+ *
+ * @return false if tasks are readonly from the TaskViewer
+ * @throws
+ */
+ public boolean isTasksEditable() throws OseeCoreException;
+
+ public String toString();
+
+ /**
+ * Returning true will allow implementer class to handle the refresh button press which whill result in
+ * handlRefreshAction() being called
+ *
+ * @return if implementer will handle refresh calls
+ */
+ public boolean isRefreshActionHandled() throws OseeCoreException;
+
+ /**
+ * Called if isRefreshActionHandled() returns true
+ */
+ public void handleRefreshAction() throws OseeCoreException;
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java
new file mode 100644
index 00000000000..00af2e04760
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskComposite.java
@@ -0,0 +1,583 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TaskableStateMachineArtifact;
+import org.eclipse.osee.ats.config.BulkLoadAtsCache;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.operation.ImportTasksFromSimpleList;
+import org.eclipse.osee.ats.operation.ImportTasksFromSpreadsheet;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.ats.util.SMAMetrics;
+import org.eclipse.osee.ats.world.WorldCompletedFilter;
+import org.eclipse.osee.ats.world.WorldContentProvider;
+import org.eclipse.osee.ats.world.WorldLabelProvider;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.SkynetActivator;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTransfer;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.blam.BlamEditor;
+import org.eclipse.osee.framework.ui.skynet.blam.BlamOperations;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskComposite extends Composite implements IActionable {
+
+ private TaskXViewer taskXViewer;
+ private MenuItem filterCompletedMenuItem, selectionMetricsMenuItem;
+ private final IXTaskViewer iXTaskViewer;
+ private Label extraInfoLabel;
+ private final WorldCompletedFilter worldCompletedFilter = new WorldCompletedFilter();
+
+ /**
+ * @param label
+ * @throws Exception
+ */
+ public TaskComposite(IXTaskViewer iXTaskViewer, Composite parent, int style) throws OseeCoreException {
+ this(iXTaskViewer, parent, style, null);
+ }
+
+ public TaskComposite(IXTaskViewer iXTaskViewer, Composite parent, int style, ToolBar toolBar) throws OseeCoreException {
+ super(parent, style);
+ this.iXTaskViewer = iXTaskViewer;
+ BulkLoadAtsCache.run(false);
+
+ setLayout(ALayout.getZeroMarginLayout(1, true));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(this)) {
+ return;
+ }
+
+ populateToolBar(toolBar);
+
+ try {
+
+ extraInfoLabel = new Label(this, SWT.NONE);
+ extraInfoLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ taskXViewer =
+ new TaskXViewer(this, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, iXTaskViewer.getEditor(), this);
+ taskXViewer.setTasksEditable(iXTaskViewer.isTasksEditable());
+ taskXViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ taskXViewer.setContentProvider(new WorldContentProvider(taskXViewer));
+ taskXViewer.setLabelProvider(new WorldLabelProvider(taskXViewer));
+ taskXViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ taskXViewer.getTree().addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent event) {
+ }
+
+ public void keyReleased(KeyEvent event) {
+ try {
+ if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
+ if (event.keyCode == 'a') {
+ taskXViewer.getTree().setSelection(taskXViewer.getTree().getItems());
+ updateExtraInfoLine();
+ } else if (event.keyCode == 'x') {
+ if (selectionMetricsMenuItem != null) {
+ selectionMetricsMenuItem.setSelection(!selectionMetricsMenuItem.getSelection());
+ updateExtraInfoLine();
+ }
+ } else if (event.keyCode == 'f') {
+ if (filterCompletedMenuItem != null) {
+ filterCompletedMenuItem.setSelection(!filterCompletedMenuItem.getSelection());
+ handleFilterAction();
+ }
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+
+ Tree tree = taskXViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ setupDragAndDropSupport();
+ parent.layout();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * @return the iXTaskViewer
+ */
+ public IXTaskViewer getIXTaskViewer() {
+ return iXTaskViewer;
+ }
+
+ public void handleFilterAction() {
+ if (filterCompletedMenuItem.getSelection()) {
+ taskXViewer.addFilter(worldCompletedFilter);
+ } else {
+ taskXViewer.removeFilter(worldCompletedFilter);
+ }
+ updateExtendedStatusString();
+ }
+
+ public void updateExtendedStatusString() {
+ String str = "";
+ if (filterCompletedMenuItem != null && filterCompletedMenuItem.getSelection()) {
+ str += "[Complete/Cancel Filter]";
+ }
+ taskXViewer.setExtendedStatusString(str);
+ taskXViewer.refresh();
+ }
+
+ private void populateToolBar(ToolBar toolBar) throws OseeCoreException {
+ ToolItem item = null;
+
+ if (iXTaskViewer.isTaskable()) {
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("newTask.gif"));
+ item.setToolTipText("New Task");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleNewTask();
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("redRemove.gif"));
+ item.setToolTipText("Delete Task");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleDeleteTask();
+ }
+ });
+
+ }
+
+ if (iXTaskViewer.getEditor() != null && (iXTaskViewer.getEditor() instanceof TaskEditor)) {
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("task.gif"));
+ item.setToolTipText("Open New ATS Task Editor");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ ITaskEditorProvider provider =
+ ((TaskEditorInput) ((TaskEditor) iXTaskViewer.getEditor()).getEditorInput()).getItaskEditorProvider().copyProvider();
+ provider.setCustomizeData(taskXViewer.getCustomizeMgr().generateCustDataFromTable());
+ provider.setTableLoadOptions(TableLoadOption.NoUI);
+ TaskEditor.open(provider);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ }
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("taskSelected.gif"));
+ item.setToolTipText("Open Selected in ATS Task Editor");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (taskXViewer.getSelectedArtifacts().size() == 0) {
+ AWorkbench.popup("ERROR", "Select items to open");
+ return;
+ }
+ try {
+ TaskEditor.open(new TaskEditorSimpleProvider("Tasks", taskXViewer.getSelectedArtifacts(),
+ taskXViewer.getCustomizeMgr().generateCustDataFromTable()));
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("refresh.gif"));
+ item.setToolTipText("Refresh Tasks");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ if (iXTaskViewer.isRefreshActionHandled()) {
+ iXTaskViewer.handleRefreshAction();
+ } else {
+ loadTable();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("customize.gif"));
+ item.setToolTipText("Customize Table");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ taskXViewer.getCustomizeMgr().handleTableCustomization();
+ }
+ });
+
+ OseeAts.addButtonToEditorToolBar(this, AtsPlugin.getInstance(), toolBar, SMAEditor.EDITOR_ID, "ATS Task Tab");
+ createTaskActionBarPulldown(toolBar, toolBar.getParent());
+
+ }
+
+ public void updateExtraInfoLine() throws OseeCoreException {
+ if (selectionMetricsMenuItem != null && selectionMetricsMenuItem.getSelection())
+ extraInfoLabel.setText(SMAMetrics.getEstRemainMetrics(getTaskXViewer().getSelectedSMAArtifacts()));
+ else
+ extraInfoLabel.setText("");
+ extraInfoLabel.getParent().layout();
+ }
+
+ public void createTaskActionBarPulldown(final ToolBar toolBar, Composite composite) {
+ final ToolItem dropDown = new ToolItem(toolBar, SWT.PUSH);
+ dropDown.setImage(AtsPlugin.getInstance().getImage("downTriangle.gif"));
+ final Menu menu = new Menu(composite);
+
+ dropDown.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ Rectangle rect = dropDown.getBounds();
+ Point pt = new Point(rect.x, rect.y + rect.height);
+ pt = toolBar.toDisplay(pt);
+ menu.setLocation(pt.x, pt.y);
+ menu.setVisible(true);
+ }
+ });
+
+ selectionMetricsMenuItem = new MenuItem(menu, SWT.CHECK);
+ selectionMetricsMenuItem.setText("Show Release Metrics by Selection - Ctrl-X");
+ selectionMetricsMenuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ updateExtraInfoLine();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ filterCompletedMenuItem = new MenuItem(menu, SWT.CHECK);
+ filterCompletedMenuItem.setText("Filter Out Completed/Cancelled - Ctrl-F");
+ filterCompletedMenuItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleFilterAction();
+ }
+ });
+
+ try {
+ if (iXTaskViewer.isTaskable()) {
+ new MenuItem(menu, SWT.SEPARATOR);
+
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Import Tasks via spreadsheet");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ handleImportTasksViaSpreadsheet();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+
+ item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Import Tasks via simple list");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ handleImportTasksViaList();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ }
+
+ public void loadTable() throws OseeCoreException {
+ getTaskXViewer().set(iXTaskViewer.getTaskArtifacts(""));
+ taskXViewer.refresh();
+ }
+
+ public void handleImportTasksViaList() throws OseeCoreException {
+ BlamOperation blamOperation = BlamOperations.getBlamOperation("ImportTasksFromSimpleList");
+ ((ImportTasksFromSimpleList) blamOperation).setTaskableStateMachineArtifact((TaskableStateMachineArtifact) iXTaskViewer.getParentSmaMgr().getSma());
+ BlamEditor.edit(blamOperation);
+ loadTable();
+ }
+
+ public void handleImportTasksViaSpreadsheet() throws OseeCoreException {
+ BlamOperation blamOperation = BlamOperations.getBlamOperation("ImportTasksFromSpreadsheet");
+ ((ImportTasksFromSpreadsheet) blamOperation).setTaskableStateMachineArtifact((TaskableStateMachineArtifact) iXTaskViewer.getParentSmaMgr().getSma());
+ BlamEditor.edit(blamOperation);
+ loadTable();
+ }
+
+ public void handleDeleteTask() {
+ final ArrayList<TaskArtifact> items = getSelectedTaskArtifactItems();
+ if (items.size() == 0) {
+ AWorkbench.popup("ERROR", "No Tasks Selected");
+ return;
+ }
+ StringBuilder builder = new StringBuilder();
+ if (items.size() > 15) {
+ builder.append("Are You Sure You Wish to Delete " + items.size() + " Tasks (NOTE: workflow will be saved)");
+ } else {
+ builder.append("Are You Sure You Wish to Delete the Task(s) (NOTE: workflow will be saved):\n\n");
+ for (TaskArtifact taskItem : items) {
+ builder.append("\"" + taskItem.getDescriptiveName() + "\"\n");
+ }
+ }
+ boolean delete =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Delete Task",
+ builder.toString());
+ if (delete) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ // Done for concurrent modification purposes
+ ArrayList<TaskArtifact> delItems = new ArrayList<TaskArtifact>();
+ delItems.addAll(items);
+ for (TaskArtifact taskArt : delItems) {
+ SMAEditor.close(taskArt, false);
+ taskArt.delete(transaction);
+ }
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public TaskArtifact handleNewTask() {
+ TaskArtifact taskArt = null;
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Create New Task", null,
+ "Enter Task Title/Description", MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ if (ed.open() == 0) {
+ try {
+ taskArt = iXTaskViewer.getParentSmaMgr().getTaskMgr().createNewTask(ed.getEntry(), false);
+ iXTaskViewer.getEditor().onDirtied();
+ taskXViewer.add(taskArt);
+ taskXViewer.getTree().setFocus();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return taskArt;
+ }
+
+ public ArrayList<TaskArtifact> getSelectedTaskArtifactItems() {
+ Iterator<?> i = ((IStructuredSelection) taskXViewer.getSelection()).iterator();
+ ArrayList<TaskArtifact> items = new ArrayList<TaskArtifact>();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifact) items.add((TaskArtifact) obj);
+ }
+ return items;
+ }
+
+ public String toHTML(String labelFont) {
+ if (getTaskXViewer().getTree().getItemCount() == 0) return "";
+ StringBuffer html = new StringBuffer();
+ try {
+ html.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Tasks"));
+ html.append(AHTML.startBorderTable(100, Overview.normalColor, ""));
+ html.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Title", "State", "POC", "%", "Hrs",
+ "Resolution", "ID"}));
+ for (TaskArtifact art : iXTaskViewer.getTaskArtifacts("")) {
+ SMAManager smaMgr = new SMAManager(art);
+ html.append(AHTML.addRowMultiColumnTable(new String[] {art.getDescriptiveName(),
+ art.getSmaMgr().getStateMgr().getCurrentStateName().replaceAll("(Task|State)", ""),
+ smaMgr.getAssigneesWasIsStr(), smaMgr.getSma().getPercentCompleteSMATotal() + "",
+ smaMgr.getSma().getHoursSpentSMATotal() + "",
+ art.getSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), ""),
+ art.getHumanReadableId()}));
+ }
+ html.append(AHTML.endBorderTable());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Task Exception - " + ex.getLocalizedMessage();
+ }
+ return html.toString();
+ }
+
+ /**
+ * @return Returns the xViewer.
+ */
+ public TaskXViewer getTaskXViewer() {
+ return taskXViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.XWidget#getData()
+ */
+ @Override
+ public Object getData() {
+ return taskXViewer.getInput();
+ }
+
+ private void setupDragAndDropSupport() {
+ DragSource source = new DragSource(taskXViewer.getTree(), DND.DROP_COPY);
+ source.setTransfer(new Transfer[] {ArtifactTransfer.getInstance()});
+ source.addDragListener(new DragSourceListener() {
+
+ public void dragFinished(DragSourceEvent event) {
+ }
+
+ public void dragSetData(DragSourceEvent event) {
+ Collection<TaskArtifact> arts = taskXViewer.getSelectedTaskArtifacts();
+ if (arts.size() > 0) {
+ event.data = new ArtifactData(arts.toArray(new Artifact[arts.size()]), "", SMAEditor.EDITOR_ID);
+ }
+ }
+
+ public void dragStart(DragSourceEvent event) {
+ }
+ });
+
+ DropTarget target = new DropTarget(taskXViewer.getTree(), DND.DROP_COPY);
+ target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance(),
+ ArtifactTransfer.getInstance()});
+ target.addDropListener(new DropTargetAdapter() {
+
+ @Override
+ public void drop(DropTargetEvent event) {
+ performDrop(event);
+ }
+
+ @Override
+ public void dragOver(DropTargetEvent event) {
+ event.detail = DND.DROP_COPY;
+ }
+
+ @Override
+ public void dropAccept(DropTargetEvent event) {
+ }
+ });
+ }
+
+ private void performDrop(DropTargetEvent e) {
+ if (e.data instanceof ArtifactData) {
+ try {
+ if (iXTaskViewer.getParentSmaMgr().getSma() == null) return;
+ final Artifact[] artsToRelate = ((ArtifactData) e.data).getArtifacts();
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (Artifact art : artsToRelate) {
+ if (art instanceof TaskArtifact) {
+ TaskArtifact taskArt = (TaskArtifact) art;
+ if (taskArt.getParentSMA() != null) {
+ taskArt.deleteRelation(AtsRelation.SmaToTask_Sma, taskArt.getParentSMA());
+ }
+ taskArt.addRelation(AtsRelation.SmaToTask_Sma, iXTaskViewer.getParentSmaMgr().getSma());
+ taskArt.persistRelations(transaction);
+ }
+ }
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetActivator.class, ex, true);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ats.IActionable#getActionDescription()
+ */
+ public String getActionDescription() {
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java
new file mode 100644
index 00000000000..72011e2ee0e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditor.java
@@ -0,0 +1,384 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.world.AtsMetricsComposite;
+import org.eclipse.osee.ats.world.IAtsMetricsProvider;
+import org.eclipse.osee.ats.world.WorldEditorParameterSearchItemProvider;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+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.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditor extends AbstractArtifactEditor implements IDirtiableEditor, IAtsMetricsProvider, IXTaskViewer {
+ public static final String EDITOR_ID = "org.eclipse.osee.ats.editor.TaskEditor";
+ private int mainPageIndex, metricsPageIndex;
+ private TaskXWidgetActionPage taskActionPage;
+ private final Collection<TaskArtifact> tasks = new HashSet<TaskArtifact>();
+ private AtsMetricsComposite metricsComposite;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (TaskArtifact taskArt : tasks) {
+ taskArt.saveSMA(transaction);
+ }
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ onDirtied();
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ return taskActionPage.getTaskComposite().getTaskXViewer().getLoadedArtifacts();
+ }
+
+ @Override
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ public void setTableTitle(final String title, final boolean warning) {
+ taskActionPage.setTableTitle(title, warning);
+ }
+
+ @Override
+ public void dispose() {
+ for (TaskArtifact taskArt : tasks)
+ if (taskArt != null && !taskArt.isDeleted() && taskArt.isSMAEditorDirty().isTrue()) taskArt.revertSMA();
+ if (taskActionPage.getTaskComposite() != null) taskActionPage.getTaskComposite().dispose();
+ if (metricsComposite != null) metricsComposite.disposeComposite();
+
+ super.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ for (TaskArtifact taskArt : tasks) {
+ if (taskArt.isDeleted())
+ continue;
+ else if (taskArt.isSMAEditorDirty().isTrue()) return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "TaskEditor";
+ }
+
+ /**
+ * @return the taskActionPage
+ */
+ public TaskXWidgetActionPage getTaskActionPage() {
+ return taskActionPage;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ @Override
+ protected void addPages() {
+
+ try {
+ OseeContributionItem.addTo(this, true);
+
+ IEditorInput editorInput = getEditorInput();
+ if (!(editorInput instanceof TaskEditorInput)) {
+ throw new IllegalArgumentException("Editor Input not TaskEditorInput");
+ }
+
+ createMainTab();
+ createMetricsTab();
+
+ setActivePage(mainPageIndex);
+ loadTable();
+
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ } catch (PartInitException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private void createMainTab() throws OseeCoreException, PartInitException {
+ taskActionPage = new TaskXWidgetActionPage(this);
+ mainPageIndex = addPage(taskActionPage);
+ }
+
+ private void createMetricsTab() throws OseeCoreException {
+ Composite comp = AtsLib.createCommonPageComposite(getContainer());
+ AtsLib.createCommonToolBar(comp);
+ metricsComposite = new AtsMetricsComposite(this, comp, SWT.NONE);
+ metricsPageIndex = addPage(comp);
+ setPageText(metricsPageIndex, "Metrics");
+ }
+
+ public ITaskEditorProvider getTaskEditorProvider() {
+ TaskEditorInput aei = (TaskEditorInput) getEditorInput();
+ return aei.getItaskEditorProvider();
+ }
+
+ private void loadTable() throws OseeCoreException {
+ ITaskEditorProvider provider = getTaskEditorProvider();
+ setPartName(provider.getTaskEditorLabel(SearchType.Search));
+
+ if (provider instanceof TaskEditorParameterSearchItemProvider && ((TaskEditorParameterSearchItemProvider) provider).isFirstTime()) {
+ setPartName(provider.getName());
+ setTableTitle(WorldEditorParameterSearchItemProvider.ENTER_OPTIONS_AND_SELECT_SEARCH, false);
+ return;
+ }
+ if (provider instanceof TaskEditorParameterSearchItemProvider) {
+ Result result =
+ ((TaskEditorParameterSearchItemProvider) provider).getWorldSearchItem().isParameterSelectionValid();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ }
+ LoadTableJob job = null;
+ job = new LoadTableJob(provider, SearchType.ReSearch, this);
+ job.setUser(false);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ if (provider.getTableLoadOptions().contains(TableLoadOption.ForcePend)) {
+ try {
+ job.join();
+ } catch (InterruptedException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ @Override
+ public void onDirtied() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+
+ public static void open(final ITaskEditorProvider provider) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(new TaskEditorInput(provider), EDITOR_ID);
+ } catch (PartInitException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }, provider.getTableLoadOptions().contains(TableLoadOption.ForcePend));
+ }
+
+ private static class LoadTableJob extends Job {
+
+ private final ITaskEditorProvider itaskEditorProvider;
+ private final TaskEditor taskEditor;
+ private final SearchType searchType;
+
+ public LoadTableJob(ITaskEditorProvider itaskEditorProvider, SearchType searchType, TaskEditor taskEditor) throws OseeCoreException {
+ super("Loading \"" + itaskEditorProvider.getTaskEditorLabel(searchType) + "\"...");
+ this.searchType = searchType;
+ this.taskEditor = taskEditor;
+ taskEditor.setPartName(itaskEditorProvider.getTaskEditorLabel(searchType));
+ taskEditor.setTableTitle("Loading \"" + itaskEditorProvider.getTaskEditorLabel(searchType) + "\"...", false);
+ this.itaskEditorProvider = itaskEditorProvider;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final List<TaskArtifact> taskArts = new ArrayList<TaskArtifact>();
+ for (Artifact artifact : itaskEditorProvider.getTaskEditorTaskArtifacts()) {
+ if (artifact instanceof TaskArtifact) {
+ taskArts.add((TaskArtifact) artifact);
+ }
+ }
+ taskEditor.tasks.clear();
+ taskEditor.tasks.addAll(taskArts);
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ try {
+ taskEditor.setPartName(itaskEditorProvider.getTaskEditorLabel(searchType));
+ if (taskArts.size() == 0) {
+ taskEditor.setTableTitle(
+ "No Results Found - " + itaskEditorProvider.getTaskEditorLabel(searchType), true);
+ } else {
+ taskEditor.setTableTitle(itaskEditorProvider.getTaskEditorLabel(searchType), false);
+ }
+ taskEditor.getTaskActionPage().getTaskComposite().loadTable();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ } catch (final Exception ex) {
+ monitor.done();
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "Can't load tasks", ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getMetricsArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getMetricsArtifacts() throws OseeCoreException {
+ return tasks;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getMetricsVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getMetricsVersionArtifact() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getCurrentStateName()
+ */
+ public String getCurrentStateName() throws OseeCoreException {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getEditor()
+ */
+ public IDirtiableEditor getEditor() throws OseeCoreException {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getParentSmaMgr()
+ */
+ public SMAManager getParentSmaMgr() throws OseeCoreException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTabName()
+ */
+ public String getTabName() throws OseeCoreException {
+ return "Tasks";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTaskArtifacts(java.lang.String)
+ */
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws OseeCoreException {
+ return tasks;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isTaskable()
+ */
+ public boolean isTaskable() throws OseeCoreException {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isTasksEditable()
+ */
+ public boolean isTasksEditable() throws OseeCoreException {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isRefreshHandled()
+ */
+ @Override
+ public boolean isRefreshActionHandled() throws OseeCoreException {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#refresh()
+ */
+ @Override
+ public void handleRefreshAction() throws OseeCoreException {
+ loadTable();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorInput.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorInput.java
new file mode 100644
index 00000000000..3a894970164
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorInput.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.logging.Level;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditorInput implements IEditorInput {
+
+ ITaskEditorProvider itaskEditorProvider;
+
+ /**
+ * @return the itaskEditorProvider
+ */
+ public ITaskEditorProvider getItaskEditorProvider() {
+ return itaskEditorProvider;
+ }
+
+ public TaskEditorInput(ITaskEditorProvider itaskEditorProvider) {
+ this.itaskEditorProvider = itaskEditorProvider;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ public boolean exists() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ try {
+ return itaskEditorProvider.getName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception getting name: " + ex.getLocalizedMessage();
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItem.java
new file mode 100644
index 00000000000..0b2cd337068
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItem.java
@@ -0,0 +1,71 @@
+/*
+ * Created on Nov 18, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class TaskEditorParameterSearchItem extends WorldSearchItem implements ITaskEditorProvider, IDynamicWidgetLayoutListener, IXWidgetOptionResolver {
+
+ boolean firstTime = true;
+
+ /**
+ * @param name
+ */
+ public TaskEditorParameterSearchItem(String name) {
+ super(name, LoadView.TaskEditor);
+ }
+
+ /**
+ * @param worldSearchItem
+ */
+ public TaskEditorParameterSearchItem(WorldSearchItem worldSearchItem) {
+ super(worldSearchItem);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldSearchItem#copy()
+ */
+ @Override
+ public WorldSearchItem copy() {
+ return null;
+ }
+
+ public abstract String getParameterXWidgetXml() throws OseeCoreException;
+
+ public abstract Result isParameterSelectionValid() throws OseeCoreException;
+
+ public abstract Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.ITaskEditorParameterProvider#getWidgetOptions(org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData)
+ */
+ @Override
+ public String[] getWidgetOptions(DynamicXWidgetLayoutData widgetData) {
+ return null;
+ }
+
+ /**
+ * @return the firstTime
+ */
+ public boolean isFirstTime() {
+ if (firstTime) {
+ firstTime = false;
+ return true;
+ }
+ return firstTime;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItemProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItemProvider.java
new file mode 100644
index 00000000000..83854e73bf7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorParameterSearchItemProvider.java
@@ -0,0 +1,75 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditorParameterSearchItemProvider extends TaskEditorProvider {
+
+ private final TaskEditorParameterSearchItem taskParameterSearchItem;
+
+ public TaskEditorParameterSearchItemProvider(TaskEditorParameterSearchItem worldParameterSearchItem) {
+ this(worldParameterSearchItem, null, TableLoadOption.None);
+ }
+
+ public TaskEditorParameterSearchItemProvider(TaskEditorParameterSearchItem taskParameterSearchItem, CustomizeData customizeData, TableLoadOption... tableLoadOptions) {
+ super(customizeData, tableLoadOptions);
+ this.taskParameterSearchItem = taskParameterSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorLabel()
+ */
+ @Override
+ public String getTaskEditorLabel(SearchType searchType) throws OseeCoreException {
+ return taskParameterSearchItem.getTaskEditorLabel(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorTaskArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException {
+ return taskParameterSearchItem.getTaskEditorTaskArtifacts();
+ }
+
+ public boolean isFirstTime() {
+ return taskParameterSearchItem.isFirstTime();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return taskParameterSearchItem.getName();
+ }
+
+ /**
+ * @return the worldSearchItem
+ */
+ public TaskEditorParameterSearchItem getWorldSearchItem() {
+ return taskParameterSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#copyProvider()
+ */
+ @Override
+ public ITaskEditorProvider copyProvider() {
+ return new TaskEditorParameterSearchItemProvider((TaskEditorParameterSearchItem) taskParameterSearchItem.copy(),
+ customizeData, tableLoadOptions);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorProvider.java
new file mode 100644
index 00000000000..ade7a20bdc0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorProvider.java
@@ -0,0 +1,56 @@
+/*
+ * Created on Nov 22, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class TaskEditorProvider implements ITaskEditorProvider {
+
+ protected TableLoadOption[] tableLoadOptions;
+ protected CustomizeData customizeData;
+
+ public TaskEditorProvider(CustomizeData customizeData, TableLoadOption... tableLoadOptions) {
+ this.customizeData = customizeData;
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /**
+ * @return the customizeData
+ */
+ public CustomizeData getCustomizeData() {
+ return customizeData;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTableLoadOptions()
+ */
+ @Override
+ public Collection<TableLoadOption> getTableLoadOptions() throws OseeCoreException {
+ return Collections.getAggregate(tableLoadOptions);
+ }
+
+ /**
+ * @param tableLoadOptions the tableLoadOptions to set
+ */
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions) {
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /**
+ * @param customizeData the customizeData to set
+ */
+ public void setCustomizeData(CustomizeData customizeData) {
+ this.customizeData = customizeData;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSearchItemProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSearchItemProvider.java
new file mode 100644
index 00000000000..384ffb78e1b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSearchItemProvider.java
@@ -0,0 +1,76 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.ats.world.search.WorldUISearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditorSearchItemProvider extends TaskEditorProvider {
+
+ private final WorldSearchItem worldSearchItem;
+
+ public TaskEditorSearchItemProvider(WorldSearchItem worldSearchItem) {
+ this(worldSearchItem, null, TableLoadOption.None);
+ }
+
+ public TaskEditorSearchItemProvider(WorldSearchItem worldSearchItem, CustomizeData customizeData, TableLoadOption... tableLoadOptions) {
+ super(customizeData, tableLoadOptions);
+ this.worldSearchItem = worldSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorLabel()
+ */
+ @Override
+ public String getTaskEditorLabel(SearchType searchType) throws OseeCoreException {
+ return worldSearchItem.getSelectedName(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorTaskArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException {
+ if (worldSearchItem instanceof WorldUISearchItem) {
+ return ((WorldUISearchItem) worldSearchItem).performSearchGetResults(false, SearchType.ReSearch);
+ } else
+ throw new OseeStateException("Unsupported WorldSearchItem");
+ }
+
+ /**
+ * @return the worldSearchItem
+ */
+ public WorldSearchItem getWorldSearchItem() {
+ return worldSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return worldSearchItem.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#copyProvider()
+ */
+ @Override
+ public ITaskEditorProvider copyProvider() {
+ return new TaskEditorSearchItemProvider(worldSearchItem.copy(), customizeData, tableLoadOptions);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSimpleProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSimpleProvider.java
new file mode 100644
index 00000000000..b0a2a5338ca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskEditorSimpleProvider.java
@@ -0,0 +1,65 @@
+/*
+ * Created on Nov 7, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditorSimpleProvider extends TaskEditorProvider {
+
+ private final String name;
+ private final Collection<? extends Artifact> artifacts;
+
+ public TaskEditorSimpleProvider(String name, Collection<? extends Artifact> artifacts) {
+ this(name, artifacts, null, TableLoadOption.None);
+ }
+
+ public TaskEditorSimpleProvider(String name, Collection<? extends Artifact> artifacts, CustomizeData customizeData, TableLoadOption... tableLoadOption) {
+ super(customizeData, tableLoadOption);
+ this.name = name;
+ this.artifacts = artifacts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorLabel(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getTaskEditorLabel(SearchType searchType) throws OseeCoreException {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.ITaskEditorProvider#getTaskEditorTaskArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException {
+ return artifacts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return name;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#copyProvider()
+ */
+ @Override
+ public ITaskEditorProvider copyProvider() {
+ return new TaskEditorSimpleProvider(name, artifacts, customizeData, tableLoadOptions);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
new file mode 100644
index 00000000000..37a28a4ce75
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewer.java
@@ -0,0 +1,485 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.world.WorldContentProvider;
+import org.eclipse.osee.ats.world.WorldXViewer;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskXViewer extends WorldXViewer {
+
+ private final TaskComposite xTaskViewer;
+ private final IDirtiableEditor editor;
+ private boolean tasksEditable = true;
+ private static String viewerId = GUID.generateGuidStr();
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public TaskXViewer(Composite parent, int style, IDirtiableEditor editor, TaskComposite xTaskViewer) {
+ super(parent, style, new TaskXViewerFactory());
+ this.editor = editor;
+ this.xTaskViewer = xTaskViewer;
+ }
+
+ @Override
+ public String toString() {
+ if (xTaskViewer == null) return "TaskXViewer";
+ try {
+ if (xTaskViewer.getIXTaskViewer().getParentSmaMgr() != null) {
+ return "TaskXViewer - id:" + viewerId + " - " + xTaskViewer.getIXTaskViewer().getParentSmaMgr().getSma().toString();
+ }
+ return "TaskXViewer - id:" + viewerId + " - " + xTaskViewer.getIXTaskViewer().toString();
+ } catch (Exception ex) {
+ return "TaskXViewer - id:" + viewerId;
+ }
+ }
+
+ public boolean isUsingTaskResolutionOptions() {
+ try {
+ return getSelectedTaskArtifact().isUsingTaskResolutionOptions();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return false;
+ }
+
+ @Override
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ handleColumnMultiEdit(treeColumn, treeItems, false);
+ Set<TaskArtifact> items = new HashSet<TaskArtifact>();
+ for (TreeItem item : treeItems)
+ items.add((TaskArtifact) item.getData());
+ refresh();
+ editor.onDirtied();
+ }
+
+ @Override
+ public void set(Collection<? extends Artifact> artifacts) {
+ for (Artifact art : artifacts)
+ if (!(art instanceof TaskArtifact)) throw new IllegalArgumentException("set only allowed for TaskArtifact");
+ ((WorldContentProvider) getContentProvider()).set(artifacts);
+ }
+
+ @Override
+ public void add(final Artifact artifact) {
+ if (!(artifact instanceof TaskArtifact)) throw new IllegalArgumentException("set only allowed for TaskArtifact");
+ add(Arrays.asList(artifact));
+ }
+
+ @Override
+ public void add(Collection<Artifact> artifacts) {
+ for (Artifact art : artifacts)
+ if (!(art instanceof TaskArtifact)) throw new IllegalArgumentException("add only allowed for TaskArtifact");
+ ((WorldContentProvider) getContentProvider()).add(artifacts);
+ }
+
+ public void removeTask(final Collection<TaskArtifact> artifacts) {
+ ((WorldContentProvider) getContentProvider()).remove(artifacts);
+ }
+
+ public TaskArtifact getSelectedTaskArtifact() {
+ Collection<TaskArtifact> arts = getSelectedTaskArtifacts();
+ if (arts.size() > 0) {
+ return arts.iterator().next();
+ }
+ return null;
+ }
+
+ public boolean isSelectedTaskArtifactsAreInWork() {
+ try {
+ Iterator<?> i = ((IStructuredSelection) getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifact) if (!((TaskArtifact) obj).isInWork()) return false;
+ }
+ return true;
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return false;
+ }
+
+ Action editTaskTitleAction, editTaskAssigneesAction, editTaskStatusAction, editTaskResolutionAction,
+ editTaskEstimateAction, editTaskRelatedStateAction, editTaskNotesAction;
+ Action addNewTaskAction, deleteTasksAction;
+
+ @Override
+ public void createMenuActions() {
+ super.createMenuActions();
+
+ editTaskTitleAction = new Action("Edit Task Title", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ SMAManager taskSmaMgr = new SMAManager(getSelectedTaskArtifact());
+ boolean success = taskSmaMgr.promptChangeAttribute(ATSAttributes.TITLE_ATTRIBUTE, false, false);
+ if (success) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskAssigneesAction = new Action("Edit Task Assignees", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeAssignees(getSelectedTaskArtifacts())) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskStatusAction = new Action("Edit Task Status", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeStatus(getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskResolutionAction = new Action("Edit Task Resolution", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ handleChangeResolution();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskEstimateAction = new Action("Edit Task Estimate", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ boolean success =
+ ArtifactPromptChange.promptChangeFloatAttribute(
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(),
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getDisplayName(), getSelectedTaskArtifacts(), false);
+ if (success) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskRelatedStateAction = new Action("Edit Task Related to State", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ boolean success =
+ SMAManager.promptChangeAttribute(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE,
+ getSelectedTaskArtifacts(), false, true);
+ if (success) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskNotesAction = new Action("Edit Task Notes", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ boolean success =
+ SMAManager.promptChangeAttribute(ATSAttributes.SMA_NOTE_ATTRIBUTE, getSelectedTaskArtifacts(),
+ false, true);
+ if (success) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ addNewTaskAction = new Action("New Task", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ xTaskViewer.handleNewTask();
+ }
+ };
+
+ deleteTasksAction = new Action("Delete Task", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ xTaskViewer.handleDeleteTask();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ }
+
+ @Override
+ public void updateEditMenuActions() {
+ MenuManager mm = getMenuManager();
+
+ // EDIT MENU BLOCK
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskTitleAction);
+ editTaskTitleAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() == 1 && isSelectedTaskArtifactsAreInWork());
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskAssigneesAction);
+ editTaskAssigneesAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0 && isSelectedTaskArtifactsAreInWork());
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskStatusAction);
+ editTaskStatusAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0);
+
+ if (!isUsingTaskResolutionOptions()) {
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskResolutionAction);
+ editTaskResolutionAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0 && isSelectedTaskArtifactsAreInWork());
+ }
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskEstimateAction);
+ editTaskEstimateAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0 && isSelectedTaskArtifactsAreInWork());
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskRelatedStateAction);
+ editTaskRelatedStateAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0 && isSelectedTaskArtifactsAreInWork());
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_EDIT, editTaskNotesAction);
+ editTaskNotesAction.setEnabled(isTasksEditable() && getSelectedArtifacts().size() > 0);
+
+ }
+
+ @Override
+ public void updateMenuActions() {
+ super.updateMenuActions();
+ MenuManager mm = getMenuManager();
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_OPEN, new Separator());
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_OPEN, addNewTaskAction);
+ addNewTaskAction.setEnabled(isTasksEditable());
+
+ mm.insertBefore(WorldXViewer.MENU_GROUP_ATS_WORLD_OPEN, deleteTasksAction);
+ deleteTasksAction.setEnabled(isTasksEditable() && getSelectedTaskArtifacts().size() > 0);
+
+ }
+
+ public boolean handleChangeResolution() throws OseeCoreException {
+ if (isUsingTaskResolutionOptions()) {
+ if (SMAManager.promptChangeStatus(getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ return true;
+ }
+ } else if (SMAManager.promptChangeAttribute(ATSAttributes.RESOLUTION_ATTRIBUTE, getSelectedTaskArtifacts(),
+ false, false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifacts().toArray(), null);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem, boolean persist) {
+ if (!isTasksEditable()) {
+ AWorkbench.popup("ERROR", "Editing disabled for current state.");
+ return false;
+ }
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ SMAManager taskSmaMgr = new SMAManager((TaskArtifact) treeItem.getData());
+ boolean modified = false;
+ try {
+ if (isSelectedTaskArtifactsAreInWork() && xCol.equals(WorldXViewerFactory.Estimated_Hours_Col)) {
+ modified = taskSmaMgr.promptChangeFloatAttribute(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && xCol.equals(WorldXViewerFactory.Title_Col)) {
+ modified = taskSmaMgr.promptChangeAttribute(ATSAttributes.TITLE_ATTRIBUTE, false, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && xCol.equals(WorldXViewerFactory.Related_To_State_Col)) {
+ modified = taskSmaMgr.promptChangeAttribute(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE, false, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && xCol.equals(WorldXViewerFactory.Assignees_Col)) {
+ modified = taskSmaMgr.promptChangeAssignees();
+ } else if (isUsingTaskResolutionOptions() && (xCol.equals(WorldXViewerFactory.Hours_Spent_State_Col) || xCol.equals(WorldXViewerFactory.Hours_Spent_Total_Col) || xCol.equals(WorldXViewerFactory.Percent_Complete_State_Col) || xCol.equals(WorldXViewerFactory.Percent_Complete_Total_Col))) {
+ modified = handleChangeResolution();
+ } else if (isSelectedTaskArtifactsAreInWork() && xCol.equals(WorldXViewerFactory.Resolution_Col)) {
+ modified = handleChangeResolution();
+ } else if (xCol.equals(WorldXViewerFactory.Hours_Spent_State_Col) || xCol.equals(WorldXViewerFactory.Hours_Spent_Total_Col) || xCol.equals(WorldXViewerFactory.Percent_Complete_State_Col) || xCol.equals(WorldXViewerFactory.Percent_Complete_Total_Col)) {
+ modified = taskSmaMgr.promptChangeStatus(false);
+ } else
+ modified = super.handleAltLeftClick(treeColumn, treeItem, false);
+
+ if (modified) {
+ editor.onDirtied();
+ update((treeItem.getData()), null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ /**
+ * @return the tasksEditable
+ */
+ public boolean isTasksEditable() {
+ return tasksEditable;
+ }
+
+ /**
+ * @param tasksEditable the tasksEditable to set
+ */
+ public void setTasksEditable(boolean tasksEditable) {
+ this.tasksEditable = tasksEditable;
+ }
+
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, final LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().size() == 0) return;
+ // ContentProvider ensures in display thread
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ try {
+ WorldContentProvider contentProvider =
+ (WorldContentProvider) xTaskViewer.getTaskXViewer().getContentProvider();
+ if (contentProvider != null) {
+ contentProvider.remove(loadedArtifacts.getLoadedArtifacts());
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().size() == 0) return;
+ // ContentProvider ensures in display thread
+ ((WorldContentProvider) xTaskViewer.getTaskXViewer().getContentProvider()).remove(loadedArtifacts.getLoadedArtifacts());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.WorldXViewer#dispose()
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ super.dispose();
+ }
+
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (xTaskViewer.getTaskXViewer().getContentProvider() == null) return;
+ ((WorldContentProvider) xTaskViewer.getTaskXViewer().getContentProvider()).remove(transData.cacheDeletedArtifacts);
+ xTaskViewer.getTaskXViewer().update(transData.cacheChangedArtifacts, null);
+
+ try {
+ if (xTaskViewer.getIXTaskViewer().getParentSmaMgr() == null) {
+ return;
+ }
+ Artifact parentSma = xTaskViewer.getIXTaskViewer().getParentSmaMgr().getSma();
+ if (parentSma != null) {
+ // Add any new tasks related to parent sma
+ Collection<Artifact> artifacts =
+ transData.getRelatedArtifacts(parentSma.getArtId(),
+ AtsRelation.SmaToTask_Task.getRelationType().getRelationTypeId(),
+ AtsPlugin.getAtsBranch().getBranchId(), transData.cacheAddedRelations);
+ if (artifacts.size() > 0) {
+ ((WorldContentProvider) xTaskViewer.getTaskXViewer().getContentProvider()).add(artifacts);
+ }
+
+ // Remove any tasks related to parent sma
+ artifacts =
+ transData.getRelatedArtifacts(parentSma.getArtId(),
+ AtsRelation.SmaToTask_Task.getRelationType().getRelationTypeId(),
+ AtsPlugin.getAtsBranch().getBranchId(), transData.cacheDeletedRelations);
+ if (artifacts.size() > 0) {
+ ((WorldContentProvider) xTaskViewer.getTaskXViewer().getContentProvider()).remove(artifacts);
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewerFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewerFactory.java
new file mode 100644
index 00000000000..8f3fb573dbd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXViewerFactory.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.task;
+
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.ats.world.WorldXViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskXViewerFactory extends SkynetXViewerFactory {
+
+ public static final List<XViewerColumn> TaskViewerVisibleColumns =
+ Arrays.asList(WorldXViewerFactory.Title_Col, WorldXViewerFactory.State_Col, WorldXViewerFactory.Assignees_Col,
+ WorldXViewerFactory.Percent_Complete_Total_Col, WorldXViewerFactory.Total_Hours_Spent_Col,
+ WorldXViewerFactory.Resolution_Col, WorldXViewerFactory.Estimated_Hours_Col,
+ WorldXViewerFactory.Remaining_Hours_Col, WorldXViewerFactory.Related_To_State_Col,
+ WorldXViewerFactory.Notes_Col);
+ public static Integer[] widths = new Integer[] {450, 60, 150, 40, 40, 100, 50, 50, 50, 80, 80};
+
+ public TaskXViewerFactory() {
+ super("org.eclipse.osee.ats.TaskXViewer");
+ int widthIndex = 0;
+ // Create new column from world columns but set show and width for task
+ for (XViewerColumn taskCol : TaskViewerVisibleColumns) {
+ XViewerColumn newCol = taskCol.copy();
+ newCol.setShow(true);
+ newCol.setWidth(widths[widthIndex++]);
+ registerColumn(newCol);
+ }
+ // Add remaining columns from world columns
+ for (XViewerColumn worldCol : WorldXViewerFactory.WorldViewColumns) {
+ if (!TaskViewerVisibleColumns.contains(worldCol)) {
+ XViewerColumn newCol = worldCol.copy();
+ newCol.setShow(false);
+ registerColumn(newCol);
+ }
+ }
+ registerAllAttributeColumns();
+ }
+
+ @Override
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ return new WorldXViewerSorter(xViewer);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXWidgetActionPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXWidgetActionPage.java
new file mode 100644
index 00000000000..e35b077fd33
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/task/TaskXWidgetActionPage.java
@@ -0,0 +1,112 @@
+/*
+ * Created on Nov 16, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.task;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.AtsXWidgetActionFormPage;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskXWidgetActionPage extends AtsXWidgetActionFormPage {
+
+ private final TaskEditor taskEditor;
+ private TaskComposite taskComposite;
+ private static String HELP_CONTEXT_ID = "atsWorkflowEditorTaskTab";
+
+ /**
+ * @param editor
+ */
+ public TaskXWidgetActionPage(TaskEditor taskEditor) {
+ super(taskEditor, "org.eclipse.osee.ats.actionPage", "Actions");
+ this.taskEditor = taskEditor;
+ }
+
+ @Override
+ public Section createResultsSection(Composite body) throws OseeCoreException {
+ resultsSection = toolkit.createSection(body, Section.NO_TITLE);
+ resultsSection.setText("Results");
+ resultsSection.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ resultsContainer = toolkit.createClientContainer(resultsSection, 1);
+ taskComposite = new TaskComposite(taskEditor, resultsContainer, SWT.BORDER, toolBar);
+ AtsPlugin.getInstance().setHelp(taskComposite, HELP_CONTEXT_ID);
+ return resultsSection;
+ }
+
+ /**
+ * @return the taskComposite
+ */
+ public TaskComposite getTaskComposite() {
+ return taskComposite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ Result result = AtsPlugin.areOSEEServicesAvailable();
+ if (result.isFalse()) {
+ AWorkbench.popup("ERROR", "DB Connection Unavailable");
+ return;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#getDynamicWidgetLayoutListener()
+ */
+ @Override
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener() {
+ if (taskEditor.getTaskEditorProvider() instanceof TaskEditorParameterSearchItemProvider) {
+ if (((TaskEditorParameterSearchItemProvider) taskEditor.getTaskEditorProvider()).getWorldSearchItem() instanceof TaskEditorParameterSearchItem) {
+ return (((TaskEditorParameterSearchItemProvider) taskEditor.getTaskEditorProvider()).getWorldSearchItem());
+ }
+ }
+ return null;
+ }
+
+ public void reSearch() throws OseeCoreException {
+ taskEditor.handleRefreshAction();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#getXWidgetsXml()
+ */
+ @Override
+ public String getXWidgetsXml() throws OseeCoreException {
+ if (taskEditor.getTaskEditorProvider() instanceof TaskEditorParameterSearchItemProvider) {
+ if (((TaskEditorParameterSearchItemProvider) taskEditor.getTaskEditorProvider()).getWorldSearchItem() instanceof TaskEditorParameterSearchItem) {
+ return (((TaskEditorParameterSearchItemProvider) taskEditor.getTaskEditorProvider()).getWorldSearchItem()).getParameterXWidgetXml();
+ }
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#handleSearchButtonPressed()
+ */
+ @Override
+ public void handleSearchButtonPressed() {
+ try {
+ reSearch();
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java
new file mode 100644
index 00000000000..c4308f05040
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.util.Overview.PreviewStyle;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.util.email.EmailGroup;
+import org.eclipse.osee.framework.ui.skynet.util.email.EmailWizard;
+
+public class ArtifactEmailWizard extends EmailWizard {
+
+ public ArtifactEmailWizard(StateMachineArtifact sma) throws OseeCoreException {
+ this(sma, null);
+ }
+
+ public ArtifactEmailWizard(StateMachineArtifact sma, ArrayList<Object> toAddress) throws OseeCoreException {
+ super();
+ setInitialAddress(toAddress);
+ setHtmlMessage(sma.getPreviewHtml(PreviewStyle.HYPEROPEN, PreviewStyle.NO_SUBSCRIBE_OR_FAVORITE));
+ setSubject(" Regarding " + sma.getArtifactTypeName() + " - " + sma.getDescriptiveName());
+ setEmailableGroups(getEmailableGroups(sma));
+ }
+
+ private ArrayList<EmailGroup> getEmailableGroups(StateMachineArtifact sma) throws OseeCoreException {
+ return sma.getEmailableGroups();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java
new file mode 100644
index 00000000000..b26309f8973
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.ResultBrowserHyperCmd;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.ResultBrowserListener;
+import org.eclipse.swt.browser.LocationEvent;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsActionBrowserListener extends ResultBrowserListener {
+
+ public void changing(LocationEvent event) {
+ String location = event.location;
+ if (location.contains("javascript:print")) return;
+ String cmdStr = location.replaceFirst("about:blank", "");
+ cmdStr = cmdStr.replaceFirst("blank", "");
+ ResultBrowserHyperCmd resultBrowserHyperCmd = ResultBrowserHyperCmd.getCmdStrHyperCmd(cmdStr);
+ if (resultBrowserHyperCmd == ResultBrowserHyperCmd.openPriorityHelp) {
+ event.doit = false;
+ AtsPlugin.getInstance().getWorkbench().getHelpSystem().displayHelp(AtsPriority.PRIORITY_HELP_CONTEXT_ID);
+ }
+ super.changing(event);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java
new file mode 100644
index 00000000000..a01cfad5e3d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.IArtifactAnnotation;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsArtifactAnnotations implements IArtifactAnnotation {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IArtifactAnnotation#getAnnotations(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ public void getAnnotations(Artifact artifact, Set<ArtifactAnnotation> annotations) {
+ try {
+ if (artifact instanceof StateMachineArtifact) {
+ SMAManager smaMgr = new SMAManager((StateMachineArtifact) artifact);
+ Result result = smaMgr.getDeadlineMgr().isDeadlineDateAlerting();
+ if (result.isTrue()) annotations.add(ArtifactAnnotation.getWarning("org.eclipse.osee.ats.deadline",
+ result.getText()));
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java
new file mode 100644
index 00000000000..ae8705bc047
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactChecks.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.world.search.ActionableItemWorldSearchItem;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem;
+import org.eclipse.osee.ats.world.search.UserRelatedToAtsObjectSearch;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem.ReleasedOption;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.LoadView;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactCheck;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsArtifactChecks extends ArtifactCheck {
+
+ /**
+ * Check for certain conditions that must be met to delete an ATS object or User artifact.
+ */
+ public AtsArtifactChecks() {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IArtifactOperation#isDeleteable(java.util.Collection)
+ */
+ @Override
+ public Result isDeleteable(Collection<Artifact> artifacts) throws OseeCoreException {
+ // Check Actionable Items
+ Result result = checkActionableItems(artifacts);
+ if (result.isFalse()) return result;
+ // Check Team Definitions
+ result = checkTeamDefinitions(artifacts);
+ if (result.isFalse()) return result;
+ // Check VUE Workflow General Documents
+ result = checkAtsVueWorkflows(artifacts);
+ if (result.isFalse()) return result;
+ // Check User artifacts related to ATS SMAs
+ result = checkUsers(artifacts);
+ if (result.isFalse()) return result;
+
+ return Result.TrueResult;
+ }
+
+ public Result checkActionableItems(Collection<Artifact> artifacts) throws OseeCoreException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (Artifact art : artifacts) {
+ if (art instanceof ActionableItemArtifact) aias.add((ActionableItemArtifact) art);
+ }
+ if (aias.size() > 0) {
+ ActionableItemWorldSearchItem srch = new ActionableItemWorldSearchItem("AI search", aias, true, false, true);
+ if (srch.performSearchGetResults(false).size() > 0) {
+ return new Result(
+ "Actionable Items (or children AIs) selected to delete have related Team Workflows; Delete or re-assign Team Workflows first.");
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ public Result checkTeamDefinitions(Collection<Artifact> artifacts) throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (Artifact art : artifacts) {
+ if (art instanceof TeamDefinitionArtifact) teamDefs.add((TeamDefinitionArtifact) art);
+ }
+ if (teamDefs.size() > 0) {
+
+ TeamWorldSearchItem srch =
+ new TeamWorldSearchItem("Team Def search", teamDefs, true, false, true, null, null,
+ ReleasedOption.Both);
+ if (srch.performSearchGetResults(false).size() > 0) {
+ return new Result(
+ "Team Definition (or children Team Definitions) selected to delete have related Team Workflows; Delete or re-assign Team Workflows first.");
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ public Result checkAtsVueWorkflows(Collection<Artifact> artifacts) throws OseeCoreException {
+ for (Artifact art : artifacts) {
+ if (art.getArtifactTypeName().equals("General Document")) {
+ String ext = art.getSoleAttributeValue("Extension", "");
+ if (ext != null && ext.equals("vue")) {
+ if (art.getRelatedArtifacts(AtsRelation.TeamDefinitionToTaskWorkflowDiagram_TeamDefinition).size() > 0) return new Result(
+ "Team Workflow selected to delete has related Team Definition(s); Team Definitions to new Team Workflows first.");
+ }
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ public Result checkUsers(Collection<Artifact> artifacts) throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ for (Artifact art : artifacts) {
+ if (art instanceof User) users.add((User) art);
+ }
+ for (User user : users) {
+ UserRelatedToAtsObjectSearch srch =
+ new UserRelatedToAtsObjectSearch("User search", user, false, LoadView.None);
+ if (srch.performSearchGetResults().size() > 0) return new Result(
+ "User name: \"" + user.getDescriptiveName() + "\" userId: \"" + user.getUserId() + "\" selected to delete has related ATS Objects; Un-relate to ATS first before deleting.");
+
+ }
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java
new file mode 100644
index 00000000000..077fe31d44c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.BranchDoesNotExist;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.event.BranchEventType;
+import org.eclipse.osee.framework.skynet.core.event.IBranchEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+
+/**
+ * This class handles new branches and setting access control based on ATS workflows and their assignees
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsBranchAccessHandler implements IBranchEventListener {
+
+ private static AtsBranchAccessHandler atsBranchAccessHandler = new AtsBranchAccessHandler();
+
+ public static AtsBranchAccessHandler getInstance() {
+ return atsBranchAccessHandler;
+ }
+
+ private AtsBranchAccessHandler() {
+ OseeLog.log(AtsPlugin.class, Level.INFO, "Starting ATS Branch Access Handler");
+ OseeEventManager.addListener(this);
+ }
+
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleBranchEvent(org.eclipse.osee.framework.ui.plugin.event.Sender, org.eclipse.osee.framework.skynet.core.artifact.BranchModType, org.eclipse.osee.framework.skynet.core.artifact.Branch, int)
+ */
+ @Override
+ public void handleBranchEvent(Sender sender, BranchEventType branchModType, int branchId) {
+ try {
+ if (branchModType == BranchEventType.Added) {
+ Branch branch = BranchManager.getBranch(branchId);
+ Artifact artifact = branch.getAssociatedArtifact();
+ if (artifact instanceof StateMachineArtifact) {
+ ((StateMachineArtifact) artifact).getSmaMgr().getBranchMgr().updateBranchAccessControl();
+ }
+ }
+ // TODO Need to remove branch access control if branch deleted, archived, etc
+ } catch (BranchDoesNotExist ex) {
+ OseeLog.log(AtsPlugin.class, Level.INFO, ex);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IBranchEventListener#handleLocalBranchToArtifactCacheUpdateEvent(org.eclipse.osee.framework.ui.plugin.event.Sender)
+ */
+ @Override
+ public void handleLocalBranchToArtifactCacheUpdateEvent(Sender sender) {
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
new file mode 100644
index 00000000000..5bafeb2fe47
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchManager.java
@@ -0,0 +1,635 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.editor.IAtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.workflow.item.AtsAddDecisionReviewRule;
+import org.eclipse.osee.ats.workflow.item.AtsAddPeerToPeerReviewRule;
+import org.eclipse.osee.ats.workflow.item.StateEventType;
+import org.eclipse.osee.framework.db.connection.exception.BranchDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.MultipleAttributesExist;
+import org.eclipse.osee.framework.db.connection.exception.MultipleBranchesExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.db.connection.exception.TransactionDoesNotExist;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.access.AccessControlData;
+import org.eclipse.osee.framework.skynet.core.access.AccessControlManager;
+import org.eclipse.osee.framework.skynet.core.access.PermissionEnum;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.change.Change;
+import org.eclipse.osee.framework.skynet.core.conflict.ConflictManagerExternal;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeData;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeManager;
+import org.eclipse.osee.framework.skynet.core.revision.RevisionManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionId;
+import org.eclipse.osee.framework.skynet.core.transaction.TransactionIdManager;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.IExceptionableRunnable;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.branch.BranchView;
+import org.eclipse.osee.framework.ui.skynet.branch.CommitHandler;
+import org.eclipse.osee.framework.ui.skynet.dialogs.ListDialogSortable;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.TransactionIdLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.IBranchArtifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xchange.ChangeView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xcommit.CommitManagerView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xmerge.MergeView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * BranchManager contains methods necessary for ATS objects to interact with creation, view and commit of branches.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsBranchManager {
+ private final SMAManager smaMgr;
+ public static String BRANCH_CATEGORY = "Branch Changes";
+
+ public AtsBranchManager(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ public void setAsDefaultBranch() {
+ try {
+ if (!isWorkingBranch()) {
+ AWorkbench.popup("ERROR", "No Current Working Branch");
+ return;
+ }
+ BranchManager.setDefaultBranch(getWorkingBranch());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void showMergeManager() {
+ try {
+ if (!isWorkingBranch() && !isCommittedBranch()) {
+ AWorkbench.popup("ERROR", "No Current Working or Committed Branch");
+ return;
+ }
+ if (isWorkingBranch()) {
+ Branch branch = getParentBranchForWorkingBranchCreation();
+ if (branch == null) {
+ AWorkbench.popup("ERROR", "Can't access parent branch");
+ return;
+ }
+ MergeView.openView(getWorkingBranch(), branch,
+ TransactionIdManager.getStartEndPoint(getWorkingBranch()).getKey());
+
+ } else if (isCommittedBranch()) {
+ TransactionId transactionId = getTransactionIdOrPopupChoose();
+ if (transactionId == null) return;
+ MergeView.openView(transactionId);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * Opens the branch currently associated with this state machine artifact.
+ */
+ public void showWorkingBranch() {
+ try {
+ if (!isWorkingBranch()) {
+ AWorkbench.popup("ERROR", "No Current Working Branch");
+ return;
+ }
+ BranchView.revealBranch(getWorkingBranch());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public Integer getBranchId() throws OseeCoreException {
+ if (getWorkingBranch() == null) return null;
+ return getWorkingBranch().getBranchId();
+ }
+
+ /**
+ * If working branch has no changes, allow for deletion.
+ */
+ public void deleteEmptyWorkingBranch() {
+ try {
+ Branch branch = getWorkingBranch();
+ if (branch.hasChanges()) {
+ if (!MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Delete Branch with Changes",
+ "Warning: Changes have been made on this branch.\n\nAre you sure you want to delete the branch: " + branch)) return;
+ } else if (!MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Delete Branch", "Are you sure you want to delete the branch: " + branch)) {
+ }
+ Job job = BranchManager.deleteBranch(branch);
+ job.join();
+
+ AWorkbench.popup("Delete Complete", "Deleted Branch Successfully");
+
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Problem deleting branch.", ex, true);
+ }
+ }
+
+ /**
+ * @return TransactionId associated with this state machine artifact
+ */
+ public Collection<TransactionId> getTransactionIds() throws OseeCoreException {
+ List<TransactionId> transactionIds = new ArrayList<TransactionId>();
+ try {
+ for (Integer transIdInt : RevisionManager.getInstance().getTransactionDataPerCommitArtifact(smaMgr.getSma())) {
+ transactionIds.add(TransactionIdManager.getTransactionId(transIdInt));
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ // there may be times where the transaction id cache is not up-to-date yet; don't throw error
+ }
+ return transactionIds;
+ }
+
+ public TransactionId getEarliestTransactionId() throws OseeCoreException {
+ Collection<TransactionId> transactionIds = getTransactionIds();
+ if (transactionIds.size() == 1) return transactionIds.iterator().next();
+ TransactionId earliestTransactionId = transactionIds.iterator().next();
+ for (TransactionId transactionId : transactionIds) {
+ if (transactionId.getTransactionNumber() < earliestTransactionId.getTransactionNumber()) {
+ earliestTransactionId = transactionId;
+ }
+ }
+ return earliestTransactionId;
+ }
+
+ public TransactionId getTransactionIdOrPopupChoose() throws OseeCoreException {
+ Collection<TransactionId> transactionIds = getTransactionIds();
+ if (transactionIds.size() == 1) {
+ return transactionIds.iterator().next();
+ }
+ ListDialogSortable ld = new ListDialogSortable(Display.getCurrent().getActiveShell());
+ ld.setContentProvider(new ArrayContentProvider());
+ ld.setLabelProvider(new TransactionIdLabelProvider());
+ ld.setSorter(new ViewerSorter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ if (((TransactionId) e1).getTransactionNumber() < ((TransactionId) e2).getTransactionNumber()) {
+ return -1;
+ } else if (((TransactionId) e1).getTransactionNumber() > ((TransactionId) e2).getTransactionNumber()) {
+ return 1;
+ }
+ return 0;
+ }
+ });
+ ld.setTitle("Select Transaction");
+ ld.setMessage("Select Transaction");
+ ld.setInput(transactionIds);
+ if (ld.open() == 0) {
+ return (TransactionId) ld.getResult()[0];
+ }
+ return null;
+ }
+
+ /**
+ * Display change report associated with the branch, if exists, or transaction, if branch has been committed.
+ */
+ public void showChangeReport() {
+ try {
+ if (isWorkingBranch()) {
+ ChangeView.open(getWorkingBranch());
+ } else if (isCommittedBranch()) {
+ TransactionId transactionId = getTransactionIdOrPopupChoose();
+ if (transactionId == null) return;
+ ChangeView.open(transactionId);
+ } else {
+ AWorkbench.popup("ERROR", "No Branch or Committed Transaction Found.");
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't show change report.", ex, true);
+ }
+ }
+
+ /**
+ * Display change report associated with the branch, if exists, or transaction, if branch has been committed.
+ */
+ public void showCommitManager() {
+ try {
+ if (smaMgr.getBranchMgr().getWorkingBranch() == null) {
+ AWorkbench.popup("ERROR", "No working branch");
+ } else if (!(smaMgr.getSma() instanceof IBranchArtifact)) {
+ AWorkbench.popup("ERROR", "Not IBranchArtifact");
+ } else
+ CommitManagerView.openViewUpon((IBranchArtifact) smaMgr.getSma());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * Return working branch associated with SMA; This data is cached across all workflows with the cache being updated
+ * by local and remote events.
+ *
+ * @return Branch
+ */
+ public Branch getWorkingBranch() throws OseeCoreException {
+ Set<Branch> branches = BranchManager.getAssociatedArtifactBranches(smaMgr.getSma());
+ if (branches.size() == 0) {
+ return null;
+ } else if (branches.size() > 1) {
+ throw new MultipleBranchesExist(
+ "Unexpected multiple associated working branches found for workflow " + smaMgr.getSma().getHumanReadableId());
+ } else {
+ return branches.iterator().next();
+ }
+ }
+
+ /**
+ * @return true if there is a current working branch
+ */
+ public boolean isWorkingBranch() throws OseeCoreException {
+ return getWorkingBranch() != null;
+ }
+
+ /**
+ * @return true if there are committed changes associated with this state machine artifact
+ */
+ public boolean isCommittedBranch() throws OseeCoreException {
+ return (getTransactionIds().size() > 0);
+ }
+
+ /**
+ * Set parent branch id associated with this state machine artifact
+ *
+ * @param branchId
+ * @throws MultipleAttributesExist
+ */
+ public void setParentBranchId(int branchId) throws OseeCoreException {
+ smaMgr.getSma().setSoleAttributeValue(ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName(),
+ String.valueOf(branchId));
+ }
+
+ /**
+ * Perform error checks and popup confirmation dialogs associated with creating a working branch.
+ *
+ * @param pageId if specified, WorkPage gets callback to provide confirmation that branch can be created
+ * @param popup if true, errors are popped up to user; otherwise sent silently in Results
+ * @return Result return of status
+ */
+ public Result createWorkingBranch(String pageId, boolean popup) {
+ try {
+ if (isCommittedBranch()) {
+ if (popup) AWorkbench.popup("ERROR",
+ "Can not create another working branch once changes have been committed.");
+ return new Result("Committed branch already exists.");
+ }
+ Branch parentBranch = getParentBranchForWorkingBranchCreation();
+ if (parentBranch == null) {
+ String errorStr =
+ "Parent Branch can not be determined.\n\nPlease specify " + "parent branch through Version Artifact or Team Definition Artifact.\n\n" + "Contact your team lead to configure this.";
+ if (popup) AWorkbench.popup("ERROR", errorStr);
+ return new Result(errorStr);
+ }
+ // Retrieve parent branch to create working branch from
+ if (popup && !MessageDialog.openConfirm(
+ Display.getCurrent().getActiveShell(),
+ "Create Working Branch",
+ "Create a working branch from parent branch\n\n\"" + parentBranch.getBranchName() + "\"?\n\n" + "NOTE: Working branches are necessary when OSEE Artifact changes " + "are made during implementation.")) return Result.FalseResult;
+ createWorkingBranch(pageId, parentBranch);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Result("Exception occurred: " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ private void createNecessaryBranchEventReviews(StateEventType stateEventType, SMAManager smaMgr, SkynetTransaction transaction) throws OseeCoreException {
+ if (stateEventType != StateEventType.CommitBranch && stateEventType != StateEventType.CreateBranch) {
+ throw new OseeStateException("Invalid stateEventType = " + stateEventType);
+ }
+ // Create any decision and peerToPeer reviews for createBranch and commitBranch
+ for (String ruleId : Arrays.asList(AtsAddDecisionReviewRule.ID, AtsAddPeerToPeerReviewRule.ID)) {
+ for (WorkRuleDefinition workRuleDef : smaMgr.getWorkRulesStartsWith(ruleId)) {
+ StateEventType eventType = AtsAddDecisionReviewRule.getStateEventType(smaMgr, workRuleDef);
+ if (eventType != null && eventType == stateEventType) {
+ if (ruleId.equals(AtsAddDecisionReviewRule.ID)) {
+ DecisionReviewArtifact decArt = AtsAddDecisionReviewRule.createNewDecisionReview(workRuleDef, smaMgr);
+ if (decArt != null) decArt.persistAttributesAndRelations(transaction);
+ } else if (ruleId.equals(AtsAddPeerToPeerReviewRule.ID)) {
+ PeerToPeerReviewArtifact peerArt =
+ AtsAddPeerToPeerReviewRule.createNewPeerToPeerReview(workRuleDef, smaMgr, transaction);
+ if (peerArt != null) peerArt.persistAttributesAndRelations(transaction);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * @return Branch that is the configured branch to create working branch from.
+ */
+ private Branch getParentBranchForWorkingBranchCreation() throws OseeCoreException {
+ Branch parentBranch = null;
+
+ // Check for parent branch id in Version artifact
+ if (smaMgr.isTeamUsesVersions()) {
+ VersionArtifact verArt = smaMgr.getTargetedForVersion();
+ if (verArt != null) {
+ try {
+ Integer branchId =
+ verArt.getSoleAttributeValue(ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName(), 0);
+ if (branchId != null && branchId > 0) {
+ parentBranch = BranchManager.getBranch(branchId);
+ }
+ } catch (BranchDoesNotExist ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ // If not defined in version, check for parent branch from team definition
+ if (parentBranch == null && (smaMgr.getSma() instanceof TeamWorkFlowArtifact)) {
+ try {
+ Integer branchId =
+ ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getSoleAttributeValue(
+ ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName());
+ if (branchId != null && branchId > 0) {
+ parentBranch = BranchManager.getBranch(branchId);
+ }
+ } catch (OseeCoreException ex) {
+ // do nothing
+ }
+ }
+
+ // If not defined, return null
+ return parentBranch;
+ }
+
+ /**
+ * Create a working branch associated with this state machine artifact. This should NOT be called by applications
+ * except in test cases or automated tools. Use createWorkingBranchWithPopups
+ *
+ * @param pageId
+ * @param parentBranch
+ * @throws Exception
+ */
+ public void createWorkingBranch(String pageId, final Branch parentBranch) throws OseeCoreException {
+ final Artifact stateMachineArtifact = smaMgr.getSma();
+ String title = stateMachineArtifact.getDescriptiveName();
+ if (title.length() > 40) title = title.substring(0, 39) + "...";
+ final String branchName =
+ String.format("%s - %s - %s", stateMachineArtifact.getHumanReadableId(),
+ stateMachineArtifact.getDescriptiveName(), title);
+ String branchShortName = "";
+ if (pageId != null && !pageId.equals("")) {
+ List<IAtsStateItem> stateItems = smaMgr.getStateItems().getStateItems(pageId);
+ if (stateItems.size() > 0) {
+ branchShortName = (stateItems.iterator().next().getBranchShortName(smaMgr));
+ }
+ }
+ final String finalBranchShortName = branchShortName;
+
+ IExceptionableRunnable runnable = new IExceptionableRunnable() {
+ public void run(IProgressMonitor monitor) throws OseeCoreException {
+ BranchManager.createWorkingBranch(parentBranch, finalBranchShortName, branchName, stateMachineArtifact);
+ // Create reviews as necessary
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ createNecessaryBranchEventReviews(StateEventType.CreateBranch, smaMgr, transaction);
+ transaction.execute();
+ }
+ };
+
+ Jobs.run("Create Branch", runnable, AtsPlugin.class, AtsPlugin.PLUGIN_ID);
+ }
+
+ public void updateBranchAccessControl() throws OseeCoreException {
+ // Only set/update branch access control if state item is configured to accept
+ for (IAtsStateItem stateItem : smaMgr.getStateItems().getCurrentPageStateItems(smaMgr)) {
+ if (stateItem.isAccessControlViaAssigneesEnabledForBranching()) {
+ Branch branch = getWorkingBranch();
+ if (branch != null) {
+ for (AccessControlData acd : AccessControlManager.getInstance().getAccessControlList(branch)) {
+ // If subject is NOT an assignee, remove access control
+ if (!smaMgr.getStateMgr().getAssignees().contains(acd.getSubject())) {
+ AccessControlManager.getInstance().removeAccessControlData(acd);
+ }
+ }
+ // If subject doesn't have access, add it
+ for (User user : smaMgr.getStateMgr().getAssignees())
+ AccessControlManager.getInstance().setPermission(user, branch, PermissionEnum.FULLACCESS);
+ }
+ }
+ }
+ }
+
+ private final class AtsCommitJob extends Job {
+ private final boolean commitPopup;
+ private final boolean overrideStateValidation;
+
+ /**
+ * @param name
+ * @param commitPopup
+ * @param overrideStateValidation
+ */
+ public AtsCommitJob(boolean commitPopup, boolean overrideStateValidation) {
+ super("Commit Branch");
+ this.commitPopup = commitPopup;
+ this.overrideStateValidation = overrideStateValidation;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ Branch branch = getWorkingBranch();
+ if (branch == null) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID,
+ "Commit Branch Failed: Can not locate branch for workflow " + smaMgr.getSma().getHumanReadableId());
+ }
+
+ // If team uses versions, then validate that the parent branch id is specified by either
+ // the team definition's attribute or the related version's attribute
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact) {
+ // Only perform checks if team definition uses ATS versions
+ TeamWorkFlowArtifact team = (TeamWorkFlowArtifact) smaMgr.getSma();
+ if (team.getTeamDefinition().isTeamUsesVersions()) {
+
+ // Confirm that team is targeted for version
+ if (team.getWorldViewTargetedVersion() == null) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, String.format(
+ "Commit Branch Failed: Workflow \"%s\" must be targeted for a version.",
+ smaMgr.getSma().getHumanReadableId()));
+ }
+
+ // Validate that a parent branch is specified in ATS configuration
+ Branch parentBranch = getParentBranchForWorkingBranchCreation();
+ if (parentBranch == null) {
+ return new Status(
+ Status.ERROR,
+ AtsPlugin.PLUGIN_ID,
+ String.format(
+ "Commit Branch Failed: Workflow \"%s\" can't access parent branch to commit to.\n\nSince the configured Team Definition uses versions, the parent branch must be specified in either the targeted Version Artifact or the Team Definition Artifact.",
+ smaMgr.getSma().getHumanReadableId()));
+ }
+
+ // Validate that the configured parentBranch is the same as the working branch's
+ // parent branch.
+ Integer targetedVersionBranchId = parentBranch.getBranchId();
+ Integer workflowWorkingBranchParentBranchId =
+ smaMgr.getBranchMgr().getWorkingBranch().getParentBranchId();
+ if (!targetedVersionBranchId.equals(workflowWorkingBranchParentBranchId)) {
+ return new Status(
+ Status.ERROR,
+ AtsPlugin.PLUGIN_ID,
+ String.format(
+ "Commit Branch Failed: Workflow \"%s\" targeted version \"%s\" branch id \"%s\" does not match branch's " + "parent branch id \"%s\"",
+ smaMgr.getSma().getHumanReadableId(),
+ team.getWorldViewTargetedVersion().getDescriptiveName(),
+ String.valueOf(targetedVersionBranchId),
+ String.valueOf(workflowWorkingBranchParentBranchId)));
+ }
+ }
+ }
+
+ // Confirm that all blocking reviews are completed
+ // Loop through this state's blocking reviews to confirm complete
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviewsFromCurrentState()) {
+ if (reviewArt.getReviewBlockType() == ReviewBlockType.Commit && !reviewArt.getSmaMgr().isCancelledOrCompleted()) {
+ return new Status(
+ Status.ERROR,
+ AtsPlugin.PLUGIN_ID,
+ "Blocking Review must be completed before commit.\n\nReview Title: \"" + reviewArt.getDescriptiveName() + "\"\nHRID: " + reviewArt.getHumanReadableId());
+ }
+ }
+
+ if (!overrideStateValidation) {
+ // Check extenstion points for valid commit
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(smaMgr.getWorkPageDefinition().getId())) {
+ Result tempResult = item.committing(smaMgr);
+ if (tempResult.isFalse()) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, tempResult.getText());
+ }
+ }
+ }
+
+ commit(commitPopup, branch);
+ } catch (OseeCoreException ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, ex.getLocalizedMessage(), ex);
+ }
+ return Status.OK_STATUS;
+ }
+
+ private void commit(boolean commitPopup, Branch branch) throws OseeCoreException {
+ boolean branchCommitted = false;
+ ConflictManagerExternal conflictManager = new ConflictManagerExternal(branch.getParentBranch(), branch);
+
+ if (commitPopup) {
+ branchCommitted = CommitHandler.commitBranch(conflictManager, true);
+ } else {
+ BranchManager.commitBranch(conflictManager, true, true);
+ branchCommitted = true;
+ }
+ if (branchCommitted) {
+ // Create reviews as necessary
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ createNecessaryBranchEventReviews(StateEventType.CommitBranch, smaMgr, transaction);
+ transaction.execute();
+ }
+ }
+ }
+
+ /**
+ * @param commitPopup if true, popup errors associated with results
+ * @param overrideStateValidation if true, don't do checks to see if commit can be performed. This should only be
+ * used for developmental testing or automation
+ */
+ public void commitWorkingBranch(final boolean commitPopup, final boolean overrideStateValidation) {
+ Jobs.startJob(new AtsCommitJob(commitPopup, overrideStateValidation));
+ }
+
+ /**
+ * Since change data for a committed branch is not going to change, cache it per run instance of OSEE
+ */
+ private static final Map<TransactionId, ChangeData> changeDataCacheForCommittedBranch =
+ new HashMap<TransactionId, ChangeData>();
+
+ public ChangeData getChangeData() throws OseeCoreException {
+ ChangeData changeData = null;
+ if (smaMgr.getBranchMgr().isWorkingBranch()) {
+ changeData = ChangeManager.getChangeDataPerBranch(getWorkingBranch(), null);
+ } else if (smaMgr.getBranchMgr().isCommittedBranch()) {
+ TransactionId transactionId = getEarliestTransactionId();
+ if (changeDataCacheForCommittedBranch.get(transactionId) == null) {
+ changeDataCacheForCommittedBranch.put(transactionId, ChangeManager.getChangeDataPerTransaction(
+ transactionId, null));
+ }
+ changeData = changeDataCacheForCommittedBranch.get(transactionId);
+ } else {
+ changeData = new ChangeData(new ArrayList<Change>());
+ }
+ return changeData;
+ }
+
+ /**
+ * @return true if isWorkingBranch() and changes exist else false
+ * @throws TransactionDoesNotExist
+ * @throws BranchDoesNotExist
+ */
+ public Boolean isChangesOnWorkingBranch() throws OseeCoreException {
+ if (isWorkingBranch()) {
+ return ChangeManager.isChangesOnWorkingBranch(getWorkingBranch());
+ }
+ return false;
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBulkLoad.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBulkLoad.java
new file mode 100644
index 00000000000..e16a99edc68
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBulkLoad.java
@@ -0,0 +1,29 @@
+/*
+ * Created on Sep 3, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+
+/**
+ * Convenience methods to bulk load ATS objects based on currently held objects
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsBulkLoad {
+
+ public static void loadFromActions(Collection<? extends Artifact> actions) throws OseeCoreException {
+ RelationManager.getRelatedArtifacts(actions, 4, AtsRelation.SmaToTask_Task,
+ AtsRelation.ActionToWorkflow_WorkFlow, AtsRelation.TeamWorkflowToReview_Review);
+ }
+
+ public static void loadFromTeamWorkflows(Collection<? extends Artifact> teams) throws OseeCoreException {
+ RelationManager.getRelatedArtifacts(teams, 3, AtsRelation.SmaToTask_Task, AtsRelation.TeamWorkflowToReview_Team,
+ AtsRelation.ActionToWorkflow_Action);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java
new file mode 100644
index 00000000000..1027f0279a3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.core.client.server.HttpRequest;
+import org.eclipse.osee.framework.core.client.server.HttpResponse;
+import org.eclipse.osee.framework.core.client.server.HttpUrlBuilder;
+import org.eclipse.osee.framework.core.client.server.IHttpServerRequest;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsHttpServerRequest implements IHttpServerRequest {
+
+ private static AtsHttpServerRequest instance = new AtsHttpServerRequest();
+
+ public AtsHttpServerRequest() {
+ super();
+ }
+
+ public static AtsHttpServerRequest getInstance() {
+ return instance;
+ }
+
+ public String getUrl(Artifact artifact) {
+ Map<String, String> keyValues = new HashMap<String, String>();
+ String guid = artifact.getGuid();
+ if (Strings.isValid(guid)) {
+ keyValues.put("guid", guid);
+ }
+ return HttpUrlBuilder.getInstance().getUrlForLocalSkynetHttpServer(getRequestType(), keyValues);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.linking.IHttpServerRequest#processRequest(org.eclipse.osee.framework.skynet.core.linking.HttpRequest,
+ * org.eclipse.osee.framework.skynet.core.linking.HttpResponse)
+ */
+ public void processRequest(HttpRequest httpRequest, HttpResponse httpResponse) {
+ String guid = httpRequest.getParameter("guid");
+ try {
+ final Artifact artifact = ArtifactQuery.getArtifactFromId(guid, AtsPlugin.getAtsBranch());
+ if (artifact instanceof IATSArtifact) {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ public void run() {
+ AtsLib.openAtsAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ });
+ }
+ String html =
+ AHTML.simplePage("Action has been opened in OSEE ATS<br><br>" + "<form><input type=button onClick='window.opener=self;window.close()' value='Close'></form>");
+ httpResponse.getPrintStream().println(html);
+ } catch (Exception ex) {
+ httpResponse.outputStandardError(400, "Exception handling request", ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.linking.IHttpServerRequest#getRequestType()
+ */
+ public String getRequestType() {
+ return "ATS";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java
new file mode 100644
index 00000000000..665dc1b682f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java
@@ -0,0 +1,281 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewAction;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowLabelProvider;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.config.BulkLoadAtsCache;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.task.TaskEditor;
+import org.eclipse.osee.ats.task.TaskEditorSimpleProvider;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.ats.IAtsLib;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.dialogs.ListDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsLib implements IAtsLib {
+
+ public AtsLib() {
+ super();
+ }
+
+ public static Composite createCommonPageComposite(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout(1, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ layout.verticalSpacing = 0;
+ composite.setLayout(layout);
+
+ return composite;
+ }
+
+ public static ToolBar createCommonToolBar(Composite parent) {
+ return createCommonToolBar(parent, null);
+ }
+
+ public static ToolBar createCommonToolBar(Composite parent, XFormToolkit toolkit) {
+ Composite toolBarComposite = new Composite(parent, SWT.BORDER);
+ GridData gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, false, 1, 1);
+ toolBarComposite.setLayoutData(gridData);
+ if (toolkit != null) toolkit.adapt(toolBarComposite);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ toolBarComposite.setLayout(layout);
+
+ ToolBar toolBar = new ToolBar(toolBarComposite, SWT.FLAT | SWT.RIGHT);
+ gridData = new GridData(SWT.FILL, SWT.BEGINNING, true, true, 1, 1);
+ toolBar.setLayoutData(gridData);
+ if (toolkit != null) toolkit.adapt(toolBar);
+ return toolBar;
+ }
+
+ /**
+ * @param <A>
+ * @param artifacts to iterate through
+ * @param active state to validate against; Both will return all artifacts matching type
+ * @param clazz type of artifacts to consider
+ * @return set of Artifacts of type clazz that match the given active state of the "Active" attribute value. If no
+ * attribute exists, Active == true; If does exist then attribute value "yes" == true, "no" == false.
+ */
+ @SuppressWarnings("unchecked")
+ public static <A extends Artifact> Set<A> getActiveSet(Collection<A> artifacts, Active active, Class<? extends Artifact> clazz) throws OseeCoreException {
+ Set<A> results = new HashSet<A>();
+ for (Artifact art : artifacts) {
+ if ((art.getClass().equals(clazz)) && art.isAttributeTypeValid(ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName())) {
+ if (active == Active.Both)
+ results.add((A) art);
+ else {
+ // Ats config Artifact is Active unless otherwise specified
+ boolean attributeActive =
+ ((A) art).getSoleAttributeValue(ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName(), false);
+ if (active == Active.Active && attributeActive) {
+ results.add((A) art);
+ } else if (active == Active.InActive && !attributeActive) {
+ results.add((A) art);
+ }
+ }
+ }
+ }
+ return results;
+ }
+
+ public boolean isAtsAdmin() {
+ return AtsPlugin.isAtsAdmin();
+ }
+
+ public static String doubleToStrString(double d) {
+ return doubleToStrString(d, false);
+ }
+
+ public static String doubleToStrString(double d, boolean blankIfZero) {
+ if (blankIfZero && d == 0)
+ return "";
+ else
+ return String.format("%5.2f", d);
+ }
+
+ public static void editActionActionableItems(ActionArtifact actionArt) throws OseeCoreException {
+ Result result = actionArt.addActionableItems();
+ if (result.isFalse() && result.getText().equals("")) return;
+ if (result.isFalse()) result.popup(result.isTrue());
+ }
+
+ public static void editTeamActionableItems(TeamWorkFlowArtifact teamArt) throws OseeCoreException {
+ Result result = teamArt.addActionableItems();
+ if (result.isFalse() && result.getText().equals("")) return;
+ if (result.isFalse() && !result.getText().equals("")) result.popup(result.isTrue());
+ }
+
+ public static void open(String guid, OseeAts.OpenView view) {
+ (new AtsLib()).openArtifact(guid, view);
+ }
+
+ public void openArtifact(String guidOrHrid, Integer branchId, OseeAts.OpenView view) {
+ try {
+ Branch branch = BranchManager.getBranch(branchId);
+ Artifact artifact = ArtifactQuery.getArtifactFromId(guidOrHrid, branch);
+ openAtsAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * Only to be used by browser. Use open (artifact) instead.
+ *
+ * @param guid
+ */
+ public void openArtifact(String guid, OseeAts.OpenView view) {
+ BulkLoadAtsCache.run(false);
+ Artifact artifact = null;
+ try {
+ artifact = ArtifactQuery.getArtifactFromId(guid, AtsPlugin.getAtsBranch());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return;
+ }
+
+ if (view == OseeAts.OpenView.ActionEditor) {
+ if ((artifact instanceof StateMachineArtifact) || (artifact instanceof ActionArtifact))
+ openATSAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ else
+ ArtifactEditor.editArtifact(artifact);
+ } else if (view == OseeAts.OpenView.ArtifactEditor) {
+ ArtifactEditor.editArtifact(artifact);
+ } else if (view == OseeAts.OpenView.ArtifactHyperViewer) {
+ AWorkbench.popup("ERROR", "Unimplemented");
+ }
+ }
+
+ public static void createAtsAction(String initialDescription, String actionableItem) {
+ (new AtsLib()).createATSAction(initialDescription, actionableItem);
+ }
+
+ public void createATSAction(String initialDescription, String actionableItemName) {
+ // Ensure actionable item is configured for ATS before continuing
+ try {
+ AtsCache.getSoleArtifactByName(actionableItemName, VersionArtifact.class);
+ } catch (ArtifactDoesNotExist ex) {
+ AWorkbench.popup(
+ "Configuration Error",
+ "Actionable Item \"" + actionableItemName + "\" is not configured for ATS tracking.\n\nAction can not be created.");
+ return;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return;
+ }
+
+ NewAction newAction = new NewAction(actionableItemName);
+ newAction.setInitialDescription(initialDescription);
+ newAction.run();
+ }
+
+ public static void openAtsAction(final Artifact art, final AtsOpenOption option) {
+ (new AtsLib()).openATSAction(art, option);
+ }
+
+ public void openATSAction(final Artifact art, final AtsOpenOption option) {
+ try {
+ if (art instanceof ActionArtifact) {
+ ActionArtifact actionArt = (ActionArtifact) art;
+ Collection<TeamWorkFlowArtifact> teams = actionArt.getTeamWorkFlowArtifacts();
+ if (option == AtsOpenOption.OpenAll)
+ for (TeamWorkFlowArtifact team : teams)
+ SMAEditor.editArtifact(team);
+ else if (option == AtsOpenOption.AtsWorld)
+ WorldEditor.open(new WorldEditorSimpleProvider("Action " + actionArt.getHumanReadableId(),
+ Arrays.asList(actionArt)));
+ else if (option == AtsOpenOption.OpenOneOrPopupSelect) {
+ if (teams.size() == 1)
+ SMAEditor.editArtifact(teams.iterator().next());
+ else {
+ TeamWorkFlowArtifact teamArt = promptSelectTeamWorkflow(actionArt);
+ if (teamArt != null)
+ SMAEditor.editArtifact((Artifact) teamArt);
+ else
+ return;
+ }
+ }
+ } else
+ SMAEditor.editArtifact(art);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public static TeamWorkFlowArtifact promptSelectTeamWorkflow(ActionArtifact actArt) throws OseeCoreException {
+ ListDialog ld = new ListDialog(Display.getCurrent().getActiveShell());
+ ld.setContentProvider(new ArrayContentProvider());
+ ld.setLabelProvider(new TeamWorkflowLabelProvider());
+ ld.setTitle("Select Team Workflow");
+ ld.setMessage("Select Team Workflow");
+ ld.setInput(actArt.getTeamWorkFlowArtifacts());
+ if (ld.open() == 0) {
+ if (ld.getResult().length == 0)
+ AWorkbench.popup("Error", "No Workflow Selected");
+ else
+ return (TeamWorkFlowArtifact) ld.getResult()[0];
+ }
+ return null;
+ }
+
+ @Override
+ public void openInAtsWorldEditor(String name, Collection<Artifact> artifacts) throws OseeCoreException {
+ WorldEditor.open(new WorldEditorSimpleProvider(name, artifacts));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ats.IAtsLib#openInAtsTaskEditor(java.lang.String, java.util.Collection)
+ */
+ @Override
+ public void openInAtsTaskEditor(String name, Collection<Artifact> artifacts) throws OseeCoreException {
+ TaskEditor.open(new TaskEditorSimpleProvider(name, artifacts));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsNotifyUsers.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsNotifyUsers.java
new file mode 100644
index 00000000000..a666b90cc6b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsNotifyUsers.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationEvent;
+import org.eclipse.osee.framework.ui.skynet.notify.OseeNotificationManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsNotifyUsers {
+
+ private static boolean testing = false; // Email goes to current user (set OseeNotifyUsersJob.testing also)
+ public static enum NotifyType {
+ Subscribed, Cancelled, Completed, Assigned, Originator
+ };
+
+ public static void notify(StateMachineArtifact sma, NotifyType... notifyTypes) throws OseeCoreException {
+ notify(sma, null, notifyTypes);
+ }
+
+ public static void notify(StateMachineArtifact sma, Collection<User> notifyUsers, NotifyType... notifyTypes) throws OseeCoreException {
+ if (testing) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE,
+ "AtsNotifyUsers: testing is enabled....turn off for production.");
+ }
+ if (!testing && (!AtsPlugin.isEmailEnabled() || !AtsPlugin.isProductionDb() || sma.getDescriptiveName().startsWith(
+ "tt "))) {
+ return;
+ }
+ List<NotifyType> types = Collections.getAggregate(notifyTypes);
+
+ SMAManager smaMgr = sma.getSmaMgr();
+ if (types.contains(NotifyType.Originator)) {
+ User originator = smaMgr.getOriginator();
+ if (!UserManager.getUser().equals(originator)) OseeNotificationManager.addNotificationEvent(new OseeNotificationEvent(
+ Arrays.asList(originator),
+ getIdString(sma),
+ NotifyType.Originator.name(),
+ "You have been set as the originator of \"" + sma.getArtifactTypeName() + "\" titled \"" + sma.getDescriptiveName() + "\""));
+ }
+ if (types.contains(NotifyType.Assigned)) {
+ Collection<User> assignees = notifyUsers != null ? notifyUsers : smaMgr.getStateMgr().getAssignees();
+ assignees.remove(UserManager.getUser());
+ if (testing || assignees.size() > 0) {
+ OseeNotificationManager.addNotificationEvent(new OseeNotificationEvent(
+ assignees,
+ getIdString(sma),
+ NotifyType.Assigned.name(),
+ "You have been set as an assignee for \"" + sma.getArtifactTypeName() + "\" titled \"" + sma.getDescriptiveName() + "\""));
+ }
+ }
+ if (types.contains(NotifyType.Subscribed)) {
+ Collection<User> subscribed = sma.getSubscribed();
+ if (subscribed.size() > 0) {
+ OseeNotificationManager.addNotificationEvent(new OseeNotificationEvent(
+ subscribed,
+ getIdString(sma),
+ NotifyType.Subscribed.name(),
+ sma.getArtifactTypeName() + " titled \"" + sma.getDescriptiveName() + "\" transitioned to \"" + sma.getSmaMgr().getStateMgr().getCurrentStateName() + "\" and you subscribed for notification."));
+ }
+ }
+ if (types.contains(NotifyType.Cancelled) || types.contains(NotifyType.Completed)) {
+ if (((sma instanceof TeamWorkFlowArtifact) || (sma instanceof ReviewSMArtifact)) && (smaMgr.isCompleted() || smaMgr.isCancelled())) {
+ User originator = smaMgr.getOriginator();
+ if (!UserManager.getUser().equals(originator)) {
+ if (smaMgr.isCompleted()) {
+ OseeNotificationManager.addNotificationEvent(new OseeNotificationEvent(
+ Arrays.asList(originator),
+ getIdString(sma),
+ NotifyType.Completed.name(),
+ "\"" + sma.getArtifactTypeName() + "\" titled \"" + sma.getDescriptiveName() + "\" is Completed"));
+ }
+ if (smaMgr.isCancelled()) {
+ LogItem cancelledItem = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ OseeNotificationManager.addNotificationEvent(new OseeNotificationEvent(
+ Arrays.asList(originator),
+ getIdString(sma),
+ NotifyType.Cancelled.name(),
+ String.format(
+ sma.getArtifactTypeName() + " titled \"" + sma.getDescriptiveName() + "\" was cancelled from the \"%s\" state on \"%s\".<br>Reason: \"%s\"",
+ cancelledItem.getState(), cancelledItem.getDate(XDate.MMDDYYHHMM), cancelledItem.getMsg())));
+ }
+ }
+ }
+ }
+ }
+
+ private static String getIdString(StateMachineArtifact sma) {
+ try {
+ String legacyPcrId = sma.getWorldViewLegacyPCR();
+ if (!legacyPcrId.equals("")) {
+ return "HRID: " + sma.getHumanReadableId() + " / LegacyId: " + legacyPcrId;
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return "HRID: " + sma.getHumanReadableId();
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPreSaveCacheRemoteEventHandler.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPreSaveCacheRemoteEventHandler.java
new file mode 100644
index 00000000000..de9e6038802
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPreSaveCacheRemoteEventHandler.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+
+/**
+ * This class handles updating ATS state machine artifacts based on remote events that change the assignees. Without
+ * this, the client will think it changed the assignees if the artifact is saved after the remote modified event.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsPreSaveCacheRemoteEventHandler implements IFrameworkTransactionEventListener {
+
+ private static AtsPreSaveCacheRemoteEventHandler instance = new AtsPreSaveCacheRemoteEventHandler();
+
+ public static AtsPreSaveCacheRemoteEventHandler getInstance() {
+ return instance;
+ }
+
+ private AtsPreSaveCacheRemoteEventHandler() {
+ OseeLog.log(AtsPlugin.class, Level.INFO, "Starting ATS Pre-Save Remote Event Handler");
+ OseeEventManager.addListener(this);
+ }
+
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ for (Artifact artifact : transData.cacheChangedArtifacts) {
+ if (artifact instanceof StateMachineArtifact) {
+ ((StateMachineArtifact) artifact).initalizePreSaveCache();
+ }
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java
new file mode 100644
index 00000000000..2365a068202
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPriority {
+
+ public static String PRIORITY_HELP_CONTEXT_ID = "atsPriority";
+
+ public static enum PriorityType {
+ None(""), Priority_1("1"), Priority_2("2"), Priority_3("3"), Priority_4("4"), Priority_5("5");
+
+ private final String shortName;
+
+ private PriorityType(String shortName) {
+ this.shortName = shortName;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public static String[] getPriorities() {
+ String priorities[] = new String[PriorityType.values().length];
+ int x = 0;
+ for (PriorityType pri : PriorityType.values())
+ priorities[x++] = pri.toString();
+ return priorities;
+ }
+
+ public static String[] getPrioritiesWithoutNone() {
+ String priorities[] = new String[PriorityType.values().length - 1];
+ int x = 0;
+ for (PriorityType pri : PriorityType.values())
+ if (pri != PriorityType.None) priorities[x++] = pri.toString();
+ return priorities;
+ }
+
+ @Override
+ public String toString() {
+ return shortName;
+ }
+
+ public static PriorityType getPriority(String type) throws OseeCoreException {
+ if (type == null || type.equals("")) return PriorityType.None;
+ for (PriorityType pri : PriorityType.values()) {
+ if (type.equals(pri.getShortName())) return pri;
+ }
+ throw new OseeStateException("Invalid priority => " + type);
+ }
+
+ };
+
+ public static void openHelp() {
+ AtsPlugin.getInstance().displayHelp(PRIORITY_HELP_CONTEXT_ID);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelation.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelation.java
new file mode 100644
index 00000000000..aa567cd1ac0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsRelation.java
@@ -0,0 +1,115 @@
+/*
+ * Created on Jun 10, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util;
+
+import org.eclipse.osee.framework.db.connection.exception.OseeDataStoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeTypeDoesNotExist;
+import org.eclipse.osee.framework.skynet.core.relation.IRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.relation.RelationType;
+import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum AtsRelation implements IRelationEnumeration {
+
+ // ATS Relations
+ ActionToWorkflow_Action(true, "ActionToWorkflow"),
+ ActionToWorkflow_WorkFlow(false, "ActionToWorkflow"),
+ //
+ TeamActionableItem_Team(true, "TeamActionableItem"),
+ TeamActionableItem_ActionableItem(false, "TeamActionableItem"),
+ //
+ TeamLead_Team(true, "TeamLead"),
+ TeamLead_Lead(false, "TeamLead"),
+ //
+ TeamMember_Team(true, "TeamMember"),
+ TeamMember_Member(false, "TeamMember"),
+ //
+ SmaToTask_Sma(true, "SmaToTask"),
+ SmaToTask_Task(false, "SmaToTask"),
+ //
+ TeamWorkflowTargetedForVersion_Workflow(true, "TeamWorkflowTargetedForVersion"),
+ TeamWorkflowTargetedForVersion_Version(false, "TeamWorkflowTargetedForVersion"),
+ //
+ TeamDefinitionToVersion_TeamDefinition(true, "TeamDefinitionToVersion"),
+ TeamDefinitionToVersion_Version(false, "TeamDefinitionToVersion"),
+ //
+ TeamDefinitionToWorkflowDiagram_TeamDefinition(true, "TeamDefinitionToWorkflowDiagram"),
+ TeamDefinitionToWorkflowDiagram_WorkflowDiagram(false, "TeamDefinitionToWorkflowDiagram"),
+ //
+ TeamDefinitionToTaskWorkflowDiagram_TeamDefinition(true, "TeamDefinitionToTaskWorkflowDiagram"),
+ TeamDefinitionToTaskWorkflowDiagram_WorkflowDiagram(false, "TeamDefinitionToTaskWorkflowDiagram"),
+ //
+ TeamDefinitionToDecisionReviewWorkflowDiagram_TeamDefinition(true, "TeamDefinitionToDecisionReviewWorkflowDiagram"),
+ TeamDefinitionToDecisionReviewWorkflowDiagram_WorkflowDiagram(false, "TeamDefinitionToDecisionReviewWorkflowDiagram"),
+ //
+ TeamDefinitionToPeerToPeerReviewWorkflowDiagram_TeamDefinition(true, "TeamDefinitionToPeerToPeerReviewWorkflowDiagram"),
+ TeamDefinitionToPeerToPeerReviewWorkflowDiagram_WorkflowDiagram(false, "TeamDefinitionToPeerToPeerReviewWorkflowDiagram"),
+ //
+ TeamWorkflowToReview_Team(true, "TeamWorkflowToReview"),
+ TeamWorkflowToReview_Review(false, "TeamWorkflowToReview"),
+ //
+ Supercedes_Supercedes(true, "Supercedes"),
+ Supercedes_Superceded(false, "Supercedes"),
+ AddressesIssues_AddressesIssues(true, "Addresses Issues"),
+ AddressesIssues_IssuedArtifact(false, "Addresses Issues"),
+ SupportingInfo_SupportedBy(true, "Supporting Info"),
+ SupportingInfo_SupportingInfo(false, "Supporting Info"),
+ //
+ WorkItem__Parent(true, "Work Item"),
+ WorkItem__Child(false, "Work Item"),
+ //
+ SubscribedUser_Artifact(true, "SubscribedUser"),
+ SubscribedUser_User(false, "SubscribedUser"),
+ FavoriteUser_Artifact(true, "FavoriteUser"),
+ FavoriteUser_User(false, "FavoriteUser");
+
+ private final RelationSide relationSide;
+ private String typeName;
+
+ private AtsRelation(boolean sideA, String typeName) {
+ this.relationSide = sideA ? RelationSide.SIDE_A : RelationSide.SIDE_B;
+ this.typeName = typeName;
+ }
+
+ /**
+ * @return Returns the sideName.
+ */
+ @Deprecated
+ public boolean isSideA() {
+ return relationSide.isSideA();
+ }
+
+ public String getSideName() throws OseeTypeDoesNotExist, OseeDataStoreException {
+ return getRelationType().getSideName(relationSide);
+ }
+
+ /**
+ * @return Returns the typeName.
+ */
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public RelationType getRelationType() throws OseeTypeDoesNotExist, OseeDataStoreException {
+ return RelationTypeManager.getType(typeName);
+ }
+
+ public boolean isThisType(RelationLink link) {
+ return link.getRelationType().getTypeName().equals(typeName);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.relation.IRelationEnumeration#getSide()
+ */
+ @Override
+ public RelationSide getSide() {
+ return relationSide;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsSearchOption.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsSearchOption.java
new file mode 100644
index 00000000000..ac8b622bb06
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsSearchOption.java
@@ -0,0 +1,14 @@
+/*
+ * Created on Nov 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util;
+
+/**
+ * @author Donald G. Dunne
+ *
+ */
+public enum AtsSearchOption {
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java
new file mode 100644
index 00000000000..d3012b968e7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Date;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DeadlineManager {
+
+ private final SMAManager smaMgr;
+
+ public DeadlineManager(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ public Date getDeadlineDate() {
+ try {
+ return ((IWorldViewArtifact) smaMgr.getSma()).getWorldViewDeadlineDate();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return null;
+ }
+
+ public boolean isDeadlineDateSet() {
+ return getDeadlineDate() != null;
+ }
+
+ public Result isDeadlineDateOverdue() throws OseeCoreException {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return Result.FalseResult;
+ if ((new Date()).after(getDeadlineDate())) return new Result(true, "Deadline Date has past.");
+ return Result.FalseResult;
+ }
+
+ public Result isDeadlinePastRelease() {
+ try {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return Result.FalseResult;
+ Date deadDate = getDeadlineDate();
+ if (deadDate == null) return Result.FalseResult;
+ Date releaseDate = smaMgr.getSma().getWorldViewEstimatedReleaseDate();
+ if (releaseDate == null) return Result.FalseResult;
+ if (releaseDate.after(deadDate)) return new Result(true, "Deadline Date is past current Release Date.");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return Result.FalseResult;
+ }
+
+ public Result isDeadlineDateAlerting() throws OseeCoreException {
+ if (!isDeadlineDateSet()) return Result.FalseResult;
+ Result r = isDeadlineDateOverdue();
+ if (r.isTrue()) return r;
+ r = isDeadlinePastRelease();
+ if (r.isTrue()) return r;
+ return Result.FalseResult;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItem.java
new file mode 100644
index 00000000000..62e4eddb7bf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DoesNotWorkItem.java
@@ -0,0 +1,437 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DoesNotWorkItem extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public DoesNotWorkItem(XNavigateItem parent) {
+ super(parent, "Does Not Work - convertAtsLogUserIds");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws OseeCoreException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+
+ // for (Artifact art : ArtifactQuery.getArtifactsFromAttributeType("ats.Branch Id", AtsPlugin.getAtsBranch())) {
+ // int branchId = art.getSoleAttributeValue("ats.Branch Id");
+ // Branch branch = null;
+ // try {
+ // branch = BranchManager.getBranch(branchId);
+ // } catch (BranchDoesNotExist ex) {
+ // System.out.println("Branch does not exist for art " + art.getHumanReadableId() + " - " + art);
+ // } catch (Exception ex) {
+ // System.err.println("Exception getting branch for art " + art.getHumanReadableId() + " - " + art);
+ // }
+ // if (branch != null) {
+ // System.err.println("Branch DOES exist for art " + art.getHumanReadableId() + " - " + art);
+ // }
+ // }
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ // convertAtsLogUserIds();
+ transaction.execute();
+
+ // deleteUnAssignedUserRelations();
+ // relateDonDunne();
+
+ // testDeleteAttribute();
+ // deleteNullUserAttributes();
+ // XNavigateItem item = AtsNavigateViewItems.getInstance().getSearchNavigateItems().get(1);
+ // System.out.println("Item " + item.getName());
+ // NavigateView.getNavigateView().handleDoubleClick(item);
+
+ // XResultData.runExample();
+
+ // fixOseePeerReviews();
+
+ AWorkbench.popup("Completed", "Complete");
+ }
+
+ private void convertAtsLogUserIds() throws OseeCoreException {
+ List<String> hrids =
+ Arrays.asList("PJDYM", "PMFNE", "1L94Y", "XV5XA", "TLP5H", "PXJ16", "M01RT", "YQ8P1", "2JDND", "XVM2A",
+ "V3XW6", "JDNP5", "3BKPH", "L9VM4", "AR3RE", "W36HM", "2DW26", "M2W9Y", "WWSPY", "64TP4", "WN457",
+ "Q3WLG", "MW57B", "Z9TYH", "U0JHV", "3LHN0", "PBC3S", "4B08D", "KKHLF", "7DRQP", "UP4LB", "KZ25J",
+ "2GJ71", "FVRCC", "YP2BF", "W9D1C", "P7VGE", "WC39K");
+ for (Artifact art : ArtifactQuery.getArtifactsFromIds(hrids, AtsPlugin.getAtsBranch())) {
+ String str = art.getSoleAttributeValue(ATSAttributes.LOG_ATTRIBUTE.getStoreName(), null);
+ str = str.replaceAll("rj236c", "1779483");
+ art.setSoleAttributeFromString(ATSAttributes.LOG_ATTRIBUTE.getStoreName(), str);
+ art.persistAttributes();
+ }
+ }
+
+ private void importTaskEstimatedHours() throws OseeCoreException {
+ System.out.println("Processing " + hrids.size() + " hrids.");
+ Map<String, String> hridHourMap = new HashMap<String, String>();
+ List<String> justHrids = new ArrayList<String>();
+ for (String str : hrids) {
+ String strs[] = str.split(",");
+ hridHourMap.put(strs[0], strs[1]);
+ justHrids.add(strs[0]);
+ }
+ // bulk load
+ List<Artifact> arts = ArtifactQuery.getArtifactsFromIds(justHrids, AtsPlugin.getAtsBranch());
+ // set
+ int x = 1;
+ for (String hrid : hridHourMap.keySet()) {
+ System.out.println("Processing " + x++ + "/" + hridHourMap.size() + "...");
+ boolean found = false;
+ for (Artifact art : arts) {
+ if (hrid.equals(art.getHumanReadableId())) {
+ System.out.println("setting value " + hridHourMap.get(hrid) + " on " + hrid + " for " + art);
+ if (art instanceof TaskArtifact) {
+ art.setSoleAttributeFromString(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(),
+ hridHourMap.get(hrid));
+ art.persistAttributes();
+ }
+ found = true;
+ }
+ }
+ if (!found) {
+ System.err.println("can't find hrid " + hrid);
+ }
+ }
+ }
+
+ private final List<String> hrids =
+ Arrays.asList("399T4,35", "6P2T3,35", "RHXXY,35", "V4248,35", "QWFR2,35", "PP650,35", "HJXNY,35", "5LTLK,35",
+ "20FVD,14", "7RTPQ,14", "77693,14", "KN3S7,13", "KSC49,13", "GVDPM,13", "JYH60,13", "JX1S3,13",
+ "8D73E,13", "MDFYU,13", "XHLV3,13", "2MB4S,13", "B9T99,13", "03QZB,151", "3RC9K,151", "Q114C,213",
+ "0WRPY,213", "ANZTF,30", "XX2J0,30", "8WRM5,30", "BDZVF,30", "DPZ2Q,30", "GFM5W,30", "4TP2N,30",
+ "K4NMA,30", "EMCVC,30", "T984F,30", "AL8W5,30", "2L071,30", "YDRJT,30", "E0F06,30", "X9GGG,30",
+ "Q4QCG,30", "KVSSJ,30", "4NW5K,30", "19WW1,30", "MNC8N,30", "J1Z48,17", "U6W8U,17", "PJDYM,17",
+ "VCR3P,17", "RC9QS,17", "WWPGB,17", "W2VQL,17", "ZYYQ6,17", "6KF0K,17", "PPH4Y,17", "0QS8W,17",
+ "31T23,17", "SJVNJ,17", "U3R18,17", "1FGX1,17", "37S6D,17", "G2VTQ,17", "0KC60,17", "0G7QZ,17",
+ "ES0KP,17", "G83T8,17", "FX1BN,17", "TGHQB,17", "TDWTL,17", "R97GY,17", "YTWDP,17", "FJ34Z,17",
+ "F6SS2,17", "BXK88,17", "YLFBX,17", "P9DKR,17", "MJKJ8,17", "ZZV3W,17", "AFR90,17", "70GKC,17",
+ "ZY4W5,22", "U9H58,22", "9713S,22", "83XVW,22", "59B9X,22", "TQD1J,22", "UVM7U,22", "HZT73,22",
+ "C49Q5,22", "DJ0TL,22", "BZQW2,22", "CGV1R,22", "W0VTD,22", "T8B4K,22", "YTNLC,22", "D82X9,22",
+ "TYDDH,22", "77W65,22", "YVGTP,22", "WNKFE,7", "6WZV3,7", "NSY6A,7", "SXNLT,7", "0NF9B,7", "7CDJA,7",
+ "HB9MS,7", "S88PK,7", "UVRZT,7", "PCLCY,7", "2NP06,7", "V4N2T,7", "1KGR6,7", "75392,7", "FD0C5,7",
+ "T2TFB,7", "WJ6NH,7", "4GDT0,7", "VH2B1,7", "W7JVA,7", "S8RQB,7", "L2T4K,7", "ARRM3,7", "J0N84,7",
+ "TTJKJ,7", "5H84J,7", "6DKP0,7", "ZRVVZ,7", "LD2BR,7", "ZDLGA,7", "4RWSY,7", "21QHH,7", "0CYBA,7",
+ "0H2N2,7", "1YHBK,7", "ZNC7P,7", "W6K3W,7", "N71XD,7", "6FNWS,7", "B1MDF,7", "TTVLB,7", "7J50J,7",
+ "3WGY5,7", "CBL80,7", "BR01T,7", "3LFL0,7", "SCCR6,7", "ZGXH1,7", "7B10T,7", "2ZVFW,7", "NS0CZ,7",
+ "R45F3,7", "7GBL2,7", "NLYFY,7", "V4HP0,7", "DF3G4,7", "0R2W1,7", "U15RW,7", "W43M4,7", "4HV1E,7",
+ "J5QN7,7", "8NVX5,7", "X8BV5,7", "NMJZM,7", "01MM6,7", "AY7DC,7", "UM6QN,7", "03X73,151", "MNGRR,151",
+ "HLCSP,13", "CP90F,13", "D5LF0,13", "GC2SE,13", "UWKDB,13", "D4V98,13", "51Q5N,13", "WWG9V,13",
+ "6SQN0,13", "1PVN8,13", "4P3JS,13", "ZRQC3,13", "WSG86,13", "8Y55U,13", "UTD8U,13", "0SVJ7,13",
+ "EPMSD,13", "APGFN,13", "8ZJJQ,13", "HWSBG,13", "21GD8,13", "PDX4S,13", "H9SLF,13", "KRP4H,13",
+ "VDJY0,13", "MTHCL,13", "36V43,13", "B9YYN,13", "PS4Z8,13", "7BPBB,13", "BC32M,13", "1WJFK,13",
+ "S4XGU,50", "VS6BW,50", "TQP3F,50", "TTS28,50", "ASGYK,50", "R1SBR,50", "8LNB0,50", "B6NHU,50",
+ "MG5YL,50", "88ZH9,50", "Q6V9M,14", "SX750,14", "JZ8HA,14", "PBSVB,14", "XTQJG,14", "WSB6S,14",
+ "LRBB5,14", "V1V0D,14", "8M0YA,14", "XF395,14", "VYW5R,14", "Y1P7S,14", "44GZ1,14", "AH3SH,14",
+ "NGPMC,14", "8CKRA,14", "K6SMV,14", "5XRF9,14", "NCG43,14", "Z6FFY,14", "JLZZH,14", "6XG3B,14",
+ "10WDV,14", "S7G2F,14", "QGJWD,14", "MDLRE,14", "D34T8,13", "T3DQF,13", "F912Y,13", "81FL9,13",
+ "D9KJX,13", "FB7DB,13", "PPNVC,13", "YPPX8,13", "X5YMQ,13", "WZFLA,13", "87XPD,13", "FTDJ3,13",
+ "QJ6NV,13", "E3Z97,13", "9L4XP,13", "9Y91S,13", "XP2C0,13", "H2YCT,13", "NVJPL,13", "TN43S,13",
+ "RBDM8,13", "BYH8H,49", "BQDVW,49", "GW6PA,49", "D9DDT,29", "55T2F,29", "GYD62,29", "N08QD,29",
+ "HN7YN,29", "U07B6,29", "4DGMF,29", "9ZZR7,29", "Z64PF,29", "AVCMB,29", "3Q50K,29", "7XCTX,29",
+ "JR477,29", "1Q8QG,29", "8L8S6,29", "L9CVL,29", "NCXNS,29", "WDSB4,29", "1GMLX,29", "G30ZM,29",
+ "2YV6K,29", "WQ901,29", "E7RB1,29", "3W1PK,29", "7T7RQ,29", "VS88V,29", "9YZNX,29", "1M98D,29",
+ "GD6PP,29", "DN7T7,29", "UCVCT,29", "99CGN,1", "RRVX0,1", "DSL72,1", "7KJ75,1", "6G7VU,1", "4MGF5,1",
+ "1894F,1", "KC0X8,1", "CZHJA,1", "0J5PF,1", "S87P9,1", "6LTBP,1", "3V56J,1", "VC0D1,1", "4HTZG,1",
+ "BK1HA,11", "QZDBP,11", "F1SWC,11", "77J6W,11", "ZXKM4,11", "WS0CF,11", "KRV72,11", "LG4JB,11",
+ "J523M,11", "FXRJ8,76", "1H51N,76", "SLQZA,76", "708D0,76", "C2400,6", "1WNCE,6", "L5RKX,6", "JH05U,6",
+ "BPNZS,6", "1XYVD,6", "BN6WR,6", "25LFC,10", "99TK0,10", "WH2MC,10", "AH18V,10", "1X9RQ,10", "VZK9H,10",
+ "V2L1T,10", "JNZDX,5", "FK7T6,5", "CX1VE,5", "8LB3W,15", "5VYSD,15", "PB93A,6", "RYVD0,6", "LN7WW,6",
+ "EVL2Y,5", "46NKP,5", "5K739,5", "N0TP6,5", "XGHKK,5", "LC1ZF,5", "GFZRF,5", "RDSV7,5", "23X4K,5",
+ "E760Y,5", "4PJVW,5", "GK7TF,5", "BNF16,5", "CK80S,5", "WW3X4,5", "BG49U,5", "160L5,5", "AST8G,5",
+ "ZQZMM,5", "EK0RU,5", "Q02F1,5", "VTBC6,5", "9Q38P,5", "AMJQC,5", "ESWZC,10", "6HLFP,10", "AX7PV,10",
+ "35WYM,10", "UPCWT,10", "G10YV,10", "ZHDG2,10", "QYSNX,10", "V23MS,10", "6BW1U,10", "13XZW,10",
+ "H8DDQ,10", "4YZK2,10", "GRCHF,10", "RN41F,10", "88WVR,10", "FGVY4,10", "LB8ZA,10", "2FJR6,10",
+ "FPG95,10", "Y7CR7,10", "PK4QK,10", "D3YMF,10", "ZSRND,10", "AYBJL,6", "A3V1E,6", "0F4Y2,6", "QRPSB,6",
+ "SSGK1,6", "44LX9,6", "EWF0F,6", "C26JA,6", "WRPT2,6", "LXSR1,6", "E54SS,6", "HSJ95,6", "UQJ75,6",
+ "JY495,6", "3J1YU,6", "5PK2F,6", "2GQC4,6", "A6XXX,6", "BG4KT,56", "EQVDW,7", "G09Y2,7", "MMG5T,7",
+ "AZLMR,7", "GBCSK,7", "TW0WS,7", "QMYSS,7", "0CJX1,7", "MN655,7", "R5J3R,7", "ED2YP,7", "9W45V,7",
+ "CVWFC,7", "0XJZJ,7", "YX5LX,7", "8S14Q,7", "TYR2Z,7", "C7HB0,7", "PSR58,7", "9G4XZ,7", "6MTQM,7",
+ "GGM8A,7", "KTDJU,7", "Z7YP7,7", "64LS8,7", "3JF3Y,7", "7ZM49,7", "332K2,7", "TCRNU,7", "WWXXE,7",
+ "51FZW,7", "0DCNP,7", "50347,34", "B9TK0,4", "1BRZ9,4", "1P2NH,4", "HJKJ7,4", "FVYLW,4", "5DDQX,4",
+ "BBS9Y,4", "SWTFM,4", "HWCTA,4", "Y35Y8,4", "04HFF,4", "G58HZ,4", "0KH3N,4", "UQBP4,4", "4XV19,4",
+ "J7WVM,4", "VSB15,4", "7811F,4", "M01RT,7", "2GJ71,7", "XVM2A,7", "KKHLF,7", "MBCXV,7", "YJFKC,7",
+ "2F461,7", "NL677,7", "ZK6PX,7", "Y1DGP,7", "XY45X,7", "PBC3S,7", "L9VM4,7", "K6ZGD,7", "EXMT0,7",
+ "W1TS8,7", "JM3RD,7", "BR2RN,7", "P7VGE,7", "W36HM,7", "WN457,7", "YQ8P1,7", "HPQJX,7", "QN2K3,7",
+ "77F2U,7", "WTMBA,7", "BH5JS,7", "V4Q50,7", "M2W9Y,7", "2DW26,7", "2P5GC,7", "YK58N,7", "LWVT1,7",
+ "KCGSQ,7", "5X2WL,7", "C8HWW,7", "NKYBF,2", "RHCPY,2", "Y00N1,2", "537LE,2", "6M4KK,2", "T5GDL,2",
+ "C1YHA,2", "75WQE,2", "LT3V2,2", "P0TRV,2", "WC39K,2", "HZL1C,2", "7Q0W3,2", "1SRBE,2", "PVBCZ,2",
+ "WS487,2", "LDJMH,2", "6PWYH,2", "9557A,2", "SQQ6T,2", "TCZWZ,2", "X5PCF,2", "T43DQ,6", "CNLKQ,6",
+ "Y5TQZ,6", "AJLRZ,6", "G8ZH7,6", "5GVBK,6", "ZGKR1,6", "SNR7U,2", "UYWFC,2", "TWH3B,2", "SQ15H,2",
+ "KXMFU,2", "8FVQF,1", "YS6ZH,1", "79RGK,1", "L7BBV,1", "Q1494,1", "KYV1J,1", "XQ0MB,1", "UXN28,1",
+ "FLK65,1", "2CSSJ,1", "GHX2J,1", "76KQG,1", "45GCD,1", "FQZGD,1", "10RSZ,1", "7FNZP,1", "8VRQY,1",
+ "41SC8,1", "UWDD9,1", "701Q5,1", "RGRX0,1", "33D0N,1", "V55RU,1", "0C7VR,1", "YTFQR,1", "HQ2YH,1",
+ "H1H5J,1", "91K17,1", "SG10Q,1", "SQR45,1", "0QGNU,1", "KTGGK,1", "XSPB3,1", "M33GH,1", "A53T1,3",
+ "G2JRU,3", "UZ6PR,3", "BJMFU,3", "1Z6D2,3", "GR6YN,3", "6SVQ2,3", "ZC7RL,3", "1PTQ4,3", "0B3MC,3",
+ "F2MVZ,3", "0BFNL,3", "8LW2D,3", "GD159,3", "7DX0S,3", "RB0H3,63", "2V840,3", "TNP0P,3", "BYJVP,3",
+ "KM0VD,3", "KYBCQ,3", "X6QZ1,3", "QV779,3", "78S6F,3", "VHJ5K,3", "1QT05,3", "6WVGY,3", "PRBLA,12",
+ "QRJZ8,12", "D95Z4,12", "7FYVN,12", "86VP1,12", "04X73,6", "4RYSQ,6", "WT5NN,6", "UJCC9,6", "H0HNU,3",
+ "K7S33,4", "W39HA,4", "PWWYH,4", "LWKGW,4", "W2574,4", "N6BDV,4", "8FFD0,4", "8MJ4L,4", "ML53C,4",
+ "EH5TF,6", "PNV30,6", "0274D,6", "JFDDF,6", "J1VX1,1", "6G1P3,1", "7HS88,1", "4KFJF,1", "Z1TTU,6",
+ "DCK4Q,6", "KH41K,6", "AQ6QL,6", "M5DK8,6", "15B04,6", "L7WXH,1", "SYFG7,1", "7VHWC,1", "C772E,1",
+ "CGH9R,1", "9XJLJ,1", "UPFKK,1", "BKCQF,3", "6SQ8E,3", "KXC1N,3", "BMYS3,3", "G91ZT,3", "L30S5,3",
+ "FKBVJ,3", "2Q7SW,3", "02BX6,3", "41B5P,3", "LHQXH,1", "FR6H4,2", "75QB5,2", "V5FM9,2", "S9G4V,2",
+ "6MZX6,2", "D7JKM,2", "J1QYY,2", "QXYT8,2", "ZGSYB,2", "2J2TC,2", "8B97M,25", "BD3NF,7", "61VBM,7",
+ "NPCR7,7", "8633F,7", "6N0T5,7", "C2BL7,7", "340TD,7", "QLS36,7", "8FCZL,3", "H6CPS,3", "909FR,3",
+ "M76WE,3", "74CK3,6", "Y08RQ,6", "E5139,6", "35NJN,6", "BZL4L,3", "X7YPS,3", "LZG97,3", "TK8KH,3",
+ "P0M07,3", "N93KW,3", "5KT0Z,3", "XRLWH,3", "P3105,3", "N29J6,11", "BV8ZV,11", "H7V6E,11", "CM7SL,11",
+ "LG8BZ,11", "HF29R,11", "L7H25,11", "3ZGQE,11", "J074N,6", "S6K60,4", "DTMWX,4", "CX07C,4", "GGY0Q,4",
+ "CW47J,4", "SGFCY,4", "0QDPW,4", "SSV09,4", "N7J5X,4", "GG87F,4", "FJ7N3,7", "PY3ZT,6");
+
+ private void fixTestTaskResolutions() throws OseeCoreException {
+ System.out.println("Started fixTestTaskResolutions...");
+ for (Artifact artifact : ArtifactQuery.getArtifactsFromAttributeType(
+ ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), AtsPlugin.getAtsBranch())) {
+ if (artifact instanceof TaskArtifact) {
+ TaskArtifact taskArt = (TaskArtifact) artifact;
+ String resolution =
+ ((TaskArtifact) artifact).getSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(),
+ null);
+ if (resolution == null) {
+ System.err.println("Unexpected null resolution." + taskArt.getHumanReadableId());
+ // taskArt.deleteSoleAttribute(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ // taskArt.persistAttributes();
+ } else {
+ String newResolution = null;
+ if (resolution.equals("Need_DTE_Test")) {
+ System.out.println("Rename Need_DTE_Test to In_DTE_Test " + taskArt.getHumanReadableId());
+ newResolution = "In_DTE_Test";
+ } else if (resolution.equals("Awaiting_Code_Fix")) {
+ System.out.println("Rename Awaiting_Code_Fix to Awaiting_Code " + taskArt.getHumanReadableId());
+ newResolution = "Awaiting_Code";
+ } else if (resolution.equals("Awaiting_Review")) {
+ System.out.println("Rename Awaiting_Review to In_DTE_Test " + taskArt.getHumanReadableId());
+ newResolution = "In_DTE_Test";
+ } else if (resolution.equals("Unit_Tested")) {
+ System.out.println("Rename Unit_Tested to In_DTE_Test " + taskArt.getHumanReadableId());
+ newResolution = "In_DTE_Test";
+ }
+ if (newResolution != null) {
+ taskArt.setSoleAttributeFromString(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), newResolution);
+ taskArt.persistAttributes();
+ }
+ }
+ }
+ }
+ System.out.println("Completed fixTestTaskResolutions...");
+ }
+
+ // private void deleteUnAssignedUserRelations() throws OseeCoreException {
+ // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsPlugin.getAtsBranch()) {
+ //
+ // @Override
+ // protected void handleTxWork() throws OseeCoreException {
+ // User unassignedUser = SkynetAuthentication.getUser(UserEnum.UnAssigned);
+ // for (Artifact art : unassignedUser.getRelatedArtifacts(CoreRelationEnumeration.Users_Artifact)) {
+ // if (art instanceof StateMachineArtifact) {
+ // unassignedUser.deleteRelation(CoreRelationEnumeration.Users_Artifact, art);
+ // }
+ // }
+ // unassignedUser.persistRelations();
+ // }
+ // };
+ // newActionTx.execute();
+ // }
+
+ private final boolean fixIt = false;
+
+ // public void cleanXViewerCustomizations() throws OseeCoreException {
+ // for (User user : SkynetAuthentication.getUsers()) {
+ // System.out.println("User: " + user);
+ //
+ // SkynetUserArtifactCustomizeDefaults custDefaults = new SkynetUserArtifactCustomizeDefaults(user);
+ //
+ // // Get all customizations
+ // List<String> customizations = user.getAttributesToStringList("XViewer Customization");
+ // if (customizations.size() == 0 && custDefaults.size() == 0) continue;
+ // Set<String> validGuids = new HashSet<String>();
+ // int currNumDefaults = custDefaults.getGuids().size();
+ // for (String custStr : new CopyOnWriteArrayList<String>(customizations)) {
+ // CustomizeData custData = new CustomizeData(custStr);
+ // validGuids.add(custData.getGuid());
+ //
+ // // check for old customizations to remove
+ // boolean orderFound = custStr.contains("<order>");
+ // boolean namespaceNullFound = custStr.contains("namespace=\"null\"");
+ // if (orderFound || namespaceNullFound) {
+ // System.err.println("Removing " + (orderFound ? "<order>" : "namespace==null") + " customizations " + custData.getGuid());
+ // validGuids.remove(custData.getGuid());
+ // custDefaults.removeDefaultCustomization(custData);
+ // customizations.remove(custStr);
+ // } else {
+ // // Check for sort columns that are hidden
+ // for (String columnName : custData.getSortingData().getSortingNames()) {
+ // XViewerColumn xCol = custData.getColumnData().getXColumn(columnName);
+ // if (xCol == null) {
+ // System.err.println("sort column not found \"" + columnName + "\" - " + custData.getGuid());
+ // } else if (xCol.isShow() == false) {
+ // System.err.println("sort col is hidden \"" + columnName + "\" - " + custData.getGuid());
+ // }
+ // }
+ // }
+ // }
+ // if (validGuids.size() != custDefaults.getGuids().size()) {
+ // System.err.println("Update default customizations : " + user + " - " + currNumDefaults + " valid: " + validGuids.size());
+ // custDefaults.setGuids(validGuids);
+ // }
+ // if (fixIt) {
+ // custDefaults.save();
+ // user.setAttributeValues("XViewer Customization", customizations);
+ // user.persistAttributes();
+ // }
+ // }
+ // }
+
+ public Result isCustomizationSortErrored(String custDataStr, CustomizeData custData) {
+
+ return Result.TrueResult;
+ }
+
+ // String xViewerDefaults = user.getSoleAttributeValueAsString("XViewer Defaults", null);
+ // // Get all current default guids
+ // Set<String> currentDefaultGuids = new HashSet<String>();
+ // if (xViewerDefaults != null) {
+ // for (String guid : AXml.getTagDataArray(xViewerDefaults, XVIEWER_DEFAULTS_TAG)) {
+ // if (guid != null && !guid.equals("")) {
+ // currentDefaultGuids.add(guid);
+ // }
+ // }
+ // }
+ // private void relateDonDunne()throws OseeCoreException{
+ // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsPlugin.getAtsBranch()) {
+ //
+ // @Override
+ // protected void handleTxWork()throws OseeCoreException{
+ // for (Artifact art : ArtifactQuery.getArtifactsFromAttribute(
+ // ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ // "%<" + SkynetAuthentication.getUser().getUserId() + ">%", AtsPlugin.getAtsBranch())) {
+ // if ((art instanceof StateMachineArtifact) && ((StateMachineArtifact) art).getSmaMgr().getStateMgr().getAssignees().contains(
+ // SkynetAuthentication.getUser())) {
+ // art.addRelation(CoreRelationEnumeration.Users_User, SkynetAuthentication.getUser());
+ // }
+ // }
+ // SkynetAuthentication.getUser().persistRelations();
+ // }
+ // };
+ // newActionTx.execute();
+ //
+ // }
+
+ // private void testDeleteAttribute() throws OseeCoreException {
+ // Artifact art =
+ // ArtifactQuery.getArtifactsFromIds(Arrays.asList("76589"), AtsPlugin.getAtsBranch()).iterator().next();
+ // for (Attribute<?> attr : art.getAttributes()) {
+ // if (attr.getValue() == null) {
+ // System.out.println(art.getHumanReadableId() + " - " + attr.getNameValueDescription());
+ // attr.delete();
+ // }
+ // }
+ // art.persistAttributes();
+ // }
+
+ // private void deleteNullAttributes() throws OseeCoreException {
+ //
+ // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsPlugin.getAtsBranch()) {
+ //
+ // @Override
+ // protected void handleTxWork() throws OseeCoreException {
+ // int x = 0;
+ // for (String artTypeName : Arrays.asList(TeamWorkFlowArtifact.ARTIFACT_NAME, TaskArtifact.ARTIFACT_NAME,
+ // DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME,
+ // "Lba V13 Code Team Workflow", "Lba V13 Test Team Workflow", "Lba V13 Req Team Workflow",
+ // "Lba V13 SW Design Team Workflow", "Lba V13 Tech Approach Team Workflow",
+ // "Lba V11 REU Code Team Workflow", "Lba V11 REU Test Team Workflow", "Lba V11 REU Req Team Workflow",
+ // "Lba B3 Code Team Workflow", "Lba B3 Test Team Workflow", "Lba B3 Req Team Workflow",
+ // "Lba B3 SW Design Team Workflow", "Lba B3 Tech Approach Team Workflow")) {
+ // for (Artifact team : ArtifactQuery.getArtifactsFromType(artTypeName, AtsPlugin.getAtsBranch())) {
+ // for (Attribute<?> attr : team.getAttributes(false)) {
+ // if (attr.getValue() == null) {
+ // System.out.println(team.getHumanReadableId() + " - " + attr.getNameValueDescription());
+ // attr.delete();
+ // x++;
+ // }
+ // }
+ // if (team.isDirty()) team.persistAttributes();
+ // }
+ // }
+ // System.out.println("Deleted " + x);
+ // }
+ // };
+ // newActionTx.execute();
+ //
+ // }
+ //
+ // private void deleteNullUserAttributes() throws OseeCoreException {
+ //
+ // AbstractSkynetTxTemplate newActionTx = new AbstractSkynetTxTemplate(AtsPlugin.getAtsBranch()) {
+ //
+ // @Override
+ // protected void handleTxWork() throws OseeCoreException {
+ // int x = 0;
+ // for (String artTypeName : Arrays.asList(User.ARTIFACT_NAME)) {
+ // for (Artifact team : ArtifactQuery.getArtifactsFromType(artTypeName, AtsPlugin.getAtsBranch())) {
+ // for (Attribute<?> attr : team.getAttributes(false)) {
+ // if (attr.getValue() == null) {
+ // System.out.println(team.getHumanReadableId() + " - " + attr.getNameValueDescription());
+ // attr.delete();
+ // x++;
+ // }
+ // }
+ // if (team.isDirty()) team.persistAttributes();
+ // }
+ // }
+ // System.out.println("Deleted " + x);
+ // }
+ // };
+ // newActionTx.execute();
+ //
+ // }
+
+ // for (String artTypeName : Arrays.asList(TeamWorkFlowArtifact.ARTIFACT_NAME, TaskArtifact.ARTIFACT_NAME,
+ // DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME,
+ // "Lba V13 Code Team Workflow", "Lba V13 Test Team Workflow", "Lba V13 Req Team Workflow",
+ // "Lba V13 SW Design Team Workflow", "Lba V13 Tech Approach Team Workflow",
+ // "Lba V11 REU Code Team Workflow", "Lba V11 REU Test Team Workflow", "Lba V11 REU Req Team Workflow",
+ // "Lba B3 Code Team Workflow", "Lba B3 Test Team Workflow", "Lba B3 Req Team Workflow",
+ // "Lba B3 SW Design Team Workflow", "Lba B3 Tech Approach Team Workflow")) {
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java
new file mode 100644
index 00000000000..34f5f58ffc8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.IFavoriteableArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class Favorites {
+
+ private final StateMachineArtifact sma;
+
+ public Favorites(StateMachineArtifact sma) {
+ super();
+ this.sma = sma;
+ }
+
+ public void toggleFavorite() {
+ toggleFavorite(true);
+ }
+
+ public void toggleFavorite(boolean prompt) {
+ try {
+ if (((IFavoriteableArtifact) sma).amIFavorite()) {
+ boolean result = true;
+ if (prompt) result =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Remove Favorite", "Are You sure you wish to remove this as Favorite?");
+ if (result) ((IFavoriteableArtifact) sma).removeFavorite(UserManager.getUser());
+ } else {
+ boolean result = true;
+ if (prompt) result =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Favorite", "Are you sure you wish add this as a Favorite?");
+ if (result) ((IFavoriteableArtifact) sma).addFavorite(UserManager.getUser());
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java
new file mode 100644
index 00000000000..b52480768d1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.Import;
+
+import java.io.File;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.FileSelector;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.dialogs.WizardDataTransferPage;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionImportPage extends WizardDataTransferPage {
+
+ private IResource currentResourceSelection;
+ private FileSelector fileSelector;
+ private Label actionLabel;
+ private Button emailPocs;
+
+ /**
+ * @param pageName
+ * @param selection
+ */
+ public ActionImportPage(String pageName, IStructuredSelection selection) {
+ super(pageName);
+ setTitle("Import Actions into ATS");
+ setDescription("Import Actions into ATS");
+
+ if (selection != null && selection.size() == 1) {
+ Object firstElement = selection.getFirstElement();
+ if (firstElement instanceof IAdaptable) {
+ currentResourceSelection = (IResource) ((IAdaptable) firstElement).getAdapter(IResource.class);
+ }
+ }
+ }
+
+ /**
+ * (non-Javadoc) Method declared on IDialogPage.
+ */
+ public void createControl(Composite parent) {
+
+ initializeDialogUnits(parent);
+
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout(1, false));
+ composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
+ composite.setFont(parent.getFont());
+
+ createSourceGroup(composite);
+
+ createOptionsGroup(composite);
+
+ restoreWidgetValues();
+ updateWidgetEnablements();
+ setPageComplete(determinePageCompletion());
+
+ setControl(composite);
+ }
+
+ @Override
+ protected void createOptionsGroup(Composite parent) {
+ Group composite = new Group(parent, SWT.NONE);
+ composite.setText("Options");
+ composite.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
+ composite.setLayout(new GridLayout(2, false));
+
+ emailPocs = new Button(composite, SWT.CHECK);
+ emailPocs.setText("Email POCs?");
+ emailPocs.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ emailPocs.addListener(SWT.Modify, this);
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ comp.setLayout(new GridLayout());
+ actionLabel = new Label(comp, SWT.NONE);
+ actionLabel.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+ }
+
+ /**
+ * The <code>WizardResourceImportPage</code> implementation of this <code>Listener</code> method handles all events
+ * and enablements for controls on this page. Subclasses may extend.
+ *
+ * @param event Event
+ */
+ public void handleEvent(Event event) {
+ setPageComplete(determinePageCompletion());
+ updateWidgetEnablements();
+ }
+
+ private void createSourceGroup(Composite parent) {
+ fileSelector = new FileSelector(parent, SWT.NONE, "Import Source (Excel saved as .xml", this);
+
+ if (currentResourceSelection != null) fileSelector.setText(currentResourceSelection.getLocation().toString());
+ setPageComplete(determinePageCompletion());
+ } /*
+ * @see WizardPage#becomesVisible
+ */
+
+ @Override
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ // policy: wizards are not allowed to come up with an error message
+ if (visible) {
+ setErrorMessage(null);
+ }
+ }
+
+ @Override
+ protected boolean validateSourceGroup() {
+ return fileSelector.validate(this);
+ }
+
+ public boolean finish() {
+ final File file = fileSelector.getFile();
+ try {
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ ExcelAtsActionArtifactExtractor extractor =
+ new ExcelAtsActionArtifactExtractor(AtsPlugin.getAtsBranch(), emailPocs.getSelection());
+ extractor.discoverArtifactAndRelationData(file);
+ if (extractor.dataIsValid()) extractor.createArtifactsAndNotify(transaction);
+ WorldEditor.open(new WorldEditorSimpleProvider("Imported Action Artifacts", extractor.getActionArts()));
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.dialogs.WizardResourceImportPage#allowNewContainerName()
+ */
+ @Override
+ protected boolean allowNewContainerName() {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
new file mode 100644
index 00000000000..c43ad37a13c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.Import;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionImportWizard extends Wizard implements IImportWizard {
+ private ActionImportPage mainPage;
+ private IStructuredSelection selection;
+
+ public ActionImportWizard() {
+ super();
+ setDialogSettings(AtsPlugin.getInstance().getDialogSettings());
+ setWindowTitle("Action Import Wizard");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ return mainPage.finish();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+ /**
+ * (non-Javadoc) Method declared on Wizard.
+ */
+ public void addPages() {
+ mainPage = new ActionImportPage("Import Actions into OSEE ATS", selection);
+ addPage(mainPage);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
new file mode 100644
index 00000000000..3a066bfc480
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
@@ -0,0 +1,306 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.Import;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.NewActionJob;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsNotifyUsers;
+import org.eclipse.osee.ats.util.AtsPriority;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.Import.AbstractArtifactExtractor;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ExcelAtsActionArtifactExtractor extends AbstractArtifactExtractor implements RowProcessor {
+ private static final String description = "Extract each row as an Action";
+ private ExcelSaxHandler excelHandler;
+ private String[] headerRow;
+ private int rowNum = 0;
+ private final boolean emailPOCs;
+ private enum Columns {
+ Title, Description, ActionableItems, Assignees, Priority, ChangeType, UserCommunity, Version
+ };
+
+ public static String getDescription() {
+ return description;
+ }
+ private Set<ActionData> actionDatas = new HashSet<ActionData>();
+ private Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
+
+ public ExcelAtsActionArtifactExtractor(Branch branch, boolean emailPOCs) {
+ super(branch);
+ this.emailPOCs = emailPOCs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processHeaderRow(java.lang.String[])
+ */
+ public void processHeaderRow(String[] headerRow) {
+ this.headerRow = headerRow.clone();
+ }
+
+ private class ActionData {
+ public String title = "";
+ public String desc = "";
+ public String priorityStr = "";
+ public Set<String> userComms = new HashSet<String>();
+ public String changeType = "";
+ public Set<String> assigneeStrs = new HashSet<String>();
+ public Set<User> assignees = new HashSet<User>();
+ public Set<String> actionableItems = new HashSet<String>();
+ public String version = "";
+ }
+
+ /**
+ * import Artifacts
+ *
+ * @param cols
+ */
+ public void processRow(String[] cols) {
+
+ rowNum++;
+ System.out.println("Processing Row " + rowNum);
+
+ boolean fullRow = false;
+ for (int i = 0; i < cols.length; i++)
+ if (cols[i] != null && !cols[i].equals("")) {
+ fullRow = true;
+ break;
+ }
+ if (!fullRow) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Empty Row Found => " + rowNum + " skipping...");
+ return;
+ }
+
+ System.out.println("Reading rows...");
+ ActionData aData = new ActionData();
+ for (int i = 0; i < cols.length; i++) {
+ if (headerRow[i] == null) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Null header column => " + i);
+ } else if (headerRow[i].equalsIgnoreCase(Columns.Title.name())) {
+ if (cols[i].equals("")) return;
+ aData.title = cols[i];
+ } else if (headerRow[i].equalsIgnoreCase(Columns.Priority.name())) {
+ aData.priorityStr = cols[i];
+ } else if (headerRow[i].equalsIgnoreCase(Columns.Version.name())) {
+ aData.version = (cols[i] == null ? "" : cols[i]);
+ } else if (headerRow[i].equalsIgnoreCase(Columns.ChangeType.name())) {
+ aData.changeType = cols[i];
+ } else if (headerRow[i].equalsIgnoreCase(Columns.Description.name())) {
+ aData.desc = (cols[i] == null ? "" : cols[i]);
+ } else if (headerRow[i].equalsIgnoreCase(Columns.UserCommunity.name())) {
+ for (String str : cols[i].split(";")) {
+ if (!str.equals("")) aData.userComms.add(str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase(Columns.ActionableItems.name())) {
+ for (String str : cols[i].split(";")) {
+ if (!str.equals("")) aData.actionableItems.add(str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase(Columns.Assignees.name())) {
+ if (cols[i] != null) for (String str : cols[i].split(";")) {
+ if (!str.equals("")) aData.assigneeStrs.add(str);
+ }
+ } else {
+ OSEELog.logSevere(AtsPlugin.class, "Unhandled column => " + headerRow[i], true);
+ }
+ }
+ actionDatas.add(aData);
+ }
+
+ public boolean dataIsValid() throws OseeCoreException {
+ System.out.println("Validating...");
+ XResultData rd = new XResultData();
+ int rowNum = 1; // Header is row 1
+ for (ActionData aData : actionDatas) {
+ rowNum++;
+ if (aData.title.equals("")) rd.logError("Row " + rowNum + "; Invalid Title");
+ if (aData.actionableItems.size() == 0)
+ rd.logError("Row " + rowNum + ": Must have at least one ActionableItem defined");
+ else {
+ for (String actionableItemName : aData.actionableItems) {
+ try {
+ if (AtsCache.getArtifactsByName(actionableItemName, ActionableItemArtifact.class).size() > 0) {
+ rd.logError("Row " + rowNum + ": Couldn't find actionable item for \"" + actionableItemName + "\"");
+ }
+ } catch (Exception ex) {
+ rd.logError("Row " + rowNum + " - " + ex.getLocalizedMessage());
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ if (!aData.version.equals("")) {
+ try {
+ if (AtsCache.getSoleArtifactByName(aData.version, VersionArtifact.class) == null) {
+ rd.logError("Row " + rowNum + ": Can't find single version \"" + aData.version + "\"");
+ }
+ } catch (Exception ex) {
+ rd.logError("Row " + rowNum + " - " + ex.getLocalizedMessage());
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ // If no assignees, ATS will auto-assign to correct person
+ // Else if assignees, confirm that they are valid
+ if (aData.assigneeStrs.size() > 0) {
+ for (String assignee : aData.assigneeStrs) {
+ User user = UserManager.getUserByName(assignee);
+ if (user == null)
+ rd.logError("Row " + rowNum + ": Couldn't retrieve user \"" + assignee + "\"");
+ else
+ aData.assignees.add(user);
+ }
+ }
+ }
+ if (!rd.toString().equals("")) {
+ rd.report("Ats Action Import Errors");
+ return false;
+ }
+ return true;
+ }
+
+ public void createArtifactsAndNotify(SkynetTransaction transaction) {
+ AtsPlugin.setEmailEnabled(false);
+ System.out.println("Creating...");
+ Set<TeamWorkFlowArtifact> teamWfs = new HashSet<TeamWorkFlowArtifact>();
+ try {
+ for (ActionData aData : actionDatas) {
+ ActionArtifact actionArt =
+ NewActionJob.createAction(null, aData.title, aData.desc, ChangeType.getChangeType(aData.changeType),
+ AtsPriority.PriorityType.getPriority(aData.priorityStr), aData.userComms, false, null,
+ ActionableItemArtifact.getActionableItems(aData.actionableItems), transaction);
+ actionArts.add(actionArt);
+ if (!aData.version.equals("")) {
+ VersionArtifact verArt = AtsCache.getSoleArtifactByName(aData.version, VersionArtifact.class);
+
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts())
+ verArt.addRelation(AtsRelation.TeamWorkflowTargetedForVersion_Workflow, team);
+ }
+ if (aData.assigneeStrs.size() > 0) {
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts()) {
+ team.getSmaMgr().getStateMgr().setAssignees(aData.assignees);
+ }
+ }
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts()) {
+ team.persistAttributesAndRelations(transaction);
+ }
+ teamWfs.addAll(actionArt.getTeamWorkFlowArtifacts());
+ }
+ AtsPlugin.setEmailEnabled(true);
+ if (emailPOCs) {
+ for (TeamWorkFlowArtifact team : teamWfs) {
+ AtsNotifyUsers.notify(team, AtsNotifyUsers.NotifyType.Assigned);
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ } finally {
+ AtsPlugin.setEmailEnabled(true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.ArtifactExtractor#discoverArtifactAndRelationData(java.io.File)
+ */
+ public void discoverArtifactAndRelationData(File artifactsFile) throws OseeCoreException {
+ try {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ excelHandler = new ExcelSaxHandler(this, true);
+ xmlReader.setContentHandler(excelHandler);
+ xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(artifactsFile), "UTF-8")));
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processEmptyRow()
+ */
+ public void processEmptyRow() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processCommentRow(java.lang.String[])
+ */
+ public void processCommentRow(String[] row) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#reachedEndOfWorksheet()
+ */
+ public void reachedEndOfWorksheet() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#detectedTotalRowCount(int)
+ */
+ public void detectedRowAndColumnCounts(int rowCount, int columnCount) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#foundStartOfWorksheet(java.lang.String)
+ */
+ public void foundStartOfWorksheet(String sheetName) {
+ }
+
+ /**
+ * @return the actionArts
+ */
+ public Set<ActionArtifact> getActionArts() {
+ return actionArts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.Import.ArtifactExtractor#getFileFilter()
+ */
+ public FileFilter getFileFilter() {
+ return null;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
new file mode 100644
index 00000000000..01f11617481
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
@@ -0,0 +1,285 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.Import;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.InputStreamReader;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsNotifyUsers;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.Import.AbstractArtifactExtractor;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ExcelAtsTaskArtifactExtractor extends AbstractArtifactExtractor implements RowProcessor {
+ private static final String description = "Extract each row as a task";
+ private ExcelSaxHandler excelHandler;
+ private String[] headerRow;
+ private StateMachineArtifact sma;
+ private IProgressMonitor monitor;
+ private int rowNum;
+ private final boolean emailPOCs;
+ private SMAManager smaMgr;
+ private final boolean persist;
+
+ public static String getDescription() {
+ return description;
+ }
+
+ public ExcelAtsTaskArtifactExtractor(TeamWorkFlowArtifact artifact, boolean emailPOCs, boolean persist) {
+ super(artifact.getBranch());
+ this.emailPOCs = emailPOCs;
+ this.persist = persist;
+ if (!(artifact instanceof StateMachineArtifact)) {
+ throw new IllegalArgumentException("Artifact must be StateMachineArtifact");
+ }
+
+ sma = (StateMachineArtifact) artifact;
+ smaMgr = new SMAManager(sma);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processHeaderRow(java.lang.String[])
+ */
+ public void processHeaderRow(String[] headerRow) {
+ this.headerRow = headerRow.clone();
+ }
+
+ /**
+ * import Artifacts
+ *
+ * @param row
+ */
+ public void processRow(String[] row) {
+ try {
+ rowNum++;
+ monitor.setTaskName("Processing Row " + rowNum);
+ TaskArtifact taskArt = smaMgr.getTaskMgr().createNewTask("", false);
+
+ monitor.subTask("Validating...");
+ boolean fullRow = false;
+ for (int i = 0; i < row.length; i++)
+ if (row[i] != null && !row[i].equals("")) {
+ fullRow = true;
+ break;
+ }
+ if (!fullRow) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Empty Row Found => " + rowNum + " skipping...");
+ return;
+ }
+
+ AtsPlugin.setEmailEnabled(false);
+ for (int i = 0; i < row.length; i++) {
+ if (headerRow[i] == null) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Null header column => " + i);
+ } else if (headerRow[i].equalsIgnoreCase("Originator")) {
+ String userName = row[i];
+ User u = null;
+ if (userName == null || userName.equals(""))
+ u = UserManager.getUser();
+ else
+ u = UserManager.getUserByName(userName);
+ if (u == null) OseeLog.log(AtsPlugin.class, Level.SEVERE, String.format(
+ "Invalid Originator \"%s\" for row %d\nSetting to current user.", userName, rowNum));
+ taskArt.getSmaMgr().getLog().setOriginator(u);
+ } else if (headerRow[i].equalsIgnoreCase("Assignees")) {
+ Set<User> assignees = new HashSet<User>();
+ for (String userName : row[i].split(";")) {
+ userName = userName.replaceAll("^\\s+", "");
+ userName = userName.replaceAll("\\+$", "");
+ User user = null;
+ if (userName == null || userName.equals(""))
+ user = UserManager.getUser();
+ else
+ user = UserManager.getUserByName(userName);
+ if (user == null) throw new IllegalArgumentException(String.format(
+ "Invalid Assignee \"%s\" for row %d", userName, rowNum));
+ assignees.add(user);
+ }
+ taskArt.getSmaMgr().getStateMgr().setAssignees(assignees);
+ } else if (headerRow[i].equalsIgnoreCase("Resolution")) {
+ String str = row[i];
+ if (str != null && !str.equals("")) {
+ taskArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Related to State")) {
+ String str = row[i];
+ if (str != null && !str.equals("")) {
+ taskArt.setSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Notes")) {
+ String str = row[i];
+ if (str != null && !str.equals("")) {
+ taskArt.setSoleAttributeValue(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName(), str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Title")) {
+ String str = row[i];
+ if (str != null && !str.equals("")) {
+ if (monitor != null) {
+ monitor.subTask(String.format("Title \"%s\"", str));
+ }
+ taskArt.setDescriptiveName(str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Percent Complete")) {
+ String str = row[i];
+ Double percent;
+ if (str != null && !str.equals("")) {
+ try {
+ percent = new Double(str);
+ if (percent < 1) percent = percent * 100;
+ } catch (Exception ex) {
+ throw new IllegalArgumentException(String.format("Invalid Percent Complete \"%s\" for row %d",
+ str, rowNum));
+ }
+ int percentInt = percent.intValue();
+ smaMgr.getStateMgr().updateMetrics(0, percentInt, true);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Hours Spent")) {
+ String str = row[i];
+ double hours = 0;
+ if (str != null && !str.equals("")) {
+ try {
+ hours = new Double(str);
+ } catch (Exception ex) {
+ throw new IllegalArgumentException(String.format("Invalid Hours Spent \"%s\" for row %d", str,
+ rowNum));
+ }
+ smaMgr.getStateMgr().updateMetrics(hours, smaMgr.getStateMgr().getPercentComplete(), true);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("Estimated Hours")) {
+ String str = row[i];
+ double hours = 0;
+ if (str != null && !str.equals("")) {
+ try {
+ hours = new Double(str);
+ } catch (Exception ex) {
+ throw new IllegalArgumentException(String.format("Invalid Estimated Hours \"%s\" for row %d", str,
+ rowNum));
+ }
+ taskArt.setSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), hours);
+ }
+ } else {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Unhandled column => " + headerRow[i]);
+ }
+ }
+ AtsPlugin.setEmailEnabled(true);
+
+ SkynetTransaction transaction = new SkynetTransaction(taskArt.getBranch());
+ if (taskArt.isCompleted()) taskArt.transitionToCompleted(false, transaction);
+ if (persist) {
+ taskArt.persistAttributesAndRelations(transaction);
+ }
+ transaction.execute();
+ if (emailPOCs && !taskArt.isCompleted() && !taskArt.isCancelled()) {
+ AtsNotifyUsers.notify(sma, AtsNotifyUsers.NotifyType.Assigned);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.ArtifactExtractor#discoverArtifactAndRelationData(java.io.File)
+ */
+ public void discoverArtifactAndRelationData(File artifactsFile) throws OseeCoreException {
+ try {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ excelHandler = new ExcelSaxHandler(this, true);
+ xmlReader.setContentHandler(excelHandler);
+ xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(artifactsFile), "UTF-8")));
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processEmptyRow()
+ */
+ public void processEmptyRow() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#processCommentRow(java.lang.String[])
+ */
+ public void processCommentRow(String[] row) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#reachedEndOfWorksheet()
+ */
+ public void reachedEndOfWorksheet() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#detectedTotalRowCount(int)
+ */
+ public void detectedRowAndColumnCounts(int rowCount, int columnCount) {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.RowProcessor#foundStartOfWorksheet(java.lang.String)
+ */
+ public void foundStartOfWorksheet(String sheetName) {
+ }
+
+ public IProgressMonitor getMonitor() {
+ return monitor;
+ }
+
+ public void setMonitor(IProgressMonitor monitor) {
+ this.monitor = monitor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.Import.ArtifactExtractor#getFileFilter()
+ */
+ public FileFilter getFileFilter() {
+ return null;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java
new file mode 100644
index 00000000000..ca883faad16
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.Import;
+
+import java.io.File;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.logging.OseeLog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskImportJob extends Job {
+ private final File file;
+ private ExcelAtsTaskArtifactExtractor atsTaskExtractor;
+
+ public TaskImportJob(File file, ExcelAtsTaskArtifactExtractor atsTaskExtractor) {
+ super("Importing Tasks");
+ this.file = file;
+ this.atsTaskExtractor = atsTaskExtractor;
+ }
+
+ public IStatus run(final IProgressMonitor monitor) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ try {
+ atsTaskExtractor.setMonitor(monitor);
+ monitor.beginTask("Importing Tasks", 0);
+ if (file != null && file.isFile()) {
+ atsTaskExtractor.discoverArtifactAndRelationData(file);
+ } else {
+ throw new OseeArgumentException("All files passed must be a file");
+ }
+ toReturn = Status.OK_STATUS;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ toReturn = new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return toReturn;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java
new file mode 100644
index 00000000000..ed0b6926c87
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.world.search.LegacyPCRActionsWorldSearchItem;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LegacyPCRActions {
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(TeamDefinitionArtifact teamDef) throws OseeCoreException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(teamDef));
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem(teamDefs, false);
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ teamArts.add((TeamWorkFlowArtifact) art);
+ }
+ }
+ return teamArts;
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(String pcrId, Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(pcrId), teamDefs);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(String pcrId) throws OseeCoreException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(pcrId), (Collection<TeamDefinitionArtifact>) null);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<String> pcrIds, TeamDefinitionArtifact teamDef) throws OseeCoreException {
+ return getTeamsTeamWorkflowArtifacts(pcrIds, teamDef != null ? Arrays.asList(teamDef) : null);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem(pcrIds, teamDefs, false);
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ teamArts.add((TeamWorkFlowArtifact) art);
+ }
+ }
+ return teamArts;
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(TeamDefinitionArtifact teamDef) throws OseeCoreException {
+ return getTeamsActionArtifacts(Arrays.asList(teamDef));
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem(teamDefs, true);
+ Set<ActionArtifact> actArts = new HashSet<ActionArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ if (art instanceof ActionArtifact) {
+ actArts.add((ActionArtifact) art);
+ }
+ }
+ return actArts;
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(String pcrId, Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ return getTeamsActionArtifacts(Arrays.asList(pcrId), teamDefs);
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs) throws OseeCoreException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem(pcrIds, teamDefs, true);
+ Set<ActionArtifact> actArts = new HashSet<ActionArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ actArts.add((ActionArtifact) art);
+ }
+ return actArts;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
new file mode 100644
index 00000000000..dd4e1aaa63b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
@@ -0,0 +1,321 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.AHTML.CellItem;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.ResultBrowserHyperCmd;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultHtml;
+
+public class Overview {
+
+ public final static String normalColor = "#EEEEEE";
+ private final static String activeColor = "#9CCCFF";
+ public final static String errorColor = "#FFD6AC";
+ public final static String subscribedColor = "#FFCCAA";
+ public final static String labelColor = "darkcyan";
+ public static enum PreviewStyle {
+ NONE, MAP, TASKS, NOTES, LOG, HYPEROPEN, NO_SUBSCRIBE_OR_FAVORITE;
+
+ public static boolean contains(PreviewStyle[] styles, PreviewStyle style) {
+ for (PreviewStyle st : styles)
+ if (st.equals(style)) return true;
+ return false;
+ }
+ };
+ private StringBuilder html;
+ public final static String labelFont = "<font color=\"darkcyan\" face=\"Arial\" size=\"-1\">";
+ public final static int TABLE_WIDTH = 95;
+ public boolean showTasks = false;
+
+ public Overview() {
+ clearHtml();
+ }
+
+ public void clearHtml() {
+ html = new StringBuilder(1000);
+ }
+
+ /**
+ * @return HTML page for browser display
+ */
+ public String getPage() {
+ return "<html><body>\n" + html + "\n</body></html>";
+ }
+
+ /**
+ * Return label with value converted to show html reserved characters
+ *
+ * @param label
+ * @param value
+ * @return string to embed into html
+ */
+ public String getLabelValue(String label, String value) {
+ String valueStr = AHTML.textToHtml(value);
+ return getLabel(label) + valueStr;
+ }
+
+ /**
+ * Return label and value WITHOUT conversion to handle html reserved characters. Value will be as-is
+ *
+ * @param label
+ * @param value
+ * @return string to embed into html
+ */
+ public String getLabelValueNoConvert(String label, String value) {
+ return getLabel(label) + value;
+ }
+
+ public static String getLabel(String label) {
+ return AHTML.getLabelStr(labelFont, label + ": ");
+ }
+
+ public void addTable(String str) {
+ addTable(new String[] {str});
+ }
+
+ public void addTable(String str, String str2) {
+ addTable(new String[] {str, str2});
+ }
+
+ public void addTable(String str, String str2, String str3) {
+ addTable(new String[] {str, str2, str3});
+ }
+
+ public void addTable(String[] strs) {
+ addTable(strs, 100);
+ }
+
+ public void addHtml(String html) {
+ this.html.append(html);
+ }
+
+ public void addTable(String[] strs, int width) {
+ if (strs.length == 1) {
+ this.html.append(AHTML.simpleTable(strs[0]));
+ } else {
+ this.html.append(AHTML.multiColumnTable(strs, width));
+ }
+ }
+
+ public void addHeader(StateMachineArtifact sma, PreviewStyle... styles) throws OseeCoreException {
+ SMAManager smaMgr = new SMAManager(sma);
+ startBorderTable(100, false, "");
+ addTable(getLabelValue("Title", sma.getDescriptiveName()));
+ this.html.append(AHTML.multiColumnTable(new String[] {
+ AHTML.getLabelStr(labelFont, "State: ") + smaMgr.getStateMgr().getCurrentStateName(),
+ AHTML.getLabelStr(labelFont, "Type: ") + sma.getArtifactTypeName(),
+ AHTML.getLabelStr(labelFont, "Id: ") + sma.getHumanReadableId()}));
+ addTable(getLabelValue("Originator", smaMgr.getOriginator().getDescriptiveName()), getLabelValue("Creation Date",
+ XDate.getDateStr(smaMgr.getLog().getCreationDate(), XDate.MMDDYYHHMM)));
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact)
+ addTable(getLabelValue("Team", ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamName()), getLabelValue(
+ "Assignees", Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees())));
+ else
+ addTable(getLabelValue("Assignees", Artifacts.toString("; ", smaMgr.getStateMgr().getAssignees())));
+ addTable(getLabelValue("Description", smaMgr.getSma().getDescription()));
+ if (smaMgr.isCancelled()) {
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ addTable(getLabelValue("Cancelled From", item.getState()));
+ addTable(getLabelValue("Cancellation Reason", item.getMsg()));
+ }
+ if (sma instanceof TaskArtifact) {
+ StateMachineArtifact parentArt = ((TaskArtifact) sma).getParentSMA();
+ if (parentArt != null) {
+ this.html.append(AHTML.multiColumnTable(new String[] {AHTML.getLabelStr(labelFont, "Parent Workflow: ") + parentArt.getDescriptiveName()}));
+ this.html.append(AHTML.multiColumnTable(new String[] {AHTML.getLabelStr(labelFont, "Parent State: ") + ((TaskArtifact) sma).getSmaMgr().getStateMgr().getCurrentStateName()}));
+ }
+ SMAManager taskSmaMgr = new SMAManager(sma);
+ this.html.append(AHTML.multiColumnTable(new String[] {AHTML.getLabelStr(labelFont, "Task Owner: ") + Artifacts.toString(
+ "; ", taskSmaMgr.getStateMgr().getAssignees())}));
+ }
+ endBorderTable();
+ }
+
+ public void addFooter(StateMachineArtifact sma, PreviewStyle... styles) {
+ this.html.append(AHTML.newline());
+
+ if (PreviewStyle.contains(styles, PreviewStyle.HYPEROPEN)) {
+ this.html.append("Start OSEE, select the ATS perspective and search by the Id shown.");
+ }
+ }
+
+ public void addRelationsBlock(ATSArtifact artifact) {
+ addRelationTable("Is Superceded By", AtsRelation.Supercedes_Supercedes, artifact);
+ addRelationTable("Supercedes", AtsRelation.Supercedes_Superceded, artifact);
+ addRelationTable("Issues Addressed By", AtsRelation.AddressesIssues_AddressesIssues, artifact);
+ addRelationTable("Addresses Issues In", AtsRelation.AddressesIssues_IssuedArtifact, artifact);
+ addRelationTable("Supports", AtsRelation.SupportingInfo_SupportedBy, artifact);
+ addRelationTable("Is Supported By", AtsRelation.SupportingInfo_SupportingInfo, artifact);
+ }
+
+ public void addNotes(StateMachineArtifact artifact, String state) {
+ if (artifact instanceof StateMachineArtifact) {
+ String notesHtml = (artifact).getSmaMgr().getNotes().getTable(state);
+ if (notesHtml.equals("")) return;
+ this.html.append(notesHtml);
+ }
+ }
+
+ public void addNotes(Artifact artifact) {
+ if (artifact instanceof StateMachineArtifact) {
+ String notesHtml = ((StateMachineArtifact) artifact).getSmaMgr().getNotes().getTable(null);
+ if (notesHtml.equals("")) return;
+ this.html.append(notesHtml);
+ }
+ }
+
+ public static String getGenericArtifactTable(String name, Collection<Artifact> arts) {
+ return getGenericArtifactTable(name, arts, 100);
+ }
+
+ public static String getGenericArtifactTable(String name, Collection<Artifact> arts, int width) {
+ StringBuilder builder = new StringBuilder();
+ builder.append(AHTML.addSpace(1) + Overview.getLabel(name));
+ if (arts.size() > 0) {
+ builder.append("<TABLE BORDER=\"1\" align=\"center\" cellspacing=\"1\" cellpadding=\"3%\" width=\"" + width + "%\"><THEAD><TR><TH>Type</TH>" + "<TH>Name</TH></THEAD></TR>");
+ for (Artifact art : arts) {
+ builder.append("<TR>");
+ builder.append("<TD>" + art.getArtifactTypeName() + "</TD>");
+ builder.append("<TD>" + Overview.getOpenHyperlinkHtml(art) + "</TD>");
+ builder.append("</TR>");
+ }
+ builder.append("</TABLE>");
+ }
+ return builder.toString();
+ }
+
+ public void addRelationTable(String name, AtsRelation side, Artifact parent) {
+ try {
+ List<Artifact> arts = parent.getRelatedArtifacts(side);
+ if (arts.size() == 0) return;
+ startBorderTable(false, name);
+ html.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Name", "Rationale"}));
+ for (Artifact art : arts) {
+ String rationale = "";
+ RelationLink link = parent.getRelations(side, art).iterator().next();
+ if (!link.getRationale().equals("")) rationale = link.getRationale();
+ String hyperStr = Overview.getOpenHyperlinkHtml(art);
+ html.append(AHTML.addRowMultiColumnTable(new String[] {art.getArtifactTypeName(), hyperStr, rationale}));
+ }
+ endBorderTable();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ public void addTeams(Collection<TeamWorkFlowArtifact> teams) throws OseeCoreException {
+ startBorderTable(TABLE_WIDTH, false, "Team Workflows");
+ String s = AHTML.beginMultiColumnTable(100, 1);
+ s += AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "State"}, new Integer[] {70, 150});
+ ArrayList<CellItem> cells = new ArrayList<CellItem>();
+ for (TeamWorkFlowArtifact team : teams) {
+ cells.add(new AHTML.CellItem(team.getHyperlinkHtml()));
+ cells.add(new AHTML.CellItem(team.getSmaMgr().getStateMgr().getCurrentStateName()));
+ s += AHTML.addRowMultiColumnTable(cells);
+ cells.clear();
+ }
+ s += AHTML.endMultiColumnTable();
+ html.append(s);
+
+ endBorderTable();
+ }
+
+ public static String getOpenHyperlinkHtml(Artifact art) {
+ return getOpenHyperlinkHtml(art.getDescriptiveName(), art);
+ }
+
+ public static String getOpenHyperlinkHtml(String name, String hrid) {
+ return AHTML.getHyperlink(ResultBrowserHyperCmd.getHyperCmdStr(ResultBrowserHyperCmd.openAction, hrid), name);
+ }
+
+ public static String getOpenArtEditHyperlinkHtml(String name, String hrid) {
+ return AHTML.getHyperlink(ResultBrowserHyperCmd.getHyperCmdStr(ResultBrowserHyperCmd.openArtifactEditor, hrid),
+ name);
+ }
+
+ public static String getOpenArtViewHyperlinkHtml(String name, String hrid) {
+ return AHTML.getHyperlink(ResultBrowserHyperCmd.getHyperCmdStr(ResultBrowserHyperCmd.openArtifactHyperViewer,
+ hrid), name);
+ }
+
+ public static String getOpenHyperlinkHtml(String name, String guidOrHrid, int branchId) {
+ return XResultHtml.getOpenHyperlinkHtml(name, guidOrHrid, branchId);
+ }
+
+ public static String getOpenHyperlinkHtml(String name, Artifact art) {
+ return AHTML.getHyperlink(ResultBrowserHyperCmd.getHyperCmdStr(ResultBrowserHyperCmd.openAction, art.getGuid()),
+ name);
+ }
+
+ public void addLog(StateMachineArtifact artifact) throws OseeCoreException {
+ ATSLog artifactLog = artifact.getSmaMgr().getLog();
+ if (artifactLog != null && artifactLog.getLogItems().size() > 0) addTable(artifact.getSmaMgr().getLog().getTable());
+ }
+
+ public void startStateBorderTable(SMAManager smaMgr, SMAState state) throws OseeCoreException {
+ String caption = state.getName();
+ String assgn = Artifacts.toString("; ", state.getAssignees());
+ startStateBorderTable(smaMgr.getStateMgr().getCurrentStateName().equals(state.getName()), caption, assgn);
+ }
+
+ public void startStateBorderTable(boolean active, String name, String assignee) {
+ if (assignee != null && !assignee.equals(""))
+ startBorderTable(active, String.format("%s (%s)", name, assignee));
+ else
+ startBorderTable(active, String.format("%s", name));
+ }
+
+ public void startBorderTable(boolean active, String caption) {
+ this.html.append(AHTML.startBorderTable(TABLE_WIDTH, (active) ? activeColor : normalColor, caption));
+ }
+
+ public void startBorderTable(int width, boolean active, String caption) {
+ this.html.append(AHTML.startBorderTable(width, (active) ? activeColor : normalColor, caption));
+ }
+
+ public void startBorderTable(int width, String caption, String backgroundColor) {
+ this.html.append(AHTML.startBorderTable(width, backgroundColor, caption));
+ }
+
+ public void endBorderTable() {
+ this.html.append(AHTML.endBorderTable());
+ }
+
+ public boolean isShowTasks() {
+ return showTasks;
+ }
+
+ public void setShowTasks(boolean showTasks) {
+ this.showTasks = showTasks;
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java
new file mode 100644
index 00000000000..5c57c9f63db
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java
@@ -0,0 +1,446 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAMetrics {
+
+ private static double manDayHrs = 7.2;
+ private static int MILLISECS_PER_DAY = (1000 * 60 * 60 * 24);
+
+ double estHours = 0;
+ double hrsRemain = 0;
+ double hrsSpent = 0;
+ double manDaysNeeded = 0;
+ double cummulativeTeamPercentComplete = 0;
+ double percentCompleteByTeamPercents = 0;
+ double percentCompleteByTeamWorkflow = 0;
+ double cummulativeTaskPercentComplete = 0;
+ double percentCompleteByTaskPercents = 0;
+ double percentCompleteByTaskWorkflow = 0;
+
+ Date estRelDate;
+ long daysTillRel = 0;
+ VersionArtifact versionArtifact = null;
+ String str = "";
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
+ Set<TaskArtifact> taskArts = new HashSet<TaskArtifact>();
+ Set<ReviewSMArtifact> reviewArts = new HashSet<ReviewSMArtifact>();
+ Set<StateMachineArtifact> smas = new HashSet<StateMachineArtifact>();
+ Set<User> assignees = new HashSet<User>();
+ Set<User> assigneesAssignedOrCompleted = new HashSet<User>();
+ Set<StateMachineArtifact> smasInherited = new HashSet<StateMachineArtifact>();
+
+ private final HashCollection<User, Artifact> userToAssignedSmas =
+ new HashCollection<User, Artifact>(true, HashSet.class, 100);
+ private final HashCollection<User, Artifact> userToCompletedSmas =
+ new HashCollection<User, Artifact>(true, HashSet.class, 100);
+
+ /**
+ * @return the userToCompletedSmas
+ */
+ public HashCollection<User, Artifact> getUserToCompletedSmas() {
+ return userToCompletedSmas;
+ }
+
+ /**
+ * @return the manDayHrs
+ */
+ public static double getManDayHrs() {
+ return manDayHrs;
+ }
+
+ /**
+ * @return the teamArts
+ */
+ public Set<TeamWorkFlowArtifact> getTeamArts() {
+ return teamArts;
+ }
+
+ /**
+ * @return the actionArts
+ */
+ public Set<ActionArtifact> getActionArts() {
+ return actionArts;
+ }
+
+ /**
+ * @return the taskArts
+ */
+ public Set<TaskArtifact> getTaskArts() {
+ return taskArts;
+ }
+
+ /**
+ * @return the reviewArts
+ */
+ public Set<ReviewSMArtifact> getReviewArts() {
+ return reviewArts;
+ }
+
+ /**
+ * @return the userToSmas
+ */
+ public HashCollection<User, Artifact> getUserToAssignedSmas() {
+ return userToAssignedSmas;
+ }
+
+ /**
+ * @return the estRelDate
+ */
+ public Date getEstRelDate() {
+ return estRelDate;
+ }
+
+ /**
+ * @param estRelDate the estRelDate to set
+ */
+ public void setEstRelDate(Date estRelDate) {
+ this.estRelDate = estRelDate;
+ }
+
+ /**
+ * @return the daysTillRel
+ */
+ public long getDaysTillRel() {
+ return daysTillRel;
+ }
+
+ /**
+ * @return the hours till release
+ */
+ public double getHoursTillRel() {
+ return daysTillRel * manDayHrs;
+ }
+
+ /**
+ * @param daysTillRel the daysTillRel to set
+ */
+ public void setDaysTillRel(int daysTillRel) {
+ this.daysTillRel = daysTillRel;
+ }
+
+ /**
+ * @return the versionArtifact
+ */
+ public VersionArtifact getVersionArtifact() {
+ return versionArtifact;
+ }
+
+ /**
+ * @param versionArtifact the versionArtifact to set
+ */
+ public void setVersionArtifact(VersionArtifact versionArtifact) {
+ this.versionArtifact = versionArtifact;
+ }
+
+ /**
+ * @return the numTeamWfs
+ */
+ public int getNumTeamWfs() {
+ return teamArts.size();
+ }
+
+ /**
+ * @return the numTasks
+ */
+ public int getNumTasks() {
+ return taskArts.size();
+ }
+
+ /**
+ * @return the numTasks
+ */
+ public int getNumActions() {
+ return actionArts.size();
+ }
+
+ /**
+ * @return the numTasks
+ */
+ public int getNumReviews() {
+ return reviewArts.size();
+ }
+
+ /**
+ * @return the estHours
+ */
+ public double getEstHours() {
+ return estHours;
+ }
+
+ /**
+ * @param estHours the estHours to set
+ */
+ public void setEstHours(double estHours) {
+ this.estHours = estHours;
+ }
+
+ /**
+ * @return the hrsRemain
+ */
+ public double getHrsRemain() {
+ return hrsRemain;
+ }
+
+ /**
+ * @param hrsRemain the hrsRemain to set
+ */
+ public void setHrsRemain(double hrsRemain) {
+ this.hrsRemain = hrsRemain;
+ }
+
+ /**
+ * @return the hrsSpent
+ */
+ public double getHrsSpent() {
+ return hrsSpent;
+ }
+
+ /**
+ * @param hrsSpent the hrsSpent to set
+ */
+ public void setHrsSpent(double hrsSpent) {
+ this.hrsSpent = hrsSpent;
+ }
+
+ /**
+ * @return the cummulativeTaskPercentComplete
+ */
+ public double getCummulativeTaskPercentComplete() {
+ return cummulativeTaskPercentComplete;
+ }
+
+ /**
+ * @return the percentCompleteByTaskPercents
+ */
+ public double getPercentCompleteByTaskPercents() {
+ return percentCompleteByTaskPercents;
+ }
+
+ /**
+ * @return the manDaysNeeded
+ */
+ public double getManDaysNeeded() {
+ return manDaysNeeded;
+ }
+
+ /**
+ * @param manDaysNeeded the manDaysNeeded to set
+ */
+ public void setManDaysNeeded(double manDaysNeeded) {
+ this.manDaysNeeded = manDaysNeeded;
+ }
+
+ /**
+ * @return the cummulativePercentComplete
+ */
+ public double getCummulativeTeamPercentComplete() {
+ return cummulativeTeamPercentComplete;
+ }
+
+ /**
+ * @param cummulativePercentComplete the cummulativePercentComplete to set
+ */
+ public void setCummulativePercentComplete(double cummulativePercentComplete) {
+ this.cummulativeTeamPercentComplete = cummulativePercentComplete;
+ }
+
+ /**
+ * @return the percentComplete
+ */
+ public double getPercentCompleteByTeamPercents() {
+ return percentCompleteByTeamPercents;
+ }
+
+ public Collection<TeamWorkFlowArtifact> getCompletedTeamWorkflows() throws OseeCoreException {
+ Set<TeamWorkFlowArtifact> teams = new HashSet<TeamWorkFlowArtifact>();
+ for (TeamWorkFlowArtifact team : getTeamArts()) {
+ if (team.getSmaMgr().isCancelledOrCompleted()) {
+ teams.add(team);
+ }
+ }
+ return teams;
+ }
+
+ public double getPercentCompleteByTeamWorkflow() throws OseeCoreException {
+ if (getTeamArts().size() == 0) return 0;
+ double completed = getCompletedTeamWorkflows().size();
+ if (completed == 0) return 0;
+ return completed / getTeamArts().size() * 100;
+ }
+
+ public Collection<TaskArtifact> getCompletedTaskWorkflows() throws OseeCoreException {
+ Set<TaskArtifact> tasks = new HashSet<TaskArtifact>();
+ for (TaskArtifact team : getTaskArts()) {
+ if (team.getSmaMgr().isCancelledOrCompleted()) {
+ tasks.add(team);
+ }
+ }
+ return tasks;
+ }
+
+ public double getPercentCompleteByTaskWorkflow() throws OseeCoreException {
+ if (getTaskArts().size() == 0) return 0;
+ double completed = getCompletedTaskWorkflows().size();
+ if (completed == 0) return 0;
+ return completed / getTaskArts().size() * 100;
+ }
+
+ /**
+ * @return the str
+ */
+ @Override
+ public String toString() {
+ return str;
+ }
+
+ public static String getEstRemainMetrics(Collection<? extends Artifact> smas) throws OseeCoreException {
+ return new SMAMetrics(smas).str;
+ }
+
+ public SMAMetrics(Collection<? extends Artifact> smas) throws OseeCoreException {
+ this(smas, null);
+ }
+
+ public SMAMetrics(Collection<? extends Artifact> artifacts, VersionArtifact versionArtifact) throws OseeCoreException {
+ this.versionArtifact = versionArtifact;
+ if (artifacts.size() == 0) return;
+ getInheritedSmasRecursive(artifacts, smasInherited);
+ for (Artifact art : artifacts) {
+ if (art instanceof ActionArtifact) {
+ actionArts.add((ActionArtifact) art);
+ }
+ }
+ for (Artifact art : smasInherited) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ teamArts.add((TeamWorkFlowArtifact) art);
+ } else if (art instanceof TaskArtifact) {
+ taskArts.add((TaskArtifact) art);
+ } else if (art instanceof ReviewSMArtifact) {
+ reviewArts.add((ReviewSMArtifact) art);
+ }
+ if (art instanceof StateMachineArtifact) {
+ smas.add((StateMachineArtifact) art);
+ Collection<User> users = ((StateMachineArtifact) art).getSmaMgr().getStateMgr().getAssignees();
+ assignees.addAll(users);
+ assigneesAssignedOrCompleted.addAll(users);
+ for (User user : users) {
+ userToAssignedSmas.put(user, art);
+ }
+ if (((StateMachineArtifact) art).getSmaMgr().isCompleted()) {
+ Collection<User> implementers = ((StateMachineArtifact) art).getImplementers();
+ assigneesAssignedOrCompleted.addAll(implementers);
+ for (User user : implementers) {
+ userToCompletedSmas.put(user, art);
+ }
+ }
+ }
+ }
+ estHours = 0;
+ hrsRemain = 0;
+ hrsSpent = 0;
+ manDaysNeeded = 0;
+ cummulativeTeamPercentComplete = 0;
+ manDaysNeeded = 0;
+ for (TeamWorkFlowArtifact team : teamArts) {
+ hrsRemain += team.getWorldViewRemainHours();
+ estHours += team.getWorldViewEstimatedHours();
+ hrsSpent += team.getWorldViewHoursSpentTotal();
+ manDaysNeeded += team.getWorldViewManDaysNeeded();
+ cummulativeTeamPercentComplete += team.getWorldViewPercentCompleteTotal();
+ }
+ if (hrsRemain != 0) manDaysNeeded = hrsRemain / manDayHrs;
+ percentCompleteByTeamPercents = 0;
+ if (getNumTeamWfs() > 0 && cummulativeTeamPercentComplete > 0) {
+ percentCompleteByTeamPercents = cummulativeTeamPercentComplete / getNumTeamWfs();
+ }
+ for (TaskArtifact task : taskArts) {
+ cummulativeTaskPercentComplete += task.getWorldViewPercentCompleteTotal();
+ }
+ percentCompleteByTaskPercents = 0;
+ if (getNumTasks() > 0 && cummulativeTaskPercentComplete > 0) {
+ percentCompleteByTaskPercents = cummulativeTaskPercentComplete / getNumTasks();
+ }
+
+ estRelDate = null;
+ Date today = new Date();
+ daysTillRel = 0;
+ if (versionArtifact != null) {
+ estRelDate = versionArtifact.getEstimatedReleaseDate();
+ if (estRelDate != null && estRelDate.after(today)) {
+ daysTillRel = (estRelDate.getTime() - today.getTime()) / MILLISECS_PER_DAY;
+ }
+ }
+ str =
+ String.format("TeamWFs: %s Tasks: %s EstHrs: %5.2f %sCmp: %5.2f RmnHrs: %5.2f HrsSpnt: %5.2f %s %s",
+ getNumTeamWfs(), getNumTasks(), estHours, "%", percentCompleteByTeamPercents, hrsRemain, hrsSpent,
+ (manDaysNeeded > 0 ? String.format("ManDaysNeeded: %5.2f ", manDaysNeeded) : ""),
+ (versionArtifact != null ? String.format("Version: %s EstRelDate: %s DaysLeft: %d ",
+ versionArtifact.getDescriptiveName(), (estRelDate == null ? "Not Set" : XDate.getDateStr(
+ estRelDate, XDate.MMDDYY)), daysTillRel) : ""));
+ }
+
+ /**
+ * @return the assigneesAssignedOrCompleted
+ */
+ public Set<User> getAssigneesAssignedOrCompleted() {
+ return assigneesAssignedOrCompleted;
+ }
+
+ public void getInheritedSmasRecursive(Collection<? extends Artifact> artifacts, Set<StateMachineArtifact> smas) throws OseeCoreException {
+ for (Artifact art : artifacts) {
+ if (art instanceof StateMachineArtifact) {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ smas.add(sma);
+ smas.addAll(sma.getSmaMgr().getReviewManager().getReviews());
+ getInheritedSmasRecursive(sma.getSmaMgr().getReviewManager().getReviews(), smas);
+ smas.addAll(sma.getSmaMgr().getTaskMgr().getTaskArtifacts());
+ } else if (art instanceof ActionArtifact) {
+ smas.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ getInheritedSmasRecursive(((ActionArtifact) art).getTeamWorkFlowArtifacts(), smas);
+ }
+ }
+ }
+
+ public String toStringObjectBreakout() {
+ return String.format("Actions: %s - Team Workflows: %s - Tasks: %s - Reviews: %s ", getNumActions(),
+ getNumTeamWfs(), getNumTasks(), getNumReviews());
+ }
+
+ public String toStringLong() {
+ return String.format(
+ "%s\nEstimated Hours: %5.2f Percent Complete: %5.2f Remaining Hours: %5.2f ManDaysNeeded: %5.2f \nHours Spent: %5.2f %s",
+ toStringObjectBreakout(), estHours, percentCompleteByTeamPercents, hrsRemain, manDaysNeeded, hrsSpent,
+ (versionArtifact != null ? String.format("\nVersion: %s Estimated Release Date: %s Days Left: %d ",
+ versionArtifact.getDescriptiveName(), (estRelDate == null ? "Not Set" : XDate.getDateStr(estRelDate,
+ XDate.MMDDYY)), daysTillRel) : ""));
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/StateManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/StateManager.java
new file mode 100644
index 00000000000..14ae2191db5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/StateManager.java
@@ -0,0 +1,274 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.util.widgets.XCurrentStateDam;
+import org.eclipse.osee.ats.util.widgets.XStateDam;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateManager {
+
+ private final XCurrentStateDam currentStateDam;
+ private final XStateDam stateDam;
+ private static Collection<User> EMPTY_USER_ARRAY = new ArrayList<User>(0);
+
+ public StateManager(SMAManager smaMgr) {
+ super();
+ currentStateDam = new XCurrentStateDam(smaMgr.getSma());
+ stateDam = new XStateDam(smaMgr.getSma());
+ }
+
+ /**
+ * Return current or past state from name
+ *
+ * @param name
+ * @param create TODO
+ * @return state matching name
+ */
+ private SMAState getSMAState(String name, boolean create) throws OseeCoreException {
+ if (currentStateDam.getState().getName().equals(name))
+ return currentStateDam.getState();
+ else
+ return (stateDam.getState(name, create));
+ }
+
+ /**
+ * Return Hours Spent for State
+ *
+ * @param stateName
+ * @return hours spent or 0 if none
+ */
+ public double getHoursSpent(String stateName) throws OseeCoreException {
+ SMAState state = getSMAState(stateName, false);
+ if (state == null) return 0.0;
+ return state.getHoursSpent();
+ }
+
+ public double getHoursSpent() throws OseeCoreException {
+ return getHoursSpent(getCurrentStateName());
+ }
+
+ /**
+ * Return Percent Complete for State
+ *
+ * @param stateName
+ * @return percent complete or 0 if none
+ */
+ public int getPercentComplete(String stateName) throws OseeCoreException {
+ if (stateName.equals(DefaultTeamState.Completed) || stateName.equals(DefaultTeamState.Cancelled)) return 100;
+ SMAState state = getSMAState(stateName, false);
+ if (state == null) return 0;
+ return state.getPercentComplete();
+
+ }
+
+ public int getPercentComplete() throws OseeCoreException {
+ return getPercentComplete(getCurrentStateName());
+ }
+
+ public String getCurrentStateName() throws OseeCoreException {
+ return currentStateDam.getState().getName();
+ }
+
+ public Collection<User> getAssignees() throws OseeCoreException {
+ return getAssignees(getCurrentStateName());
+ }
+
+ public Collection<User> getAssignees(String stateName) throws OseeCoreException {
+ SMAState state = getSMAState(stateName, false);
+ if (state != null)
+ return state.getAssignees();
+ else
+ return EMPTY_USER_ARRAY;
+ }
+
+ public void updateMetrics(double additionalHours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ updateMetrics(getCurrentStateName(), additionalHours, percentComplete, logMetrics);
+ }
+
+ public void updateMetrics(String stateName, double additionalHours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ if (stateName.equals(getCurrentStateName()))
+ currentStateDam.updateMetrics(additionalHours, percentComplete, logMetrics);
+ else
+ stateDam.updateMetrics(stateName, additionalHours, percentComplete, logMetrics);
+ }
+
+ public void setMetrics(double hours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ currentStateDam.setMetrics(hours, percentComplete, logMetrics);
+ }
+
+ /**
+ * Sets the assignees AND writes to SMA. Does not persist.
+ *
+ * @param assignees
+ * @throws Exception
+ */
+ public void setAssignees(Collection<User> assignees) throws OseeCoreException {
+ SMAState state = getSMAState(getCurrentStateName(), false);
+ state.setAssignees(assignees);
+ putState(state);
+ }
+
+ /**
+ * Sets the assignee AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws Exception
+ */
+ public void setAssignee(String stateName, User assignee) throws OseeCoreException {
+ if (!isStateVisited(stateName)) throw new IllegalArgumentException("State " + stateName + " does not exist.");
+ SMAState state = getSMAState(stateName, false);
+ state.setAssignee(assignee);
+ putState(state);
+ }
+
+ /**
+ * Sets the assignee AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws Exception
+ */
+ public void setAssignee(User assignee) throws OseeCoreException {
+ SMAState state = getSMAState(getCurrentStateName(), false);
+ state.setAssignee(assignee);
+ putState(state);
+ }
+
+ /**
+ * Removes the assignee from stateName state AND writes to SMA. Does not persist.
+ *
+ * @param stateName
+ * @param assignee
+ * @throws Exception
+ */
+ public void removeAssignee(String stateName, User assignee) throws OseeCoreException {
+ if (!isStateVisited(stateName)) return;
+ SMAState state = getSMAState(stateName, false);
+ state.removeAssignee(assignee);
+ putState(state);
+ }
+
+ /**
+ * Removes the assignee AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws Exception
+ */
+ public void removeAssignee(User assignee) throws OseeCoreException {
+ SMAState state = getSMAState(getCurrentStateName(), false);
+ state.removeAssignee(assignee);
+ putState(state);
+ }
+
+ /**
+ * Adds the assignee AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws Exception
+ */
+ public void addAssignee(User assignee) throws OseeCoreException {
+ SMAState state = getSMAState(getCurrentStateName(), false);
+ state.addAssignee(assignee);
+ putState(state);
+ }
+
+ /**
+ * Removes ALL assignees AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws Exception
+ */
+ public void clearAssignees() throws OseeCoreException {
+ SMAState state = getSMAState(getCurrentStateName(), false);
+ state.clearAssignees();
+ putState(state);
+ }
+
+ public boolean isStateVisited(String name) throws OseeCoreException {
+ return getVisitedStateNames().contains(name);
+ }
+
+ public void transitionHelper(Collection<User> toAssignees, boolean persist, WorkPageDefinition fromPage, WorkPageDefinition toPage, String toStateName, String cancelReason) throws OseeCoreException {
+ // Set XCurrentState info to XState
+ stateDam.setState(currentStateDam.getState());
+
+ // Set XCurrentState; If been to this state, copy state info from prev state; else create new
+ SMAState previousState = stateDam.getState(toStateName, false);
+ if (previousState != null) {
+ if (toAssignees.size() > 0) previousState.setAssignees(toAssignees);
+ currentStateDam.setState(previousState);
+ } else {
+ currentStateDam.setState(new SMAState(toStateName, toAssignees));
+ }
+ }
+
+ /**
+ * Initializes state machine and sets the current state to stateName
+ *
+ * @param stateName
+ * @throws Exception
+ */
+ public void initializeStateMachine(String stateName) throws OseeCoreException {
+ initializeStateMachine(stateName, null);
+ }
+
+ /**
+ * Initializes state machine and sets the current state to stateName
+ *
+ * @param stateName
+ * @param assignees
+ * @throws Exception
+ */
+ public void initializeStateMachine(String stateName, Collection<User> assignees) throws OseeCoreException {
+ SMAState smaState = null;
+ if (getVisitedStateNames().contains(stateName)) {
+ smaState = getSMAState(stateName, false);
+ } else {
+ if (assignees == null) {
+ smaState = new SMAState(stateName, UserManager.getUser());
+ } else {
+ smaState = new SMAState(stateName, assignees);
+ }
+ }
+ currentStateDam.setState(smaState);
+ }
+
+ private void putState(SMAState state) throws OseeCoreException {
+ if (getCurrentStateName().equals(state.getName()))
+ currentStateDam.setState(state);
+ else
+ stateDam.setState(state);
+ }
+
+ public Collection<String> getVisitedStateNames() throws OseeCoreException {
+ Set<String> names = new HashSet<String>();
+ for (SMAState state : stateDam.getStates()) {
+ names.add(state.getName());
+ }
+ names.add(getCurrentStateName());
+ return names;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java
new file mode 100644
index 00000000000..2206740c6a7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ISubscribableArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class Subscribe {
+
+ private final StateMachineArtifact sma;
+
+ public Subscribe(StateMachineArtifact sma) {
+ super();
+ this.sma = sma;
+ }
+
+ public void toggleSubscribe() {
+ toggleSubscribe(true);
+ }
+
+ public void toggleSubscribe(boolean prompt) {
+ try {
+ if (((ISubscribableArtifact) sma).amISubscribed()) {
+ boolean result = true;
+ if (prompt) result =
+ MessageDialog.openQuestion(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Un-Subscribe",
+ "You are currently subscribed to receive emails when this artifact transitions." + "\n\nAre You sure you wish to Un-Subscribe?");
+ if (result) {
+ ((ISubscribableArtifact) sma).removeSubscribed(UserManager.getUser());
+ }
+ } else {
+ boolean result = true;
+ if (prompt) result =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Subscribe",
+ "Are you sure you wish to subscribe to receive emails when this artifact transitions?");
+ if (result) {
+ ((ISubscribableArtifact) sma).addSubscribed(UserManager.getUser());
+ }
+
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java
new file mode 100644
index 00000000000..aa48528b483
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/TeamBasedDefaultBranchProvider.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IDefaultInitialBranchesProvider;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class TeamBasedDefaultBranchProvider implements IDefaultInitialBranchesProvider {
+
+ public Collection<Branch> getDefaultInitialBranches() throws OseeCoreException {
+ User user = UserManager.getUser();
+ try {
+ Collection<TeamDefinitionArtifact> teams =
+ user.getRelatedArtifacts(AtsRelation.TeamMember_Team, TeamDefinitionArtifact.class);
+ Collection<Branch> branches = new LinkedList<Branch>();
+
+ Branch branch;
+ for (TeamDefinitionArtifact team : teams) {
+ branch = team.getTeamBranch();
+ if (branch != null) {
+ branches.add(branch);
+ }
+ }
+
+ return branches;
+ } catch (Exception ex) {
+ OseeLog.log(TeamBasedDefaultBranchProvider.class, Level.WARNING, ex);
+ }
+
+ return Collections.emptyList();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/UsersByIds.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/UsersByIds.java
new file mode 100644
index 00000000000..f621b3de091
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/UsersByIds.java
@@ -0,0 +1,50 @@
+/*
+ * Created on Sep 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UsersByIds {
+
+ public static Pattern userPattern = Pattern.compile("<(.*?)>");
+
+ public static String getStorageString(Collection<User> users) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (User u : users)
+ sb.append("<" + u.getUserId() + ">");
+ return sb.toString();
+ }
+
+ public static Collection<User> getUsers(String sorageString) throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ Matcher m = userPattern.matcher(sorageString);
+ while (m.find()) {
+ String userId = m.group(1);
+ if (userId == null || userId.equals("")) throw new IllegalArgumentException("Blank userId specified.");
+ try {
+ User u = UserManager.getUserByUserId(m.group(1));
+ users.add(u);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return users;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionMetrics.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionMetrics.java
new file mode 100644
index 00000000000..29289757fa5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionMetrics.java
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionMetrics {
+
+ private final VersionArtifact verArt;
+ private final VersionTeamMetrics verTeamMet;
+
+ public VersionMetrics(VersionArtifact verArt, VersionTeamMetrics verTeamMet) {
+ this.verArt = verArt;
+ this.verTeamMet = verTeamMet;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(verArt.getDescriptiveName() + "\n");
+ try {
+ sb.append("Workflows: " + verArt.getTargetedForTeamArtifacts().size());
+ sb.append(" Problem: " + getTeamWorkFlows(ChangeType.Problem).size() + " Improve: " + getTeamWorkFlows(
+ ChangeType.Improvement).size() + " Support: " + getTeamWorkFlows(ChangeType.Support).size());
+ sb.append(" Release Date: " + verArt.getReleaseDate());
+ VersionMetrics prevVerMet = getPreviousVerMetViaReleaseDate();
+ if (prevVerMet == null) {
+ sb.append(" Prev Release Version: <not found>");
+ } else {
+ sb.append(" Prev Release Version \"" + prevVerMet + "\" Release Date: " + verArt.getReleaseDate());
+ }
+ sb.append(" Start Date: " + getReleaseStartDate());
+ sb.append(" Num Days: " + getNumberDaysInRelease());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return sb.toString();
+ }
+
+ public Integer getNumberDaysInRelease() throws OseeCoreException {
+ Date startDate = getReleaseStartDate();
+ if (startDate == null) return null;
+ if (verArt.getReleaseDate() == null) return null;
+ return XDate.calculateDifference(startDate, verArt.getReleaseDate());
+ }
+
+ public Date getReleaseStartDate() throws OseeCoreException {
+ VersionMetrics prevVerMet = getPreviousVerMetViaReleaseDate();
+ if (prevVerMet == null) return null;
+ return prevVerMet.getVerArt().getReleaseDate();
+ }
+
+ public Collection<TeamWorkFlowArtifact> getTeamWorkFlows(ChangeType... changeType) throws OseeCoreException {
+ List<ChangeType> changeTypes = Arrays.asList(changeType);
+ Set<TeamWorkFlowArtifact> teams = new HashSet<TeamWorkFlowArtifact>();
+ for (TeamWorkFlowArtifact team : verArt.getTargetedForTeamArtifacts()) {
+ if (changeTypes.contains(team.getChangeType())) teams.add(team);
+ }
+ return teams;
+ }
+
+ public VersionMetrics getPreviousVerMetViaReleaseDate() throws OseeCoreException {
+ if (verArt.getReleaseDate() == null) return null;
+ int index = verTeamMet.getReleasedOrderedVersions().indexOf(this);
+ if (index > 0) return verTeamMet.getReleasedOrderedVersions().get(index - 1);
+ return null;
+ }
+
+ public VersionMetrics getNextVerMetViaReleaseDate() throws OseeCoreException {
+ if (verArt.getReleaseDate() == null) return null;
+ int index = verTeamMet.getReleasedOrderedVersions().indexOf(this);
+ if (index < verTeamMet.getReleasedOrderedVersions().size() - 1) {
+ return verTeamMet.getReleasedOrderedVersions().get(index + 1);
+ }
+ return null;
+ }
+
+ /**
+ * @return the verArt
+ */
+ public VersionArtifact getVerArt() {
+ return verArt;
+ }
+
+ /**
+ * @return the verTeamMet
+ */
+ public VersionTeamMetrics getVerTeamMet() {
+ return verTeamMet;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java
new file mode 100644
index 00000000000..15b6958c327
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultView;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionReportJob extends Job {
+
+ protected final String title;
+ protected final VersionArtifact verArt;
+
+ public VersionReportJob(String title, VersionArtifact verArt) {
+ super("Creating Release Report");
+ this.title = title;
+ this.verArt = verArt;
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ final String html = getReleaseReportHtml(title + " - " + XDate.getDateNow(XDate.MMDDYYHHMM), verArt, monitor);
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ XResultView.getResultView().addResultPage(new XResultPage(title, html, Manipulations.HTML_MANIPULATIONS));
+ AWorkbench.popup("Complete", getName() + " Complete...Results in ATS Results");
+ }
+ });
+
+ } catch (Exception ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ public static String getReleaseReportHtml(String title, VersionArtifact verArt, IProgressMonitor monitor) throws OseeCoreException {
+ if (verArt == null) {
+ AWorkbench.popup("ERROR", "Must select product, config and version.");
+ return null;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.heading(3, title + getReleasedString(verArt), verArt.getDescriptiveName()));
+ sb.append(getTeamWorkflowReport(verArt.getTargetedForTeamArtifacts(), null, monitor));
+ return sb.toString();
+ }
+
+ public static String getFullReleaseReport(TeamDefinitionArtifact teamDef, IProgressMonitor monitor) throws OseeCoreException {
+ // Sort by release date and estimated release date
+ Map<String, VersionArtifact> dateToVerArt = new HashMap<String, VersionArtifact>();
+ for (VersionArtifact verArt : teamDef.getVersionsArtifacts()) {
+ if (verArt.getReleaseDate() != null)
+ dateToVerArt.put(verArt.getReleaseDate().getTime() + verArt.getDescriptiveName(), verArt);
+ else if (verArt.getEstimatedReleaseDate() != null)
+ dateToVerArt.put(verArt.getEstimatedReleaseDate().getTime() + verArt.getDescriptiveName(), verArt);
+ else
+ dateToVerArt.put("Un-Released - No Estimated Release " + verArt.getDescriptiveName(), verArt);
+ }
+ String[] dateSort = dateToVerArt.keySet().toArray(new String[dateToVerArt.size()]);
+ Arrays.sort(dateSort);
+ // Create hyperlinks reverse sorted
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.heading(2, teamDef + " Releases"));
+ sb.append(AHTML.bold("Report generated by OSEE ATS on " + XDate.getDateNow()) + AHTML.newline(2));
+ for (int x = dateSort.length - 1; x >= 0; x--) {
+ VersionArtifact verArt = dateToVerArt.get(dateSort[x]);
+ if (verArt.isReleased())
+ sb.append(AHTML.getHyperlink("#" + verArt.getDescriptiveName(),
+ verArt.getDescriptiveName() + VersionReportJob.getReleasedString(verArt)) + AHTML.newline());
+ else if (verArt.getEstimatedReleaseDate() != null)
+ sb.append(verArt.getDescriptiveName() + " - Un-Released - Estimated Release Date: " + getDateString(verArt.getEstimatedReleaseDate()) + AHTML.newline());
+ else
+ sb.append(verArt.getDescriptiveName() + " - Un-Released - No Estimated Release Date" + AHTML.newline());
+ }
+ sb.append(AHTML.addSpace(5));
+ int x = 1;
+ for (VersionArtifact verArt : teamDef.getVersionsArtifacts()) {
+ if (monitor != null) {
+ String str = "Processing version " + x++ + "/" + teamDef.getVersionsArtifacts().size();
+ monitor.subTask(str);
+ }
+ if (verArt.isReleased()) {
+ String html = VersionReportJob.getReleaseReportHtml(verArt.getDescriptiveName(), verArt, null);
+ sb.append(html);
+ }
+ }
+ return sb.toString();
+ }
+
+ private static String getDateString(Date date) {
+ if (date != null) return XDate.getDateStr(date, XDate.MMDDYY);
+ return null;
+ }
+
+ public static String getReleasedString(VersionArtifact verArt) throws OseeCoreException {
+ String released = "";
+ if (verArt.getSoleAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), null) != null) {
+ released =
+ " - " + "Released: " + getDateString(verArt.getSoleAttributeValue(
+ ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), null, Date.class));
+ }
+ return released;
+ }
+
+ public static String getTeamWorkflowReport(Collection<TeamWorkFlowArtifact> teamArts, Integer backgroundColor, IProgressMonitor monitor) throws OseeCoreException {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.beginMultiColumnTable(100, 1, backgroundColor));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Team", "Priority", "Change", "Title", "HRID"}));
+ int x = 1;
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (TeamWorkFlowArtifact team : teamArts)
+ teamDefs.add(team.getTeamDefinition());
+ for (TeamDefinitionArtifact teamDef : teamDefs) {
+ for (TeamWorkFlowArtifact team : teamArts) {
+ if (team.getTeamDefinition().equals(teamDef)) {
+ String str = "Processing team " + x++ + "/" + teamArts.size();
+ if (monitor != null) monitor.subTask(str);
+ System.out.println(str);
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {"Action", team.getTeamName(),
+ team.getWorldViewPriority(), team.getWorldViewChangeTypeStr(), team.getDescriptiveName(),
+ team.getHumanReadableId()}, null, (x % 2 == 0 ? null : "#cccccc")));
+
+ SMAManager smaMgr = new SMAManager(team);
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts()) {
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {"Task", "", "", "",
+ taskArt.getDescriptiveName(), taskArt.getHumanReadableId()}, null,
+ (x % 2 == 0 ? null : "#cccccc")));
+ }
+ }
+ }
+ }
+ sb.append(AHTML.endMultiColumnTable());
+ return sb.toString();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionTeamMetrics.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionTeamMetrics.java
new file mode 100644
index 00000000000..3f4e517e7cb
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionTeamMetrics.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionTeamMetrics {
+
+ private final TeamDefinitionArtifact verTeamDef;
+ private List<VersionMetrics> releasedOrderedVersions = new ArrayList<VersionMetrics>();
+ private Set<VersionMetrics> verMets = new HashSet<VersionMetrics>();
+ Map<Date, VersionMetrics> relDateToVerMet = new HashMap<Date, VersionMetrics>();
+
+ public VersionTeamMetrics(TeamDefinitionArtifact verTeamDef) throws OseeCoreException {
+ this.verTeamDef = verTeamDef;
+ loadMetrics();
+ }
+
+ private void loadMetrics() throws OseeCoreException {
+ bulkLoadArtifacts();
+ orderReleasedVersions();
+ }
+
+ private void bulkLoadArtifacts() throws OseeCoreException {
+ RelationManager.getRelatedArtifacts(Arrays.asList(this.verTeamDef), 6,
+ CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, AtsRelation.TeamDefinitionToVersion_Version,
+ AtsRelation.TeamWorkflowTargetedForVersion_Workflow, AtsRelation.SmaToTask_Task,
+ AtsRelation.ActionToWorkflow_Action);
+ }
+
+ private Map<TeamWorkFlowArtifact, Date> teamWorkflowToOrigDate = null;
+
+ public Collection<TeamWorkFlowArtifact> getWorkflowsOriginatedBetween(Date startDate, Date endDate) throws OseeCoreException {
+ if (teamWorkflowToOrigDate == null) {
+ teamWorkflowToOrigDate = new HashMap<TeamWorkFlowArtifact, Date>();
+ for (VersionArtifact verArt : verTeamDef.getVersionsArtifacts()) {
+ for (TeamWorkFlowArtifact team : verArt.getTargetedForTeamArtifacts()) {
+ Date origDate = team.getSmaMgr().getLog().getCreationDate();
+ teamWorkflowToOrigDate.put(team, origDate);
+ }
+ }
+ }
+ Set<TeamWorkFlowArtifact> teams = new HashSet<TeamWorkFlowArtifact>();
+ for (Entry<TeamWorkFlowArtifact, Date> entry : teamWorkflowToOrigDate.entrySet()) {
+ if (entry.getValue() != null && entry.getValue().after(startDate) && entry.getValue().before(endDate)) {
+ teams.add(entry.getKey());
+ }
+ }
+ return teams;
+ }
+
+ private void orderReleasedVersions() throws OseeCoreException {
+ for (VersionArtifact ver : verTeamDef.getVersionsArtifacts()) {
+ VersionMetrics verMet = new VersionMetrics(ver, this);
+ if (ver.getReleaseDate() != null) {
+ relDateToVerMet.put(ver.getReleaseDate(), verMet);
+ }
+ verMets.add(verMet);
+ }
+ Date[] releases = relDateToVerMet.keySet().toArray(new Date[relDateToVerMet.keySet().size()]);
+ Arrays.sort(releases);
+ for (Date date : releases) {
+ releasedOrderedVersions.add(relDateToVerMet.get(date));
+ }
+ }
+
+ /**
+ * @return the verTeamDef
+ */
+ public TeamDefinitionArtifact getVerTeamDef() {
+ return verTeamDef;
+ }
+
+ /**
+ * @return the releasedOrderedVersions
+ */
+ public List<VersionMetrics> getReleasedOrderedVersions() {
+ return releasedOrderedVersions;
+ }
+
+ /**
+ * @return the verMets
+ */
+ public Set<VersionMetrics> getVerMets() {
+ return verMets;
+ }
+
+ /**
+ * @return the relDateToVerMet
+ */
+ public Map<Date, VersionMetrics> getRelDateToVerMet() {
+ return relDateToVerMet;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
new file mode 100644
index 00000000000..6ae5dd9679d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import org.eclipse.osee.framework.ui.skynet.widgets.XHyperlabelGroupSelection;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetProvider;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWidgetProvider implements IXWidgetProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetProvider#createXWidget(java.lang.String, java.lang.String, boolean, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData)
+ */
+ @Override
+ public XWidget createXWidget(String widgetName, String name, DynamicXWidgetLayoutData widgetLayoutData) {
+ XWidget toReturn = null;
+ if (widgetName.equals(XHyperlabelTeamDefinitionSelection.WIDGET_ID)) {
+ XHyperlabelTeamDefinitionSelection widget = new XHyperlabelTeamDefinitionSelection(name);
+ widget.setToolTip(widgetLayoutData.getToolTip());
+ toReturn = widget;
+ }
+ if (widgetName.equals(XHyperlabelGroupSelection.WIDGET_ID)) {
+ XHyperlabelGroupSelection widget = new XHyperlabelGroupSelection(name);
+ widget.setToolTip(widgetLayoutData.getToolTip());
+ toReturn = widget;
+ }
+ return toReturn;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java
new file mode 100644
index 00000000000..544bc8ef1ad
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java
@@ -0,0 +1,167 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.logging.Level;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+public class DecisionOption {
+ private String name;
+ private Collection<User> assignees = new HashSet<User>();
+ private boolean followupRequired;
+
+ public DecisionOption(String name, Collection<User> assignees, boolean followup) {
+ this.name = name;
+ this.followupRequired = followup;
+ if (assignees != null) this.assignees = assignees;
+ }
+
+ public DecisionOption(String name, User assignee, boolean followup) {
+ this.name = name;
+ this.followupRequired = followup;
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ public DecisionOption(String name) {
+ this(name, (User) null, false);
+ }
+
+ public DecisionOption() {
+ this("", (User) null, false);
+ }
+
+ public String toString() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof DecisionOption) {
+ DecisionOption state = (DecisionOption) obj;
+ if (!state.name.equals(name)) return false;
+ return true;
+ }
+ return super.equals(obj);
+ }
+
+ public Collection<User> getAssignees() {
+ return assignees;
+ }
+
+ /**
+ * Sets the assigness but DOES NOT write to SMA. This method should NOT be called outside the SMAManager.
+ *
+ * @param assignees
+ */
+ public void setAssignees(Collection<User> assignees) {
+ this.assignees.clear();
+ if (assignees != null) this.assignees.addAll(assignees);
+ }
+
+ /**
+ * Sets the assignes but DOES NOT write to SMA. This method should NOT be called outside the SMAManager.
+ *
+ * @param assignee
+ */
+ public void setAssignee(User assignee) {
+ this.assignees.clear();
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ /**
+ * @param assignee
+ */
+ public void addAssignee(User assignee) {
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toXml() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer(name);
+ sb.append(";");
+ for (User u : assignees)
+ sb.append("<" + u.getUserId() + ">");
+ sb.append(";");
+ sb.append(followupRequired);
+ return sb.toString();
+ }
+
+ public Result setFromXml(String xml) {
+ Matcher m = Pattern.compile("^(.*?);(.*?);(.*?)$").matcher(xml);
+ if (m.find()) {
+ name = m.group(1);
+ if (name.equals("")) return new Result("Invalid name");
+ if (m.group(2).toLowerCase().equals("followup"))
+ followupRequired = true;
+ else if (m.group(2).toLowerCase().equals("completed"))
+ followupRequired = false;
+ else
+ return new Result("Invalid followup string \"" + m.group(2) + "\"\nShould be followup or completed");
+ m = Pattern.compile("<(.*?)>").matcher(m.group(2));
+ while (m.find()) {
+ try {
+ assignees.add(UserManager.getUserByUserId(m.group(3)));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ if (followupRequired && assignees.size() == 0)
+ return new Result("If followup is specified, must set assignees.\nShould be: <userid><userid>");
+ else if (!followupRequired && assignees.size() > 0) return new Result(
+ "If completed is specified, don't specify assigness. Leave blank.\n");
+ } else
+ new Result(
+ "Can't unpack decision option data => " + xml + "\n\n" + "must be in format: \"Name;(followup|completed);<userid1><userid2>\"" + "where true if followup is required; false if not. If followup required, assignees will be userid1, userid2.");
+ return Result.TrueResult;
+ }
+
+ /**
+ * @return the followupRequired
+ */
+ public boolean isFollowupRequired() {
+ return followupRequired;
+ }
+
+ /**
+ * @param followupRequired the followupRequired to set
+ */
+ public void setFollowupRequired(boolean followupRequired) {
+ this.followupRequired = followupRequired;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java
new file mode 100644
index 00000000000..989dadd7c4d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java
@@ -0,0 +1,263 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewDecisionReviewJob;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.UsersByIds;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ReviewManager {
+
+ private final SMAManager smaMgr;
+ private static String VALIDATE_REVIEW_TITLE = "Is the resolution of this Action valid?";
+
+ public ReviewManager(SMAManager smaMgr) {
+ super();
+ this.smaMgr = smaMgr;
+ }
+
+ /**
+ * Create a new decision review configured and transitioned to handle action validation
+ *
+ * @param force will force the creation of the review without checking that a review should be created
+ * @param transaction
+ * @return new review
+ * @throws
+ */
+ public DecisionReviewArtifact createValidateReview(boolean force, SkynetTransaction transaction) throws OseeCoreException {
+ // If not validate page, don't do anything
+ if (!force && !AtsWorkDefinitions.isValidatePage(smaMgr.getWorkPageDefinition())) {
+ return null;
+ }
+ // If validate review already created for this state, return
+ if (!force && getReviewsFromCurrentState().size() > 0) {
+ for (ReviewSMArtifact rev : getReviewsFromCurrentState()) {
+ if (rev.getDescriptiveName().equals(VALIDATE_REVIEW_TITLE)) return null;
+ }
+ }
+ // Create validate review
+ try {
+
+ DecisionReviewArtifact decRev =
+ NewDecisionReviewJob.createNewDecisionReview(
+ smaMgr.getSma(),
+ AtsWorkDefinitions.isValidateReviewBlocking(smaMgr.getWorkPageDefinition()) ? ReviewBlockType.Transition : ReviewBlockType.None,
+ true);
+ decRev.setDescriptiveName(VALIDATE_REVIEW_TITLE);
+ decRev.setSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(),
+ "No;Followup;" + getValidateReviewFollowupUsersStr() + "\n" + "Yes;Completed;");
+
+ SMAManager revSmaMgr = new SMAManager(decRev);
+ revSmaMgr.transition(DecisionReviewArtifact.DecisionReviewState.Decision.name(), smaMgr.getOriginator(), true, transaction);
+
+ return decRev;
+
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public PeerToPeerReviewArtifact createNewPeerToPeerReview(String reviewTitle, String againstState, SkynetTransaction transaction) throws OseeCoreException {
+ return createNewPeerToPeerReview(reviewTitle, againstState, UserManager.getUser(), new Date(), transaction);
+ }
+
+ public PeerToPeerReviewArtifact createNewPeerToPeerReview(String reviewTitle, String againstState, User origUser, Date origDate, SkynetTransaction transaction) throws OseeCoreException {
+ return createNewPeerToPeerReview(smaMgr.getSma(), reviewTitle, againstState, origUser, origDate, transaction);
+ }
+
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(StateMachineArtifact teamParent, String reviewTitle, String againstState, User origUser, Date origDate, SkynetTransaction transaction) throws OseeCoreException {
+ PeerToPeerReviewArtifact peerToPeerRev =
+ (PeerToPeerReviewArtifact) ArtifactTypeManager.addArtifact(PeerToPeerReviewArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch(), reviewTitle == null ? "Peer to Peer Review" : reviewTitle);
+
+ if (teamParent != null) {
+ teamParent.addRelation(AtsRelation.TeamWorkflowToReview_Review, peerToPeerRev);
+ if (againstState != null) peerToPeerRev.setSoleAttributeValue(
+ ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), againstState);
+ }
+
+ peerToPeerRev.getSmaMgr().getLog().addLog(LogType.Originated, "", "", origDate, origUser);
+ peerToPeerRev.setSoleAttributeValue(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName(),
+ ReviewBlockType.None.name());
+
+ // Initialize state machine
+ peerToPeerRev.getSmaMgr().getStateMgr().initializeStateMachine(DecisionReviewArtifact.DecisionReviewState.Prepare.name());
+ peerToPeerRev.getSmaMgr().getLog().addLog(LogType.StateEntered, DecisionReviewArtifact.DecisionReviewState.Prepare.name(),
+ "", origDate, origUser);
+ peerToPeerRev.persistAttributesAndRelations(transaction);
+ return peerToPeerRev;
+ }
+
+ /**
+ * Return Remain Hours for all reviews
+ *
+ * @return remain hours
+ * @throws Exception
+ */
+ public double getRemainHours() throws OseeCoreException {
+ double hours = 0;
+ for (ReviewSMArtifact reviewArt : getReviews())
+ hours += reviewArt.getRemainHoursFromArtifact();
+ return hours;
+
+ }
+
+ /**
+ * Return Estimated Review Hours of "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Estimated Hours
+ */
+ public double getEstimatedHours(String relatedToStateName) throws OseeCoreException {
+ double hours = 0;
+ for (ReviewSMArtifact revArt : getReviews(relatedToStateName))
+ hours += revArt.getEstimatedHoursTotal();
+ return hours;
+ }
+
+ /**
+ * Return Estimated Hours for all reviews
+ *
+ * @return estimated hours
+ * @throws Exception
+ */
+ public double getEstimatedHours() throws OseeCoreException {
+ double hours = 0;
+ for (ReviewSMArtifact revArt : getReviews())
+ hours += revArt.getEstimatedHoursTotal();
+ return hours;
+
+ }
+
+ public String getValidateReviewFollowupUsersStr() {
+ try {
+ return UsersByIds.getStorageString(getValidateReviewFollowupUsers());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public Collection<User> getValidateReviewFollowupUsers() throws OseeCoreException {
+ Collection<User> users = smaMgr.getStateMgr().getAssignees("Implement");
+ if (users.size() > 0) return users;
+
+ // Else if Team Workflow , return it to the leads of this team
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact) return ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getLeads();
+
+ // Else, return current user; should never hit this
+ return Arrays.asList(UserManager.getUser());
+ }
+
+ public Collection<ReviewSMArtifact> getReviews() throws OseeCoreException {
+ return smaMgr.getSma().getRelatedArtifacts(AtsRelation.TeamWorkflowToReview_Review, ReviewSMArtifact.class);
+ }
+
+ public Collection<ReviewSMArtifact> getReviewsFromCurrentState() throws OseeCoreException {
+ return getReviews(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ public Collection<ReviewSMArtifact> getReviews(String stateName) throws OseeCoreException {
+ Set<ReviewSMArtifact> arts = new HashSet<ReviewSMArtifact>();
+ if (!smaMgr.getSma().isTaskable()) return arts;
+ for (ReviewSMArtifact revArt : getReviews()) {
+ if (revArt.getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), "").equals(stateName)) arts.add(revArt);
+ }
+ return arts;
+ }
+
+ public boolean hasReviews() {
+ try {
+ return smaMgr.getSma().getRelatedArtifactsCount(AtsRelation.TeamWorkflowToReview_Review) > 0;
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return false;
+ }
+ }
+
+ public Result areReviewsComplete() {
+ return areReviewsComplete(true);
+ }
+
+ public Result areReviewsComplete(boolean popup) {
+ try {
+ for (ReviewSMArtifact reviewArt : getReviews()) {
+ SMAManager smaMgr = new SMAManager(reviewArt);
+ if (!smaMgr.isCompleted() && smaMgr.isCancelled()) return new Result("Not Complete");
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return Result.TrueResult;
+ }
+
+ public static Collection<String> getAllReviewArtifactTypeNames() {
+ return Arrays.asList(DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME);
+ }
+
+ /**
+ * Return Hours Spent for Reviews of "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Hours Spent
+ */
+ public double getHoursSpent(String relatedToStateName) throws OseeCoreException {
+ double spent = 0;
+ for (ReviewSMArtifact reviewArt : getReviews(relatedToStateName))
+ spent += reviewArt.getHoursSpentSMATotal();
+ return spent;
+ }
+
+ /**
+ * Return Total Percent Complete / # Reviews for "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Percent Complete.
+ */
+ public int getPercentComplete(String relatedToStateName) throws OseeCoreException {
+ int spent = 0;
+ Collection<ReviewSMArtifact> reviewArts = getReviews(relatedToStateName);
+ for (ReviewSMArtifact reviewArt : reviewArts)
+ spent += reviewArt.getPercentCompleteSMATotal();
+ if (spent == 0) return 0;
+ return spent / reviewArts.size();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java
new file mode 100644
index 00000000000..4b4f2f8f3a3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java
@@ -0,0 +1,204 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.UsersByIds;
+import org.eclipse.osee.framework.core.data.SystemUser;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+
+public class SMAState {
+ private String name;
+ private Collection<User> assignees = new HashSet<User>();
+ private int percentComplete = 0;
+ private double hoursSpent = 0;
+
+ public SMAState(String name, Collection<User> assignees) {
+ this.name = name;
+ if (assignees != null) this.assignees = assignees;
+ }
+
+ public SMAState(String name, User assignee) {
+ this.name = name;
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ public SMAState(String name) {
+ this(name, (User) null);
+ }
+
+ public SMAState() {
+ this("", (User) null);
+ }
+
+ @Override
+ public String toString() {
+ return name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof SMAState) {
+ SMAState state = (SMAState) obj;
+ if (!state.name.equals(name)) return false;
+ if (!state.assignees.equals(this.assignees)) return false;
+ return true;
+ }
+ return super.equals(obj);
+ }
+
+ public Collection<User> getAssignees() {
+ return assignees;
+ }
+
+ /**
+ * Sets the assigness but DOES NOT write to SMA. This method should NOT be called outside the SMAManager.
+ *
+ * @param assignees
+ * @throws OseeCoreException
+ */
+ public void setAssignees(Collection<User> assignees) throws OseeCoreException {
+ if (assignees.contains(UserManager.getUser(SystemUser.NoOne)) || assignees.contains(UserManager.getUser(SystemUser.Guest))) {
+ throw new OseeArgumentException("Can not assign workflow to NoOne or Guest");
+ }
+ if (assignees.size() > 1 && assignees.contains(UserManager.getUser(SystemUser.UnAssigned))) {
+ throw new OseeArgumentException("Can not assign to user and UnAssigned");
+ }
+ if (assignees.size() > 0 && (name.equals(DefaultTeamState.Completed.name()) || name.equals(DefaultTeamState.Cancelled.name()))) throw new OseeStateException(
+ "Can't assign completed/cancelled states.");
+ this.assignees.clear();
+ if (assignees != null) this.assignees.addAll(assignees);
+ }
+
+ public void clearAssignees() {
+ this.assignees.clear();
+ }
+
+ /**
+ * Sets the assignees but DOES NOT write to SMA. This method should NOT be called outside the SMAManager.
+ *
+ * @param assignee
+ * @throws OseeCoreException
+ * @throws IllegalOseeArgumentException
+ */
+ public void setAssignee(User assignee) throws OseeCoreException {
+ if (assignee != null && (name.equals(DefaultTeamState.Completed.name()) || name.equals(DefaultTeamState.Cancelled.name()))) {
+ throw new OseeStateException("Can't assign completed/cancelled states.");
+ }
+ if (assignee == UserManager.getUser(SystemUser.NoOne) || assignee == UserManager.getUser(SystemUser.Guest)) {
+ throw new OseeArgumentException("Can not assign workflow to NoOne or Guest");
+ }
+ this.assignees.clear();
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ /**
+ * @param assignee
+ */
+ public void addAssignee(User assignee) throws OseeCoreException {
+ if (assignee == UserManager.getUser(SystemUser.NoOne) || assignee == UserManager.getUser(SystemUser.Guest)) {
+ throw new OseeArgumentException("Can not assign workflow to NoOne or Guest");
+ }
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ public void removeAssignee(User assignee) {
+ if (assignee != null) this.assignees.remove(assignee);
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String toXml() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer(name);
+ sb.append(";");
+ sb.append(UsersByIds.getStorageString(assignees));
+ sb.append(";");
+ if (hoursSpent > 0) sb.append(getHoursSpentStr());
+ sb.append(";");
+ if (percentComplete > 0) sb.append(percentComplete);
+ return sb.toString();
+ }
+
+ public static Pattern storagePattern = Pattern.compile("^(.*?);(.*?);(.*?);(.*?)$");
+
+ public void setFromXml(String xml) throws OseeCoreException {
+ if (xml == null || xml.equals("")) {
+ name = "Unknown";
+ return;
+ }
+ Matcher m = storagePattern.matcher(xml);
+ if (m.find()) {
+ name = m.group(1);
+ if (!m.group(3).equals("")) hoursSpent = new Float(m.group(3)).doubleValue();
+ if (!m.group(4).equals("")) percentComplete = new Integer(m.group(4)).intValue();
+ assignees = UsersByIds.getUsers(m.group(2));
+ } else
+ throw new OseeArgumentException("Can't unpack state data => " + xml);
+ }
+
+ /**
+ * @return Returns the hoursSpent.
+ */
+ public double getHoursSpent() {
+ return hoursSpent;
+ }
+
+ public String getHoursSpentStr() {
+ return AtsLib.doubleToStrString(hoursSpent);
+ }
+
+ /**
+ * @param hoursSpent The hoursSpent to set.
+ */
+ public void setHoursSpent(double hoursSpent) {
+ this.hoursSpent = hoursSpent;
+ }
+
+ /**
+ * @return Returns the percentComplete.
+ */
+ public int getPercentComplete() {
+ return percentComplete;
+ }
+
+ /**
+ * @param percentComplete The percentComplete to set.
+ */
+ public void setPercentComplete(int percentComplete) {
+ this.percentComplete = percentComplete;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java
new file mode 100644
index 00000000000..4b8b5a7aebc
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.TaskArtifact.TaskStates;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskManager {
+ private final SMAManager smaMgr;
+
+ public TaskManager(SMAManager smaMgr) {
+ super();
+ this.smaMgr = smaMgr;
+ }
+
+ public Collection<TaskArtifact> getTaskArtifacts() throws OseeCoreException {
+ return smaMgr.getSma().getRelatedArtifacts(AtsRelation.SmaToTask_Task, TaskArtifact.class);
+ }
+
+ public Collection<TaskArtifact> getTaskArtifactsFromCurrentState() throws OseeCoreException {
+ return getTaskArtifacts(smaMgr.getStateMgr().getCurrentStateName());
+ }
+
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws OseeCoreException {
+ List<TaskArtifact> arts = new ArrayList<TaskArtifact>();
+ for (TaskArtifact taskArt : smaMgr.getSma().getRelatedArtifacts(AtsRelation.SmaToTask_Task, TaskArtifact.class)) {
+ if (taskArt.getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), "").equals(
+ stateName)) arts.add(taskArt);
+ }
+ return arts;
+ }
+
+ public boolean hasTaskArtifacts() {
+ try {
+ return smaMgr.getSma().getRelatedArtifactsCount(AtsRelation.SmaToTask_Task) > 0;
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return false;
+ }
+ }
+
+ public TaskArtifact createNewTask(String title, boolean persist) throws OseeCoreException {
+ return createNewTask(Arrays.asList(UserManager.getUser()), title, persist);
+ }
+
+ public TaskArtifact createNewTask(User assignee, String title, boolean persist) throws OseeCoreException {
+ return createNewTask(Arrays.asList(assignee), title, persist);
+ }
+
+ public TaskArtifact createNewTask(Collection<User> assignees, String title, boolean persist) throws OseeCoreException {
+ TaskArtifact taskArt = null;
+ taskArt =
+ (TaskArtifact) ArtifactTypeManager.addArtifact(TaskArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch(), title);
+ taskArt.getSmaMgr().getLog().addLog(LogType.Originated, "", "");
+
+ // Initialize state machine
+ taskArt.getSmaMgr().getStateMgr().initializeStateMachine(TaskStates.InWork.name(), assignees);
+ taskArt.getSmaMgr().getLog().addLog(LogType.StateEntered, "InWork", "");
+
+ // Set parent state task is related to
+ taskArt.setSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(),
+ smaMgr.getStateMgr().getCurrentStateName());
+
+ smaMgr.getSma().addRelation(AtsRelation.SmaToTask_Task, taskArt);
+ if (persist) {
+ taskArt.persistAttributesAndRelations();
+ }
+
+ return taskArt;
+ }
+
+ public Result areTasksComplete() {
+ return areTasksComplete(true);
+ }
+
+ public Result areTasksComplete(boolean popup) {
+ try {
+ for (TaskArtifact taskArt : getTaskArtifacts()) {
+ if (!taskArt.isCompleted() && taskArt.isCancelled()) return new Result("Not Complete");
+ }
+ return Result.TrueResult;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return Result.TrueResult;
+ }
+
+ /**
+ * Return Estimated Task Hours of "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Estimated Hours
+ */
+ public double getEstimatedHours(String relatedToStateName) throws OseeCoreException {
+ double hours = 0;
+ for (TaskArtifact taskArt : getTaskArtifacts(relatedToStateName))
+ hours += taskArt.getEstimatedHoursTotal();
+ return hours;
+ }
+
+ /**
+ * Return Estimated Hours for all tasks
+ *
+ * @return
+ * @throws Exception
+ */
+ public double getEstimatedHours() throws OseeCoreException {
+ double hours = 0;
+ for (TaskArtifact taskArt : getTaskArtifacts())
+ hours += taskArt.getEstimatedHoursFromArtifact();
+ return hours;
+
+ }
+
+ /**
+ * Return Remain Task Hours of "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Remain Hours
+ */
+ public double getRemainHours(String relatedToStateName) throws OseeCoreException {
+ double hours = 0;
+ for (TaskArtifact taskArt : getTaskArtifacts(relatedToStateName))
+ hours += taskArt.getRemainHoursFromArtifact();
+ return hours;
+ }
+
+ /**
+ * Return Remain Hours for all tasks
+ *
+ * @return
+ * @throws Exception
+ */
+ public double getRemainHours() throws OseeCoreException {
+ double hours = 0;
+ for (TaskArtifact taskArt : getTaskArtifacts())
+ hours += taskArt.getRemainHoursFromArtifact();
+ return hours;
+
+ }
+
+ /**
+ * Return Hours Spent for Tasks of "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Hours Spent
+ */
+ public double getHoursSpent(String relatedToStateName) throws OseeCoreException {
+ double spent = 0;
+ for (TaskArtifact taskArt : getTaskArtifacts(relatedToStateName))
+ spent += taskArt.getHoursSpentSMATotal();
+ return spent;
+ }
+
+ /**
+ * Return Total Percent Complete / # Tasks for "Related to State" stateName
+ *
+ * @param relatedToStateName state name of parent workflow's state
+ * @return Returns the Percent Complete.
+ */
+ public int getPercentComplete(String relatedToStateName) throws OseeCoreException {
+ int spent = 0;
+ Collection<TaskArtifact> taskArts = getTaskArtifacts(relatedToStateName);
+ for (TaskArtifact taskArt : taskArts)
+ spent += taskArt.getPercentCompleteSMATotal();
+ if (spent == 0) return 0;
+ return spent / taskArts.size();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java
new file mode 100644
index 00000000000..d8e1142852f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.XTextDam;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XActionableItemsDam extends XTextDam {
+
+ protected final Artifact sma;
+
+ public XActionableItemsDam(Artifact sma) {
+ super(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName());
+ this.sma = sma;
+ }
+
+ public Set<ActionableItemArtifact> getActionableItems() throws OseeCoreException {
+ Set<ActionableItemArtifact> ais = new HashSet<ActionableItemArtifact>();
+ for (String guid : getActionableItemGuids()) {
+ ActionableItemArtifact aia = AtsCache.getActionableItemByGuid(guid);
+ if (aia == null)
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Can't find Actionable Item for guid " + guid);
+ else
+ ais.add(aia);
+ }
+ return ais;
+ }
+
+ public String getActionableItemsStr() throws OseeCoreException {
+ return Artifacts.toString("; ", getActionableItems());
+ }
+
+ public List<String> getActionableItemGuids() throws OseeCoreException {
+ return sma.getAttributesToStringList(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName());
+ }
+
+ public void addActionableItem(ActionableItemArtifact aia) throws OseeCoreException {
+ if (!getActionableItemGuids().contains(aia.getGuid())) sma.addAttribute(
+ ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName(), aia.getGuid());
+ }
+
+ public void removeActionableItem(ActionableItemArtifact aia) throws OseeCoreException {
+ sma.deleteAttribute(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName(), aia.getGuid());
+ }
+
+ public Result setActionableItems(Collection<ActionableItemArtifact> newItems) throws OseeCoreException {
+ Set<ActionableItemArtifact> existingAias = getActionableItems();
+
+ // Remove non-selected items
+ for (ActionableItemArtifact existingAia : existingAias)
+ if (!newItems.contains(existingAia)) removeActionableItem(existingAia);
+
+ // Add newly-selected items
+ for (ActionableItemArtifact newItem : newItems)
+ if (!existingAias.contains(newItem)) addActionableItem(newItem);
+
+ return Result.TrueResult;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java
new file mode 100644
index 00000000000..2477feff5ef
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Date;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XCurrentStateDam extends XStateAssigneesDam {
+
+ public XCurrentStateDam(StateMachineArtifact sma) {
+ super(sma, ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName());
+ }
+
+ public SMAState getState() throws OseeCoreException {
+ Set<SMAState> states = getStates();
+ if (states.size() != 1) throw new OseeArgumentException(
+ "Must be one current state. Found " + states.size() + " for " + sma.getHumanReadableId());
+ return states.iterator().next();
+ }
+
+ @Override
+ public void setState(SMAState state) throws OseeCoreException {
+ sma.setSoleAttributeValue(attributeTypeName, state.toXml());
+ }
+
+ public void updateMetrics(double additionalHours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ SMAState currState = getState();
+ currState.setHoursSpent(currState.getHoursSpent() + additionalHours);
+ currState.setPercentComplete(percentComplete);
+ setState(currState);
+ if (logMetrics) logMetrics();
+ }
+
+ public void setMetrics(double hours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ SMAState currState = getState();
+ currState.setHoursSpent(hours);
+ currState.setPercentComplete(percentComplete);
+ setState(currState);
+ if (logMetrics) logMetrics();
+ }
+
+ public void logMetrics() throws OseeCoreException {
+ logMetrics(sma, sma.getPercentCompleteSMATotal() + "", AtsLib.doubleToStrString(sma.getHoursSpentSMATotal()), "",
+ UserManager.getUser(), new Date());
+ }
+
+ public static void logMetrics(StateMachineArtifact sma, String percent, String hours, String stateName, User user, Date date) throws OseeCoreException {
+ LogItem logItem =
+ new LogItem(LogType.Metrics, date, user, stateName, String.format("Percent %s Hours %s", percent, hours));
+ sma.getSmaMgr().getLog().addLogItem(logItem);
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java
new file mode 100644
index 00000000000..18e4d52db9b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XDecisionOptions {
+
+ protected final StateMachineArtifact sma;
+
+ public XDecisionOptions(StateMachineArtifact sma) {
+ this.sma = sma;
+ }
+
+ public DecisionOption getDecisionOption(String stateName, boolean create) throws OseeCoreException {
+ String decisionOptions =
+ sma.getSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(), "");
+ for (String decsionOpt : decisionOptions.split("\n")) {
+ DecisionOption state = new DecisionOption();
+ state.setFromXml(decsionOpt);
+ return state;
+ }
+ if (create) return new DecisionOption(stateName);
+ return null;
+ }
+
+ public Set<DecisionOption> getDecisionOptions() throws OseeCoreException {
+ String decString = sma.getSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(), "");
+ return getDecisionOptions(decString);
+ }
+
+ public Set<DecisionOption> getDecisionOptions(String decisionOptions) {
+ Set<DecisionOption> decOptions = new HashSet<DecisionOption>();
+ for (String decsionOpt : decisionOptions.split("\n")) {
+ DecisionOption state = new DecisionOption();
+ state.setFromXml(decsionOpt);
+ decOptions.add(state);
+ }
+ return decOptions;
+ }
+
+ public DecisionOption getDecisionOption(String name) throws OseeCoreException {
+ for (DecisionOption opt : getDecisionOptions()) {
+ if (opt.getName().equals(name)) return opt;
+ }
+ return null;
+ }
+
+ public Result validateDecisionOptions() throws OseeCoreException {
+ return validateDecisionOptions(sma.getSoleAttributeValue(
+ ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(), ""));
+ }
+
+ public static Result validateDecisionOptions(String decisionOptions) {
+ for (String decsionOpt : decisionOptions.split("\n")) {
+ DecisionOption state = new DecisionOption();
+ Result result = state.setFromXml(decsionOpt);
+ if (result.isFalse()) return new Result("Invalid Decision Option \"" + decsionOpt + "\" " + result.getText());
+ }
+ return Result.TrueResult;
+ }
+
+ public String toXml(Set<DecisionOption> opts) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ for (DecisionOption opt : opts)
+ sb.append(opt.toXml() + "\n");
+ return sb.toString().replaceFirst("\n$", "");
+ }
+
+ public void setDecisionOptions(String decisionOptions) throws OseeCoreException {
+ sma.setSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(),
+ toXml(getDecisionOptions(decisionOptions)));
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XHyperlabelTeamDefinitionSelection.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XHyperlabelTeamDefinitionSelection.java
new file mode 100644
index 00000000000..8f987c92262
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XHyperlabelTeamDefinitionSelection.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionTreeWithChildrenDialog;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XHyperlinkLabelSelection;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XHyperlabelTeamDefinitionSelection extends XHyperlinkLabelSelection {
+
+ public static final String WIDGET_ID = XHyperlabelTeamDefinitionSelection.class.getSimpleName();
+ Set<TeamDefinitionArtifact> selectedTeamDefs = new HashSet<TeamDefinitionArtifact>();
+
+ /**
+ * @param label
+ */
+ public XHyperlabelTeamDefinitionSelection(String label) {
+ super(label);
+ }
+
+ public Set<TeamDefinitionArtifact> getSelectedTeamDefintions() {
+ return selectedTeamDefs;
+ }
+
+ @Override
+ public String getCurrentValue() {
+ StringBuffer sb = new StringBuffer();
+ for (TeamDefinitionArtifact user : selectedTeamDefs)
+ sb.append(user.getDescriptiveName() + ", ");
+ return sb.toString().replaceFirst(", $", "");
+ }
+
+ public void setSelectedUsers(Set<TeamDefinitionArtifact> selectedUsers) {
+ this.selectedTeamDefs = selectedUsers;
+ refresh();
+ }
+
+ @Override
+ public boolean handleSelection() {
+ try {
+ TeamDefinitionTreeWithChildrenDialog dialog = new TeamDefinitionTreeWithChildrenDialog(Active.Active);
+ int result = dialog.open();
+ if (result == 0) {
+ selectedTeamDefs.clear();
+ for (Object obj : dialog.getResultAndRecursedTeamDefs()) {
+ selectedTeamDefs.add((TeamDefinitionArtifact) obj);
+ }
+ notifyXModifiedListeners();
+ }
+ return true;
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java
new file mode 100644
index 00000000000..c172d358c16
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
+import org.eclipse.osee.framework.ui.skynet.widgets.XTextDam;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class XStateAssigneesDam extends XTextDam {
+
+ protected final String attributeTypeName;
+ protected final StateMachineArtifact sma;
+
+ public XStateAssigneesDam(StateMachineArtifact sma, String attributeName) {
+ super(attributeName);
+ this.sma = sma;
+ this.attributeTypeName = attributeName;
+ }
+
+ public SMAState getState(String stateName, boolean create) {
+ try {
+ for (String stateXml : sma.getAttributesToStringList(attributeTypeName)) {
+ if (stateXml.startsWith(stateName + ";")) {
+ SMAState state = new SMAState();
+ state.setFromXml(stateXml);
+ return state;
+ }
+ }
+ if (create) return new SMAState(stateName);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Error parsing state data for " + sma.getHumanReadableId(), ex);
+ }
+ return null;
+ }
+
+ public void updateMetrics(String stateName, double additionalHours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ SMAState currState = getState(stateName, false);
+ currState.setHoursSpent(currState.getHoursSpent() + additionalHours);
+ currState.setPercentComplete(percentComplete);
+ setState(currState);
+ if (logMetrics) {
+ XCurrentStateDam.logMetrics(sma, sma.getPercentCompleteSMATotal() + "",
+ AtsLib.doubleToStrString(sma.getHoursSpentSMATotal()), stateName, UserManager.getUser(),
+ new Date());
+ }
+ }
+
+ public void setMetrics(String stateName, double hours, int percentComplete, boolean logMetrics) throws OseeCoreException {
+ SMAState currState = getState(stateName, false);
+ currState.setHoursSpent(hours);
+ currState.setPercentComplete(percentComplete);
+ setState(currState);
+ if (logMetrics) {
+ XCurrentStateDam.logMetrics(sma, sma.getPercentCompleteSMATotal() + "",
+ AtsLib.doubleToStrString(sma.getHoursSpentSMATotal()), stateName, UserManager.getUser(),
+ new Date());
+ }
+ }
+
+ public Set<SMAState> getStates() {
+ Set<SMAState> states = new HashSet<SMAState>();
+ try {
+ for (String stateXml : sma.getAttributesToStringList(attributeTypeName)) {
+ SMAState state = new SMAState();
+ state.setFromXml(stateXml);
+ states.add(state);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Error parsing state data for " + sma.getHumanReadableId(), ex);
+ }
+ return states;
+ }
+
+ public void setState(SMAState state) throws OseeCoreException {
+ // Update attribute if it already exists
+ try {
+ Collection<Attribute<String>> attrs = sma.getAttributes(attributeTypeName);
+ for (Attribute<String> attr : attrs) {
+ SMAState storedState = new SMAState();
+ storedState.setFromXml(attr.getValue());
+ if (state.getName().equals(storedState.getName())) {
+ attr.setValue(state.toXml());
+ return;
+ }
+ }
+ // Else, doesn't exist yet, create
+ sma.addAttribute(attributeTypeName, state.toXml());
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, "Error setting state data for " + sma.getHumanReadableId(), ex);
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java
new file mode 100644
index 00000000000..48a199651e5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XStateDam extends XStateAssigneesDam {
+
+ public XStateDam(StateMachineArtifact sma) {
+ super(sma, ATSAttributes.STATE_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java
new file mode 100644
index 00000000000..bad217a0e99
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets;
+
+import org.eclipse.osee.ats.util.widgets.defect.XDefectViewer;
+import org.eclipse.osee.ats.util.widgets.role.XUserRoleViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetProvider;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XWidgetProvider implements IXWidgetProvider {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetProvider#createXWidget(java.lang.String, java.lang.String, boolean, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData)
+ */
+ public XWidget createXWidget(String widgetName, String name, DynamicXWidgetLayoutData widgetLayoutData) {
+
+ if (widgetName.equals("XDefectViewer")) {
+ return new XDefectViewer();
+ } else if (widgetName.equals("XUserRoleViewer")) {
+ return new XUserRoleViewer();
+ }
+ return null;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
new file mode 100644
index 00000000000..489b7e113ea
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.util.SkynetGuiDebug;
+
+public class DefectContentProvider implements ITreeContentProvider {
+
+ protected Collection<DefectItem> rootSet = new HashSet<DefectItem>();
+ private final DefectXViewer xViewer;
+ private static Object[] EMPTY_ARRAY = new Object[0];
+ private SkynetGuiDebug debug = new SkynetGuiDebug(false, "DefectContentProvider");
+
+ public DefectContentProvider(DefectXViewer WorldXViewer) {
+ super();
+ this.xViewer = WorldXViewer;
+ }
+
+ public void add(final DefectItem item) {
+ add(Arrays.asList(item));
+ }
+
+ public void add(final Collection<? extends DefectItem> items) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.addAll(items);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void set(final Collection<? extends DefectItem> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ clear();
+ add(arts);
+ };
+ });
+ }
+
+ public void remove(final Artifact art) {
+ remove(Arrays.asList(art));
+ }
+
+ public void remove(final Collection<? extends Artifact> arts) {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ ArrayList<DefectItem> delItems = new ArrayList<DefectItem>();
+ delItems.addAll(rootSet);
+ for (Artifact art : arts) {
+ for (DefectItem wai : rootSet)
+ if (wai.equals(art)) delItems.add(wai);
+ }
+ removeItems(delItems);
+ }
+
+ public void removeItems(final Collection<? extends DefectItem> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.remove(arts);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void clear() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.clear();
+ xViewer.refresh();
+ };
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Object[]) {
+ return (Object[]) parentElement;
+ }
+ if (parentElement instanceof Collection) {
+ return ((Collection) parentElement).toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ public Object getParent(Object element) {
+ debug.report("getParent");
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ debug.report("hasChildren");
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ debug.report("getElements");
+ if (inputElement instanceof String) return new Object[] {inputElement};
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /**
+ * @return the rootSet
+ */
+ public Collection<DefectItem> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java
new file mode 100644
index 00000000000..ec5bd590696
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java
@@ -0,0 +1,269 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DefectItem {
+
+ private Date date = new Date();
+ private String description = "";
+ private String location = "";
+ private String resolution = "";
+ private User user;
+ private String guid = GUID.generateGuidStr();
+ private Severity severity = Severity.None;
+ private Disposition disposition = Disposition.None;
+ private InjectionActivity injectionActivity = InjectionActivity.None;
+ private boolean closed = false;
+ public static enum Severity {
+ None, Major, Minor, Issue;
+ public static Collection<String> strValues() {
+ Set<String> values = new HashSet<String>();
+ for (Enum<Severity> e : values()) {
+ values.add(e.name());
+ }
+ return values;
+ }
+
+ public static Image getImage(Severity sev) {
+ if (sev == Major)
+ return SkynetGuiPlugin.getInstance().getImage("major.gif");
+ else if (sev == Minor)
+ return SkynetGuiPlugin.getInstance().getImage("minor.gif");
+ else if (sev == Issue) return SkynetGuiPlugin.getInstance().getImage("issue.gif");
+ return null;
+ }
+ };
+
+ public DefectItem() throws OseeCoreException {
+ user = UserManager.getUser();
+ }
+
+ public DefectItem(User user, Severity severity, Disposition disposition, InjectionActivity injectionActivity, String description, String resolution, String location, Date date) {
+ this.user = user;
+ if (severity != null) this.severity = severity;
+ if (disposition != null) this.disposition = disposition;
+ if (injectionActivity != null) this.injectionActivity = injectionActivity;
+ if (description != null) this.description = description;
+ if (resolution != null) this.resolution = resolution;
+ if (location != null) this.location = location;
+ if (date != null) this.date = date;
+ }
+
+ public DefectItem(String xml) throws OseeCoreException {
+ fromXml(xml);
+ }
+
+ public void update(DefectItem dItem) throws OseeCoreException {
+ fromXml(dItem.toXml());
+ }
+
+ public static enum Disposition {
+ None, Accept, Reject, Duplicate;
+ public static Collection<String> strValues() {
+ Set<String> values = new HashSet<String>();
+ for (Enum<Disposition> e : values()) {
+ values.add(e.name());
+ }
+ return values;
+ }
+
+ public static Image getImage(Disposition sev) {
+ if (sev == Accept)
+ return SkynetGuiPlugin.getInstance().getImage("accept.gif");
+ else if (sev == Reject)
+ return SkynetGuiPlugin.getInstance().getImage("reject.gif");
+ else if (sev == Duplicate) return SkynetGuiPlugin.getInstance().getImage("duplicate.gif");
+ return null;
+ }
+ };
+ public static enum InjectionActivity {
+ None,
+ Planning,
+ System_Level_Requirements,
+ System_Design,
+ Software_Requirements,
+ Software_Design,
+ Code,
+ Test,
+ Other;
+ public static Collection<String> strValues() {
+ Set<String> values = new HashSet<String>();
+ for (Enum<InjectionActivity> e : values()) {
+ values.add(e.name());
+ }
+ return values;
+ }
+ };
+
+ public String getDate(String pattern) {
+ if (pattern != null) return (new SimpleDateFormat(pattern)).format(date);
+ return date.toString();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof DefectItem) {
+ DefectItem di = (DefectItem) obj;
+ return di.guid.equals(getGuid());
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return guid.hashCode();
+ }
+
+ public String toXml() throws OseeCoreException {
+ return "<severity>" + severity.name() + "</severity><disposition>" + disposition.name() +
+ //
+ "</disposition><injectionActivity>" + injectionActivity.name() + "</injectionActivity><date>" + date.getTime() +
+ //
+ "</date><user>" + user.getUserId() + "</user><description>" + description + "</description><location>" + location +
+ //
+ "</location><resolution>" + resolution + "</resolution><closed>" + closed + "</closed><guid>" + guid + "</guid>";
+ }
+
+ private void fromXml(String xml) throws OseeCoreException {
+ this.severity = Severity.valueOf(AXml.getTagData(xml, "severity"));
+ this.disposition = Disposition.valueOf(AXml.getTagData(xml, "disposition"));
+ this.injectionActivity = InjectionActivity.valueOf(AXml.getTagData(xml, "injectionActivity"));
+ Date date = new Date();
+ date.setTime(new Long(AXml.getTagData(xml, "date")));
+ this.date = date;
+ this.user = UserManager.getUserByUserId(AXml.getTagData(xml, "user"));
+ this.description = AXml.getTagData(xml, "description");
+ this.location = AXml.getTagData(xml, "location");
+ this.resolution = AXml.getTagData(xml, "resolution");
+ this.closed = AXml.getTagBooleanData(xml, "closed");
+ this.guid = AXml.getTagData(xml, "guid");
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public String getCreatedDate(String pattern) {
+ if (pattern != null) return (new SimpleDateFormat(pattern)).format(date);
+ return date.toString();
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public String toString() {
+ return severity + " - " + disposition + " - " + injectionActivity + " - " + user + " on " + getCreatedDate(XDate.MMDDYYHHMM) + "\n";
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+ public String toHTML(String labelFont) {
+ return "DEFECT (" + severity + "): " + description + " (" + user.getName() + ")";
+ }
+
+ /**
+ * @param user The user to set.
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
+ public String getResolution() {
+ return resolution;
+ }
+
+ public void setResolution(String resolution) {
+ this.resolution = resolution;
+ }
+
+ public Severity getSeverity() {
+ return severity;
+ }
+
+ public void setSeverity(Severity severity) {
+ this.severity = severity;
+ }
+
+ public Disposition getDisposition() {
+ return disposition;
+ }
+
+ public void setDisposition(Disposition disposition) {
+ this.disposition = disposition;
+ }
+
+ public InjectionActivity getInjectionActivity() {
+ return injectionActivity;
+ }
+
+ public void setInjectionActivity(InjectionActivity injectionActivity) {
+ this.injectionActivity = injectionActivity;
+ }
+
+ public boolean isClosed() {
+ return closed;
+ }
+
+ public void setClosed(boolean closed) {
+ this.closed = closed;
+ }
+
+ /**
+ * @return the guid
+ */
+ public String getGuid() {
+ return guid;
+ }
+
+ /**
+ * @param guid the guid to set
+ */
+ public void setGuid(String guid) {
+ this.guid = guid;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java
new file mode 100644
index 00000000000..5ec62c9d729
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Disposition;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.InjectionActivity;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerLabelProvider;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+public class DefectLabelProvider extends XViewerLabelProvider {
+ Font font = null;
+
+ private final DefectXViewer xViewer;
+
+ public DefectLabelProvider(DefectXViewer xViewer) {
+ super(xViewer);
+ this.xViewer = xViewer;
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn dCol, int columnIndex) throws OseeCoreException {
+ DefectItem defectItem = (DefectItem) element;
+ if (dCol.equals(DefectXViewerFactory.Severity_Col))
+ return Severity.getImage(defectItem.getSeverity());
+ else if (dCol.equals(DefectXViewerFactory.Injection_Activity_Col))
+ return AtsPlugin.getInstance().getImage("info.gif");
+ else if (dCol.equals(DefectXViewerFactory.Disposition_Col))
+ return Disposition.getImage(defectItem.getDisposition());
+ else if (dCol.equals(DefectXViewerFactory.Closed_Col)) {
+ return defectItem.isClosed() ? SkynetGuiPlugin.getInstance().getImage("chkbox_enabled.gif") : SkynetGuiPlugin.getInstance().getImage(
+ "chkbox_disabled.gif");
+ } else if (dCol.equals(DefectXViewerFactory.User_Col)) {
+ if (defectItem.getUser().equals(UserManager.getUser()))
+ return SkynetGuiPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return ArtifactTypeManager.getType("User").getImage();
+ }
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn aCol, int columnIndex) throws OseeCoreException {
+ DefectItem defectItem = (DefectItem) element;
+ if (aCol.equals(DefectXViewerFactory.User_Col))
+ return defectItem.getUser().getName();
+ else if (aCol.equals(DefectXViewerFactory.Closed_Col))
+ return String.valueOf(defectItem.isClosed());
+ else if (aCol.equals(DefectXViewerFactory.Created_Date_Col))
+ return defectItem.getCreatedDate(XDate.MMDDYYHHMM);
+ else if (aCol.equals(DefectXViewerFactory.Description_Col))
+ return defectItem.getDescription();
+ else if (aCol.equals(DefectXViewerFactory.Resolution_Col))
+ return defectItem.getResolution();
+ else if (aCol.equals(DefectXViewerFactory.Location_Col))
+ return defectItem.getLocation();
+ else if (aCol.equals(DefectXViewerFactory.Severity_Col))
+ return defectItem.getSeverity().equals(Severity.None) ? "" : defectItem.getSeverity().name();
+ else if (aCol.equals(DefectXViewerFactory.Disposition_Col))
+ return defectItem.getDisposition().equals(Disposition.None) ? "" : defectItem.getDisposition().name();
+ else if (aCol.equals(DefectXViewerFactory.Injection_Activity_Col)) return defectItem.getInjectionActivity() == InjectionActivity.None ? "" : defectItem.getInjectionActivity().name();
+
+ return "Unhandled Column";
+ }
+
+ public void dispose() {
+ if (font != null) font.dispose();
+ font = null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public DefectXViewer getTreeViewer() {
+ return xViewer;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java
new file mode 100644
index 00000000000..4d97844cdd9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DefectManager {
+
+ private final Artifact artifact;
+ private boolean enabled = true;
+ private static String ATS_DEFECT_TAG = "AtsDefect";
+ private static String DEFECT_ITEM_TAG = "Item";
+ private static String REVIEW_DEFECT_ATTRIBUTE_NAME = "ats.Review Defect";
+ private Matcher defectMatcher =
+ java.util.regex.Pattern.compile("<" + DEFECT_ITEM_TAG + ">(.*?)</" + DEFECT_ITEM_TAG + ">",
+ Pattern.DOTALL | Pattern.MULTILINE).matcher("");
+
+ public DefectManager(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getHtml() throws OseeCoreException {
+ if (getDefectItems().size() == 0) return "";
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Defects"));
+ sb.append(getTable());
+ return sb.toString();
+ }
+
+ public Set<DefectItem> getDefectItems() throws OseeCoreException {
+ Set<DefectItem> defectItems = new HashSet<DefectItem>();
+ String xml = artifact.getSoleAttributeValue(REVIEW_DEFECT_ATTRIBUTE_NAME, "");
+ defectMatcher.reset(xml);
+ while (defectMatcher.find()) {
+ DefectItem item = new DefectItem(defectMatcher.group());
+ defectItems.add(item);
+ }
+ return defectItems;
+ }
+
+ public int getNumMajor() throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Major) x++;
+ return x;
+ }
+
+ public int getNumMinor() throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Minor) x++;
+ return x;
+ }
+
+ public int getNumIssues() throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Issue) x++;
+ return x;
+ }
+
+ private void saveDefectItems(Set<DefectItem> defectItems, boolean persist, SkynetTransaction transaction) {
+ try {
+ StringBuffer sb = new StringBuffer("<" + ATS_DEFECT_TAG + ">");
+ for (DefectItem item : defectItems)
+ sb.append(AXml.addTagData(DEFECT_ITEM_TAG, item.toXml()));
+ sb.append("</" + ATS_DEFECT_TAG + ">");
+ artifact.setSoleAttributeValue(REVIEW_DEFECT_ATTRIBUTE_NAME, sb.toString());
+ if (persist) artifact.persistAttributes(transaction);
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, "Can't create ats review defect document", ex, true);
+ }
+ }
+
+ public void addOrUpdateDefectItem(DefectItem defectItem, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ Set<DefectItem> defectItems = getDefectItems();
+ boolean found = false;
+ for (DefectItem dItem : defectItems) {
+ if (defectItem.equals(dItem)) {
+ dItem.update(defectItem);
+ found = true;
+ }
+ }
+ if (!found) defectItems.add(defectItem);
+ saveDefectItems(defectItems, persist, transaction);
+ }
+
+ public void removeDefectItem(DefectItem defectItem, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ Set<DefectItem> defectItems = getDefectItems();
+ defectItems.remove(defectItem);
+ saveDefectItems(defectItems, persist, transaction);
+ }
+
+ public void addDefectItem(String description, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ DefectItem item = new DefectItem();
+ item.setDescription(description);
+ addOrUpdateDefectItem(item, persist, transaction);
+ }
+
+ public String getTable() throws OseeCoreException {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Severity</TH>" + "<TH>Disposition</TH><TH>Injection</TH><TH>User</TH><TH>Date</TH><TH>Description</TH><TH>Location</TH>" + "<TH>Resolution</TH><TH>Guid</TH><TH>Completed</TH></THEAD></TR>");
+ for (DefectItem item : getDefectItems()) {
+ User user = item.getUser();
+ String name = "";
+ if (user != null) {
+ name = user.getName();
+ if (name == null || name.equals("")) {
+ name = user.getName();
+ }
+ }
+ builder.append("<TR>");
+ builder.append("<TD>" + item.getSeverity() + "</TD>");
+ builder.append("<TD>" + item.getDisposition() + "</TD>");
+ builder.append("<TD>" + item.getInjectionActivity() + "</TD>");
+ if (user.equals(UserManager.getUser()))
+ builder.append("<TD bgcolor=\"#CCCCCC\">" + name + "</TD>");
+ else
+ builder.append("<TD>" + name + "</TD>");
+ builder.append("<TD>" + item.getCreatedDate(XDate.MMDDYYHHMM) + "</TD>");
+ builder.append("<TD>" + item.getDescription() + "</TD>");
+ builder.append("<TD>" + item.getLocation() + "</TD>");
+ builder.append("<TD>" + item.getResolution() + "</TD>");
+ builder.append("<TD>" + item.getGuid() + "</TD>");
+ builder.append("<TD>" + item.isClosed() + "</TD>");
+ builder.append("</TR>");
+ }
+ builder.append("</TABLE>");
+ return builder.toString();
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
new file mode 100644
index 00000000000..6132ac265ca
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
@@ -0,0 +1,291 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Disposition;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.InjectionActivity;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.EnumStringSingleSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.SkynetGuiDebug;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.IXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XPromptChange;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XPromptChange.Option;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DefectXViewer extends XViewer {
+
+ private final XDefectViewer xDefectViewer;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public DefectXViewer(Composite parent, int style, XDefectViewer xDefectViewer) {
+ this(parent, style, new DefectXViewerFactory(), xDefectViewer);
+ }
+
+ public DefectXViewer(Composite parent, int style, IXViewerFactory xViewerFactory, XDefectViewer xDefectViewer) {
+ super(parent, style, xViewerFactory);
+ this.xDefectViewer = xDefectViewer;
+ }
+
+ @Override
+ protected void createSupportWidgets(Composite parent) {
+ super.createSupportWidgets(parent);
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ ((DefectContentProvider) getContentProvider()).clear();
+ }
+ });
+ createMenuActions();
+ }
+
+ public void createMenuActions() {
+ MenuManager mm = getMenuManager();
+ mm.createContextMenu(getControl());
+ mm.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ updateMenuActions();
+ }
+ });
+ }
+
+ public void updateEditMenuActions() {
+ // MenuManager mm = getMenuManager();
+
+ // EDIT MENU BLOCK
+ }
+
+ public void updateMenuActions() {
+ MenuManager mm = getMenuManager();
+
+ updateEditMenuActions();
+
+ mm.insertBefore(MENU_GROUP_PRE, new Separator());
+ }
+
+ public Collection<DefectItem> getLoadedDefectItems() {
+ return ((DefectContentProvider) getContentProvider()).getRootSet();
+ }
+
+ public void add(Collection<DefectItem> defectItems) {
+ if (((DefectContentProvider) getContentProvider()) != null) ((DefectContentProvider) getContentProvider()).add(defectItems);
+ }
+
+ public void set(Collection<? extends DefectItem> defectItems) {
+ if (((DefectContentProvider) getContentProvider()) != null) ((DefectContentProvider) getContentProvider()).set(defectItems);
+ }
+
+ public void clear() {
+ if (((DefectContentProvider) getContentProvider()) != null) ((DefectContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ @Override
+ public void dispose() {
+ // Dispose of the table objects is done through separate dispose listener off tree
+ // Tell the label provider to release its ressources
+ getLabelProvider().dispose();
+ }
+
+ public ArrayList<DefectItem> getSelectedDefectItems() {
+ ArrayList<DefectItem> arts = new ArrayList<DefectItem>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((DefectItem) item.getData());
+ return arts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer#handleLeftClickInIconArea(org.eclipse.swt.widgets.TreeColumn, org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleLeftClickInIconArea(TreeColumn treeColumn, TreeItem treeItem) {
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ if (xCol.equals(DefectXViewerFactory.User_Col)) {
+ return handleAltLeftClick(treeColumn, treeItem);
+ } else if (xCol.equals(DefectXViewerFactory.Injection_Activity_Col)) {
+ return handleAltLeftClick(treeColumn, treeItem);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer#handleLeftClick(org.eclipse.swt.widgets.TreeColumn, org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ if (!xDefectViewer.isEditable()) {
+ return false;
+ }
+ try {
+ XViewerColumn aCol = (XViewerColumn) treeColumn.getData();
+ DefectItem defectItem = (DefectItem) treeItem.getData();
+ boolean modified = false;
+ if (aCol.equals(DefectXViewerFactory.Closed_Col)) {
+ modified = true;
+ defectItem.setClosed(!defectItem.isClosed());
+ }
+ if (aCol.equals(DefectXViewerFactory.Severity_Col)) {
+ modified = handleAltLeftClick(treeColumn, treeItem);
+ }
+ if (aCol.equals(DefectXViewerFactory.Disposition_Col)) {
+ modified = handleAltLeftClick(treeColumn, treeItem);
+ }
+ if (modified) {
+ SkynetTransaction transaction =
+ new SkynetTransaction(xDefectViewer.getReviewArt().getArtifact().getBranch());
+ xDefectViewer.getReviewArt().getDefectManager().addOrUpdateDefectItem(defectItem, false, transaction);
+ transaction.execute();
+ xDefectViewer.refresh();
+ xDefectViewer.notifyXModifiedListeners();
+ update(defectItem, null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.viewer.XViewer#handleAltLeftClick(org.eclipse.swt.widgets.TreeColumn,
+ * org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ if (!xDefectViewer.isEditable()) {
+ return false;
+ }
+ try {
+ // System.out.println("Column " + treeColumn.getText() + " item " +
+ // treeItem);
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ DefectItem defectItem = (DefectItem) treeItem.getData();
+ boolean modified = false;
+ if (xCol.equals(DefectXViewerFactory.Created_Date_Col)) {
+ Date selDate = XPromptChange.promptChangeDate(xCol.getName(), defectItem.getDate());
+ if (selDate != null) {
+ modified = true;
+ defectItem.setDate(selDate);
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Closed_Col)) {
+ Boolean closed = XPromptChange.promptChangeBoolean(xCol.getName(), xCol.getName(), defectItem.isClosed());
+ if (closed != null && (defectItem.isClosed() != closed)) {
+ modified = true;
+ defectItem.setClosed(closed);
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Description_Col)) {
+ String desc =
+ XPromptChange.promptChangeString(xCol.getName(), defectItem.getDescription(), null, Option.MULTI_LINE);
+ if (desc != null && !defectItem.getDescription().equals(desc)) {
+ modified = true;
+ defectItem.setDescription(desc);
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Resolution_Col)) {
+ String resolution =
+ XPromptChange.promptChangeString(xCol.getName(), defectItem.getResolution(), null, Option.MULTI_LINE);
+ if (resolution != null && !defectItem.getResolution().equals(resolution)) {
+ modified = true;
+ defectItem.setResolution(resolution);
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Location_Col)) {
+ String desc =
+ XPromptChange.promptChangeString(xCol.getName(), defectItem.getLocation(), null, Option.MULTI_LINE);
+ if (desc != null && !defectItem.getLocation().equals(desc)) {
+ modified = true;
+ defectItem.setLocation(desc);
+ }
+ } else if (xCol.equals(DefectXViewerFactory.User_Col)) {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New User");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = ld.getSelection();
+ if (selectedUser != null && defectItem.getUser() != selectedUser) {
+ modified = true;
+ defectItem.setUser(selectedUser);
+ }
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Severity_Col)) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(xCol.getName(), Severity.strValues(),
+ defectItem.getSeverity().name());
+ if (enumDialog != null) {
+ if (enumDialog.getResult()[0] != null) {
+ modified = true;
+ defectItem.setSeverity(Severity.valueOf((String) enumDialog.getResult()[0]));
+ }
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Disposition_Col)) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(xCol.getName(), Disposition.strValues(),
+ defectItem.getDisposition().name());
+ if (enumDialog != null) {
+ if (enumDialog.getResult()[0] != null) {
+ modified = true;
+ defectItem.setDisposition(Disposition.valueOf((String) enumDialog.getResult()[0]));
+ }
+ }
+ } else if (xCol.equals(DefectXViewerFactory.Injection_Activity_Col)) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(xCol.getName(), InjectionActivity.strValues(),
+ defectItem.getInjectionActivity().name());
+ if (enumDialog != null) {
+ if (enumDialog.getResult()[0] != null) {
+ modified = true;
+ defectItem.setInjectionActivity(InjectionActivity.valueOf((String) enumDialog.getResult()[0]));
+ }
+ }
+ } else
+ throw new OseeStateException("Unhandled defect column");
+
+ if (modified) {
+ SkynetTransaction transaction =
+ new SkynetTransaction(xDefectViewer.getReviewArt().getArtifact().getBranch());
+ xDefectViewer.getReviewArt().getDefectManager().addOrUpdateDefectItem(defectItem, false, transaction);
+ transaction.execute();
+ xDefectViewer.notifyXModifiedListeners();
+ update(defectItem, null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiDebug.class, ex, true);
+ }
+ return false;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java
new file mode 100644
index 00000000000..9240f467e0d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DefectXViewerFactory extends SkynetXViewerFactory {
+
+ public static XViewerColumn Severity_Col =
+ new XViewerColumn("osee.defect.severity", "Severity", 70, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn Disposition_Col =
+ new XViewerColumn("osee.defect.disposition", "Disposition", 70, SWT.CENTER, true, SortDataType.String, false,
+ null);
+ public static XViewerColumn Closed_Col =
+ new XViewerColumn("osee.defect.closed", "Closed", 70, SWT.LEFT, true, SortDataType.Boolean, false, null);
+ public static XViewerColumn User_Col =
+ new XViewerColumn("osee.defect.user", "User", 100, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn Created_Date_Col =
+ new XViewerColumn("osee.defect.createdDate", "Created Date", 80, SWT.LEFT, true, SortDataType.Date, false,
+ null);
+ public static XViewerColumn Injection_Activity_Col =
+ new XViewerColumn("osee.defect.injectionActivity", "Injection Activity", 35, SWT.LEFT, true,
+ SortDataType.String, false, null);
+ public static XViewerColumn Description_Col =
+ new XViewerColumn("osee.defect.description", "Description", 200, SWT.LEFT, true,
+ SortDataType.String_MultiLine, false, null);
+ public static XViewerColumn Location_Col =
+ new XViewerColumn("osee.defect.location", "Location", 200, SWT.LEFT, true, SortDataType.String_MultiLine,
+ false, null);
+ public static XViewerColumn Resolution_Col =
+ new XViewerColumn("osee.defect.resolution", "Resolution", 200, SWT.LEFT, true, SortDataType.String_MultiLine,
+ false, null);
+
+ private static String NAMESPACE = "osee.ats.DefectXViewer";
+
+ public DefectXViewerFactory() {
+ super(NAMESPACE);
+ registerColumn(Severity_Col, Disposition_Col, Closed_Col, User_Col, Created_Date_Col, Injection_Activity_Col,
+ Description_Col, Location_Col, Resolution_Col);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
new file mode 100644
index 00000000000..53bb307c26f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
@@ -0,0 +1,527 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.defect;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.IReviewArtifact;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Disposition;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XDefectViewer extends XWidget implements IArtifactWidget, IFrameworkTransactionEventListener {
+
+ private DefectXViewer xViewer;
+ private IDirtiableEditor editor;
+ private IReviewArtifact reviewArt;
+ public final static String normalColor = "#EEEEEE";
+ private static ToolItem newDefectItem, deleteDefectItem;
+ private Label extraInfoLabel;
+
+ /**
+ * @param label
+ */
+ public XDefectViewer() {
+ super("Defects");
+ OseeEventManager.addListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.XWidget#createWidgets(org.eclipse.swt.widgets.Composite, int)
+ */
+ @Override
+ public void createWidgets(Composite parent, int horizontalSpan) {
+
+ // Create Text Widgets
+ if (displayLabel && !label.equals("")) {
+ labelWidget = new Label(parent, SWT.NONE);
+ labelWidget.setText(label + ":");
+ if (toolTip != null) {
+ labelWidget.setToolTipText(toolTip);
+ }
+ }
+
+ Composite mainComp = new Composite(parent, SWT.BORDER);
+ mainComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+ mainComp.setLayout(ALayout.getZeroMarginLayout());
+ if (toolkit != null) toolkit.paintBordersFor(mainComp);
+
+ createTaskActionBar(mainComp);
+
+ xViewer = new DefectXViewer(mainComp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, this);
+ xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ xViewer.setContentProvider(new DefectContentProvider(xViewer));
+ xViewer.setLabelProvider(new DefectLabelProvider(xViewer));
+ xViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ refreshActionEnablement();
+ }
+ });
+
+ if (toolkit != null) toolkit.adapt(xViewer.getStatusLabel(), false, false);
+
+ Tree tree = xViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH);
+ gridData.heightHint = 100;
+ tree.setLayout(ALayout.getZeroMarginLayout());
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+ // NOTE: Don't adapt the tree using xToolkit cause will loose xViewer's context menu
+
+ (new Label(mainComp, SWT.None)).setText("Select \"New Defect\" to add. Select icon in cell to update value.");
+ loadTable();
+ }
+
+ public void createTaskActionBar(Composite parent) {
+
+ // Button composite for state transitions, etc
+ Composite bComp = new Composite(parent, SWT.NONE);
+ // bComp.setBackground(mainSComp.getDisplay().getSystemColor(SWT.COLOR_CYAN));
+ bComp.setLayout(new GridLayout(2, false));
+ bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite leftComp = new Composite(bComp, SWT.NONE);
+ leftComp.setLayout(new GridLayout());
+ leftComp.setLayoutData(new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL));
+
+ extraInfoLabel = new Label(leftComp, SWT.NONE);
+ extraInfoLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ extraInfoLabel.setText("");
+ extraInfoLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ Composite rightComp = new Composite(bComp, SWT.NONE);
+ rightComp.setLayout(new GridLayout());
+ rightComp.setLayoutData(new GridData(GridData.END));
+
+ ToolBar toolBar = new ToolBar(rightComp, SWT.FLAT | SWT.RIGHT);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ toolBar.setLayoutData(gd);
+ ToolItem item = null;
+
+ newDefectItem = new ToolItem(toolBar, SWT.PUSH);
+ newDefectItem.setImage(SkynetGuiPlugin.getInstance().getImage("greenPlus.gif"));
+ newDefectItem.setToolTipText("New Defect");
+ newDefectItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleNewDefect();
+ }
+ });
+
+ deleteDefectItem = new ToolItem(toolBar, SWT.PUSH);
+ deleteDefectItem.setImage(SkynetGuiPlugin.getInstance().getImage("redRemove.gif"));
+ deleteDefectItem.setToolTipText("Delete Defect");
+ deleteDefectItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleDeleteDefect(false);
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("refresh.gif"));
+ item.setToolTipText("Refresh Defects");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ loadTable();
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("customize.gif"));
+ item.setToolTipText("Customize Table");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.getCustomizeMgr().handleTableCustomization();
+ }
+ });
+
+ createTaskActionBarPulldown(toolBar, rightComp);
+ refreshActionEnablement();
+ }
+
+ public void refreshActionEnablement() {
+ deleteDefectItem.setEnabled(editable && getSelectedDefectItems().size() > 0);
+ newDefectItem.setEnabled(editable);
+ }
+
+ public void createTaskActionBarPulldown(final ToolBar toolBar, Composite composite) {
+ final ToolItem dropDown = new ToolItem(toolBar, SWT.DROP_DOWN);
+ final Menu menu = new Menu(composite);
+
+ dropDown.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ if (event.detail == SWT.ARROW) {
+ Rectangle rect = dropDown.getBounds();
+ Point pt = new Point(rect.x, rect.y + rect.height);
+ pt = toolBar.toDisplay(pt);
+ menu.setLocation(pt.x, pt.y);
+ menu.setVisible(true);
+ }
+ }
+ });
+
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Create Defects via simple list");
+ item.setEnabled(editable);
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleImportDefectsViaList();
+ }
+ });
+
+ }
+
+ public void loadTable() {
+ try {
+ if (reviewArt != null && xViewer != null) {
+ xViewer.set(reviewArt.getDefectManager().getDefectItems());
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ refresh();
+ }
+
+ public void handleImportDefectsViaList() {
+ try {
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Create Defects", null,
+ "Enter task titles, one per line.", MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ ed.setFillVertically(true);
+ if (ed.open() == 0) {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (String str : ed.getEntry().split("\n")) {
+ str = str.replaceAll("\r", "");
+ if (!str.equals("")) {
+ reviewArt.getDefectManager().addDefectItem(str, false, transaction);
+ }
+ }
+ transaction.execute();
+ loadTable();
+ notifyXModifiedListeners();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void handleDeleteDefect(boolean persist) {
+ final List<DefectItem> items = getSelectedDefectItems();
+ if (items.size() == 0) {
+ AWorkbench.popup("ERROR", "No Defects Selected");
+ return;
+ }
+ StringBuilder builder = new StringBuilder();
+ for (DefectItem defectItem : items)
+ builder.append("\"" + defectItem.getDescription() + "\"\n");
+
+ boolean delete =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Delete Defects", "Are You Sure You Wish to Delete the Defects(s):\n\n" + builder.toString());
+ if (delete) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ deleteDefectHelper(items, persist, transaction);
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private void deleteDefectHelper(List<DefectItem> items, boolean persist, SkynetTransaction transaction) {
+ try {
+ for (DefectItem defectItem : items) {
+ reviewArt.getDefectManager().removeDefectItem(defectItem, persist, transaction);
+ xViewer.remove(defectItem);
+ }
+ loadTable();
+ notifyXModifiedListeners();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void handleNewDefect() {
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Create New Defect", null,
+ "Enter Defect Description", MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ if (ed.open() == 0) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ reviewArt.getDefectManager().addDefectItem(ed.getEntry(), false, transaction);
+ transaction.execute();
+ notifyXModifiedListeners();
+ loadTable();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public ArrayList<DefectItem> getSelectedDefectItems() {
+ ArrayList<DefectItem> items = new ArrayList<DefectItem>();
+ if (xViewer == null) return items;
+ if (xViewer.getSelection().isEmpty()) return items;
+ Iterator i = ((IStructuredSelection) xViewer.getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ items.add((DefectItem) obj);
+ }
+ return items;
+ }
+
+ @Override
+ public Control getControl() {
+ return xViewer.getTree();
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ xViewer.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ xViewer.getTree().setFocus();
+ }
+
+ @Override
+ public void refresh() {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+ xViewer.refresh();
+ setLabelError();
+ refreshActionEnablement();
+ }
+
+ @Override
+ public Result isValid() {
+ try {
+ if (isRequiredEntry() && xViewer.getTree().getItemCount() == 0) {
+ extraInfoLabel.setText("At least one defect entry is required");
+ return new Result("At least one defect entry is required");
+ }
+ if (reviewArt != null) {
+ for (DefectItem item : reviewArt.getDefectManager().getDefectItems()) {
+ if (item.isClosed() == false || item.getDisposition() == Disposition.None || (item.getSeverity() == Severity.None && (item.getDisposition() != Disposition.Duplicate && item.getDisposition() != Disposition.Reject))) {
+ extraInfoLabel.setText("Review not complete till all items are marked for severity, disposition and closed");
+ return new Result(
+ "Review not complete till all items are marked for severity, disposition and closed");
+ }
+
+ }
+ }
+ extraInfoLabel.setText("");
+ return Result.TrueResult;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return new Result("Exception validating defects. See log for details. " + ex);
+ }
+ }
+
+ @Override
+ public void setXmlData(String str) {
+ }
+
+ @Override
+ public String getXmlData() {
+ return null;
+ }
+
+ @Override
+ public String toHTML(String labelFont) {
+ if (getXViewer().getTree().getItemCount() == 0) return "";
+ StringBuffer html = new StringBuffer();
+ try {
+ html.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Tasks"));
+ html.append(AHTML.startBorderTable(100, normalColor, ""));
+ html.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Date", "User", "Location", "Description",
+ "Severity", "Disposition", "Injection Activity", "Resolution", "Location", "Closted"}));
+ for (DefectItem item : reviewArt.getDefectManager().getDefectItems()) {
+ html.append(AHTML.addRowMultiColumnTable(new String[] {item.getCreatedDate(XDate.MMDDYY),
+ item.getUser().getName(), item.getLocation(), item.getDescription(), item.getSeverity().name(),
+ item.getDisposition().name(), item.getInjectionActivity().name(), item.getResolution(),
+ item.isClosed() + ""}));
+ }
+ html.append(AHTML.endBorderTable());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ return "Defect Item Exception - " + ex.getLocalizedMessage();
+ }
+ return html.toString();
+ }
+
+ @Override
+ public String getReportData() {
+ return null;
+ }
+
+ /**
+ * @return Returns the xViewer.
+ */
+ public DefectXViewer getXViewer() {
+ return xViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.XWidget#getData()
+ */
+ @Override
+ public Object getData() {
+ return xViewer.getInput();
+ }
+
+ public IDirtiableEditor getEditor() {
+ return editor;
+ }
+
+ public void setEditor(IDirtiableEditor editor) {
+ this.editor = editor;
+ }
+
+ @Override
+ public boolean isEditable() {
+ return editable;
+ }
+
+ @Override
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public IReviewArtifact getReviewArt() {
+ return reviewArt;
+ }
+
+ public void setReviewArt(IReviewArtifact reviewArt) {
+ this.reviewArt = reviewArt;
+ if (xViewer != null) loadTable();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IDamWidget#setArtifact(org.eclipse.osee.framework.skynet.core.artifact.Artifact,
+ * java.lang.String)
+ */
+ public void setArtifact(Artifact artifact, String attrName) {
+ setReviewArt((IReviewArtifact) artifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#saveToArtifact()
+ */
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ // DefectViewer uses artifact as storage mechanism; nothing to do here
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#isDirty()
+ */
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ // DefectViewer uses artifact as storage mechanism which already determines dirty
+ return Result.FalseResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#revert()
+ */
+ @Override
+ public void revert() throws OseeCoreException {
+ // Nothing to revert cause artifact will be reverted
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.getBranchId() != AtsPlugin.getAtsBranch().getBranchId()) return;
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+ if (transData.isRelAddedChangedDeleted(reviewArt.getArtifact())) {
+ loadTable();
+ } else
+ refresh();
+ }
+ });
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
new file mode 100644
index 00000000000..5b86648911a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.filteredTree.OSEECheckedFilteredTreeDialog;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.dialogs.PatternFilter;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AICheckTreeDialog extends OSEECheckedFilteredTreeDialog {
+
+ private static PatternFilter patternFilter = new PatternFilter();
+ private final Active active;
+
+ public AICheckTreeDialog(String title, String message, Active active) {
+ super(title, message, patternFilter, new AITreeContentProvider(active), new ArtifactLabelProvider());
+ this.active = active;
+ }
+
+ public Collection<ActionableItemArtifact> getChecked() {
+ if (super.getTreeViewer() == null) return Collections.emptyList();
+ Set<ActionableItemArtifact> checked = new HashSet<ActionableItemArtifact>();
+ for (Object obj : super.getTreeViewer().getChecked()) {
+ checked.add((ActionableItemArtifact) obj);
+ }
+ return checked;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control comp = super.createDialogArea(container);
+ try {
+ getTreeViewer().getViewer().setInput(ActionableItemArtifact.getTopLevelActionableItems(active));
+ getTreeViewer().getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ try {
+ for (ActionableItemArtifact aia : getChecked()) {
+ if (!aia.isActionable()) {
+ AWorkbench.popup("ERROR", ActionableItemArtifact.getNotActionableItemError(aia));
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return comp;
+ }
+
+ @Override
+ protected Result isComplete() {
+ try {
+ for (ActionableItemArtifact aia : getChecked()) {
+ if (!aia.isActionable()) {
+ return Result.FalseResult;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return super.isComplete();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
new file mode 100644
index 00000000000..98729d734dd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+public class AITreeContentProvider implements ITreeContentProvider {
+
+ private final Active active;
+
+ public AITreeContentProvider(Active active) {
+ super();
+ this.active = active;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Collection)
+ return ((Collection) parentElement).toArray();
+ else if (parentElement instanceof ActionableItemArtifact) {
+ try {
+ ActionableItemArtifact ai = ((ActionableItemArtifact) parentElement);
+ return AtsLib.getActiveSet(Artifacts.getChildrenOfTypeSet(ai, ActionableItemArtifact.class, false), active,
+ ActionableItemArtifact.class).toArray();
+ } catch (Exception ex) {
+ }
+ }
+ return new Object[] {};
+ }
+
+ public Object getParent(Object element) {
+ try {
+ if (element instanceof ActionableItemArtifact) {
+ return ((ActionableItemArtifact) element).getParent();
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
new file mode 100644
index 00000000000..382dcf45fb5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionActionableItemListDialog extends CheckedTreeSelectionDialog {
+
+ XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Actionable Items' Actions");
+ boolean recurseChildren = false;
+ XCheckBox showFinishedCheck = new XCheckBox("Show Completed and Cancelled Workflows");
+ boolean showFinished = false;
+ XCheckBox showActionCheck = new XCheckBox("Show Action instead of Workflows");
+ boolean showAction = false;
+
+ public ActionActionableItemListDialog(Active active) {
+ super(Display.getCurrent().getActiveShell(), new ArtifactDescriptiveLabelProvider(), new AITreeContentProvider(
+ active));
+ setTitle("Select Actionable Items");
+ setMessage("Select Actionable Items");
+ setComparator(new ArtifactNameSorter());
+ try {
+ setInput(ActionableItemArtifact.getTopLevelActionableItems(active));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Control control = super.createDialogArea(container);
+ Composite comp = new Composite(control.getParent(), SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ recurseChildrenCheck.createWidgets(comp, 2);
+ recurseChildrenCheck.set(recurseChildren);
+ recurseChildrenCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ recurseChildren = recurseChildrenCheck.isSelected();
+ };
+ });
+ showFinishedCheck.createWidgets(comp, 2);
+ showFinishedCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showFinished = showFinishedCheck.isSelected();
+ };
+ });
+ showActionCheck.createWidgets(comp, 2);
+ showActionCheck.set(showAction);
+ showActionCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showAction = showActionCheck.isSelected();
+ };
+ });
+
+ return container;
+ }
+
+ public boolean isShowFinished() {
+ return showFinished;
+ }
+
+ public boolean isShowAction() {
+ return showAction;
+ }
+
+ /**
+ * @return the recurseChildren
+ */
+ public boolean isRecurseChildren() {
+ return recurseChildren;
+ }
+
+ /**
+ * @param recurseChildren the recurseChildren to set
+ */
+ public void setRecurseChildren(boolean recurseChildren) {
+ this.recurseChildren = recurseChildren;
+ }
+
+ /**
+ * @param showFinished the showFinished to set
+ */
+ public void setShowFinished(boolean showFinished) {
+ this.showFinished = showFinished;
+ }
+
+ /**
+ * @param showAction the showAction to set
+ */
+ public void setShowAction(boolean showAction) {
+ this.showAction = showAction;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java
new file mode 100644
index 00000000000..45e9d66d4fe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java
@@ -0,0 +1,144 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.ArrayList;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.ArtifactListDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionTeamListDialog extends ArtifactListDialog {
+
+ XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Team's Actions");
+ boolean recurseChildren = false;
+ XCheckBox showFinishedCheck = new XCheckBox("Show Completed and Cancelled Workflows");
+ boolean showFinished = false;
+ XCheckBox showActionCheck = new XCheckBox("Show Action instead of Workflows");
+ boolean showAction = true;
+
+ public ActionTeamListDialog(Active active) {
+ super(Display.getCurrent().getActiveShell(), null);
+ setTitle("Select Team(s)");
+ setMessage("Select Team(s)");
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ try {
+ for (Artifact prod : TeamDefinitionArtifact.getTeamDefinitions(active))
+ arts.add(prod);
+ } catch (Exception ex) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't Load product list.", true);
+ }
+ setArtifacts(arts);
+ }
+
+ /**
+ * Return the style flags for the table viewer.
+ *
+ * @return int
+ */
+ @Override
+ protected int getTableStyle() {
+ return SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Control control = super.createDialogArea(container);
+ Composite comp = new Composite(control.getParent(), SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ recurseChildrenCheck.createWidgets(comp, 2);
+ recurseChildrenCheck.set(recurseChildren);
+ recurseChildrenCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ recurseChildren = recurseChildrenCheck.isSelected();
+ };
+ });
+ showFinishedCheck.createWidgets(comp, 2);
+ showFinishedCheck.set(showFinished);
+ showFinishedCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showFinished = showFinishedCheck.isSelected();
+ };
+ });
+ showActionCheck.createWidgets(comp, 2);
+ showActionCheck.set(showAction);
+ showActionCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showAction = showActionCheck.isSelected();
+ };
+ });
+
+ return container;
+ }
+
+ public boolean isShowFinished() {
+ return showFinished;
+ }
+
+ public boolean isShowAction() {
+ return showAction;
+ }
+
+ /**
+ * @param showFinished the showFinished to set
+ */
+ public void setShowFinished(boolean showFinished) {
+ this.showFinished = showFinished;
+ }
+
+ /**
+ * @param showAction the showAction to set
+ */
+ public void setShowAction(boolean showAction) {
+ this.showAction = showAction;
+ }
+
+ /**
+ * @return the recurseChildren
+ */
+ public boolean isRecurseChildren() {
+ return recurseChildren;
+ }
+
+ /**
+ * @param recurseChildren the recurseChildren to set
+ */
+ public void setRecurseChildren(boolean recurseChildren) {
+ this.recurseChildren = recurseChildren;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java
new file mode 100644
index 00000000000..c8eb2cecab8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionTeamVersionListDialog extends ActionTeamListDialog {
+
+ XListViewer versionList = new XListViewer("Version");
+ VersionArtifact selectedVersion = null;
+
+ /**
+ * @param active
+ */
+ public ActionTeamVersionListDialog(Active active) {
+ super(active);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ super.createDialogArea(container);
+ getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ try {
+ Collection<Object> objs = new HashSet<Object>();
+ if (getTableViewer().getSelection().isEmpty()) return;
+ IStructuredSelection sel = (IStructuredSelection) getTableViewer().getSelection();
+ for (Artifact art : ((TeamDefinitionArtifact) sel.iterator().next()).getVersionsFromTeamDefHoldingVersions(VersionReleaseType.Both))
+ objs.add(art);
+ versionList.setInput(objs);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+
+ Composite comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(1, false));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ versionList.setLabelProvider(new VersionArtifactLabelProvider());
+ versionList.setContentProvider(new ArrayContentProvider());
+ versionList.setSorter(new ArtifactViewerSorter());
+ versionList.setGrabHorizontal(true);
+ versionList.setMultiSelect(false);
+ versionList.createWidgets(comp, 2);
+ versionList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ if (versionList.getSelected().size() == 0)
+ selectedVersion = null;
+ else
+ selectedVersion = (VersionArtifact) versionList.getSelected().iterator().next();
+ };
+ });
+
+ return container;
+ }
+
+ /**
+ * @return the selectedVersion
+ */
+ public VersionArtifact getSelectedVersion() {
+ return selectedVersion;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
new file mode 100644
index 00000000000..c706fc1563e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemListDialog extends CheckedTreeSelectionDialog {
+
+ public ActionableItemListDialog(Active active) {
+ super(Display.getCurrent().getActiveShell(), new ArtifactDescriptiveLabelProvider(), new AITreeContentProvider(
+ active));
+ setTitle("Select Actionable Item(s)");
+ setMessage("Select Actionable Item(s)");
+ setComparator(new ArtifactNameSorter());
+ try {
+ setInput(ActionableItemArtifact.getTopLevelActionableItems(active));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public Set<ActionableItemArtifact> getSelected() {
+ Set<ActionableItemArtifact> selectedactionItems = new HashSet<ActionableItemArtifact>();
+ for (Object obj : getResult())
+ selectedactionItems.add((ActionableItemArtifact) obj);
+ return selectedactionItems;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java
new file mode 100644
index 00000000000..835ec5be611
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.ArrayList;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsPriority;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.HyperLinkLabel;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.dialogs.ListDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPriorityDialog extends ListDialog {
+
+ PriorityType selected = null;
+
+ public AtsPriorityDialog(Shell parent) {
+ super(parent);
+ setContentProvider(new ArrayContentProvider());
+ setLabelProvider(new PriorityLabelProvider());
+ setInput(AtsPriority.PriorityType.values());
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ setTitle("Select Priority");
+ setMessage("Select Priority - Click for Help");
+ }
+
+ public AtsPriority.PriorityType getSelection() {
+ return (AtsPriority.PriorityType) getResult()[0];
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.dialogs.SelectionDialog#createMessageArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Label createMessageArea(Composite composite) {
+ Label label = super.createMessageArea(composite);
+ label.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event event) {
+ AtsPriority.openHelp();
+ }
+ });
+ HyperLinkLabel.adapt(label);
+ return label;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Control c = super.createDialogArea(container);
+ if (selected != null) {
+ ArrayList<Object> sel = new ArrayList<Object>();
+ sel.add(selected);
+ getTableViewer().setSelection(new StructuredSelection(sel.toArray(new Object[sel.size()])));
+ getTableViewer().getTable().setFocus();
+ }
+ AtsPlugin.getInstance().setHelp(getTableViewer().getControl(), AtsPriority.PRIORITY_HELP_CONTEXT_ID);
+ return c;
+ }
+
+ @Override
+ protected void okPressed() {
+ if (getTableViewer().getSelection().isEmpty()) {
+ AWorkbench.popup("ERROR", "Must make selection.");
+ return;
+ }
+ super.okPressed();
+ }
+
+ public class PriorityLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ PriorityType type = (PriorityType) arg0;
+ if (type == PriorityType.None) return type.name();
+ return type.getShortName();
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+
+ }
+
+ public void setSelected(PriorityType selected) {
+ this.selected = selected;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
new file mode 100644
index 00000000000..c3ecf167533
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XFloat;
+import org.eclipse.osee.framework.ui.skynet.widgets.XPercent;
+import org.eclipse.osee.framework.ui.skynet.widgets.XRadioButton;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+
+public class SMAStatusDialog extends MessageDialog {
+
+ protected Label statusLabel;
+ protected XPercent percent = new XPercent("Percent Complete", "");
+ protected XFloat hours = new XFloat("Additional Hours Spent", "");
+ protected XRadioButton splitRadio = new XRadioButton("Split Hours Spent between Tasks");
+ protected XRadioButton eachRadio = new XRadioButton("Apply Hours Spent to each Task");
+ private Button okButton;
+ private final boolean showPercent;
+ protected final Collection<? extends StateMachineArtifact> smas;
+
+ public SMAStatusDialog(Shell parentShell, String dialogTitle, String dialogMessage, Collection<? extends StateMachineArtifact> smas) {
+ this(parentShell, dialogTitle, dialogMessage, true, smas);
+ }
+
+ public SMAStatusDialog(Shell parentShell, String dialogTitle, String dialogMessage, boolean showPercent, Collection<? extends StateMachineArtifact> smas) {
+ super(parentShell, dialogTitle, null, dialogMessage, MessageDialog.NONE, new String[] {"OK", "Cancel"}, 0);
+ this.showPercent = showPercent;
+ this.smas = smas;
+ }
+
+ protected void createPreCustomArea(Composite parent) {
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+
+ boolean hasTask = false;
+ for (StateMachineArtifact sma : smas)
+ if (sma instanceof TaskArtifact) hasTask = true;
+
+ statusLabel = new Label(parent, SWT.NONE);
+ statusLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ updateStatusLabel();
+
+ if (smas.size() > 1) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText("Mulitple objects being statused. All objects will be " + "set to percent\ncomplete and hours spent will be split or added into each task.");
+ }
+
+ createPreCustomArea(parent);
+
+ if (hasTask) (new Label(parent, SWT.NONE)).setText("Task will auto-transition to complete when statused 100%.\n" + "Make all other changes to Task prior to statusing 100%.");
+
+ if (showPercent) {
+ percent.setRequiredEntry(true);
+ percent.setToolTip("Enter total percent complete.");
+ percent.createWidgets(parent, 2);
+ try {
+ if (smas.size() == 1) percent.set(smas.iterator().next().getSmaMgr().getStateMgr().getPercentComplete());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ percent.addModifyListener(new ModifyListener() {
+ public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
+ updateButtons();
+ updateStatusLabel();
+ };
+ });
+ percent.getLabelWidget().addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event event) {
+ if (event.button == 3) {
+ percent.set("100");
+ hours.set("1");
+ updateStatusLabel();
+ }
+ }
+ });
+ }
+
+ hours.setRequiredEntry(true);
+ hours.setToolTip("Enter hours spent since last status entry.");
+ hours.createWidgets(parent, 2);
+ hours.addModifyListener(new ModifyListener() {
+ public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
+ updateButtons();
+ updateStatusLabel();
+ };
+ });
+
+ if (smas.size() > 1) {
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout(4, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ eachRadio.createWidgets(comp, 2);
+ eachRadio.setSelected(false);
+ eachRadio.setToolTip("Hours Spent will be added to to time spent for each object.");
+
+ splitRadio.createWidgets(comp, 2);
+ splitRadio.setSelected(true);
+ splitRadio.setToolTip("Hours Spent will be divided equaly by the number of objects " + "and added to the existing hours spent for the object.");
+ }
+
+ return parent;
+ }
+
+ protected void updateStatusLabel() {
+ Result result = isComplete();
+ if (result.isFalse())
+ statusLabel.setText(result.getText());
+ else
+ statusLabel.setText("");
+ statusLabel.getParent().layout();
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control c = super.createButtonBar(parent);
+ okButton = getButton(0);
+ okButton.setEnabled(false);
+ return c;
+ }
+
+ public boolean isSplitHours() {
+ return (splitRadio.isSelected());
+ }
+
+ protected Result isComplete() {
+ if (percent.isValid().isFalse()) return percent.isValid();
+ if (hours.isValid().isFalse()) return hours.isValid();
+ if (smas.size() > 1) {
+ if (!splitRadio.isSelected() && !eachRadio.isSelected()) return new Result(
+ "Either split or each must be selected");
+ if (splitRadio.isSelected() && eachRadio.isSelected()) return new Result("Select only split or each");
+ }
+ return Result.TrueResult;
+ }
+
+ private void updateButtons() {
+ okButton.setEnabled(isComplete().isTrue());
+ }
+
+ public XFloat getHours() {
+ return hours;
+ }
+
+ public XRadioButton getEachRadio() {
+ return eachRadio;
+ }
+
+ public XRadioButton getSplitRadio() {
+ return splitRadio;
+ }
+
+ public XPercent getPercent() {
+ return percent;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListAndTitleDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListAndTitleDialog.java
new file mode 100644
index 00000000000..b04e3f9d7c9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListAndTitleDialog.java
@@ -0,0 +1,87 @@
+/*
+ * Created on Jul 1, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XText;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateListAndTitleDialog extends StateListDialog {
+
+ String reviewTitle;
+ XText titleText;
+
+ /**
+ * @param title
+ * @param message
+ * @param values
+ */
+ public StateListAndTitleDialog(String title, String message, Collection<String> values) {
+ super(title, message, values);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.dialogs.ListDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Composite comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout());
+ comp.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
+ titleText = new XText("Review Title");
+ titleText.createWidgets(comp, 1);
+ if (reviewTitle != null) titleText.set(reviewTitle);
+ titleText.getStyledText().setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, false));
+ titleText.addXModifiedListener(new XModifiedListener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener#widgetModified(org.eclipse.osee.framework.ui.skynet.widgets.XWidget)
+ */
+ @Override
+ public void widgetModified(XWidget widget) {
+ reviewTitle = titleText.get();
+ }
+ });
+
+ Control control = super.createDialogArea(container);
+ getTableViewer().setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return getComparator().compare((String) e1, (String) e2);
+ }
+ });
+
+ return control;
+ }
+
+ /**
+ * @return the reviewTitle
+ */
+ public String getReviewTitle() {
+ return reviewTitle;
+ }
+
+ /**
+ * @param reviewTitle the reviewTitle to set
+ */
+ public void setReviewTitle(String reviewTitle) {
+ this.reviewTitle = reviewTitle;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java
new file mode 100644
index 00000000000..f944a20e5d0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.ListDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateListDialog extends ListDialog {
+
+ public StateListDialog(String title, String message, Collection<String> values) {
+ super(Display.getCurrent().getActiveShell());
+ setInput(values);
+ setTitle(title);
+ setMessage(message);
+ setContentProvider(new ArrayContentProvider());
+ setLabelProvider(new StringLabelProvider());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.dialogs.ListDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control control = super.createDialogArea(container);
+ getTableViewer().setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return getComparator().compare((String) e1, (String) e2);
+ }
+ });
+ return control;
+ }
+
+ public String getSelectedState() {
+ return (String) getResult()[0];
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java
new file mode 100644
index 00000000000..c5792b6eed5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskOptionStatusDialog extends SMAStatusDialog {
+
+ XComboViewer resolutionCombo = new XComboViewer("Resolution");
+ private final List<TaskResOptionDefinition> options;
+ private Map<String, TaskResOptionDefinition> nameToResDef = new HashMap<String, TaskResOptionDefinition>();
+ private TaskResOptionDefinition selectedOption;
+
+ /**
+ * @param parentShell
+ * @param dialogTitle
+ * @param dialogMessage
+ * @param showPercent
+ * @param options
+ */
+ public TaskOptionStatusDialog(Shell parentShell, String dialogTitle, String dialogMessage, boolean showPercent, List<TaskResOptionDefinition> options, Collection<? extends StateMachineArtifact> tasks) {
+ super(parentShell, dialogTitle, dialogMessage, showPercent, tasks);
+ this.options = options;
+ for (TaskResOptionDefinition trd : options)
+ nameToResDef.put(trd.getName(), trd);
+ }
+
+ @Override
+ protected Result isComplete() {
+ TaskResOptionDefinition trd = getSelectedOptionDef();
+ if (trd == null) return Result.FalseResult;
+ int percentComp = percent.getInt();
+ if (trd.isCompleteable() && (percentComp != 100)) return new Result(
+ "Completed resolution must have %Complete == 100");
+ if (percentComp == 100 && !trd.isCompleteable()) return new Result(
+ "Can't have 100% complete with a non-Completed resolution");
+ return super.isComplete();
+ }
+
+ public TaskResOptionDefinition getSelectedOptionDef() {
+ return selectedOption;
+ }
+
+ @Override
+ protected void createPreCustomArea(Composite parent) {
+ super.createPreCustomArea(parent);
+ resolutionCombo.setLabelProvider(new ResolutionLabelProvider());
+ resolutionCombo.setContentProvider(new ArrayContentProvider());
+ resolutionCombo.setRequiredEntry(true);
+ ArrayList<Object> objs = new ArrayList<Object>();
+ for (Object obj : options)
+ objs.add(obj);
+ resolutionCombo.setInput(objs);
+ resolutionCombo.createWidgets(parent, 2);
+ try {
+ if (smas.size() == 1) {
+ String selOption = smas.iterator().next().getWorldViewResolution();
+ if (selOption != null && !selOption.equals("")) {
+ selectedOption = nameToResDef.get(selOption);
+ if (selectedOption != null) {
+ ArrayList<Object> sel = new ArrayList<Object>();
+ sel.add(selectedOption);
+ resolutionCombo.setSelected(sel);
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ resolutionCombo.getCombo().setVisibleItemCount(20);
+ resolutionCombo.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectedOption = (TaskResOptionDefinition) resolutionCombo.getSelected();
+ if (selectedOption != null && !selectedOption.getPercent().equals("")) {
+ int newPercent = (new Integer(selectedOption.getPercent())).intValue();
+ percent.set(newPercent + "");
+ updateStatusLabel();
+ }
+ };
+ });
+ }
+ public class ResolutionLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ TaskResOptionDefinition trd = ((TaskResOptionDefinition) arg0);
+ return trd.getName() + " - " + trd.getDesc() + (trd.isCompleteable() ? " (Completed)" : "");
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java
new file mode 100644
index 00000000000..620e4686143
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.swt.SWT;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskResOptionDefinition {
+
+ private String name;
+ private String desc;
+ private boolean completeable;
+ private String color;
+ private String percent;
+ public static String ATS_TASK_OPTION_TAG = "AtsTaskOption";
+
+ public TaskResOptionDefinition() {
+ name = "";
+ desc = "";
+ percent = "";
+ completeable = false;
+ }
+
+ /**
+ * @param name
+ * @param desc
+ * @param completeable true/false of whether option allows task to be transitioned to complete
+ */
+ public TaskResOptionDefinition(String name, String desc, String completeable, String color, String defaultPercent) {
+ this(name, desc, completeable.equals("true"), color, defaultPercent);
+ }
+
+ public TaskResOptionDefinition(String name, String desc, boolean completeable, String defaultPercent) {
+ this(name, desc, completeable, "", defaultPercent);
+ }
+
+ public void setFromElement(Element element) {
+ for (int x = 0; x < element.getAttributes().getLength(); x++) {
+ Node node = element.getAttributes().item(x);
+ String nodeName = node.getNodeName();
+ if (nodeName.equals(Field.name.name()))
+ name = node.getNodeValue();
+ else if (nodeName.equals(Field.desc.name()))
+ desc = node.getNodeValue();
+ else if (nodeName.equals(Field.complete.name()))
+ completeable = Boolean.parseBoolean(node.getNodeValue());
+ else if (nodeName.equals(Field.color.name()))
+ color = node.getNodeValue();
+ else if (nodeName.equals(Field.percent.name()))
+ percent = node.getNodeValue();
+ else
+ throw new IllegalArgumentException("Unknow Task Resolution Option Attribute \"" + nodeName + "\"");
+ }
+ }
+
+ /**
+ * @param name
+ * @param desc
+ * @param completeable true if option allows task to be transitioned to complete
+ * @param color BLUE, RED, etc...; "" for black
+ */
+ public TaskResOptionDefinition(String name, String desc, boolean completeable, String color, String defaultPercent) {
+ this.name = name;
+ this.desc = desc;
+ this.completeable = completeable;
+ this.color = color;
+ this.percent = defaultPercent;
+ }
+
+ public int getColorInt() {
+ if (color == null || color.equals("")) return SWT.COLOR_BLACK;
+ if (color.equals("WHITE")) return SWT.COLOR_WHITE;
+ if (color.equals("BLACK")) return SWT.COLOR_BLACK;
+ if (color.equals("RED")) return SWT.COLOR_RED;
+ if (color.equals("DARK_RED")) return SWT.COLOR_DARK_RED;
+ if (color.equals("GREEN")) return SWT.COLOR_GREEN;
+ if (color.equals("DARK_GREEN")) return SWT.COLOR_DARK_GREEN;
+ if (color.equals("YELLOW")) return SWT.COLOR_YELLOW;
+ if (color.equals("DARK_YELLOW")) return SWT.COLOR_DARK_YELLOW;
+ if (color.equals("BLUE")) return SWT.COLOR_BLUE;
+ if (color.equals("DARK_BLUE")) return SWT.COLOR_DARK_BLUE;
+ if (color.equals("MAGENTA")) return SWT.COLOR_MAGENTA;
+ if (color.equals("DARK_MAGENTA")) return SWT.COLOR_DARK_MAGENTA;
+ if (color.equals("CYAN")) return SWT.COLOR_CYAN;
+ if (color.equals("DARK_CYAN")) return SWT.COLOR_DARK_CYAN;
+ if (color.equals("GRAY")) return SWT.COLOR_GRAY;
+ if (color.equals("DARK_GRAY")) return SWT.COLOR_DARK_GRAY;
+ return SWT.COLOR_BLACK;
+ }
+
+ /**
+ * @return true if resolution option allows task to be transitioned to complete
+ */
+ public boolean isCompleteable() {
+ return completeable;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ private enum Field {
+ name, desc, complete, percent, color
+ };
+
+ public void setFromXml(String xml) {
+ for (Field field : Field.values()) {
+ String data = AXml.getTagData(xml, field.name());
+ if (field == Field.name)
+ setName(data);
+ else if (field == Field.color)
+ setColor(data);
+ else if (field == Field.desc)
+ setDesc(data);
+ else if (field == Field.percent)
+ setPercent(data);
+ else if (field == Field.complete)
+ setComplete(data.equals("true"));
+ else
+ throw new IllegalArgumentException("Unexpected field");
+ }
+ }
+
+ public String toXml() {
+ StringBuffer sb = new StringBuffer("<" + ATS_TASK_OPTION_TAG + ">");
+ for (Field field : Field.values()) {
+ String str = "";
+ if (field == Field.name)
+ str = getName();
+ else if (field == Field.color)
+ str = getColor();
+ else if (field == Field.desc)
+ str = getDesc();
+ else if (field == Field.percent)
+ str = getPercent();
+ else if (field == Field.complete)
+ str = (isCompleteable() ? "true" : "false");
+ else
+ throw new IllegalArgumentException("Unexpected field");
+ sb.append(AXml.addTagData(field.name(), str));
+ }
+ sb.append("</" + ATS_TASK_OPTION_TAG + ">");
+ return sb.toString();
+ }
+
+ public void setComplete(boolean complete) {
+ this.completeable = complete;
+ }
+
+ public void setDesc(String desc) {
+ this.desc = desc;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getColor() {
+ return color;
+ }
+
+ public void setColor(String color) {
+ this.color = color;
+ }
+
+ public String getPercent() {
+ return percent;
+ }
+
+ public void setPercent(String defaultPercent) {
+ this.percent = defaultPercent;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptionRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptionRule.java
new file mode 100644
index 00000000000..86344be7459
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptionRule.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskResolutionOptionRule extends WorkRuleDefinition {
+
+ private final List<TaskResOptionDefinition> options = new ArrayList<TaskResOptionDefinition>();
+ public static String ATS_TASK_OPTIONS_TAG = "AtsTaskOptions";
+ public static String WORK_TYPE = "AtsTaskResolutionOptions";
+ public static List<TaskResOptionDefinition> EMPTY_TASK_RESOLUTION_OPTIONS = new ArrayList<TaskResOptionDefinition>();
+
+ public TaskResolutionOptionRule(String name, String id, String value) {
+ super(name, id, null, WORK_TYPE);
+ addWorkDataKeyValue(ATS_TASK_OPTIONS_TAG, value);
+ }
+
+ /**
+ * @param artifact
+ * @throws Exception
+ */
+ public TaskResolutionOptionRule(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ fromXml(artifact.getSoleAttributeValue(WorkItemAttributes.WORK_PARENT_ID.getAttributeTypeName(), ""));
+ }
+
+ public static List<TaskResOptionDefinition> getTaskResolutionOptions(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ TaskResolutionOptionRule taskResolutionOptionRule = getTaskResolutionOptionRule(workPageDefinition);
+ if (taskResolutionOptionRule != null) return taskResolutionOptionRule.getOptions();
+ return EMPTY_TASK_RESOLUTION_OPTIONS;
+ }
+
+ public static TaskResolutionOptionRule getTaskResolutionOptionRule(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ List<WorkItemDefinition> wids =
+ workPageDefinition.getWorkItemDefinitionsByType(TaskResolutionOptionRule.WORK_TYPE);
+ if (wids.size() == 0) return null;
+ WorkItemDefinition workItemDefinition = wids.iterator().next();
+ if (workItemDefinition != null) {
+ TaskResolutionOptionRule taskResolutionOptionRule =
+ new TaskResolutionOptionRule(null, GUID.generateGuidStr(), null);
+ taskResolutionOptionRule.fromXml(workItemDefinition.getWorkDataValue(ATS_TASK_OPTIONS_TAG));
+ return taskResolutionOptionRule;
+ }
+ return null;
+ }
+
+ public void setFromDoc(Document doc) {
+ NodeList nodes = doc.getElementsByTagName(TaskResOptionDefinition.ATS_TASK_OPTION_TAG);
+ if (nodes.getLength() > 0) {
+ for (int x = 0; x < nodes.getLength(); x++) {
+ Element element = (Element) nodes.item(x);
+ TaskResOptionDefinition trd = new TaskResOptionDefinition();
+ trd.setFromElement(element);
+ options.add(trd);
+ }
+ }
+ }
+
+ public void fromXml(String xmlStr) throws OseeCoreException {
+ try {
+ setFromDoc(Jaxp.readXmlDocument(xmlStr));
+ } catch (Exception ex) {
+ throw new OseeCoreException(ex);
+ }
+ }
+
+ public String toXml() {
+ StringBuffer sb = new StringBuffer();
+ sb.append("<" + TaskResOptionDefinition.ATS_TASK_OPTION_TAG + ">\n");
+ for (TaskResOptionDefinition def : options) {
+ sb.append(def.toXml() + "\n");
+ }
+ sb.append("</" + TaskResOptionDefinition.ATS_TASK_OPTION_TAG + ">\n");
+ return sb.toString();
+ }
+
+ public List<TaskResOptionDefinition> getOptions() {
+ return options;
+ }
+
+ /**
+ * Return the order index number of the given option name. Used for comparisons of resolutions like < and > by
+ * getting both indexes and doing a mathmatical comparison.
+ *
+ * @param name
+ * @return index number (starting at 1) or null if not found
+ */
+ public Integer getResolutionOptionOrderIndex(String name) {
+ int x = 1;
+ for (TaskResOptionDefinition option : options) {
+ if (option.getName().equals(name)) return x;
+ x++;
+ }
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java
new file mode 100644
index 00000000000..ae1f8a20139
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionDialog extends org.eclipse.ui.dialogs.ListDialog {
+
+ /**
+ *
+ */
+ public TeamDefinitionDialog(String title, String message) {
+ super(Display.getCurrent().getActiveShell());
+ this.setTitle(title);
+ this.setMessage(message);
+ this.setContentProvider(new ArrayContentProvider() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof Collection) {
+ Collection list = (Collection) inputElement;
+ return (list.toArray(new TeamDefinitionArtifact[list.size()]));
+ }
+ return super.getElements(inputElement);
+ }
+ });
+ setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof TeamDefinitionArtifact) {
+ return ((TeamDefinitionArtifact) element).getDescriptiveName();
+ }
+ return "Unknown element type";
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof TeamDefinitionArtifact) {
+ return ((TeamDefinitionArtifact) element).getImage();
+ }
+ return null;
+ }
+
+ });
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control c = super.createDialogArea(container);
+ getTableViewer().setSorter(new ArtifactNameSorter());
+ return c;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java
new file mode 100644
index 00000000000..593f2cc1d44
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionTreeByVersionDialog extends TeamDefinitionTreeDialog {
+
+ XListViewer versionList = new XListViewer("Version");
+ VersionArtifact selectedVersion = null;
+private Button okButton;
+
+ /**
+ * @param active
+ */
+ public TeamDefinitionTreeByVersionDialog(Active active) {
+ super(active);
+ try {
+ setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(active));
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ super.createDialogArea(container);
+ getTreeViewer().addCheckStateListener(new ICheckStateListener() {
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
+ */
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ try {
+ Collection<Object> objs = new HashSet<Object>();
+ Object objects[] = getTreeViewer().getCheckedElements();
+ for (Object object : objects) {
+ for (Artifact art : ((TeamDefinitionArtifact) object).getVersionsFromTeamDefHoldingVersions(VersionReleaseType.Both))
+ objs.add(art);
+ }
+ versionList.setInput(objs);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+
+ Composite comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(1, false));
+ comp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ versionList.setLabelProvider(new VersionArtifactLabelProvider());
+ versionList.setContentProvider(new ArrayContentProvider());
+ versionList.setSorter(new ArtifactViewerSorter(true));
+ versionList.setGrabHorizontal(true);
+ versionList.setMultiSelect(false);
+ versionList.createWidgets(comp, 2);
+ versionList.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ if (versionList.getSelected().size() == 0)
+ selectedVersion = null;
+ else
+ selectedVersion = (VersionArtifact) versionList.getSelected().iterator().next();
+
+ updateButtons();
+ };
+ });
+ return container;
+ }
+
+ /**
+ * @return the selectedVersion
+ */
+ public VersionArtifact getSelectedVersion() {
+ return selectedVersion;
+ }
+
+ @Override
+ protected Control createButtonBar(Composite parent) {
+ Control c = super.createButtonBar(parent);
+ okButton = getButton(0);
+ okButton.setEnabled(false);
+ return c;
+ }
+
+ protected boolean isComplete() {
+ return selectedVersion != null;
+ }
+
+ private void updateButtons() {
+ if (okButton != null) {
+ okButton.setEnabled(isComplete());
+ }
+ }
+
+ protected void updateOKStatus() {
+ updateButtons();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java
new file mode 100644
index 00000000000..999c3d5efe2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+public class TeamDefinitionTreeContentProvider implements ITreeContentProvider {
+
+ private final Active active;
+
+ public TeamDefinitionTreeContentProvider(Active active) {
+ super();
+ this.active = active;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Collection)
+ return ((Collection) parentElement).toArray();
+ else if (parentElement instanceof TeamDefinitionArtifact) {
+ try {
+ TeamDefinitionArtifact teamDef = ((TeamDefinitionArtifact) parentElement);
+ return AtsLib.getActiveSet(Artifacts.getChildrenOfTypeSet(teamDef, TeamDefinitionArtifact.class, false),
+ active, TeamDefinitionArtifact.class).toArray();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ return new Object[] {};
+ }
+
+ public Object getParent(Object element) {
+ try {
+ if (element instanceof TeamDefinitionArtifact) {
+ return ((TeamDefinitionArtifact) element).getParent();
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java
new file mode 100644
index 00000000000..ff7270a27ec
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionTreeDialog extends TeamDefinitionTreeWithChildrenDialog {
+
+ XCheckBox showFinishedCheck = new XCheckBox("Show Completed and Cancelled Workflows");
+ Boolean showFinished = false;
+ XCheckBox showActionCheck = new XCheckBox("Show Action instead of Workflows");
+ Boolean showAction = false;
+
+ public TeamDefinitionTreeDialog(Active active) {
+ super(active);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Control control = super.createDialogArea(container);
+
+ if (showFinished != null) {
+ showFinishedCheck.createWidgets(dialogComp, 2);
+ showFinishedCheck.set(showFinished);
+ showFinishedCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showFinished = showFinishedCheck.isSelected();
+ };
+ });
+ }
+
+ if (showAction != null) {
+ showActionCheck.createWidgets(dialogComp, 2);
+ showActionCheck.set(showAction);
+ showActionCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showAction = showActionCheck.isSelected();
+ };
+ });
+ }
+
+ return control;
+ }
+
+ public Boolean isShowFinished() {
+ return showFinished;
+ }
+
+ public Boolean isShowAction() {
+ return showAction;
+ }
+
+ /**
+ * @param showFinished true/false default for showAction checkbox; null to not display showAction checkbox
+ */
+ public void setShowFinished(Boolean showFinished) {
+ this.showFinished = showFinished;
+ }
+
+ /**
+ * @param showAction true/false default for showAction checkbox; null to not display showAction checkbox
+ */
+ public void setShowAction(Boolean showAction) {
+ this.showAction = showAction;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
new file mode 100644
index 00000000000..3da042d5d32
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamDefinitionTreeWithChildrenDialog extends CheckedTreeSelectionDialog {
+
+ XCheckBox recurseChildrenCheck = new XCheckBox("Include all children Team Definition Actions");
+ boolean recurseChildren = false;
+ protected Composite dialogComp;
+
+ public TeamDefinitionTreeWithChildrenDialog(Active active) {
+ super(Display.getCurrent().getActiveShell(), new ArtifactDescriptiveLabelProvider(),
+ new TeamDefinitionTreeContentProvider(active));
+ setTitle("Select Team Definition");
+ setMessage("Select Team Definition");
+ setComparator(new ArtifactNameSorter());
+ try {
+ setInput(TeamDefinitionArtifact.getTeamTopLevelDefinitions(active));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * @return selected team defs and children if recurseChildren was checked
+ * @throws OseeCoreException
+ */
+ public Collection<TeamDefinitionArtifact> getResultAndRecursedTeamDefs() throws OseeCoreException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>(10);
+ for (Object obj : getResult()) {
+ teamDefs.add((TeamDefinitionArtifact) obj);
+ if (recurseChildren) {
+ teamDefs.addAll(Artifacts.getChildrenOfTypeSet((Artifact) obj, TeamDefinitionArtifact.class, true));
+ }
+ }
+ return teamDefs;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ Control control = super.createDialogArea(container);
+ dialogComp = new Composite(control.getParent(), SWT.NONE);
+ dialogComp.setLayout(new GridLayout(2, false));
+ dialogComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ recurseChildrenCheck.createWidgets(dialogComp, 2);
+ recurseChildrenCheck.set(recurseChildren);
+ recurseChildrenCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ recurseChildren = recurseChildrenCheck.isSelected();
+ };
+ });
+
+ return container;
+ }
+
+ /**
+ * @return the recurseChildren
+ */
+ public boolean isRecurseChildren() {
+ return recurseChildren;
+ }
+
+ /**
+ * @param recurseChildren the recurseChildren to set
+ */
+ public void setRecurseChildren(boolean recurseChildren) {
+ this.recurseChildren = recurseChildren;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java
new file mode 100644
index 00000000000..f8b6e9f8616
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.ArrayList;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.ArtifactViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactDescriptiveLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.dialogs.SelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamVersionListDialog extends SelectionDialog {
+
+ XComboViewer teamCombo = new XComboViewer("Team");
+ XComboViewer versionCombo = new XComboViewer("Version");
+ VersionArtifact selectedVersion = null;
+ TeamDefinitionArtifact selectedTeamDef = null;
+ private final Active active;
+ private final TeamDefinitionArtifact teamDef;
+
+ public TeamVersionListDialog(Active active) {
+ super(Display.getCurrent().getActiveShell());
+ this.active = active;
+ this.teamDef = null;
+ setTitle("Select Version");
+ setMessage("Select Version");
+ }
+
+ public TeamVersionListDialog(TeamDefinitionArtifact teamDef, Active active) {
+ super(Display.getCurrent().getActiveShell());
+ this.teamDef = teamDef;
+ this.active = active;
+ setTitle("Select Version");
+ setMessage("Select Version");
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ ArrayList<Object> objs = new ArrayList<Object>();
+ try {
+ for (Artifact art : TeamDefinitionArtifact.getTeamReleaseableDefinitions(active))
+ objs.add((Object) art);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ Composite comp = new Composite(container, SWT.NONE);
+ comp.setLayout(new GridLayout(2, false));
+ comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ if (teamDef == null) {
+ teamCombo.setInput(objs);
+ teamCombo.setLabelProvider(new ArtifactDescriptiveLabelProvider());
+ teamCombo.setContentProvider(new ArrayContentProvider());
+ teamCombo.setSorter(new ArtifactViewerSorter());
+ teamCombo.setGrabHorizontal(true);
+ teamCombo.createWidgets(comp, 2);
+ teamCombo.getCombo().setVisibleItemCount(20);
+ teamCombo.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ ArrayList<Object> objs = new ArrayList<Object>();
+ try {
+ selectedTeamDef = (TeamDefinitionArtifact) teamCombo.getSelected();
+ for (Artifact pda : selectedTeamDef.getVersionsArtifacts(VersionReleaseType.Both))
+ objs.add((Object) pda);
+ versionCombo.setInput(objs);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ };
+ });
+ } else
+ selectedTeamDef = teamDef;
+
+ versionCombo.setLabelProvider(new ArtifactDescriptiveLabelProvider());
+ versionCombo.setContentProvider(new ArrayContentProvider());
+ versionCombo.setSorter(new ArtifactViewerSorter());
+ versionCombo.setGrabHorizontal(true);
+ versionCombo.createWidgets(comp, 2);
+ versionCombo.getCombo().setVisibleItemCount(20);
+ versionCombo.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ selectedVersion = (VersionArtifact) versionCombo.getSelected();
+ };
+ });
+ if (teamDef != null) {
+ objs = new ArrayList<Object>();
+ try {
+ for (Artifact pda : teamDef.getVersionsArtifacts(VersionReleaseType.Both))
+ objs.add((Object) pda);
+ versionCombo.setInput(objs);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ return container;
+ }
+
+ public VersionArtifact getSelectedVersion() {
+ return selectedVersion;
+ }
+
+ /**
+ * @return the selectedTeamDef
+ */
+ public TeamDefinitionArtifact getSelectedTeamDef() {
+ return selectedTeamDef;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java
new file mode 100644
index 00000000000..03c1ffc62a3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.UserCommunity;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserCommunityListDialog extends org.eclipse.ui.dialogs.ListDialog {
+
+ public UserCommunityListDialog() {
+ super(Display.getCurrent().getActiveShell());
+ this.setTitle("Select User Community");
+ this.setMessage("Select User Community");
+ this.setContentProvider(new ArrayContentProvider() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof Collection) {
+ Collection list = (Collection) inputElement;
+ return (list.toArray(new String[list.size()]));
+ }
+ return super.getElements(inputElement);
+ }
+ });
+ setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ if (element instanceof String) {
+ return ((String) element);
+ }
+ return "Unknown element type";
+ }
+
+ });
+ setInput(UserCommunity.getInstance().getUserCommunityNames());
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control c = super.createDialogArea(container);
+ getTableViewer().setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ public int compare(Viewer viewer, Object o1, Object o2) {
+ return getComparator().compare((String) o1, (String) o2);
+ }
+ });
+ return c;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java
new file mode 100644
index 00000000000..046e458721e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionArtifactLabelProvider extends LabelProvider {
+
+ public VersionArtifactLabelProvider() {
+ }
+
+ @Override
+ public String getText(Object element) {
+ if (element instanceof VersionArtifact) {
+ VersionArtifact verArt = ((VersionArtifact) element);
+ String str = verArt.getDescriptiveName();
+ try {
+ if (verArt.getEstimatedReleaseDate() != null) {
+ str += " - Estimated Release: " + XDate.getDateStr(verArt.getEstimatedReleaseDate(), XDate.MMDDYY);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return str;
+ }
+ return "Unknown element type";
+ }
+
+ @Override
+ public Image getImage(Object element) {
+ if (element instanceof VersionArtifact) {
+ return ((VersionArtifact) element).getImage();
+ }
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java
new file mode 100644
index 00000000000..f87f99bb7bd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.ui.skynet.util.ArtifactNameReverseSorter;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionListDialog extends org.eclipse.ui.dialogs.ListDialog {
+
+ public VersionListDialog(String title, String message, Collection<VersionArtifact> verArts) {
+ super(Display.getCurrent().getActiveShell());
+ this.setTitle(title);
+ this.setMessage(message);
+ this.setContentProvider(new ArrayContentProvider() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof Collection) {
+ Collection list = (Collection) inputElement;
+ return (list.toArray(new VersionArtifact[list.size()]));
+ }
+ return super.getElements(inputElement);
+ }
+ });
+ setLabelProvider(new VersionArtifactLabelProvider());
+ setInput(verArts);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control c = super.createDialogArea(container);
+ getTableViewer().setSorter(new ArtifactNameReverseSorter());
+ return c;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java
new file mode 100644
index 00000000000..b9ec028cf9c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java
@@ -0,0 +1,191 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRole {
+
+ private Role role = Role.Reviewer;
+ private User user;
+ private Double hoursSpent = null;
+ private String guid = GUID.generateGuidStr();
+ private Boolean completed = false;
+
+ public static enum Role {
+ Moderator, Reviewer, Author;
+ public static Collection<String> strValues() {
+ Set<String> values = new HashSet<String>();
+ for (Enum<Role> e : values()) {
+ values.add(e.name());
+ }
+ return values;
+ }
+ };
+
+ public UserRole() throws OseeCoreException {
+ this(Role.Reviewer, UserManager.getUser(), null, false);
+ }
+
+ public UserRole(Role role, User user) {
+ this(role, user, 0.0, false);
+ }
+
+ public UserRole(Role role, User user, Double hoursSpent, Boolean completed) {
+ this.role = role;
+ this.user = user;
+ this.hoursSpent = hoursSpent;
+ this.completed = completed;
+ }
+
+ public UserRole(String xml) {
+ fromXml(xml);
+ }
+
+ public void update(UserRole dItem) throws OseeCoreException {
+ fromXml(dItem.toXml());
+ }
+
+ public String toXml() throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AXml.addTagData("role", role.name()));
+ sb.append(AXml.addTagData("userId", user.getUserId()));
+ sb.append(AXml.addTagData("hoursSpent", hoursSpent == null ? "" : String.valueOf(hoursSpent)));
+ sb.append(AXml.addTagData("completed", String.valueOf(completed)));
+ sb.append(AXml.addTagData("guid", guid));
+ return sb.toString();
+ }
+
+ public void fromXml(String xml) {
+ try {
+ this.role = Role.valueOf(AXml.getTagData(xml, "role"));
+ this.user = UserManager.getUserByUserId(AXml.getTagData(xml, "userId"));
+ this.hoursSpent =
+ AXml.getTagData(xml, "hoursSpent").equals("") ? null : Double.valueOf(AXml.getTagData(xml, "hoursSpent")).doubleValue();
+ String completedStr = AXml.getTagData(xml, "completed");
+ if (completedStr != null)
+ this.completed = completedStr.equals("true");
+ else
+ this.completed = false;
+ this.guid = AXml.getTagData(xml, "guid");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof UserRole) {
+ UserRole userRole = (UserRole) obj;
+ return userRole.getGuid().equals(getGuid());
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return getGuid().hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return role + " - " + user + " - " + hoursSpent + " - " + (completed ? "Completed" : "InWork");
+ }
+
+ /**
+ * @return the role
+ */
+ public Role getRole() {
+ return role;
+ }
+
+ /**
+ * @param role the role to set
+ */
+ public void setRole(Role role) {
+ this.role = role;
+ }
+
+ /**
+ * @return the user
+ */
+ public User getUser() {
+ return user;
+ }
+
+ /**
+ * @param user the user to set
+ */
+ public void setUser(User user) {
+ this.user = user;
+ }
+
+ /**
+ * @return the hoursSpent
+ */
+ public Double getHoursSpent() {
+ return hoursSpent;
+ }
+
+ public String getHoursSpentStr() {
+ return hoursSpent == null ? "" : AtsLib.doubleToStrString(hoursSpent, true);
+ }
+
+ /**
+ * @param hoursSpent the hoursSpent to set
+ */
+ public void setHoursSpent(Double hoursSpent) {
+ this.hoursSpent = hoursSpent;
+ }
+
+ /**
+ * @return the guid
+ */
+ public String getGuid() {
+ return guid;
+ }
+
+ /**
+ * @param guid the guid to set
+ */
+ public void setGuid(String guid) {
+ this.guid = guid;
+ }
+
+ /**
+ * @return the completed
+ */
+ public boolean isCompleted() {
+ return completed;
+ }
+
+ /**
+ * @param completed the completed to set
+ */
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
new file mode 100644
index 00000000000..ba368147abe
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+
+public class UserRoleContentProvider implements ITreeContentProvider {
+
+ protected Collection<UserRole> rootSet = new HashSet<UserRole>();
+ private final UserRoleXViewer xViewer;
+ private static Object[] EMPTY_ARRAY = new Object[0];
+
+ public UserRoleContentProvider(UserRoleXViewer WorldXViewer) {
+ super();
+ this.xViewer = WorldXViewer;
+ }
+
+ public void add(final UserRole item) {
+ add(Arrays.asList(item));
+ }
+
+ public void add(final Collection<? extends UserRole> items) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.addAll(items);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void set(final Collection<? extends UserRole> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ clear();
+ add(arts);
+ };
+ });
+ }
+
+ public void remove(final Artifact art) {
+ remove(Arrays.asList(art));
+ }
+
+ public void remove(final Collection<? extends Artifact> arts) {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ ArrayList<UserRole> delItems = new ArrayList<UserRole>();
+ delItems.addAll(rootSet);
+ for (Artifact art : arts) {
+ for (UserRole wai : rootSet)
+ if (wai.equals(art)) delItems.add(wai);
+ }
+ removeItems(delItems);
+ }
+
+ public void removeItems(final Collection<? extends UserRole> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.remove(arts);
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void clear() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.clear();
+ xViewer.refresh();
+ };
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getChildren(Object parentElement) {
+ if (parentElement instanceof Object[]) {
+ return (Object[]) parentElement;
+ }
+ if (parentElement instanceof Collection) {
+ return ((Collection) parentElement).toArray();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof String) return new Object[] {inputElement};
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /**
+ * @return the rootSet
+ */
+ public Collection<UserRole> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java
new file mode 100644
index 00000000000..2b8068c7881
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerLabelProvider;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+public class UserRoleLabelProvider extends XViewerLabelProvider {
+ Font font = null;
+
+ private final UserRoleXViewer xViewer;
+
+ public UserRoleLabelProvider(UserRoleXViewer xViewer) {
+ super(xViewer);
+ this.xViewer = xViewer;
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn dCol, int columnIndex) throws OseeCoreException {
+ UserRole roleItem = (UserRole) element;
+ if (dCol.equals(UserRoleXViewerFactory.User_Col)) {
+ if (roleItem.getUser().equals(UserManager.getUser()))
+ return SkynetGuiPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return SkynetGuiPlugin.getInstance().getImage("user_sm.gif");
+ } else if (dCol.equals(UserRoleXViewerFactory.Role_Col)) {
+ return AtsPlugin.getInstance().getImage("role.gif");
+ } else if (dCol.equals(UserRoleXViewerFactory.Hours_Spent_Col)) {
+ return SkynetGuiPlugin.getInstance().getImage("clock.gif");
+ } else if (dCol.equals(UserRoleXViewerFactory.Completed_Col)) {
+ return roleItem.isCompleted() ? SkynetGuiPlugin.getInstance().getImage("chkbox_enabled.gif") : SkynetGuiPlugin.getInstance().getImage(
+ "chkbox_disabled.gif");
+ } else if (dCol.equals(UserRoleXViewerFactory.Num_Major_Col)) {
+ return Severity.getImage(Severity.Major);
+ } else if (dCol.equals(UserRoleXViewerFactory.Num_Minor_Col)) {
+ return Severity.getImage(Severity.Minor);
+ } else if (dCol.equals(UserRoleXViewerFactory.Num_Issues_Col)) {
+ return Severity.getImage(Severity.Issue);
+ }
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn aCol, int columnIndex) throws OseeCoreException {
+
+ UserRole defectItem = ((UserRole) element);
+ if (aCol.equals(UserRoleXViewerFactory.User_Col))
+ return defectItem.getUser().getName();
+ else if (aCol.equals(UserRoleXViewerFactory.Hours_Spent_Col))
+ return defectItem.getHoursSpent() == null ? "" : AtsLib.doubleToStrString(defectItem.getHoursSpent(), false);
+ else if (aCol.equals(UserRoleXViewerFactory.Role_Col))
+ return defectItem.getRole().name();
+ else if (aCol.equals(UserRoleXViewerFactory.Completed_Col))
+ return String.valueOf(defectItem.isCompleted());
+ else if (aCol.equals(UserRoleXViewerFactory.Num_Major_Col))
+ return xViewer.getXUserRoleViewer().getReviewArt().getUserRoleManager().getNumMajor(defectItem.getUser()) + "";
+ else if (aCol.equals(UserRoleXViewerFactory.Num_Minor_Col))
+ return xViewer.getXUserRoleViewer().getReviewArt().getUserRoleManager().getNumMinor(defectItem.getUser()) + "";
+ else if (aCol.equals(UserRoleXViewerFactory.Num_Issues_Col)) return xViewer.getXUserRoleViewer().getReviewArt().getUserRoleManager().getNumIssues(
+ defectItem.getUser()) + "";
+ return "unhandled column";
+ }
+
+ public void dispose() {
+ if (font != null) font.dispose();
+ font = null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public UserRoleXViewer getTreeViewer() {
+ return xViewer;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java
new file mode 100644
index 00000000000..235c8c97779
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import org.eclipse.osee.ats.artifact.IReviewArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem;
+import org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+import org.eclipse.osee.ats.util.widgets.role.UserRole.Role;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRoleManager {
+
+ private final ReviewSMArtifact artifact;
+ private boolean enabled = true;
+ private static String ATS_DEFECT_TAG = "AtsRole";
+ private static String DEFECT_ITEM_TAG = "Role";
+ private static String REVIEW_DEFECT_ATTRIBUTE_NAME = "ats.Role";
+
+ public UserRoleManager(ReviewSMArtifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getHtml() throws OseeCoreException {
+ if (getUserRoles().size() == 0) return "";
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Defects"));
+ sb.append(getTable());
+ return sb.toString();
+ }
+
+ public Set<UserRole> getUserRoles() throws OseeCoreException {
+ Set<UserRole> uRoles = new HashSet<UserRole>();
+ String xml = artifact.getSoleAttributeValue(REVIEW_DEFECT_ATTRIBUTE_NAME, "");
+ Matcher m =
+ java.util.regex.Pattern.compile("<" + DEFECT_ITEM_TAG + ">(.*?)</" + DEFECT_ITEM_TAG + ">").matcher(xml);
+ while (m.find()) {
+ UserRole item = new UserRole(m.group());
+ uRoles.add(item);
+ }
+ return uRoles;
+ }
+
+ public Set<UserRole> getUserRoles(Role role) throws OseeCoreException {
+ Set<UserRole> roles = new HashSet<UserRole>();
+ for (UserRole uRole : getUserRoles())
+ if (uRole.getRole() == role) roles.add(uRole);
+ return roles;
+ }
+
+ public Set<User> getRoleUsers(Role role) throws OseeCoreException {
+ Set<User> users = new HashSet<User>();
+ for (UserRole uRole : getUserRoles())
+ if (uRole.getRole() == role) users.add(uRole.getUser());
+ return users;
+ }
+
+ private void saveRoleItems(Set<UserRole> defectItems, boolean persist, SkynetTransaction transaction) {
+ try {
+ StringBuffer sb = new StringBuffer("<" + ATS_DEFECT_TAG + ">");
+ for (UserRole item : defectItems)
+ sb.append(AXml.addTagData(DEFECT_ITEM_TAG, item.toXml()));
+ sb.append("</" + ATS_DEFECT_TAG + ">");
+ artifact.setSoleAttributeValue(REVIEW_DEFECT_ATTRIBUTE_NAME, sb.toString());
+ updateAssignees();
+ if (persist) artifact.persistAttributes(transaction);
+ rollupHoursSpentToReviewState(persist, transaction);
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, "Can't create ats review defect document", ex, true);
+ }
+ }
+
+ public void addOrUpdateUserRole(UserRole userRole, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ Set<UserRole> roleItems = getUserRoles();
+ boolean found = false;
+ for (UserRole uRole : roleItems) {
+ if (userRole.equals(uRole)) {
+ uRole.update(userRole);
+ found = true;
+ }
+ }
+ if (!found) roleItems.add(userRole);
+ saveRoleItems(roleItems, persist, transaction);
+ }
+
+ private void updateAssignees() throws OseeCoreException {
+ // Set assigness based on roles that are not set as completed
+ Set<User> assignees = new HashSet<User>();
+ for (UserRole uRole : getUserRoles()) {
+ if (!uRole.isCompleted() && uRole.getUser() != null) assignees.add(uRole.getUser());
+ }
+ // If roles are all completed, then still need to select a user to assign to SMA
+ if (assignees.size() == 0) {
+ if (getUserRoles(Role.Author).size() > 0)
+ for (UserRole role : getUserRoles(Role.Author))
+ assignees.add(role.getUser());
+ else if (getUserRoles(Role.Moderator).size() > 0)
+ for (UserRole role : getUserRoles(Role.Moderator))
+ assignees.add(role.getUser());
+ else
+ assignees.add(UserManager.getUser());
+ }
+ // Set assigness based on roles
+ artifact.getSmaMgr().getStateMgr().setAssignees(assignees);
+ }
+
+ public void removeUserRole(UserRole userRole, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ Set<UserRole> roleItems = getUserRoles();
+ roleItems.remove(userRole);
+ saveRoleItems(roleItems, persist, transaction);
+ }
+
+ public String getTable() throws OseeCoreException {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<TABLE BORDER=\"1\" cellspacing=\"1\" cellpadding=\"3%\" width=\"100%\"><THEAD><TR><TH>Role</TH>" + "<TH>User</TH><TH>Hours</TH><TH>Major</TH><TH>Minor</TH><TH>Issues</TH>");
+ for (UserRole item : getUserRoles()) {
+ User user = item.getUser();
+ String name = "";
+ if (user != null) {
+ name = user.getName();
+ if (name == null || name.equals("")) {
+ name = user.getName();
+ }
+ }
+ builder.append("<TR>");
+ builder.append("<TD>" + item.getRole().name() + "</TD>");
+ builder.append("<TD>" + item.getUser().getDescriptiveName() + "</TD>");
+ builder.append("<TD>" + item.getHoursSpentStr() + "</TD>");
+ builder.append("<TD>" + getNumMajor(item.getUser()) + "</TD>");
+ builder.append("<TD>" + getNumMinor(item.getUser()) + "</TD>");
+ builder.append("<TD>" + getNumIssues(item.getUser()) + "</TD>");
+ builder.append("</TR>");
+ }
+ builder.append("</TABLE>");
+ return builder.toString();
+ }
+
+ public int getNumMajor(User user) throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : ((IReviewArtifact) artifact).getDefectManager().getDefectItems())
+ if (dItem.getSeverity() == Severity.Major && dItem.getUser() == user) x++;
+ return x;
+ }
+
+ public int getNumMinor(User user) throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : ((IReviewArtifact) artifact).getDefectManager().getDefectItems())
+ if (dItem.getSeverity() == Severity.Minor && dItem.getUser() == user) x++;
+ return x;
+ }
+
+ public int getNumIssues(User user) throws OseeCoreException {
+ int x = 0;
+ for (DefectItem dItem : ((IReviewArtifact) artifact).getDefectManager().getDefectItems())
+ if (dItem.getSeverity() == Severity.Issue && dItem.getUser() == user) x++;
+ return x;
+ }
+
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+ public void rollupHoursSpentToReviewState(boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ double hoursSpent = 0.0;
+ for (UserRole role : getUserRoles())
+ hoursSpent += role.getHoursSpent() == null ? 0 : role.getHoursSpent();
+ SMAManager smaMgr = new SMAManager(artifact);
+ smaMgr.getStateMgr().setMetrics(hoursSpent, smaMgr.getStateMgr().getPercentComplete(), true);
+ if (persist) artifact.persistAttributes(transaction);
+ }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
new file mode 100644
index 00000000000..8dbbdc7ec89
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
@@ -0,0 +1,210 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.osee.ats.util.widgets.role.UserRole.Role;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.EnumStringSingleSelectionDialog;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.SkynetGuiDebug;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XPromptChange;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRoleXViewer extends XViewer {
+
+ private final XUserRoleViewer xUserRoleViewer;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public UserRoleXViewer(Composite parent, int style, XUserRoleViewer xUserRoleViewer) {
+ super(parent, style, new UserRoleXViewerFactory());
+ this.xUserRoleViewer = xUserRoleViewer;
+ }
+
+ @Override
+ protected void createSupportWidgets(Composite parent) {
+ super.createSupportWidgets(parent);
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ ((UserRoleContentProvider) getContentProvider()).clear();
+ }
+ });
+ createMenuActions();
+ }
+
+ public void createMenuActions() {
+ MenuManager mm = getMenuManager();
+ mm.createContextMenu(getControl());
+ mm.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ updateMenuActions();
+ }
+ });
+ }
+
+ public void updateEditMenuActions() {
+ // MenuManager mm = getMenuManager();
+ // EDIT MENU BLOCK
+ }
+
+ public void updateMenuActions() {
+ MenuManager mm = getMenuManager();
+
+ updateEditMenuActions();
+
+ mm.insertBefore(MENU_GROUP_PRE, new Separator());
+ }
+
+ public Collection<UserRole> getLoadedUserRoleItems() {
+ return ((UserRoleContentProvider) getContentProvider()).getRootSet();
+ }
+
+ public void add(Collection<UserRole> userRoles) {
+ ((UserRoleContentProvider) getContentProvider()).add(userRoles);
+ }
+
+ public void set(Collection<? extends UserRole> userRoles) {
+ if (((UserRoleContentProvider) getContentProvider()) != null) ((UserRoleContentProvider) getContentProvider()).set(userRoles);
+ }
+
+ public void clear() {
+ ((UserRoleContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ @Override
+ public void dispose() {
+ // Dispose of the table objects is done through separate dispose listener off tree
+ // Tell the label provider to release its ressources
+ getLabelProvider().dispose();
+ }
+
+ public ArrayList<UserRole> getSelectedUserRoleItems() {
+ ArrayList<UserRole> arts = new ArrayList<UserRole>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((UserRole) item.getData());
+ return arts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer#handleLeftClickInIconArea(org.eclipse.swt.widgets.TreeColumn, org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleLeftClickInIconArea(TreeColumn treeColumn, TreeItem treeItem) {
+ return handleAltLeftClick(treeColumn, treeItem);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.viewer.XViewer#handleAltLeftClick(org.eclipse.swt.widgets.TreeColumn,
+ * org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ if (!xUserRoleViewer.isEditable()) {
+ return false;
+ }
+ try {
+ // System.out.println("Column " + treeColumn.getText() + " item " +
+ // treeItem);
+ XViewerColumn aCol = (XViewerColumn) treeColumn.getData();
+ UserRole userRole = (UserRole) treeItem.getData();
+ boolean modified = false;
+ if (aCol.equals(UserRoleXViewerFactory.Hours_Spent_Col)) {
+ String hours =
+ XPromptChange.promptChangeFloat(aCol.getName(),
+ userRole.getHoursSpent() == null ? 0 : userRole.getHoursSpent());
+ if (hours != null) {
+ modified = true;
+ userRole.setHoursSpent(hours.equals("") ? 0 : (new Double(hours)).doubleValue());
+ }
+ } else if (aCol.equals(UserRoleXViewerFactory.Num_Minor_Col) || aCol.equals(UserRoleXViewerFactory.Num_Major_Col) || aCol.equals(UserRoleXViewerFactory.Num_Issues_Col)) {
+ AWorkbench.popup("ERROR", "Field is calculated");
+ } else if (aCol.equals(UserRoleXViewerFactory.Completed_Col)) {
+ if (userRole.getHoursSpent() == null) {
+ AWorkbench.popup("ERROR", "Must enter Hours Spent");
+ return false;
+ }
+ modified = true;
+ userRole.setCompleted(!userRole.isCompleted());
+ } else if (aCol.equals(UserRoleXViewerFactory.User_Col)) {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New User");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = ld.getSelection();
+ if (selectedUser != null && userRole.getUser() != selectedUser) {
+ modified = true;
+ userRole.setUser(selectedUser);
+ }
+ }
+ } else if (aCol.equals(UserRoleXViewerFactory.Role_Col)) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(aCol.getName(), Role.strValues(),
+ userRole.getRole().name());
+ if (enumDialog != null) {
+ if (enumDialog.getResult()[0] != null) {
+ modified = true;
+ userRole.setRole(Role.valueOf((String) enumDialog.getResult()[0]));
+ }
+ }
+ } else
+ throw new OseeStateException("Unhandled user role column");
+
+ if (modified) {
+ SkynetTransaction transaction =
+ new SkynetTransaction(xUserRoleViewer.getReviewArt().getArtifact().getBranch());
+ xUserRoleViewer.getReviewArt().getUserRoleManager().addOrUpdateUserRole(userRole, false, transaction);
+ transaction.execute();
+ xUserRoleViewer.refresh();
+ xUserRoleViewer.notifyXModifiedListeners();
+ update(userRole, null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiDebug.class, ex, true);
+ }
+ return false;
+ }
+
+ /**
+ * @return the xUserRoleViewer
+ */
+ public XUserRoleViewer getXUserRoleViewer() {
+ return xUserRoleViewer;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java
new file mode 100644
index 00000000000..e94c6c72ec1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRoleXViewerFactory extends SkynetXViewerFactory {
+
+ private static String NAMESPACE = "osee.ats.UserRoleXViewer";
+ public static XViewerColumn Role_Col =
+ new XViewerColumn("osee.userRole.role", "Role", 100, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn User_Col =
+ new XViewerColumn("osee.userRole.user", "User", 150, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn Hours_Spent_Col =
+ new XViewerColumn("osee.userRole.hoursSpent", "Hours Spent", 80, SWT.LEFT, true, SortDataType.Float, false,
+ null);
+ public static XViewerColumn Completed_Col =
+ new XViewerColumn("osee.userRole.completed", "Completed", 80, SWT.LEFT, true, SortDataType.String, false, null);
+ public static XViewerColumn Num_Major_Col =
+ new XViewerColumn("osee.userRole.major", "Major", 60, SWT.CENTER, true, SortDataType.Integer, false, null);
+ public static XViewerColumn Num_Minor_Col =
+ new XViewerColumn("osee.userRole.minor", "Minor", 60, SWT.CENTER, true, SortDataType.Integer, false, null);
+ public static XViewerColumn Num_Issues_Col =
+ new XViewerColumn("osee.userRole.issues", "Issues", 60, SWT.CENTER, true, SortDataType.Integer, false, null);
+
+ public UserRoleXViewerFactory() {
+ super(NAMESPACE);
+ registerColumn(Role_Col, User_Col, Hours_Spent_Col, Completed_Col, Num_Major_Col, Num_Minor_Col, Num_Issues_Col);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
new file mode 100644
index 00000000000..40efcdb73a8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -0,0 +1,453 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.util.widgets.role;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.IReviewArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XUserRoleViewer extends XWidget implements IArtifactWidget, IFrameworkTransactionEventListener {
+
+ private UserRoleXViewer xViewer;
+ private IDirtiableEditor editor;
+ private IReviewArtifact reviewArt;
+ public final static String normalColor = "#EEEEEE";
+ private static ToolItem newUserRoleItem, deleteUserRoleItem;
+ private Label extraInfoLabel;
+
+ /**
+ * @param label
+ */
+ public XUserRoleViewer() {
+ super("Roles");
+
+ OseeEventManager.addListener(this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.XWidget#createWidgets(org.eclipse.swt.widgets.Composite, int)
+ */
+ @Override
+ public void createWidgets(Composite parent, int horizontalSpan) {
+
+ // Create Text Widgets
+ if (displayLabel && !label.equals("")) {
+ labelWidget = new Label(parent, SWT.NONE);
+ labelWidget.setText(label + ":");
+ if (toolTip != null) {
+ labelWidget.setToolTipText(toolTip);
+ }
+ }
+
+ Composite mainComp = new Composite(parent, SWT.BORDER);
+ mainComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+ mainComp.setLayout(ALayout.getZeroMarginLayout());
+ if (toolkit != null) toolkit.paintBordersFor(mainComp);
+
+ createTaskActionBar(mainComp);
+
+ xViewer = new UserRoleXViewer(mainComp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, this);
+ xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ xViewer.setContentProvider(new UserRoleContentProvider(xViewer));
+ xViewer.setLabelProvider(new UserRoleLabelProvider(xViewer));
+ xViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ refreshActionEnablement();
+ }
+ });
+
+ if (toolkit != null) toolkit.adapt(xViewer.getStatusLabel(), false, false);
+
+ Tree tree = xViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH);
+ gridData.heightHint = 100;
+ tree.setLayout(ALayout.getZeroMarginLayout());
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+ // NOTE: Don't adapt the tree using xToolkit cause will loose xViewer's context menu
+
+ (new Label(mainComp, SWT.None)).setText("Select \"New Role\" to add. Select icon in cell to update value.");
+ loadTable();
+ }
+
+ public void createTaskActionBar(Composite parent) {
+
+ // Button composite for state transitions, etc
+ Composite bComp = new Composite(parent, SWT.NONE);
+ // bComp.setBackground(mainSComp.getDisplay().getSystemColor(SWT.COLOR_CYAN));
+ bComp.setLayout(new GridLayout(2, false));
+ bComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ Composite leftComp = new Composite(bComp, SWT.NONE);
+ leftComp.setLayout(new GridLayout());
+ leftComp.setLayoutData(new GridData(GridData.BEGINNING | GridData.FILL_HORIZONTAL));
+
+ extraInfoLabel = new Label(leftComp, SWT.NONE);
+ extraInfoLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ extraInfoLabel.setText("");
+ extraInfoLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ Composite rightComp = new Composite(bComp, SWT.NONE);
+ rightComp.setLayout(new GridLayout());
+ rightComp.setLayoutData(new GridData(GridData.END));
+
+ ToolBar toolBar = new ToolBar(rightComp, SWT.FLAT | SWT.RIGHT);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ toolBar.setLayoutData(gd);
+ ToolItem item = null;
+
+ newUserRoleItem = new ToolItem(toolBar, SWT.PUSH);
+ newUserRoleItem.setImage(AtsPlugin.getInstance().getImage("userAdd.gif"));
+ newUserRoleItem.setToolTipText("New Role");
+ newUserRoleItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleNewUserRole();
+ }
+ });
+
+ deleteUserRoleItem = new ToolItem(toolBar, SWT.PUSH);
+ deleteUserRoleItem.setImage(SkynetGuiPlugin.getInstance().getImage("redRemove.gif"));
+ deleteUserRoleItem.setToolTipText("Delete Role");
+ deleteUserRoleItem.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleDeleteUserRole(false);
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("refresh.gif"));
+ item.setToolTipText("Refresh Roles");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ loadTable();
+ }
+ });
+
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(SkynetGuiPlugin.getInstance().getImage("customize.gif"));
+ item.setToolTipText("Customize Table");
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.getCustomizeMgr().handleTableCustomization();
+ }
+ });
+
+ refreshActionEnablement();
+ }
+
+ public void refreshActionEnablement() {
+ deleteUserRoleItem.setEnabled(editable && getSelectedUserRoleItems().size() > 0);
+ newUserRoleItem.setEnabled(editable);
+ }
+
+ public void loadTable() {
+ try {
+ if (reviewArt != null && xViewer != null) {
+ xViewer.set(reviewArt.getUserRoleManager().getUserRoles());
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ refresh();
+ }
+
+ public void handleDeleteUserRole(boolean persist) {
+ final List<UserRole> items = getSelectedUserRoleItems();
+ if (items.size() == 0) {
+ AWorkbench.popup("ERROR", "No Roles Selected");
+ return;
+ }
+ StringBuilder builder = new StringBuilder();
+ for (UserRole userRole : items)
+ builder.append("\"" + userRole.toString() + "\"\n");
+
+ boolean delete =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Delete Roles",
+ "Are You Sure You Wish to Delete the Roles(s):\n\n" + builder.toString());
+ if (delete) {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(reviewArt.getArtifact().getBranch());
+ removeUserRoleHelper(items, persist, transaction);
+ transaction.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private void removeUserRoleHelper(List<UserRole> items, boolean persist, SkynetTransaction transaction) throws OseeCoreException {
+ for (UserRole userRole : items) {
+ reviewArt.getUserRoleManager().removeUserRole(userRole, persist, transaction);
+ xViewer.remove(userRole);
+ }
+ loadTable();
+ notifyXModifiedListeners();
+ }
+
+ public void handleNewUserRole() {
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(reviewArt.getArtifact().getBranch());
+ reviewArt.getUserRoleManager().addOrUpdateUserRole(new UserRole(), false, transaction);
+ transaction.execute();
+ notifyXModifiedListeners();
+ loadTable();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public ArrayList<UserRole> getSelectedUserRoleItems() {
+ ArrayList<UserRole> items = new ArrayList<UserRole>();
+ if (xViewer == null) return items;
+ if (xViewer.getSelection().isEmpty()) return items;
+ Iterator i = ((IStructuredSelection) xViewer.getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ items.add((UserRole) obj);
+ }
+ return items;
+ }
+
+ @Override
+ public Control getControl() {
+ return xViewer.getTree();
+ }
+
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ xViewer.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ xViewer.getTree().setFocus();
+ }
+
+ @Override
+ public void refresh() {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+ xViewer.refresh();
+ setLabelError();
+ refreshActionEnablement();
+ }
+
+ @Override
+ public Result isValid() {
+ try {
+ if (isRequiredEntry() && xViewer.getTree().getItemCount() == 0) {
+ extraInfoLabel.setText("At least one role entry is required");
+ return new Result("At least one role entry is required");
+ }
+ Result result = reviewArt.isUserRoleValid();
+ if (result.isFalse()) {
+ extraInfoLabel.setText(result.getText());
+ return result;
+ }
+ extraInfoLabel.setText("");
+ return Result.TrueResult;
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Result("Exception validating roles. See log for details. " + ex.getLocalizedMessage());
+ }
+ }
+
+ @Override
+ public void setXmlData(String str) {
+ }
+
+ @Override
+ public String getXmlData() {
+ return null;
+ }
+
+ @Override
+ public String toHTML(String labelFont) {
+ if (getXViewer().getTree().getItemCount() == 0) return "";
+ StringBuffer html = new StringBuffer();
+ try {
+ html.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Tasks"));
+ html.append(AHTML.startBorderTable(100, normalColor, ""));
+ html.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Role", "User", "Hours", "Major", "Minor",
+ "Issues"}));
+ for (UserRole item : reviewArt.getUserRoleManager().getUserRoles()) {
+ html.append(AHTML.addRowMultiColumnTable(new String[] {item.getRole().name(), item.getUser().getName(),
+ item.getHoursSpentStr(), reviewArt.getUserRoleManager().getNumMajor(item.getUser()) + "",
+ reviewArt.getUserRoleManager().getNumMinor(item.getUser()) + "",
+ reviewArt.getUserRoleManager().getNumIssues(item.getUser()) + ""}));
+ }
+ html.append(AHTML.endBorderTable());
+ } catch (Exception ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ return "User Role Item Exception - " + ex.getLocalizedMessage();
+ }
+ return html.toString();
+ }
+
+ @Override
+ public String getReportData() {
+ return null;
+ }
+
+ /**
+ * @return Returns the xViewer.
+ */
+ public UserRoleXViewer getXViewer() {
+ return xViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.XWidget#getData()
+ */
+ @Override
+ public Object getData() {
+ return xViewer.getInput();
+ }
+
+ public IDirtiableEditor getEditor() {
+ return editor;
+ }
+
+ public void setEditor(IDirtiableEditor editor) {
+ this.editor = editor;
+ }
+
+ @Override
+ public boolean isEditable() {
+ return editable;
+ }
+
+ @Override
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public IReviewArtifact getReviewArt() {
+ return reviewArt;
+ }
+
+ public void setReviewArt(IReviewArtifact reviewArt) {
+ this.reviewArt = reviewArt;
+ if (xViewer != null) loadTable();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IDamWidget#setArtifact(org.eclipse.osee.framework.skynet.core.artifact.Artifact,
+ * java.lang.String)
+ */
+ public void setArtifact(Artifact artifact, String attrName) {
+ setReviewArt((IReviewArtifact) artifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#saveToArtifact()
+ */
+ @Override
+ public void saveToArtifact() throws OseeCoreException {
+ // RoleViewer uses artifact as storage mechanism, nothing to save
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#isDirty()
+ */
+ @Override
+ public Result isDirty() throws OseeCoreException {
+ // RoleViewer uses artifact as storage mechanism which already determines dirty
+ return Result.FalseResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget#revert()
+ */
+ @Override
+ public void revert() throws OseeCoreException {
+ // Nothing to revert cause artifact will be reverted
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.getBranchId() != AtsPlugin.getAtsBranch().getBranchId()) return;
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+ if (transData.isRelAddedChangedDeleted(reviewArt.getArtifact())) {
+ loadTable();
+ } else
+ refresh();
+ }
+ });
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java
new file mode 100644
index 00000000000..a6cd7f46fe7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerAtsAttributeColumn.java
@@ -0,0 +1,44 @@
+/*
+ * Created on Jul 17, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.xviewer.column;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerAttributeColumn;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XViewerAtsAttributeColumn extends XViewerAttributeColumn {
+
+ /**
+ * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
+ * XViewerValueColumn need to extend this constructor to copy extra stored fields
+ *
+ * @param col
+ */
+ public XViewerAtsAttributeColumn copy() {
+ return new XViewerAtsAttributeColumn(getId(), getName(), getAttributeTypeName(), getWidth(), getAlign(),
+ isShow(), getSortDataType(), isMultiColumnEditable(), getDescription());
+ }
+
+ public XViewerAtsAttributeColumn(String id, ATSAttributes atsAttribute, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ this(id, atsAttribute.getDisplayName(), atsAttribute.getStoreName(), width, align, show, sortDataType,
+ multiColumnEditable, description);
+ }
+
+ public XViewerAtsAttributeColumn(ATSAttributes atsAttribute, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ this(
+ WorldXViewerFactory.COLUMN_NAMESPACE + "." + (atsAttribute.getDisplayName().replaceAll(" ", "").toLowerCase()),
+ atsAttribute.getDisplayName(), atsAttribute.getStoreName(), width, align, show, sortDataType,
+ multiColumnEditable, description);
+ }
+
+ public XViewerAtsAttributeColumn(String id, String name, String attributeTypeName, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ super(id, name, attributeTypeName, width, align, show, sortDataType, multiColumnEditable, description);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java
new file mode 100644
index 00000000000..352040b3c4e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerReviewRoleColumn.java
@@ -0,0 +1,67 @@
+/*
+ * Created on Jul 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.xviewer.column;
+
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.util.widgets.role.UserRole;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XViewerReviewRoleColumn extends XViewerValueColumn {
+
+ private final User user;
+
+ /**
+ * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
+ * XViewerValueColumn need to extend this constructor to copy extra stored fields
+ *
+ * @param col
+ */
+ public XViewerReviewRoleColumn copy() {
+ return new XViewerReviewRoleColumn(getUser(), getId(), getName(), getWidth(), getAlign(), isShow(),
+ getSortDataType(), isMultiColumnEditable(), getDescription());
+ }
+
+ public XViewerReviewRoleColumn(User user) {
+ super("ats.column.role", "Role", 75, SWT.LEFT, true, SortDataType.String, false, null);
+ this.user = user;
+ }
+
+ public XViewerReviewRoleColumn(User user, String id, String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ super(id, name, width, align, show, sortDataType, multiColumnEditable, description);
+ this.user = user;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn#getColumnText(java.lang.Object, org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn)
+ */
+ @Override
+ public String getColumnText(Object element, XViewerColumn column, int columnIndex) throws OseeCoreException {
+ if (element instanceof ReviewSMArtifact) {
+ return getRolesStr((ReviewSMArtifact) element, user);
+ }
+ return "";
+ }
+
+ private static String getRolesStr(ReviewSMArtifact reviewArt, User user) throws OseeCoreException {
+ String str = "";
+ for (UserRole role : reviewArt.getUserRoleManager().getUserRoles()) {
+ if (role.getUser().equals(user)) str += role.getRole().name() + ", ";
+ }
+ return str.replaceFirst(", $", "");
+ }
+
+ public User getUser() {
+ return user;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCompletedDateColumn.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCompletedDateColumn.java
new file mode 100644
index 00000000000..b75d432fb8c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCompletedDateColumn.java
@@ -0,0 +1,55 @@
+/*
+ * Created on Jul 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.xviewer.column;
+
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XViewerSmaCompletedDateColumn extends XViewerValueColumn {
+
+ public XViewerSmaCompletedDateColumn() {
+ this("Completed");
+ }
+
+ public XViewerSmaCompletedDateColumn(String name) {
+ super(WorldXViewerFactory.COLUMN_NAMESPACE + "completeDate", name, 80, SWT.LEFT, true, SortDataType.Date, false,
+ "Date this workflow transitioned to the Completed state.");
+ }
+
+ public XViewerSmaCompletedDateColumn(String id, String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ super(id, name, width, align, show, sortDataType, multiColumnEditable, description);
+ }
+
+ /**
+ * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
+ * XViewerValueColumn need to extend this constructor to copy extra stored fields
+ *
+ * @param col
+ */
+ public XViewerSmaCompletedDateColumn copy() {
+ return new XViewerSmaCompletedDateColumn(getId(), getName(), getWidth(), getAlign(), isShow(), getSortDataType(),
+ isMultiColumnEditable(), getDescription());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn#getColumnText(java.lang.Object, org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn)
+ */
+ @Override
+ public String getColumnText(Object element, XViewerColumn column, int columnIndex) throws OseeCoreException {
+ if (element instanceof StateMachineArtifact) {
+ return ((StateMachineArtifact) element).getWorldViewCompletedDateStr();
+ }
+ return super.getColumnText(element, column, columnIndex);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCreatedDateColumn.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCreatedDateColumn.java
new file mode 100644
index 00000000000..7d26f236314
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaCreatedDateColumn.java
@@ -0,0 +1,55 @@
+/*
+ * Created on Jul 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.xviewer.column;
+
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XViewerSmaCreatedDateColumn extends XViewerValueColumn {
+
+ public XViewerSmaCreatedDateColumn() {
+ this("Created Date");
+ }
+
+ public XViewerSmaCreatedDateColumn(String name) {
+ super(WorldXViewerFactory.COLUMN_NAMESPACE + ".createdDate", name, 80, SWT.LEFT, true, SortDataType.Date, false,
+ "Date this workflow was created.");
+ }
+
+ public XViewerSmaCreatedDateColumn(String id, String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ super(id, name, width, align, show, sortDataType, multiColumnEditable, description);
+ }
+
+ /**
+ * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
+ * XViewerValueColumn need to extend this constructor to copy extra stored fields
+ *
+ * @param col
+ */
+ public XViewerSmaCreatedDateColumn copy() {
+ return new XViewerSmaCreatedDateColumn(getId(), getName(), getWidth(), getAlign(), isShow(), getSortDataType(),
+ isMultiColumnEditable(), getDescription());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn#getColumnText(java.lang.Object, org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn)
+ */
+ @Override
+ public String getColumnText(Object element, XViewerColumn column, int columnIndex) throws OseeCoreException {
+ if (element instanceof IWorldViewArtifact) {
+ return ((IWorldViewArtifact) element).getWorldViewCreatedDateStr();
+ }
+ return super.getColumnText(element, column, columnIndex);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaStateColumn.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaStateColumn.java
new file mode 100644
index 00000000000..6826648c5f9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/xviewer/column/XViewerSmaStateColumn.java
@@ -0,0 +1,50 @@
+/*
+ * Created on Jul 14, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util.xviewer.column;
+
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.ats.world.WorldXViewerFactory;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XViewerSmaStateColumn extends XViewerValueColumn {
+
+ public XViewerSmaStateColumn() {
+ super(WorldXViewerFactory.COLUMN_NAMESPACE + "smaState", "State", 75, SWT.LEFT, true, SortDataType.String, false,
+ null);
+ }
+
+ public XViewerSmaStateColumn(String id, String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String description) {
+ super(id, name, width, align, show, sortDataType, multiColumnEditable, description);
+ }
+
+ /**
+ * XViewer uses copies of column definitions so originals that are registered are not corrupted. Classes extending
+ * XViewerValueColumn need to extend this constructor to copy extra stored fields
+ *
+ * @param col
+ */
+ public XViewerSmaStateColumn copy() {
+ return new XViewerSmaStateColumn(getId(), getName(), getWidth(), getAlign(), isShow(), getSortDataType(),
+ isMultiColumnEditable(), getDescription());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerValueColumn#getColumnText(java.lang.Object, org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn)
+ */
+ @Override
+ public String getColumnText(Object element, XViewerColumn column, int columnIndex) throws OseeCoreException {
+ if (element instanceof IWorldViewArtifact) {
+ return ((IWorldViewArtifact) element).getWorldViewState();
+ }
+ return "";
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
new file mode 100644
index 00000000000..11541cbae09
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ATSXWidgetOptionResolver extends DefaultXWidgetOptionResolver {
+
+ private static ATSXWidgetOptionResolver instance = new ATSXWidgetOptionResolver();
+ public static String OPTIONS_FROM_ATTRIBUTE_VALIDITY = "OPTIONS_FROM_ATTRIBUTE_VALIDITY";
+
+ /**
+ *
+ */
+ private ATSXWidgetOptionResolver() {
+ instance = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver#getWidgetOptions(java.lang.String)
+ */
+ @Override
+ public String[] getWidgetOptions(DynamicXWidgetLayoutData xWidgetData) {
+
+ if (xWidgetData.getXWidgetName().contains(OPTIONS_FROM_ATTRIBUTE_VALIDITY) || xWidgetData.getXWidgetName().contains(
+ "ACTIVE_USER_COMMUNITIES")) {
+ Set<String> options;
+ try {
+ options =
+ AttributeTypeManager.getValidEnumerationAttributeValues(xWidgetData.getStorageName(),
+ AtsPlugin.getAtsBranch());
+ } catch (Exception ex) {
+ options = new HashSet<String>();
+ options.add(ex.getLocalizedMessage());
+ }
+ String optStrs[] = options.toArray(new String[options.size()]);
+ Arrays.sort(optStrs);
+ return optStrs;
+ }
+ return super.getWidgetOptions(xWidgetData);
+ }
+
+ /**
+ * @return the instance
+ */
+ public static ATSXWidgetOptionResolver getInstance() {
+ return instance;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
new file mode 100644
index 00000000000..0aa74b393d1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.editor.IAtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResolutionOptionRule;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkPage extends WorkPage {
+
+ protected TaskResolutionOptionRule taskResolutionOptions;
+ private SMAManager smaMgr;
+
+ public AtsWorkPage(WorkFlowDefinition workFlowDefinition, WorkPageDefinition workPageDefinition, String xWidgetsXml, IXWidgetOptionResolver optionResolver) {
+ super(workFlowDefinition, workPageDefinition, xWidgetsXml, optionResolver);
+ }
+
+ public AtsWorkPage(IXWidgetOptionResolver optionResolver) {
+ this(null, null, null, optionResolver);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.workflow.WorkPage#widgetCreated(osee.skynet.gui.widgets.XWidget,
+ * org.eclipse.ui.forms.widgets.FormToolkit, osee.skynet.gui.widgets.workflow.WorkPage,
+ * osee.skynet.gui.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, WorkPage page, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ super.widgetCreated(xWidget, toolkit, art, page, xModListener, isEditable);
+ // Check extenstion points for page creation
+ if (smaMgr != null) {
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ item.xWidgetCreated(xWidget, toolkit, (AtsWorkPage) page, art, xModListener, isEditable);
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.workflow.WorkPage#workAttrCreated(osee.skynet.gui.widgets.workflow.WorkAttribute,
+ * osee.skynet.gui.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit,
+ * osee.skynet.artifact.Artifact, osee.skynet.gui.widgets.workflow.WorkPage,
+ * osee.skynet.gui.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void createXWidgetLayoutData(DynamicXWidgetLayoutData layoutData, XWidget xWidget, FormToolkit toolkit, Artifact art, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ super.createXWidgetLayoutData(layoutData, xWidget, toolkit, art, xModListener, isEditable);
+ // If no tooltip, add global tooltip
+ if ((xWidget.getToolTip() == null || xWidget.getToolTip().equals("")) && ATSAttributes.getAtsAttributeByStoreName(layoutData.getStorageName()) != null && ATSAttributes.getAtsAttributeByStoreName(
+ layoutData.getStorageName()).getDescription() != null && !ATSAttributes.getAtsAttributeByStoreName(
+ layoutData.getStorageName()).getDescription().equals("")) {
+ xWidget.setToolTip(ATSAttributes.getAtsAttributeByStoreName(layoutData.getStorageName()).getDescription());
+ layoutData.setToolTip(ATSAttributes.getAtsAttributeByStoreName(layoutData.getStorageName()).getDescription());
+ }
+ // Store workAttr in control for use by help
+ if (xWidget.getControl() != null) xWidget.getControl().setData(layoutData);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.workflow.WorkPage#widgetCreating(osee.skynet.gui.widgets.XWidget,
+ * org.eclipse.ui.forms.widgets.FormToolkit, osee.skynet.gui.widgets.workflow.WorkPage,
+ * osee.skynet.gui.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreating(XWidget xWidget, FormToolkit toolkit, Artifact art, WorkPage page, XModifiedListener xModListener, boolean isEditable) throws OseeCoreException {
+ super.widgetCreating(xWidget, toolkit, art, page, xModListener, isEditable);
+ // Check extenstion points for page creation
+ if (smaMgr != null) {
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ Result result = item.xWidgetCreating(xWidget, toolkit, (AtsWorkPage) page, art, xModListener, isEditable);
+ if (result.isFalse()) {
+ OSEELog.logSevere(AtsPlugin.class, "Error in page creation => " + result.getText(), true);
+ }
+ }
+ }
+ }
+
+ public boolean isCompletePage() {
+ return getName().equals(DefaultTeamState.Completed.name());
+ }
+
+ public boolean isCancelledPage() {
+ return getName().equals(DefaultTeamState.Cancelled.name());
+ }
+
+ public boolean isDisplayService(WorkPageService service) {
+ return true;
+ }
+
+ public boolean isEndorsePage() {
+ return getName().equals(DefaultTeamState.Endorse.name());
+ }
+
+ /**
+ * @return Returns the taskResolutionOptions.
+ */
+ public TaskResolutionOptionRule getTaskResDef() {
+ return taskResolutionOptions;
+ }
+
+ /**
+ * @param taskResolutionOptions The taskResolutionOptions to set.
+ */
+ public void setTaskResDef(TaskResolutionOptionRule taskResolutionOptions) {
+ this.taskResolutionOptions = taskResolutionOptions;
+ }
+
+ public boolean isUsingTaskResolutionOptions() {
+ return this.taskResolutionOptions != null;
+ }
+
+ /**
+ * @return the startPage
+ */
+ public boolean isStartPage() throws OseeCoreException {
+ return workFlowDefinition.getStartPage().getId().equals(getId());
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ /**
+ * @param smaMgr the smaMgr to set
+ */
+ public void setSmaMgr(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ /**
+ * @return the validatePage
+ */
+ public boolean isValidatePage() throws OseeCoreException {
+ return AtsWorkDefinitions.isValidatePage(workPageDefinition);
+ }
+
+ /**
+ * @return the validateReviewBlocking
+ */
+ public boolean isValidateReviewBlocking() throws OseeCoreException {
+ return AtsWorkDefinitions.isValidateReviewBlocking(workPageDefinition);
+ }
+
+ /**
+ * @return the forceAssigneesToTeamLeads
+ */
+ public boolean isForceAssigneesToTeamLeads() throws OseeCoreException {
+ return AtsWorkDefinitions.isForceAssigneesToTeamLeads(workPageDefinition);
+ }
+
+ /**
+ * @return the forceAssigneesToTeamLeads
+ */
+ public boolean isRequireStateHoursSpentPrompt() throws OseeCoreException {
+ return AtsWorkDefinitions.isRequireStateHoursSpentPrompt(workPageDefinition);
+ }
+
+ /**
+ * @return the allowCreateBranch
+ */
+ public boolean isAllowTransitionWithWorkingBranch() throws OseeCoreException {
+ return AtsWorkDefinitions.isAllowTransitionWithWorkingBranch(workPageDefinition);
+ }
+
+ /**
+ * @return the allowCreateBranch
+ */
+ public boolean isAllowCreateBranch() throws OseeCoreException {
+ return AtsWorkDefinitions.isAllowCreateBranch(workPageDefinition);
+ }
+
+ /**
+ * @return the allowCommitBranch
+ */
+ public boolean isAllowCommitBranch() throws OseeCoreException {
+ return AtsWorkDefinitions.isAllowCommitBranch(workPageDefinition);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/DecisionWorkflowDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/DecisionWorkflowDefinition.java
new file mode 100644
index 00000000000..2fe5aa279d7
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/DecisionWorkflowDefinition.java
@@ -0,0 +1,102 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.flow;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.item.AtsStatePercentCompleteWeightDecisionReviewRule;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsDecisionCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsDecisionDecisionWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsDecisionFollowupWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsDecisionPrepareWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DecisionWorkflowDefinition extends WorkFlowDefinition {
+
+ public static String ID = "osee.ats.decisionReview";
+ public static String DECISION_CANCELLED_STATE_ID = ID + "." + DefaultTeamState.Cancelled.name();
+
+ public DecisionWorkflowDefinition() {
+ super(ID, ID, null);
+ addTransitions();
+ startPageId = AtsDecisionPrepareWorkPageDefinition.ID;
+ addWorkItem(AtsStatePercentCompleteWeightDecisionReviewRule.ID);
+ }
+
+ public DecisionWorkflowDefinition(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ throw new OseeStateException("This constructor should never be used.");
+ }
+
+ public void config(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData, getAtsWorkDefinitions());
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ // Add Decision Pages and Workflow Definition
+ workItems.add(new AtsDecisionPrepareWorkPageDefinition());
+ workItems.add(new AtsDecisionDecisionWorkPageDefinition());
+ workItems.add(new AtsDecisionFollowupWorkPageDefinition());
+ workItems.add(new AtsDecisionCompletedWorkPageDefinition());
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Cancelled.name(),
+ DecisionWorkflowDefinition.DECISION_CANCELLED_STATE_ID, AtsCancelledWorkPageDefinition.ID));
+ workItems.add(new DecisionWorkflowDefinition());
+
+ return workItems;
+ }
+
+ private void addTransitions() {
+ // Add Prepare Transitions
+ addPageTransition(AtsDecisionPrepareWorkPageDefinition.ID, AtsDecisionDecisionWorkPageDefinition.ID,
+ TransitionType.ToPageAsDefault);
+ addPageTransitionToPageAndReturn(AtsDecisionPrepareWorkPageDefinition.ID, DECISION_CANCELLED_STATE_ID);
+
+ // Add Decision Transitions
+ addPageTransition(AtsDecisionDecisionWorkPageDefinition.ID, AtsDecisionCompletedWorkPageDefinition.ID,
+ TransitionType.ToPageAsDefault);
+ addPageTransition(AtsDecisionDecisionWorkPageDefinition.ID, AtsDecisionFollowupWorkPageDefinition.ID,
+ TransitionType.ToPage);
+ addPageTransition(AtsDecisionDecisionWorkPageDefinition.ID, AtsDecisionPrepareWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+
+ // Add Followup Transitions
+ addPageTransition(AtsDecisionFollowupWorkPageDefinition.ID, AtsDecisionDecisionWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(AtsDecisionFollowupWorkPageDefinition.ID, AtsDecisionCompletedWorkPageDefinition.ID,
+ TransitionType.ToPageAsDefault);
+ addPageTransitionToPageAndReturn(AtsDecisionFollowupWorkPageDefinition.ID, DECISION_CANCELLED_STATE_ID);
+
+ // Add Completed Transitions
+ addPageTransition(AtsDecisionCompletedWorkPageDefinition.ID, AtsDecisionDecisionWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(AtsDecisionCompletedWorkPageDefinition.ID, AtsDecisionFollowupWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+
+ // Add Cancelled Transitions
+ addPageTransition(DECISION_CANCELLED_STATE_ID, AtsDecisionPrepareWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(DECISION_CANCELLED_STATE_ID, AtsDecisionDecisionWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(DECISION_CANCELLED_STATE_ID, AtsDecisionFollowupWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/PeerToPeerWorkflowDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/PeerToPeerWorkflowDefinition.java
new file mode 100644
index 00000000000..16605ac83c4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/PeerToPeerWorkflowDefinition.java
@@ -0,0 +1,87 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.flow;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.item.AtsStatePercentCompleteWeightPeerToPeerReviewRule;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsPeerPrepareWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsPeerReviewWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class PeerToPeerWorkflowDefinition extends WorkFlowDefinition {
+
+ public static String ID = "osee.ats.peerToPeerReview";
+ public static String PEER_REVIEW_COMPLETED_STATE_ID = ID + "." + DefaultTeamState.Completed.name();
+ public static String PEER_REVIEW_CANCELLED_STATE_ID = ID + "." + DefaultTeamState.Cancelled.name();
+
+ public PeerToPeerWorkflowDefinition() {
+ super(ID, ID, null);
+ addTransitions();
+ startPageId = AtsPeerPrepareWorkPageDefinition.ID;
+ addWorkItem(AtsStatePercentCompleteWeightPeerToPeerReviewRule.ID);
+ }
+
+ public PeerToPeerWorkflowDefinition(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ throw new OseeStateException("This constructor should never be used.");
+ }
+
+ public void config(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData, getAtsWorkDefinitions());
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ // Add PeerToPeer Pages and Workflow Definition
+ workItems.add(new AtsPeerPrepareWorkPageDefinition());
+ workItems.add(new AtsPeerReviewWorkPageDefinition());
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Completed.name(),
+ PeerToPeerWorkflowDefinition.PEER_REVIEW_COMPLETED_STATE_ID, AtsCompletedWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Cancelled.name(),
+ PeerToPeerWorkflowDefinition.PEER_REVIEW_CANCELLED_STATE_ID, AtsCancelledWorkPageDefinition.ID));
+ workItems.add(new PeerToPeerWorkflowDefinition());
+
+ return workItems;
+ }
+
+ private void addTransitions() {
+ // Add default transitions
+ addPageTransition(AtsPeerPrepareWorkPageDefinition.ID, AtsPeerReviewWorkPageDefinition.ID,
+ TransitionType.ToPageAsDefault);
+ addPageTransition(AtsPeerReviewWorkPageDefinition.ID, PEER_REVIEW_COMPLETED_STATE_ID,
+ TransitionType.ToPageAsDefault);
+
+ // Add return transitions
+ addPageTransition(PEER_REVIEW_COMPLETED_STATE_ID, AtsPeerReviewWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(AtsPeerReviewWorkPageDefinition.ID, AtsPeerPrepareWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(PEER_REVIEW_CANCELLED_STATE_ID, AtsPeerReviewWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+ addPageTransition(PEER_REVIEW_CANCELLED_STATE_ID, AtsPeerPrepareWorkPageDefinition.ID,
+ TransitionType.ToPageAsReturn);
+
+ // Add cancelled transitions
+ addPageTransitionToPageAndReturn(AtsPeerPrepareWorkPageDefinition.ID, PEER_REVIEW_CANCELLED_STATE_ID);
+ addPageTransitionToPageAndReturn(AtsPeerReviewWorkPageDefinition.ID, PEER_REVIEW_CANCELLED_STATE_ID);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/SimpleWorkflowDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/SimpleWorkflowDefinition.java
new file mode 100644
index 00000000000..4b9e45a7196
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/SimpleWorkflowDefinition.java
@@ -0,0 +1,95 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.flow;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.item.AtsStatePercentCompleteWeightSimpleWorkflowRule;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsEndorseWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsSimpleInWorkWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SimpleWorkflowDefinition extends WorkFlowDefinition {
+
+ public static String ID = "osee.ats.simpleTeamWorkflow";
+ public static enum SimpleState {
+ Endorse, InWork, Completed, Cancelled
+ };
+ public static String ENDORSE_STATE_ID = ID + "." + SimpleState.Endorse.name();
+ public static String INWORK_STATE_ID = ID + "." + SimpleState.InWork.name();
+ public static String COMPLETED_STATE_ID = ID + "." + SimpleState.Completed.name();
+ public static String CANCELLED_STATE_ID = ID + "." + SimpleState.Cancelled.name();
+
+ public SimpleWorkflowDefinition(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ throw new OseeStateException("This constructor should never be used.");
+ }
+
+ public SimpleWorkflowDefinition() {
+ this(ID, ID);
+ addWorkItem(AtsStatePercentCompleteWeightSimpleWorkflowRule.ID);
+ }
+
+ /**
+ * @param name
+ * @param id
+ * @param parentId
+ */
+ public SimpleWorkflowDefinition(String name, String workflowId) {
+ super(name, workflowId, null);
+ addDefaultTransitions(this, workflowId);
+ startPageId = SimpleState.Endorse.name();
+ }
+
+ public void config(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData, getAtsWorkDefinitions());
+ }
+
+ public static void addDefaultTransitions(WorkFlowDefinition teamWorkflowDefinition, String workflowId) {
+ teamWorkflowDefinition.addPageTransition(SimpleState.Endorse.name(), SimpleState.InWork.name(),
+ TransitionType.ToPageAsDefault);
+ teamWorkflowDefinition.addPageTransition(SimpleState.InWork.name(), SimpleState.Completed.name(),
+ TransitionType.ToPageAsDefault);
+
+ // Add return transitions
+ teamWorkflowDefinition.addPageTransition(SimpleState.InWork.name(), SimpleState.Endorse.name(),
+ TransitionType.ToPageAsReturn);
+ teamWorkflowDefinition.addPageTransition(SimpleState.Completed.name(), SimpleState.InWork.name(),
+ TransitionType.ToPageAsReturn);
+
+ // Add cancelled transitions
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(SimpleState.Endorse.name(), SimpleState.Cancelled.name());
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(SimpleState.InWork.name(), SimpleState.Cancelled.name());
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ workItems.add(new WorkPageDefinition(SimpleState.Endorse.name(), SimpleWorkflowDefinition.ENDORSE_STATE_ID,
+ AtsEndorseWorkPageDefinition.ID));
+ workItems.add(new AtsSimpleInWorkWorkPageDefinition());
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Completed.name(),
+ SimpleWorkflowDefinition.COMPLETED_STATE_ID, AtsCompletedWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Cancelled.name(),
+ SimpleWorkflowDefinition.CANCELLED_STATE_ID, AtsCancelledWorkPageDefinition.ID));
+ workItems.add(new SimpleWorkflowDefinition());
+
+ return workItems;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TaskWorkflowDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TaskWorkflowDefinition.java
new file mode 100644
index 00000000000..fdad93f2d70
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TaskWorkflowDefinition.java
@@ -0,0 +1,75 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.flow;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TaskArtifact.TaskStates;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsTaskInWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskWorkflowDefinition extends WorkFlowDefinition {
+
+ public static String ID = "osee.ats.taskWorkflow";
+
+ public TaskWorkflowDefinition() {
+ this(ID, ID);
+ startPageId = TaskStates.InWork.name();
+ }
+
+ public TaskWorkflowDefinition(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ throw new OseeStateException("This constructor should never be used.");
+ }
+
+ public void config(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData, getAtsWorkDefinitions());
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ // Add Task Page and Workflow Definition
+ workItems.add(new AtsTaskInWorkPageDefinition());
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Completed.name(), ID + "." + TaskStates.Completed.name(),
+ AtsCompletedWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Cancelled.name(), ID + "." + TaskStates.Cancelled.name(),
+ AtsCancelledWorkPageDefinition.ID));
+ workItems.add(new TaskWorkflowDefinition());
+
+ return workItems;
+ }
+
+ /**
+ * @param name
+ * @param id
+ * @param parentId
+ */
+ public TaskWorkflowDefinition(String name, String id) {
+ super(name, id, null);
+ addPageTransition(TaskStates.InWork.name(), TaskStates.Completed.name(), TransitionType.ToPageAsDefault);
+
+ // Add return transitions
+ addPageTransition(TaskStates.Completed.name(), TaskStates.InWork.name(), TransitionType.ToPageAsReturn);
+
+ // Add cancelled transitions
+ addPageTransitionToPageAndReturn(TaskStates.InWork.name(), TaskStates.Cancelled.name());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TeamWorkflowDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TeamWorkflowDefinition.java
new file mode 100644
index 00000000000..4c03cb2ad88
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/flow/TeamWorkflowDefinition.java
@@ -0,0 +1,136 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.flow;
+
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.item.AtsStatePercentCompleteWeightDefaultWorkflowRule;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.page.AtsAnalyzeWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsAuthorizeWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsEndorseWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsImplementWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.OseeStateException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowDefinition extends WorkFlowDefinition {
+
+ public static String ID = "osee.ats.teamWorkflow";
+
+ public TeamWorkflowDefinition() {
+ this(ID, ID);
+ addWorkItem(AtsStatePercentCompleteWeightDefaultWorkflowRule.ID);
+ }
+
+ public TeamWorkflowDefinition(Artifact artifact) throws OseeCoreException {
+ super(artifact);
+ throw new OseeStateException("This constructor should never be used.");
+ }
+
+ /**
+ * Instantiate workflow as inherited from parentWorkflowId. Default transitions and startPageId are not set as they
+ * will most likely come from parent.
+ *
+ * @param name
+ * @param workflowId
+ * @param parentWorkflowId
+ */
+ public TeamWorkflowDefinition(String name, String workflowId, String parentWorkflowId) {
+ super(name, workflowId, parentWorkflowId);
+ }
+
+ public void config(WriteType writeType, XResultData xResultData) throws OseeCoreException {
+ AtsWorkDefinitions.importWorkItemDefinitionsIntoDb(writeType, xResultData, getAtsWorkDefinitions());
+ }
+
+ /**
+ * Instantiate workflow as a TeamWorkflowDefinition with default transitions and startPageId set.
+ *
+ * @param name
+ * @param id
+ * @param parentId
+ */
+ public TeamWorkflowDefinition(String name, String workflowId) {
+ super(name, workflowId, null);
+ addDefaultTransitions(this, workflowId);
+ startPageId = DefaultTeamState.Endorse.name();
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ // Add Team Page and Workflow Definition
+ workItems.add(new AtsEndorseWorkPageDefinition());
+ workItems.add(new AtsAnalyzeWorkPageDefinition());
+ workItems.add(new AtsAuthorizeWorkPageDefinition());
+ workItems.add(new AtsImplementWorkPageDefinition());
+ workItems.add(new AtsCompletedWorkPageDefinition());
+ workItems.add(new AtsCancelledWorkPageDefinition());
+ workItems.add(new TeamWorkflowDefinition());
+
+ return workItems;
+ }
+
+ public static List<WorkItemDefinition> getWorkPageDefinitionsForId(String workflowId) {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+ // Add Team Page and Workflow Definition
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Endorse.name(),
+ workflowId + "." + DefaultTeamState.Endorse.name(), AtsEndorseWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Analyze.name(),
+ workflowId + "." + DefaultTeamState.Analyze.name(), AtsAnalyzeWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Authorize.name(),
+ workflowId + "." + DefaultTeamState.Authorize.name(), AtsAuthorizeWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Implement.name(),
+ workflowId + "." + DefaultTeamState.Implement.name(), AtsImplementWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Completed.name(),
+ workflowId + "." + DefaultTeamState.Completed.name(), AtsCompletedWorkPageDefinition.ID));
+ workItems.add(new WorkPageDefinition(DefaultTeamState.Cancelled.name(),
+ workflowId + "." + DefaultTeamState.Cancelled.name(), AtsCancelledWorkPageDefinition.ID));
+ return workItems;
+ }
+
+ public static void addDefaultTransitions(WorkFlowDefinition teamWorkflowDefinition, String workflowId) {
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Endorse.name(), DefaultTeamState.Analyze.name(),
+ TransitionType.ToPageAsDefault);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Analyze.name(), DefaultTeamState.Authorize.name(),
+ TransitionType.ToPageAsDefault);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Authorize.name(), DefaultTeamState.Implement.name(),
+ TransitionType.ToPageAsDefault);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Implement.name(), DefaultTeamState.Completed.name(),
+ TransitionType.ToPageAsDefault);
+
+ // Add return transitions
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Authorize.name(), DefaultTeamState.Analyze.name(),
+ TransitionType.ToPageAsReturn);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Implement.name(), DefaultTeamState.Analyze.name(),
+ TransitionType.ToPageAsReturn);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Implement.name(), DefaultTeamState.Authorize.name(),
+ TransitionType.ToPageAsReturn);
+ teamWorkflowDefinition.addPageTransition(DefaultTeamState.Completed.name(), DefaultTeamState.Implement.name(),
+ TransitionType.ToPageAsReturn);
+
+ // Add cancelled transitions
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(DefaultTeamState.Endorse.name(),
+ DefaultTeamState.Cancelled.name());
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(DefaultTeamState.Analyze.name(),
+ DefaultTeamState.Cancelled.name());
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(DefaultTeamState.Authorize.name(),
+ DefaultTeamState.Cancelled.name());
+ teamWorkflowDefinition.addPageTransitionToPageAndReturn(DefaultTeamState.Implement.name(),
+ DefaultTeamState.Cancelled.name());
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddDecisionReviewRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddDecisionReviewRule.java
new file mode 100644
index 00000000000..ca78e9f7959
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddDecisionReviewRule.java
@@ -0,0 +1,134 @@
+/*
+ * Created on Sep 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewDecisionReviewJob;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.UsersByIds;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAddDecisionReviewRule extends WorkRuleDefinition {
+
+ public static String ID = "atsAddDecisionReview";
+ public static enum DecisionParameter {
+ title, forState, forEvent, reviewBlockingType, assignees, options, description
+ };
+
+ public AtsAddDecisionReviewRule() {
+ this(ID, ID);
+ }
+
+ public AtsAddDecisionReviewRule(String name, String id) {
+ super(name, id);
+ setDescription("Work Page and Team Definition Option: Decision Review will be auto-created based on WorkData attribute values.");
+ setDecisionParameterValue(this, DecisionParameter.title, "Enter Title Here");
+ setDecisionParameterValue(this, DecisionParameter.reviewBlockingType, "Transition");
+ setDecisionParameterValue(this, DecisionParameter.forState, "Implement");
+ setDecisionParameterValue(this, DecisionParameter.forEvent, StateEventType.TransitionTo.name());
+ try {
+ setDecisionParameterValue(this, DecisionParameter.assignees, "<99999997>");
+ setDecisionParameterValue(this, DecisionParameter.options, "Completed;Completed;");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ public static void setDecisionParameterValue(WorkRuleDefinition workRuleDefinition, DecisionParameter decisionParameter, String value) {
+ workRuleDefinition.addWorkDataKeyValue(decisionParameter.name(), value);
+ }
+
+ public static String getDecisionParameterValue(WorkRuleDefinition workRuleDefinition, DecisionParameter decisionParameter) {
+ return workRuleDefinition.getWorkDataValue(decisionParameter.name());
+ }
+
+ /**
+ * Creates decision review if one of same name doesn't already exist
+ *
+ * @param atsAddDecisionReviewRule
+ * @param smaMgr
+ * @return DecisionReviewArtifact
+ * @throws OseeCoreException
+ */
+ public static DecisionReviewArtifact createNewDecisionReview(WorkRuleDefinition atsAddDecisionReviewRule, SMAManager smaMgr) throws OseeCoreException {
+ if (!atsAddDecisionReviewRule.getId().startsWith(AtsAddDecisionReviewRule.ID)) {
+ throw new IllegalArgumentException("WorkRuleDefinition must be AtsAddDecisionReviewRule.ID");
+ }
+ String title = getValueOrDefault(smaMgr, atsAddDecisionReviewRule, DecisionParameter.title);
+ if (Artifacts.artNames(smaMgr.getReviewManager().getReviews()).contains(title)) {
+ // Already created this review
+ return null;
+ }
+ DecisionReviewArtifact decArt =
+ NewDecisionReviewJob.createNewDecisionReview(smaMgr.getSma(), getReviewBlockTypeOrDefault(smaMgr,
+ atsAddDecisionReviewRule), title, getValueOrDefault(smaMgr, atsAddDecisionReviewRule,
+ DecisionParameter.forState), getValueOrDefault(smaMgr, atsAddDecisionReviewRule,
+ DecisionParameter.description), getValueOrDefault(smaMgr, atsAddDecisionReviewRule,
+ DecisionParameter.options), getAssigneesOrDefault(smaMgr, atsAddDecisionReviewRule));
+
+ decArt.getSmaMgr().getLog().addLog(LogType.Note, null,
+ "Review auto-generated off rule " + atsAddDecisionReviewRule.getId());
+ return decArt;
+ }
+
+ public static ReviewBlockType getReviewBlockTypeOrDefault(SMAManager smaMgr, WorkRuleDefinition workRuleDefinition) {
+ String value = getDecisionParameterValue(workRuleDefinition, DecisionParameter.reviewBlockingType);
+ if (value == null || value.equals("")) {
+ return null;
+ }
+ return ReviewBlockType.valueOf(value);
+ }
+
+ public static StateEventType getStateEventType(SMAManager smaMgr, WorkRuleDefinition workRuleDefinition) {
+ String value = getDecisionParameterValue(workRuleDefinition, DecisionParameter.forEvent);
+ if (value == null || value.equals("")) {
+ return null;
+ }
+ return StateEventType.valueOf(value);
+ }
+
+ private static String getValueOrDefault(SMAManager smaMgr, WorkRuleDefinition workRuleDefinition, DecisionParameter decisionParameter) throws OseeCoreException {
+ String value = getDecisionParameterValue(workRuleDefinition, decisionParameter);
+ if (value == null || value.equals("")) {
+ if (decisionParameter == DecisionParameter.title) {
+ return "Decide on \"" + smaMgr.getSma().getDescriptiveName() + "\"";
+ } else if (decisionParameter == DecisionParameter.options) {
+ return "Yes;Followup;<" + UserManager.getUser().getUserId() + ">\n" + "No;Completed;";
+ } else if (decisionParameter == DecisionParameter.description) {
+ return null;
+ } else if (decisionParameter == DecisionParameter.forState) {
+ return smaMgr.getStateMgr().getCurrentStateName();
+ }
+ }
+ return value;
+ }
+
+ public static Collection<User> getAssigneesOrDefault(SMAManager smaMgr, WorkRuleDefinition workRuleDefinition) throws OseeCoreException {
+ String value = getDecisionParameterValue(workRuleDefinition, DecisionParameter.assignees);
+ if (value == null || value.equals("")) {
+ return Arrays.asList(new User[] {UserManager.getUser()});
+ }
+ Collection<User> users = UsersByIds.getUsers(value);
+ if (users.size() == 0) {
+ users.add(UserManager.getUser());
+ }
+ return users;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddPeerToPeerReviewRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddPeerToPeerReviewRule.java
new file mode 100644
index 00000000000..c8d4de91d1e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAddPeerToPeerReviewRule.java
@@ -0,0 +1,114 @@
+/*
+ * Created on Sep 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact.ReviewBlockType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAddPeerToPeerReviewRule extends WorkRuleDefinition {
+
+ public static String ID = "atsAddPeerToPeerReview";
+ public static enum PeerToPeerParameter {
+ title, forState, reviewBlockingType, assignees, location, description
+ };
+
+ public AtsAddPeerToPeerReviewRule() {
+ super(ID, ID);
+ setDescription("Work Page and Team Definition Option: PeerToPeer Review will be auto-created based on WorkData attribute values.");
+ setPeerToPeerParameterValue(this, PeerToPeerParameter.reviewBlockingType, "Transition");
+ setPeerToPeerParameterValue(this, PeerToPeerParameter.forState, "Implement");
+ try {
+ setPeerToPeerParameterValue(this, PeerToPeerParameter.assignees, "<99999997>");
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ public static void setPeerToPeerParameterValue(WorkRuleDefinition workRuleDefinition, PeerToPeerParameter decisionParameter, String value) {
+ workRuleDefinition.addWorkDataKeyValue(decisionParameter.name(), value);
+ }
+
+ public static String getPeerToPeerParameterValue(WorkRuleDefinition workRuleDefinition, PeerToPeerParameter decisionParameter) {
+ return workRuleDefinition.getWorkDataValue(decisionParameter.name());
+ }
+
+ /**
+ * Creates PeerToPeer review if one of same name doesn't already exist
+ *
+ * @param atsAddPeerToPeerReviewRule
+ * @param smaMgr
+ * @param transaction
+ * @return review
+ * @throws OseeCoreException
+ */
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(WorkRuleDefinition atsAddPeerToPeerReviewRule, SMAManager smaMgr, SkynetTransaction transaction) throws OseeCoreException {
+ if (!atsAddPeerToPeerReviewRule.getId().startsWith(AtsAddPeerToPeerReviewRule.ID)) {
+ throw new IllegalArgumentException("WorkRuleDefinition must be AtsAddPeerToPeerReviewRule.ID");
+ }
+ String title = getValueOrDefault(smaMgr, atsAddPeerToPeerReviewRule, PeerToPeerParameter.title);
+ if (Artifacts.artNames(smaMgr.getReviewManager().getReviews()).contains(title)) {
+ // Already created this review
+ return null;
+ }
+ PeerToPeerReviewArtifact peerArt =
+ ReviewManager.createNewPeerToPeerReview(smaMgr.getSma(), title, getValueOrDefault(smaMgr,
+ atsAddPeerToPeerReviewRule, PeerToPeerParameter.forState), UserManager.getUser(), new Date(), transaction);
+ String desc = getValueOrDefault(smaMgr, atsAddPeerToPeerReviewRule, PeerToPeerParameter.description);
+ if (desc != null && !desc.equals("")) {
+ peerArt.setSoleAttributeFromString(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ }
+ ReviewBlockType reviewBlockType =
+ AtsAddDecisionReviewRule.getReviewBlockTypeOrDefault(smaMgr, atsAddPeerToPeerReviewRule);
+ if (reviewBlockType != null) {
+ peerArt.setSoleAttributeFromString(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName(),
+ reviewBlockType.name());
+ }
+ String location = getValueOrDefault(smaMgr, atsAddPeerToPeerReviewRule, PeerToPeerParameter.location);
+ if (location != null && location.equals("")) {
+ peerArt.setSoleAttributeFromString(ATSAttributes.LOCATION_ATTRIBUTE.getStoreName(), location);
+ }
+ Collection<User> assignees = AtsAddDecisionReviewRule.getAssigneesOrDefault(smaMgr, atsAddPeerToPeerReviewRule);
+ if (assignees.size() > 0) {
+ peerArt.getSmaMgr().getStateMgr().setAssignees(assignees);
+ }
+ peerArt.getSmaMgr().getLog().addLog(LogType.Note, null,
+ "Review auto-generated off rule " + atsAddPeerToPeerReviewRule.getId());
+ return peerArt;
+ }
+
+ private static String getValueOrDefault(SMAManager smaMgr, WorkRuleDefinition workRuleDefinition, PeerToPeerParameter peerToPeerParameter) throws OseeCoreException {
+ String value = getPeerToPeerParameterValue(workRuleDefinition, peerToPeerParameter);
+ if (value == null || value.equals("")) {
+ if (peerToPeerParameter == PeerToPeerParameter.title) {
+ return PeerToPeerReviewArtifact.getDefaultReviewTitle(smaMgr);
+ } else if (peerToPeerParameter == PeerToPeerParameter.forState) {
+ return smaMgr.getStateMgr().getCurrentStateName();
+ } else if (peerToPeerParameter == PeerToPeerParameter.location) {
+ return null;
+ }
+ }
+ return value;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewDefectXWidgetWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewDefectXWidgetWorkItem.java
new file mode 100644
index 00000000000..57197a87c22
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewDefectXWidgetWorkItem.java
@@ -0,0 +1,25 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeReviewDefectXWidgetWorkItem extends WorkWidgetDefinition {
+
+ protected AtsAttributeReviewDefectXWidgetWorkItem(ATSAttributes atsAttribute) {
+ super(atsAttribute.getDisplayName() + " - " + atsAttribute.getStoreName(), atsAttribute.getStoreName());
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ data.setStorageName(getId());
+ data.setXWidgetName("XDefectViewer");
+ set(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewRolesXWidgetWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewRolesXWidgetWorkItem.java
new file mode 100644
index 00000000000..5d7a7045366
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeReviewRolesXWidgetWorkItem.java
@@ -0,0 +1,27 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeReviewRolesXWidgetWorkItem extends WorkWidgetDefinition {
+
+ protected AtsAttributeReviewRolesXWidgetWorkItem(ATSAttributes atsAttribute) {
+ super(atsAttribute.getDisplayName() + " - " + atsAttribute.getStoreName(), atsAttribute.getStoreName());
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ data.setStorageName(getId());
+ data.getXOptionHandler().add(XOption.REQUIRED);
+ data.setXWidgetName("XUserRoleViewer");
+ set(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeSoleComboXWidgetWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeSoleComboXWidgetWorkItem.java
new file mode 100644
index 00000000000..a227854f32d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeSoleComboXWidgetWorkItem.java
@@ -0,0 +1,27 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeSoleComboXWidgetWorkItem extends WorkWidgetDefinition {
+
+ protected AtsAttributeSoleComboXWidgetWorkItem(ATSAttributes atsAttribute, String commaOptions, XOption... xOption) {
+ super(atsAttribute.getDisplayName() + " - " + atsAttribute.getStoreName(), atsAttribute.getStoreName());
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ data.setStorageName(getId());
+ data.setXWidgetName("XComboDam(" + commaOptions + ")");
+ data.getXOptionHandler().add(xOption);
+ set(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeXWidgetWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeXWidgetWorkItem.java
new file mode 100644
index 00000000000..d8fcde01b39
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsAttributeXWidgetWorkItem.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeXWidgetWorkItem extends WorkWidgetDefinition {
+
+ public AtsAttributeXWidgetWorkItem(String name, String id, String attributeTypeName, String xWidgetName, XOption... xOption) {
+ super(name + " - " + id, id);
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(name);
+ data.setId(id);
+ data.setStorageName(attributeTypeName);
+ data.setXWidgetName(xWidgetName);
+ data.getXOptionHandler().add(xOption);
+ set(data);
+ }
+
+ public AtsAttributeXWidgetWorkItem(ATSAttributes atsAttribute, String xWidgetName, XOption... xOption) {
+ this(atsAttribute.getDisplayName(), atsAttribute.getStoreName(), atsAttribute.getStoreName(), xWidgetName,
+ xOption);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancellationReasonStateWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancellationReasonStateWorkItem.java
new file mode 100644
index 00000000000..14d0f7dbd99
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancellationReasonStateWorkItem.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsCancellationReasonStateWorkItem extends WorkWidgetDefinition {
+
+ protected AtsCancellationReasonStateWorkItem(SMAManager smaMgr) throws OseeCoreException {
+ super("Cancellation Reason", "ats.CancellationReason");
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ data.setDefaultValue(item.getMsg());
+ data.setStorageName(getId());
+ data.setXWidgetName("XText");
+ data.getXOptionHandler().add(XOption.NOT_EDITABLE);
+ data.getXOptionHandler().add(XOption.FILL_HORIZONTALLY);
+ setXWidgetLayoutData(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancelledFromStateWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancelledFromStateWorkItem.java
new file mode 100644
index 00000000000..8a3bf7625e2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCancelledFromStateWorkItem.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsCancelledFromStateWorkItem extends WorkWidgetDefinition {
+
+ protected AtsCancelledFromStateWorkItem(SMAManager smaMgr) throws OseeCoreException {
+ super("Cancelled from State", "ats.CancelledFromState");
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateCancelled);
+ data.setDefaultValue(item.getState());
+ data.setStorageName(getId());
+ data.setXWidgetName("XText");
+ data.getXOptionHandler().add(XOption.NOT_EDITABLE);
+ data.getXOptionHandler().add(XOption.FILL_HORIZONTALLY);
+ setXWidgetLayoutData(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCompletedFromStateWorkItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCompletedFromStateWorkItem.java
new file mode 100644
index 00000000000..b0957265840
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsCompletedFromStateWorkItem.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsCompletedFromStateWorkItem extends WorkWidgetDefinition {
+
+ protected AtsCompletedFromStateWorkItem(SMAManager smaMgr) throws OseeCoreException {
+ super("Completed from State", "ats.CompletedFromState");
+ DynamicXWidgetLayoutData data = new DynamicXWidgetLayoutData(null);
+ data.setName(getName());
+ LogItem item = smaMgr.getLog().getStateEvent(LogType.StateComplete);
+ data.setDefaultValue(item.getState());
+ data.setStorageName(getId());
+ data.setXWidgetName("XText");
+ data.getXOptionHandler().add(XOption.NOT_EDITABLE);
+ data.getXOptionHandler().add(XOption.FILL_HORIZONTALLY);
+ setXWidgetLayoutData(data);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDecisionReviewRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDecisionReviewRule.java
new file mode 100644
index 00000000000..951f3e40008
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDecisionReviewRule.java
@@ -0,0 +1,26 @@
+/*
+ * Created on Sep 29, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact.DecisionReviewState;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStatePercentCompleteWeightDecisionReviewRule extends AtsStatePercentCompleteWeightRule {
+
+ public static String ID = "atsStatePercentCompleteWeight.DecisionReview";
+
+ public AtsStatePercentCompleteWeightDecisionReviewRule() {
+ super(ID, ID);
+ setDescription("State Percent Complete rule for Decision Review.");
+ addWorkDataKeyValue(DecisionReviewState.Prepare.name(), ".20");
+ addWorkDataKeyValue(DecisionReviewState.Decision.name(), ".69");
+ addWorkDataKeyValue(DecisionReviewState.Followup.name(), ".09");
+ addWorkDataKeyValue(DecisionReviewState.Completed.name(), ".01");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDefaultWorkflowRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDefaultWorkflowRule.java
new file mode 100644
index 00000000000..881c979983a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightDefaultWorkflowRule.java
@@ -0,0 +1,27 @@
+/*
+ * Created on Sep 29, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStatePercentCompleteWeightDefaultWorkflowRule extends AtsStatePercentCompleteWeightRule {
+
+ public static String ID = "atsStatePercentCompleteWeight.DefaultWorkflow";
+
+ public AtsStatePercentCompleteWeightDefaultWorkflowRule() {
+ super(ID, ID);
+ setDescription("State Percent Complete rule where Analyze and Implement states are where work is performed.");
+ addWorkDataKeyValue(DefaultTeamState.Endorse.name(), ".05");
+ addWorkDataKeyValue(DefaultTeamState.Analyze.name(), ".1");
+ addWorkDataKeyValue(DefaultTeamState.Authorize.name(), ".05");
+ addWorkDataKeyValue(DefaultTeamState.Implement.name(), ".79");
+ addWorkDataKeyValue(DefaultTeamState.Completed.name(), ".01");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightPeerToPeerReviewRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightPeerToPeerReviewRule.java
new file mode 100644
index 00000000000..a39b65b15ee
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightPeerToPeerReviewRule.java
@@ -0,0 +1,25 @@
+/*
+ * Created on Sep 29, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact.PeerToPeerReviewState;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStatePercentCompleteWeightPeerToPeerReviewRule extends AtsStatePercentCompleteWeightRule {
+
+ public static String ID = "atsStatePercentCompleteWeight.PeerToPeerReview";
+
+ public AtsStatePercentCompleteWeightPeerToPeerReviewRule() {
+ super(ID, ID);
+ setDescription("State Percent Complete rule for PeerToPeer Review.");
+ addWorkDataKeyValue(PeerToPeerReviewState.Prepare.name(), ".20");
+ addWorkDataKeyValue(PeerToPeerReviewState.Review.name(), ".79");
+ addWorkDataKeyValue(PeerToPeerReviewState.Completed.name(), ".01");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightRule.java
new file mode 100644
index 00000000000..9ed8d78b175
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightRule.java
@@ -0,0 +1,55 @@
+/*
+ * Created on Sep 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStatePercentCompleteWeightRule extends WorkRuleDefinition {
+
+ public static String ID = "atsStatePercentCompleteWeight";
+
+ public AtsStatePercentCompleteWeightRule() {
+ this(ID, ID);
+ }
+
+ public AtsStatePercentCompleteWeightRule(String name, String id) {
+ super(name, id);
+ setDescription("Work Flow Option: <state>=<percent> Work Data attributes specify weighting given to each state in percent complete calculations. <state> is either state name (not id) and <percent> is number from 0..1");
+ }
+
+ public static Map<String, Double> getStateWeightMap(WorkRuleDefinition workRuleDefinition) throws OseeCoreException {
+ Map<String, Double> stateToWeight = new HashMap<String, Double>();
+ for (String stateName : workRuleDefinition.getWorkDataKeyValueMap().keySet()) {
+ String value = workRuleDefinition.getWorkDataValue(stateName);
+ try {
+ double percent = new Double(value).doubleValue();
+ if (percent < 0.0 || percent > 1) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE,
+ "Invalid percent value \"" + value + "\" (must be 0..1) for rule " + workRuleDefinition.getId(),
+ new IllegalArgumentException());
+ } else {
+ stateToWeight.put(stateName, percent);
+ }
+ } catch (Exception ex) {
+ OseeLog.log(
+ AtsPlugin.class,
+ Level.SEVERE,
+ "Invalid percent value \"" + value + "\" (must be float 0..1) for rule " + workRuleDefinition.getId(),
+ new IllegalArgumentException());
+ }
+ }
+ return stateToWeight;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightSimpleWorkflowRule.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightSimpleWorkflowRule.java
new file mode 100644
index 00000000000..5b6278a6af3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsStatePercentCompleteWeightSimpleWorkflowRule.java
@@ -0,0 +1,25 @@
+/*
+ * Created on Sep 29, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import org.eclipse.osee.ats.workflow.flow.SimpleWorkflowDefinition.SimpleState;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsStatePercentCompleteWeightSimpleWorkflowRule extends AtsStatePercentCompleteWeightRule {
+
+ public static String ID = "atsStatePercentCompleteWeight.SimpleWorkflow";
+
+ public AtsStatePercentCompleteWeightSimpleWorkflowRule() {
+ super(ID, ID);
+ setDescription("State Percent Complete rule where InWork work is performed.");
+ addWorkDataKeyValue(SimpleState.Endorse.name(), ".10");
+ addWorkDataKeyValue(SimpleState.InWork.name(), ".89");
+ addWorkDataKeyValue(SimpleState.Completed.name(), ".01");
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java
new file mode 100644
index 00000000000..92528a75c5f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/AtsWorkDefinitions.java
@@ -0,0 +1,274 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.config.AtsConfig;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.PeerToPeerWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.TaskWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCancelledWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsCompletedWorkPageDefinition;
+import org.eclipse.osee.ats.workflow.page.AtsDecisionDecisionWorkPageDefinition;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.widgets.XOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IWorkDefinitionProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinitionFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkRuleDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkWidgetDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkItemDefinition.WriteType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+
+/**
+ * Create all the default ATS work items. This keeps from having to create a class for each of these. Also implement
+ * WorkDefinitionProvider which registers all definitions with the definitions factory
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsWorkDefinitions implements IWorkDefinitionProvider {
+
+ public static String ATS_TITLE_ID = "ats.Title";
+ public static String ATS_DESCRIPTION_NOT_REQUIRED_ID =
+ ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName() + ".notRequired";
+ public static enum RuleWorkItemId {
+ atsRequireStateHourSpentPrompt("Work Page Option: Will popup a dialog to prompt user for time spent in this state."),
+ atsAddDecisionValidateBlockingReview("Work Page Option: Will auto-create a blocking decision review for this state requesting validation for this workflow."),
+ atsAddDecisionValidateNonBlockingReview("Work Page Option: Will auto-create a non blocking decision review requesting validation of workflow changes."),
+ atsAllowTransitionWithWorkingBranch("Work Page Option: Will allow transition to next state without committing current working branch."),
+ atsAllowCreateBranch("Work Page Option: Allows a working branch to be created in this state."),
+ atsAllowCommitBranch("Work Page Option: Allows a working branch to be committed in this state."),
+ atsForceAssigneesToTeamLeads("Work Page Option: Will force this state to be assigned back to the configured team leads. Useful for authorization state."),
+ atsRequireTargetedVersion("Work Page and Team Definition Option: Requires workflow to be targeted for version before transition is allowed."),
+ atsAllowPriviledgedEditToTeamMember("Work Page and Team Definition Option: Allow team member to priviledged edit workflow assigned to team."),
+ atsAllowPriviledgedEditToTeamMemberAndOriginator("Work Page and Team Definition Option: Allow team member to priviledged edit workflow assigned to team if user is originator."),
+ atsAllowPriviledgedEditToAll("Work Page and Team Definition Option: Allow anyone to priviledged edit workflow assigned to team."),
+ atsAllowEditToAll("Work Page and Team Definition Option: Allow anyone to edit workflow.");
+
+ public final String description;
+
+ public String getDescription() {
+ return description;
+ }
+
+ private RuleWorkItemId(String description) {
+ this.description = description;
+ }
+ }
+
+ public static void relatePageToBranchCommitRules(String pageId) throws OseeCoreException {
+ WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, RuleWorkItemId.atsAllowCommitBranch.name());
+ WorkItemDefinitionFactory.relateWorkItemDefinitions(pageId, RuleWorkItemId.atsAllowCreateBranch.name());
+ }
+
+ public static List<WorkItemDefinition> getAtsWorkDefinitions() {
+ List<WorkItemDefinition> workItems = new ArrayList<WorkItemDefinition>();
+
+ // Create rule work items
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsRequireStateHourSpentPrompt.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAddDecisionValidateBlockingReview.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAddDecisionValidateNonBlockingReview.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowTransitionWithWorkingBranch.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowCreateBranch.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowCommitBranch.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsForceAssigneesToTeamLeads.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsRequireTargetedVersion.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowPriviledgedEditToTeamMember.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowPriviledgedEditToTeamMemberAndOriginator.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowPriviledgedEditToAll.name()));
+ workItems.add(new WorkRuleDefinition(RuleWorkItemId.atsAllowEditToAll.name()));
+ workItems.add(new AtsAddDecisionReviewRule());
+ workItems.add(new AtsAddPeerToPeerReviewRule());
+ workItems.add(new AtsStatePercentCompleteWeightRule());
+ workItems.add(new AtsStatePercentCompleteWeightDefaultWorkflowRule());
+ workItems.add(new AtsStatePercentCompleteWeightSimpleWorkflowRule());
+ workItems.add(new AtsStatePercentCompleteWeightDecisionReviewRule());
+ workItems.add(new AtsStatePercentCompleteWeightPeerToPeerReviewRule());
+
+ // Create XWidget work items
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.LOCATION_ATTRIBUTE, "XTextDam", XOption.REQUIRED,
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE, "XTextDam"));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.CATEGORY_ATTRIBUTE, "XTextDam"));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE, "XTextDam"));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.SMA_NOTE_ATTRIBUTE, "XTextDam",
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem("Title", "ats.Title", "Name", "XTextDam", XOption.REQUIRED));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE, "XTextDam",
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE, "XTextDam",
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.PROBLEM_ATTRIBUTE, "XTextDam",
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem("Question",
+ AtsDecisionDecisionWorkPageDefinition.DECISION_QUESTION_LABEL, "Name", "XLabelDam"));
+ workItems.add(new AtsAttributeXWidgetWorkItem("Decision",
+ AtsDecisionDecisionWorkPageDefinition.DECISION_ANSWER_LABEL,
+ ATSAttributes.DECISION_ATTRIBUTE.getStoreName(), "XLabelDam"));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE, "XTextDam",
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.DESCRIPTION_ATTRIBUTE, "XTextDam", XOption.REQUIRED,
+ XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.DESCRIPTION_ATTRIBUTE.getDisplayName(),
+ ATS_DESCRIPTION_NOT_REQUIRED_ID, ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "XTextDam",
+ XOption.NOT_REQUIRED, XOption.FILL_VERTICALLY));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE, "XComboBooleanDam",
+ XOption.REQUIRED, XOption.HORIZONTAL_LABEL));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE,
+ "XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)", XOption.REQUIRED, XOption.HORIZONTAL_LABEL));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.DECISION_ATTRIBUTE, "XComboDam(1,2,3)",
+ XOption.REQUIRED, XOption.HORIZONTAL_LABEL));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, "XFloatDam",
+ XOption.REQUIRED));
+ workItems.add(new AtsAttributeSoleComboXWidgetWorkItem(ATSAttributes.CHANGE_TYPE_ATTRIBUTE,
+ "OPTIONS_FROM_ATTRIBUTE_VALIDITY", XOption.REQUIRED, XOption.BEGIN_COMPOSITE_6));
+ workItems.add(new AtsAttributeSoleComboXWidgetWorkItem(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE,
+ "OPTIONS_FROM_ATTRIBUTE_VALIDITY", XOption.REQUIRED));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.DEADLINE_ATTRIBUTE, "XDateDam",
+ XOption.HORIZONTAL_LABEL, XOption.END_COMPOSITE));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE, "XCheckBoxDam",
+ XOption.HORIZONTAL_LABEL, XOption.LABEL_BEFORE));
+ workItems.add(new AtsAttributeXWidgetWorkItem(ATSAttributes.USER_COMMUNITY_ATTRIBUTE,
+ "XListDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)", XOption.HORIZONTAL_LABEL, XOption.REQUIRED));
+ workItems.add(new AtsAttributeReviewDefectXWidgetWorkItem(ATSAttributes.REVIEW_DEFECT_ATTRIBUTE));
+ workItems.add(new AtsAttributeReviewRolesXWidgetWorkItem(ATSAttributes.ROLE_ATTRIBUTE));
+
+ return workItems;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IWorkDefinitionProvider#getDynamicWorkItemDefinitionsForPage()
+ */
+ @Override
+ public Collection<WorkItemDefinition> getDynamicWorkItemDefinitionsForPage(WorkFlowDefinition workFlowDefinition, WorkPageDefinition workPageDefinition, Object data) throws OseeCoreException {
+ List<WorkItemDefinition> defs = new ArrayList<WorkItemDefinition>();
+ if (data instanceof SMAManager) {
+ SMAManager smaMgr = (SMAManager) data;
+ if (workPageDefinition.isInstanceOfPage(AtsCancelledWorkPageDefinition.ID)) {
+ defs.add(new AtsCancelledFromStateWorkItem(smaMgr));
+ defs.add(new AtsCancellationReasonStateWorkItem(smaMgr));
+ }
+ if (workPageDefinition.isInstanceOfPage(AtsCompletedWorkPageDefinition.ID)) {
+ defs.add(new AtsCompletedFromStateWorkItem(smaMgr));
+ }
+ }
+ return defs;
+ }
+
+ @Override
+ public Collection<WorkItemDefinition> getProgramaticWorkItemDefinitions() throws OseeCoreException {
+ return new ArrayList<WorkItemDefinition>();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IWorkDefinitionProvider#getWorkFlowDefinition(org.eclipse.osee.framework.skynet.core.artifact.Artifact)
+ */
+ @Override
+ public WorkFlowDefinition getWorkFlowDefinition(Artifact artifact) throws OseeCoreException {
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ // return (WorkFlowDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(TeamWorkflowDefinition.ID);
+ return ((TeamWorkFlowArtifact) artifact).getTeamDefinition().getWorkFlowDefinition();
+ }
+ if (artifact instanceof TaskArtifact) return (WorkFlowDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(TaskWorkflowDefinition.ID);
+ if (artifact instanceof PeerToPeerReviewArtifact) return (WorkFlowDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(PeerToPeerWorkflowDefinition.ID);
+ if (artifact instanceof DecisionReviewArtifact) return (WorkFlowDefinition) WorkItemDefinitionFactory.getWorkItemDefinition(DecisionWorkflowDefinition.ID);
+ return null;
+ }
+
+ public static boolean isValidatePage(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ if (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAddDecisionValidateBlockingReview.name()) != null) return true;
+ if (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAddDecisionValidateNonBlockingReview.name()) != null) return true;
+ return false;
+ }
+
+ public static boolean isValidateReviewBlocking(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAddDecisionValidateBlockingReview.name()) != null);
+ }
+
+ public static boolean isForceAssigneesToTeamLeads(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsForceAssigneesToTeamLeads.name()) != null);
+ }
+
+ public static boolean isAllowTransitionWithWorkingBranch(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAllowTransitionWithWorkingBranch.name()) != null);
+ }
+
+ public static boolean isRequireStateHoursSpentPrompt(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsRequireStateHourSpentPrompt.name()) != null);
+ }
+
+ public static boolean isAllowCreateBranch(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAllowCreateBranch.name()) != null);
+ }
+
+ public static boolean isAllowCommitBranch(WorkPageDefinition workPageDefinition) throws OseeCoreException {
+ return (workPageDefinition.getWorkItemDefinition(AtsWorkDefinitions.RuleWorkItemId.atsAllowCommitBranch.name()) != null);
+ }
+
+ public static void importWorkItemDefinitionsIntoDb(WriteType writeType, XResultData resultData, WorkItemDefinition workItemDefinition) throws OseeCoreException {
+ importWorkItemDefinitionsIntoDb(writeType, resultData,
+ Arrays.asList(new WorkItemDefinition[] {workItemDefinition}));
+ }
+
+ public static void importWorkItemDefinitionsIntoDb(final WriteType writeType, final XResultData resultData, final Collection<? extends WorkItemDefinition> workItemDefinitions) throws OseeCoreException {
+
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+
+ // Items must be imported in order due to the relations that are created between items
+ for (Class<?> clazz : new Class[] {WorkRuleDefinition.class, WorkWidgetDefinition.class,
+ WorkPageDefinition.class, WorkFlowDefinition.class}) {
+ for (WorkItemDefinition wid : workItemDefinitions) {
+ if (clazz.isInstance(wid)) {
+ // System.out.println("Adding " + wid.getId() + " as class " + clazz);
+ Artifact art = wid.toArtifact(writeType);
+ // Relate if not already related
+ if (art.getRelatedArtifacts(AtsRelation.WorkItem__Parent, Artifact.class).size() == 0) {
+ if (wid instanceof WorkPageDefinition) {
+ relateIfNotRelated(AtsConfig.getInstance().getOrCreateWorkPagesFolderArtifact(transaction), art);
+ }
+ if (wid instanceof WorkRuleDefinition) {
+ relateIfNotRelated(AtsConfig.getInstance().getOrCreateWorkRulesFolderArtifact(transaction), art);
+ }
+ if (wid instanceof WorkWidgetDefinition) {
+ relateIfNotRelated(AtsConfig.getInstance().getOrCreateWorkWidgetsFolderArtifact(transaction), art);
+ }
+ if (wid instanceof WorkFlowDefinition) {
+ relateIfNotRelated(AtsConfig.getInstance().getOrCreateWorkFlowsFolderArtifact(transaction), art);
+ }
+ }
+ if (art.isDirty(true) && resultData != null) {
+ resultData.log("Updated artifact " + art);
+ }
+ art.persistAttributesAndRelations(transaction);
+ }
+ }
+ }
+ transaction.execute();
+ }
+
+ private static void relateIfNotRelated(Artifact parent, Artifact child) throws OseeCoreException {
+ if (!parent.getRelatedArtifacts(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, Artifact.class).contains(
+ child)) {
+ parent.addChild(child);
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/StateEventType.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/StateEventType.java
new file mode 100644
index 00000000000..0adf3d4d41a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/item/StateEventType.java
@@ -0,0 +1,13 @@
+/*
+ * Created on Sep 29, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.item;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum StateEventType {
+ TransitionTo, CreateBranch, CommitBranch;
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAnalyzeWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAnalyzeWorkPageDefinition.java
new file mode 100644
index 00000000000..94f33a9e853
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAnalyzeWorkPageDefinition.java
@@ -0,0 +1,36 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAnalyzeWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Analyze.name();
+
+ public AtsAnalyzeWorkPageDefinition() {
+ this(DefaultTeamState.Analyze.name(), ID, null);
+ }
+
+ public AtsAnalyzeWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ addWorkItem(ATSAttributes.PROBLEM_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAuthorizeWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAuthorizeWorkPageDefinition.java
new file mode 100644
index 00000000000..5439c805726
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsAuthorizeWorkPageDefinition.java
@@ -0,0 +1,27 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAuthorizeWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Authorize.name();
+
+ public AtsAuthorizeWorkPageDefinition() {
+ this(DefaultTeamState.Authorize.name(), ID, null);
+ }
+
+ public AtsAuthorizeWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCancelledWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCancelledWorkPageDefinition.java
new file mode 100644
index 00000000000..819424868c4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCancelledWorkPageDefinition.java
@@ -0,0 +1,26 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsCancelledWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Cancelled.name();
+
+ public AtsCancelledWorkPageDefinition() {
+ this(DefaultTeamState.Cancelled.name(), ID, null);
+ }
+
+ public AtsCancelledWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCompletedWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCompletedWorkPageDefinition.java
new file mode 100644
index 00000000000..cda1fafa61c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsCompletedWorkPageDefinition.java
@@ -0,0 +1,29 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsCompletedWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Completed.name();
+
+ public AtsCompletedWorkPageDefinition() {
+ this(DefaultTeamState.Completed.name(), ID, null);
+ }
+
+ public AtsCompletedWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsAddDecisionValidateBlockingReview.name());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionCompletedWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionCompletedWorkPageDefinition.java
new file mode 100644
index 00000000000..92e89082dd9
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionCompletedWorkPageDefinition.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionCompletedWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = DecisionWorkflowDefinition.ID + "." + DefaultTeamState.Completed.name();
+
+ public AtsDecisionCompletedWorkPageDefinition() {
+ this(DefaultTeamState.Completed.name(), ID, null);
+ }
+
+ public AtsDecisionCompletedWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsAddDecisionValidateBlockingReview.name());
+ addWorkItem(AtsDecisionDecisionWorkPageDefinition.DECISION_QUESTION_LABEL);
+ addWorkItem(AtsDecisionDecisionWorkPageDefinition.DECISION_ANSWER_LABEL);
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionDecisionWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionDecisionWorkPageDefinition.java
new file mode 100644
index 00000000000..6b350569cf3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionDecisionWorkPageDefinition.java
@@ -0,0 +1,36 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionDecisionWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID =
+ DecisionWorkflowDefinition.ID + "." + DecisionReviewArtifact.DecisionReviewState.Decision.name();
+ public static String DECISION_QUESTION_LABEL = "ats.Decision Question";
+ public static String DECISION_ANSWER_LABEL = "ats.Decision Answer";
+
+ public AtsDecisionDecisionWorkPageDefinition() {
+ this(DecisionReviewArtifact.DecisionReviewState.Decision.name(), ID, null);
+ }
+
+ public AtsDecisionDecisionWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(AtsDecisionDecisionWorkPageDefinition.DECISION_QUESTION_LABEL);
+ addWorkItem(ATSAttributes.DECISION_ATTRIBUTE.getStoreName());
+ addWorkItem(AtsWorkDefinitions.ATS_DESCRIPTION_NOT_REQUIRED_ID);
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionFollowupWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionFollowupWorkPageDefinition.java
new file mode 100644
index 00000000000..389bd954e2f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionFollowupWorkPageDefinition.java
@@ -0,0 +1,29 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionFollowupWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = DecisionWorkflowDefinition.ID + "." + DecisionReviewArtifact.DecisionReviewState.Followup.name();
+
+ public AtsDecisionFollowupWorkPageDefinition() {
+ this(DecisionReviewArtifact.DecisionReviewState.Followup.name(), ID, null);
+ }
+
+ public AtsDecisionFollowupWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionPrepareWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionPrepareWorkPageDefinition.java
new file mode 100644
index 00000000000..2bb4a75570a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsDecisionPrepareWorkPageDefinition.java
@@ -0,0 +1,36 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.DecisionReviewArtifact;
+import org.eclipse.osee.ats.workflow.flow.DecisionWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsDecisionPrepareWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = DecisionWorkflowDefinition.ID + "." + DecisionReviewArtifact.DecisionReviewState.Prepare.name();
+
+ public AtsDecisionPrepareWorkPageDefinition() {
+ this(DecisionReviewArtifact.DecisionReviewState.Prepare.name(), ID, null);
+ }
+
+ public AtsDecisionPrepareWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem("ats.Title");
+ addWorkItem(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName());
+ addWorkItem(AtsWorkDefinitions.ATS_DESCRIPTION_NOT_REQUIRED_ID);
+ addWorkItem(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsEndorseWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsEndorseWorkPageDefinition.java
new file mode 100644
index 00000000000..c8fa6afa6bd
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsEndorseWorkPageDefinition.java
@@ -0,0 +1,38 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsEndorseWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Endorse.name();
+
+ public AtsEndorseWorkPageDefinition() {
+ this(DefaultTeamState.Endorse.name(), ID, null);
+ }
+
+ public AtsEndorseWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ addWorkItem("ats.Title");
+ addWorkItem(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsImplementWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsImplementWorkPageDefinition.java
new file mode 100644
index 00000000000..1be109368f5
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsImplementWorkPageDefinition.java
@@ -0,0 +1,30 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.flow.TeamWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsImplementWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TeamWorkflowDefinition.ID + "." + DefaultTeamState.Implement.name();
+
+ public AtsImplementWorkPageDefinition() {
+ this(DefaultTeamState.Implement.name(), ID, null);
+ }
+
+ public AtsImplementWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerPrepareWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerPrepareWorkPageDefinition.java
new file mode 100644
index 00000000000..f6fed448ce1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerPrepareWorkPageDefinition.java
@@ -0,0 +1,38 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.workflow.flow.PeerToPeerWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPeerPrepareWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = PeerToPeerWorkflowDefinition.ID + "." + PeerToPeerReviewArtifact.PeerToPeerReviewState.Prepare.name();
+
+ public AtsPeerPrepareWorkPageDefinition() {
+ this(PeerToPeerReviewArtifact.PeerToPeerReviewState.Prepare.name(), ID, null);
+ }
+
+ public AtsPeerPrepareWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem("ats.Title");
+ addWorkItem(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.ROLE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.LOCATION_ATTRIBUTE.getStoreName());
+ addWorkItem(AtsWorkDefinitions.ATS_DESCRIPTION_NOT_REQUIRED_ID);
+ addWorkItem(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.REVIEW_BLOCKS_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerReviewWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerReviewWorkPageDefinition.java
new file mode 100644
index 00000000000..315062ec5e1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsPeerReviewWorkPageDefinition.java
@@ -0,0 +1,33 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.PeerToPeerReviewArtifact;
+import org.eclipse.osee.ats.workflow.flow.PeerToPeerWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsPeerReviewWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = PeerToPeerWorkflowDefinition.ID + "." + PeerToPeerReviewArtifact.PeerToPeerReviewState.Review.name();
+
+ public AtsPeerReviewWorkPageDefinition() {
+ this(PeerToPeerReviewArtifact.PeerToPeerReviewState.Review.name(), ID, null);
+ }
+
+ public AtsPeerReviewWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(ATSAttributes.ROLE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.REVIEW_DEFECT_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ addWorkItem(AtsWorkDefinitions.ATS_DESCRIPTION_NOT_REQUIRED_ID);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsSimpleInWorkWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsSimpleInWorkWorkPageDefinition.java
new file mode 100644
index 00000000000..ac62548ed0e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsSimpleInWorkWorkPageDefinition.java
@@ -0,0 +1,30 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.workflow.flow.SimpleWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.flow.SimpleWorkflowDefinition.SimpleState;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsSimpleInWorkWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = SimpleWorkflowDefinition.ID + "." + SimpleState.InWork.name();
+
+ public AtsSimpleInWorkWorkPageDefinition() {
+ this(SimpleState.InWork.name(), ID, null);
+ }
+
+ public AtsSimpleInWorkWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsTaskInWorkPageDefinition.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsTaskInWorkPageDefinition.java
new file mode 100644
index 00000000000..35586956c19
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/page/AtsTaskInWorkPageDefinition.java
@@ -0,0 +1,38 @@
+/*
+ * Created on May 28, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.page;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact.TaskStates;
+import org.eclipse.osee.ats.workflow.flow.TaskWorkflowDefinition;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions;
+import org.eclipse.osee.ats.workflow.item.AtsWorkDefinitions.RuleWorkItemId;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageDefinition;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsTaskInWorkPageDefinition extends WorkPageDefinition {
+
+ public static String ID = TaskWorkflowDefinition.ID + "." + TaskStates.InWork.name();
+
+ public AtsTaskInWorkPageDefinition() {
+ this(TaskStates.InWork.name(), ID, null);
+ }
+
+ public AtsTaskInWorkPageDefinition(String name, String pageId, String parentId) {
+ super(name, pageId, parentId);
+ addWorkItem(RuleWorkItemId.atsRequireStateHourSpentPrompt.name());
+ addWorkItem("ats.Title");
+ addWorkItem(AtsWorkDefinitions.ATS_DESCRIPTION_NOT_REQUIRED_ID);
+ addWorkItem(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName());
+ addWorkItem(ATSAttributes.CATEGORY_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/AtsDbConfig.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/AtsDbConfig.java
new file mode 100644
index 00000000000..f05c97f5f21
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/AtsDbConfig.java
@@ -0,0 +1,16 @@
+/*
+ * Created on Oct 23, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.workflow.vue;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class AtsDbConfig {
+
+ protected void executeLoadAIsAndTeamsAction(String bundleId) {
+ LoadAIsAndTeamsAction.executeForDbConfig(bundleId);
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/Diagram.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/Diagram.java
new file mode 100644
index 00000000000..a34606baa11
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/Diagram.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class Diagram {
+
+ protected List<DiagramNode> nodes = new ArrayList<DiagramNode>();
+ private Set<String> nodeNames = new HashSet<String>();
+ private String id;
+ private String inheritData;
+
+ public Diagram(String id) {
+ super();
+ this.id = id;
+ }
+
+ public Set<String> getPageNames() {
+ if (nodeNames.size() == 0) {
+ for (DiagramNode page : nodes)
+ nodeNames.add(page.getName());
+ }
+ return nodeNames;
+ }
+
+ public void addPage(DiagramNode page) {
+ nodes.add(page);
+ }
+
+ public DiagramNode getPage(String pageName) {
+ List<DiagramNode> pages = getPages(pageName);
+ if (pages.size() > 1) throw new IllegalArgumentException(
+ "Multiple node of same name found in workflow => " + getId() + " Use getPages.");
+ return pages.iterator().next();
+ }
+
+ public List<DiagramNode> getPages(String pageName) {
+ List<DiagramNode> foundPages = new ArrayList<DiagramNode>();
+ for (DiagramNode page : nodes)
+ if (page.getName().equals(pageName)) foundPages.add(page);
+ if (foundPages.size() == 0) throw new IllegalArgumentException(
+ "Invalid node Name \"" + pageName + "\" from workflow => " + getId());
+ return foundPages;
+ }
+
+ public DiagramNode getPageFromId(String id) {
+ for (DiagramNode page : nodes)
+ if (page.getId().equals(id)) return page;
+ return null;
+ }
+
+ public Collection<DiagramNode> getPages() {
+ return nodes;
+ }
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the inheritData
+ */
+ public String getInheritData() {
+ return inheritData;
+ }
+
+ /**
+ * @param inheritData the inheritData to set
+ */
+ public void setInheritData(String inheritData) {
+ this.inheritData = inheritData;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramFactory.java
new file mode 100644
index 00000000000..d07f0e6d919
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramFactory.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DiagramFactory {
+
+ private static DiagramFactory instance = new DiagramFactory();
+ public static String GENERAL_DOCUMENT_ARTIFACT_NAME = "General Document";
+ private static Map<Object, String> objToAtsWorkFlowXml = new HashMap<Object, String>();
+
+ private DiagramFactory() {
+ super();
+ }
+
+ public static DiagramFactory getInstance() {
+ return instance;
+ }
+
+ public Diagram getWorkFlowFromFilename(String workFlowFilename) {
+ if (!objToAtsWorkFlowXml.containsKey(workFlowFilename)) {
+ String vueXml = AFile.readFile(new File(workFlowFilename));
+ objToAtsWorkFlowXml.put(workFlowFilename, vueXml);
+ }
+ return (Diagram) (new VueDiagram(workFlowFilename, objToAtsWorkFlowXml.get(workFlowFilename))).getWorkflow();
+ }
+
+ public Diagram getWorkFlowFromFileContents(String name, String vueXml) {
+ if (!objToAtsWorkFlowXml.containsKey(name)) {
+ objToAtsWorkFlowXml.put(name, vueXml);
+ }
+ return (Diagram) (new VueDiagram(name, objToAtsWorkFlowXml.get(name))).getWorkflow();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramNode.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramNode.java
new file mode 100644
index 00000000000..909536f3b72
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/DiagramNode.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DiagramNode {
+
+ private String id = GUID.generateGuidStr();
+ private String name;
+ private ArrayList<DiagramNode> fromPages = new ArrayList<DiagramNode>();
+ private ArrayList<DiagramNode> toPages = new ArrayList<DiagramNode>();
+ private ArrayList<DiagramNode> returnPages = new ArrayList<DiagramNode>();
+ private DiagramNode defaultToPage;
+ private String instructionStr;
+
+ public static enum PageType {
+ Team, ActionableItem
+ };
+ private PageType pageType;
+
+ /**
+ * @param instructionLines input lines of WorkAttribute declarations
+ */
+ public DiagramNode(String name, String id, String xWidgetsXml, IXWidgetOptionResolver optionResolver) {
+ super();
+ this.name = name;
+ if (id != null && !id.equals("")) this.id = id;
+ }
+
+ public DiagramNode(String xWidgetsXml, IXWidgetOptionResolver optionResolver) {
+ this("", "", xWidgetsXml, optionResolver);
+ }
+
+ public DiagramNode(IXWidgetOptionResolver optionResolver) {
+ this("", "", null, optionResolver);
+ }
+
+ /**
+ * @return the instructionStr
+ */
+ public String getInstructionStr() {
+ return instructionStr;
+ }
+
+ /**
+ * @param instructionStr the instructionStr to set
+ */
+ public void setInstructionStr(String instructionStr) {
+ this.instructionStr = instructionStr;
+ }
+
+ /**
+ * @return Returns the pageType.
+ */
+ public PageType getPageType() {
+ return pageType;
+ }
+
+ /**
+ * @param pageType The pageType to set.
+ */
+ public void setPageType(PageType pageType) {
+ this.pageType = pageType;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof DiagramNode) return getId().equals(((DiagramNode) obj).getId());
+ return false;
+ }
+
+ public String toString() {
+ StringBuffer sb = new StringBuffer(name + (id != null ? " (" + id + ") " : "") + "\n");
+ for (DiagramNode page : toPages) {
+ sb.append("-> " + page.name + (returnPages.contains(toPages) ? " (return)" : "") + "\n");
+ }
+ return sb.toString();
+ }
+
+ public void addFromPage(DiagramNode page) {
+ fromPages.add(page);
+ }
+
+ public void addToPage(DiagramNode page, boolean returnPage) {
+ toPages.add(page);
+ if (returnPage) returnPages.add(page);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @return Returns the fromPages.
+ */
+ public ArrayList<DiagramNode> getFromPages() {
+ return fromPages;
+ }
+
+ /**
+ * @return Returns the toPages.
+ */
+ public ArrayList<DiagramNode> getToPages() {
+ return toPages;
+ }
+
+ public boolean isReturnPage(DiagramNode page) {
+ return returnPages.contains(page);
+ }
+
+ /**
+ * @return Returns the defaultToPage.
+ */
+ public DiagramNode getDefaultToPage() {
+ return defaultToPage;
+ }
+
+ /**
+ * @param defaultToPage The defaultToPage to set.
+ */
+ public void setDefaultToPage(DiagramNode defaultToPage) {
+ this.defaultToPage = defaultToPage;
+ }
+
+ /**
+ * @param id The id to set.
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * @return the returnPages
+ */
+ public ArrayList<DiagramNode> getReturnPages() {
+ return returnPages;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/LoadAIsAndTeamsAction.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/LoadAIsAndTeamsAction.java
new file mode 100644
index 00000000000..38438793b2d
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/LoadAIsAndTeamsAction.java
@@ -0,0 +1,366 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact.TeamDefinitionOptions;
+import org.eclipse.osee.ats.config.AtsConfig;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.workflow.vue.DiagramNode.PageType;
+import org.eclipse.osee.framework.core.data.OseeUser;
+import org.eclipse.osee.framework.db.connection.exception.ArtifactDoesNotExist;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.db.connection.exception.UserNotInDatabase;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.UserManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
+import org.eclipse.osee.framework.skynet.core.artifact.StaticIdQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlowDefinition;
+import org.eclipse.swt.widgets.Display;
+import org.osgi.framework.Bundle;
+
+/**
+ * Retrieve "AIs and Teams.vue" extension points and configure ATS for Actionable Items and Teams from within.
+ */
+public class LoadAIsAndTeamsAction {
+
+ private static final String FULL_NAME = "Full Name:";
+ private static final String DESCRIPTION = "Description:";
+ private static final String WORKFLOW_ID = "WorkflowId:";
+ private static final String STATIC_ID = "StaticId:";
+ private static final String GET_OR_CREATE = "GetOrCreate";
+ private static final String NOT_ACTIONABLE = "NotActionable";
+ private static final String LEAD = "Lead:";
+ private static final String MEMBER = "Member:";
+
+ private final Map<String, ActionableItemArtifact> idToActionItem;
+ private final String bundleId;
+ private final boolean prompt;
+ private final boolean allowUserCreation;
+
+ private LoadAIsAndTeamsAction(boolean prompt, String bundleId, boolean allowUserCreation) {
+ this.idToActionItem = new HashMap<String, ActionableItemArtifact>();
+ this.prompt = prompt;
+ this.bundleId = bundleId;
+ this.allowUserCreation = allowUserCreation;
+ }
+
+ /**
+ * This method is package private to prevent others from using it - only AtsDbConfig children are allowed access;
+ *
+ * @param bundleId
+ */
+ static void executeForDbConfig(String bundleId) {
+ new LoadAIsAndTeamsAction(false, bundleId, true).run();
+ }
+
+ public static void executeForAtsRuntimeConfig(boolean prompt, String bundleId) throws OseeCoreException {
+ new LoadAIsAndTeamsAction(false, bundleId, !AtsPlugin.isProductionDb()).run();
+ }
+
+ private void run() {
+ if (prompt && !MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Import ATS Config?",
+ "Importing ATS Config from ActionableItems.vue.\n\nAre you sure?")) return;
+
+ for (Entry<String, String> entry : loadResources().entrySet()) {
+ Diagram workFlow = DiagramFactory.getInstance().getWorkFlowFromFileContents(entry.getKey(), entry.getValue());
+ processWorkflow(workFlow);
+ }
+ }
+
+ private Map<String, String> loadResources() {
+ Map<String, String> resources = new HashMap<String, String>();
+ IExtensionPoint point =
+ Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsAIandTeamConfig");
+ if (point == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't access AtsAIandTeamConfig extension point", true);
+ return resources;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String vueFilename = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsAIandTeamConfig")) {
+ vueFilename = el.getAttribute("vueFilename");
+ bundleName = el.getContributor().getName();
+ if (bundleId == null || bundleId.equals(bundleName)) {
+ if (vueFilename != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ URL url = bundle.getEntry(vueFilename);
+ resources.put(bundleName + "/" + vueFilename, Lib.inputStreamToString(url.openStream()));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsStateItem extension", ex, true);
+ }
+ }
+ }
+ }
+ }
+ }
+ return resources;
+ }
+
+ private void processWorkflow(final Diagram workFlow) {
+ if (workFlow == null) throw new IllegalArgumentException("ATS config items can't be loaded.");
+
+ try {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ // Get or create ATS root artifact
+ Artifact atsHeading = AtsConfig.getInstance().getOrCreateAtsHeadingArtifact(transaction);
+
+ // Create Actionable Items
+ DiagramNode workPage = workFlow.getPage("Actionable Items");
+ addActionableItem(atsHeading, workPage, transaction);
+
+ // Create Teams
+ workPage = workFlow.getPage("Teams");
+ addTeam(atsHeading, workPage, transaction);
+
+ atsHeading.persistAttributesAndRelations(transaction);
+ transaction.execute();
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ private User getUserByName(String name, boolean create, SkynetTransaction transaction) throws OseeCoreException {
+ try {
+ return UserManager.getUserByName(name);
+ } catch (UserNotInDatabase ex) {
+ if (create) {
+ return UserManager.createUser(new OseeUser(name, name, "", true), transaction);
+ } else {
+ throw ex;
+ }
+ }
+ }
+
+ private TeamDefinitionArtifact addTeam(Artifact parent, DiagramNode page, SkynetTransaction transaction) throws OseeCoreException {
+ // System.out.println("Adding Team " + page.getName());
+ TeamDefinitionArtifact teamDefArt = null;
+ if (page.getName().equals(AtsConfig.TEAMS_HEADING)) {
+ teamDefArt = AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact(transaction);
+ } else {
+
+ ArrayList<User> leads = new ArrayList<User>();
+ ArrayList<User> members = new ArrayList<User>();
+ java.util.Set<String> staticIds = new HashSet<String>();
+ String desc = "";
+ boolean getOrCreate = false;
+ boolean actionable = true;
+ String fullName = "";
+ String workflowId = "";
+ List<TeamDefinitionOptions> teamDefinitionOptions = new ArrayList<TeamDefinitionOptions>();
+ for (String line : page.getInstructionStr().replaceAll("\r", "\n").split("\n")) {
+ if (!line.equals("")) {
+ if (line.startsWith(DESCRIPTION))
+ desc = line.replaceFirst(DESCRIPTION, "");
+ else if (line.startsWith(WORKFLOW_ID)) {
+ workflowId = line.replaceFirst(WORKFLOW_ID, "");
+ } else if (line.startsWith(STATIC_ID)) {
+ staticIds.add(line.replaceFirst(STATIC_ID, ""));
+ } else if (line.startsWith(GET_OR_CREATE))
+ getOrCreate = true;
+ else if (line.startsWith(NOT_ACTIONABLE))
+ actionable = false;
+ else if (line.startsWith(FULL_NAME))
+ fullName = line.replaceFirst(FULL_NAME, "");
+ else if (line.contains(TeamDefinitionOptions.TeamUsesVersions.name()))
+ teamDefinitionOptions.add(TeamDefinitionOptions.TeamUsesVersions);
+ else if (line.contains(TeamDefinitionOptions.RequireTargetedVersion.name()))
+ teamDefinitionOptions.add(TeamDefinitionOptions.RequireTargetedVersion);
+ else if (line.startsWith(LEAD)) {
+ String name = line.replaceFirst(LEAD, "");
+ User u = getUserByName(name, allowUserCreation, transaction);
+ leads.add(u);
+ } else if (line.startsWith(MEMBER)) {
+ String name = line.replaceFirst(MEMBER, "");
+ User u = getUserByName(name, allowUserCreation, transaction);
+ members.add(u);
+ } else
+ throw new IllegalArgumentException(
+ "Unhandled AtsConfig Line\"" + line + "\" in diagram page \"" + page.getName() + "\"");
+ }
+ }
+
+ ArrayList<ActionableItemArtifact> actionableItems = new ArrayList<ActionableItemArtifact>();
+ for (DiagramNode childPage : page.getToPages()) {
+ if (childPage.getPageType() == PageType.ActionableItem) {
+ // Relate this Team Definition to the Actionable Item
+ ActionableItemArtifact actItem = idToActionItem.get(childPage.getId());
+ if (actItem != null) {
+ actionableItems.add(actItem);
+ } else
+ throw new IllegalArgumentException(
+ "Can't retrieve Actionable Item \"" + childPage.getName() + "\" with id " + childPage.getId());
+ }
+ }
+
+ if (getOrCreate) {
+ teamDefArt =
+ (TeamDefinitionArtifact) Artifacts.getOrCreateArtifact(AtsPlugin.getAtsBranch(),
+ TeamDefinitionArtifact.ARTIFACT_NAME, page.getName());
+ } else {
+ teamDefArt =
+ (TeamDefinitionArtifact) ArtifactTypeManager.addArtifact(TeamDefinitionArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch(), page.getName());
+ }
+ if (!teamDefArt.isInDb()) {
+ teamDefArt.initialize(fullName, desc, leads, members, actionableItems,
+ teamDefinitionOptions.toArray(new TeamDefinitionOptions[teamDefinitionOptions.size()]));
+ if (parent == null) {
+ // Relate to team heading
+ parent = AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact(transaction);
+ }
+ parent.addChild(teamDefArt);
+
+ for (Artifact actionableItem : actionableItems) {
+ teamDefArt.addRelation(AtsRelation.TeamActionableItem_ActionableItem, actionableItem);
+ }
+ for (String staticId : staticIds) {
+ teamDefArt.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, staticId);
+ }
+ teamDefArt.setSoleAttributeValue(ATSAttributes.ACTIONABLE_ATTRIBUTE.getStoreName(), actionable);
+ }
+ if (!workflowId.equals("")) {
+ try {
+ Artifact workflowArt =
+ ArtifactQuery.getArtifactFromTypeAndName(WorkFlowDefinition.ARTIFACT_NAME, workflowId,
+ AtsPlugin.getAtsBranch());
+ if (workflowArt != null)
+ teamDefArt.addRelation(AtsRelation.WorkItem__Child, workflowArt);
+ else
+ System.err.println("Can't find workflow with id \"" + workflowId + "\"");
+ } catch (Exception ex) {
+ System.err.println(ex.getLocalizedMessage());
+ }
+ }
+ teamDefArt.persistAttributesAndRelations(transaction);
+ }
+
+ // Handle all team children
+ for (DiagramNode childPage : page.getToPages()) {
+ if (childPage.getPageType() == PageType.Team) {
+ addTeam(teamDefArt, (DiagramNode) childPage, transaction);
+ }
+ }
+ return teamDefArt;
+ }
+
+ private ActionableItemArtifact addActionableItem(Artifact parent, DiagramNode page, SkynetTransaction transaction) throws OseeCoreException {
+ // System.out.println("Processing page " + page.getName());
+ ActionableItemArtifact aia = null;
+ boolean getOrCreate = false;
+ boolean actionable = true;
+ Set<String> staticIds = new HashSet<String>();
+ Set<User> leads = new HashSet<User>();
+ for (String line : page.getInstructionStr().replaceAll("\r", "\n").split("\n")) {
+ if (!line.equals("")) {
+ if (line.startsWith(GET_OR_CREATE))
+ getOrCreate = true;
+ else if (line.startsWith(NOT_ACTIONABLE))
+ actionable = false;
+ else if (line.startsWith(LEAD)) {
+ String name = line.replaceFirst(LEAD, "");
+ User u = getUserByName(name, allowUserCreation, transaction);
+ leads.add(u);
+ } else if (line.startsWith(STATIC_ID)) staticIds.add(line.replaceFirst(STATIC_ID, ""));
+ }
+ }
+ if (page.getName().equals(AtsConfig.ACTIONABLE_ITEMS_HEADING)) {
+ aia = AtsConfig.getInstance().getOrCreateActionableItemsHeadingArtifact(transaction);
+ } else {
+ if (getOrCreate) {
+ try {
+ aia =
+ (ActionableItemArtifact) ArtifactQuery.getArtifactFromTypeAndName(
+ ActionableItemArtifact.ARTIFACT_NAME, page.getName(), AtsPlugin.getAtsBranch());
+ } catch (ArtifactDoesNotExist ex) {
+ // do nothing; will be created below
+ }
+ }
+ if (aia == null) {
+ aia =
+ (ActionableItemArtifact) ArtifactTypeManager.addArtifact(ActionableItemArtifact.ARTIFACT_NAME,
+ AtsPlugin.getAtsBranch());
+ aia.setDescriptiveName(page.getName());
+ for (String staticId : staticIds) {
+ aia.addAttribute(StaticIdQuery.STATIC_ID_ATTRIBUTE, staticId);
+ }
+ for (User user : leads) {
+ aia.addRelation(AtsRelation.TeamLead_Lead, user);
+ }
+
+ aia.persistAttributes(transaction);
+ idToActionItem.put(page.getId(), aia);
+ parent.addChild(aia);
+ parent.persistAttributesAndRelations(transaction);
+ }
+ }
+ for (DiagramNode childPage : page.getToPages()) {
+ addActionableItem(aia, (DiagramNode) childPage, transaction);
+ }
+ aia.setSoleAttributeValue(ATSAttributes.ACTIONABLE_ATTRIBUTE.getStoreName(), actionable);
+
+ aia.persistAttributes(transaction);
+ return aia;
+ }
+
+ // /**
+ // * Selection in the workbench has been changed. We can change the state of the 'real' action here if we want, but
+ // * this can only happen after the delegate has been created.
+ // */
+ // public void selectionChanged(IAction action, ISelection selection) {
+ // }
+ //
+ // /**
+ // * We can use this method to dispose of any system resources we previously allocated.
+ // *
+ // * @see IWorkbenchWindowActionDelegate#dispose
+ // */
+ // public void dispose() {
+ // }
+ //
+ // /**
+ // * We will cache window object in order to be able to provide parent shell for the message dialog.
+ // *
+ // * @see IWorkbenchWindowActionDelegate#init
+ // */
+ // public void init(IWorkbenchWindow window) {
+ // }
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueDiagram.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueDiagram.java
new file mode 100644
index 00000000000..b5bb6739300
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueDiagram.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueDiagram {
+
+ private ArrayList<VueLink> links = new ArrayList<VueLink>();
+ private ArrayList<VueNode> vuePages = new ArrayList<VueNode>();
+ private Diagram workflow;
+ private static Pattern childPattern =
+ Pattern.compile("<child(.*?)>(.*?)</child>", Pattern.DOTALL | Pattern.MULTILINE);
+
+ /**
+ * @param vueXml
+ */
+ public VueDiagram(String workflowId, String vueXml) {
+ workflow = new Diagram(workflowId);
+ processXml(vueXml);
+ }
+
+ private void processXml(String xml) {
+ Matcher m = childPattern.matcher(xml);
+ while (m.find()) {
+ String childParms = m.group(1);
+ String matchStr = m.group();
+ // System.out.println("Processing child "+childParms);
+ if (childParms.contains("xsi:type=\"group\"")) {
+ throw new IllegalArgumentException("Can't use grouping in diagram");
+ } else if (childParms.contains("xsi:type=\"link\"")) {
+ VueLink link = new VueLink(matchStr);
+ links.add(link);
+ } else if (childParms.contains("xsi:type=\"node\"")) {
+ VueNode vuePage = new VueNode(matchStr);
+ vuePages.add(vuePage);
+ workflow.addPage(vuePage.getWorkPage());
+ } else
+ throw new IllegalArgumentException("Unhandled xsi:type");
+ }
+ for (VueLink link : links) {
+ VueNode fromVuePage = getPageFromVueId(link.getFromVueId());
+ if (fromVuePage == null) throw new IllegalArgumentException("Can't retrieve from page");
+ VueNode toVuePage = getPageFromVueId(link.getToVueId());
+ if (toVuePage == null) throw new IllegalArgumentException(
+ "Can't retrieve to page " + link.getToVueId() + " from page " + link.getFromVueId() + " named \"" + fromVuePage.getWorkPage().getName() + "\"");
+ fromVuePage.getWorkPage().addToPage(toVuePage.getWorkPage(), link.getName().equals("return"));
+ toVuePage.getWorkPage().addFromPage(fromVuePage.getWorkPage());
+ if (link.isMultiDirectional()) {
+ toVuePage.getWorkPage().addToPage(fromVuePage.getWorkPage(), link.getName().equals("return"));
+ fromVuePage.getWorkPage().addFromPage(toVuePage.getWorkPage());
+ }
+ if (link.getName().equals("default")) {
+ if (fromVuePage.getWorkPage().getDefaultToPage() == null)
+ fromVuePage.getWorkPage().setDefaultToPage(toVuePage.getWorkPage());
+ else
+ throw new IllegalArgumentException(
+ "Can't have 2 default transitions. Page " + fromVuePage.getWorkPage().getName());
+ }
+ }
+ }
+
+ public VueNode getPageFromVueId(String vueId) {
+ for (VueNode page : vuePages)
+ if (page.getVueId().equals(vueId)) return page;
+ return null;
+ }
+
+ /**
+ * @return Returns the workflow.
+ */
+ public Diagram getWorkflow() {
+ return workflow;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueLink.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueLink.java
new file mode 100644
index 00000000000..dcbe7499e11
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueLink.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueLink {
+
+ private final String xml;
+ private String name;
+ private String vueId;
+ private boolean multiDirectional = false;
+ private String fromVueId;
+ private String toVueId;
+
+ /**
+ *
+ */
+ public VueLink(String xml) {
+ super();
+ this.xml = xml;
+ Matcher m =
+ Pattern.compile("<ID1>(.*?)</ID1>.*?<ID2>(.*?)</ID2>", Pattern.DOTALL | Pattern.MULTILINE).matcher(xml);
+ while (m.find()) {
+ if (xml.contains("arrowState=\"2\"")) {
+ fromVueId = m.group(1);
+ toVueId = m.group(2);
+ } else if (xml.contains("arrowState=\"1\"")) {
+ toVueId = m.group(1);
+ fromVueId = m.group(2);
+ } else if (xml.contains("arrowState=\"3\"")) {
+ fromVueId = m.group(1);
+ toVueId = m.group(2);
+ multiDirectional = true;
+ } else if (xml.contains("arrowState=\"0\"")) throw new IllegalArgumentException(
+ "Non-directional links not supported. id = " + getVueId());
+ }
+ }
+
+ public String getVueId() {
+ if (vueId == null) {
+ Matcher m = Pattern.compile("<child.*? ID=\"(.*?)\" ").matcher(xml);
+ if (m.find())
+ vueId = m.group(1);
+ else {
+ vueId = "Unknown";
+ }
+ }
+ return vueId;
+ }
+
+ public String getName() {
+ if (name == null) {
+ Matcher m = Pattern.compile("<child.*? label=\"(.*?)\" ").matcher(xml);
+ if (m.find())
+ name = m.group(1);
+ else {
+ name = "Unknown";
+ }
+ }
+ return name;
+ }
+
+ /**
+ * @return Returns the fromId.
+ */
+ public String getFromVueId() {
+ return fromVueId;
+ }
+
+ /**
+ * @return Returns the toId.
+ */
+ public String getToVueId() {
+ return toVueId;
+ }
+
+ /**
+ * @return Returns the multiDirectional.
+ */
+ public boolean isMultiDirectional() {
+ return multiDirectional;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueNode.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueNode.java
new file mode 100644
index 00000000000..a6d826e1501
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/vue/VueNode.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.workflow.vue;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.workflow.ATSXWidgetOptionResolver;
+import org.eclipse.osee.ats.workflow.vue.DiagramNode.PageType;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueNode {
+
+ private final String vueXml;
+ private String vueId;
+ private DiagramNode workPage;
+ public static enum Shape {
+ ellipse, rectangle, hexagon;
+ public static Shape getShape(String shape) {
+ for (Shape s : Shape.values()) {
+ if (s.name().equals(shape)) return s;
+ }
+ return null;
+ }
+ };
+ private Shape shape;
+
+ public String toString() {
+ return workPage.getPageType() + ": " + workPage.getName();
+ }
+
+ /**
+ * @return Returns the workPage.
+ */
+ public DiagramNode getWorkPage() {
+ return workPage;
+ }
+
+ /**
+ *
+ */
+ public VueNode(String vueXml) {
+ super();
+ this.vueXml = vueXml;
+ workPage = new DiagramNode(ATSXWidgetOptionResolver.getInstance());
+ processVueXml(vueXml);
+ }
+
+ public void processVueXml(String xml) {
+ String noteXml = AXml.getTagData(xml, "notes");
+ noteXml = noteXml.replaceAll("%nl;", "\r");
+ noteXml = noteXml.replaceAll("%sp;", " ");
+ workPage.setInstructionStr(noteXml);
+ getDetails();
+ if (getShape() == VueNode.Shape.ellipse)
+ workPage.setPageType(PageType.Team);
+ else if (getShape() == VueNode.Shape.rectangle) workPage.setPageType(PageType.ActionableItem);
+ }
+
+ public void getDetails() {
+ Matcher m = Pattern.compile("<child.*? label=\"(.*?)\" ").matcher(vueXml);
+ if (m.find())
+ workPage.setName(m.group(1));
+ else
+ workPage.setName("Unknown");
+
+ m = Pattern.compile("<shape xsi:type=\"(.*?)\"").matcher(vueXml);
+ if (m.find())
+ shape = Shape.getShape(m.group(1));
+ else
+ throw new IllegalArgumentException("Can't determine shape name");
+ m = Pattern.compile("<child.*? ID=\"(.*?)\" ").matcher(vueXml);
+ if (m.find())
+ vueId = m.group(1);
+ else
+ vueId = "Unknown";
+ }
+
+ /**
+ * @return Returns the shape.
+ */
+ public Shape getShape() {
+ return shape;
+ }
+
+ /**
+ * @return Returns the vueObjId.
+ */
+ public String getVueId() {
+ return vueId;
+ }
+
+ /**
+ * @param vueObjId The vueObjId to set.
+ */
+ public void setVueId(String vueObjId) {
+ this.vueId = vueObjId;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsMetricsComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsMetricsComposite.java
new file mode 100644
index 00000000000..83eb108727f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsMetricsComposite.java
@@ -0,0 +1,310 @@
+/*
+ * Created on Nov 2, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.util.SMAMetrics;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.xbargraph.XBarGraphLine;
+import org.eclipse.osee.framework.ui.skynet.widgets.xbargraph.XBarGraphLineSegment;
+import org.eclipse.osee.framework.ui.skynet.widgets.xbargraph.XBarGraphTable;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsMetricsComposite extends ScrolledComposite {
+
+ private Composite toolBarComposite;
+ private Composite metricsComposite;
+ private final IAtsMetricsProvider iAtsMetricsProvider;
+ private final Color BACKGROUND_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_WHITE);
+ private final Color FOREGROUND_COLOR = Display.getCurrent().getSystemColor(SWT.COLOR_BLUE);
+ private final Composite mainComp;
+ private boolean refreshedOnce = true;
+
+ /**
+ * @param iAtsMetricsProvider
+ * @param parent
+ * @param style
+ */
+ public AtsMetricsComposite(IAtsMetricsProvider iAtsMetricsProvider, Composite parent, int style) {
+ super(parent, style | SWT.V_SCROLL | SWT.H_SCROLL);
+ this.iAtsMetricsProvider = iAtsMetricsProvider;
+
+ setLayout(new GridLayout(1, true));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ mainComp = new Composite(this, SWT.NONE);
+ mainComp.setLayout(new GridLayout());
+ mainComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ adapt(mainComp);
+
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(mainComp)) {
+ return;
+ }
+
+ adapt(this);
+ creatToolBar(mainComp);
+
+ setContent(mainComp);
+ setExpandHorizontal(true);
+ setExpandVertical(true);
+ layout();
+ }
+
+ private void creatToolBar(Composite composite) {
+ toolBarComposite = new Composite(composite, SWT.NONE);
+ toolBarComposite.setLayoutData(new GridData(SWT.NONE, SWT.NONE, true, false, 1, 1));
+ toolBarComposite.setLayout(new GridLayout(2, false));
+ adapt(toolBarComposite);
+
+ Button refresh = new Button(toolBarComposite, SWT.PUSH);
+ refresh.setText("Display/Refresh Metrics");
+ refresh.setToolTipText("Recalculate and Update Metrics");
+ refresh.addSelectionListener(new SelectionAdapter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ handleUpdateMetrics();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ adapt(refresh);
+
+ if (!refreshedOnce) {
+ Label label = new Label(toolBarComposite, SWT.NONE);
+ label.setText(" Last Updated: " + XDate.getDateNow(XDate.MMDDYYHHMM));
+ adapt(label);
+ }
+
+ }
+
+ public void handleUpdateMetrics() throws OseeCoreException {
+ refreshedOnce = false;
+ if (metricsComposite != null) {
+ metricsComposite.dispose();
+ }
+ metricsComposite = new Composite(mainComp, SWT.NONE);
+ metricsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ metricsComposite.setLayout(ALayout.getZeroMarginLayout(1, true));
+ adapt(metricsComposite);
+
+ addSpace();
+ SMAMetrics sMet =
+ new SMAMetrics(iAtsMetricsProvider.getMetricsArtifacts(), iAtsMetricsProvider.getMetricsVersionArtifact());
+ createOverviewChart(sMet, metricsComposite);
+ addSpace();
+ createCompletedByAssigneesChart(sMet, metricsComposite);
+ addSpace();
+ createHoursRemainingByAssigneesChart(sMet, metricsComposite);
+
+ mainComp.layout();
+ computeScrollSize();
+ }
+
+ public void computeScrollSize() {
+ this.computeScrollSize(mainComp);
+ }
+
+ private void computeScrollSize(Composite viewableArea) {
+ this.setMinSize(viewableArea.computeSize(SWT.DEFAULT, SWT.DEFAULT));
+ }
+
+ private void addSpace() {
+ Label label = new Label(metricsComposite, SWT.NONE);
+ label.setText(" ");
+ adapt(label);
+ }
+
+ public void createOverviewChart(SMAMetrics sMet, Composite parent) throws OseeCoreException {
+ List<XBarGraphLine> lines = new ArrayList<XBarGraphLine>();
+
+ List<XBarGraphLineSegment> segments = new ArrayList<XBarGraphLineSegment>();
+ int totalObjects = sMet.getNumActions() + sMet.getNumTeamWfs() + sMet.getNumTasks() + sMet.getNumReviews();
+ if (sMet.getNumActions() > 0) {
+ double percent = new Double(sMet.getNumActions()) / totalObjects * 100;
+ segments.add(new XBarGraphLineSegment("Actions", SWT.COLOR_DARK_YELLOW, Math.round(percent)));
+ }
+ if (sMet.getNumTeamWfs() > 0) {
+ double percent = new Double(sMet.getNumTeamWfs()) / totalObjects * 100;
+ segments.add(new XBarGraphLineSegment("Workflows", SWT.COLOR_GREEN, Math.round(percent)));
+ }
+ if (sMet.getNumTasks() > 0) {
+ double percent = new Double(sMet.getNumTasks()) / totalObjects * 100;
+ segments.add(new XBarGraphLineSegment("Tasks", SWT.COLOR_CYAN, Math.round(percent)));
+ }
+ if (sMet.getNumReviews() > 0) {
+ double percent = new Double(sMet.getNumReviews()) / totalObjects * 100;
+ segments.add(new XBarGraphLineSegment("Reviews", SWT.COLOR_MAGENTA, Math.round(percent)));
+ }
+ lines.add(new XBarGraphLine(sMet.toStringObjectBreakout(), segments));
+
+ lines.add(XBarGraphLine.getPercentLine(
+ "By Team Percents (" + sMet.getCummulativeTeamPercentComplete() + "/" + sMet.getNumTeamWfs() + ")",
+ (int) sMet.getPercentCompleteByTeamPercents()));
+ lines.add(XBarGraphLine.getPercentLine(
+ "By Team Workflow (" + sMet.getCompletedTeamWorkflows().size() + "/" + sMet.getNumTeamWfs() + ")",
+ (int) sMet.getPercentCompleteByTeamWorkflow()));
+ lines.add(XBarGraphLine.getPercentLine(
+ "By Task Percents (" + sMet.getCummulativeTaskPercentComplete() + "/" + sMet.getNumTasks() + ")",
+ (int) sMet.getPercentCompleteByTaskPercents()));
+ lines.add(XBarGraphLine.getPercentLine(
+ "By Task (" + sMet.getCompletedTaskWorkflows().size() + "/" + sMet.getNumTasks() + ")",
+ (int) sMet.getPercentCompleteByTaskWorkflow()));
+
+ lines.add(XBarGraphLine.getTextLine("Estimated Hours: ", String.format("%5.2f", sMet.getEstHours())));
+ lines.add(XBarGraphLine.getTextLine("Remaining Hours: ", String.format("%5.2f", sMet.getHrsRemain())));
+ lines.add(XBarGraphLine.getTextLine("Hours Spent: ", String.format("%5.2f", sMet.getHrsSpent())));
+ lines.add(XBarGraphLine.getTextLine("Man Days Needed: ", String.format("%5.2f", sMet.getManDaysNeeded())));
+
+ try {
+ if (iAtsMetricsProvider.getMetricsVersionArtifact() != null) {
+ lines.add(new XBarGraphLine("Targeted Version", 0,
+ iAtsMetricsProvider.getMetricsVersionArtifact().toString()));
+ lines.add(new XBarGraphLine("Estimated Release Date", 0,
+ iAtsMetricsProvider.getMetricsVersionArtifact().getSoleAttributeValueAsString(
+ ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(), "Not Set")));
+ double hoursTillRelease = sMet.getHoursTillRel();
+ double hoursRemaining = sMet.getHrsRemain();
+ int percent = 0;
+ if (hoursTillRelease != 0) {
+ percent = (int) (hoursRemaining / hoursTillRelease);
+ }
+ if (sMet.getEstRelDate() == null) {
+ lines.add(new XBarGraphLine("Release Effort Remaining", 0, "Estimated Release Date Not Set"));
+ } else if (percent == 0 || hoursRemaining > hoursTillRelease) {
+ lines.add(new XBarGraphLine("Release Effort Remaining", XBarGraphLine.DEFAULT_RED_FOREGROUND,
+ XBarGraphLine.DEFAULT_RED_BACKGROUND, 100, String.format(
+ "%5.2f hours exceeds remaining release hours %5.2f", hoursRemaining, hoursTillRelease)));
+ } else {
+ lines.add(new XBarGraphLine("Release Effort Remaining", XBarGraphLine.DEFAULT_GREEN_FOREGROUND,
+ XBarGraphLine.DEFAULT_GREEN_BACKGROUND, SWT.COLOR_WHITE, SWT.COLOR_WHITE, percent, String.format(
+ "%5.2f remaining work hours", hoursRemaining), String.format(
+ "%5.2f release remaining hours", hoursRemaining)));
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ XBarGraphTable table = new XBarGraphTable("Overview", "", "", lines);
+ table.setHeaderVisible(false);
+ table.setFillHorizontally(true);
+ table.createWidgets(parent, 1);
+ adapt(table);
+ }
+
+ public void createCompletedByAssigneesChart(SMAMetrics sMet, Composite parent) {
+ List<XBarGraphLine> lines = new ArrayList<XBarGraphLine>();
+ for (User user : sMet.getAssigneesAssignedOrCompleted()) {
+ int completed =
+ sMet.getUserToCompletedSmas().containsKey(user) ? sMet.getUserToCompletedSmas().getValues(user).size() : 0;
+ int inWork =
+ sMet.getUserToAssignedSmas().containsKey(user) ? sMet.getUserToAssignedSmas().getValues(user).size() : 0;
+ int total = completed + inWork;
+ int percentComplete = 0;
+ if (completed == total) {
+ percentComplete = 100;
+ } else if (completed != 0 && total != 0) {
+ double percent = new Double(completed) / total * 100.0;
+ percentComplete = (int) percent;
+ }
+ lines.add(XBarGraphLine.getPercentLine(user.getName() + " (" + completed + "/" + total + ")", percentComplete));
+ }
+ XBarGraphTable table =
+ new XBarGraphTable("Completed by Assignee per Assigned Workflow", "User", "Percent Complete", lines);
+ table.setFillHorizontally(true);
+ table.createWidgets(parent, 1);
+ adapt(table);
+ }
+
+ public void createHoursRemainingByAssigneesChart(SMAMetrics sMet, Composite parent) throws OseeCoreException {
+ List<XBarGraphLine> lines = new ArrayList<XBarGraphLine>();
+ Double versionHoursRemain = null;
+ if (iAtsMetricsProvider.getMetricsVersionArtifact() != null) {
+ versionHoursRemain = sMet.getHoursTillRel();
+ }
+ for (User user : sMet.getAssigneesAssignedOrCompleted()) {
+ try {
+ double userHoursRemain = 0;
+ for (TeamWorkFlowArtifact team : sMet.getTeamArts()) {
+ Collection<User> users = team.getSmaMgr().getStateMgr().getAssignees();
+ if (users.contains(user)) {
+ double hours = team.getRemainHoursTotal();
+ if (hours > 0) {
+ userHoursRemain += hours / users.size();
+ }
+ }
+ }
+ if (sMet.getEstRelDate() == null) {
+ lines.add(new XBarGraphLine(user.getName(), 0, "Estimated Release Date Not Set"));
+ } else if (versionHoursRemain == null) {
+ lines.add(new XBarGraphLine(user.getName(), (int) userHoursRemain, String.format("%5.2f",
+ userHoursRemain)));
+ } else {
+ lines.add(new XBarGraphLine(user.getName(), XBarGraphLine.DEFAULT_RED_FOREGROUND,
+ XBarGraphLine.DEFAULT_RED_BACKGROUND, (int) userHoursRemain, String.format(
+ "%5.2f - Exceeds release remaining hours %5.2f.", userHoursRemain, versionHoursRemain)));
+ }
+ } catch (OseeCoreException ex) {
+ lines.add(new XBarGraphLine(user.getName(), 0, "Exception: " + ex.getLocalizedMessage()));
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ XBarGraphTable table = new XBarGraphTable("Hours Remaining by Assignee", "User", "Hours Remaining", lines);
+ table.setFillHorizontally(true);
+ table.createWidgets(parent, 1);
+ adapt(table);
+ }
+
+ public void disposeComposite() {
+ }
+
+ public void adapt(XWidget xWidget) {
+ adapt(xWidget.getControl());
+ adapt(xWidget.getLabelWidget());
+ }
+
+ public void adapt(Control control) {
+ if (control == null) return;
+ control.setBackground(BACKGROUND_COLOR);
+ control.setForeground(FOREGROUND_COLOR);
+ }
+
+ public void adapt(Composite composite) {
+ composite.setBackground(BACKGROUND_COLOR);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java
new file mode 100644
index 00000000000..9de9d05342f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXWidgetActionFormPage.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+import org.eclipse.osee.framework.ui.skynet.XWidgetParser;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DefaultXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.swt.ALayout;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.SectionPart;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class AtsXWidgetActionFormPage extends FormPage {
+ protected DynamicXWidgetLayout dynamicXWidgetLayout;
+ protected final XFormToolkit toolkit;
+ private Composite parametersContainer;
+ private Section parameterSection;
+ protected Composite resultsContainer;
+ protected Section resultsSection;
+ protected ToolBar toolBar;
+ private Label warningLabel, searchNameLabel;
+
+ public AtsXWidgetActionFormPage(AbstractArtifactEditor editor, String id, String name) {
+ super(editor, id, name);
+ this.toolkit = editor.getToolkit();
+ }
+
+ public abstract String getXWidgetsXml() throws OseeCoreException;
+
+ @Override
+ protected void createFormContent(IManagedForm managedForm) {
+ fillBody(managedForm);
+ managedForm.refresh();
+ }
+
+ public void reflow() {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ getManagedForm().reflow(true);
+ }
+ });
+ }
+
+ private void fillBody(IManagedForm managedForm) {
+ ScrolledForm scrolledForm = managedForm.getForm();
+ Composite body = scrolledForm.getBody();
+ body.setLayout(ALayout.getZeroMarginLayout(1, true));
+ body.setLayoutData(new GridData(SWT.LEFT, SWT.LEFT, false, false));
+
+ toolBar = AtsLib.createCommonToolBar(body, toolkit);
+
+ Composite headerComp = new Composite(body, SWT.NONE);
+ headerComp.setLayout(new GridLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ headerComp.setLayoutData(gd);
+ toolkit.adapt(headerComp);
+
+ warningLabel = new Label(headerComp, SWT.NONE);
+ toolkit.adapt(warningLabel, true, true);
+ searchNameLabel = new Label(headerComp, SWT.NONE);
+ toolkit.adapt(searchNameLabel, true, true);
+
+ try {
+ if (getXWidgetsXml() != null && !getXWidgetsXml().equals("")) {
+ managedForm.addPart(new SectionPart(createParametersSection(body)));
+ }
+ managedForm.addPart(new SectionPart(createResultsSection(body)));
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ private Section createParametersSection(Composite body) {
+ parameterSection = toolkit.createSection(body, Section.NO_TITLE);
+ parameterSection.setText("Parameters");
+ parameterSection.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ parametersContainer = toolkit.createClientContainer(parameterSection, 1);
+ parameterSection.setExpanded(true);
+
+ Composite mainComp = toolkit.createComposite(parametersContainer, SWT.NONE);
+ mainComp.setLayout(ALayout.getZeroMarginLayout(2, false));
+ mainComp.setLayoutData(new GridData(SWT.NONE, SWT.FILL, false, true));
+
+ Button runButton = toolkit.createButton(mainComp, "Search", SWT.PUSH);
+ GridData gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
+ runButton.setLayoutData(gridData);
+ runButton.addSelectionListener(new SelectionAdapter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ handleSearchButtonPressed();
+ }
+ });
+
+ Composite paramComp = new Composite(mainComp, SWT.NONE);
+ paramComp.setLayout(ALayout.getZeroMarginLayout(1, false));
+ paramComp.setLayoutData(new GridData(SWT.NONE, SWT.FILL, false, true));
+
+ List<DynamicXWidgetLayoutData> layoutDatas = null;
+ dynamicXWidgetLayout = new DynamicXWidgetLayout(getDynamicWidgetLayoutListener(), getXWidgetOptionResolver());
+ try {
+ layoutDatas = XWidgetParser.extractWorkAttributes(dynamicXWidgetLayout, getXWidgetsXml());
+ if (layoutDatas != null && !layoutDatas.isEmpty()) {
+ dynamicXWidgetLayout.addWorkLayoutDatas(layoutDatas);
+ dynamicXWidgetLayout.createBody(toolkit, paramComp, null, null, true);
+ parametersContainer.layout();
+ parametersContainer.getParent().layout();
+ }
+ parameterSection.setExpanded(true);
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+
+ return parameterSection;
+ }
+
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener() {
+ return null;
+ }
+
+ public IXWidgetOptionResolver getXWidgetOptionResolver() {
+ return new DefaultXWidgetOptionResolver();
+ }
+
+ public abstract void handleSearchButtonPressed();
+
+ public void setTableTitle(final String title, final boolean warning) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (warning)
+ warningLabel.setImage(AtsPlugin.getInstance().getImage("warn.gif"));
+ else
+ warningLabel.setImage(null);
+ searchNameLabel.setText(title);
+ searchNameLabel.getParent().layout();
+ };
+ });
+ }
+
+ public String getCurrentTitleLabel() {
+ if (searchNameLabel != null) {
+ return searchNameLabel.getText();
+ } else
+ return WorldEditor.EDITOR_ID;
+ }
+
+ public abstract Section createResultsSection(Composite body) throws OseeCoreException;
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IAtsMetricsProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IAtsMetricsProvider.java
new file mode 100644
index 00000000000..e7ea533f4a6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IAtsMetricsProvider.java
@@ -0,0 +1,21 @@
+/*
+ * Created on Nov 5, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsMetricsProvider {
+
+ public Collection<? extends Artifact> getMetricsArtifacts() throws OseeCoreException;
+
+ public VersionArtifact getMetricsVersionArtifact() throws OseeCoreException;
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorParameterProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorParameterProvider.java
new file mode 100644
index 00000000000..e6b7fcc63ad
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorParameterProvider.java
@@ -0,0 +1,27 @@
+/*
+ * Created on Nov 18, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IWorldEditorParameterProvider extends IWorldEditorProvider {
+
+ public String getParameterXWidgetXml() throws OseeCoreException;
+
+ public Collection<? extends Artifact> performSearchGetResults(SearchType searchType) throws OseeCoreException;
+
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener();
+
+ public String[] getWidgetOptions(DynamicXWidgetLayoutData xWidgetData);
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorProvider.java
new file mode 100644
index 00000000000..1ab6371284e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldEditorProvider.java
@@ -0,0 +1,32 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IWorldEditorProvider {
+
+ public void run(WorldEditor worldEditor, SearchType searchType, boolean forcePend) throws OseeCoreException;
+
+ public String getSelectedName(SearchType searchType) throws OseeCoreException;
+
+ public String getName() throws OseeCoreException;
+
+ public VersionArtifact getTargetedVersionArtifact() throws OseeCoreException;
+
+ public IWorldEditorProvider copyProvider();
+
+ public void setCustomizeData(CustomizeData customizeData);
+
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions);
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java
new file mode 100644
index 00000000000..4654cecb62f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.Date;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+import org.eclipse.swt.graphics.Image;
+
+public interface IWorldViewArtifact {
+
+ public Image getAssigneeImage() throws OseeCoreException;
+
+ public String getWorldViewActionableItems() throws OseeCoreException;
+
+ public String getWorldViewActivePoc() throws OseeCoreException;
+
+ public double getWorldViewAnnualCostAvoidance() throws OseeCoreException;
+
+ public String getWorldViewBranchStatus() throws OseeCoreException;
+
+ public Date getWorldViewCancelledDate() throws OseeCoreException;
+
+ public String getWorldViewCancelledDateStr() throws OseeCoreException;
+
+ public String getWorldViewCategory() throws OseeCoreException;
+
+ public String getWorldViewCategory2() throws OseeCoreException;
+
+ public String getWorldViewCategory3() throws OseeCoreException;
+
+ public ChangeType getWorldViewChangeType() throws OseeCoreException;
+
+ public String getWorldViewChangeTypeStr() throws OseeCoreException;
+
+ public Date getWorldViewCompletedDate() throws OseeCoreException;
+
+ public String getWorldViewCompletedDateStr() throws OseeCoreException;
+
+ public Date getWorldViewCreatedDate() throws OseeCoreException;
+
+ public String getWorldViewCreatedDateStr() throws OseeCoreException;
+
+ public Date getWorldViewDeadlineDate() throws OseeCoreException;
+
+ public String getWorldViewDeadlineDateStr() throws OseeCoreException;
+
+ public String getWorldViewDecision() throws OseeCoreException;
+
+ public String getWorldViewDescription() throws OseeCoreException;
+
+ public double getWorldViewEstimatedHours() throws OseeCoreException;
+
+ public Date getWorldViewEstimatedReleaseDate() throws OseeCoreException;
+
+ public String getWorldViewEstimatedReleaseDateStr() throws OseeCoreException;
+
+ public Date getWorldViewEstimatedCompletionDate() throws OseeCoreException;
+
+ public String getWorldViewEstimatedCompletionDateStr() throws OseeCoreException;
+
+ public double getWorldViewHoursSpentState() throws OseeCoreException;
+
+ public double getWorldViewHoursSpentStateReview() throws OseeCoreException;
+
+ public double getWorldViewHoursSpentStateTask() throws OseeCoreException;
+
+ public double getWorldViewHoursSpentStateTotal() throws OseeCoreException;
+
+ public double getWorldViewHoursSpentTotal() throws OseeCoreException;
+
+ public String getWorldViewID() throws OseeCoreException;
+
+ public String getWorldViewImplementer() throws OseeCoreException;
+
+ public String getWorldViewLegacyPCR() throws OseeCoreException;
+
+ public String getWorldViewSWEnhancement() throws OseeCoreException;
+
+ public double getWorldViewManDaysNeeded() throws OseeCoreException;
+
+ public String getWorldViewNotes() throws OseeCoreException;
+
+ public String getWorldViewNumberOfTasks() throws OseeCoreException;
+
+ public String getWorldViewLastUpdated() throws OseeCoreException;
+
+ public String getWorldViewLastStatused() throws OseeCoreException;
+
+ public String getWorldViewOriginator() throws OseeCoreException;
+
+ public int getWorldViewPercentCompleteState() throws OseeCoreException;
+
+ public int getWorldViewPercentCompleteStateReview() throws OseeCoreException;
+
+ public int getWorldViewPercentCompleteStateTask() throws OseeCoreException;
+
+ public int getWorldViewPercentCompleteTotal() throws OseeCoreException;
+
+ public int getWorldViewPercentRework() throws OseeCoreException;
+
+ public String getWorldViewPercentReworkStr() throws OseeCoreException;
+
+ public String getWorldViewPriority() throws OseeCoreException;
+
+ public String getWorldViewRelatedToState() throws OseeCoreException;
+
+ public Date getWorldViewReleaseDate() throws OseeCoreException;
+
+ public String getWorldViewReleaseDateStr() throws OseeCoreException;
+
+ public double getWorldViewRemainHours() throws OseeCoreException;
+
+ public String getWorldViewResolution() throws OseeCoreException;
+
+ public String getWorldViewGroups() throws OseeCoreException;
+
+ public String getWorldViewReviewAuthor() throws OseeCoreException;
+
+ public String getWorldViewReviewDecider() throws OseeCoreException;
+
+ public String getWorldViewReviewModerator() throws OseeCoreException;
+
+ public String getWorldViewReviewReviewer() throws OseeCoreException;
+
+ public String getWorldViewState() throws OseeCoreException;
+
+ public String getWorldViewTeam() throws OseeCoreException;
+
+ public String getWorldViewTitle() throws OseeCoreException;
+
+ public String getWorldViewType() throws OseeCoreException;
+
+ public String getWorldViewUserCommunity() throws OseeCoreException;
+
+ public String getWorldViewValidationRequiredStr() throws OseeCoreException;
+
+ public String getWorldViewTargetedVersionStr() throws OseeCoreException;
+
+ public VersionArtifact getWorldViewTargetedVersion() throws OseeCoreException;
+
+ public double getWorldViewWeeklyBenefit() throws OseeCoreException;
+
+ public String getWorldViewWorkPackage() throws OseeCoreException;
+
+ public Result isWorldViewAnnualCostAvoidanceValid() throws OseeCoreException;
+
+ public Result isWorldViewDeadlineAlerting() throws OseeCoreException;
+
+ public Result isWorldViewManDaysNeededValid() throws OseeCoreException;
+
+ public Result isWorldViewRemainHoursValid() throws OseeCoreException;
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java
new file mode 100644
index 00000000000..21539ada4de
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.regex.Pattern;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+public class WorldCompletedFilter extends ViewerFilter {
+
+ Pattern p = Pattern.compile("(Completed|Cancelled)");
+
+ public WorldCompletedFilter() {
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ try {
+ Artifact art = (Artifact) element;
+ if (art instanceof IWorldViewArtifact) {
+ return !p.matcher(((IWorldViewArtifact) art).getWorldViewState()).find();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return true;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java
new file mode 100644
index 00000000000..9f6c44a7573
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldComposite.java
@@ -0,0 +1,654 @@
+/*
+ * Created on Nov 1, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewAction;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.SMAMetrics;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+import org.eclipse.osee.framework.ui.skynet.util.DbConnectionExceptionComposite;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldComposite extends ScrolledComposite implements IFrameworkTransactionEventListener {
+
+ private Action filterCompletedAction, releaseMetricsAction, selectionMetricsAction, toAction, toWorkFlow, toTask;
+ private Label extraInfoLabel;
+ private final WorldXViewer worldXViewer;
+ private final WorldCompletedFilter worldCompletedFilter = new WorldCompletedFilter();
+ private final Set<Artifact> worldArts = new HashSet<Artifact>(200);
+ private final Set<Artifact> otherArts = new HashSet<Artifact>(200);
+ private TableLoadOption[] tableLoadOptions;
+ private final ToolBar toolBar;
+ private final WorldEditor worldEditor;
+ private final Composite mainComp;
+
+ public WorldComposite(WorldEditor editor, Composite parent, int style, ToolBar toolBar) {
+ super(parent, style);
+ this.worldEditor = editor;
+ this.toolBar = toolBar;
+
+ setLayout(new GridLayout(1, true));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ mainComp = new Composite(this, SWT.NONE);
+ mainComp.setLayout(new GridLayout());
+ mainComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+ if (!DbConnectionExceptionComposite.dbConnectionIsOk(this)) {
+ extraInfoLabel = null;
+ worldXViewer = null;
+ return;
+ }
+
+ extraInfoLabel = new Label(mainComp, SWT.NONE);
+ extraInfoLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ worldXViewer = new WorldXViewer(mainComp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
+ worldXViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ worldXViewer.setContentProvider(new WorldContentProvider(worldXViewer));
+ worldXViewer.setLabelProvider(new WorldLabelProvider(worldXViewer));
+
+ Tree tree = worldXViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
+ gridData.heightHint = 500;
+ gridData.widthHint = 500;
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ worldXViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ worldXViewer.getTree().addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent event) {
+ }
+
+ public void keyReleased(KeyEvent event) {
+ // if CTRL key is already pressed
+ if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
+ if (event.keyCode == 'a') {
+ worldXViewer.getTree().setSelection(worldXViewer.getTree().getItems());
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ } else if (event.keyCode == 'z') {
+ releaseMetricsAction.setChecked(!releaseMetricsAction.isChecked());
+ releaseMetricsAction.run();
+ } else if (event.keyCode == 'x') {
+ selectionMetricsAction.setChecked(!selectionMetricsAction.isChecked());
+ selectionMetricsAction.run();
+ } else if (event.keyCode == 'f') {
+ filterCompletedAction.setChecked(!filterCompletedAction.isChecked());
+ filterCompletedAction.run();
+ }
+ }
+ }
+ });
+
+ new WorldViewDragAndDrop(this, WorldEditor.EDITOR_ID);
+
+ createActions();
+
+ setContent(mainComp);
+ setExpandHorizontal(true);
+ setExpandVertical(true);
+ layout();
+
+ OseeEventManager.addListener(this);
+ }
+
+ public void setCustomizeData(CustomizeData customizeData) {
+ worldXViewer.getCustomizeMgr().loadCustomization(customizeData);
+ }
+
+ public Control getControl() {
+ return worldXViewer.getControl();
+ }
+
+ public void load(final String name, final Collection<? extends Artifact> arts, TableLoadOption... tableLoadOption) {
+ load(name, arts, null, tableLoadOption);
+ }
+
+ public void load(final String name, final Collection<? extends Artifact> arts, final CustomizeData customizeData, TableLoadOption... tableLoadOption) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ worldArts.clear();
+ otherArts.clear();
+ for (Artifact art : arts) {
+ if (art instanceof IWorldViewArtifact)
+ worldArts.add(art);
+ else
+ otherArts.add(art);
+ }
+ worldXViewer.set(worldArts);
+ if (customizeData != null && !worldXViewer.getCustomizeMgr().generateCustDataFromTable().equals(
+ customizeData)) {
+ setCustomizeData(customizeData);
+ }
+ if (arts.size() == 0)
+ setTableTitle("No Results Found - " + name, true);
+ else
+ setTableTitle(name, false);
+ worldXViewer.refresh();
+ if (otherArts.size() > 0) {
+ if (MessageDialog.openConfirm(
+ Display.getCurrent().getActiveShell(),
+ "Open in Artifact Editor?",
+ otherArts.size() + " Non-WorldView Artifacts were returned from request.\n\nOpen in Artifact Editor?")) {
+ ArtifactEditor.editArtifacts(otherArts);
+ }
+ }
+ }
+ }, true);
+ // Need to reflow the managed page based on the results. Don't put this in the above thread.
+ worldEditor.getActionPage().reflow();
+ }
+
+ public class FilterLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ try {
+ return ((WorldSearchItem) arg0).getSelectedName(SearchType.Search);
+ } catch (OseeCoreException ex) {
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+ }
+
+ public class FilterContentProvider implements IStructuredContentProvider {
+ public Object[] getElements(Object arg0) {
+ return ((ArrayList<?>) arg0).toArray();
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
+ }
+ }
+
+ public void setTableTitle(final String title, final boolean warning) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ try {
+ worldEditor.setTableTitle(title, warning);
+ worldXViewer.setReportingTitle(title + " - " + XDate.getDateNow());
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ };
+ });
+ }
+
+ public void updateExtraInfoLine() throws OseeCoreException {
+ if (extraInfoLabel == null || extraInfoLabel.isDisposed()) return;
+ String str = "";
+ if (releaseMetricsAction.isChecked()) {
+ VersionArtifact verArt = null;
+ Set<StateMachineArtifact> smaArts = getXViewer().getSelectedSMAArtifacts();
+ if (smaArts.size() != 0) {
+ verArt = smaArts.iterator().next().getWorldViewTargetedVersion();
+ SMAMetrics sMet = new SMAMetrics(smaArts, verArt);
+ str = sMet.toString();
+ }
+ } else if (selectionMetricsAction.isChecked()) {
+ SMAMetrics sMet = new SMAMetrics(getXViewer().getSelectedSMAArtifacts(), null);
+ str = sMet.toString();
+ }
+
+ extraInfoLabel.setText(str);
+ extraInfoLabel.getParent().layout();
+ }
+
+ protected void createActions() {
+
+ Action newWorldEditor = new Action("Open New ATS World Editor") {
+
+ @Override
+ public void run() {
+ try {
+ IWorldEditorProvider provider =
+ ((WorldEditorInput) worldEditor.getEditorInput()).getIWorldEditorProvider().copyProvider();
+ provider.setCustomizeData(worldXViewer.getCustomizeMgr().generateCustDataFromTable());
+ provider.setTableLoadOptions(TableLoadOption.NoUI);
+ WorldEditor.open(provider);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ newWorldEditor.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("globe.gif"));
+ newWorldEditor.setToolTipText("Open in ATS World Editor");
+
+ Action newWorldEditorSelected = new Action("Open Selected in ATS World Editor") {
+
+ @Override
+ public void run() {
+
+ if (worldXViewer.getSelectedArtifacts().size() == 0) {
+ AWorkbench.popup("ERROR", "Select items to open");
+ return;
+ }
+ try {
+ WorldEditor.open(new WorldEditorSimpleProvider("ATS World", worldXViewer.getSelectedArtifacts(),
+ worldXViewer.getCustomizeMgr().generateCustDataFromTable(), tableLoadOptions));
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ newWorldEditorSelected.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("globeSelect.gif"));
+ newWorldEditorSelected.setToolTipText("Open Selected in ATS World Editor");
+
+ Action expandAllAction = new Action("Expand All") {
+
+ @Override
+ public void run() {
+ worldXViewer.expandAll();
+ }
+ };
+ expandAllAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("expandAll.gif"));
+ expandAllAction.setToolTipText("Expand All");
+
+ filterCompletedAction = new Action("Filter Out Completed/Cancelled - Ctrl-F", Action.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ if (filterCompletedAction.isChecked()) {
+ worldXViewer.addFilter(worldCompletedFilter);
+ } else {
+ worldXViewer.removeFilter(worldCompletedFilter);
+ }
+ updateExtendedStatusString();
+ worldXViewer.refresh();
+ }
+ };
+ filterCompletedAction.setToolTipText("Filter Out Completed/Cancelled - Ctrl-F");
+
+ Action refreshAction = new Action("Refresh") {
+
+ @Override
+ public void run() {
+ try {
+ worldEditor.reSearch();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ refreshAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("refresh.gif"));
+ refreshAction.setToolTipText("Refresh");
+
+ releaseMetricsAction = new Action("Show Release Metrics by Release Version - Ctrl-Z", Action.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ if (releaseMetricsAction.isChecked()) selectionMetricsAction.setChecked(false);
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+ releaseMetricsAction.setToolTipText("Show Release Metrics by Release Version - Ctrl-Z");
+
+ selectionMetricsAction = new Action("Show Release Metrics by Selection - Ctrl-X", Action.AS_CHECK_BOX) {
+
+ @Override
+ public void run() {
+ if (selectionMetricsAction.isChecked()) releaseMetricsAction.setChecked(false);
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ };
+ selectionMetricsAction.setToolTipText("Show Release Metrics by Selection - Ctrl-X");
+
+ toAction = new Action("Re-display as Actions", Action.AS_PUSH_BUTTON) {
+
+ @Override
+ public void run() {
+ redisplayAsAction();
+ }
+ };
+ toAction.setToolTipText("Re-display as Actions");
+
+ toWorkFlow = new Action("Re-display as WorkFlows", Action.AS_PUSH_BUTTON) {
+
+ @Override
+ public void run() {
+ redisplayAsWorkFlow();
+ }
+ };
+ toWorkFlow.setToolTipText("Re-display as WorkFlows");
+
+ toTask = new Action("Re-display as Tasks", Action.AS_PUSH_BUTTON) {
+
+ @Override
+ public void run() {
+ redisplayAsTask();
+ }
+ };
+ toTask.setToolTipText("Re-display as Tasks");
+
+ if (toolBar != null) {
+ actionToToolItem(toolBar, refreshAction);
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ actionToToolItem(toolBar, expandAllAction);
+ actionToToolItem(toolBar, worldXViewer.getCustomizeAction());
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ actionToToolItem(toolBar, newWorldEditor);
+ actionToToolItem(toolBar, newWorldEditorSelected);
+ new ToolItem(toolBar, SWT.SEPARATOR);
+ actionToToolItem(toolBar, new NewAction());
+
+ OseeAts.addButtonToEditorToolBar(worldEditor, AtsPlugin.getInstance(), toolBar, WorldEditor.EDITOR_ID,
+ "ATS World");
+ new ToolItem(toolBar, SWT.SEPARATOR);
+
+ createToolBarPulldown(toolBar, toolBar.getParent());
+ }
+ }
+
+ public void createToolBarPulldown(final ToolBar toolBar, Composite composite) {
+ final ToolItem dropDown = new ToolItem(toolBar, SWT.PUSH);
+ dropDown.setImage(AtsPlugin.getInstance().getImage("downTriangle.gif"));
+ final Menu menu = new Menu(composite);
+
+ dropDown.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(org.eclipse.swt.widgets.Event event) {
+ Rectangle rect = dropDown.getBounds();
+ Point pt = new Point(rect.x, rect.y + rect.height);
+ pt = toolBar.toDisplay(pt);
+ menu.setLocation(pt.x, pt.y);
+ menu.setVisible(true);
+ }
+ });
+
+ actionToMenuItem(menu, filterCompletedAction, SWT.CHECK);
+ new MenuItem(menu, SWT.SEPARATOR);
+ actionToMenuItem(menu, releaseMetricsAction, SWT.CHECK);
+ actionToMenuItem(menu, selectionMetricsAction, SWT.CHECK);
+ new MenuItem(menu, SWT.SEPARATOR);
+ actionToMenuItem(menu, toAction, SWT.PUSH);
+ actionToMenuItem(menu, toWorkFlow, SWT.PUSH);
+ actionToMenuItem(menu, toTask, SWT.PUSH);
+
+ }
+
+ private ToolItem actionToToolItem(ToolBar toolBar, Action action) {
+ final Action fAction = action;
+ ToolItem item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(action.getImageDescriptor().createImage());
+ item.setToolTipText(action.getToolTipText());
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ fAction.run();
+ }
+ });
+ return item;
+ }
+
+ private MenuItem actionToMenuItem(Menu menu, final Action action, final int buttonType) {
+ final Action fAction = action;
+ MenuItem item = new MenuItem(menu, buttonType);
+ item.setText(action.getText());
+ if (action.getImageDescriptor() != null) {
+ item.setImage(action.getImageDescriptor().createImage());
+ }
+ item.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (buttonType == SWT.CHECK) {
+ action.setChecked(!action.isChecked());
+ }
+ fAction.run();
+ }
+ });
+ return item;
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ return getXViewer().getLoadedArtifacts();
+ }
+
+ public void updateExtendedStatusString() {
+ worldXViewer.setExtendedStatusString(filterCompletedAction.isChecked() ? "[Complete/Cancel Filter]" : "");
+ }
+
+ public void redisplayAsAction() {
+ final ArrayList<Artifact> artifacts = worldXViewer.getLoadedArtifacts();
+ Job job = new Job("Re-display as Actions") {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final Set<Artifact> arts = new HashSet<Artifact>();
+ for (Artifact art : artifacts) {
+ if (art instanceof ActionArtifact) {
+ arts.add(art);
+ } else if (art instanceof StateMachineArtifact) {
+ Artifact parentArt = ((StateMachineArtifact) art).getParentActionArtifact();
+ if (parentArt != null) {
+ arts.add(parentArt);
+ }
+ }
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ load(worldEditor.getCurrentTitleLabel(), arts);
+ }
+ });
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job, true);
+ }
+
+ public void redisplayAsWorkFlow() {
+ final ArrayList<Artifact> artifacts = worldXViewer.getLoadedArtifacts();
+ Job job = new Job("Re-display as Workflows") {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final Set<Artifact> arts = new HashSet<Artifact>();
+ for (Artifact art : artifacts) {
+ if (art instanceof ActionArtifact) {
+ arts.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ } else if (art instanceof StateMachineArtifact) {
+ Artifact parentArt = ((StateMachineArtifact) art).getParentTeamWorkflow();
+ if (parentArt != null) {
+ arts.add(parentArt);
+ }
+ }
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ load(worldEditor.getCurrentTitleLabel(), arts);
+ }
+ });
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job, true);
+ }
+
+ public void redisplayAsTask() {
+ final ArrayList<Artifact> artifacts = worldXViewer.getLoadedArtifacts();
+ Job job = new Job("Re-display as Tasks") {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ final Set<Artifact> arts = new HashSet<Artifact>();
+ for (Artifact art : artifacts) {
+ if (art instanceof ActionArtifact) {
+ for (TeamWorkFlowArtifact team : ((ActionArtifact) art).getTeamWorkFlowArtifacts()) {
+ arts.addAll(team.getSmaMgr().getTaskMgr().getTaskArtifacts());
+ }
+ } else if (art instanceof StateMachineArtifact) {
+ arts.addAll(((StateMachineArtifact) art).getSmaMgr().getTaskMgr().getTaskArtifacts());
+ }
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ load(worldEditor.getCurrentTitleLabel(), arts);
+ }
+ });
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job, true);
+ }
+
+ public void disposeComposite() {
+ OseeEventManager.removeListener(this);
+ if (worldXViewer != null && !worldXViewer.getTree().isDisposed()) {
+ worldXViewer.dispose();
+ }
+ }
+
+ /**
+ * @return the xViewer
+ */
+ public WorldXViewer getXViewer() {
+ return worldXViewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.skynet.core.eventx.IFrameworkTransactionEventListener#handleFrameworkTransactionEvent(org.eclipse.osee.framework.ui.plugin.event.Sender.Source, org.eclipse.osee.framework.skynet.core.eventx.FrameworkTransactionData)
+ */
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.branchId == AtsPlugin.getAtsBranch().getBranchId()) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ updateExtraInfoLine();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ });
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
new file mode 100644
index 00000000000..ec9e00a520a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
@@ -0,0 +1,207 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.ActionDebug;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+
+public class WorldContentProvider implements ITreeContentProvider {
+
+ protected Collection<Artifact> rootSet = new HashSet<Artifact>();
+ private final WorldXViewer xViewer;
+ private static Object[] EMPTY_ARRAY = new Object[0];
+ private final ActionDebug debug = new ActionDebug(false, "WorldTreeContentProvider");
+
+ public WorldContentProvider(WorldXViewer WorldXViewer) {
+ super();
+ this.xViewer = WorldXViewer;
+ }
+
+ @Override
+ public String toString() {
+ return "WorldContentProvider";
+ }
+
+ public void add(final Artifact item) {
+ add(Arrays.asList(item));
+ }
+
+ public void add(final Collection<? extends Artifact> items) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ for (Artifact item : items) {
+ if (!rootSet.contains(item)) {
+ rootSet.add(item);
+ }
+ }
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void set(final Collection<? extends Artifact> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.clear();
+ add(arts);
+ };
+ });
+ }
+
+ public void remove(final Artifact art) {
+ remove(Arrays.asList(art));
+ }
+
+ public void remove(final Collection<? extends Object> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ for (Object art : arts) {
+ rootSet.remove(art);
+ }
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public void clear() {
+ rootSet.clear();
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) {
+ xViewer.setInput(rootSet);
+ }
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ debug.report("getChildren");
+ if (parentElement instanceof Collection) {
+ return ((Collection<?>) parentElement).toArray();
+ }
+ if (parentElement instanceof Artifact) {
+ try {
+ Artifact artifact = (Artifact) parentElement;
+ if (artifact == null) {
+ return new Object[] {};
+ }
+ if (artifact.isDeleted()) return new Object[] {};
+ if (artifact instanceof ActionArtifact) {
+ return ((ActionArtifact) artifact).getTeamWorkFlowArtifacts().toArray();
+ }
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) artifact;
+ List<Artifact> arts = new ArrayList<Artifact>();
+ // Convert artifacts to WorldArtifactItems
+ arts.addAll(teamArt.getSmaMgr().getReviewManager().getReviews());
+ arts.addAll(teamArt.getSmaMgr().getTaskMgr().getTaskArtifacts());
+ return arts.toArray();
+ }
+ if (artifact instanceof ReviewSMArtifact) {
+ ReviewSMArtifact reviewArt = (ReviewSMArtifact) artifact;
+ List<Artifact> arts = new ArrayList<Artifact>();
+ // Convert artifacts to WorldArtifactItems
+ arts.addAll(reviewArt.getSmaMgr().getReviewManager().getReviews());
+ arts.addAll(reviewArt.getSmaMgr().getTaskMgr().getTaskArtifacts());
+ return arts.toArray();
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ return EMPTY_ARRAY;
+ }
+
+ public Object getParent(Object element) {
+ debug.report("getParent");
+ if (element instanceof Artifact) {
+ try {
+ Artifact artifact = (Artifact) element;
+ if (artifact == null) {
+ return null;
+ }
+ if (artifact.isDeleted()) return null;
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ ((TeamWorkFlowArtifact) artifact).getParentActionArtifact();
+ }
+ if (artifact instanceof TaskArtifact) {
+ ((TaskArtifact) artifact).getParentSMA();
+ }
+ if (artifact instanceof ReviewSMArtifact) {
+ ((TeamWorkFlowArtifact) artifact).getParentSMA();
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ debug.report("hasChildren");
+ if (element instanceof Collection) return true;
+ if (element instanceof String) return false;
+ if (((Artifact) element).isDeleted()) return false;
+ if (element instanceof ActionArtifact) return true;
+ if (element instanceof StateMachineArtifact) {
+ try {
+ return ((StateMachineArtifact) element).hasAtsWorldChildren();
+ } catch (Exception ex) {
+ // do nothing
+ }
+ }
+ return true;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ debug.report("getElements");
+ if (inputElement instanceof String) return new Object[] {inputElement};
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object)
+ */
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /**
+ * @return the rootSet
+ */
+ public Collection<Artifact> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
new file mode 100644
index 00000000000..a56377ea219
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditor.java
@@ -0,0 +1,216 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.OseeContributionItem;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditor extends AbstractArtifactEditor implements IDirtiableEditor, IAtsMetricsProvider, IActionable {
+ public static final String EDITOR_ID = "org.eclipse.osee.ats.world.WorldEditor";
+ private int mainPageIndex, metricsPageIndex;
+ private WorldXWidgetActionPage actionPage;
+ private AtsMetricsComposite metricsComposite;
+ public static final String HELP_CONTEXT_ID = "atsWorldView";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ }
+
+ public static void open(final IWorldEditorProvider provider) throws OseeCoreException {
+ open(provider, false);
+ }
+
+ public static void open(final IWorldEditorProvider provider, boolean forcePend) throws OseeCoreException {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(new WorldEditorInput(provider), EDITOR_ID);
+ } catch (PartInitException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }, forcePend);
+ }
+
+ @Override
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ public void refreshTitle() {
+ firePropertyChange(IWorkbenchPart.PROP_TITLE);
+ }
+
+ @Override
+ public void dispose() {
+ if (actionPage != null && actionPage.getWorldComposite() != null) {
+ actionPage.getWorldComposite().disposeComposite();
+ }
+ if (metricsComposite != null) metricsComposite.disposeComposite();
+ super.dispose();
+ }
+
+ public String getCurrentTitleLabel() {
+ return actionPage.getCurrentTitleLabel();
+ }
+
+ public void setTableTitle(final String title, final boolean warning) {
+ actionPage.setTableTitle(title, warning);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ @Override
+ protected void addPages() {
+
+ try {
+ OseeContributionItem.addTo(this, true);
+
+ IWorldEditorProvider provider = getWorldEditorProvider();
+
+ createMainTab();
+ createMetricsTab();
+
+ setPartName(provider.getSelectedName(SearchType.Search));
+ setActivePage(mainPageIndex);
+
+ // Until WorldEditor has different help, just use WorldView's help
+ AtsPlugin.getInstance().setHelp(actionPage.getWorldComposite().getControl(), HELP_CONTEXT_ID);
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ /**
+ * @return the actionPage
+ */
+ public WorldXWidgetActionPage getActionPage() {
+ return actionPage;
+ }
+
+ public void setEditorTitle(final String str) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ setPartName(str);
+ firePropertyChange(IWorkbenchPart.PROP_TITLE);
+ }
+ });
+ }
+
+ public IWorldEditorProvider getWorldEditorProvider() {
+ IEditorInput editorInput = getEditorInput();
+ if (!(editorInput instanceof WorldEditorInput)) {
+ throw new IllegalArgumentException("Editor Input not WorldEditorInput");
+ }
+ WorldEditorInput worldEditorInput = (WorldEditorInput) editorInput;
+ return worldEditorInput.getIWorldEditorProvider();
+ }
+
+ public void reSearch() throws OseeCoreException {
+ actionPage.reSearch();
+ }
+
+ private void createMainTab() throws OseeCoreException, PartInitException {
+ actionPage = new WorldXWidgetActionPage(this);
+ mainPageIndex = addPage(actionPage);
+ }
+
+ private void createMetricsTab() throws OseeCoreException {
+ Composite comp = AtsLib.createCommonPageComposite(getContainer());
+ AtsLib.createCommonToolBar(comp);
+ metricsComposite = new AtsMetricsComposite(this, comp, SWT.NONE);
+ metricsPageIndex = addPage(comp);
+ setPageText(metricsPageIndex, "Metrics");
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ return actionPage.getWorldComposite().getLoadedArtifacts();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getMetricsArtifacts() throws OseeCoreException {
+ return getLoadedArtifacts();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IAtsMetricsProvider#getMetricsVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getMetricsVersionArtifact() throws OseeCoreException {
+ return getWorldEditorProvider().getTargetedVersionArtifact();
+ }
+
+ public WorldComposite getWorldComposite() {
+ return actionPage.getWorldComposite();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ats.IActionable#getActionDescription()
+ */
+ @Override
+ public String getActionDescription() {
+ return null;
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java
new file mode 100644
index 00000000000..527d2585341
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorInput.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.logging.Level;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorInput implements IEditorInput {
+
+ IWorldEditorProvider iWorldEditorProvider;
+
+ /**
+ * @return the iWorldEditorProvider
+ */
+ public IWorldEditorProvider getIWorldEditorProvider() {
+ return iWorldEditorProvider;
+ }
+
+ public WorldEditorInput(IWorldEditorProvider iWorldEditorProvider) {
+ this.iWorldEditorProvider = iWorldEditorProvider;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#exists()
+ */
+ public boolean exists() {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getPersistable()
+ */
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ public String getToolTipText() {
+ return "";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ @Override
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ @Override
+ public String getName() {
+ try {
+ return iWorldEditorProvider.getName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception getting name: " + ex.getLocalizedMessage();
+ }
+ }
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java
new file mode 100644
index 00000000000..66eeeca4d2f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItem.java
@@ -0,0 +1,88 @@
+/*
+ * Created on Nov 18, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IXWidgetOptionResolver;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class WorldEditorParameterSearchItem extends WorldSearchItem implements IWorldEditorParameterProvider, IDynamicWidgetLayoutListener, IXWidgetOptionResolver {
+
+ private CustomizeData customizeData;
+ private TableLoadOption[] tableLoadOptions;
+
+ /**
+ * @param name
+ */
+ public WorldEditorParameterSearchItem(String name) {
+ super(name);
+ }
+
+ /**
+ * @param name
+ * @param loadView
+ */
+ public WorldEditorParameterSearchItem(String name, LoadView loadView) {
+ super(name, loadView);
+ }
+
+ /**
+ * @param worldSearchItem
+ */
+ public WorldEditorParameterSearchItem(WorldSearchItem worldSearchItem) {
+ super(worldSearchItem);
+ }
+
+ public abstract String getParameterXWidgetXml() throws OseeCoreException;
+
+ public abstract Result isParameterSelectionValid() throws OseeCoreException;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#run(org.eclipse.osee.ats.world.WorldEditor, org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType, boolean)
+ */
+ @Override
+ public void run(WorldEditor worldEditor, SearchType searchType, boolean forcePend) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getWidgetOptions(org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData)
+ */
+ @Override
+ public String[] getWidgetOptions(DynamicXWidgetLayoutData widgetData) {
+ return null;
+ }
+
+ public void setCustomizeData(CustomizeData customizeData) {
+ this.customizeData = customizeData;
+ }
+
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions) {
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /**
+ * @return the customizeData
+ */
+ public CustomizeData getCustomizeData() {
+ return customizeData;
+ }
+
+ /**
+ * @return the tableLoadOptions
+ */
+ public TableLoadOption[] getTableLoadOptions() {
+ return tableLoadOptions;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java
new file mode 100644
index 00000000000..eaf6473ed2c
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorParameterSearchItemProvider.java
@@ -0,0 +1,200 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorParameterSearchItemProvider extends WorldEditorProvider implements IWorldEditorParameterProvider {
+
+ private final WorldEditorParameterSearchItem worldParameterSearchItem;
+ public static String ENTER_OPTIONS_AND_SELECT_SEARCH = "Enter options and select \"Search\"";
+ private boolean firstTime = true;
+
+ public WorldEditorParameterSearchItemProvider(WorldEditorParameterSearchItem worldParameterSearchItem) {
+ this(worldParameterSearchItem, null, TableLoadOption.None);
+ }
+
+ public WorldEditorParameterSearchItemProvider(WorldEditorParameterSearchItem worldParameterSearchItem, CustomizeData customizeData, TableLoadOption... tableLoadOptions) {
+ super(customizeData, tableLoadOptions);
+ this.worldParameterSearchItem = worldParameterSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#copy(org.eclipse.osee.ats.world.IWorldEditorProvider)
+ */
+ @Override
+ public IWorldEditorProvider copyProvider() {
+ return new WorldEditorParameterSearchItemProvider(
+ (WorldEditorParameterSearchItem) worldParameterSearchItem.copy(), customizeData, tableLoadOptions);
+ }
+
+ /**
+ * @return the worldSearchItem
+ */
+ public WorldSearchItem getWorldSearchItem() {
+ return worldParameterSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return worldParameterSearchItem.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#run(org.eclipse.osee.ats.world.WorldEditor)
+ */
+ @Override
+ public void run(WorldEditor worldEditor, SearchType searchType, boolean forcePend) throws OseeCoreException {
+
+ if (firstTime) {
+ firstTime = false;
+ worldEditor.setTableTitle(ENTER_OPTIONS_AND_SELECT_SEARCH, false);
+ return;
+ }
+ if (worldParameterSearchItem.isCancelled()) return;
+
+ Result result = worldParameterSearchItem.isParameterSelectionValid();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+
+ LoadTableJob job = null;
+ job = new LoadTableJob(worldEditor, worldParameterSearchItem, searchType, tableLoadOptions);
+ job.setUser(false);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ if (forcePend) {
+ try {
+ job.join();
+ } catch (InterruptedException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ private class LoadTableJob extends Job {
+
+ private final WorldEditorParameterSearchItem worldParameterSearchItem;
+ private boolean cancel = false;
+ private final SearchType searchType;
+ private final WorldEditor worldEditor;
+ private final TableLoadOption[] tableLoadOptions;
+
+ public LoadTableJob(WorldEditor worldEditor, WorldEditorParameterSearchItem worldParameterSearchItem, SearchType searchType, TableLoadOption[] tableLoadOptions) throws OseeCoreException {
+ super("Loading \"" + worldParameterSearchItem.getSelectedName(searchType) + "\"...");
+ this.worldEditor = worldEditor;
+ this.worldParameterSearchItem = worldParameterSearchItem;
+ this.searchType = searchType;
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+
+ String selectedName = "";
+ try {
+ selectedName = worldParameterSearchItem.getSelectedName(searchType);
+ worldEditor.setEditorTitle(selectedName != null ? selectedName : worldParameterSearchItem.getName());
+ worldEditor.setTableTitle("Loading \"" + (selectedName != null ? selectedName : "") + "\"...", false);
+ cancel = false;
+ worldParameterSearchItem.setCancelled(cancel);
+ final Collection<? extends Artifact> artifacts;
+ worldEditor.getWorldComposite().getXViewer().clear();
+ artifacts = worldParameterSearchItem.performSearchGetResults(searchType);
+ if (artifacts.size() == 0) {
+ if (worldParameterSearchItem.isCancelled()) {
+ monitor.done();
+ worldEditor.setTableTitle("CANCELLED - " + selectedName, false);
+ return Status.CANCEL_STATUS;
+ } else {
+ monitor.done();
+ worldEditor.setTableTitle("No Results Found - " + selectedName, true);
+ return Status.OK_STATUS;
+ }
+ }
+ worldEditor.getWorldComposite().load(selectedName, artifacts, customizeData, tableLoadOptions);
+ } catch (final Exception ex) {
+ String str = "Exception occurred. Network may be down.";
+ if (ex.getLocalizedMessage() != null && !ex.getLocalizedMessage().equals("")) str +=
+ " => " + ex.getLocalizedMessage();
+ worldEditor.getWorldComposite().setTableTitle("Searching Error - " + selectedName, false);
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ monitor.done();
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, str, null);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getSelectedName(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return worldParameterSearchItem.getSelectedName(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getParameterXWidgetXml()
+ */
+ @Override
+ public String getParameterXWidgetXml() throws OseeCoreException {
+ return worldParameterSearchItem.getParameterXWidgetXml();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#performSearchGetResults(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public Collection<? extends Artifact> performSearchGetResults(SearchType searchType) throws OseeCoreException {
+ return worldParameterSearchItem.performSearchGetResults(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getDynamicWidgetLayoutListener()
+ */
+ @Override
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener() {
+ return worldParameterSearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorParameterProvider#getWidgetOptions(org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData)
+ */
+ @Override
+ public String[] getWidgetOptions(DynamicXWidgetLayoutData widgetData) {
+ return null;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorProvider.java
new file mode 100644
index 00000000000..27694256b32
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorProvider.java
@@ -0,0 +1,71 @@
+/*
+ * Created on Nov 22, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class WorldEditorProvider implements IWorldEditorProvider {
+
+ protected TableLoadOption[] tableLoadOptions;
+ protected CustomizeData customizeData;
+
+ public WorldEditorProvider(CustomizeData customizeData, TableLoadOption[] tableLoadOptions) {
+ this.customizeData = customizeData;
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getSelectedName(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getTargetedVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getTargetedVersionArtifact() throws OseeCoreException {
+ return null;
+ }
+
+ /**
+ * @return the tableLoadOptions
+ */
+ public TableLoadOption[] getTableLoadOptions() {
+ return tableLoadOptions;
+ }
+
+ /**
+ * @return the customizeData
+ */
+ public CustomizeData getCustomizeData() {
+ return customizeData;
+ }
+
+ /**
+ * @param tableLoadOptions the tableLoadOptions to set
+ */
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions) {
+ this.tableLoadOptions = tableLoadOptions;
+ }
+
+ /**
+ * @param customizeData the customizeData to set
+ */
+ public void setCustomizeData(CustomizeData customizeData) {
+ this.customizeData = customizeData;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java
new file mode 100644
index 00000000000..44ea45f6bac
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleProvider.java
@@ -0,0 +1,57 @@
+/*
+ * Created on Nov 7, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorSimpleProvider extends WorldEditorProvider {
+
+ private final String name;
+ private final Collection<? extends Artifact> artifacts;
+
+ public WorldEditorSimpleProvider(String name, Collection<? extends Artifact> artifacts) {
+ this(name, artifacts, null, TableLoadOption.None);
+ }
+
+ public WorldEditorSimpleProvider(String name, Collection<? extends Artifact> artifacts, CustomizeData customizeData, TableLoadOption... tableLoadOption) {
+ super(customizeData, tableLoadOption);
+ this.name = name;
+ this.artifacts = artifacts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#copy(org.eclipse.osee.ats.world.IWorldEditorProvider)
+ */
+ @Override
+ public IWorldEditorProvider copyProvider() {
+ return new WorldEditorSimpleProvider(name, artifacts, customizeData, tableLoadOptions);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#run(org.eclipse.osee.ats.world.WorldEditor)
+ */
+ @Override
+ public void run(WorldEditor worldEditor, SearchType searchtype, boolean forcePend) throws OseeCoreException {
+ worldEditor.getWorldComposite().load(name, artifacts, customizeData, getTableLoadOptions());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return name;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorUISearchItemProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorUISearchItemProvider.java
new file mode 100644
index 00000000000..776d8db3b4a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorUISearchItemProvider.java
@@ -0,0 +1,171 @@
+/*
+ * Created on Nov 6, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.Collection;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.world.search.NextVersionSearchItem;
+import org.eclipse.osee.ats.world.search.VersionTargetedForTeamSearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.ats.world.search.WorldUISearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+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.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorUISearchItemProvider extends WorldEditorProvider {
+
+ private final WorldUISearchItem worldUISearchItem;
+
+ public WorldEditorUISearchItemProvider(WorldUISearchItem worldUISearchItem) {
+ this(worldUISearchItem, null, TableLoadOption.None);
+ }
+
+ public WorldEditorUISearchItemProvider(WorldUISearchItem worldUISearchItem, CustomizeData customizeData, TableLoadOption... tableLoadOptions) {
+ super(customizeData, tableLoadOptions);
+ this.worldUISearchItem = worldUISearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#copy(org.eclipse.osee.ats.world.IWorldEditorProvider)
+ */
+ @Override
+ public IWorldEditorProvider copyProvider() {
+ return new WorldEditorUISearchItemProvider((WorldUISearchItem) worldUISearchItem.copy(), customizeData,
+ tableLoadOptions);
+ }
+
+ /**
+ * @return the worldSearchItem
+ */
+ public WorldSearchItem getWorldSearchItem() {
+ return worldUISearchItem;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getName()
+ */
+ @Override
+ public String getName() throws OseeCoreException {
+ return worldUISearchItem.getName();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getSelectedName(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return worldUISearchItem.getSelectedName(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#run(org.eclipse.osee.ats.world.WorldEditor)
+ */
+ @Override
+ public void run(WorldEditor worldEditor, SearchType searchType, boolean forcePend) throws OseeCoreException {
+
+ Collection<TableLoadOption> options = Collections.getAggregate(tableLoadOptions);
+ if (!options.contains(TableLoadOption.NoUI) && searchType == SearchType.Search) {
+ worldUISearchItem.performUI(searchType);
+ }
+ if (worldUISearchItem.isCancelled()) {
+ worldEditor.close(false);
+ return;
+ }
+
+ LoadTableJob job = null;
+ job = new LoadTableJob(worldEditor, worldUISearchItem, searchType);
+ job.setUser(false);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ if (options.contains(TableLoadOption.ForcePend)) {
+ try {
+ job.join();
+ } catch (InterruptedException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+
+ private class LoadTableJob extends Job {
+
+ private final WorldUISearchItem worldUISearchItem;
+ private boolean cancel = false;
+ private final SearchType searchType;
+ private final WorldEditor worldEditor;
+
+ public LoadTableJob(WorldEditor worldEditor, WorldUISearchItem worldUISearchItem, SearchType searchType) throws OseeCoreException {
+ super("Loading \"" + worldUISearchItem.getSelectedName(searchType) + "\"...");
+ this.worldEditor = worldEditor;
+ this.worldUISearchItem = worldUISearchItem;
+ this.searchType = searchType;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ String selectedName = "";
+ try {
+ selectedName = worldUISearchItem.getSelectedName(searchType);
+ worldEditor.setEditorTitle(selectedName != null ? selectedName : worldUISearchItem.getName());
+ worldEditor.setTableTitle("Loading \"" + (selectedName != null ? selectedName : "") + "\"...", false);
+ cancel = false;
+ worldUISearchItem.setCancelled(cancel);
+ final Collection<Artifact> artifacts;
+ worldEditor.getWorldComposite().getXViewer().clear();
+ artifacts = worldUISearchItem.performSearchGetResults(false, searchType);
+ if (artifacts.size() == 0) {
+ if (worldUISearchItem.isCancelled()) {
+ worldEditor.setTableTitle("CANCELLED - " + selectedName, false);
+ return Status.CANCEL_STATUS;
+ } else {
+ worldEditor.setTableTitle("No Results Found - " + selectedName, true);
+ return Status.OK_STATUS;
+ }
+ }
+ worldEditor.getWorldComposite().load((selectedName != null ? selectedName : ""), artifacts, customizeData);
+ } catch (final Exception ex) {
+ worldEditor.getWorldComposite().setTableTitle("Searching Error - " + selectedName, false);
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getLocalizedMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+
+ return Status.OK_STATUS;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldEditorProvider#getTargetedVersionArtifact()
+ */
+ @Override
+ public VersionArtifact getTargetedVersionArtifact() throws OseeCoreException {
+ if (worldUISearchItem instanceof VersionTargetedForTeamSearchItem) {
+ return ((VersionTargetedForTeamSearchItem) worldUISearchItem).getSearchVersionArtifact();
+ } else if (worldUISearchItem instanceof NextVersionSearchItem) {
+ return ((NextVersionSearchItem) worldUISearchItem).getSelectedVersionArt();
+ }
+ return null;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java
new file mode 100644
index 00000000000..f5192de8b2f
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java
@@ -0,0 +1,187 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerCells;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerLabelProvider;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+
+public class WorldLabelProvider extends XViewerLabelProvider {
+
+ private final WorldXViewer treeViewer;
+ protected Font font;
+
+ public WorldLabelProvider(WorldXViewer treeViewer) {
+ super(treeViewer);
+ this.treeViewer = treeViewer;
+ }
+
+ @Override
+ public Image getColumnImage(Object element, XViewerColumn xCol, int columnIndex) {
+ try {
+ if (!(element instanceof IWorldViewArtifact)) return null;
+ IWorldViewArtifact wva = (IWorldViewArtifact) element;
+ if (xCol.equals(WorldXViewerFactory.Change_Type_Col))
+ return wva.getWorldViewChangeType().getImage();
+ else if (xCol.equals(WorldXViewerFactory.Type_Col))
+ return ((Artifact) element).getImage();
+ else if (xCol.equals(WorldXViewerFactory.Assignees_Col))
+ return wva.getAssigneeImage();
+ else if (xCol.equals(WorldXViewerFactory.Deadline_Col)) {
+ if (wva.isWorldViewDeadlineAlerting().isTrue()) return AtsPlugin.getInstance().getImage("warn.gif");
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return null;
+ }
+
+ @Override
+ public Color getForeground(Object element, XViewerColumn xCol, int columnIndex) {
+ try {
+ if ((element instanceof TaskArtifact) && xCol.equals(WorldXViewerFactory.Resolution_Col)) {
+ TaskArtifact taskArt = (TaskArtifact) element;
+ TaskResOptionDefinition def = taskArt.getTaskResolutionOptionDefinition(taskArt.getWorldViewResolution());
+ if (def != null) {
+ return Display.getCurrent().getSystemColor(def.getColorInt());
+ }
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public String getColumnText(Object element, XViewerColumn xCol, int columnIndex) {
+ try {
+ // NOTE: HRID, Type, Title are handled by XViewerValueColumn values
+ if (!(element instanceof IWorldViewArtifact)) return "";
+ IWorldViewArtifact wva = (IWorldViewArtifact) element;
+ Artifact art = (Artifact) element;
+ if (art.isDeleted()) {
+ if (xCol.equals(WorldXViewerFactory.ID_Col))
+ return art.getHumanReadableId();
+ else if (xCol.equals(WorldXViewerFactory.Title_Col))
+ return art.getInternalDescriptiveName();
+ else
+ return "<deleted>";
+ }
+ if (xCol.equals(WorldXViewerFactory.Type_Col)) return wva.getWorldViewType();
+ if (xCol.equals(WorldXViewerFactory.State_Col)) return wva.getWorldViewState();
+ if (xCol.equals(WorldXViewerFactory.Assignees_Col)) return wva.getWorldViewActivePoc();
+ if (xCol.equals(WorldXViewerFactory.Change_Type_Col)) return wva.getWorldViewChangeTypeStr();
+ if (xCol.equals(WorldXViewerFactory.Priority_Col)) return wva.getWorldViewPriority();
+ if (xCol.equals(WorldXViewerFactory.Actionable_Items_Col)) return wva.getWorldViewActionableItems();
+ if (xCol.equals(WorldXViewerFactory.User_Community_Col)) return wva.getWorldViewUserCommunity();
+ if (xCol.equals(WorldXViewerFactory.Version_Target_Col)) return wva.getWorldViewTargetedVersionStr();
+ if (xCol.equals(WorldXViewerFactory.Notes_Col)) return wva.getWorldViewNotes();
+
+ if (xCol.equals(WorldXViewerFactory.Resolution_Col)) return wva.getWorldViewResolution();
+ if (xCol.equals(WorldXViewerFactory.Groups_Col)) return wva.getWorldViewGroups();
+ if (xCol.equals(WorldXViewerFactory.Legacy_PCR_Col)) return wva.getWorldViewLegacyPCR();
+ if (xCol.equals(WorldXViewerFactory.Created_Date_Col)) return wva.getWorldViewCreatedDateStr();
+ if (xCol.equals(WorldXViewerFactory.Completed_Date_Col)) return wva.getWorldViewCompletedDateStr();
+ if (xCol.equals(WorldXViewerFactory.Cancelled_Date_Col)) return wva.getWorldViewCancelledDateStr();
+ if (xCol.equals(WorldXViewerFactory.Team_Col)) return wva.getWorldViewTeam();
+ if (xCol.equals(WorldXViewerFactory.Related_To_State_Col)) return wva.getWorldViewRelatedToState();
+ if (xCol.equals(WorldXViewerFactory.Originator_Col)) return wva.getWorldViewOriginator();
+ if (xCol.equals(WorldXViewerFactory.Branch_Status_Col)) return wva.getWorldViewBranchStatus();
+ if (xCol.equals(WorldXViewerFactory.Decision_Col)) return wva.getWorldViewDecision();
+ if (xCol.equals(WorldXViewerFactory.Estimated_Hours_Col)) return AtsLib.doubleToStrString(wva.getWorldViewEstimatedHours());
+ if (xCol.equals(WorldXViewerFactory.Remaining_Hours_Col)) {
+ Result result = wva.isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewRemainHours());
+ }
+ if (xCol.equals(WorldXViewerFactory.Percent_Complete_State_Col)) return String.valueOf(wva.getWorldViewPercentCompleteState());
+ if (xCol.equals(WorldXViewerFactory.Percent_Complete_State_Task_Col)) return String.valueOf(wva.getWorldViewPercentCompleteStateTask());
+ if (xCol.equals(WorldXViewerFactory.Percent_Complete_State_Review_Col)) return String.valueOf(wva.getWorldViewPercentCompleteStateReview());
+ if (xCol.equals(WorldXViewerFactory.Percent_Complete_Total_Col)) return String.valueOf(wva.getWorldViewPercentCompleteTotal());
+ if (xCol.equals(WorldXViewerFactory.Hours_Spent_State_Col)) return AtsLib.doubleToStrString(wva.getWorldViewHoursSpentState());
+ if (xCol.equals(WorldXViewerFactory.Hours_Spent_State_Task_Col)) return AtsLib.doubleToStrString(wva.getWorldViewHoursSpentStateTask());
+ if (xCol.equals(WorldXViewerFactory.Hours_Spent_State_Review_Col)) return AtsLib.doubleToStrString(wva.getWorldViewHoursSpentStateReview());
+ if (xCol.equals(WorldXViewerFactory.Hours_Spent_Total_Col)) return AtsLib.doubleToStrString(wva.getWorldViewHoursSpentStateTotal());
+
+ if (xCol.equals(WorldXViewerFactory.Total_Hours_Spent_Col)) return AtsLib.doubleToStrString(wva.getWorldViewHoursSpentTotal());
+
+ if (xCol.equals(WorldXViewerFactory.Percent_Rework_Col)) return wva.getWorldViewPercentReworkStr();
+ if (xCol.equals(WorldXViewerFactory.Estimated_Release_Date_Col)) return wva.getWorldViewEstimatedReleaseDateStr();
+ if (xCol.equals(WorldXViewerFactory.Estimated_Completion_Date_Col)) return wva.getWorldViewEstimatedCompletionDateStr();
+ if (xCol.equals(WorldXViewerFactory.Release_Date_Col)) return wva.getWorldViewReleaseDateStr();
+ if (xCol.equals(WorldXViewerFactory.Deadline_Col)) return wva.getWorldViewDeadlineDateStr();
+ if (xCol.equals(WorldXViewerFactory.Work_Package_Col)) return wva.getWorldViewWorkPackage();
+ if (xCol.equals(WorldXViewerFactory.Category_Col)) return wva.getWorldViewCategory();
+ if (xCol.equals(WorldXViewerFactory.Category2_Col)) return wva.getWorldViewCategory2();
+ if (xCol.equals(WorldXViewerFactory.Category3_Col)) return wva.getWorldViewCategory3();
+ if (xCol.equals(WorldXViewerFactory.Number_of_Tasks_Col)) return wva.getWorldViewNumberOfTasks();
+ if (xCol.equals(WorldXViewerFactory.Last_Modified_Col)) return wva.getWorldViewLastUpdated();
+ if (xCol.equals(WorldXViewerFactory.Last_Statused_Col)) return wva.getWorldViewLastStatused();
+ if (xCol.equals(WorldXViewerFactory.Description_Col)) return wva.getWorldViewDescription();
+ if (xCol.equals(WorldXViewerFactory.Validation_Required_Col)) return wva.getWorldViewValidationRequiredStr();
+ if (xCol.equals(WorldXViewerFactory.Implementor_Col)) return wva.getWorldViewImplementer();
+ if (xCol.equals(WorldXViewerFactory.Review_Author_Col)) return wva.getWorldViewReviewAuthor();
+ if (xCol.equals(WorldXViewerFactory.Review_Moderator_Col)) return wva.getWorldViewReviewModerator();
+ if (xCol.equals(WorldXViewerFactory.Review_Reviewer_Col)) return wva.getWorldViewReviewReviewer();
+ if (xCol.equals(WorldXViewerFactory.Review_Decider_Col)) return wva.getWorldViewReviewDecider();
+ if (xCol.equals(WorldXViewerFactory.SW_Enhancement_Col)) return wva.getWorldViewSWEnhancement();
+ if (xCol.equals(WorldXViewerFactory.Weekly_Benefit_Hrs_Col)) return AtsLib.doubleToStrString(
+ wva.getWorldViewWeeklyBenefit(), true);
+ if (xCol.equals(WorldXViewerFactory.Annual_Cost_Avoidance_Col)) {
+ Result result = wva.isWorldViewAnnualCostAvoidanceValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewAnnualCostAvoidance(), true);
+ }
+ if (xCol.equals(WorldXViewerFactory.Man_Days_Needed_Col)) {
+ Result result = wva.isWorldViewManDaysNeededValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewManDaysNeeded());
+ }
+
+ return "Unhandled Column";
+ } catch (Exception ex) {
+ return XViewerCells.getCellExceptionString(ex);
+ }
+ }
+
+ public void dispose() {
+ if (font != null) font.dispose();
+ font = null;
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public WorldXViewer getTreeViewer() {
+ return treeViewer;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewDragAndDrop.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewDragAndDrop.java
new file mode 100644
index 00000000000..05cce8447b6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldViewDragAndDrop.java
@@ -0,0 +1,133 @@
+/*
+ * Created on Oct 7, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.search.GroupWorldSearchItem;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactData;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTransfer;
+import org.eclipse.osee.framework.skynet.core.artifact.UniversalGroup;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.util.SkynetDragAndDrop;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DropTargetEvent;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldViewDragAndDrop extends SkynetDragAndDrop {
+
+ private final WorldComposite worldComposite;
+
+ public WorldViewDragAndDrop(WorldComposite worldComposite, String viewId) {
+ super(worldComposite.getXViewer().getTree(), viewId);
+ this.worldComposite = worldComposite;
+ }
+
+ @Override
+ public Artifact[] getArtifacts() {
+ IStructuredSelection selection = (IStructuredSelection) worldComposite.getXViewer().getSelection();
+ Iterator<?> i = selection.iterator();
+ List<Artifact> artifacts = new ArrayList<Artifact>();
+ while (i.hasNext()) {
+ Object object = i.next();
+ if (object instanceof Artifact) artifacts.add((Artifact) object);
+ }
+ return artifacts.toArray(new Artifact[artifacts.size()]);
+ }
+
+ private boolean isValidForArtifactDrop(DropTargetEvent event) {
+ if (ArtifactTransfer.getInstance().isSupportedType(event.currentDataType)) {
+ ArtifactData artData = ArtifactTransfer.getInstance().nativeToJava(event.currentDataType);
+
+ if (artData != null) {
+ Artifact[] artifacts = artData.getArtifacts();
+ for (Artifact art : artifacts) {
+ if ((art instanceof IWorldViewArtifact) || art.getArtifactTypeName().equals(
+ UniversalGroup.ARTIFACT_TYPE_NAME)) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void performDragOver(DropTargetEvent event) {
+ if (isValidForArtifactDrop(event)) {
+ event.detail = DND.DROP_COPY;
+ }
+ }
+
+ @Override
+ public void performDrop(final DropTargetEvent event) {
+ if (ArtifactTransfer.getInstance().isSupportedType(event.currentDataType)) {
+ final ArtifactData artData = ArtifactTransfer.getInstance().nativeToJava(event.currentDataType);
+ Job job = new Job("Loading WorldView...") {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ String name = "Dropped Artifacts";
+ Set<Artifact> arts = new HashSet<Artifact>();
+ if (artData != null) {
+ Artifact[] artifacts = artData.getArtifacts();
+ if (artifacts.length == 1) {
+ Artifact art = artifacts[0];
+ if (art instanceof IWorldViewArtifact) {
+ name = art.getDescriptiveName();
+ } else if (art.getArtifactTypeName().equals(UniversalGroup.ARTIFACT_TYPE_NAME)) {
+ GroupWorldSearchItem groupWorldSearchItem = new GroupWorldSearchItem();
+ groupWorldSearchItem.setSelectedGroup(art);
+ WorldEditor.open(new WorldEditorUISearchItemProvider(groupWorldSearchItem, null,
+ TableLoadOption.NoUI));
+ return Status.OK_STATUS;
+ }
+ }
+ for (Artifact art : artifacts) {
+ if (art instanceof IWorldViewArtifact) {
+ arts.add(art);
+ } else if (art.getArtifactTypeName().equals(UniversalGroup.ARTIFACT_TYPE_NAME)) {
+ for (Artifact relArt : art.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS)) {
+ if (relArt instanceof IWorldViewArtifact) {
+ arts.add(relArt);
+ }
+ }
+ }
+ }
+ }
+ if (arts.size() > 0) {
+ WorldEditor.open(new WorldEditorSimpleProvider(name, arts));
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, ex.getLocalizedMessage(), ex);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
new file mode 100644
index 00000000000..0d0426ebd78
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -0,0 +1,995 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSArtifact;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.IFavoriteableArtifact;
+import org.eclipse.osee.ats.artifact.ISubscribableArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.task.TaskEditor;
+import org.eclipse.osee.ats.task.TaskEditorSimpleProvider;
+import org.eclipse.osee.ats.task.TaskXViewer;
+import org.eclipse.osee.ats.util.ArtifactEmailWizard;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.Favorites;
+import org.eclipse.osee.ats.util.Subscribe;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IArtifactsPurgedEventListener;
+import org.eclipse.osee.framework.skynet.core.event.IFrameworkTransactionEventListener;
+import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
+import org.eclipse.osee.framework.skynet.core.event.Sender;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.skynet.core.utility.LoadedArtifacts;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.HtmlDialog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.IXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerAttributeColumn;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldXViewer extends XViewer implements IArtifactsPurgedEventListener, IArtifactsChangeTypeEventListener, IFrameworkTransactionEventListener {
+ private String title;
+ private String extendedStatusString = "";
+ public static final String MENU_GROUP_ATS_WORLD_EDIT = "ATS WORLD EDIT";
+ public static final String MENU_GROUP_ATS_WORLD_OPEN = "ATS WORLD OPEN";
+ public static final String MENU_GROUP_ATS_WORLD_OTHER = "ATS WORLD OTHER";
+ public static final String ADD_AS_FAVORITE = "Add as Favorite";
+ public static final String REMOVE_FAVORITE = "Remove Favorite";
+ public static final String SUBSCRIBE = "Subscribe for Notifications";
+ public static final String UN_SUBSCRIBE = "Un-Subscribe for Notifications";
+ public final WorldXViewer thisXViewer = this;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public WorldXViewer(Composite parent, int style) {
+ this(parent, style, new WorldXViewerFactory());
+ }
+
+ public WorldXViewer(Composite parent, int style, IXViewerFactory xViewerFactory) {
+ super(parent, style, xViewerFactory);
+ this.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(org.eclipse.jface.viewers.DoubleClickEvent event) {
+ handleDoubleClick();
+ };
+ });
+ }
+
+ @Override
+ public void handleArtifactsPurgedEvent(Sender sender, LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().size() == 0) return;
+ // ContentProvider ensures in display thread
+ ((WorldContentProvider) getContentProvider()).remove(loadedArtifacts.getLoadedArtifacts());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void handleArtifactsChangeTypeEvent(Sender sender, int toArtifactTypeId, LoadedArtifacts loadedArtifacts) {
+ try {
+ if (loadedArtifacts.getLoadedArtifacts().size() == 0) return;
+ // ContentProvider ensures in display thread
+ ((WorldContentProvider) getContentProvider()).remove(loadedArtifacts.getLoadedArtifacts());
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void handleFrameworkTransactionEvent(Sender sender, final FrameworkTransactionData transData) throws OseeCoreException {
+ if (transData.branchId != AtsPlugin.getAtsBranch().getBranchId()) return;
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ @Override
+ public void run() {
+ if (getContentProvider() == null) return;
+ ((WorldContentProvider) getContentProvider()).remove(transData.cacheDeletedArtifacts);
+ update(transData.cacheChangedArtifacts, null);
+ refresh(transData.cacheRelationAddedArtifacts);
+ refresh(transData.cacheRelationChangedArtifacts);
+ refresh(transData.cacheRelationDeletedArtifacts);
+ }
+ });
+ }
+
+ @Override
+ protected void createSupportWidgets(Composite parent) {
+ super.createSupportWidgets(parent);
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ ((WorldContentProvider) getContentProvider()).clear();
+ }
+ });
+ createMenuActions();
+ OseeEventManager.addListener(this);
+ }
+
+ Action editStatusAction, editNotesAction, editEstimateAction, editChangeTypeAction, editPriorityAction,
+ editTargetVersionAction, editAssigneeAction, editActionableItemsAction;
+ Action convertActionableItemsAction;
+ Action openInArtifactEditorAction, openInAtsWorkflowEditorAction, openInMassEditorAction,
+ openInAtsWorldEditorAction, openInAtsTaskEditorAction;
+ Action favoritesAction;
+ Action subscribedAction;
+ Action deletePurgeAtsObjectAction;
+ Action emailAction;
+ Action resetActionArtifactAction;
+
+ public void createMenuActions() {
+ MenuManager mm = getMenuManager();
+ mm.createContextMenu(getControl());
+ mm.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager manager) {
+ updateMenuActions();
+ }
+ });
+
+ editNotesAction = new Action("Edit Notes", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeAttribute(ATSAttributes.SMA_NOTE_ATTRIBUTE, getSelectedSMAArtifacts(), true,
+ true)) {
+ update(getSelectedSMAArtifacts().toArray(), null);
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editStatusAction = new Action("Edit Status", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeStatus(getSelectedSMAArtifacts(), true)) {
+ update(getSelectedSMAArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editEstimateAction = new Action("Edit Estimated Hours", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (ArtifactPromptChange.promptChangeFloatAttribute(
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(),
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getDisplayName(), getSelectedSMAArtifacts(), true)) {
+ update(getSelectedSMAArtifacts().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editChangeTypeAction = new Action("Edit Change Type", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeType(getSelectedTeamWorkflowArtifacts(), true)) {
+ update(getSelectedArtifactItems().toArray(), null);
+ }
+ }
+ };
+
+ editPriorityAction = new Action("Edit Priority", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangePriority(getSelectedTeamWorkflowArtifacts(), true)) {
+ update(getSelectedArtifactItems().toArray(), null);
+ }
+ }
+ };
+
+ editTargetVersionAction = new Action("Edit Targeted Version", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeVersion(getSelectedTeamWorkflowArtifacts(),
+ (AtsPlugin.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased), true)) {
+ update(getSelectedArtifactItems().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editAssigneeAction = new Action("Edit Assignee", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ Set<StateMachineArtifact> artifacts = getSelectedSMAArtifacts();
+ if (SMAManager.promptChangeAssignees(artifacts)) {
+ Artifacts.persistInTransaction(artifacts);
+ update(getSelectedArtifactItems().toArray(), null);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editActionableItemsAction = new Action("Edit Actionable Item(s)", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (getSelectedActionArtifacts().size() == 1) {
+ ActionArtifact actionArt = getSelectedActionArtifacts().iterator().next();
+ AtsLib.editActionActionableItems(actionArt);
+ refresh(getSelectedArtifactItems().iterator().next());
+ } else {
+ TeamWorkFlowArtifact teamArt = getSelectedTeamWorkflowArtifacts().iterator().next();
+ AtsLib.editTeamActionableItems(teamArt);
+ refresh(getSelectedArtifactItems().toArray()[0]);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ convertActionableItemsAction = new Action("Convert to Actionable Item/Team", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ TeamWorkFlowArtifact teamArt = getSelectedTeamWorkflowArtifacts().iterator().next();
+ Result result = teamArt.convertActionableItems();
+ if (result.isFalse() && !result.getText().equals("")) result.popup(result.isTrue());
+ refresh(getSelectedArtifactItems().iterator().next());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ openInMassEditorAction = new Action("Open in Mass Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedArtifacts().size() == 0) {
+ AWorkbench.popup("Error", "No items selected");
+ return;
+ }
+ MassArtifactEditor.editArtifacts("", getSelectedArtifacts());
+ }
+ };
+
+ openInAtsWorkflowEditorAction = new Action("Open in ATS Workflow Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ AtsLib.openAtsAction(getSelectedArtifactItems().iterator().next(), AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ };
+
+ openInAtsWorldEditorAction = new Action("Open in ATS World Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedArtifacts().size() == 0) {
+ AWorkbench.popup("Error", "No items selected");
+ return;
+ }
+ WorldEditorInput worldEditorInput = null;
+ if (thisXViewer instanceof TaskXViewer) {
+ worldEditorInput =
+ new WorldEditorInput(new WorldEditorSimpleProvider("ATS World", getSelectedArtifacts(), null,
+ TableLoadOption.None));
+ } else {
+ worldEditorInput =
+ new WorldEditorInput(new WorldEditorSimpleProvider("ATS World", getSelectedArtifacts(),
+ getCustomizeMgr().generateCustDataFromTable(), TableLoadOption.None));
+ }
+ if (worldEditorInput != null) {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(worldEditorInput, WorldEditor.EDITOR_ID);
+ } catch (PartInitException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ };
+
+ openInAtsTaskEditorAction = new Action("Open in ATS Task Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedTaskArtifacts().size() == 0) {
+ AWorkbench.popup("Error", "No Tasks selected");
+ return;
+ }
+ try {
+ TaskEditor.open(new TaskEditorSimpleProvider("ATS Tasks", getSelectedTaskArtifacts()));
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ favoritesAction = new Action("Add as Favorite", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedSMA() != null) (new Favorites(getSelectedSMA())).toggleFavorite();
+ }
+ };
+
+ subscribedAction = new Action("Subscribe for Notifications", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedSMA() != null) (new Subscribe(getSelectedSMA())).toggleSubscribe();
+ }
+ };
+
+ openInArtifactEditorAction = new Action("Open in Artifact Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (getSelectedArtifacts().size() > 0)
+ ArtifactEditor.editArtifact(getSelectedArtifactItems().iterator().next());
+ else
+ OSEELog.logException(AtsPlugin.class, new Exception("Can't retrieve SMA"), true);
+ }
+ };
+
+ deletePurgeAtsObjectAction = new Action("Delete/Purge ATS Object", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ handleDeleteAtsObject();
+ }
+ };
+
+ emailAction = new Action("Email ATS Object", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ handleEmailSelectedAtsObject();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ resetActionArtifactAction = new Action("Reset Action off Children", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ SkynetTransaction transaction;
+ try {
+ transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ for (ActionArtifact actionArt : getSelectedActionArtifacts()) {
+ actionArt.resetAttributesOffChildren(transaction);
+ }
+ transaction.execute();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+
+ }
+ };
+ }
+
+ @Override
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ handleColumnMultiEdit(treeColumn, treeItems, true);
+ }
+
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems, final boolean persist) {
+ if (!(treeColumn.getData() instanceof XViewerAttributeColumn)) {
+ AWorkbench.popup("ERROR", "Column is not attribute and thus not multi-editable " + treeColumn.getText());
+ return;
+ }
+ final XViewerAttributeColumn xCol = (XViewerAttributeColumn) treeColumn.getData();
+ XResultData rData = new XResultData();
+ final String attrName = xCol.getAttributeTypeName();
+ if (attrName == null) {
+ AWorkbench.popup("ERROR", "Can't retrieve attribute name from attribute column " + treeColumn.getText());
+ return;
+ }
+ final Set<Artifact> useArts = new HashSet<Artifact>();
+ for (TreeItem item : treeItems) {
+ Artifact art = (Artifact) item.getData();
+ try {
+ if (art.isAttributeTypeValid(attrName)) {
+ useArts.add(art);
+ } else {
+ rData.logError(attrName + " not valid for artifact " + art.getHumanReadableId() + " - " + art.getDescriptiveName());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ rData.logError(ex.getLocalizedMessage());
+ }
+ }
+ if (!rData.isEmpty()) {
+ rData.report("Column Multi Edit Errors");
+ return;
+ }
+ try {
+ if (useArts.size() > 0) {
+ ArtifactPromptChange.promptChangeAttribute(attrName, xCol.getName(), useArts, persist);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+
+ @Override
+ public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ if (!(treeColumn.getData() instanceof XViewerColumn)) return false;
+ if (!((XViewerColumn) treeColumn.getData()).isMultiColumnEditable()) {
+ return false;
+ }
+ // Currently don't know how to multi-edit anything but attribute
+ if (!(treeColumn.getData() instanceof XViewerAttributeColumn)) return false;
+ XViewerAttributeColumn xCol = (XViewerAttributeColumn) treeColumn.getData();
+ final String attrName = xCol.getAttributeTypeName();
+ if (attrName == null) {
+ AWorkbench.popup("ERROR", "Can't retrieve attribute name from attribute column " + treeColumn.getText());
+ return false;
+ }
+ if (attrName == null) return false;
+ for (TreeItem item : treeItems) {
+ if (item.getData() instanceof ActionArtifact) return false;
+ try {
+ if (!((Artifact) item.getData()).isAttributeTypeValid(attrName)) {
+ return false;
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isColumnMultiEditEnabled() {
+ return true;
+ }
+
+ public void handleEmailSelectedAtsObject() throws OseeCoreException {
+ Artifact art = getSelectedArtifacts().iterator().next();
+ if (art instanceof ActionArtifact) {
+ if (((ActionArtifact) art).getTeamWorkFlowArtifacts().size() > 1) {
+ art = AtsLib.promptSelectTeamWorkflow((ActionArtifact) art);
+ if (art == null) return;
+ } else
+ art = ((ActionArtifact) art).getTeamWorkFlowArtifacts().iterator().next();
+ }
+ if (art != null) {
+ ArtifactEmailWizard ew = new ArtifactEmailWizard((StateMachineArtifact) art);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), ew);
+ dialog.create();
+ dialog.open();
+ }
+ }
+
+ public StateMachineArtifact getSelectedSMA() {
+ Object obj = null;
+ if (getSelectedArtifactItems().size() == 0) return null;
+ obj = (getTree().getSelection()[0]).getData();
+ return (obj != null && (obj instanceof StateMachineArtifact)) ? (StateMachineArtifact) obj : null;
+ }
+
+ public void updateEditMenuActions() {
+ MenuManager mm = getMenuManager();
+
+ // EDIT MENU BLOCK
+ mm.insertBefore(MENU_GROUP_PRE, editChangeTypeAction);
+ editChangeTypeAction.setEnabled(getSelectedTeamWorkflowArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editPriorityAction);
+ editPriorityAction.setEnabled(getSelectedTeamWorkflowArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editTargetVersionAction);
+ editTargetVersionAction.setEnabled(getSelectedTeamWorkflowArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editAssigneeAction);
+ editAssigneeAction.setEnabled(getSelectedSMAArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editStatusAction);
+ editStatusAction.setEnabled(getSelectedSMAArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editEstimateAction);
+ editEstimateAction.setEnabled(getSelectedSMAArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editNotesAction);
+ editNotesAction.setEnabled(getSelectedSMAArtifacts().size() > 0);
+
+ mm.insertBefore(MENU_GROUP_PRE, editActionableItemsAction);
+ editActionableItemsAction.setEnabled(getSelectedActionArtifacts().size() == 1 || getSelectedTeamWorkflowArtifacts().size() == 1);
+
+ mm.insertBefore(MENU_GROUP_PRE, convertActionableItemsAction);
+ convertActionableItemsAction.setEnabled(getSelectedTeamWorkflowArtifacts().size() == 1);
+
+ }
+
+ public void updateMenuActions() {
+ MenuManager mm = getMenuManager();
+
+ mm.insertBefore(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_EDIT));
+ updateEditMenuActions();
+
+ mm.insertBefore(MENU_GROUP_PRE, new Separator());
+
+ // OPEN MENU BLOCK
+ mm.insertBefore(MENU_GROUP_PRE, new Separator());
+ mm.insertBefore(MENU_GROUP_PRE, openInAtsWorkflowEditorAction);
+ openInAtsWorkflowEditorAction.setEnabled(getSelectedArtifacts() != null);
+ mm.insertBefore(MENU_GROUP_PRE, openInMassEditorAction);
+ openInMassEditorAction.setEnabled(getSelectedArtifacts() != null);
+ mm.insertBefore(MENU_GROUP_PRE, openInAtsWorldEditorAction);
+ openInAtsWorldEditorAction.setEnabled(getSelectedArtifacts() != null);
+ mm.insertBefore(MENU_GROUP_PRE, openInAtsTaskEditorAction);
+ openInAtsTaskEditorAction.setEnabled(getSelectedTaskArtifacts() != null);
+ if (AtsPlugin.isAtsAdmin()) {
+ mm.insertBefore(MENU_GROUP_PRE, openInArtifactEditorAction);
+ openInArtifactEditorAction.setEnabled(getSelectedArtifacts() != null);
+ mm.insertBefore(MENU_GROUP_PRE, deletePurgeAtsObjectAction);
+ deletePurgeAtsObjectAction.setEnabled(getSelectedArtifactItems().size() > 0);
+ }
+ mm.insertBefore(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_OPEN));
+ mm.insertBefore(MENU_GROUP_PRE, new Separator());
+
+ // OTHER MENU BLOCK
+ mm.insertBefore(MENU_GROUP_PRE, favoritesAction);
+ favoritesAction.setEnabled(getSelectedSMAArtifacts().size() == 1 && (getSelectedSMA() instanceof IFavoriteableArtifact));
+ if (getSelectedSMA() == null)
+ favoritesAction.setText(ADD_AS_FAVORITE);
+ else
+ favoritesAction.setText(((IFavoriteableArtifact) getSelectedSMA()).amIFavorite() ? REMOVE_FAVORITE : ADD_AS_FAVORITE);
+
+ mm.insertBefore(MENU_GROUP_PRE, subscribedAction);
+ subscribedAction.setEnabled(getSelectedSMAArtifacts().size() == 1 && (getSelectedSMA() instanceof ISubscribableArtifact));
+ if (getSelectedSMA() == null)
+ subscribedAction.setText(SUBSCRIBE);
+ else
+ subscribedAction.setText(((ISubscribableArtifact) getSelectedSMA()).amISubscribed() ? UN_SUBSCRIBE : SUBSCRIBE);
+
+ mm.insertBefore(MENU_GROUP_PRE, emailAction);
+ emailAction.setEnabled(getSelectedArtifacts().size() == 1);
+ emailAction.setText("Email " + ((getSelectedArtifacts().size() == 1) ? getSelectedArtifacts().iterator().next().getArtifactTypeName() : ""));
+
+ mm.insertBefore(MENU_GROUP_PRE, resetActionArtifactAction);
+ resetActionArtifactAction.setEnabled(getSelectedActionArtifacts().size() > 0);
+
+ mm.insertAfter(XViewer.MENU_GROUP_PRE, new GroupMarker(MENU_GROUP_ATS_WORLD_OTHER));
+ mm.insertAfter(MENU_GROUP_PRE, new Separator());
+
+ }
+
+ public void handleDoubleClick() {
+ if (getSelectedArtifactItems().size() == 0) return;
+ Artifact art = getSelectedArtifactItems().iterator().next();
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ if (getRoot() != null) {
+ for (Object artifact : (Collection<?>) getRoot()) {
+ if (artifact instanceof Artifact) {
+ arts.add((Artifact) artifact);
+ }
+ }
+ }
+ return arts;
+ }
+
+ public void clear() {
+ ((WorldContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ @Override
+ public void dispose() {
+ OseeEventManager.removeListener(this);
+ // Dispose of the table objects is done through separate dispose listener off tree
+ // Tell the label provider to release its resources
+ getLabelProvider().dispose();
+ super.dispose();
+ }
+
+ public ArrayList<Artifact> getSelectedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((Artifact) item.getData());
+ return arts;
+ }
+
+ public ArrayList<TaskArtifact> getSelectedTaskArtifacts() {
+ ArrayList<TaskArtifact> arts = new ArrayList<TaskArtifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) {
+ for (TreeItem item : items) {
+ if (item.getData() instanceof TaskArtifact) {
+ arts.add((TaskArtifact) item.getData());
+ }
+ }
+ }
+ return arts;
+ }
+
+ /**
+ * @return true if all selected are Workflow OR are Actions with single workflow
+ */
+ public boolean isSelectedTeamWorkflowArtifacts() {
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items) {
+ if (item.getData() instanceof ActionArtifact) {
+ try {
+ if (((ActionArtifact) item.getData()).getTeamWorkFlowArtifacts().size() != 1) return false;
+ } catch (OseeCoreException ex) {
+ // Do Nothing
+ }
+ } else if (!(item.getData() instanceof TeamWorkFlowArtifact)) return false;
+ }
+ return true;
+ }
+
+ /**
+ * @return all selected Workflow and any workflow that have Actions with single workflow
+ */
+ public Set<TeamWorkFlowArtifact> getSelectedTeamWorkflowArtifacts() {
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items) {
+ if (item.getData() instanceof TeamWorkFlowArtifact) teamArts.add((TeamWorkFlowArtifact) item.getData());
+ if (item.getData() instanceof ActionArtifact) {
+ try {
+ if (((ActionArtifact) item.getData()).getTeamWorkFlowArtifacts().size() == 1) teamArts.addAll(((ActionArtifact) item.getData()).getTeamWorkFlowArtifacts());
+ } catch (OseeCoreException ex) {
+ // Do Nothing
+ }
+ }
+ }
+ return teamArts;
+ }
+
+ /**
+ * @return all selected Workflow and any workflow that have Actions with single workflow
+ */
+ public Set<StateMachineArtifact> getSelectedSMAArtifacts() {
+ Set<StateMachineArtifact> smaArts = new HashSet<StateMachineArtifact>();
+ try {
+ Iterator<?> i = ((IStructuredSelection) getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof StateMachineArtifact)
+ smaArts.add((StateMachineArtifact) obj);
+ else if (obj instanceof ActionArtifact) smaArts.addAll(((ActionArtifact) obj).getTeamWorkFlowArtifacts());
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ return smaArts;
+ }
+
+ public Set<ActionArtifact> getSelectedActionArtifacts() {
+ Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items) {
+ if (item.getData() instanceof ActionArtifact) actionArts.add((ActionArtifact) item.getData());
+ }
+ return actionArts;
+ }
+
+ public void setCancelledNotification() {
+ TreeItem item = getTree().getItem(0);
+ if (item.getData() instanceof String) item.setData(DefaultTeamState.Cancelled.name());
+ refresh(item.getData());
+ }
+
+ /**
+ * @param title string to be used in reporting
+ */
+ public void setReportingTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @return Returns the title.
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ public void set(Collection<? extends Artifact> artifacts) {
+ ((WorldContentProvider) getContentProvider()).set(artifacts);
+ }
+
+ public void add(Collection<Artifact> artifacts) {
+ ((WorldContentProvider) getContentProvider()).add(artifacts);
+ }
+
+ public void add(final Artifact artifact) {
+ add(Arrays.asList(artifact));
+ }
+
+ public void remove(final Artifact artifact) {
+ ((WorldContentProvider) getContentProvider()).remove(artifact);
+ }
+
+ @Override
+ public void remove(final Collection<Object> artifacts) {
+ ((WorldContentProvider) getContentProvider()).remove(artifacts);
+ }
+
+ @Override
+ public void load(Collection<Object> objects) {
+ Set<Artifact> arts = new HashSet<Artifact>();
+ for (Object obj : objects) {
+ if (obj instanceof IWorldViewArtifact) {
+ arts.add((Artifact) obj);
+ }
+ }
+ set(arts);
+ }
+
+ public ArrayList<Artifact> getSelectedArtifactItems() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((Artifact) item.getData());
+ return arts;
+ }
+
+ private void handleDeleteAtsObject() {
+ try {
+ ArrayList<Artifact> delArts = new ArrayList<Artifact>();
+ StringBuilder artBuilder = new StringBuilder();
+ ArrayList<Artifact> selectedArts = getSelectedArtifacts();
+
+ for (Artifact art : selectedArts) {
+ if (art instanceof ATSArtifact) {
+ delArts.add(art);
+ if (selectedArts.size() < 30) artBuilder.append(String.format("Name: %s Type: %s\n",
+ art.getHumanReadableId(), art.getArtifactTypeName()));
+ }
+ }
+ if (selectedArts.size() >= 5) {
+ artBuilder.append(" < " + selectedArts.size() + " artifacts>");
+ }
+ MessageDialogWithToggle md =
+ MessageDialogWithToggle.openOkCancelConfirm(
+ Display.getCurrent().getActiveShell(),
+ "Delete/Purge ATS Object",
+ "Prepare to Delete/Purge ATS Object\n\n" + artBuilder.toString().replaceFirst("\n$", "") + "\n\nAnd ALL it's ATS children.\n(Artifacts will be retrieved for confirmation)\nAre You Sure?",
+ "Purge", false, null, null);
+ if (md.getReturnCode() == 0) {
+ final boolean purge = md.getToggleState();
+ StringBuilder delBuilder = new StringBuilder();
+ final Set<Artifact> deleteArts = new HashSet<Artifact>(30);
+ Map<Artifact, Object> ignoredArts = new HashMap<Artifact, Object>();
+ for (Artifact art : delArts) {
+ delBuilder.append("\nArtifact: " + art.getDescriptiveName());
+ ((ATSArtifact) art).atsDelete(deleteArts, ignoredArts);
+ delBuilder.append("\n\nDelete/Purge:\n");
+ for (Artifact loopArt : deleteArts)
+ delBuilder.append(String.format("Guid %s Type: \"%s\" Name: \"%s\"", loopArt.getGuid(),
+ loopArt.getArtifactTypeName(), loopArt.getDescriptiveName()) + "\n");
+ delBuilder.append("\n\nIngoring:\n");
+ for (Artifact loopArt : ignoredArts.keySet())
+ if (!deleteArts.contains(loopArt)) delBuilder.append(String.format(
+ "Type: \"%s\" Name: \"%s\" <-rel to-> Class: %s", loopArt.getArtifactTypeName(),
+ loopArt.getDescriptiveName(), ignoredArts.get(loopArt).getClass().getCanonicalName()) + "\n");
+ }
+ String results = (purge ? "Purge" : "Delete") + " ATS Objects, Are You Sure?\n" + delBuilder.toString();
+ results = results.replaceAll("\n", "<br>");
+ HtmlDialog dialog =
+ new HtmlDialog((purge ? "Purge" : "Delete") + " ATS Objects", "", AHTML.simplePage(results));
+ dialog.open();
+ if (dialog.getReturnCode() == 0) {
+ if (purge) {
+ ArtifactPersistenceManager.purgeArtifacts(deleteArts);
+ } else {
+ SkynetTransaction transaction = new SkynetTransaction(AtsPlugin.getAtsBranch());
+ ArtifactPersistenceManager.deleteArtifact(transaction, false,
+ deleteArts.toArray(new Artifact[deleteArts.size()]));
+ transaction.execute();
+ }
+
+ AWorkbench.popup((purge ? "Purge" : "Delete") + " Completed",
+ (purge ? "Purge" : "Delete") + " Completed");
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer#getStatusString()
+ */
+ @Override
+ public String getStatusString() {
+ return extendedStatusString;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.viewer.XViewer#handleAltLeftClick(org.eclipse.swt.widgets.TreeColumn,
+ * org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ return handleAltLeftClick(treeColumn, treeItem, true);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer#handleLeftClickInIconArea(org.eclipse.swt.widgets.TreeColumn, org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleLeftClickInIconArea(TreeColumn treeColumn, TreeItem treeItem) {
+ try {
+ Artifact useArt = (Artifact) treeItem.getData();
+ if (useArt instanceof StateMachineArtifact) {
+ boolean modified = false;
+ if (useArt instanceof ActionArtifact) {
+ if (((ActionArtifact) useArt).getTeamWorkFlowArtifacts().size() == 1)
+ useArt = (((ActionArtifact) useArt).getTeamWorkFlowArtifacts().iterator().next());
+ else
+ return false;
+ }
+ if (modified) {
+ update(useArt, null);
+ return true;
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem, boolean persist) {
+ try {
+ super.handleAltLeftClick(treeColumn, treeItem);
+ if (!(treeColumn.getData() instanceof XViewerColumn)) return false;
+ Artifact useArt = (Artifact) treeItem.getData();
+ if (useArt instanceof ActionArtifact) {
+ if (((ActionArtifact) useArt).getTeamWorkFlowArtifacts().size() == 1)
+ useArt = (((ActionArtifact) useArt).getTeamWorkFlowArtifacts().iterator().next());
+ else
+ return false;
+ }
+ SMAManager smaMgr = new SMAManager((StateMachineArtifact) useArt);
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ boolean modified = false;
+ if (xCol.equals(WorldXViewerFactory.Version_Target_Col))
+ modified =
+ smaMgr.promptChangeVersion(
+ AtsPlugin.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased, true);
+ else if (xCol.equals(WorldXViewerFactory.Notes_Col))
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.SMA_NOTE_ATTRIBUTE, persist, true);
+ else if (xCol.equals(WorldXViewerFactory.Percent_Rework_Col))
+ modified = smaMgr.promptChangePercentAttribute(ATSAttributes.PERCENT_REWORK_ATTRIBUTE, persist);
+ else if (xCol.equals(WorldXViewerFactory.Estimated_Hours_Col))
+ modified = smaMgr.promptChangeFloatAttribute(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, persist);
+ else if (xCol.equals(WorldXViewerFactory.Weekly_Benefit_Hrs_Col))
+ modified = smaMgr.promptChangeFloatAttribute(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE, persist);
+ else if (xCol.equals(WorldXViewerFactory.Estimated_Release_Date_Col))
+ modified = smaMgr.promptChangeEstimatedReleaseDate();
+ else if (xCol.equals(WorldXViewerFactory.Deadline_Col))
+ modified = smaMgr.promptChangeDate(ATSAttributes.DEADLINE_ATTRIBUTE, persist);
+ else if (xCol.equals(WorldXViewerFactory.Remaining_Hours_Col)) {
+ AWorkbench.popup("Calculated Field",
+ "Hours Remaining field is calculated.\nHour Estimate - (Hour Estimate * Percent Complete)");
+ return false;
+ } else if (xCol.equals(WorldXViewerFactory.Man_Days_Needed_Col)) {
+ AWorkbench.popup(
+ "Calculated Field",
+ "Man Days Needed field is calculated.\nRemaining Hours / Hours per Week (" + smaMgr.getSma().getManDayHrsPreference() + ")");
+ return false;
+ } else if (xCol.equals(WorldXViewerFactory.Release_Date_Col))
+ modified = smaMgr.promptChangeReleaseDate();
+ else if (xCol.equals(WorldXViewerFactory.Work_Package_Col))
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.WORK_PACKAGE_ATTRIBUTE, persist, false);
+ else if (xCol.equals(WorldXViewerFactory.Category_Col))
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY_ATTRIBUTE, persist, true);
+ else if (xCol.equals(WorldXViewerFactory.Category2_Col))
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY2_ATTRIBUTE, persist, true);
+ else if (xCol.equals(WorldXViewerFactory.Category3_Col))
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY3_ATTRIBUTE, persist, true);
+ else if (xCol.equals(WorldXViewerFactory.Change_Type_Col))
+ modified = smaMgr.promptChangeType(persist);
+ else if (xCol.equals(WorldXViewerFactory.Priority_Col)) modified = smaMgr.promptChangePriority(persist);
+ if (modified) {
+ update(useArt, null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ /**
+ * @return the extendedStatusString
+ */
+ public String getExtendedStatusString() {
+ return extendedStatusString;
+ }
+
+ /**
+ * @param extendedStatusString the extendedStatusString to set
+ */
+ public void setExtendedStatusString(String extendedStatusString) {
+ this.extendedStatusString = extendedStatusString;
+ updateStatusLabel();
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java
new file mode 100644
index 00000000000..a11083c931e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java
@@ -0,0 +1,257 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsAttributeColumn;
+import org.eclipse.osee.ats.util.xviewer.column.XViewerSmaCreatedDateColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerSorter;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerArtifactNameColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.column.XViewerHridColumn;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldXViewerFactory extends SkynetXViewerFactory {
+
+ public static String COLUMN_NAMESPACE = "ats.column";
+ public static final XViewerColumn Type_Col =
+ new XViewerColumn("ats.column.type", "Type", 150, SWT.LEFT, true, SortDataType.String, false, null);
+ public static final XViewerColumn State_Col =
+ new XViewerColumn("ats.column.state", "State", 75, SWT.LEFT, true, SortDataType.String, false, null);
+ public static final XViewerColumn Priority_Col =
+ new XViewerAtsAttributeColumn(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE, 20, SWT.CENTER, true,
+ SortDataType.String, false, null);
+ public static final XViewerColumn Change_Type_Col =
+ new XViewerAtsAttributeColumn(ATSAttributes.CHANGE_TYPE_ATTRIBUTE, 22, SWT.CENTER, true, SortDataType.String,
+ false, null);
+ public static final XViewerColumn Assignees_Col =
+ new XViewerColumn(WorldXViewerFactory.COLUMN_NAMESPACE + ".assignees", "Assignees", 100, SWT.LEFT, true,
+ SortDataType.String, false, null);
+ public static final XViewerColumn Title_Col = new XViewerArtifactNameColumn("Title");
+ public static final XViewerColumn Actionable_Items_Col =
+ new XViewerColumn(WorldXViewerFactory.COLUMN_NAMESPACE + ".actionableItems", "Actionable Items", 80, SWT.LEFT,
+ true, SortDataType.String, false, "Actionable Items that are impacted by this change.");
+ public static final XViewerColumn User_Community_Col =
+ new XViewerAtsAttributeColumn(ATSAttributes.USER_COMMUNITY_ATTRIBUTE, 60, SWT.LEFT, true, SortDataType.String,
+ false, null);
+ public static final XViewerColumn ID_Col = new XViewerHridColumn("HRID");
+ public static final XViewerColumn Created_Date_Col = new XViewerSmaCreatedDateColumn();
+ public static final XViewerColumn Version_Target_Col =
+ new XViewerColumn(WorldXViewerFactory.COLUMN_NAMESPACE + ".versionTarget", "Version Target", 40, SWT.LEFT,
+ true, SortDataType.String, false, "Date this workflow transitioned to the Completed state.");
+ public static final XViewerColumn Team_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".team", "Team", 50, SWT.LEFT, true, SortDataType.String, false,
+ "Team that has been assigned to work this Action.");
+ public static final XViewerColumn Notes_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".notes", "Notes", 80, SWT.LEFT, true, SortDataType.String, true,
+ "Team that has been assigned to work this Action.");
+ public static final XViewerColumn Deadline_Col =
+ new XViewerAtsAttributeColumn(ATSAttributes.DEADLINE_ATTRIBUTE, 80, SWT.LEFT, true, SortDataType.String, true,
+ null);
+
+ // Aren't shown by default
+ public static final XViewerColumn Annual_Cost_Avoidance_Col =
+ new XViewerColumn(
+ COLUMN_NAMESPACE + ".annualCostAvoidance",
+ "Annual Cost Avoidance",
+ 50,
+ SWT.LEFT,
+ false,
+ SortDataType.Float,
+ false,
+ "Hours that would be saved for the first year if this change were completed.\n\n" + "(Weekly Benefit Hours * 52 weeks) - Remaining Hours\n\n" + "If number is high, benefit is great given hours remaining.");
+ public static final XViewerColumn Description_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".description", "Description", 150, SWT.LEFT, false, SortDataType.String,
+ true, null);
+ public static XViewerColumn Legacy_PCR_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".legacyPcr", ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getDisplayName(), 40,
+ SWT.LEFT, false, SortDataType.String, false, null);
+ public static XViewerColumn SW_Enhancement_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".swEnhancement", "SW Enhancement", 150, SWT.LEFT, false,
+ SortDataType.String, false, null);
+ public static final XViewerColumn Decision_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".decision", "Decision", 150, SWT.LEFT, false, SortDataType.String,
+ false, null);
+ public static final XViewerColumn Resolution_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".resolution", ATSAttributes.RESOLUTION_ATTRIBUTE, 150,
+ SWT.LEFT, false, SortDataType.String, true, null);
+ public static XViewerColumn Estimated_Release_Date_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".estimatedReleaseDate",
+ ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE, 80, SWT.LEFT, false, SortDataType.Date, true,
+ "Date the changes will be made available to the users.");
+ public static XViewerColumn Estimated_Completion_Date_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".estimatedCompletionDate",
+ ATSAttributes.ESTIMATED_COMPLETION_DATE_ATTRIBUTE, 80, SWT.LEFT, false, SortDataType.Date, true,
+ "Date the changes will be completed.");
+ public static final XViewerColumn Release_Date_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".releaseDate", ATSAttributes.RELEASE_DATE_ATTRIBUTE.getDisplayName(),
+ 80, SWT.LEFT, false, SortDataType.Date, false, "Date the changes were made available to the users.");
+ public static final XViewerColumn Work_Package_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".workPackage", "Work Package", 80, SWT.LEFT, false, SortDataType.String,
+ true, null);
+ public static final XViewerColumn Category_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".category", ATSAttributes.CATEGORY_ATTRIBUTE, 80, SWT.LEFT,
+ false, SortDataType.String, true,
+ "Open field for user to be able to enter text to use for categorizing/sorting.");
+ public static final XViewerColumn Category2_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".category2", ATSAttributes.CATEGORY2_ATTRIBUTE, 80,
+ SWT.LEFT, false, SortDataType.String, true,
+ "Open field for user to be able to enter text to use for categorizing/sorting.");
+ public static final XViewerColumn Category3_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".category3", ATSAttributes.CATEGORY3_ATTRIBUTE, 80,
+ SWT.LEFT, false, SortDataType.String, true,
+ "Open field for user to be able to enter text to use for categorizing/sorting.");
+ public static XViewerAtsAttributeColumn Related_To_State_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".relatedToState", ATSAttributes.RELATED_TO_STATE_ATTRIBUTE,
+ 80, SWT.LEFT, false, SortDataType.String, true,
+ "State of the parent State Machine that this object is related to.");
+ public static final XViewerColumn Estimated_Hours_Col =
+ new XViewerAtsAttributeColumn(COLUMN_NAMESPACE + ".estimatedHours", ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE,
+ 40, SWT.CENTER, false, SortDataType.Float, true,
+ "Hours estimated to implement the changes associated with this Action.");
+ public static final XViewerColumn Weekly_Benefit_Hrs_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".weeklyBenefitHrs", "Weekly Benefit Hrs", 40, SWT.CENTER, false,
+ SortDataType.Float, false,
+ "Estimated number of hours that will be saved over a single year if this change is completed.");
+ public static final XViewerColumn Remaining_Hours_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".remainingHours", "Remaining Hours", 40, SWT.CENTER, false,
+ SortDataType.Float, false,
+ "Hours that remain to complete the changes.\n\nEstimated Hours - (Estimated Hours * Percent Complete).");
+
+ public static final XViewerColumn Percent_Complete_State_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".statePercentComplete", "State Percent Complete", 40, SWT.CENTER, false,
+ SortDataType.Percent, false,
+ "Percent Complete for the changes to the current state.\n\nAmount entered from user.");
+ public static final XViewerColumn Percent_Complete_State_Task_Col =
+ new XViewerColumn(
+ COLUMN_NAMESPACE + ".stateTaskPercentComplete",
+ "State Task Percent Complete",
+ 40,
+ SWT.CENTER,
+ false,
+ SortDataType.Percent,
+ false,
+ "Percent Complete for the tasks related to the current state.\n\nCalculation: total percent of all tasks related to state / number of tasks related to state");
+ public static final XViewerColumn Percent_Complete_State_Review_Col =
+ new XViewerColumn(
+ COLUMN_NAMESPACE + ".stateReviewPercentComplete",
+ "State Review Percent Complete",
+ 40,
+ SWT.CENTER,
+ false,
+ SortDataType.Percent,
+ false,
+ "Percent Complete for the reviews related to the current state.\n\nCalculation: total percent of all reviews related to state / number of reviews related to state");
+ public static final XViewerColumn Percent_Complete_Total_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".totalPercentComplete", "Total Percent Complete", 40, SWT.CENTER, false,
+ SortDataType.Percent, false, "Percent Complete for the reviews related to the current state.");
+
+ public static final XViewerColumn Hours_Spent_State_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".stateHoursSpent", "State Hours Spent", 40, SWT.CENTER, false,
+ SortDataType.Float, false, "Hours spent in performing the changes to the current state.");
+ public static final XViewerColumn Hours_Spent_State_Task_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".stateTaskHoursSpent", "State Task Hours Spent", 40, SWT.CENTER, false,
+ SortDataType.Float, false,
+ "Hours spent in performing the changes for the tasks related to the current state.");
+ public static final XViewerColumn Hours_Spent_State_Review_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".stateReviewHoursSpent", "State Review Hours Spent", 40, SWT.CENTER,
+ false, SortDataType.Float, false,
+ "Hours spent in performing the changes for the reveiws related to the current state.");
+ public static final XViewerColumn Hours_Spent_Total_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".stateTotalHoursSpent", "State Total Hours Spent", 40, SWT.CENTER,
+ false, SortDataType.Float, false, "Hours spent for all work related to the current state.");
+
+ public static final XViewerColumn Total_Hours_Spent_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".totalHoursSpent", "Total Hours Spent", 40, SWT.CENTER, false,
+ SortDataType.Float, false, "Hours spent for all work related to all states.");
+
+ public static final XViewerColumn Originator_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".originator", "Originator", 80, SWT.LEFT, false, SortDataType.String,
+ false, null);
+ public static final XViewerColumn Implementor_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".implementer", "Implementer", 80, SWT.LEFT, false, SortDataType.String,
+ false, "User assigned to the Implementation of the changes.");
+ public static final XViewerColumn Review_Author_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".reviewAuthor", "Review Author", 100, SWT.LEFT, false,
+ SortDataType.String, false, "Review Author(s)");
+ public static final XViewerColumn Review_Moderator_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".reviewModerator", "Review Moderator", 100, SWT.LEFT, false,
+ SortDataType.String, false, "Review Moderator(s)");
+ public static final XViewerColumn Groups_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".groups", "Groups", 100, SWT.LEFT, false, SortDataType.String, false,
+ "Groups");
+ public static final XViewerColumn Review_Reviewer_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".reviewReviewer", "Review Reviewer", 100, SWT.LEFT, false,
+ SortDataType.String, false, "Review Reviewer(s)");
+ public static final XViewerColumn Review_Decider_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".reviewDecider", "Review Decider", 100, SWT.LEFT, false,
+ SortDataType.String, false, "Review Decider");
+ public static final XViewerColumn Completed_Date_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".completedDate", "Completed Date", 80, SWT.CENTER, false,
+ SortDataType.Date, false, null);
+ public static final XViewerColumn Cancelled_Date_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".cancelledDate", "Cancelled Date", 80, SWT.CENTER, false,
+ SortDataType.Date, false, null);
+ public static final XViewerColumn Man_Days_Needed_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".manDaysNeeded", "Man Days Needed", 40, SWT.CENTER, false,
+ SortDataType.Float, false, null);
+ public static final XViewerColumn Percent_Rework_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".percentRework", "Percent Rework", 40, SWT.CENTER, false,
+ SortDataType.Percent, false, null);
+ public static final XViewerColumn Branch_Status_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".branchStatus", "Branch Status", 40, SWT.CENTER, false,
+ SortDataType.String, false, null);
+ public static final XViewerColumn Number_of_Tasks_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".numberOfTasks", "Number of Tasks", 40, SWT.CENTER, false,
+ SortDataType.Integer, false, null);
+ public static final XViewerColumn Last_Modified_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".lastModified", "Last Modified", 40, SWT.CENTER, false,
+ SortDataType.Date, false, "Retrieves timestamp of last database update of this artifact.");
+ public static final XViewerColumn Last_Statused_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".lastStatused", "Last Statused", 40, SWT.CENTER, false,
+ SortDataType.Date, false, "Retrieves timestamp of status (percent completed or hours spent).");
+ public static final XViewerColumn Validation_Required_Col =
+ new XViewerColumn(COLUMN_NAMESPACE + ".validationRequired", "Validation Required", 80, SWT.LEFT, false,
+ SortDataType.String, false,
+ "If set, Originator will be asked to perform a review to\nensure changes are as expected.");
+ public static final XViewerColumn[] WorldViewColumns =
+ new XViewerColumn[] {Type_Col, State_Col, Priority_Col, Change_Type_Col, Assignees_Col, Title_Col,
+ Actionable_Items_Col, User_Community_Col, ID_Col, Created_Date_Col, Version_Target_Col, Team_Col,
+ Notes_Col, Deadline_Col, Annual_Cost_Avoidance_Col, Description_Col, Legacy_PCR_Col, SW_Enhancement_Col,
+ Decision_Col, Resolution_Col, Groups_Col, Estimated_Release_Date_Col, Estimated_Completion_Date_Col,
+ Release_Date_Col, Work_Package_Col, Category_Col, Category2_Col, Category3_Col, Related_To_State_Col,
+ Estimated_Hours_Col, Weekly_Benefit_Hrs_Col, Remaining_Hours_Col, Percent_Complete_State_Col,
+ Percent_Complete_State_Task_Col, Percent_Complete_State_Review_Col, Percent_Complete_Total_Col,
+ Hours_Spent_State_Col, Hours_Spent_State_Task_Col, Hours_Spent_State_Review_Col, Hours_Spent_Total_Col,
+ Total_Hours_Spent_Col, Originator_Col, Implementor_Col, Review_Author_Col, Review_Moderator_Col,
+ Review_Reviewer_Col, Review_Decider_Col, Completed_Date_Col, Cancelled_Date_Col, Man_Days_Needed_Col,
+ Percent_Rework_Col, Branch_Status_Col, Number_of_Tasks_Col, Last_Modified_Col, Last_Statused_Col,
+ Validation_Required_Col};
+ private static String NAMESPACE = "org.eclipse.osee.ats.WorldXViewer";
+
+ public WorldXViewerFactory() {
+ super(NAMESPACE);
+ registerColumn(WorldViewColumns);
+ registerAllAttributeColumns();
+ }
+
+ @Override
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ return new WorldXViewerSorter(xViewer);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java
new file mode 100644
index 00000000000..1bf2314a8f1
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.ActionDebug;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerSorter;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldXViewerSorter extends XViewerSorter {
+
+ ActionDebug debug = new ActionDebug(true, "WorldXViewerSorter");
+ protected final XViewer xViewer;
+
+ /**
+ * @param xViewer
+ */
+ public WorldXViewerSorter(XViewer xViewer) {
+ super(xViewer);
+ this.xViewer = xViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerSorter#compare(org.eclipse.jface.viewers.Viewer,
+ * java.lang.Object, java.lang.Object, int)
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object o1, Object o2, int sortXColIndex) {
+ try {
+ if (xViewer == null || !xViewer.getCustomizeMgr().isSorting()) return 0;
+ XViewerColumn sortXCol = xViewer.getCustomizeMgr().getSortXCols().get(sortXColIndex);
+ IWorldViewArtifact m1 = (IWorldViewArtifact) ((Artifact) o1);
+ IWorldViewArtifact m2 = (IWorldViewArtifact) ((Artifact) o2);
+
+ if (sortXCol.equals(WorldXViewerFactory.Assignees_Col)) {
+ int compareInt =
+ getComparator().compare(
+ (new SMAManager((StateMachineArtifact) m1)).getAssigneesWasIsStr().replaceFirst("\\(", ""),
+ (new SMAManager((StateMachineArtifact) m2)).getAssigneesWasIsStr().replaceFirst("\\(", ""));
+ return getCompareBasedOnDirection(sortXCol, compareInt, viewer, o1, o2, sortXColIndex);
+ } else if (sortXCol.equals(WorldXViewerFactory.Change_Type_Col)) {
+ int compareInt =
+ getComparator().compare(m1.getWorldViewChangeType().ordinal() + "",
+ m2.getWorldViewChangeType().ordinal() + "");
+ return getCompareBasedOnDirection(sortXCol, compareInt, viewer, o1, o2, sortXColIndex);
+ }
+
+ return super.compare(viewer, o1, o2, sortXColIndex);
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return 1;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java
new file mode 100644
index 00000000000..c77093f6417
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXWidgetActionPage.java
@@ -0,0 +1,112 @@
+/*
+ * Created on Nov 16, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldXWidgetActionPage extends AtsXWidgetActionFormPage {
+
+ private final WorldEditor worldEditor;
+ private WorldComposite worldComposite;
+
+ /**
+ * @return the worldComposite
+ */
+ public WorldComposite getWorldComposite() {
+ return worldComposite;
+ }
+
+ /**
+ * @param editor
+ */
+ public WorldXWidgetActionPage(WorldEditor worldEditor) {
+ super(worldEditor, "org.eclipse.osee.ats.actionPage", "Actions");
+ this.worldEditor = worldEditor;
+ }
+
+ @Override
+ public Section createResultsSection(Composite body) {
+ resultsSection = toolkit.createSection(body, Section.NO_TITLE);
+ resultsSection.setText("Results");
+ resultsSection.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ resultsContainer = toolkit.createClientContainer(resultsSection, 1);
+ worldComposite = new WorldComposite(worldEditor, resultsContainer, SWT.BORDER, toolBar);
+ return resultsSection;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.forms.editor.FormPage#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ super.createPartControl(parent);
+
+ Result result = AtsPlugin.areOSEEServicesAvailable();
+ if (result.isFalse()) {
+ AWorkbench.popup("ERROR", "DB Connection Unavailable");
+ return;
+ }
+
+ try {
+ worldEditor.getWorldEditorProvider().run(worldEditor, SearchType.Search, false);
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#getDynamicWidgetLayoutListener()
+ */
+ @Override
+ public IDynamicWidgetLayoutListener getDynamicWidgetLayoutListener() {
+ if (worldEditor.getWorldEditorProvider() instanceof IWorldEditorParameterProvider) {
+ return ((IWorldEditorParameterProvider) worldEditor.getWorldEditorProvider()).getDynamicWidgetLayoutListener();
+ }
+ return null;
+ }
+
+ public void reSearch() throws OseeCoreException {
+ worldEditor.getWorldEditorProvider().run(worldEditor, SearchType.ReSearch, false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#getXWidgetsXml()
+ */
+ @Override
+ public String getXWidgetsXml() throws OseeCoreException {
+ if (worldEditor.getWorldEditorProvider() instanceof IWorldEditorParameterProvider) {
+ return ((IWorldEditorParameterProvider) worldEditor.getWorldEditorProvider()).getParameterXWidgetXml();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.AtsXWidgetActionFormPage#handleSearchButtonPressed()
+ */
+ @Override
+ public void handleSearchButtonPressed() {
+ try {
+ reSearch();
+ } catch (OseeCoreException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
new file mode 100644
index 00000000000..5ea839d050a
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
@@ -0,0 +1,218 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.ActionActionableItemListDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AbstractArtifactSearchCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemWorldSearchItem extends WorldUISearchItem {
+
+ private Collection<ActionableItemArtifact> actionItems;
+ private Set<ActionableItemArtifact> selectedActionItems;
+ private boolean recurseChildren;
+ private boolean selectedRecurseChildren; // Used to not corrupt original values
+ private boolean showFinished;
+ private boolean selectedShowFinished; // Used to not corrupt original values
+ private boolean showAction;
+ private boolean selectedShowAction; // Used to not corrupt original values
+ private final Collection<String> actionItemNames;
+
+ public ActionableItemWorldSearchItem(Collection<String> actionItemNames, String displayName, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.actionItemNames = actionItemNames;
+ this.showFinished = showFinished;
+ this.selectedShowFinished = showFinished; // Set as default in case UI is not used
+ this.showAction = showAction;
+ this.selectedShowAction = showAction; // Set as default in case UI is not used
+ this.recurseChildren = recurseChildren;
+ this.selectedRecurseChildren = recurseChildren; // Set as default in case UI is not used
+ }
+
+ public ActionableItemWorldSearchItem(String displayName, Collection<ActionableItemArtifact> actionItems, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.actionItemNames = null;
+ this.actionItems = actionItems;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public ActionableItemWorldSearchItem(ActionableItemWorldSearchItem item) {
+ super(item);
+ this.actionItemNames = item.actionItemNames;
+ this.actionItems = item.actionItems;
+ this.showFinished = item.showFinished;
+ this.showAction = item.showAction;
+ this.recurseChildren = item.recurseChildren;
+ }
+
+ public Collection<String> getProductSearchName() {
+ if (actionItemNames != null)
+ return actionItemNames;
+ else if (actionItems != null)
+ return Artifacts.artNames(actionItems);
+ else if (selectedActionItems != null) return Artifacts.artNames(selectedActionItems);
+ return new ArrayList<String>();
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), getProductSearchName());
+ }
+
+ public void getActionableItems() throws OseeCoreException {
+ if (actionItemNames != null && actionItems == null) {
+ for (String actionItemName : actionItemNames) {
+ ActionableItemArtifact aia = AtsCache.getSoleArtifactByName(actionItemName, ActionableItemArtifact.class);
+ if (aia != null) {
+ actionItems.add(aia);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return All directly specified teamDefs plus if recurse, will get all children
+ */
+ private Set<ActionableItemArtifact> getSearchActionableItems() throws OseeCoreException {
+ getActionableItems();
+ Set<ActionableItemArtifact> srchTeamDefs = new HashSet<ActionableItemArtifact>();
+ for (ActionableItemArtifact actionableItem : (actionItems != null ? actionItems : selectedActionItems))
+ srchTeamDefs.add(actionableItem);
+ if (selectedRecurseChildren) {
+ for (ActionableItemArtifact actionableItem : (actionItems != null ? actionItems : selectedActionItems)) {
+ Artifacts.getChildrenOfType(actionableItem, srchTeamDefs, ActionableItemArtifact.class, true);
+ }
+ }
+ return srchTeamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ Set<ActionableItemArtifact> items = getSearchActionableItems();
+ List<String> actionItemGuids = new ArrayList<String>(items.size());
+ for (ActionableItemArtifact ai : items) {
+ actionItemGuids.add(ai.getGuid());
+ }
+ List<AbstractArtifactSearchCriteria> criteria = new ArrayList<AbstractArtifactSearchCriteria>();
+
+ criteria.add(new AttributeCriteria(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName(), actionItemGuids));
+
+ if (!selectedShowFinished) {
+ List<String> cancelOrComplete = new ArrayList<String>(2);
+ cancelOrComplete.add(DefaultTeamState.Cancelled.name() + ";;;");
+ cancelOrComplete.add(DefaultTeamState.Completed.name() + ";;;");
+ criteria.add(new AttributeCriteria(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(), cancelOrComplete,
+ Operator.NOT_EQUAL));
+ }
+
+ List<Artifact> artifacts = ArtifactQuery.getArtifactsFromCriteria(AtsPlugin.getAtsBranch(), 1000, criteria);
+
+ if (selectedShowAction) {
+ return RelationManager.getRelatedArtifacts(artifacts, 1, AtsRelation.ActionToWorkflow_Action);
+ } else {
+ return artifacts;
+ }
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (actionItemNames != null) return;
+ if (actionItems != null) return;
+ if (searchType == SearchType.ReSearch && selectedActionItems != null) return;
+ ActionActionableItemListDialog diag = new ActionActionableItemListDialog(Active.Both);
+ diag.setShowFinished(showFinished);
+ diag.setShowAction(showAction);
+ diag.setRecurseChildren(recurseChildren);
+ int result = diag.open();
+ if (result == 0) {
+ selectedShowFinished = diag.isShowFinished();
+ selectedShowAction = diag.isShowAction();
+ selectedRecurseChildren = diag.isRecurseChildren();
+ if (selectedActionItems == null)
+ selectedActionItems = new HashSet<ActionableItemArtifact>();
+ else
+ selectedActionItems.clear();
+ for (Object obj : diag.getResult())
+ selectedActionItems.add((ActionableItemArtifact) obj);
+ return;
+ }
+ cancelled = true;
+ }
+
+ /**
+ * @param showAction The showAction to set.
+ */
+ public void setShowAction(boolean showAction) {
+ this.showAction = showAction;
+ }
+
+ /**
+ * @param showFinished The showFinished to set.
+ */
+ public void setShowFinished(boolean showFinished) {
+ this.showFinished = showFinished;
+ }
+
+ /**
+ * @return the recurseChildren
+ */
+ public boolean isRecurseChildren() {
+ return recurseChildren;
+ }
+
+ /**
+ * @param recurseChildren the recurseChildren to set
+ */
+ public void setRecurseChildren(boolean recurseChildren) {
+ this.recurseChildren = recurseChildren;
+ }
+
+ /**
+ * @param selectedActionItems the selectedActionItems to set
+ */
+ public void setSelectedActionItems(Set<ActionableItemArtifact> selectedActionItems) {
+ this.selectedActionItems = selectedActionItems;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ActionableItemWorldSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtIdSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtIdSearchItem.java
new file mode 100644
index 00000000000..64f63f51691
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtIdSearchItem.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ArtIdSearchItem extends WorldUISearchItem {
+ private String enteredIds = "";
+
+ public ArtIdSearchItem() {
+ super("Search by Guid/ArtId on Default Branch");
+ }
+
+ public ArtIdSearchItem(ArtIdSearchItem artIdSearchItem) {
+ super(artIdSearchItem);
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ Set<Artifact> artifacts = new HashSet<Artifact>();
+ for (Artifact art : ArtifactQuery.getArtifactsFromIds(Lib.stringToIntegerList(enteredIds),
+ BranchManager.getDefaultBranch(), false)) {
+ artifacts.add(art);
+ }
+ for (Artifact art : ArtifactQuery.getArtifactsFromIds(Arrays.asList(enteredIds.split(",")),
+ BranchManager.getDefaultBranch())) {
+ artifacts.add(art);
+ }
+ if (artifacts.size() == 0) {
+ AWorkbench.popup("ERROR",
+ "Didn't find any artifacts on default branch \"" + BranchManager.getDefaultBranch() + "\"");
+ }
+ return artifacts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), getName(), null,
+ "Enter Guid(s)/ArtId(s) (comma separated)", MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ int response = ed.open();
+ if (response == 0) {
+ enteredIds = ed.getEntry();
+ enteredIds = enteredIds.replaceAll(" ", "");
+ return;
+ } else
+ enteredIds = null;
+ cancelled = true;
+ }
+
+ /**
+ * @return the enteredIds
+ */
+ public String getEnteredIds() {
+ return enteredIds;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ArtIdSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypeSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypeSearchItem.java
new file mode 100644
index 00000000000..744a3344caf
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypeSearchItem.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ArtifactTypeSearchItem extends WorldUISearchItem {
+
+ private final String artifactTypeName;
+
+ public ArtifactTypeSearchItem(String name, String artifactTypeName) {
+ super(name);
+ this.artifactTypeName = artifactTypeName;
+ }
+
+ public ArtifactTypeSearchItem(ArtifactTypeSearchItem artifactTypeSearchItem) {
+ super(artifactTypeSearchItem);
+ this.artifactTypeName = artifactTypeSearchItem.artifactTypeName;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (artifactTypeName == null) throw new IllegalArgumentException("Inavlid search \"" + getName() + "\"");
+ return ArtifactQuery.getArtifactsFromType(artifactTypeName, AtsPlugin.getAtsBranch());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ArtifactTypeSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypesSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypesSearchItem.java
new file mode 100644
index 00000000000..04a6e954235
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ArtifactTypesSearchItem.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ArtifactTypesSearchItem extends WorldUISearchItem {
+
+ private final Collection<String> artifactTypeNames;
+
+ public ArtifactTypesSearchItem(String name, Collection<String> artifactTypeNames) {
+ super(name);
+ this.artifactTypeNames = artifactTypeNames;
+ }
+
+ public ArtifactTypesSearchItem(ArtifactTypesSearchItem artifactTypesSearchItem) {
+ super(artifactTypesSearchItem);
+ this.artifactTypeNames = artifactTypesSearchItem.artifactTypeNames;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (artifactTypeNames == null || artifactTypeNames.size() == 0) throw new OseeArgumentException(
+ "Inavlid search \"" + getName() + "\"");
+ return ArtifactQuery.getArtifactsFromTypes(artifactTypeNames, AtsPlugin.getAtsBranch());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ArtifactTypesSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java
new file mode 100644
index 00000000000..b6369e346bb
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.DepricatedOperator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeSearchItem extends WorldUISearchItem {
+
+ private String searchStr;
+ private final String attributeName;
+
+ public AtsAttributeSearchItem(String searchName, String attributeName, String searchStr) {
+ super(searchName);
+ this.attributeName = attributeName;
+ this.searchStr = searchStr;
+ }
+
+ public AtsAttributeSearchItem(String searchName, String searchStr) {
+ this("%", searchName, searchStr);
+ }
+
+ public AtsAttributeSearchItem() {
+ this("Search ATS Attributes", "%", "");
+ }
+
+ public AtsAttributeSearchItem(AtsAttributeSearchItem atsAttributeSearchItem) {
+ super(atsAttributeSearchItem);
+ this.searchStr = atsAttributeSearchItem.searchStr;
+ this.attributeName = atsAttributeSearchItem.attributeName;
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), searchStr);
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (searchStr == null) return EMPTY_SET;
+ LinkedList<ISearchPrimitive> criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new AttributeValueSearch(attributeName, searchStr, DepricatedOperator.CONTAINS));
+ FromArtifactsSearch stringCriteria = new FromArtifactsSearch(criteria, true);
+
+ LinkedList<ISearchPrimitive> atsObjectCriteria = new LinkedList<ISearchPrimitive>();
+ atsObjectCriteria.add(new ArtifactTypeSearch(ActionArtifact.ARTIFACT_NAME, DepricatedOperator.EQUAL));
+ for (String teamArtifactName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ atsObjectCriteria.add(new ArtifactTypeSearch(teamArtifactName, DepricatedOperator.EQUAL));
+ atsObjectCriteria.add(new ArtifactTypeSearch(TaskArtifact.ARTIFACT_NAME, DepricatedOperator.EQUAL));
+ FromArtifactsSearch atsObjectSearch = new FromArtifactsSearch(atsObjectCriteria, false);
+
+ LinkedList<ISearchPrimitive> bothCriteria = new LinkedList<ISearchPrimitive>();
+ bothCriteria.add(stringCriteria);
+ bothCriteria.add(atsObjectSearch);
+
+ if (cancelled) return EMPTY_SET;
+ Collection<Artifact> artifacts =
+ ArtifactPersistenceManager.getArtifacts(bothCriteria, true, AtsPlugin.getAtsBranch());
+ if (cancelled) return EMPTY_SET;
+ return artifacts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Search by Ats Attribute", null,
+ "Enter string to search for.", MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ if (ed.open() == 0) {
+ searchStr = ed.getEntry();
+ return;
+ } else
+ cancelled = true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new AtsAttributeSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsUserActivelyAssignedSearch.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsUserActivelyAssignedSearch.java
new file mode 100644
index 00000000000..f835f37f81e
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsUserActivelyAssignedSearch.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.DepricatedOperator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+
+/**
+ * Return all ATS Objects that a user is related to through logs, review roles, defects and etc.
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsUserActivelyAssignedSearch extends UserSearchItem {
+
+ public AtsUserActivelyAssignedSearch(String name, LoadView loadView) {
+ this(name, null, loadView);
+ }
+
+ public AtsUserActivelyAssignedSearch(String name, User user, LoadView loadView) {
+ super(name, user);
+ setLoadView(loadView);
+ }
+
+ public AtsUserActivelyAssignedSearch(AtsUserActivelyAssignedSearch atsActivelyAssignedSearch) {
+ super(atsActivelyAssignedSearch);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ List<ISearchPrimitive> currentStateCriteria = new LinkedList<ISearchPrimitive>();
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "<" + user.getUserId() + ">", DepricatedOperator.CONTAINS));
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "userId>" + user.getUserId() + "</userId", DepricatedOperator.CONTAINS));
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "user>" + user.getUserId() + "</user", DepricatedOperator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ List<ISearchPrimitive> smaArtifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artifactTypeName : StateMachineArtifact.getAllSMATypeNames()) {
+ smaArtifactTypeCriteria.add(new ArtifactTypeSearch(artifactTypeName, DepricatedOperator.EQUAL));
+ }
+ FromArtifactsSearch smaArtifactTypeSearch = new FromArtifactsSearch(smaArtifactTypeCriteria, false);
+
+ List<ISearchPrimitive> smaCriteria = new LinkedList<ISearchPrimitive>();
+ smaCriteria.add(smaArtifactTypeSearch);
+ smaCriteria.add(currentStateSearch);
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts = ArtifactPersistenceManager.getArtifacts(smaCriteria, true, AtsPlugin.getAtsBranch());
+
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.TeamLead_Team));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.TeamMember_Team));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.FavoriteUser_Artifact));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.SubscribedUser_Artifact));
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new AtsUserActivelyAssignedSearch(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java
new file mode 100644
index 00000000000..11225879673
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+import org.eclipse.osee.framework.skynet.core.artifact.UniversalGroup;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.GroupListDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class GroupWorldSearchItem extends WorldUISearchItem {
+
+ private Artifact group;
+ private Artifact selectedGroup;
+ private final String groupName;
+
+ public GroupWorldSearchItem(String displayName, String groupName) {
+ super(displayName);
+ this.groupName = groupName;
+ }
+
+ public GroupWorldSearchItem() {
+ this("Group Search", null);
+ }
+
+ public GroupWorldSearchItem(GroupWorldSearchItem groupWorldSearchItem) {
+ super(groupWorldSearchItem);
+ this.group = groupWorldSearchItem.group;
+ this.groupName = groupWorldSearchItem.groupName;
+ this.selectedGroup = groupWorldSearchItem.selectedGroup;
+ }
+
+ public String getGroupSearchName() {
+ if (group != null)
+ return group.getDescriptiveName();
+ else if (selectedGroup != null)
+ return selectedGroup.getDescriptiveName();
+ else if (groupName != null) return groupName;
+ return "";
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("Group Search - %s", getGroupSearchName());
+ }
+
+ public void getProduct() throws OseeCoreException {
+ if (groupName == null) return;
+ if (group == null) group =
+ UniversalGroup.getGroups(groupName, BranchManager.getDefaultBranch()).iterator().next();
+ if (group == null) throw new IllegalArgumentException("Can't Find Universal Group for " + getName());
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ getProduct();
+ if (getSearchGroup() == null) return EMPTY_SET;
+ Collection<Artifact> arts =
+ getSearchGroup().getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS);
+ if (cancelled) return EMPTY_SET;
+ return arts;
+ }
+
+ private Artifact getSearchGroup() {
+ if (group != null) return group;
+ if (selectedGroup != null) return selectedGroup;
+ return null;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (groupName != null) return;
+ if (group != null) return;
+ if (searchType == SearchType.ReSearch && selectedGroup != null) return;
+ GroupListDialog gld = new GroupListDialog(Display.getCurrent().getActiveShell());
+ int result = gld.open();
+ if (result == 0) {
+ selectedGroup = gld.getSelection();
+ return;
+ } else {
+ selectedGroup = null;
+ cancelled = true;
+ }
+ }
+
+ /**
+ * @param selectedGroup the selectedGroup to set
+ */
+ public void setSelectedGroup(Artifact selectedGroup) {
+ this.selectedGroup = selectedGroup;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new GroupWorldSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java
new file mode 100644
index 00000000000..92a4d7ed8b2
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AbstractArtifactSearchCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.RelationCriteria;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LegacyPCRActionsWorldSearchItem extends WorldUISearchItem {
+ private final boolean returnActions;
+ private final Collection<String> pcrIds;
+ private final Collection<TeamDefinitionArtifact> teamDefs;
+
+ public LegacyPCRActionsWorldSearchItem(Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs, boolean returnActions) {
+ super("");
+ this.pcrIds = pcrIds;
+ this.teamDefs = teamDefs;
+ this.returnActions = returnActions;
+ }
+
+ public LegacyPCRActionsWorldSearchItem(Collection<TeamDefinitionArtifact> teamDefs, boolean returnActions) {
+ this(null, teamDefs, returnActions);
+ }
+
+ public LegacyPCRActionsWorldSearchItem(LegacyPCRActionsWorldSearchItem legacyPCRActionsWorldSearchItem) {
+ super(legacyPCRActionsWorldSearchItem);
+ this.returnActions = legacyPCRActionsWorldSearchItem.returnActions;
+ this.pcrIds = legacyPCRActionsWorldSearchItem.pcrIds;
+ this.teamDefs = legacyPCRActionsWorldSearchItem.teamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ List<AbstractArtifactSearchCriteria> criteria = new ArrayList<AbstractArtifactSearchCriteria>(4);
+
+ if (pcrIds != null && pcrIds.size() > 0) {
+ criteria.add(new AttributeCriteria(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), pcrIds));
+ } else {
+ criteria.add(new AttributeCriteria(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName()));
+ }
+
+ if (teamDefs != null && teamDefs.size() > 0) {
+ List<String> teamDefGuids = new ArrayList<String>(teamDefs.size());
+ for (TeamDefinitionArtifact teamDef : teamDefs) {
+ teamDefGuids.add(teamDef.getGuid());
+ }
+ criteria.add(new AttributeCriteria(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), teamDefGuids));
+ }
+
+ if (returnActions) {
+ criteria.add(new RelationCriteria(AtsRelation.ActionToWorkflow_Action));
+ }
+
+ return ArtifactQuery.getArtifactsFromCriteria(AtsPlugin.getAtsBranch(), 200, criteria);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new LegacyPCRActionsWorldSearchItem(this);
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java
new file mode 100644
index 00000000000..a00a194ba71
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Pattern;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.LegacyPCRActions;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MultipleHridSearchItem extends WorldUISearchItem {
+ private String enteredIds = "";
+ Pattern numberPattern = Pattern.compile("^[0-9]+$");
+
+ public MultipleHridSearchItem(String name) {
+ super(name);
+ }
+
+ public MultipleHridSearchItem() {
+ this("Search by ID(s)");
+ }
+
+ public MultipleHridSearchItem(MultipleHridSearchItem multipleHridSearchItem) {
+ super(multipleHridSearchItem);
+ this.enteredIds = multipleHridSearchItem.enteredIds;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ List<String> hridGuids = new ArrayList<String>();
+ Set<String> nonHridGuids = new HashSet<String>();
+ for (String str : enteredIds.split(",")) {
+ str = str.replaceAll("\\s+", "");
+ if (str.length() == 5) {
+ hridGuids.add(str);
+ } else if (GUID.isValid(str)) hridGuids.add(str);
+ nonHridGuids.add(str);
+ }
+
+ if (isCancelled()) return EMPTY_SET;
+
+ Collection<Artifact> resultArts = new HashSet<Artifact>();
+
+ // If items were entered that are not HRIDs or Guids, attempt to open via legacy pcr field
+ if (nonHridGuids.size() > 0) {
+ Collection<ActionArtifact> actionArts =
+ LegacyPCRActions.getTeamsActionArtifacts(nonHridGuids, (Collection<TeamDefinitionArtifact>) null);
+ if (actionArts.size() != 0) {
+ for (ActionArtifact teamWf : actionArts) {
+ resultArts.add(teamWf);
+ }
+ }
+ }
+
+ if (hridGuids.size() > 0) {
+ Collection<Artifact> arts = ArtifactQuery.getArtifactsFromIds(hridGuids, AtsPlugin.getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ if (arts != null) resultArts.addAll(arts);
+ }
+ if (resultArts.size() == 0) {
+ OSEELog.logException(AtsPlugin.class,
+ "Invalid HRID/Guid/Legacy PCR Id(s): " + Lib.getCommaString(nonHridGuids), null, true);
+ }
+ return resultArts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), getName(), null,
+ "Enter GUID(s) or 5 Character ID(s) (comma separated)", MessageDialog.QUESTION, new String[] {"OK",
+ "Cancel"}, 0);
+ int response = ed.open();
+ if (response == 0) {
+ enteredIds = ed.getEntry();
+ if (enteredIds.equals("oseerocks")) {
+ AWorkbench.popup("Confirmation", "Confirmed! Osee Rocks!");
+ cancelled = true;
+ return;
+ }
+ enteredIds = enteredIds.replaceAll(" ", "");
+ return;
+ } else
+ enteredIds = null;
+ cancelled = true;
+ }
+
+ /**
+ * @return the enteredIds
+ */
+ public String getEnteredIds() {
+ return enteredIds;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MultipleHridSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java
new file mode 100644
index 00000000000..58ca779eb84
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyCompletedSearchItem extends UserSearchItem {
+
+ public MyCompletedSearchItem() {
+ this("My Completed", null);
+ }
+
+ public MyCompletedSearchItem(String name) {
+ super(name, null);
+ }
+
+ public MyCompletedSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ public MyCompletedSearchItem(MyCompletedSearchItem myCompletedSearchItem) {
+ super(myCompletedSearchItem);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ if (isCancelled()) return EMPTY_SET;
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ String valueToMatch =
+ "%state=\"Completed\" type=\"StateEntered\" userId=\"" + getSearchUser().getUserId() + "\"%";
+ return ArtifactQuery.getArtifactsFromAttribute(ATSAttributes.LOG_ATTRIBUTE.getStoreName(), valueToMatch,
+ AtsPlugin.getAtsBranch());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MyCompletedSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java
new file mode 100644
index 00000000000..7edde383d55
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyFavoritesSearchItem extends UserSearchItem {
+
+ public MyFavoritesSearchItem(String name) {
+ this(name, null);
+ }
+
+ public MyFavoritesSearchItem() {
+ this("My Favorites", null);
+ }
+
+ public MyFavoritesSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ public MyFavoritesSearchItem(MyFavoritesSearchItem myFavoritesSearchItem) {
+ super(myFavoritesSearchItem);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ return user.getRelatedArtifacts(AtsRelation.FavoriteUser_Artifact);
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ if (user != null) return;
+ super.performUI(searchType);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MyFavoritesSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java
new file mode 100644
index 00000000000..4c6685fb907
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyOrigSearchItem extends UserSearchItem {
+
+ private final OriginatedState originatedState;
+
+ public enum OriginatedState {
+ InWork, All
+ };
+
+ public MyOrigSearchItem(String name, User user, OriginatedState originatedState) {
+ super(name, user);
+ this.originatedState = originatedState;
+ }
+
+ public MyOrigSearchItem(MyOrigSearchItem myOrigSearchItem) {
+ super(myOrigSearchItem);
+ this.originatedState = myOrigSearchItem.originatedState;
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+
+ Collection<Artifact> artifacts =
+ ArtifactQuery.getArtifactsFromAttribute(ATSAttributes.LOG_ATTRIBUTE.getStoreName(),
+ "%type=\"Originated\" userId=\"" + user.getUserId() + "\"%", AtsPlugin.getAtsBranch());
+
+ List<Artifact> artifactsToReturn = new ArrayList<Artifact>(artifacts.size());
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof StateMachineArtifact) {
+ if (originatedState == OriginatedState.All || (originatedState == OriginatedState.InWork && !((StateMachineArtifact) artifact).getSmaMgr().isCancelledOrCompleted())) {
+ artifactsToReturn.add(artifact);
+ }
+ }
+ }
+ return artifactsToReturn;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MyOrigSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java
new file mode 100644
index 00000000000..3557e049b85
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ReviewSMArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyReviewWorkflowItem extends UserSearchItem {
+
+ private final ReviewState reviewState;
+
+ public enum ReviewState {
+ InWork, All
+ };
+
+ public MyReviewWorkflowItem(String name, User user, ReviewState reviewState) {
+ super(name, user);
+ this.reviewState = reviewState;
+ }
+
+ public MyReviewWorkflowItem(MyReviewWorkflowItem myReviewWorkflowItem) {
+ super(myReviewWorkflowItem);
+ this.reviewState = myReviewWorkflowItem.reviewState;
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+
+ Set<Artifact> assigned =
+ RelationManager.getRelatedArtifacts(Arrays.asList(user), 1, CoreRelationEnumeration.Users_Artifact);
+ Set<Artifact> artifacts = new HashSet<Artifact>(50);
+ // Because user can be assigned directly to review or through being assigned to task, add in
+ // all the original artifacts.
+ artifacts.addAll(assigned);
+
+ if (reviewState == ReviewState.InWork) {
+ artifacts.addAll(RelationManager.getRelatedArtifacts(assigned, 1, AtsRelation.SmaToTask_Sma));
+ } else {
+ artifacts.addAll(ArtifactQuery.getArtifactsFromAttribute(ATSAttributes.STATE_ATTRIBUTE.getStoreName(),
+ "%<" + user.getUserId() + ">%", AtsPlugin.getAtsBranch()));
+ }
+
+ List<Artifact> artifactsToReturn = new ArrayList<Artifact>(artifacts.size());
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof ReviewSMArtifact) {
+ if (reviewState == ReviewState.All || (reviewState == ReviewState.InWork && !((StateMachineArtifact) artifact).getSmaMgr().isCancelledOrCompleted())) {
+ artifactsToReturn.add(artifact);
+ }
+ }
+ }
+ return artifactsToReturn;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MyReviewWorkflowItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java
new file mode 100644
index 00000000000..6d4c2a00727
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MySubscribedSearchItem extends UserSearchItem {
+
+ public MySubscribedSearchItem(String name) {
+ this(name, null);
+ }
+
+ public MySubscribedSearchItem() {
+ this("My Subscribed", null);
+ }
+
+ public MySubscribedSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ public MySubscribedSearchItem(MySubscribedSearchItem mySubscribedSearchItem) {
+ super(mySubscribedSearchItem);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ return user.getRelatedArtifacts(AtsRelation.SubscribedUser_Artifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MySubscribedSearchItem(this);
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java
new file mode 100644
index 00000000000..2d1e6a3bdee
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyWorldSearchItem extends UserSearchItem {
+
+ public MyWorldSearchItem(String name) {
+ this(name, null);
+ }
+
+ public MyWorldSearchItem() {
+ super("My World", null);
+ }
+
+ public MyWorldSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ public MyWorldSearchItem(MyWorldSearchItem myWorldSearchItem) {
+ super(myWorldSearchItem);
+ }
+
+ @Override
+ public Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ Set<Artifact> assigned =
+ RelationManager.getRelatedArtifacts(Arrays.asList(user), 1, CoreRelationEnumeration.Users_Artifact);
+
+ Set<Artifact> artifacts =
+ RelationManager.getRelatedArtifacts(assigned, 4, AtsRelation.SmaToTask_Sma,
+ AtsRelation.TeamWorkflowToReview_Team, AtsRelation.ActionToWorkflow_Action);
+
+ List<Artifact> artifactsToReturn = new ArrayList<Artifact>(artifacts.size());
+ for (Artifact artifact : artifacts) {
+ if (artifact instanceof ActionArtifact) {
+ artifactsToReturn.add(artifact);
+ }
+ }
+ return artifactsToReturn;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new MyWorldSearchItem(this);
+ }
+
+} \ No newline at end of file
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java
new file mode 100644
index 00000000000..99506a278d4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NextVersionSearchItem extends WorldUISearchItem {
+
+ private final TeamDefinitionArtifact teamDefHoldingVersions;
+ private TeamDefinitionArtifact selectedTeamDef;
+ private VersionArtifact selectedVersionArt;
+
+ /**
+ * @param name
+ */
+ public NextVersionSearchItem(TeamDefinitionArtifact teamDefHoldingVersions, LoadView loadView) {
+ this(null, teamDefHoldingVersions, loadView);
+ }
+
+ public NextVersionSearchItem(String name, TeamDefinitionArtifact teamDefHoldingVersions, LoadView loadView) {
+ super(name != null ? name : "Workflows Targeted-For Next Version", loadView);
+ this.teamDefHoldingVersions = teamDefHoldingVersions;
+ }
+
+ public NextVersionSearchItem(NextVersionSearchItem nextVersionSearchItem) {
+ super(nextVersionSearchItem);
+ this.teamDefHoldingVersions = nextVersionSearchItem.teamDefHoldingVersions;
+ this.selectedTeamDef = nextVersionSearchItem.selectedTeamDef;
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ String name = super.getName();
+ TeamDefinitionArtifact teamDef = getTeamDefinition(searchType);
+ try {
+ if (teamDef != null) {
+ name += (teamDef != null ? " - " + teamDef.getDescriptiveName() : "");
+ selectedVersionArt = teamDef.getNextReleaseVersion();
+ name += (selectedVersionArt != null ? " - " + selectedVersionArt.getDescriptiveName() : "");
+ }
+ } catch (Exception ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return "Exception Occurred - See Log - " + ex.getLocalizedMessage();
+ }
+ return name;
+ }
+
+ private TeamDefinitionArtifact getTeamDefinition(SearchType searchType) {
+ if (teamDefHoldingVersions != null) return teamDefHoldingVersions;
+ return selectedTeamDef;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#performSearch()
+ */
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (isCancelled()) return EMPTY_SET;
+ if (getTeamDefinition(searchType).getNextReleaseVersion() == null) {
+ AWorkbench.popup("ERROR", "No version marked as Next Release for \"" + getTeamDefinition(searchType) + "\"");
+ return EMPTY_SET;
+ }
+ List<Artifact> arts =
+ getTeamDefinition(searchType).getNextReleaseVersion().getRelatedArtifacts(
+ AtsRelation.TeamWorkflowTargetedForVersion_Workflow);
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (teamDefHoldingVersions != null) return;
+ if (searchType == SearchType.ReSearch && selectedTeamDef != null) return;
+ try {
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Both));
+ int result = ld.open();
+ if (result == 0) {
+ selectedTeamDef = (TeamDefinitionArtifact) ld.getResult()[0];
+ return;
+ } else
+ cancelled = true;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ cancelled = true;
+ }
+
+ /**
+ * @param selectedTeamDef the selectedTeamDef to set
+ */
+ public void setSelectedTeamDef(TeamDefinitionArtifact selectedTeamDef) {
+ this.selectedTeamDef = selectedTeamDef;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new NextVersionSearchItem(this);
+ }
+
+ /**
+ * @return the selectedVersionArt
+ */
+ public VersionArtifact getSelectedVersionArt() {
+ return selectedVersionArt;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ReviewsSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ReviewsSearchItem.java
new file mode 100644
index 00000000000..36ae525fd52
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ReviewsSearchItem.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.DepricatedOperator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+
+/**
+ * Returns all reviews that user had a role in
+ *
+ * @author Donald G. Dunne
+ */
+public class ReviewsSearchItem extends UserSearchItem {
+
+ public ReviewsSearchItem(String name) {
+ this(name, null);
+ }
+
+ public ReviewsSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ public ReviewsSearchItem(ReviewsSearchItem reviewsSearchItem) {
+ super(reviewsSearchItem);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ List<ISearchPrimitive> currentStateCriteria = new LinkedList<ISearchPrimitive>();
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.ROLE_ATTRIBUTE.getStoreName(),
+ "<" + user.getUserId() + ">", DepricatedOperator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> reviewTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String reviewArtName : ReviewManager.getAllReviewArtifactTypeNames())
+ reviewTypeCriteria.add(new ArtifactTypeSearch(reviewArtName, DepricatedOperator.EQUAL));
+ FromArtifactsSearch reviewArtSearch = new FromArtifactsSearch(reviewTypeCriteria, false);
+
+ List<ISearchPrimitive> allCriteria = new LinkedList<ISearchPrimitive>();
+ allCriteria.add(currentStateSearch);
+ allCriteria.add(reviewArtSearch);
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts = ArtifactPersistenceManager.getArtifacts(allCriteria, true, AtsPlugin.getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ReviewsSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java
new file mode 100644
index 00000000000..f9100279e47
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AbstractArtifactSearchCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowOpenWorkflowsByArtifactType extends WorldUISearchItem {
+
+ private final String artifactTypeName;
+ private final boolean showFinished;
+ private final boolean showWorkflow;
+
+ public ShowOpenWorkflowsByArtifactType(String displayName, String artifactTypeName, boolean showFinished, boolean showWorkflow) {
+ super(displayName);
+ this.artifactTypeName = artifactTypeName;
+ this.showFinished = showFinished;
+ this.showWorkflow = showWorkflow;
+ }
+
+ public ShowOpenWorkflowsByArtifactType(ShowOpenWorkflowsByArtifactType showOpenWorkflowsByArtifactType) {
+ super(showOpenWorkflowsByArtifactType);
+ this.artifactTypeName = showOpenWorkflowsByArtifactType.artifactTypeName;
+ this.showFinished = showOpenWorkflowsByArtifactType.showFinished;
+ this.showWorkflow = showOpenWorkflowsByArtifactType.showWorkflow;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+
+ List<Artifact> artifacts = null;
+ if (!showFinished) {
+ List<AbstractArtifactSearchCriteria> criteria = new ArrayList<AbstractArtifactSearchCriteria>();
+ List<String> cancelOrComplete = new ArrayList<String>(2);
+ cancelOrComplete.add(DefaultTeamState.Cancelled.name() + ";;;");
+ cancelOrComplete.add(DefaultTeamState.Completed.name() + ";;;");
+ criteria.add(new AttributeCriteria(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(), cancelOrComplete,
+ Operator.NOT_EQUAL));
+ artifacts = ArtifactQuery.getArtifactsFromTypeAnd(artifactTypeName, AtsPlugin.getAtsBranch(), 500, criteria);
+ } else {
+ artifacts = ArtifactQuery.getArtifactsFromType(artifactTypeName, AtsPlugin.getAtsBranch());
+ }
+
+ if (showWorkflow) {
+ return RelationManager.getRelatedArtifacts(artifacts, 1, AtsRelation.TeamWorkflowToReview_Team);
+ } else {
+ return artifacts;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new ShowOpenWorkflowsByArtifactType(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java
new file mode 100644
index 00000000000..1e26d71aa2b
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateWorldSearchItem extends WorldUISearchItem {
+
+ private final String stateClass;
+ private String selectedStateClass;
+
+ public StateWorldSearchItem(String name) {
+ this(name, null);
+ }
+
+ public StateWorldSearchItem() {
+ this("Search by Current State", null);
+
+ }
+
+ public StateWorldSearchItem(StateWorldSearchItem stateWorldSearchItem) {
+ super(stateWorldSearchItem);
+ this.stateClass = stateWorldSearchItem.stateClass;
+ }
+
+ public String getStateSearchName() {
+ if (stateClass != null)
+ return stateClass;
+ else
+ return selectedStateClass;
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), getStateSearchName());
+ }
+
+ public StateWorldSearchItem(String name, String stateClass) {
+ super(name);
+ this.stateClass = stateClass;
+ }
+
+ private String getSearchStateClass() {
+ if (stateClass != null) return stateClass;
+ return selectedStateClass;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ Collection<Artifact> arts =
+ ArtifactQuery.getArtifactsFromAttribute(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ getSearchStateClass() + ";%", AtsPlugin.getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ if (stateClass != null) return;
+ if (searchType == SearchType.ReSearch && selectedStateClass != null) return;
+ EntryDialog ed = new EntryDialog("Enter State", "Enter state name.");
+ if (ed.open() == 0) {
+ selectedStateClass = ed.getEntry();
+ return;
+ }
+ cancelled = true;
+ }
+
+ /**
+ * @param selectedStateClass the selectedStateClass to set
+ */
+ public void setSelectedStateClass(String selectedStateClass) {
+ this.selectedStateClass = selectedStateClass;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new StateWorldSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TaskSearchWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TaskSearchWorldSearchItem.java
new file mode 100644
index 00000000000..cc7b7fb2ca3
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TaskSearchWorldSearchItem.java
@@ -0,0 +1,370 @@
+/*
+ * Created on Nov 20, 2008
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.task.ITaskEditorProvider;
+import org.eclipse.osee.ats.task.TaskEditorParameterSearchItem;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.XHyperlabelTeamDefinitionSelection;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem.ReleasedOption;
+import org.eclipse.osee.framework.db.connection.exception.OseeArgumentException;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Collections;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XHyperlabelGroupSelection;
+import org.eclipse.osee.framework.ui.skynet.widgets.XMembersCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskSearchWorldSearchItem extends TaskEditorParameterSearchItem {
+
+ private XMembersCombo assigneeCombo;
+ private XCheckBox includeCompletedCancelledCheckbox;
+ private XHyperlabelTeamDefinitionSelection teamCombo = null;
+ private XHyperlabelGroupSelection groupWidget = null;
+ private XCombo versionCombo = null;
+
+ /**
+ * @param worldSearchItem
+ */
+ public TaskSearchWorldSearchItem(WorldSearchItem worldSearchItem) {
+ super(worldSearchItem);
+ }
+
+ /**
+ * @param name
+ * @param loadView
+ */
+ public TaskSearchWorldSearchItem() {
+ super("Task Search");
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.TaskEditorParameterSearchItem#getParameterXWidgetXml()
+ */
+ @Override
+ public String getParameterXWidgetXml() throws OseeCoreException {
+ return "<xWidgets>" +
+ //
+ "<XWidget xwidgetType=\"XHyperlabelTeamDefinitionSelection\" displayName=\"Team Definitions(s)\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XCombo()\" beginComposite=\"8\" displayName=\"Version\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XHyperlabelGroupSelection\" displayName=\"Group(s)\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XMembersCombo\" displayName=\"Assignee\" horizontalLabel=\"true\"/>" +
+ //
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"Include Completed/Cancelled\" defaultValue=\"false\" labelAfter=\"true\" horizontalLabel=\"true\"/>" +
+ //
+ "</xWidgets>";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.TaskEditorParameterSearchItem#getTaskEditorTaskArtifacts()
+ */
+ @Override
+ public Collection<? extends Artifact> getTaskEditorTaskArtifacts() throws OseeCoreException {
+ List<Artifact> workflows = new ArrayList<Artifact>();
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ VersionArtifact verArt = getSelectedVersionArtifact();
+ Collection<Artifact> groups = getSelectedGroups();
+ User user = getSelectedUser();
+
+ // If only user selected, handle that case separately
+ if (verArt == null && teamDefs.size() == 0 && user != null) {
+ return handleOnlyUserSelected();
+ } // If version specified, get workflows from targeted relation
+ if (verArt != null) {
+ for (Artifact art : verArt.getRelatedArtifacts(AtsRelation.TeamWorkflowTargetedForVersion_Workflow)) {
+ if (teamDefs.size() == 0) {
+ workflows.add(art);
+ }
+ // Filter by team def if specified
+ else if (teamDefs.contains((((TeamWorkFlowArtifact) art).getTeamDefinition()))) {
+ workflows.add(art);
+ }
+ }
+ }
+ // Else, get workflows from teamdefs
+ else if (teamDefs.size() > 0) {
+ TeamWorldSearchItem teamWorldSearchItem =
+ new TeamWorldSearchItem("", teamDefs, true, false, false, null, null, ReleasedOption.UnReleased);
+ workflows.addAll(teamWorldSearchItem.performSearchGetResults(false, SearchType.Search));
+ } else if (groups.size() > 0) {
+ Set<TaskArtifact> taskArts = new HashSet<TaskArtifact>();
+ for (Artifact groupArt : groups) {
+ for (Artifact art : groupArt.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS)) {
+ if (art instanceof TaskArtifact) {
+ taskArts.add((TaskArtifact) art);
+ } else if (art instanceof StateMachineArtifact) {
+ taskArts.addAll(((StateMachineArtifact) art).getSmaMgr().getTaskMgr().getTaskArtifacts());
+ }
+ }
+ }
+ return filterByCompletedAndSelectedUser(taskArts);
+ }
+
+ // Bulk load tasks related to workflows
+ Collection<Artifact> artifacts = RelationManager.getRelatedArtifacts(workflows, 1, AtsRelation.SmaToTask_Task);
+
+ // Apply the remaining criteria
+ return filterByCompletedAndSelectedUser(artifacts);
+ }
+
+ private Collection<TaskArtifact> handleOnlyUserSelected() throws OseeCoreException {
+ return filterByCompletedAndSelectedUser(getUserAssignedTaskArtifacts());
+ }
+
+ private Collection<TaskArtifact> getUserAssignedTaskArtifacts() throws OseeCoreException {
+ Set<TaskArtifact> tasks = new HashSet<TaskArtifact>();
+ for (Artifact art : getSelectedUser().getRelatedArtifacts(CoreRelationEnumeration.Users_Artifact)) {
+ if (art instanceof TaskArtifact) {
+ tasks.add((TaskArtifact) art);
+ }
+ }
+ return tasks;
+ }
+
+ private Collection<TaskArtifact> filterByCompletedAndSelectedUser(Collection<? extends Artifact> artifacts) throws OseeCoreException {
+ Set<TaskArtifact> tasks = new HashSet<TaskArtifact>();
+ for (Artifact art : artifacts) {
+ TaskArtifact taskArt = (TaskArtifact) art;
+ // If not include completed and task is such, skip this task
+ if (!isIncludeCompletedCancelledCheckbox() && taskArt.getSmaMgr().isCancelledOrCompleted()) {
+ continue;
+ }
+ // If include completed and task is such and user not implementer, skip this task
+ if (isIncludeCompletedCancelledCheckbox() && taskArt.getSmaMgr().isCancelledOrCompleted() && getSelectedUser() != null && taskArt.getImplementers().contains(
+ getSelectedUser())) {
+ tasks.add(taskArt);
+ continue;
+ }
+ // If user is selected and not user is assigned, skip this task
+ else if (getSelectedUser() != null && !taskArt.getSmaMgr().getStateMgr().getAssignees().contains(
+ getSelectedUser())) {
+ continue;
+ }
+ tasks.add(taskArt);
+ }
+ return tasks;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.TaskEditorParameterSearchItem#isParameterSelectionValid()
+ */
+ @Override
+ public Result isParameterSelectionValid() throws OseeCoreException {
+ if (getSelectedUser() != null && isIncludeCompletedCancelledCheckbox() && getSelectedVersionArtifact() == null && getSelectedTeamDefinitions().size() == 0) {
+ // This case is unsupported and should be filtered out prior to this point
+ throw new OseeArgumentException("Unsupported User and Include Completed selected.");
+ }
+
+ // If only user selected, handle that case separately
+ if (getSelectedVersionArtifact() == null && getSelectedTeamDefinitions().size() == 0 && getSelectedUser() != null) {
+ return Result.TrueResult;
+ }
+
+ if (getSelectedGroups().size() > 0 && (getSelectedVersionArtifact() != null || getSelectedTeamDefinitions().size() > 0)) {
+ // This case is unsupported and should be filtered out prior to this point
+ throw new OseeArgumentException("Unsupported Groups selection with Version or Team(s).");
+ }
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#getTableLoadOptions()
+ */
+ @Override
+ public Collection<TableLoadOption> getTableLoadOptions() throws OseeCoreException {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#getTaskEditorLabel(org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType)
+ */
+ @Override
+ public String getTaskEditorLabel(SearchType searchType) throws OseeCoreException {
+ StringBuffer sb = new StringBuffer();
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ if (teamDefs.size() > 0) {
+ sb.append(" - Teams: " + org.eclipse.osee.framework.jdk.core.util.Collections.toString(",", teamDefs));
+ }
+ if (getSelectedVersionArtifact() != null) {
+ sb.append(" - Version: " + getSelectedVersionArtifact());
+ }
+ if (getSelectedGroups().size() > 0) {
+ sb.append(" - Groups: " + Collections.toString(",", getSelectedGroups()));
+ }
+ if (getSelectedUser() != null) {
+ sb.append(" - Assignee: " + getSelectedUser());
+ }
+ if (isIncludeCompletedCancelledCheckbox()) {
+ sb.append(" - Include Completed/Cancelled");
+ }
+ return "Tasks" + sb.toString();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener#createXWidgetLayoutData(org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayoutData, org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void createXWidgetLayoutData(DynamicXWidgetLayoutData layoutData, XWidget widget, FormToolkit toolkit, Artifact art, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.workflow.IDynamicWidgetLayoutListener#widgetCreating(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreating(XWidget widget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#widgetCreated(org.eclipse.osee.framework.ui.skynet.widgets.XWidget, org.eclipse.ui.forms.widgets.FormToolkit, org.eclipse.osee.framework.skynet.core.artifact.Artifact, org.eclipse.osee.framework.ui.skynet.widgets.workflow.DynamicXWidgetLayout, org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener, boolean)
+ */
+ @Override
+ public void widgetCreated(XWidget widget, FormToolkit toolkit, Artifact art, DynamicXWidgetLayout dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) throws OseeCoreException {
+ if (widget.getLabel().equals("Group(s)")) {
+ groupWidget = (XHyperlabelGroupSelection) widget;
+ }
+ if (widget.getLabel().equals("Assignee")) {
+ assigneeCombo = (XMembersCombo) widget;
+ }
+ if (widget.getLabel().equals("Include Completed/Cancelled")) {
+ includeCompletedCancelledCheckbox = (XCheckBox) widget;
+ }
+ if (widget.getLabel().equals("Version")) {
+ versionCombo = (XCombo) widget;
+ versionCombo.getComboBox().setVisibleItemCount(25);
+ widget.getLabelWidget().setToolTipText("Select Team to populate Version list");
+ }
+ if (widget.getLabel().equals("Team Definitions(s)")) {
+ teamCombo = (XHyperlabelTeamDefinitionSelection) widget;
+ teamCombo.addXModifiedListener(new XModifiedListener() {
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (versionCombo != null) {
+ try {
+ Collection<TeamDefinitionArtifact> teamDefArts = getSelectedTeamDefinitions();
+ if (teamDefArts.size() == 0) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ TeamDefinitionArtifact teamDefHoldingVersions =
+ teamDefArts.iterator().next().getTeamDefinitionHoldingVersions();
+ if (teamDefHoldingVersions == null) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ Collection<String> names =
+ Artifacts.artNames(teamDefHoldingVersions.getVersionsArtifacts(VersionReleaseType.Both));
+ if (names.size() == 0) {
+ versionCombo.setDataStrings(new String[] {});
+ return;
+ }
+ versionCombo.setDataStrings(names.toArray(new String[names.size()]));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ });
+ }
+ }
+
+ private User getSelectedUser() {
+ if (assigneeCombo == null) return null;
+ return assigneeCombo.getUser();
+ }
+
+ private boolean isIncludeCompletedCancelledCheckbox() {
+ if (includeCompletedCancelledCheckbox == null) return false;
+ return includeCompletedCancelledCheckbox.isSelected();
+ }
+
+ private VersionArtifact getSelectedVersionArtifact() throws OseeCoreException {
+ if (versionCombo == null) return null;
+ String versionStr = versionCombo.get();
+ if (versionStr == null || versionStr.equals("")) return null;
+ Collection<TeamDefinitionArtifact> teamDefs = getSelectedTeamDefinitions();
+ if (teamDefs.size() > 0) {
+ TeamDefinitionArtifact teamDefHoldingVersions = teamDefs.iterator().next().getTeamDefinitionHoldingVersions();
+ if (teamDefHoldingVersions == null) return null;
+ for (VersionArtifact versionArtifact : teamDefHoldingVersions.getVersionsArtifacts(VersionReleaseType.Both)) {
+ if (versionArtifact.getDescriptiveName().equals(versionStr)) {
+ return versionArtifact;
+ }
+ }
+ }
+ return null;
+ }
+
+ private Collection<TeamDefinitionArtifact> getSelectedTeamDefinitions() throws OseeCoreException {
+ return teamCombo.getSelectedTeamDefintions();
+ }
+
+ private Collection<Artifact> getSelectedGroups() throws OseeCoreException {
+ return groupWidget.getSelectedGroups();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldSearchItem#copy()
+ */
+ @Override
+ public TaskSearchWorldSearchItem copy() {
+ return new TaskSearchWorldSearchItem(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#copyProvider()
+ */
+ @Override
+ public ITaskEditorProvider copyProvider() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#setCustomizeData(org.eclipse.osee.framework.ui.skynet.widgets.xviewer.customize.CustomizeData)
+ */
+ @Override
+ public void setCustomizeData(CustomizeData customizeData) {
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.task.ITaskEditorProvider#setTableLoadOptions(org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateComposite.TableLoadOption[])
+ */
+ @Override
+ public void setTableLoadOptions(TableLoadOption... tableLoadOptions) {
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
new file mode 100644
index 00000000000..f73482bfea4
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact.DefaultTeamState;
+import org.eclipse.osee.ats.config.AtsCache;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AbstractArtifactSearchCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeCriteria;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorldSearchItem extends WorldUISearchItem {
+
+ public enum ReleasedOption {
+ Released, UnReleased, Both
+ };
+ private Collection<TeamDefinitionArtifact> teamDefs;
+ private final boolean recurseChildren;
+ private boolean showFinished;
+ private boolean showAction;
+ private final Collection<String> teamDefNames;
+ private final ChangeType changeType;
+ private final VersionArtifact versionArt;
+ private final User userArt;
+ private final ReleasedOption releasedOption;
+
+ public TeamWorldSearchItem(String displayName, String[] teamDefNames, boolean showFinished, boolean showAction, boolean recurseChildren, ChangeType changeType, VersionArtifact versionArt, User userArt, ReleasedOption releasedOption) {
+ super(displayName);
+ this.versionArt = versionArt;
+ this.userArt = userArt;
+ if (teamDefNames != null) {
+ this.teamDefNames = Arrays.asList(teamDefNames);
+ } else {
+ this.teamDefNames = null;
+ }
+ this.showFinished = showFinished;
+ this.releasedOption = releasedOption;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ this.changeType = changeType;
+ }
+
+ public TeamWorldSearchItem(String displayName, Collection<TeamDefinitionArtifact> teamDefs, boolean showFinished, boolean showAction, boolean recurseChildren, VersionArtifact versionArt, User userArt, ReleasedOption releasedOption) {
+ super(displayName);
+ this.versionArt = versionArt;
+ this.userArt = userArt;
+ this.recurseChildren = recurseChildren;
+ this.releasedOption = releasedOption;
+ this.teamDefNames = null;
+ this.teamDefs = teamDefs;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.changeType = null;
+ }
+
+ public TeamWorldSearchItem(TeamWorldSearchItem teamWorldUISearchItem) {
+ super(teamWorldUISearchItem);
+ this.versionArt = null;
+ this.userArt = null;
+ this.releasedOption = null;
+ this.recurseChildren = teamWorldUISearchItem.recurseChildren;
+ this.teamDefNames = teamWorldUISearchItem.teamDefNames;
+ this.teamDefs = teamWorldUISearchItem.teamDefs;
+ this.showFinished = teamWorldUISearchItem.showFinished;
+ this.showAction = teamWorldUISearchItem.showAction;
+ this.changeType = teamWorldUISearchItem.changeType;
+ }
+
+ public Collection<String> getProductSearchName() {
+ if (teamDefNames != null)
+ return teamDefNames;
+ else if (teamDefs != null) return Artifacts.artNames(teamDefs);
+ return new ArrayList<String>();
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), getProductSearchName());
+ }
+
+ /**
+ * Loads all team definitions if specified by name versus by team definition class
+ *
+ * @throws IllegalArgumentException
+ */
+ public void getTeamDefs() throws OseeCoreException {
+ if (teamDefNames != null && teamDefs == null) {
+ teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (String teamDefName : teamDefNames) {
+ TeamDefinitionArtifact aia = AtsCache.getSoleArtifactByName(teamDefName, TeamDefinitionArtifact.class);
+ if (aia != null) {
+ teamDefs.add(aia);
+ }
+ }
+ }
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ getTeamDefs();
+ List<String> teamDefinitionGuids = new ArrayList<String>(teamDefs.size());
+ for (TeamDefinitionArtifact art : teamDefs) {
+ teamDefinitionGuids.add(art.getGuid());
+ }
+ List<AbstractArtifactSearchCriteria> criteria = new ArrayList<AbstractArtifactSearchCriteria>();
+ criteria.add(new AttributeCriteria(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(),
+ teamDefinitionGuids));
+
+ if (!showFinished) {
+ List<String> cancelOrComplete = new ArrayList<String>(2);
+ cancelOrComplete.add(DefaultTeamState.Cancelled.name() + ";;;");
+ cancelOrComplete.add(DefaultTeamState.Completed.name() + ";;;");
+ criteria.add(new AttributeCriteria(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(), cancelOrComplete,
+ Operator.NOT_EQUAL));
+ }
+ if (changeType != null) {
+ criteria.add(new AttributeCriteria(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), changeType.name()));
+ }
+
+ List<Artifact> artifacts = ArtifactQuery.getArtifactsFromCriteria(AtsPlugin.getAtsBranch(), 1000, criteria);
+
+ Set<Artifact> resultSet = new HashSet<Artifact>();
+ for (Artifact art : artifacts) {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ // don't include if userArt specified and userArt not assignee
+ if (userArt != null && !sma.getSmaMgr().getStateMgr().getAssignees().contains(userArt)) {
+ continue;
+ }
+ // don't include if version specified and workflow's not targeted for version
+ if (versionArt != null) {
+ TeamWorkFlowArtifact team = sma.getParentTeamWorkflow();
+ if (team != null && (team.getWorldViewTargetedVersion() == null || !team.getWorldViewTargetedVersion().equals(
+ versionArt))) {
+ continue;
+ }
+ }
+ // don't include if release option doesn't match relese state of targeted version
+ if (releasedOption != ReleasedOption.Both) {
+ TeamWorkFlowArtifact team = sma.getParentTeamWorkflow();
+ if (team != null) {
+ // skip if released is desired and version artifact is not set
+ VersionArtifact setVerArt = team.getWorldViewTargetedVersion();
+ if (setVerArt == null && releasedOption == ReleasedOption.Released) {
+ continue;
+ }
+ // skip of version release is opposite of desired
+ if (setVerArt != null) {
+ if (releasedOption == ReleasedOption.Released && !setVerArt.isReleased()) {
+ continue;
+ } else if (releasedOption == ReleasedOption.UnReleased && setVerArt.isReleased()) {
+ continue;
+ }
+ }
+ }
+ }
+ resultSet.add(art);
+ }
+ if (showAction) {
+ return RelationManager.getRelatedArtifacts(resultSet, 1, AtsRelation.ActionToWorkflow_Action);
+ } else {
+ return resultSet;
+ }
+
+ }
+
+ /**
+ * @param showAction The showAction to set.
+ */
+ public void setShowAction(boolean showAction) {
+ this.showAction = showAction;
+ }
+
+ /**
+ * @param showFinished The showFinished to set.
+ */
+ public void setShowFinished(boolean showFinished) {
+ this.showFinished = showFinished;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new TeamWorldSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java
new file mode 100644
index 00000000000..308d1a210b8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.ats.util.widgets.dialog.UserCommunityListDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.DepricatedOperator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserCommunitySearchItem extends WorldUISearchItem {
+
+ private String userComm;
+ private String selectedUserComm;
+ private final String userCommName;
+
+ public UserCommunitySearchItem(String displayName, String userCommName) {
+ super(displayName);
+ this.userCommName = userCommName;
+ }
+
+ public UserCommunitySearchItem() {
+ this("User Community Search", null);
+ }
+
+ public UserCommunitySearchItem(UserCommunitySearchItem userCommunitySearchItem) {
+ super(userCommunitySearchItem);
+ this.userComm = userCommunitySearchItem.userComm;
+ this.userCommName = userCommunitySearchItem.userCommName;
+ }
+
+ public String getGroupSearchName() {
+ if (userComm != null)
+ return userComm;
+ else if (selectedUserComm != null) return selectedUserComm;
+ return "";
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), getGroupSearchName());
+ }
+
+ private String getSearchUserComm() {
+ if (userComm != null) return userComm;
+ return selectedUserComm;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (isCancelled()) return EMPTY_SET;
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames()) {
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, DepricatedOperator.EQUAL));
+ }
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new AttributeValueSearch(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName(), getSearchUserComm(),
+ DepricatedOperator.EQUAL));
+ criteria.add(teamWorkflowSearch);
+ FromArtifactsSearch criteriaSearch = new FromArtifactsSearch(criteria, true);
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(criteriaSearch, AtsRelation.ActionToWorkflow_Action));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getArtifacts(actionCriteria, true, AtsPlugin.getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (userCommName != null) return;
+ if (userComm != null) return;
+ if (searchType == SearchType.ReSearch && selectedUserComm != null) return;
+ UserCommunityListDialog gld = new UserCommunityListDialog();
+ int result = gld.open();
+ if (result == 0) {
+ selectedUserComm = (String) gld.getResult()[0];
+ return;
+ } else {
+ selectedUserComm = null;
+ cancelled = true;
+ }
+ }
+
+ /**
+ * @param selectedUserComm the selectedUserComm to set
+ */
+ public void setSelectedUserComm(String selectedUserComm) {
+ this.selectedUserComm = selectedUserComm;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new UserCommunitySearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java
new file mode 100644
index 00000000000..5bd603a0f29
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserRelatedToAtsObjectSearch.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.util.AtsRelation;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.DepricatedOperator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+
+/**
+ * Return all ATS Objects that a user is related to through logs, review roles, defects and etc.
+ *
+ * @author Donald G. Dunne
+ */
+public class UserRelatedToAtsObjectSearch extends UserSearchItem {
+
+ private final boolean activeObjectsOnly;
+
+ public UserRelatedToAtsObjectSearch(String name, User user, boolean activeObjectsOnly, LoadView loadView) {
+ super(name, user);
+ this.activeObjectsOnly = activeObjectsOnly;
+ setLoadView(loadView);
+ }
+
+ public UserRelatedToAtsObjectSearch(UserRelatedToAtsObjectSearch userRelatedToAtsObjectSearch) {
+ super(userRelatedToAtsObjectSearch);
+ this.activeObjectsOnly = userRelatedToAtsObjectSearch.activeObjectsOnly;
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ List<ISearchPrimitive> currentStateCriteria = new LinkedList<ISearchPrimitive>();
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "<" + user.getUserId() + ">", DepricatedOperator.CONTAINS));
+ if (!activeObjectsOnly) {
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.STATE_ATTRIBUTE.getStoreName(),
+ "<" + user.getUserId() + ">", DepricatedOperator.CONTAINS));
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.LOG_ATTRIBUTE.getStoreName(),
+ "userId=\"" + user.getUserId() + "\"", DepricatedOperator.CONTAINS));
+ }
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "userId>" + user.getUserId() + "</userId", DepricatedOperator.CONTAINS));
+ currentStateCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ "user>" + user.getUserId() + "</user", DepricatedOperator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ List<ISearchPrimitive> smaArtifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artifactTypeName : StateMachineArtifact.getAllSMATypeNames()) {
+ smaArtifactTypeCriteria.add(new ArtifactTypeSearch(artifactTypeName, DepricatedOperator.EQUAL));
+ }
+ FromArtifactsSearch smaArtifactTypeSearch = new FromArtifactsSearch(smaArtifactTypeCriteria, false);
+
+ List<ISearchPrimitive> smaCriteria = new LinkedList<ISearchPrimitive>();
+ smaCriteria.add(smaArtifactTypeSearch);
+ smaCriteria.add(currentStateSearch);
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts = ArtifactPersistenceManager.getArtifacts(smaCriteria, true, AtsPlugin.getAtsBranch());
+
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.TeamLead_Team));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.TeamMember_Team));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.FavoriteUser_Artifact));
+ arts.addAll(user.getRelatedArtifacts(AtsRelation.SubscribedUser_Artifact));
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new UserRelatedToAtsObjectSearch(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
new file mode 100644
index 00000000000..2573faf9ac0
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.UserListDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class UserSearchItem extends WorldUISearchItem {
+
+ protected final User user;
+ protected User selectedUser;
+
+ public UserSearchItem(String name) {
+ this(name, null);
+ }
+
+ public UserSearchItem(String name, User user) {
+ super(name);
+ this.user = user;
+ }
+
+ public UserSearchItem(UserSearchItem userSearchItem) {
+ super(userSearchItem);
+ this.user = userSearchItem.user;
+ this.selectedUser = userSearchItem.selectedUser;
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return String.format("%s - %s", super.getSelectedName(searchType), getUserSearchName());
+ }
+
+ public String getUserSearchName() {
+ if (user != null)
+ return user.getName();
+ else if (selectedUser != null) return selectedUser.getName();
+ return "";
+ }
+
+ public User getSearchUser() {
+ if (user != null) return user;
+ return selectedUser;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+ if (isCancelled()) return EMPTY_SET;
+ if (user != null)
+ return searchIt(user);
+ else
+ return searchIt();
+ }
+
+ protected Collection<Artifact> searchIt(User user) throws OseeCoreException {
+ return EMPTY_SET;
+ }
+
+ private Collection<Artifact> searchIt() throws OseeCoreException {
+ if (isCancelled()) return EMPTY_SET;
+ if (selectedUser != null) return searchIt(selectedUser);
+ return EMPTY_SET;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (user != null) return;
+ if (searchType == SearchType.ReSearch && selectedUser != null) return;
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell());
+ int result = ld.open();
+ if (result == 0) {
+ selectedUser = ld.getSelection();
+ return;
+ }
+ cancelled = true;
+ }
+
+ /**
+ * @param selectedUser the selectedUser to set
+ */
+ public void setSelectedUser(User selectedUser) {
+ this.selectedUser = selectedUser;
+ }
+
+ /**
+ * @return the user
+ */
+ public User getDefaultUser() {
+ return user;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof UserSearchItem) {
+ UserSearchItem wsi = (UserSearchItem) obj;
+ try {
+ if (!getClass().equals(obj.getClass()) || !wsi.getName().equals(getName()) || wsi.getLoadView() != getLoadView()) {
+ return false;
+ }
+ } catch (OseeCoreException ex) {
+ return false;
+ }
+ if (getDefaultUser() != null && wsi.getDefaultUser() != null) {
+ if (!wsi.getDefaultUser().equals(getDefaultUser())) return false;
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ try {
+ return getName().hashCode() + (getDefaultUser() != null ? getDefaultUser().hashCode() : 0) * 13;
+ } catch (OseeCoreException ex) {
+ return 0;
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java
new file mode 100644
index 00000000000..3ac9ac59f91
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.ats.util.widgets.dialog.VersionListDialog;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VersionTargetedForTeamSearchItem extends WorldUISearchItem {
+ private final VersionArtifact versionArt;
+ private VersionArtifact selectedVersionArt;
+ private final boolean returnAction;
+ private final TeamDefinitionArtifact teamDef;
+ private TeamDefinitionArtifact selectedTeamDef;
+
+ public VersionTargetedForTeamSearchItem(TeamDefinitionArtifact teamDef, VersionArtifact versionArt, boolean returnAction, LoadView loadView) {
+ this(null, teamDef, versionArt, returnAction, loadView);
+ }
+
+ public VersionTargetedForTeamSearchItem(String name, TeamDefinitionArtifact teamDef, VersionArtifact versionArt, boolean returnAction, LoadView loadView) {
+ super(name != null ? name : (returnAction ? "Actions" : "Workflows") + " Targeted-For Version", loadView);
+ this.teamDef = teamDef;
+ this.versionArt = versionArt;
+ this.returnAction = returnAction;
+ }
+
+ public VersionTargetedForTeamSearchItem(VersionTargetedForTeamSearchItem versionTargetedForTeamSearchItem) {
+ super(versionTargetedForTeamSearchItem);
+ this.versionArt = versionTargetedForTeamSearchItem.versionArt;
+ this.returnAction = versionTargetedForTeamSearchItem.returnAction;
+ this.teamDef = versionTargetedForTeamSearchItem.teamDef;
+ }
+
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ if (getSearchVersionArtifact() != null) return super.getName() + " - " + getSearchVersionArtifact();
+ return "";
+ }
+
+ public VersionArtifact getSearchVersionArtifact() {
+ if (versionArt != null) return versionArt;
+ return selectedVersionArt;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException {
+
+ if (getSearchVersionArtifact() == null) throw new IllegalArgumentException("Invalid release version");
+
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ for (Artifact art : getSearchVersionArtifact().getTargetedForTeamArtifacts())
+ if (returnAction)
+ arts.add(((TeamWorkFlowArtifact) art).getParentActionArtifact());
+ else
+ arts.add(art);
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ super.performUI(searchType);
+ if (searchType == SearchType.ReSearch && selectedVersionArt != null) return;
+ if (versionArt != null) return;
+ try {
+ selectedTeamDef = teamDef;
+ if (versionArt == null && selectedTeamDef == null) {
+ TeamDefinitionDialog ld = new TeamDefinitionDialog("Select Team", "Select Team");
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Both));
+ int result = ld.open();
+ if (result == 0) {
+ selectedTeamDef = (TeamDefinitionArtifact) ld.getResult()[0];
+ } else
+ cancelled = true;
+ }
+ if (versionArt == null && selectedTeamDef != null) {
+ final VersionListDialog vld =
+ new VersionListDialog("Select Version", "Select Version",
+ selectedTeamDef.getVersionsArtifacts(VersionReleaseType.Both));
+ if (vld.open() == 0) {
+ selectedVersionArt = (VersionArtifact) vld.getResult()[0];
+ return;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ cancelled = true;
+ }
+
+ /**
+ * @param selectedVersionArt the selectedVersionArt to set
+ */
+ public void setSelectedVersionArt(VersionArtifact selectedVersionArt) {
+ this.selectedVersionArt = selectedVersionArt;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.search.WorldUISearchItem#copy()
+ */
+ @Override
+ public WorldUISearchItem copy() {
+ return new VersionTargetedForTeamSearchItem(this);
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java
new file mode 100644
index 00000000000..1253acac5e6
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class WorldSearchItem {
+
+ private final String name;
+ protected static Set<Artifact> EMPTY_SET = new HashSet<Artifact>();
+ protected boolean cancelled = false;
+ private LoadView loadView;
+ public static enum LoadView {
+ TaskEditor, WorldEditor, None
+ }
+ public static enum SearchType {
+ Search, ReSearch
+ };
+ public static enum ShowActionType {
+ ShowAction, ShowTeamWorkflow
+ }
+
+ public static enum RecurseType {
+ RecurseChildren, None
+ }
+
+ public static enum ShowFinishedType {
+ ShowAll, ShowFinished
+ }
+
+ public WorldSearchItem(String name) {
+ this(name, LoadView.WorldEditor);
+ }
+
+ public WorldSearchItem(String name, LoadView loadView) {
+ super();
+ this.name = name;
+ this.loadView = loadView;
+ this.cancelled = false;
+ }
+
+ public WorldSearchItem(WorldSearchItem worldSearchItem) {
+ this.name = worldSearchItem.name;
+ this.cancelled = worldSearchItem.cancelled;
+ this.loadView = worldSearchItem.loadView;
+ }
+
+ public abstract WorldSearchItem copy();
+
+ public String getName() throws OseeCoreException {
+ return name;
+ }
+
+ /**
+ * Method called to display the current search in the view. Override to provide more information about selected
+ * values (eg MyWorld)
+ *
+ * @param searchType TODO
+ * @return selected name
+ * @throws OseeCoreException
+ */
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return getName();
+ }
+
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ /**
+ * @return the loadView
+ */
+ public LoadView getLoadView() {
+ return loadView;
+ }
+
+ /**
+ * @param loadView the loadView to set
+ */
+ public void setLoadView(LoadView loadView) {
+ this.loadView = loadView;
+ }
+
+ @Override
+ public String toString() {
+ try {
+ return getName();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java
new file mode 100644
index 00000000000..df59ef16331
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldUISearchItem.java
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.world.search;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.db.connection.exception.OseeCoreException;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class WorldUISearchItem extends WorldSearchItem {
+
+ public WorldUISearchItem(String name) {
+ this(name, LoadView.WorldEditor);
+ }
+
+ public WorldUISearchItem(String name, LoadView loadView) {
+ super(name, loadView);
+ }
+
+ public WorldUISearchItem(WorldUISearchItem WorldUISearchItem) {
+ super(WorldUISearchItem);
+ }
+
+ /**
+ * Method called to display the current search in the view. Override to provide more information about selected
+ * values (eg MyWorld)
+ *
+ * @param searchType TODO
+ * @return selected name
+ * @throws OseeCoreException
+ */
+ @Override
+ public String getSelectedName(SearchType searchType) throws OseeCoreException {
+ return getName();
+ }
+
+ public abstract Collection<Artifact> performSearch(SearchType searchType) throws OseeCoreException;
+
+ public Collection<Artifact> performReSearch() {
+ return EMPTY_SET;
+ }
+
+ public Collection<Artifact> performSearchGetResults() throws OseeCoreException {
+ return performSearchGetResults(false, SearchType.Search);
+ }
+
+ public Collection<Artifact> performSearchGetResults(SearchType searchType) throws OseeCoreException {
+ return performSearchGetResults(false, searchType);
+ }
+
+ public Collection<Artifact> performSearchGetResults(boolean performUi) throws OseeCoreException {
+ return performSearchGetResults(performUi, SearchType.Search);
+ }
+
+ public Collection<Artifact> performSearchGetResults(boolean performUi, final SearchType searchType) throws OseeCoreException {
+ cancelled = false;
+ if (performUi) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ try {
+ performUI(searchType);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }, true);
+
+ }
+ if (cancelled) return EMPTY_SET;
+ return performSearch(searchType);
+ }
+
+ public void performUI(SearchType searchType) throws OseeCoreException {
+ cancelled = false;
+ }
+
+}
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml b/0.5.0_20081201/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml
new file mode 100644
index 00000000000..e0532420538
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml
@@ -0,0 +1,1712 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <LastAuthor>Ryan Brooks</LastAuthor>
+ <Created>2006-03-10T14:37:59Z</Created>
+ <LastSaved>2008-11-29T20:19:36Z</LastSaved>
+ <Version>11.9999</Version>
+ </DocumentProperties>
+ <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
+ <DoNotRelyOnCSS/>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>11130</WindowHeight>
+ <WindowWidth>18900</WindowWidth>
+ <WindowTopX>-15</WindowTopX>
+ <WindowTopY>-15</WindowTopY>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s20" ss:Name="Percent">
+ <NumberFormat ss:Format="0%"/>
+ </Style>
+ <Style ss:ID="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
+ </Style>
+ <Style ss:ID="s22">
+ <Font x:Family="Swiss" ss:Size="9"/>
+ </Style>
+ <Style ss:ID="s23">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
+ <Interior/>
+ </Style>
+ <Style ss:ID="s24">
+ <Alignment ss:Horizontal="Center" ss:Vertical="Bottom"/>
+ </Style>
+ <Style ss:ID="s25">
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="3"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
+ </Style>
+ <Style ss:ID="s26">
+ <Borders>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Size="9"/>
+ </Style>
+ <Style ss:ID="s27">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
+ <Borders>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Size="9"/>
+ <NumberFormat/>
+ </Style>
+ <Style ss:ID="s29">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s32">
+ <NumberFormat ss:Format="@"/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="SkyNet_ATS">
+ <Names>
+ <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=SkyNet_ATS!R211C1:R236C5"
+ ss:Hidden="1"/>
+ </Names>
+ <Table ss:ExpandedColumnCount="11" ss:ExpandedRowCount="240" x:FullColumns="1"
+ x:FullRows="1">
+ <Column ss:AutoFitWidth="0" ss:Width="286.5"/>
+ <Column ss:AutoFitWidth="0" ss:Width="339.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="186.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="132.75"/>
+ <Column ss:Width="147.75"/>
+ <Column ss:Index="7" ss:AutoFitWidth="0" ss:Width="91.5"/>
+ <Column ss:Index="9" ss:Width="63.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="57"/>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String"># Factory to Artifact Mapping</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="14.25">
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Factory Class</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Artifact Type Name</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Super Type Name</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Actionable Item</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.ats.artifact.AtsArtifactFactory</Data></Cell>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22"/>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String"># Attribute definition</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="14.25">
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Attribute Base Type</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Attribute Data Provider</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Attribute Name</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">File Extension</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Tagger ID</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Default Value</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Validity Xml</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Min Occurrence</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Max Occurrence</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Tip Text</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">User Visible</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Validation Required</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Active</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">yes</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution Override</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution Override</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem Override</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Uses Resolution Options</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Released</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Next Version</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Uses Versions</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Require Targeted Version</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Blocking Review</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Metrics from Tasks</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="String">yes</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Completion Date</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Release Date</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Blocks</Data></Cell>
+ <Cell ss:Index="7"><Data ss:Type="String">&lt;ReviewBlocks&gt;&lt;Enum&gt;None&lt;/Enum&gt;&lt;Enum&gt;Transition&lt;/Enum&gt;&lt;Enum&gt;Commit&lt;/Enum&gt;&lt;/ReviewBlocks&gt;</Data></Cell>
+ <Cell><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Priority</Data></Cell>
+ <Cell ss:Index="7"><Data ss:Type="String">&lt;Priority&gt;&lt;Enum&gt;1&lt;/Enum&gt;&lt;Enum&gt;2&lt;/Enum&gt;&lt;Enum&gt;3&lt;/Enum&gt;&lt;Enum&gt;4&lt;/Enum&gt;&lt;Enum&gt;5&lt;/Enum&gt;&lt;/Priority&gt;</Data></Cell>
+ <Cell><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Change Type</Data></Cell>
+ <Cell ss:Index="7"><Data ss:Type="String">&lt;ChangeType&gt;&lt;Enum&gt;Improvement&lt;/Enum&gt;&lt;Enum&gt;Problem&lt;/Enum&gt;&lt;Enum&gt;Support&lt;/Enum&gt;&lt;/ChangeType&gt;</Data></Cell>
+ <Cell><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.User Community</Data></Cell>
+ <Cell ss:Index="7"><Data ss:Type="String">&lt;UserCommunities&gt;&lt;Enum&gt;Program 1&lt;/Enum&gt;&lt;Enum&gt;Program 2&lt;/Enum&gt;&lt;Enum&gt;Tools&lt;/Enum&gt;&lt;Enum&gt;Processes&lt;/Enum&gt;&lt;Enum&gt;Other&lt;/Enum&gt;&lt;/UserCommunities&gt;</Data></Cell>
+ <Cell><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ <Cell ss:Index="6" ss:StyleID="s32"><Data ss:Type="String">0.0</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Weekly Benefit</Data></Cell>
+ <Cell ss:Index="6"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Man Days Needed</Data></Cell>
+ <Cell ss:Index="6" ss:StyleID="s32"><Data ss:Type="String">0.0</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Branch Id</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Parent Branch Id</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Transaction Id</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Percent Rework</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Branch Metrics</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem</Data></Cell>
+ <Cell><Data ss:Type="String">txt</Data></Cell>
+ <Cell><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ <Cell><Data ss:Type="String">txt</Data></Cell>
+ <Cell><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ <Cell><Data ss:Type="String">txt</Data></Cell>
+ <Cell><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Full Name</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Definition</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ <Cell><Data ss:Type="String">xml</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ <Cell><Data ss:Type="String">xml</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Related To State</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Work Package</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category2</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category3</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Legacy PCR Id</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision Review Options</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Defect</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.ClobAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Location</Data></Cell>
+ <Cell><Data ss:Type="String">txt</Data></Cell>
+ <Cell><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Authors</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Role</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="11"><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22"/>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String"># Map attribute to artifact type</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="14.25">
+ <Cell ss:StyleID="s25"><Data ss:Type="String">Artifact Type Name</Data></Cell>
+ <Cell ss:StyleID="s25"><Data ss:Type="String">Attribute Name</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">Name</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Annotation</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Static Id</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Blocking Review</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Related To State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Defect</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Completion Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Location</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Authors</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Role</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Legacy PCR Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Blocks</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Blocks</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Completion Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision Review Options</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Blocking Review</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Related To State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Role</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Legacy PCR Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Man Days Needed</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Full Name</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Uses Versions</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Require Targeted Version</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Parent Branch Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Active</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Actionable Item</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Active</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Actionable Item</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Weekly Benefit</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Branch Metrics</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Percent Rework</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Parent Branch Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Branch Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Transaction Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Legacy PCR Id</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Work Package</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category2</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category3</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.User Community</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Change Type</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Definition</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Priority</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem Override</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Completion Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution Override</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution Override</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Validation Required</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Metrics from Tasks</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Uses Resolution Options</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Work Package</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category2</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category3</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="Default"><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Estimated Completion Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Related To State</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.User Community</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Change Type</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Priority</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Validation Required</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Released</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Full Name</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Version</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Next Version</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Version</Data></Cell>
+ <Cell ss:StyleID="Default"><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell ss:StyleID="Default"><Data ss:Type="String">Version</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">ats.Release Date</Data></Cell>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="Default"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ <Cell ss:StyleID="s20"/>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Parent Branch Id</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22"/>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String"># Relation Type definition</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="14.25">
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Relation type name</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Side A Name</Data></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">A to B Phrase</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Side B Name</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">B to A Phrase</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Short Name</Data></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Ordered</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">TeamLead</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">is lead by </Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">leads</Data></Cell>
+ <Cell><Data ss:Type="String">LEAD</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamMember</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">has member</Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">is member of </Data></Cell>
+ <Cell><Data ss:Type="String">MEMB</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamActionableItem</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">supports</Data></Cell>
+ <Cell><Data ss:Type="String">Actionable Item</Data></Cell>
+ <Cell><Data ss:Type="String">is supported by</Data></Cell>
+ <Cell><Data ss:Type="String">TAI</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">ActionToWorkflow</Data></Cell>
+ <Cell><Data ss:Type="String">Action</Data></Cell>
+ <Cell><Data ss:Type="String">impacts</Data></Cell>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">supports</Data></Cell>
+ <Cell><Data ss:Type="String">AtW</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">SmaToTask</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">has tasks</Data></Cell>
+ <Cell><Data ss:Type="String">Task</Data></Cell>
+ <Cell><Data ss:Type="String">belongs to</Data></Cell>
+ <Cell><Data ss:Type="String">TSKS</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamWorkflowTargetedForVersion</Data></Cell>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">is targeted for</Data></Cell>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">implements</Data></Cell>
+ <Cell><Data ss:Type="String">TSKS</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamDefinitionToVersion</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">has version</Data></Cell>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ <Cell><Data ss:Type="String">is version of</Data></Cell>
+ <Cell><Data ss:Type="String">TSKS</Data></Cell>
+ <Cell><Data ss:Type="String">Yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamDefinitionToWorkflowDiagram</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">has diagram</Data></Cell>
+ <Cell><Data ss:Type="String">General Document</Data></Cell>
+ <Cell><Data ss:Type="String">is team workflow of</Data></Cell>
+ <Cell><Data ss:Type="String">TDtWFD</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamDefinitionToTaskWorkflowDiagram</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">has diagram</Data></Cell>
+ <Cell><Data ss:Type="String">General Document</Data></Cell>
+ <Cell><Data ss:Type="String">is task workflow of</Data></Cell>
+ <Cell><Data ss:Type="String">TDtWFD</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamDefinitionToDecisionReviewWorkflowDiagram</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">has diagram</Data></Cell>
+ <Cell><Data ss:Type="String">General Document</Data></Cell>
+ <Cell><Data ss:Type="String">is decision workflow of</Data></Cell>
+ <Cell><Data ss:Type="String">TDtWFD</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamDefinitionToPeerToPeerReviewWorkflowDiagram</Data></Cell>
+ <Cell><Data ss:Type="String">Team Definition</Data></Cell>
+ <Cell><Data ss:Type="String">has diagram</Data></Cell>
+ <Cell><Data ss:Type="String">General Document</Data></Cell>
+ <Cell><Data ss:Type="String">is peerToPeer workflow of</Data></Cell>
+ <Cell><Data ss:Type="String">TDtWFD</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">TeamWorkflowToReview</Data></Cell>
+ <Cell><Data ss:Type="String">Team Workflow</Data></Cell>
+ <Cell><Data ss:Type="String">is reviewed by </Data></Cell>
+ <Cell><Data ss:Type="String">Decision Review</Data></Cell>
+ <Cell><Data ss:Type="String">is review of</Data></Cell>
+ <Cell><Data ss:Type="String">TWtDR</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">SubscribedUser</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">is subscribed by</Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">is subscribed to</Data></Cell>
+ <Cell><Data ss:Type="String">Sub</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">FavoriteUser</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">is a favorite of</Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">has favorite</Data></Cell>
+ <Cell><Data ss:Type="String">Fav</Data></Cell>
+ <Cell><Data ss:Type="String">No</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22"/>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell><Data ss:Type="String"># NOTE: The way relations are added and because All Artifacts are of SuperType &quot;Artifact&quot;, line Defect,ArtifactToDef will set Defect's max with 0,0 and Artifact,ArtifactToDefect will add n,0 to all other artifact types</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="12" ss:StyleID="s22">
+ <Cell><Data ss:Type="String"># Resolution: Always define specific artifact side first, then define the &quot;Artifact&quot; side second; eg: Route State, RouteFromState,1,0 THEN Artifact,RouteFromState,0,1</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String"># Valid artifact types per side of a relation</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell ss:StyleID="s22"><Data ss:Type="String"># Although 1 Action can have N Product Impacts, this table describes it by the number of relation lines. There can only be one Product Impact on Side B, but side A can have UNLIMITED Actions on left</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell ss:StyleID="s22"><Data ss:Type="String"># In otherwords: How many ActionProductImpact links can be attached to the same Product Impact = 1; How many ActionProductiMpact linkds can be attached to one ActionArtifact = n</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="14.25">
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Artifact Type</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Relation Type</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s21"><Data ss:Type="String">Side A Max</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s23"><Data ss:Type="String">Side B Max</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Side (unused)</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">General Document</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToTaskWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">General Document</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToTaskWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToDecisionReviewWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">General Document</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToDecisionReviewWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToPeerToPeerReviewWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">General Document</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToPeerToPeerReviewWorkflowDiagram</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToVersion</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamDefinitionToVersion</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">ActionToWorkflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Team Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">ActionToWorkflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamWorkflowToReview</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Decision Review</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamWorkflowToReview</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">PeerToPeer Review</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamWorkflowToReview</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamWorkflowTargetedForVersion</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Action</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Version</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamWorkflowTargetedForVersion</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Workflow</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Task</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">SmaToTask</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Task</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Artifact</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">SmaToTask</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Actionable Item</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamActionableItem</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">User</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Team Definition</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamActionableItem</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">State</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">User</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamLead</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">User</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Artifact</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamLead</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">State</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">User</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamMember</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">User</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell><Data ss:Type="String">Artifact</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">TeamMember</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell><Data ss:Type="String">State</Data><NamedCell ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">SubscribedUser</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">SubscribedUser</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ <Cell><Data ss:Type="String">FavoriteUser</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell><Data ss:Type="String">User</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">FavoriteUser</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">Artifact</Data></Cell>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>600</HorizontalResolution>
+ <VerticalResolution>600</VerticalResolution>
+ </Print>
+ <Zoom>90</Zoom>
+ <Selected/>
+ <TopRowVisible>9</TopRowVisible>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ <ActiveRow>36</ActiveRow>
+ <ActiveCol>5</ActiveCol>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ <Sorting xmlns="urn:schemas-microsoft-com:office:excel">
+ <Sort>Attribute Base Type</Sort>
+ </Sorting>
+ </Worksheet>
+</Workbook>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/support/Action Import.xml b/0.5.0_20081201/org.eclipse.osee.ats/support/Action Import.xml
new file mode 100644
index 00000000000..3fa79c91868
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/support/Action Import.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <LastAuthor>Donald G. Dunne</LastAuthor>
+ <Created>1996-10-14T23:33:28Z</Created>
+ <LastSaved>2007-03-08T19:22:23Z</LastSaved>
+ <Version>11.8132</Version>
+ </DocumentProperties>
+ <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
+ <DoNotRelyOnCSS/>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>9300</WindowHeight>
+ <WindowWidth>15135</WindowWidth>
+ <WindowTopX>120</WindowTopX>
+ <WindowTopY>120</WindowTopY>
+ <AcceptLabelsInFormulas/>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="Sheet1">
+ <Table ss:ExpandedColumnCount="8" ss:ExpandedRowCount="3" x:FullColumns="1"
+ x:FullRows="1">
+ <Column ss:Width="78"/>
+ <Column ss:Width="102"/>
+ <Column ss:Width="75.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="113.25"/>
+ <Column ss:Width="60"/>
+ <Column ss:Index="7" ss:Width="75.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="78.75"/>
+ <Row>
+ <Cell><Data ss:Type="String">Title</Data></Cell>
+ <Cell><Data ss:Type="String">Description</Data></Cell>
+ <Cell><Data ss:Type="String">ActionableItems</Data></Cell>
+ <Cell><Data ss:Type="String">Assignees</Data></Cell>
+ <Cell><Data ss:Type="String">ChangeType</Data></Cell>
+ <Cell><Data ss:Type="String">Priority</Data></Cell>
+ <Cell><Data ss:Type="String">UserCommunity</Data></Cell>
+ <Cell><Data ss:Type="String">Version</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">This is the name</Data></Cell>
+ <Cell><Data ss:Type="String">This is the description</Data></Cell>
+ <Cell><Data ss:Type="String">ATS Editor</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G</Data></Cell>
+ <Cell><Data ss:Type="String">Improvement</Data></Cell>
+ <Cell><Data ss:Type="Number">3</Data></Cell>
+ <Cell><Data ss:Type="String">Eclipse Community</Data></Cell>
+ <Cell><Data ss:Type="String">2.5.7</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">2nd Action</Data></Cell>
+ <Cell><Data ss:Type="String">2nd Description</Data></Cell>
+ <Cell><Data ss:Type="String">Define</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G</Data></Cell>
+ <Cell><Data ss:Type="String">Problem</Data></Cell>
+ <Cell><Data ss:Type="Number">4</Data></Cell>
+ <Cell><Data ss:Type="String">Eclipse Community</Data></Cell>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Selected/>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ <ActiveRow>3</ActiveRow>
+ <ActiveCol>6</ActiveCol>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+ <Worksheet ss:Name="Sheet2">
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+ <Worksheet ss:Name="Sheet3">
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+</Workbook>
diff --git a/0.5.0_20081201/org.eclipse.osee.ats/support/Task Import.xml b/0.5.0_20081201/org.eclipse.osee.ats/support/Task Import.xml
new file mode 100644
index 00000000000..07fdbd72fa8
--- /dev/null
+++ b/0.5.0_20081201/org.eclipse.osee.ats/support/Task Import.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <LastAuthor>Donald G. Dunne</LastAuthor>
+ <Created>1996-10-14T23:33:28Z</Created>
+ <LastSaved>2008-05-27T21:06:21Z</LastSaved>
+ <Version>11.9999</Version>
+ </DocumentProperties>
+ <OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
+ <DoNotRelyOnCSS/>
+ </OfficeDocumentSettings>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>9300</WindowHeight>
+ <WindowWidth>15135</WindowWidth>
+ <WindowTopX>120</WindowTopX>
+ <WindowTopY>120</WindowTopY>
+ <AcceptLabelsInFormulas/>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="Sheet1">
+ <Table ss:ExpandedColumnCount="9" ss:ExpandedRowCount="4" x:FullColumns="1"
+ x:FullRows="1">
+ <Column ss:Width="78"/>
+ <Column ss:Width="102"/>
+ <Column ss:AutoFitWidth="0" ss:Width="161.25"/>
+ <Column ss:AutoFitWidth="0" ss:Width="83.25" ss:Span="1"/>
+ <Row>
+ <Cell><Data ss:Type="String">Title</Data></Cell>
+ <Cell><Data ss:Type="String">Originator</Data></Cell>
+ <Cell><Data ss:Type="String">Assignees</Data></Cell>
+ <Cell><Data ss:Type="String">Resolution</Data></Cell>
+ <Cell><Data ss:Type="String">Related to State</Data></Cell>
+ <Cell><Data ss:Type="String">Hours Spent</Data></Cell>
+ <Cell><Data ss:Type="String">Estimated Hours</Data></Cell>
+ <Cell><Data ss:Type="String">Percent Complete</Data></Cell>
+ <Cell><Data ss:Type="String">Notes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">1st Task</Data></Cell>
+ <Cell><Data ss:Type="String">Brooks, Ryan D</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G</Data></Cell>
+ <Cell><Data ss:Type="String">Working</Data></Cell>
+ <Cell><Data ss:Type="String">Implement</Data></Cell>
+ <Cell><Data ss:Type="Number">3</Data></Cell>
+ <Cell><Data ss:Type="Number">34</Data></Cell>
+ <Cell><Data ss:Type="Number">23</Data></Cell>
+ <Cell><Data ss:Type="String">Note 1</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">2nd Task</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G</Data></Cell>
+ <Cell><Data ss:Type="String">UnAssigned</Data></Cell>
+ <Cell><Data ss:Type="String">Waiting</Data></Cell>
+ <Cell><Data ss:Type="String">Implement</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">3</Data></Cell>
+ <Cell><Data ss:Type="Number">45</Data></Cell>
+ <Cell><Data ss:Type="String">Note 2</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">3rd Task</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G</Data></Cell>
+ <Cell><Data ss:Type="String">Dunne, Donald G; Brooks, Ryan D</Data></Cell>
+ <Cell><Data ss:Type="String">Waiting</Data></Cell>
+ <Cell><Data ss:Type="String">Implement</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">45</Data></Cell>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Selected/>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ <ActiveRow>3</ActiveRow>
+ <ActiveCol>8</ActiveCol>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+ <Worksheet ss:Name="Sheet2">
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+ <Worksheet ss:Name="Sheet3">
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ </Worksheet>
+</Workbook>

Back to the top