Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-05-19 15:47:43 +0000
committerddunne2010-05-19 15:47:43 +0000
commit001df8cdf6bcd434148363dac9874d14b2271035 (patch)
treeae9ffe8c2a175b313805439dbc8da3086c2c0531
parenta146e27bfc785fb11c791bdf43006a335f12f0d9 (diff)
downloadorg.eclipse.osee-001df8cdf6bcd434148363dac9874d14b2271035.tar.gz
org.eclipse.osee-001df8cdf6bcd434148363dac9874d14b2271035.tar.xz
org.eclipse.osee-001df8cdf6bcd434148363dac9874d14b2271035.zip
Goal for dups and Action artifacts
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java10
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java13
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java8
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java32
4 files changed, 34 insertions, 29 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
index 00a2f337120..b7fda46dcb1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/ActionArtifact.java
@@ -478,13 +478,7 @@ public class ActionArtifact extends ATSArtifact implements IWorldViewArtifact {
@Override
public String getWorldViewGoals() throws OseeCoreException {
- Set<Artifact> groups = new HashSet<Artifact>();
- groups.addAll(getRelatedArtifacts(AtsRelationTypes.Goal_Goal));
- // Roll up if same for all children
- for (TeamWorkFlowArtifact team : getTeamWorkFlowArtifacts()) {
- groups.addAll(team.getRelatedArtifacts(AtsRelationTypes.Goal_Goal));
- }
- return Artifacts.toString("; ", groups);
+ return Artifacts.toString("; ", getRelatedArtifacts(AtsRelationTypes.Goal_Goal));
}
public String getWorldViewNumeric1() throws OseeCoreException {
@@ -512,7 +506,7 @@ public class ActionArtifact extends ATSArtifact implements IWorldViewArtifact {
}
public String getWorldViewGoalOrderVote() throws OseeCoreException {
- return "";
+ return getSoleAttributeValue(ATSAttributes.GOAL_ORDER_VOTE_ATTRIBUTE.getStoreName(), "");
}
public String getWorldViewWorkPackage() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
index 1ccc3a29d9c..4f2abeb8556 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/artifact/GoalArtifact.java
@@ -121,11 +121,6 @@ public class GoalArtifact extends StateMachineArtifact {
if (art instanceof GoalArtifact) {
goals.add(art);
}
- if (art instanceof ActionArtifact) {
- for (TeamWorkFlowArtifact teamArt : ((ActionArtifact) art).getTeamWorkFlowArtifacts()) {
- getGoals(teamArt, goals, recurse);
- }
- }
goals.addAll(art.getRelatedArtifacts(AtsRelationTypes.Goal_Goal, GoalArtifact.class));
if (recurse && art instanceof StateMachineArtifact && ((StateMachineArtifact) art).getParentSMA() != null) {
getGoals(((StateMachineArtifact) art).getParentSMA(), goals, recurse);
@@ -144,7 +139,13 @@ public class GoalArtifact extends StateMachineArtifact {
if (!isHasGoal(artifact)) return "";
Collection<Artifact> goals = GoalArtifact.getGoals(artifact, false);
if (goals.size() > 1) {
- return "unable to resolve duplicate parents";
+ List<Artifact> goalsSorted = new ArrayList<Artifact>(goals);
+ Collections.sort(goalsSorted);
+ StringBuffer sb = new StringBuffer();
+ for (Artifact goal : goalsSorted) {
+ sb.append(String.format("%s-[%s] ", getGoalOrder((GoalArtifact) goal, artifact), goal));
+ }
+ return sb.toString();
}
Artifact goal = goals.iterator().next();
return getGoalOrder((GoalArtifact) goal, artifact);
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
index 9932cbe109c..394f7dc968c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java
@@ -73,13 +73,13 @@ public class PromptChangeUtil {
return false;
}
- public static boolean promptChangeGoals(StateMachineArtifact sma, boolean persist) throws OseeCoreException {
+ public static boolean promptChangeGoals(Artifact sma, boolean persist) throws OseeCoreException {
return promptChangeGoals(Arrays.asList(sma), persist);
}
- public static boolean promptChangeGoals(final Collection<? extends StateMachineArtifact> smas, boolean persist) throws OseeCoreException {
+ public static boolean promptChangeGoals(final Collection<? extends Artifact> smas, boolean persist) throws OseeCoreException {
Set<Artifact> selected = new HashSet<Artifact>();
- for (StateMachineArtifact sma : smas) {
+ for (Artifact sma : smas) {
selected.addAll(sma.getRelatedArtifacts(AtsRelationTypes.Goal_Goal));
}
Collection<Artifact> allGoals =
@@ -89,7 +89,7 @@ public class PromptChangeUtil {
dialog.setInitialSelections(selected.toArray());
if (dialog.open() == 0) {
SkynetTransaction transaction = new SkynetTransaction(AtsUtil.getAtsBranch(), "Set Goals");
- for (StateMachineArtifact sma : smas) {
+ for (Artifact sma : smas) {
sma.setRelations(AtsRelationTypes.Goal_Goal, dialog.getSelection());
sma.persist(transaction);
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
index bf972c17911..5cbcc503dab 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -61,6 +61,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.IATSArtifact;
import org.eclipse.osee.framework.skynet.core.event.FrameworkTransactionData;
import org.eclipse.osee.framework.skynet.core.event.IArtifactReloadEventListener;
import org.eclipse.osee.framework.skynet.core.event.IArtifactsChangeTypeEventListener;
@@ -948,6 +949,24 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
return false;
}
Artifact useArt = (Artifact) treeItem.getData();
+ XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
+ if (useArt instanceof IATSArtifact) {
+ boolean modified = false;
+ if (xCol.equals(WorldXViewerFactory.Goal_Order)) {
+ handleAltLeftClickGoalOrder(treeItem, (IATSArtifact) useArt);
+ return false;
+ } else if (xCol.equals(WorldXViewerFactory.Goal_Order_Vote_Col)) {
+ modified =
+ PromptChangeUtil.promptChangeAttribute((Artifact) useArt, ATSAttributes.GOAL_ORDER_VOTE_ATTRIBUTE,
+ persist, true);
+ } else if (xCol.equals(WorldXViewerFactory.Goals_Col)) {
+ modified = PromptChangeUtil.promptChangeGoals((Artifact) useArt, persist);
+ }
+ if (modified) {
+ update(useArt, null);
+ return true;
+ }
+ }
if (useArt instanceof ActionArtifact) {
if (((ActionArtifact) useArt).getTeamWorkFlowArtifacts().size() == 1) {
useArt = ((ActionArtifact) useArt).getTeamWorkFlowArtifacts().iterator().next();
@@ -956,7 +975,6 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
}
}
StateMachineArtifact sma = (StateMachineArtifact) useArt;
- XViewerColumn xCol = (XViewerColumn) treeColumn.getData();
boolean modified = false;
if (xCol.equals(WorldXViewerFactory.Version_Target_Col)) {
modified =
@@ -977,8 +995,6 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
modified = PromptChangeUtil.promptChangeEstimatedReleaseDate(sma);
} else if (xCol.equals(WorldXViewerFactory.Groups_Col)) {
modified = PromptChangeUtil.promptChangeGroups(sma, persist);
- } else if (xCol.equals(WorldXViewerFactory.Goals_Col)) {
- modified = PromptChangeUtil.promptChangeGoals(sma, persist);
} else if (xCol.equals(WorldXViewerFactory.Estimated_Completion_Date_Col)) {
modified =
PromptChangeUtil.promptChangeDate(sma, ATSAttributes.ESTIMATED_COMPLETION_DATE_ATTRIBUTE, persist);
@@ -1006,9 +1022,6 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
modified = PromptChangeUtil.promptChangeFloatAttribute(sma, ATSAttributes.NUMERIC1_ATTRIBUTE, persist);
} else if (xCol.equals(WorldXViewerFactory.Numeric2_Col)) {
modified = PromptChangeUtil.promptChangeFloatAttribute(sma, ATSAttributes.NUMERIC2_ATTRIBUTE, persist);
- } else if (xCol.equals(WorldXViewerFactory.Goal_Order_Vote_Col)) {
- modified =
- PromptChangeUtil.promptChangeAttribute(sma, ATSAttributes.GOAL_ORDER_VOTE_ATTRIBUTE, persist, true);
} else if (xCol.equals(WorldXViewerFactory.Category_Col)) {
modified = PromptChangeUtil.promptChangeAttribute(sma, ATSAttributes.CATEGORY_ATTRIBUTE, persist, true);
} else if (xCol.equals(WorldXViewerFactory.Resolution_Col)) {
@@ -1021,9 +1034,6 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
modified = PromptChangeUtil.promptChangeType(sma, persist);
} else if (xCol.equals(WorldXViewerFactory.Priority_Col)) {
modified = PromptChangeUtil.promptChangePriority(sma, persist);
- } else if (xCol.equals(WorldXViewerFactory.Goal_Order)) {
- handleAltLeftClickGoalOrder(treeItem, sma);
- return false;
}
if (modified) {
update(useArt, null);
@@ -1035,7 +1045,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
return false;
}
- private void handleAltLeftClickGoalOrder(TreeItem treeItem, StateMachineArtifact sma) throws OseeCoreException {
+ private void handleAltLeftClickGoalOrder(TreeItem treeItem, IATSArtifact atsArt) throws OseeCoreException {
GoalArtifact parentGoalArtifact = null;
if (xViewerFactory instanceof GoalXViewerFactory) {
@@ -1052,7 +1062,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IArt
}
if (changedGoal != null) {
refresh(changedGoal);
- update(sma, null);
+ update(atsArt, null);
}
}

Back to the top