Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorafinkbein2008-01-03 15:19:27 +0000
committerafinkbein2008-01-03 15:19:27 +0000
commit7cb833e2fb98b297d094fb6e9b7b2b324f9909ee (patch)
treefd5f0a35fd4c3e9236b7641e4c1e94595c2a5541
parent30e090e8ce354d1c8e7f6adfefee243314f5d9d3 (diff)
downloadorg.eclipse.osee-7cb833e2fb98b297d094fb6e9b7b2b324f9909ee.tar.gz
org.eclipse.osee-7cb833e2fb98b297d094fb6e9b7b2b324f9909ee.tar.xz
org.eclipse.osee-7cb833e2fb98b297d094fb6e9b7b2b324f9909ee.zip
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/.classpath7
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/.project28
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/META-INF/MANIFEST.MF54
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/build.properties8
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/A.gifbin0 -> 475 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/AI.gifbin0 -> 475 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/Asearch.gifbin0 -> 222 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/C.gifbin0 -> 861 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/D.gifbin0 -> 861 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/MyWorld.gifbin0 -> 475 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/P.gifbin0 -> 858 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/R.gifbin0 -> 863 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/T.gifbin0 -> 862 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/X.gifbin0 -> 866 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/action.gifbin0 -> 864 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/actionRaised.gifbin0 -> 207 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/alert_8_8.gifbin0 -> 173 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/artView.gifbin0 -> 471 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspect.gifbin0 -> 472 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspectDef.gifbin0 -> 497 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsNavigate.gifbin0 -> 497 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsPerspective.gifbin0 -> 476 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueCheck.gifbin0 -> 100 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueX.gifbin0 -> 163 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/branch.gifbin0 -> 127 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/bug.gifbin0 -> 472 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/cancel.gifbin0 -> 215 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/categoryTask.gifbin0 -> 464 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/center.gifbin0 -> 465 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/check.gifbin0 -> 131 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/clear.gifbin0 -> 595 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/collapseAll.gifbin0 -> 157 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/community.gifbin0 -> 937 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/configDef.gifbin0 -> 493 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/copyToClipboard.gifbin0 -> 604 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/cots.gifbin0 -> 864 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/currentState.gifbin0 -> 482 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/down.gifbin0 -> 332 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/editAction.gifbin0 -> 590 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/email.gifbin0 -> 362 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/error.gifbin0 -> 82 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/expandAll.gifbin0 -> 164 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/export.gifbin0 -> 343 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/favorite.gifbin0 -> 283 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/filter.gifbin0 -> 211 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/folder.gifbin0 -> 916 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBall.gifbin0 -> 1026 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBug.gifbin0 -> 348 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenPlus.gifbin0 -> 318 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/group.gifbin0 -> 364 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/home.gifbin0 -> 539 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/hyper.gifbin0 -> 474 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/inHouse.gifbin0 -> 871 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/info.gifbin0 -> 85 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/info2.gifbin0 -> 121 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/metric.gifbin0 -> 870 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/myTasks.gifbin0 -> 88 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/newAction.gifbin0 -> 508 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/newCategory.gifbin0 -> 216 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/newNote.gifbin0 -> 486 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/newTask.gifbin0 -> 479 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/note.gifbin0 -> 475 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/openId.gifbin0 -> 860 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/openParent.gifbin0 -> 863 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/orangeR_8_8.gifbin0 -> 281 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/order.gifbin0 -> 370 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/personal.gifbin0 -> 863 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/pinEditor.gifbin0 -> 358 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/plan.gifbin0 -> 204 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/print.gifbin0 -> 607 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/product.gifbin0 -> 474 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/productDef.gifbin0 -> 501 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/publish.gifbin0 -> 862 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/rank.gifbin0 -> 475 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/redCheck.gifbin0 -> 125 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/redDot.gifbin0 -> 72 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/redRemove.gifbin0 -> 143 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user.gifbin0 -> 341 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user_sm.gifbin0 -> 319 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/refresh.gifbin0 -> 182 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/relate.gifbin0 -> 160 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/release.gifbin0 -> 468 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/remove.gifbin0 -> 163 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/removeAll.gifbin0 -> 204 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/repository.gifbin0 -> 861 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/reviewer.gifbin0 -> 502 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/route.gifbin0 -> 470 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/sample.gifbin0 -> 983 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/search.gifbin0 -> 870 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/simpleTask.gifbin0 -> 486 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/state.gifbin0 -> 472 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/subscribed.gifbin0 -> 176 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/tanBall.gifbin0 -> 1033 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/task.gifbin0 -> 857 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/team.gifbin0 -> 946 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/tool.gifbin0 -> 474 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/up.gifbin0 -> 323 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/user.gifbin0 -> 542 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/userAdd.gifbin0 -> 576 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/user_sm.gifbin0 -> 314 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/users.gifbin0 -> 257 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/users2.gifbin0 -> 597 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/version.gifbin0 -> 477 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/warn.gifbin0 -> 338 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteGear.gifbin0 -> 856 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteT_8_8.gifbin0 -> 449 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/workflow.gifbin0 -> 499 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/world.gifbin0 -> 860 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowBall.gifbin0 -> 1035 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowN_8_8.gifbin0 -> 308 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowT_8_8.gifbin0 -> 474 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom.gifbin0 -> 1848 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_in.gifbin0 -> 517 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_out.gifbin0 -> 515 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/plugin.xml269
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/Priority.html52
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.html32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.jpgbin0 -> 33681 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_icons.html49
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.gifbin0 -> 10936 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.jpgbin0 -> 66981 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator_view.html29
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.html54
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.jpgbin0 -> 123844 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html43
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html135
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html39
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html44
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html29
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/contexts.xml45
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml8
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPGbin0 -> 37341 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml17
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html29
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html50
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdfbin0 -> 2136039 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/README.txt3
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/ats_overview.html27
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml8
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPGbin0 -> 408866 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPGbin0 -> 25922 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/report_a_bug.html25
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/toc.xml46
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html41
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpgbin0 -> 133565 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html37
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpgbin0 -> 254740 bytes
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/current_state.html44
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsStateItem.exsd105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsVueWorkflowDiagram.exsd112
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsWizardItem.exsd105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java85
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java38
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java129
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/TeamBasedDefaultBranchProvider.java52
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java108
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java98
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java71
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java44
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java204
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java60
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java77
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java186
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java167
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java127
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java208
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java184
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java133
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java69
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java88
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java176
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java249
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java154
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java1332
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java138
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java58
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java263
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java34
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java123
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java100
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java259
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java92
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java993
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java365
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java343
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java658
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java87
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java36
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java116
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java52
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java144
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java82
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/ImportWorkflowAction.java126
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/LoadAIsAndTeamsAction.java334
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/WorkflowDiagramFactory.java114
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java51
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java121
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java81
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java72
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java467
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java41
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java967
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsComposite.java159
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java70
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCancelledSection.java76
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCompletedSection.java77
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java86
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowLogSection.java86
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java629
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java488
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditor.java228
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java46
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java64
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java89
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java92
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java90
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java89
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java62
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java148
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java58
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java94
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java56
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java77
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java54
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java95
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java68
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java64
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java79
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java141
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java170
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java75
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java122
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java114
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java91
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java111
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java76
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java75
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java145
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java139
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java132
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java146
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportToolbarService.java95
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java128
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java32
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java56
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java64
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java38
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java71
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java71
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamAnalyzeStateItem.java93
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamEndorseStateItem.java71
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/BranchableStateItem.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ActionsHaveOneTeam.java117
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AssignedActiveActions.java134
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AttributeDuplication.java87
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/DuplicateUsersItem.java94
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/InvalidEstimatedHoursAttribute.java118
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/OrphanedTasks.java105
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TeamWorkflowsHaveZeroOrOneVersion.java133
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/UnAssignedAssignedAtsObjects.java140
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java82
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java297
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java253
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java54
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java342
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java1052
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java199
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java39
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java134
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java79
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java289
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java77
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java123
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java100
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java114
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java45
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java23
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java47
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/KickoffOSEEItem.java36
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java93
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java128
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java72
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java127
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java123
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java36
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java57
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToBranchOrTransaction.java88
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java127
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java158
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java143
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportItem.java54
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java198
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java36
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java35
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java40
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java103
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java245
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java69
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/BranchManager.java468
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java73
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamState.java20
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamWorkflowManager.java148
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java52
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java169
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java60
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java310
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java258
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java90
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportPage.java220
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportWizard.java69
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java94
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/NotifyUsersJob.java305
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java332
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java121
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java60
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java169
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java166
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java186
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java203
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java110
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java102
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java99
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java90
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java90
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java24
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java37
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectColumn.java132
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java135
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java256
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java124
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java165
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java241
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java483
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java87
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java134
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java144
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java109
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java49
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java125
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java179
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java58
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java132
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java190
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptions.java73
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java73
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java116
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java86
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java89
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java146
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java67
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java53
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java52
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java161
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleColumn.java126
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java130
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java112
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java177
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java204
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java425
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/IXTaskViewer.java50
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskArtifactItem.java33
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskContentProvider.java51
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskCurrentStateFilter.java31
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskLabelProvider.java79
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewer.java374
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerFactory.java92
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerSorter.java62
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/XTaskViewer.java728
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java70
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlow.java102
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlowFactory.java129
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java367
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkFlow.java179
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkLink.java97
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkPage.java122
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXColumn.java201
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java135
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldArtifactItem.java209
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java35
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java156
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java198
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldView.java641
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java826
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java66
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java61
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java219
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java96
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/CriteriaSearchItem.java45
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java89
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java112
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java110
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java60
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java67
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java84
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java72
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java61
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTaskSearchItem.java65
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTeamWFSearchItem.java80
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java73
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java100
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java90
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java91
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamVersionWorldSearchItem.java239
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java220
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UnReleasedTeamWorldSearchItem.java261
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java108
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java87
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java100
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java130
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml1447
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/Action Import.xml101
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_decisionReview_workflow.vue195
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultSimpleTeam_workflow.vue133
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTask_workflow.vue99
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTeam_workflow.vue232
-rw-r--r--MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_peerToPeerReview_workflow.vue134
434 files changed, 44139 insertions, 0 deletions
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/.classpath b/MS_0.1.4_20080103/org.eclipse.osee.ats/.classpath
new file mode 100644
index 00000000000..02159672985
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/.project b/MS_0.1.4_20080103/org.eclipse.osee.ats/.project
new file mode 100644
index 00000000000..abda3a60482
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/META-INF/MANIFEST.MF b/MS_0.1.4_20080103/org.eclipse.osee.ats/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..dafd95ee7fb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/META-INF/MANIFEST.MF
@@ -0,0 +1,54 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Ats Plug-in (Incubation)
+Bundle-SymbolicName: org.eclipse.osee.ats;singleton:=true
+Bundle-Version: 0.1.0.qualifier
+Bundle-Activator: org.eclipse.osee.ats.AtsPlugin
+Bundle-Vendor: Eclipse.org
+Require-Bundle: org.eclipse.osee.framework.ui.jdk,
+ org.eclipse.gef,
+ org.eclipse.osee.framework.jdk.core,
+ javax.mail,
+ org.eclipse.ui.workbench.texteditor,
+ 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.jface,
+ 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.views,
+ org.eclipse.mylyn.zest.core,
+ org.eclipse.mylyn.zest.layouts
+Eclipse-LazyStart: true
+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.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.util.widgets.task,
+ org.eclipse.osee.ats.workflow,
+ org.eclipse.osee.ats.world,
+ org.eclipse.osee.ats.world.search
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/build.properties b/MS_0.1.4_20080103/org.eclipse.osee.ats/build.properties
new file mode 100644
index 00000000000..c121788a44c
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/images/A.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/A.gif
new file mode 100644
index 00000000000..f2aac572737
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/A.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/AI.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/AI.gif
new file mode 100644
index 00000000000..5ef59b47402
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/AI.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/Asearch.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/Asearch.gif
new file mode 100644
index 00000000000..fb85678f4f8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/Asearch.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/C.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/C.gif
new file mode 100644
index 00000000000..0d494fd0ef7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/C.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/D.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/D.gif
new file mode 100644
index 00000000000..dbc0f800a1d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/D.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/MyWorld.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/MyWorld.gif
new file mode 100644
index 00000000000..96fea67137f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/MyWorld.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/P.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/P.gif
new file mode 100644
index 00000000000..b99507ab205
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/P.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/R.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/R.gif
new file mode 100644
index 00000000000..0780916eae2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/R.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/T.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/T.gif
new file mode 100644
index 00000000000..2693eb5baff
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/T.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/X.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/X.gif
new file mode 100644
index 00000000000..2b93b3cdc92
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/X.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/action.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/action.gif
new file mode 100644
index 00000000000..6a18beda16c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/action.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/actionRaised.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/actionRaised.gif
new file mode 100644
index 00000000000..0f076926979
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/actionRaised.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/alert_8_8.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/alert_8_8.gif
new file mode 100644
index 00000000000..ee2dac4a90a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/alert_8_8.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/artView.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/artView.gif
new file mode 100644
index 00000000000..9b42afcac6d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/artView.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspect.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspect.gif
new file mode 100644
index 00000000000..11d750ac0f2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspect.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspectDef.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspectDef.gif
new file mode 100644
index 00000000000..24d19923fc8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/aspectDef.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsNavigate.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsNavigate.gif
new file mode 100644
index 00000000000..8f529d2e366
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsNavigate.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsPerspective.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsPerspective.gif
new file mode 100644
index 00000000000..37e66066aad
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/atsPerspective.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueCheck.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueCheck.gif
new file mode 100644
index 00000000000..1d9c323e953
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueCheck.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueX.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueX.gif
new file mode 100644
index 00000000000..d90835fa494
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/blueX.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/branch.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/branch.gif
new file mode 100644
index 00000000000..9c4a6755758
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/branch.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/bug.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/bug.gif
new file mode 100644
index 00000000000..9a738e55054
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/bug.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cancel.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cancel.gif
new file mode 100644
index 00000000000..dc47edf0695
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cancel.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/categoryTask.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/categoryTask.gif
new file mode 100644
index 00000000000..4c882068b69
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/categoryTask.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/center.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/center.gif
new file mode 100644
index 00000000000..6daf9d594b2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/center.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/check.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/check.gif
new file mode 100644
index 00000000000..6b3078b35cf
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/check.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/clear.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/clear.gif
new file mode 100644
index 00000000000..af30a42f83d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/clear.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/collapseAll.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/collapseAll.gif
new file mode 100644
index 00000000000..a2d80a9044f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/collapseAll.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/community.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/community.gif
new file mode 100644
index 00000000000..d75b50967f0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/community.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/configDef.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/configDef.gif
new file mode 100644
index 00000000000..d5bde8dca99
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/configDef.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/copyToClipboard.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/copyToClipboard.gif
new file mode 100644
index 00000000000..540860fb103
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/copyToClipboard.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cots.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cots.gif
new file mode 100644
index 00000000000..01bbf4c913b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/cots.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/currentState.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/currentState.gif
new file mode 100644
index 00000000000..eb91ded1880
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/currentState.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/down.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/down.gif
new file mode 100644
index 00000000000..072b1844572
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/down.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/editAction.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/editAction.gif
new file mode 100644
index 00000000000..a5ac28d4c56
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/editAction.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/email.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/email.gif
new file mode 100644
index 00000000000..2cb69621de8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/email.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/error.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/error.gif
new file mode 100644
index 00000000000..c112416d5ac
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/error.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/expandAll.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/expandAll.gif
new file mode 100644
index 00000000000..0205b29176d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/expandAll.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/export.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/export.gif
new file mode 100644
index 00000000000..d11c996e570
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/export.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/favorite.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/favorite.gif
new file mode 100644
index 00000000000..e96e43ea722
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/favorite.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/filter.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/filter.gif
new file mode 100644
index 00000000000..3d061d77cbe
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/filter.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/folder.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/folder.gif
new file mode 100644
index 00000000000..b6858690c89
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/folder.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBall.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBall.gif
new file mode 100644
index 00000000000..805446ee46e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBall.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBug.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBug.gif
new file mode 100644
index 00000000000..b0dfd3ba982
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenBug.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenPlus.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenPlus.gif
new file mode 100644
index 00000000000..252d7ebcb8c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/greenPlus.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/group.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/group.gif
new file mode 100644
index 00000000000..5ba5b91c5bb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/group.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/home.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/home.gif
new file mode 100644
index 00000000000..b288f5e78e5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/home.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/hyper.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/hyper.gif
new file mode 100644
index 00000000000..04d053e5248
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/hyper.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/inHouse.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/inHouse.gif
new file mode 100644
index 00000000000..f4eed5b5f2c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/inHouse.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info.gif
new file mode 100644
index 00000000000..33cc76e9dc5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info2.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info2.gif
new file mode 100644
index 00000000000..2da001e3e98
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/info2.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/metric.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/metric.gif
new file mode 100644
index 00000000000..3601dd80841
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/metric.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/myTasks.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/myTasks.gif
new file mode 100644
index 00000000000..6d74e802b54
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/myTasks.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newAction.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newAction.gif
new file mode 100644
index 00000000000..9fdd250e994
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newAction.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newCategory.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newCategory.gif
new file mode 100644
index 00000000000..2c59ccbad2b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newCategory.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newNote.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newNote.gif
new file mode 100644
index 00000000000..2e1a393b5c1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newNote.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newTask.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newTask.gif
new file mode 100644
index 00000000000..b4807550386
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/newTask.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/note.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/note.gif
new file mode 100644
index 00000000000..2d8ab53eefd
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/note.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openId.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openId.gif
new file mode 100644
index 00000000000..f5091346025
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openId.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openParent.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openParent.gif
new file mode 100644
index 00000000000..3c51e519f55
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/openParent.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/orangeR_8_8.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/orangeR_8_8.gif
new file mode 100644
index 00000000000..d3893141160
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/orangeR_8_8.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/order.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/order.gif
new file mode 100644
index 00000000000..42fca3fcc9a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/order.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/personal.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/personal.gif
new file mode 100644
index 00000000000..bce90f6ee96
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/personal.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/pinEditor.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/pinEditor.gif
new file mode 100644
index 00000000000..dfc1dabbb3e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/pinEditor.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/plan.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/plan.gif
new file mode 100644
index 00000000000..94eedf6f929
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/plan.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/print.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/print.gif
new file mode 100644
index 00000000000..045de755326
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/print.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/product.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/product.gif
new file mode 100644
index 00000000000..346a94d0201
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/product.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/productDef.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/productDef.gif
new file mode 100644
index 00000000000..3c8f545dc61
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/productDef.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/publish.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/publish.gif
new file mode 100644
index 00000000000..a031b62c2d3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/publish.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/rank.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/rank.gif
new file mode 100644
index 00000000000..a013d4ed09e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/rank.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redCheck.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redCheck.gif
new file mode 100644
index 00000000000..8da601e66d0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redCheck.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redDot.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redDot.gif
new file mode 100644
index 00000000000..532db639899
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redDot.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redRemove.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redRemove.gif
new file mode 100644
index 00000000000..6f647666d32
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/redRemove.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user.gif
new file mode 100644
index 00000000000..f674064cdd4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user_sm.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user_sm.gif
new file mode 100644
index 00000000000..f91ca279748
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/red_user_sm.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/refresh.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/refresh.gif
new file mode 100644
index 00000000000..a063c230aca
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/refresh.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/relate.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/relate.gif
new file mode 100644
index 00000000000..870934b6934
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/relate.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/release.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/release.gif
new file mode 100644
index 00000000000..7e31d4303e2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/release.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/remove.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/remove.gif
new file mode 100644
index 00000000000..2cd9c544436
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/remove.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/removeAll.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/removeAll.gif
new file mode 100644
index 00000000000..28a3785aaca
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/removeAll.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/repository.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/repository.gif
new file mode 100644
index 00000000000..44d16935949
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/repository.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/reviewer.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/reviewer.gif
new file mode 100644
index 00000000000..f3b67a87f7e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/reviewer.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/route.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/route.gif
new file mode 100644
index 00000000000..8a945332071
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/route.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/sample.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/sample.gif
new file mode 100644
index 00000000000..34fb3c9d8cb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/sample.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/search.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/search.gif
new file mode 100644
index 00000000000..2e772da925f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/search.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/simpleTask.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/simpleTask.gif
new file mode 100644
index 00000000000..faad0cbbc08
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/simpleTask.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/state.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/state.gif
new file mode 100644
index 00000000000..e45bada95db
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/state.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/subscribed.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/subscribed.gif
new file mode 100644
index 00000000000..9e1b70f295f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/subscribed.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tanBall.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tanBall.gif
new file mode 100644
index 00000000000..e1dde912dcb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tanBall.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/task.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/task.gif
new file mode 100644
index 00000000000..36fc007591a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/task.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/team.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/team.gif
new file mode 100644
index 00000000000..68a0f1e738a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/team.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tool.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tool.gif
new file mode 100644
index 00000000000..c4d1c761a14
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/tool.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/up.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/up.gif
new file mode 100644
index 00000000000..07164754e5c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/up.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user.gif
new file mode 100644
index 00000000000..79723a4bf1d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/userAdd.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/userAdd.gif
new file mode 100644
index 00000000000..3fdf0738e4c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/userAdd.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user_sm.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user_sm.gif
new file mode 100644
index 00000000000..d2780011574
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/user_sm.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users.gif
new file mode 100644
index 00000000000..bb86ad37cc2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users2.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users2.gif
new file mode 100644
index 00000000000..d28c326dea2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/users2.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/version.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/version.gif
new file mode 100644
index 00000000000..91868db39c4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/version.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/warn.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/warn.gif
new file mode 100644
index 00000000000..14009e9974d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/warn.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteGear.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteGear.gif
new file mode 100644
index 00000000000..837074b1536
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteGear.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteT_8_8.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteT_8_8.gif
new file mode 100644
index 00000000000..cede7c6806b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/whiteT_8_8.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/workflow.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/workflow.gif
new file mode 100644
index 00000000000..d4f14922643
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/workflow.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/world.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/world.gif
new file mode 100644
index 00000000000..b88343e5ebf
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/world.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowBall.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowBall.gif
new file mode 100644
index 00000000000..07c5346e0c4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowBall.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowN_8_8.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowN_8_8.gif
new file mode 100644
index 00000000000..ec06366b2e9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowN_8_8.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowT_8_8.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowT_8_8.gif
new file mode 100644
index 00000000000..df68897ca1e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/yellowT_8_8.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom.gif
new file mode 100644
index 00000000000..4b0a1212823
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_in.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_in.gif
new file mode 100644
index 00000000000..2ab25e5cb78
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_in.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_out.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_out.gif
new file mode 100644
index 00000000000..11ac62bfe85
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/images/zoom_out.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/plugin.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/plugin.xml
new file mode 100644
index 00000000000..f7f7d65f571
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/plugin.xml
@@ -0,0 +1,269 @@
+<?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="AtsVueWorkflowDiagram" name="AtsVueWorkflowDiagram" schema="schema/AtsVueWorkflowDiagram.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.editor.TaskEditor"
+ default="false"
+ icon="images/task.gif"
+ id="org.eclipse.osee.ats.editor.TaskEditor"
+ name="ATS Task 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>
+ <view
+ class="org.eclipse.osee.ats.world.WorldView"
+ icon="images/world.gif"
+ category="org.eclipse.osee.ats.category"
+ name="ATS World"
+ id="org.eclipse.osee.ats.world.WorldView">
+ </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.AtsTeamAnalyzeStateItem"/>
+ <AtsStateItem classname="org.eclipse.osee.ats.editor.stateItem.AtsTeamEndorseStateItem"/>
+ <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>
+ </extension>
+ <extension
+ id="ATS_Skynet_Types"
+ name="ATS_Skynet_Types"
+ point="org.eclipse.osee.framework.skynet.core.SkynetDbTypes">
+ <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="ConnectWorkflowToBranchOrTransaction"
+ name="ConnectWorkflowToBranchOrTransaction"
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation className="org.eclipse.osee.ats.operation.ConnectWorkflowToBranchOrTransaction"/>
+ </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.ats.AtsVueWorkflowDiagram">
+ <AtsVueWorkflowDiagram
+ id="osee_ats_defaultTeam_workflow"
+ vueFilename="support/osee_ats_defaultTeam_workflow.vue"/>
+ <AtsVueWorkflowDiagram
+ id="osee_ats_defaultTask_workflow"
+ vueFilename="support/osee_ats_defaultTask_workflow.vue"/>
+ <AtsVueWorkflowDiagram
+ id="osee_ats_defaultSimpleTeam_workflow"
+ vueFilename="support/osee_ats_defaultSimpleTeam_workflow.vue"/>
+ <AtsVueWorkflowDiagram
+ id="osee_ats_decisionReview_workflow"
+ vueFilename="support/osee_ats_decisionReview_workflow.vue"/>
+ <AtsVueWorkflowDiagram
+ id="osee_ats_peerToPeerReview_workflow"
+ vueFilename="support/osee_ats_peerToPeerReview_workflow.vue"/>
+ </extension>
+ <extension
+ point="org.eclipse.osee.framework.skynet.core.DefaultInitialBranchProvider">
+ <Provider class="org.eclipse.osee.ats.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>
+</plugin>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/Priority.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/Priority.html
new file mode 100644
index 00000000000..0fa30d8aeab
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.html
new file mode 100644
index 00000000000..81dbb7dee3c
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.jpg b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.jpg
new file mode 100644
index 00000000000..9d42cd75ae9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_action_view.jpg
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_icons.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_icons.html
new file mode 100644
index 00000000000..fc95fd6ae71
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.gif b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.gif
new file mode 100644
index 00000000000..d5225ac9f7a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.gif
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.jpg b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.jpg
new file mode 100644
index 00000000000..1f1b55f52bc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator.jpg
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator_view.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_navigator_view.html
new file mode 100644
index 00000000000..f94beee9514
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.html
new file mode 100644
index 00000000000..212e0c7d2ad
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.jpg b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.jpg
new file mode 100644
index 00000000000..75176a1d039
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/ats_world_view.jpg
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_help.html
new file mode 100644
index 00000000000..b43276fa6a8
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/configure_ats_for_tracking.html
new file mode 100644
index 00000000000..dd16b0b6536
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_actionable_items.html
new file mode 100644
index 00000000000..7c710ff7e99
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_new_team_definition.html
new file mode 100644
index 00000000000..84dc23d7d5f
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/configure/create_vue_workflow_diagram.html
new file mode 100644
index 00000000000..f9b39240b7d
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/contexts.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/contexts.xml
new file mode 100644
index 00000000000..0fcbb65c01e
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/contexts.xml
new file mode 100644
index 00000000000..db3afa4453d
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG
new file mode 100644
index 00000000000..986d9d4633e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.JPG
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/decision_review_workflow/decisionReview.html
new file mode 100644
index 00000000000..c095dfa2887
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/contexts.xml
new file mode 100644
index 00000000000..72f37de7fcd
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_1.html
new file mode 100644
index 00000000000..453064fea71
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/newActionWizard/new_action_wizard_page_2.html
new file mode 100644
index 00000000000..7f593952241
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf
new file mode 100644
index 00000000000..b30a1c679c3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/OSEE ATS Overview.pdf
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/README.txt b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/README.txt
new file mode 100644
index 00000000000..4d08ca8ed3c
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/ats_overview.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/overview/ats_overview.html
new file mode 100644
index 00000000000..bc6aaa1d499
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/contexts.xml
new file mode 100644
index 00000000000..1164a0c4f18
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReview.html
new file mode 100644
index 00000000000..41bd4ce39ed
--- /dev/null
+++ b/MS_0.1.4_20080103/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-Along 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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG
new file mode 100644
index 00000000000..2839752c0ff
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewEditor.JPG
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG
new file mode 100644
index 00000000000..414c3f56b3e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/peer_to_peer_review_workflow/peerToPeerReviewStateMachine.JPG
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/report_a_bug.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/report_a_bug.html
new file mode 100644
index 00000000000..b6dc6f1abf9
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/toc.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/toc.xml
new file mode 100644
index 00000000000..cde0128bd3f
--- /dev/null
+++ b/MS_0.1.4_20080103/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="../osee.skynet.gui/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="../osee.skynet.gui/reference/ats_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="../osee.skynet.gui/reference/skynet_toc.xml"/>
+</toc>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor.html
new file mode 100644
index 00000000000..389d15fd181
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.html
new file mode 100644
index 00000000000..87153c1c5c9
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg
new file mode 100644
index 00000000000..42937dcf17d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_task_tab.jpg
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.html
new file mode 100644
index 00000000000..558e1d56843
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg
new file mode 100644
index 00000000000..05ea2c1b27c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/ats_workflow_editor_workflow_tab.jpg
Binary files differ
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/current_state.html b/MS_0.1.4_20080103/org.eclipse.osee.ats/reference/workflow_editor/current_state.html
new file mode 100644
index 00000000000..1bae0ebd5d1
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsAIandTeamConfig.exsd
new file mode 100644
index 00000000000..66aa5e1e408
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsNavigateItem.exsd
new file mode 100644
index 00000000000..77330b762b4
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsStateItem.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsStateItem.exsd
new file mode 100644
index 00000000000..5a1f3d90806
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsTeamWorkflow.exsd
new file mode 100644
index 00000000000..71df02d300d
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsVueWorkflowDiagram.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsVueWorkflowDiagram.exsd
new file mode 100644
index 00000000000..06d96e689b4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsVueWorkflowDiagram.exsd
@@ -0,0 +1,112 @@
+<?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="AtsVueWorkflowDiagram" name="AtsVueWorkflowDiagram"/>
+ </appInfo>
+ <documentation>
+ VUE Diagram of a workflow that will be imported into the DB as part of a database initialization. The VUE Diagrams contain the graphical workflow including states (squares), valid state transitions (arrows), and the state configuration and widgets to be created (xml note tags embedded in each state.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <complexType>
+ <sequence minOccurs="1" maxOccurs="unbounded">
+ <element ref="AtsVueWorkflowDiagram" minOccurs="1" maxOccurs="unbounded"/>
+ </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="AtsVueWorkflowDiagram">
+ <complexType>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <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/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsWizardItem.exsd b/MS_0.1.4_20080103/org.eclipse.osee.ats/schema/AtsWizardItem.exsd
new file mode 100644
index 00000000000..9951168790f
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.java
new file mode 100644
index 00000000000..3fea81e3d2e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ATSPerspective.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;
+
+import org.eclipse.osee.ats.hyper.ActionHyperView;
+import org.eclipse.osee.ats.hyper.ActionSkyWalker;
+import org.eclipse.osee.ats.hyper.ArtifactHyperView;
+import org.eclipse.osee.ats.navigate.NavigateView;
+import org.eclipse.osee.ats.world.WorldView;
+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(WorldView.VIEW_ID);
+ 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("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);
+
+ IFolderLayout botLeft = layout.createFolder("bottomLeft", IPageLayout.BOTTOM, (float) 0.60, NavigateView.VIEW_ID);
+ botLeft.addView(ActionSkyWalker.VIEW_ID);
+ botLeft.addView(ActionHyperView.VIEW_ID);
+
+ IFolderLayout lower = layout.createFolder("bottom", IPageLayout.BOTTOM, (float) 0.65, editorArea);
+ lower.addView(WorldView.VIEW_ID);
+ lower.addView(QuickSearchView.VIEW_ID);
+ if (AtsPlugin.isAtsAdmin()) {
+ lower.addView(ArtifactHyperView.VIEW_ID);
+ }
+
+ if (AtsPlugin.isAtsAdmin()) {
+ IFolderLayout bottomRight =
+ layout.createFolder("bottomRight", IPageLayout.RIGHT, (float) 0.75, WorldView.VIEW_ID);
+ bottomRight.addView("org.eclipse.pde.runtime.LogView");
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ActionDebug.java
new file mode 100644
index 00000000000..16288ac1410
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.java
new file mode 100644
index 00000000000..1fe582c3a36
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsPlugin.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;
+
+import java.util.logging.Logger;
+import org.eclipse.osee.ats.util.AtsBranchAccessHandler;
+import org.eclipse.osee.framework.database.DatabaseActivator;
+import org.eclipse.osee.framework.jdk.core.util.OseeProperties;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.ui.plugin.OseeUiActivator;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+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 Logger logger = ConfigUtil.getConfigFactory().getLogger(AtsPlugin.class);
+ private static boolean emailEnabled = true;
+ public static Color ACTIVE_COLOR = new Color(null, 206, 212, 241);
+
+ /**
+ * The constructor.
+ */
+ public AtsPlugin() {
+ super();
+ pluginInstance = this;
+ AtsBranchAccessHandler.getInstance();
+ }
+
+ public static boolean isEmailEnabled() {
+ return emailEnabled;
+ }
+
+ public static void setEmailEnabled(boolean enabled) {
+ System.out.println("AtsPlugin: remove this");
+ // if (!SkynetDbInit.isDbInit())
+ // System.out.println("Email " + (enabled ? "Enabled" : "Disabled"));
+ // emailEnabled = enabled;
+ }
+
+ public static boolean isProductionDb() {
+ return DatabaseActivator.getInstance().isProductionDb();
+ }
+
+ 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 isAtsIgnoreConfigUpgrades() {
+ return OseeProperties.getInstance().isAtsIgnoreConfigUpgrades();
+ }
+
+ public static boolean isAtsAdmin() {
+ return OseeProperties.getInstance().isAtsAdmin();
+ }
+
+ public static boolean isAtsUseWorkflowFiles() {
+ return OseeProperties.getInstance().isAtsUseWorkflowFiles();
+ }
+
+ public static boolean isAtsDisableEmail() {
+ return OseeProperties.getInstance().isAtsDisableEmail();
+ }
+
+ public static boolean isAtsAlwaysEmailMe() {
+ return OseeProperties.getInstance().isAtsAlwaysEmailMe();
+ }
+
+ public static boolean isAtsShowUser() {
+ return OseeProperties.getInstance().isAtsShowUser();
+ }
+
+ public static Logger getLogger() {
+ return logger;
+ }
+
+ public static Branch getAtsBranch() {
+ try {
+ return BranchPersistenceManager.getInstance().getAtsBranch();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/TeamBasedDefaultBranchProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/TeamBasedDefaultBranchProvider.java
new file mode 100644
index 00000000000..5bb7ab31483
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/TeamBasedDefaultBranchProvider.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;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IDefaultInitialBranchesProvider;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Robert A. Fisher
+ */
+public class TeamBasedDefaultBranchProvider implements IDefaultInitialBranchesProvider {
+
+ public Collection<Branch> getDefaultInitialBranches() {
+ User user = SkynetAuthentication.getInstance().getAuthenticatedUser();
+ try {
+ Collection<TeamDefinitionArtifact> teams =
+ user.getArtifacts(RelationSide.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 (SQLException ex) {
+ OSEELog.logException(TeamBasedDefaultBranchProvider.class, ex, true);
+ }
+
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.java
new file mode 100644
index 00000000000..9f3c98a0031
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewAction.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.actions;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+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.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("New Action");
+ this.actionableItem = actionableItem;
+ setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("newAction.gif"));
+ setToolTipText("New Action");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ super.run();
+ NewActionWizard wizard = new NewActionWizard();
+ try {
+ if (actionableItem != null) {
+ wizard.setCheckedArtifacts(getTeamActionableItems());
+ }
+ 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);
+ }
+ }
+
+ private Collection<ActionableItemArtifact> getTeamActionableItems() throws SQLException {
+ Set<ActionableItemArtifact> ais = new HashSet<ActionableItemArtifact>();
+ if (actionableItem != null) {
+ ais.add(ActionableItemArtifact.getSoleActionableItem(actionableItem));
+ }
+ return ais;
+ }
+
+ /**
+ * @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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.java
new file mode 100644
index 00000000000..0fb4a160f38
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewDecisionReviewJob.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.actions;
+
+import java.sql.SQLException;
+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.util.AtsLib;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewDecisionReviewJob extends Job {
+ private static final BranchPersistenceManager branchManager = BranchPersistenceManager.getInstance();
+ private final TeamWorkFlowArtifact teamParent;
+ private final boolean againstCurrentState;
+ private DecisionReviewArtifact decisionReviewArtifact;
+
+ public NewDecisionReviewJob(TeamWorkFlowArtifact teamParent, boolean againstCurrentState) {
+ super("Creating New Decision Review");
+ this.teamParent = teamParent;
+ this.againstCurrentState = againstCurrentState;
+ }
+
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ AbstractSkynetTxTemplate newDecisionReviewTx = new AbstractSkynetTxTemplate(branchManager.getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ decisionReviewArtifact = createNewDecisionReview(teamParent, againstCurrentState);
+ decisionReviewArtifact.persist(true);
+ }
+
+ };
+ newDecisionReviewTx.execute();
+ 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, boolean againstCurrentState) throws SQLException {
+ DecisionReviewArtifact decRev =
+ (DecisionReviewArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ DecisionReviewArtifact.ARTIFACT_NAME, branchManager.getAtsBranch()).makeNewArtifact();
+
+ if (teamParent != null) teamParent.relate(RelationSide.TeamWorkflowToReview_Review, decRev);
+ if (againstCurrentState) decRev.setSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(),
+ teamParent.getCurrentStateName());
+
+ decRev.getLog().addLog(LogType.Originated, "", "");
+ decRev.setDescriptiveName("Should we do this? Yes will require followup, No will not");
+ decRev.setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(),
+ "Enter description of the decision, if any");
+ decRev.setSoleAttributeValue(
+ ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(),
+ "Yes;Followup;<" + SkynetAuthentication.getInstance().getAuthenticatedUser().getUserId() + ">\n" + "No;Completed;");
+
+ // Set state
+ // Set current state and POCs
+ decRev.getCurrentStateDam().setState(
+ new SMAState(DecisionReviewArtifact.StateNames.Prepare.name(),
+ SkynetAuthentication.getInstance().getAuthenticatedUser()));
+ decRev.getLog().addLog(LogType.StateEntered, DecisionReviewArtifact.StateNames.Prepare.name(), "");
+
+ return decRev;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.java
new file mode 100644
index 00000000000..cd1fd264223
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/NewPeerToPeerReviewJob.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.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.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.skynet.ats.AtsOpenOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewPeerToPeerReviewJob extends Job {
+ private static final BranchPersistenceManager branchManager = BranchPersistenceManager.getInstance();
+
+ private final TeamWorkFlowArtifact teamParent;
+ private final String againstState;
+ private PeerToPeerReviewArtifact peerToPeerReviewArtifact;
+
+ public NewPeerToPeerReviewJob(TeamWorkFlowArtifact teamParent, String againstState) {
+ super("Creating New PeerToPeer Review");
+ this.teamParent = teamParent;
+ this.againstState = againstState;
+ }
+
+ @Override
+ public IStatus run(final IProgressMonitor monitor) {
+ try {
+ AbstractSkynetTxTemplate newPeerToPeerTx = new AbstractSkynetTxTemplate(branchManager.getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ peerToPeerReviewArtifact =
+ teamParent.getSmaMgr().getReviewManager().createNewPeerToPeerReview(againstState);
+ peerToPeerReviewArtifact.persist(true);
+ }
+
+ };
+ newPeerToPeerTx.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.java
new file mode 100644
index 00000000000..14b921f77ec
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ActionableItemFilter.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.actions.wizard;
+
+import java.sql.SQLException;
+import java.util.logging.Level;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+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.skynet.core.artifact.Artifact;
+
+public class ActionableItemFilter extends ViewerFilter {
+ private String contains = null;
+ private final CheckboxTreeViewer treeViewer;
+
+ public ActionableItemFilter(CheckboxTreeViewer 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 (SQLException ex) {
+ AtsPlugin.getLogger().log(Level.SEVERE, ex.getLocalizedMessage(), ex);
+ }
+ return false;
+ }
+
+ /**
+ * @param contains The contains to set.
+ */
+ public void setContains(String contains) {
+ this.contains = contains;
+ if (contains.equals(""))
+ treeViewer.collapseAll();
+ else
+ treeViewer.expandAll();
+ }
+
+ /**
+ * @return Returns the contains.
+ */
+ public String getContains() {
+ return contains;
+ }
+
+ public boolean isFiltering() {
+ return contains != null && contains.length() > 0;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizard.java
new file mode 100644
index 00000000000..2fca59f90e7
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.java
new file mode 100644
index 00000000000..ee6a90fd9ee
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/ArtifactSelectWizardPage.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.actions.wizard;
+
+import java.sql.SQLException;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ArtifactSubtypeDescriptor;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+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(ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptors(
+ BranchPersistenceManager.getInstance().getAtsBranch()));
+ artTypeList.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ ArtifactSubtypeDescriptor desc = (ArtifactSubtypeDescriptor) selection.getFirstElement();
+ try {
+ artList.setInput(ArtifactPersistenceManager.getInstance().getArtifactsFromSubtypeName(desc.getName(),
+ BranchPersistenceManager.getInstance().getAtsBranch()));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ });
+ artTypeList.setSorter(new ViewerSorter() {
+ @SuppressWarnings("unchecked")
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
+ return getComparator().compare(((ArtifactSubtypeDescriptor) e1).getName(),
+ ((ArtifactSubtypeDescriptor) 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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+
+ 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 ((ArtifactSubtypeDescriptor) 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.java
new file mode 100644
index 00000000000..3ffb8711e97
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsTeamWorkflow.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.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;
+
+/**
+ * @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 Exception;
+
+ /**
+ * 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 Exception;
+
+ /**
+ * 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.java
new file mode 100644
index 00000000000..423454a17af
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/IAtsWizardItem.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.actions.wizard;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import org.eclipse.osee.ats.artifact.ActionArtifact;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+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
+ * @throws SQLException
+ */
+ public Result isActionValidToCreate(Collection<ActionableItemArtifact> aias, NewActionWizard wizard) throws SQLException;
+
+ /**
+ * 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
+ * @throws Exception TODO
+ */
+ public void wizardCompleted(ActionArtifact actionArt, NewActionWizard wizard) 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
+ * @throws SQLException
+ */
+ public Result isWizardXWidgetsComplete(NewActionWizard wizard) throws SQLException;
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.java
new file mode 100644
index 00000000000..7b163172142
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionJob.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.actions.wizard;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Date;
+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.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.jdk.core.util.AFile;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @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 {
+ AbstractSkynetTxTemplate newActionTx =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ if (title.equals("tt")) title += " " + getAtsDeveloperTTNum();
+ actionArt =
+ createAction(monitor, title, desc, changeType, priority, userComms, validationRequired,
+ needByDate, actionableItems);
+
+ if (wizard != null) wizard.notifyAtsWizardItemExtensions(actionArt);
+
+ monitor.subTask("Persisting");
+ }
+ };
+ newActionTx.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.logException(AtsPlugin.class, ex, false);
+ 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) throws Exception {
+ // 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) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ ActionArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ 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");
+ Set<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));
+ }
+ actionArt.persist(true);
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.java
new file mode 100644
index 00000000000..5c132c5c751
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage1.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.actions.wizard;
+
+import java.sql.SQLException;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.jface.viewers.CheckboxTreeViewer;
+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.ats.workflow.AtsWorkPage;
+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.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.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.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NewActionPage1 extends WizardPage {
+ private final NewActionWizard wizard;
+ private AtsWorkPage page;
+ private XText filterText;
+ private CheckboxTreeViewer treeViewer;
+ private ActionableItemFilter nameFilter;
+ private Set<ActionableItemArtifact> selectedAias;
+
+ /**
+ * @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;
+ this.filterText = new XText("Filter");
+ selectedAias = new HashSet<ActionableItemArtifact>();
+ if (wizard.getCheckedArtifacts() != null) selectedAias.addAll(wizard.getCheckedArtifacts());
+ }
+
+ private XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget widget) {
+ getContainer().updateButtons();
+ }
+ };
+
+ public void createControl(Composite parent) {
+
+ 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 AtsWorkPage("Action", "", 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 CheckboxTreeViewer(aiComp,
+ SWT.MULTI | SWT.CHECK | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ treeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ treeViewer.setContentProvider(new AITreeContentProvider(Active.Active));
+ treeViewer.setLabelProvider(new ArtifactLabelProvider());
+ try {
+ // Load all AIs due to performance
+ ActionableItemArtifact.getActionableItems();
+ treeViewer.setInput(ActionableItemArtifact.getTopLevelActionableItems(Active.Active));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ nameFilter = new ActionableItemFilter(treeViewer);
+ treeViewer.addFilter(nameFilter);
+ treeViewer.setSorter(new ArtifactNameSorter());
+ treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ storeSelectedActionableItemArtifacts();
+ getContainer().updateButtons();
+ }
+ });
+ if (wizard.getCheckedArtifacts() != null && wizard.getCheckedArtifacts().size() > 0) {
+ treeViewer.setCheckedElements(wizard.getCheckedArtifacts().toArray(
+ new Object[wizard.getCheckedArtifacts().size()]));
+ for (Artifact art : wizard.getCheckedArtifacts())
+ treeViewer.reveal(art);
+ }
+
+ Composite filterComp = new Composite(aiComp, SWT.NONE);
+ filterComp.setLayout(new GridLayout(2, false));
+ filterComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ (new Label(filterComp, SWT.NONE)).setText("Filter");
+ filterText.setDisplayLabel(false);
+ filterText.createWidgets(filterComp, 2);
+ filterText.addModifyListener(new ModifyListener() {
+ public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
+ nameFilter.setContains(filterText.get());
+ treeViewer.refresh();
+ };
+ });
+
+ setControl(comp);
+ setHelpContexts();
+ }
+
+ private void setHelpContexts() {
+ AtsPlugin.getInstance().setHelp(this.getControl(), "new_action_wizard_page_1");
+ }
+
+ private void storeSelectedActionableItemArtifacts() {
+ selectedAias.clear();
+ for (Object obj : treeViewer.getCheckedElements())
+ selectedAias.add((ActionableItemArtifact) obj);
+ }
+
+ public Set<ActionableItemArtifact> getSelectedActionableItemArtifacts() {
+ return selectedAias;
+ }
+
+ public XWidget getXWidget(String attrName) {
+ if (page == null) throw new IllegalArgumentException("WorkPage == null");
+ return page.getLayoutData(attrName).getXWidget();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (treeViewer.getCheckedElements().length == 0) return false;
+ try {
+ TeamDefinitionArtifact.getImpactedTeamDefs(getSelectedActionableItemArtifacts());
+ } catch (Exception ex) {
+ AWorkbench.popup("ERROR", ex.getLocalizedMessage());
+ return false;
+ }
+ if (!page.isPageComplete().isTrue()) return false;
+ return true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java
new file mode 100644
index 00000000000..5d7d7f47630
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage2.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.ats.workflow.AtsWorkPage;
+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.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.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 AtsWorkPage 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")).set(wizard.getInitialDescription());
+ if (wizard.isTTAction()) handlePopulateWithDebugInfo();
+ wizard.createPage3IfNecessary();
+ ((XText) getXWidget("Description")).getStyledText().setFocus();
+ }
+
+ private XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget widget) {
+ getContainer().updateButtons();
+ }
+ };
+
+ public void createControl(Composite parent) {
+
+ 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 AtsWorkPage("Action", "", 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();
+ }
+
+ private void setHelpContexts() {
+ AtsPlugin.getInstance().setHelp(this.getControl(), "new_action_wizard_page_2");
+ }
+
+ public void handlePopulateWithDebugInfo() {
+ try {
+ ((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("3");
+ ((XCombo) getXWidget("ats.Change Type")).set("Improvement");
+ } catch (IllegalStateException ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ } catch (SQLException ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+
+ public void update() {
+ getContainer().updateButtons();
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (!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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
new file mode 100644
index 00000000000..6014b94ebcd
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionPage3.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+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.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.ats.workflow.AtsWorkPage;
+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.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 AtsWorkPage 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) {
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(wizard.getSelectedActionableItemArtifacts())) item.wizardCompleted(
+ action, wizard);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private 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) {
+ 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 AtsWorkPage("Action", "", sb.toString(), ATSXWidgetOptionResolver.getInstance());
+ page.createBody(null, comp, null, xModListener, true);
+
+ comp.layout();
+ }
+ }
+
+ /**
+ * 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.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ setErrorMessage(null);
+ return true;
+ }
+
+ public XWidget getXWidget(String attrName) {
+ if (page == null) throw new IllegalArgumentException("WorkPage == null");
+ return page.getLayoutData(attrName).getXWidget();
+ }
+
+ @SuppressWarnings("deprecation")
+ 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) throws SQLException {
+ getWizardXWidgetExtensions();
+ for (IAtsWizardItem item : wizardExtensionItems) {
+ try {
+ if (item.hasWizardXWidgetExtensions(aias)) return true;
+ } catch (Exception ex) {
+ // DO NOTHING
+ }
+ }
+ return false;
+ }
+
+ public Result isActionValid() throws SQLException {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
new file mode 100644
index 00000000000..f7df9407cec
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewActionWizard.java
@@ -0,0 +1,184 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.AtsPlugin;
+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.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.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> checkedArtifacts;
+ 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.
+ */
+ 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() {
+ try {
+ if (page3 == null && NewActionPage3.isPage3Necesary(getSelectedActionableItemArtifacts())) {
+ page3 = new NewActionPage3(this);
+ addPage(page3);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ 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() {
+ // 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();
+ }
+
+ /**
+ * @return Returns the checkedArtifacts.
+ */
+ public Collection<ActionableItemArtifact> getCheckedArtifacts() {
+ return checkedArtifacts;
+ }
+
+ /**
+ * @param checkedArtifacts The checkedArtifacts to set.
+ */
+ public void setCheckedArtifacts(Collection<ActionableItemArtifact> checkedArtifacts) {
+ this.checkedArtifacts = checkedArtifacts;
+ }
+
+ public void notifyAtsWizardItemExtensions(ActionArtifact action) {
+ if (page3 != null) {
+ page3.notifyAtsWizardItemExtensions(action);
+ }
+ }
+
+ public XWidget getExtendedXWidget(String attrName) {
+ if (page3 == null) return null;
+ return page3.getXWidget(attrName);
+ }
+
+ public Result isActionValid() throws SQLException {
+ 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;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNotePage.java
new file mode 100644
index 00000000000..ece3e545b50
--- /dev/null
+++ b/MS_0.1.4_20080103/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.plugin.util.ALayout;
+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.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/wizard/NewNoteWizard.java
new file mode 100644
index 00000000000..6669878019f
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.java
new file mode 100644
index 00000000000..f54aa3eca60
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSArtifact.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.artifact;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.hyper.IHyperArtifact;
+import org.eclipse.osee.ats.util.Overview;
+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.BasicArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+public abstract class ATSArtifact extends BasicArtifact implements IHyperArtifact, IATSArtifact {
+
+ public static final String CELL_ERROR_PREFIX = "!Error";
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public ATSArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ public String toString() {
+ return getDescriptiveName();
+ }
+
+ public String getHyperlinkHtml() {
+ return Overview.getOpenHyperlinkHtml(this);
+ }
+
+ public String getCellExceptionString(String message) {
+ return CELL_ERROR_PREFIX + " - " + message;
+ }
+
+ public String getCellExceptionString(Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return CELL_ERROR_PREFIX + " - " + ex.getLocalizedMessage();
+ }
+
+ /**
+ * Recursively retrieve artifacts and all it's ATS related artifacts such as tasks, notes, subscriptions, etc... for
+ * deletion
+ *
+ * @param deleteArts
+ * @param allRelated
+ * @throws SQLException
+ */
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws SQLException {
+ deleteArts.add(this);
+ getRelated(allRelated);
+ }
+
+ public void getRelated(Map<Artifact, Object> allRelated) throws SQLException {
+ for (RelationLinkGroup group : getLinkManager().getGroups())
+ for (Artifact art : group.getArtifacts())
+ allRelated.put(art, this);
+ }
+
+ public Collection<User> convertToUserCollection(Collection<Artifact> coll) {
+ ArrayList<User> arts = new ArrayList<User>();
+ for (Artifact art : coll)
+ arts.add((User) art);
+ return arts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java
new file mode 100644
index 00000000000..9a5a1b63db4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSAttributes.java
@@ -0,0 +1,176 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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 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 HOURS_SPENT_ATTRIBUTE = new ATSAttributes("Hours Spent");
+ 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_COMPLETE_ATTRIBUTE = new ATSAttributes("Percent Complete");
+ 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("Note", "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 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");
+ public static final ATSAttributes USES_RESOLUTION_OPTIONS_ATTRIBUTE =
+ new ATSAttributes("Uses Resolution Options", "True if ATS object's tasks uses resolution options.");
+ 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 ESTIMATED_RELEASE_DATE_ATTRIBUTE = new ATSAttributes("Estimated Release 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");
+ public static final ATSAttributes METRICS_FROM_TASKS_ATTRIBUTE =
+ new ATSAttributes("Metrics from Tasks",
+ "True if hour estimate, hours spent and percent complete should be determined from related tasks.");
+
+ 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);
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.java
new file mode 100644
index 00000000000..74985014026
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSLog.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.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+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;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ATSLog {
+
+ private final Artifact artifact;
+ private boolean enabled = true;
+ private static final SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ 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) {
+ for (Enum<LogType> e : LogType.values()) {
+ if (e.name().equals(type)) return (LogType) e;
+ }
+ throw new IllegalArgumentException("Unhandled LogType");
+ }
+
+ };
+
+ public ATSLog(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getHtml() {
+ return getHtml(true);
+ }
+
+ public String getHtml(boolean showLog) {
+ if (getLogItems().size() == 0) return "";
+ StringBuffer sb = new StringBuffer();
+ if (showLog) sb.append(AHTML.addSpace(1) + AHTML.getLabelStr(AHTML.LABEL_FONT, "Log"));
+ sb.append(getTable());
+ return sb.toString();
+ }
+
+ public List<LogItem> getLogItems() {
+ List<LogItem> logItems = new ArrayList<LogItem>();
+ String xml = artifact.getSoleAttributeValue(ATSAttributes.LOG_ATTRIBUTE.getStoreName());
+ if (!xml.equals("")) {
+ try {
+ NodeList nodes = Jaxp.readXmlDocument(xml).getElementsByTagName(LOG_ITEM_TAG);
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Element element = (Element) nodes.item(i);
+ LogItem item =
+ new LogItem(element.getAttribute("type"), element.getAttribute("date"),
+ element.getAttribute("userId"), element.getAttribute("state"), element.getAttribute("msg"));
+ logItems.add(item);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return logItems;
+ }
+
+ 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() {
+ List<LogItem> logItems = getLogItems();
+ Collections.reverse(logItems);
+ return logItems;
+ }
+
+ public void setOriginator(User user) {
+ List<LogItem> logItems = getLogItems();
+ for (LogItem item : logItems) {
+ if (item.getType() == LogType.Originated) {
+ item.setUser(user);
+ putLogItems(logItems);
+ return;
+ }
+ }
+ }
+
+ /**
+ * 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) {
+ 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) {
+ 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;
+ }
+ }
+ }
+
+ public void addLog(LogType type, String state, String msg) {
+ addLog(type, state, msg, new Date(), skynetAuth.getAuthenticatedUser());
+ }
+
+ public void addLog(LogType type, String state, String msg, User user) {
+ addLog(type, state, msg, new Date(), user);
+ }
+
+ public void addLogItem(LogItem item) {
+ addLog(item.getType(), item.getState(), item.getMsg(), item.getDate(), item.getUser());
+ }
+
+ public void addLog(LogType type, String state, String msg, Date date, User user) {
+ 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() {
+ 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(skynetAuth.getAuthenticatedUser()))
+ 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) {
+ for (LogItem item : getLogItems())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+ public LogItem getLastEvent(LogType type) {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+ public LogItem getStateEvent(LogType type, String stateName) {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type && item.getState().equals(stateName)) return item;
+ return null;
+ }
+
+ public LogItem getStateEvent(LogType type) {
+ for (LogItem item : getLogItemsReversed())
+ if (item.getType() == type) return item;
+ return null;
+ }
+
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java
new file mode 100644
index 00000000000..c643dc62f35
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ATSNote.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+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 static final SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ 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>();
+ String xml = artifact.getSoleAttributeValue(ATSAttributes.STATE_NOTES_ATTRIBUTE.getStoreName());
+ if (!xml.equals("")) {
+ try {
+ 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 = null;
+ try {
+ user = SkynetAuthentication.getInstance().getUserByIdWithError(element.getAttribute("userId"));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ 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();
+ if (!artifact.isAttributeTypeValid(ATSAttributes.STATE_NOTES_ATTRIBUTE.getStoreName())) 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.equals(skynetAuth.getAuthenticatedUser()))
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
new file mode 100644
index 00000000000..3e19855e2fc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
@@ -0,0 +1,1332 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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 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.editor.SMAManager;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+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.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.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.annotation.ArtifactAnnotation;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.DynamicAttributeManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.skynet.core.util.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.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+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
+ * @throws SQLException
+ */
+ public ActionArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#onInitializationComplete()
+ */
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ actionableItemsDam = new XActionableItemsDam(this);
+ }
+
+ public void resetAttributesOffChildren() throws SQLException {
+ resetActionItemsOffChildren();
+ resetChangeTypeOffChildren();
+ resetPriorityOffChildren();
+ resetUserCommunityOffChildren();
+ resetTitleOffChildren();
+ resetValidationOffChildren();
+ resetDescriptionOffChildren();
+ if (isDirty()) persist();
+ }
+
+ /**
+ * Reset Action title only if all children are titled the same
+ *
+ * @throws SQLException
+ */
+ private void resetTitleOffChildren() throws SQLException {
+ 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 SQLException {
+ boolean validationRequired = false;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName())) validationRequired =
+ true;
+ }
+ if (validationRequired != getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName())) setSoleBooleanAttributeValue(
+ ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), validationRequired);
+ }
+
+ /**
+ * Reset Action title only if all children are titled the same
+ *
+ * @throws SQLException
+ */
+ private void resetDescriptionOffChildren() throws SQLException {
+ 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);
+ }
+
+ private Result resetActionItemsOffChildren() throws SQLException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts())
+ if (!(new SMAManager(team)).isCancelled()) aias.addAll(team.getActionableItemsDam().getActionableItems());
+ return actionableItemsDam.setActionableItems(aias);
+ }
+
+ private void resetChangeTypeOffChildren() throws SQLException {
+ 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 SQLException {
+ 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 SQLException {
+ Set<String> userComs = new HashSet<String>();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts())
+ if (!(new SMAManager(team)).isCancelled()) userComs.addAll(team.getAttributesToStringCollection(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName()));
+ setDamAttributes(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName(), userComs);
+ }
+
+ public void setChangeType(ChangeType type) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), type.name());
+ }
+
+ public ChangeType getChangeType() {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ public PriorityType getPriority() {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ public void setPriority(PriorityType type) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), type.getShortName());
+ }
+
+ /**
+ * @return Returns the actionableItemsDam.
+ */
+ public XActionableItemsDam getActionableItemsDam() {
+ return actionableItemsDam;
+ }
+
+ public Collection<TeamWorkFlowArtifact> getTeamWorkFlowArtifacts() throws SQLException {
+ return getArtifacts(RelationSide.ActionToWorkflow_WorkFlow, TeamWorkFlowArtifact.class);
+ }
+
+ public String getWorldViewType() {
+ return ARTIFACT_NAME;
+ }
+
+ public String getWorldViewTitle() {
+ return getDescriptiveName();
+ }
+
+ public ChangeType getWorldViewChangeType() {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ public String getWorldViewBranchStatus() {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewBranchStatus().equals("")) sb.append(team.getWorldViewBranchStatus() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewNumberOfTasks() {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewNumberOfTasks().equals("")) sb.append(team.getWorldViewNumberOfTasks() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewState() {
+ 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 getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewActivePoc() {
+ Set<User> pocs = new HashSet<User>();
+ try {
+ // Roll up all assignees
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ pocs.addAll(team.getCurrentState().getAssignees());
+ }
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ return Artifacts.commaArts(pocs);
+ }
+
+ public String getWorldViewCreatedDateStr() {
+ try {
+ Date date = getWorldViewCreatedDate();
+ if (date == null) return getCellExceptionString("No Creation Date Found");
+ return XDate.getDateStr(date, XDate.MMDDYYHHMM);
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public Date getWorldViewCreatedDate() throws Exception {
+ return getTeamWorkFlowArtifacts().iterator().next().getWorldViewCreatedDate();
+ }
+
+ public String getWorldViewID() {
+ return getHumanReadableId();
+ }
+
+ public String getWorldViewPriority() {
+ try {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName())).getShortName();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public Image getAssigneeImage() {
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ Image image = team.getAssigneeImage();
+ if (image != null) return image;
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return null;
+ }
+
+ public String getWorldViewUserCommunity() {
+ try {
+ return getAttributesToString(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewActionableItems() {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (ActionableItemArtifact aia : getActionableItemsDam().getActionableItems()) {
+ sb.append(aia.getDescriptiveName() + ", ");
+ }
+ return sb.toString().replaceFirst(", $", "");
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws SQLException {
+ super.atsDelete(deleteArts, allRelated);
+ // Delete all products
+ for (TeamWorkFlowArtifact art : getArtifacts(RelationSide.ActionToWorkflow_WorkFlow, TeamWorkFlowArtifact.class))
+ art.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewTeam() {
+ Set<TeamDefinitionArtifact> teams = new HashSet<TeamDefinitionArtifact>();
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ teams.add(team.getTeamDefinition());
+ }
+ } catch (SQLException ex) {
+ return 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public Date getWorldViewCompletedDate() throws Exception {
+ Date date = null;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return null;
+ }
+
+ public Date getWorldViewCancelledDate() throws Exception {
+ Date date = null;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return null;
+ }
+
+ 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewRemainHours()
+ */
+ public double getWorldViewRemainHours() {
+ double hours = 0;
+ try {
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewRemainHours();
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewManDaysNeeded()
+ */
+ public double getWorldViewManDaysNeeded() {
+ double hours = 0;
+ try {
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewManDaysNeeded();
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewEstimatedHours()
+ */
+ public double getWorldViewEstimatedHours() {
+ double hours = 0;
+ try {
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewEstimatedHours();
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewStatePercentComplete()
+ */
+ public int getWorldViewStatePercentComplete() {
+ try {
+ 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();
+ }
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewStateHoursSpent()
+ */
+ public double getWorldViewStateHoursSpent() {
+ try {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getWorldViewStateHoursSpent();
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewTotalPercentComplete()
+ */
+ public int getWorldViewTotalPercentComplete() {
+ try {
+ if (getTeamWorkFlowArtifacts().size() == 1)
+ return getTeamWorkFlowArtifacts().iterator().next().getWorldViewTotalPercentComplete();
+ else {
+ double percent = 0;
+ int items = 0;
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ if (!smaMgr.isCancelled()) {
+ percent += team.getWorldViewTotalPercentComplete();
+ items++;
+ }
+ }
+ if (items > 0) {
+ Double rollPercent = percent / items;
+ return rollPercent.intValue();
+ }
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewTotalHoursSpent()
+ */
+ public double getWorldViewTotalHoursSpent() {
+ double hours = 0;
+ try {
+ // Add up hours for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ hours += team.getWorldViewTotalHoursSpent();
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return hours;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewRelatedToState()
+ */
+ public String getWorldViewRelatedToState() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewNotes()
+ */
+ public String getWorldViewNotes() {
+ String str = "";
+ try {
+ // Roll up if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (str.equals(""))
+ str = team.getWorldViewNotes();
+ else if (!str.equals(team.getWorldViewNotes())) return "";
+ }
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewCategory()
+ */
+ public String getWorldViewCategory() {
+ 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 getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewWorkPackage() {
+ 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 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ public String getWorldViewCategory3() {
+ 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 getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewVersion()
+ */
+ public String getWorldViewVersion() {
+ Set<String> versions = new HashSet<String>();
+ try {
+ // Roll up version if same for all children
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (!team.getWorldViewVersion().equals("")) versions.add(team.getWorldViewVersion());
+ }
+ return Collections.toString(",", versions);
+ } catch (SQLException ex) {
+ return 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() {
+ return "Team";
+ }
+
+ /*
+ * (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 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 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() {
+ try {
+ if (getTeamWorkFlowArtifacts().size() == 1) return getTeamWorkFlowArtifacts().iterator().next().getHyperAssigneeImage();
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperArtifact()
+ */
+ public Artifact getHyperArtifact() {
+ return this;
+ }
+
+ public Result addActionableItems() throws Exception {
+ 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);
+ if (diag.open() != 0) return Result.FalseResult;
+
+ final StringBuffer sb = new StringBuffer();
+
+ AbstractSkynetTxTemplate transaction = new AbstractSkynetTxTemplate(branchManager.getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ for (Object obj : diag.getResult()) {
+ ActionableItemArtifact aia = (ActionableItemArtifact) obj;
+ Result result = addActionableItemToTeamsOrAddTeams(aia);
+ sb.append(result.getText());
+ }
+ }
+ };
+ transaction.execute();
+ return new Result(true, sb.toString());
+ }
+
+ public Result addActionableItemToTeamsOrAddTeams(ActionableItemArtifact aia) throws Exception {
+ StringBuffer sb = new StringBuffer();
+ for (TeamDefinitionArtifact tda : TeamDefinitionArtifact.getImpactedTeamDef(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.persist();
+ 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(new ActionableItemArtifact[] {aia}), tda.getLeads());
+ 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) throws Exception {
+ 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.logWarning(AtsPlugin.class, ex, false);
+ }
+ 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);
+ // 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) throws SQLException {
+ return createTeamWorkflow(teamDef, actionableItems, assignees, null, null, artifactName);
+ }
+
+ public TeamWorkFlowArtifact createTeamWorkflow(TeamDefinitionArtifact teamDef, Collection<ActionableItemArtifact> actionableItems, Collection<User> assignees, String guid, String hrid, String artifactName) throws SQLException {
+
+ // 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 twa = null;
+ if (guid == null)
+ twa =
+ (TeamWorkFlowArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ artifactName, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ else
+ twa =
+ (TeamWorkFlowArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ artifactName, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact(guid, hrid);
+ setArtifactIdentifyData(this, twa);
+
+ twa.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)) twa.getActionableItemsDam().addActionableItem(aia);
+
+ // Set current state and POCs
+ twa.getCurrentStateDam().setState(new SMAState(DefaultTeamState.Endorse.name(), assignees));
+ twa.getLog().addLog(LogType.StateEntered, DefaultTeamState.Endorse.name(), "");
+
+ // Relate WorkFlow to Team Definition (by guid due to relation loading
+ // issues)
+ twa.setTeamDefinition(teamDef);
+
+ // Relate Action to WorkFlow
+ relate(RelationSide.ActionToWorkflow_WorkFlow, twa);
+
+ // Persist
+ twa.persist(true);
+
+ return twa;
+ }
+
+ /**
+ * Set teamworkflowartifact attributes off given action artifact
+ *
+ * @param fromAction
+ * @param toTeam
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public static void setArtifactIdentifyData(ActionArtifact fromAction, TeamWorkFlowArtifact toTeam) throws IllegalStateException, SQLException {
+ 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 IllegalArgumentException("Invalid priority => " + priorityStr);
+ setArtifactIdentifyData(
+ toTeam,
+ fromAction.getDescriptiveName(),
+ fromAction.getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName()),
+ ChangeType.getChangeType(fromAction.getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName())),
+ priType, fromAction.getAttributesToStringCollection(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName()),
+ fromAction.getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName()),
+ fromAction.getSoleDateAttributeValue(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName()));
+ }
+
+ /**
+ * Since there is no shared attribute yet, action and workflow arts are all populate with identify data
+ *
+ * @param art
+ * @throws SQLException
+ */
+ public static void setArtifactIdentifyData(Artifact art, String title, String desc, ChangeType changeType, PriorityType priority, Collection<String> userComms, boolean validationRequired, Date needByDate) throws SQLException {
+ art.setDescriptiveName(title);
+ if (!desc.equals("")) art.setAttribute(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ art.setAttribute(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), changeType.name());
+ DynamicAttributeManager dam = art.getAttributeManager(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ for (String comm : userComms)
+ dam.getNewAttribute().setStringData(comm);
+ if (priority != null) art.setAttribute(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(),
+ priority.getShortName());
+ if (needByDate != null) art.setAttribute(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName(),
+ needByDate.getTime() + "");
+ if (validationRequired) art.setAttribute(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName(), "yes");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDecision()
+ */
+ public String getWorldViewDecision() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact#getParentSMArt()
+ */
+ public Artifact getParentSMArt() throws SQLException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewValidationRequired()
+ */
+ public String getWorldViewValidationRequiredStr() {
+ try {
+ return String.valueOf(getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName()));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public Date getWorldViewEstimatedReleaseDate() throws Exception {
+ 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewReleaseDateStr() {
+ try {
+ Date date = getWorldViewReleaseDate();
+ if (date == null) return "";
+ return XDate.getDateStr(date, XDate.MMDDYY);
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public Date getWorldViewReleaseDate() throws Exception {
+ Date date = null;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // do nothing
+ }
+ return null;
+ }
+
+ /*
+ * (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 (SQLException ex) {
+ return 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewRemainHoursValid()
+ */
+ public Result isWorldViewRemainHoursValid() {
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts())
+ if (team.isWorldViewRemainHoursValid().isFalse()) return team.isWorldViewRemainHoursValid();
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ 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 (SQLException 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 (SQLException ex) {
+ return 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ return str;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws Exception {
+ Date date = null;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() {
+ try {
+ Date date = getWorldViewDeadlineDate();
+ if (date == null) return "";
+ return XDate.getDateStr(date, XDate.MMDDYY);
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() {
+ double hours = 0;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewAnnualCostAvoidance()
+ */
+ public double getWorldViewAnnualCostAvoidance() {
+ double hours = 0;
+ try {
+ // 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;
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return 0;
+ }
+
+ /*
+ * (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 (SQLException 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 (SQLException ex) {
+ // Do nothing
+ }
+ 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 (SQLException ex) {
+ // Do nothing
+ }
+ return Result.FalseResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isMetricsFromTasks()
+ */
+ public boolean isMetricsFromTasks() {
+ boolean metricsFromTasks = false;
+ try {
+ for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
+ if (team.getSoleBooleanAttributeValue(ATSAttributes.METRICS_FROM_TASKS_ATTRIBUTE.getStoreName())) metricsFromTasks =
+ true;
+ }
+ } catch (SQLException ex) {
+ // do nothing
+ }
+ return metricsFromTasks;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewLegacyPCR()
+ */
+ public String getWorldViewLegacyPCR() {
+ 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 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 (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewPercentRework()
+ */
+ public int getWorldViewPercentRework() {
+ return 0;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.java
new file mode 100644
index 00000000000..febdc50d49e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionableItemArtifact.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.artifact;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.util.AtsLib;
+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.BasicArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ActiveArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch.SearchOperator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemArtifact extends BasicArtifact {
+
+ 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
+ * @throws SQLException
+ */
+ public ActionableItemArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItems(Active active) throws SQLException {
+ ActiveArtifactTypeSearch search =
+ new ActiveArtifactTypeSearch(ARTIFACT_NAME, active, BranchPersistenceManager.getInstance().getAtsBranch());
+ return search.getArtifacts(ActionableItemArtifact.class);
+ }
+
+ public static Set<ActionableItemArtifact> getTopLevelActionableItems(Active active) throws SQLException {
+ 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 SQLException {
+ return getArtifacts(RelationSide.TeamLead_Lead, User.class);
+ }
+
+ public static ActionableItemArtifact getTopActionableItem() throws SQLException {
+ return ArtifactStaticIdSearch.getSingletonArtifactOrException(ActionableItemArtifact.ARTIFACT_NAME,
+ TOP_AI_STATIC_ID, BranchPersistenceManager.getInstance().getAtsBranch(), SearchOperator.EQUAL,
+ ActionableItemArtifact.class);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItems() throws SQLException {
+ ActiveArtifactTypeSearch search =
+ new ActiveArtifactTypeSearch(ARTIFACT_NAME, Active.Active,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ return search.getArtifacts(ActionableItemArtifact.class);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItems(Collection<String> aiaStrs) throws SQLException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ for (String aia : aiaStrs) {
+ aias.add(getSoleActionableItem(aia));
+ }
+ return aias;
+ }
+
+ /**
+ * Refrain from using this method as Actionable Items names can be changed by the user.
+ *
+ * @param name
+ * @return
+ * @throws SQLException
+ */
+ public static ActionableItemArtifact getSoleActionableItem(String name) throws SQLException {
+ ArtifactTypeNameSearch search =
+ new ArtifactTypeNameSearch(ARTIFACT_NAME, name, BranchPersistenceManager.getInstance().getAtsBranch());
+ return search.getSingletonArtifactOrException(ActionableItemArtifact.class);
+ }
+
+ public static Set<TeamDefinitionArtifact> getImpactedTeamDefs(Set<ActionableItemArtifact> aias) throws SQLException {
+ return TeamDefinitionArtifact.getImpactedTeamDefs(aias);
+ }
+
+ public static Set<TeamDefinitionArtifact> getImpactedTeamDef(ActionableItemArtifact aia) throws SQLException {
+ return TeamDefinitionArtifact.getImpactedTeamDef(aia);
+ }
+
+ public Set<TeamDefinitionArtifact> getImpactedTeamDefs() throws SQLException {
+ return TeamDefinitionArtifact.getImpactedTeamDef(this);
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamsFromItemAndChildren(ActionableItemArtifact aia) throws SQLException {
+ return TeamDefinitionArtifact.getTeamsFromItemAndChildren(aia);
+ }
+
+ public static Set<ActionableItemArtifact> getActionableItemsFromItemAndChildren(ActionableItemArtifact aia) throws SQLException {
+ Set<ActionableItemArtifact> aias = new HashSet<ActionableItemArtifact>();
+ getActionableItemsFromItemAndChildren(aia, aias);
+ return aias;
+ }
+
+ public static void getActionableItemsFromItemAndChildren(ActionableItemArtifact aia, Set<ActionableItemArtifact> aiaTeams) throws SQLException {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.java
new file mode 100644
index 00000000000..588826a4b3d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/AtsArtifactFactory.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.sql.SQLException;
+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.factory.ArtifactFactory;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class AtsArtifactFactory extends ArtifactFactory<Artifact> {
+ 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 getNewArtifact(String guid, String humandReadableId, String factoryKey, Branch branch) throws SQLException {
+ if (factoryKey.equals(ActionArtifact.ARTIFACT_NAME)) return new ActionArtifact(this, guid, humandReadableId,
+ branch);
+ if (factoryKey.equals(TaskArtifact.ARTIFACT_NAME)) return new TaskArtifact(this, guid, humandReadableId, branch);
+ if (factoryKey.equals(TeamWorkFlowArtifact.ARTIFACT_NAME)) return new TeamWorkFlowArtifact(this, guid,
+ humandReadableId, branch);
+ if (factoryKey.equals(TeamDefinitionArtifact.ARTIFACT_NAME)) return new TeamDefinitionArtifact(this, guid,
+ humandReadableId, branch);
+ if (factoryKey.equals(VersionArtifact.ARTIFACT_NAME)) return new VersionArtifact(this, guid, humandReadableId,
+ branch);
+ if (factoryKey.equals(ActionableItemArtifact.ARTIFACT_NAME)) return new ActionableItemArtifact(this, guid,
+ humandReadableId, branch);
+ if (factoryKey.equals(DecisionReviewArtifact.ARTIFACT_NAME)) return new DecisionReviewArtifact(this, guid,
+ humandReadableId, branch);
+ if (factoryKey.equals(PeerToPeerReviewArtifact.ARTIFACT_NAME)) return new PeerToPeerReviewArtifact(this, guid,
+ humandReadableId, branch);
+ throw new IllegalArgumentException("did not recognize the factory key: " + factoryKey);
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.java
new file mode 100644
index 00000000000..9b129f1476e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/DecisionReviewArtifact.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.artifact;
+
+import java.sql.SQLException;
+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.widgets.SMAState;
+import org.eclipse.osee.ats.util.widgets.XDecisionOptions;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.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 StateNames {
+ Prepare, Decision, Followup, Completed
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public DecisionReviewArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ registerSMARelation(RelationSide.TeamWorkflowToReview_Team);
+ decisionOptions = new XDecisionOptions(this);
+ }
+
+ public TeamWorkFlowArtifact getParentTeamWorkflow() {
+ try {
+ Collection<TeamWorkFlowArtifact> teamArts =
+ getArtifacts(RelationSide.TeamWorkflowToReview_Team, TeamWorkFlowArtifact.class);
+ if (teamArts.size() == 0) throw new IllegalStateException(
+ "Decision Review " + getHumanReadableId() + " has no parent workflow");
+ if (teamArts.size() > 1) throw new IllegalStateException(
+ "Decision Review " + getHumanReadableId() + " has multiple parent workflows");
+ return teamArts.iterator().next();
+ } catch (SQLException ex) {
+ return null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isCurrentSectionExpanded(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isCurrentSectionExpanded(AtsWorkPage page) {
+ // Always expand the decision state
+ if (page.getName().endsWith(StateNames.Decision.name())) return true;
+ // If current state is decision and this is prepare state, don't expand the Prepare state
+ if (getCurrentStateName().equals(StateNames.Decision.name()) && page.getName().contains(StateNames.Prepare.name())) return false;
+ return super.isCurrentSectionExpanded(page);
+ }
+
+ @Override
+ public String getHelpContext() {
+ return "decisionReview";
+ }
+
+ public String getWorldViewVersion() {
+ return "";
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws SQLException {
+ Set<User> users = new HashSet<User>();
+ if (getParentTeamWorkflow() != null)
+ users.addAll(getParentTeamWorkflow().getPrivilegedUsers());
+ else {
+ if (AtsPlugin.isAtsAdmin()) {
+ users.add(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+ }
+ return users;
+ }
+
+ public int getWorldViewTotalPercentComplete() {
+ if (smaMgr.isCompleted()) return 100;
+ if (smaMgr.isCancelled()) return 0;
+ SMAState state = smaMgr.getSMAState(StateNames.Decision.name(), false);
+ if (state != null) return state.getPercentComplete();
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#isTaskable()
+ */
+ @Override
+ public boolean isTaskable() {
+ return false;
+ }
+
+ @Override
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewTeam()
+ */
+ public String getWorldViewTeam() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws SQLException {
+ return getParentTeamWorkflow();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDecision()
+ */
+ public String getWorldViewDecision() {
+ return getSoleAttributeValue(ATSAttributes.DECISION_ATTRIBUTE.getStoreName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewCategory() {
+ return "";
+ }
+
+ public String getWorldViewCategory2() {
+ return "";
+ }
+
+ public String getWorldViewCategory3() {
+ return "";
+ }
+
+ public Date getWorldViewEstimatedReleaseDate() throws Exception {
+ return null;
+ }
+
+ public Date getWorldViewReleaseDate() throws Exception {
+ return null;
+ }
+
+ @Override
+ public VersionArtifact getTargetedForVersion() throws SQLException {
+ return getParentSMA().getTargetedForVersion();
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws SQLException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma).getParentActionArtifact();
+ else
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ public String getWorldViewImplementer() {
+ SMAState state = getStateDam().getState(StateNames.Decision.name(), false);
+ if (state != null) Artifacts.commaArts(state.getAssignees());
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws Exception {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWorkPackage()
+ */
+ public String getWorldViewWorkPackage() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#isMetricsFromTasks()
+ */
+ public boolean isMetricsFromTasks() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.ats.IReviewArtifact#getArtifact()
+ */
+ public Artifact getArtifact() {
+ return this;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IFavoriteableArtifact.java
new file mode 100644
index 00000000000..a223f5f124b
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import java.util.ArrayList;
+import org.eclipse.osee.framework.skynet.core.User;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IFavoriteableArtifact {
+
+ public void addFavorite(User u) throws SQLException;
+
+ public void removeFavorite(User u) throws SQLException;
+
+ public boolean isFavorite(User u) throws SQLException;
+
+ public ArrayList<User> getFavorites() throws SQLException;
+
+ public boolean amIFavorite();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/IReviewArtifact.java
new file mode 100644
index 00000000000..39e2e6926ab
--- /dev/null
+++ b/MS_0.1.4_20080103/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 java.sql.SQLException;
+import org.eclipse.osee.ats.util.widgets.defect.DefectManager;
+import org.eclipse.osee.ats.util.widgets.role.UserRoleManager;
+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 SQLException;
+
+ public DefectManager getDefectManager();
+
+ public UserRoleManager getUserRoleManager();
+
+ public Artifact getArtifact();
+
+ public Result isUserRoleValid();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ISubscribableArtifact.java
new file mode 100644
index 00000000000..99c595e1b2d
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import java.util.ArrayList;
+import org.eclipse.osee.framework.skynet.core.User;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface ISubscribableArtifact {
+
+ public void addSubscribed(User u) throws SQLException;
+
+ public void removeSubscribed(User u) throws SQLException;
+
+ public boolean isSubscribed(User u) throws SQLException;
+
+ public ArrayList<User> getSubscribed() throws SQLException;
+
+ public boolean amISubscribed();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.java
new file mode 100644
index 00000000000..429b073185e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/LogItem.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.artifact;
+
+import java.sql.SQLException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+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;
+
+ public LogItem() {
+ }
+
+ public LogItem(LogType type, Date date, User user, String state, String msg) {
+ this(type.name(), date.getTime() + "", user.getUserId(), state, msg);
+ }
+
+ public LogItem(LogType type, String date, String userId, String state, String msg) {
+ Long l = new Long(date);
+ this.date = new Date(l.longValue());
+ this.msg = msg;
+ this.state = state;
+ try {
+ this.user = SkynetAuthentication.getInstance().getUserByIdWithError(userId);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ this.type = type;
+ }
+
+ public LogItem(String type, String date, String userId, String state, String msg) {
+ this(LogType.getType(type), date, userId, state, msg);
+ }
+
+ public String toXml() {
+ 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;
+ }
+
+ public String toString() {
+ return (msg.equals("") ? "" : msg) + " (" + type + ") " + (state.equals("") ? "" : "from " + state + " ") + "by " + user.getUserId() + " on " + getDate(XDate.MMDDYYHHMM) + "\n";
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/NoteItem.java
new file mode 100644
index 00000000000..542dc6224f5
--- /dev/null
+++ b/MS_0.1.4_20080103/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 + "): " + msg + " - (" + user.getName() + ")" + (state.equals("") ? "" : " for \"" + state + "\" state") + " - " + getDate(XDate.MMDDYYHHMM);
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java
new file mode 100644
index 00000000000..aa290ee17e2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/PeerToPeerReviewArtifact.java
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+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.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.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 State {
+ Prepare, Review, Completed
+ };
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public PeerToPeerReviewArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ registerSMARelation(RelationSide.TeamWorkflowToReview_Team);
+ defectManager = new DefectManager(this);
+ }
+
+ public TeamWorkFlowArtifact getParentTeamWorkflow() {
+ try {
+ Set<TeamWorkFlowArtifact> teams =
+ getArtifacts(RelationSide.TeamWorkflowToReview_Team, TeamWorkFlowArtifact.class);
+ if (teams.size() > 0) return teams.iterator().next();
+ return null;
+ } catch (SQLException ex) {
+ return null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.ReviewSMArtifact#isUserRoleValid()
+ */
+ @Override
+ public Result isUserRoleValid() {
+ 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 (getCurrentStateName().equals(PeerToPeerReviewArtifact.State.Review.name())) {
+ for (UserRole uRole : userRoleManager.getUserRoles()) {
+ if (uRole.getHoursSpent() == 0) return new Result("Hours spent must be entered for each role.");
+ }
+ }
+ return super.isUserRoleValid();
+ }
+
+ @Override
+ public String getHelpContext() {
+ return "peerToPeerReview";
+ }
+
+ public String getWorldViewVersion() {
+ return "";
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws SQLException {
+ Set<User> users = new HashSet<User>();
+ if (getParentTeamWorkflow() != null)
+ users.addAll(getParentTeamWorkflow().getPrivilegedUsers());
+ else {
+ if (AtsPlugin.isAtsAdmin()) {
+ users.add(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+ }
+ return users;
+ }
+
+ public int getWorldViewTotalPercentComplete() {
+ if (smaMgr.isCompleted()) return 100;
+ if (smaMgr.isCancelled()) return 0;
+ SMAState state = smaMgr.getSMAState(State.Review.name(), false);
+ if (state != null) return state.getPercentComplete();
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#isTaskable()
+ */
+ @Override
+ public boolean isTaskable() {
+ return false;
+ }
+
+ @Override
+ public String getHyperName() {
+ return getDescriptiveName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewTeam()
+ */
+ public String getWorldViewTeam() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws SQLException {
+ return getParentTeamWorkflow();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewCategory() {
+ return "";
+ }
+
+ public String getWorldViewCategory2() {
+ return "";
+ }
+
+ public String getWorldViewCategory3() {
+ return "";
+ }
+
+ public Date getWorldViewEstimatedReleaseDate() throws Exception {
+ return null;
+ }
+
+ public Date getWorldViewReleaseDate() throws Exception {
+ return null;
+ }
+
+ @Override
+ public VersionArtifact getTargetedForVersion() throws SQLException {
+ if (getParentSMA() == null) return null;
+ return getParentSMA().getTargetedForVersion();
+ }
+
+ @Override
+ public ActionArtifact getParentActionArtifact() throws SQLException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma).getParentActionArtifact();
+ else
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ public String getWorldViewImplementer() {
+ SMAState state = getStateDam().getState(State.Review.name(), false);
+ if (state != null) Artifacts.commaArts(state.getAssignees());
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws Exception {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#getWorldViewWorkPackage()
+ */
+ public String getWorldViewWorkPackage() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.ats.world.IWorldViewArtifact#isMetricsFromTasks()
+ */
+ public boolean isMetricsFromTasks() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.ats.IReviewArtifact#getArtifact()
+ */
+ public Artifact getArtifact() {
+ return this;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.java
new file mode 100644
index 00000000000..6f029be9eb9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ReviewSMArtifact.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.sql.SQLException;
+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.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class ReviewSMArtifact extends StateMachineArtifact {
+
+ public DefectManager defectManager;
+ public UserRoleManager userRoleManager;
+ private XActionableItemsDam actionableItemsDam;
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public ReviewSMArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ 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 IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE.getStoreName());
+ }
+
+ public DefectManager getDefectManager() {
+ return defectManager;
+ }
+
+ public UserRoleManager getUserRoleManager() {
+ return userRoleManager;
+ }
+
+ public Result isUserRoleValid() {
+ return Result.TrueResult;
+ }
+
+ public Set<TeamDefinitionArtifact> getCorrespondingTeamDefinitionArtifact() throws Exception {
+ 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;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java
new file mode 100644
index 00000000000..0df59e923bd
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/StateMachineArtifact.java
@@ -0,0 +1,993 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.NotifyUsersJob;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.ats.util.Overview.PreviewStyle;
+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.ats.workflow.AtsWorkFlow;
+import org.eclipse.osee.ats.workflow.AtsWorkFlowFactory;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.relation.IRelationEnumeration;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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.WorkPage;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class StateMachineArtifact extends ATSArtifact implements IEventReceiver, ISubscribableArtifact, IFavoriteableArtifact {
+
+ private XCurrentStateDam currentStateDam;
+ private XStateDam stateDam;
+ protected SMAManager smaMgr;
+ private ATSLog atsLog;
+ private ATSNote atsNote;
+ private Set<IRelationEnumeration> smaRelations = new HashSet<IRelationEnumeration>();
+ private SMAState preSaveState;
+ private User preSaveOriginator;
+ public static double MAN_DAY_HOURS = 8;
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public StateMachineArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ currentStateDam = new XCurrentStateDam(this);
+ stateDam = new XStateDam(this);
+ smaMgr = new SMAManager(this);
+ atsLog = new ATSLog(this);
+ atsNote = new ATSNote(this);
+ preSaveState = smaMgr.getSMAState();
+ if (getLog().getLastEvent(LogType.Originated) == null)
+ preSaveOriginator = SkynetAuthentication.getInstance().getAuthenticatedUser();
+ else
+ preSaveOriginator = smaMgr.getOriginator();
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, this);
+ }
+
+ public String getHelpContext() {
+ return "atsWorkflowEditorWorkflowTab";
+ }
+
+ public abstract boolean isMetricsFromTasks() throws SQLException;
+
+ public String getArtifactSuperTypeName() {
+ return getArtifactTypeName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.Artifact#persist(boolean, boolean)
+ */
+ @Override
+ public void persist(boolean recurse, boolean persistAttributes) throws SQLException {
+ super.persist(recurse, persistAttributes);
+ // Since multiple different ways exist to change the assignees,
+ // notitification is performed on
+ // the persist
+ notifyNewAssigneesAndReset();
+ notifyOriginatorAndReset();
+ }
+
+ /**
+ * Override to apply different algorithm to current section expansion.
+ *
+ * @param page
+ * @return true if section should be expanded
+ */
+ public boolean isCurrentSectionExpanded(AtsWorkPage page) {
+ return smaMgr.isCurrentState(page);
+ }
+
+ public void notifyNewAssigneesAndReset() {
+ Set<User> newAssignees = new HashSet<User>();
+ for (User user : smaMgr.getAssignees()) {
+ if (!preSaveState.getAssignees().contains(user)) {
+ newAssignees.add(user);
+ }
+ }
+ preSaveState = smaMgr.getSMAState();
+ if (newAssignees.size() == 0) return;
+ try {
+ NotifyUsersJob job = new NotifyUsersJob(this, newAssignees, NotifyUsersJob.NotifyType.Assignee);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void notifyOriginatorAndReset() {
+ if (preSaveOriginator != null && smaMgr.getOriginator() != null && !smaMgr.getOriginator().equals(
+ preSaveOriginator)) {
+ try {
+ Set<User> originators = new HashSet<User>();
+ originators.add(smaMgr.getOriginator());
+ NotifyUsersJob job = new NotifyUsersJob(this, originators, NotifyUsersJob.NotifyType.Originator);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ preSaveOriginator = smaMgr.getOriginator();
+ }
+
+ public boolean isValidationRequired() throws SQLException {
+ return false;
+ }
+
+ public abstract Set<User> getPrivilegedUsers() throws SQLException;
+
+ public String getDescription() {
+ return "";
+ }
+
+ public ArrayList<EmailGroup> getEmailableGroups() {
+ 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.getAssignees().size() > 0) {
+ emails = new ArrayList<String>();
+ for (User u : smaMgr.getAssignees())
+ emails.add(u.getEmail());
+ groupNames.add(new EmailGroup("Assignees", emails));
+ }
+ return groupNames;
+ }
+
+ public abstract StateMachineArtifact getParentSMA() throws SQLException;
+
+ public abstract ActionArtifact getParentActionArtifact() throws SQLException;
+
+ public abstract TeamWorkFlowArtifact getParentTeamWorkflow() throws SQLException;
+
+ public String getPreviewHtml() {
+ return getPreviewHtml(PreviewStyle.NONE);
+ }
+
+ public String getPreviewHtml(PreviewStyle... styles) {
+ 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;
+ boolean metricsFromTasks = false;
+ try {
+ subscribed = isSubscribed(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ favorite = isFavorite(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ metricsFromTasks = isMetricsFromTasks();
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return super.getDescriptor().getImage(subscribed, favorite, getMainAnnotationType(), metricsFromTasks);
+ }
+
+ public boolean isDefaultShowAllTasks() {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return true;
+ return false;
+ }
+
+ public boolean isUnCancellable() {
+ try {
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateCancelled);
+ if (item == null) throw new IllegalArgumentException("No Cancelled Event");
+ for (WorkPage toPage : smaMgr.getWorkPage().getToPages())
+ if (toPage.getName().equals(item.getState())) return true;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return false;
+ }
+
+ public boolean isTaskable() {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return false;
+ return true;
+ }
+
+ public boolean showTaskTab() {
+ return isTaskable();
+ }
+
+ public ATSLog getLog() {
+ return atsLog;
+ }
+
+ public ATSNote getNotes() {
+ return atsNote;
+ }
+
+ /**
+ * If state has tasks, statePercentComplete is determined from #tasks/%complete Else return stored state percent
+ * complete
+ *
+ * @return percent complete of state/tasks
+ */
+ public int getStatePercentComplete() {
+ return getStatePercentComplete(getCurrentStateName());
+ }
+
+ /**
+ * If state has tasks, statePercentComplete is determined from #tasks/%complete Else return stored state percent
+ * complete
+ *
+ * @param stateName
+ * @return percent complete of state/tasks
+ */
+ public int getStatePercentComplete(String stateName) {
+ try {
+ SMAState state = getCurrentStateDam().getState();
+ if (state == null) state = getStateDam().getState(stateName, false);
+ if (state == null) return 0;
+ if (stateName.equals(DefaultTeamState.Implement.name()) && isMetricsFromTasks()) {
+ Collection<TaskArtifact> tasks = smaMgr.getTaskMgr().getTaskArtifacts(state.getName());
+ if (tasks.size() > 0) {
+ int percent = 0;
+ for (TaskArtifact taskArt : tasks)
+ percent += taskArt.getWorldViewTotalPercentComplete();
+ if (percent == 0) return 0;
+ return percent / tasks.size();
+ }
+ return 0;
+ } else {
+ return state.getPercentComplete();
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return 0;
+ }
+ }
+
+ /**
+ * @return return hours spent on state and state-tasks
+ */
+ public double getStateHoursSpent() {
+ return getStateHoursSpent(getCurrentStateName());
+ }
+
+ /**
+ * @param stateName
+ * @return return hours spent on state and state-tasks
+ */
+ public double getStateHoursSpent(String stateName) {
+ SMAState state = null;
+ if (getCurrentStateName().equals(stateName)) state = getCurrentStateDam().getState();
+ if (state == null) state = getStateDam().getState(stateName, false);
+ if (state == null) return 0;
+
+ double hours = 0;
+ try {
+ if ((this instanceof TeamWorkFlowArtifact) && stateName.equals(DefaultTeamState.Implement.name()) && isMetricsFromTasks())
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts(stateName))
+ hours += taskArt.getTotalHoursSpent();
+ else
+ hours = state.getHoursSpent();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return hours;
+ }
+
+ /**
+ * @return total hours spent on current and past states and tasks
+ */
+ public double getTotalHoursSpent() {
+ double hours = 0;
+ try {
+ for (String stateName : smaMgr.getWorkFlow().getPageNames())
+ // Adds state hours and task hours
+ hours += getStateHoursSpent(stateName);
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return hours;
+ }
+
+ public String getEditorTitle() {
+ return getDescriptiveName();
+ }
+
+ public String getWorldViewActionableItems() {
+ return "";
+ }
+
+ public void registerSMARelation(RelationSide side) {
+ smaRelations.add(side);
+ }
+
+ public Image getAssigneeImage() {
+ if (isDeleted()) return null;
+ if (smaMgr.getAssignees().size() > 0) {
+ if (smaMgr.isAssigneeMe())
+ return AtsPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return AtsPlugin.getInstance().getImage("user_sm.gif");
+ }
+ return null;
+ }
+
+ public AtsWorkFlow getWorkFlow() {
+ try {
+ return AtsWorkFlowFactory.getInstance().getWorkflow(this);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public String getCurrentStateName() {
+ try {
+ return currentStateDam.getState().getName();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ /**
+ * @return Returns the CurrentStateDam.
+ */
+ public XCurrentStateDam getCurrentStateDam() {
+ return currentStateDam;
+ }
+
+ /**
+ * @return Returns the current SMAState.
+ */
+ public SMAState getCurrentState() {
+ return getCurrentStateDam().getState();
+ }
+
+ /**
+ * @return Returns the StateDam.
+ */
+ public XStateDam getStateDam() {
+ return stateDam;
+ }
+
+ public void addSubscribed(User user) throws SQLException {
+ relate(RelationSide.SubscribedUser_User, user, true);
+ }
+
+ public void removeSubscribed(User user) throws SQLException {
+ unrelate(RelationSide.SubscribedUser_User, user, true);
+ }
+
+ public boolean isSubscribed(User user) throws SQLException {
+ return (getArtifacts(RelationSide.SubscribedUser_User).contains(user));
+ }
+
+ public ArrayList<User> getSubscribed() throws SQLException {
+ ArrayList<User> arts = new ArrayList<User>();
+ for (Artifact art : getArtifacts(RelationSide.SubscribedUser_User))
+ arts.add((User) art);
+ return arts;
+ }
+
+ public void addFavorite(User user) throws SQLException {
+ relate(RelationSide.FavoriteUser_User, user, true);
+ }
+
+ public void removeFavorite(User user) throws SQLException {
+ unrelate(RelationSide.FavoriteUser_User, user, true);
+ }
+
+ public boolean isFavorite(User user) throws SQLException {
+ return (getArtifacts(RelationSide.FavoriteUser_User).contains(user));
+ }
+
+ public ArrayList<User> getFavorites() throws SQLException {
+ ArrayList<User> arts = new ArrayList<User>();
+ for (Artifact art : getArtifacts(RelationSide.FavoriteUser_User))
+ arts.add((User) art);
+ return arts;
+ }
+
+ public boolean amISubscribed() {
+ try {
+ return isSubscribed(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ } catch (SQLException ex) {
+ return false;
+ }
+ }
+
+ public boolean amIFavorite() {
+ try {
+ return isFavorite(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ } catch (SQLException 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 SQLException {
+ SMAEditor.close(this, true);
+ super.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewType() {
+ return getArtifactTypeName();
+ }
+
+ public String getWorldViewTitle() {
+ return getDescriptiveName();
+ }
+
+ public String getWorldViewState() {
+ return getCurrentStateName();
+ }
+
+ public String getWorldViewActivePoc() {
+ return smaMgr.getAssigneesStr();
+ }
+
+ public String getWorldViewCreatedDateStr() {
+ try {
+ if (getWorldViewCreatedDate() == null) return getCellExceptionString("No creation date");
+ return new XDate(getWorldViewCreatedDate()).getMMDDYYHHMM();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewCompletedDateStr() {
+ try {
+ if (smaMgr.isCompleted()) {
+ if (getWorldViewCompletedDate() == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Completed with no date => " + smaMgr.getSma().getHumanReadableId(),
+ true);
+ return getCellExceptionString("Completed with no date.");
+ }
+ return new XDate(getWorldViewCompletedDate()).getMMDDYYHHMM();
+ }
+ return "";
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewCancelledDateStr() {
+ try {
+ if (smaMgr.isCancelled()) {
+ if (getWorldViewCancelledDate() == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Cancelled with no date => " + smaMgr.getSma().getHumanReadableId(),
+ false);
+ return getCellExceptionString("Cancelled with no date.");
+ }
+ return new XDate(getWorldViewCancelledDate()).getMMDDYYHHMM();
+ }
+ return "";
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public Date getWorldViewCreatedDate() throws Exception {
+ return getLog().getEvent(LogType.Originated).getDate();
+ }
+
+ public String getWorldViewOriginator() {
+ return smaMgr.getOriginator().getName();
+ }
+
+ public String getWorldViewID() {
+ return getHumanReadableId();
+ }
+
+ public String getWorldViewLegacyPCR() {
+ if (isAttributeTypeValid(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName())) return getSoleAttributeValue(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName());
+ return "";
+ }
+
+ public Date getWorldViewCompletedDate() throws Exception {
+ LogItem item = getLog().getStateEvent(LogType.StateEntered, DefaultTeamState.Completed.name());
+ if (item != null) return item.getDate();
+ return null;
+ }
+
+ public Date getWorldViewCancelledDate() throws Exception {
+ LogItem item = getLog().getStateEvent(LogType.StateEntered, DefaultTeamState.Cancelled.name());
+ if (item != null) return item.getDate();
+ return null;
+ }
+
+ public abstract VersionArtifact getTargetedForVersion() throws SQLException;
+
+ public ChangeType getWorldViewChangeType() {
+ return ChangeType.None;
+ }
+
+ public String getWorldViewChangeTypeStr() {
+ if (getWorldViewChangeType() == null || getWorldViewChangeType() == ChangeType.None)
+ return "";
+ else
+ return getWorldViewChangeType().name();
+ }
+
+ public double getWorldViewEstimatedHours() {
+ try {
+ if (isMetricsFromTasks()) {
+ double hours = 0;
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts(DefaultTeamState.Implement.name())) {
+ hours += taskArt.getWorldViewEstimatedHours();
+ }
+ return hours;
+ } else {
+ String value = getSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ if (value == null || value.equals("")) return 0;
+ return new Float(value).doubleValue();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ }
+ return 0;
+ }
+
+ public String getWorldViewUserCommunity() {
+ return "";
+ }
+
+ public String getWorldViewPriority() {
+ return "";
+ }
+
+ public String getWorldViewResolution() {
+ try {
+ return getAttributesToString(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName());
+ } catch (SQLException ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public double getWorldViewRemainHours() {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return 0;
+ double est = getWorldViewEstimatedHours();
+ if (getWorldViewStatePercentComplete() == 0) return getWorldViewEstimatedHours();
+ SMAState implementState = smaMgr.getSMAState(DefaultTeamState.Implement.name(), false);
+ if (implementState == null || implementState.getPercentComplete() == 0) return getWorldViewEstimatedHours();
+ double remain = getWorldViewEstimatedHours() - (est * (implementState.getPercentComplete() / 100.0));
+ return remain;
+ }
+
+ public Result isWorldViewRemainHoursValid() {
+ String value = getSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ if (value == null || value.equals("")) return new Result("Estimated Hours not set.");
+ try {
+ new Float(value).doubleValue();
+ } catch (NumberFormatException ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ return new Result("Estimated Hours value is invalid double \"" + value + "\"");
+ }
+ return Result.TrueResult;
+ }
+
+ public Result isWorldViewManDaysNeededValid() {
+ 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() {
+ double hrsRemain = getWorldViewRemainHours();
+ double manDaysNeeded = 0;
+ if (hrsRemain != 0) manDaysNeeded = hrsRemain / getManDayHrsPreference();
+ return manDaysNeeded;
+ }
+
+ public double getManDayHrsPreference() {
+ return MAN_DAY_HOURS;
+ }
+
+ public double getWorldViewAnnualCostAvoidance() {
+ return 0;
+ }
+
+ public Result isWorldViewAnnualCostAvoidanceValid() {
+ Result result = isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result;
+ String value = getSoleAttributeValue(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName());
+ if (value == null || value.equals("")) return new Result("Weekly Benefit Hours not set.");
+ try {
+ 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 + "\"");
+ }
+ return Result.TrueResult;
+ }
+
+ public String getWorldViewRemainHoursStr() {
+ if (smaMgr.isCancelled() || smaMgr.isCompleted()) return AtsLib.doubleToStrString(0);
+ Result result = isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(getWorldViewRemainHours());
+ }
+
+ public String getWorldViewEstimatedHoursStr() {
+ return AtsLib.doubleToStrString(getWorldViewEstimatedHours());
+ }
+
+ public String getWorldViewNotes() {
+ return getSoleAttributeValue(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewWorkPackage() {
+ return getSoleAttributeValue(ATSAttributes.WORK_PACKAGE_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewCategory() {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewCategory2() {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY2_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewCategory3() {
+ return getSoleAttributeValue(ATSAttributes.CATEGORY3_ATTRIBUTE.getStoreName());
+ }
+
+ public int getWorldViewStatePercentComplete() {
+ return getStatePercentComplete(getCurrentStateName());
+ }
+
+ public String getWorldViewNumberOfTasks() {
+ try {
+ int num = getSmaMgr().getTaskMgr().getTaskArtifacts().size();
+ if (num == 0) return "";
+ return String.valueOf(num);
+ } catch (SQLException ex) {
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+
+ public abstract int getWorldViewTotalPercentComplete();
+
+ public double getWorldViewStateHoursSpent() {
+ return getStateHoursSpent(getCurrentStateName());
+ }
+
+ public String getWorldViewRelatedToState() {
+ return "";
+ }
+
+ public double getWorldViewTotalHoursSpent() {
+ return getTotalHoursSpent();
+ }
+
+ public abstract String getWorldViewVersion();
+
+ /**
+ * 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 boolean isSMADirty() {
+ return isSMADirty(new StringBuilder());
+ }
+
+ public boolean isSMADirty(StringBuilder info) {
+ if (isRelationsAndArtifactsDirty(smaRelations, info)) return true;
+ return false;
+ }
+
+ public void saveSMA() {
+ try {
+ saveRelationsAndArtifacts(smaRelations, false);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't save artifact " + getHumanReadableId(), ex, true);
+ }
+ }
+
+ public void revertSMA() {
+ try {
+ saveRelationsAndArtifacts(smaRelations, true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't revert artifact " + getHumanReadableId(), ex, true);
+ }
+ }
+
+ public abstract Date getWorldViewEstimatedReleaseDate() throws Exception;
+
+ public String getWorldViewEstimatedReleaseDateStr() {
+ try {
+ if (getWorldViewEstimatedReleaseDate() == null) return "";
+ return new XDate(getWorldViewEstimatedReleaseDate()).getMMDDYYHHMM();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public abstract Date getWorldViewReleaseDate() throws Exception;
+
+ public String getWorldViewReleaseDateStr() {
+ try {
+ if (getWorldViewReleaseDate() == null) return "";
+ return new XDate(getWorldViewReleaseDate()).getMMDDYYHHMM();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ 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.
+ */
+ public void statusChanged() {
+ }
+
+ /**
+ * Called at the end of a transition just before transaction manager persist. SMAs can override to perform tasks due
+ * to transition.
+ *
+ * @throws SQLException
+ */
+ public void transitioned(AtsWorkPage fromPage, AtsWorkPage toPage, Collection<User> toAssignees, boolean persist) throws SQLException {
+ }
+
+ /*
+ * (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() {
+ return "Team";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperState()
+ */
+ public String getHyperState() {
+ return getCurrentStateName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.hyper.IHyperArtifact#getHyperAssignee()
+ */
+ public String getHyperAssignee() {
+ return smaMgr.getAssigneesStr();
+ }
+
+ /*
+ * (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() {
+ 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() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact#getParentSMArt()
+ */
+ public Artifact getParentSMArt() throws SQLException {
+ return getParentSMA();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewValidationRequiredStr()
+ */
+ public String getWorldViewValidationRequiredStr() {
+ try {
+ return String.valueOf(getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName()));
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isWorldViewDeadlineAlerting()
+ */
+ public Result isWorldViewDeadlineAlerting() {
+ return Result.FalseResult;
+ }
+
+ public int getWorldViewPercentRework() {
+ return 0;
+ }
+
+ public String getWorldViewPercentReworkStr() {
+ int reWork = getWorldViewPercentRework();
+ if (reWork == 0) return "";
+ return String.valueOf(reWork);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.plugin.event.IEventReceiver#onEvent(org.eclipse.osee.framework.ui.plugin.event.Event)
+ */
+ public void onEvent(Event event) {
+ try {
+ // Check if LocalEvent and NOT RemoteEvent. Since EventService will handle moving access
+ // control changes across the OSEE instances, only handle local events
+ if (event instanceof LocalTransactionEvent) {
+ // Only update access control if THIS artifact is modified
+ if (((LocalTransactionEvent) event).getEventData(this).isModified()) {
+ // Update branch access control
+ smaMgr.getBranchMgr().updateBranchAccessControl();
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.plugin.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return false;
+ }
+
+ public static Set<String> getAllSMATypeNames() {
+ java.util.Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ artTypeNames.addAll(Arrays.asList(new String[] {TaskArtifact.ARTIFACT_NAME, DecisionReviewArtifact.ARTIFACT_NAME,
+ PeerToPeerReviewArtifact.ARTIFACT_NAME}));
+ return artTypeNames;
+ }
+
+ public static Collection<Artifact> getAllSMATypeArtifacts() throws SQLException {
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artType : getAllSMATypeNames())
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ return ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ }
+
+ public static Collection<Artifact> getAllTeamWorkflowArtifacts() throws SQLException {
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artType : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ return ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ public String getWorldViewBranchStatus() {
+ return "";
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
new file mode 100644
index 00000000000..14ecb0a77a1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TaskArtifact.java
@@ -0,0 +1,365 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskArtifact extends StateMachineArtifact implements IWorldViewArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "Task";
+
+ private SMAManager smaMgr;
+
+ public static String INWORK_STATE = "InWork";
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public TaskArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ registerSMARelation(RelationSide.SmaToTask_Sma);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#onInitializationComplete()
+ */
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ smaMgr = new SMAManager(this);
+ }
+
+ /**
+ * @return total hours spent on current and past states and tasks
+ */
+ @Override
+ public double getTotalHoursSpent() {
+ SMAState state = smaMgr.getSMAState(INWORK_STATE, false);
+ if (state == null)
+ return 0;
+ else
+ return state.getHoursSpent();
+ }
+
+ /**
+ * Allow parent SMA's assignees and all priviledged users up Team tree
+ */
+ @Override
+ public Set<User> getPrivilegedUsers() throws SQLException {
+ Set<User> users = new HashSet<User>();
+ StateMachineArtifact parentSma = getParentSMA();
+ if (parentSma instanceof TeamWorkFlowArtifact) users.addAll(((TeamWorkFlowArtifact) parentSma).getPrivilegedUsers());
+ users.addAll(((new SMAManager(parentSma)).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.getCurrentStateName().equals(getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName())));
+ if (!unCancellable) return false;
+ return super.isUnCancellable();
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isTaskable()
+ */
+ @Override
+ public boolean isTaskable() {
+ return false;
+ }
+
+ @Override
+ public String getDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ @Override
+ public String getWorldViewRelatedToState() {
+ return getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName());
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws SQLException {
+ super.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewTeam() {
+ return "";
+ }
+
+ @Override
+ public StateMachineArtifact getParentSMA() throws SQLException {
+ Collection<StateMachineArtifact> smas = getArtifacts(RelationSide.SmaToTask_Sma, StateMachineArtifact.class);
+ if (smas.size() > 0) return smas.iterator().next();
+ return null;
+ }
+
+ public Boolean isCancelled() {
+ return smaMgr.isCancelled();
+ }
+
+ public Boolean isInWork() {
+ return (getCurrentStateName().equals(INWORK_STATE));
+ }
+
+ public Boolean isCompleted() {
+ return smaMgr.isCompleted();
+ }
+
+ // Since Tasks only have one state, state percent is same as InWork state
+ public int getWorldViewTotalPercentComplete() {
+ return smaMgr.getSMAState(INWORK_STATE, false).getPercentComplete();
+ }
+
+ public void transitionToCancelled(String reason, boolean persist) throws IllegalStateException, SQLException {
+ if (getCurrentState().equals(DefaultTeamState.Cancelled.name())) return;
+ setSoleAttributeValue(ATSAttributes.CANCEL_REASON_ATTRIBUTE.getStoreName(), reason);
+ Result result = smaMgr.transition(DefaultTeamState.Cancelled.name(), (User) null, persist);
+ if (result.isFalse()) result.popup();
+ }
+
+ public void transitionToCompleted(boolean persist) {
+ if (getCurrentState().equals(DefaultTeamState.Completed.name())) return;
+ Result result = smaMgr.transition(DefaultTeamState.Completed.name(), (User) null, persist);
+ if (result.isFalse()) result.popup();
+ }
+
+ public void transitionToInWork(User toUser, boolean persist) throws IllegalStateException, SQLException {
+ if (getCurrentState().equals(INWORK_STATE)) return;
+ Result result = smaMgr.transition(INWORK_STATE, toUser, false);
+ if (smaMgr.getSMAState().getPercentComplete() == 100) smaMgr.getCurrentStateDam().setPercentComplete(99);
+ if (persist) smaMgr.getSma().saveSMA();
+ if (result.isFalse()) result.popup();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#statusChanged()
+ */
+ @Override
+ public void statusChanged() {
+ super.statusChanged();
+ if (getCurrentState().getPercentComplete() == 100 && !isCompleted())
+ transitionToCompleted(false);
+ else if (getCurrentState().getPercentComplete() != 100 && isCompleted()) {
+ try {
+ transitionToInWork(SkynetAuthentication.getInstance().getAuthenticatedUser(), true);
+ } catch (IllegalStateException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public void parentWorkFlowTransitioned(AtsWorkPage fromPage, AtsWorkPage toPage, Collection<User> toAssignees, boolean persist) throws IllegalStateException, SQLException {
+ if (toPage.isCancelledPage() && isInWork())
+ transitionToCancelled("Parent Cancelled", persist);
+ else if (fromPage.isCancelledPage() && isCancelled()) transitionToInWork(
+ SkynetAuthentication.getInstance().getAuthenticatedUser(), persist);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewVersion()
+ */
+ public String getWorldViewVersion() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ public String getWorldViewNumberOfTasks() {
+ return "";
+ }
+
+ /**
+ * @return parent SMA's date if it has one. else return task's date if it has one
+ */
+ public Date getWorldViewEstimatedReleaseDate() throws Exception {
+ if (getParentSMA() instanceof TeamWorkFlowArtifact) return ((TeamWorkFlowArtifact) getParentSMA()).getWorldViewEstimatedReleaseDate();
+ return getSoleDateAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+
+ public Date getWorldViewReleaseDate() throws Exception {
+ if (getParentSMA() instanceof TeamWorkFlowArtifact) return ((TeamWorkFlowArtifact) getParentSMA()).getWorldViewReleaseDate();
+ return getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+
+ public VersionArtifact getTargetedForVersion() throws SQLException {
+ return getParentSMA().getTargetedForVersion();
+ }
+
+ @Override
+ public double getWorldViewRemainHours() {
+ if (smaMgr.isCompleted() || smaMgr.isCancelled()) return 0;
+ double est = getWorldViewEstimatedHours();
+ if (getWorldViewStatePercentComplete() == 0) return getWorldViewEstimatedHours();
+ SMAState inWorkState = smaMgr.getSMAState(TaskArtifact.INWORK_STATE, false);
+ if (inWorkState == null || inWorkState.getPercentComplete() == 0) return getWorldViewEstimatedHours();
+ double remain = getWorldViewEstimatedHours() - (est * (inWorkState.getPercentComplete() / 100.0));
+ return remain;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentActionArtifact()
+ */
+ @Override
+ public ActionArtifact getParentActionArtifact() throws SQLException {
+ 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 SQLException {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma instanceof TeamWorkFlowArtifact)
+ return ((TeamWorkFlowArtifact) sma);
+ else
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ public String getWorldViewImplementer() {
+ try {
+ SMAState state = null;
+ if (getCurrentStateName().equals(INWORK_STATE)) {
+ state = getCurrentState();
+ } else {
+ state = getStateDam().getState(INWORK_STATE, false);
+ }
+ if (state != null) {
+ return Artifacts.commaArts(state.getAssignees());
+ }
+ return "";
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws Exception {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() {
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isMetricsFromTasks()
+ */
+ public boolean isMetricsFromTasks() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewLegacyPCR()
+ */
+ public String getWorldViewLegacyPCR() {
+ try {
+ StateMachineArtifact sma = getParentSMA();
+ if (sma != null) return sma.getWorldViewLegacyPCR();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Exception - see log";
+ }
+ return "";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java
new file mode 100644
index 00000000000..5da0e88abbc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamDefinitionArtifact.java
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import org.eclipse.osee.ats.artifact.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.config.AtsConfig;
+import org.eclipse.osee.ats.util.AtsLib;
+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.BasicArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ActiveArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch.SearchOperator;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+
+/**
+ * @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>();
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public TeamDefinitionArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ }
+
+ public static TeamDefinitionArtifact createNewTeamDefinition(String name, String fullname, String description, Collection<User> leads, Collection<User> members, boolean usesVersions, Collection<ActionableItemArtifact> actionableItems, Artifact parentTeamDef) throws SQLException {
+ TeamDefinitionArtifact tda = null;
+ tda =
+ (TeamDefinitionArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ TeamDefinitionArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ tda.setDescriptiveName(name);
+ tda.setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), description);
+ tda.setSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName(), fullname);
+ for (User user : leads) {
+ tda.relate(RelationSide.TeamLead_Lead, user);
+ // All leads are members
+ tda.relate(RelationSide.TeamMember_Member, user);
+ }
+ for (User user : members) {
+ tda.relate(RelationSide.TeamMember_Member, user);
+ }
+
+ if (usesVersions) tda.setSoleAttributeValue(ATSAttributes.TEAM_USES_VERSIONS_ATTRIBUTE.getStoreName(), "yes");
+ tda.persist(true);
+
+ Artifact parentTeamDefinition = parentTeamDef;
+ if (parentTeamDefinition == null) {
+ // Relate to team heading
+ parentTeamDef = AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact();
+ }
+ parentTeamDef.addChild(tda);
+ parentTeamDef.persist(true);
+
+ // Relate to actionable items
+ for (ActionableItemArtifact aia : actionableItems) {
+ tda.relate(RelationSide.TeamActionableItem_ActionableItem, aia);
+ }
+
+ tda.persist(true);
+ return tda;
+ }
+
+ public static TeamDefinitionArtifact getOrCreateTeamsDefinitionArtifact() throws SQLException {
+ return AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact();
+ }
+
+ /**
+ * 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 definintions
+ */
+ public TeamDefinitionArtifact getTeamDefinitionHoldingVersions() throws SQLException {
+ 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;
+ }
+
+ public VersionArtifact getNextReleaseVersion() throws SQLException {
+ for (VersionArtifact verArt : getArtifacts(RelationSide.TeamDefinitionToVersion_Version, VersionArtifact.class)) {
+ if (verArt.getSoleBooleanAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName())) {
+ return verArt;
+ }
+ }
+ return null;
+ }
+
+ public Collection<VersionArtifact> getVersionsFromTeamDefHoldingVersions(VersionReleaseType releaseType) throws SQLException {
+ TeamDefinitionArtifact teamDef = getTeamDefinitionHoldingVersions();
+ if (teamDef == null) return new ArrayList<VersionArtifact>();
+ return teamDef.getVersionsArtifacts(releaseType);
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamDefinitions(Active active) throws SQLException {
+ ActiveArtifactTypeSearch search =
+ new ActiveArtifactTypeSearch(ARTIFACT_NAME, active, BranchPersistenceManager.getInstance().getAtsBranch());
+ return search.getArtifacts(TeamDefinitionArtifact.class);
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamTopLevelDefinitions(Active active) throws SQLException {
+ 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 SQLException {
+ return ArtifactStaticIdSearch.getSingletonArtifactOrException(TeamDefinitionArtifact.ARTIFACT_NAME,
+ TOP_TEAM_STATIC_ID, BranchPersistenceManager.getInstance().getAtsBranch(), SearchOperator.EQUAL,
+ TeamDefinitionArtifact.class);
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamReleaseableDefinitions(Active active) throws SQLException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ ActiveArtifactTypeSearch search =
+ new ActiveArtifactTypeSearch(ARTIFACT_NAME, active, BranchPersistenceManager.getInstance().getAtsBranch());
+ for (TeamDefinitionArtifact teamDef : search.getArtifacts(TeamDefinitionArtifact.class)) {
+ if (teamDef.getVersionsArtifacts().size() > 0 && teamDef.getSoleBooleanAttributeValue(ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName())) teamDefs.add(teamDef);
+ }
+ return teamDefs;
+ }
+
+ public static Set<TeamDefinitionArtifact> getImpactedTeamDefs(Set<ActionableItemArtifact> aias) throws SQLException {
+ Set<TeamDefinitionArtifact> resultTeams = new HashSet<TeamDefinitionArtifact>();
+ for (ActionableItemArtifact aia : aias) {
+ Set<TeamDefinitionArtifact> aiaTeams = getImpactedTeamDef(aia);
+ if (aiaTeams == null) throw new IllegalArgumentException(
+ "No team workflow associated with Actionable Item \"" + aia + "\" (" + aia.getHumanReadableId() + ") or any parent.\n\nAction can not be written against this item.");
+ resultTeams.addAll(aiaTeams);
+ }
+ return resultTeams;
+ }
+
+ public static Set<TeamDefinitionArtifact> getImpactedTeamDef(ActionableItemArtifact aia) throws SQLException {
+ if (aia.getArtifacts(RelationSide.TeamActionableItem_Team).size() > 0) return aia.getArtifacts(
+ RelationSide.TeamActionableItem_Team, TeamDefinitionArtifact.class);
+ Artifact parentArt = aia.getParent();
+ if (parentArt instanceof ActionableItemArtifact) return getImpactedTeamDef((ActionableItemArtifact) parentArt);
+ return null;
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamsFromItemAndChildren(ActionableItemArtifact aia) throws SQLException {
+ Set<TeamDefinitionArtifact> aiaTeams = new HashSet<TeamDefinitionArtifact>();
+ getTeamFromItemAndChildren(aia, aiaTeams);
+ return aiaTeams;
+ }
+
+ public static void getTeamFromItemAndChildren(ActionableItemArtifact aia, Set<TeamDefinitionArtifact> aiaTeams) throws SQLException {
+ if (aia.getArtifacts(RelationSide.TeamActionableItem_Team).size() > 0) aiaTeams.addAll(aia.getArtifacts(
+ RelationSide.TeamActionableItem_Team, TeamDefinitionArtifact.class));
+ for (Artifact childArt : aia.getChildren()) {
+ if (childArt instanceof ActionableItemArtifact) getTeamFromItemAndChildren((ActionableItemArtifact) childArt,
+ aiaTeams);
+ }
+ }
+
+ public static Set<TeamDefinitionArtifact> getTeamsFromItemAndChildren(TeamDefinitionArtifact teamDef) throws SQLException {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ getTeamFromItemAndChildren(Arrays.asList(new TeamDefinitionArtifact[] {teamDef}), teamDefs);
+ return teamDefs;
+ }
+
+ public static void getTeamFromItemAndChildren(Collection<TeamDefinitionArtifact> teamDefs, Set<TeamDefinitionArtifact> returnTeamDefs) throws SQLException {
+ for (TeamDefinitionArtifact teamDef : teamDefs) {
+ returnTeamDefs.add(teamDef);
+ for (Artifact childArt : teamDef.getChildren()) {
+ if (childArt instanceof TeamDefinitionArtifact) getTeamFromItemAndChildren(
+ Arrays.asList(new TeamDefinitionArtifact[] {(TeamDefinitionArtifact) childArt}), returnTeamDefs);
+ }
+ }
+ }
+
+ public static TeamDefinitionArtifact getHeadTeamDefinition() throws SQLException {
+ return (new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, AtsConfig.TEAMS_HEADING,
+ BranchPersistenceManager.getInstance().getAtsBranch())).getSingletonArtifactOrException(TeamDefinitionArtifact.class);
+ }
+
+ public double getManDayHrsFromItemAndChildren() throws SQLException {
+ return getManDayHrsFromItemAndChildren(this);
+ }
+
+ /**
+ * 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
+ * @throws SQLException
+ */
+ public double getManDayHrsFromItemAndChildren(TeamDefinitionArtifact teamDef) throws SQLException {
+ Double manDaysHrs = teamDef.getSoleDoubleAttributeValue(ATSAttributes.MAN_DAYS_NEEDED_ATTRIBUTE.getStoreName());
+ 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;
+ }
+
+ /**
+ * 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 SQLException
+ */
+ public Collection<User> getLeads() throws SQLException {
+ return getArtifacts(RelationSide.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
+ * @throws SQLException
+ */
+ public Collection<User> getLeads(Collection<ActionableItemArtifact> actionableItems) throws SQLException {
+ 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 SQLException {
+ return getArtifacts(RelationSide.TeamMember_Member, User.class);
+ }
+
+ public VersionArtifact getVersionArtifact(String name, boolean create) throws SQLException {
+ for (VersionArtifact verArt : getVersionsArtifacts()) {
+ if (verArt.getDescriptiveName().equals(name)) return verArt;
+ }
+ if (create) return createVersion(name);
+ return null;
+ }
+
+ public VersionArtifact createVersion(String name) {
+ try {
+ VersionArtifact versionArt =
+ (VersionArtifact) configurationPersistenceManager.getArtifactSubtypeDescriptor(
+ VersionArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ versionArt.setDescriptiveName(name);
+ versionArt.persist();
+
+ relate(RelationSide.TeamDefinitionToVersion_Version, versionArt, true);
+ return versionArt;
+ } catch (SQLException ex) {
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ }
+ return null;
+ }
+
+ public Collection<VersionArtifact> getVersionsArtifacts() throws SQLException {
+ return getArtifacts(RelationSide.TeamDefinitionToVersion_Version, VersionArtifact.class);
+ }
+
+ public Collection<VersionArtifact> getVersionsArtifacts(VersionReleaseType releaseType) throws SQLException {
+ 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 IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.TEAM_USES_VERSIONS_ATTRIBUTE.getStoreName());
+ }
+
+ /**
+ * 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 SQLException
+ */
+ public Branch getTeamBranch() throws SQLException {
+ Integer branchId = getSoleIntegerAttributeValue(ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName());
+ if (branchId != null && branchId > 0) {
+ return branchManager.getBranch(branchId);
+ } else {
+ Artifact parent = getParent();
+ if (parent instanceof TeamDefinitionArtifact) {
+ return ((TeamDefinitionArtifact) parent).getTeamBranch();
+ }
+ }
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java
new file mode 100644
index 00000000000..ee830db9e4b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkFlowArtifact.java
@@ -0,0 +1,658 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.AtsPriority.PriorityType;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.util.widgets.XActionableItemsDam;
+import org.eclipse.osee.ats.util.widgets.dialog.AICheckTreeDialog;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSStateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.skynet.core.util.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.XDate;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkFlowArtifact extends StateMachineArtifact implements IWorldViewArtifact, IATSStateMachineArtifact {
+
+ public static String ARTIFACT_NAME = "Team Workflow";
+ private XActionableItemsDam actionableItemsDam;
+
+ /**
+ * @param parentFactory
+ * @param guid
+ * @param humanReadableId
+ * @param branch
+ * @throws SQLException
+ */
+ public TeamWorkFlowArtifact(IArtifactFactory parentFactory, String guid, String humanReadableId, Branch branch) throws SQLException {
+ super(parentFactory, guid, humanReadableId, branch);
+ registerSMARelation(RelationSide.SmaToTask_Task);
+ registerSMARelation(RelationSide.TeamWorkflowToReview_Review);
+ registerSMARelation(RelationSide.TeamWorkflowTargetedForVersion_Version);
+ }
+
+ @Override
+ public boolean showTaskTab() {
+ return (isTaskable() || smaMgr.isCompleted());
+ }
+
+ /*
+ * (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() {
+ super.saveSMA();
+ try {
+ getParentActionArtifact().resetAttributesOffChildren();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't reset Action parent of children", ex, true);
+ }
+ }
+
+ @Override
+ public String getDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isValidationRequired()
+ */
+ @Override
+ public boolean isValidationRequired() throws IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.VALIDATION_REQUIRED_ATTRIBUTE.getStoreName());
+ }
+
+ @Override
+ public int getWorldViewPercentRework() {
+ Integer rework = getSoleIntegerAttributeValue(ATSAttributes.PERCENT_REWORK_ATTRIBUTE.getStoreName());
+ if (rework == null)
+ return 0;
+ else
+ return rework;
+ }
+
+ @Override
+ public Set<User> getPrivilegedUsers() throws SQLException {
+ Set<User> users = new HashSet<User>();
+ try {
+ addLeadUsersUpTree(getTeamDefinition(), users);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return users;
+ }
+
+ private void addLeadUsersUpTree(TeamDefinitionArtifact tda, Set<User> users) {
+ try {
+ users.addAll(tda.getLeads());
+ if (tda.getParent() != null && (tda.getParent() instanceof TeamDefinitionArtifact)) addLeadUsersUpTree(
+ (TeamDefinitionArtifact) tda.getParent(), users);
+ // Add scenario where user is originator AND user is member of team that workflow is
+ // written
+ // against
+ if (!users.contains(SkynetAuthentication.getInstance().getAuthenticatedUser())) {
+ if (smaMgr.getOriginator().equals(SkynetAuthentication.getInstance().getAuthenticatedUser())) {
+ if (tda.getMembers().contains(SkynetAuthentication.getInstance().getAuthenticatedUser())) users.add(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ }
+
+ @Override
+ public String getEditorTitle() {
+ return getTeamTitle();
+ }
+
+ @Override
+ public void onInitializationComplete() {
+ super.onInitializationComplete();
+ actionableItemsDam = new XActionableItemsDam(this);
+ }
+
+ public ChangeType getChangeType() {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ public void setChangeType(ChangeType type) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(), type.name());
+ }
+
+ public PriorityType getPriority() {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ public void setPriority(PriorityType type) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName(), type.getShortName());
+ }
+
+ /**
+ * @return Returns the actionableItemsDam.
+ */
+ public XActionableItemsDam getActionableItemsDam() {
+ return actionableItemsDam;
+ }
+
+ public void setTeamDefinition(TeamDefinitionArtifact tda) throws IllegalStateException, SQLException {
+ this.setSoleAttributeValue(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), tda.getGuid());
+ }
+
+ public TeamDefinitionArtifact getTeamDefinition() throws SQLException {
+ String guid = this.getSoleAttributeValue(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName());
+ if (guid == null || guid.equals("")) throw new IllegalArgumentException(
+ "TeamWorkflow has no TeamDefinition associated.");
+ return (TeamDefinitionArtifact) ArtifactPersistenceManager.getInstance().getArtifact(guid,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ }
+
+ public String getTeamTitle() {
+ return "[" + getTeamName() + "] - " + getDescriptiveName();
+ }
+
+ public String getTeamName() {
+ try {
+ return getTeamDefinition().getDescriptiveName();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Exception - see log";
+ }
+ }
+
+ public String getWorldViewType() {
+ return getTeamName() + " Workflow";
+ }
+
+ public int getWorldViewTotalPercentComplete() {
+ try {
+ if (smaMgr.isCompleted()) return 100;
+ if (smaMgr.isCancelled()) return 0;
+ if (isMetricsFromTasks()) {
+ Collection<TaskArtifact> taskArts = smaMgr.getTaskMgr().getTaskArtifacts(DefaultTeamState.Implement.name());
+ if (taskArts.size() == 0) return 0;
+ int numTasks = taskArts.size();
+ int percent = 0;
+ for (TaskArtifact taskArt : taskArts) {
+ percent += taskArt.getWorldViewTotalPercentComplete();
+ }
+ if (percent == 0) return 0;
+ return (new Double(percent / numTasks)).intValue();
+ } else {
+ SMAState state = smaMgr.getSMAState(DefaultTeamState.Implement.name(), false);
+ if (state != null) return state.getPercentComplete();
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return 0;
+ }
+
+ public ChangeType getWorldViewChangeType() {
+ return ChangeType.getChangeType(getSoleAttributeValue(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName()));
+ }
+
+ public String getWorldViewPriority() {
+ try {
+ return PriorityType.getPriority(getSoleAttributeValue(ATSAttributes.PRIORITY_TYPE_ATTRIBUTE.getStoreName())).getShortName();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ }
+
+ public String getWorldViewUserCommunity() {
+ try {
+ return getAttributesToString(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public String getWorldViewActionableItems() {
+ return getActionableItemsDam().getActionableItemsStr();
+ }
+
+ @Override
+ public void atsDelete(Set<Artifact> deleteArts, Map<Artifact, Object> allRelated) throws SQLException {
+ super.atsDelete(deleteArts, allRelated);
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts())
+ taskArt.atsDelete(deleteArts, allRelated);
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviews())
+ reviewArt.atsDelete(deleteArts, allRelated);
+ }
+
+ public String getWorldViewTeam() {
+ return getTeamName();
+ }
+
+ public ActionArtifact getParentActionArtifact() throws SQLException {
+ Set<ActionArtifact> arts = getArtifacts(RelationSide.ActionToWorkflow_Action, ActionArtifact.class);
+ if (arts.size() == 0) {
+ throw new IllegalStateException("Team " + getHumanReadableId() + " has no parent Action");
+ } else if (arts.size() > 1) {
+ throw new IllegalStateException("Team " + getHumanReadableId() + " has multiple parent Actions");
+ } else
+ return arts.iterator().next();
+ }
+
+ @Override
+ public void transitioned(AtsWorkPage fromPage, AtsWorkPage toPage, Collection<User> toAssignees, boolean persist) throws SQLException {
+ super.transitioned(fromPage, toPage, toAssignees, persist);
+ for (TaskArtifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts())
+ taskArt.parentWorkFlowTransitioned(fromPage, toPage, toAssignees, persist);
+ }
+
+ public String getWorldViewVersion() {
+ try {
+ Collection<VersionArtifact> verArts =
+ getArtifacts(RelationSide.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.logException(AtsPlugin.class, errStr, null, false);
+ return getCellExceptionString(errStr);
+ }
+ VersionArtifact verArt = verArts.iterator().next();
+ if (!smaMgr.isCompleted() && verArt.getSoleBooleanAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName())) {
+ String errStr =
+ "Workflow " + smaMgr.getSma().getHumanReadableId() + " targeted for released version, but not completed: " + verArt;
+ OSEELog.logException(AtsPlugin.class, errStr, null, false);
+ return getCellExceptionString(errStr);
+ }
+ return verArt.getDescriptiveName();
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ return "";
+ }
+
+ public void setTargetedForVersion(VersionArtifact version, boolean persist) throws SQLException {
+ relateReplace(RelationSide.TeamWorkflowTargetedForVersion_Version, version, persist);
+ }
+
+ public VersionArtifact getTargetedForVersion() throws SQLException {
+ return (VersionArtifact) getFirstArtifact(RelationSide.TeamWorkflowTargetedForVersion_Version);
+ }
+
+ @Override
+ public String getHyperName() {
+ return getTeamName();
+ }
+
+ @Override
+ public double getManDayHrsPreference() {
+ try {
+ return getTeamDefinition().getManDayHrsFromItemAndChildren();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ 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().getArtifacts(RelationSide.TeamActionableItem_ActionableItem,
+ ActionableItemArtifact.class));
+ diag.setInitialSelections(actionableItemsDam.getActionableItems().toArray(
+ new Object[actionableItemsDam.getActionableItems().size()]));
+ if (diag.open() != 0) {
+ toReturn = new Result("Add/Remove Cancelled");
+ } else if (diag.getResult().length == 0) {
+ toReturn = new Result("At least one actionable item must remain.");
+ } else {
+ Set<ActionableItemArtifact> selectedAlias = new HashSet<ActionableItemArtifact>();
+ for (Object obj : diag.getResult()) {
+ selectedAlias.add((ActionableItemArtifact) obj);
+ }
+
+ ActionableItemsTx txWrapper =
+ new ActionableItemsTx(BranchPersistenceManager.getInstance().getAtsBranch(), selectedAlias, null);
+ txWrapper.execute();
+ toReturn = txWrapper.getResult();
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ toReturn = Result.FalseResult;
+ }
+ return toReturn;
+ }
+
+ public Result convertActionableItems() throws SQLException {
+ 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);
+
+ try {
+ diag.setInput(ActionableItemArtifact.getTopLevelActionableItems(Active.Both));
+ if (diag.open() != 0) return Result.FalseResult;
+ if (diag.getResult().length == 0) return new Result("At least one actionable item must must be selected.");
+ if (diag.getResult().length > 1) return new Result("Only ONE actionable item can be selected for converts");
+ ActionableItemArtifact selectedAia = (ActionableItemArtifact) diag.getResult()[0];
+ Set<TeamDefinitionArtifact> teamDefs = ActionableItemArtifact.getImpactedTeamDef(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);
+ ActionableItemsTx txWrapper =
+ new ActionableItemsTx(BranchPersistenceManager.getInstance().getAtsBranch(), toProcess,
+ newTeamDef);
+ txWrapper.execute();
+ toReturn = txWrapper.getResult();
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ throw new SQLException(ex.getLocalizedMessage());
+ }
+ return toReturn;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentSMA()
+ */
+ @Override
+ public StateMachineArtifact getParentSMA() throws SQLException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDescription()
+ */
+ public String getWorldViewDescription() {
+ 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.
+ */
+ public Date getWorldViewEstimatedReleaseDate() throws Exception {
+ Collection<VersionArtifact> vers =
+ getArtifacts(RelationSide.TeamWorkflowTargetedForVersion_Version, VersionArtifact.class);
+ Date date = null;
+ if (vers.size() > 0) {
+ date = vers.iterator().next().getEstimatedReleaseDate();
+ if (date == null) {
+ date = getSoleDateAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+ } else
+ date = getSoleDateAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName());
+ return date;
+ }
+
+ @Override
+ public double getWorldViewRemainHours() {
+ try {
+ if (isMetricsFromTasks()) {
+ SMAManager smaMgr = new SMAManager(this);
+
+ Collection<TaskArtifact> taskArts = smaMgr.getTaskMgr().getTaskArtifacts(DefaultTeamState.Implement.name());
+ double remainHrs = 0;
+ for (TaskArtifact taskArt : taskArts) {
+ remainHrs += taskArt.getWorldViewRemainHours();
+ }
+ return remainHrs;
+
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return super.getWorldViewRemainHours();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#isWorldViewRemainHoursValid()
+ */
+ @Override
+ public Result isWorldViewRemainHoursValid() {
+ try {
+ if (isMetricsFromTasks()) {
+ SMAManager smaMgr = new SMAManager(this);
+ Collection<TaskArtifact> taskArts = smaMgr.getTaskMgr().getTaskArtifacts(DefaultTeamState.Implement.name());
+ if (taskArts.size() == 0) return new Result("No tasks assigned for Implement state");
+ for (TaskArtifact taskArt : taskArts) {
+ String value = taskArt.getSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ if (value == null || value.equals("")) return new Result("Task Estimated Hours not set.");
+ try {
+ new Float(value).doubleValue();
+ } catch (NumberFormatException ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ return new Result("Estimated Hours value is invalid double \"" + value + "\"");
+ }
+ }
+ return Result.TrueResult;
+ }
+ } catch (SQLException ex) {
+ return new Result("Exception: " + ex.getLocalizedMessage());
+ }
+ return super.isWorldViewRemainHoursValid();
+ }
+
+ /**
+ * If targeted for version exists, return that estimated date. Else, if attribute is set, return that date. Else
+ * null.
+ */
+ public Date getWorldViewReleaseDate() throws Exception {
+ Collection<VersionArtifact> vers =
+ getArtifacts(RelationSide.TeamWorkflowTargetedForVersion_Version, VersionArtifact.class);
+ Date date = null;
+ if (vers.size() > 0) {
+ date = vers.iterator().next().getReleaseDate();
+ if (date == null) {
+ date = getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+ } else
+ date = getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName());
+ return date;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewImplementer()
+ */
+ public String getWorldViewImplementer() {
+ SMAState state = getStateDam().getState(DefaultTeamState.Implement.name(), false);
+ if (state != null) return Artifacts.commaArts(state.getAssignees());
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDateStr()
+ */
+ public String getWorldViewDeadlineDateStr() {
+ try {
+ Date date = getWorldViewDeadlineDate();
+ if (date != null) return new XDate(date).getMMDDYY();
+ } catch (Exception ex) {
+ return getCellExceptionString(ex);
+ }
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewDeadlineDate()
+ */
+ public Date getWorldViewDeadlineDate() throws Exception {
+ return getSoleDateAttributeValue(ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewWeeklyBenefit()
+ */
+ public double getWorldViewWeeklyBenefit() {
+ String value = getSoleAttributeValue(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE.getStoreName());
+ if (value == null || value.equals("")) return 0;
+ try {
+ return new Float(value).doubleValue();
+ } catch (NumberFormatException ex) {
+ OSEELog.logException(AtsPlugin.class, "HRID " + getHumanReadableId(), ex, true);
+ }
+ return 0;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewAnnualCostAvoidance()
+ */
+ public double getWorldViewAnnualCostAvoidance() {
+ double benefit = getWorldViewWeeklyBenefit();
+ double remainHrs = getWorldViewRemainHours();
+ return (benefit * 52) - remainHrs;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#isMetricsFromTasks()
+ */
+ public boolean isMetricsFromTasks() throws IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.METRICS_FROM_TASKS_ATTRIBUTE.getStoreName());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.artifact.StateMachineArtifact#getParentTeamWorkflow()
+ */
+ @Override
+ public TeamWorkFlowArtifact getParentTeamWorkflow() throws SQLException {
+ return this;
+ }
+
+ private final class ActionableItemsTx extends AbstractSkynetTxTemplate {
+
+ private Result workResult;
+ private Set<ActionableItemArtifact> selectedAlias;
+ private TeamDefinitionArtifact teamDefinition;
+
+ public ActionableItemsTx(Branch branch, Set<ActionableItemArtifact> selectedAlias, TeamDefinitionArtifact teamDefinition) {
+ super(branch);
+ this.workResult = Result.TrueResult;
+ this.selectedAlias = selectedAlias;
+ this.teamDefinition = teamDefinition;
+ }
+
+ public Result getResult() {
+ return workResult;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.transaction.AbstractTxTemplate#handleTxWork()
+ */
+ @Override
+ protected void handleTxWork() throws Exception {
+ workResult = actionableItemsDam.setActionableItems(selectedAlias);
+ if (workResult.isTrue()) {
+ if (teamDefinition != null) setTeamDefinition(teamDefinition);
+ getParentActionArtifact().resetAttributesOffChildren();
+ persist();
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.world.IWorldViewArtifact#getWorldViewBranchStatus()
+ */
+ public String getWorldViewBranchStatus() {
+ try {
+ if (getSmaMgr().getBranchMgr().isWorkingBranch())
+ return "Working";
+ else if (getSmaMgr().getBranchMgr().isCommittedBranch()) return "Committed";
+ return "";
+ } catch (SQLException ex) {
+ return "Exception: " + ex.getLocalizedMessage();
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.java
new file mode 100644
index 00000000000..aa6df4f7ecc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowExtensions.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.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
+ */
+/**
+ * @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( {"deprecation", "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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/TeamWorkflowLabelProvider.java
new file mode 100644
index 00000000000..d98b83e865f
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.java
new file mode 100644
index 00000000000..a0628523304
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/VersionArtifact.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.artifact;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.Date;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+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.factory.IArtifactFactory;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+public class VersionArtifact extends BasicArtifact {
+
+ public static String ARTIFACT_NAME = "Version";
+
+ public static enum VersionReleaseType {
+ Released, UnReleased, Both
+ };
+
+ public VersionArtifact(String guid) throws SQLException {
+ this(null, guid, null, null);
+ }
+
+ public VersionArtifact(IArtifactFactory parentFactory, Branch tagId) throws SQLException {
+ this(parentFactory, null, null, tagId);
+ }
+
+ public VersionArtifact(IArtifactFactory parentFactory, String guid, String humandReadableId, Branch tagId) throws SQLException {
+ super(parentFactory, guid, humandReadableId, tagId);
+ }
+
+ public TeamDefinitionArtifact getParentTeamDefinition() throws SQLException {
+ return getArtifacts(RelationSide.TeamDefinitionToVersion_TeamDefinition, TeamDefinitionArtifact.class).iterator().next();
+ }
+
+ public Boolean isReleased() throws IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName());
+ }
+
+ public Boolean isNextVersion() throws IllegalStateException, SQLException {
+ return getSoleBooleanAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName());
+ }
+
+ public String toString() {
+ return getDescriptiveName();
+ }
+
+ public void setReleased(boolean released) throws IllegalStateException, SQLException {
+ setSoleBooleanAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), released);
+ }
+
+ public void setNextVersion(boolean nextVersion) throws IllegalStateException, SQLException {
+ setSoleBooleanAttributeValue(ATSAttributes.NEXT_VERSION_ATTRIBUTE.getStoreName(), nextVersion);
+ }
+
+ public String getFullName() {
+ return getSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName());
+ }
+
+ public void setFullName(String name) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.FULL_NAME_ATTRIBUTE.getStoreName(), name);
+ }
+
+ public String getDescription() {
+ return getSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName());
+ }
+
+ public void setDescription(String desc) throws IllegalStateException, SQLException {
+ setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), desc);
+ }
+
+ public Collection<TeamWorkFlowArtifact> getTargetedForTeamArtifacts() throws SQLException {
+ return getArtifacts(RelationSide.TeamWorkflowTargetedForVersion_Workflow, TeamWorkFlowArtifact.class);
+ }
+
+ public String getFullDisplayName() {
+ 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 SQLException {
+ return (TeamDefinitionArtifact) getFirstArtifact(RelationSide.TeamDefinitionToVersion_TeamDefinition);
+ }
+
+ public Date getEstimatedReleaseDate() throws IllegalStateException, SQLException {
+ return getSoleDateAttributeValue(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+
+ public Date getReleaseDate() throws IllegalStateException, SQLException {
+ return getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName());
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.java
new file mode 100644
index 00000000000..8b484d5795e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/annotation/ReviewAnnotationHandler.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.artifact.annotation;
+
+import java.sql.SQLException;
+import java.util.Set;
+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.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;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfig.java
new file mode 100644
index 00000000000..31acc705cfd
--- /dev/null
+++ b/MS_0.1.4_20080103/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 java.sql.SQLException;
+import java.util.Collection;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.NativeArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+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 HEADING_ARTIFACT = "Heading";
+ public static String ATS_HEADING = "Action Tracking System";
+ public static String MSA_TOOLS_HEADING = "MSA Tools";
+ public static String WORKFLOW_DIAGRAMS_HEADING = "Workflow Diagrams";
+ public static String TEAMS_HEADING = "Teams";
+ public static String ACTIONABLE_ITEMS_HEADING = "Actionable Items";
+
+ private AtsConfig() {
+ super();
+ }
+
+ public static AtsConfig getInstance() {
+ return instance;
+ }
+
+ public ActionableItemArtifact getOrCreateActionableItemsHeadingArtifact() throws SQLException {
+ Artifact art = getOrCreateHeadingArtifact(ActionableItemArtifact.ARTIFACT_NAME, ACTIONABLE_ITEMS_HEADING);
+ if (!art.getAttributesToStringCollection(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).contains(
+ ActionableItemArtifact.TOP_AI_STATIC_ID)) {
+ art.getAttributeManager(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).getNewAttribute().setVarchar(
+ ActionableItemArtifact.TOP_AI_STATIC_ID);
+ }
+ validateATSHeadingParent(art);
+ return (ActionableItemArtifact) art;
+ }
+
+ public TeamDefinitionArtifact getOrCreateTeamsDefinitionArtifact() throws SQLException {
+ Artifact art = getOrCreateHeadingArtifact(TeamDefinitionArtifact.ARTIFACT_NAME, TEAMS_HEADING);
+ if (!art.getAttributesToStringCollection(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).contains(
+ TeamDefinitionArtifact.TOP_TEAM_STATIC_ID)) {
+ art.getAttributeManager(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).getNewAttribute().setVarchar(
+ TeamDefinitionArtifact.TOP_TEAM_STATIC_ID);
+ }
+ validateATSHeadingParent(art);
+ return (TeamDefinitionArtifact) art;
+ }
+
+ public Artifact getOrCreateWorkflowDiagramsArtifact() throws SQLException {
+ Artifact art = getOrCreateHeadingArtifact(HEADING_ARTIFACT, WORKFLOW_DIAGRAMS_HEADING);
+ validateATSHeadingParent(art);
+ return art;
+ }
+
+ private void validateATSHeadingParent(Artifact art) {
+ if (art.getParent() == null) {
+ try {
+ Artifact atsHeadingArtifact = getOrCreateAtsHeadingArtifact();
+ atsHeadingArtifact.addChild(art);
+ atsHeadingArtifact.persist(true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public Artifact getOrCreateAtsHeadingArtifact() throws SQLException {
+ Artifact art = getOrCreateHeadingArtifact(HEADING_ARTIFACT, ATS_HEADING);
+ if (art.getParent() == null) {
+ try {
+ Artifact rootArt =
+ ArtifactPersistenceManager.getInstance().getDefaultHierarchyRootArtifact(
+ BranchPersistenceManager.getInstance().getAtsBranch(), true);
+ rootArt.addChild(art);
+ rootArt.persist(true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return art;
+ }
+
+ public Artifact getOrCreateMsaToolsHeadingArtifact() throws SQLException {
+ Artifact art = getOrCreateHeadingArtifact(HEADING_ARTIFACT, MSA_TOOLS_HEADING);
+ if (art.getParent() == null) {
+ try {
+ Artifact rootArt =
+ ArtifactPersistenceManager.getInstance().getDefaultHierarchyRootArtifact(
+ BranchPersistenceManager.getInstance().getAtsBranch(), true);
+ rootArt.addChild(art);
+ rootArt.persist(true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return art;
+ }
+
+ private static Artifact getOrCreateHeadingArtifact(String artifactTypeName, String name) throws SQLException {
+
+ // Get if it already exists
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(artifactTypeName, name, BranchPersistenceManager.getInstance().getAtsBranch());
+ Collection<NativeArtifact> arts = srch.getArtifacts(NativeArtifact.class);
+ if (arts.size() == 1) return arts.iterator().next();
+ if (arts.size() > 0) throw new IllegalArgumentException(
+ "Should be 1 \"" + name + "\" heading artifact. Found " + arts.size());
+
+ Artifact rootArt = null;
+ try {
+ rootArt =
+ (Artifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(artifactTypeName,
+ BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ rootArt.setDescriptiveName(name);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ return rootArt;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.java
new file mode 100644
index 00000000000..d74c6b8125c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsDatabaseConfig.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.config;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.workflow.AtsWorkFlowFactory;
+import org.eclipse.osee.framework.database.initialize.tasks.DbInitializationTask;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.XViewerCustomizationArtifact;
+
+public class AtsDatabaseConfig extends DbInitializationTask {
+
+ public void run(Connection connection) throws Exception {
+ createXViewerGlobalCustomization();
+ createAtsTopLevelConfigObjects();
+ // Imports workflow vue diagrams as id specified in extension point
+ (new ImportWorkflowAction(false)).run();
+ // Creates Actionable Items and Teams
+ // Teams are related to workflow by id specified in team object in VUE diagram
+ (new LoadAIsAndTeamsAction(false)).run();
+ linkHeadTeamDefinitionWithReviewsAndTaskWorkflowDiagrams();
+ }
+
+ private void linkHeadTeamDefinitionWithReviewsAndTaskWorkflowDiagrams() throws SQLException {
+ TeamDefinitionArtifact teamDef = TeamDefinitionArtifact.getHeadTeamDefinition();
+
+ // Relate task workflow
+ Artifact taskWorkflow =
+ (new ArtifactTypeNameSearch("General Document", AtsWorkFlowFactory.DEFAULT_TASK_WORKFLOW,
+ BranchPersistenceManager.getInstance().getAtsBranch())).getSingletonArtifactOrException(Artifact.class);
+ teamDef.relate(RelationSide.TeamDefinitionToTaskWorkflowDiagram_WorkflowDiagram, taskWorkflow);
+
+ // Relate peer to Peer review
+ Artifact peerWorkflow =
+ (new ArtifactTypeNameSearch("General Document", AtsWorkFlowFactory.PEERTOPEER_REVIEW_WORKFLOW,
+ BranchPersistenceManager.getInstance().getAtsBranch())).getSingletonArtifactOrException(Artifact.class);
+ teamDef.relate(RelationSide.TeamDefinitionToPeerToPeerReviewWorkflowDiagram_WorkflowDiagram, peerWorkflow);
+
+ // Relate peer to Peer review
+ Artifact decisionWorkflow =
+ (new ArtifactTypeNameSearch("General Document", AtsWorkFlowFactory.DECISION_REVIEW_WORKFLOW,
+ BranchPersistenceManager.getInstance().getAtsBranch())).getSingletonArtifactOrException(Artifact.class);
+ teamDef.relate(RelationSide.TeamDefinitionToDecisionReviewWorkflowDiagram_WorkflowDiagram, decisionWorkflow);
+
+ teamDef.persist(true);
+ }
+
+ private void createAtsTopLevelConfigObjects() throws SQLException {
+ AtsConfig.getInstance().getOrCreateAtsHeadingArtifact();
+ AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact();
+ AtsConfig.getInstance().getOrCreateActionableItemsHeadingArtifact();
+ AtsConfig.getInstance().getOrCreateWorkflowDiagramsArtifact();
+ }
+
+ private void createXViewerGlobalCustomization() throws SQLException {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(XViewerCustomizationArtifact.ARTIFACT_TYPE_NAME, "",
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (srch.getArtifacts(XViewerCustomizationArtifact.class).size() == 0) {
+ XViewerCustomizationArtifact art =
+ (XViewerCustomizationArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ XViewerCustomizationArtifact.ARTIFACT_TYPE_NAME,
+ BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ art.persist();
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/ImportWorkflowAction.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/ImportWorkflowAction.java
new file mode 100644
index 00000000000..1949cd48a2e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/ImportWorkflowAction.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.config;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+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.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.swt.widgets.Display;
+import org.osgi.framework.Bundle;
+
+/**
+ * Retrieve workflow extension points and import workflows into system
+ */
+public class ImportWorkflowAction extends Action {
+ private final boolean prompt;
+ private final String pluginId;
+
+ /**
+ * Will import all workflows as specified in plugin extensions
+ *
+ * @param prompt
+ */
+ public ImportWorkflowAction(boolean prompt) {
+ this(prompt, null);
+ }
+
+ /**
+ * Will import only workflows specified in pluginId's extensions The constructor.
+ */
+ public ImportWorkflowAction(boolean prompt, String pluginId) {
+ super("Import Workflows");
+ this.prompt = prompt;
+ this.pluginId = pluginId;
+ }
+
+ /**
+ * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench
+ * UI.
+ */
+ public void run() {
+ if (prompt && !MessageDialog.openQuestion(Display.getCurrent().getActiveShell(), "Import ATS Workflows?",
+ "Importing ATS Workflows\n\nAre you sure?")) return;
+
+ for (Entry<String, URL> idToURL : loadWorkflowIdToURL(pluginId).entrySet()) {
+ // System.out.println(" Loading " + idToURL.getKey());
+ WorkflowDiagramFactory diagFact = WorkflowDiagramFactory.getInstance();
+ try {
+ diagFact.importWorkflowDiagramToSkynet(idToURL.getValue().openStream(), idToURL.getKey());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ }
+
+ public static String getWorkflowXmlFromFile(String contains) throws IOException {
+ for (Entry<String, URL> idToURL : loadWorkflowIdToURL().entrySet()) {
+ if (idToURL.getKey().contains(contains)) {
+ return Lib.inputStreamToString(idToURL.getValue().openStream());
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("deprecation")
+ private static Map<String, URL> loadWorkflowIdToURL() {
+ return loadWorkflowIdToURL(null);
+ }
+
+ private static Map<String, URL> loadWorkflowIdToURL(String pluginId) {
+ Map<String, URL> resources = new HashMap<String, URL>();
+ IExtensionPoint point =
+ Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.osee.ats.AtsVueWorkflowDiagram");
+ if (point == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Can't access AtsVueWorkflowDiagram extension point", true);
+ return resources;
+ }
+ IExtension[] extensions = point.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ String vueFilename = null;
+ String id = null;
+ String bundleName = null;
+ for (IConfigurationElement el : elements) {
+ if (el.getName().equals("AtsVueWorkflowDiagram")) {
+ id = el.getAttribute("id");
+ vueFilename = el.getAttribute("vueFilename");
+ bundleName = el.getContributor().getName();
+ if (pluginId == null || pluginId.equals(bundleName)) {
+ if (vueFilename != null && bundleName != null) {
+ Bundle bundle = Platform.getBundle(bundleName);
+ try {
+ URL url = bundle.getEntry(vueFilename);
+ if (url == null) throw new IllegalStateException(
+ "Invalid AtsVueWorkflowDiagram filename =>" + vueFilename + " specified in bundle => " + bundleName);
+ resources.put(id, url);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsVueWorkflowDiagram extension", ex,
+ false);
+ }
+ }
+ }
+ }
+ }
+ }
+ return resources;
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/LoadAIsAndTeamsAction.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/LoadAIsAndTeamsAction.java
new file mode 100644
index 00000000000..5c7349a943a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/LoadAIsAndTeamsAction.java
@@ -0,0 +1,334 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.net.URL;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+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.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.workflow.AtsWorkFlow;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage.PageType;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactStaticIdSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+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 extends Action {
+ private Map<String, ActionableItemArtifact> idToActionItem = new HashMap<String, ActionableItemArtifact>();
+ private final boolean prompt;
+ private static String FULL_NAME = "Full Name:";
+ private static String DESCRIPTION = "Description:";
+ private static String WORKFLOW_ID = "WorkflowId:";
+ private static String STATIC_ID = "StaticId:";
+ private static String GET_OR_CREATE = "GetOrCreate";
+ private static String LEAD = "Lead:";
+ private static String MEMBER = "Member:";
+ private static String TEAM_USES_VERSIONS = "AtsTeamUsesVersions";
+ private final String bundleId;
+
+ public LoadAIsAndTeamsAction(boolean prompt) {
+ this(prompt, null);
+ }
+
+ /**
+ * The constructor.
+ */
+ public LoadAIsAndTeamsAction(boolean prompt, String bundleId) {
+ super("Load ATS Config");
+ this.prompt = prompt;
+ this.bundleId = bundleId;
+ }
+
+ /**
+ * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench
+ * UI.
+ */
+ public 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()) {
+ // System.out.println(" Loading " + entry.getKey());
+ AtsWorkFlow workFlow =
+ WorkflowDiagramFactory.getInstance().getWorkFlowFromFileContents(entry.getKey(), entry.getValue());
+ processWorkflow(workFlow);
+ }
+ }
+
+ @SuppressWarnings("deprecation")
+ 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 AtsWorkFlow workFlow) {
+ if (workFlow == null) throw new IllegalArgumentException("ATS config items can't be loaded.");
+
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ // Get or create ATS root artifact
+ Artifact atsHeading = AtsConfig.getInstance().getOrCreateAtsHeadingArtifact();
+
+ // Create Actionable Items
+ AtsWorkPage workPage = workFlow.getAtsPage("Actionable Items");
+ addActionableItem(atsHeading, workPage);
+ atsHeading.persist(true);
+
+ // Create Teams
+ workPage = workFlow.getAtsPage("Teams");
+ addTeam(atsHeading, workPage);
+ atsHeading.persist(true);
+
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ public TeamDefinitionArtifact addTeam(Artifact parent, AtsWorkPage page) throws SQLException {
+ // System.out.println("Adding Team " + page.getName());
+ TeamDefinitionArtifact teamDefArt = null;
+ if (page.getName().equals(AtsConfig.TEAMS_HEADING)) {
+ teamDefArt = AtsConfig.getInstance().getOrCreateTeamsDefinitionArtifact();
+ } else {
+
+ ArrayList<User> leads = new ArrayList<User>();
+ ArrayList<User> members = new ArrayList<User>();
+ java.util.Set<String> staticIds = new HashSet<String>();
+ String desc = "";
+ boolean teamUsesVersions = false;
+ boolean getOrCreate = false;
+ String fullName = "";
+ String workflowId = "";
+ 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(FULL_NAME))
+ fullName = line.replaceFirst(FULL_NAME, "");
+ else if (line.startsWith(TEAM_USES_VERSIONS))
+ teamUsesVersions = true;
+ else if (line.startsWith(LEAD)) {
+ String name = line.replaceFirst(LEAD, "");
+ // Get user or create temp user if not on production DB
+ User u = SkynetAuthentication.getInstance().getUserByName(name, !AtsPlugin.isProductionDb());
+ leads.add(u);
+ } else if (line.startsWith(MEMBER)) {
+ String name = line.replaceFirst(MEMBER, "");
+ // Get user or create temp user if not on production DB
+ User u = SkynetAuthentication.getInstance().getUserByName(name, !AtsPlugin.isProductionDb());
+ members.add(u);
+ } else
+ throw new IllegalArgumentException(
+ "Unhandled AtsConfig Line\"" + line + "\" in diagram page \"" + page.getName() + "\"");
+ }
+ }
+
+ ArrayList<ActionableItemArtifact> actionableItems = new ArrayList<ActionableItemArtifact>();
+ for (AtsWorkPage childPage : page.getToAtsPages()) {
+ 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 has been specified, search to see if team already exists to reuse
+ if (getOrCreate) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, page.getName(),
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ teamDefArt = srch.getSingletonArtifact(TeamDefinitionArtifact.class);
+
+ if (teamDefArt != null) {
+ teamDefArt.relate(RelationSide.TeamActionableItem_ActionableItem, actionableItems);
+ }
+ }
+ if (teamDefArt == null) {
+ teamDefArt =
+ TeamDefinitionArtifact.createNewTeamDefinition(page.getName(), fullName, desc, leads, members,
+ teamUsesVersions, actionableItems, parent);
+ }
+ for (String staticId : staticIds) {
+ teamDefArt.getAttributeManager(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).getNewAttribute().setStringData(
+ staticId);
+ }
+
+ if (!workflowId.equals("")) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(WorkflowDiagramFactory.GENERAL_DOCUMENT_ARTIFACT_NAME, workflowId,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ Artifact workflowArt = srch.getSingletonArtifactOrException(Artifact.class);
+ teamDefArt.relate(RelationSide.TeamDefinitionToWorkflowDiagram_WorkflowDiagram, workflowArt);
+ }
+
+ teamDefArt.persist(true);
+ }
+
+ // Handle all team children
+ for (AtsWorkPage childPage : page.getToAtsPages())
+ if (childPage.getPageType() == PageType.Team) addTeam(teamDefArt, (AtsWorkPage) childPage);
+
+ return teamDefArt;
+ }
+
+ public ActionableItemArtifact addActionableItem(Artifact parent, AtsWorkPage page) throws SQLException {
+ // System.out.println("Processing page " + page.getName());
+ ActionableItemArtifact aia = null;
+ boolean getOrCreate = false;
+ 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(LEAD)) {
+ String name = line.replaceFirst(LEAD, "");
+ // Get user or create temp user if not on production DB
+ User u = SkynetAuthentication.getInstance().getUserByName(name, !AtsPlugin.isProductionDb());
+ 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();
+ } else {
+ if (getOrCreate) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(ActionableItemArtifact.ARTIFACT_NAME, page.getName(),
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ aia = srch.getSingletonArtifact(ActionableItemArtifact.class);
+ }
+ if (aia == null) {
+ aia =
+ (ActionableItemArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ ActionableItemArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ aia.setDescriptiveName(page.getName());
+ for (String staticId : staticIds) {
+ aia.getAttributeManager(ArtifactStaticIdSearch.STATIC_ID_ATTRIBUTE).getNewAttribute().setStringData(
+ staticId);
+ }
+ for (User user : leads) {
+ aia.relate(RelationSide.TeamLead_Lead, user);
+ }
+
+ aia.persist();
+ idToActionItem.put(page.getId(), aia);
+ parent.addChild(aia);
+ parent.persist();
+ }
+ }
+ for (WorkPage childPage : page.getToPages()) {
+ addActionableItem(aia, (AtsWorkPage) childPage);
+ }
+ aia.persist();
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/WorkflowDiagramFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/WorkflowDiagramFactory.java
new file mode 100644
index 00000000000..1ae8babe489
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/WorkflowDiagramFactory.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.config;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.ats.workflow.AtsWorkFlow;
+import org.eclipse.osee.ats.workflow.VueWorkFlow;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.NativeArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkflowDiagramFactory {
+
+ private static WorkflowDiagramFactory instance = new WorkflowDiagramFactory();
+ public static String GENERAL_DOCUMENT_ARTIFACT_NAME = "General Document";
+ private static Map<Object, String> objToAtsWorkFlowXml = new HashMap<Object, String>();
+
+ private WorkflowDiagramFactory() {
+ super();
+ }
+
+ public static WorkflowDiagramFactory getInstance() {
+ return instance;
+ }
+
+ /**
+ * Create, import and relate to in default hierarchy the given vue workflow
+ *
+ * @param pluginVueFilename
+ * @param name
+ * @return NativeArtifact created
+ */
+ public NativeArtifact importWorkflowDiagramToSkynet(InputStream inputStream, String name) throws SQLException, IOException {
+ NativeArtifact art = null;
+ // System.out.println("Importing diagram " + name);
+ art =
+ (NativeArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ GENERAL_DOCUMENT_ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ art.setDescriptiveName(name);
+ art.setSoleAttributeValue("Extension", "vue");
+ art.setNativeContent(inputStream);
+ art.persist();
+
+ Artifact diagHeadArt = AtsConfig.getInstance().getOrCreateWorkflowDiagramsArtifact();
+ diagHeadArt.addChild(art);
+ diagHeadArt.persist(true);
+ return art;
+ }
+
+ public AtsWorkFlow getAtsWorkflowFromSkynet(String diagramName) throws IOException, SQLException {
+ Artifact workflowDiagArt = getAtsWorkflowArtifact(diagramName);
+ return getAtsWorkflowFromArtifact(workflowDiagArt);
+ }
+
+ public NativeArtifact getAtsWorkflowArtifact(String diagramName) throws SQLException {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(GENERAL_DOCUMENT_ARTIFACT_NAME, diagramName,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ return srch.getSingletonArtifactOrException(NativeArtifact.class);
+ }
+
+ public boolean atsWorkflowArtifactExists(String diagramName) throws SQLException {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(GENERAL_DOCUMENT_ARTIFACT_NAME, diagramName,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ return srch.getArtifacts(NativeArtifact.class).size() == 1;
+ }
+
+ public AtsWorkFlow getAtsWorkflowFromArtifact(Artifact artifact) throws IOException, SQLException {
+ if (!objToAtsWorkFlowXml.containsKey(artifact)) {
+ NativeArtifact nativeArtifact = (NativeArtifact) artifact;
+ InputStream is = nativeArtifact.getNativeContent();
+ String vueXml = AFile.readFile(is);
+ objToAtsWorkFlowXml.put(artifact, vueXml);
+ }
+ return (AtsWorkFlow) (new VueWorkFlow(artifact.getDescriptiveName() + " - " + artifact.getHumanReadableId(),
+ objToAtsWorkFlowXml.get(artifact))).getWorkflow();
+ }
+
+ public AtsWorkFlow getWorkFlowFromFilename(String workFlowFilename) {
+ if (!objToAtsWorkFlowXml.containsKey(workFlowFilename)) {
+ String vueXml = AFile.readFile(new File(workFlowFilename));
+ objToAtsWorkFlowXml.put(workFlowFilename, vueXml);
+ }
+ return (AtsWorkFlow) (new VueWorkFlow(workFlowFilename, objToAtsWorkFlowXml.get(workFlowFilename))).getWorkflow();
+ }
+
+ public AtsWorkFlow getWorkFlowFromFileContents(String name, String vueXml) {
+ if (!objToAtsWorkFlowXml.containsKey(name)) {
+ objToAtsWorkFlowXml.put(name, vueXml);
+ }
+ return (AtsWorkFlow) (new VueWorkFlow(name, objToAtsWorkFlowXml.get(name))).getWorkflow();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java
new file mode 100644
index 00000000000..c4fcf5f41a5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsRenderer.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.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 {
+
+ /* (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, String option, IProgressMonitor monitor) throws Exception {
+ OseeAts.getAtsLib().openATSAction(artifact, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+
+ /* (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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java
new file mode 100644
index 00000000000..e289d01c24b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItem.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.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.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.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 ArrayList<WorkPageService> EMPTY_SERVICES = new ArrayList<WorkPageService>();
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#committing(org.eclipse.osee.ats.editor.SMAManager)
+ */
+ public Result committing(SMAManager smaMgr) {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getBranchShortName(org.eclipse.osee.ats.editor.SMAManager)
+ */
+ public String getBranchShortName(SMAManager smaMgr) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToAssignees(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToStateName(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getServices(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> getServices(SMAManager smaMgr) {
+ 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) {
+ 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) {
+ }
+
+ /* (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 Exception {
+ 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) {
+ }
+
+ /* (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) {
+ }
+
+ /* (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) {
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#isAccessControlViaAssigneesEnabledForBranching()
+ */
+ public boolean isAccessControlViaAssigneesEnabledForBranching() {
+ return false;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.java
new file mode 100644
index 00000000000..87a55097970
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/AtsStateItems.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;
+
+import java.util.ArrayList;
+import java.util.List;
+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.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) {
+ loadAllStateItems();
+ List<IAtsStateItem> items = new ArrayList<IAtsStateItem>();
+ for (IAtsStateItem item : stateItems)
+ if (item.getId().equals(AtsStateItem.ALL_STATE_IDS) || item.getId().equals(stateId)) items.add(item);
+ return items;
+ }
+
+ public List<IAtsStateItem> getCurrentPageStateItems(SMAManager smaMgr) {
+ return getStateItems(smaMgr.getWorkPage().getId());
+ }
+
+ @SuppressWarnings( {"deprecation", "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();
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.java
new file mode 100644
index 00000000000..fefb16b9427
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/IAtsStateItem.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.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.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.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);
+
+ public Result xWidgetCreating(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable);
+
+ public void xWidgetCreated(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable);
+
+ public void widgetModified(SMAWorkFlowSection section, XWidget xWidget);
+
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section);
+
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section);
+
+ public String getDescription();
+
+ public String getBranchShortName(SMAManager smaMgr);
+
+ public boolean isAccessControlViaAssigneesEnabledForBranching();
+
+ /**
+ * @return Id that matches PageId:<id> in creation of WorkPage or in state notes of VUE diagram.
+ */
+ public String getId();
+
+ public List<WorkPageService> getServices(SMAManager smaMgr);
+
+ /**
+ * @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 Exception;
+
+ public void transitioned(SMAManager smaMgr, String fromState, String toState, Collection<User> toAssignees);
+
+ /**
+ * @param smaMgr TODO
+ * @return Result of operation. If Result.isFalse(), commit will not continue and Result.popup will occur.
+ */
+ public Result committing(SMAManager smaMgr);
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
new file mode 100644
index 00000000000..1554c82e559
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditor.java
@@ -0,0 +1,467 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.action.Action;
+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.ats.navigate.VisitedItems;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.ats.util.widgets.task.IXTaskViewer;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+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.AtsLocalStateTransitionedEvent;
+import org.eclipse.osee.framework.skynet.core.artifact.CacheArtifactModifiedEvent;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactModifiedEvent.ModType;
+import org.eclipse.osee.framework.skynet.core.event.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalCommitBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalNewBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteCommitBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteNewBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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.SkynetContributionItem;
+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.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xresults.XResultPage.Manipulations;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAEditor extends AbstractArtifactEditor implements IDirtiableEditor, IEventReceiver, IXTaskViewer {
+ public static final String EDITOR_ID = "org.eclipse.osee.ats.editor.SMAEditor";
+ private static final Logger logger = ConfigUtil.getConfigFactory().getLogger(SMAEditor.class);
+ private SMAManager smaMgr;
+ private int workFlowPageIndex, taskPageIndex;
+ private SMAWorkFlowTab workFlowTab;
+ private SMATaskComposite taskComposite;
+ public static enum PriviledgedEditMode {
+ Off, CurrentState, Global
+ };
+ private PriviledgedEditMode priviledgedEditMode = PriviledgedEditMode.Off;
+ private Action printAction;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ 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 {
+ smaMgr.getSma().saveSMA();
+ workFlowTab.refresh();
+ onDirtied();
+ }
+ }
+
+ void enableGlobalPrint() {
+ printAction = new Action("Print") {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.beginMultiColumnTable(100));
+ sb.append(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())
+
+ }));
+ sb.append(AHTML.endMultiColumnTable());
+ sb.append(workFlowTab.getHtml());
+ sb.append(taskComposite.getHtml());
+ sb.append(AHTML.newline());
+ sb.append(smaMgr.getSma().getLog().getHtml());
+ XResultData resultData = new XResultData(AtsPlugin.getLogger());
+ resultData.addRaw(sb.toString());
+ resultData.report(smaMgr.getSma().getDescriptiveName(), Manipulations.RAW_HTML);
+ }
+ };
+ getEditorSite().getActionBars().setGlobalActionHandler(ActionFactory.PRINT.getId(), printAction);
+ }
+
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ @Override
+ public void dispose() {
+ if (smaMgr != null && !smaMgr.getSma().isDeleted() && smaMgr.getSma().isSMADirty()) smaMgr.getSma().revertSMA();
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ workFlowTab.dispose();
+ if (taskComposite != null) taskComposite.dispose();
+ super.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
+ */
+ @Override
+ public boolean isDirty() {
+ if (smaMgr.getSma().isDeleted()) return false;
+ return (((StateMachineArtifact) getEditorInput().getArtifact()).isSMADirty());
+ }
+
+ public String toString() {
+ return "SMAEditor " + smaMgr.getSma().getHumanReadableId() + " - " + smaMgr.getSma().getArtifactTypeName() + " - " + smaMgr.getSma().getDescriptiveName();
+ }
+
+ @Override
+ protected void createPages() {
+ super.createPages();
+ SkynetContributionItem.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);
+
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(CacheArtifactModifiedEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalNewBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteNewBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalCommitBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteCommitBranchEvent.class, this);
+
+ setPartName(smaMgr.getSma().getEditorTitle());
+ setContentDescription(priviledgedEditMode != PriviledgedEditMode.Off ? " PRIVILEGED EDIT MODE ENABLED - " + priviledgedEditMode.name() : "");
+ setTitleImage(smaMgr.getSma().getImage());
+
+ // Create WorkFlow tab
+ workFlowTab = new SMAWorkFlowTab(smaMgr);
+ workFlowPageIndex = addPage(workFlowTab);
+
+ // Create Tasks tab
+ if (smaMgr.showTaskTab()) {
+ taskComposite = new SMATaskComposite(getContainer(), SWT.NONE);
+ taskComposite.create(this);
+ taskPageIndex = addPage(taskComposite);
+ setPageText(taskPageIndex, "Tasks");
+ }
+
+ setActivePage(workFlowPageIndex);
+ } catch (PartInitException ex) {
+ logger.log(Level.SEVERE, ex.getLocalizedMessage(), ex);
+ }
+
+ enableGlobalPrint();
+ }
+
+ public void redrawPages() {
+ if (workFlowTab != null) workFlowTab.dispose();
+ if (taskComposite != null) taskComposite.dispose();
+ int page = getActivePage();
+ for (int x = getPageCount() - 1; x >= 0; x--)
+ removePage(x);
+ addPages();
+ if (page < getPageCount() && page != -1) setActivePage(page);
+ }
+
+ 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(StateMachineArtifact sma) {
+ if (sma.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ }
+ 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)) {
+ System.out.println("Closing editor \"" + (artifact.isDeleted() ? "" : artifact.getDescriptiveName()) + "\"");
+ page.closeEditor(editor.getEditor(false), save);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return Returns the smaMgr.
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ public void onEvent(final Event event) {
+ try {
+ if (smaMgr.isInTransition()) return;
+ if (getContainer() == null || getContainer().isDisposed()) return;
+
+ // Because ArtifactVersionIncrementedEvent is only remote, need
+ // to handle local state transition events separately
+ if (event instanceof AtsLocalStateTransitionedEvent) {
+ redrawPages();
+ }
+ if ((event instanceof LocalCommitBranchEvent) || (event instanceof RemoteCommitBranchEvent) ||
+ //
+ (event instanceof LocalNewBranchEvent) || (event instanceof RemoteNewBranchEvent)) {
+ int branchId = ((BranchEvent) event).getBranchId();
+ if (smaMgr.getBranchMgr().getBranchId() != null && smaMgr.getBranchMgr().getBranchId() == branchId) {
+ redrawPages();
+ }
+ } else if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(smaMgr.getSma());
+ if (ed.isRemoved()) {
+ smaMgr.closeEditors(false);
+ return;
+ } else if (ed.getAvie() != null) {
+ System.err.println(String.format("VERSION INC switching %d to %d for artifact %s",
+ smaMgr.getSma().getArtId(), ed.getAvie().getNewVersion().getArtId(),
+ smaMgr.getSma().getDescriptiveName()));
+ getEditorInput().setArtifact(ed.getAvie().getNewVersion());
+ redrawPages();
+ } else if (ed.isHasEvent()) {
+ setTitleImage(smaMgr.getSma().getImage());
+ redrawPages();
+ }
+ } else if (event instanceof CacheArtifactModifiedEvent) {
+ if (((CacheArtifactModifiedEvent) event).getType() == ModType.Reverted && ((CacheArtifactModifiedEvent) event).getArtifact().equals(
+ smaMgr.getSma())) {
+ redrawPages();
+ }
+ } else
+ logger.log(Level.SEVERE, "Unexpected event => " + event);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ onDirtied();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getCurrentStateName()
+ */
+ public String getCurrentStateName() {
+ return smaMgr.getCurrentStateName();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getEditor()
+ */
+ public IDirtiableEditor getEditor() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getParentSmaMgr()
+ */
+ public SMAManager getParentSmaMgr() {
+ return smaMgr;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getResOptions()
+ */
+ public List<TaskResOptionDefinition> getResOptions() {
+ if (smaMgr.getWorkPage().isUsingTaskResolutionOptions()) return smaMgr.getWorkPage().getTaskResDef().getOptions();
+ return new ArrayList<TaskResOptionDefinition>();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTabName()
+ */
+ public String getTabName() {
+ return "Tasks";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTaskArtifacts(java.lang.String)
+ */
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws SQLException {
+ 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() {
+ return smaMgr.isTaskable();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isUsingTaskResolutionOptions()
+ */
+ public boolean isUsingTaskResolutionOptions() {
+ return smaMgr.getWorkPage().isUsingTaskResolutionOptions();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isEditable()
+ */
+ public boolean isTasksEditable() {
+ return smaMgr.getSma().isTaskable();
+ }
+
+ /**
+ * @return the priviledgedEditMode
+ */
+ public PriviledgedEditMode getPriviledgedEditMode() {
+ return priviledgedEditMode;
+ }
+
+ /**
+ * @param priviledgedEditMode the priviledgedEditMode to set
+ */
+ public void setPriviledgedEditMode(PriviledgedEditMode priviledgedEditMode) {
+ this.priviledgedEditMode = priviledgedEditMode;
+ smaMgr.getSma().saveSMA();
+ redrawPages();
+ }
+
+ /**
+ * @return the isAccessControlWrite
+ */
+ public boolean isAccessControlWrite() {
+ return AccessControlManager.getInstance().checkCurrentUserObjectPermission(smaMgr.getSma(), PermissionEnum.WRITE);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java
new file mode 100644
index 00000000000..bb18964e354
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAEditorInput.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAEditorInput extends ArtifactEditorInput {
+
+ /**
+ * @param artifact
+ */
+ public SMAEditorInput(Artifact artifact) {
+ super(artifact);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof SMAEditorInput) {
+ SMAEditorInput otherEdInput = (SMAEditorInput) obj;
+
+ return artifact == otherEdInput.artifact;
+ }
+ return false;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java
new file mode 100644
index 00000000000..9835887f36a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAManager.java
@@ -0,0 +1,967 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.AtsPlugin;
+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.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.VersionArtifact.VersionReleaseType;
+import org.eclipse.osee.ats.util.BranchManager;
+import org.eclipse.osee.ats.util.DeadlineManager;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.NotifyUsersJob;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.util.widgets.TaskManager;
+import org.eclipse.osee.ats.util.widgets.XCurrentStateDam;
+import org.eclipse.osee.ats.util.widgets.XStateDam;
+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.AtsWorkFlow;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.skynet.core.util.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.util.OSEELog;
+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.WorkPage;
+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 StateMachineArtifact sma;
+ private Set<User> transitionAssignees = new HashSet<User>();
+ private static String SEPERATOR = "; ";
+ private TaskManager taskMgr;
+ private ReviewManager reviewMgr;
+ private BranchManager branchMgr;
+ private DeadlineManager deadlineMgr;
+ private SMAEditor editor;
+ private AtsStateItems stateItems;
+ private boolean inTransition = false;
+
+ public SMAManager(StateMachineArtifact sma, SMAEditor editor) {
+ super();
+ this.sma = sma;
+ this.editor = editor;
+ reviewMgr = new ReviewManager(this);
+ taskMgr = new TaskManager(this);
+ branchMgr = new BranchManager(this);
+ deadlineMgr = new DeadlineManager(this);
+ stateItems = new AtsStateItems();
+ }
+
+ public SMAManager(StateMachineArtifact sma) {
+ this(sma, null);
+ }
+
+ public void closeEditors(boolean save) {
+ SMAEditor.close(sma, save);
+ }
+
+ public boolean isFirstState(AtsWorkPage page) {
+ if (page.isStartPage()) return true;
+ if ((sma instanceof TeamWorkFlowArtifact) && page.isEndorsePage()) return true;
+ if ((sma instanceof TaskArtifact) && page.getName().equals(TaskArtifact.INWORK_STATE)) return true;
+ return false;
+ }
+
+ public Set<User> getPrivilegedUsers() throws SQLException {
+ return sma.getPrivilegedUsers();
+ }
+
+ public String getEditorHeaderString() {
+ if (sma instanceof TeamWorkFlowArtifact)
+ return String.format("Current State: %s Team: %s Assignee(s): %s", getCurrentStateName(),
+ ((TeamWorkFlowArtifact) sma).getTeamName(), getAssigneesStr());
+ else
+ return String.format("Current State: %s Assignee(s): %s", getCurrentStateName(), getAssigneesStr());
+ }
+
+ public Result getUserInputNeeded() {
+ return Result.FalseResult;
+ }
+
+ public void setState(SMAState state) throws IllegalStateException, SQLException {
+ if (getCurrentStateName().equals(state.getName()))
+ getCurrentStateDam().setState(state);
+ else
+ getStateDam().setState(state);
+ }
+
+ public AtsWorkPage getWorkPage() {
+ try {
+ return (AtsWorkPage) sma.getWorkFlow().getPage(sma.getCurrentStateName());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public boolean isHistoricalVersion() {
+ return !sma.getPersistenceMemo().getTransactionId().isHead();
+ }
+
+ public boolean isAccessControlWrite() {
+ return AccessControlManager.getInstance().checkCurrentUserObjectPermission(sma, PermissionEnum.WRITE);
+ }
+
+ public AtsWorkPage getWorkPage(String name) {
+ try {
+ return (AtsWorkPage) sma.getWorkFlow().getPage(name);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public User getOriginator() {
+ LogItem item = sma.getLog().getLastEvent(LogType.Originated);
+ if (item == null) return null;
+ return item.getUser();
+ }
+
+ public void setOriginator(User user) {
+ sma.getLog().addLog(LogType.Originated, "",
+ "Changed by " + SkynetAuthentication.getInstance().getAuthenticatedUser().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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return false;
+ }
+ }
+
+ /**
+ * @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 (SQLException ex) {
+ // Do Nothing
+ }
+ return false;
+ }
+
+ public VersionArtifact getTargetedForVersion() throws SQLException {
+ return sma.getTargetedForVersion();
+ }
+
+ public SMAState getSMAState() {
+ return sma.getCurrentStateDam().getState();
+ }
+
+ /**
+ * Return current or past state from name
+ *
+ * @param name
+ * @param create TODO
+ * @return state matching name
+ * @throws SQLException
+ */
+ public SMAState getSMAState(String name, boolean create) {
+ if (sma.getCurrentStateDam().getState().getName().equals(name))
+ return sma.getCurrentStateDam().getState();
+ else
+ return (sma.getStateDam().getState(name, create));
+ }
+
+ public boolean promptChangeAssignees() {
+ return promptChangeAssignees(Arrays.asList(new StateMachineArtifact[] {sma}));
+ }
+
+ public static boolean promptChangeAssignees(final Collection<? extends StateMachineArtifact> smas) {
+ try {
+ 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.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;
+ }
+ for (StateMachineArtifact sma : smas) {
+ SMAManager smaMgr = new SMAManager(sma);
+ smaMgr.setAssignees(users);
+ }
+ } catch (IllegalStateException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return true;
+ }
+
+ public boolean promptChangeOriginator() {
+ return promptChangeOriginator(Arrays.asList(new StateMachineArtifact[] {sma}));
+ }
+
+ public static boolean promptChangeOriginator(final Collection<? extends StateMachineArtifact> smas) {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New Originator");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = (User) ld.getSelection();
+ for (StateMachineArtifact sma : smas) {
+ SMAManager smaMgr = new SMAManager(sma);
+ smaMgr.setOriginator(selectedUser);
+ }
+ return true;
+ }
+ return false;
+ }
+
+ public boolean promptChangeVersion(boolean persist) throws SQLException {
+ return promptChangeVersion(Arrays.asList(new TeamWorkFlowArtifact[] {(TeamWorkFlowArtifact) sma}), persist);
+ }
+
+ public static boolean promptChangeVersion(final Collection<? extends TeamWorkFlowArtifact> smas, final boolean persist) throws SQLException {
+ 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()) {
+ AWorkbench.popup("ERROR", "Team Workflow\n \"" + teamArt.getDescriptiveName() + "\"\n is already released.");
+ return false;
+ }
+ 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(AtsPlugin.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased));
+ if (smas.size() == 1 && smas.iterator().next().getTargetedForVersion() != null) {
+ Object[] objs = new Object[1];
+ objs[0] = smas.iterator().next().getTargetedForVersion();
+ vld.setInitialSelections(objs);
+ }
+ int result = vld.open();
+ if (result != 0) {
+ return false;
+ }
+ try {
+ if (persist) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ promptChangeVersionHelper(smas, vld, persist);
+ }
+ };
+ txWrapper.execute();
+ } else {
+ promptChangeVersionHelper(smas, vld, persist);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Prompt Change Version Version Exception", ex, false);
+ }
+ return true;
+ }
+
+ private static void promptChangeVersionHelper(Collection<? extends TeamWorkFlowArtifact> smas, VersionListDialog vld, boolean persist) throws SQLException {
+ Object obj = vld.getResult()[0];
+ VersionArtifact newVersion = (VersionArtifact) obj;
+
+ for (TeamWorkFlowArtifact teamArt : smas) {
+ teamArt.setTargetedForVersion(newVersion, persist);
+ }
+ }
+
+ public boolean promptChangeType(boolean persist) {
+ if (sma instanceof TeamWorkFlowArtifact) return promptChangeType(
+ Arrays.asList(new TeamWorkFlowArtifact[] {(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 ald = new ChangeTypeDialog(Display.getCurrent().getActiveShell());
+ if (teams.size() == 1) {
+ ald.setSelected(teams.iterator().next().getChangeType());
+ }
+ if (ald.open() == 0) {
+
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+
+ for (TeamWorkFlowArtifact team : teams) {
+ if (team.getChangeType() != ald.getSelection()) {
+ team.setChangeType(ald.getSelection());
+ team.saveSMA();
+ }
+ }
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't change priority", ex, true);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean promptChangePriority(boolean persist) {
+ if (sma instanceof TeamWorkFlowArtifact) return promptChangePriority(
+ Arrays.asList(new TeamWorkFlowArtifact[] {(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());
+ if (teams.size() == 1) {
+ ald.setSelected(teams.iterator().next().getPriority());
+ }
+ if (ald.open() == 0) {
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ for (TeamWorkFlowArtifact team : teams) {
+ if (team.getPriority() != ald.getSelection()) {
+ team.setPriority(ald.getSelection());
+ team.saveSMA();
+ }
+ }
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't change priority", ex, true);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ public boolean promptChangeStatus(boolean persist) {
+ return promptChangeStatus(null, persist);
+ }
+
+ public boolean promptChangeStatus(List<TaskResOptionDefinition> options, boolean persist) {
+ return promptChangeStatus(options, Arrays.asList(new StateMachineArtifact[] {sma}), persist);
+ }
+
+ public static boolean promptChangeStatus(List<TaskResOptionDefinition> options, final Collection<? extends StateMachineArtifact> smas, boolean persist) {
+ try {
+ 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.getCurrentStateDam().setHoursSpent(hours + sma.getCurrentStateDam().getState().getHoursSpent());
+ sma.getCurrentStateDam().setPercentComplete(tsd.getPercent().getInt());
+ sma.setAttribute(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.getCurrentStateDam().setHoursSpent(hours + sma.getCurrentStateDam().getState().getHoursSpent());
+ sma.getCurrentStateDam().setPercentComplete(tsd.getPercent().getInt());
+ sma.statusChanged();
+ }
+ return true;
+ }
+ }
+ } catch (IllegalStateException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ return false;
+ }
+
+ public boolean promptChangeFloatAttribute(ATSAttributes atsAttr, boolean persist) throws SQLException {
+ return ArtifactPromptChange.promptChangeFloatAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ }
+
+ public boolean promptChangeIntegerAttribute(ATSAttributes atsAttr, boolean persist) throws SQLException {
+ return ArtifactPromptChange.promptChangeIntegerAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ }
+
+ public boolean promptChangePercentAttribute(ATSAttributes atsAttr, boolean persist) throws SQLException {
+ return ArtifactPromptChange.promptChangePercentAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ }
+
+ public boolean promptChangeBoolean(ATSAttributes atsAttr, String toggleMessage, boolean persist) throws SQLException {
+ return ArtifactPromptChange.promptChangeBoolean(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), toggleMessage, persist);
+ }
+
+ public static boolean promptChangeAttribute(ATSAttributes atsAttr, final Collection<? extends StateMachineArtifact> smas, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ null, smas, persist);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public static boolean promptChangeAttribute(ATSAttributes atsAttr, final Artifact sma, boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ public boolean promptChangeAttribute(ATSAttributes atsAttr, final boolean persist) {
+ try {
+ return ArtifactPromptChange.promptChangeStringAttribute(atsAttr.getStoreName(), atsAttr.getDisplayName(),
+ Arrays.asList(new Artifact[] {sma}), persist);
+ } catch (SQLException 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 (SQLException 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.setAttribute(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(),
+ diag.getSelectedDate().getTime() + "");
+ verArt.persist();
+ 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().getTime() + "");
+ sma.persist();
+ 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.setAttribute(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getStoreName(),
+ diag.getSelectedDate().getTime() + "");
+ verArt.persist();
+ 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().getTime() + "");
+ sma.persist();
+ return true;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't save est release date " + sma.getHumanReadableId(), ex, true);
+ }
+ return false;
+ }
+
+ public AtsWorkFlow getWorkFlow() {
+ return sma.getWorkFlow();
+ }
+
+ public boolean isStateVisited(String name) {
+ return sma.getStateDam().getState(name, false) != null;
+ }
+
+ public XCurrentStateDam getCurrentStateDam() {
+ return sma.getCurrentStateDam();
+ }
+
+ public XStateDam getStateDam() {
+ return sma.getStateDam();
+ }
+
+ public boolean isCompleted() {
+ return (getCurrentStateName().equals(DefaultTeamState.Completed.name()));
+ }
+
+ public boolean isCancelled() {
+ return (getCurrentStateName().equals(DefaultTeamState.Cancelled.name()));
+ }
+
+ public boolean isCurrentSectionExpanded(AtsWorkPage page) {
+ return sma.isCurrentSectionExpanded(page);
+ }
+
+ public boolean isCurrentState(WorkPage page) {
+ return sma.getCurrentStateDam().getState(page.getName(), false) != null;
+ }
+
+ public void setTransitionAssignees(Collection<User> assignees) {
+ transitionAssignees.clear();
+ transitionAssignees.addAll(assignees);
+ }
+
+ public boolean isAssigneeMe() {
+ return getAssignees().contains(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+
+ /**
+ * Sets the assignees AND writes to SMA. Does not persist.
+ *
+ * @param assignees
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void setAssignees(Collection<User> assignees) throws IllegalStateException, SQLException {
+ SMAState currState = getSMAState();
+ currState.setAssignees(assignees);
+ sma.getCurrentStateDam().setState(currState);
+ }
+
+ /**
+ * Sets the assignee AND writes to SMA. Does not persist.
+ *
+ * @param assignee
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void setAssignee(User assignee) throws IllegalStateException, SQLException {
+ SMAState currState = getSMAState();
+ currState.setAssignee(assignee);
+ sma.getCurrentStateDam().setState(currState);
+ }
+
+ public void clearAssignees() throws IllegalStateException, SQLException {
+ SMAState currState = getSMAState();
+ currState.clearAssignees();
+ sma.getCurrentStateDam().setState(currState);
+ }
+
+ public Set<User> getTransitionAssignees() {
+ if (transitionAssignees.size() == 0) transitionAssignees.addAll(getAssignees());
+ return transitionAssignees;
+ }
+
+ public String getCurrentStateName() {
+ try {
+ return sma.getCurrentStateDam().getState().getName();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public String getTransitionAssigneesStr() {
+ StringBuffer sb = new StringBuffer();
+ for (User u : getTransitionAssignees()) {
+ sb.append(u.getName() + SEPERATOR);
+ }
+ return sb.toString().replaceFirst(SEPERATOR + "$", "");
+ }
+
+ /**
+ * @return Returns the assignees.
+ * @throws SQLException
+ */
+ public Collection<User> getAssignees() {
+ return getSMAState().getAssignees();
+ }
+
+ public String getAssigneesStr() {
+ StringBuffer sb = new StringBuffer();
+ for (User u : getAssignees()) {
+ sb.append(u.getName() + SEPERATOR);
+ }
+ return sb.toString().replaceFirst(SEPERATOR + "$", "");
+ }
+
+ public String getAssigneesWasIsStr() {
+ if (isCompleted() || isCancelled()) return "(" + Artifacts.commaArts(getStateDam().getState(
+ TaskArtifact.INWORK_STATE, false).getAssignees()) + ")";
+ return getAssigneesStr();
+ }
+
+ public Image getAssigneeImage() {
+ return getSma().getAssigneeImage();
+ }
+
+ /**
+ * @return Returns the sma.
+ */
+ public StateMachineArtifact getSma() {
+ return sma;
+ }
+
+ /**
+ * @return true if SMA is allowed to have tasks
+ */
+ public boolean isTaskable() {
+ return sma.isTaskable();
+ }
+
+ public boolean showTaskTab() {
+ return sma.showTaskTab();
+ }
+
+ /**
+ * @return Returns the taskMgr.
+ */
+ public TaskManager getTaskMgr() {
+ return taskMgr;
+ }
+
+ public Result transition(String toStateName, User toAssignee, boolean persist) {
+ 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);
+ }
+
+ public Result transitionToCancelled(String reason, boolean persist) throws SQLException {
+ Result result =
+ transition(DefaultTeamState.Cancelled.name(), Arrays.asList(new User[] {}), persist, reason, false);
+ if (result.isTrue()) {
+ for (VersionArtifact verArt : sma.getArtifacts(RelationSide.TeamWorkflowTargetedForVersion_Version,
+ VersionArtifact.class)) {
+ sma.unrelate(RelationSide.TeamWorkflowTargetedForVersion_Version, verArt, true);
+ }
+ }
+ return result;
+ }
+
+ public Result transition(String toStateName, Collection<User> toAssignees, boolean persist, boolean overrideTransitionCheck) {
+ return transition(toStateName, toAssignees, persist, null, overrideTransitionCheck);
+ }
+
+ public Result transition(String toStateName, User toAssignee, boolean persist, boolean overrideTransitionCheck) {
+ return transition(toStateName, Arrays.asList(new User[] {toAssignee}), persist, null, overrideTransitionCheck);
+ }
+
+ private Result transition(final String toStateName, final Collection<User> toAssignees, final boolean persist, final String cancelReason, boolean overrideTransitionCheck) {
+ try {
+ // Validate toState name
+ final AtsWorkPage fromPage = getWorkPage();
+ final AtsWorkPage toPage = getWorkPage(toStateName);
+ if (toPage == null) return new Result("Invalid toState \"" + toStateName + "\"");
+
+ // Validate transition from fromPage to toPage
+ if (!overrideTransitionCheck && !fromPage.getToPages().contains(toPage)) {
+ String errStr =
+ "According to transition configuration, can't transition to \"" + toStateName + "\" from \"" + fromPage.getName() + "\"";
+ OSEELog.logSevere(AtsPlugin.class, errStr, false);
+ return new Result(errStr);
+ }
+
+ // Check extension points for valid transition
+ for (IAtsStateItem item : stateItems.getStateItems(fromPage.getId())) {
+ Result result = item.transitioning(this, fromPage.getName(), toStateName, toAssignees);
+ if (result.isFalse()) return result;
+ }
+ for (IAtsStateItem item : stateItems.getStateItems(toPage.getId())) {
+ Result result = item.transitioning(this, fromPage.getName(), toStateName, toAssignees);
+ if (result.isFalse()) return result;
+ }
+
+ if (persist) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ transitionHelper(toAssignees, persist, fromPage, toPage, toStateName, cancelReason);
+ }
+
+ };
+ txWrapper.execute();
+ } else {
+ transitionHelper(toAssignees, persist, fromPage, toPage, toStateName, cancelReason);
+ }
+ } 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, AtsWorkPage fromPage, AtsWorkPage toPage, String toStateName, String cancelReason) throws SQLException {
+ // Log transition
+ if (toPage.isCancelledPage()) {
+ getSma().getLog().addLog(LogType.StateCancelled, getCurrentStateName(), cancelReason);
+ } else {
+ getSma().getLog().addLog(LogType.StateComplete, getCurrentStateName(), "");
+ }
+ getSma().getLog().addLog(LogType.StateEntered, toStateName, "");
+
+ // Set XCurrentState info to XState
+ getSma().getStateDam().setState(getSma().getCurrentStateDam().getState());
+
+ // Set XCurrentState; If been to this state, copy state info from
+ // prev state; else create
+ // new
+ SMAState previousState = getSma().getStateDam().getState(toStateName, false);
+ if (previousState != null) {
+ if (toAssignees.size() > 0) previousState.setAssignees(toAssignees);
+ getSma().getCurrentStateDam().setState(previousState);
+ } else {
+ getSma().getCurrentStateDam().setState(new SMAState(toStateName, toAssignees));
+ }
+
+ if (getSma().isValidationRequired()) {
+ getReviewManager().createValidateReview(false);
+ }
+
+ // Notify Users; NOTE: Assignees are notified as part of
+ // StateMachineArtifact.persist
+ NotifyUsersJob job =
+ new NotifyUsersJob(sma, NotifyUsersJob.NotifyType.Subscribers, NotifyUsersJob.NotifyType.Completed);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+
+ // Persist
+ if (persist) {
+ getSma().persist();
+ }
+
+ getSma().transitioned(fromPage, toPage, toAssignees, true);
+
+ // Notify extension points of transition
+ for (IAtsStateItem item : stateItems.getStateItems(fromPage.getId())) {
+ item.transitioned(this, fromPage.getName(), toStateName, toAssignees);
+ }
+ for (IAtsStateItem item : stateItems.getStateItems(toPage.getId())) {
+ item.transitioned(this, fromPage.getName(), toStateName, toAssignees);
+ }
+ }
+
+ /**
+ * @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 BranchManager 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;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsComposite.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsComposite.java
new file mode 100644
index 00000000000..4dfadf35953
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsComposite.java
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.widgets.dialog.AICheckTreeDialog;
+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.IRelationLink;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+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.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 SMARelationsComposite extends Composite {
+
+ private final XFormToolkit toolkit;
+ private static RelationSide sides[] =
+ new RelationSide[] {RelationSide.TeamWorkflowToReview_Review, RelationSide.TeamWorkflowToReview_Team,
+ RelationSide.Supercedes_Superceded, RelationSide.Supercedes_Supercedes,
+ RelationSide.SupportingInfo_SupportedBy, RelationSide.SupportingInfo_SupportingInfo};
+ private SMAManager smaMgr;
+ private Label actionableItemsLabel;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public SMARelationsComposite(Composite parent, XFormToolkit toolkit, int style) {
+ super(parent, style);
+ this.toolkit = toolkit;
+ }
+
+ public void create(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ try {
+ setLayout(ALayout.getZeroMarginLayout(2, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ 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());
+ }
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+ }
+
+ public static boolean relationExists(StateMachineArtifact smaArt) throws SQLException {
+ for (RelationSide side : sides) {
+ if (smaArt.getArtifacts(side).size() > 0) return true;
+ if (smaArt.getParentActionArtifact() != null && smaArt.getParentActionArtifact().getArtifacts(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 SQLException {
+ for (RelationSide side : sides) {
+ for (final Artifact art : thisArt.getArtifacts(side)) {
+ IRelationLink rel = thisArt.getRelations(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 SQLException {
+ 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() {
+ if (smaMgr.getSma() instanceof ReviewSMArtifact) actionableItemsLabel.setText("This \"" + ((ReviewSMArtifact) smaMgr.getSma()).getArtifactTypeName() + "\" is review of Actionable Items \"" + ((ReviewSMArtifact) smaMgr.getSma()).getActionableItemsDam().getActionableItemsStr() + "\" ");
+ }
+
+ public void refresh() {
+ 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().toArray());
+ if (diag.open() != 0) return;
+ reviewArt.getActionableItemsDam().setActionableItems(diag.getSelection());
+ smaMgr.getEditor().onDirtied();
+ refreshActionableItemsLabel();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.java
new file mode 100644
index 00000000000..a5bdfbb4a23
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMATaskComposite.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.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.widgets.task.IXTaskViewer;
+import org.eclipse.osee.ats.util.widgets.task.XTaskViewer;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMATaskComposite extends Composite {
+
+ private static String HELP_CONTEXT_ID = "atsWorkflowEditorTaskTab";
+ private XTaskViewer xTaskViewer;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public SMATaskComposite(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.widgets.Widget#dispose()
+ */
+ @Override
+ public void dispose() {
+ xTaskViewer.dispose();
+ super.dispose();
+ }
+
+ public String getHtml() {
+ return xTaskViewer.toHTML(AHTML.LABEL_FONT);
+ }
+
+ public void create(IXTaskViewer iXTaskViewer) {
+ setLayout(new GridLayout(1, true));
+ setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ xTaskViewer = new XTaskViewer(iXTaskViewer);
+ xTaskViewer.createWidgets(this, 1);
+ // xTask.addXModifiedListener(xModListener);
+
+ AtsPlugin.getInstance().setHelp(this, HELP_CONTEXT_ID);
+
+ xTaskViewer.loadTable();
+ }
+
+ /**
+ * @return the xTask
+ */
+ public XTaskViewer getXTask() {
+ return xTaskViewer;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCancelledSection.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCancelledSection.java
new file mode 100644
index 00000000000..08bac66f923
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCancelledSection.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.editor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowCancelledSection extends SMAWorkFlowSection {
+
+ /**
+ * @param parent
+ * @param toolkit
+ * @param style
+ * @param page
+ * @param smaMgr
+ */
+ public SMAWorkFlowCancelledSection(Composite parent, XFormToolkit toolkit, int style, AtsWorkPage page, SMAManager smaMgr) {
+ super(parent, toolkit, style, page, smaMgr);
+ }
+
+ @Override
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) {
+ Composite workComp = super.createWorkArea(comp, page, toolkit);
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateCancelled);
+ toolkit.createLabel(workComp, "Cancellation Reason: " + item.getMsg());
+ toolkit.createLabel(workComp, "Cancelled From State: " + item.getState());
+
+ if (smaMgr.getSma().isUnCancellable()) {
+ final LogItem fItem = item;
+ Button button = toolkit.createButton(workComp, "Return to \"" + item.getState() + "\"", SWT.PUSH);
+ button.addListener(SWT.MouseUp, new Listener() {
+ public void handleEvent(Event event) {
+ handleUnCancel(fItem.getState());
+ }
+ });
+ }
+ return workComp;
+ }
+
+ private void handleUnCancel(String toStateName) {
+ if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Return to \"" + toStateName + "\"",
+ "Return to \"" + toStateName + "\"?")) {
+ SMAState toSmaState = smaMgr.getStateDam().getState(toStateName, false);
+ if (toSmaState == null) {
+ AWorkbench.popup("ERROR", "Return to state doesn't exist");
+ throw new IllegalArgumentException("Invalid return-to state \"" + toStateName + "\"");
+ }
+ Result result = smaMgr.transition(toStateName, toSmaState.getAssignees(), true, false);
+ if (result.isFalse()) result.popup();
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCompletedSection.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCompletedSection.java
new file mode 100644
index 00000000000..85da9859c17
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowCompletedSection.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.editor;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.LogItem;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAEditor.PriviledgedEditMode;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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.swt.SWT;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowCompletedSection extends SMAWorkFlowSection {
+
+ /**
+ * @param parent
+ * @param toolkit
+ * @param style
+ * @param page
+ * @param smaMgr
+ */
+ public SMAWorkFlowCompletedSection(Composite parent, XFormToolkit toolkit, int style, AtsWorkPage page, SMAManager smaMgr) {
+ super(parent, toolkit, style, page, smaMgr);
+ }
+
+ @Override
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) {
+ Composite workComp = super.createWorkArea(comp, page, toolkit);
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateComplete);
+ toolkit.createLabel(workComp, "Completed From State: " + item.getState());
+
+ if (smaMgr.getEditor().getPriviledgedEditMode() != PriviledgedEditMode.Off || AtsPlugin.isAtsAdmin()) {
+ final LogItem fItem = item;
+ 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;
+ }
+
+ private void handleUnComplete(String toStateName) {
+ if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Return to \"" + toStateName + "\"",
+ "Return to \"" + toStateName + "\"?")) {
+ SMAState toSmaState = smaMgr.getStateDam().getState(toStateName, false);
+ if (toSmaState == null) {
+ AWorkbench.popup("ERROR", "Return to state doesn't exist");
+ throw new IllegalArgumentException("Invalid return-to state \"" + toStateName + "\"");
+ }
+ Result result = smaMgr.transition(toStateName, toSmaState.getAssignees(), true, true);
+ if (result.isFalse()) result.popup();
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.java
new file mode 100644
index 00000000000..c9feb4d03a1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowDebugSection.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.editor;
+
+import org.eclipse.osee.ats.editor.stateItem.AtsDebugWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+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
+ */
+ public SMAWorkFlowDebugSection(Composite parent, XFormToolkit toolkit, int style, SMAManager smaMgr) {
+ super(parent, toolkit, style, new AtsDebugWorkPage(), smaMgr);
+ }
+
+ @Override
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) {
+ this.toolkit = toolkit;
+ workComp = super.createWorkArea(comp, page, toolkit);
+ toolkit.createLabel(workComp, "ATS Debug Section");
+
+ addDebug("WorkflowId: " + smaMgr.getWorkFlow().getId());
+ if (smaMgr.getWorkFlow().getInheritData() != null && !smaMgr.getWorkFlow().getInheritData().equals("")) addDebug("InheritData: " + smaMgr.getWorkFlow().getInheritData());
+ for (org.eclipse.osee.ats.workflow.AtsWorkPage atsPage : smaMgr.getWorkFlow().getPagesOrdered()) {
+ addDebug(" PageId: " + atsPage.getId());
+ if (atsPage.isAllowCreateBranch()) addDebug(" " + AtsWorkPage.WORKPAGE_ATS_ALLOW_CREATE_BRANCH + ": " + atsPage.isAllowCreateBranch());
+ if (atsPage.isAllowCreateBranch()) addDebug(" " + AtsWorkPage.WORKPAGE_ATS_ALLOW_COMMIT_BRANCH + ": " + atsPage.isAllowCommitBranch());
+ if (atsPage.isForceAssigneesToTeamLeads()) addDebug(" " + AtsWorkPage.WORkPAGE_ATS_FORCE_ASSIGNEES_TO_TEAM_LEADS + ": " + atsPage.isForceAssigneesToTeamLeads());
+ if (atsPage.isRequireStateHoursSpentPrompt()) addDebug(" " + AtsWorkPage.WORKPAGE_ATS_REQUIRE_STATE_HOURS_SPENT_PROMPT + ": " + atsPage.isRequireStateHoursSpentPrompt());
+ if (atsPage.isStartPage()) addDebug(" " + AtsWorkPage.WORKPAGE_STARTPAGE + ": " + atsPage.isStartPage());
+ if (atsPage.isValidatePage()) addDebug(" " + AtsWorkPage.WORKPAGE_VALIDATE_PAGE + ": " + atsPage.isValidatePage());
+ for (IAtsStateItem stateItem : smaMgr.getStateItems().getStateItems(atsPage.getId())) {
+ addDebug(" StateItem: " + stateItem.getDescription());
+ }
+ }
+
+ // 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) {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowLogSection.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowLogSection.java
new file mode 100644
index 00000000000..9cc38d63062
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowLogSection.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.editor;
+
+import org.eclipse.osee.ats.editor.stateItem.AtsLogWorkPage;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.ui.skynet.XFormToolkit;
+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.ui.forms.widgets.Section;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAWorkFlowLogSection extends SMAWorkFlowSection {
+
+ private Composite workComp;
+ private XFormToolkit toolkit;
+ private XResultsComposite xResultsComp;
+ private String title = "";
+
+ /**
+ * @param parent
+ * @param toolkit
+ * @param style
+ * @param page
+ * @param smaMgr
+ */
+ public SMAWorkFlowLogSection(Composite parent, XFormToolkit toolkit, int style, SMAManager smaMgr) {
+ super(parent, toolkit, style, new AtsLogWorkPage(smaMgr.getSma().getArtifactTypeName() + " History"), smaMgr);
+ }
+
+ @Override
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) {
+ this.toolkit = toolkit;
+ workComp = super.createWorkArea(comp, page, toolkit);
+
+ xResultsComp = new XResultsComposite(workComp, 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.getSma().getLog().getHtml(false), title);
+
+ return workComp;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.SMAWorkFlowSection#createPage(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Section createPage(Composite comp) {
+ Section section = super.createPage(comp);
+ return section;
+ }
+
+ public void addDebug(String str) {
+ toolkit.createText(workComp, str, SWT.MULTI | SWT.WRAP);
+ workComp.layout();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.SMAWorkFlowSection#refresh()
+ */
+ @Override
+ public void refresh() {
+ super.refresh();
+ xResultsComp.setHtmlText(smaMgr.getSma().getLog().getHtml(false), title);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
new file mode 100644
index 00000000000..396a3a04b92
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowSection.java
@@ -0,0 +1,629 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+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.NoteItem;
+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.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.service.ServicesArea;
+import org.eclipse.osee.ats.util.widgets.dialog.SMAStatusDialog;
+import org.eclipse.osee.ats.util.widgets.task.XTaskViewer;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.User;
+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.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.WorkPage;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageLabelProvider;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPageViewSorter;
+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 page;
+ private final boolean isEditable, isCurrentState, isGlobalEditable;
+ private ServicesArea servicesArea;
+ private final XFormToolkit toolkit;
+ private XTaskViewer xTask;
+ public static String TRANSITION_TO_STATE_COMBO = "Transition To State Combo";
+ private Composite mainComp;
+
+ public SMAWorkFlowSection(Composite parent, XFormToolkit toolkit, int style, AtsWorkPage page, SMAManager smaMgr) {
+ super(parent, toolkit, style);
+ this.toolkit = toolkit;
+ this.page = page;
+ this.smaMgr = smaMgr;
+ isEditable =
+ !smaMgr.getSma().isReadOnly() && smaMgr.isAccessControlWrite() && smaMgr.isCurrentState(page) && (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);
+ // parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_CYAN));
+ createPage(parent);
+ }
+
+ protected Section createPage(Composite comp) {
+
+ Section section = toolkit.createSection(comp, Section.TWISTIE | Section.TITLE_BAR);
+ section.setText(getCurrentStateTitle());
+ if (smaMgr.isCurrentState(page)) section.setBackground(AtsPlugin.ACTIVE_COLOR);
+ section.setExpanded(smaMgr.isCurrentSectionExpanded(page));
+ 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();
+
+ createStateNotesHeader(smaMgr, mainComp, toolkit, 2);
+
+ 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, page, 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, page, toolkit, this);
+
+ section.layout();
+ return section;
+ }
+
+ public static void createStateNotesHeader(SMAManager smaMgr, Composite comp, XFormToolkit toolkit, int horizontalSpan) {
+ // Display global Notes
+ for (NoteItem noteItem : smaMgr.getSma().getNotes().getNoteItems()) {
+ if (noteItem.getState().equals(smaMgr.getCurrentStateName())) {
+ Label label = toolkit.createLabel(comp, noteItem.toHTML());
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = horizontalSpan;
+ label.setLayoutData(gd);
+ }
+ }
+ }
+
+ private String getCurrentStateTitle() {
+ StringBuffer sb = new StringBuffer(page.getName());
+ if (isEditable && (!smaMgr.isCompleted() && !smaMgr.isCancelled())) {
+ sb.append(" - Current State");
+ }
+ if (smaMgr.isCancelled()) {
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateCancelled);
+ if (item.getState().equals(page.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.getSma().getLog().getStateEvent(LogType.StateEntered, page.getName());
+ sb.append(" by " + item.getUser().getName());
+ } else if (smaMgr.isCancelled()) {
+ sb.append(" - ");
+ sb.append(smaMgr.getSma().getWorldViewCancelledDateStr());
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateEntered, page.getName());
+ sb.append(" by " + item.getUser().getName());
+ }
+ if (smaMgr.getAssignees().size() > 0) {
+ sb.append(" assigned to ");
+ sb.append(smaMgr.getAssigneesStr());
+ }
+ } else {
+ LogItem item = smaMgr.getSma().getLog().getStateEvent(LogType.StateComplete, page.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();
+ page.dispose();
+ servicesArea.dispose();
+ }
+
+ protected Composite createWorkArea(Composite comp, AtsWorkPage page, XFormToolkit toolkit) {
+
+ 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, page, toolkit);
+
+ page.setSmaMgr(smaMgr);
+ page.createBody(toolkit, workComp, smaMgr.getSma(), xModListener, isEditable || isGlobalEditable);
+
+ // Check extenstion points for page creation
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ Result result = item.pageCreated(toolkit, page, smaMgr, xModListener, isEditable || isGlobalEditable);
+ if (result.isFalse()) {
+ result.popup();
+ OSEELog.logSevere(AtsPlugin.class, "Error in page creation => " + result.getText(), true);
+ }
+ }
+
+ if (isEditable && !smaMgr.isCancelled() && !smaMgr.isCompleted()) createCurrentPageTransitionLine(workComp, page,
+ toolkit);
+
+ return workComp;
+ }
+
+ final SMAWorkFlowSection fSection = this;
+ final XModifiedListener xModListener = new XModifiedListener() {
+ public void widgetModified(XWidget xWidget) {
+ if (smaMgr.getSma().isDeleted()) return;
+ // Notify extensions of widget modified
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ item.widgetModified(fSection, xWidget);
+ }
+ updateTransitionToState();
+ updateTransitionToAssignees();
+ smaMgr.getEditor().onDirtied();
+ }
+ };
+
+ @Override
+ public void refresh() {
+ super.refresh();
+ if (isEditable) {
+ if (currentAssigneesLabel != null && !currentAssigneesLabel.isDisposed()) {
+ currentAssigneesLabel.setText(smaMgr.getAssigneesStr());
+ currentAssigneesLabel.getParent().layout();
+ }
+ if (transitionAssigneesLabel != null && !transitionAssigneesLabel.isDisposed()) {
+ AtsWorkPage toWorkPage = (AtsWorkPage) transitionToStateCombo.getSelected();
+ if (toWorkPage.isCancelledPage() || toWorkPage.isCompletePage())
+ transitionAssigneesLabel.setText("");
+ else
+ transitionAssigneesLabel.setText(smaMgr.getTransitionAssigneesStr());
+ transitionAssigneesLabel.getParent().layout();
+ }
+ }
+ refreshStateServices();
+ }
+
+ private void createCurrentPageHeader(Composite parent, AtsWorkPage page, XFormToolkit toolkit) {
+ 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 assigned to ");
+ Hyperlink link = toolkit.createHyperlink(comp, ASSIGNEES, SWT.NONE);
+ link.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkEntered(HyperlinkEvent e) {
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+ }
+
+ public void linkActivated(HyperlinkEvent e) {
+ handleChangeCurrentAssignees();
+ }
+
+ });
+ currentAssigneesLabel = toolkit.createLabel(comp, smaMgr.getAssigneesStr());
+ currentAssigneesLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ if (smaMgr.getAssignees().size() == 0) {
+ Label errorLabel = toolkit.createLabel(comp, "Error: State has no assignees");
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ } else if (smaMgr.getAssignees().size() > 0) {
+ Label errorLabel =
+ toolkit.createLabel(comp,
+ "Error: Non-current/Cancelled/Completed state still assigned to " + smaMgr.getAssigneesStr());
+ errorLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+ }
+
+ private void handleChangeCurrentAssignees() {
+ if (smaMgr.promptChangeAssignees()) {
+ refresh();
+ smaMgr.getEditor().onDirtied();
+ }
+ }
+
+ private void handleChangeTransitionAssignees() {
+ AtsWorkPage toWorkPage = (AtsWorkPage) transitionToStateCombo.getSelected();
+ 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 page, XFormToolkit toolkit) {
+ 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 (AtsWorkPage nextPage : page.getToAtsPages()) {
+ allPages.add(nextPage);
+ }
+ transitionToStateCombo.setInput(allPages);
+ transitionToStateCombo.setLabelProvider(new WorkPageLabelProvider());
+ transitionToStateCombo.setContentProvider(new ArrayContentProvider());
+ transitionToStateCombo.setSorter(new WorkPageViewSorter());
+
+ transitionToStateCombo.createWidgets(comp, 1);
+
+ // Set default page from workflow default
+ ArrayList<Object> defaultPage = new ArrayList<Object>();
+ if (page.getDefaultToPage() != null) {
+ defaultPage.add(page.getDefaultToPage());
+ 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) {
+ updateTransitionToAssignees();
+ }
+ });
+
+ 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) {
+ handleChangeTransitionAssignees();
+ }
+
+ });
+ transitionAssigneesLabel = toolkit.createLabel(comp, smaMgr.getTransitionAssigneesStr());
+ transitionAssigneesLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ }
+
+ public void updateTransitionToAssignees() {
+ Collection<User> assignees = null;
+ // Determine if the is an override set of assigness
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.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() {
+ // Determine if there is a transitionToStateOverride for this page
+ String transitionStateOverride = null;
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ transitionStateOverride = item.getOverrideTransitionToStateName(this);
+ if (transitionStateOverride != null) break;
+ }
+ if (transitionStateOverride != null) {
+ // Return if override state is same as selected
+ if (((AtsWorkPage) transitionToStateCombo.getSelected()).getName().equals(transitionStateOverride)) return;
+ // Find page corresponding to override state name
+ for (WorkPage toPage : page.getToAtsPages()) {
+ if (toPage.getName().equals(transitionStateOverride)) {
+ // Reset selection
+ ArrayList<Object> defaultPage = new ArrayList<Object>();
+ defaultPage.add(toPage);
+ transitionToStateCombo.setSelected(defaultPage);
+ return;
+ }
+ }
+ }
+ }
+
+ public void setTransitionToStateSelection(String stateName) {
+ ArrayList<Object> allPages = new ArrayList<Object>();
+ for (AtsWorkPage nextPage : page.getToAtsPages()) {
+ if (nextPage.getName().equals(stateName)) allPages.add(nextPage);
+ }
+ transitionToStateCombo.setSelected(allPages);
+ }
+
+ private void handleTransition() {
+ // System.out.println("Transition to " + ((AtsWorkPage)
+ // transitionToStateCombo.getSelected()).getName());
+
+ try {
+ // if (smaMgr.getBranchMgr().getBranchId() != 0) {
+ // AWorkbench.popup("ERROR",
+ // "Can't transition with working branch present.\n\n" +
+ // "Delete branch first, then transition.");
+ // return;
+ // }
+ smaMgr.setInTransition(true);
+
+ smaMgr.getSma().persist(true);
+ smaMgr.getEditor().onDirtied();
+
+ // Get transition to state
+ AtsWorkPage toWorkPage = (AtsWorkPage) transitionToStateCombo.getSelected();
+
+ if (toWorkPage == null) {
+ AWorkbench.popup("ERROR", "Can't retrieve transition to state from combo");
+ return;
+ }
+ if (toWorkPage.isCancelledPage()) {
+ EntryDialog cancelDialog = new EntryDialog("Cancellation Reason", "Enter cancellation reason.");
+ if (cancelDialog.open() != 0) return;
+ Result result = smaMgr.transitionToCancelled(cancelDialog.getEntry(), true);
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ smaMgr.setInTransition(false);
+ smaMgr.getEditor().redrawPages();
+ return;
+ }
+
+ // Get transition to assignees
+ Set<User> toAssignees;
+ if (toWorkPage.isCancelledPage() || toWorkPage.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.getWorkPage().isReturnPage(toWorkPage)) {
+
+ // Validate XWidgets for transition
+ Result result = page.isPageComplete();
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+
+ // Loop throught 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;
+ }
+ }
+ }
+
+ // Loop throught this state's blocking reviews to confirm complete
+ for (ReviewSMArtifact reviewArt : smaMgr.getReviewManager().getReviewsFromCurrentState()) {
+ SMAManager smaMgr = new SMAManager(reviewArt);
+ if (reviewArt.isBlocking() && (!smaMgr.isCancelled() && !smaMgr.isCompleted())) {
+ AWorkbench.popup(
+ "Error",
+ "Blocking Review Not Complete\n\nTitle: " + reviewArt.getDescriptiveName() + "\n\nHRID: " + reviewArt.getHumanReadableId());
+ return;
+ }
+ }
+
+ // Check extension points for valid transition
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ try {
+ result = item.transitioning(smaMgr, smaMgr.getCurrentStateName(), toWorkPage.getName(), toAssignees);
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ // Ask for metrics for this page (store in state versus task?)
+ if (!handlePopulateStateMetrics()) return;
+ }
+
+ try {
+ smaMgr.getSma().persist();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ Result result = smaMgr.transition(toWorkPage.getName(), toAssignees, true, false);
+ if (result.isFalse()) {
+ result.popup();
+ return;
+ }
+ smaMgr.setInTransition(false);
+ smaMgr.getEditor().redrawPages();
+ } catch (SQLException 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 IllegalStateException, SQLException {
+
+ // Page has the ability to override the autofill of the metrics
+ if (!page.isRequireStateHoursSpentPrompt() && smaMgr.getSma().getCurrentState().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.getCurrentStateDam().setPercentComplete(100);
+ smaMgr.getCurrentStateDam().setHoursSpent(hoursSinceCreation);
+ return true;
+ }
+ }
+
+ // Otherwise, open dialog to ask for hours complete
+ String msg =
+ smaMgr.getCurrentStateName() + " State\n\n" + smaMgr.getSma().getCurrentState().getHoursSpentStr() + " 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(new StateMachineArtifact[] {smaMgr.getSma()}));
+ int result = tsd.open();
+ if (result == 0) {
+ smaMgr.getCurrentStateDam().setPercentComplete(100);
+ smaMgr.getCurrentStateDam().setHoursSpent(
+ smaMgr.getSma().getCurrentState().getHoursSpent() + tsd.getHours().getFloat());
+ return true;
+ }
+ return false;
+ }
+
+ public int getCreationToNowDateDeltaMinutes() {
+ Date createDate = smaMgr.getSma().getLog().getStateEvent(LogType.StateEntered, page.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 XTaskViewer 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 page;
+ }
+
+ /**
+ * @return the mainComp
+ */
+ public Composite getMainComp() {
+ return mainComp;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
new file mode 100644
index 00000000000..386b3382173
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMAWorkFlowTab.java
@@ -0,0 +1,488 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+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.AtsWorkPage;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+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.workflow.WorkPage;
+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.Label;
+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 SMAManager smaMgr;
+ private ArrayList<SMAWorkFlowSection> sections = new ArrayList<SMAWorkFlowSection>();
+ private 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 List<AtsWorkPage> pages = new ArrayList<AtsWorkPage>();
+ private ScrolledForm scrolledForm;
+ private Integer HEADER_COMP_COLUMNS = 4;
+ private static Map<String, Integer> guidToScrollLocation = new HashMap<String, Integer>();
+ private final TeamWorkFlowArtifact teamWf;
+ private SMARelationsComposite smaRelationsComposite;
+
+ 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) {
+ 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);
+ managedForm.refresh();
+
+ ServicesArea toolbarArea = new ServicesArea(smaMgr);
+ toolbarArea.createToolbarServices(scrolledForm.getToolBarManager());
+
+ OseeAts.addButtonToEditorToolBar(smaMgr.getEditor(), this, AtsPlugin.getInstance(),
+ scrolledForm.getToolBarManager(), SMAEditor.EDITOR_ID, "ATS Editor");
+
+ if (smaMgr.getSma().getHelpContext() != null) AtsPlugin.getInstance().setHelp(scrolledForm,
+ smaMgr.getSma().getHelpContext());
+
+ scrolledForm.updateToolBar();
+ // restoreScrollLocation();
+ } catch (Exception ex) {
+ OSEELog.logException(getClass(), ex, true);
+ }
+ }
+
+ public void dispose() {
+ for (SMAWorkFlowSection section : sections)
+ section.dispose();
+ toolkit.dispose();
+ }
+
+ public String getActionDescription() {
+ return "Workflow Tab";
+ }
+
+ public final static String normalColor = "#EEEEEE";
+ private final static String activeColor = "#9CCCFF";
+
+ public String getHtml() {
+ StringBuffer sb = new StringBuffer();
+ for (WorkPage wPage : pages) {
+ AtsWorkPage page = (AtsWorkPage) wPage;
+ if (smaMgr.isCurrentState(page) || smaMgr.isStateVisited(page.getName())) {
+ sb.append(page.getHtml(smaMgr.isCurrentState(page) ? activeColor : normalColor));
+ sb.append(AHTML.newline());
+ }
+ }
+ return sb.toString();
+ }
+
+ private void fillBody(IManagedForm managedForm) {
+ Composite body = managedForm.getForm().getBody();
+ GridLayout gridLayout = new GridLayout(1, false);
+ body.setLayout(gridLayout);
+ body.setLayoutData(new GridData(SWT.LEFT, SWT.LEFT, true, false));
+
+ Composite headerComp = toolkit.createComposite(body);
+ headerComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ headerComp.setLayout(ALayout.getZeroMarginLayout(1, false));
+ // mainComp.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ createTopLineHeader(headerComp, toolkit);
+ createLatestHeader(headerComp, toolkit);
+ createTeamWorkflowHeader(headerComp, toolkit);
+ createNotesHeader(headerComp, toolkit);
+ createAnnotationsHeader(headerComp, toolkit);
+
+ sections.clear();
+ pages.clear();
+
+ // Display relations
+ try {
+ if (SMARelationsComposite.relationExists(smaMgr.getSma())) {
+ smaRelationsComposite = new SMARelationsComposite(body, toolkit, SWT.NONE);
+ smaRelationsComposite.create(smaMgr);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+
+ // Only display current or past states
+ for (WorkPage wPage : smaMgr.getSma().getWorkFlow().getPagesOrdered()) {
+ AtsWorkPage page = (AtsWorkPage) wPage;
+ if (smaMgr.isCurrentState(page) || smaMgr.isStateVisited(page.getName())) {
+ // Don't show completed or cancelled state if not currently those state
+ if (page.isCompletePage() && !smaMgr.isCompleted()) continue;
+ if (page.isCancelledPage() && !smaMgr.isCancelled()) continue;
+ SMAWorkFlowSection section = null;
+ if (page.isCancelledPage())
+ section = new SMAWorkFlowCancelledSection(body, toolkit, SWT.NONE, page, smaMgr);
+ else if (page.isCompletePage())
+ section = new SMAWorkFlowCompletedSection(body, toolkit, SWT.NONE, page, smaMgr);
+ else {
+ section = new SMAWorkFlowSection(body, toolkit, SWT.NONE, page, smaMgr);
+ }
+ control = section.getMainComp();
+ sections.add(section);
+ managedForm.addPart(section);
+ pages.add(page);
+ }
+ }
+
+ logSection = new SMAWorkFlowLogSection(body, toolkit, SWT.NONE, smaMgr);
+ control = logSection.getMainComp();
+ sections.add(logSection);
+ managedForm.addPart(logSection);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ SMAWorkFlowDebugSection section = new SMAWorkFlowDebugSection(body, toolkit, SWT.NONE, smaMgr);
+ control = section.getMainComp();
+ sections.add(section);
+ managedForm.addPart(section);
+ section.getSection().setExpanded(true);
+ }
+
+ body.setFocus();
+ // Jump to scroll location if set
+ Integer selection = guidToScrollLocation.get(smaMgr.getSma().getGuid());
+ if (selection != null) {
+ JumpScrollbarJob job = new JumpScrollbarJob("");
+ job.schedule(500);
+ }
+ }
+
+ private Control control = null;
+ private SMAWorkFlowLogSection logSection;
+
+ 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, "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, "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, "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, "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.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ 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));
+
+ toolkit.createLabel(topLineComp, smaMgr.getEditorHeaderString(), SWT.NO_TRIM);
+ createOriginatorHeader(topLineComp, toolkit);
+
+ try {
+ toolkit.createLabel(topLineComp, "Action Id:");
+ Text text = new Text(topLineComp, SWT.NONE);
+ toolkit.adapt(text, true, true);
+ text.setText(smaMgr.getSma().getParentActionArtifact() == null ? "??" : smaMgr.getSma().getParentActionArtifact().getHumanReadableId());
+ } catch (SQLException ex) {
+ // Do nothing
+ }
+
+ toolkit.createLabel(topLineComp, smaMgr.getSma().getArtifactSuperTypeName() + " Id:");
+ Text 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());
+ }
+ }
+
+ private void createNotesHeader(Composite comp, XFormToolkit toolkit) {
+ // Display SMA Note
+ String note = smaMgr.getSma().getSoleAttributeValue(ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName());
+ if (!note.equals("")) {
+ Label label = toolkit.createLabel(comp, "Note: " + note);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = HEADER_COMP_COLUMNS;
+ label.setLayoutData(gd);
+ }
+ // Display global Notes
+ for (NoteItem noteItem : smaMgr.getSma().getNotes().getNoteItems()) {
+ if (noteItem.getState().equals("")) {
+ Label label = toolkit.createLabel(comp, noteItem.toHTML());
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = HEADER_COMP_COLUMNS;
+ label.setLayoutData(gd);
+ }
+ }
+ }
+
+ private void createOriginatorHeader(Composite comp, XFormToolkit toolkit) {
+ 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) {
+ if (smaMgr.promptChangeOriginator()) {
+ updateOrigLabel();
+ smaMgr.getEditor().onDirtied();
+ }
+ }
+
+ });
+ 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() {
+ origLabel.setText(smaMgr.getOriginator().getName());
+ origLabel.getParent().layout();
+ if (teamWf != null) {
+ teamActionableItemLabel.setText(teamWf.getActionableItemsDam().getActionableItemsStr());
+ actionActionableItemsLabel.setText(teamWf.getActionableItemsDam().getActionableItemsStr());
+ }
+ }
+
+ public void refresh() {
+ for (SMAWorkFlowSection section : sections)
+ section.refresh();
+ if (smaRelationsComposite != null) smaRelationsComposite.refresh();
+ }
+
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditor.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditor.java
new file mode 100644
index 00000000000..4f8cf438b16
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditor.java
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.ats.util.widgets.task.IXTaskViewer;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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.SkynetContributionItem;
+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.swt.IDirtiableEditor;
+import org.eclipse.swt.SWT;
+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, IEventReceiver, IXTaskViewer {
+ public static final String EDITOR_ID = "org.eclipse.osee.ats.editor.TaskEditor";
+ private int taskPageIndex;
+ private SMATaskComposite taskComposite;
+ private Collection<TaskArtifact> tasks = new HashSet<TaskArtifact>();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.AbstractArtifactEditor#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ for (TaskArtifact taskArt : tasks)
+ taskArt.saveSMA();
+ onDirtied();
+ }
+
+ public static void editArtifacts(TaskEditorInput input) {
+ IWorkbenchPage page = AWorkbench.getActivePage();
+ try {
+ page.openEditor(input, EDITOR_ID);
+ } catch (PartInitException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public boolean isSaveOnCloseNeeded() {
+ return isDirty();
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ for (TaskArtifact taskArt : tasks)
+ if (taskArt != null && !taskArt.isDeleted() && taskArt.isSMADirty()) taskArt.revertSMA();
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ taskComposite.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.isSMADirty()) return true;
+ return false;
+ }
+
+ public String toString() {
+ return "TaskEditor";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.forms.editor.FormEditor#addPages()
+ */
+ @Override
+ protected void addPages() {
+
+ SkynetContributionItem.addTo(this, true);
+
+ IEditorInput editorInput = getEditorInput();
+ if (editorInput instanceof TaskEditorInput) {
+ TaskEditorInput aei = (TaskEditorInput) editorInput;
+ tasks = ((TaskEditorInput) aei).getTaskArts();
+ } else
+ throw new IllegalArgumentException("Editor Input not TaskEditorInput");
+
+ setPartName(((TaskEditorInput) editorInput).getName());
+
+ // Create Tasks tab
+ taskComposite = new SMATaskComposite(getContainer(), SWT.NONE);
+ taskComposite.create(this);
+ taskPageIndex = addPage(taskComposite);
+ setPageText(taskPageIndex, "Tasks");
+
+ setActivePage(taskPageIndex);
+ }
+
+ @Override
+ public void onDirtied() {
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ public void run() {
+ firePropertyChange(PROP_DIRTY);
+ }
+ });
+ }
+
+ public void onEvent(final Event event) {
+ if (getContainer() == null || getContainer().isDisposed()) return;
+ onDirtied();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getCurrentStateName()
+ */
+ public String getCurrentStateName() {
+ return "";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getEditor()
+ */
+ public IDirtiableEditor getEditor() {
+ return this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getOptions()
+ */
+ public List<TaskResOptionDefinition> getResOptions() {
+ return ((TaskEditorInput) (IEditorInput) getEditorInput()).getResOptions();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getParentSmaMgr()
+ */
+ public SMAManager getParentSmaMgr() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTabName()
+ */
+ public String getTabName() {
+ return "Tasks";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#getTaskArtifacts(java.lang.String)
+ */
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws SQLException {
+ return tasks;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isTaskable()
+ */
+ public boolean isTaskable() {
+ return false;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isUsingTaskResolutionOptions()
+ */
+ public boolean isUsingTaskResolutionOptions() {
+ return getResOptions().size() > 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.util.widgets.task.IXTaskViewer#isTasksEditable()
+ */
+ public boolean isTasksEditable() {
+ return true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.java
new file mode 100644
index 00000000000..3857405ed79
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/TaskEditorInput.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.editor;
+
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskEditorInput extends ArtifactEditorInput {
+
+ private final Collection<TaskArtifact> taskArts;
+ private final String name;
+ private final List<TaskResOptionDefinition> resOptions;
+
+ /**
+ * @param artifact
+ */
+ public TaskEditorInput(String name, Collection<TaskArtifact> taskArts, List<TaskResOptionDefinition> resOptions) {
+ super(null);
+ this.name = name;
+ this.taskArts = taskArts;
+ this.resOptions = resOptions;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditorInput#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ return false;
+ }
+
+ /**
+ * @return the taskArts
+ */
+ public Collection<TaskArtifact> getTaskArts() {
+ return taskArts;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the resOptions
+ */
+ public List<TaskResOptionDefinition> getResOptions() {
+ return resOptions;
+ }
+
+ /* (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 "";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/AtsHelpContext.java
new file mode 100644
index 00000000000..2e1b223f796
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/help/WorkAttrHelpResource.java
new file mode 100644
index 00000000000..ceef15fc735
--- /dev/null
+++ b/MS_0.1.4_20080103/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.getLayoutName() + ".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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.java
new file mode 100644
index 00000000000..9ec6568a32a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddDecisionReviewService.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.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.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) {
+ 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) {
+ 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(), 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.java
new file mode 100644
index 00000000000..cd13bef2d3f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddNoteOperation.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 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.editor.SMAManager;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.WorkPage;
+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 (WorkPage page : smaMgr.getWorkFlow().getPages())
+ if (!page.equals(DefaultTeamState.Cancelled.name()) && !page.equals(DefaultTeamState.Completed.name())) artifactNames.add(page.getName());
+ 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.getSma().getNotes().addNote(
+ NoteType.getType(noteWizard.mainPage.typeList.getSelected().iterator().next().getName()), state,
+ noteWizard.mainPage.noteText.get(), SkynetAuthentication.getInstance().getAuthenticatedUser());
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.java
new file mode 100644
index 00000000000..eb5343e38a5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AddPeerToPeerReviewService.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.editor.service;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.actions.NewPeerToPeerReviewJob;
+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.StateListDialog;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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 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) {
+ 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) {
+ 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) {
+ StateListDialog dialog =
+ new StateListDialog("Related Review State", "Select state to that review will be associated with.",
+ smaMgr.getWorkFlow().getPageNames());
+ dialog.setInitialSelections(new Object[] {smaMgr.getCurrentStateName()});
+ if (dialog.open() == 0) {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Add PeerToPeer Review",
+ "Create a PeerToPeer Review and attach it the \"" + dialog.getResult()[0] + "\" state?")) return;
+ NewPeerToPeerReviewJob job =
+ new NewPeerToPeerReviewJob((TeamWorkFlowArtifact) smaMgr.getSma(), dialog.getSelectedState());
+ 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 PeerToPeer Review";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getSidebarCategory()
+ */
+ @Override
+ public String getSidebarCategory() {
+ return ServicesArea.OPERATION_CATEGORY;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.java
new file mode 100644
index 00000000000..336d4f2ec6a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/AtsAdminStat.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.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.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) {
+ 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) {
+ label = toolkit.createLabel(workGroup, "AtsAdmin");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+
+ if (AtsPlugin.isAtsUseWorkflowFiles()) {
+ label = toolkit.createLabel(workGroup, "AtsUseWorkflowFiles");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if (AtsPlugin.isAtsIgnoreConfigUpgrades()) {
+ label = toolkit.createLabel(workGroup, "AtsIgnoreConfigUpgrades");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if (AtsPlugin.isAtsDisableEmail()) {
+ label = toolkit.createLabel(workGroup, "AtsDisableEmail");
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ }
+
+ if (AtsPlugin.isAtsAlwaysEmailMe()) {
+ label = toolkit.createLabel(workGroup, "AtsAlwaysEmailMe");
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/BlockingReview.java
new file mode 100644
index 00000000000..14285fb8ba9
--- /dev/null
+++ b/MS_0.1.4_20080103/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 java.sql.SQLException;
+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.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) {
+ 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) {
+ label = toolkit.createLabel(workGroup, "");
+ label.setToolTipText("A blocking review requires the review be completed before the parent workflow can continue.");
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Blocking Review";
+ }
+
+ /* (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()) {
+ boolean blocking = ((ReviewSMArtifact) smaMgr.getSma()).isBlocking();
+ label.setText(blocking ? "Blocking Review" : "Non-Blocking Review");
+ label.setForeground(blocking ? Display.getCurrent().getSystemColor(SWT.COLOR_RED) : null);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/CopyActionDetailsService.java
new file mode 100644
index 00000000000..5c8ff74d7af
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.java
new file mode 100644
index 00000000000..d7804cb4226
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/DebugOperations.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.editor.service;
+
+import java.sql.SQLException;
+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.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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.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.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) {
+ 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) {
+ 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) {
+ StringBuilder info = new StringBuilder();
+ info.append(AHTML.heading(2, "State Machine Artifact - Dirty Report"));
+ smaMgr.getSma().isSMADirty(info);
+ String title = "State Machine Artifact - Dirty Report";
+ XResultView.getResultView().addResultPage(
+ new XResultPage(title + " - " + XDate.getDateNow(XDate.MMDDYYHHMM), AHTML.simplePage(info.toString())));
+ AWorkbench.popup("Complete", title + " Complete...Results in ATS Results");
+ }
+
+ });
+ 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) {
+ String hrid = smaMgr.getWorkFlow().getId().replaceFirst("^.* - ", "");
+ if (hrid.length() != 5)
+ AWorkbench.popup("Open Workflow", "Workflow is NOT an artifact\n\n" + smaMgr.getWorkFlow().getId());
+ else
+ AtsLib.open(hrid, OpenView.ArtifactEditor);
+ }
+ });
+ 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 (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.java
new file mode 100644
index 00000000000..a8508618d50
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/EmailActionService.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.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.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EmailActionService extends WorkPageService {
+
+ public EmailActionService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performEmail() {
+ 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() {
+ performEmail();
+ }
+ };
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java
new file mode 100644
index 00000000000..d9d7a30f8f7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/FavoriteOperation.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.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) {
+ 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) {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInArtifactEditorOperation.java
new file mode 100644
index 00000000000..af8cd2ed168
--- /dev/null
+++ b/MS_0.1.4_20080103/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("laser_16_16.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.java
new file mode 100644
index 00000000000..99f0bd1174b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInAtsWorldOperation.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.editor.service;
+
+import java.sql.SQLException;
+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.WorldView;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+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();
+ WorldView.loadIt("Action " + actionArt.getHumanReadableId(), Arrays.asList(new Artifact[] {actionArt}));
+ return;
+ } else if (smaMgr.getSma() instanceof StateMachineArtifact) {
+ WorldView.loadIt(smaMgr.getSma().getArtifactTypeName() + ": " + smaMgr.getSma().getHumanReadableId(),
+ Arrays.asList(new Artifact[] {smaMgr.getSma()}));
+ return;
+ }
+ OSEELog.logSevere(AtsPlugin.class, "Unhandled artifact type " + smaMgr.getSma().getArtifactTypeName(), true);
+ } catch (SQLException 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) {
+ public void run() {
+ performOpen();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("world.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open in ATS World";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenInSkyWalkerOperation.java
new file mode 100644
index 00000000000..e824966c876
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.java
new file mode 100644
index 00000000000..c57c99c9321
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenLatestVersion.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 java.sql.SQLException;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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) {
+ return isCurrentState(page) && !smaMgr.getSma().getPersistenceMemo().getTransactionId().isHead();
+ }
+
+ /* (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) {
+ 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 =
+ ArtifactPersistenceManager.getInstance().getArtifact(smaMgr.getSma().getGuid(),
+ smaMgr.getSma().getBranch());
+ if (art == null) {
+ AWorkbench.popup("ERROR", "Can't retrieve latest version of artifact; may have been deleted");
+ return;
+ }
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java
new file mode 100644
index 00000000000..f2a65fe89d3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenParent.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.ui.skynet.ats.AtsOpenOption;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OpenParent extends WorkPageService {
+
+ public OpenParent(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ private void performOpen() {
+ try {
+ AtsLib.openAtsAction(smaMgr.getSma().getParentSMA(), AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ }
+
+ @Override
+ public Action createToolbarService() {
+ if (!isParent()) return null;
+ Action action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performOpen();
+ }
+ };
+ 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.logException(AtsPlugin.class, ex, false);
+ }
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Open Parent";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.java
new file mode 100644
index 00000000000..653fb2b8a85
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenTeamDefinition.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 java.sql.SQLException;
+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 (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java
new file mode 100644
index 00000000000..9409d8bc82a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/OpenVersionArtifact.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.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()).getTargetedForVersion() != null) ArtifactEditor.editArtifact(((TeamWorkFlowArtifact) smaMgr.getSma()).getTargetedForVersion());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /* (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()).getTargetedForVersion() != null;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ action.setEnabled(enabled);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.java
new file mode 100644
index 00000000000..600c97bf776
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/PrivilegedEditService.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.editor.service;
+
+import java.sql.SQLException;
+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.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+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) {
+ 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) {
+ 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(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ StringBuffer sb = new StringBuffer();
+ for (User user : users)
+ sb.append(user.getName() + "\n");
+ String buttons[];
+ boolean iAmPrivileged = users.contains(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ if (iAmPrivileged)
+ buttons = new String[] {"OK", "Override and Edit", "Override and Edit All", "Cancel"};
+ else
+ buttons = new String[] {"OK", "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) {
+ if (result == 1)
+ smaMgr.getEditor().setPriviledgedEditMode(SMAEditor.PriviledgedEditMode.CurrentState);
+ else if (result == 2) smaMgr.getEditor().setPriviledgedEditMode(
+ SMAEditor.PriviledgedEditMode.Global);
+ }
+ }
+
+ } catch (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.java
new file mode 100644
index 00000000000..e92c09d14cc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ServicesArea.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.editor.service;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+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.ShowChangeReportService;
+import org.eclipse.osee.ats.editor.service.branch.ShowChangeReportToolbarService;
+import org.eclipse.osee.ats.editor.service.branch.ShowWorkingBranchService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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 List<WorkPageService> services = new ArrayList<WorkPageService>();
+ private 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 : services)
+ service.dispose();
+ }
+
+ public void loadServices(AtsWorkPage page) {
+ if (services.size() == 0) {
+ // Operations
+ services.add(new FavoriteOperation(smaMgr));
+ services.add(new SubscribedOperation(smaMgr));
+ services.add(new OpenLatestVersion(smaMgr));
+ services.add(new DebugOperations(smaMgr));
+ services.add(new PrivilegedEditService(smaMgr));
+ // Services
+ services.add(new AtsAdminStat(smaMgr));
+ services.add(new TotalPercentCompleteStat(smaMgr));
+ services.add(new TotalHoursSpentStat(smaMgr));
+ services.add(new TargetedForVersionState(smaMgr));
+ services.add(new StatePercentCompleteStat(smaMgr));
+ services.add(new StateHoursSpentStat(smaMgr));
+ services.add(new AddDecisionReviewService(smaMgr));
+ services.add(new AddPeerToPeerReviewService(smaMgr));
+ services.add(new BlockingReview(smaMgr));
+ // Toolbar Services
+ services.add(new ShowChangeReportToolbarService(smaMgr));
+ services.add(new OpenParent(smaMgr));
+ services.add(new EmailActionService(smaMgr));
+ services.add(new AddNoteOperation(smaMgr));
+ services.add(new ShowNotesOperation(smaMgr));
+ services.add(new OpenInAtsWorldOperation(smaMgr));
+ services.add(new OpenInArtifactEditorOperation(smaMgr));
+ services.add(new OpenInSkyWalkerOperation(smaMgr));
+ services.add(new OpenVersionArtifact(smaMgr));
+ services.add(new OpenTeamDefinition(smaMgr));
+ services.add(new CopyActionDetailsService(smaMgr));
+ // Add page configured branchable state items
+ if (page != null && (page.isAllowCommitBranch() || page.isAllowCreateBranch())) {
+ if (page.isAllowCreateBranch()) services.add(new CreateWorkingBranchService(smaMgr));
+ services.add(new ShowWorkingBranchService(smaMgr));
+ services.add(new ShowChangeReportService(smaMgr));
+ if (page.isAllowCommitBranch()) services.add(new CommitWorkingBranchService(smaMgr, false));
+ if (AtsPlugin.isAtsAdmin()) services.add(new CommitWorkingBranchService(smaMgr, true));
+ services.add(new DeleteWorkingBranch(smaMgr));
+ }
+ // Add state specific items (these can also contain branch items through extending BranchableStateItem class
+ if (page != null)
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(page.getId())) {
+ services.addAll(item.getServices(smaMgr));
+ }
+ // If page is null, this is a toolbar request for services, load all state items
+ else if (page == null) for (IAtsStateItem item : AtsStateItems.getAllStateItems()) {
+ services.addAll(item.getServices(smaMgr));
+ }
+ }
+ }
+
+ public void createSidebarServices(Composite comp, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) {
+ loadServices(page);
+ Set<String> categories = new HashSet<String>();
+ for (WorkPageService service : services) {
+ categories.add(service.getSidebarCategory());
+ }
+ createServicesArea(comp, STATISTIC_CATEGORY, page, toolkit, section);
+ categories.remove(STATISTIC_CATEGORY);
+ createServicesArea(comp, OPERATION_CATEGORY, page, toolkit, section);
+ categories.remove(OPERATION_CATEGORY);
+ for (String category : categories) {
+ createServicesArea(comp, category, page, toolkit, section);
+ }
+ }
+
+ public void createToolbarServices(IToolBarManager toolbarManager) {
+ loadServices(null);
+ for (final WorkPageService service : services) {
+ try {
+ Action action = service.createToolbarService();
+ if (action != null) toolbarManager.add(action);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ }
+
+ private void createServicesArea(Composite comp, String category, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) {
+
+ // Determine services that are in this category and confirm that they should be displayed
+ List<WorkPageService> displayServices = new ArrayList<WorkPageService>();
+ for (WorkPageService service : services)
+ 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 : services)
+ stat.refresh();
+ for (Group group : groups)
+ if (group != null && !group.isDisposed()) group.layout();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/ShowNotesOperation.java
new file mode 100644
index 00000000000..9f87bc9299f
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.java
new file mode 100644
index 00000000000..40092067034
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StateHoursSpentStat.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.editor.service;
+
+import java.sql.SQLException;
+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.util.AtsLib;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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.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) {
+ 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) {
+ this.page = page;
+ if (!isCompleteCancelledState(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.getCurrentStateName().equals(DefaultTeamState.Implement.name()) && smaMgr.getSma().isMetricsFromTasks()) {
+ AWorkbench.popup("ERROR",
+ "Hours Spent is rollup of task(s) hours spent " + "and can not be edited here.");
+ return;
+ } else if (smaMgr.promptChangeStatus(false)) section.refreshStateServices();
+ } catch (SQLException 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 Spent: " + AtsLib.doubleToStrString(smaMgr.getSma().getStateHoursSpent(
+ page.getName())));
+ else if (page != null && label != null && !label.isDisposed())
+ label.setText("State Hours Spent: " + AtsLib.doubleToStrString(smaMgr.getSma().getStateHoursSpent(
+ page.getName())));
+ else if (label != null && !label.isDisposed()) label.setText("State Hours Spent Error: page == null");
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.java
new file mode 100644
index 00000000000..d5a918478d8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/StatePercentCompleteStat.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.editor.service;
+
+import java.sql.SQLException;
+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.DefaultTeamState;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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 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) {
+ 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) {
+ 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.getCurrentStateName().equals(DefaultTeamState.Implement.name()) && smaMgr.getSma().isMetricsFromTasks()) {
+ AWorkbench.popup("ERROR",
+ "Percent Complete is rollup of task(s) percent complete " + "and can not be edited here.");
+ return;
+ } else if (smaMgr.promptChangeStatus(false)) section.refreshStateServices();
+ } catch (SQLException 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.STATISTIC_CATEGORY;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.statistic.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ if (page == null)
+ link.setText("State Percent Error: page == null");
+ else
+ link.setText("State Percent: " + smaMgr.getSma().getStatePercentComplete(page.getName()));
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Percent Complete";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.java
new file mode 100644
index 00000000000..df56e6016c2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/SubscribedOperation.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.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.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) {
+ return smaMgr.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) {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.java
new file mode 100644
index 00000000000..fd3f2e3aa95
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TargetedForVersionState.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.service;
+
+import java.sql.SQLException;
+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.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() {
+ try {
+ String str = "Target Version: ";
+ if (smaMgr.getTargetedForVersion() != null) str += smaMgr.getTargetedForVersion().getDescriptiveName();
+ if (link != null && !link.isDisposed())
+ link.setText(str);
+ else if (label != null && !label.isDisposed()) label.setText(str);
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#isShowSidebarService(org.eclipse.osee.ats.workflow.AtsWorkPage)
+ */
+ @Override
+ public boolean isShowSidebarService(AtsWorkPage page) {
+ return smaMgr.isCurrentState(page) && (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) {
+ 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(false)) {
+ refresh();
+ section.refreshStateServices();
+ }
+ } catch (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.java
new file mode 100644
index 00000000000..60afcf6c584
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalHoursSpentStat.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.editor.service;
+
+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.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) {
+ return smaMgr.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) {
+ 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 (label != null && !label.isDisposed()) label.setText("Total Hours Spent: " + AtsLib.doubleToStrString(smaMgr.getSma().getTotalHoursSpent()));
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.java
new file mode 100644
index 00000000000..f5e55599c7e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/TotalPercentCompleteStat.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.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.SMAWorkFlowSection;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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) {
+ return smaMgr.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) {
+ label = toolkit.createLabel(workGroup, "", SWT.NONE);
+ 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.WorkPageStatistic#refresh()
+ */
+ @Override
+ public void refresh() {
+ if (label != null && !label.isDisposed()) label.setText("Total Percent: " + smaMgr.getSma().getWorldViewTotalPercentComplete());
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.java
new file mode 100644
index 00000000000..281a1fd0838
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/WorkPageService.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.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.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) {
+ return smaMgr.isCurrentState(page);
+ }
+
+ public boolean isCurrentNonCompleteCancelledState(AtsWorkPage page) {
+ return smaMgr.isCurrentState(page) && !isCompleteCancelledState(page);
+ }
+
+ public boolean isCompleteCancelledState(AtsWorkPage page) {
+ return page.isCancelledPage() || page.isCompletePage();
+ }
+
+ public void createSidebarService(Group workGroup, AtsWorkPage page, XFormToolkit toolkit, SMAWorkFlowSection section) {
+ }
+
+ 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
+ */
+ public boolean isShowSidebarService(AtsWorkPage page) {
+ return showSidebarService;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.java
new file mode 100644
index 00000000000..0b2ffe61f6f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CommitWorkingBranchService.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.branch;
+
+import java.sql.SQLException;
+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.editor.stateItem.BranchableStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.event.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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 CommitWorkingBranchService extends WorkPageService implements IEventReceiver {
+
+ 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) {
+ 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) {
+ if (smaMgr.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) {
+ Result result = smaMgr.getBranchMgr().commitWorkingBranch(true, overrideStateValidation);
+ if (result.isFalse()) result.popup();
+ }
+ });
+ }
+ SkynetEventManager.getInstance().register(LocalBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteBranchEvent.class, 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 BranchableStateItem.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 (SQLException ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ public void onEvent(Event event) {
+ if (event instanceof BranchEvent) {
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.java
new file mode 100644
index 00000000000..6d63931fbe4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/CreateWorkingBranchService.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.service.branch;
+
+import java.sql.SQLException;
+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.editor.stateItem.BranchableStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.event.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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 IEventReceiver {
+
+ 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) {
+ 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) {
+ 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();
+ }
+ });
+ SkynetEventManager.getInstance().register(LocalBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteBranchEvent.class, 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 BranchableStateItem.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 (SQLException ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ public void onEvent(Event event) {
+ if (event instanceof BranchEvent) {
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java
new file mode 100644
index 00000000000..387b9f37d60
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/DeleteWorkingBranch.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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 java.sql.SQLException;
+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.editor.stateItem.BranchableStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.event.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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 IEventReceiver {
+
+ 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) {
+ 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) {
+ 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();
+ }
+ });
+ SkynetEventManager.getInstance().register(LocalBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteBranchEvent.class, 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 BranchableStateItem.BRANCH_CATEGORY;
+ }
+
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch();
+ } catch (SQLException ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ public void onEvent(Event event) {
+ if (event instanceof BranchEvent) {
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.java
new file mode 100644
index 00000000000..672453b239b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportService.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.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.editor.stateItem.BranchableStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+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.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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 IEventReceiver {
+ private static final TransactionIdManager transactionIdManager = TransactionIdManager.getInstance();
+
+ 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) {
+ return isCurrentState(page) || page.getId().contains("Implement");
+ }
+
+ /* (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) {
+ 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();
+ }
+ });
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteBranchEvent.class, this);
+ refresh();
+ }
+
+ /* (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 BranchableStateItem.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.setText(enabled ? "Show Change Report" : "Show Change Report\n(no changes)");
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ if (smaMgr.getBranchMgr().isWorkingBranch()) {
+ Pair<TransactionId, TransactionId> transactionToFrom =
+ transactionIdManager.getStartEndPoint(smaMgr.getBranchMgr().getWorkingBranch());
+ enabled = !transactionToFrom.getKey().equals(transactionToFrom.getValue());
+ } else {
+ enabled = smaMgr.getBranchMgr().getTransactionId() != null;
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ public void onEvent(Event event) {
+ refresh();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ private void performService() {
+ smaMgr.getBranchMgr().showChangeReport();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportToolbarService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportToolbarService.java
new file mode 100644
index 00000000000..e91caa31cf2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowChangeReportToolbarService.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.branch;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
+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.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowChangeReportToolbarService extends WorkPageService implements IEventReceiver {
+ private static final TransactionIdManager transactionIdManager = TransactionIdManager.getInstance();
+
+ private Action action;
+
+ // Since this service is only going to be added for the Implement state, Location.AllState will
+ // work
+ public ShowChangeReportToolbarService(SMAManager smaMgr) {
+ super(smaMgr);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#createToolbarService()
+ */
+ @Override
+ public Action createToolbarService() {
+ if (!isEnabled()) return null;
+ action = new Action(getName(), Action.AS_PUSH_BUTTON) {
+ public void run() {
+ performService();
+ }
+ };
+ action.setToolTipText(getName());
+ action.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("branch_change.gif"));
+ return action;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#getName()
+ */
+ @Override
+ public String getName() {
+ return "Show Change Report";
+ }
+
+ private boolean isEnabled() {
+ boolean enabled = false;
+ try {
+ if (smaMgr.getBranchMgr().isWorkingBranch()) {
+ Pair<TransactionId, TransactionId> transactionToFrom =
+ transactionIdManager.getStartEndPoint(smaMgr.getBranchMgr().getWorkingBranch());
+ enabled = !transactionToFrom.getKey().equals(transactionToFrom.getValue());
+ } else {
+ enabled = smaMgr.getBranchMgr().getTransactionId() != null;
+ }
+ } catch (Exception ex) {
+ // do nothing
+ }
+ return enabled;
+ }
+
+ public void onEvent(Event event) {
+ refresh();
+ if (action != null) action.setEnabled(isEnabled());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ private void performService() {
+ smaMgr.getBranchMgr().showChangeReport();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.java
new file mode 100644
index 00000000000..baf546cb4d7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/service/branch/ShowWorkingBranchService.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.editor.service.branch;
+
+import java.sql.SQLException;
+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.editor.stateItem.BranchableStateItem;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.framework.skynet.core.event.BranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.LocalBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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 IEventReceiver {
+
+ 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) {
+ 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) {
+ 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();
+ }
+ });
+ SkynetEventManager.getInstance().register(LocalBranchEvent.class, this);
+ SkynetEventManager.getInstance().register(RemoteBranchEvent.class, 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 BranchableStateItem.BRANCH_CATEGORY;
+ }
+
+ @Override
+ public void refresh() {
+ if (link != null && !link.isDisposed()) {
+ boolean enabled = false;
+ try {
+ enabled = smaMgr.getBranchMgr().isWorkingBranch();
+ } catch (SQLException ex) {
+ // do nothing
+ }
+ link.setEnabled(enabled);
+ link.setUnderlined(enabled);
+ }
+ }
+
+ public void onEvent(Event event) {
+ if (event instanceof BranchEvent) {
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.service.WorkPageService#dispose()
+ */
+ @Override
+ public void dispose() {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.java
new file mode 100644
index 00000000000..c66c44208c8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDebugWorkPage.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.editor.stateItem;
+
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+
+/**
+ * @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("ATS Admin Debug", "ats.Debug", null, null);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.java
new file mode 100644
index 00000000000..b51e95d8b6c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewDecisionStateItem.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.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.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()
+ */
+ 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)
+ */
+ public Result xWidgetCreating(XWidget xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) {
+ if (xWidget.getLabel().equals(ATSAttributes.DECISION_ATTRIBUTE.getDisplayName())) {
+ if (xWidget == null) throw new IllegalStateException("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;
+ }
+
+ public String getOverrideTransitionToStateName(SMAWorkFlowSection section) {
+ 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.StateNames.Followup.name();
+ else
+ return DecisionReviewArtifact.StateNames.Completed.name();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getOverrideTransitionToAssignees(org.eclipse.osee.ats.editor.SMAWorkFlowSection)
+ */
+ public Collection<User> getOverrideTransitionToAssignees(SMAWorkFlowSection section) {
+ DecisionOption decisionOption = getDecisionOption(section);
+ if (decisionOption == null) return null;
+ return decisionOption.getAssignees();
+ }
+
+ private DecisionOption getDecisionOption(SMAWorkFlowSection section) {
+ 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() {
+ return "AtsDecisionReviewDecisionStateItem - Add decision options to review state based on prepare state's entries.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.java
new file mode 100644
index 00000000000..d904ea8d258
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsDecisionReviewPrepareStateItem.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.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.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 Exception {
+ if (fromState.equals(DecisionReviewArtifact.StateNames.Prepare) && toState.equals(DecisionReviewArtifact.StateNames.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() {
+ return "AtsDecisionReviewPrepareStateItem - Add validation of decision options prior to transitioning.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.java
new file mode 100644
index 00000000000..66aee341cdf
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsForceAssigneesToTeamLeadsStateItem.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.stateItem;
+
+import java.sql.SQLException;
+import java.util.Collection;
+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.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @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) {
+ super.transitioned(smaMgr, fromState, toState, toAssignees);
+ if ((smaMgr.getSma() instanceof TeamWorkFlowArtifact) && (smaMgr.getWorkPage(toState).isForceAssigneesToTeamLeads())) {
+ // Set Assignees to all user roles users
+ try {
+ Collection<User> teamLeads = ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getLeads();
+ smaMgr.setAssignees(teamLeads);
+ if (smaMgr.getSma().isDirty()) smaMgr.getSma().persist();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "AtsForceAssigneesToTeamLeadsStateItem";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.java
new file mode 100644
index 00000000000..30067ab8af7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsLogWorkPage.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.editor.stateItem;
+
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsLogWorkPage extends AtsWorkPage {
+
+ public static String PAGE_ID = "ats.Log";
+
+ /**
+ * @param title
+ */
+ public AtsLogWorkPage(String title) {
+ super(title, "ats.Log", 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.java
new file mode 100644
index 00000000000..46481f5024a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewPrepareStateItem.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.editor.stateItem;
+
+import java.sql.SQLException;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+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()
+ */
+ 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) {
+ 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())) {
+ XComboDam decisionComboDam = (XComboDam) widget;
+ decisionComboDam.setEnabled(false);
+ decisionComboDam.setRequiredEntry(false);
+ }
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "AtsPeerToPeerReviewPrepareStateItem - If stand-alone review, remove blocking review enablement and required entry.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.java
new file mode 100644
index 00000000000..ecbf2d0102f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsPeerToPeerReviewReviewStateItem.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.editor.stateItem;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+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.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @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) {
+ super.transitioned(smaMgr, fromState, toState, toAssignees);
+ if (!toState.equals(PeerToPeerReviewArtifact.State.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.getAssignees());
+
+ try {
+ smaMgr.setAssignees(assignees);
+ if (smaMgr.getSma().isDirty()) smaMgr.getSma().persist();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "AtsPeerToPeerReviewReviewStateItem - assign review state to all members of review as per role in prepare state.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamAnalyzeStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamAnalyzeStateItem.java
new file mode 100644
index 00000000000..1f720f54997
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamAnalyzeStateItem.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.stateItem;
+
+import java.sql.SQLException;
+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.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+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.XFloatDam;
+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 AtsTeamAnalyzeStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return "osee.ats.defaultTeam.Analyze";
+ }
+
+ /*
+ * (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) {
+ if (xWidget.getLabel().contains(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getDisplayName())) {
+ XFloatDam estimatedHrsFloat = (XFloatDam) xWidget;
+ SMAManager smaMgr = new SMAManager((StateMachineArtifact) art);
+ try {
+ if (smaMgr.getSma().isMetricsFromTasks()) {
+ estimatedHrsFloat.setEnabled(false);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ /*
+ * (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) {
+ if (xWidget.getLabel().equals(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getDisplayName())) {
+ XFloatDam estimatedHrsFloat = (XFloatDam) xWidget;
+ SMAManager smaMgr = new SMAManager((StateMachineArtifact) art);
+ try {
+ if (smaMgr.getSma().isMetricsFromTasks()) {
+ estimatedHrsFloat.setLabel("Estimated Hours (Set from Tasks): " + smaMgr.getSma().getWorldViewEstimatedHoursStr());
+ estimatedHrsFloat.setRequiredEntry(false);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return Result.TrueResult;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "AtsTeamAnalyzeStateItem - Modify hours widget based on MetricsFromTasks selection.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamEndorseStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamEndorseStateItem.java
new file mode 100644
index 00000000000..3965ea59c4a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/AtsTeamEndorseStateItem.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.editor.stateItem;
+
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.workflow.AtsWorkPage;
+import org.eclipse.osee.ats.world.WorldXViewer;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBoxDam;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsTeamEndorseStateItem extends AtsStateItem {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public String getId() {
+ return "osee.ats.defaultTeam.Endorse";
+ }
+
+ /* (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 xWidget, FormToolkit toolkit, AtsWorkPage page, Artifact art, XModifiedListener xModListener, boolean isEditable) {
+ super.xWidgetCreated(xWidget, toolkit, page, art, xModListener, isEditable);
+ if (xWidget.getLabel().equals(ATSAttributes.METRICS_FROM_TASKS_ATTRIBUTE.getDisplayName())) {
+ XCheckBoxDam metricsCheck = (XCheckBoxDam) xWidget;
+ final SMAManager smaMgr = new SMAManager((StateMachineArtifact) art);
+ metricsCheck.getCheckButton().addSelectionListener(new SelectionAdapter() {
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ super.widgetSelected(e);
+ WorldXViewer.handleMetricsFromTasksToggle(smaMgr.getSma());
+ }
+ });
+ }
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "AtsTeamEndorseStateItem - Add extra functionality to metrics from tasks toggle to remove hours spent and % complete when toggle.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/BranchableStateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/BranchableStateItem.java
new file mode 100644
index 00000000000..467465061a8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/stateItem/BranchableStateItem.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.editor.stateItem;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.editor.AtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.editor.service.WorkPageService;
+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.ShowChangeReportService;
+import org.eclipse.osee.ats.editor.service.branch.ShowWorkingBranchService;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class BranchableStateItem extends AtsStateItem {
+
+ private boolean allowCommit = true;
+ public static String BRANCH_CATEGORY = "Branch Changes";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getId()
+ */
+ public abstract String getId();
+
+ public List<WorkPageService> getServices(SMAManager smaMgr) {
+ List<WorkPageService> services = new ArrayList<WorkPageService>();
+ services.add(new CreateWorkingBranchService(smaMgr));
+ services.add(new ShowWorkingBranchService(smaMgr));
+ services.add(new ShowChangeReportService(smaMgr));
+ services.add(new CommitWorkingBranchService(smaMgr, false));
+ if (AtsPlugin.isAtsAdmin()) services.add(new CommitWorkingBranchService(smaMgr, true));
+ services.add(new DeleteWorkingBranch(smaMgr));
+ return services;
+ }
+
+ /*
+ * (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) {
+ if (!allowCommit) return Result.TrueResult;
+ try {
+ if (smaMgr.getBranchMgr().isWorkingBranch()) return new Result(
+ "Working Branch exists. Please commit or delete working branch before transition.");
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Result("Problem determining status of working branch. See error log. " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ /**
+ * @return the allowCommit
+ */
+ public boolean isAllowCommit() {
+ return allowCommit;
+ }
+
+ /**
+ * @param allowCommit the allowCommit to set
+ */
+ public void setAllowCommit(boolean allowCommit) {
+ this.allowCommit = allowCommit;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.editor.IAtsStateItem#getDescription()
+ */
+ public String getDescription() {
+ return "add Branch/Commit block.";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ActionsHaveOneTeam.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ActionsHaveOneTeam.java
new file mode 100644
index 00000000000..6e723e46a21
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/ActionsHaveOneTeam.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionsHaveOneTeam extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public ActionsHaveOneTeam(XNavigateItem parent) {
+ super(parent, "Report Actions Have One Team");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ 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(AtsPlugin.getLogger());
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+
+ // Get Team and Action artifacts
+ java.util.Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ artTypeNames.add(ActionArtifact.ARTIFACT_NAME);
+
+ for (String artType : artTypeNames)
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ Collection<Artifact> artifacts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ int x = 0;
+ for (Artifact art : artifacts) {
+ monitor.subTask(String.format("Processing %d/%d...", x++, artifacts.size()));
+ try {
+ if (art instanceof ActionArtifact) {
+ if (((ActionArtifact) art).getTeamWorkFlowArtifacts().size() == 0) {
+ rd.logError("Action " + art.getHumanReadableId() + " has no Team Workflows\n");
+ }
+ }
+ if (art instanceof TeamWorkFlowArtifact) {
+ if (((TeamWorkFlowArtifact) art).getParentActionArtifact() == null) {
+ rd.logError("Team " + art.getHumanReadableId() + " has no parent Action\n");
+ }
+ }
+ } catch (IllegalStateException ex) {
+ rd.logError("Team " + art.getHumanReadableId() + " has no parent Action\n" + ex.getLocalizedMessage() + "\n");
+ }
+ }
+ rd.report(getName());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AssignedActiveActions.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AssignedActiveActions.java
new file mode 100644
index 00000000000..94eaa6c89da
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AssignedActiveActions.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.health;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.editor.SMAManager;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AssignedActiveActions extends XNavigateItemAction {
+
+ boolean fixIt = true;
+
+ /**
+ * @param parent
+ */
+ public AssignedActiveActions(XNavigateItem parent) {
+ super(parent, "Report Assigned Active Actions (fix available)");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new Report(getName()), true);
+ }
+
+ private final 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) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ final XResultData rd = new XResultData(AtsPlugin.getLogger());
+ try {
+ if (fixIt) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ assignedActiveActionsHelper(rd);
+ }
+ };
+ txWrapper.execute();
+ } else {
+ assignedActiveActionsHelper(rd);
+ }
+ rd.report(getName());
+ toReturn = Status.OK_STATUS;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ toReturn = new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return toReturn;
+ }
+ }
+
+ private void assignedActiveActionsHelper(XResultData rd) throws SQLException {
+ java.util.Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ artTypeNames.add(TaskArtifact.ARTIFACT_NAME);
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artType : artTypeNames)
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ Collection<Artifact> artifacts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ for (Artifact art : artifacts) {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ SMAManager smaMgr = new SMAManager(sma);
+ if ((smaMgr.isCompleted() || smaMgr.isCancelled()) && smaMgr.getAssignees().size() > 0) {
+ rd.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " cancel/complete with assignees");
+ if (fixIt) {
+ smaMgr.clearAssignees();
+ smaMgr.getSma().persist();
+ rd.log("Fixed");
+ }
+ } else if ((!smaMgr.isCompleted() && !smaMgr.isCancelled()) && smaMgr.getAssignees().size() == 0) {
+ rd.logError(sma.getArtifactTypeName() + " " + sma.getHumanReadableId() + " In Work without assignees");
+ }
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AttributeDuplication.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AttributeDuplication.java
new file mode 100644
index 00000000000..6beca95639e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/AttributeDuplication.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.health;
+
+import java.sql.SQLException;
+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.StateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AttributeDuplication extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public AttributeDuplication(XNavigateItem parent) {
+ super(parent, "Report Duplication Attribute");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new LoadArtifactsJob(getName()), true);
+ }
+
+ public class LoadArtifactsJob extends Job {
+
+ private final String name;
+
+ public LoadArtifactsJob(String name) {
+ super(name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ final XResultData rd = new XResultData(AtsPlugin.getLogger());
+ for (String type : StateMachineArtifact.getAllSMATypeNames()) {
+ monitor.subTask("Loading " + type + "...");
+ try {
+ // just need to load the aritfacts for them to exception out
+ ArtifactPersistenceManager.getInstance().getArtifactsFromSubtypeName(type,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ rd.logError(ex.getLocalizedMessage());
+ }
+ }
+ rd.report(name);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/DuplicateUsersItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/DuplicateUsersItem.java
new file mode 100644
index 00000000000..c0fa02bdb84
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/DuplicateUsersItem.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.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.BranchPersistenceManager;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DuplicateUsersItem extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public DuplicateUsersItem(XNavigateItem parent) {
+ super(parent, "Report Duplicate Users in DB");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ 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 {
+ XResultData rd = new XResultData(AtsPlugin.getLogger());
+ Set<User> users = new HashSet<User>();
+ for (Artifact user : ArtifactPersistenceManager.getInstance().getArtifactsFromSubtypeName("User",
+ BranchPersistenceManager.getInstance().getAtsBranch())) {
+ if (!users.add((User) user)) {
+ User otherUser = null;
+ for (User userArt : users)
+ if (userArt.equals(user)) {
+ otherUser = userArt;
+ break;
+ }
+ rd.logError("Duplicate User => " + ((User) user).getUserId() + " " + user.getHumanReadableId() + " and " + otherUser.getUserId() + " " + otherUser.getHumanReadableId());
+ }
+ }
+ rd.report(getName());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/InvalidEstimatedHoursAttribute.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/InvalidEstimatedHoursAttribute.java
new file mode 100644
index 00000000000..17a04912a20
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/InvalidEstimatedHoursAttribute.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.health;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class InvalidEstimatedHoursAttribute extends XNavigateItemAction {
+
+ private boolean fix = true;
+
+ /**
+ * @param parent
+ */
+ public InvalidEstimatedHoursAttribute(XNavigateItem parent) {
+ super(parent, "Report Invalid Estimated Hours Attribute");
+ }
+
+ @Override
+ public void run() throws SQLException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new Report(getName()), true);
+ }
+
+ public class Report extends Job {
+
+ private final String name;
+
+ public Report(String name) {
+ super(name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ final XResultData rd = new XResultData(AtsPlugin.getLogger());
+ try {
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+
+ // Get Team and Task artifacts
+ java.util.Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ artTypeNames.add(TaskArtifact.ARTIFACT_NAME);
+ for (String artType : artTypeNames)
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ Collection<Artifact> artifacts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ int x = 0;
+ for (Artifact art : artifacts) {
+ monitor.subTask(String.format("Processing %d/%d...", x++, artifacts.size()));
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ String value = sma.getSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName());
+ if (value != null && !value.equals("")) {
+ try {
+ new Float(value).doubleValue();
+ } catch (NumberFormatException ex) {
+ rd.logError("HRID " + art.getHumanReadableId() + " has invalid float \"" + value + "\"");
+ if (fix) {
+ sma.setSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), "0");
+ sma.persist(true);
+ rd.logError("Fixed error by changing estimate to 0.");
+ }
+ }
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ rd.logError(ex.getLocalizedMessage());
+ }
+ rd.report(name);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/OrphanedTasks.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/OrphanedTasks.java
new file mode 100644
index 00000000000..3e4419b5e35
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/OrphanedTasks.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.health;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+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.TaskArtifact;
+import org.eclipse.osee.ats.world.WorldView;
+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.BranchPersistenceManager;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class OrphanedTasks extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ */
+ public OrphanedTasks(XNavigateItem parent) {
+ super(parent, "Report Orphaned Tasks");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new LoadArtifactsJob(getName()), true);
+ }
+
+ public class LoadArtifactsJob extends Job {
+
+ private final String name;
+
+ public LoadArtifactsJob(String name) {
+ super(name);
+ this.name = name;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ final XResultData rd = new XResultData(AtsPlugin.getLogger());
+ final List<TaskArtifact> orphanedTasks = new ArrayList<TaskArtifact>();
+ try {
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifactsFromSubtypeName(TaskArtifact.ARTIFACT_NAME,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ int x = 0;
+ for (Artifact art : arts) {
+ TaskArtifact taskArt = (TaskArtifact) art;
+ monitor.subTask("Checking task " + x++ + "/" + arts.size() + " - " + art.getHumanReadableId());
+ if (taskArt.getParentSMA() == null) {
+ orphanedTasks.add(taskArt);
+ rd.logError("Orphaned => " + taskArt.getHumanReadableId());
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ rd.logError(ex.getLocalizedMessage());
+ }
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ rd.report(name);
+ WorldView.loadIt("Orphaned Tasks", orphanedTasks);
+ }
+ });
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TeamWorkflowsHaveZeroOrOneVersion.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TeamWorkflowsHaveZeroOrOneVersion.java
new file mode 100644
index 00000000000..5feb42fb5bf
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/TeamWorkflowsHaveZeroOrOneVersion.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.health;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorkflowsHaveZeroOrOneVersion extends XNavigateItemAction {
+
+ boolean fixIt = false;
+
+ /**
+ * @param parent
+ */
+ public TeamWorkflowsHaveZeroOrOneVersion(XNavigateItem parent) {
+ super(parent, "Report Team Workflows have > 1 version.");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ if (!MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getName(), getName())) return;
+ Jobs.startJob(new ReportCompletedWorkflowsJob(getName()), true);
+ }
+
+ private final class ReportCompletedWorkflowsJob extends Job {
+
+ public ReportCompletedWorkflowsJob(String jobName) {
+ super(jobName);
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ try {
+ SearchWorkFlowsTx searchWorkFlowsTx =
+ new SearchWorkFlowsTx(BranchPersistenceManager.getInstance().getAtsBranch(), getName(), monitor);
+ searchWorkFlowsTx.execute();
+ toReturn = Status.OK_STATUS;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ toReturn = new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getLocalizedMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return toReturn;
+ }
+ }
+
+ private final class SearchWorkFlowsTx extends AbstractSkynetTxTemplate {
+ private XResultData rd;
+ private String jobName;
+ private IProgressMonitor monitor;
+
+ public SearchWorkFlowsTx(Branch branch, String jobName, IProgressMonitor monitor) {
+ super(branch);
+ this.rd = new XResultData(AtsPlugin.getLogger());
+ this.jobName = jobName;
+ this.monitor = monitor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.transaction.AbstractTxTemplate#handleTxWork()
+ */
+ @Override
+ protected void handleTxWork() throws Exception {
+ monitor.subTask("Searching Team Workflows...");
+
+ // Get Team artifacts
+ List<ISearchPrimitive> artifactTypeCriteria = new LinkedList<ISearchPrimitive>();
+ java.util.Set<String> artTypeNames = TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames();
+ for (String artType : artTypeNames)
+ artifactTypeCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(artifactTypeCriteria, false, getTxBranch());
+
+ int x = 0;
+
+ for (Artifact art : arts) {
+ monitor.subTask(String.format("Processing %d/%d...", x++, arts.size()));
+ TeamWorkFlowArtifact teamArt = (TeamWorkFlowArtifact) art;
+ if (teamArt.getArtifacts(RelationSide.TeamWorkflowTargetedForVersion_Version).size() > 1) {
+ rd.logError("Team workflow " + teamArt.getHumanReadableId() + " has " + teamArt.getArtifacts(
+ RelationSide.TeamWorkflowTargetedForVersion_Version).size() + " versions");
+ }
+ }
+ rd.report(jobName);
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/UnAssignedAssignedAtsObjects.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/UnAssignedAssignedAtsObjects.java
new file mode 100644
index 00000000000..917b6e24362
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/health/UnAssignedAssignedAtsObjects.java
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.skynet.core.user.UserEnum;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+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.xresults.XResultData;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UnAssignedAssignedAtsObjects extends XNavigateItemAction {
+
+ boolean fixIt = false;
+ XResultData rd = new XResultData(AtsPlugin.getLogger());
+
+ /**
+ * @param parent
+ */
+ public UnAssignedAssignedAtsObjects(XNavigateItem parent) {
+ super(parent, "Report UnAssigned AND Assigned / NoOne Assigned (partial fix available)");
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ 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) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ try {
+ if (fixIt) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ getUnassignedAtsObjectHelper();
+ }
+ };
+ txWrapper.execute();
+
+ } else {
+ getUnassignedAtsObjectHelper();
+ }
+ toReturn = Status.OK_STATUS;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ toReturn = new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return toReturn;
+ }
+ }
+
+ private void getUnassignedAtsObjectHelper() throws Exception {
+ User unAssignedUser = SkynetAuthentication.getInstance().getUser(UserEnum.UnAssigned);
+ User noOneUser = SkynetAuthentication.getInstance().getUser(UserEnum.NoOne);
+ final XResultData rd = new XResultData(AtsPlugin.getLogger());
+
+ for (Artifact art : StateMachineArtifact.getAllSMATypeArtifacts()) {
+ StateMachineArtifact sma = (StateMachineArtifact) art;
+ SMAManager smaMgr = new SMAManager(sma);
+ if (smaMgr.getAssignees().size() > 1) {
+ if (smaMgr.getAssignees().contains(unAssignedUser)) {
+ rd.logError(art.getHumanReadableId() + " is unassigned and assigned => " + Artifacts.commaArts(smaMgr.getAssignees()));
+ if (fixIt) {
+ SMAState state = smaMgr.getSMAState();
+ state.removeAssignee(unAssignedUser);
+ smaMgr.getCurrentStateDam().setState(state);
+ }
+ }
+ }
+ for (SMAState state : smaMgr.getStateDam().getStates()) {
+ if (state.getAssignees().size() > 1 && state.getAssignees().contains(unAssignedUser)) {
+ rd.logError(art.getHumanReadableId() + " state " + state.getName() + " is unassigned and assigned => " + Artifacts.commaArts(state.getAssignees()));
+ if (fixIt) {
+ state.removeAssignee(unAssignedUser);
+ smaMgr.getStateDam().setState(state);
+ }
+ }
+ }
+ if (smaMgr.getAssignees().contains(noOneUser)) {
+ rd.logError(art.getHumanReadableId() + " is assigned to NoOne; invalid assignment - MANUAL FIX REQUIRED");
+ }
+ if (sma.isDirty()) {
+ sma.persist();
+ }
+ rd.report(getName());
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.java
new file mode 100644
index 00000000000..44a2b2f0f2a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperItem.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.hyper;
+
+import java.util.ArrayList;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.swt.graphics.Image;
+
+public class ActionHyperItem extends HyperViewItem {
+
+ private final IHyperArtifact artifact;
+
+ public ActionHyperItem(IHyperArtifact artifact) {
+ super(artifact.getHyperName());
+ this.artifact = artifact;
+ setGuid(artifact.getGuid());
+ }
+
+ public Image getImage() {
+ if (artifact.isDeleted()) return null;
+ return artifact.getHyperImage();
+ }
+
+ @Override
+ public String getTitle() {
+ if (artifact.isDeleted()) return "Deleted";
+ return artifact.getHyperName();
+ }
+
+ @Override
+ public String getToolTip() {
+ if (artifact.isDeleted()) return "";
+ StringBuilder builder = new StringBuilder();
+ builder.append("Type: " + ((IHyperArtifact) artifact).getHyperType());
+ if (artifact instanceof IHyperArtifact) {
+ builder.append("\nState: " + ((IHyperArtifact) artifact).getHyperState());
+ builder.append("\nAssignee: " + ((IHyperArtifact) artifact).getHyperAssignee());
+ }
+ return builder.toString();
+ }
+
+ @Override
+ public Image getMarkImage() {
+ if (artifact.isDeleted()) return null;
+ if (artifact instanceof IHyperArtifact) return ((IHyperArtifact) artifact).getHyperAssigneeImage();
+ 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 artifact;
+ }
+
+ public Artifact getArtifact() {
+ return artifact.getHyperArtifact();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
new file mode 100644
index 00000000000..87f85adc17f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionHyperView.java
@@ -0,0 +1,297 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.logging.Level;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.osee.ats.ActionDebug;
+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.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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.OSEELog;
+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, IEventReceiver, 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;
+ private SkynetEventManager eventManager;
+ private ActionDebug debug = new ActionDebug(false, "ActionHyperView");
+
+ public ActionHyperView() {
+ super();
+ debug.report("ActionHyperView");
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(this);
+ setNodeColor(whiteColor);
+ setCenterColor(whiteColor);
+ setVerticalSelection(45);
+ eventManager = SkynetEventManager.getInstance();
+ }
+
+ @Override
+ public void createPartControl(Composite top) {
+ debug.report("createPartControl");
+ 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);
+ }
+
+ 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() {
+ super.dispose();
+ eventManager.unRegisterAll(this);
+ }
+
+ @Override
+ public void handleItemDoubleClick(HyperViewItem hvi) {
+ Artifact art = ((ActionHyperItem) hvi).getArtifact();
+ if (art.isDeleted()) {
+ AWorkbench.popup("ERROR", "Artifact has been deleted");
+ return;
+ }
+ getContainer().setCursor(new Cursor(null, SWT.CURSOR_WAIT));
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+
+ @Override
+ public void display() {
+ try {
+ getContainer().setCursor(new Cursor(null, SWT.NONE));
+ debug.report("display");
+ eventManager.unRegisterAll(this);
+ if (currentArtifact == null || currentArtifact.isDeleted()) return;
+ eventManager.register(RemoteTransactionEvent.class, this);
+ eventManager.register(LocalTransactionEvent.class, this);
+ ATSArtifact topArt = getTopArtifact(currentArtifact);
+ if (topArt == null || topArt.isDeleted()) return;
+ topAHI = new ActionHyperItem(topArt);
+ if (topArt instanceof ActionArtifact) {
+ for (TeamWorkFlowArtifact pia : ((ActionArtifact) topArt).getTeamWorkFlowArtifacts()) {
+ ActionHyperItem productAHI = new ActionHyperItem(pia);
+ productAHI.setRelationToolTip("Team");
+ topAHI.addBottom(productAHI);
+ }
+ }
+
+ if (activeEditorIsActionEditor()) setCurrentArtifact();
+ create(topAHI);
+ } catch (SQLException ex) {
+ clear();
+ }
+ }
+
+ public void setCurrentArtifact() {
+ debug.report("setCurrentArtifact");
+ if (currentArtifact.equals(topAHI.getArtifact()))
+ topAHI.setCurrent(true);
+ else {
+ topAHI.setCurrent(false);
+ }
+ for (ActionHyperItem child : topAHI.getChildren()) {
+ if (child.getArtifact().equals(currentArtifact))
+ child.setCurrent(true);
+ else
+ child.setCurrent(false);
+ for (ActionHyperItem childChild : child.getChildren()) {
+ if (childChild.getArtifact().equals(currentArtifact))
+ childChild.setCurrent(true);
+ else
+ childChild.setCurrent(false);
+ }
+ }
+ }
+
+ public ATSArtifact getTopArtifact(ATSArtifact art) throws SQLException {
+ debug.report("getTopArtifact");
+ 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)) {
+ currentArtifact = (ATSArtifact) ((SMAEditor) editor).getSmaMgr().getSma();
+ display();
+ } else
+ super.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();
+ }
+
+ 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();
+ }
+
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#onEvent(org.eclipse.osee.framework.jdk.core.event.Event)
+ */
+ public void onEvent(Event event) {
+ debug.report("onEvent");
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(currentArtifact);
+ if (ed.isRemoved()) {
+ clear();
+ } else if (ed.getAvie() != null && ed.getAvie().getOldVersion().equals(currentArtifact)) {
+ currentArtifact = (StateMachineArtifact) ed.getAvie().getNewVersion();
+ display();
+ } else if (ed.getAvie() != null || ed.isModified() || ed.isRelChange()) {
+ display();
+ }
+ } else
+ logger.log(Level.SEVERE, "Unexpected event => " + event);
+ }
+
+ /*
+ * (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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
new file mode 100644
index 00000000000..beaeb7ad1a8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ActionSkyWalker.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+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, IEventReceiver, 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});
+ }
+
+ /*
+ * (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() {
+ public void run() {
+ redraw();
+ }
+ };
+ action.setText("Refresh");
+ action.setToolTipText("Refresh");
+ action.setImageDescriptor(SkynetGuiPlugin.getInstance().getImageDescriptor("refresh.gif"));
+ tbm.add(action);
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+
+ /*
+ * (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) {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ 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));
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, this);
+ } catch (SQLException ex) {
+ clear();
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+ }
+
+ public ATSArtifact getTopArtifact(ATSArtifact art) throws SQLException {
+ 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((ATSArtifact) ((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();
+ }
+
+ 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");
+ }
+
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#onEvent(org.eclipse.osee.framework.jdk.core.event.Event)
+ */
+ public void onEvent(Event event) {
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(getOptions().getArtifact());
+ if (ed.isRemoved()) {
+ clear();
+ } else if (ed.getAvie() != null && ed.getAvie().getOldVersion().equals(getOptions().getArtifact())) {
+ explore((StateMachineArtifact) ed.getAvie().getNewVersion());
+ } else if (ed.getAvie() != null || ed.isModified() || ed.isRelChange()) {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.java
new file mode 100644
index 00000000000..03cad5ae392
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperItem.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.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
new file mode 100644
index 00000000000..6371df3858a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/ArtifactHyperView.java
@@ -0,0 +1,342 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.artifact.ATSArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAEditor;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.skynet.core.relation.IRelationLink;
+import org.eclipse.osee.framework.skynet.core.relation.RelationLinkGroup;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.ats.IActionable;
+import org.eclipse.osee.framework.ui.skynet.ats.OseeAts;
+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 IEventReceiver, 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 SkynetEventManager eventManager;
+ private Action pinAction;
+
+ public ArtifactHyperView() {
+ super();
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(this);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(this);
+ setNodeColor(whiteColor);
+ setCenterColor(whiteColor);
+ eventManager = SkynetEventManager.getInstance();
+ 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) {
+ super.createPartControl(top);
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "ATS Action View");
+ }
+
+ @Override
+ public void handleItemDoubleClick(HyperViewItem hvi) {
+ currentArtifact = ((ArtifactHyperItem) hvi).getArtifact();
+ display();
+ }
+
+ public void load(Artifact artifact) {
+ currentArtifact = artifact;
+ display();
+ }
+
+ @Override
+ public void display() {
+ try {
+ eventManager.unRegisterAll(this);
+ if (currentArtifact == null) return;
+ eventManager.register(RemoteTransactionEvent.class, this);
+ eventManager.register(LocalTransactionEvent.class, this);
+ topAHI = new ArtifactHyperItem(currentArtifact);
+ // System.out.println("Artifact "+currentArtifact.getArtifactTypeNameShort());
+ int x = 0;
+ for (RelationLinkGroup grp : currentArtifact.getLinkManager().getGroups()) {
+ debug.report("relation " + grp.getDescriptor().getName());
+
+ for (IRelationLink link : grp.getGroupSide()) {
+ // Don't process link if onlyShowRel is populated and doesn't contain link name
+ if (onlyShowRelations.size() > 0) {
+ if (!onlyShowRelations.contains(link.getLinkDescriptor().getName())) 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 = grp.getDescriptor().getName();
+ if (!link.getRationale().equals("")) tip += "(" + link.getRationale() + ")";
+ ahi.setRelationToolTip(tip);
+ String label =
+ (isShowOrder() ? "(" + thisOrder + ") " : "") + grp.getDescriptor().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 (SQLException ex) {
+ clear();
+ }
+ }
+
+ @Override
+ protected void handleRefreshButton() {
+ display();
+ }
+
+ @Override
+ public void dispose() {
+ super.dispose();
+ eventManager.unRegisterAll(this);
+ }
+
+ 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 = (ATSArtifact) ((SMAEditor) editor).getSmaMgr().getSma();
+ load(currentArtifact);
+ }
+ }
+ }
+
+ public void partActivated(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this))
+ dispose();
+ else
+ handleWindowChange();
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ handleWindowChange();
+ }
+
+ @Override
+ protected void createActions() {
+ super.createActions();
+
+ pinAction = new Action("Pin Viewer", Action.AS_CHECK_BOX) {
+
+ 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") {
+
+ 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) {
+
+ public void run() {
+ MultipleHridSearchItem gsi = new MultipleHridSearchItem();
+ try {
+ Collection<Artifact> arts = gsi.performSearchGetResults(true, false);
+ if (arts.size() == 0) {
+ AWorkbench.popup("ERROR", "No Artifacts Found");
+ return;
+ }
+ load(arts.iterator().next());
+ } catch (Exception ex) {
+ logger.log(Level.SEVERE, ex.toString(), 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 "";
+ }
+
+ public void onEvent(Event event) {
+
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(currentArtifact);
+ if (ed.isRemoved()) {
+ clear();
+ } else if (ed.getAvie() != null && ed.getAvie().getOldVersion().equals(currentArtifact)) {
+ currentArtifact = (StateMachineArtifact) ed.getAvie().getNewVersion();
+ display();
+ } else if (ed.getAvie() != null || ed.isModified() || ed.isRelChange()) {
+ display();
+ }
+ } else
+ logger.log(Level.SEVERE, "Unexpected event => " + event);
+ }
+
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (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();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
new file mode 100644
index 00000000000..21561862efb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperView.java
@@ -0,0 +1,1052 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Vector;
+import java.util.logging.Logger;
+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.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandler;
+import org.eclipse.osee.framework.ui.skynet.SkynetContributionItem;
+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 Vector<PolylineConnection> connectors = new Vector<PolylineConnection>(); // PolylineConnection
+ private 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 Cursor hCursor = null;
+ private Menu popupMenu;
+ private Menu connectPopupMenu;
+ /* Full circle is (2*Math.PI) */
+ private double quadrant = ((2 * Math.PI) / 4);
+ /* Each quadrant is 90 degrees */
+ private double oneEighthCircle = quadrant / 2; /* Start 45 degrees off 0 */
+ private double bottomQuadrantStart = oneEighthCircle;
+ private double topQuadrantStart = oneEighthCircle + (2 * quadrant);
+ private double leftQuadrantStart = oneEighthCircle + quadrant;
+ private 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 ActionDebug debug = new ActionDebug(false, "HV");
+ protected static Logger logger = ConfigUtil.getConfigFactory().getLogger(HyperView.class);
+ 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;
+
+ 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.
+ */
+ public void createPartControl(Composite parent) {
+ debug.report("createPartControl");
+
+ if (ConnectionHandler.isOpen()) SkynetContributionItem.addTo(this, true);
+
+ 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 (((HyperViewItem) 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++) {
+ ((PolylineConnection) 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, ((NodeFigure) 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() {
+
+ 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();
+ try {
+ artA.getLinkManager().persistLinks();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ connectPopupMenu.dispose();
+ connectPopupMenu = null;
+ display();
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ 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() + " " + figure.hashCode()));
+ 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 = (HyperViewItem) nf.getSearchItem();
+ handleItemDoubleClick(si);
+ }
+ }
+
+ public void mousePressed(MouseEvent e) {
+ // System.out.println("mousePressed");
+ // if (e.getSource() instanceof NodeFigure) {
+ // NodeFigure nf = (NodeFigure) e.getSource();
+ // switch (e.button) {
+ // case 1:
+ // if (nf == centerFigure) {
+ // hCursor = new Cursor(null, SWT.CURSOR_HAND);
+ // container.setCursor(hCursor);
+ // nf.setCursor(hCursor);
+ // dragCenter = true;
+ // }
+ // break;
+ // case 3:
+ // break;
+ // }
+ // }
+ }
+
+ 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 = (HyperViewItem) nf.getSearchItem();
+ debug.report("Click: " + si.getTitle());
+ if (e.button == 3) {
+ createMenuBar(si);
+ }
+ }
+ }
+ };
+ figure.addMouseListener(mouseListener);
+ }
+
+ public void handleItemDoubleClick(HyperViewItem hvi) {
+ 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() {
+
+ 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() {
+
+ 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 (SQLException 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() {
+
+ 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() {
+
+ public void run() {
+ center();
+ }
+ };
+ centerAction.setText("Center");
+ centerAction.setToolTipText("Center");
+ centerAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("center.gif"));
+
+ if (provideBackForwardActions()) {
+ // Back Action
+ backAction = new Action() {
+
+ public void run() {
+ printBackList("pre backSelected");
+ if (backList.size() == 0) {
+ return;
+ }
+ if (backListIndex > 0) {
+ backListIndex--;
+ }
+ jumpTo((HyperViewItem) 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() {
+
+ public void run() {
+ printBackList("pre forwardSelected");
+ if (backList.size() - 1 > backListIndex) {
+ backListIndex++;
+ jumpTo((HyperViewItem) 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() {
+
+ 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() {
+
+ 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) {
+
+ public void run() {
+ debug.report("expandTitles");
+ refresh();
+ }
+ };
+ titleAction.setToolTipText("Expand Titles");
+
+ Action refreshAction = new Action("Refresh") {
+
+ 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) {
+
+ 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.
+ */
+ 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;
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/HyperViewItem.java
new file mode 100644
index 00000000000..1488f36bd35
--- /dev/null
+++ b/MS_0.1.4_20080103/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.IRelationLink;
+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 IRelationLink 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 IRelationLink getLink() {
+ return link;
+ }
+
+ public void setLink(IRelationLink link) {
+ this.link = link;
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/hyper/IHyperArtifact.java
new file mode 100644
index 00000000000..57e7312fb3f
--- /dev/null
+++ b/MS_0.1.4_20080103/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();
+
+ public Artifact getHyperArtifact();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.java
new file mode 100644
index 00000000000..6aaeeeba505
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ArtifactImpactToActionSearchItem.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.navigate;
+
+import java.sql.SQLException;
+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.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch.SearchOperator;
+import org.eclipse.osee.framework.skynet.core.revision.RevisionManager;
+import org.eclipse.osee.framework.skynet.core.revision.TransactionData;
+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.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() throws SQLException {
+ EntryDialog ed =
+ new EntryDialog(
+ getName(),
+ "Searching on current default branch \"" + BranchPersistenceManager.getInstance().getDefaultBranch().getBranchName() + "\"\n\nEnter Artifact Name (or string) to search");
+ 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(AtsPlugin.getLogger());
+
+ 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.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
+
+ private void getMatrixItems() throws SQLException {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(null, artifactName,
+ BranchPersistenceManager.getInstance().getDefaultBranch(), SearchOperator.LIKE);
+ Collection<Artifact> srchArts = srch.getArtifacts(Artifact.class);
+ if (srchArts.size() == 0) return;
+ int x = 1;
+ rd.log("Searching for \"" + artifactName + "\"on current default branch \"" + BranchPersistenceManager.getInstance().getDefaultBranch().getBranchName() + "\"");
+ rd.log("Found " + srchArts.size() + " matching artifacts.");
+ for (Artifact srchArt : srchArts) {
+ String str = String.format("Processing %d/%d - %s ", x++, srchArts.size(), srchArt.getDescriptiveName());
+ System.out.println(str);
+ rd.log("\n" + AHTML.bold(srchArt.getDescriptiveName()));
+ monitor.subTask(str);
+ Collection<TransactionData> transactions =
+ RevisionManager.getInstance().getTransactionsPerArtifact(srchArt, true);
+ int y = 1;
+ boolean found = false;
+ StringBuffer sb = new StringBuffer();
+ sb.append(AHTML.beginMultiColumnTable(95, 1));
+ sb.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "HRID", "Title"}));
+ for (TransactionData transData : transactions) {
+ String transStr = String.format("Tranaction %d/%d", y++, transactions.size());
+ System.out.println(transStr);
+ monitor.subTask(transStr);
+ if (transData.getCommitArtId() > 0) {
+ Artifact assocArt =
+ ArtifactPersistenceManager.getInstance().getArtifactFromId(transData.getCommitArtId(),
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (assocArt instanceof TeamWorkFlowArtifact) {
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {assocArt.getArtifactTypeName(),
+ assocArt.getHumanReadableId(), assocArt.getDescriptiveName()}));
+ found = true;
+ }
+ }
+ }
+ sb.append(AHTML.endMultiColumnTable());
+ if (found)
+ rd.addRaw(sb.toString().replaceAll("\n", ""));
+ else
+ rd.log(" No Action Changes Found");
+ }
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
new file mode 100644
index 00000000000..abe416fee74
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateComposite.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.world.WorldView;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandler;
+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;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * @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);
+ if (!ConnectionHandler.isConnected()) {
+ (new Label(parent, SWT.NONE)).setText("DB Connection Unavailable");
+ return;
+ }
+ }
+
+ @Override
+ protected void handleDoubleClick() {
+ IStructuredSelection sel = (IStructuredSelection) filteredTree.getViewer().getSelection();
+ if (!sel.iterator().hasNext()) return;
+ XNavigateItem item = (XNavigateItem) sel.iterator().next();
+ if (item instanceof SearchNavigateItem)
+ openWorld(((SearchNavigateItem) item).getWsi());
+ else
+ super.handleDoubleClick();
+ }
+
+ public static void openWorld(WorldSearchItem searchItem) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ WorldView worldView = (WorldView) page.showView(WorldView.VIEW_ID);
+ worldView.loadTable(searchItem, true);
+ } catch (PartInitException e1) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error",
+ "Couldn't Launch Search View " + e1.getMessage());
+ }
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
new file mode 100644
index 00000000000..12119f3f8e0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/AtsNavigateViewItems.java
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.LinkedList;
+import java.util.List;
+import java.util.Map;
+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.ActionArtifact;
+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.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.health.ActionsHaveOneTeam;
+import org.eclipse.osee.ats.health.AssignedActiveActions;
+import org.eclipse.osee.ats.health.AttributeDuplication;
+import org.eclipse.osee.ats.health.DuplicateUsersItem;
+import org.eclipse.osee.ats.health.InvalidEstimatedHoursAttribute;
+import org.eclipse.osee.ats.health.OrphanedTasks;
+import org.eclipse.osee.ats.health.TeamWorkflowsHaveZeroOrOneVersion;
+import org.eclipse.osee.ats.health.UnAssignedAssignedAtsObjects;
+import org.eclipse.osee.ats.navigate.EmailTeamsItem.MemberType;
+import org.eclipse.osee.ats.report.ExtendedStatusReportItem;
+import org.eclipse.osee.ats.world.search.ActionableItemWorldSearchItem;
+import org.eclipse.osee.ats.world.search.AtsAttributeSearchItem;
+import org.eclipse.osee.ats.world.search.CriteriaSearchItem;
+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.MyTaskSearchItem;
+import org.eclipse.osee.ats.world.search.MyTeamWFSearchItem;
+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.TeamVersionWorldSearchItem;
+import org.eclipse.osee.ats.world.search.TeamWorldSearchItem;
+import org.eclipse.osee.ats.world.search.UnReleasedTeamWorldSearchItem;
+import org.eclipse.osee.ats.world.search.UserCommunitySearchItem;
+import org.eclipse.osee.ats.world.search.VersionTargetedForTeamSearchItem;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandler;
+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.XNavigateViewItems;
+import org.osgi.framework.Bundle;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsNavigateViewItems extends XNavigateViewItems {
+ private static AtsNavigateViewItems navigateItems = new AtsNavigateViewItems();
+ private SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+
+ public AtsNavigateViewItems() {
+ super();
+ }
+
+ public static AtsNavigateViewItems getInstance() {
+ return navigateItems;
+ }
+
+ public WorldSearchItem getMyWorldSearchItem() {
+ return new MyWorldSearchItem("My World", skynetAuth.getAuthenticatedUser());
+ }
+
+ public List<XNavigateItem> getSearchNavigateItems() {
+ List<XNavigateItem> items = new ArrayList<XNavigateItem>();
+
+ if (!ConnectionHandler.isConnected()) return items;
+
+ items.add(new XNavigateItemAction(null, new NewAction()));
+
+ LinkedList<ISearchPrimitive> criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new ArtifactTypeSearch(ActionArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ items.add(new SearchNavigateItem(null, new MyWorldSearchItem("My World", skynetAuth.getAuthenticatedUser())));
+ items.add(new SearchNavigateItem(null, new MyFavoritesSearchItem("My Favorites",
+ skynetAuth.getAuthenticatedUser())));
+ items.add(new SearchNavigateItem(null, new MyReviewWorkflowItem("My Reviews", skynetAuth.getAuthenticatedUser())));
+
+ items.add(new VisitedItems(null));
+
+ XNavigateItem otherItems = new XNavigateItem(null, "Other My Searches");
+ new SearchNavigateItem(otherItems, new MyTeamWFSearchItem("My Team Workflows", skynetAuth.getAuthenticatedUser()));
+ new SearchNavigateItem(otherItems, new MyTaskSearchItem("My Task", skynetAuth.getAuthenticatedUser()));
+ new SearchNavigateItem(otherItems, new MySubscribedSearchItem("My Subscribed", skynetAuth.getAuthenticatedUser()));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("My Originator - InWork",
+ skynetAuth.getAuthenticatedUser(), true));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("My Originator - All", skynetAuth.getAuthenticatedUser(),
+ false));
+ new SearchNavigateItem(otherItems, new MyCompletedSearchItem("My Completed", skynetAuth.getAuthenticatedUser()));
+ items.add(otherItems);
+
+ otherItems = new XNavigateItem(null, "Other User Searches");
+ new SearchNavigateItem(otherItems, new MyWorldSearchItem("User's World"));
+ new SearchNavigateItem(otherItems, new MyReviewWorkflowItem("User's Reviews"));
+ new SearchNavigateItem(otherItems, new MyTeamWFSearchItem("User's Team Workflows"));
+ new SearchNavigateItem(otherItems, new MyTaskSearchItem("User's Tasks"));
+ new SearchNavigateItem(otherItems, new MyOrigSearchItem("User's Originator"));
+ new SearchNavigateItem(otherItems, new MyCompletedSearchItem("User's Completed"));
+ new SearchNavigateItem(otherItems, new MyFavoritesSearchItem("User's Favorites"));
+ new SearchNavigateItem(otherItems, new MySubscribedSearchItem("User's Subscribed"));
+ items.add(otherItems);
+
+ items.add(new SearchNavigateItem(null, new GroupWorldSearchItem()));
+ items.add(new SearchNavigateItem(null, new UserCommunitySearchItem()));
+
+ XNavigateItem aiTeam = new XNavigateItem(null, "Actionable Items");
+ new SearchNavigateItem(aiTeam, new ActionableItemWorldSearchItem("Actionable Item Actions", (String[]) null,
+ false, true, false));
+ items.add(aiTeam);
+
+ XNavigateItem teamItem = new XNavigateItem(null, "Teams");
+ new SearchNavigateItem(teamItem, new TeamWorldSearchItem("Team Actions", (String[]) null, false, true, false,
+ null));
+ new SearchNavigateItem(teamItem, new TeamVersionWorldSearchItem("Team Actions by Version", (String[]) null,
+ false, false, false, null));
+ new SearchNavigateItem(teamItem, new UnReleasedTeamWorldSearchItem("Un-Released Team Actions", (String[]) null,
+ true, true, false));
+ new MassEditTeamVersionItem("Show Team Versions", teamItem, "");
+ items.add(teamItem);
+
+ XNavigateItem releaseItems = new XNavigateItem(null, "Versions");
+ new MassEditTeamVersionItem("Edit Versions", releaseItems, (TeamDefinitionArtifact) null);
+ new SearchNavigateItem(releaseItems, new VersionTargetedForTeamSearchItem(null, null, false));
+ new SearchNavigateItem(releaseItems, new NextVersionSearchItem(null));
+ 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",
+ Arrays.asList(new String[] {DecisionReviewArtifact.ARTIFACT_NAME}), false, false));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Workflows Waiting " + DecisionReviewArtifact.ARTIFACT_NAME + "s",
+ Arrays.asList(new String[] {DecisionReviewArtifact.ARTIFACT_NAME}), false, true));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Open " + PeerToPeerReviewArtifact.ARTIFACT_NAME + "s",
+ Arrays.asList(new String[] {PeerToPeerReviewArtifact.ARTIFACT_NAME}), false, false));
+ new SearchNavigateItem(reviewItem, new ShowOpenWorkflowsByArtifactType(
+ "Show Workflows Waiting " + PeerToPeerReviewArtifact.ARTIFACT_NAME + "s",
+ Arrays.asList(new String[] {PeerToPeerReviewArtifact.ARTIFACT_NAME}), false, true));
+ new NewPeerToPeerReviewItem(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 SearchNavigateItem(null, new MultipleHridSearchItem()));
+ 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");
+ XNavigateItem atsReportItems =
+ 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);
+ items.add(emailItems);
+
+ items.add(reportItems);
+
+ XNavigateItem importItems = new XNavigateItem(null, "Import");
+ new ImportActionsViaSpreadsheet(importItems);
+ items.add(importItems);
+
+ if (AtsPlugin.isAtsAdmin()) {
+ XNavigateItem adminItems = new XNavigateItem(null, "Admin");
+
+ new KickoffOSEEItem(adminItems);
+
+ criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new ArtifactTypeSearch(ActionArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ new SearchNavigateItem(adminItems, new CriteriaSearchItem("Admin - Actions", criteria, true));
+
+ criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new ArtifactTypeSearch(DecisionReviewArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ new SearchNavigateItem(adminItems, new CriteriaSearchItem("Admin - Decision Review", criteria, true));
+
+ criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new ArtifactTypeSearch(PeerToPeerReviewArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ new SearchNavigateItem(adminItems, new CriteriaSearchItem("Admin - PeerToPeer Review", criteria, true));
+
+ criteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtifactName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ criteria.add(new ArtifactTypeSearch(teamArtifactName, Operator.EQUAL));
+ new SearchNavigateItem(adminItems, new CriteriaSearchItem("Admin - Teams", criteria, false));
+
+ criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new ArtifactTypeSearch(TaskArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ new SearchNavigateItem(adminItems, new CriteriaSearchItem("Admin - Tasks", criteria, true));
+
+ XNavigateItem healthItems = new XNavigateItem(adminItems, "Health");
+ new AttributeDuplication(healthItems);
+ new OrphanedTasks(healthItems);
+ new InvalidEstimatedHoursAttribute(healthItems);
+ new ActionsHaveOneTeam(healthItems);
+ new AssignedActiveActions(healthItems);
+ new DuplicateUsersItem(healthItems);
+ new TeamWorkflowsHaveZeroOrOneVersion(healthItems);
+ new UnAssignedAssignedAtsObjects(healthItems);
+
+ // new ActionNavigateItem(adminItems, new XViewerViewAction());
+ // new ActionNavigateItem(adminItems, new OpenEditorAction());
+ // new CreateBugFixesItem(adminItems);
+
+ items.add(adminItems);
+ }
+
+ return items;
+ }
+
+ @SuppressWarnings("deprecation")
+ 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.getSearchNavigateItems()) {
+ nameToNavItem.put(navItem.getName(), navItem);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Error loading AtsNavigateItem extension", ex, true);
+ }
+ }
+ }
+ // 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.java
new file mode 100644
index 00000000000..56c63bcdfc4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ConfigureDBForAts.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.sql.SQLException;
+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.config.ImportWorkflowAction;
+import org.eclipse.osee.ats.config.LoadAIsAndTeamsAction;
+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.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() throws SQLException {
+ 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 TeamWorkflows for " + pluginId);
+ (new ImportWorkflowAction(false, pluginId)).run();
+ monitor.subTask("Loading Actionable Items and Teams for " + pluginId);
+ (new LoadAIsAndTeamsAction(false, pluginId)).run();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.java
new file mode 100644
index 00000000000..352bcb80dea
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/CreateNewVersionItem.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.navigate;
+
+import java.sql.SQLException;
+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.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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.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() throws SQLException {
+ final TeamDefinitionArtifact teamDefHoldingVersions = getReleaseableTeamDefinitionArtifact();
+ 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 {
+ Branch branch = BranchPersistenceManager.getInstance().getAtsBranch();
+ new CreateNewVersionItemTx(branch, teamDefHoldingVersions, newVer).execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public TeamDefinitionArtifact getReleaseableTeamDefinitionArtifact() throws SQLException {
+ 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;
+ }
+
+ private final class CreateNewVersionItemTx extends AbstractSkynetTxTemplate {
+
+ private TeamDefinitionArtifact teamDefHoldingVersions;
+ private String newVersionName;
+
+ public CreateNewVersionItemTx(Branch branch, TeamDefinitionArtifact teamDefHoldingVersions, String newVer) {
+ super(branch);
+ this.teamDefHoldingVersions = teamDefHoldingVersions;
+ this.newVersionName = newVer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate#handleTxWork()
+ */
+ @Override
+ protected void handleTxWork() throws Exception {
+ VersionArtifact ver =
+ (VersionArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ VersionArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ ver.setDescriptiveName(newVersionName);
+ teamDefHoldingVersions.relate(RelationSide.TeamDefinitionToVersion_Version, ver);
+ ver.persist(true);
+ ArtifactEditor.editArtifact(ver);
+ }
+
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.java
new file mode 100644
index 00000000000..9f25ea8a51f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/EmailTeamsItem.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.navigate;
+
+import java.sql.SQLException;
+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.widgets.dialog.TeamDefinitionTreeWithChildrenDialog;
+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.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.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.swt.program.Program;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class EmailTeamsItem extends XNavigateItemAction {
+
+ private final TeamDefinitionArtifact teamDef;
+ private 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() throws SQLException {
+ Collection<TeamDefinitionArtifact> teamDefs = getTeamDefinitions();
+ if (teamDefs == null || 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.getArtifacts(RelationSide.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.getArtifacts(RelationSide.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 SQLException {
+ if (teamDef != null) {
+ return Artifacts.getChildrenOfTypeSet(teamDef, TeamDefinitionArtifact.class, true);
+ }
+ TeamDefinitionTreeWithChildrenDialog ld = new TeamDefinitionTreeWithChildrenDialog(Active.Active);
+ ld.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Active));
+ int result = ld.open();
+ if (result == 0) {
+ Set<TeamDefinitionArtifact> teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (Object obj : ld.getResult()) {
+ teamDefs.add((TeamDefinitionArtifact) obj);
+ teamDefs.addAll(Artifacts.getChildrenOfTypeSet((TeamDefinitionArtifact) obj, TeamDefinitionArtifact.class,
+ true));
+ }
+ return teamDefs;
+ }
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.java
new file mode 100644
index 00000000000..6ca24ae85f9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateFullVersionReportItem.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 java.sql.SQLException;
+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.util.VersionReportJob;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.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() throws SQLException {
+ 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 SQLException {
+ if (teamDef != null) return teamDef;
+ if (teamDefName != null && !teamDefName.equals("")) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, teamDefName,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ TeamDefinitionArtifact teamDef = srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class);
+ if (teamDef != null) return teamDef;
+ }
+ 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;
+ }
+
+ 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(AtsPlugin.getLogger());
+ rd.addRaw(html);
+ rd.report(getName(), Manipulations.RAW_HTML);
+ } catch (SQLException ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/GenerateVersionReportItem.java
new file mode 100644
index 00000000000..8ca2b4ea2a8
--- /dev/null
+++ b/MS_0.1.4_20080103/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 java.sql.SQLException;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class GenerateVersionReportItem extends XNavigateItemAction {
+
+ public GenerateVersionReportItem(XNavigateItem parent) {
+ super(parent, "Generate Version Report");
+ }
+
+ @Override
+ public void run() throws SQLException {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java
new file mode 100644
index 00000000000..5f39b964481
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/IAtsNavigateItem.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.ui.skynet.widgets.xnavigate.XNavigateItem;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IAtsNavigateItem {
+
+ public List<XNavigateItem> getSearchNavigateItems();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ImportActionsViaSpreadsheet.java
new file mode 100644
index 00000000000..d53fab94315
--- /dev/null
+++ b/MS_0.1.4_20080103/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 java.sql.SQLException;
+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.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() throws SQLException {
+ ActionImportWizard actionWizard = new ActionImportWizard();
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), actionWizard);
+ dialog.create();
+ dialog.open();
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/KickoffOSEEItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/KickoffOSEEItem.java
new file mode 100644
index 00000000000..aba98954def
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/KickoffOSEEItem.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.navigate;
+
+import java.sql.SQLException;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class KickoffOSEEItem extends XNavigateItemAction {
+
+ public KickoffOSEEItem(XNavigateItem parent) {
+ super(parent, "Kickoff OSEE");
+ }
+
+ @Override
+ public void run() throws SQLException {
+ // String command = "\"C:\\Program Files\\OSEE\\eclipse.exe\" -product org.eclipse.osee.framework.ui.product.osee"
+ // + " -showsplash org.eclipse.osee.framework.ui.product -data C:\\UserData\\workspace_autorun -vmargs -XX:MaxPermSize=256m -Xmx768M -DAtsAdmin -DEmailMe";
+ // try {
+ // Process child = Runtime.getRuntime().exec(command);
+ // } catch (IOException e) {
+ // }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.java
new file mode 100644
index 00000000000..ff65bca1cf9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/MassEditTeamVersionItem.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.navigate;
+
+import java.sql.SQLException;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MassEditTeamVersionItem extends XNavigateItemAction {
+
+ private final String teamDefName;
+ private final TeamDefinitionArtifact teamDef;
+
+ 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 SQLException {
+ if (teamDef != null) return teamDef;
+ if (teamDefName != null && !teamDefName.equals("")) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, teamDefName,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ TeamDefinitionArtifact teamDef = srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class);
+ if (teamDef != null) return teamDef;
+ }
+ 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;
+ }
+
+ @Override
+ public void run() throws SQLException {
+ TeamDefinitionArtifact teamDef = getTeamDefinition();
+ if (teamDef == null) return;
+ try {
+ if (teamDef.getTeamDefinitionHoldingVersions() == null) {
+ AWorkbench.popup("ERROR", "Team is not configured to use versions.");
+ return;
+ }
+ MassArtifactEditor.editArtifacts(getName(), teamDef.getTeamDefinitionHoldingVersions().getVersionsArtifacts());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.java
new file mode 100644
index 00000000000..180d343de7d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NavigateView.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.navigate;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.ActionDebug;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.NewAction;
+import org.eclipse.osee.ats.world.search.MultipleHridSearchItem;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandler;
+import org.eclipse.osee.framework.ui.skynet.SkynetContributionItem;
+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.xnavigate.XNavigateItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+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 ActionDebug debug = new ActionDebug(false, "NavigateView");
+ private AtsNavigateComposite xNavComp;
+
+ /**
+ * The constructor.
+ */
+ public NavigateView() {
+ }
+
+ public void setFocus() {
+ }
+
+ /*
+ * @see IWorkbenchPart#createPartControl(Composite)
+ */
+ public void createPartControl(Composite parent) {
+ debug.report("createPartControl");
+
+ try {
+ ConnectionHandler.getConnection();
+ } catch (Exception ex) {
+ (new Label(parent, SWT.NONE)).setText(" DB Connection Unavailable");
+ return;
+ }
+
+ SkynetContributionItem.addTo(this, true);
+
+ xNavComp = new AtsNavigateComposite(new AtsNavigateViewItems(), parent, SWT.NONE);
+
+ AtsPlugin.getInstance().setHelp(xNavComp, HELP_CONTEXT_ID);
+ createActions();
+ xNavComp.refresh();
+ xNavComp.getFilteredTree().getFilterControl().setFocus();
+ }
+
+ protected void createActions() {
+ debug.report("createActions");
+
+ Action collapseAction = new Action("Collapse All") {
+
+ public void run() {
+ xNavComp.getFilteredTree().getViewer().collapseAll();
+ }
+ };
+ collapseAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("collapseAll.gif"));
+ collapseAction.setToolTipText("Collapse All");
+
+ Action refreshAction = new Action("Refresh") {
+
+ public void run() {
+ xNavComp.refresh();
+ }
+ };
+ refreshAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("refresh.gif"));
+ refreshAction.setToolTipText("Refresh");
+
+ Action openByIdAction = new Action("Open by Id") {
+
+ public void run() {
+ MultipleHridSearchItem srch = new MultipleHridSearchItem();
+ try {
+ srch.performSearchGetResults(true, true);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+ openByIdAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("openId.gif"));
+ openByIdAction.setToolTipText("Open by Id");
+
+ IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+ toolbarManager.add(collapseAction);
+ toolbarManager.add(refreshAction);
+ toolbarManager.add(openByIdAction);
+ toolbarManager.add(new NewAction());
+
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "ATS Navigator");
+
+ }
+
+ 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 "";
+ }
+
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.java
new file mode 100644
index 00000000000..6d33bab2c7a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/NewPeerToPeerReviewItem.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.navigate;
+
+import java.sql.SQLException;
+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.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.skynet.widgets.xnavigate.XNavigateItemAction;
+
+/**
+ * @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() throws SQLException {
+ 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) {
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ PeerToPeerReviewArtifact peerArt =
+ ReviewManager.createNewPeerToPeerReview(null, null,
+ SkynetAuthentication.getInstance().getAuthenticatedUser(), new Date());
+ peerArt.getActionableItemsDam().setActionableItems(ld.getSelected());
+ peerArt.persist(true);
+ AtsLib.openAtsAction(peerArt, AtsOpenOption.OpenAll);
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java
new file mode 100644
index 00000000000..6c79e3166c5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/PublishFullVersionReportItem.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.util.VersionReportJob;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.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() throws SQLException {
+ 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) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, teamDefName,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ useTeamDef = srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class);
+ }
+ 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 (SQLException ex) {
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.toString(), ex);
+ }
+
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.java
new file mode 100644
index 00000000000..4bf2acac19d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/ReleaseVersionItem.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.navigate;
+
+import java.sql.SQLException;
+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.skynet.core.SkynetAuthentication;
+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.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() throws SQLException {
+ 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(
+ SkynetAuthentication.getInstance().getAuthenticatedUser())) {
+ 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.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.setSoleBooleanAttributeValue(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), true);
+ verArt.setSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName(), new Date());
+ verArt.setNextVersion(false);
+ verArt.persist();
+
+ 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.persist();
+ }
+ }
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, "Error releasing version", ex, true);
+ }
+ }
+
+ public TeamDefinitionArtifact getReleaseableTeamDefinitionArtifact() throws SQLException {
+ 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;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.java
new file mode 100644
index 00000000000..89145ea917c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/SearchNavigateItem.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.navigate;
+
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+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
+ */
+ public SearchNavigateItem(XNavigateItem parent, WorldSearchItem wsi) {
+ super(parent, wsi.getName());
+ this.wsi = wsi;
+ }
+
+ public WorldSearchItem getWsi() {
+ return wsi;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.java
new file mode 100644
index 00000000000..94bec32b29c
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/navigate/VisitedItems.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 java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.osee.ats.world.WorldView;
+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;
+
+/**
+ * @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() throws SQLException {
+ WorldView.loadIt(getName(), visited);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToBranchOrTransaction.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToBranchOrTransaction.java
new file mode 100644
index 00000000000..d67a4d0c475
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/ConnectWorkflowToBranchOrTransaction.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.operation;
+
+import static org.eclipse.osee.framework.ui.plugin.util.db.schemas.SkynetDatabase.TRANSACTION_DETAIL_TABLE;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.ui.plugin.sql.SQL3DataType;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandler;
+import org.eclipse.osee.framework.ui.plugin.util.db.ConnectionHandlerStatement;
+import org.eclipse.osee.framework.ui.plugin.util.db.DbUtil;
+import org.eclipse.osee.framework.ui.skynet.blam.BlamVariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class ConnectWorkflowToBranchOrTransaction implements BlamOperation {
+ private static final Logger logger =
+ ConfigUtil.getConfigFactory().getLogger(ConnectWorkflowToBranchOrTransaction.class);
+ private static final String SELECT_COMMIT_TRANSACTIONS =
+ "SELECT " + TRANSACTION_DETAIL_TABLE.columns("transaction_id", "osee_comment") + " FROM " + TRANSACTION_DETAIL_TABLE + " WHERE " + TRANSACTION_DETAIL_TABLE.column("osee_comment") + " LIKE ?";
+ 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.BlamVariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch)
+ */
+ public void runOperation(BlamVariableMap variableMap, Branch branch, IProgressMonitor monitor) throws Exception {
+ ArtifactPersistenceManager artifactManager = ArtifactPersistenceManager.getInstance();
+
+ if (monitor.isCanceled()) return;
+
+ monitor.subTask("Aquiring Team Workflow");
+ Collection<Artifact> teamWorkflows =
+ artifactManager.getArtifactsFromSubtypeName("Lba B3 Req Team Workflow",
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ ConnectionHandlerStatement chStmt = null;
+ try {
+ chStmt = ConnectionHandler.runPreparedQuery(200, SELECT_COMMIT_TRANSACTIONS, SQL3DataType.VARCHAR, "Commit%");
+ ResultSet rSet = chStmt.getRset();
+ while (chStmt.next()) {
+ if (monitor.isCanceled()) return;
+ updateWorkflow(teamWorkflows, rSet);
+ }
+ } finally {
+ DbUtil.close(chStmt);
+ }
+ }
+
+ private void updateWorkflow(Collection<Artifact> teamWorkflows, ResultSet rSet) throws SQLException {
+ String commitComment = rSet.getString("osee_comment");
+ Matcher hridMatcher = hridPattern.matcher(commitComment);
+
+ if (hridMatcher.find()) {
+ String hrid = hridMatcher.group(1);
+ for (Artifact workflow : teamWorkflows) {
+ if (workflow.getHumanReadableId().equals(hrid)) {
+ workflow.setSoleAttributeValue("ats.Transaction Id", String.valueOf(rSet.getInt("transaction_id")));
+ workflow.persist();
+ return;
+ }
+ }
+ logger.log(Level.WARNING, "Could not find a team workflow to with the hrid " + hrid);
+ } else {
+ logger.log(Level.WARNING, "Commit comment not of expected pattern: " + commitComment);
+ }
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java
new file mode 100644
index 00000000000..11d1449cc9d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/TaskMetrics.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map.Entry;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+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.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.excel.ExcelXmlWriter;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.excel.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.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeSearch;
+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;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.attribute.ArtifactSubtypeDescriptor;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+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.BlamVariableMap;
+import org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation;
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class TaskMetrics implements BlamOperation {
+ private static final ArtifactPersistenceManager artifactManager = ArtifactPersistenceManager.getInstance();
+ 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.BlamVariableMap, org.eclipse.osee.framework.skynet.core.artifact.Branch, org.eclipse.core.runtime.IProgressMonitor)
+ *
+ * <XWidget xwidgetType="XArtifactTypeListViewer" displayName="descriptor" />
+ */
+ public void runOperation(BlamVariableMap variableMap, Branch branch, IProgressMonitor monitor) throws Exception {
+ monitor.beginTask("TaskMetrics", 5);
+ metrics.clear();
+
+ ArtifactSubtypeDescriptor descriptor = variableMap.getArtifactSubtypeDescriptor("descriptor");
+
+ FromArtifactsSearch teamWorkflowSearch =
+ new FromArtifactsSearch(new ArtifactTypeSearch(descriptor.getName(), Operator.EQUAL));
+ LinkedList<ISearchPrimitive> relatedCriteria = new LinkedList<ISearchPrimitive>();
+ relatedCriteria.add(new InRelationSearch(teamWorkflowSearch, RelationSide.SmaToTask_Task));
+
+ Collection<Artifact> artifacts = artifactManager.getArtifacts(relatedCriteria, true, branch);
+ for (Artifact artifact : artifacts) {
+ tallyState((TaskArtifact) artifact);
+ }
+
+ writeSummary();
+
+ excelWriter.endWorkbook();
+ IFile iFile = OseeData.getIFile("Task_Metrics.xml");
+ AIFile.writeToFile(iFile, charBak);
+ Program.launch(iFile.getLocation().toOSString());
+ }
+
+ private void tallyState(TaskArtifact task) throws SQLException {
+ XStateDam stateDam = new XStateDam(task);
+
+ SMAState state = stateDam.getState(TaskArtifact.INWORK_STATE, false);
+ if (state == null) {
+ XCurrentStateDam currentStateDam = new XCurrentStateDam(task);
+ state = currentStateDam.getState(TaskArtifact.INWORK_STATE, 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());
+ }
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ActionTeamDateListDialog.java
new file mode 100644
index 00000000000..4fbfeaac2bf
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+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.artifact.TeamDefinitionArtifact;
+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.util.OSEELog;
+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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.java
new file mode 100644
index 00000000000..8d2f37b50d5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/CreateActionArtifactChangeReportJob.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.report;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collection;
+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.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.attribute.EnumeratedAttribute;
+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.util.OSEELog;
+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;
+ }
+
+ 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(AtsPlugin.getLogger());
+ try {
+ if (teamArts.size() == 0) throw new IllegalStateException("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(new Manipulations[] {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.logException(AtsPlugin.class, ex.getLocalizedMessage(), ex, false);
+ 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 Exception {
+ monitor.subTask("Retrieving Actions");
+
+ int x = 1;
+ StringBuffer sb = new StringBuffer(AHTML.beginMultiColumnTable(95));
+ sb.append(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, sb);
+ x++;
+
+ // System.err.println("Developmental purposes only, don't release with this");
+ // if (x >= 5)
+ // break;
+ }
+ sb.append(AHTML.endMultiColumnTable());
+ rd.addRaw(sb.toString().replaceAll("\n", ""));
+ }
+
+ private static void processTeam(TeamWorkFlowArtifact teamArt, String buildId, String byAttribute, StringBuffer sb) throws Exception {
+ String rpcrNum = teamArt.getSoleAttributeValue(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName());
+ for (Artifact modArt : teamArt.getSmaMgr().getBranchMgr().getArtifactsModified(false)) {
+ Set<String> attrStrs = modArt.getAttributesToStringCollection(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ modArt.getDescriptiveName(), attrStr, rpcrNum, "Content"}));
+ }
+ for (Artifact artChg : teamArt.getSmaMgr().getBranchMgr().getArtifactsDeleted()) {
+ Set<String> attrStrs = artChg.getAttributesToStringCollection(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ artChg.getDescriptiveName(), attrStr, rpcrNum, "Deleted"}));
+ }
+ for (Artifact artChg : teamArt.getSmaMgr().getBranchMgr().getArtifactsRelChanged()) {
+ Set<String> attrStrs = artChg.getAttributesToStringCollection(byAttribute);
+ if (attrStrs.size() == 0) attrStrs.add(EnumeratedAttribute.UNSPECIFIED_VALUE);
+ for (String attrStr : attrStrs)
+ sb.append(AHTML.addRowMultiColumnTable(new String[] {teamArt.getHumanReadableId(), buildId,
+ artChg.getDescriptiveName(), attrStr, rpcrNum, "Relation"}));
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportItem.java
new file mode 100644
index 00000000000..461c566e144
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportItem.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.report;
+
+import java.sql.SQLException;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osee.ats.world.WorldView;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ExtendedStatusReportItem extends XNavigateItemAction {
+
+ /**
+ * @param parent
+ * @param name
+ */
+ public ExtendedStatusReportItem(XNavigateItem parent, String name) {
+ super(parent, name);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.navigate.ActionNavigateItem#run()
+ */
+ @Override
+ public void run() throws SQLException {
+ WorldView worldView = WorldView.getWorldView();
+ if (worldView == null) {
+ AWorkbench.popup("ERROR",
+ "Can't access ATS World\n\nNOTE: This report is driven off data populated in ATS World.");
+ return;
+ }
+ ExtendedStatusReportJob job =
+ new ExtendedStatusReportJob("ATS Extended Status Report - " + worldView.getxViewer().getTitle(),
+ worldView.getxViewer().getLoadedArtifacts());
+ job.setUser(true);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.java
new file mode 100644
index 00000000000..2965136a0c6
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/report/ExtendedStatusReportJob.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.report;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+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.jdk.core.util.AHTML;
+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.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;
+ private IProgressMonitor monitor;
+ private String title;
+
+ public ExtendedStatusReportJob(String title, ArrayList<Artifact> arts) {
+ super("Creating " + title);
+ this.title = title;
+ this.arts = arts;
+
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ this.monitor = monitor;
+ if (arts.size() == 0) {
+ OSEELog.logSevere(AtsPlugin.class, "No Artifacts Returned", false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, "No Artifacts Returned", null);
+ }
+ try {
+
+ final String html = AHTML.simplePage(getStatusReport());
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ XResultView.getResultView().addResultPage(
+ new XResultPage(title + " - " + XDate.getDateNow(XDate.MMDDYYHHMM), html,
+ Manipulations.HTML_MANIPULATIONS));
+ AWorkbench.popup("Complete", title + " Complete...Results in ATS Results");
+ }
+ });
+ monitor.done();
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
+
+ public String getStatusReport() throws SQLException {
+ StringBuilder sb = new StringBuilder();
+ sb.append(AHTML.heading(3, title));
+ sb.append(getStatusReportBody());
+ return sb.toString();
+ }
+
+ private static enum Columns {
+ Priority,
+ Change_Type,
+ Team,
+ Type,
+ ActionId,
+ TeamId,
+ TaskId,
+ Title,
+ Analysis,
+ Originator,
+ Assignees,
+ Status_State,
+ Date_Created,
+ Version;
+
+ 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()]);
+ }
+ };
+
+ public String getStatusReportBody() throws SQLException {
+ 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();
+ }
+
+ public void addTableRow(StringBuilder sb, StateMachineArtifact sma) throws SQLException {
+ 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(smaMgr.getAssigneesStr());
+ else if (col == Columns.Status_State)
+ values.add(smaMgr.getCurrentStateName());
+ else if (col == Columns.Date_Created)
+ values.add(sma.getWorldViewCreatedDateStr());
+ else if (col == Columns.Version) {
+ values.add((sma.getWorldViewVersion() == null || sma.getWorldViewVersion().equals("") ? "." : sma.getWorldViewVersion()));
+ }
+ }
+ sb.append(AHTML.addRowMultiColumnTable(values.toArray(new String[values.size()])));
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.java
new file mode 100644
index 00000000000..f084b2db82e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/ArtifactEmailWizard.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.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.ui.skynet.util.email.EmailGroup;
+import org.eclipse.osee.framework.ui.skynet.util.email.EmailWizard;
+
+public class ArtifactEmailWizard extends EmailWizard {
+
+ public ArtifactEmailWizard(StateMachineArtifact sma) {
+ this(sma, null);
+ }
+
+ public ArtifactEmailWizard(StateMachineArtifact sma, ArrayList<Object> toAddress) {
+ 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) {
+ return sma.getEmailableGroups();
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsActionBrowserListener.java
new file mode 100644
index 00000000000..b26309f8973
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.java
new file mode 100644
index 00000000000..bc573352078
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsArtifactAnnotations.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.util;
+
+import java.util.Set;
+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.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) {
+ 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()));
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java
new file mode 100644
index 00000000000..05490a53529
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsBranchAccessHandler.java
@@ -0,0 +1,66 @@
+/*
+ * Created on Dec 26, 2007
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.ats.util;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.event.LocalNewBranchEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * This class handles new branches and setting access control based on ATS workflows and their assignees
+ *
+ * @author Donald G. Dunne
+ */
+public class AtsBranchAccessHandler implements IEventReceiver {
+
+ private static AtsBranchAccessHandler atsBranchAccessHandler = new AtsBranchAccessHandler();
+
+ public static AtsBranchAccessHandler getInstance() {
+ return atsBranchAccessHandler;
+ }
+
+ private AtsBranchAccessHandler() {
+ OSEELog.logInfo(AtsPlugin.class, "Starting ATS Branch Access Handler", false);
+ SkynetEventManager.getInstance().register(LocalNewBranchEvent.class, this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.plugin.event.IEventReceiver#onEvent(org.eclipse.osee.framework.ui.plugin.event.Event)
+ */
+ public void onEvent(Event event) {
+ try {
+ if (event instanceof LocalNewBranchEvent) {
+ Branch branch =
+ BranchPersistenceManager.getInstance().getBranch(((LocalNewBranchEvent) event).getBranchId());
+ Artifact artifact = branch.getAssociatedArtifact();
+ if (artifact instanceof StateMachineArtifact) {
+ ((StateMachineArtifact) artifact).getSmaMgr().getBranchMgr().updateBranchAccessControl();
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ public void dispose() {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.plugin.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.java
new file mode 100644
index 00000000000..345fab9ee80
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsHttpServerRequest.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.util;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Level;
+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.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
+import org.eclipse.osee.framework.skynet.core.linking.HttpRequest;
+import org.eclipse.osee.framework.skynet.core.linking.HttpResponse;
+import org.eclipse.osee.framework.skynet.core.linking.HttpServer;
+import org.eclipse.osee.framework.skynet.core.linking.IHttpServerRequest;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+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();
+ try {
+ if (Strings.isValid(guid)) {
+ keyValues.put("guid", URLEncoder.encode(guid, "UTF-8"));
+ }
+ } catch (UnsupportedEncodingException ex) {
+ SkynetGuiPlugin.getLogger().log(Level.SEVERE, ex.toString(), ex);
+ }
+ return HttpServer.getUrl(this, 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 =
+ ArtifactPersistenceManager.getInstance().getArtifact(guid,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (artifact == null) {
+ httpResponse.outputStandardError(400, "Artifact Can Not Be Found In OSEE");
+ // TODO Display if artifact was deleted
+ // DON Display if artifact was deleted
+ }
+
+ else {
+ 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");
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.linking.IHttpServerRequest#getRequestType()
+ */
+ public String getRequestType() {
+ return "ATS";
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java
new file mode 100644
index 00000000000..b05eb7ca0ae
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsLib.java
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.editor.SMAEditor;
+import org.eclipse.osee.ats.world.WorldView;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+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.Displays;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+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.widgets.Display;
+import org.eclipse.ui.dialogs.ListDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsLib implements IAtsLib {
+
+ private static ArtifactPersistenceManager apm = ArtifactPersistenceManager.getInstance();
+
+ public AtsLib() {
+ super();
+ }
+
+ /**
+ * 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.
+ *
+ * @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
+ */
+ @SuppressWarnings("unchecked")
+ public static <A extends Artifact> Set<A> getActiveSet(Collection<A> artifacts, Active active, Class<? extends Artifact> clazz) {
+ 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
+ String activeStr = art.getSoleAttributeValue(ATSAttributes.ACTIVE_ATTRIBUTE.getStoreName());
+ if (active == Active.Active && (activeStr.equals("") || activeStr.equals("yes")))
+ results.add((A) art);
+ else if (active == Active.InActive && activeStr.equals("no")) results.add((A) art);
+ }
+ }
+ }
+ return results;
+ }
+
+ 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 Exception {
+ 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 Exception {
+ Result result = teamArt.addActionableItems();
+ if (result.isFalse() && result.getText().equals("")) return;
+ if (result.isFalse() && !result.getText().equals("")) result.popup(result.isTrue());
+ }
+
+ public static String commaStrs(Collection<String> strs) {
+ StringBuffer sb = new StringBuffer();
+ for (String str : strs)
+ sb.append(str + ", ");
+ return sb.toString().replaceFirst(", ", "");
+ }
+
+ 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 = BranchPersistenceManager.getInstance().getBranch(branchId);
+ Artifact art = null;
+ if (guidOrHrid.length() == 5) {
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifactsFromHrid(guidOrHrid, branch);
+ if (arts.size() > 0) art = arts.iterator().next();
+ } else {
+ art = ArtifactPersistenceManager.getInstance().getArtifact(guidOrHrid, branch);
+ }
+ if (art != null) openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ } catch (SQLException 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) {
+ Artifact art = null;
+ try {
+ if (guid.length() == 5) {
+ Collection<Artifact> arts =
+ apm.getArtifactsFromHrid(guid, BranchPersistenceManager.getInstance().getAtsBranch());
+ if (arts.size() > 1) {
+ OSEELog.logSevere(AtsPlugin.class, "Action in DB more than once " + guid, true);
+ } else if (arts.size() == 1) art = arts.iterator().next();
+ } else
+ art = apm.getArtifact(guid, BranchPersistenceManager.getInstance().getAtsBranch());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ if (art == null) {
+ AWorkbench.popup("ERROR", "Action not in DB");
+ return;
+ }
+ if (view == OseeAts.OpenView.ActionEditor) {
+ if ((art instanceof StateMachineArtifact) || (art instanceof ActionArtifact))
+ openATSAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ else
+ ArtifactEditor.editArtifact(art);
+ } else if (view == OseeAts.OpenView.ArtifactEditor) {
+ ArtifactEditor.editArtifact(art);
+ } else if (view == OseeAts.OpenView.ArtifactHyperViewer) {
+ AWorkbench.popup("ERROR", "Unimplemented");
+ // try {
+ // ArtifactHyperView.openArtifact(art);
+ // }
+ // catch (PartInitException ex) {
+ // OSEELog.logException(AtsPlugin.class, ex, true);
+ // }
+ }
+ }
+
+ public static void createAtsAction(String initialDescription, String actionableItem) {
+ (new AtsLib()).createATSAction(initialDescription, actionableItem);
+ }
+
+ public void createATSAction(String initialDescription, String actionableItem) {
+
+ NewAction newAction = new NewAction(actionableItem);
+ 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) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ 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)
+ WorldView.loadIt("Action " + actionArt.getHumanReadableId(),
+ Arrays.asList(new Artifact[] {actionArt}));
+ else if (option == AtsOpenOption.OpenOneOrPopupSelect) {
+ if (teams.size() == 1)
+ SMAEditor.editArtifact(teams.iterator().next());
+ else {
+ TeamWorkFlowArtifact art = promptSelectTeamWorkflow(actionArt);
+ if (art != null)
+ SMAEditor.editArtifact((Artifact) art);
+ else
+ return;
+ }
+ }
+ } else
+ SMAEditor.editArtifact(art);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ });
+ }
+
+ public static TeamWorkFlowArtifact promptSelectTeamWorkflow(ActionArtifact actArt) throws SQLException {
+ 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;
+ }
+
+ public void openInAtsWorld(String name, Collection<Artifact> artifacts) {
+ WorldView.loadIt(name, artifacts);
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.java
new file mode 100644
index 00000000000..a2899f9d6b1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/AtsPriority.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.util;
+
+import org.eclipse.osee.ats.AtsPlugin;
+
+/**
+ * @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;
+ }
+
+ public String toString() {
+ return shortName;
+ }
+
+ public static PriorityType getPriority(String type) {
+ if (type == null || type.equals("")) return PriorityType.None;
+ for (PriorityType pri : PriorityType.values()) {
+ if (type.equals(pri.getShortName())) return pri;
+ }
+ throw new IllegalStateException("Invalid priority => " + type);
+ }
+
+ };
+
+ public static void openHelp() {
+ AtsPlugin.getInstance().displayHelp(PRIORITY_HELP_CONTEXT_ID);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/BranchManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/BranchManager.java
new file mode 100644
index 00000000000..67165819cbe
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/BranchManager.java
@@ -0,0 +1,468 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.window.Window;
+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.ats.editor.IAtsStateItem;
+import org.eclipse.osee.ats.editor.SMAManager;
+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.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactInTransactionSearch;
+import org.eclipse.osee.framework.skynet.core.revision.ArtifactChange;
+import org.eclipse.osee.framework.skynet.core.revision.ChangeReportInput;
+import org.eclipse.osee.framework.skynet.core.revision.RevisionManager;
+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.plugin.util.db.schemas.SkynetDatabase.ModificationType;
+import org.eclipse.osee.framework.ui.skynet.branch.BranchView;
+import org.eclipse.osee.framework.ui.skynet.changeReport.ChangeReportView;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.CheckBoxDialog;
+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 BranchManager {
+
+ private boolean commitPopup;
+ private final SMAManager smaMgr;
+
+ public BranchManager(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ /**
+ * 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 SQLException {
+ 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()) {
+ AWorkbench.popup("ERROR", "Working branch has changes. Can't delete through Action.");
+ return;
+ }
+ if (MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Delete Branch", "Are you sure you want to delete the branch: " + branch)) {
+ Job job = BranchPersistenceManager.getInstance().deleteBranch(branch);
+ job.join();
+
+ AWorkbench.popup("Delete Complete", "Deleted Branch Successfully");
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't delete change report.", ex, true);
+ }
+ }
+
+ /**
+ * @return TransactionId associated with this state machine artifact
+ * @throws SQLException
+ */
+ public TransactionId getTransactionId() throws SQLException {
+ Set<Integer> tranSet = RevisionManager.getInstance().getTransactionDataPerCommitArtifact(smaMgr.getSma());
+ // Cache null transactionId so don't re-search for every call
+ if (tranSet.size() == 0) {
+ return null;
+ } else if (tranSet.size() > 1) {
+ OSEELog.logWarning(AtsPlugin.class,
+ "Unexpected multiple transactions per committed artifact id " + smaMgr.getSma().getArtId(), false);
+ }
+ try {
+ return TransactionIdManager.getInstance().getPossiblyEditableTransactionId(tranSet.iterator().next());
+ } catch (Exception ex) {
+ // there may be times where the transaction id cache is not up-to-date yet; don't throw error
+ }
+ return null;
+ }
+
+ /**
+ * Display change report associated with the branch, if exists, or transaction, if branch has been committed.
+ */
+ public void showChangeReport() {
+ try {
+ if (isWorkingBranch()) {
+ ChangeReportView.openViewUpon(getWorkingBranch());
+ } else if (isCommittedBranch()) {
+ ChangeReportView.openViewUpon(new ChangeReportInput(smaMgr.getSma().getDescriptiveName(),
+ getTransactionId()));
+ } else {
+ AWorkbench.popup("ERROR", "No Branch or Committed Transaction Found.");
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't show change report.", 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
+ * @throws SQLException
+ */
+ public Branch getWorkingBranch() throws SQLException {
+ Set<Branch> branches = BranchPersistenceManager.getInstance().getAssociatedArtifactBranches(smaMgr.getSma());
+ // Cache null working branch so don't re-search for every call
+ if (branches.size() == 0) {
+ return null;
+ } else if (branches.size() > 1) {
+ OSEELog.logWarning(AtsPlugin.class,
+ "Unexpected multiple working branches per workflow" + smaMgr.getSma().getHumanReadableId(), false);
+ } else {
+ return branches.iterator().next();
+ }
+ return null;
+ }
+
+ /**
+ * @return true if there is a current working branch
+ */
+ public boolean isWorkingBranch() throws SQLException {
+ return getWorkingBranch() != null;
+ }
+
+ /**
+ * @return true if there are committed changes associated with this state machine artifact
+ */
+ public boolean isCommittedBranch() throws SQLException {
+ return (getTransactionId() != null);
+ }
+
+ /**
+ * Set parent branch id associated with this state machine artifact
+ *
+ * @param branchId
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void setParentBranchId(int branchId) throws IllegalStateException, SQLException {
+ 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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return new Result("Exception occurred: " + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ /**
+ * @return Branch that is the configured branch to create working branch from.
+ * @throws SQLException
+ */
+ private Branch getParentBranchForWorkingBranchCreation() throws SQLException {
+ Branch parentBranch = null;
+
+ // Check for parent branch id in Version artifact
+ if (smaMgr.isTeamUsesVersions()) {
+ VersionArtifact verArt = smaMgr.getTargetedForVersion();
+ if (verArt != null) {
+ Integer branchId =
+ verArt.getSoleIntegerAttributeValue(ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName());
+ if (branchId != null && branchId > 0) {
+ parentBranch = BranchPersistenceManager.getInstance().getBranch(branchId);
+ }
+ }
+ }
+
+ // If not defined in version, check for parent branch from team definition
+ if (parentBranch == null && (smaMgr.getSma() instanceof TeamWorkFlowArtifact)) {
+ Integer branchId =
+ ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getSoleIntegerAttributeValue(
+ ATSAttributes.PARENT_BRANCH_ID_ATTRIBUTE.getStoreName());
+ if (branchId != null && branchId > 0) {
+ parentBranch = BranchPersistenceManager.getInstance().getBranch(branchId);
+ }
+ }
+
+ // 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 SQLException
+ */
+ public void createWorkingBranch(String pageId, Branch parentBranch) throws SQLException {
+ 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;
+ final TransactionId parentTransactionId =
+ TransactionIdManager.getInstance().getEditableTransactionId(parentBranch);
+
+ IExceptionableRunnable runnable = new IExceptionableRunnable() {
+ public void run(IProgressMonitor monitor) throws Exception {
+ BranchPersistenceManager.getInstance().createWorkingBranch(parentTransactionId, finalBranchShortName,
+ branchName, stateMachineArtifact);
+ }
+ };
+
+ Jobs.run("Create Branch", runnable, AtsPlugin.getLogger(), AtsPlugin.PLUGIN_ID);
+ }
+
+ public void updateBranchAccessControl() throws SQLException {
+ // 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.getAssignees().contains(acd.getSubject())) {
+ AccessControlManager.getInstance().removeAccessControlData(acd);
+ }
+ }
+ // If subject doesn't have access, add it
+ for (User user : smaMgr.getAssignees())
+ AccessControlManager.getInstance().setPermission(user, branch, PermissionEnum.FULLACCESS);
+ }
+ }
+ }
+ }
+
+ /**
+ * @param popup if true, popup errors associated with results
+ * @return Result
+ */
+ public Result commitWorkingBranch(boolean popup) {
+ return commitWorkingBranch(popup, false);
+ }
+
+ /**
+ * @param popup 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
+ * @return Result
+ */
+ public Result commitWorkingBranch(boolean popup, boolean overrideStateValidation) {
+ commitPopup = popup;
+
+ try {
+ Branch branch = getWorkingBranch();
+ if (branch == null) {
+ OSEELog.logSevere(AtsPlugin.class,
+ "Commit Branch Failed: Can not locate branch for workflow " + smaMgr.getSma().getHumanReadableId(),
+ popup);
+ return new Result("Commit Branch Failed: Can not locate branch.");
+ }
+
+ if (!overrideStateValidation) {
+ // Check extenstion points for valid commit
+ for (IAtsStateItem item : smaMgr.getStateItems().getStateItems(smaMgr.getWorkPage().getId())) {
+ Result result = item.committing(smaMgr);
+ if (result.isFalse()) return result;
+ }
+ }
+
+ try {
+ if (commitPopup && Display.getCurrent() != null) {
+ CheckBoxDialog cd = BranchView.createCommitDialog();
+
+ if (cd.open() != Window.OK) {
+ return new Result("Operation Cancelled");
+ }
+ }
+
+ BranchPersistenceManager.getInstance().commitBranch(branch, true);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Commit Branch Failed", ex, popup);
+ return new Result("Commit Branch Failed: " + ex.getLocalizedMessage());
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Commit Branch Failed", ex, popup);
+ return new Result("Commit Branch Failed" + ex.getLocalizedMessage());
+ }
+ return Result.TrueResult;
+ }
+
+ /**
+ * Return the artifacts modified via transaction of branch commit during implementation state. This includes
+ * artifacts that only had relation changes. NOTE: The returned artifacts are the old versions at the time of the
+ * commit. They can't be used for editing or relating. NOTE: This is a VERY expensive operation as each artifact must
+ * be loaded. Retrieving data through change report snapshot is cheaper.
+ *
+ * @return artifacts modified
+ */
+ public Collection<Artifact> getArtifactsModified(boolean includeRelationOnlyChanges) throws SQLException {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ if (smaMgr.getBranchMgr().isWorkingBranch()) {
+ Branch workingBranch = smaMgr.getBranchMgr().getWorkingBranch();
+ if (workingBranch != null) {
+ try {
+ return RevisionManager.getInstance().getNewAndModifiedArtifacts(workingBranch,
+ includeRelationOnlyChanges);
+ } catch (SQLException ex) {
+ OSEELog.logSevere(AtsPlugin.class, "Error getting modified artifacts", true);
+ }
+ }
+ } else if (smaMgr.getBranchMgr().isCommittedBranch()) {
+ TransactionId transactionId = getTransactionId();
+ if (transactionId != null) {
+ try {
+ return RevisionManager.getInstance().getNewAndModifiedArtifacts(transactionId, transactionId,
+ includeRelationOnlyChanges);
+ } catch (SQLException ex) {
+ OSEELog.logSevere(AtsPlugin.class, "Error getting modified artifacts", true);
+ }
+ }
+ }
+ return arts;
+ }
+
+ /**
+ * Return All artifacts who had a relation change. This includes relation only artifacts and those who had other
+ * attribute changes.
+ *
+ * @return artifacts
+ */
+ public Collection<Artifact> getArtifactsRelChanged() throws SQLException {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TransactionId transactionId = getTransactionId();
+ if (transactionId == null) return arts;
+ try {
+ return RevisionManager.getInstance().getRelationChangedArtifacts(transactionId, transactionId);
+ } catch (SQLException ex) {
+ OSEELog.logSevere(AtsPlugin.class, "Error getting relation changed artifacts", true);
+ }
+ return arts;
+ }
+
+ /**
+ * Since deleted artifacts don't exist, this method will return the artifact object just prior to it's deletion.
+ * NOTE: This is a VERY expensive operation as each artifact must be loaded. Retrieving data through change report
+ * snapshot is cheaper.
+ *
+ * @return artifacts that were deleted
+ */
+ public Collection<Artifact> getArtifactsDeleted() throws SQLException {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TransactionId transactionId = getTransactionId();
+ if (transactionId == null) return arts;
+
+ try {
+ for (ArtifactChange artChange : RevisionManager.getInstance().getDeletedArtifactChanges(transactionId)) {
+ if (artChange.getModType() == ModificationType.DELETE) arts.add(artChange.getArtifact());
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class,
+ "Error getting deleted artifacts " + smaMgr.getSma().getHumanReadableId(), ex, true);
+ }
+ return arts;
+ }
+
+ /**
+ * Return the head of artifacts modified via transaction of branch commit during implementation state. NOTE: The
+ * returned artifacts are NOT the old versions at the time of the commit. They are the head versions of the artifacts
+ * and CAN be used for relating
+ *
+ * @return head of artifacts modified
+ * @throws SQLException
+ */
+ public Collection<Artifact> getArtifactsModifiedHead() throws SQLException {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TransactionId transactionId = getTransactionId();
+ if (transactionId == null) return arts;
+ Collection<Artifact> transArts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(new ArtifactInTransactionSearch(transactionId),
+ transactionId.getBranch());
+ return transArts;
+ }
+
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.java
new file mode 100644
index 00000000000..3cab6eb30f0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DeadlineManager.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;
+
+import java.util.Date;
+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.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @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() {
+ 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.logException(AtsPlugin.class, ex, false);
+ }
+ return Result.FalseResult;
+ }
+
+ public Result isDeadlineDateAlerting() {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamState.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamState.java
new file mode 100644
index 00000000000..7727ad7b9da
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamState.java
@@ -0,0 +1,20 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum DefaultTeamState {
+
+ Endorse, Analyze, Authorize, Implement, Completed, Cancelled
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamWorkflowManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamWorkflowManager.java
new file mode 100644
index 00000000000..c4a9536d020
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/DefaultTeamWorkflowManager.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.util;
+
+import java.sql.SQLException;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.skynet.core.User;
+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 DefaultTeamWorkflowManager {
+
+ private final SMAManager smaMgr;
+ private final TeamWorkFlowArtifact teamArt;
+
+ public DefaultTeamWorkflowManager(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
+ * 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
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public Result transitionTo(DefaultTeamState toState, User user, boolean popup) throws IllegalStateException, SQLException {
+ 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.getAssignees().iterator().next()), false);
+ 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.getAssignees().iterator().next()), false);
+ 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.getAssignees().iterator().next()), false);
+ 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.getAssignees().iterator().next()), false);
+ if (result.isFalse()) {
+ if (popup) result.popup();
+ return result;
+ }
+ return Result.TrueResult;
+
+ }
+
+ public Result setEndorseData(String propRes, int statePercentComplete, double stateHoursSpent) throws IllegalStateException, SQLException {
+ if (!smaMgr.getCurrentStateName().equals("Endorse")) return new Result("Action not in Endorse state");
+ if (propRes == null || propRes.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), "yes");
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName(), propRes);
+ smaMgr.getCurrentStateDam().setHoursSpent(stateHoursSpent);
+ smaMgr.getCurrentStateDam().setPercentComplete(statePercentComplete);
+ return Result.TrueResult;
+ }
+
+ public Result setAnalyzeData(String problem, String propRes, double hourEstimate, int statePercentComplete, double stateHoursSpent) throws IllegalStateException, SQLException {
+ if (!smaMgr.getCurrentStateName().equals("Analyze")) return new Result("Action not in Analyze state");
+ if (problem == null || problem.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROBLEM_OVERRIDE_ATTRIBUTE.getStoreName(), "yes");
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROBLEM_ATTRIBUTE.getStoreName(), problem);
+ if (propRes == null || propRes.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), "yes");
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.PROPOSED_RESOLUTION_ATTRIBUTE.getStoreName(), propRes);
+ teamArt.setSoleAttributeValue(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(), hourEstimate + "");
+ smaMgr.getCurrentStateDam().setHoursSpent(stateHoursSpent);
+ smaMgr.getCurrentStateDam().setPercentComplete(statePercentComplete);
+ return Result.TrueResult;
+ }
+
+ public Result setAuthorizeData(int statePercentComplete, double stateHoursSpent) throws IllegalStateException, SQLException {
+ if (!smaMgr.getCurrentStateName().equals("Authorize")) return new Result("Action not in Authorize state");
+ smaMgr.getCurrentStateDam().setHoursSpent(stateHoursSpent);
+ smaMgr.getCurrentStateDam().setPercentComplete(statePercentComplete);
+ return Result.TrueResult;
+ }
+
+ public Result setImplementData(String resolution, int statePercentComplete, double stateHoursSpent) throws IllegalStateException, SQLException {
+ if (!smaMgr.getCurrentStateName().equals("Implement")) return new Result("Action not in Implement state");
+ if (resolution == null || resolution.equals(""))
+ teamArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_OVERRIDE_ATTRIBUTE.getStoreName(), "yes");
+ else
+ teamArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), resolution);
+ smaMgr.getCurrentStateDam().setHoursSpent(stateHoursSpent);
+ smaMgr.getCurrentStateDam().setPercentComplete(statePercentComplete);
+ return Result.TrueResult;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.java
new file mode 100644
index 00000000000..462ca39cdf0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Favorites.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;
+
+import java.sql.SQLException;
+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.skynet.core.SkynetAuthentication;
+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() {
+ try {
+ if (((IFavoriteableArtifact) sma).amIFavorite()) {
+ boolean result =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Remove Favorite", "Are You sure you wish to remove this as Favorite?");
+ if (result) ((IFavoriteableArtifact) sma).removeFavorite(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ } else {
+ boolean result =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Favorite", "Are you sure you wish add this as a Favorite?");
+ if (result) ((IFavoriteableArtifact) sma).addFavorite(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.java
new file mode 100644
index 00000000000..9a34a2660bc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportPage.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.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.WorldView;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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);
+ }
+
+ 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
+ */
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ // policy: wizards are not allowed to come up with an error message
+ if (visible) {
+ setErrorMessage(null);
+ }
+ }
+
+ protected boolean validateSourceGroup() {
+ return fileSelector.validate(this);
+ }
+
+ public boolean finish() {
+ final File file = fileSelector.getFile();
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ ExcelAtsActionArtifactExtractor extractor =
+ new ExcelAtsActionArtifactExtractor(BranchPersistenceManager.getInstance().getAtsBranch(),
+ emailPocs.getSelection());
+ extractor.discoverArtifactAndRelationData(file);
+ if (extractor.dataIsValid()) extractor.createArtifactsAndNotify();
+ WorldView.loadIt("Imported Action Artifacts", extractor.getActionArts());
+ AWorkbench.popup("Complete", "Action Import Complete");
+ }
+ };
+ txWrapper.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ActionImportWizard.java
new file mode 100644
index 00000000000..c43ad37a13c
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
new file mode 100644
index 00000000000..1d05c8482fc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsActionArtifactExtractor.java
@@ -0,0 +1,310 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.core.runtime.jobs.Job;
+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.editor.SMAManager;
+import org.eclipse.osee.ats.util.AtsPriority;
+import org.eclipse.osee.ats.util.NotifyUsersJob;
+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.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+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 SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ 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) throws SQLException, IllegalArgumentException {
+ 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.logSevere(AtsPlugin.class, "Empty Row Found => " + rowNum + " skipping...", false);
+ return;
+ }
+
+ System.out.println("Reading rows...");
+ ActionData aData = new ActionData();
+ for (int i = 0; i < cols.length; i++) {
+ if (headerRow[i] == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Null header column => " + i, false);
+ } 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() {
+ System.out.println("Validating...");
+ XResultData rd = new XResultData(AtsPlugin.getLogger());
+ 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 ai : aData.actionableItems) {
+ try {
+ ActionableItemArtifact aia = ActionableItemArtifact.getSoleActionableItem(ai);
+ if (aia == null) {
+ rd.logError("Row " + rowNum + ": Couldn't find actionable item for \"" + ai + "\"");
+ }
+ } catch (SQLException ex) {
+ rd.logError("Row " + rowNum + " - " + ex.getLocalizedMessage());
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ }
+ if (!aData.version.equals("")) {
+ try {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(VersionArtifact.ARTIFACT_NAME, aData.version,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (srch.getSingletonArtifactOrException(VersionArtifact.class) == null) rd.logError("Row " + rowNum + ": Can't find single version \"" + aData.version + "\"");
+ } catch (SQLException ex) {
+ rd.logError("Row " + rowNum + " - " + ex.getLocalizedMessage());
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ // 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 = skynetAuth.getUserByName(assignee, false);
+ 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() {
+ 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));
+ actionArts.add(actionArt);
+ if (!aData.version.equals("")) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(VersionArtifact.ARTIFACT_NAME, aData.version,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ VersionArtifact verArt = srch.getSingletonArtifactOrException(VersionArtifact.class);
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts())
+ verArt.relate(RelationSide.TeamWorkflowTargetedForVersion_Workflow, team, true);
+ }
+ if (aData.assigneeStrs.size() > 0) {
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts()) {
+ SMAManager smaMgr = new SMAManager(team);
+ smaMgr.setAssignees(aData.assignees);
+ }
+ }
+ for (TeamWorkFlowArtifact team : actionArt.getTeamWorkFlowArtifacts()) {
+ team.persist(true);
+ }
+ teamWfs.addAll(actionArt.getTeamWorkFlowArtifacts());
+ }
+ AtsPlugin.setEmailEnabled(true);
+ if (emailPOCs) {
+ for (TeamWorkFlowArtifact team : teamWfs) {
+ NotifyUsersJob job = new NotifyUsersJob(team, NotifyUsersJob.NotifyType.Assignee);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ } finally {
+ AtsPlugin.setEmailEnabled(true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.ArtifactExtractor#discoverArtifactAndRelationData(java.io.File)
+ */
+ public void discoverArtifactAndRelationData(File artifactsFile) throws Exception {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ excelHandler = new ExcelSaxHandler(this, true);
+ xmlReader.setContentHandler(excelHandler);
+ xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(artifactsFile), "UTF-8")));
+ }
+
+ /*
+ * (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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
new file mode 100644
index 00000000000..3f873c1f5df
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/ExcelAtsTaskArtifactExtractor.java
@@ -0,0 +1,258 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import org.eclipse.core.runtime.IProgressMonitor;
+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.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.NotifyUsersJob;
+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.skynet.core.SkynetAuthentication;
+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.Branch;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.ui.skynet.Import.AbstractArtifactExtractor;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+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 SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ 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 static SkynetAuthentication skyAuth = SkynetAuthentication.getInstance();
+ private SMAManager smaMgr;
+
+ public static String getDescription() {
+ return description;
+ }
+
+ public ExcelAtsTaskArtifactExtractor(String hrid, Branch branch, boolean emailPOCs) throws SQLException, IllegalArgumentException {
+ super(branch);
+ this.emailPOCs = emailPOCs;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifactsFromHrid(hrid,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (arts.size() == 0) throw new IllegalArgumentException("Can't find artifact associated with " + hrid);
+ if (arts.size() > 1) throw new IllegalArgumentException("Found two artifacts for HRID " + hrid);
+ if (!(arts.iterator().next() instanceof StateMachineArtifact)) throw new IllegalArgumentException(
+ "Artifact must be StateMachineArtifact");
+ sma = (StateMachineArtifact) arts.iterator().next();
+ 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.logSevere(AtsPlugin.class, "Empty Row Found => " + rowNum + " skipping...", false);
+ return;
+ }
+
+ AtsPlugin.setEmailEnabled(false);
+ for (int i = 0; i < row.length; i++) {
+ if (headerRow[i] == null) {
+ OSEELog.logSevere(AtsPlugin.class, "Null header column => " + i, false);
+ } else if (headerRow[i].equalsIgnoreCase("Originator")) {
+ String userName = row[i];
+ User u = null;
+ if (userName == null || userName.equals(""))
+ u = skynetAuth.getAuthenticatedUser();
+ else
+ u = skyAuth.getUserByName(userName, false);
+ if (u == null) OSEELog.logSevere(AtsPlugin.class, String.format(
+ "Invalid originator \"%s\" for row %d\nSetting to current user.", userName, rowNum), false);
+ sma.getLog().setOriginator(u);
+ } else if (headerRow[i].equalsIgnoreCase("Assignee")) {
+ String userName = row[i];
+ User u = null;
+ if (userName == null || userName.equals(""))
+ u = skynetAuth.getAuthenticatedUser();
+ else
+ u = skyAuth.getUserByName(userName, false);
+ if (u == null) throw new IllegalArgumentException(String.format("Invalid Assignee \"%s\" for row %d",
+ userName, rowNum));
+ taskArt.getCurrentState().setAssignee(u);
+ } else if (headerRow[i].equalsIgnoreCase(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName())) {
+ String str = row[i];
+ if (str != null && !str.equals("")) {
+ taskArt.setSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName(), str);
+ }
+ } else if (headerRow[i].equalsIgnoreCase(ATSAttributes.TITLE_ATTRIBUTE.getStoreName())) {
+ 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(ATSAttributes.PERCENT_COMPLETE_ATTRIBUTE.getStoreName())) {
+ String str = row[i];
+ Double percent;
+ if (str != null && !str.equals("")) {
+ try {
+ percent = new Double(str);
+ percent = percent * 100;
+ } catch (Exception ex) {
+ throw new IllegalArgumentException(String.format("Invalid Percent Complete \"%s\" for row %d",
+ str, rowNum));
+ }
+ int percentInt = percent.intValue();
+ taskArt.getCurrentStateDam().setPercentComplete(percentInt);
+ }
+ } else if (headerRow[i].equalsIgnoreCase(ATSAttributes.HOURS_SPENT_ATTRIBUTE.getStoreName())) {
+ 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));
+ }
+ taskArt.getCurrentStateDam().setHoursSpent(hours);
+ }
+ } else if (headerRow[i].equalsIgnoreCase("group")) {
+ System.out.println("groups not handled yet");
+ } else {
+ OSEELog.logSevere(AtsPlugin.class, "Unhandled column => " + headerRow[i], false);
+ }
+ }
+ AtsPlugin.setEmailEnabled(true);
+
+ if (taskArt.isCompleted()) taskArt.transitionToCompleted(false);
+ taskArt.persist(true);
+ if (emailPOCs && !taskArt.isCompleted() && !taskArt.isCancelled()) {
+ NotifyUsersJob job = new NotifyUsersJob(sma, NotifyUsersJob.NotifyType.Assignee);
+ job.setPriority(Job.SHORT);
+ job.schedule();
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.define.artifact.Import.ArtifactExtractor#discoverArtifactAndRelationData(java.io.File)
+ */
+ public void discoverArtifactAndRelationData(File artifactsFile) throws Exception {
+ XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+ excelHandler = new ExcelSaxHandler(this, true);
+ xmlReader.setContentHandler(excelHandler);
+ xmlReader.parse(new InputSource(new InputStreamReader(new FileInputStream(artifactsFile), "UTF-8")));
+ }
+
+ /*
+ * (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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.java
new file mode 100644
index 00000000000..a58d5b04142
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportJob.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.util.Import;
+
+import java.io.File;
+import java.sql.SQLException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.eclipse.core.runtime.CoreException;
+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.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.skynet.core.artifact.Branch;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskImportJob extends Job {
+ private static final Logger logger = ConfigUtil.getConfigFactory().getLogger(TaskImportJob.class);
+ private final File file;
+ private ExcelAtsTaskArtifactExtractor extractor;
+ private final Branch branch;
+
+ public TaskImportJob(File file, String hrid, ExcelAtsTaskArtifactExtractor extractor, Branch branch) throws IllegalArgumentException, CoreException, SQLException {
+ super("Importing Tasks");
+ this.file = file;
+ this.extractor = extractor;
+ this.branch = branch;
+ }
+
+ public IStatus run(final IProgressMonitor monitor) {
+ IStatus toReturn = Status.CANCEL_STATUS;
+ try {
+ extractor.setMonitor(monitor);
+ monitor.beginTask("Importing Tasks", 0);
+ AbstractSkynetTxTemplate txWrapper = new ExtractArtifactTx(branch, file, monitor);
+ txWrapper.execute();
+ toReturn = Status.OK_STATUS;
+ } catch (Exception ex) {
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ toReturn = new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ } finally {
+ monitor.done();
+ }
+ return toReturn;
+ }
+ private final class ExtractArtifactTx extends AbstractSkynetTxTemplate {
+
+ private IProgressMonitor monitor;
+ private File file;
+
+ public ExtractArtifactTx(Branch branch, File file, IProgressMonitor monitor) {
+ super(branch);
+ this.file = file;
+ this.monitor = monitor;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.skynet.core.transaction.AbstractTxTemplate#handleTxWork()
+ */
+ @Override
+ protected void handleTxWork() throws Exception {
+ if (file != null && file.isFile()) {
+ extractor.discoverArtifactAndRelationData(file);
+ } else {
+ throw new IllegalStateException("All files passed must be a file");
+ }
+ System.out.println("Committing Transaction");
+ monitor.setTaskName("Committing Transaction");
+ monitor.subTask(""); // blank out leftover relation subtask
+ monitor.worked(1); // cause the status to update
+ }
+
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportPage.java
new file mode 100644
index 00000000000..3d71fc1cb82
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportPage.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.ui.plugin.util.FileSelector;
+import org.eclipse.osee.framework.ui.plugin.util.Jobs;
+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.swt.widgets.Text;
+import org.eclipse.ui.dialogs.WizardDataTransferPage;
+import org.eclipse.ui.dialogs.WizardResourceImportPage;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskImportPage extends WizardDataTransferPage {
+ private static Logger logger = ConfigUtil.getConfigFactory().getLogger(WizardResourceImportPage.class);
+
+ private IResource currentResourceSelection;
+ private FileSelector fileSelector;
+ private Text hridText;
+ private Label actionLabel;
+ private Button emailPocs;
+ private String hrid;
+
+ /**
+ * @param pageName
+ * @param selection
+ */
+ public TaskImportPage(String pageName, IStructuredSelection selection, String hrid) {
+ super(pageName);
+ this.hrid = hrid;
+ setTitle("Import tasks into ATS");
+ setDescription("Import tasks 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);
+ }
+
+ 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));
+
+ Label label = new Label(composite, SWT.NONE);
+ label.setText("HRID:");
+ label.setLayoutData(new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false));
+
+ hridText = new Text(composite, SWT.SINGLE | SWT.BORDER);
+ hridText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ hridText.addListener(SWT.Modify, this);
+ if (hrid != null && !hrid.equals("")) hridText.setText(hrid);
+
+ emailPocs = new Button(composite, SWT.CHECK);
+ emailPocs.setText("Email POCs of Un-Completed Tasks?");
+ 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
+ */
+
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
+ // policy: wizards are not allowed to come up with an error message
+ if (visible) {
+ setErrorMessage(null);
+ }
+ }
+
+ protected boolean validateSourceGroup() {
+ return fileSelector.validate(this);
+ }
+
+ @Override
+ protected boolean validateOptionsGroup() {
+ String hrid = hridText.getText();
+ if (hrid.length() != 5) {
+ setErrorMessage("Enter valid HRID");
+ return false;
+ }
+ Collection<Artifact> arts;
+ try {
+ arts =
+ ArtifactPersistenceManager.getInstance().getArtifactsFromHrid(hrid,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (arts.size() != 1) {
+ setErrorMessage("Can't retrieve artifact for entered HRID");
+ actionLabel.setText("");
+ return false;
+ }
+ Artifact art = arts.iterator().next();
+ if (!(art instanceof StateMachineArtifact)) {
+ setErrorMessage("Artifact retrieved is not a StateMachineArtifact");
+ actionLabel.setText("");
+ return false;
+ }
+ actionLabel.setText(String.format("Import to: \"%s\"\nCurrent state: %s",
+ ((StateMachineArtifact) art).getDescriptiveName(), ((StateMachineArtifact) art).getCurrentStateName()));
+ actionLabel.getParent().layout();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return true;
+ }
+
+ public boolean finish() {
+ File file = fileSelector.getFile();
+ System.out.println("Not Implemented Yet");
+
+ try {
+ ExcelAtsTaskArtifactExtractor extractor =
+ new ExcelAtsTaskArtifactExtractor(hridText.getText(),
+ BranchPersistenceManager.getInstance().getAtsBranch(), emailPocs.getSelection());
+ Jobs.startJob(new TaskImportJob(file, hridText.getText(), extractor,
+ BranchPersistenceManager.getInstance().getAtsBranch()));
+ } catch (Exception ex) {
+ logger.log(Level.SEVERE, ex.toString(), ex);
+ ErrorDialog.openError(getShell(), "ATS Import Error", "An error has occured while importing document.",
+ new Status(IStatus.ERROR, "org.eclipse.osee.framework.jdk.core", IStatus.ERROR,
+ "Unknown exception occured in the import", ex));
+ }
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportWizard.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportWizard.java
new file mode 100644
index 00000000000..962d563a2a7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Import/TaskImportWizard.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.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 TaskImportWizard extends Wizard implements IImportWizard {
+ private TaskImportPage mainPage;
+ private IStructuredSelection selection;
+ private String hrid;
+
+ public TaskImportWizard() {
+ super();
+ setDialogSettings(AtsPlugin.getInstance().getDialogSettings());
+ setWindowTitle("Task 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;
+ }
+
+ public void setHrid(String hrid) {
+ this.hrid = hrid;
+ }
+
+ /**
+ * (non-Javadoc) Method declared on Wizard.
+ */
+ public void addPages() {
+ mainPage = new TaskImportPage("Import Tasks into OSEE ATS", selection, hrid);
+ addPage(mainPage);
+ }
+
+ public String getHrid() {
+ return hrid;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java
new file mode 100644
index 00000000000..da5c479c025
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/LegacyPCRActions.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LegacyPCRActions {
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(TeamDefinitionArtifact teamDef) throws SQLException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(new TeamDefinitionArtifact[] {teamDef}));
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem("", teamDefs);
+ search.setReturnTeams(true);
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ teamArts.add((TeamWorkFlowArtifact) art);
+ }
+ return teamArts;
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(String pcrId, Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(new String[] {pcrId}), teamDefs);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(String pcrId) throws SQLException {
+ return getTeamsTeamWorkflowArtifacts(Arrays.asList(new String[] {pcrId}),
+ (Collection<TeamDefinitionArtifact>) null);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<String> pcrIds, TeamDefinitionArtifact teamDef) throws SQLException {
+ return getTeamsTeamWorkflowArtifacts(pcrIds,
+ teamDef != null ? Arrays.asList(new TeamDefinitionArtifact[] {teamDef}) : null);
+ }
+
+ public static Collection<TeamWorkFlowArtifact> getTeamsTeamWorkflowArtifacts(Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem("", pcrIds, teamDefs);
+ search.setReturnTeams(true);
+ Set<TeamWorkFlowArtifact> teamArts = new HashSet<TeamWorkFlowArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ teamArts.add((TeamWorkFlowArtifact) art);
+ }
+ return teamArts;
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(TeamDefinitionArtifact teamDef) throws SQLException {
+ return getTeamsActionArtifacts(Arrays.asList(new TeamDefinitionArtifact[] {teamDef}));
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem("", teamDefs);
+ Set<ActionArtifact> actArts = new HashSet<ActionArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ actArts.add((ActionArtifact) art);
+ }
+ return actArts;
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(String pcrId, Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ return getTeamsActionArtifacts(Arrays.asList(new String[] {pcrId}), teamDefs);
+ }
+
+ public static Collection<ActionArtifact> getTeamsActionArtifacts(Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs) throws SQLException {
+ LegacyPCRActionsWorldSearchItem search = new LegacyPCRActionsWorldSearchItem("", pcrIds, teamDefs);
+ Set<ActionArtifact> actArts = new HashSet<ActionArtifact>();
+ for (Artifact art : search.performSearchGetResults()) {
+ actArts.add((ActionArtifact) art);
+ }
+ return actArts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/NotifyUsersJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/NotifyUsersJob.java
new file mode 100644
index 00000000000..e6f16d822c1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/NotifyUsersJob.java
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+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.ActionDebug;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.LogItem;
+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.ats.util.Overview.PreviewStyle;
+import org.eclipse.osee.framework.jdk.core.util.AEmail;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XDate;
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.REUtil;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class NotifyUsersJob extends Job {
+ private static final SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ private final StateMachineArtifact sma;
+ private final SMAManager smaMgr;
+ private final Set<NotifyType> types = new HashSet<NotifyType>();
+ private ActionDebug debug = new ActionDebug(false, "NotifyUsersJob");
+ public static enum NotifyType {
+ Subscribers, Completed, Assignee, Originator
+ };
+ // Set to true to test emailing without actually sending email; set to false for production
+ private boolean testing = false;
+
+ String stateName;
+ private final Set<User> notifyUsers = new HashSet<User>();;
+
+ public NotifyUsersJob(StateMachineArtifact sma, NotifyType type, NotifyType... types) throws IllegalArgumentException, SQLException {
+ this(sma, null, type, types);
+ }
+
+ public NotifyUsersJob(StateMachineArtifact sma, Collection<User> notifyUsers, NotifyType type, NotifyType... types) throws IllegalArgumentException, SQLException {
+ super("Notifying ATS Users");
+ if (testing) OSEELog.logException(AtsPlugin.class,
+ "NotifyUsersJob is in testing mode; don't release in this state.", null, false);
+ this.sma = sma;
+ if (notifyUsers != null) this.notifyUsers.addAll(notifyUsers);
+ // Never email current user
+ this.notifyUsers.remove(skynetAuth.getAuthenticatedUser());
+ this.types.add(type);
+ if (types != null) for (NotifyType nt : types)
+ this.types.add(nt);
+ stateName = sma.getCurrentStateName();
+ smaMgr = new SMAManager(sma);
+ }
+
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ if (!testing && !AtsPlugin.isAtsAlwaysEmailMe()) {
+ if (!AtsPlugin.isEmailEnabled()) {
+ // System.out.println("Email programatically disabled; not sending.");
+ monitor.done();
+ return Status.OK_STATUS;
+ } else if (!AtsPlugin.isProductionDb()) {
+ AtsPlugin.getLogger().log(Level.INFO, "Test DB; Not Sending Email");
+ monitor.done();
+ return Status.OK_STATUS;
+ } else if (AtsPlugin.isAtsDisableEmail()) {
+ AtsPlugin.getLogger().log(Level.INFO, "ATS Email Disabled; Not Sending");
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+ }
+
+ String html = sma.getPreviewHtml(PreviewStyle.HYPEROPEN, PreviewStyle.NO_SUBSCRIBE_OR_FAVORITE);
+ if (types.contains(NotifyType.Originator)) notifyOriginator(monitor, html);
+ if (types.contains(NotifyType.Assignee)) notifyAssignees(monitor, html);
+ if (types.contains(NotifyType.Subscribers)) notifySubscribers(monitor, html);
+ if (types.contains(NotifyType.Completed)) if ((sma instanceof TeamWorkFlowArtifact) && (smaMgr.isCompleted() || smaMgr.isCancelled())) notifyCompletion(
+ monitor, html);
+
+ monitor.done();
+ return Status.OK_STATUS;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, ex.getMessage(), ex);
+ }
+ }
+
+ private void notifyCompletion(IProgressMonitor monitor, String html) {
+ monitor.subTask("Notifying of Completion/Cancellation");
+
+ String emails = "";
+ if (!smaMgr.getOriginator().isMe()) emails = smaMgr.getOriginator().getEmail();
+ if (!testing && AtsPlugin.isAtsAlwaysEmailMe()) {
+ AtsPlugin.getLogger().log(Level.INFO, "NotifyCompletion: Always Email Me Enabled");
+ // For debug purposes, show who would have emailed if email is enabled
+ if (AtsPlugin.isEmailEnabled()) debug.report("AtsAlwaysEmailMe but would have notifyCompletion => " + emails);
+ emails = skynetAuth.getAuthenticatedUser().getEmail();
+ }
+ if (emails.equals("")) {
+ if (testing) System.out.println("notifyCompletion = not sending; no emails to send to");
+ return;
+ }
+ LogItem cancelledItem = smaMgr.getSma().getLog().getStateEvent(LogType.StateCancelled);
+
+ String subjectStr = sma.getArtifactTypeName() + " - \"" + sma.getDescriptiveName() + "\"";
+ String notifyStr = sma.getArtifactTypeName() + " " + stateName + " - " + sma.getDescriptiveName() + "<br><br>";
+ String cancelledStr = "";
+ if (smaMgr.isCancelled() && cancelledItem != null) cancelledStr =
+ String.format(
+ sma.getArtifactTypeName() + " was cancelled from \"%s\" state on \"%s\".<br>Reason: \"%s\"<br><br>",
+ cancelledItem.getState(), cancelledItem.getDate(XDate.MMDDYYHHMM), cancelledItem.getMsg());
+
+ AEmail emailMessage =
+ new AEmail(null, skynetAuth.getAuthenticatedUser().getEmail(),
+ skynetAuth.getAuthenticatedUser().getEmail(), "ATS " + stateName + " Alert: " + subjectStr);
+
+ try {
+ emailMessage.setRecipients(Message.RecipientType.TO, emails);
+ // Remove hyperlinks cause they won't work in email.
+
+ html =
+ html.replaceFirst("<body>",
+ REUtil.quoteMeta("<body>" + (smaMgr.isCancelled() ? cancelledStr : notifyStr)));
+ emailMessage.addHTMLBody(html);
+ if (testing)
+ System.out.println("notifyCompletion = sending to " + emails);
+ else
+ emailMessage.send();
+ } catch (MessagingException ex) {
+ OSEELog.logException(AtsPlugin.class, "Your Email Message could not be sent.", ex, true);
+ }
+ }
+
+ public void notifyOriginator(IProgressMonitor monitor, String html) {
+ monitor.subTask("Notifying Originator");
+ String emails = smaMgr.getOriginator().getEmail();
+ if (!testing && AtsPlugin.isAtsAlwaysEmailMe()) {
+ AtsPlugin.getLogger().log(Level.INFO, "Notifys: Always Email Me Enabled");
+ // For debug purposes, show who would have emailed if email is enabled
+ if (AtsPlugin.isEmailEnabled()) debug.report("AtsAlwaysEmailMe but would have notifyOriginator => " + emails);
+ emails = skynetAuth.getAuthenticatedUser().getEmail();
+ }
+ // Don't send if originator is this user
+ if (!AtsPlugin.isAtsAlwaysEmailMe() && emails.equals(skynetAuth.getAuthenticatedUser().getEmail())) {
+ if (testing) System.out.println("notifyOriginator = not sending; originator is me");
+ return;
+ }
+ // Don't try to send if there are no actives
+ if (emails.equals("")) {
+ if (testing) System.out.println("notifyOriginator = not sending; no emails to send to");
+ return;
+ }
+ String headerStr = "You have been set as the originator of this " + sma.getArtifactTypeName() + ".<br><br>";
+ AEmail emailMessage =
+ new AEmail(null, skynetAuth.getAuthenticatedUser().getEmail(),
+ skynetAuth.getAuthenticatedUser().getEmail(),
+ "ATS Originator Alert: " + sma.getArtifactTypeName() + " - \"" + sma.getDescriptiveName() + "\"\n");
+ try {
+ emailMessage.setRecipients(Message.RecipientType.TO, emails);
+ emailMessage.setHTMLBody(headerStr);
+ emailMessage.addHTMLBody(html);
+ if (testing)
+ System.out.println("notifyOriginator = sending to " + emails);
+ else
+ emailMessage.send();
+ } catch (MessagingException ex) {
+ MessageDialog.openInformation(null, "Message Could Not Be Sent", "Your Email Message could not be sent.");
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ public void notifyAssignees(IProgressMonitor monitor, String html) {
+ monitor.subTask("Notifying Assignees");
+ String emails = "";
+ try {
+
+ if (notifyUsers != null) {
+ notifyUsers.remove(skynetAuth.getAuthenticatedUser());
+ if (notifyUsers.size() == 0) return;
+ emails = getEmails(notifyUsers);
+ } else
+ emails = getActiveEmails();
+ if (!testing && AtsPlugin.isAtsAlwaysEmailMe()) {
+ AtsPlugin.getLogger().log(Level.INFO, "Notifys: Always Email Me Enabled");
+ // For debug purposes, show who would have emailed if email is enabled
+ if (AtsPlugin.isEmailEnabled()) debug.report("AtsAlwaysEmailMe but would have notifyAssignees => " + emails);
+ emails = skynetAuth.getAuthenticatedUser().getEmail();
+ }
+ // Don't send if transition is to this user
+ if (!AtsPlugin.isAtsAlwaysEmailMe() && emails.equals(skynetAuth.getAuthenticatedUser().getEmail())) {
+ if (testing) System.out.println("notifyAssignees = not sending; assignee is me");
+ return;
+ }
+ // Don't try to send if there are no actives (Cancel, Hold or
+ // Completed states)
+ if (emails.equals("")) {
+ if (testing) System.out.println("notifyAssignees = not sending; no emails to send");
+ return;
+ }
+ String headerStr =
+ "You have been identified as an assignee for this " + sma.getArtifactTypeName() + ".<br><br>";
+ AEmail emailMessage =
+ new AEmail(null, skynetAuth.getAuthenticatedUser().getEmail(),
+ skynetAuth.getAuthenticatedUser().getEmail(),
+ "ATS Assignee Alert: " + sma.getArtifactTypeName() + " - \"" + sma.getDescriptiveName() + "\"\n");
+
+ emailMessage.setRecipients(Message.RecipientType.TO, emails);
+ emailMessage.setHTMLBody(headerStr);
+ emailMessage.addHTMLBody(html);
+ if (testing)
+ System.out.println("notifyAssignees = sending to " + emails);
+ else
+ emailMessage.send();
+ } catch (Exception ex) {
+ MessageDialog.openInformation(null, "Message Could Not Be Sent", "Your Email Message could not be sent");
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ private String getActiveEmails() throws SQLException {
+ Collection<User> emails = smaMgr.getAssignees();
+ // Never email current user
+ emails.remove(skynetAuth.getAuthenticatedUser());
+ return getEmails(emails);
+ }
+
+ public static String getEmails(Collection<User> users) {
+ StringBuilder builder = new StringBuilder();
+ for (User u : users) {
+ if (u.getEmail() != null && !u.getEmail().equals("")) builder.append(u.getEmail() + ", ");
+ }
+ return builder.toString().replaceFirst(", $", "");
+ }
+
+ private void notifySubscribers(IProgressMonitor monitor, String html) {
+ try {
+ monitor.subTask("Notifying Subscribers");
+ ArrayList<User> subscribed = sma.getSubscribed();
+ if (subscribed.size() == 0) {
+ if (testing) System.out.println("notifySubscribers = not sending; no-one is subscribed");
+ return;
+ }
+ String emails = "";
+ for (User u : subscribed)
+ emails += u.getEmail() + ", ";
+ emails = emails.replaceFirst(", $", "");
+ if (!testing && AtsPlugin.isAtsAlwaysEmailMe()) {
+ AtsPlugin.getLogger().log(Level.INFO, "NotifySubscribers: Always Email Me Enabled");
+ // For debug purposes, show who would have emailed if email is enabled
+ if (AtsPlugin.isEmailEnabled()) debug.report("AtsAlwaysEmailMe but would have notifySubscribers => " + emails);
+ emails = skynetAuth.getAuthenticatedUser().getEmail();
+ }
+ if (emails.equals("")) {
+ if (testing) System.out.println("notifySubscribers = not sending; emails to send");
+ return;
+ }
+ AEmail emailMessage =
+ new AEmail(
+ null,
+ skynetAuth.getAuthenticatedUser().getEmail(),
+ skynetAuth.getAuthenticatedUser().getEmail(),
+ "ATS Subscription Alert: " + sma.getArtifactTypeName() + " - \"" + sma.getDescriptiveName() + "\"\n");
+ String notifyStr =
+ sma.getArtifactTypeName() + " Transitioned to \"" + sma.getCurrentStateName() + "\"<br><br>";
+ String unsubscribeStr =
+ "<br><br>You are subscribed to receive notification of transition for this " + sma.getArtifactTypeName() + ". <br>Enter OSEE ATS to un-subscribe.";
+
+ emailMessage.setRecipients(Message.RecipientType.TO, emails);
+ // Remove hyperlinks cause they won't work in email.
+ html = html.replaceFirst("<body>", REUtil.quoteMeta("<body>" + notifyStr));
+ html = html.replaceFirst("</html>", REUtil.quoteMeta(unsubscribeStr + "</html>"));
+ emailMessage.addHTMLBody(html);
+ if (testing)
+ System.out.println("notifySubscribers = sending to " + emails);
+ else
+ emailMessage.send();
+ } catch (Exception ex) {
+ MessageDialog.openInformation(null, "Message Could Not Be Sent", "Your Email Message could not be sent.");
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
new file mode 100644
index 00000000000..e9c32288931
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Overview.java
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Set;
+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.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.jdk.core.util.AHTML.CellItem;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.relation.IRelationLink;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+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.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) {
+
+ try {
+ 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.getCurrentStateName(),
+ AHTML.getLabelStr(labelFont, "Type: ") + sma.getArtifactTypeName(),
+ AHTML.getLabelStr(labelFont, "Id: ") + sma.getHumanReadableId()}));
+ addTable(getLabelValue("Originator", smaMgr.getOriginator().getDescriptiveName()), getLabelValue(
+ "Creation Date", smaMgr.getSma().getLog().getStateEvent(LogType.Originated).getDate(XDate.MMDDYYHHMM)));
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact)
+ addTable(getLabelValue("Team", ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamName()), getLabelValue(
+ "Assignees", smaMgr.getAssigneesStr()));
+ else
+ addTable(getLabelValue("Assignees", smaMgr.getAssigneesStr()));
+ addTable(getLabelValue("Description", smaMgr.getSma().getDescription()));
+ if (smaMgr.isCancelled()) {
+ LogItem item = smaMgr.getSma().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).getCurrentStateName()}));
+ }
+
+ SMAManager taskSmaMgr = new SMAManager(sma);
+ this.html.append(AHTML.multiColumnTable(new String[] {AHTML.getLabelStr(labelFont, "Task Owner: ") + taskSmaMgr.getAssigneesStr()}));
+ }
+ endBorderTable();
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ }
+
+ public void addFooter(StateMachineArtifact sma, PreviewStyle... styles) {
+ this.html.append(AHTML.newline());
+
+ if (PreviewStyle.contains(styles, PreviewStyle.HYPEROPEN)) this.html.append("<A HREF=\"" + AtsHttpServerRequest.getInstance().getUrl(
+ sma) + "\">" + "Start OSEE and select here to open this " + sma.getArtifactTypeName() + " in ATS.</A>");
+ }
+
+ public void addRelationsBlock(ATSArtifact artifact) {
+ addRelationTable("Is Superceded By", RelationSide.Supercedes_Supercedes, artifact);
+ addRelationTable("Supercedes", RelationSide.Supercedes_Superceded, artifact);
+ addRelationTable("Issues Addressed By", RelationSide.AddressesIssues_AddressesIssues, artifact);
+ addRelationTable("Addresses Issues In", RelationSide.AddressesIssues_IssuedArtifact, artifact);
+ addRelationTable("Supports", RelationSide.SupportingInfo_SupportedBy, artifact);
+ addRelationTable("Is Supported By", RelationSide.SupportingInfo_SupportingInfo, artifact);
+ }
+
+ public void addNotes(StateMachineArtifact artifact, String state) {
+ if (artifact instanceof StateMachineArtifact) {
+ String notesHtml = ((StateMachineArtifact) artifact).getNotes().getTable(state);
+ if (notesHtml.equals("")) return;
+ this.html.append(notesHtml);
+ }
+ }
+
+ public void addNotes(Artifact artifact) {
+ if (artifact instanceof StateMachineArtifact) {
+ String notesHtml = ((StateMachineArtifact) artifact).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, RelationSide side, Artifact parent) {
+ try {
+ Set<Artifact> arts = parent.getArtifacts(side);
+ if (arts.size() == 0) return;
+ startBorderTable(false, name);
+ html.append(AHTML.addHeaderRowMultiColumnTable(new String[] {"Type", "Name", "Rationale"}));
+ for (Artifact art : arts) {
+ String rationale = "";
+ IRelationLink 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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ public void addTeams(Collection<TeamWorkFlowArtifact> teams) {
+ 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.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(Artifact art, int transId) {
+ String str =
+ AHTML.getHyperlink(ResultBrowserHyperCmd.getHyperCmdStr(ResultBrowserHyperCmd.openTransAction,
+ String.format("%s,%s", art.getGuid(), transId + "")), art.getDescriptiveName());
+ return str;
+ }
+
+ 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) {
+ ATSLog artifactLog = artifact.getLog();
+ if (artifactLog != null && artifactLog.getLogItems().size() > 0) addTable(artifact.getLog().getTable());
+ }
+
+ public void startStateBorderTable(SMAManager smaMgr, SMAState state) {
+ String caption = state.getName();
+ String assgn = Artifacts.commaArts(state.getAssignees());
+ startStateBorderTable(smaMgr.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java
new file mode 100644
index 00000000000..41f83a36cc2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/SMAMetrics.java
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.Date;
+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.TaskArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class SMAMetrics {
+
+ private static int MILLISECS_PER_DAY = (1000 * 60 * 60 * 24);
+
+ public static String getEstRemainMetrics(Collection<StateMachineArtifact> smas) {
+ if (smas.size() == 0) return "";
+ try {
+ int numTeamWfs = 0;
+ int numTasks = 0;
+ for (Artifact art : smas) {
+ if (art instanceof TeamWorkFlowArtifact) {
+ smas.add((TeamWorkFlowArtifact) art);
+ numTeamWfs++;
+ } else if ((art instanceof ActionArtifact) && ((ActionArtifact) art).getTeamWorkFlowArtifacts().size() > 0) {
+ smas.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ numTeamWfs += ((ActionArtifact) art).getTeamWorkFlowArtifacts().size();
+ } else if (art instanceof TaskArtifact) {
+ smas.add((TaskArtifact) art);
+ numTasks++;
+ }
+ }
+ int numObjects = numTasks + numTeamWfs;
+ double estHours = 0;
+ double hrsRemain = 0;
+ double hrsSpent = 0;
+ double manDaysNeeded = 0;
+ double totalPercentComplete = 0;
+ for (StateMachineArtifact team : smas) {
+ hrsRemain += team.getWorldViewRemainHours();
+ estHours += team.getWorldViewEstimatedHours();
+ hrsSpent += team.getWorldViewTotalHoursSpent();
+ manDaysNeeded += team.getWorldViewManDaysNeeded();
+ totalPercentComplete += team.getWorldViewTotalPercentComplete();
+ }
+ double percentComplete = 0;
+ if (numObjects > 0 && totalPercentComplete > 0) percentComplete = totalPercentComplete / numObjects;
+ return String.format(" Selected %s %s EstHrs: %5.2f %sCmp: %5.2f RmnHrs: %5.2f HrsSpnt: %5.2f %s",
+ (numTeamWfs > 0 ? "TeamWFs: " + numTeamWfs : ""), (numTasks > 0 ? "Tasks: " + numTasks : ""), estHours,
+ "%", percentComplete, hrsRemain, hrsSpent, (manDaysNeeded > 0 ? String.format("ManDaysNeeded: %5.2f ",
+ manDaysNeeded) : ""));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Exception occurred - see log";
+ }
+ }
+
+ private static double manDayHrs = 7.2;
+
+ public static String getReleaseEstRemainMetrics(Collection<StateMachineArtifact> smas) {
+ if (smas.size() == 0) return "";
+ try {
+ Artifact art = smas.iterator().next();
+ TeamWorkFlowArtifact selTeam = null;
+ if (art instanceof TeamWorkFlowArtifact)
+ selTeam = (TeamWorkFlowArtifact) art;
+ else if ((art instanceof ActionArtifact) && ((ActionArtifact) art).getTeamWorkFlowArtifacts().size() == 1) selTeam =
+ ((ActionArtifact) art).getTeamWorkFlowArtifacts().iterator().next();
+ if (selTeam != null) {
+ if (selTeam.getTargetedForVersion() != null) {
+ VersionArtifact verArt = selTeam.getTargetedForVersion();
+ Collection<TeamWorkFlowArtifact> teams = verArt.getTargetedForTeamArtifacts();
+ double estHours = 0;
+ double hrsRemain = 0;
+ double hrsSpent = 0;
+ for (TeamWorkFlowArtifact team : teams) {
+ hrsRemain += team.getWorldViewRemainHours();
+ estHours += team.getWorldViewEstimatedHours();
+ hrsSpent += team.getWorldViewTotalHoursSpent();
+ }
+ Date estRelDate = verArt.getEstimatedReleaseDate();
+ double manDaysNeeded = 0;
+ if (hrsRemain != 0) manDaysNeeded = hrsRemain / manDayHrs;
+ String daysLeft = "";
+ Date today = new Date();
+ long daysTillRel = 0;
+ if (estRelDate != null && estRelDate.after(today)) {
+ daysTillRel = (estRelDate.getTime() - today.getTime()) / MILLISECS_PER_DAY;
+ daysLeft = String.format(" DaysLft: %d", daysTillRel);
+ }
+ return String.format(
+ " Target Version: %s EstRelDate: %s %s TeamWFs: %s EstHrs: %5.2f RmnHrs: %5.2f HrsSpnt: %5.2f ManDaysNeeded: %5.2f ",
+ verArt.getDescriptiveName(), XDate.getDateStr(estRelDate, XDate.MMDDYY), daysLeft, teams.size(),
+ estHours, hrsRemain, hrsSpent, manDaysNeeded);
+
+ }
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Exception occurred - see log";
+ }
+ return "";
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.java
new file mode 100644
index 00000000000..caa1cd1bed3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/Subscribe.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.sql.SQLException;
+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.skynet.core.SkynetAuthentication;
+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() {
+ try {
+ if (((ISubscribableArtifact) sma).amISubscribed()) {
+ boolean 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(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+ } else {
+ boolean 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(SkynetAuthentication.getInstance().getAuthenticatedUser());
+ }
+
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.java
new file mode 100644
index 00000000000..6855ded7a63
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/VersionReportJob.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.util;
+
+import java.sql.SQLException;
+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.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 (SQLException 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 SQLException {
+ 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 SQLException {
+ // 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 IllegalStateException, SQLException {
+ String released = "";
+ if (verArt.getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName()) != null) {
+ released =
+ " - " + "Released: " + getDateString(verArt.getSoleDateAttributeValue(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getStoreName()));
+ }
+ return released;
+ }
+
+ public static String getTeamWorkflowReport(Collection<TeamWorkFlowArtifact> teamArts, Integer backgroundColor, IProgressMonitor monitor) throws SQLException {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java
new file mode 100644
index 00000000000..3fbbbcae086
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/DecisionOption.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+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() {
+ 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(SkynetAuthentication.getInstance().getUserByIdWithError(m.group(3)));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.java
new file mode 100644
index 00000000000..000c3b934e1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/ReviewManager.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.util.widgets;
+
+import java.sql.SQLException;
+import java.util.Arrays;
+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.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.editor.SMAManager;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+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
+ * @return new review
+ * @throws SQLException
+ */
+ public DecisionReviewArtifact createValidateReview(boolean force) throws SQLException {
+ // If not validate page, don't do anything
+ if (!force && !smaMgr.getWorkPage().isValidatePage()) 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(), true);
+ decRev.setDescriptiveName(VALIDATE_REVIEW_TITLE);
+ decRev.setSoleAttributeValue(ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName(), "");
+ decRev.setSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(),
+ "No;Followup;" + getValidateReviewFollowupUsersStr() + "\n" + "Yes;Completed;");
+ decRev.setSoleBooleanAttributeValue(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE.getStoreName(),
+ smaMgr.getWorkPage().isValidateReviewBlocking());
+
+ SMAManager revSmaMgr = new SMAManager(decRev);
+ revSmaMgr.transition(DecisionReviewArtifact.StateNames.Decision.name(), smaMgr.getOriginator(), true);
+
+ return decRev;
+
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return null;
+ }
+
+ public PeerToPeerReviewArtifact createNewPeerToPeerReview(String againstState) throws SQLException {
+ return createNewPeerToPeerReview(againstState, SkynetAuthentication.getInstance().getAuthenticatedUser(),
+ new Date());
+ }
+
+ public PeerToPeerReviewArtifact createNewPeerToPeerReview(String againstState, User origUser, Date origDate) throws SQLException {
+ return createNewPeerToPeerReview(smaMgr.getSma(), againstState, origUser, origDate);
+ }
+
+ public static PeerToPeerReviewArtifact createNewPeerToPeerReview(StateMachineArtifact teamParent, String againstState, User origUser, Date origDate) throws SQLException {
+ PeerToPeerReviewArtifact peerToPeerRev =
+ (PeerToPeerReviewArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ PeerToPeerReviewArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+
+ if (teamParent != null) {
+ teamParent.relate(RelationSide.TeamWorkflowToReview_Review, peerToPeerRev);
+ if (againstState != null) peerToPeerRev.setSoleAttributeValue(
+ ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(), againstState);
+ }
+
+ peerToPeerRev.getLog().addLog(LogType.Originated, "", "", origDate, origUser);
+ peerToPeerRev.setDescriptiveName("Peer to Peer Review");
+ peerToPeerRev.setSoleBooleanAttributeValue(ATSAttributes.BLOCKING_REVIEW_ATTRIBUTE.getStoreName(), false);
+
+ // Set state
+ // Set current state and POCs
+ peerToPeerRev.getCurrentStateDam().setState(
+ new SMAState(DecisionReviewArtifact.StateNames.Prepare.name(),
+ SkynetAuthentication.getInstance().getAuthenticatedUser()));
+ peerToPeerRev.getLog().addLog(LogType.StateEntered, DecisionReviewArtifact.StateNames.Prepare.name(), "",
+ origDate, origUser);
+ peerToPeerRev.persist(true);
+ return peerToPeerRev;
+ }
+
+ public String getValidateReviewFollowupUsersStr() {
+ try {
+ return SMAState.getAssigneesStorageString(getValidateReviewFollowupUsers());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public Collection<User> getValidateReviewFollowupUsers() throws SQLException {
+ SMAState state = smaMgr.getSMAState("Implement", false);
+ // Try to find an Implement state and it's assignees
+ if (state != null && state.getAssignees().size() > 0) return state.getAssignees();
+ try {
+ // Else if Team Workflow , return it to the leads of this team
+ if (smaMgr.getSma() instanceof TeamWorkFlowArtifact) return ((TeamWorkFlowArtifact) smaMgr.getSma()).getTeamDefinition().getLeads();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ // Else, return current user; should never hit this
+ return Arrays.asList(new User[] {SkynetAuthentication.getInstance().getAuthenticatedUser()});
+ }
+
+ public Collection<ReviewSMArtifact> getReviews() throws SQLException {
+ return smaMgr.getSma().getArtifacts(RelationSide.TeamWorkflowToReview_Review, ReviewSMArtifact.class);
+ }
+
+ public Collection<ReviewSMArtifact> getReviewsFromCurrentState() throws SQLException {
+ return getReviews(smaMgr.getSma().getCurrentStateName());
+ }
+
+ public Collection<ReviewSMArtifact> getReviews(String stateName) throws SQLException {
+ 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() {
+ return smaMgr.getSma().hasArtifacts(RelationSide.TeamWorkflowToReview_Review);
+ }
+
+ 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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return Result.TrueResult;
+ }
+
+ public static Collection<String> getAllReviewArtifactTypeNames() {
+ return Arrays.asList(new String[] {DecisionReviewArtifact.ARTIFACT_NAME, PeerToPeerReviewArtifact.ARTIFACT_NAME});
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java
new file mode 100644
index 00000000000..df06edcc218
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/SMAState.java
@@ -0,0 +1,203 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+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);
+ }
+
+ 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
+ */
+ public void setAssignees(Collection<User> assignees) {
+ if (assignees.size() > 0 && (name.equals(DefaultTeamState.Completed.name()) || name.equals(DefaultTeamState.Cancelled.name()))) throw new IllegalStateException(
+ "Can't assign completed/cancelled states.");
+ this.assignees.clear();
+ if (assignees != null) this.assignees.addAll(assignees);
+ }
+
+ public void clearAssignees() {
+ this.assignees.clear();
+ }
+
+ /**
+ * 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) {
+ if (assignee != null && (name.equals(DefaultTeamState.Completed.name()) || name.equals(DefaultTeamState.Cancelled.name()))) throw new IllegalStateException(
+ "Can't assign completed/cancelled states.");
+ this.assignees.clear();
+ if (assignee != null) this.assignees.add(assignee);
+ }
+
+ /**
+ * @param assignee
+ */
+ public void addAssignee(User assignee) {
+ 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() {
+ StringBuffer sb = new StringBuffer(name);
+ sb.append(";");
+ sb.append(getAssigneesStorageString(assignees));
+ sb.append(";");
+ if (hoursSpent > 0) sb.append(getHoursSpentStr());
+ sb.append(";");
+ if (percentComplete > 0) sb.append(percentComplete);
+ return sb.toString();
+ }
+
+ public static String getAssigneesStorageString(Collection<User> users) {
+ StringBuffer sb = new StringBuffer();
+ for (User u : users)
+ sb.append("<" + u.getUserId() + ">");
+ return sb.toString();
+ }
+
+ public static Pattern storagePattern = Pattern.compile("^(.*?);(.*?);(.*?);(.*?)$");
+ public static Pattern userPattern = Pattern.compile("<(.*?)>");
+
+ public void setFromXml(String xml) {
+ if (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();
+ m = userPattern.matcher(m.group(2));
+ while (m.find()) {
+ try {
+ User u = SkynetAuthentication.getInstance().getUserByIdWithError(m.group(1));
+ if (u == null)
+ throw new IllegalArgumentException("Can't retrieve user => " + m.group(1));
+ else
+ assignees.add(u);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ } else
+ throw new IllegalArgumentException("Can't unpack state data => " + xml);
+ }
+
+ /**
+ * @return Returns the hoursSpent.
+ */
+ public double getHoursSpent() {
+ return hoursSpent;
+ }
+
+ public String getHoursSpentStr() {
+ return String.format("%4.2f", 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.java
new file mode 100644
index 00000000000..35a3c959264
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/TaskManager.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;
+
+import java.sql.SQLException;
+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.TaskArtifact;
+import org.eclipse.osee.ats.artifact.ATSLog.LogType;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+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 static SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ private final SMAManager smaMgr;
+
+ public TaskManager(SMAManager smaMgr) {
+ super();
+ this.smaMgr = smaMgr;
+ }
+
+ public Collection<TaskArtifact> getTaskArtifacts() throws SQLException {
+ return smaMgr.getSma().getArtifacts(RelationSide.SmaToTask_Task, TaskArtifact.class);
+ }
+
+ public Collection<TaskArtifact> getTaskArtifactsFromCurrentState() throws SQLException {
+ return getTaskArtifacts(smaMgr.getSma().getCurrentStateName());
+ }
+
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws SQLException {
+ List<TaskArtifact> arts = new ArrayList<TaskArtifact>();
+ for (TaskArtifact taskArt : smaMgr.getSma().getArtifacts(RelationSide.SmaToTask_Task, TaskArtifact.class)) {
+ if (taskArt.getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName()).equals(stateName)) arts.add(taskArt);
+ }
+ return arts;
+ }
+
+ public boolean hasTaskArtifacts() {
+ return smaMgr.getSma().hasArtifacts(RelationSide.SmaToTask_Task);
+ }
+
+ public TaskArtifact createNewTask(String title, boolean persist) throws SQLException {
+ return createNewTask(Arrays.asList(new User[] {skynetAuth.getAuthenticatedUser()}), title, persist);
+ }
+
+ public TaskArtifact createNewTask(User assignee, String title, boolean persist) throws SQLException {
+ return createNewTask(Arrays.asList(new User[] {assignee}), title, persist);
+ }
+
+ public TaskArtifact createNewTask(Collection<User> assignees, String title, boolean persist) throws SQLException {
+ TaskArtifact taskArt = null;
+ taskArt =
+ (TaskArtifact) ConfigurationPersistenceManager.getInstance().getArtifactSubtypeDescriptor(
+ TaskArtifact.ARTIFACT_NAME, BranchPersistenceManager.getInstance().getAtsBranch()).makeNewArtifact();
+ taskArt.getLog().addLog(LogType.Originated, "", "");
+ taskArt.setDescriptiveName(title);
+
+ // Set current state and POCs
+ taskArt.getCurrentStateDam().setState(new SMAState("InWork", assignees));
+ taskArt.getLog().addLog(LogType.StateEntered, "InWork", "");
+
+ // Set parent state task is related to
+ taskArt.setAttribute(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName(),
+ smaMgr.getSma().getCurrentStateName());
+
+ if (persist) taskArt.persist();
+ smaMgr.getSma().relate(RelationSide.SmaToTask_Task, taskArt, persist);
+
+ 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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return Result.TrueResult;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.java
new file mode 100644
index 00000000000..afb3377cc0f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XActionableItemsDam.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.util.widgets;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+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.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
+import org.eclipse.osee.framework.skynet.core.attribute.DynamicAttributeManager;
+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.XTextDam;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XActionableItemsDam extends XTextDam {
+
+ protected final Artifact sma;
+ private static ArtifactPersistenceManager apm = ArtifactPersistenceManager.getInstance();
+
+ public XActionableItemsDam(Artifact sma) {
+ super(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName());
+ this.sma = sma;
+ }
+
+ public DynamicAttributeManager getDam() throws SQLException {
+ return sma.getAttributeManager(ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName());
+ }
+
+ public Set<ActionableItemArtifact> getActionableItems() throws SQLException {
+ Set<ActionableItemArtifact> ais = new HashSet<ActionableItemArtifact>();
+ for (Attribute attr : getDam().getAttributes()) {
+ try {
+ ais.add((ActionableItemArtifact) apm.getArtifact(attr.getStringData(),
+ BranchPersistenceManager.getInstance().getAtsBranch()));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ return ais;
+ }
+
+ public String getActionableItemsStr() {
+ try {
+ StringBuffer sb = new StringBuffer();
+ for (ActionableItemArtifact aia : getActionableItems())
+ sb.append(aia.getDescriptiveName() + ", ");
+ return sb.toString().replaceFirst(", $", "");
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+
+ public Set<String> getActionableItemGuids() throws SQLException {
+ Set<String> ais = new HashSet<String>();
+ for (Attribute attr : getDam().getAttributes())
+ ais.add(attr.getStringData());
+ return ais;
+ }
+
+ public void addActionableItem(ActionableItemArtifact aia) throws SQLException {
+ if (!getActionableItemGuids().contains(aia.getGuid())) getDam().getNewAttribute().setStringData(aia.getGuid());
+ }
+
+ public void removeActionableItem(ActionableItemArtifact aia) throws SQLException {
+ for (Attribute attr : getDam().getAttributes()) {
+ if (aia.getGuid().equals(attr.getStringData())) attr.delete();
+ }
+ }
+
+ public Result setActionableItems(Collection<ActionableItemArtifact> newItems) throws SQLException {
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.java
new file mode 100644
index 00000000000..7b5eb398950
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XCurrentStateDam.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.util.widgets;
+
+import java.sql.SQLException;
+import java.util.Date;
+import java.util.Set;
+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.ATSLog.LogType;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XCurrentStateDam extends XStateAssigneesDam {
+
+ public XCurrentStateDam(StateMachineArtifact sma) {
+ super(sma, "ats.Current State");
+ }
+
+ public SMAState getState() {
+ Set<SMAState> states = getStates();
+ if (states.size() != 1) throw new IllegalArgumentException(
+ "Must be one current state. Found " + states.size() + " for " + sma.getHumanReadableId());
+ return states.iterator().next();
+ }
+
+ @Override
+ public void setState(SMAState state) throws IllegalStateException, SQLException {
+ sma.setSoleAttributeValue(attributeName, state.toXml());
+ }
+
+ public void logMetrics() {
+ if (sma instanceof TaskArtifact) logMetrics(sma, sma.getWorldViewTotalPercentComplete() + "",
+ AtsLib.doubleToStrString(sma.getWorldViewTotalHoursSpent()),
+ SkynetAuthentication.getInstance().getAuthenticatedUser(), new Date());
+ }
+
+ public static void logMetrics(StateMachineArtifact sma, String percent, String hours, User user, Date date) {
+ LogItem logItem =
+ new LogItem(LogType.Metrics, date, user, "", String.format("Percent %s Hours %s", percent, hours));
+ sma.getLog().addLogItem(logItem);
+ }
+
+ /**
+ * Set hours spent on the current state
+ *
+ * @param hoursSpent The hoursSpent to set.
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void setHoursSpent(double hoursSpent) throws IllegalStateException, SQLException {
+ SMAState currState = getState();
+ currState.setHoursSpent(hoursSpent);
+ setState(currState);
+ logMetrics();
+ }
+
+ /**
+ * Add hours spent on the current state
+ *
+ * @param hoursSpent The hoursSpent to set.
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void addHoursSpent(double hoursSpent) throws IllegalStateException, SQLException {
+ SMAState currState = getState();
+ currState.setHoursSpent(hoursSpent + currState.getHoursSpent());
+ setState(currState);
+ logMetrics();
+ }
+
+ /**
+ * Set percent complete on the current state
+ *
+ * @param percentComplete The percentComplete to set.
+ * @throws SQLException
+ * @throws IllegalStateException
+ */
+ public void setPercentComplete(int percentComplete) throws IllegalStateException, SQLException {
+ SMAState currState = getState();
+ currState.setPercentComplete(percentComplete);
+ setState(currState);
+ logMetrics();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.java
new file mode 100644
index 00000000000..8170b39eb31
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XDecisionOptions.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.util.widgets;
+
+import java.sql.SQLException;
+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.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) {
+ 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() {
+ 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) {
+ for (DecisionOption opt : getDecisionOptions()) {
+ if (opt.getName().equals(name)) return opt;
+ }
+ return null;
+ }
+
+ public Result validateDecisionOptions() {
+ 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) {
+ StringBuffer sb = new StringBuffer();
+ for (DecisionOption opt : opts)
+ sb.append(opt.toXml() + "\n");
+ return sb.toString().replaceFirst("\n$", "");
+ }
+
+ public void setDecisionOptions(String decisionOptions) throws IllegalStateException, SQLException {
+ sma.setSoleAttributeValue(ATSAttributes.DECISION_REVIEW_OPTIONS_ATTRIBUTE.getStoreName(),
+ toXml(getDecisionOptions(decisionOptions)));
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.java
new file mode 100644
index 00000000000..610fea6a94b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateAssigneesDam.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.util.widgets;
+
+import java.sql.SQLException;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
+import org.eclipse.osee.framework.skynet.core.attribute.DynamicAttributeManager;
+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.XTextDam;
+
+/**
+ * @author Donald G. Dunne
+ */
+public abstract class XStateAssigneesDam extends XTextDam {
+
+ protected final String attributeName;
+ protected final StateMachineArtifact sma;
+
+ public XStateAssigneesDam(StateMachineArtifact sma, String attributeName) {
+ super(attributeName);
+ this.sma = sma;
+ this.attributeName = attributeName;
+ try {
+ setArtifact(sma, attributeName);
+ } catch (SQLException ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+
+ public DynamicAttributeManager getDam() throws SQLException {
+ return sma.getAttributeManager(attributeName);
+ }
+
+ public SMAState getState(String stateName, boolean create) {
+ try {
+ for (Attribute attr : getDam().getAttributes()) {
+ if (attr.getStringData().startsWith(stateName + ";")) {
+ SMAState state = new SMAState();
+ state.setFromXml(attr.getStringData());
+ return state;
+ }
+ }
+ if (create) return new SMAState(stateName);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return null;
+ }
+
+ public Set<SMAState> getStates() {
+ Set<SMAState> states = new HashSet<SMAState>();
+ try {
+ for (Attribute attr : getDam().getAttributes()) {
+ SMAState state = new SMAState();
+ state.setFromXml(attr.getStringData());
+ states.add(state);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return states;
+ }
+
+ public void setState(SMAState state) throws IllegalStateException, SQLException {
+ // Update attribute if it already exists
+ for (Attribute attr : getDam().getAttributes()) {
+ SMAState storedState = new SMAState();
+ storedState.setFromXml(attr.getStringData());
+ if (state.getName().equals(storedState.getName())) {
+ attr.setStringData(state.toXml());
+ return;
+ }
+ }
+ // Else, doesn't exist yet, create
+ getDam().getNewAttribute().setStringData(state.toXml());
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.java
new file mode 100644
index 00000000000..b1bd4c65d44
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XStateDam.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.util.widgets;
+
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XStateDam extends XStateAssigneesDam {
+
+ public XStateDam(StateMachineArtifact sma) {
+ super(sma, "ats.State");
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XWidgetProvider.java
new file mode 100644
index 00000000000..640392f6c99
--- /dev/null
+++ b/MS_0.1.4_20080103/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, boolean labelAfter, DynamicXWidgetLayoutData widgetLayoutData) {
+
+ if (widgetName.equals("XDefectViewer")) {
+ return new XDefectViewer();
+ } else if (widgetName.equals("XUserRoleViewer")) {
+ return new XUserRoleViewer();
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectColumn.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectColumn.java
new file mode 100644
index 00000000000..c8d2ade54b7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectColumn.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum DefectColumn {
+
+ Empty_Col("", 0, SWT.LEFT, false, SortDataType.String, false),
+
+ Severity_Col("Severity", 35, SWT.LEFT, true, SortDataType.String, false),
+
+ Disposition_Col("Disposition", 35, SWT.CENTER, true, SortDataType.String, false),
+
+ Closed_Col("Closed", 80, SWT.LEFT, true, SortDataType.Boolean, false),
+
+ User_Col("User", 100, SWT.LEFT, true, SortDataType.String, false),
+
+ Created_Date_Col("Created Date", 80, SWT.LEFT, true, SortDataType.Date, false),
+
+ Injection_Activity_Col("Injection Activity", 35, SWT.LEFT, true, SortDataType.String, false),
+
+ Description_Col("Description", 200, SWT.CENTER, true, SortDataType.String, false),
+
+ Location_Col("Location", 200, SWT.LEFT, true, SortDataType.String, false),
+
+ Resolution_Col("Resolution", 200, SWT.LEFT, true, SortDataType.String, false);
+
+ private final String name;
+ private final int width;
+ private final int align;
+ private final boolean show;
+ private final SortDataType sortDataType;
+ private final String desc;
+ private static Map<String, DefectColumn> nameToAtsXColumn = new HashMap<String, DefectColumn>();
+ private final boolean multiColumnEditable;
+
+ public static DefectColumn getAtsXColumn(XViewerColumn xCol) {
+ if (nameToAtsXColumn.size() == 0) {
+ for (DefectColumn atsCol : DefectColumn.values())
+ nameToAtsXColumn.put(atsCol.getName(), atsCol);
+ }
+ return nameToAtsXColumn.get(xCol.getSystemName());
+ }
+
+ public XViewerColumn getXViewerColumn(DefectColumn atsXCol) {
+ XViewerColumn xCol =
+ new XViewerColumn(atsXCol.name, atsXCol.width, atsXCol.width, atsXCol.align, atsXCol.isShow(),
+ atsXCol.sortDataType, 0);
+ if (atsXCol.getDesc() != null)
+ xCol.setToolTip(atsXCol.getName() + ":\n" + atsXCol.getDesc());
+ else
+ xCol.setToolTip(atsXCol.getDesc());
+ return xCol;
+ }
+
+ private DefectColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable) {
+ this(name, width, align, show, sortDataType, multiColumnEditable, null);
+ }
+
+ private DefectColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String desc) {
+ this.name = name;
+ this.width = width;
+ this.align = align;
+ this.show = show;
+ this.sortDataType = sortDataType;
+ this.multiColumnEditable = multiColumnEditable;
+ this.desc = desc;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the align
+ */
+ public int getAlign() {
+ return align;
+ }
+
+ /**
+ * @return the show
+ */
+ public boolean isShow() {
+ return show;
+ }
+
+ /**
+ * @return the sortDataType
+ */
+ public SortDataType getSortDataType() {
+ return sortDataType;
+ }
+
+ /**
+ * @return the width
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * @return the desc
+ */
+ public String getDesc() {
+ return desc;
+ }
+
+ public boolean isMultiColumnEditable() {
+ return multiColumnEditable;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.java
new file mode 100644
index 00000000000..e1884c7eedd
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectContentProvider.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.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(new DefectItem[] {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(new Artifact[] {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() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /**
+ * @return the rootSet
+ */
+ public Collection<DefectItem> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java
new file mode 100644
index 00000000000..aa7f349b589
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectItem.java
@@ -0,0 +1,256 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+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;
+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 = SkynetAuthentication.getInstance().getAuthenticatedUser();
+ 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 void update(DefectItem dItem) {
+ 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 DefectItem() {
+ }
+
+ public String getDate(String pattern) {
+ if (pattern != null) return (new SimpleDateFormat(pattern)).format(date);
+ return date.toString();
+ }
+
+ public DefectItem(String xml) {
+ fromXml(xml);
+ }
+
+ @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() {
+ 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>";
+ }
+
+ public void fromXml(String xml) {
+ 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;
+ try {
+ this.user = SkynetAuthentication.getInstance().getUserByIdWithError(AXml.getTagData(xml, "user"));
+ } catch (SQLException ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, false);
+ }
+ this.description = AXml.getTagData(xml, "description");
+ this.location = AXml.getTagData(xml, "location");
+ this.resolution = AXml.getTagData(xml, "resoltuion");
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.java
new file mode 100644
index 00000000000..01e8fdc8722
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectLabelProvider.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.util.widgets.defect;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+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.skynet.core.SkynetAuthentication;
+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.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+public class DefectLabelProvider implements ITableLabelProvider {
+ Font font = null;
+
+ private final DefectXViewer treeViewer;
+
+ public DefectLabelProvider(DefectXViewer treeViewer) {
+ super();
+ this.treeViewer = treeViewer;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof String) {
+ if (columnIndex == 1)
+ return (String) element;
+ else
+ return "";
+ }
+ DefectItem defectItem = ((DefectItem) element);
+ if (defectItem == null) return "";
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ DefectColumn aCol = DefectColumn.getAtsXColumn(xCol);
+ return getColumnText(element, columnIndex, defectItem, xCol, aCol);
+ }
+ return "";
+ }
+
+ /**
+ * Provided as optimization of subclassed classes so provider doesn't have to retrieve the same information that has
+ * already been retrieved
+ *
+ * @param element
+ * @param columnIndex
+ * @param defectItem
+ * @param xCol
+ * @param aCol
+ * @return column string
+ */
+ public String getColumnText(Object element, int columnIndex, DefectItem defectItem, XViewerColumn xCol, DefectColumn aCol) {
+ if (!xCol.isShow()) return ""; // Since not shown, don't display
+ if (aCol == DefectColumn.User_Col)
+ return defectItem.getUser().getName();
+ else if (aCol == DefectColumn.Closed_Col)
+ return String.valueOf(defectItem.isClosed());
+ else if (aCol == DefectColumn.Created_Date_Col)
+ return defectItem.getCreatedDate(XDate.MMDDYYHHMM);
+ else if (aCol == DefectColumn.Description_Col)
+ return defectItem.getDescription();
+ else if (aCol == DefectColumn.Resolution_Col)
+ return defectItem.getResolution();
+ else if (aCol == DefectColumn.Location_Col)
+ return defectItem.getLocation();
+ else if (aCol == DefectColumn.Severity_Col)
+ return defectItem.getSeverity() == Severity.None ? "" : defectItem.getSeverity().name();
+ else if (aCol == DefectColumn.Disposition_Col)
+ return defectItem.getDisposition() == Disposition.None ? "" : defectItem.getDisposition().name();
+ else if (aCol == DefectColumn.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 treeViewer;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (element instanceof String) return null;
+ DefectItem defectItem = (DefectItem) element;
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol == null) return null;
+ DefectColumn dCol = DefectColumn.getAtsXColumn(xCol);
+ if (!xCol.isShow()) return null; // Since not shown, don't display
+ if (dCol == DefectColumn.Severity_Col)
+ return Severity.getImage(defectItem.getSeverity());
+ else if (dCol == DefectColumn.Disposition_Col)
+ return Disposition.getImage(defectItem.getDisposition());
+ else if (dCol == DefectColumn.User_Col) {
+ if (defectItem.getUser().equals(SkynetAuthentication.getInstance().getAuthenticatedUser()))
+ return SkynetGuiPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return SkynetGuiPlugin.getInstance().getImage("user_sm.gif");
+ }
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectManager.java
new file mode 100644
index 00000000000..2ce0d444636
--- /dev/null
+++ b/MS_0.1.4_20080103/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 org.eclipse.osee.ats.util.widgets.defect.DefectItem.Severity;
+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.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+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 final SkynetAuthentication skynetAuth = SkynetAuthentication.getInstance();
+ private static String ATS_DEFECT_TAG = "AtsDefect";
+ private static String DEFECT_ITEM_TAG = "Item";
+ private static String REVIEW_DEFECT_ATTRIBUTE_NAME = "ats.Review Defect";
+
+ public DefectManager(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getHtml() {
+ 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() {
+ Set<DefectItem> defectItems = new HashSet<DefectItem>();
+ 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()) {
+ DefectItem item = new DefectItem(m.group());
+ defectItems.add(item);
+ }
+ return defectItems;
+ }
+
+ public int getNumMajor() {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Major) x++;
+ return x;
+ }
+
+ public int getNumMinor() {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Minor) x++;
+ return x;
+ }
+
+ public int getNumIssues() {
+ int x = 0;
+ for (DefectItem dItem : getDefectItems())
+ if (dItem.getSeverity() == Severity.Issue) x++;
+ return x;
+ }
+
+ private void saveDefectItems(Set<DefectItem> defectItems, boolean persist) {
+ 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.persist();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, "Can't create ats review defect document", ex, true);
+ }
+ }
+
+ public void addOrUpdateDefectItem(DefectItem defectItem, boolean persist) {
+ 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);
+ }
+
+ public void removeDefectItem(DefectItem defectItem, boolean persist) {
+ Set<DefectItem> defectItems = getDefectItems();
+ defectItems.remove(defectItem);
+ saveDefectItems(defectItems, persist);
+ }
+
+ public void addDefectItem(String description, boolean persist) {
+ DefectItem item = new DefectItem();
+ item.setDescription(description);
+ addOrUpdateDefectItem(item, persist);
+ }
+
+ public void clearLog(boolean persist) {
+ saveDefectItems(new HashSet<DefectItem>(), persist);
+ }
+
+ public String getTable() {
+ 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(skynetAuth.getAuthenticatedUser()))
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
new file mode 100644
index 00000000000..110885cd37b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewer.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.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.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.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.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 static String NAMESPACE = "osee.ats.DefectXViewer";
+ private final XDefectViewer xDefectViewer;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public DefectXViewer(Composite parent, int style, XDefectViewer xViewer) {
+ this(parent, style, NAMESPACE, new DefectXViewerFactory(), xViewer);
+ }
+
+ public DefectXViewer(Composite parent, int style, String nameSpace, IXViewerFactory xViewerFactory, XDefectViewer xDefectViewer) {
+ super(parent, style, nameSpace, 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();
+ }
+ });
+ }
+
+ @Override
+ public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ DefectColumn aCol = DefectColumn.getAtsXColumn((XViewerColumn) treeColumn.getData());
+ XViewerColumn xCol = getCustomize().getCurrentCustData().getColumnData().getXColumn(aCol.getName());
+ if (!xCol.isShow() || !aCol.isMultiColumnEditable()) return false;
+ return true;
+ }
+
+ @Override
+ public boolean isColumnMultiEditEnabled() {
+ return true;
+ }
+
+ 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) {
+ ((DefectContentProvider) getContentProvider()).add(defectItems);
+ }
+
+ public void set(Collection<? extends DefectItem> defectItems) {
+ ((DefectContentProvider) getContentProvider()).set(defectItems);
+ }
+
+ public void clear() {
+ ((DefectContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ 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 osee.ats.viewer.XViewer#handleAltLeftClick(org.eclipse.swt.widgets.TreeColumn,
+ * org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ try {
+ // System.out.println("Column " + treeColumn.getText() + " item " +
+ // treeItem);
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ DefectColumn aCol = DefectColumn.getAtsXColumn(xCol);
+ DefectItem defectItem = (DefectItem) treeItem.getData();
+ boolean modified = false;
+ if (aCol == DefectColumn.Created_Date_Col) {
+ Date selDate = XPromptChange.promptChangeDate(aCol.getName(), defectItem.getDate());
+ if (selDate != null) {
+ modified = true;
+ defectItem.setDate(selDate);
+ }
+ } else if (aCol == DefectColumn.Closed_Col) {
+ Boolean closed = XPromptChange.promptChangeBoolean(aCol.getName(), aCol.getName(), defectItem.isClosed());
+ if (closed != null && (defectItem.isClosed() != closed)) {
+ modified = true;
+ defectItem.setClosed(closed);
+ }
+ } else if (aCol == DefectColumn.Description_Col) {
+ String desc = XPromptChange.promptChangeString(aCol.getName(), defectItem.getDescription(), null);
+ if (desc != null && !defectItem.getDescription().equals(desc)) {
+ modified = true;
+ defectItem.setDescription(desc);
+ }
+ } else if (aCol == DefectColumn.Resolution_Col) {
+ String resolution = XPromptChange.promptChangeString(aCol.getName(), defectItem.getResolution(), null);
+ if (resolution != null && !defectItem.getResolution().equals(resolution)) {
+ modified = true;
+ defectItem.setResolution(resolution);
+ }
+ } else if (aCol == DefectColumn.Location_Col) {
+ String desc = XPromptChange.promptChangeString(aCol.getName(), defectItem.getLocation(), null);
+ if (desc != null && !defectItem.getLocation().equals(desc)) {
+ modified = true;
+ defectItem.setLocation(desc);
+ }
+ } else if (aCol == DefectColumn.User_Col) {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New User");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = (User) ld.getSelection();
+ if (selectedUser != null && defectItem.getUser() != selectedUser) {
+ modified = true;
+ defectItem.setUser(selectedUser);
+ }
+ }
+ } else if (aCol == DefectColumn.Severity_Col) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(aCol.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 (aCol == DefectColumn.Disposition_Col) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(aCol.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 (aCol == DefectColumn.Injection_Activity_Col) {
+ EnumStringSingleSelectionDialog enumDialog =
+ XPromptChange.promptChangeSingleSelectEnumeration(aCol.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 IllegalStateException("Unhandled defect column");
+
+ if (modified) {
+ xDefectViewer.getReviewArt().getDefectManager().addOrUpdateDefectItem(defectItem, false);
+ xDefectViewer.notifyXModifiedListeners();
+ update(defectItem, null);
+ return true;
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiDebug.class, ex, true);
+ }
+ return false;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.java
new file mode 100644
index 00000000000..fdcea8bd5fb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/DefectXViewerFactory.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.util.widgets.defect;
+
+import java.util.ArrayList;
+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.customize.CustomizeData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class DefectXViewerFactory extends SkynetXViewerFactory {
+
+ private XViewer xViewer;
+
+ /**
+ *
+ */
+ public DefectXViewerFactory() {
+ }
+
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ this.xViewer = xViewer;
+ return new XViewerSorter(xViewer);
+ }
+
+ public CustomizeData getDefaultTableCustomizeData() {
+ CustomizeData custData = new CustomizeData();
+ int x = 0;
+ ArrayList<XViewerColumn> cols = new ArrayList<XViewerColumn>();
+ for (DefectColumn atsXCol : DefectColumn.values()) {
+ XViewerColumn newCol = atsXCol.getXViewerColumn(atsXCol);
+ newCol.setOrderNum(x++);
+ newCol.setTreeViewer(xViewer);
+ cols.add(newCol);
+ }
+ custData.getColumnData().setColumns(cols);
+ return custData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.xviewer.IXViewerFactory#getDefaultXViewerColumn()
+ */
+ public XViewerColumn getDefaultXViewerColumn(String name) {
+ for (DefectColumn atsXCol : DefectColumn.values()) {
+ if (atsXCol.getName().equals(name)) {
+ return atsXCol.getXViewerColumn(atsXCol);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
new file mode 100644
index 00000000000..14417843cce
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/defect/XDefectViewer.java
@@ -0,0 +1,483 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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 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.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.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+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.IDamWidget;
+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.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 IDamWidget, IEventReceiver {
+
+ 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");
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, 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
+
+ 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("");
+
+ 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("newTask.gif"));
+ newDefectItem.setToolTipText("New Defect");
+ newDefectItem.addSelectionListener(new SelectionAdapter() {
+ 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() {
+ 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() {
+ 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() {
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.getCustomize().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() {
+ public void widgetSelected(SelectionEvent e) {
+ handleImportDefectsViaList();
+ }
+ });
+
+ }
+
+ public void loadTable() {
+ try {
+ if (reviewArt != null) {
+ xViewer.set(reviewArt.getDefectManager().getDefectItems());
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ refresh();
+ }
+
+ public void handleImportDefectsViaList() {
+ 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) {
+ for (String str : ed.getEntry().split("\n")) {
+ str = str.replaceAll("\r", "");
+ if (!str.equals("")) {
+ reviewArt.getDefectManager().addDefectItem(str, false);
+ }
+ }
+ loadTable();
+ notifyXModifiedListeners();
+ }
+ }
+
+ 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 {
+ if (persist) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ deleteDefectHelper(items);
+ }
+ };
+ txWrapper.execute();
+ } else {
+ deleteDefectHelper(items);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private void deleteDefectHelper(List<DefectItem> items) {
+ for (DefectItem defectItem : items) {
+ reviewArt.getDefectManager().removeDefectItem(defectItem, false);
+ xViewer.remove(defectItem);
+ }
+ loadTable();
+ notifyXModifiedListeners();
+ }
+
+ 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 {
+ reviewArt.getDefectManager().addDefectItem(ed.getEntry(), false);
+ 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() {
+ xViewer.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ xViewer.getTree().setFocus();
+ }
+
+ public void refresh() {
+ xViewer.refresh();
+ setLabelError();
+ refreshActionEnablement();
+ }
+
+ @Override
+ public boolean isValid() {
+ if (isRequiredEntry() && xViewer.getTree().getItemCount() == 0) {
+ extraInfoLabel.setText("At least one defect entry is required");
+ return false;
+ }
+ if (reviewArt != null) {
+ for (DefectItem item : reviewArt.getDefectManager().getDefectItems()) {
+ if (item.getSeverity() == Severity.None || item.getDisposition() == Disposition.None || item.isClosed() == false) {
+ extraInfoLabel.setText("Review not complete till all items are marked for severity, disposition and closed");
+ return false;
+ }
+ }
+ }
+ extraInfoLabel.setText("");
+ return true;
+ }
+
+ @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.logException(SkynetGuiPlugin.class, ex, false);
+ return "Defect Item Exception - " + ex.getLocalizedMessage();
+ }
+ return html.toString();
+ }
+
+ @Override
+ public String getReportData() {
+ return null;
+ }
+
+ /**
+ * @return Returns the xViewer.
+ */
+ public DefectXViewer getXViewer() {
+ return xViewer;
+ }
+
+ public void onEvent(final Event event) {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(reviewArt.getArtifact());
+ if (ed.isHasEvent() && ed.isRelChange())
+ loadTable();
+ else
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (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;
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public IReviewArtifact getReviewArt() {
+ return reviewArt;
+ }
+
+ public void setReviewArt(IReviewArtifact reviewArt) {
+ this.reviewArt = reviewArt;
+ 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);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.java
new file mode 100644
index 00000000000..06d19c0c59e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AICheckTreeDialog.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.widgets.dialog;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.actions.wizard.ActionableItemFilter;
+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.XText;
+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.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AICheckTreeDialog extends CheckedTreeSelectionDialog {
+
+ private ActionableItemFilter nameFilter;
+ private XText filterText;
+
+ public AICheckTreeDialog(String title, String message, Active active) {
+ super(Display.getCurrent().getActiveShell(), new ArtifactDescriptiveLabelProvider(), new AITreeContentProvider(
+ active));
+ try {
+ setInput(ActionableItemArtifact.getTopLevelActionableItems(active));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ this.filterText = new XText("Filter");
+ setTitle(title);
+ setMessage(message);
+ }
+
+ public Collection<ActionableItemArtifact> getSelection() {
+ ArrayList<ActionableItemArtifact> arts = new ArrayList<ActionableItemArtifact>();
+ for (Object obj : getResult())
+ arts.add((ActionableItemArtifact) obj);
+ return arts;
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+ Control comp = super.createDialogArea(container);
+ getTreeViewer().setSorter(new ArtifactNameSorter());
+
+ nameFilter = new ActionableItemFilter(getTreeViewer());
+ getTreeViewer().addFilter(nameFilter);
+
+ Composite filterComp = new Composite(comp.getParent(), SWT.NONE);
+ filterComp.setLayout(new GridLayout(2, false));
+ filterComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ (new Label(filterComp, SWT.NONE)).setText("Filter");
+ filterText.setDisplayLabel(false);
+ filterText.createWidgets(filterComp, 2);
+ filterText.addModifyListener(new ModifyListener() {
+ public void modifyText(org.eclipse.swt.events.ModifyEvent e) {
+ nameFilter.setContains(filterText.get());
+ getTreeViewer().refresh();
+ };
+ });
+
+ return comp;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.java
new file mode 100644
index 00000000000..1dda0fddf47
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AITreeContentProvider.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.util.widgets.dialog;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+
+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 (SQLException ex) {
+ }
+ }
+ return new Object[] {};
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof ActionableItemArtifact) return ((ActionableItemArtifact) element).getParent();
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.java
new file mode 100644
index 00000000000..d353bfeba73
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionActionableItemListDialog.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.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);
+ showAction = true;
+ showActionCheck.set(true);
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamListDialog.java
new file mode 100644
index 00000000000..45e9d66d4fe
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionTeamVersionListDialog.java
new file mode 100644
index 00000000000..09eb61f5b27
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+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.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.OSEELog;
+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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ });
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/ActionableItemListDialog.java
new file mode 100644
index 00000000000..c706fc1563e
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/AtsPriorityDialog.java
new file mode 100644
index 00000000000..835ec5be611
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.java
new file mode 100644
index 00000000000..ed69101e09d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/SMAStatusDialog.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.util.widgets.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.dialogs.MessageDialog;
+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.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);
+ if (smas.size() == 1) percent.set(smas.iterator().next().getStatePercentComplete());
+ 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.isValidResult().isFalse()) return percent.isValidResult();
+ if (hours.isValidResult().isFalse()) return hours.isValidResult();
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/StateListDialog.java
new file mode 100644
index 00000000000..fee6bd358b5
--- /dev/null
+++ b/MS_0.1.4_20080103/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.skynet.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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java
new file mode 100644
index 00000000000..ccc4a665036
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskOptionStatusDialog.java
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.artifact.StateMachineArtifact;
+import org.eclipse.osee.framework.ui.plugin.util.Result;
+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);
+ 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);
+ }
+ }
+ }
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResOptionDefinition.java
new file mode 100644
index 00000000000..620e4686143
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptions.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptions.java
new file mode 100644
index 00000000000..789966a3175
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TaskResolutionOptions.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.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskResolutionOptions {
+
+ private List<TaskResOptionDefinition> options = new ArrayList<TaskResOptionDefinition>();
+ public static String ATS_TASK_OPTIONS_TAG = "AtsTaskOptions";
+
+ public TaskResolutionOptions() {
+ super();
+ }
+
+ 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 setFromXml(String xmlStr) {
+ String optionsXml = AXml.getTagData(xmlStr, ATS_TASK_OPTIONS_TAG);
+ Matcher m =
+ Pattern.compile(
+ "<" + TaskResOptionDefinition.ATS_TASK_OPTION_TAG + ">.*?</" + TaskResOptionDefinition.ATS_TASK_OPTION_TAG + ">",
+ Pattern.DOTALL | Pattern.MULTILINE).matcher(optionsXml);
+ while (m.find()) {
+ TaskResOptionDefinition trd = new TaskResOptionDefinition();
+ trd.setFromXml(m.group());
+ options.add(trd);
+ }
+ }
+
+ public String toXml(String xmlStr) {
+ 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionDialog.java
new file mode 100644
index 00000000000..ae1f8a20139
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.java
new file mode 100644
index 00000000000..6c1b78bc20a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeByVersionDialog.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.util.widgets.dialog;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+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.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.OSEELog;
+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 TeamDefinitionTreeByVersionDialog extends TeamDefinitionTreeDialog {
+
+ XListViewer versionList = new XListViewer("Version");
+ VersionArtifact selectedVersion = null;
+
+ /**
+ * @param active
+ */
+ public TeamDefinitionTreeByVersionDialog(Active active) {
+ super(active);
+ try {
+ setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(active));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+
+ }
+
+ @Override
+ protected Control createDialogArea(Composite container) {
+
+ super.createDialogArea(container);
+ getTreeViewer().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 (getTreeViewer().getSelection().isEmpty()) return;
+ IStructuredSelection sel = (IStructuredSelection) getTreeViewer().getSelection();
+ for (Artifact art : ((TeamDefinitionArtifact) sel.iterator().next()).getVersionsFromTeamDefHoldingVersions(VersionReleaseType.Both))
+ objs.add(art);
+ versionList.setInput(objs);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+ });
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.java
new file mode 100644
index 00000000000..8e630d079d1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeContentProvider.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.util.widgets.dialog;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+
+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 (SQLException ex) {
+ }
+ }
+ return new Object[] {};
+ }
+
+ public Object getParent(Object element) {
+ if (element instanceof TeamDefinitionArtifact) return ((TeamDefinitionArtifact) element).getParent();
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.java
new file mode 100644
index 00000000000..2218e874e3e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeDialog.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.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);
+
+ showFinishedCheck.createWidgets(dialogComp, 2);
+ showFinishedCheck.addSelectionListener(new SelectionListener() {
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ public void widgetSelected(SelectionEvent e) {
+ showFinished = showFinishedCheck.isSelected();
+ };
+ });
+ showActionCheck.createWidgets(dialogComp, 2);
+ showAction = true;
+ showActionCheck.set(true);
+ 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 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.java
new file mode 100644
index 00000000000..133f280252a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamDefinitionTreeWithChildrenDialog.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.util.widgets.dialog;
+
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+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 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);
+ }
+ }
+
+ @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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/TeamVersionListDialog.java
new file mode 100644
index 00000000000..f8b6e9f8616
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/UserCommunityListDialog.java
new file mode 100644
index 00000000000..03c1ffc62a3
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionArtifactLabelProvider.java
new file mode 100644
index 00000000000..84310836700
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.framework.ui.skynet.util.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 (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/dialog/VersionListDialog.java
new file mode 100644
index 00000000000..f87f99bb7bd
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java
new file mode 100644
index 00000000000..b78d8967778
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRole.java
@@ -0,0 +1,161 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.ats.AtsPlugin;
+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.SkynetAuthentication;
+import org.eclipse.osee.framework.skynet.core.User;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRole {
+
+ private Role role = Role.Reviewer;
+ private User user;
+ private Double hoursSpent = 0.0;
+ private String guid = GUID.generateGuidStr();
+
+ 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() {
+ this(Role.Reviewer, SkynetAuthentication.getInstance().getAuthenticatedUser(), 0.0);
+ }
+
+ public UserRole(Role role, User user) {
+ this(role, user, 0.0);
+ }
+
+ public UserRole(Role role, User user, Double hoursSpent) {
+ this.role = role;
+ this.user = user;
+ this.hoursSpent = hoursSpent;
+ }
+
+ public UserRole(String xml) {
+ try {
+ fromXml(xml);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+ public void update(UserRole dItem) throws SQLException {
+ fromXml(dItem.toXml());
+ }
+
+ public String toXml() {
+ StringBuffer sb = new StringBuffer();
+ sb.append(AXml.addTagData("role", role.name()));
+ sb.append(AXml.addTagData("userId", user.getUserId()));
+ sb.append(AXml.addTagData("hoursSpent", String.valueOf(hoursSpent)));
+ sb.append(AXml.addTagData("guid", guid));
+ return sb.toString();
+ }
+
+ public void fromXml(String xml) throws SQLException {
+ this.role = Role.valueOf(AXml.getTagData(xml, "role"));
+ this.user = SkynetAuthentication.getInstance().getUserByIdWithError(AXml.getTagData(xml, "userId"));
+ this.hoursSpent = Double.valueOf(AXml.getTagData(xml, "hoursSpent")).doubleValue();
+ this.guid = AXml.getTagData(xml, "guid");
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof UserRole) {
+ UserRole di = (UserRole) obj;
+ return di.getGuid().equals(getGuid());
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return toString().hashCode();
+ }
+
+ public String toString() {
+ return role + " - " + user + " - " + hoursSpent;
+ }
+
+ /**
+ * @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;
+ }
+
+ /**
+ * @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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleColumn.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleColumn.java
new file mode 100644
index 00000000000..7a633b6ccd7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleColumn.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.widgets.role;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum UserRoleColumn {
+
+ Empty_Col("", 0, SWT.LEFT, false, SortDataType.String, false),
+
+ Role_Col("Role", 100, SWT.LEFT, true, SortDataType.String, false),
+
+ User_Col("User", 150, SWT.LEFT, true, SortDataType.String, false),
+
+ Hours_Spent_Col("Hours Spent", 80, SWT.LEFT, true, SortDataType.Float, false),
+
+ Num_Major_Col("Major", 60, SWT.CENTER, true, SortDataType.Integer, false),
+
+ Num_Minor_Col("Minor", 60, SWT.CENTER, true, SortDataType.Integer, false),
+
+ Num_Issues_Col("Issues", 60, SWT.CENTER, true, SortDataType.Integer, false);
+
+ private final String name;
+ private final int width;
+ private final int align;
+ private final boolean show;
+ private final SortDataType sortDataType;
+ private final String desc;
+ private static Map<String, UserRoleColumn> nameToAtsXColumn = new HashMap<String, UserRoleColumn>();
+ private final boolean multiColumnEditable;
+
+ public static UserRoleColumn getAtsXColumn(XViewerColumn xCol) {
+ if (nameToAtsXColumn.size() == 0) {
+ for (UserRoleColumn atsCol : UserRoleColumn.values())
+ nameToAtsXColumn.put(atsCol.getName(), atsCol);
+ }
+ return nameToAtsXColumn.get(xCol.getSystemName());
+ }
+
+ public XViewerColumn getXViewerColumn(UserRoleColumn atsXCol) {
+ XViewerColumn xCol =
+ new XViewerColumn(atsXCol.name, atsXCol.width, atsXCol.width, atsXCol.align, atsXCol.isShow(),
+ atsXCol.sortDataType, 0);
+ if (atsXCol.getDesc() != null)
+ xCol.setToolTip(atsXCol.getName() + ":\n" + atsXCol.getDesc());
+ else
+ xCol.setToolTip(atsXCol.getDesc());
+ return xCol;
+ }
+
+ private UserRoleColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable) {
+ this(name, width, align, show, sortDataType, multiColumnEditable, null);
+ }
+
+ private UserRoleColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String desc) {
+ this.name = name;
+ this.width = width;
+ this.align = align;
+ this.show = show;
+ this.sortDataType = sortDataType;
+ this.multiColumnEditable = multiColumnEditable;
+ this.desc = desc;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the align
+ */
+ public int getAlign() {
+ return align;
+ }
+
+ /**
+ * @return the show
+ */
+ public boolean isShow() {
+ return show;
+ }
+
+ /**
+ * @return the sortDataType
+ */
+ public SortDataType getSortDataType() {
+ return sortDataType;
+ }
+
+ /**
+ * @return the width
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * @return the desc
+ */
+ public String getDesc() {
+ return desc;
+ }
+
+ public boolean isMultiColumnEditable() {
+ return multiColumnEditable;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
new file mode 100644
index 00000000000..e0efc3899dd
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleContentProvider.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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(new UserRole[] {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(new Artifact[] {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() {
+ }
+
+ @SuppressWarnings("unchecked")
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ /**
+ * @return the rootSet
+ */
+ public Collection<UserRole> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java
new file mode 100644
index 00000000000..0975396ab84
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleLabelProvider.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.jface.viewers.ITableLabelProvider;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+public class UserRoleLabelProvider implements ITableLabelProvider {
+ Font font = null;
+
+ private final UserRoleXViewer treeViewer;
+
+ public UserRoleLabelProvider(UserRoleXViewer treeViewer) {
+ super();
+ this.treeViewer = treeViewer;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof String) {
+ if (columnIndex == 1)
+ return (String) element;
+ else
+ return "";
+ }
+ UserRole defectItem = ((UserRole) element);
+ if (defectItem == null) return "";
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ UserRoleColumn aCol = UserRoleColumn.getAtsXColumn(xCol);
+ return getColumnText(element, columnIndex, defectItem, xCol, aCol);
+ }
+ return "";
+ }
+
+ /**
+ * Provided as optimization of subclassed classes so provider doesn't have to retrieve the same information that has
+ * already been retrieved
+ *
+ * @param element
+ * @param columnIndex
+ * @param defectItem
+ * @param xCol
+ * @param aCol
+ * @return column string
+ */
+ public String getColumnText(Object element, int columnIndex, UserRole defectItem, XViewerColumn xCol, UserRoleColumn aCol) {
+ if (!xCol.isShow()) return ""; // Since not shown, don't display
+ if (aCol == UserRoleColumn.User_Col)
+ return defectItem.getUser().getName();
+ else if (aCol == UserRoleColumn.Hours_Spent_Col)
+ return AtsLib.doubleToStrString(defectItem.getHoursSpent(), true);
+ else if (aCol == UserRoleColumn.Role_Col)
+ return defectItem.getRole().name();
+ else if (aCol == UserRoleColumn.Num_Major_Col)
+ return treeViewer.getXUserRoleViewer().getReviewArt().getUserRoleManager().getNumMajor(defectItem.getUser()) + "";
+ else if (aCol == UserRoleColumn.Num_Minor_Col)
+ return treeViewer.getXUserRoleViewer().getReviewArt().getUserRoleManager().getNumMinor(defectItem.getUser()) + "";
+ else if (aCol == UserRoleColumn.Num_Issues_Col) return treeViewer.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 treeViewer;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (element instanceof String) return null;
+ UserRole defectItem = (UserRole) element;
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol == null) return null;
+ UserRoleColumn dCol = UserRoleColumn.getAtsXColumn(xCol);
+ if (!xCol.isShow()) return null; // Since not shown, don't display
+ if (dCol == UserRoleColumn.User_Col) {
+ if (defectItem.getUser().equals(SkynetAuthentication.getInstance().getAuthenticatedUser()))
+ return SkynetGuiPlugin.getInstance().getImage("red_user_sm.gif");
+ else
+ return SkynetGuiPlugin.getInstance().getImage("user_sm.gif");
+ }
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java
new file mode 100644
index 00000000000..c60a81e8f95
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleManager.java
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.regex.Matcher;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.IReviewArtifact;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+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.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.artifact.Artifact;
+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 Artifact 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(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getHtml() {
+ 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() {
+ 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) {
+ Set<UserRole> roles = new HashSet<UserRole>();
+ for (UserRole uRole : getUserRoles())
+ if (uRole.getRole() == role) roles.add(uRole);
+ return roles;
+ }
+
+ private void saveDefectItems(Set<UserRole> defectItems, boolean persist) {
+ 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());
+ if (persist) artifact.persist();
+ rollupHoursSpentToReviewState(persist);
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, "Can't create ats review defect document", ex, true);
+ }
+ }
+
+ public void addOrUpdateUserRole(UserRole userRole, boolean persist) throws SQLException {
+ Set<UserRole> defectItems = getUserRoles();
+ boolean found = false;
+ for (UserRole uRole : defectItems) {
+ if (userRole.equals(uRole)) {
+ uRole.update(userRole);
+ found = true;
+ }
+ }
+ if (!found) defectItems.add(userRole);
+ saveDefectItems(defectItems, persist);
+ }
+
+ public void removeUserRole(UserRole userRole, boolean persist) {
+ Set<UserRole> defectItems = getUserRoles();
+ defectItems.remove(userRole);
+ saveDefectItems(defectItems, persist);
+ }
+
+ public void clearLog(boolean persist) {
+ saveDefectItems(new HashSet<UserRole>(), persist);
+ }
+
+ public String getTable() {
+ 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.getHoursSpent() + "</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) {
+ 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) {
+ 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) {
+ 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) throws SQLException {
+ double hoursSpent = 0.0;
+ try {
+ for (UserRole role : getUserRoles())
+ hoursSpent += role.getHoursSpent();
+ SMAManager smaMgr = new SMAManager((StateMachineArtifact) artifact);
+ smaMgr.getCurrentStateDam().setHoursSpent(hoursSpent);
+ if (artifact.isDirty() && persist) artifact.persist();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ }
+
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.java
new file mode 100644
index 00000000000..d73805d4424
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewer.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.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.skynet.core.User;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.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.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 static String NAMESPACE = "osee.ats.UserRoleXViewer";
+ private final XUserRoleViewer xUserRoleViewer;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public UserRoleXViewer(Composite parent, int style, XUserRoleViewer xViewer) {
+ this(parent, style, NAMESPACE, new UserRoleXViewerFactory(), xViewer);
+ }
+
+ public UserRoleXViewer(Composite parent, int style, String nameSpace, IXViewerFactory xViewerFactory, XUserRoleViewer xRoleViewer) {
+ super(parent, style, nameSpace, xViewerFactory);
+ this.xUserRoleViewer = xRoleViewer;
+ }
+
+ @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();
+ }
+ });
+ }
+
+ @Override
+ public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ UserRoleColumn aCol = UserRoleColumn.getAtsXColumn((XViewerColumn) treeColumn.getData());
+ XViewerColumn xCol = getCustomize().getCurrentCustData().getColumnData().getXColumn(aCol.getName());
+ if (!xCol.isShow() || !aCol.isMultiColumnEditable()) return false;
+ return true;
+ }
+
+ @Override
+ public boolean isColumnMultiEditEnabled() {
+ return true;
+ }
+
+ 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) {
+ ((UserRoleContentProvider) getContentProvider()).set(userRoles);
+ }
+
+ public void clear() {
+ ((UserRoleContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ 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 osee.ats.viewer.XViewer#handleAltLeftClick(org.eclipse.swt.widgets.TreeColumn,
+ * org.eclipse.swt.widgets.TreeItem)
+ */
+ @Override
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem) {
+ try {
+ // System.out.println("Column " + treeColumn.getText() + " item " +
+ // treeItem);
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ UserRoleColumn aCol = UserRoleColumn.getAtsXColumn(xCol);
+ UserRole userRole = (UserRole) treeItem.getData();
+ boolean modified = false;
+ if (aCol == UserRoleColumn.Hours_Spent_Col) {
+ String hours = XPromptChange.promptChangeFloat(aCol.getName(), userRole.getHoursSpent());
+ if (hours != null) {
+ modified = true;
+ userRole.setHoursSpent((new Double(hours)).doubleValue());
+ }
+ } else if (aCol == UserRoleColumn.Num_Minor_Col || aCol == UserRoleColumn.Num_Major_Col || aCol == UserRoleColumn.Num_Issues_Col) {
+ AWorkbench.popup("ERROR", "Field is calculated");
+ } else if (aCol == UserRoleColumn.User_Col) {
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell(), "Select New User");
+ int result = ld.open();
+ if (result == 0) {
+ User selectedUser = (User) ld.getSelection();
+ if (selectedUser != null && userRole.getUser() != selectedUser) {
+ modified = true;
+ userRole.setUser(selectedUser);
+ }
+ }
+ } else if (aCol == UserRoleColumn.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 IllegalStateException("Unhandled user role column");
+
+ if (modified) {
+ xUserRoleViewer.getReviewArt().getUserRoleManager().addOrUpdateUserRole(userRole, false);
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.java
new file mode 100644
index 00000000000..d9939daa75f
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/UserRoleXViewerFactory.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.util.widgets.role;
+
+import java.util.ArrayList;
+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.customize.CustomizeData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserRoleXViewerFactory extends SkynetXViewerFactory {
+
+ private XViewer xViewer;
+
+ /**
+ *
+ */
+ public UserRoleXViewerFactory() {
+ }
+
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ this.xViewer = xViewer;
+ return new XViewerSorter(xViewer);
+ }
+
+ public CustomizeData getDefaultTableCustomizeData() {
+ CustomizeData custData = new CustomizeData();
+ int x = 0;
+ ArrayList<XViewerColumn> cols = new ArrayList<XViewerColumn>();
+ for (UserRoleColumn atsXCol : UserRoleColumn.values()) {
+ XViewerColumn newCol = atsXCol.getXViewerColumn(atsXCol);
+ newCol.setOrderNum(x++);
+ newCol.setTreeViewer(xViewer);
+ cols.add(newCol);
+ }
+ custData.getColumnData().setColumns(cols);
+ return custData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.skynet.gui.widgets.xviewer.IXViewerFactory#getDefaultXViewerColumn()
+ */
+ public XViewerColumn getDefaultXViewerColumn(String name) {
+ for (UserRoleColumn atsXCol : UserRoleColumn.values()) {
+ if (atsXCol.getName().equals(name)) {
+ return atsXCol.getXViewerColumn(atsXCol);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
new file mode 100644
index 00000000000..65617cc39a4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/role/XUserRoleViewer.java
@@ -0,0 +1,425 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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 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.AtsLib;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+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.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.IDamWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+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.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 IDamWidget, IEventReceiver {
+
+ 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");
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, 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
+
+ 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("");
+
+ 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() {
+ 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() {
+ 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() {
+ 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() {
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.getCustomize().handleTableCustomization();
+ }
+ });
+
+ refreshActionEnablement();
+ }
+
+ public void refreshActionEnablement() {
+ deleteUserRoleItem.setEnabled(editable && getSelectedUserRoleItems().size() > 0);
+ newUserRoleItem.setEnabled(editable);
+ }
+
+ public void loadTable() {
+ try {
+ if (reviewArt != 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 {
+ if (persist) {
+ AbstractSkynetTxTemplate transactionWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ removeUserRoleHelper(items);
+ }
+
+ };
+ transactionWrapper.execute();
+ } else {
+ removeUserRoleHelper(items);
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+ }
+
+ private void removeUserRoleHelper(List<UserRole> items) {
+ for (UserRole userRole : items) {
+ reviewArt.getUserRoleManager().removeUserRole(userRole, false);
+ xViewer.remove(userRole);
+ }
+ loadTable();
+ notifyXModifiedListeners();
+ }
+
+ public void handleNewUserRole() {
+ try {
+ reviewArt.getUserRoleManager().addOrUpdateUserRole(new UserRole(), false);
+ 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() {
+ xViewer.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ xViewer.getTree().setFocus();
+ }
+
+ public void refresh() {
+ xViewer.refresh();
+ setLabelError();
+ refreshActionEnablement();
+ }
+
+ @Override
+ public boolean isValid() {
+ if (isRequiredEntry() && xViewer.getTree().getItemCount() == 0) {
+ extraInfoLabel.setText("At least one role entry is required");
+ return false;
+ }
+ Result result = reviewArt.isUserRoleValid();
+ if (result.isFalse()) {
+ extraInfoLabel.setText(result.getText());
+ return false;
+ }
+ extraInfoLabel.setText("");
+ return true;
+ }
+
+ @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(),
+ AtsLib.doubleToStrString(item.getHoursSpent(), true),
+ reviewArt.getUserRoleManager().getNumMajor(item.getUser()) + "",
+ reviewArt.getUserRoleManager().getNumMinor(item.getUser()) + "",
+ reviewArt.getUserRoleManager().getNumIssues(item.getUser()) + ""}));
+ }
+ html.append(AHTML.endBorderTable());
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, false);
+ 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;
+ }
+
+ public void onEvent(final Event event) {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(reviewArt.getArtifact());
+ if (ed.isHasEvent() && ed.isRelChange())
+ loadTable();
+ else
+ refresh();
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see osee.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (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;
+ }
+
+ public boolean isEditable() {
+ return editable;
+ }
+
+ public void setEditable(boolean editable) {
+ this.editable = editable;
+ }
+
+ public IReviewArtifact getReviewArt() {
+ return reviewArt;
+ }
+
+ public void setReviewArt(IReviewArtifact reviewArt) {
+ this.reviewArt = reviewArt;
+ 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);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/IXTaskViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/IXTaskViewer.java
new file mode 100644
index 00000000000..9f3f31076e7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/IXTaskViewer.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.util.widgets.task;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.framework.ui.swt.IDirtiableEditor;
+
+/**
+ * @author Donald G. Dunne
+ */
+public interface IXTaskViewer {
+
+ public String getTabName();
+
+ public Collection<TaskArtifact> getTaskArtifacts(String stateName) throws SQLException;
+
+ public IDirtiableEditor getEditor();
+
+ public boolean isUsingTaskResolutionOptions();
+
+ public List<TaskResOptionDefinition> getResOptions();
+
+ public boolean isTaskable();
+
+ public String getCurrentStateName();
+
+ public SMAManager getParentSmaMgr();
+
+ /**
+ * 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 functionailty.
+ *
+ * @return false if tasks are readonly from the TaskViewer
+ */
+ public boolean isTasksEditable();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskArtifactItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskArtifactItem.java
new file mode 100644
index 00000000000..a22f9e3490d
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskArtifactItem.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.world.WorldArtifactItem;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskArtifactItem extends WorldArtifactItem {
+
+ /**
+ * @param xViewer
+ * @param artifact
+ */
+ public TaskArtifactItem(TaskXViewer xViewer, Artifact artifact, WorldArtifactItem parentItem) {
+ super(xViewer, artifact, parentItem);
+ }
+
+ public TaskArtifact getTaskArtifact() {
+ return (TaskArtifact) getArtifact();
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskContentProvider.java
new file mode 100644
index 00000000000..e137785f4b3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskContentProvider.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import org.eclipse.osee.ats.world.WorldContentProvider;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskContentProvider extends WorldContentProvider {
+
+ private final TaskXViewer xViewer;
+
+ /**
+ */
+ public TaskContentProvider(TaskXViewer taskXViewer) {
+ super(taskXViewer);
+ this.xViewer = taskXViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.WorldContentProvider#hasChildren(java.lang.Object)
+ */
+ @Override
+ public boolean hasChildren(Object element) {
+ if (element instanceof TaskArtifactItem) return false;
+ return super.hasChildren(element);
+ }
+
+ public void add(final TaskArtifactItem item) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ public void run() {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ rootSet.add(item);
+ xViewer.refresh();
+ };
+ });
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskCurrentStateFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskCurrentStateFilter.java
new file mode 100644
index 00000000000..e9f4992f1fe
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskCurrentStateFilter.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+
+public class TaskCurrentStateFilter extends ViewerFilter {
+
+ private final String stateName;
+
+ public TaskCurrentStateFilter(String stateName) {
+ this.stateName = stateName;
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ TaskArtifactItem item = (TaskArtifactItem) element;
+ if (item.getTaskArtifact().isDeleted()) return true;
+ return (item.getTaskArtifact().getSoleAttributeValue(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName()).equals(stateName));
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskLabelProvider.java
new file mode 100644
index 00000000000..a69fef8e4a4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskLabelProvider.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.world.AtsXColumn;
+import org.eclipse.osee.ats.world.WorldArtifactItem;
+import org.eclipse.osee.ats.world.WorldLabelProvider;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskLabelProvider extends WorldLabelProvider {
+
+ private final TaskXViewer treeViewer;
+
+ /**
+ * @param treeViewer
+ */
+ public TaskLabelProvider(TaskXViewer treeViewer) {
+ super(treeViewer);
+ this.treeViewer = treeViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.WorldLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof String) {
+ if (columnIndex == 1)
+ return (String) element;
+ else
+ return "";
+ }
+ TaskArtifact taskArt = ((TaskArtifactItem) element).getTaskArtifact();
+ if (taskArt == null || taskArt.isDeleted()) return "";
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ if (!xCol.isShow()) return ""; // Since not shown, don't display
+ if (aCol == AtsXColumn.Assignees_Col) {
+ return (new SMAManager(taskArt)).getAssigneesWasIsStr();
+ }
+ return super.getColumnText(element, columnIndex, taskArt, xCol, aCol);
+ }
+ return "";
+ }
+
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (element instanceof String) return null;
+ Artifact artifact = ((WorldArtifactItem) element).getArtifact();
+ if (artifact == null || artifact.isDeleted()) return null;
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ if (!xCol.isShow()) return null; // Since not shown, don't display
+ if (aCol == AtsXColumn.Title_Col) return artifact.getImage();
+ return super.getColumnImage(element, columnIndex, artifact, xCol, aCol);
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewer.java
new file mode 100644
index 00000000000..037c7666983
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewer.java
@@ -0,0 +1,374 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+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.widgets.dialog.TaskResOptionDefinition;
+import org.eclipse.osee.ats.world.AtsXColumn;
+import org.eclipse.osee.ats.world.WorldArtifactItem;
+import org.eclipse.osee.ats.world.WorldXViewer;
+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.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 static String NAMESPACE = "org.eclipse.osee.ats.TaskXViewer";
+ private final XTaskViewer xTaskViewer;
+ private final IDirtiableEditor editor;
+ private final boolean isUsingTaskResolutionOptions;
+ private final List<TaskResOptionDefinition> resOptions;
+ private boolean tasksEditable = true;
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public TaskXViewer(Composite parent, int style, IDirtiableEditor editor, boolean isUsingTaskResolutionOptions, List<TaskResOptionDefinition> resOptions, XTaskViewer xTaskViewer) {
+ super(parent, style, NAMESPACE, new TaskXViewerFactory());
+ this.editor = editor;
+ this.isUsingTaskResolutionOptions = isUsingTaskResolutionOptions;
+ this.resOptions = resOptions;
+ this.xTaskViewer = xTaskViewer;
+ }
+
+ @Override
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ handleColumnMultiEdit(treeColumn, treeItems, false);
+ Set<TaskArtifactItem> items = new HashSet<TaskArtifactItem>();
+ for (TreeItem item : treeItems)
+ items.add((TaskArtifactItem) 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");
+ Set<TaskArtifactItem> items = new HashSet<TaskArtifactItem>();
+ for (Artifact art : artifacts)
+ items.add(new TaskArtifactItem(this, art, null));
+ ((TaskContentProvider) getContentProvider()).set(items);
+ }
+
+ @Override
+ public void add(final Artifact artifact) {
+ if (!(artifact instanceof TaskArtifact)) throw new IllegalArgumentException("set only allowed for TaskArtifact");
+ add(Arrays.asList(new Artifact[] {artifact}));
+ }
+
+ @Override
+ public void add(Collection<Artifact> artifacts) {
+ for (Artifact art : artifacts)
+ if (!(art instanceof TaskArtifact)) throw new IllegalArgumentException("set only allowed for TaskArtifact");
+ Set<TaskArtifactItem> items = new HashSet<TaskArtifactItem>();
+ for (Artifact art : artifacts)
+ items.add(new TaskArtifactItem(this, art, null));
+ ((TaskContentProvider) getContentProvider()).add(items);
+ }
+
+ public void removeTask(final Collection<TaskArtifact> artifacts) {
+ ((TaskContentProvider) getContentProvider()).remove(artifacts);
+ }
+
+ public TaskArtifact getSelectedTaskArtifact() {
+ Collection<TaskArtifact> arts = getSelectedTaskArtifacts();
+ if (arts.size() > 0) return arts.iterator().next();
+ return null;
+ }
+
+ public Collection<TaskArtifact> getSelectedTaskArtifacts() {
+ Iterator<?> i = ((IStructuredSelection) getSelection()).iterator();
+ ArrayList<TaskArtifact> taskArts = new ArrayList<TaskArtifact>();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifactItem) taskArts.add(((TaskArtifactItem) obj).getTaskArtifact());
+ }
+ return taskArts;
+ }
+
+ public boolean isSelectedTaskArtifactsAreInWork() {
+ Iterator<?> i = ((IStructuredSelection) getSelection()).iterator();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifactItem) if (!((TaskArtifactItem) obj).getTaskArtifact().isInWork()) return false;
+ }
+ return true;
+ }
+
+ public Collection<TaskArtifactItem> getSelectedTaskArtifactItems() {
+ Iterator<?> i = ((IStructuredSelection) getSelection()).iterator();
+ ArrayList<TaskArtifactItem> items = new ArrayList<TaskArtifactItem>();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifactItem) items.add((TaskArtifactItem) obj);
+ }
+ return items;
+ }
+
+ public Object[] getSelectedTaskArtifactItemsArray() {
+ return getSelectedArtifactItems().toArray(new TaskArtifactItem[getSelectedArtifactItems().size()]);
+ }
+
+ Action editTaskTitleAction;
+ Action editTaskAssigneesAction;
+ Action editTaskStatusAction;
+ Action editTaskResolutionAction;
+ Action editTaskEstimateAction;
+ Action editTaskRelatedStateAction;
+ Action editTaskNotesAction;
+ Action addNewTaskAction;
+ Action deleteTasksAction;
+
+ @Override
+ public void createMenuActions() {
+ super.createMenuActions();
+
+ editTaskTitleAction = new Action("Edit Task Title", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ SMAManager taskSmaMgr = new SMAManager(getSelectedTaskArtifact());
+ if (taskSmaMgr.promptChangeAttribute(ATSAttributes.TITLE_ATTRIBUTE, false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editTaskAssigneesAction = new Action("Edit Task Assignees", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeAssignees(getSelectedTaskArtifacts())) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editTaskStatusAction = new Action("Edit Task Status", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeStatus((isUsingTaskResolutionOptions ? resOptions : null),
+ getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editTaskResolutionAction = new Action("Edit Task Resolution", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ handleChangeResolution();
+ }
+ };
+
+ editTaskEstimateAction = new Action("Edit Task Estimate", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (ArtifactPromptChange.promptChangeFloatAttribute(
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName(),
+ ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getDisplayName(), getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ editTaskRelatedStateAction = new Action("Edit Task Related to State", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeAttribute(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE, getSelectedTaskArtifacts(),
+ false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editTaskNotesAction = new Action("Edit Task Notes", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeAttribute(ATSAttributes.SMA_NOTE_ATTRIBUTE, getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ 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() {
+ xTaskViewer.handleDeleteTask();
+ }
+ };
+
+ }
+
+ @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() == 1 && isSelectedTaskArtifactsAreInWork());
+
+ }
+
+ @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() {
+ if (isUsingTaskResolutionOptions) {
+ if (SMAManager.promptChangeStatus(resOptions, getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ return true;
+ }
+ } else if (SMAManager.promptChangeAttribute(ATSAttributes.RESOLUTION_ATTRIBUTE, getSelectedTaskArtifacts(), false)) {
+ editor.onDirtied();
+ update(getSelectedTaskArtifactItemsArray(), null);
+ return true;
+ }
+ return false;
+ }
+
+ /*
+ * (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) {
+ if (!isTasksEditable()) {
+ AWorkbench.popup("ERROR", "Editing disabled for current state.");
+ return false;
+ }
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ SMAManager taskSmaMgr = new SMAManager(((TaskArtifactItem) treeItem.getData()).getTaskArtifact());
+ boolean modified = false;
+ try {
+ if (isSelectedTaskArtifactsAreInWork() && aCol == AtsXColumn.Estimated_Hours_Col) {
+ modified = taskSmaMgr.promptChangeFloatAttribute(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && aCol == AtsXColumn.Title_Col) {
+ modified = taskSmaMgr.promptChangeAttribute(ATSAttributes.TITLE_ATTRIBUTE, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && aCol == AtsXColumn.Related_To_State_Col) {
+ modified = taskSmaMgr.promptChangeAttribute(ATSAttributes.RELATED_TO_STATE_ATTRIBUTE, false);
+ } else if (isSelectedTaskArtifactsAreInWork() && aCol == AtsXColumn.Assignees_Col) {
+ modified = taskSmaMgr.promptChangeAssignees();
+ } else if (isUsingTaskResolutionOptions && (aCol == AtsXColumn.Total_Hours_Spent_Col || aCol == AtsXColumn.Total_Percent_Complete_Col)) {
+ modified = handleChangeResolution();
+ } else if (isSelectedTaskArtifactsAreInWork() && aCol == AtsXColumn.Resolution_Col) {
+ modified = handleChangeResolution();
+ } else if ((aCol == AtsXColumn.Total_Hours_Spent_Col || aCol == AtsXColumn.Total_Percent_Complete_Col)) {
+ modified = taskSmaMgr.promptChangeStatus(false);
+ } else
+ modified = super.handleAltLeftClick(treeColumn, treeItem, false);
+
+ if (modified) {
+ editor.onDirtied();
+ update(((TaskArtifactItem) treeItem.getData()), null);
+ return true;
+ }
+ } catch (SQLException 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;
+ }
+
+ public Collection<WorldArtifactItem> getRootSet() {
+ return xTaskViewer.getXViewer().getRootSet();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerFactory.java
new file mode 100644
index 00000000000..40442cc8843
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerFactory.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.util.widgets.task;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import org.eclipse.osee.ats.world.AtsXColumn;
+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.customize.CustomizeData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskXViewerFactory extends SkynetXViewerFactory {
+
+ private XViewer xViewer;
+
+ public TaskXViewerFactory() {
+ }
+
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ this.xViewer = xViewer;
+ return new TaskXViewerSorter(xViewer);
+ }
+
+ public CustomizeData getDefaultTableCustomizeData() {
+ CustomizeData custData = new CustomizeData();
+ // Title, State, POC, Percent_Complete, Hours_Spent, Resolution, Est_Hours, Remain_Hours
+ List<AtsXColumn> taskColumnOrder =
+ Arrays.asList(new AtsXColumn[] {AtsXColumn.Title_Col, AtsXColumn.State_Col, AtsXColumn.Assignees_Col,
+ AtsXColumn.Total_Percent_Complete_Col, AtsXColumn.Total_Hours_Spent_Col, AtsXColumn.Resolution_Col,
+ AtsXColumn.Estimated_Hours_Col, AtsXColumn.Remaining_Hours_Col, AtsXColumn.Related_To_State_Col,
+ AtsXColumn.Notes_Col});
+ List<Integer> widths = Arrays.asList(new Integer[] {450, 60, 150, 40, 40, 100, 50, 50, 50, 80, 80});
+
+ int x = 0;
+ ArrayList<XViewerColumn> cols = new ArrayList<XViewerColumn>();
+
+ // Set visible and first columns
+ ArrayList<AtsXColumn> handled = new ArrayList<AtsXColumn>();
+ for (AtsXColumn atsXCol : taskColumnOrder) {
+ XViewerColumn newCol = atsXCol.getXViewerColumn(atsXCol);
+ newCol.setWidth(widths.get(x));
+ newCol.setOrderNum(x++);
+ newCol.setTreeViewer(xViewer);
+ newCol.setShow(true);
+ cols.add(newCol);
+ handled.add(atsXCol);
+ }
+
+ // Reset the remainder of the columns to the order and non-visible
+ for (AtsXColumn atsXCol : AtsXColumn.values()) {
+ if (!handled.contains(atsXCol)) {
+ XViewerColumn newCol = atsXCol.getXViewerColumn(atsXCol);
+ newCol.setOrderNum(x++);
+ newCol.setTreeViewer(xViewer);
+ newCol.setShow(false);
+ cols.add(newCol);
+ handled.add(atsXCol);
+ }
+ }
+ custData.getColumnData().setColumns(cols);
+ return custData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.IXViewerFactory#getDefaultXViewerColumn()
+ */
+ public XViewerColumn getDefaultXViewerColumn(String name) {
+ for (AtsXColumn atsXCol : AtsXColumn.values()) {
+ if (atsXCol.getName().equals(name)) {
+ return atsXCol.getXViewerColumn(atsXCol);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerSorter.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerSorter.java
new file mode 100644
index 00000000000..61fc4478a37
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/TaskXViewerSorter.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.util.widgets.task;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.world.AtsXColumn;
+import org.eclipse.osee.ats.world.IWorldViewArtifact;
+import org.eclipse.osee.ats.world.WorldArtifactItem;
+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;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TaskXViewerSorter extends WorldXViewerSorter {
+
+ /**
+ * @param xViewer
+ */
+ public TaskXViewerSorter(XViewer xViewer) {
+ super(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) {
+ if (xViewer == null || !xViewer.getCustomize().getCurrentCustData().getSortingData().isSorting()) return 0;
+ XViewerColumn sortXCol =
+ xViewer.getCustomize().getCurrentCustData().getSortingData().getSortXCols().get(sortXColIndex);
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(sortXCol);
+ IWorldViewArtifact m1 = (IWorldViewArtifact) ((WorldArtifactItem) o1).getArtifact();
+ IWorldViewArtifact m2 = (IWorldViewArtifact) ((WorldArtifactItem) o2).getArtifact();
+
+ if (aCol == AtsXColumn.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);
+ }
+
+ return super.compare(viewer, o1, o2, sortXColIndex);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/XTaskViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/XTaskViewer.java
new file mode 100644
index 00000000000..81e80346a67
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/task/XTaskViewer.java
@@ -0,0 +1,728 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.task;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+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.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+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.SMAEditor;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.Overview;
+import org.eclipse.osee.ats.util.SMAMetrics;
+import org.eclipse.osee.ats.util.Import.TaskImportWizard;
+import org.eclipse.osee.ats.world.WorldArtifactItem;
+import org.eclipse.osee.ats.world.WorldCompletedFilter;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+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.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.skynet.core.relation.RelationPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.relation.RelationPersistenceManager.Direction;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+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.util.OSEELog;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+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.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 XTaskViewer extends XWidget implements IEventReceiver, IActionable {
+
+ private TaskXViewer xViewer;
+ private ToolItem upItem, downItem, currentStateFilterItem;
+ private MenuItem currentStateFilterMenuItem, filterCompletedMenuItem, selectionMetricsMenuItem;
+ private TaskArtifact selected;
+ private IXTaskViewer iXTaskViewer;
+ private SkynetEventManager eventManager = SkynetEventManager.getInstance();
+ private TaskCurrentStateFilter currentStateFilter = null;
+ private Label extraInfoLabel;
+ private WorldCompletedFilter worldCompletedFilter = new WorldCompletedFilter();
+
+ /**
+ * @param label
+ */
+ public XTaskViewer(IXTaskViewer iXTaskViewer) {
+ super(iXTaskViewer.getTabName());
+ this.iXTaskViewer = iXTaskViewer;
+ eventManager.register(RemoteTransactionEvent.class, this);
+ eventManager.register(LocalTransactionEvent.class, this);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.XWidget#createWidgets(org.eclipse.swt.widgets.Composite,
+ * int)
+ */
+ @Override
+ public void createWidgets(Composite parent, int horizontalSpan) {
+
+ 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 TaskXViewer(mainComp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION, iXTaskViewer.getEditor(),
+ iXTaskViewer.isUsingTaskResolutionOptions(), iXTaskViewer.getResOptions(), this);
+ xViewer.setTasksEditable(iXTaskViewer.isTasksEditable());
+ xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ xViewer.setContentProvider(new TaskContentProvider(xViewer));
+ xViewer.setLabelProvider(new TaskLabelProvider(xViewer));
+ xViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateExtraInfoLine();
+ }
+ });
+ xViewer.getTree().addKeyListener(new KeyListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)
+ */
+ public void keyPressed(KeyEvent event) {
+ // if CTRL key is already pressed
+ if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
+ if (event.keyCode == 'a') {
+ xViewer.getTree().setSelection(xViewer.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();
+ }
+ }
+ }
+ // System.out.println("keypressed " + event.keyCode);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent)
+ */
+ public void keyReleased(KeyEvent event) {
+ }
+ });
+
+ 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);
+ if (toolkit != null) toolkit.adapt(tree);
+ updateCurrentStateFilter();
+ setupDragAndDropSupport();
+ }
+
+ public void handleFilterAction() {
+ if (filterCompletedMenuItem.getSelection()) {
+ xViewer.addFilter(worldCompletedFilter);
+ } else {
+ xViewer.removeFilter(worldCompletedFilter);
+ }
+ updateExtendedStatusString();
+ }
+
+ public void updateExtendedStatusString() {
+ String str = "";
+ if (filterCompletedMenuItem != null && filterCompletedMenuItem.getSelection()) {
+ str += " Complete/Cancel FILTERED - ";
+ }
+ if (currentStateFilterItem != null && currentStateFilterItem.getSelection()) {
+ str += " Curr State FILTERED - ";
+ }
+ xViewer.setExtendedStatusString(str);
+ xViewer.refresh();
+ }
+
+ 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));
+
+ 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;
+
+ currentStateFilterItem = new ToolItem(toolBar, SWT.CHECK);
+ currentStateFilterItem.setImage(AtsPlugin.getInstance().getImage("currentState.gif"));
+ currentStateFilterItem.setToolTipText("Filter by Current State.");
+ currentStateFilterItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateCurrentStateFilter();
+ }
+ });
+
+ if (iXTaskViewer.isTaskable()) {
+
+ upItem = new ToolItem(toolBar, SWT.PUSH);
+ upItem.setImage(AtsPlugin.getInstance().getImage("up.gif"));
+ upItem.setToolTipText("Up; Disabled if sorted by Column");
+ // DON Add ability to move tasks up/down
+ // upItem.setEnabled(smaMgr.isTaskable());
+ upItem.setEnabled(false);
+ upItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleMoveSelection(Direction.Back);
+ }
+ });
+
+ downItem = new ToolItem(toolBar, SWT.PUSH);
+ downItem.setImage(AtsPlugin.getInstance().getImage("down.gif"));
+ downItem.setToolTipText("Down; Disabled if sorted by Column");
+ // DON Add ability to move tasks up/down
+ // downItem.setEnabled(smaMgr.isTaskable());
+ downItem.setEnabled(false);
+ downItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleMoveSelection(Direction.Forward);
+ }
+ });
+
+ 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() {
+ 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() {
+ public void widgetSelected(SelectionEvent e) {
+ handleDeleteTask();
+ }
+ });
+
+ }
+ item = new ToolItem(toolBar, SWT.PUSH);
+ item.setImage(AtsPlugin.getInstance().getImage("refresh.gif"));
+ item.setToolTipText("Refresh Tasks");
+ item.addSelectionListener(new SelectionAdapter() {
+ 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() {
+ public void widgetSelected(SelectionEvent e) {
+ xViewer.getCustomize().handleTableCustomization();
+ }
+ });
+
+ OseeAts.addButtonToEditorToolBar(this, AtsPlugin.getInstance(), toolBar, SMAEditor.EDITOR_ID, "ATS Task Tab");
+ createTaskActionBarPulldown(toolBar, rightComp);
+
+ }
+
+ public void updateExtraInfoLine() {
+ if (selectionMetricsMenuItem != null && selectionMetricsMenuItem.getSelection())
+ extraInfoLabel.setText(SMAMetrics.getEstRemainMetrics(getXViewer().getSelectedSMAArtifacts()));
+ else
+ extraInfoLabel.setText("");
+ extraInfoLabel.getParent().layout();
+ }
+
+ public void updateCurrentStateFilter() {
+ if (currentStateFilterItem != null && currentStateFilterItem.getSelection()) {
+ currentStateFilter = new TaskCurrentStateFilter(iXTaskViewer.getCurrentStateName());
+ getXViewer().addFilter(currentStateFilter);
+ } else {
+ if (currentStateFilter != null) getXViewer().removeFilter(currentStateFilter);
+ currentStateFilter = null;
+ }
+ if (currentStateFilterMenuItem != null) currentStateFilterMenuItem.setSelection(currentStateFilterItem.getSelection());
+ updateExtendedStatusString();
+ }
+
+ 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);
+ }
+ }
+ });
+
+ currentStateFilterMenuItem = new MenuItem(menu, SWT.CHECK);
+ currentStateFilterMenuItem.setText("Filter by Current State");
+ currentStateFilterMenuItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ currentStateFilterItem.setSelection(!currentStateFilterItem.getSelection());
+ updateCurrentStateFilter();
+ }
+ });
+
+ selectionMetricsMenuItem = new MenuItem(menu, SWT.CHECK);
+ selectionMetricsMenuItem.setText("Show Release Metrics by Selection - Ctrl-X");
+ selectionMetricsMenuItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ updateExtraInfoLine();
+ }
+ });
+
+ filterCompletedMenuItem = new MenuItem(menu, SWT.CHECK);
+ filterCompletedMenuItem.setText("Filter Out Completed/Cancelled - Ctrl-F");
+ filterCompletedMenuItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleFilterAction();
+ }
+ });
+
+ if (iXTaskViewer.isTaskable()) {
+
+ MenuItem item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Import Tasks via spreadsheet");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleImportTasksViaSpreadsheet();
+ }
+ });
+
+ item = new MenuItem(menu, SWT.PUSH);
+ item.setText("Import Tasks via simple list");
+ item.setEnabled(iXTaskViewer.isTasksEditable() && iXTaskViewer.isTaskable());
+ item.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ handleImportTasksViaList();
+ }
+ });
+ }
+
+ }
+
+ public void loadTable() {
+ try {
+ getXViewer().set(iXTaskViewer.getTaskArtifacts(""));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+
+ xViewer.refresh();
+ }
+
+ public void handleImportTasksViaList() {
+ final EntryDialog ed =
+ new EntryDialog(Display.getCurrent().getActiveShell(), "Create Tasks", null,
+ "Enter task titles, one per line.\nNOTE: For more complex import use import via spreadsheet.",
+ MessageDialog.QUESTION, new String[] {"OK", "Cancel"}, 0);
+ ed.setFillVertically(true);
+ if (ed.open() == 0) {
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ for (String str : ed.getEntry().split("\n")) {
+ str = str.replaceAll("\r", "");
+ if (!str.equals("")) {
+ TaskArtifact taskArt =
+ iXTaskViewer.getParentSmaMgr().getTaskMgr().createNewTask(str, true);
+ taskArt.persist(true);
+ }
+ }
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ public void handleImportTasksViaSpreadsheet() {
+ TaskImportWizard actionWizard = new TaskImportWizard();
+ actionWizard.setHrid(iXTaskViewer.getParentSmaMgr().getSma().getHumanReadableId());
+ WizardDialog dialog =
+ new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), actionWizard);
+ dialog.create();
+ dialog.open();
+ }
+
+ public void handleDeleteTask() {
+ final ArrayList<TaskArtifactItem> items = getSelectedTaskArtifactItems();
+ if (items.size() == 0) {
+ AWorkbench.popup("ERROR", "No Tasks Selected");
+ return;
+ }
+ StringBuilder builder = new StringBuilder();
+ for (TaskArtifactItem taskItem : items) {
+ builder.append("\"" + taskItem.getTaskArtifact().getDescriptiveName() + "\"\n");
+ }
+ boolean delete =
+ MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Delete Task",
+ "Are You Sure You Wish to Delete the Task(s):\n\n" + builder.toString());
+ if (delete) {
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ // Done for concurrent modification purposes
+ ArrayList<TaskArtifactItem> delItems = new ArrayList<TaskArtifactItem>();
+ delItems.addAll(items);
+ for (TaskArtifactItem taskItem : delItems) {
+ SMAEditor.close(taskItem.getTaskArtifact(), false);
+ TaskArtifact taskArt = taskItem.getTaskArtifact();
+ taskArt.delete();
+ }
+ xViewer.removeItems(delItems);
+ xViewer.refresh();
+ }
+ };
+ txWrapper.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();
+ xViewer.add(taskArt);
+ xViewer.getTree().setFocus();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ return taskArt;
+ }
+
+ public ArrayList<TaskArtifactItem> getSelectedTaskArtifactItems() {
+ Iterator<?> i = ((IStructuredSelection) xViewer.getSelection()).iterator();
+ ArrayList<TaskArtifactItem> items = new ArrayList<TaskArtifactItem>();
+ while (i.hasNext()) {
+ Object obj = i.next();
+ if (obj instanceof TaskArtifactItem) items.add((TaskArtifactItem) obj);
+ }
+ return items;
+ }
+
+ public void storeSelection() {
+ // Store selected so can re-select after event re-draw
+ if (xViewer.getSelectedTaskArtifactItems().size() > 0) selected =
+ xViewer.getSelectedTaskArtifactItems().iterator().next().getTaskArtifact();
+ }
+
+ public void restoreSelection() {
+ if (selected != null) {
+ for (WorldArtifactItem item : xViewer.getRootSet()) {
+ if (item.getArtifact().equals(selected)) {
+ ArrayList<TaskArtifactItem> selected = new ArrayList<TaskArtifactItem>();
+ selected.add((TaskArtifactItem) item);
+ xViewer.setSelection(new StructuredSelection(selected.toArray(new Object[selected.size()])));
+ }
+ }
+ }
+ }
+
+ public void handleMoveSelection(Direction dir) {
+ storeSelection();
+ if (xViewer.getSelectedTaskArtifactItems().size() != 1) {
+ AWorkbench.popup("ERROR", "Must select single item to move");
+ return;
+ }
+ TaskArtifact taskArt = xViewer.getSelectedTaskArtifactItems().iterator().next().getTaskArtifact();
+ if (taskArt != null) {
+ try {
+ RelationPersistenceManager.getInstance().moveObjectB(iXTaskViewer.getParentSmaMgr().getSma(), taskArt,
+ RelationSide.SmaToTask_Task, dir);
+ refresh();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+
+ @Override
+ public Control getControl() {
+ return xViewer.getTree();
+ }
+
+ @Override
+ public void dispose() {
+ eventManager.unRegisterAll(this);
+ xViewer.dispose();
+ }
+
+ @Override
+ public void setFocus() {
+ xViewer.getTree().setFocus();
+ }
+
+ public void refresh() {
+ xViewer.refresh();
+ }
+
+ @Override
+ public boolean isValid() {
+ return false;
+ }
+
+ @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, 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.getCurrentStateName().replaceAll("(Task|State)", ""), smaMgr.getAssigneesWasIsStr(),
+ smaMgr.getSma().getWorldViewTotalPercentComplete() + "",
+ smaMgr.getSma().getWorldViewTotalHoursSpent() + "",
+ art.getSoleAttributeValue(ATSAttributes.RESOLUTION_ATTRIBUTE.getStoreName()),
+ art.getHumanReadableId()}));
+ }
+ html.append(AHTML.endBorderTable());
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Task Exception - " + ex.getLocalizedMessage();
+ }
+ return html.toString();
+ }
+
+ @Override
+ public String getReportData() {
+ return null;
+ }
+
+ /**
+ * @return Returns the xViewer.
+ */
+ public TaskXViewer getXViewer() {
+ return xViewer;
+ }
+
+ public void onEvent(final Event event) {
+ if (xViewer == null || xViewer.getTree() == null || xViewer.getTree().isDisposed()) return;
+
+ if (event instanceof TransactionEvent) {
+ if (iXTaskViewer.getParentSmaMgr() != null) {
+ EventData ed = ((TransactionEvent) event).getEventData(iXTaskViewer.getParentSmaMgr().getSma());
+ if (ed.isHasEvent() && ed.isRelChange())
+ loadTable();
+ else
+ refresh();
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.XWidget#getData()
+ */
+ @Override
+ public Object getData() {
+ return xViewer.getInput();
+ }
+
+ private void setupDragAndDropSupport() {
+ DragSource source = new DragSource(xViewer.getTree(), DND.DROP_COPY);
+ source.setTransfer(new Transfer[] {ArtifactTransfer.getInstance()});
+ source.addDragListener(new DragSourceListener() {
+
+ public void dragFinished(DragSourceEvent event) {
+ refresh();
+ }
+
+ public void dragSetData(DragSourceEvent event) {
+ Collection<TaskArtifact> arts = xViewer.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(xViewer.getTree(), DND.DROP_COPY);
+ target.setTransfer(new Transfer[] {FileTransfer.getInstance(), TextTransfer.getInstance(),
+ ArtifactTransfer.getInstance()});
+ target.addDropListener(new DropTargetAdapter() {
+
+ public void drop(DropTargetEvent event) {
+ performDrop(event);
+ }
+
+ public void dragOver(DropTargetEvent event) {
+ event.detail = DND.DROP_COPY;
+ }
+
+ public void dropAccept(DropTargetEvent event) {
+ }
+ });
+ }
+
+ private void performDrop(DropTargetEvent e) {
+ if (e.data instanceof ArtifactData) {
+ if (iXTaskViewer.getParentSmaMgr().getSma() == null) return;
+ final Artifact[] artsToRelate = ((ArtifactData) e.data).getArtifacts();
+ try {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+ @Override
+ protected void handleTxWork() throws Exception {
+ for (Artifact art : artsToRelate) {
+ if (art instanceof TaskArtifact) {
+ TaskArtifact taskArt = (TaskArtifact) art;
+ if (taskArt.getParentSMA() != null) taskArt.unrelate(RelationSide.SmaToTask_Sma,
+ taskArt.getParentSMA(), true);
+ taskArt.relate(RelationSide.SmaToTask_Sma, iXTaskViewer.getParentSmaMgr().getSma(), true);
+ }
+ }
+ }
+ };
+ txWrapper.execute();
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetActivator.class, ex, true);
+ }
+ }
+ refresh();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.osee.framework.ui.skynet.ats.IActionable#getActionDescription()
+ */
+ public String getActionDescription() {
+ return null;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.java
new file mode 100644
index 00000000000..5da4e4a3577
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/ATSXWidgetOptionResolver.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.workflow;
+
+import java.sql.SQLException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.attribute.ConfigurationPersistenceManager;
+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 =
+ ConfigurationPersistenceManager.getInstance().getValidEnumerationAttributeValues(
+ xWidgetData.getLayoutName(), BranchPersistenceManager.getInstance().getAtsBranch());
+ } catch (SQLException 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlow.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlow.java
new file mode 100644
index 00000000000..5aad996332a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlow.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.workflow;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkFlow;
+import org.eclipse.osee.framework.ui.skynet.widgets.workflow.WorkPage;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkFlow extends WorkFlow {
+
+ private String inheritData;
+
+ public AtsWorkFlow(String id) {
+ super(id);
+ }
+
+ // artifact, etc)
+
+ public AtsWorkPage getAtsPage(String pageName) {
+ return (AtsWorkPage) super.getPage(pageName);
+ }
+
+ public List<AtsWorkPage> getAtsPages(String pageName) {
+ List<AtsWorkPage> foundPages = new ArrayList<AtsWorkPage>();
+ for (WorkPage page : super.getPages(pageName))
+ foundPages.add((AtsWorkPage) page);
+ return foundPages;
+ }
+
+ public WorkPage getAtsPageFromId(String id) {
+ return (AtsWorkPage) super.getPageFromId(id);
+ }
+
+ public Collection<AtsWorkPage> getAtsWorkPages() {
+ List<AtsWorkPage> pages = new ArrayList<AtsWorkPage>();
+ for (WorkPage page : super.getPages())
+ pages.add((AtsWorkPage) page);
+ return pages;
+ }
+
+ public List<AtsWorkPage> getPagesOrdered() {
+ for (WorkPage wpg : pages) {
+ AtsWorkPage page = (AtsWorkPage) wpg;
+ if (page.isStartPage()) {
+ List<AtsWorkPage> orderedPages = new ArrayList<AtsWorkPage>();
+ getOrderedPages(page, orderedPages);
+ // Move completed to the end if it exists
+ AtsWorkPage completedPage = null;
+ for (AtsWorkPage wPage : orderedPages)
+ if (wPage.getName().equals(DefaultTeamState.Completed.name())) completedPage = wPage;
+ if (completedPage != null) {
+ orderedPages.remove(completedPage);
+ orderedPages.add(completedPage);
+ }
+ // for (WorkPage wPage : orderedPages)
+ // System.out.println("Ordered Page: - " + wPage);
+ return orderedPages;
+ }
+ }
+ throw new IllegalArgumentException(
+ "Can't locate root page for workflow. Start page must have \"StartPage\" identifier.");
+ }
+
+ private void getOrderedPages(AtsWorkPage page, List<AtsWorkPage> pages) {
+ // Add this page first
+ if (!pages.contains(page)) pages.add(page);
+ // Add default page
+ if (page.getDefaultToPage() != null) getOrderedPages((AtsWorkPage) page.getDefaultToPage(), pages);
+ // Add remaining pages
+ for (WorkPage wPage : page.getToPages())
+ if (!pages.contains(wPage)) getOrderedPages((AtsWorkPage) wPage, pages);
+ }
+
+ /**
+ * @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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlowFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlowFactory.java
new file mode 100644
index 00000000000..3973df39053
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkFlowFactory.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.workflow;
+
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Collection;
+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.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.config.ImportWorkflowAction;
+import org.eclipse.osee.ats.config.WorkflowDiagramFactory;
+import org.eclipse.osee.framework.skynet.core.artifact.NativeArtifact;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkFlowFactory {
+
+ private static AtsWorkFlowFactory instance = new AtsWorkFlowFactory();
+
+ /**
+ *
+ */
+ private AtsWorkFlowFactory() {
+ super();
+ }
+
+ public static AtsWorkFlowFactory getInstance() {
+ return instance;
+ }
+
+ public static String DEFAULT_TEAM_WORKFLOW = "osee_ats_defaultTeam_workflow";
+ public static String DEFAULT_TASK_WORKFLOW = "osee_ats_defaultTask_workflow";
+ public static String DECISION_REVIEW_WORKFLOW = "osee_ats_decisionReview_workflow";
+ public static String PEERTOPEER_REVIEW_WORKFLOW = "osee_ats_peerToPeerReview_workflow";
+
+ public AtsWorkFlow getWorkflow(StateMachineArtifact sma) throws SQLException, IOException {
+ if (AtsPlugin.isAtsUseWorkflowFiles()) {
+ String workflowId = "";
+ String workflowXml = "";
+ System.err.println("ATS Admin - Retrieving WorkFlows from Files");
+ /**
+ * NOTE: Loading from files will only work if DB has workflow configured and loaded into DB via a DB wipe. This
+ * load uses the name of the workflow which needs to correspond to the id declared in the AtsWorkflow extension
+ * point. Loading from files is a developers tool for rapid creation of workflows only and should not be used
+ * as a deployment solution.
+ */
+ if (sma instanceof TeamWorkFlowArtifact) {
+ workflowId = DEFAULT_TEAM_WORKFLOW;
+ workflowXml = ImportWorkflowAction.getWorkflowXmlFromFile(workflowId);
+ } else if (sma instanceof TaskArtifact) {
+ workflowId = DEFAULT_TASK_WORKFLOW;
+ workflowXml = ImportWorkflowAction.getWorkflowXmlFromFile(DEFAULT_TASK_WORKFLOW);
+ } else if (sma instanceof DecisionReviewArtifact) {
+ workflowId = DECISION_REVIEW_WORKFLOW;
+ workflowXml = ImportWorkflowAction.getWorkflowXmlFromFile(DECISION_REVIEW_WORKFLOW);
+ } else if (sma instanceof PeerToPeerReviewArtifact) {
+ workflowId = PEERTOPEER_REVIEW_WORKFLOW;
+ workflowXml = ImportWorkflowAction.getWorkflowXmlFromFile(PEERTOPEER_REVIEW_WORKFLOW);
+ } else
+ throw new IllegalStateException("Can't retrieve workflow file xml");
+ System.err.println("Workflow Id: " + workflowId);
+ return WorkflowDiagramFactory.getInstance().getWorkFlowFromFileContents(workflowId, workflowXml);
+ } else {
+ // If TaskArtifact, walk up team definition tree till find a workflow diagram or
+ // exception
+ // if not found
+ NativeArtifact nativeArt = null;
+ if (sma instanceof TaskArtifact) {
+ nativeArt =
+ getTeamDefinitionWorkflowDiagram(RelationSide.TeamDefinitionToTaskWorkflowDiagram_WorkflowDiagram,
+ ((TeamWorkFlowArtifact) ((TaskArtifact) sma).getParentSMA()).getTeamDefinition());
+ } else if (sma instanceof DecisionReviewArtifact) {
+ nativeArt =
+ getTeamDefinitionWorkflowDiagram(
+ RelationSide.TeamDefinitionToDecisionReviewWorkflowDiagram_WorkflowDiagram,
+ ((TeamWorkFlowArtifact) ((DecisionReviewArtifact) sma).getParentSMA()).getTeamDefinition());
+ } else if (sma instanceof PeerToPeerReviewArtifact) {
+ PeerToPeerReviewArtifact peerArt = (PeerToPeerReviewArtifact) sma;
+ if (peerArt.getParentSMA() == null)
+ nativeArt =
+ getTeamDefinitionWorkflowDiagram(
+ RelationSide.TeamDefinitionToPeerToPeerReviewWorkflowDiagram_WorkflowDiagram,
+ TeamDefinitionArtifact.getHeadTeamDefinition());
+ else
+ nativeArt =
+ getTeamDefinitionWorkflowDiagram(
+ RelationSide.TeamDefinitionToPeerToPeerReviewWorkflowDiagram_WorkflowDiagram,
+ ((TeamWorkFlowArtifact) ((PeerToPeerReviewArtifact) sma).getParentSMA()).getTeamDefinition());
+ }
+ // If TeamWorkflowArtifact, walk up team tree till find a workflow diagram or exception
+ // if not found
+ else if (sma instanceof TeamWorkFlowArtifact) {
+ nativeArt =
+ getTeamDefinitionWorkflowDiagram(RelationSide.TeamDefinitionToWorkflowDiagram_WorkflowDiagram,
+ ((TeamWorkFlowArtifact) sma).getTeamDefinition());
+ }
+ if (nativeArt != null)
+ return WorkflowDiagramFactory.getInstance().getAtsWorkflowFromArtifact(nativeArt);
+ else
+ throw new IllegalArgumentException("Unhandled artifact type for team workflow diagram");
+ }
+ }
+
+ private NativeArtifact getTeamDefinitionWorkflowDiagram(RelationSide side, TeamDefinitionArtifact teamDef) throws SQLException {
+ Collection<NativeArtifact> arts = teamDef.getArtifacts(side, NativeArtifact.class);
+ if (arts.size() > 1) throw new IllegalArgumentException("Expected 1 Workflow diagram. Retrieved " + arts.size());
+ if (arts.size() == 1) return arts.iterator().next();
+ if (teamDef.getParent() instanceof TeamDefinitionArtifact)
+ return getTeamDefinitionWorkflowDiagram(side, (TeamDefinitionArtifact) teamDef.getParent());
+ else
+ throw new IllegalArgumentException("No Workflow Diagram configured for path");
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
new file mode 100644
index 00000000000..ea7433725b5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/AtsWorkPage.java
@@ -0,0 +1,367 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.io.IOException;
+import java.util.ArrayList;
+import java.util.logging.Level;
+import javax.xml.parsers.ParserConfigurationException;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+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.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.dialog.TaskResolutionOptions;
+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.SkynetGuiPlugin;
+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.WorkPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsWorkPage extends WorkPage {
+
+ private boolean requireStateHoursSpentPrompt = false;
+ private boolean forceAssigneesToTeamLeads = false;
+ private boolean allowCreateBranch = false;
+ private boolean allowCommitBranch = false;
+ protected TaskResolutionOptions taskResolutionOptions;
+ private boolean startPage = false;
+ private boolean validatePage = false;
+ private boolean validateReviewBlocking = false;
+ public static String WORKPAGE_STARTPAGE = "startPage";
+ public static String WORKPAGE_VALIDATE_PAGE = "validatePage";
+ public static String WORKPAGE_PAGE_ID = "pageId";
+ public static String WORKPAGE_ATS_REQUIRE_STATE_HOURS_SPENT_PROMPT = "atsRequireStateHourSpentPrompt";
+ public static String WORkPAGE_ATS_FORCE_ASSIGNEES_TO_TEAM_LEADS = "atsForceAssigneesToTeamLeads";
+ public static String WORKPAGE_ATS_ALLOW_CREATE_BRANCH = "atsAllowCreateBranch";
+ public static String WORKPAGE_ATS_ALLOW_COMMIT_BRANCH = "atsAllowCommitBranch";
+ private PageType pageType;
+ private SMAManager smaMgr;
+ private String instructionStr;
+ public static enum PageType {
+ Team, ActionableItem, WorkFlowPage
+ };
+
+ public AtsWorkPage(String name, String id, String xWidgetsXml, IXWidgetOptionResolver optionResolver) {
+ super(name, id, xWidgetsXml, optionResolver);
+ }
+
+ public AtsWorkPage(IXWidgetOptionResolver optionResolver) {
+ this("", "", 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) {
+ 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) {
+ super.createXWidgetLayoutData(layoutData, xWidget, toolkit, art, xModListener, isEditable);
+ // If no tooltip, add global tooltip
+ if ((xWidget.getToolTip() == null || xWidget.getToolTip().equals("")) && ATSAttributes.getAtsAttributeByStoreName(layoutData.getLayoutName()) != null && ATSAttributes.getAtsAttributeByStoreName(
+ layoutData.getLayoutName()).getDescription() != null && !ATSAttributes.getAtsAttributeByStoreName(
+ layoutData.getLayoutName()).getDescription().equals("")) {
+ xWidget.setToolTip(ATSAttributes.getAtsAttributeByStoreName(layoutData.getLayoutName()).getDescription());
+ layoutData.setToolTip(ATSAttributes.getAtsAttributeByStoreName(layoutData.getLayoutName()).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) {
+ 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;
+ }
+
+ /**
+ * @return Returns the fromPages.
+ */
+ public ArrayList<AtsWorkPage> getFromAtsPages() {
+ ArrayList<AtsWorkPage> pages = new ArrayList<AtsWorkPage>();
+ for (WorkPage page : super.getFromPages())
+ pages.add((AtsWorkPage) page);
+ return pages;
+ }
+
+ /**
+ * @return Returns the toPages.
+ */
+ public ArrayList<AtsWorkPage> getToAtsPages() {
+ ArrayList<AtsWorkPage> pages = new ArrayList<AtsWorkPage>();
+ for (WorkPage page : super.getToPages())
+ pages.add((AtsWorkPage) page);
+ return pages;
+ }
+
+ public boolean isEndorsePage() {
+ return getName().equals(DefaultTeamState.Endorse.name());
+ }
+
+ @Override
+ public void processInstructions(Document doc) throws ParserConfigurationException, SAXException, IOException {
+
+ // Process workpage node attributes
+ processWorkPageNode(doc);
+
+ NodeList nodes = doc.getElementsByTagName(TaskResolutionOptions.ATS_TASK_OPTIONS_TAG);
+ if (nodes.getLength() > 0) {
+ taskResolutionOptions = new TaskResolutionOptions();
+ taskResolutionOptions.setFromDoc(doc);
+ }
+ dynamicXWidgetLayout.processInstructions(doc);
+ }
+
+ public void processWorkPageNode(Document doc) {
+ Element rootElement = doc.getDocumentElement();
+ if (rootElement.getNodeName().equals("WorkPage")) {
+ for (int x = 0; x < rootElement.getAttributes().getLength(); x++) {
+ Node node = rootElement.getAttributes().item(x);
+ String nodeName = node.getNodeName();
+ if (nodeName.equals(WORKPAGE_STARTPAGE))
+ setStartPage(Boolean.parseBoolean(node.getNodeValue()));
+ else if (nodeName.equals(WORKPAGE_ATS_REQUIRE_STATE_HOURS_SPENT_PROMPT))
+ requireStateHoursSpentPrompt = Boolean.parseBoolean(node.getNodeValue());
+ else if (nodeName.equals(WORkPAGE_ATS_FORCE_ASSIGNEES_TO_TEAM_LEADS))
+ forceAssigneesToTeamLeads = Boolean.parseBoolean(node.getNodeValue());
+ else if (nodeName.equals(WORKPAGE_ATS_ALLOW_CREATE_BRANCH))
+ allowCreateBranch = Boolean.parseBoolean(node.getNodeValue());
+ else if (nodeName.equals(WORKPAGE_ATS_ALLOW_COMMIT_BRANCH))
+ allowCommitBranch = Boolean.parseBoolean(node.getNodeValue());
+ else if (nodeName.equals(WORKPAGE_PAGE_ID))
+ setId(node.getNodeValue());
+ else if (nodeName.equals(WORKPAGE_VALIDATE_PAGE)) {
+ setValidatePage(true);
+ if (node.getNodeValue().equals("nonblocking"))
+ setValidateReviewBlocking(true);
+ else
+ setValidateReviewBlocking(false);
+ } else {
+ OSEELog.logSevere(AtsPlugin.class,
+ "Unhandled WorkPage attribute \"" + nodeName + "\" for page " + getName(), false);
+ }
+ }
+ } else {
+ SkynetGuiPlugin.getLogger().log(Level.SEVERE, "No WorkPage element found for page " + getName());
+ throw new IllegalArgumentException("No WorkPage element found for page " + getName());
+ }
+ }
+
+ /**
+ * @return Returns the taskResolutionOptions.
+ */
+ public TaskResolutionOptions getTaskResDef() {
+ return taskResolutionOptions;
+ }
+
+ /**
+ * @param taskResolutionOptions The taskResolutionOptions to set.
+ */
+ public void setTaskResDef(TaskResolutionOptions taskResolutionOptions) {
+ this.taskResolutionOptions = taskResolutionOptions;
+ }
+
+ public boolean isUsingTaskResolutionOptions() {
+ return this.taskResolutionOptions != null;
+ }
+
+ public boolean isRequireStateHoursSpentPrompt() {
+ return requireStateHoursSpentPrompt;
+ }
+
+ /**
+ * @return Returns the pageType.
+ */
+ public PageType getPageType() {
+ return pageType;
+ }
+
+ /**
+ * @param pageType The pageType to set.
+ */
+ public void setPageType(PageType pageType) {
+ this.pageType = pageType;
+ }
+
+ /**
+ * @return the startPage
+ */
+ public boolean isStartPage() {
+ return startPage;
+ }
+
+ /**
+ * @param startPage the startPage to set
+ */
+ public void setStartPage(boolean startPage) {
+ this.startPage = startPage;
+ }
+
+ /**
+ * @return the validatePage
+ */
+ public boolean isValidatePage() {
+ return validatePage;
+ }
+
+ /**
+ * @param validatePage the validatePage to set
+ */
+ public void setValidatePage(boolean validatePage) {
+ this.validatePage = validatePage;
+ }
+
+ /**
+ * @return the validateReviewBlocking
+ */
+ public boolean isValidateReviewBlocking() {
+ return validateReviewBlocking;
+ }
+
+ /**
+ * @param validateReviewBlocking the validateReviewBlocking to set
+ */
+ public void setValidateReviewBlocking(boolean validateReviewBlocking) {
+ this.validateReviewBlocking = validateReviewBlocking;
+ }
+
+ /**
+ * @return the smaMgr
+ */
+ public SMAManager getSmaMgr() {
+ return smaMgr;
+ }
+
+ /**
+ * @param smaMgr the smaMgr to set
+ */
+ public void setSmaMgr(SMAManager smaMgr) {
+ this.smaMgr = smaMgr;
+ }
+
+ /**
+ * @return the instructionStr
+ */
+ public String getInstructionStr() {
+ return instructionStr;
+ }
+
+ /**
+ * @param instructionStr the instructionStr to set
+ */
+ public void setInstructionStr(String instructionStr) {
+ this.instructionStr = instructionStr;
+ }
+
+ public String toString() {
+ return getPageType() + ": " + getName();
+ }
+
+ /**
+ * @return the forceAssigneesToTeamLeads
+ */
+ public boolean isForceAssigneesToTeamLeads() {
+ return forceAssigneesToTeamLeads;
+ }
+
+ /**
+ * @return the allowCreateBranch
+ */
+ public boolean isAllowCreateBranch() {
+ return allowCreateBranch;
+ }
+
+ /**
+ * @param allowCreateBranch the allowCreateBranch to set
+ */
+ public void setAllowCreateBranch(boolean allowCreateBranch) {
+ this.allowCreateBranch = allowCreateBranch;
+ }
+
+ /**
+ * @return the allowCommitBranch
+ */
+ public boolean isAllowCommitBranch() {
+ return allowCommitBranch;
+ }
+
+ /**
+ * @param allowCommitBranch the allowCommitBranch to set
+ */
+ public void setAllowCommitBranch(boolean allowCommitBranch) {
+ this.allowCommitBranch = allowCommitBranch;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkFlow.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkFlow.java
new file mode 100644
index 00000000000..4e431910df5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkFlow.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.workflow;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.config.WorkflowDiagramFactory;
+import org.eclipse.osee.framework.jdk.core.util.AFile;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.skynet.core.artifact.NativeArtifact;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.w3c.dom.Document;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueWorkFlow {
+
+ private ArrayList<VueWorkLink> links = new ArrayList<VueWorkLink>();
+ private ArrayList<VueWorkPage> vuePages = new ArrayList<VueWorkPage>();
+ private AtsWorkFlow workflow;
+ private static String INHERITED_WORKFLOW_TAG = "InheritedWorkflow";
+ private static String PAGE_REPLACE_ALL_TAG = "PageIdReplaceAll";
+ private static Pattern workPagePattern = Pattern.compile("<WorkPage +pageId=\"(.*?)\".*?\\/>");
+ private static Pattern inheritedPattern =
+ Pattern.compile("&lt;" + INHERITED_WORKFLOW_TAG + " workflowId=\"(.*?)\"/&gt;",
+ Pattern.DOTALL | Pattern.MULTILINE);
+ private static Pattern childPattern =
+ Pattern.compile("<child(.*?)>(.*?)</child>", Pattern.DOTALL | Pattern.MULTILINE);
+ private static Pattern replaceAllPageIdsPattern =
+ Pattern.compile("&lt;" + PAGE_REPLACE_ALL_TAG + " search=\"(.*?)\" replace=\"(.*?)\"/&gt;",
+ Pattern.DOTALL | Pattern.MULTILINE);
+ private static Pattern inheritedDataPattern = Pattern.compile("<notes>(&lt;InheritedWorkflow .*?)</notes>");
+
+ /**
+ * @param vueXml
+ */
+ public VueWorkFlow(String workflowId, String vueXml) {
+ workflow = new AtsWorkFlow(workflowId);
+ String inheritedVueXml = getInheritedVueXml(workflowId, vueXml);
+ if (inheritedVueXml != null) {
+ processXml(inheritedVueXml);
+ replacePageIds(workflowId, vueXml);
+ setOverriddenWorkPageAttributes(vueXml);
+ storeInheritData(vueXml);
+ } else
+ processXml(vueXml);
+ }
+
+ private void storeInheritData(String vueXml) {
+ Matcher m = inheritedDataPattern.matcher(vueXml);
+ if (m.find())
+ workflow.setInheritData(AXml.xmlToText(m.group(1)).replaceAll("%nl;", "\r\n"));
+ else
+ workflow.setInheritData("Unable to extract just inherit block => " + vueXml);
+ }
+
+ private void setOverriddenWorkPageAttributes(String xml) {
+ String xmlStr = AXml.xmlToText(xml);
+ Matcher m = workPagePattern.matcher(xmlStr);
+ while (m.find()) {
+ try {
+ String pageId = m.group(1);
+ for (VueWorkPage page : vuePages) {
+ if (page.getWorkPage().getId().equals(pageId)) {
+ Document doc = Jaxp.readXmlDocument(m.group());
+ page.getWorkPage().processWorkPageNode(doc);
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't process vue xml", ex, true);
+ }
+ }
+
+ }
+
+ private void replacePageIds(String workflowId, String xml) {
+ String srchValue = null;
+ String replaceValue = null;
+ Matcher m = replaceAllPageIdsPattern.matcher(xml);
+ if (!m.find()) {
+ if (xml.contains(PAGE_REPLACE_ALL_TAG)) throw new IllegalArgumentException(
+ PAGE_REPLACE_ALL_TAG + " tag found, but format is invalid in workflowId " + workflowId);
+ }
+ srchValue = m.group(1);
+ replaceValue = m.group(2);
+ for (VueWorkPage page : vuePages) {
+ page.getWorkPage().setId(page.getWorkPage().getId().replaceFirst(srchValue, replaceValue));
+ }
+ }
+
+ private String getInheritedVueXml(String workflowId, String xml) {
+ String workflowName = null;
+ try {
+ Matcher m = inheritedPattern.matcher(xml);
+ if (!m.find()) {
+ if (xml.contains(INHERITED_WORKFLOW_TAG)) throw new IllegalArgumentException(
+ INHERITED_WORKFLOW_TAG + " tag found, but format is invalid in workflowId " + workflowId);
+ return null;
+ }
+ workflowName = m.group(1);
+ NativeArtifact nativeArtifact = WorkflowDiagramFactory.getInstance().getAtsWorkflowArtifact(workflowName);
+ InputStream is = nativeArtifact.getNativeContent();
+ String vueXml = AFile.readFile(is);
+ return vueXml;
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class,
+ "Can't load inherited workflow artifact \"" + workflowName + "\"specified in workflowId " + workflowId,
+ ex, true);
+ }
+ return null;
+ }
+
+ 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\"")) {
+ VueWorkLink link = new VueWorkLink(matchStr);
+ links.add(link);
+ } else if (childParms.contains("xsi:type=\"node\"")) {
+ VueWorkPage vuePage = new VueWorkPage(matchStr);
+ vuePages.add(vuePage);
+ workflow.addPage(vuePage.getWorkPage());
+ } else
+ throw new IllegalArgumentException("Unhandled xsi:type");
+ }
+ for (VueWorkLink link : links) {
+ VueWorkPage fromVuePage = getPageFromVueId(link.getFromVueId());
+ if (fromVuePage == null) throw new IllegalArgumentException("Can't retrieve from page");
+ VueWorkPage 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 VueWorkPage getPageFromVueId(String vueId) {
+ for (VueWorkPage page : vuePages)
+ if (page.getVueId().equals(vueId)) return page;
+ return null;
+ }
+
+ /**
+ * @return Returns the workflow.
+ */
+ public AtsWorkFlow getWorkflow() {
+ return workflow;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkLink.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkLink.java
new file mode 100644
index 00000000000..a2d086b3f27
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkLink.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;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueWorkLink {
+
+ private final String xml;
+ private String name;
+ private String vueId;
+ private boolean multiDirectional = false;
+ private String fromVueId;
+ private String toVueId;
+
+ /**
+ *
+ */
+ public VueWorkLink(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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkPage.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkPage.java
new file mode 100644
index 00000000000..b52136b9db5
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/VueWorkPage.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.workflow;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.workflow.AtsWorkPage.PageType;
+import org.eclipse.osee.framework.jdk.core.util.AXml;
+import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+import org.w3c.dom.Document;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class VueWorkPage {
+
+ private final String vueXml;
+ private String vueId;
+ private AtsWorkPage 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 AtsWorkPage getWorkPage() {
+ return workPage;
+ }
+
+ /**
+ *
+ */
+ public VueWorkPage(String vueXml) {
+ super();
+ this.vueXml = vueXml;
+ workPage = new AtsWorkPage(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() == VueWorkPage.Shape.ellipse)
+ workPage.setPageType(PageType.Team);
+ else if (getShape() == VueWorkPage.Shape.rectangle) workPage.setPageType(PageType.ActionableItem);
+ if (noteXml.startsWith("<WorkPage ")) {
+ workPage.setPageType(PageType.WorkFlowPage);
+ try {
+ Document doc = Jaxp.readXmlDocument(noteXml);
+ workPage.processInstructions(doc);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Can't process vue xml", ex, true);
+ }
+ }
+ }
+
+ 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/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXColumn.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXColumn.java
new file mode 100644
index 00000000000..b2159738ac0
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/AtsXColumn.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.HashMap;
+import java.util.Map;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.XViewerColumn.SortDataType;
+import org.eclipse.swt.SWT;
+
+/**
+ * @author Donald G. Dunne
+ */
+public enum AtsXColumn {
+
+ Type_Col("Type", 80, SWT.LEFT, true, SortDataType.String, false),
+
+ State_Col("State", 70, SWT.LEFT, true, SortDataType.String, false),
+
+ Priority_Col("Priority", 20, SWT.CENTER, true, SortDataType.String, false),
+
+ Change_Type_Col("Change Type", 22, SWT.LEFT, true, SortDataType.String, false),
+
+ Assignees_Col("Assignees", 100, SWT.LEFT, true, SortDataType.String, false),
+
+ Title_Col("Title", 200, SWT.LEFT, true, SortDataType.String, false),
+
+ Actionable_Items_Col("Actionable Items", 80, SWT.LEFT, true, SortDataType.String, false, "Actionable Items that are impacted by this change."),
+
+ User_Community_Col("User Community", 60, SWT.LEFT, true, SortDataType.String, false, "Program, Project or Group that caused the creation of this Action."),
+
+ ID_Col("ID", 40, SWT.LEFT, true, SortDataType.String, false, "Human Readable ID"),
+
+ Created_Date_Col("Created Date", 80, SWT.LEFT, true, SortDataType.Date, false),
+
+ Version_Target_Col("Version Target", 40, SWT.LEFT, true, SortDataType.String, false),
+
+ Team_Col("Team", 50, SWT.LEFT, true, SortDataType.String, false, "Team that has been assigned to work this Action."),
+
+ Notes_Col("Notes", 80, SWT.LEFT, true, SortDataType.String, true),
+
+ Deadline_Col("Deadline", 80, SWT.LEFT, true, SortDataType.Date, true, "Date the changes need to be completed by."),
+
+ // Aren't shown by default
+
+ Annual_Cost_Avoidance_Col("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."),
+
+ Description_Col("Description", 150, SWT.LEFT, false, SortDataType.String, true),
+
+ Metrics_from_Tasks_Col("Metrics from Tasks", 40, SWT.LEFT, false, SortDataType.Boolean, false, "Determine Estimated Hours and Percent Complete from Implement Tasks."),
+
+ Legacy_PCR_Col("Legacy PCR", 40, SWT.LEFT, false, SortDataType.String, false),
+
+ Decision_Col("Decision", 150, SWT.LEFT, false, SortDataType.String, false),
+
+ Resolution_Col("Resolution", 150, SWT.LEFT, false, SortDataType.String, false),
+
+ Estimated_Release_Date_Col(ATSAttributes.ESTIMATED_RELEASE_DATE_ATTRIBUTE.getDisplayName(), 80, SWT.LEFT, false, SortDataType.Date, false, "Date the changes will be made available to the users."),
+
+ Release_Date_Col(ATSAttributes.RELEASE_DATE_ATTRIBUTE.getDisplayName(), 80, SWT.LEFT, false, SortDataType.Date, false, "Date the changes were made available to the users."),
+
+ Work_Package_Col("Work Package", 80, SWT.LEFT, false, SortDataType.String, true),
+
+ Category_Col("Category", 80, SWT.LEFT, false, SortDataType.String, true, "Open field for user to be able to enter text to use for categorizing/sorting."),
+
+ Category2_Col("Category2", 80, SWT.LEFT, false, SortDataType.String, true, "Open field for user to be able to enter text to use for categorizing/sorting."),
+
+ Category3_Col("Category3", 80, SWT.LEFT, false, SortDataType.String, true, "Open field for user to be able to enter text to use for categorizing/sorting."),
+
+ Related_To_State_Col("Related To State", 80, SWT.LEFT, false, SortDataType.String, true, "State of the parent State Machine that this object is related to."),
+
+ Total_Percent_Complete_Col("Total Percent Complete", 40, SWT.CENTER, false, SortDataType.Percent, false),
+
+ Estimated_Hours_Col("Estimated Hours", 40, SWT.CENTER, false, SortDataType.Float, true, "Hours estimated to implement the changes associated with this Action."),
+
+ Weekly_Benefit_Hrs_Col("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."),
+
+ Total_Hours_Spent_Col("Total Hours Spent", 40, SWT.CENTER, false, SortDataType.Float, false, "Total Hours spent for all work done in states and tasks."),
+
+ Remaining_Hours_Col("Remaining Hours", 40, SWT.CENTER, false, SortDataType.Float, false, "Hours that remain to complete the changes.\n\nEstimated Hours - (Estimated Hours * Percent Complete)."),
+
+ State_Percent_Col("State Percent", 40, SWT.CENTER, false, SortDataType.Percent, false, "Percent Complete for the changes to the current state."),
+
+ State_Hours_Spent_Col("State Hours Spent", 40, SWT.CENTER, false, SortDataType.Float, false, "Hours spent in performing the changes to the current state."),
+
+ Originator_Col("Originator", 80, SWT.LEFT, false, SortDataType.String, false),
+
+ Implementor_Col("Implementer", 80, SWT.LEFT, false, SortDataType.String, false, "User assigned to the Implementation of the changes."),
+
+ Completed_Date_Col("Completed Date", 80, SWT.CENTER, false, SortDataType.Date, false),
+
+ Cancelled_Date_Col("Cancelled Date", 80, SWT.CENTER, false, SortDataType.Date, false),
+
+ Man_Days_Needed_Col("Man Days Needed", 40, SWT.CENTER, false, SortDataType.Float, false),
+
+ Percent_Rework_Col("Percent Rework", 40, SWT.CENTER, false, SortDataType.Integer, false),
+
+ Branch_Status_Col("Branch Status", 40, SWT.CENTER, false, SortDataType.String, false),
+
+ Number_of_Tasks_Col("Number of Tasks", 40, SWT.CENTER, false, SortDataType.String, false),
+
+ Validation_Required_Col("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.");
+
+ private final String name;
+ private final int width;
+ private final int align;
+ private final boolean show;
+ private final SortDataType sortDataType;
+ private final String desc;
+ private static Map<String, AtsXColumn> nameToAtsXColumn = new HashMap<String, AtsXColumn>();
+ private final boolean multiColumnEditable;
+
+ public static AtsXColumn getAtsXColumn(XViewerColumn xCol) {
+ if (nameToAtsXColumn.size() == 0) {
+ for (AtsXColumn atsCol : AtsXColumn.values())
+ nameToAtsXColumn.put(atsCol.getName(), atsCol);
+ }
+ return nameToAtsXColumn.get(xCol.getSystemName());
+ }
+
+ public XViewerColumn getXViewerColumn(AtsXColumn atsXCol) {
+ XViewerColumn xCol =
+ new XViewerColumn(atsXCol.name, atsXCol.width, atsXCol.width, atsXCol.align, atsXCol.isShow(),
+ atsXCol.sortDataType, 0);
+ if (atsXCol.getDesc() != null)
+ xCol.setToolTip(atsXCol.getName() + ":\n" + atsXCol.getDesc());
+ else
+ xCol.setToolTip(atsXCol.getDesc());
+ return xCol;
+ }
+
+ private AtsXColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable) {
+ this(name, width, align, show, sortDataType, multiColumnEditable, null);
+ }
+
+ private AtsXColumn(String name, int width, int align, boolean show, SortDataType sortDataType, boolean multiColumnEditable, String desc) {
+ this.name = name;
+ this.width = width;
+ this.align = align;
+ this.show = show;
+ this.sortDataType = sortDataType;
+ this.multiColumnEditable = multiColumnEditable;
+ this.desc = desc;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @return the align
+ */
+ public int getAlign() {
+ return align;
+ }
+
+ /**
+ * @return the show
+ */
+ public boolean isShow() {
+ return show;
+ }
+
+ /**
+ * @return the sortDataType
+ */
+ public SortDataType getSortDataType() {
+ return sortDataType;
+ }
+
+ /**
+ * @return the width
+ */
+ public int getWidth() {
+ return width;
+ }
+
+ /**
+ * @return the desc
+ */
+ public String getDesc() {
+ return desc;
+ }
+
+ public boolean isMultiColumnEditable() {
+ return multiColumnEditable;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.java
new file mode 100644
index 00000000000..490454ae373
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/IWorldViewArtifact.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.world;
+
+import java.util.Date;
+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 String getWorldViewNotes();
+
+ public int getWorldViewPercentRework();
+
+ public String getWorldViewNumberOfTasks();
+
+ public String getWorldViewPercentReworkStr();
+
+ public Date getWorldViewEstimatedReleaseDate() throws Exception;
+
+ public String getWorldViewEstimatedReleaseDateStr();
+
+ public String getWorldViewBranchStatus();
+
+ public double getWorldViewRemainHours();
+
+ public double getWorldViewManDaysNeeded();
+
+ public Result isWorldViewAnnualCostAvoidanceValid();
+
+ public double getWorldViewAnnualCostAvoidance();
+
+ public Result isWorldViewRemainHoursValid();
+
+ public Result isWorldViewManDaysNeededValid();
+
+ public Date getWorldViewReleaseDate() throws Exception;
+
+ public String getWorldViewReleaseDateStr();
+
+ public Date getWorldViewDeadlineDate() throws Exception;
+
+ public String getWorldViewDeadlineDateStr();
+
+ /**
+ * @return true if the deadline date causes
+ */
+ public Result isWorldViewDeadlineAlerting();
+
+ public String getWorldViewWorkPackage();
+
+ public String getWorldViewCategory();
+
+ public String getWorldViewCategory2();
+
+ public String getWorldViewCategory3();
+
+ public String getWorldViewType();
+
+ public String getWorldViewTitle();
+
+ public Date getWorldViewCompletedDate() throws Exception;
+
+ public String getWorldViewCompletedDateStr();
+
+ public String getWorldViewDescription();
+
+ public String getWorldViewValidationRequiredStr();
+
+ public boolean isMetricsFromTasks() throws Exception;
+
+ public Date getWorldViewCancelledDate() throws Exception;
+
+ public String getWorldViewCancelledDateStr();
+
+ public ChangeType getWorldViewChangeType();
+
+ public String getWorldViewChangeTypeStr();
+
+ public String getWorldViewState();
+
+ public String getWorldViewTeam();
+
+ public String getWorldViewRelatedToState();
+
+ public String getWorldViewUserCommunity();
+
+ public String getWorldViewResolution();
+
+ public String getWorldViewDecision();
+
+ public String getWorldViewLegacyPCR();
+
+ public String getWorldViewActionableItems();
+
+ public String getWorldViewActivePoc();
+
+ public Image getAssigneeImage();
+
+ public String getWorldViewCreatedDateStr();
+
+ public Date getWorldViewCreatedDate() throws Exception;
+
+ public String getWorldViewOriginator();
+
+ public String getWorldViewImplementer();
+
+ public String getWorldViewVersion();
+
+ public String getWorldViewID();
+
+ public String getWorldViewPriority();
+
+ public double getWorldViewEstimatedHours();
+
+ public double getWorldViewWeeklyBenefit();
+
+ public int getWorldViewStatePercentComplete();
+
+ public double getWorldViewStateHoursSpent();
+
+ public int getWorldViewTotalPercentComplete();
+
+ public double getWorldViewTotalHoursSpent();
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldArtifactItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldArtifactItem.java
new file mode 100644
index 00000000000..0d82baa43f9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldArtifactItem.java
@@ -0,0 +1,209 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.ats.ActionDebug;
+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.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent.EventData;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldArtifactItem implements IEventReceiver {
+
+ private Artifact artifact;
+ private final WorldXViewer xViewer;
+ protected List<WorldArtifactItem> artifactList;
+ protected WorldArtifactItem parentItem;
+ private ActionDebug debug = new ActionDebug(false, "WorldArtifactItem");
+
+ public WorldArtifactItem(WorldXViewer xViewer, Artifact artifact, WorldArtifactItem parentItem) {
+ this.xViewer = xViewer;
+ this.parentItem = parentItem;
+ artifactList = new ArrayList<WorldArtifactItem>();
+ setArtifact(artifact);
+ }
+
+ private void setArtifact(Artifact newArt) {
+ if (artifact != null) {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+ if (newArt != null) {
+ SkynetEventManager.getInstance().register(RemoteTransactionEvent.class, this);
+ SkynetEventManager.getInstance().register(LocalTransactionEvent.class, this);
+ }
+ artifact = newArt;
+ }
+
+ public StateMachineArtifact getSMA() {
+ if (artifact instanceof StateMachineArtifact) return (StateMachineArtifact) artifact;
+ return null;
+ }
+
+ public Artifact getArtifact() {
+ return artifact;
+ }
+
+ public List<WorldArtifactItem> getArtifactItems() {
+ return artifactList;
+ }
+
+ public WorldArtifactItem getParentItem() {
+ return parentItem;
+ }
+
+ protected void addArtifactItem(WorldArtifactItem artifactItem) {
+ artifactList.add(artifactItem);
+ artifactItem.parentItem = this;
+ }
+
+ protected void removeArtifactItem(WorldArtifactItem artifactItem) {
+ artifactList.remove(artifactItem);
+ fireRemove(artifactItem);
+ }
+
+ protected void fireRemove(Object removed) {
+ SkynetEventManager.getInstance().unRegisterAll(this);
+ }
+
+ private void addArtsToArtifactItems(WorldArtifactItem parentItem, ArrayList<WorldArtifactItem> items, Collection<? extends Artifact> arts) {
+ for (Artifact art : arts) {
+ WorldArtifactItem wai = new WorldArtifactItem(xViewer, art, parentItem);
+ items.add(wai);
+ addArtifactItem(wai);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object[] getChildren() {
+ debug.report("getChildren()");
+ if (artifact == null) {
+ Object[] objs = (Object[]) ((Collection) artifactList).toArray(new Object[artifactList.size()]);
+ return objs;
+ }
+ if (artifact.isDeleted()) return new Object[] {};
+ if (artifact instanceof ActionArtifact) {
+ ActionArtifact art = (ActionArtifact) artifact;
+ // Convert artifacts to WorldArtifactItems
+ ArrayList<WorldArtifactItem> wais = new ArrayList<WorldArtifactItem>();
+ try {
+ addArtsToArtifactItems(this, wais, art.getTeamWorkFlowArtifacts());
+ } catch (SQLException ex) {
+ // Don't do anything
+ ;
+ }
+ return (Object[]) ((ArrayList) wais).toArray(new Object[((ArrayList) wais).size()]);
+ }
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ TeamWorkFlowArtifact twf = (TeamWorkFlowArtifact) artifact;
+ SMAManager smaMgr = new SMAManager(twf);
+ // Convert artifacts to WorldArtifactItems
+ ArrayList<WorldArtifactItem> wais = new ArrayList<WorldArtifactItem>();
+ try {
+ addArtsToArtifactItems(this, wais, smaMgr.getReviewManager().getReviews());
+ addArtsToArtifactItems(this, wais, smaMgr.getTaskMgr().getTaskArtifacts());
+ } catch (SQLException ex) {
+ // Don't do anything
+ }
+ return (Object[]) ((ArrayList) wais).toArray(new Object[((ArrayList) wais).size()]);
+ }
+ return null;
+ }
+
+ public void dispose() {
+ // Remove children
+ for (WorldArtifactItem child : artifactList) {
+ child.dispose();
+ }
+ // Clear artifactList
+ artifactList.clear();
+ // Clear out event registration
+ setArtifact(null);
+ }
+
+ public void onEvent(final Event event) {
+ if (artifact == null || artifact.isDeleted() || xViewer.getTree() == null || xViewer.getTree().isDisposed()) {
+ if (xViewer.getTree() != null && !xViewer.getTree().isDisposed()) xViewer.remove(this);
+ dispose();
+ return;
+ }
+ final WorldArtifactItem wai = this;
+
+ if (event instanceof TransactionEvent) {
+ EventData ed = ((TransactionEvent) event).getEventData(artifact);
+ if (ed.isRemoved()) {
+ xViewer.remove(wai);
+ } else if (ed.getAvie() != null && ed.getAvie().getOldVersion().equals(artifact)) {
+ setArtifact((Artifact) ed.getAvie().getNewVersion());
+ xViewer.update(wai, null);
+ } else if (ed.isModified() || ed.isRelChange()) {
+ xViewer.update(wai, null);
+ }
+
+ // If ActionArtifact, need to check if it was a child team that changed
+ // Cause Action shows data rolled up from team children
+ if (artifact instanceof ActionArtifact) {
+ try {
+ for (Artifact team : ((ActionArtifact) artifact).getTeamWorkFlowArtifacts()) {
+ EventData teamEd = ((TransactionEvent) event).getEventData(team);
+ if (teamEd.isHasEvent()) {
+ xViewer.update(wai, null);
+ break;
+ }
+ }
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ }
+ if (artifact instanceof TeamWorkFlowArtifact) {
+ try {
+ SMAManager smaMgr = new SMAManager((TeamWorkFlowArtifact) artifact);
+ for (Artifact taskArt : smaMgr.getTaskMgr().getTaskArtifacts()) {
+ EventData teamEd = ((TransactionEvent) event).getEventData(taskArt);
+ if (teamEd.isHasEvent()) {
+ xViewer.update(wai, null);
+ break;
+ }
+ }
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ }
+ } else
+ OSEELog.logSevere(AtsPlugin.class, "Unexpected event => " + event, true);
+ }
+
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ public String toString() {
+ return getArtifact().getArtifactTypeName() + " - \"" + artifact + "\"";
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.java
new file mode 100644
index 00000000000..6e6ffad24e3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldCompletedFilter.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.world;
+
+import java.util.regex.Pattern;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+public class WorldCompletedFilter extends ViewerFilter {
+
+ Pattern p = Pattern.compile("(Completed|Cancelled)");
+
+ public WorldCompletedFilter() {
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ WorldArtifactItem item = (WorldArtifactItem) element;
+ Artifact art = item.getArtifact();
+ if (art instanceof IWorldViewArtifact) {
+ return !p.matcher(((IWorldViewArtifact) art).getWorldViewState()).find();
+ }
+ return true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
new file mode 100644
index 00000000000..4ff3cf1aaeb
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldContentProvider.java
@@ -0,0 +1,156 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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 org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.ActionDebug;
+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.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+
+public class WorldContentProvider implements ITreeContentProvider {
+
+ protected Collection<WorldArtifactItem> rootSet = new HashSet<WorldArtifactItem>();
+ private final WorldXViewer xViewer;
+ private static Object[] EMPTY_ARRAY = new Object[0];
+ private ActionDebug debug = new ActionDebug(false, "WorldTreeContentProvider");
+
+ public WorldContentProvider(WorldXViewer WorldXViewer) {
+ super();
+ this.xViewer = WorldXViewer;
+ }
+
+ public void add(final WorldArtifactItem item) {
+ add(Arrays.asList(new WorldArtifactItem[] {item}));
+ }
+
+ public void add(final Collection<? extends WorldArtifactItem> 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 WorldArtifactItem> 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(new Artifact[] {art}));
+ }
+
+ public void remove(final Collection<? extends Artifact> arts) {
+ if (xViewer.getInput() == null) xViewer.setInput(rootSet);
+ ArrayList<WorldArtifactItem> delItems = new ArrayList<WorldArtifactItem>();
+ delItems.addAll(rootSet);
+ for (Artifact art : arts) {
+ for (WorldArtifactItem wai : rootSet)
+ if (wai.getArtifact().equals(art)) delItems.add(wai);
+ }
+ removeItems(delItems);
+ }
+
+ public void removeItems(final Collection<? extends WorldArtifactItem> 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);
+ for (WorldArtifactItem wai : rootSet)
+ wai.dispose();
+ rootSet.clear();
+ xViewer.refresh();
+ };
+ });
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ debug.report("getChildren");
+ if (parentElement instanceof Collection) {
+ return ((Collection<?>) parentElement).toArray();
+ }
+ if (parentElement instanceof WorldArtifactItem) {
+ return ((WorldArtifactItem) parentElement).getChildren();
+ }
+ return EMPTY_ARRAY;
+ }
+
+ public Object getParent(Object element) {
+ debug.report("getParent");
+ if (element instanceof WorldArtifactItem) {
+ return ((WorldArtifactItem) element).getParentItem();
+ }
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ debug.report("hasChildren");
+ if (element instanceof Collection) return true;
+ if (element instanceof String) return false;
+ if (((WorldArtifactItem) element).getArtifact() == null) return false;
+ if (((WorldArtifactItem) element).getArtifact() instanceof TaskArtifact) return false;
+ if (((WorldArtifactItem) element).getArtifact() instanceof DecisionReviewArtifact) return false;
+ if (((WorldArtifactItem) element).getArtifact() instanceof PeerToPeerReviewArtifact) return false;
+ if (((WorldArtifactItem) element).getArtifact().isDeleted()) return false;
+ 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<WorldArtifactItem> getRootSet() {
+ return rootSet;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.java
new file mode 100644
index 00000000000..bbe04cb0ce7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldLabelProvider.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.world;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.osee.ats.AtsPlugin;
+import org.eclipse.osee.ats.util.AtsLib;
+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.xviewer.XViewerColumn;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+
+public class WorldLabelProvider implements ITableLabelProvider {
+ Font font = null;
+
+ private final WorldXViewer treeViewer;
+
+ public WorldLabelProvider(WorldXViewer treeViewer) {
+ super();
+ this.treeViewer = treeViewer;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (element instanceof String) {
+ if (columnIndex == 1)
+ return (String) element;
+ else
+ return "";
+ }
+ Artifact artifact = ((WorldArtifactItem) element).getArtifact();
+ if (artifact == null || artifact.isDeleted()) return "";
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ return getColumnText(element, columnIndex, artifact, xCol, aCol);
+ }
+ return "";
+ }
+
+ /**
+ * Provided as optimization of subclassed classes so provider doesn't have to retrieve the same information that has
+ * already been retrieved
+ *
+ * @param element
+ * @param columnIndex
+ * @param artifact
+ * @param xCol
+ * @param aCol
+ * @return column string
+ */
+ public String getColumnText(Object element, int columnIndex, Artifact artifact, XViewerColumn xCol, AtsXColumn aCol) {
+ if (!xCol.isShow()) return ""; // Since not shown, don't display
+ IWorldViewArtifact wva = (IWorldViewArtifact) artifact;
+ if (aCol == AtsXColumn.Type_Col) return wva.getWorldViewType();
+ if (aCol == AtsXColumn.Actionable_Items_Col) return wva.getWorldViewActionableItems();
+ if (aCol == AtsXColumn.User_Community_Col) return wva.getWorldViewUserCommunity();
+ if (aCol == AtsXColumn.Title_Col) return wva.getWorldViewTitle();
+ if (aCol == AtsXColumn.Number_of_Tasks_Col) return wva.getWorldViewNumberOfTasks();
+ if (aCol == AtsXColumn.Description_Col) return wva.getWorldViewDescription();
+ if (aCol == AtsXColumn.Metrics_from_Tasks_Col) {
+ try {
+ return wva.isMetricsFromTasks() ? "yes" : "";
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return ex.getLocalizedMessage();
+ }
+ }
+ if (aCol == AtsXColumn.Validation_Required_Col) return wva.getWorldViewValidationRequiredStr();
+ if (aCol == AtsXColumn.Version_Target_Col) return wva.getWorldViewVersion();
+ if (aCol == AtsXColumn.Completed_Date_Col) return wva.getWorldViewCompletedDateStr();
+ if (aCol == AtsXColumn.Cancelled_Date_Col) return wva.getWorldViewCancelledDateStr();
+ if (aCol == AtsXColumn.Team_Col) return wva.getWorldViewTeam();
+ if (aCol == AtsXColumn.Related_To_State_Col) return wva.getWorldViewRelatedToState();
+ if (aCol == AtsXColumn.Originator_Col) return wva.getWorldViewOriginator();
+ if (aCol == AtsXColumn.Branch_Status_Col) return wva.getWorldViewBranchStatus();
+ if (aCol == AtsXColumn.Implementor_Col) return wva.getWorldViewImplementer();
+ if (aCol == AtsXColumn.Change_Type_Col) return wva.getWorldViewChangeTypeStr();
+ if (aCol == AtsXColumn.State_Col) return wva.getWorldViewState();
+ if (aCol == AtsXColumn.Assignees_Col) return wva.getWorldViewActivePoc();
+ if (aCol == AtsXColumn.Created_Date_Col) return wva.getWorldViewCreatedDateStr();
+ if (aCol == AtsXColumn.ID_Col) return wva.getWorldViewID();
+ if (aCol == AtsXColumn.Priority_Col) return wva.getWorldViewPriority();
+ if (aCol == AtsXColumn.Resolution_Col) return wva.getWorldViewResolution();
+ if (aCol == AtsXColumn.Decision_Col) return wva.getWorldViewDecision();
+ if (aCol == AtsXColumn.Legacy_PCR_Col) return wva.getWorldViewLegacyPCR();
+ if (aCol == AtsXColumn.Weekly_Benefit_Hrs_Col) return AtsLib.doubleToStrString(wva.getWorldViewWeeklyBenefit(),
+ true);
+ if (aCol == AtsXColumn.Estimated_Hours_Col) return AtsLib.doubleToStrString(wva.getWorldViewEstimatedHours());
+ if (aCol == AtsXColumn.Annual_Cost_Avoidance_Col) {
+ Result result = wva.isWorldViewAnnualCostAvoidanceValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewAnnualCostAvoidance(), true);
+ }
+ if (aCol == AtsXColumn.Remaining_Hours_Col) {
+ Result result = wva.isWorldViewRemainHoursValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewRemainHours());
+ }
+ if (aCol == AtsXColumn.Man_Days_Needed_Col) {
+ Result result = wva.isWorldViewManDaysNeededValid();
+ if (result.isFalse()) return result.getText();
+ return AtsLib.doubleToStrString(wva.getWorldViewManDaysNeeded());
+ }
+ if (aCol == AtsXColumn.State_Percent_Col) return AtsLib.doubleToStrString(wva.getWorldViewStatePercentComplete());
+ if (aCol == AtsXColumn.State_Hours_Spent_Col) return AtsLib.doubleToStrString(wva.getWorldViewStateHoursSpent());
+ if (aCol == AtsXColumn.Notes_Col) return wva.getWorldViewNotes();
+ if (aCol == AtsXColumn.Percent_Rework_Col) return wva.getWorldViewPercentReworkStr();
+ if (aCol == AtsXColumn.Estimated_Release_Date_Col) return wva.getWorldViewEstimatedReleaseDateStr();
+ if (aCol == AtsXColumn.Release_Date_Col) return wva.getWorldViewReleaseDateStr();
+ if (aCol == AtsXColumn.Deadline_Col) return wva.getWorldViewDeadlineDateStr();
+ if (aCol == AtsXColumn.Work_Package_Col) return wva.getWorldViewWorkPackage();
+ if (aCol == AtsXColumn.Category_Col) return wva.getWorldViewCategory();
+ if (aCol == AtsXColumn.Category2_Col) return wva.getWorldViewCategory2();
+ if (aCol == AtsXColumn.Category3_Col) return wva.getWorldViewCategory3();
+ if (aCol == AtsXColumn.Total_Percent_Complete_Col) return wva.getWorldViewTotalPercentComplete() + "";
+ if (aCol == AtsXColumn.Total_Hours_Spent_Col) return AtsLib.doubleToStrString(wva.getWorldViewTotalHoursSpent());
+
+ 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 WorldXViewer getTreeViewer() {
+ return treeViewer;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ if (element instanceof String) return null;
+ Artifact artifact = ((WorldArtifactItem) element).getArtifact();
+ if (artifact == null || artifact.isDeleted()) return null;
+ XViewerColumn xCol = treeViewer.getXTreeColumn(columnIndex);
+ if (xCol != null) {
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ return getColumnImage(element, columnIndex, artifact, xCol, aCol);
+ }
+ return null;
+ }
+
+ /**
+ * Provided as optimization of subclassed classes so provider doesn't have to retrieve the same information that has
+ * already been retrieved
+ *
+ * @param element
+ * @param columnIndex
+ * @param artifact
+ * @param xCol
+ * @param aCol
+ * @return image to display
+ */
+ public Image getColumnImage(Object element, int columnIndex, Artifact artifact, XViewerColumn xCol, AtsXColumn aCol) {
+ if (element instanceof String) return null;
+ IWorldViewArtifact wva = (IWorldViewArtifact) artifact;
+ if (!xCol.isShow()) return null; // Since not shown, don't display
+ if (aCol == AtsXColumn.Type_Col)
+ return artifact.getImage();
+ else if (aCol == AtsXColumn.Change_Type_Col)
+ return wva.getWorldViewChangeType().getImage();
+ else if (aCol == AtsXColumn.Assignees_Col)
+ return wva.getAssigneeImage();
+ else if (aCol == AtsXColumn.Deadline_Col) {
+ if (wva.isWorldViewDeadlineAlerting().isTrue()) return AtsPlugin.getInstance().getImage("warn.gif");
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableColorProvider#getBackground(java.lang.Object, int)
+ */
+ public Color getBackground(Object element, int columnIndex) {
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldView.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldView.java
new file mode 100644
index 00000000000..a1fcb406b67
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldView.java
@@ -0,0 +1,641 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+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.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+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.ActionDebug;
+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.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.navigate.AtsNavigateViewItems;
+import org.eclipse.osee.ats.util.SMAMetrics;
+import org.eclipse.osee.ats.world.search.WorldSearchItem;
+import org.eclipse.osee.framework.plugin.core.config.ConfigUtil;
+import org.eclipse.osee.framework.skynet.core.SkynetAuthentication;
+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.event.LocalTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.RemoteTransactionEvent;
+import org.eclipse.osee.framework.skynet.core.event.SkynetEventManager;
+import org.eclipse.osee.framework.skynet.core.event.TransactionEvent;
+import org.eclipse.osee.framework.ui.plugin.event.Event;
+import org.eclipse.osee.framework.ui.plugin.event.IEventReceiver;
+import org.eclipse.osee.framework.ui.plugin.util.ALayout;
+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.db.ConnectionHandler;
+import org.eclipse.osee.framework.ui.skynet.SkynetContributionItem;
+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.XDate;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+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.Transfer;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+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.Label;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+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 WorldView extends ViewPart implements IEventReceiver, IPartListener, IActionable {
+ protected Browser browser;
+ public static final String VIEW_ID = "org.eclipse.osee.ats.world.WorldView";
+ public static final String HELP_CONTEXT_ID = "atsWorldView";
+ private ActionDebug debug = new ActionDebug(false, "WorldView");
+ private Action filterCompletedAction, releaseMetricsAction, selectionMetricsAction;
+ private Label warningLabel, searchNameLabel, extraInfoLabel;
+ private WorldSearchItem lastSearchItem;
+ private WorldXViewer xViewer;
+ private static Logger logger = ConfigUtil.getConfigFactory().getLogger(WorldView.class);
+ private SkynetEventManager eventManager = SkynetEventManager.getInstance();
+ private WorldCompletedFilter worldCompletedFilter = new WorldCompletedFilter();
+
+ /**
+ * The constructor.
+ */
+ public WorldView() {
+ }
+
+ public static WorldView getWorldView() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ return (WorldView) page.showView(WorldView.VIEW_ID);
+ } catch (PartInitException e1) {
+ MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Launch Error",
+ "Couldn't Launch OSEE World View " + e1.getMessage());
+ }
+ return null;
+ }
+
+ public void atsArtifactSaved(Artifact artifact) {
+ if (artifact instanceof IWorldViewArtifact) xViewer.refresh(artifact);
+ }
+
+ public static void loadIt(final String name, final Collection<? extends Artifact> arts) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ try {
+ WorldView worldView = (WorldView) page.showView(WorldView.VIEW_ID);
+ worldView.load(name, arts);
+ } catch (PartInitException e1) {
+ OSEELog.logSevere(AtsPlugin.class, "Couldn't Launch XViewer Dev View ", true);
+ }
+ }
+ });
+ }
+
+ public void load(final String name, final Collection<? extends Artifact> arts) {
+ lastSearchItem = null;
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ if (arts.size() == 0)
+ setTableTitle("No Results Found - " + name, true);
+ else
+ setTableTitle(name, false);
+ xViewer.set(arts);
+ }
+ });
+ }
+
+ public void setFocus() {
+ }
+
+ public void createPartControl(Composite parent) {
+ debug.report("createPartControl");
+
+ try {
+ ConnectionHandler.getConnection();
+ } catch (Exception ex) {
+ (new Label(parent, SWT.NONE)).setText(" DB Connection Unavailable");
+ return;
+ }
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 1;
+ layout.verticalSpacing = 0;
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
+ parent.setLayout(layout);
+ parent.setLayoutData(new GridData(GridData.FILL_BOTH));
+ // parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WHITE));
+
+ Composite comp = new Composite(parent, SWT.NONE);
+ comp.setLayout(new GridLayout(1, false));
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ comp.setLayoutData(gd);
+
+ // Heaader Composite
+ Composite headerComp = new Composite(comp, SWT.NONE);
+ headerComp.setLayout(ALayout.getZeroMarginLayout(3, false));
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ headerComp.setLayoutData(gd);
+
+ warningLabel = new Label(headerComp, SWT.NONE);
+ searchNameLabel = new Label(headerComp, SWT.NONE);
+
+ String adminStr = "";
+ if (AtsPlugin.isAtsAdmin())
+ adminStr = "Admin - " + getWhoAmI();
+ else if (AtsPlugin.isAtsShowUser()) adminStr = getWhoAmI();
+ if (AtsPlugin.isAtsDisableEmail()) adminStr += " - Email Disabled";
+ if (AtsPlugin.isAtsUseWorkflowFiles()) adminStr += " - AtsUseWorkflowFiles";
+ if (AtsPlugin.isAtsAlwaysEmailMe()) adminStr += " - AtsAlwaysEmailMe";
+ if (!adminStr.equals("")) {
+ Label label = new Label(headerComp, SWT.NONE);
+ label.setText(adminStr);
+ label.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
+ gd = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
+ label.setLayoutData(gd);
+ }
+
+ extraInfoLabel = new Label(headerComp, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 3;
+ extraInfoLabel.setLayoutData(gd);
+
+ xViewer = new WorldXViewer(comp, SWT.MULTI | SWT.BORDER | SWT.FULL_SELECTION);
+ xViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ xViewer.setContentProvider(new WorldContentProvider(xViewer));
+ xViewer.setLabelProvider(new WorldLabelProvider(xViewer));
+ AtsPlugin.getInstance().setHelp(xViewer.getControl(), HELP_CONTEXT_ID);
+
+ Tree tree = xViewer.getTree();
+ GridData gridData = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
+ tree.setLayoutData(gridData);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+
+ xViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateExtraInfoLine();
+ }
+ });
+ xViewer.getTree().addKeyListener(new KeyListener() {
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.events.KeyListener#keyPressed(org.eclipse.swt.events.KeyEvent)
+ */
+ public void keyPressed(KeyEvent event) {
+ // if CTRL key is already pressed
+ if ((event.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
+ if (event.keyCode == 'a') {
+ xViewer.getTree().setSelection(xViewer.getTree().getItems());
+ updateExtraInfoLine();
+ } 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();
+ }
+ }
+ // System.out.println("keypressed " + event.keyCode);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent)
+ */
+ public void keyReleased(KeyEvent event) {
+ }
+ });
+
+ parent.layout();
+ createActions();
+ SkynetContributionItem.addTo(this, true);
+ setupDragAndDropSupport();
+
+ eventManager.register(LocalTransactionEvent.class, this);
+ eventManager.register(RemoteTransactionEvent.class, this);
+
+ }
+
+ private void setupDragAndDropSupport() {
+ DragSource source = new DragSource(xViewer.getTree(), DND.DROP_COPY);
+ source.setTransfer(new Transfer[] {ArtifactTransfer.getInstance()});
+ source.addDragListener(new DragSourceListener() {
+
+ public void dragFinished(DragSourceEvent event) {
+ }
+
+ public void dragSetData(DragSourceEvent event) {
+ String item = "work";
+ event.data =
+ new ArtifactData(xViewer.getSelectedArtifacts().toArray(
+ new Artifact[xViewer.getSelectedArtifacts().size()]), item, WorldView.VIEW_ID);
+ }
+
+ public void dragStart(DragSourceEvent event) {
+ }
+ });
+ }
+
+ private String getWhoAmI() {
+ return ConfigUtil.getConfigFactory().getOseeConfig().getServiceID() + ", " + ConfigUtil.getConfigFactory().getOseeConfig().getUser() + " - " + SkynetAuthentication.getInstance().getAuthenticatedUser().getName();
+ }
+
+ public class FilterLabelProvider implements ILabelProvider {
+
+ public Image getImage(Object arg0) {
+ return null;
+ }
+
+ public String getText(Object arg0) {
+ return ((WorldSearchItem) arg0).getSelectedName();
+ }
+
+ 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) {
+ }
+ }
+
+ private class LoadTableJob extends Job {
+
+ @SuppressWarnings("unused")
+ private final boolean sort;
+ private final WorldSearchItem searchItem;
+ private boolean cancel = false;
+
+ public LoadTableJob(WorldSearchItem searchItem, WorldView worldView, boolean sort) {
+ super("Loading \"" + searchItem.getSelectedName() + "\"...");
+ this.searchItem = searchItem;
+ this.sort = sort;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+
+ setTableTitle("Loading \"" + searchItem.getSelectedName() + "\"...", false);
+ cancel = false;
+ searchItem.setCancelled(cancel);
+ debug.report("Querying DB", true);
+ final Collection<Artifact> artifacts;
+ xViewer.clear();
+ try {
+ artifacts = searchItem.performSearchGetResults(true, true);
+ if (artifacts.size() == 0) {
+ if (searchItem.isCancelled()) {
+ monitor.done();
+ setTableTitle("CANCELLED - " + searchItem.getSelectedName(), false);
+ return Status.CANCEL_STATUS;
+ } else {
+ monitor.done();
+ setTableTitle("No Results Found - " + searchItem.getSelectedName(), true);
+ return Status.OK_STATUS;
+ }
+ }
+ }
+
+ catch (final Exception ex) {
+ String str = "Exception occurred. Network may be down.";
+ if (ex.getLocalizedMessage() != null && !ex.getLocalizedMessage().equals("")) str +=
+ " => " + ex.getLocalizedMessage();
+ setTableTitle("Searching Error - " + searchItem.getSelectedName(), false);
+ logger.log(Level.SEVERE, "Searching Error - " + ex.getLocalizedMessage(), ex);
+ monitor.done();
+ return new Status(Status.ERROR, AtsPlugin.PLUGIN_ID, -1, str, null);
+ }
+ monitor.done();
+ setTableTitle(searchItem.getSelectedName(), false);
+ return Status.OK_STATUS;
+ }
+
+ }
+
+ 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();
+ xViewer.setReportingTitle(title + " - " + XDate.getDateNow());
+ updateExtraInfoLine();
+ };
+ });
+ }
+
+ public void updateExtraInfoLine() {
+ if (extraInfoLabel == null || extraInfoLabel.isDisposed()) return;
+ if (releaseMetricsAction.isChecked()) {
+ extraInfoLabel.setText(SMAMetrics.getReleaseEstRemainMetrics(getxViewer().getSelectedSMAArtifacts()));
+ } else if (selectionMetricsAction.isChecked()) {
+ extraInfoLabel.setText(SMAMetrics.getEstRemainMetrics(getxViewer().getSelectedSMAArtifacts()));
+ } else
+ extraInfoLabel.setText("");
+ extraInfoLabel.getParent().layout();
+ }
+
+ public void loadTable(WorldSearchItem searchItem, boolean sort) {
+ this.lastSearchItem = searchItem;
+ debug.report("loadTable", true);
+ if (!ConnectionHandler.isConnected()) {
+ AWorkbench.popup("ERROR", "DB Connection Unavailable");
+ return;
+ }
+
+ if (searchItem == null) return;
+ LoadTableJob job = null;
+ try {
+ job = new LoadTableJob(searchItem, this, sort);
+ job.setUser(false);
+ job.setPriority(Job.LONG);
+ job.schedule();
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, "Load Table Failed", ex, true);
+ }
+ }
+
+ protected void createActions() {
+ debug.report("createActions");
+
+ Action myWorldAction = new Action("My World") {
+
+ public void run() {
+ loadTable(AtsNavigateViewItems.getInstance().getMyWorldSearchItem(), true);
+ }
+ };
+ myWorldAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("MyWorld.gif"));
+ myWorldAction.setToolTipText("My World");
+
+ filterCompletedAction = new Action("Filter Out Completed/Cancelled - Ctrl-F", Action.AS_CHECK_BOX) {
+
+ public void run() {
+ if (filterCompletedAction.isChecked()) {
+ xViewer.addFilter(worldCompletedFilter);
+ } else {
+ xViewer.removeFilter(worldCompletedFilter);
+ }
+ updateExtendedStatusString();
+ xViewer.refresh();
+ }
+ };
+ filterCompletedAction.setToolTipText("Filter Out Completed/Cancelled - Ctrl-F");
+
+ Action refreshAction = new Action("Refresh") {
+
+ public void run() {
+ if (lastSearchItem != null) loadTable(lastSearchItem, true);
+ }
+ };
+ refreshAction.setImageDescriptor(AtsPlugin.getInstance().getImageDescriptor("refresh.gif"));
+ refreshAction.setToolTipText("Refresh");
+
+ Action whoAmIAction = new Action("Who Am I") {
+
+ public void run() {
+ MessageDialog.openInformation(Display.getCurrent().getActiveShell(), "Who Am I", getWhoAmI());
+ }
+ };
+ whoAmIAction.setToolTipText("Who Am I");
+
+ releaseMetricsAction = new Action("Show Release Metrics by Release Version - Ctrl-Z", Action.AS_CHECK_BOX) {
+
+ public void run() {
+ if (releaseMetricsAction.isChecked()) selectionMetricsAction.setChecked(false);
+ updateExtraInfoLine();
+ }
+ };
+ releaseMetricsAction.setToolTipText("Show Release Metrics by Release Version - Ctrl-Z");
+
+ selectionMetricsAction = new Action("Show Release Metrics by Selection - Ctrl-X", Action.AS_CHECK_BOX) {
+
+ public void run() {
+ if (selectionMetricsAction.isChecked()) releaseMetricsAction.setChecked(false);
+ updateExtraInfoLine();
+ }
+ };
+ selectionMetricsAction.setToolTipText("Show Release Metrics by Selection - Ctrl-X");
+
+ Action toAction = new Action("Re-display WorkFlows as Actions", Action.AS_PUSH_BUTTON) {
+
+ public void run() {
+ redisplayAsAction();
+ }
+ };
+ toAction.setToolTipText("Re-display WorkFlows as Actions");
+
+ Action toWorkFlow = new Action("Re-display Actions as WorkFlows", Action.AS_PUSH_BUTTON) {
+
+ public void run() {
+ redisplayAsWorkFlow();
+ }
+ };
+ toWorkFlow.setToolTipText("Re-display Actions as WorkFlows");
+
+ IToolBarManager toolbarManager = getViewSite().getActionBars().getToolBarManager();
+ toolbarManager.add(myWorldAction);
+ toolbarManager.add(new NewAction());
+ toolbarManager.add(refreshAction);
+
+ IMenuManager manager = getViewSite().getActionBars().getMenuManager();
+ manager.add(filterCompletedAction);
+ manager.add(new Separator());
+ manager.add(whoAmIAction);
+ manager.add(releaseMetricsAction);
+ manager.add(selectionMetricsAction);
+ manager.add(new Separator());
+ manager.add(toAction);
+ manager.add(toWorkFlow);
+ if (AtsPlugin.isAtsAdmin()) {
+ manager.add(new Separator());
+ }
+ xViewer.addCustomizeToViewToolbar(this);
+ OseeAts.addBugToViewToolbar(this, this, AtsPlugin.getInstance(), VIEW_ID, "ATS World");
+ }
+
+ public void updateExtendedStatusString() {
+ String str = "";
+ if (filterCompletedAction.isChecked()) {
+ str += " Complete/Cancel FILTERED - ";
+ }
+ xViewer.setExtendedStatusString(str);
+ }
+
+ public void redisplayAsAction() {
+ try {
+ TreeItem treeItem[] = xViewer.getTree().getItems();
+ Set<Artifact> arts = new HashSet<Artifact>();
+ for (TreeItem item : treeItem) {
+ Object obj = item.getData();
+ if (obj instanceof WorldArtifactItem) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art instanceof TeamWorkFlowArtifact) {
+ arts.add(((TeamWorkFlowArtifact) art).getParentActionArtifact());
+ } else
+ arts.add(art);
+ }
+ }
+ load(searchNameLabel.getText(), arts);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public void redisplayAsWorkFlow() {
+ try {
+ TreeItem treeItem[] = xViewer.getTree().getItems();
+ Set<Artifact> arts = new HashSet<Artifact>();
+ for (TreeItem item : treeItem) {
+ if (item.getData() instanceof WorldArtifactItem) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art instanceof ActionArtifact) {
+ arts.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ } else
+ arts.add(art);
+ }
+ }
+ load(searchNameLabel.getText(), arts);
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public String getActionDescription() {
+ if (lastSearchItem != null) return String.format("Search Item: %s", lastSearchItem.getSelectedName());
+ return "";
+ }
+
+ public void partActivated(IWorkbenchPart part) {
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+ if (part.equals(this)) {
+ xViewer.dispose();
+ }
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ }
+
+ public WorldXViewer getxViewer() {
+ return xViewer;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.part.WorkbenchPart#dispose()
+ */
+ @Override
+ public void dispose() {
+ super.dispose();
+ if (xViewer != null) xViewer.dispose();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.jdk.core.event.IEventReceiver#runOnEventInDisplayThread()
+ */
+ public boolean runOnEventInDisplayThread() {
+ return true;
+ }
+
+ public void onEvent(final Event event) {
+ if (event instanceof TransactionEvent) {
+ updateExtraInfoLine();
+ }
+ }
+} \ No newline at end of file
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
new file mode 100644
index 00000000000..46ccfe2ba80
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -0,0 +1,826 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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 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.TeamWorkFlowArtifact;
+import org.eclipse.osee.ats.editor.SMAManager;
+import org.eclipse.osee.ats.util.ArtifactEmailWizard;
+import org.eclipse.osee.ats.util.AtsLib;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.Favorites;
+import org.eclipse.osee.ats.util.Subscribe;
+import org.eclipse.osee.ats.util.widgets.SMAState;
+import org.eclipse.osee.framework.jdk.core.util.AHTML;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.transaction.AbstractSkynetTxTemplate;
+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.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.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.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.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 WorldXViewer extends XViewer {
+
+ private static String NAMESPACE = "org.eclipse.osee.ats.WorldXViewer";
+ 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";
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public WorldXViewer(Composite parent, int style) {
+ this(parent, style, NAMESPACE, new WorldXViewerFactory());
+ }
+
+ public WorldXViewer(Composite parent, int style, String nameSpace, IXViewerFactory xViewerFactory) {
+ super(parent, style, nameSpace, xViewerFactory);
+ this.addDoubleClickListener(new IDoubleClickListener() {
+ public void doubleClick(org.eclipse.jface.viewers.DoubleClickEvent event) {
+ handleDoubleClick();
+ };
+ });
+ }
+
+ @Override
+ protected void createSupportWidgets(Composite parent) {
+ super.createSupportWidgets(parent);
+ parent.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ ((WorldContentProvider) getContentProvider()).clear();
+ }
+ });
+ createMenuActions();
+ }
+
+ Action editChangeTypeAction;
+ Action editPriorityAction;
+ Action editTargetVersionAction;
+ Action editActionableItemsAction;
+ Action convertActionableItemsAction;
+ Action openInAtsEditorAction;
+ Action favoritesAction;
+ Action subscribedAction;
+ Action openInArtifactEditorAction;
+ 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();
+ }
+ });
+
+ editChangeTypeAction = new Action("Edit Change Type", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangeType(getSelectedTeamWorkflowArtifacts(), true)) {
+ update(getSelectedArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editPriorityAction = new Action("Edit Priority", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ if (SMAManager.promptChangePriority(getSelectedTeamWorkflowArtifacts(), true)) {
+ update(getSelectedArtifactItemsArray(), null);
+ }
+ }
+ };
+
+ editTargetVersionAction = new Action("Edit Targeted Version", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ try {
+ if (SMAManager.promptChangeVersion(getSelectedTeamWorkflowArtifacts(), true)) {
+ update(getSelectedArtifactItemsArray(), null);
+ }
+ } catch (SQLException 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(getSelectedArtifactItemsArray()[0]);
+ } else {
+ TeamWorkFlowArtifact teamArt = getSelectedTeamWorkflowArtifacts().iterator().next();
+ AtsLib.editTeamActionableItems(teamArt);
+ refresh(getSelectedArtifactItemsArray()[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(getSelectedArtifactItemsArray()[0]);
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ };
+
+ openInAtsEditorAction = new Action("Open in ATS Editor", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ AtsLib.openAtsAction(getSelectedArtifactItems().iterator().next().getArtifact(),
+ AtsOpenOption.OpenOneOrPopupSelect);
+ }
+ };
+
+ 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().getArtifact());
+ 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() {
+ handleEmailSelectedAtsObject();
+ }
+ };
+
+ resetActionArtifactAction = new Action("Reset Action off Children", Action.AS_PUSH_BUTTON) {
+ @Override
+ public void run() {
+ for (ActionArtifact actionArt : getSelectedActionArtifacts()) {
+ try {
+ actionArt.resetAttributesOffChildren();
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+ }
+ };
+ }
+
+ @Override
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ handleColumnMultiEdit(treeColumn, treeItems, true);
+ }
+
+ public void handleColumnMultiEdit(TreeColumn treeColumn, Collection<TreeItem> treeItems, final boolean persist) {
+ final AtsXColumn aCol = AtsXColumn.getAtsXColumn((XViewerColumn) treeColumn.getData());
+ XResultData rData = new XResultData(AtsPlugin.getLogger());
+ final String attrName = getAttributeNameFromColumn(aCol);
+ if (attrName == null) {
+ AWorkbench.popup("ERROR", "Un-handled column " + treeColumn.getText());
+ return;
+ }
+ final Set<Artifact> useArts = new HashSet<Artifact>();
+ for (TreeItem item : treeItems) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art.isAttributeTypeValid(attrName))
+ useArts.add(art);
+ else
+ rData.logError(attrName + " not valid for artifact " + art.getHumanReadableId() + " - " + art.getDescriptiveName());
+ }
+ if (!rData.isEmpty()) {
+ rData.report("Column Multi Edit Errors");
+ return;
+ }
+ try {
+ if (useArts.size() > 0) {
+ if (persist) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ ArtifactPromptChange.promptChangeAttribute(attrName, aCol.getName(), useArts, persist);
+ }
+ };
+ txWrapper.execute();
+ } else {
+ ArtifactPromptChange.promptChangeAttribute(attrName, aCol.getName(), useArts, persist);
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(SkynetGuiPlugin.class, ex, true);
+ }
+ }
+
+ private String getAttributeNameFromColumn(AtsXColumn aCol) {
+ if (aCol == AtsXColumn.Notes_Col)
+ return ATSAttributes.SMA_NOTE_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Category_Col)
+ return ATSAttributes.CATEGORY_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Category2_Col)
+ return ATSAttributes.CATEGORY2_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Category3_Col)
+ return ATSAttributes.CATEGORY3_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Related_To_State_Col)
+ return ATSAttributes.RELATED_TO_STATE_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Work_Package_Col)
+ return ATSAttributes.WORK_PACKAGE_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Deadline_Col)
+ return ATSAttributes.DEADLINE_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Estimated_Hours_Col)
+ return ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE.getStoreName();
+ else if (aCol == AtsXColumn.Description_Col) return ATSAttributes.DESCRIPTION_ATTRIBUTE.getStoreName();
+ return null;
+ }
+
+ @Override
+ public boolean isColumnMultiEditable(TreeColumn treeColumn, Collection<TreeItem> treeItems) {
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn((XViewerColumn) treeColumn.getData());
+ if (aCol == null) return false;
+ XViewerColumn xCol = getCustomize().getCurrentCustData().getColumnData().getXColumn(aCol.getName());
+ if (xCol == null || !xCol.isShow() || !aCol.isMultiColumnEditable()) return false;
+ String attrName = getAttributeNameFromColumn(aCol);
+ if (attrName == null) return false;
+ for (TreeItem item : treeItems) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art instanceof ActionArtifact) return false;
+ if (!art.isAttributeTypeValid(attrName)) return false;
+ }
+ return true;
+ }
+
+ @Override
+ public boolean isColumnMultiEditEnabled() {
+ return true;
+ }
+
+ public void handleEmailSelectedAtsObject() {
+ try {
+ 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();
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ public StateMachineArtifact getSelectedSMA() {
+ Object obj = null;
+ if (getSelectedArtifactItems().size() == 0) return null;
+ obj = ((TreeItem) getTree().getSelection()[0]).getData();
+ return (obj != null && (obj instanceof WorldArtifactItem)) ? ((WorldArtifactItem) obj).getSMA() : 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, 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, openInAtsEditorAction);
+ openInAtsEditorAction.setEnabled(getSelectedArtifacts() != 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().getArtifact();
+ AtsLib.openAtsAction(art, AtsOpenOption.OpenOneOrPopupSelect);
+ }
+
+ public ArrayList<Artifact> getLoadedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ for (WorldArtifactItem wai : ((WorldContentProvider) getContentProvider()).rootSet) {
+ arts.add(wai.getArtifact());
+ }
+ return arts;
+ }
+
+ public void clear() {
+ ((WorldContentProvider) getContentProvider()).clear();
+ }
+
+ /**
+ * Release resources
+ */
+ public void dispose() {
+ super.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<Artifact> getSelectedArtifacts() {
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((Artifact) ((WorldArtifactItem) item.getData()).getArtifact());
+ 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) {
+ Artifact art = (((WorldArtifactItem) item.getData()).getArtifact());
+ if (art instanceof ActionArtifact) {
+ try {
+ if (((ActionArtifact) art).getTeamWorkFlowArtifacts().size() != 1) return false;
+ } catch (SQLException ex) {
+ // Do Nothing
+ }
+ } else if (!(art 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) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art instanceof TeamWorkFlowArtifact) teamArts.add((TeamWorkFlowArtifact) art);
+ if (art instanceof ActionArtifact) {
+ try {
+ if (((ActionArtifact) art).getTeamWorkFlowArtifacts().size() == 1) teamArts.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ } catch (SQLException 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 WorldArtifactItem) {
+ Artifact art = ((WorldArtifactItem) obj).getArtifact();
+ if (art instanceof StateMachineArtifact)
+ smaArts.add((StateMachineArtifact) art);
+ else if (art instanceof ActionArtifact) smaArts.addAll(((ActionArtifact) art).getTeamWorkFlowArtifacts());
+ }
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ return smaArts;
+ }
+
+ public Set<ActionArtifact> getSelectedActionArtifacts() {
+ Set<ActionArtifact> actionArts = new HashSet<ActionArtifact>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items) {
+ Artifact art = ((WorldArtifactItem) item.getData()).getArtifact();
+ if (art instanceof ActionArtifact) actionArts.add((ActionArtifact) art);
+ }
+ 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) {
+ Set<WorldArtifactItem> items = new HashSet<WorldArtifactItem>();
+ for (Artifact art : artifacts)
+ items.add(new WorldArtifactItem(this, art, null));
+ ((WorldContentProvider) getContentProvider()).set(items);
+ }
+
+ public void add(Collection<Artifact> artifacts) {
+ Set<WorldArtifactItem> items = new HashSet<WorldArtifactItem>();
+ for (Artifact art : artifacts)
+ items.add(new WorldArtifactItem(this, art, null));
+ ((WorldContentProvider) getContentProvider()).add(items);
+ }
+
+ public void add(final Artifact artifact) {
+ add(Arrays.asList(new Artifact[] {artifact}));
+ }
+
+ public void remove(final Artifact artifact) {
+ ((WorldContentProvider) getContentProvider()).remove(artifact);
+ }
+
+ public void remove(final Collection<Artifact> artifacts) {
+ ((WorldContentProvider) getContentProvider()).remove(artifacts);
+ }
+
+ public void removeItems(final Collection<? extends WorldArtifactItem> items) {
+ ((WorldContentProvider) getContentProvider()).removeItems(items);
+ }
+
+ public ArrayList<WorldArtifactItem> getSelectedArtifactItems() {
+ ArrayList<WorldArtifactItem> arts = new ArrayList<WorldArtifactItem>();
+ TreeItem items[] = getTree().getSelection();
+ if (items.length > 0) for (TreeItem item : items)
+ arts.add((WorldArtifactItem) item.getData());
+ return arts;
+ }
+
+ public Object[] getSelectedArtifactItemsArray() {
+ return getSelectedArtifactItems().toArray(new WorldArtifactItem[getSelectedArtifactItems().size()]);
+ }
+
+ private void handleDeleteAtsObject() {
+ try {
+ ArrayList<Artifact> delArts = new ArrayList<Artifact>();
+ StringBuilder artBuilder = new StringBuilder();
+ ArrayList<WorldArtifactItem> items = getSelectedArtifactItems();
+ 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 wd =
+ new HtmlDialog((purge ? "Purge" : "Delete") + " ATS Objects", "", AHTML.simplePage(results));
+ wd.open();
+ if (wd.getReturnCode() == 0) {
+ AbstractSkynetTxTemplate txWrapper =
+ new AbstractSkynetTxTemplate(BranchPersistenceManager.getInstance().getAtsBranch()) {
+
+ @Override
+ protected void handleTxWork() throws Exception {
+ for (Artifact loopArt : deleteArts) {
+ if (purge)
+ loopArt.purge();
+ else {
+ loopArt.delete();
+ }
+ }
+ }
+ };
+ txWrapper.execute();
+ removeItems(items);
+ }
+ }
+ } 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);
+ }
+
+ public boolean handleAltLeftClick(TreeColumn treeColumn, TreeItem treeItem, boolean persist) {
+ try {
+ super.handleAltLeftClick(treeColumn, treeItem);
+ // System.out.println("Column " + treeColumn.getText() + " item " +
+ // treeItem);
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(xCol);
+ WorldArtifactItem wai = ((WorldArtifactItem) treeItem.getData());
+ Artifact useArt = wai.getArtifact();
+ 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);
+ boolean modified = false;
+ if (aCol == AtsXColumn.Version_Target_Col)
+ modified = smaMgr.promptChangeVersion(true);
+ else if (aCol == AtsXColumn.Notes_Col)
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.SMA_NOTE_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Percent_Rework_Col)
+ modified = smaMgr.promptChangePercentAttribute(ATSAttributes.PERCENT_REWORK_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Estimated_Hours_Col) {
+ if (smaMgr.getSma().isMetricsFromTasks()) {
+ AWorkbench.popup(
+ "ERROR",
+ "Estimated Hours for this " + smaMgr.getSma().getArtifactTypeName() + " are" + " determined from Implement Tasks.\n\nSet Estimated Hours through Tasks.");
+ return false;
+ }
+ modified = smaMgr.promptChangeFloatAttribute(ATSAttributes.ESTIMATED_HOURS_ATTRIBUTE, persist);
+ } else if (aCol == AtsXColumn.Weekly_Benefit_Hrs_Col)
+ modified = smaMgr.promptChangeFloatAttribute(ATSAttributes.WEEKLY_BENEFIT_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Estimated_Release_Date_Col)
+ modified = smaMgr.promptChangeEstimatedReleaseDate();
+ else if (aCol == AtsXColumn.Deadline_Col)
+ modified = smaMgr.promptChangeDate(ATSAttributes.DEADLINE_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Remaining_Hours_Col) {
+ AWorkbench.popup("Calculated Field",
+ "Hours Remaining field is calculated.\nHour Estimate - (Hour Estimate * Percent Complete)");
+ return false;
+ } else if (aCol == AtsXColumn.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 (aCol == AtsXColumn.Release_Date_Col)
+ modified = smaMgr.promptChangeReleaseDate();
+ else if (aCol == AtsXColumn.Work_Package_Col)
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.WORK_PACKAGE_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Category_Col)
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Category2_Col)
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY2_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Category3_Col)
+ modified = smaMgr.promptChangeAttribute(ATSAttributes.CATEGORY3_ATTRIBUTE, persist);
+ else if (aCol == AtsXColumn.Change_Type_Col)
+ modified = smaMgr.promptChangeType(persist);
+ else if (aCol == AtsXColumn.Priority_Col)
+ modified = smaMgr.promptChangePriority(persist);
+ else if (aCol == AtsXColumn.Metrics_from_Tasks_Col) {
+ modified =
+ smaMgr.promptChangeBoolean(ATSAttributes.METRICS_FROM_TASKS_ATTRIBUTE,
+ AtsXColumn.Metrics_from_Tasks_Col.getDesc(), persist);
+ if (modified) handleMetricsFromTasksToggle(smaMgr.getSma());
+ }
+ if (modified) {
+ update(wai, null);
+ return true;
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ return false;
+ }
+
+ /**
+ * When metrics from tasks is chosen, confirm that implement's hours spent and percent complete change to 0. Prompt
+ * the user as such.
+ */
+ public static void handleMetricsFromTasksToggle(StateMachineArtifact sma) {
+ try {
+ if (sma.isMetricsFromTasks()) {
+ SMAManager smaMgr = new SMAManager(sma);
+ SMAState implementState = smaMgr.getSMAState(DefaultTeamState.Implement.name(), false);
+ if (implementState != null && (implementState.getPercentComplete() > 0 || implementState.getHoursSpent() > 0)) {
+ StringBuffer sb = new StringBuffer();
+ if (implementState.getPercentComplete() > 0) {
+ sb.append("Implement State Percent Complete was " + implementState.getPercentComplete() + "\n");
+ implementState.setPercentComplete(0);
+ }
+ if (implementState.getHoursSpent() > 0) {
+ sb.append("Implement State Hours Spent was " + implementState.getHoursSpentStr() + "\n");
+ implementState.setHoursSpent(0);
+ }
+ sb.append("\nSince metrics from tasks, values above have been cleared.");
+ AWorkbench.popup("INFO", sb.toString());
+
+ smaMgr.setState(implementState);
+ smaMgr.getSma().persist();
+ }
+ }
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ }
+
+ /**
+ * @return the extendedStatusString
+ */
+ public String getExtendedStatusString() {
+ return extendedStatusString;
+ }
+
+ /**
+ * @param extendedStatusString the extendedStatusString to set
+ */
+ public void setExtendedStatusString(String extendedStatusString) {
+ this.extendedStatusString = extendedStatusString;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.java
new file mode 100644
index 00000000000..93b4d94333e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerFactory.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.world;
+
+import java.util.ArrayList;
+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.customize.CustomizeData;
+import org.eclipse.osee.framework.ui.skynet.widgets.xviewer.skynet.SkynetXViewerFactory;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldXViewerFactory extends SkynetXViewerFactory {
+
+ private XViewer xViewer;
+
+ /**
+ *
+ */
+ public WorldXViewerFactory() {
+ }
+
+ public XViewerSorter createNewXSorter(XViewer xViewer) {
+ this.xViewer = xViewer;
+ return new WorldXViewerSorter(xViewer);
+ }
+
+ public CustomizeData getDefaultTableCustomizeData() {
+ CustomizeData custData = new CustomizeData();
+ int x = 0;
+ ArrayList<XViewerColumn> cols = new ArrayList<XViewerColumn>();
+ for (AtsXColumn atsXCol : AtsXColumn.values()) {
+ XViewerColumn newCol = atsXCol.getXViewerColumn(atsXCol);
+ newCol.setOrderNum(x++);
+ newCol.setTreeViewer(xViewer);
+ cols.add(newCol);
+ }
+ custData.getColumnData().setColumns(cols);
+ return custData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.framework.ui.skynet.widgets.xviewer.IXViewerFactory#getDefaultXViewerColumn()
+ */
+ public XViewerColumn getDefaultXViewerColumn(String name) {
+ for (AtsXColumn atsXCol : AtsXColumn.values()) {
+ if (atsXCol.getName().equals(name)) {
+ return atsXCol.getXViewerColumn(atsXCol);
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.java
new file mode 100644
index 00000000000..50f9f0b54ca
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewerSorter.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.world;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.ats.ActionDebug;
+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) {
+ if (xViewer == null || !xViewer.getCustomize().getCurrentCustData().getSortingData().isSorting()) return 0;
+ XViewerColumn sortXCol =
+ xViewer.getCustomize().getCurrentCustData().getSortingData().getSortXCols().get(sortXColIndex);
+ AtsXColumn aCol = AtsXColumn.getAtsXColumn(sortXCol);
+ IWorldViewArtifact m1 = (IWorldViewArtifact) ((WorldArtifactItem) o1).getArtifact();
+ IWorldViewArtifact m2 = (IWorldViewArtifact) ((WorldArtifactItem) o2).getArtifact();
+
+ if (aCol == AtsXColumn.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);
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.java
new file mode 100644
index 00000000000..08115ed00e4
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ActionableItemWorldSearchItem.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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.ActionableItemArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.dialog.ActionActionableItemListDialog;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ActionableItemWorldSearchItem extends WorldSearchItem {
+
+ private Set<ActionableItemArtifact> actionItems;
+ private Set<ActionableItemArtifact> selectedActionItems;
+ private boolean recurseChildren;
+ private boolean showFinished;
+ private boolean showAction;
+ private final String[] actionItemNames;
+
+ public ActionableItemWorldSearchItem(String displayName, String[] actionItemNames, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.actionItemNames = actionItemNames;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public ActionableItemWorldSearchItem(String displayName, Set<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 Collection<String> getProductSearchName() {
+ if (actionItemNames != null)
+ return Arrays.asList(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() {
+ return String.format("%s - %s", super.getSelectedName(), getProductSearchName());
+ }
+
+ public void getActionableItems() throws SQLException, IllegalArgumentException {
+ if (actionItemNames == null) return;
+ if (actionItems == null) {
+ actionItems = new HashSet<ActionableItemArtifact>();
+ for (String name : actionItemNames) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(ActionableItemArtifact.ARTIFACT_NAME, name,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ actionItems.add(srch.getSingletonArtifactOrException(ActionableItemArtifact.class));
+ }
+ }
+ if (actionItems == null) throw new IllegalArgumentException(
+ "Can't Find ProductDefinitionArtifact for " + getName());
+ }
+
+ /**
+ * @return All directly specified teamDefs plus if recurse, will get all children
+ * @throws SQLException
+ */
+ private Set<ActionableItemArtifact> getSearchActionableItems() throws SQLException {
+ getActionableItems();
+ Set<ActionableItemArtifact> srchTeamDefs = new HashSet<ActionableItemArtifact>();
+ for (ActionableItemArtifact actionableItem : (actionItems != null ? actionItems : selectedActionItems))
+ srchTeamDefs.add(actionableItem);
+ if (recurseChildren) {
+ for (ActionableItemArtifact actionableItem : (actionItems != null ? actionItems : selectedActionItems)) {
+ Artifacts.getChildrenOfType(actionableItem, srchTeamDefs, ActionableItemArtifact.class, true);
+ }
+ }
+ return srchTeamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ getActionableItems();
+
+ // Find all Team Workflows with one of the given AI's
+ List<ISearchPrimitive> teamWorkflowToAICriteria = new LinkedList<ISearchPrimitive>();
+ for (ActionableItemArtifact ai : getSearchActionableItems())
+ teamWorkflowToAICriteria.add(new AttributeValueSearch(
+ ATSAttributes.ACTIONABLE_ITEM_GUID_ATTRIBUTE.getStoreName(), ai.getGuid(), Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowToAISearch = new FromArtifactsSearch(teamWorkflowToAICriteria, false);
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ // Find all
+ List<ISearchPrimitive> allProductCriteria = new LinkedList<ISearchPrimitive>();
+ allProductCriteria.add(teamWorkflowToAISearch);
+ allProductCriteria.add(teamWorkflowSearch);
+ if (!showFinished) {
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ FromArtifactsSearch allTeamWorkflows = new FromArtifactsSearch(allProductCriteria, true);
+
+ if (!showAction) {
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(allProductCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(allTeamWorkflows, RelationSide.ActionToWorkflow_Action));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+
+ }
+
+ @Override
+ public void performUI() {
+ if (actionItemNames != null) return;
+ if (actionItems != null) return;
+ ActionActionableItemListDialog diag = new ActionActionableItemListDialog(Active.Both);
+ diag.setShowFinished(showFinished);
+ diag.setShowAction(showAction);
+ diag.setRecurseChildren(recurseChildren);
+ int result = diag.open();
+ if (result == 0) {
+ showFinished = diag.isShowFinished();
+ showAction = diag.isShowAction();
+ recurseChildren = 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.java
new file mode 100644
index 00000000000..643c82b533a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/AtsAttributeSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import org.eclipse.jface.dialogs.MessageDialog;
+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.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AtsAttributeSearchItem extends WorldSearchItem {
+
+ 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", "%", "");
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), searchStr);
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ if (searchStr == null) return EMPTY_SET;
+ LinkedList<ISearchPrimitive> criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new AttributeValueSearch(attributeName, searchStr, Operator.CONTAINS));
+ FromArtifactsSearch stringCriteria = new FromArtifactsSearch(criteria, true);
+
+ LinkedList<ISearchPrimitive> atsObjectCriteria = new LinkedList<ISearchPrimitive>();
+ atsObjectCriteria.add(new ArtifactTypeSearch(ActionArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ for (String teamArtifactName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ atsObjectCriteria.add(new ArtifactTypeSearch(teamArtifactName, Operator.EQUAL));
+ atsObjectCriteria.add(new ArtifactTypeSearch(TaskArtifact.ARTIFACT_NAME, Operator.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.getInstance().getArtifacts(bothCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (cancelled) return EMPTY_SET;
+ return artifacts;
+ }
+
+ @Override
+ public void performUI() {
+ 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/CriteriaSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/CriteriaSearchItem.java
new file mode 100644
index 00000000000..86aaa858fb9
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/CriteriaSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.List;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class CriteriaSearchItem extends WorldSearchItem {
+
+ private final List<ISearchPrimitive> criteria;
+ private final boolean all;
+
+ public CriteriaSearchItem(String name, List<ISearchPrimitive> criteria, boolean all) {
+ super(name);
+ this.criteria = criteria;
+ this.all = all;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ if (criteria == null) throw new IllegalArgumentException("Inavlid search \"" + getName() + "\"");
+ Collection<Artifact> artifacts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(criteria, all,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (cancelled) return EMPTY_SET;
+ return artifacts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.java
new file mode 100644
index 00000000000..204687389d3
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/GroupWorldSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.UniversalGroup;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.GroupListDialog;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class GroupWorldSearchItem extends WorldSearchItem {
+
+ private Artifact group;
+ private Artifact selectedGroup;
+ private final String groupName;
+
+ public GroupWorldSearchItem(String displayName, String groupName) {
+ super(displayName);
+ this.groupName = groupName;
+ }
+
+ public GroupWorldSearchItem() {
+ this("Groups Search", null);
+ }
+
+ public String getGroupSearchName() {
+ if (group != null)
+ return group.getDescriptiveName();
+ else {
+ if (selectedGroup != null) return selectedGroup.getDescriptiveName();
+ }
+ return "";
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), getGroupSearchName());
+ }
+
+ public void getProduct() {
+ if (groupName == null) return;
+ if (group == null) group = UniversalGroup.getGroups(groupName).iterator().next();
+ if (group == null) throw new IllegalArgumentException("Can't Find Universal Group for " + getName());
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ getProduct();
+ if (getSearchGroup() == null) return EMPTY_SET;
+ Collection<Artifact> arts = getSearchGroup().getArtifacts(RelationSide.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() {
+ if (groupName != null) return;
+ if (group != null) return;
+ GroupListDialog gld = new GroupListDialog(Display.getCurrent().getActiveShell());
+ int result = gld.open();
+ if (result == 0) {
+ selectedGroup = (Artifact) gld.getSelection();
+ return;
+ } else {
+ selectedGroup = null;
+ cancelled = true;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java
new file mode 100644
index 00000000000..af1f00a70df
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/LegacyPCRActionsWorldSearchItem.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+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;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class LegacyPCRActionsWorldSearchItem extends WorldSearchItem {
+
+ private boolean returnTeams = false;
+ private final Collection<String> pcrIds;
+ private final Collection<TeamDefinitionArtifact> teamDefs;
+
+ public LegacyPCRActionsWorldSearchItem(String name, String pcrId, Collection<TeamDefinitionArtifact> teamDefs) {
+ this(name, pcrId != null ? Arrays.asList(new String[] {pcrId}) : null, teamDefs);
+ }
+
+ public LegacyPCRActionsWorldSearchItem(String name, Collection<String> pcrIds, Collection<TeamDefinitionArtifact> teamDefs) {
+ super(name);
+ this.pcrIds = pcrIds;
+ this.teamDefs = teamDefs;
+ }
+
+ public LegacyPCRActionsWorldSearchItem(String name, Collection<TeamDefinitionArtifact> teamDefs) {
+ this(name, (String) null, teamDefs);
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ List<ISearchPrimitive> prodCriteria = new LinkedList<ISearchPrimitive>();
+ if (pcrIds != null && pcrIds.size() > 0) {
+ for (String pcrId : pcrIds) {
+ prodCriteria.add(new AttributeValueSearch(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), pcrId,
+ Operator.EQUAL));
+ }
+ } else if (pcrIds == null || pcrIds.size() == 0) {
+ prodCriteria.add(new AttributeValueSearch(ATSAttributes.LEGACY_PCR_ID_ATTRIBUTE.getStoreName(), "%",
+ Operator.LIKE));
+ }
+ FromArtifactsSearch prodSearch = new FromArtifactsSearch(prodCriteria, false);
+
+ List<ISearchPrimitive> teamDefCriteria = new LinkedList<ISearchPrimitive>();
+ boolean teamDefsSpecified = (teamDefs != null && teamDefs.size() > 0);
+ if (teamDefsSpecified) {
+ for (TeamDefinitionArtifact pcrId : teamDefs) {
+ teamDefCriteria.add(new AttributeValueSearch(ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(),
+ pcrId.getGuid(), Operator.EQUAL));
+ }
+ }
+ FromArtifactsSearch teamDefSearch = new FromArtifactsSearch(teamDefCriteria, false);
+
+ List<ISearchPrimitive> bothCriteria = new LinkedList<ISearchPrimitive>();
+ bothCriteria.add(prodSearch);
+ if (teamDefsSpecified) bothCriteria.add(teamDefSearch);
+ FromArtifactsSearch bothSearch = new FromArtifactsSearch(bothCriteria, true);
+
+ if (isReturnTeams()) {
+ if (cancelled) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(bothCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (cancelled) return EMPTY_SET;
+ return arts;
+ } else {
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(bothSearch, RelationSide.ActionToWorkflow_Action));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (cancelled) return EMPTY_SET;
+
+ return arts;
+ }
+ }
+
+ public boolean isReturnTeams() {
+ return returnTeams;
+ }
+
+ public void setReturnTeams(boolean returnTeams) {
+ this.returnTeams = returnTeams;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.java
new file mode 100644
index 00000000000..7ede360f4b1
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MultipleHridSearchItem.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.sql.SQLException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+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.AtsLib;
+import org.eclipse.osee.ats.util.LegacyPCRActions;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactGuidSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactHridSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+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 WorldSearchItem {
+ private String id = "";
+
+ public MultipleHridSearchItem() {
+ super("Search by ID(s)");
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+
+ List<ISearchPrimitive> idCriteria = new LinkedList<ISearchPrimitive>();
+ Set<String> nonHridGuids = new HashSet<String>();
+ for (String str : id.split(",")) {
+ str = str.replaceAll(" ", "");
+ if (str.length() == 5)
+ idCriteria.add(new ArtifactHridSearch(str));
+ else if (GUID.isValid(str))
+ idCriteria.add(new ArtifactGuidSearch(str));
+ else {
+ 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) {
+ // Attempt to open off legacy PCR field
+ OSEELog.logException(AtsPlugin.class,
+ "Invalid HRID/Guid/Legacy PCR Id(s): " + AtsLib.commaStrs(nonHridGuids), null, true);
+ } else {
+ for (ActionArtifact teamWf : actionArts) {
+ resultArts.add(teamWf);
+ }
+ return resultArts;
+ }
+ }
+
+ if (idCriteria.size() > 0) {
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(idCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ return EMPTY_SET;
+ }
+
+ @Override
+ public void performUI() {
+ 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) {
+ id = ed.getEntry();
+ id = id.replaceAll(" ", "");
+ return;
+ } else
+ id = null;
+ cancelled = true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyCompletedSearchItem.java
new file mode 100644
index 00000000000..319475e80ab
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+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.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.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+
+/**
+ * @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);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ List<ISearchPrimitive> smaOrigCriteria = new LinkedList<ISearchPrimitive>();
+ smaOrigCriteria.add(new AttributeValueSearch(ATSAttributes.LOG_ATTRIBUTE.getStoreName(),
+ "state=\"Completed\" type=\"StateEntered\" userId=\"" + getSearchUser().getUserId() + "\"",
+ Operator.CONTAINS));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(smaOrigCriteria, true, AtsPlugin.getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.java
new file mode 100644
index 00000000000..eb7e362e651
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyFavoritesSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.BranchPersistenceManager;
+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;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.UserIdSearch;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @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);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+ FromArtifactsSearch userSearch = new FromArtifactsSearch(new UserIdSearch(user.getUserId(), Operator.EQUAL));
+
+ List<ISearchPrimitive> subscribedCriteria = new LinkedList<ISearchPrimitive>();
+ subscribedCriteria.add(new InRelationSearch(userSearch, RelationSide.FavoriteUser_Artifact));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(subscribedCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ if (user != null) return;
+ super.performUI();
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.java
new file mode 100644
index 00000000000..5c56cc5e327
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyOrigSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyOrigSearchItem extends UserSearchItem {
+
+ private final boolean onlyInWork;
+
+ public MyOrigSearchItem(String name) {
+ this(name, null, false);
+ }
+
+ public MyOrigSearchItem() {
+ this("My Originator", null, false);
+ }
+
+ public MyOrigSearchItem(String name, User user, boolean onlyInWork) {
+ super(name, user);
+ this.onlyInWork = onlyInWork;
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ // SMA having user as portion of current state attribute (Team WorkFlow and Task)
+ List<ISearchPrimitive> smaOrigCriteria = new LinkedList<ISearchPrimitive>();
+ smaOrigCriteria.add(new AttributeValueSearch(ATSAttributes.LOG_ATTRIBUTE.getStoreName(),
+ "%type=\"Originated\" userId=\"" + user.getUserId() + "\"%", Operator.LIKE));
+ if (onlyInWork) {
+ smaOrigCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ smaOrigCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ smaOrigCriteria.add(teamWorkflowSearch);
+ FromArtifactsSearch smaOrigSearch = new FromArtifactsSearch(smaOrigCriteria, true);
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(
+ new InRelationSearch(smaOrigSearch, RelationSide.ActionToWorkflow_Action),
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.java
new file mode 100644
index 00000000000..d397ff50d73
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyReviewWorkflowItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.util.widgets.ReviewManager;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyReviewWorkflowItem extends UserSearchItem {
+
+ public MyReviewWorkflowItem(String name) {
+ this(name, null);
+ }
+
+ public MyReviewWorkflowItem() {
+ super("My Reviews", null);
+ }
+
+ public MyReviewWorkflowItem(String name, User user) {
+ super(name, user);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+
+ // 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() + ">", Operator.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, Operator.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.getInstance().getArtifacts(allCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.java
new file mode 100644
index 00000000000..d0cdb291f94
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MySubscribedSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+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.BranchPersistenceManager;
+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;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.artifact.search.UserIdSearch;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @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);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+ FromArtifactsSearch userSearch = new FromArtifactsSearch(new UserIdSearch(user.getUserId(), Operator.EQUAL));
+
+ List<ISearchPrimitive> subscribedCriteria = new LinkedList<ISearchPrimitive>();
+ subscribedCriteria.add(new InRelationSearch(userSearch, RelationSide.SubscribedUser_Artifact));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(subscribedCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTaskSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTaskSearchItem.java
new file mode 100644
index 00000000000..f960b147599
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTaskSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TaskArtifact;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyTaskSearchItem extends UserSearchItem {
+
+ public MyTaskSearchItem(String name) {
+ this(name, null);
+ }
+
+ public MyTaskSearchItem() {
+ super("My World", null);
+ }
+
+ public MyTaskSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+ // 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() + ">", Operator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ teamWorkflowCriteria.add(currentStateSearch);
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(TaskArtifact.ARTIFACT_NAME, Operator.EQUAL));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(teamWorkflowCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTeamWFSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTeamWFSearchItem.java
new file mode 100644
index 00000000000..30b6469291b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyTeamWFSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class MyTeamWFSearchItem extends UserSearchItem {
+
+ public MyTeamWFSearchItem(String name) {
+ this(name, null);
+ }
+
+ public MyTeamWFSearchItem() {
+ super("My World", null);
+ }
+
+ public MyTeamWFSearchItem(String name, User user) {
+ super(name, user);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+
+ // 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() + ">", Operator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ // Add all the Team Workflow's related to assigned Tasks
+ List<ISearchPrimitive> teamAndTaskCriteria = new LinkedList<ISearchPrimitive>();
+ teamAndTaskCriteria.add(currentStateSearch);
+ teamAndTaskCriteria.add(new InRelationSearch(currentStateSearch, RelationSide.SmaToTask_Sma));
+ FromArtifactsSearch teamAndTaskSearch = new FromArtifactsSearch(teamAndTaskCriteria, false);
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> allCriteria = new LinkedList<ISearchPrimitive>();
+ allCriteria.add(teamAndTaskSearch);
+ allCriteria.add(teamWorkflowSearch);
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(allCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/MyWorldSearchItem.java
new file mode 100644
index 00000000000..4a1c6ba03d4
--- /dev/null
+++ b/MS_0.1.4_20080103/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.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+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;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @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);
+ }
+
+ @Override
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+
+ // 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() + ">", Operator.CONTAINS));
+ FromArtifactsSearch currentStateSearch = new FromArtifactsSearch(currentStateCriteria, false);
+
+ // Add all the Team Workflow's related to assigned Tasks
+ List<ISearchPrimitive> teamAndTaskCriteria = new LinkedList<ISearchPrimitive>();
+ teamAndTaskCriteria.add(currentStateSearch);
+ teamAndTaskCriteria.add(new InRelationSearch(currentStateSearch, RelationSide.SmaToTask_Sma));
+ teamAndTaskCriteria.add(new InRelationSearch(currentStateSearch, RelationSide.TeamWorkflowToReview_Team));
+ FromArtifactsSearch teamAndTaskSearch = new FromArtifactsSearch(teamAndTaskCriteria, false);
+
+ // Return teamworkflow items
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(teamAndTaskSearch, RelationSide.ActionToWorkflow_Action));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.java
new file mode 100644
index 00000000000..c6da0cd380b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/NextVersionSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.Set;
+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.widgets.dialog.TeamDefinitionDialog;
+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.RelationSide;
+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 WorldSearchItem {
+
+ private final TeamDefinitionArtifact teamDefHoldingVersions;
+ private TeamDefinitionArtifact selectedTeamDef;
+
+ /**
+ * @param name
+ */
+ public NextVersionSearchItem(TeamDefinitionArtifact teamDefHoldingVersions) {
+ this(null, teamDefHoldingVersions);
+ }
+
+ public NextVersionSearchItem(String name, TeamDefinitionArtifact teamDefHoldingVersions) {
+ super(name != null ? name : "Workflows Targeted-For Next Version");
+ this.teamDefHoldingVersions = teamDefHoldingVersions;
+ }
+
+ @Override
+ public String getSelectedName() {
+ try {
+ VersionArtifact verArt = getTeamDefinition().getNextReleaseVersion();
+ return super.getName() + (verArt != null ? " - " + verArt.getDescriptiveName() : "");
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ return "Exception Occurred - See Log";
+ }
+ }
+
+ private TeamDefinitionArtifact getTeamDefinition() {
+ if (teamDefHoldingVersions != null) return teamDefHoldingVersions;
+ return selectedTeamDef;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.osee.ats.world.search.WorldSearchItem#performSearch()
+ */
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ if (isCancelled()) return EMPTY_SET;
+ if (getTeamDefinition().getNextReleaseVersion() == null) {
+ AWorkbench.popup("ERROR", "No version marked as Next Release for \"" + getTeamDefinition() + "\"");
+ return EMPTY_SET;
+ }
+ Set<Artifact> arts =
+ getTeamDefinition().getNextReleaseVersion().getArtifacts(
+ RelationSide.TeamWorkflowTargetedForVersion_Workflow);
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ if (teamDefHoldingVersions != 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.java
new file mode 100644
index 00000000000..c0e42c789f8
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/ShowOpenWorkflowsByArtifactType.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class ShowOpenWorkflowsByArtifactType extends WorldSearchItem {
+
+ private final Collection<String> artifactTypes;
+ private final boolean showFinished;
+ private final boolean showWorkflow;
+
+ public ShowOpenWorkflowsByArtifactType(String displayName, Collection<String> artifactTypes, boolean showFinished, boolean showWorkflow) {
+ super(displayName);
+ this.artifactTypes = artifactTypes;
+ this.showFinished = showFinished;
+ this.showWorkflow = showWorkflow;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+
+ List<ISearchPrimitive> artTypeNameCriteria = new LinkedList<ISearchPrimitive>();
+ for (String artType : artifactTypes)
+ artTypeNameCriteria.add(new ArtifactTypeSearch(artType, Operator.EQUAL));
+ FromArtifactsSearch artTypeNameSearch = new FromArtifactsSearch(artTypeNameCriteria, false);
+
+ List<ISearchPrimitive> allReviewCriteria = new LinkedList<ISearchPrimitive>();
+ allReviewCriteria.add(artTypeNameSearch);
+ if (!showFinished) {
+ allReviewCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ allReviewCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ FromArtifactsSearch allReviews = new FromArtifactsSearch(allReviewCriteria, true);
+
+ if (!showWorkflow) {
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(allReviewCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ List<ISearchPrimitive> teamCriteria = new LinkedList<ISearchPrimitive>();
+ teamCriteria.add(new InRelationSearch(allReviews, RelationSide.TeamWorkflowToReview_Team));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(teamCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ return;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.java
new file mode 100644
index 00000000000..29f474e5d3b
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/StateWorldSearchItem.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.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.AttributeValueSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class StateWorldSearchItem extends WorldSearchItem {
+
+ private final String stateClass;
+ private String selectedStateClass;
+
+ public StateWorldSearchItem(String name) {
+ this(name, null);
+ }
+
+ public StateWorldSearchItem() {
+ this("Search by Current State", null);
+
+ }
+
+ public String getStateSearchName() {
+ if (stateClass != null)
+ return stateClass;
+ else
+ return selectedStateClass;
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), 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() throws SQLException, IllegalArgumentException {
+ List<ISearchPrimitive> baseCriteria;
+ baseCriteria = new LinkedList<ISearchPrimitive>();
+ baseCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ getSearchStateClass(), Operator.CONTAINS));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(baseCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+
+ }
+
+ @Override
+ public void performUI() {
+ if (stateClass != null) return;
+ EntryDialog ed = new EntryDialog("Enter State", "Enter state name.");
+ if (ed.open() == 0) {
+ selectedStateClass = ed.getEntry();
+ return;
+ }
+ cancelled = true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamVersionWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamVersionWorldSearchItem.java
new file mode 100644
index 00000000000..f0dde96f118
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamVersionWorldSearchItem.java
@@ -0,0 +1,239 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionTreeByVersionDialog;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactIdSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamVersionWorldSearchItem extends WorldSearchItem {
+
+ private Collection<TeamDefinitionArtifact> teamDefs;
+ private Set<TeamDefinitionArtifact> selectedTeamDefs;
+ private boolean recurseChildren;
+ private boolean showFinished;
+ private boolean showAction;
+ private final String[] teamDefNames;
+ private VersionArtifact selectedVersion = null;
+ private final ChangeType changeType;
+
+ public TeamVersionWorldSearchItem(String displayName, String[] teamDefNames, boolean showFinished, boolean showAction, boolean recurseChildren, ChangeType changeType) {
+ super(displayName);
+ this.teamDefNames = teamDefNames;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.changeType = changeType;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public TeamVersionWorldSearchItem(String displayName, Collection<TeamDefinitionArtifact> teamDefs, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.teamDefNames = null;
+ this.teamDefs = teamDefs;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.changeType = null;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public Collection<String> getProductSearchName() {
+ if (teamDefNames != null)
+ return Arrays.asList(teamDefNames);
+ else if (teamDefs != null)
+ return Artifacts.artNames(teamDefs);
+ else if (selectedTeamDefs != null) return Artifacts.artNames(selectedTeamDefs);
+ return new ArrayList<String>();
+ }
+
+ @Override
+ public String getSelectedName() {
+ if (selectedVersion != null)
+ return String.format("%s - %s - %s", super.getSelectedName(), getProductSearchName(),
+ selectedVersion.getDescriptiveName());
+ else
+ return String.format("%s - %s", super.getSelectedName(), getProductSearchName());
+ }
+
+ public void getTeamDefs() throws SQLException, IllegalArgumentException {
+ if (teamDefNames == null) return;
+ if (teamDefs == null) {
+ teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (String name : teamDefNames) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, name,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ teamDefs.add(srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class));
+ }
+ }
+ if (teamDefs == null) throw new IllegalArgumentException("Can't Find ProductDefinitionArtifact for " + getName());
+ }
+
+ /**
+ * @return All directly specified teamDefs plus if recurse, will get all children
+ * @throws SQLException
+ */
+ public Set<TeamDefinitionArtifact> getSearchTeamDefs() throws SQLException {
+ getTeamDefs();
+ Set<TeamDefinitionArtifact> srchTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs))
+ srchTeamDefs.add(teamDef);
+ if (recurseChildren) {
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs)) {
+ Artifacts.getChildrenOfType(teamDef, srchTeamDefs, TeamDefinitionArtifact.class, true);
+ }
+ }
+ return srchTeamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ getTeamDefs();
+
+ List<ISearchPrimitive> teamDefWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (TeamDefinitionArtifact tda : getSearchTeamDefs())
+ teamDefWorkflowCriteria.add(new AttributeValueSearch(
+ ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), tda.getGuid(), Operator.EQUAL));
+ FromArtifactsSearch teamDefWorkflowSearch = new FromArtifactsSearch(teamDefWorkflowCriteria, false);
+
+ FromArtifactsSearch versionWorkflowSearch = null;
+ if (selectedVersion != null) {
+ List<ISearchPrimitive> versionCriteria = new LinkedList<ISearchPrimitive>();
+ versionCriteria.add(new ArtifactIdSearch(selectedVersion.getArtId(), Operator.EQUAL));
+ versionWorkflowSearch = new FromArtifactsSearch(versionCriteria, true);
+ }
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> allProductCriteria = new LinkedList<ISearchPrimitive>();
+ allProductCriteria.add(teamDefWorkflowSearch);
+ allProductCriteria.add(teamWorkflowSearch);
+ if (selectedVersion != null) allProductCriteria.add(new InRelationSearch(versionWorkflowSearch,
+ RelationSide.TeamWorkflowTargetedForVersion_Workflow));
+ if (!showFinished) {
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ if (changeType != null) {
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(),
+ changeType.name(), Operator.EQUAL));
+ }
+ FromArtifactsSearch allTeamWorkflows = new FromArtifactsSearch(allProductCriteria, true);
+
+ if (!showAction) {
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(allProductCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(allTeamWorkflows, RelationSide.ActionToWorkflow_Action));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ if (teamDefNames != null) return;
+ if (teamDefs != null) return;
+ TeamDefinitionTreeByVersionDialog diag = new TeamDefinitionTreeByVersionDialog(Active.Both);
+ diag.setShowFinished(showFinished);
+ diag.setShowAction(showAction);
+ diag.setRecurseChildren(recurseChildren);
+ int result = diag.open();
+ if (result == 0) {
+ showFinished = diag.isShowFinished();
+ showAction = diag.isShowAction();
+ selectedVersion = diag.getSelectedVersion();
+ recurseChildren = diag.isRecurseChildren();
+ if (selectedTeamDefs == null)
+ selectedTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ else
+ selectedTeamDefs.clear();
+ for (Object obj : diag.getResult())
+ selectedTeamDefs.add((TeamDefinitionArtifact) 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
new file mode 100644
index 00000000000..30f97eb1e5a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/TeamWorldSearchItem.java
@@ -0,0 +1,220 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionTreeDialog;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.ChangeType;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class TeamWorldSearchItem extends WorldSearchItem {
+
+ private Collection<TeamDefinitionArtifact> teamDefs;
+ private Set<TeamDefinitionArtifact> selectedTeamDefs;
+ private boolean recurseChildren;
+ private boolean showFinished;
+ private boolean showAction;
+ private final String[] teamDefNames;
+ private final ChangeType changeType;
+
+ public TeamWorldSearchItem(String displayName, String[] teamDefNames, boolean showFinished, boolean showAction, boolean recurseChildren, ChangeType changeType) {
+ super(displayName);
+ this.teamDefNames = teamDefNames;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ this.changeType = changeType;
+ }
+
+ public TeamWorldSearchItem(String displayName, Collection<TeamDefinitionArtifact> teamDefs, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.recurseChildren = recurseChildren;
+ this.teamDefNames = null;
+ this.teamDefs = teamDefs;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.changeType = null;
+ }
+
+ public TeamWorldSearchItem(String displayName, TeamDefinitionArtifact teamDef, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ this(displayName, Arrays.asList(new TeamDefinitionArtifact[] {teamDef}), showFinished, showAction,
+ recurseChildren);
+ }
+
+ public Collection<String> getProductSearchName() {
+ if (teamDefNames != null)
+ return Arrays.asList(teamDefNames);
+ else if (teamDefs != null)
+ return Artifacts.artNames(teamDefs);
+ else if (selectedTeamDefs != null) return Artifacts.artNames(selectedTeamDefs);
+ return new ArrayList<String>();
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), getProductSearchName());
+ }
+
+ /**
+ * Loads all team definitions if specified by name versus by team definition class
+ *
+ * @throws SQLException
+ * @throws IllegalArgumentException
+ */
+ public void getTeamDefs() throws SQLException, IllegalArgumentException {
+ if (teamDefNames == null) return;
+ if (teamDefs == null) {
+ teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (String name : teamDefNames) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, name,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ teamDefs.add(srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class));
+ }
+ }
+ if (teamDefs == null) throw new IllegalArgumentException("Can't Find ProductDefinitionArtifact for " + getName());
+ }
+
+ /**
+ * @return All directly specified teamDefs plus if recurse, will get all children
+ * @throws SQLException
+ */
+ public Set<TeamDefinitionArtifact> getSearchTeamDefs() throws SQLException {
+ getTeamDefs();
+ Set<TeamDefinitionArtifact> srchTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs))
+ srchTeamDefs.add(teamDef);
+ if (recurseChildren) {
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs)) {
+ Artifacts.getChildrenOfType(teamDef, srchTeamDefs, TeamDefinitionArtifact.class, true);
+ }
+ }
+ return srchTeamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ getTeamDefs();
+ List<ISearchPrimitive> teamDefWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (TeamDefinitionArtifact tda : getSearchTeamDefs())
+ teamDefWorkflowCriteria.add(new AttributeValueSearch(
+ ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), tda.getGuid(), Operator.EQUAL));
+ FromArtifactsSearch teamDefWorkflowSearch = new FromArtifactsSearch(teamDefWorkflowCriteria, false);
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> allProductCriteria = new LinkedList<ISearchPrimitive>();
+ allProductCriteria.add(teamDefWorkflowSearch);
+ allProductCriteria.add(teamWorkflowSearch);
+ if (!showFinished) {
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ if (changeType != null) {
+ allProductCriteria.add(new AttributeValueSearch(ATSAttributes.CHANGE_TYPE_ATTRIBUTE.getStoreName(),
+ changeType.name(), Operator.EQUAL));
+ }
+ FromArtifactsSearch allTeamWorkflows = new FromArtifactsSearch(allProductCriteria, true);
+
+ if (!showAction) {
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(allProductCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(allTeamWorkflows, RelationSide.ActionToWorkflow_Action));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+
+ }
+
+ @Override
+ public void performUI() {
+ if (teamDefNames != null) return;
+ if (teamDefs != null) return;
+ TeamDefinitionTreeDialog diag = new TeamDefinitionTreeDialog(Active.Both);
+ diag.setShowFinished(showFinished);
+ diag.setShowAction(showAction);
+ diag.setRecurseChildren(recurseChildren);
+ int result = diag.open();
+ if (result == 0) {
+ showFinished = diag.isShowFinished();
+ showAction = diag.isShowAction();
+ recurseChildren = diag.isRecurseChildren();
+ if (selectedTeamDefs == null)
+ selectedTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ else
+ selectedTeamDefs.clear();
+ for (Object obj : diag.getResult())
+ selectedTeamDefs.add((TeamDefinitionArtifact) 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UnReleasedTeamWorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UnReleasedTeamWorldSearchItem.java
new file mode 100644
index 00000000000..69ee7d391fc
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UnReleasedTeamWorldSearchItem.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedList;
+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.TeamDefinitionArtifact;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.artifact.VersionArtifact;
+import org.eclipse.osee.ats.util.DefaultTeamState;
+import org.eclipse.osee.ats.util.widgets.dialog.TeamDefinitionTreeDialog;
+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.BranchPersistenceManager;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Active;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactTypeNameSearch;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.NotSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+import org.eclipse.osee.framework.skynet.core.util.Artifacts;
+import org.eclipse.osee.framework.ui.skynet.util.OSEELog;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UnReleasedTeamWorldSearchItem extends WorldSearchItem {
+
+ private Set<TeamDefinitionArtifact> teamDefs;
+ private Set<TeamDefinitionArtifact> selectedTeamDefs;
+ private boolean recurseChildren;
+ private boolean showFinished;
+ private boolean showAction;
+ private final String[] teamDefNames;
+
+ public UnReleasedTeamWorldSearchItem(String displayName, String[] teamDefNames, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.teamDefNames = teamDefNames;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public UnReleasedTeamWorldSearchItem(String displayName, Set<TeamDefinitionArtifact> teamDefs, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.teamDefNames = null;
+ this.teamDefs = teamDefs;
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public UnReleasedTeamWorldSearchItem(String displayName, TeamDefinitionArtifact teamDef, boolean showFinished, boolean showAction, boolean recurseChildren) {
+ super(displayName);
+ this.teamDefNames = null;
+ this.teamDefs = new HashSet<TeamDefinitionArtifact>();
+ this.teamDefs.add(teamDef);
+ this.showFinished = showFinished;
+ this.showAction = showAction;
+ this.recurseChildren = recurseChildren;
+ }
+
+ public Collection<String> getProductSearchName() {
+ if (teamDefNames != null)
+ return Arrays.asList(teamDefNames);
+ else if (teamDefs != null)
+ return Artifacts.artNames(teamDefs);
+ else if (selectedTeamDefs != null) return Artifacts.artNames(selectedTeamDefs);
+ return new ArrayList<String>();
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), getProductSearchName());
+ }
+
+ public void getTeamDefs() throws SQLException, IllegalArgumentException {
+ if (teamDefNames == null) return;
+ if (teamDefs == null) {
+ teamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (String name : teamDefNames) {
+ ArtifactTypeNameSearch srch =
+ new ArtifactTypeNameSearch(TeamDefinitionArtifact.ARTIFACT_NAME, name,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ teamDefs.add(srch.getSingletonArtifactOrException(TeamDefinitionArtifact.class));
+ }
+ }
+ if (teamDefs == null) throw new IllegalArgumentException("Can't Find ProductDefinitionArtifact for " + getName());
+ }
+
+ /**
+ * @return All directly specified teamDefs plus if recurse, will get all children
+ * @throws SQLException
+ */
+ public Set<TeamDefinitionArtifact> getSearchTeamDefs() throws SQLException {
+ getTeamDefs();
+ Set<TeamDefinitionArtifact> srchTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs))
+ srchTeamDefs.add(teamDef);
+ if (recurseChildren) {
+ for (TeamDefinitionArtifact teamDef : (teamDefs != null ? teamDefs : selectedTeamDefs)) {
+ Artifacts.getChildrenOfType(teamDef, srchTeamDefs, TeamDefinitionArtifact.class, true);
+ }
+ }
+ return srchTeamDefs;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ getTeamDefs();
+ List<ISearchPrimitive> teamDefWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (TeamDefinitionArtifact tda : getSearchTeamDefs())
+ teamDefWorkflowCriteria.add(new AttributeValueSearch(
+ ATSAttributes.TEAM_DEFINITION_GUID_ATTRIBUTE.getStoreName(), tda.getGuid(), Operator.EQUAL));
+ FromArtifactsSearch teamDefWorkflowSearch = new FromArtifactsSearch(teamDefWorkflowCriteria, false);
+
+ // Find all Team Workflows artifact types
+ List<ISearchPrimitive> teamWorkflowCriteria = new LinkedList<ISearchPrimitive>();
+ for (String teamArtName : TeamWorkflowExtensions.getInstance().getAllTeamWorkflowArtifactNames())
+ teamWorkflowCriteria.add(new ArtifactTypeSearch(teamArtName, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> allTeamCriteria = new LinkedList<ISearchPrimitive>();
+ allTeamCriteria.add(teamDefWorkflowSearch);
+ allTeamCriteria.add(teamWorkflowSearch);
+ if (!showFinished) {
+ allTeamCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Cancelled.name() + ";;;", Operator.NOT_EQUAL));
+ allTeamCriteria.add(new AttributeValueSearch(ATSAttributes.CURRENT_STATE_ATTRIBUTE.getStoreName(),
+ DefaultTeamState.Completed.name() + ";;;", Operator.NOT_EQUAL));
+ }
+ FromArtifactsSearch allTeamWorkflows = new FromArtifactsSearch(allTeamCriteria, true);
+
+ // Get un-targeted workflows
+ List<ISearchPrimitive> untargetedTeamsCriteria = new LinkedList<ISearchPrimitive>();
+ untargetedTeamsCriteria.add(teamWorkflowSearch);
+ untargetedTeamsCriteria.add(new NotSearch(new InRelationSearch(allTeamWorkflows,
+ RelationSide.TeamWorkflowTargetedForVersion_Workflow)));
+ FromArtifactsSearch untargetedTeamsCriteriaArts = new FromArtifactsSearch(untargetedTeamsCriteria, true);
+
+ // Get un-released version artifacts
+ List<ISearchPrimitive> unReleasedVersionCriteria = new LinkedList<ISearchPrimitive>();
+ unReleasedVersionCriteria.add(new ArtifactTypeSearch(VersionArtifact.ARTIFACT_NAME, Operator.EQUAL));
+ unReleasedVersionCriteria.add(new AttributeValueSearch(ATSAttributes.RELEASED_ATTRIBUTE.getStoreName(), "no",
+ Operator.EQUAL));
+ FromArtifactsSearch unReleasedVersionCriteriaArts = new FromArtifactsSearch(unReleasedVersionCriteria, true);
+
+ List<ISearchPrimitive> unReleasedTeamsCriteria = new LinkedList<ISearchPrimitive>();
+ unReleasedTeamsCriteria.add(new InRelationSearch(unReleasedVersionCriteriaArts,
+ RelationSide.TeamWorkflowTargetedForVersion_Workflow));
+ unReleasedTeamsCriteria.add(allTeamWorkflows);
+ FromArtifactsSearch unReleasedTeamsCriteriaArts = new FromArtifactsSearch(unReleasedTeamsCriteria, true);
+
+ // Get all un-released and un-targeted workflows
+ List<ISearchPrimitive> unReleasedAndUntargetedTeamsCriteria = new LinkedList<ISearchPrimitive>();
+ unReleasedAndUntargetedTeamsCriteria.add(untargetedTeamsCriteriaArts);
+ unReleasedAndUntargetedTeamsCriteria.add(unReleasedTeamsCriteriaArts);
+ FromArtifactsSearch unReleasedAndUntargetedTeamsCriteriaArts =
+ new FromArtifactsSearch(unReleasedAndUntargetedTeamsCriteria, false);
+
+ if (!showAction) {
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(unReleasedAndUntargetedTeamsCriteria, false,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(unReleasedAndUntargetedTeamsCriteriaArts,
+ RelationSide.ActionToWorkflow_Action));
+
+ if (isCancelled()) return EMPTY_SET;
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+
+ }
+
+ @Override
+ public void performUI() {
+ if (teamDefNames != null) return;
+ if (teamDefs != null) return;
+ TeamDefinitionTreeDialog diag = new TeamDefinitionTreeDialog(Active.Both);
+ try {
+ diag.setInput(TeamDefinitionArtifact.getTeamReleaseableDefinitions(Active.Both));
+ } catch (SQLException ex) {
+ OSEELog.logException(AtsPlugin.class, ex, false);
+ }
+ diag.setShowFinished(showFinished);
+ diag.setShowFinished(true);
+ int result = diag.open();
+ if (result == 0) {
+ showFinished = diag.isShowFinished();
+ showAction = diag.isShowAction();
+ recurseChildren = diag.isRecurseChildren();
+ if (selectedTeamDefs == null)
+ selectedTeamDefs = new HashSet<TeamDefinitionArtifact>();
+ else
+ selectedTeamDefs.clear();
+ for (Object obj : diag.getResult())
+ selectedTeamDefs.add((TeamDefinitionArtifact) 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;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.java
new file mode 100644
index 00000000000..77c3db41b7e
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserCommunitySearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.osee.ats.artifact.ATSAttributes;
+import org.eclipse.osee.ats.artifact.TeamWorkflowExtensions;
+import org.eclipse.osee.ats.util.widgets.dialog.UserCommunityListDialog;
+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.BranchPersistenceManager;
+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.FromArtifactsSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ISearchPrimitive;
+import org.eclipse.osee.framework.skynet.core.artifact.search.InRelationSearch;
+import org.eclipse.osee.framework.skynet.core.artifact.search.Operator;
+import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class UserCommunitySearchItem extends WorldSearchItem {
+
+ 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 String getGroupSearchName() {
+ if (userComm != null)
+ return userComm;
+ else if (selectedUserComm != null) return selectedUserComm;
+ return "";
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), getGroupSearchName());
+ }
+
+ private String getSearchUserComm() {
+ if (userComm != null) return userComm;
+ return selectedUserComm;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ 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, Operator.EQUAL));
+ FromArtifactsSearch teamWorkflowSearch = new FromArtifactsSearch(teamWorkflowCriteria, false);
+
+ List<ISearchPrimitive> criteria = new LinkedList<ISearchPrimitive>();
+ criteria.add(new AttributeValueSearch(ATSAttributes.USER_COMMUNITY_ATTRIBUTE.getStoreName(), getSearchUserComm(),
+ Operator.EQUAL));
+ criteria.add(teamWorkflowSearch);
+ FromArtifactsSearch criteriaSearch = new FromArtifactsSearch(criteria, true);
+
+ List<ISearchPrimitive> actionCriteria = new LinkedList<ISearchPrimitive>();
+ actionCriteria.add(new InRelationSearch(criteriaSearch, RelationSide.ActionToWorkflow_Action));
+
+ Collection<Artifact> arts =
+ ArtifactPersistenceManager.getInstance().getArtifacts(actionCriteria, true,
+ BranchPersistenceManager.getInstance().getAtsBranch());
+
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ if (userCommName != null) return;
+ if (userComm != null) return;
+ UserCommunityListDialog gld = new UserCommunityListDialog();
+ int result = gld.open();
+ if (result == 0) {
+ selectedUserComm = (String) gld.getResult()[0];
+ return;
+ } else {
+ selectedUserComm = null;
+ cancelled = true;
+ }
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.java
new file mode 100644
index 00000000000..c4a3d75cf70
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/UserSearchItem.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.world.search;
+
+import java.sql.SQLException;
+import java.util.Collection;
+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 WorldSearchItem {
+
+ 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;
+ }
+
+ @Override
+ public String getSelectedName() {
+ return String.format("%s - %s", super.getSelectedName(), 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;
+ else if (selectedUser != null) return selectedUser;
+ return null;
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+ if (isCancelled()) return EMPTY_SET;
+ if (user != null)
+ return searchIt(user);
+ else
+ return searchIt();
+ }
+
+ protected Collection<Artifact> searchIt(User user) throws SQLException, IllegalArgumentException {
+ return EMPTY_SET;
+ }
+
+ private Collection<Artifact> searchIt() throws SQLException, IllegalArgumentException {
+ if (isCancelled()) return EMPTY_SET;
+ if (selectedUser != null) return searchIt(selectedUser);
+ return EMPTY_SET;
+ }
+
+ @Override
+ public void performUI() {
+ if (user != null) return;
+ UserListDialog ld = new UserListDialog(Display.getCurrent().getActiveShell());
+ int result = ld.open();
+ if (result == 0) {
+ selectedUser = (User) ld.getSelection();
+ return;
+ } else
+ selectedUser = null;
+ cancelled = true;
+ }
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.java
new file mode 100644
index 00000000000..a3c85cf8bf6
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/VersionTargetedForTeamSearchItem.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.world.search;
+
+import java.sql.SQLException;
+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.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 WorldSearchItem {
+ private final VersionArtifact versionArt;
+ private VersionArtifact selectedVersionArt;
+ private final boolean returnAction;
+ private final TeamDefinitionArtifact teamDef;
+
+ public VersionTargetedForTeamSearchItem(TeamDefinitionArtifact teamDef, VersionArtifact versionArt, boolean returnAction) {
+ this(null, teamDef, versionArt, returnAction);
+ }
+
+ public VersionTargetedForTeamSearchItem(String name, TeamDefinitionArtifact teamDef, VersionArtifact versionArt, boolean returnAction) {
+ super(name != null ? name : (returnAction ? "Actions" : "Workflows") + " Targeted-For Version");
+ this.teamDef = teamDef;
+ this.versionArt = versionArt;
+ this.returnAction = returnAction;
+ }
+
+ @Override
+ public String getSelectedName() {
+ return super.getName() + " - " + (selectedVersionArt != null ? selectedVersionArt : versionArt);
+ }
+
+ @Override
+ public Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException {
+
+ if (versionArt == null && selectedVersionArt == null) throw new IllegalArgumentException(
+ "Invalid release version");
+
+ ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ for (Artifact art : (selectedVersionArt != null ? selectedVersionArt : versionArt).getTargetedForTeamArtifacts())
+ if (returnAction)
+ arts.add(((TeamWorkFlowArtifact) art).getParentActionArtifact());
+ else
+ arts.add(art);
+ if (isCancelled()) return EMPTY_SET;
+ return arts;
+ }
+
+ @Override
+ public void performUI() {
+ if (versionArt != null) return;
+ try {
+ TeamDefinitionArtifact 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(AtsPlugin.isAtsAdmin() ? VersionReleaseType.Both : VersionReleaseType.UnReleased));
+ if (vld.open() == 0) {
+ selectedVersionArt = (VersionArtifact) vld.getResult()[0];
+ return;
+ }
+ }
+ } catch (Exception ex) {
+ OSEELog.logException(AtsPlugin.class, ex, true);
+ }
+ cancelled = true;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java
new file mode 100644
index 00000000000..15e42da0f85
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/search/WorldSearchItem.java
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this 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.sql.SQLException;
+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.StateMachineArtifact;
+import org.eclipse.osee.ats.world.WorldView;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactPersistenceManager;
+import org.eclipse.osee.framework.ui.plugin.util.Displays;
+import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
+
+/**
+ * @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;
+ protected boolean loadWorldView = true;
+ protected ArtifactPersistenceManager apm = ArtifactPersistenceManager.getInstance();
+
+ public WorldSearchItem(String name) {
+ super();
+ this.name = name;
+ this.cancelled = false;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Method called to display the current search in the view. Override to provide more information about selected
+ * values (eg MyWorld)
+ *
+ * @return selected name
+ */
+ public String getSelectedName() {
+ return getName();
+ }
+
+ public abstract Collection<Artifact> performSearch() throws SQLException, IllegalArgumentException;
+
+ /**
+ * Perform search and return result set without loading in WorldView. This method can be used repeatedly.
+ *
+ * @return artifacts resulting from search
+ * @throws SQLException
+ * @throws IllegalArgumentException
+ */
+ public Collection<Artifact> performSearchGetResults() throws SQLException, IllegalArgumentException {
+ return performSearchGetResults(false, false);
+ }
+
+ public Collection<Artifact> performSearchGetResults(boolean performUi, boolean loadWorldView) throws SQLException, IllegalArgumentException {
+ this.loadWorldView = loadWorldView;
+ if (performUi) {
+ Displays.ensureInDisplayThread(new Runnable() {
+ /* (non-Javadoc)
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ performUI();
+ }
+ }, true);
+
+ }
+ if (cancelled) return EMPTY_SET;
+ Collection<Artifact> arts = performSearch();
+ if (loadWorldView) loadResultArtifacts(arts);
+ return arts;
+ }
+
+ public void performUI() {
+ cancelled = false;
+ }
+
+ private void loadResultArtifacts(Collection<Artifact> artifacts) {
+ final Set<Artifact> addedArts = new HashSet<Artifact>();
+ for (Artifact artifact : artifacts) {
+ if (isCancelled())
+ return;
+ else if ((!(artifact instanceof ActionArtifact)) && (!(artifact instanceof StateMachineArtifact))) {
+ ArtifactEditor.editArtifact(artifact);
+ continue;
+ } else
+ addedArts.add(artifact);
+ }
+ if (loadWorldView && addedArts.size() > 0) {
+ WorldView.loadIt(getSelectedName(), addedArts);
+ }
+ }
+
+ public boolean isCancelled() {
+ return cancelled;
+ }
+
+ public void setCancelled(boolean cancelled) {
+ this.cancelled = cancelled;
+ }
+
+ public boolean isLoadWorldView() {
+ return loadWorldView;
+ }
+
+ /**
+ * By default, performSearch loads worldview with results. Set to false to perform search and use getResultArtifacts
+ * to get result set.
+ *
+ * @param loadWorldView
+ */
+ public void setLoadWorldView(boolean loadWorldView) {
+ this.loadWorldView = loadWorldView;
+ }
+
+}
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml
new file mode 100644
index 00000000000..d5ce4ba12c2
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/ATS_Skynet_Types.xml
@@ -0,0 +1,1447 @@
+<?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>2006-03-10T14:37:59Z</Created>
+ <LastSaved>2007-10-01T19:46:21Z</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>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="s27">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="SkyNet_ATS">
+ <Names>
+ <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=SkyNet_ATS!R190C1:R215C5"
+ ss:Hidden="1"/>
+ </Names>
+ <Table ss:ExpandedColumnCount="9" ss:ExpandedRowCount="219" x:FullColumns="1"
+ x:FullRows="1">
+ <Column ss:AutoFitWidth="0" ss:Width="228.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="195.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="99.75"/>
+ <Column ss:AutoFitWidth="0" ss:Width="126"/>
+ <Column ss:AutoFitWidth="0" ss:Width="108"/>
+ <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 Name</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">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Validation Required</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Active</Data></Cell>
+ <Cell><Data ss:Type="String">yes</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution Override</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution Override</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem Override</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Uses Resolution Options</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Released</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Next Version</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Uses Versions</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Blocking Review</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">BooleanAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Metrics from Tasks</Data></Cell>
+ <Cell><Data ss:Type="String">no</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Need By</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Release Date</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">DateAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Release Date</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Priority</Data></Cell>
+ <Cell ss:Index="4"><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="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Change Type</Data></Cell>
+ <Cell ss:Index="4"><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="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">EnumeratedAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.User Community</Data></Cell>
+ <Cell ss:Index="4"><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="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Estimated Hours</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Weekly Benefit</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">FloatingPointAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Man Days Needed</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Branch Id</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Parent Branch Id</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Transaction Id</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">IntegerAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Percent Rework</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Current State</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">1</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Problem</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Proposed Resolution</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Resolution</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Description</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Full Name</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Actionable Item</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Team Definition</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Log</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.State Notes</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Related To State</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s24"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.SMA Note</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Work Package</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category2</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s22"><Data ss:Type="String">ats.Category3</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Legacy PCR Id</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision Review Options</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Decision</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Review Defect</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Location</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Authors</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><Data ss:Type="String">yes</Data></Cell>
+ </Row>
+ <Row>
+ <Cell><Data ss:Type="String">StringAttribute</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Role</Data></Cell>
+ <Cell ss:Index="5"><Data ss:Type="Number">0</Data></Cell>
+ <Cell><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:Index="8"><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="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>
+ <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 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 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="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.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">Actionable Item</Data></Cell>
+ <Cell><Data ss:Type="String">ats.Active</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.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="s27"><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="s27"><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="s27"><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="s27"><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="s27"><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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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>
+ </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">Artifact</Data></Cell>
+ <Cell><Data ss:Type="String">is review of</Data></Cell>
+ <Cell><Data ss:Type="String">TWtDR</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>
+ </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>
+ </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">
+ <Selected/>
+ <TopRowVisible>146</TopRowVisible>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ <ActiveRow>182</ActiveRow>
+ <ActiveCol>4</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/MS_0.1.4_20080103/org.eclipse.osee.ats/support/Action Import.xml b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/Action Import.xml
new file mode 100644
index 00000000000..3fa79c91868
--- /dev/null
+++ b/MS_0.1.4_20080103/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/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_decisionReview_workflow.vue b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_decisionReview_workflow.vue
new file mode 100644
index 00000000000..2ecba2c653a
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_decisionReview_workflow.vue
@@ -0,0 +1,195 @@
+<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/vue/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml -->
+<!-- Do Not Remove: Saved date Fri Sep 28 10:39:26 MST 2007 by b0727536 on platform Windows XP 5.1 in JVM 1.5.0_07-b03 -->
+<!-- Do Not Remove: Saving version @(#)VUE: built October 17 2006 at 0400 by vue on Linux 2.4.21-37.EL i386 JVM 1.5.0_06-b05 -->
+<?xml version="1.0" encoding="US-ASCII"?>
+<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="none" ID="0"
+ label="osee_ats_decisionReview_workflow(AAABEu5a1BQAaR82IjQ3GQ) Fri Sep 28 10;39;03 MST 2007.xml"
+ x="110.425" y="-9.0" width="337.09998" height="378.0"
+ strokeWidth="0.0" autoSized="false">
+ <fillColor>#ffffff</fillColor>
+ <strokeColor>#404040</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ <child ID="4" label="Prepare" x="209.17499" y="-8.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage startPage="true" pageId="osee.ats.decisionReview.Prepare"&gt;%nl;%nl;&lt;XWidget displayName="Title" storageName="Name" required="true" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;XWidget displayName="Decision Review Options" storageName="ats.Decision Review Options" required="true" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Description" storageName="ats.Description" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Blocking Review" storageName="ats.Blocking Review" xwidgetType="XComboDam(yes,no)" required="true" horizontalLabel="true" beginComposite="4"/&gt;%nl;%nl;&lt;XWidget displayName="Need By" storageName="ats.Need By" xwidgetType="XDateDam" horizontalLabel="true"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="51" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="8" label="default" x="250.88748" y="20.5" width="10.0"
+ height="105.99609" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="255.58324" y="20.5"/>
+ <point2 x="256.19174" y="126.49609"/>
+ <ID1>4</ID1>
+ <ID2>12</ID2>
+ </child>
+ <child ID="12" label="Decision" x="204.17499" y="126.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.decisionReview.Decision"&gt;%nl;%nl;&lt;XWidget displayName="Question" storageName="Name" xwidgetType="XLabelDam"/&gt;%nl;%nl;&lt;XWidget displayName="Decision" storageName="ats.Decision" required="true" xwidgetType="XComboDam(1,2,3)" /&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;/WorkPage&gt;%nl;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="54" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="14" label="Completed" x="205.17499" y="339.5"
+ width="108.399994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.decisionReview.Completed"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="68" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="16" label="default" x="252.82501" y="155.5" width="10.0"
+ height="184.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="256.48602" y="155.5"/>
+ <point2 x="259.16397" y="339.5"/>
+ <ID1>12</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="17" label="Cancelled" x="338.90002" y="58.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.decisionReview.Cancelled"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="63" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="18" x="284.82465" y="20.500008" width="76.85074"
+ height="37.999985" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="284.82465" y="20.500008"/>
+ <point2 x="361.67538" y="58.499992"/>
+ <ID1>4</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="22" x="285.00308" y="87.5" width="77.2688" height="39.0"
+ strokeWidth="1.0" autoSized="false" controlCount="0"
+ arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="285.00308" y="126.5"/>
+ <point2 x="362.27188" y="87.5"/>
+ <ID1>12</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="26" label="return" x="110.925" y="20.5" width="122.03372"
+ height="106.0" strokeWidth="1.0" autoSized="false"
+ controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="206.09464" y="126.5"/>
+ <point2 x="232.95872" y="20.5"/>
+ <ID1>12</ID1>
+ <ID2>4</ID2>
+ <ctrlPoint0 x="110.925" y="99.0" xsi:type="point"/>
+ </child>
+ <child ID="27" label="Followup" x="342.82498" y="233.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.decisionReview.Followup"&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" horizontalLabel="true" %sp;fill="Vertically"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="56" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="28" x="275.06403" y="155.50002" width="101.07193"
+ height="77.99997" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="275.06403" y="155.50002"/>
+ <point2 x="376.13596" y="233.49998"/>
+ <ID1>12</ID1>
+ <ID2>27</ID2>
+ </child>
+ <child ID="29" x="387.96252" y="87.5" width="10.0" height="146.0"
+ strokeWidth="1.0" autoSized="false" controlCount="0"
+ arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="394.5998" y="233.5"/>
+ <point2 x="391.32523" y="87.5"/>
+ <ID1>27</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="30" label="default" x="277.91724" y="262.5"
+ width="98.465485" height="77.0" strokeWidth="1.0"
+ autoSized="false" controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="376.38272" y="262.5"/>
+ <point2 x="277.91724" y="339.5"/>
+ <ID1>27</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="31" label="return" x="308.375" y="132.0" width="83.04999"
+ height="101.500015" strokeWidth="1.0" autoSized="false"
+ controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="391.425" y="233.5"/>
+ <point2 x="308.375" y="136.76231"/>
+ <ID1>27</ID1>
+ <ID2>12</ID2>
+ <ctrlPoint0 x="366.925" y="132.0" xsi:type="point"/>
+ </child>
+ <userZoom>1.0</userZoom>
+ <userOrigin x="-21.074997" y="-158.0"/>
+ <PathwayList currentPathway="0" revealerIndex="-1">
+ <pathway label="Untitled Pathway" x="0.0" y="0.0"
+ width="1.4E-45" height="1.4E-45" hidden="true"
+ strokeWidth="0.0" autoSized="false" currentIndex="-1"
+ locked="false" open="true">
+ <strokeColor>#993333</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ </pathway>
+ </PathwayList>
+ <date>2006-12-19</date>
+ <mapFilterModel/>
+</LW-MAP>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultSimpleTeam_workflow.vue b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultSimpleTeam_workflow.vue
new file mode 100644
index 00000000000..b4e3b2e6c04
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultSimpleTeam_workflow.vue
@@ -0,0 +1,133 @@
+<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/vue/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml -->
+<!-- Do Not Remove: Saved date Mon Sep 10 10:05:56 MST 2007 by b0727536 on platform Windows XP 5.1 in JVM 1.5.0_07-b03 -->
+<!-- Do Not Remove: Saving version @(#)VUE: built October 17 2006 at 0400 by vue on Linux 2.4.21-37.EL i386 JVM 1.5.0_06-b05 -->
+<?xml version="1.0" encoding="US-ASCII"?>
+<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="none" ID="0"
+ label="osee_ats_defaultSimpleTeam_workflow.vue" x="131.425" y="81.0"
+ width="341.17502" height="287.0" strokeWidth="0.0" autoSized="false">
+ <fillColor>#ffffff</fillColor>
+ <strokeColor>#404040</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ <child ID="4" label="Endorse" x="210.17499" y="81.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage startPage="true" pageId="osee.ats.defaultSimpleTeam.Endorse"&gt;%nl;%nl;&lt;XWidget displayName="Title" storageName="Name" required="true" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;XWidget displayName="Description" storageName="ats.Description" required="true" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Change Type" storageName="ats.Change Type" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" beginComposite="6"/&gt;%nl;%nl;&lt;XWidget displayName="Priority" storageName="ats.Priority" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" /&gt;%nl;%nl;&lt;XWidget displayName="Need By" storageName="ats.Need By" xwidgetType="XDateDam" horizontalLabel="true"/&gt;%nl;%nl;&lt;XWidget displayName="Validation Required" storageName="ats.Validation Required" xwidgetType="XCheckBoxDam" horizontalLabel="true" endComposite="true" labelAfter="true"/&gt;%nl;%nl;&lt;XWidget displayName="User Community" storageName="ats.User Community" xwidgetType="XListDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" required="true"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="53" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="8" label="default" x="251.88748" y="110.50391"
+ width="10.0" height="111.99609" strokeWidth="1.0"
+ autoSized="false" controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="256.5797" y="110.50391"/>
+ <point2 x="257.19525" y="222.5"/>
+ <ID1>4</ID1>
+ <ID2>12</ID2>
+ </child>
+ <child ID="12" label="InWork" x="205.17497" y="222.5" width="104.2"
+ height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultSimpleTeam.InWork" atsRequireStateHourSpentPrompt="true"&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="44" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="14" label="Completed" x="205.17499" y="338.5"
+ width="108.399994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultSimpleTeam.Completed" validatePage="NonBlocking"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="68" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="16" label="default" x="253.32498" y="251.5" width="10.0"
+ height="87.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="257.53748" y="251.5"/>
+ <point2 x="259.1125" y="338.5"/>
+ <ID1>12</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="17" label="Cancelled" x="367.90002" y="159.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultSimpleTeam.Cancelled"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="63" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="18" x="286.89423" y="110.5" width="102.71158"
+ height="49.000008" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="286.89423" y="110.49999"/>
+ <point2 x="389.6058" y="159.5"/>
+ <ID1>4</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="22" x="294.72754" y="188.5" width="87.819855"
+ height="34.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="294.72754" y="222.5"/>
+ <point2 x="382.5474" y="188.5"/>
+ <ID1>12</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="26" label="return" x="131.925" y="110.5"
+ width="103.57109" height="112.0" strokeWidth="1.0"
+ autoSized="false" controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="224.22815" y="222.5"/>
+ <point2 x="235.4961" y="110.5"/>
+ <ID1>12</ID1>
+ <ID2>4</ID2>
+ <ctrlPoint0 x="131.925" y="182.0" xsi:type="point"/>
+ </child>
+ <userZoom>1.0</userZoom>
+ <userOrigin x="-21.074997" y="-157.0"/>
+ <PathwayList currentPathway="0" revealerIndex="-1">
+ <pathway label="Untitled Pathway" x="0.0" y="0.0"
+ width="1.4E-45" height="1.4E-45" hidden="true"
+ strokeWidth="0.0" autoSized="false" currentIndex="-1"
+ locked="false" open="true">
+ <strokeColor>#993333</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ </pathway>
+ </PathwayList>
+ <date>2006-12-19</date>
+ <mapFilterModel/>
+</LW-MAP>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTask_workflow.vue b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTask_workflow.vue
new file mode 100644
index 00000000000..d2762a63f04
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTask_workflow.vue
@@ -0,0 +1,99 @@
+<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/vue/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml -->
+<!-- Do Not Remove: Saved date Fri Sep 28 10:38:49 MST 2007 by b0727536 on platform Windows XP 5.1 in JVM 1.5.0_07-b03 -->
+<!-- Do Not Remove: Saving version @(#)VUE: built October 17 2006 at 0400 by vue on Linux 2.4.21-37.EL i386 JVM 1.5.0_06-b05 -->
+<?xml version="1.0" encoding="US-ASCII"?>
+<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="none" ID="0"
+ label="osee_ats_defaultTask_workflow(AAABEu5ajy4AaR82I850eQ) Fri Sep 28 10;38;12 MST 2007.xml"
+ x="91.425" y="80.0" width="357.17502" height="133.0"
+ strokeWidth="0.0" autoSized="false">
+ <fillColor>#ffffff</fillColor>
+ <strokeColor>#404040</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ <child ID="4" label="InWork" x="211.17499" y="80.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage startPage="true" pageId="osee.ats.defaultTask.InWork"&gt;%nl;%nl;&lt;XWidget displayName="Title" storageName="Name" required="true" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;XWidget displayName="Description" storageName="ats.Description" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Estimated Hours" storageName="ats.Estimated Hours" xwidgetType="XFloatDam" /&gt;%nl;%nl;&lt;XWidget displayName="Related To State" storageName="ats.Related To State" xwidgetType="XTextDam" /&gt;%nl;%nl;&lt;XWidget displayName="SMA Note" storageName="ats.SMA Note" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Category" storageName="ats.Category" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="44" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="8" label="default" x="254.4375" y="109.49951"
+ width="10.0" height="74.00049" strokeWidth="1.0"
+ autoSized="false" controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="258.0455" y="109.49951"/>
+ <point2 x="260.8295" y="183.5"/>
+ <ID1>4</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="14" label="Completed" x="207.17499" y="183.5"
+ width="108.399994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTask.Completed" validatePage="NonBlocking"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="68" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="17" label="Cancelled" x="343.90002" y="148.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTask.Cancelled"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="63" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="20" x="293.94257" y="109.5" width="78.66614"
+ height="39.000008" strokeWidth="1.0" autoSized="false"
+ controlCount="1" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="293.94257" y="109.49999"/>
+ <point2 x="372.6087" y="148.5"/>
+ <ID1>4</ID1>
+ <ID2>17</ID2>
+ <ctrlPoint0 x="337.925" y="127.0" xsi:type="point"/>
+ </child>
+ <child ID="21" x="91.925" y="101.15521" width="139.11636"
+ height="82.34479" strokeWidth="1.0" autoSized="false"
+ controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="231.04137" y="183.5"/>
+ <point2 x="211.17499" y="101.15521"/>
+ <ID1>14</ID1>
+ <ID2>4</ID2>
+ <ctrlPoint0 x="91.925" y="117.0" xsi:type="point"/>
+ </child>
+ <userZoom>1.0</userZoom>
+ <userOrigin x="-21.074997" y="-157.0"/>
+ <PathwayList currentPathway="0" revealerIndex="-1">
+ <pathway label="Untitled Pathway" x="0.0" y="0.0"
+ width="1.4E-45" height="1.4E-45" hidden="true"
+ strokeWidth="0.0" autoSized="false" currentIndex="-1"
+ locked="false" open="true">
+ <strokeColor>#993333</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ </pathway>
+ </PathwayList>
+ <date>2006-12-19</date>
+ <mapFilterModel/>
+</LW-MAP>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTeam_workflow.vue b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTeam_workflow.vue
new file mode 100644
index 00000000000..056512af9c6
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_defaultTeam_workflow.vue
@@ -0,0 +1,232 @@
+<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/vue/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml -->
+<!-- Do Not Remove: Saved date Fri Sep 28 14:58:42 MST 2007 by b0727536 on platform Windows XP 5.1 in JVM 1.5.0_07-b03 -->
+<!-- Do Not Remove: Saving version @(#)VUE: built October 17 2006 at 0400 by vue on Linux 2.4.21-37.EL i386 JVM 1.5.0_06-b05 -->
+<?xml version="1.0" encoding="US-ASCII"?>
+<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="none" ID="0"
+ label="osee_ats_defaultTeam_workflow.vue" x="105.31415" y="84.0"
+ width="367.2859" height="372.0" strokeWidth="0.0" autoSized="false">
+ <fillColor>#ffffff</fillColor>
+ <strokeColor>#404040</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ <child ID="4" label="Endorse" x="210.17499" y="84.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage startPage="true" pageId="osee.ats.defaultTeam.Endorse"&gt;%nl;%nl;&lt;XWidget displayName="Title" storageName="Name" required="true" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;XWidget displayName="Description" storageName="ats.Description" required="true" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Proposed Resolution" storageName="ats.Proposed Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Change Type" storageName="ats.Change Type" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" beginComposite="4"/&gt;%nl;%nl;&lt;XWidget displayName="Priority" storageName="ats.Priority" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" endComposite="true" helpPluginId="osee.ats" helpContextId="atsPriority"/&gt;%nl;%nl;&lt;XWidget displayName="Deadline" storageName="ats.Need By" xwidgetType="XDateDam" horizontalLabel="true" beginComposite="6"/&gt;%nl;%nl;&lt;XWidget displayName="Validation Required" storageName="ats.Validation Required" xwidgetType="XCheckBoxDam" horizontalLabel="true" endComposite="true" labelAfter="true"/&gt;%nl;%nl;&lt;XWidget displayName="Metrics from Tasks" storageName="ats.Metrics from Tasks" xwidgetType="XCheckBoxDam" horizontalLabel="true" endComposite="true" labelAfter="true"/&gt;%nl;%nl;&lt;XWidget displayName="User Community" storageName="ats.User Community" xwidgetType="XListDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" required="true"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="53" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="6" label="Analyze" x="209.17499" y="176.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTeam.Analyze" atsRequireStateHourSpentPrompt="true"&gt;%nl;%nl;&lt;XWidget displayName="Problem" storageName="ats.Problem" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Proposed Resolution" storageName="ats.Proposed Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Change Type" storageName="ats.Change Type" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" beginComposite="6"/&gt;%nl;%nl;&lt;XWidget displayName="Priority" storageName="ats.Priority" xwidgetType="XComboDam(OPTIONS_FROM_ATTRIBUTE_VALIDITY)" horizontalLabel="true" /&gt;%nl;%nl;&lt;XWidget displayName="Deadline" storageName="ats.Need By" xwidgetType="XDateDam" horizontalLabel="true" endComposite="true" /&gt;%nl;%nl;&lt;XWidget displayName="Estimated Hours" storageName="ats.Estimated Hours" xwidgetType="XFloatDam" required="true" horizontalLabel="true" /&gt;%nl;%nl;&lt;/WorkPage&gt;%nl;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="49" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="8" label="default" x="251.0" y="113.49805" width="10.0"
+ height="63.001953" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="256.3424" y="113.49805"/>
+ <point2 x="255.65761" y="176.5"/>
+ <ID1>4</ID1>
+ <ID2>6</ID2>
+ </child>
+ <child ID="9" label="Authorize" x="210.17499" y="259.5"
+ width="99.75" height="28.5" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTeam.Authorize"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="59" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="10" label="default" x="252.78186" y="205.5" width="10.0"
+ height="54.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="256.29727" y="205.5"/>
+ <point2 x="259.26645" y="259.5"/>
+ <ID1>6</ID1>
+ <ID2>9</ID2>
+ </child>
+ <child ID="12" label="Implement" x="206.17499" y="352.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTeam.Implement" atsRequireStateHourSpentPrompt="true"&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="64" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="13" label="default" x="254.16486" y="288.0" width="10.0"
+ height="64.50098" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="259.77875" y="288.0"/>
+ <point2 x="258.551" y="352.50098"/>
+ <ID1>9</ID1>
+ <ID2>12</ID2>
+ </child>
+ <child ID="14" label="Completed" x="207.17499" y="426.5"
+ width="108.399994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTeam.Completed" validatePage="NonBlocking"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="68" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="16" label="default" x="254.82501" y="381.5" width="10.0"
+ height="45.00049" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="258.88242" y="381.5"/>
+ <point2 x="260.76758" y="426.5005"/>
+ <ID1>12</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="17" label="Cancelled" x="367.90002" y="159.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.defaultTeam.Cancelled"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="63" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="18" x="288.11" y="113.5" width="100.28003" height="46.0"
+ strokeWidth="1.0" autoSized="false" controlCount="0"
+ arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="288.11" y="113.5"/>
+ <point2 x="388.39" y="159.5"/>
+ <ID1>4</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="20" x="301.82495" y="177.7984" width="66.07504"
+ height="10.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="301.82498" y="186.21262"/>
+ <point2 x="367.90002" y="179.3842"/>
+ <ID1>6</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="21" x="282.90002" y="188.5" width="113.84915"
+ height="71.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="282.9" y="259.5"/>
+ <point2 x="396.74915" y="188.5"/>
+ <ID1>9</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="22" x="270.42532" y="188.5" width="137.42438"
+ height="164.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="270.42532" y="352.5"/>
+ <point2 x="407.8497" y="188.5"/>
+ <ID1>12</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="24" label="return" x="128.925" y="205.5"
+ width="85.271484" height="54.0" strokeWidth="1.0"
+ autoSized="false" controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="214.19649" y="259.5"/>
+ <point2 x="211.8015" y="205.5"/>
+ <ID1>9</ID1>
+ <ID2>6</ID2>
+ <ctrlPoint0 x="128.925" y="233.0" xsi:type="point"/>
+ </child>
+ <child ID="25" label="return" x="106.925" y="205.5"
+ width="125.224106" height="147.0" strokeWidth="1.0"
+ autoSized="false" controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="232.14911" y="352.5"/>
+ <point2 x="232.08325" y="205.5"/>
+ <ID1>12</ID1>
+ <ID2>6</ID2>
+ <ctrlPoint0 x="106.925" y="283.0" xsi:type="point"/>
+ </child>
+ <child ID="26" label="return" x="105.81415" y="285.4721"
+ width="113.676956" height="67.02789" strokeWidth="1.0"
+ autoSized="false" controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="219.4911" y="352.5"/>
+ <point2 x="210.17499" y="285.4721"/>
+ <ID1>12</ID1>
+ <ID2>9</ID2>
+ <ctrlPoint0 x="105.81415" y="310.0" xsi:type="point"/>
+ </child>
+ <userZoom>1.0</userZoom>
+ <userOrigin x="-21.074997" y="-157.0"/>
+ <PathwayList currentPathway="0" revealerIndex="-1">
+ <pathway label="Untitled Pathway" x="0.0" y="0.0"
+ width="1.4E-45" height="1.4E-45" hidden="true"
+ strokeWidth="0.0" autoSized="false" currentIndex="-1"
+ locked="false" open="true">
+ <strokeColor>#993333</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ </pathway>
+ </PathwayList>
+ <date>2006-12-19</date>
+ <mapFilterModel/>
+</LW-MAP>
diff --git a/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_peerToPeerReview_workflow.vue b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_peerToPeerReview_workflow.vue
new file mode 100644
index 00000000000..d39919ccba7
--- /dev/null
+++ b/MS_0.1.4_20080103/org.eclipse.osee.ats/support/osee_ats_peerToPeerReview_workflow.vue
@@ -0,0 +1,134 @@
+<!-- Do Not Remove: VUE mapping @version(1.1) jar:file:/C:/Program%20Files/vue/VUE.jar!/tufts/vue/resources/lw_mapping_1_1.xml -->
+<!-- Do Not Remove: Saved date Fri Sep 28 10:38:04 MST 2007 by b0727536 on platform Windows XP 5.1 in JVM 1.5.0_07-b03 -->
+<!-- Do Not Remove: Saving version @(#)VUE: built October 17 2006 at 0400 by vue on Linux 2.4.21-37.EL i386 JVM 1.5.0_06-b05 -->
+<?xml version="1.0" encoding="US-ASCII"?>
+<LW-MAP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="none" ID="0"
+ label="osee_ats_peerToPeerReview_workflow(AAABFNKhB4EBzlr5Twr6hA) Fri Sep 28 10;35;49 MST 2007.xml"
+ x="110.425" y="-7.0" width="333.17502" height="307.0"
+ strokeWidth="0.0" autoSized="false">
+ <fillColor>#ffffff</fillColor>
+ <strokeColor>#404040</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ <child ID="4" label="Prepare" x="210.17499" y="-6.5"
+ width="92.649994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage startPage="true" pageId="osee.ats.peerToPeerReview.Prepare"&gt;%nl;%nl;&lt;XWidget displayName="Title" storageName="Name" required="true" xwidgetType="XTextDam"/&gt;%nl;%nl;&lt;XWidget displayName="Related State of Parent Workflow" storageName="ats.Related To State" horizontalLabel="true" xwidgetType="XLabelDam" beginComposite="4"/&gt;%nl;%nl;&lt;XWidget displayName="Legacy PCR Number" storageName="ats.Legacy PCR Id" horizontalLabel="true" xwidgetType="XLabelDam" endComposite="true"/&gt;%nl;%nl;&lt;XWidget displayName="Review Roles" storageName="ats.Role" required="true" xwidgetType="XUserRoleViewer" /&gt;%nl;%nl;&lt;XWidget displayName="Location of review materials" storageName="ats.Location" required="true" xwidgetType="XTextResourceDropDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Description" storageName="ats.Description" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;XWidget displayName="Blocking Review" storageName="ats.Blocking Review" xwidgetType="XComboDam(yes,no)" required="true" horizontalLabel="true" beginComposite="4"/&gt;%nl;%nl;&lt;XWidget displayName="Need By" storageName="ats.Need By" xwidgetType="XDateDam" horizontalLabel="true"/&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="51" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="8" label="default" x="252.38751" y="22.501953"
+ width="10.0" height="104.99805" strokeWidth="1.0"
+ autoSized="false" controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="256.69208" y="22.501953"/>
+ <point2 x="258.08292" y="127.5"/>
+ <ID1>4</ID1>
+ <ID2>12</ID2>
+ </child>
+ <child ID="12" label="Review" x="206.17499" y="127.5" width="104.2"
+ height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.peerToPeerReview.Review"&gt;%nl;%nl;&lt;XWidget displayName="Review Roles" storageName="ats.Role" required="true" xwidgetType="XUserRoleViewer" /&gt;%nl;%nl;&lt;XWidget displayName="Review Defect" storageName="ats.Review Defect" required="false" xwidgetType="XDefectViewer" /&gt;%nl;%nl;&lt;XWidget displayName="Resolution" storageName="ats.Resolution" xwidgetType="XTextDam" fill="Vertically"/&gt;%nl;%nl;&lt;/WorkPage&gt;%nl;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="45" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="14" label="Completed" x="202.17499" y="270.5"
+ width="108.399994" height="29.0" strokeWidth="1.0"
+ autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.peerToPeerReview.Completed"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="68" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="16" label="default" x="252.32501" y="156.5" width="10.0"
+ height="114.0" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="37" height="15"/>
+ <nodeFilter/>
+ <point1 x="258.08234" y="156.5"/>
+ <point2 x="256.56766" y="270.5"/>
+ <ID1>12</ID1>
+ <ID2>14</ID2>
+ </child>
+ <child ID="17" label="Cancelled" x="338.90002" y="58.5"
+ width="104.2" height="29.0" strokeWidth="1.0" autoSized="false" xsi:type="node">
+ <notes>&lt;WorkPage pageId="osee.ats.decisionReview.Cancelled"&gt;%nl;%nl;&lt;/WorkPage&gt;</notes>
+ <fillColor>#7f9cc6</fillColor>
+ <strokeColor>#776d6d</strokeColor>
+ <font>Arial-plain-14</font>
+ <textBox width="63" height="17"/>
+ <nodeFilter/>
+ <shape xsi:type="rectangle"/>
+ </child>
+ <child ID="18" x="286.50385" y="22.499992" width="74.49237"
+ height="36.000015" strokeWidth="1.0" autoSized="false"
+ controlCount="0" arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="286.50385" y="22.499992"/>
+ <point2 x="360.99622" y="58.500008"/>
+ <ID1>4</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="22" x="286.1665" y="87.5" width="76.941986" height="40.0"
+ strokeWidth="1.0" autoSized="false" controlCount="0"
+ arrowState="3" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <nodeFilter/>
+ <point1 x="286.16653" y="127.5"/>
+ <point2 x="363.10852" y="87.5"/>
+ <ID1>12</ID1>
+ <ID2>17</ID2>
+ </child>
+ <child ID="26" label="return" x="110.925" y="22.5" width="122.37897"
+ height="105.0" strokeWidth="1.0" autoSized="false"
+ controlCount="1" arrowState="2" xsi:type="link">
+ <strokeColor>#404040</strokeColor>
+ <textColor>#404040</textColor>
+ <font>Arial-plain-12</font>
+ <textBox width="32" height="15"/>
+ <nodeFilter/>
+ <point1 x="208.58722" y="127.5"/>
+ <point2 x="233.30397" y="22.5"/>
+ <ID1>12</ID1>
+ <ID2>4</ID2>
+ <ctrlPoint0 x="110.925" y="99.0" xsi:type="point"/>
+ </child>
+ <userZoom>1.0</userZoom>
+ <userOrigin x="-21.074997" y="-158.0"/>
+ <PathwayList currentPathway="0" revealerIndex="-1">
+ <pathway label="Untitled Pathway" x="0.0" y="0.0"
+ width="1.4E-45" height="1.4E-45" hidden="true"
+ strokeWidth="0.0" autoSized="false" currentIndex="-1"
+ locked="false" open="true">
+ <strokeColor>#993333</strokeColor>
+ <font>SansSerif-plain-14</font>
+ <nodeFilter/>
+ </pathway>
+ </PathwayList>
+ <date>2006-12-19</date>
+ <mapFilterModel/>
+</LW-MAP>

Back to the top