diff options
author | afinkbein | 2009-08-21 23:18:32 +0000 |
---|---|---|
committer | afinkbein | 2009-08-21 23:18:32 +0000 |
commit | 92675598047578c4919f3f26d88550fcffedf775 (patch) | |
tree | d181d39bb679ccec421a4dd134fec65773df8305 | |
parent | e68c6b99e6eba223c15316191963aeb86f6906aa (diff) | |
download | org.eclipse.osee-92675598047578c4919f3f26d88550fcffedf775.tar.gz org.eclipse.osee-92675598047578c4919f3f26d88550fcffedf775.tar.xz org.eclipse.osee-92675598047578c4919f3f26d88550fcffedf775.zip |
41 files changed, 1696 insertions, 799 deletions
diff --git a/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/GUID.java b/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/GUID.java index 0b8452dc026..e0309457758 100644 --- a/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/GUID.java +++ b/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/GUID.java @@ -72,4 +72,8 @@ public class GUID { writeBuffer[14] = (byte) (low >>> 0); return writeBuffer; } + + public static void main(String[] args){ + System.out.println(GUID.create()); + } }
\ No newline at end of file diff --git a/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java index c33f6ba1c9f..5bdb083061b 100644 --- a/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java +++ b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/FrameworkCore_Demo_Suite.java @@ -23,6 +23,7 @@ import org.eclipse.osee.framework.skynet.core.test.cases.DuplicateHridTest; import org.eclipse.osee.framework.skynet.core.test.cases.NativeArtifactTest;
import org.eclipse.osee.framework.skynet.core.test.cases.OseeEnumTypeManagerTest;
import org.eclipse.osee.framework.skynet.core.test.cases.RelationDeletionTest;
+import org.eclipse.osee.framework.skynet.core.test.cases.RelationOrderingTest;
import org.eclipse.osee.framework.skynet.core.test.cases.SevereLogMonitorTest;
import org.eclipse.osee.framework.skynet.core.test.cases.StaticIdManagerTest;
import org.junit.BeforeClass;
@@ -33,7 +34,7 @@ import org.junit.runners.Suite; @Suite.SuiteClasses( {ArtifactPurgeTest.class, BranchPurgeTest.class, Artifact_setAttributeValues.class,
CsvArtifactTest.class, NativeArtifactTest.class, OseeEnumTypeManagerTest.class, ConflictTest.class,
ChangeManagerTest.class, SevereLogMonitorTest.class, RelationDeletionTest.class, StaticIdManagerTest.class,
- BranchStateTest.class, DuplicateHridTest.class})
+ BranchStateTest.class, DuplicateHridTest.class, RelationOrderingTest.class})
/**
* @author Donald G. Dunne
*/
diff --git a/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationDeletionTest.java b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationDeletionTest.java index 4508dee9cba..30443058b82 100644 --- a/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationDeletionTest.java +++ b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationDeletionTest.java @@ -21,9 +21,6 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; import org.eclipse.osee.framework.skynet.core.artifact.Branch;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
-import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
-import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
-import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
import org.junit.Before;
/**
@@ -73,14 +70,6 @@ public class RelationDeletionTest { assertTrue("Child2 is not the first in the list and it should be.", children.get(0) == child2);
- List<RelationLink> relations =
- RelationManager.getRelations(parent, CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD.getRelationType(),
- CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD.getSide());
-
- assertTrue("The order should point to the head '-1'", relations.get(0).getOrder(RelationSide.SIDE_B) == -1);
- assertTrue("The second item in the list is not pointing to the first.", relations.get(1).getOrder(
- RelationSide.SIDE_B) == relations.get(0).getArtifactId(RelationSide.SIDE_B));
-
assertTrue(monitor.toString(), monitor.getAllLogs().size() == 0);
}
}
diff --git a/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java new file mode 100644 index 00000000000..0bd08c8c641 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/test/cases/RelationOrderingTest.java @@ -0,0 +1,155 @@ +/* + * Created on Aug 17, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.test.cases; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import java.util.ArrayList; +import java.util.List; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager; +import org.eclipse.osee.framework.skynet.core.artifact.Attribute; +import org.eclipse.osee.framework.skynet.core.artifact.Branch; +import org.eclipse.osee.framework.skynet.core.artifact.BranchManager; +import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration; +import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderBaseTypes; +import org.junit.After; +import org.junit.Before; + +/** + * @author Andrew M. Finkbeiner + */ +public class RelationOrderingTest { + + private static final String ARTIFACT_TYPE = "Folder"; + + private Branch branch; + private Artifact parent; + private Artifact child1; + private Artifact child2; + private Artifact child3; + + @Before + public void setupArtifacts() throws Exception { + branch = BranchManager.getCommonBranch(); + parent = ArtifactTypeManager.getType(ARTIFACT_TYPE).makeNewArtifact(branch); + child1 = ArtifactTypeManager.getType(ARTIFACT_TYPE).makeNewArtifact(branch); + child1.setSoleAttributeFromString("Name", "a_child"); + child2 = ArtifactTypeManager.getType(ARTIFACT_TYPE).makeNewArtifact(branch); + child2.setSoleAttributeFromString("Name", "b_child"); + child3 = ArtifactTypeManager.getType(ARTIFACT_TYPE).makeNewArtifact(branch); + child3.setSoleAttributeFromString("Name", "c_child"); + parent.addRelation(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, child1); + parent.addRelation(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, child2); + parent.addRelation(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, child3); + } + + @After + public void cleanupArtifacts() throws Exception { +// parent.deleteAndPersist(); +// child1.deleteAndPersist(); +// child2.deleteAndPersist(); +// child3.deleteAndPersist(); + } + + @org.junit.Test + public void testSetOrderAndSort() throws Exception { + + checkDesc(); + + checkAsc(); + + checkUserDefined(); + + parent.setRelationOrder(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, + RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC); + Attribute<Object> attribute = parent.getSoleAttribute("Relation Order"); + assertTrue("Setting the attribute back to the default type did not cause an attribute to be deleted", + (attribute == null || attribute.isDeleted())); + + + checkDesc(); + + Artifact child4 = ArtifactTypeManager.getType("User").makeNewArtifact(branch); + child1.setSoleAttributeFromString("Name", "a_child"); + Artifact child5 = ArtifactTypeManager.getType("User").makeNewArtifact(branch); + child2.setSoleAttributeFromString("Name", "b_child"); + Artifact child6 = ArtifactTypeManager.getType("User").makeNewArtifact(branch); + + parent.addRelation(CoreRelationEnumeration.Users_User, child4); + parent.addRelation(CoreRelationEnumeration.Users_User, child5); + parent.addRelation(CoreRelationEnumeration.Users_User, child6); + parent.persistRelations(); + + parent.setRelationOrder(CoreRelationEnumeration.Users_User, + RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC); + + parent.setRelationOrder(CoreRelationEnumeration.Users_Artifact, + RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC); + + parent.setRelationOrder(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, + RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC); + + attribute = parent.getSoleAttribute("Relation Order"); + assertTrue("The attribute was deleted even though there was a still a non default sort order on the artifact.", + (attribute != null)); + + + } + + private void checkAsc() throws OseeCoreException { + parent.setRelationOrder(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, + RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC); + List<Artifact> children = parent.getRelatedArtifacts(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD); + assertTrue(children.size() == 3); + assertTrue(children.get(0).getName().equals("a_child")); + assertTrue(children.get(1).getName().equals("b_child")); + assertTrue(children.get(2).getName().equals("c_child")); + } + + private void checkDesc() throws OseeCoreException { + parent.setRelationOrder(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, + RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC); + List<Artifact> children = parent.getRelatedArtifacts(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD); + assertTrue(children.size() == 3); + assertTrue(children.get(0).getName().equals("c_child")); + assertTrue(children.get(1).getName().equals("b_child")); + assertTrue(children.get(2).getName().equals("a_child")); + } + + private void checkUserDefined() throws OseeCoreException { + List<Artifact> children = new ArrayList<Artifact>(); + children.add(child2); + children.add(child3); + children.add(child1); + parent.setRelationOrder(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, children); + children = parent.getRelatedArtifacts(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD); + assertTrue(children.size() == 3); + assertTrue(children.get(0).getName().equals("b_child")); + assertTrue(children.get(1).getName().equals("c_child")); + assertTrue(children.get(2).getName().equals("a_child")); + } + + @org.junit.Test + public void testUserDefinedOrderUpdatesListWhenRelationDeleted() throws OseeCoreException{ + checkUserDefined(); + + String artifactGuid = child3.getGuid(); + + parent.deleteRelation(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD, child3); + + String orderString = parent.getSoleAttributeValue("Relation Order"); + + assertFalse(orderString.contains(artifactGuid)); + + List<Artifact> children = parent.getRelatedArtifacts(CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD); + assertTrue(children.size() == 2); + assertTrue(children.get(0).getName().equals("b_child")); + assertTrue(children.get(1).getName().equals("a_child")); + } + +} diff --git a/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF b/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF index 9166117b9f4..0a4d824f7cb 100644 --- a/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF +++ b/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF @@ -40,6 +40,7 @@ Export-Package: org.eclipse.osee.framework.skynet.core, org.eclipse.osee.framework.skynet.core.linking,
org.eclipse.osee.framework.skynet.core.preferences,
org.eclipse.osee.framework.skynet.core.relation,
+ org.eclipse.osee.framework.skynet.core.relation.order,
org.eclipse.osee.framework.skynet.core.revision,
org.eclipse.osee.framework.skynet.core.status,
org.eclipse.osee.framework.skynet.core.transaction,
diff --git a/org.eclipse.osee.framework.skynet.core/dbschemas/SKYNET.VERSIONING.SCHEMA.xml b/org.eclipse.osee.framework.skynet.core/dbschemas/SKYNET.VERSIONING.SCHEMA.xml index 901e5358678..9ced82679d6 100644 --- a/org.eclipse.osee.framework.skynet.core/dbschemas/SKYNET.VERSIONING.SCHEMA.xml +++ b/org.eclipse.osee.framework.skynet.core/dbschemas/SKYNET.VERSIONING.SCHEMA.xml @@ -252,6 +252,7 @@ <Column id="BA_PHRASING" defaultValue="not null" limits="50" type="VARCHAR" />
<Column id="SHORT_NAME" defaultValue="not null" limits="20" type="VARCHAR" />
<Column id="USER_ORDERED" defaultValue="not null" limits="5" type="VARCHAR" />
+ <Column id="DEFAULT_ORDER_TYPE_GUID" defaultValue="not null" limits="28" type="VARCHAR" />
<Constraint schema="OSEE" id="OSEE_REL_LINK_TYPE_RLT_PK" type="PRIMARY KEY" appliesTo="REL_LINK_TYPE_ID" />
</Table>
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java index 4539788e8fb..6df2cb0e12b 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java @@ -45,6 +45,7 @@ import org.eclipse.osee.framework.database.core.ConnectionHandler; import org.eclipse.osee.framework.database.core.DbTransaction;
import org.eclipse.osee.framework.database.core.OseeConnection;
import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.eclipse.osee.framework.jdk.core.util.HumanReadableId;
@@ -71,6 +72,8 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationLink; import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationType;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderBaseTypes;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderId;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionId;
import org.eclipse.osee.framework.skynet.core.transaction.TransactionIdManager;
@@ -182,6 +185,23 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro public List<Artifact> getRelatedArtifacts(IRelationEnumeration relationEnum, boolean includeDeleted) throws OseeCoreException {
return RelationManager.getRelatedArtifacts(this, relationEnum, includeDeleted);
}
+
+ public String getRelationRationale(Artifact artifact, IRelationEnumeration relationTypeSide) throws OseeCoreException{
+ Pair<Artifact, Artifact> sides = determineArtifactSides(artifact, relationTypeSide);
+ return RelationManager.getRelationRationale(sides.getFirst(), sides.getSecond(), relationTypeSide.getRelationType());
+ }
+
+ public void setRelationRationale(Artifact artifact, IRelationEnumeration relationTypeSide, String rationale) throws OseeCoreException{
+ Pair<Artifact, Artifact> sides = determineArtifactSides(artifact, relationTypeSide);
+ RelationManager.setRelationRationale(sides.getFirst(), sides.getSecond(), relationTypeSide.getRelationType(), rationale);
+ }
+
+ private Pair<Artifact, Artifact> determineArtifactSides(Artifact artifact, IRelationEnumeration relationSide){
+ boolean sideA = relationSide.isSideA();
+ Artifact artifactA = sideA ? artifact : this;
+ Artifact artifactB = sideA ? this : artifact;
+ return new Pair<Artifact, Artifact>(artifactA, artifactB);
+ }
/**
* Check if artifacts are related to each other by relation type
@@ -1199,45 +1219,9 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro return descendant;
}
- /**
- * Return relations that exist between artifacts
- *
- * @throws ArtifactDoesNotExist
- */
- @Deprecated
- public ArrayList<RelationLink> getRelations(Artifact artifact) throws OseeCoreException {
- ArrayList<RelationLink> relations = new ArrayList<RelationLink>();
- for (RelationLink relation : getRelationsAll(false)) {
- try {
- if (relation.getArtifactOnOtherSide(this).equals(artifact)) {
- relations.add(relation);
- }
- } catch (ArtifactDoesNotExist ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- }
- return relations;
- }
- /**
- * Return relations that exist between artifacts of type side
- *
- * @throws OseeCoreException
- */
- @Deprecated
- public ArrayList<RelationLink> getRelations(IRelationEnumeration side, Artifact artifact) throws OseeCoreException {
- ArrayList<RelationLink> relations = new ArrayList<RelationLink>();
- for (RelationLink relation : getRelations(side)) {
- try {
- if (relation.getArtifactOnOtherSide(this).equals(artifact)) {
- relations.add(relation);
- }
- } catch (ArtifactDoesNotExist ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- }
- return relations;
- }
+
+
/**
* Removes artifact from a specific branch
@@ -1277,10 +1261,8 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro }
public void addRelation(IRelationEnumeration relationSide, Artifact artifact, String rationale) throws OseeCoreException {
- boolean sideA = relationSide.isSideA();
- Artifact artifactA = sideA ? artifact : this;
- Artifact artifactB = sideA ? this : artifact;
- RelationManager.addRelation(relationSide.getRelationType(), artifactA, artifactB, rationale);
+ Pair<Artifact, Artifact> sides = determineArtifactSides(artifact, relationSide);
+ RelationManager.addRelation(relationSide.getRelationType(), sides.getFirst(), sides.getSecond(), rationale);
}
public void addRelation(IRelationEnumeration relationSide, Artifact artifact) throws OseeCoreException {
@@ -1298,35 +1280,46 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro RelationManager.addRelation(targetArtifactA, insertAfterATarget, targetArtifactB, insertAfterBTarget,
relationSide.getRelationType(), artifactA, artifactB, rationale);
+
+ setRelationOrder(targetArtifact, insertAfterTarget, relationSide, artifact);
}
+
+
+ public void setRelationOrder(IRelationEnumeration relationSide, RelationOrderId orderId) throws OseeCoreException {
+ List<Artifact> empty = java.util.Collections.emptyList();
+ RelationManager.setRelationOrder(this, relationSide.getRelationType(), relationSide.getSide(), orderId, empty);
+ }
+
public void setRelationOrder(IRelationEnumeration relationSide, List<Artifact> artifactsInNewOrder) throws OseeCoreException {
- if (artifactsInNewOrder.size() == 0) {
- return;
- }
- List<Artifact> currentOrder = getRelatedArtifacts(relationSide, Artifact.class);
- // Insert first artifact before first artifact in list
- Artifact previousArtifact = currentOrder.iterator().next();
- boolean firstArtifact = true;
- for (Artifact artifact : artifactsInNewOrder) {
- if (previousArtifact != artifact) {
- setRelationOrder(previousArtifact, !firstArtifact, relationSide, artifact);
- }
- firstArtifact = false;
- previousArtifact = artifact;
- }
+ RelationManager.setRelationOrder(this, relationSide.getRelationType(), relationSide.getSide(), RelationOrderBaseTypes.USER_DEFINED, artifactsInNewOrder);
}
public void setRelationOrder(Artifact targetArtifact, boolean insertAfterTarget, IRelationEnumeration relationSide, Artifact artifact) throws OseeCoreException {
- boolean sideA = relationSide.isSideA();
- Artifact artifactA = sideA ? artifact : this;
- Artifact artifactB = sideA ? this : artifact;
- Artifact targetArtifactA = sideA ? targetArtifact : null;
- Artifact targetArtifactB = sideA ? null : targetArtifact;
- boolean insertAfterATarget = sideA ? insertAfterTarget : true;
- boolean insertAfterBTarget = sideA ? true : insertAfterTarget;
- RelationManager.setRelationOrder(targetArtifactA, insertAfterATarget, targetArtifactB, insertAfterBTarget,
- relationSide.getRelationType(), artifactA, artifactB);
+ List<Artifact> currentOrder = getRelatedArtifacts(relationSide, Artifact.class);
+ boolean found = false;
+ int index = 0;
+ for(int i = 0; i < currentOrder.size(); i++){
+ if(currentOrder.get(i).equals(targetArtifact)){
+ index = i;
+ found = true;
+ break;
+ }
+ }
+ currentOrder.remove(artifact);
+ if(found){
+ if(insertAfterTarget){
+ index++;
+ }
+ if(index > currentOrder.size()){
+ currentOrder.add(artifact);
+ } else {
+ currentOrder.add(index, artifact);
+ }
+ } else {
+ currentOrder.add(artifact);
+ }
+ RelationManager.setRelationOrder(this, relationSide.getRelationType(), relationSide.getSide(), RelationOrderBaseTypes.USER_DEFINED, currentOrder);
}
/**
@@ -1345,10 +1338,8 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro }
public void deleteRelation(IRelationEnumeration relationSide, Artifact artifact) throws OseeCoreException {
- boolean sideA = relationSide.isSideA();
- Artifact artifactA = sideA ? artifact : this;
- Artifact artifactB = sideA ? this : artifact;
- RelationManager.deleteRelation(relationSide.getRelationType(), artifactA, artifactB);
+ Pair<Artifact, Artifact> sides = determineArtifactSides(artifact, relationSide);
+ RelationManager.deleteRelation(relationSide.getRelationType(), sides.getFirst(), sides.getSecond());
}
public void deleteRelations(IRelationEnumeration relationSide) throws OseeCoreException {
@@ -1418,6 +1409,7 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro public static boolean isUniqueHRID(String id) throws OseeDataStoreException {
String DUPLICATE_HRID_SEARCH = "SELECT COUNT(1) FROM osee_artifact t1 WHERE t1.human_readable_id = ?";
+
return ConnectionHandler.runPreparedQueryFetchInt(-1, DUPLICATE_HRID_SEARCH, id) == 0;
}
@@ -1721,17 +1713,59 @@ public class Artifact implements IAdaptable, Comparable<Artifact>, IAccessContro }
/**
+ * Return relations that exist between artifacts
+ *
+ * @throws ArtifactDoesNotExist
+ */
+ @Deprecated
+ public ArrayList<RelationLink> getRelations(Artifact artifact) throws OseeCoreException {
+ ArrayList<RelationLink> relations = new ArrayList<RelationLink>();
+ for (RelationLink relation : getRelationsAll(false)) {
+ try {
+ if (relation.getArtifactOnOtherSide(this).equals(artifact)) {
+ relations.add(relation);
+ }
+ } catch (ArtifactDoesNotExist ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+ return relations;
+ }
+
+ @Deprecated
+ public List<RelationLink> getRelations(IRelationEnumeration relationEnum) throws OseeCoreException {
+ return RelationManager.getRelations(this, relationEnum.getRelationType(), relationEnum.getSide());
+ }
+
+ /**
+ * Return relations that exist between artifacts of type side
+ *
+ * @throws OseeCoreException
+ */
+ @Deprecated
+ public ArrayList<RelationLink> getRelations(IRelationEnumeration side, Artifact artifact) throws OseeCoreException {
+ ArrayList<RelationLink> relations = new ArrayList<RelationLink>();
+ for (RelationLink relation : getRelations(side)) {
+ try {
+ if (relation.getArtifactOnOtherSide(this).equals(artifact)) {
+ relations.add(relation);
+ }
+ } catch (ArtifactDoesNotExist ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+ return relations;
+ }
+
+ /**
* @param relationType
* @return a list of relations from a specific relation type
*/
+ @Deprecated
public List<RelationLink> getRelations(RelationType relationType) {
return RelationManager.getRelations(this, relationType, null);
}
- public List<RelationLink> getRelations(IRelationEnumeration relationEnum) throws OseeCoreException {
- return RelationManager.getRelations(this, relationEnum.getRelationType(), relationEnum.getSide());
- }
-
public List<RelationLink> getRelationsAll(boolean includeDeleted) {
return RelationManager.getRelationsAll(this, includeDeleted);
}
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java index a3edf0ac235..ed5bd354205 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactLoader.java @@ -422,7 +422,6 @@ public final class ArtifactLoader { Map<Integer, RelationLink> sideA = new HashMap<Integer, RelationLink>();
for (Artifact artifact : artifacts) {
artifact.setLinksLoaded();
- RelationManager.sortRelations(artifact, sideA, sideB);
}
}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameComparator.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactNameComparator.java index 431bbcb0382..f883fdde2c3 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactNameComparator.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/ArtifactNameComparator.java @@ -1,17 +1,25 @@ /** * */ -package org.eclipse.osee.framework.ui.skynet.artifact; +package org.eclipse.osee.framework.skynet.core.artifact; import java.util.Comparator; import java.util.regex.Matcher; import java.util.regex.Pattern; -import org.eclipse.osee.framework.skynet.core.artifact.Artifact; public class ArtifactNameComparator implements Comparator<Artifact> { private static final Pattern numberPattern = Pattern.compile("[+-]?\\d+"); private final Matcher numberMatcher = numberPattern.matcher(""); - + private boolean descending = false; + + public ArtifactNameComparator(){ + + } + + public ArtifactNameComparator(boolean descending){ + this.descending = descending; + } + @Override public int compare(Artifact artifact1, Artifact artifact2) { String name1 = artifact1.getName(); @@ -21,9 +29,17 @@ public class ArtifactNameComparator implements Comparator<Artifact> { if (numberMatcher.matches()) { numberMatcher.reset(name2); if (numberMatcher.matches()) { - return Integer.valueOf(name1).compareTo(Integer.valueOf(name2)); + if(descending){ + return Integer.valueOf(name2).compareTo(Integer.valueOf(name1)); + } else { + return Integer.valueOf(name1).compareTo(Integer.valueOf(name2)); + } } } - return name1.compareTo(name2); + if(descending){ + return name2.compareTo(name1); + } else { + return name1.compareTo(name2); + } } }
\ No newline at end of file diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/RemoteEventManager.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/RemoteEventManager.java index a7400ee16d2..2e371f9aad5 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/RemoteEventManager.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/event/RemoteEventManager.java @@ -14,7 +14,6 @@ import java.rmi.RemoteException; import java.rmi.server.ExportException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
@@ -618,45 +617,45 @@ public class RemoteEventManager { // }
//TODO Maybe just send a link change refresh event
if (event instanceof NetworkRelationLinkOrderModifiedEvent) {
- RelationLink relation =
- RelationManager.getLoadedRelation(event.getRelId(), event.getArtAId(), event.getArtBId(),
- branch, branch);
- if (relation != null) {
- RelationEventType relationEventType = null;
- boolean aOrderChanged =
- ((NetworkRelationLinkOrderModifiedEvent) event).getAOrder() != relation.getAOrder();
- boolean bOrderChanged =
- ((NetworkRelationLinkOrderModifiedEvent) event).getBOrder() != relation.getBOrder();
- if (aOrderChanged) {
- relation.setAOrder(((NetworkRelationLinkOrderModifiedEvent) event).getAOrder());
- if (bArtifactLoaded) {
- RelationManager.sortRelations(bArtifact, relation.getRelationType(),
- new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
- }
- relationEventType = RelationEventType.ReOrdered;
- }
- if (bOrderChanged) {
- relation.setBOrder(((NetworkRelationLinkOrderModifiedEvent) event).getBOrder());
- if (aArtifactLoaded) {
- RelationManager.sortRelations(aArtifact, relation.getRelationType(),
- new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
- }
- relationEventType = RelationEventType.ReOrdered;
- }
- if (relation.getRationale().equals(((NetworkRelationLinkOrderModifiedEvent) event).getRationale())) {
- relation.setRationale(((NetworkRelationLinkOrderModifiedEvent) event).getRationale(), false);
- relationEventType = RelationEventType.RationaleMod;
- }
- if (relationEventType == null) {
- OseeLog.log(Activator.class, Level.SEVERE,
- "Link Modified Type Can Not Be Determined; Event Ignored. " + event);
- } else {
- relation.setNotDirty();
-
- xModifiedEvents.add(new RelationModifiedEvent(sender, relationEventType, relation,
- relation.getBranch(), relation.getRelationType().getTypeName()));
- }
- }
+// RelationLink relation =
+// RelationManager.getLoadedRelation(event.getRelId(), event.getArtAId(), event.getArtBId(),
+// branch, branch);
+// if (relation != null) {
+// RelationEventType relationEventType = null;
+// boolean aOrderChanged =
+// ((NetworkRelationLinkOrderModifiedEvent) event).getAOrder() != relation.getAOrder();
+// boolean bOrderChanged =
+// ((NetworkRelationLinkOrderModifiedEvent) event).getBOrder() != relation.getBOrder();
+// if (aOrderChanged) {
+// relation.setAOrder(((NetworkRelationLinkOrderModifiedEvent) event).getAOrder());
+// if (bArtifactLoaded) {
+// RelationManager.sortRelations(bArtifact, relation.getRelationType(),
+// new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
+// }
+// relationEventType = RelationEventType.ReOrdered;
+// }
+// if (bOrderChanged) {
+// relation.setBOrder(((NetworkRelationLinkOrderModifiedEvent) event).getBOrder());
+// if (aArtifactLoaded) {
+// RelationManager.sortRelations(aArtifact, relation.getRelationType(),
+// new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
+// }
+// relationEventType = RelationEventType.ReOrdered;
+// }
+// if (relation.getRationale().equals(((NetworkRelationLinkOrderModifiedEvent) event).getRationale())) {
+// relation.setRationale(((NetworkRelationLinkOrderModifiedEvent) event).getRationale(), false);
+// relationEventType = RelationEventType.RationaleMod;
+// }
+// if (relationEventType == null) {
+// OseeLog.log(Activator.class, Level.SEVERE,
+// "Link Modified Type Can Not Be Determined; Event Ignored. " + event);
+// } else {
+// relation.setNotDirty();
+//
+// xModifiedEvents.add(new RelationModifiedEvent(sender, relationEventType, relation,
+// relation.getBranch(), relation.getRelationType().getTypeName()));
+// }
+// }
} else if (event instanceof NetworkRelationLinkDeletedEvent) {
RelationLink relation =
RelationManager.getLoadedRelation(event.getRelId(), event.getArtAId(), event.getArtBId(),
@@ -681,14 +680,14 @@ public class RemoteEventManager { ((NetworkNewRelationLinkEvent) event).getBOrder(), ModificationType.NEW);
RelationManager.manageRelation(relation, RelationSide.SIDE_A);
RelationManager.manageRelation(relation, RelationSide.SIDE_B);
- if (bArtifactLoaded) {
- RelationManager.sortRelations(bArtifact, relation.getRelationType(),
- new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
- }
- if (aArtifactLoaded) {
- RelationManager.sortRelations(aArtifact, relation.getRelationType(),
- new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
- }
+// if (bArtifactLoaded) {
+// RelationManager.sortRelations(bArtifact, relation.getRelationType(),
+// new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
+// }
+// if (aArtifactLoaded) {
+// RelationManager.sortRelations(aArtifact, relation.getRelationType(),
+// new HashMap<Integer, RelationLink>(), new HashMap<Integer, RelationLink>());
+// }
xModifiedEvents.add(new RelationModifiedEvent(sender, RelationEventType.Added, relation,
relation.getBranch(), relation.getRelationType().getTypeName()));
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/DbOseeDataTypeProcessor.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/DbOseeDataTypeProcessor.java index 844270fc503..2609f80f084 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/DbOseeDataTypeProcessor.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/DbOseeDataTypeProcessor.java @@ -59,9 +59,9 @@ public class DbOseeDataTypeProcessor implements IOseeDataTypeProcessor { }
@Override
- public void onRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered) throws OseeCoreException {
+ public void onRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered, String defaultOrderIdGuid) throws OseeCoreException {
RelationTypeManager.createRelationType(namespace, relationTypeName, sideAName, sideBName, abPhrasing, baPhrasing,
- shortName, ordered);
+ shortName, ordered, defaultOrderIdGuid);
}
@Override
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/ExcelOseeTypeDataParser.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/ExcelOseeTypeDataParser.java index bd0811bb4fc..230b4dd5a4f 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/ExcelOseeTypeDataParser.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/ExcelOseeTypeDataParser.java @@ -28,6 +28,7 @@ import org.eclipse.osee.framework.jdk.core.type.Pair; import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelSaxHandler;
import org.eclipse.osee.framework.jdk.core.util.io.xml.RowProcessor;
import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderBaseTypes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
@@ -218,9 +219,17 @@ public class ExcelOseeTypeDataParser implements RowProcessor { String baPhrasing = row[4];
String shortName = row[5];
String ordered = row[6];
+ String defaultOrderTypeGuid = row[7];
+ if(defaultOrderTypeGuid == null){
+ if(ordered.equalsIgnoreCase("Yes")){
+ defaultOrderTypeGuid = RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC.getGuid();
+ } else {
+ defaultOrderTypeGuid = RelationOrderBaseTypes.UNORDERED.getGuid();
+ }
+ }
dataTypeProcessor.onRelationType("", relationTypeName, sideAName, sideBName, abPhrasing, baPhrasing, shortName,
- ordered);
+ ordered, defaultOrderTypeGuid);
}
private void addArtifactType(String[] row) throws Exception {
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/IOseeDataTypeProcessor.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/IOseeDataTypeProcessor.java index 6c09f60cab8..d21f9745f83 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/IOseeDataTypeProcessor.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/IOseeDataTypeProcessor.java @@ -22,7 +22,7 @@ public interface IOseeDataTypeProcessor { public void onArtifactType(String namespace, String artifactTypeName) throws OseeCoreException;
- public void onRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered) throws OseeCoreException;
+ public void onRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered, String defaultOrderTypeGuid) throws OseeCoreException;
public void onAttributeValidity(String attributeName, String artifactSuperTypeName, Collection<String> concreteTypes) throws OseeCoreException;
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java index 5f113c1e95c..fa3e76d98dd 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationLink.java @@ -135,22 +135,9 @@ public class RelationLink { private void internalDelete(boolean reorderRelations, boolean setDirty) {
if (!isDeleted()) {
- Artifact aArt = null;
- Artifact bArt = null;
- if (reorderRelations) {
- aArt = preloadArtifactForDelete(RelationSide.SIDE_A);
- bArt = preloadArtifactForDelete(RelationSide.SIDE_B);
- }
markAsDeleted(setDirty);
- if (aArt != null) {
- RelationManager.setOrderValues(aArt, getRelationType(), RelationSide.SIDE_B, setDirty);
- }
- if (bArt != null) {
- RelationManager.setOrderValues(bArt, getRelationType(), RelationSide.SIDE_A, setDirty);
- }
-
if (setDirty) {
try {
OseeEventManager.kickRelationModifiedEvent(RelationManager.class, RelationEventType.Deleted, this,
@@ -162,16 +149,6 @@ public class RelationLink { }
}
- private Artifact preloadArtifactForDelete(RelationSide side) {
- Artifact artifact = null;
- try {
- artifact = ArtifactQuery.getArtifactFromId(getArtifactId(side), getBranch(side), false);
- } catch (OseeCoreException ex) {
- OseeLog.log(RelationManager.class, Level.SEVERE, ex);
- }
- return artifact;
- }
-
public void markAsDeleted() {
markAsDeleted(SET_DIRTY);
}
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java index 9bf0b1099c2..e800dd2e0a7 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationManager.java @@ -14,12 +14,9 @@ import java.sql.Timestamp; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
@@ -32,6 +29,7 @@ import org.eclipse.osee.framework.core.exception.OseeDataStoreException; import org.eclipse.osee.framework.database.core.ConnectionHandler;
import org.eclipse.osee.framework.database.core.SQL3DataType;
import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap;
+import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.jdk.core.util.time.GlobalTime;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -44,6 +42,8 @@ import org.eclipse.osee.framework.skynet.core.artifact.ArtifactType; import org.eclipse.osee.framework.skynet.core.artifact.Branch;
import org.eclipse.osee.framework.skynet.core.event.OseeEventManager;
import org.eclipse.osee.framework.skynet.core.internal.Activator;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderId;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrdering;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
/**
@@ -51,11 +51,7 @@ import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction; */
public class RelationManager {
// the branch is accounted for because Artifact.equals includes the branch in the comparison
- private static final CompositeKeyHashMap<Artifact, RelationType, List<RelationLink>> relationsByType =
- new CompositeKeyHashMap<Artifact, RelationType, List<RelationLink>>(1024);
-
- private static final HashMap<Artifact, List<RelationLink>> artifactToRelations =
- new HashMap<Artifact, List<RelationLink>>(1024);
+ private static final CompositeKeyHashMap<Artifact, RelationType, List<RelationLink>> relationsByType = new CompositeKeyHashMap<Artifact, RelationType, List<RelationLink>>(1024);
private static final String[] DELETED =
new String[] {
@@ -65,8 +61,8 @@ public class RelationManager { private static final String GET_DELETED_ARTIFACT_B = DELETED[0] + "b_art_id" + DELETED[1] + "a_art_id" + DELETED[2];
private static final String GET_DELETED_ARTIFACT_A = DELETED[0] + "a_art_id" + DELETED[1] + "b_art_id" + DELETED[2];
- private static final int LINKED_LIST_KEY = -1;
-
+ private static RelationOrdering relationOrdering = new RelationOrdering();
+
private synchronized static RelationLink getLoadedRelation(Artifact artifact, int aArtifactId, int bArtifactId, RelationType relationType, boolean includeDeleted) {
List<RelationLink> selectedRelations = relationsByType.get(artifact, relationType);
Set<RelationLink> relations = new HashSet<RelationLink>();
@@ -158,10 +154,9 @@ public class RelationManager { ArtifactCache.getActive(relation.getArtifactId(relationSide), relation.getBranch(relationSide));
if (artifact != null) {
- List<RelationLink> artifactsRelations = artifactToRelations.get(artifact);
+ List<RelationLink> artifactsRelations = getFlattenedList(relationsByType.getValues(artifact));
if (artifactsRelations == null) {
artifactsRelations = new CopyOnWriteArrayList<RelationLink>();
- artifactToRelations.put(artifact, artifactsRelations);
}
if (artifactsRelations.contains(relation)) {
// Log error cause this should never happen; only one relation link object should be created
@@ -192,10 +187,24 @@ public class RelationManager { }
}
+ /**
+ * @param values
+ * @return
+ */
+ private static List<RelationLink> getFlattenedList(List<List<RelationLink>> values) {
+ List<RelationLink> links = new ArrayList<RelationLink>();
+ for(List<RelationLink> valueLinks :values){
+ for(RelationLink link:valueLinks){
+ links.add(link);
+ }
+ }
+ return links;
+ }
+
private synchronized static List<Artifact> getRelatedArtifacts(Artifact artifact, RelationType relationType, RelationSide relationSide) throws OseeCoreException {
List<RelationLink> selectedRelations = null;
if (relationType == null) {
- selectedRelations = artifactToRelations.get(artifact);
+ selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
} else {
selectedRelations = relationsByType.get(artifact, relationType);
}
@@ -232,9 +241,12 @@ public class RelationManager { }
}
}
+
+ relationOrdering.sort(artifact, relationType, relationSide, relatedArtifacts);
+
return relatedArtifacts;
}
-
+
private static void addRelatedArtifactIds(int queryId, Artifact artifact, Collection<Artifact> relatedArtifacts, CompositeKeyHashMap<Integer, Integer, Object[]> insertParameters, List<RelationLink> relations, RelationSide side) {
if (relations == null) {
return;
@@ -286,7 +298,7 @@ public class RelationManager { List<RelationLink> selectedRelations = null;
if (relationEnums.length == 0) {
- selectedRelations = artifactToRelations.get(artifact);
+ selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
addRelatedArtifactIds(queryId, artifact, newArtifacts, insertParameters, selectedRelations,
RelationSide.OPPOSITE);
} else {
@@ -306,6 +318,7 @@ public class RelationManager { newArtifactsToSearch.addAll(newArtifacts);
relatedArtifacts.addAll(newArtifacts);
}
+
return relatedArtifacts;
}
@@ -405,12 +418,11 @@ public class RelationManager { */
public synchronized static void prepareRelationsForReload(Artifact artifact) {
// weakness: references held to links by other applications will continue to exist.
- artifactToRelations.remove(artifact);
relationsByType.removeValues(artifact);
}
public synchronized static boolean hasDirtyLinks(Artifact artifact) {
- List<RelationLink> selectedRelations = artifactToRelations.get(artifact);
+ List<RelationLink> selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
if (selectedRelations == null) {
return false;
}
@@ -426,7 +438,7 @@ public class RelationManager { * Return what relation is dirty otherwise null
*/
public synchronized static String reportHasDirtyLinks(Artifact artifact) {
- List<RelationLink> selectedRelations = artifactToRelations.get(artifact);
+ List<RelationLink> selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
if (selectedRelations != null) {
for (RelationLink relation : selectedRelations) {
if (relation.isDirty()) {
@@ -450,7 +462,7 @@ public class RelationManager { public synchronized static void persistRelationsFor(SkynetTransaction transaction, Artifact artifact, RelationType relationType) throws OseeCoreException {
List<RelationLink> selectedRelations;
if (relationType == null) {
- selectedRelations = artifactToRelations.get(artifact);
+ selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
} else {
selectedRelations = relationsByType.get(artifact, relationType);
}
@@ -488,7 +500,7 @@ public class RelationManager { }
public synchronized static List<RelationLink> getRelationsAll(Artifact artifact, boolean includeDeleted) {
- List<RelationLink> selectedRelations = artifactToRelations.get(artifact);
+ List<RelationLink> selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
if (selectedRelations == null) {
return Collections.emptyList();
@@ -543,8 +555,6 @@ public class RelationManager { relation = new RelationLink(artifactA, artifactB, relationType, rationale, ModificationType.NEW);
relation.setDirty();
- setDefaultRelationOrder(relation, artifactA, artifactB);
-
RelationManager.manageRelation(relation, RelationSide.SIDE_A);
RelationManager.manageRelation(relation, RelationSide.SIDE_B);
@@ -594,21 +604,34 @@ public class RelationManager { }
}
- public static void deleteRelation(RelationType relationType, Artifact artifactA, Artifact artifactB) throws ArtifactDoesNotExist, OseeArgumentException {
+ public static void deleteRelation(RelationType relationType, Artifact artifactA, Artifact artifactB) throws OseeCoreException {
RelationLink relation = getLoadedRelation(artifactA, artifactA.getArtId(), artifactB.getArtId(), relationType);
relation.delete(true);
+
+ updateOrderListOnDelete(artifactA, relationType,RelationSide.SIDE_B, getRelatedArtifacts(artifactA, relationType, RelationSide.SIDE_B));
+ updateOrderListOnDelete(artifactB, relationType,RelationSide.SIDE_A, getRelatedArtifacts(artifactB, relationType, RelationSide.SIDE_A));
}
- public synchronized static void deleteRelationsAll(Artifact artifact, boolean reorderRelations) throws ArtifactDoesNotExist {
- List<RelationLink> selectedRelations = artifactToRelations.get(artifact);
+ public synchronized static void deleteRelationsAll(Artifact artifact, boolean reorderRelations) throws OseeCoreException {
+ List<RelationLink> selectedRelations = getFlattenedList(relationsByType.getValues(artifact));
+ Set<Pair<RelationType, RelationSide>> typesToUpdate = new HashSet<Pair<RelationType, RelationSide>>();
if (selectedRelations != null) {
for (RelationLink relation : selectedRelations) {
+ typesToUpdate.add(new Pair<RelationType, RelationSide>(relation.getRelationType(),relation.getSide(artifact).oppositeSide()));
relation.delete(reorderRelations);
}
}
+
+ for(Pair<RelationType, RelationSide> type:typesToUpdate){
+ updateOrderListOnDelete(artifact, type.getFirst(),type.getSecond(), getRelatedArtifacts(artifact, type.getFirst(), type.getSecond()));
+ }
+ }
+
+ private static void updateOrderListOnDelete(Artifact artifact, RelationType relationType, RelationSide relationSide,List<Artifact> relatives) throws OseeCoreException{
+ relationOrdering.updateOrderOnRelationDelete(artifact, relationType, relationSide,relatives);
}
- public synchronized static void deleteRelations(Artifact artifact, RelationType relationType, RelationSide relationSide) throws ArtifactDoesNotExist {
+ public synchronized static void deleteRelations(Artifact artifact, RelationType relationType, RelationSide relationSide) throws OseeCoreException {
List<RelationLink> selectedRelations = relationsByType.get(artifact, relationType);
if (selectedRelations != null) {
for (RelationLink relation : selectedRelations) {
@@ -621,8 +644,10 @@ public class RelationManager { }
}
}
+
+ updateOrderListOnDelete(artifact, relationType,relationSide, getRelatedArtifacts(artifact, relationType, relationSide));
}
-
+
/**
* This method should only be called for unordered Relation Types. It does not handle reordering relation types that
* maintain order.
@@ -653,7 +678,7 @@ public class RelationManager { * @throws OseeDataStoreException
*/
public synchronized static void purgeRelationsFor(Artifact artifact) throws OseeDataStoreException {
- Collection<RelationLink> links = artifactToRelations.get(artifact);
+ Collection<RelationLink> links = getFlattenedList(relationsByType.getValues(artifact));
if (!links.isEmpty()) {
List<Object[]> batchArgs = new ArrayList<Object[]>(links.size());
String PURGE_RELATION = "delete from osee_relation_link WHERE rel_link_id = ?";
@@ -684,208 +709,46 @@ public class RelationManager { relation = new RelationLink(artifactA, artifactB, relationType, rationale, ModificationType.NEW);
relation.setDirty();
- setDefaultRelationOrder(relation, artifactA, artifactB);
-
RelationManager.manageRelation(relation, RelationSide.SIDE_A);
RelationManager.manageRelation(relation, RelationSide.SIDE_B);
-
- setRelationOrdering(RelationSide.SIDE_B, relation, artifactBTarget, insertAfterBTarget, artifactA, artifactA,
- artifactBTarget);
- setRelationOrdering(RelationSide.SIDE_A, relation, artifactATarget, insertAfterATarget, artifactB,
- artifactATarget, artifactB);
}
OseeEventManager.kickRelationModifiedEvent(RelationManager.class, RelationEventType.Added, relation,
relation.getBranch(), relation.getRelationType().getTypeName());
-
- }
-
- private static void setDefaultRelationOrder(RelationLink relation, Artifact artifactA, Artifact artifactB) {
- if (relation.getRelationType().isOrdered()) {
- List<RelationLink> selectedRelations =
- getRelations(artifactA, relation.getRelationType(), RelationSide.SIDE_B);
- if (selectedRelations != null && selectedRelations.size() > 0) {
- relation.setOrder(RelationSide.SIDE_B, selectedRelations.get(selectedRelations.size() - 1).getArtifactId(
- RelationSide.SIDE_B));
- } else {
- relation.setOrder(RelationSide.SIDE_B, -1);
- }
- selectedRelations = getRelations(artifactB, relation.getRelationType(), RelationSide.SIDE_A);
- if (selectedRelations != null && selectedRelations.size() > 0) {
- relation.setOrder(RelationSide.SIDE_A, selectedRelations.get(selectedRelations.size() - 1).getArtifactId(
- RelationSide.SIDE_A));
- } else {
- relation.setOrder(RelationSide.SIDE_A, -1);
- }
- }
- }
-
- private synchronized static void setRelationOrdering(RelationSide side, RelationLink relation, Artifact targetArtifact, boolean insertAfterTarget, Artifact sourceArtifact, Artifact artA, Artifact artB) throws OseeCoreException {
- if (relation.getRelationType().isOrdered() && targetArtifact != null) {
-
- RelationLink targetRelation =
- getLoadedRelation(sourceArtifact, artA.getArtId(), artB.getArtId(), relation.getRelationType());
-
- List<RelationLink> selectedRelations = relationsByType.get(sourceArtifact, relation.getRelationType());
- if (selectedRelations.remove(relation)) {
- int targetIndex = selectedRelations.indexOf(targetRelation);
- if (targetIndex == -1) {
- selectedRelations.add(relation);
- } else {
- int index = insertAfterTarget ? targetIndex + 1 : targetIndex;
- selectedRelations.add(index, relation);
- }
- int lastArtId = LINKED_LIST_KEY;
- for (RelationLink link : selectedRelations) {
- if (!link.isDeleted() && link.getSide(sourceArtifact) == side.oppositeSide()) {
- if (link.getOrder(side) != lastArtId) {
- link.setOrder(side, lastArtId);
- }
- lastArtId = link.getArtifactId(side);
- }
- }
- }
- }
}
/**
- * @param targetArtifact
- * @param insertAfterTarget
+ * @param artifact
* @param relationType
- * @param artifactA
- * @param artifactB
- * @throws OseeCoreException
+ * @param currentOrder
+ * @throws OseeCoreException
*/
- public static void setRelationOrder(Artifact artifactATarget, boolean insertAfterATarget, Artifact artifactBTarget, boolean insertAfterBTarget, RelationType relationType, Artifact artifactA, Artifact artifactB) throws OseeCoreException {
-
- RelationLink relation = getLoadedRelation(artifactA, artifactA.getArtId(), artifactB.getArtId(), relationType);
-
- setRelationOrdering(RelationSide.SIDE_B, relation, artifactBTarget, insertAfterBTarget, artifactA, artifactA,
- artifactBTarget);
- setRelationOrdering(RelationSide.SIDE_A, relation, artifactATarget, insertAfterATarget, artifactB,
- artifactATarget, artifactB);
-
- try {
- OseeEventManager.kickRelationModifiedEvent(RelationManager.class, RelationEventType.ReOrdered, relation,
- relation.getABranch(), relationType.getTypeName());
- } catch (Exception ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
+ public static void setRelationOrder(Artifact artifact, RelationType relationType, RelationSide side, RelationOrderId orderId, List<Artifact> relatives) throws OseeCoreException {
+ relationOrdering.setOrder(artifact, relationType, side, orderId, relatives);
}
- /**
- * @param artifact
- */
- public static void sortRelations(Artifact artifact, Map<Integer, RelationLink> sideA, Map<Integer, RelationLink> sideB) {
- List<RelationType> types = RelationTypeManager.getValidTypes(artifact.getArtifactType(), artifact.getBranch());
- for (RelationType type : types) {
- sortRelations(artifact, type, sideA, sideB);
- }
- }
-
- public synchronized static void sortRelations(Artifact artifact, RelationType type, Map<Integer, RelationLink> sideA, Map<Integer, RelationLink> sideB) {
- if (type.isOrdered()) {
- List<RelationLink> relations = relationsByType.get(artifact, type);
- if (relations != null) {
- sideA.clear();
- sideB.clear();
- boolean badValues = false;
- for (RelationLink relation : relations) {
- if (!relation.isDeleted()) {
- if (relation.getSide(artifact) == RelationSide.SIDE_A) {
- if (sideB.put(relation.getOrder(RelationSide.SIDE_B), relation) != null) {
- badValues = true;
- }
- } else {
- if (sideA.put(relation.getOrder(RelationSide.SIDE_A), relation) != null) {
- badValues = true;
- }
- }
- }
- }
- if (!badValues) {
- relations.clear();
-
- //do side b first
- RelationLink relation = sideB.remove(LINKED_LIST_KEY);
- while (relation != null) {
- relations.add(relation);
- RelationLink newRelation = sideB.get(relation.getArtifactId(RelationSide.SIDE_B));
- sideB.remove(relation.getArtifactId(RelationSide.SIDE_B));
- relation = newRelation;
- }
- if (sideB.values().size() > 0) {
- OseeLog.log(
- RelationManager.class,
- Level.FINE,
- String.format(
- "Artifact artId[%d] - %s - is unsorted for relations type - relTypeId[%d] - %s - . (missing a relation)",
- artifact.getArtId(), artifact.toString(), type.getRelationTypeId(), type.toString()));
- }
- relations.addAll(sideB.values());
- //now side a
- relation = sideA.remove(LINKED_LIST_KEY);
- while (relation != null) {
- relations.add(relation);
- relation = sideA.remove(relation.getArtifactId(RelationSide.SIDE_A));
- }
- if (sideA.values().size() > 0) {
- OseeLog.log(
- RelationManager.class,
- Level.FINE,
- String.format(
- "Artifact artId[%d] - %s - is unsorted for relations type - relTypeId[%d] - %s - . (missing a relation)",
- artifact.getArtId(), artifact.toString(), type.getRelationTypeId(), type.toString()));
- }
- relations.addAll(sideA.values());
- } else {
- OseeLog.log(
- RelationManager.class,
- Level.INFO,
- String.format(
- "Artifact \"%s\" - guid[%s] is unsorted for relations type %s - # of relations in mem - %d - . (duplicate relation)",
- artifact.toString(), artifact.getGuid(), type.getTypeName(), relations.size()));
- }
- }
- }
+ public static void setRelationRationale(Artifact artifactA, Artifact artifactB, RelationType relationType, String rationale) throws OseeCoreException{
+ RelationLink relation = getRelationLink(artifactA, artifactB, relationType);
+ relation.setRationale(rationale, true);
}
-
- public static synchronized void sortRelatedArtifacts(Artifact sourceArtifact, IRelationEnumeration relationEnum, Comparator<Artifact> artifactComparator) throws OseeCoreException {
- List<Artifact> otherArtifacts = RelationManager.getRelatedArtifacts(sourceArtifact, relationEnum);
- Collections.sort(otherArtifacts, artifactComparator);
- List<RelationLink> selectedRelations = relationsByType.get(sourceArtifact, relationEnum.getRelationType());
- if (selectedRelations == null) {
- return;
- }
-
- int lastArtId = LINKED_LIST_KEY;
- for (Artifact artifact : otherArtifacts) {
- for (RelationLink relation : selectedRelations) {
- if (relation.getArtifact(relationEnum.getSide()).equals(artifact)) {
- relation.setOrder(relationEnum.getSide(), lastArtId);
- break;
- }
- }
- lastArtId = artifact.getArtId();
- }
+
+ public static String getRelationRationale(Artifact artifactA, Artifact artifactB, RelationType relationType) throws OseeCoreException{
+ RelationLink relation = getRelationLink(artifactA, artifactB, relationType);
+ return relation.getRationale();
}
-
- static synchronized void setOrderValues(Artifact sourceArtifact, RelationType relationType, RelationSide side, boolean markAsNotDirty) {
- if (relationType.isOrdered()) {
- List<RelationLink> selectedRelations = relationsByType.get(sourceArtifact, relationType);
- if (selectedRelations == null) {
- return;
- }
- int lastArtId = LINKED_LIST_KEY;
- for (RelationLink link : selectedRelations) {
- if (!link.isDeleted() && link.getSide(sourceArtifact) == side.oppositeSide()) {
- link.setOrder(side, lastArtId);
- if (markAsNotDirty) {
- link.setNotDirty();
- }
- lastArtId = link.getArtifactId(side);
- }
+
+ private static RelationLink getRelationLink(Artifact artifactA, Artifact artifactB, RelationType relationType) throws OseeCoreException{
+ List<RelationLink> relationLinks = relationsByType.get(artifactA, relationType);
+ for(RelationLink relation:relationLinks){
+ if(relation.getArtifactB().equals(artifactB)){
+ return relation;
}
}
+ throw new OseeCoreException(String.format("Unable to find a relation link for type[%s] artA[%s] artB[%s]", relationType.getTypeName(), artifactA.getName(), artifactB.getName()));
+ }
+
+ public static List<RelationOrderId> getRelationOrderTypes(){
+ return relationOrdering.getRegisteredRelationOrderIds();
}
+
}
\ No newline at end of file diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationType.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationType.java index f347a4cbf32..fa03cae967d 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationType.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationType.java @@ -25,8 +25,9 @@ public class RelationType implements Comparable<RelationType> { private final String bToAPhrasing; private final String shortName; private final String ordered; + private final String defaultOrderTypeGuid; - public RelationType(int linkTypeId, String namespace, String typeName, String sideAName, String sideBName, String aToBPhrasing, String bToAPhrasing, String shortName, String ordered) { + public RelationType(int linkTypeId, String namespace, String typeName, String sideAName, String sideBName, String aToBPhrasing, String bToAPhrasing, String shortName, String ordered, String defaultOrderTypeGuid) { super(); this.relationTypeId = linkTypeId; this.namespace = namespace == null ? "" : namespace; @@ -37,6 +38,7 @@ public class RelationType implements Comparable<RelationType> { this.bToAPhrasing = bToAPhrasing; this.shortName = shortName; this.ordered = ordered; + this.defaultOrderTypeGuid = defaultOrderTypeGuid; } /** @@ -126,4 +128,8 @@ public class RelationType implements Comparable<RelationType> { public boolean isOrdered() { return ordered.equalsIgnoreCase("Yes"); } + + public String getDefaultOrderTypeGuid(){ + return defaultOrderTypeGuid; + } }
\ No newline at end of file diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java index 8b6c3d442c2..6b75ff54660 100644 --- a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/RelationTypeManager.java @@ -38,7 +38,7 @@ import org.eclipse.osee.framework.skynet.core.internal.Activator; public class RelationTypeManager {
private static final String SELECT_LINK_TYPES = "SELECT * FROM osee_relation_link_type";
private static final String INSERT_RELATION_LINK_TYPE =
- "INSERT INTO osee_relation_link_type (rel_link_type_id, namespace, type_name, a_name, b_name, ab_phrasing, ba_phrasing, short_name, user_ordered) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
+ "INSERT INTO osee_relation_link_type (rel_link_type_id, namespace, type_name, a_name, b_name, ab_phrasing, ba_phrasing, short_name, user_ordered, default_order_type_guid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
private static final String INSERT_VALID_RELATION =
"INSERT INTO osee_valid_relations (art_type_id, rel_link_type_id, side_a_max, side_b_max, branch_id) VALUES (?, ?, ?, ?, ?)";
@@ -148,7 +148,7 @@ public class RelationTypeManager { new RelationType(chStmt.getInt("rel_link_type_id"), chStmt.getString("namespace"),
chStmt.getString("type_name"), chStmt.getString("a_name"), chStmt.getString("b_name"),
chStmt.getString("ab_phrasing"), chStmt.getString("ba_phrasing"),
- chStmt.getString("short_name"), chStmt.getString("user_ordered"));
+ chStmt.getString("short_name"), chStmt.getString("user_ordered"), chStmt.getString("default_order_type_guid"));
cache(relationType);
}
loadLinkValidities();
@@ -197,7 +197,7 @@ public class RelationTypeManager { * @param shortName An abbreviated name to display for the link type.
* @throws OseeCoreException
*/
- public static RelationType createRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered) throws OseeCoreException {
+ public static RelationType createRelationType(String namespace, String relationTypeName, String sideAName, String sideBName, String abPhrasing, String baPhrasing, String shortName, String ordered, String orderTypeGuid) throws OseeCoreException {
if (typeExists(namespace, relationTypeName)) {
return getType(namespace, relationTypeName);
}
@@ -223,11 +223,11 @@ public class RelationTypeManager { int relationTypeId = SequenceManager.getNextRelationTypeId();
ConnectionHandler.runPreparedUpdate(INSERT_RELATION_LINK_TYPE, relationTypeId, namespace, relationTypeName,
- sideAName, sideBName, abPhrasing, baPhrasing, shortName, ordered);
+ sideAName, sideBName, abPhrasing, baPhrasing, shortName, ordered, orderTypeGuid);
RelationType relationType =
new RelationType(relationTypeId, namespace, relationTypeName, sideAName, sideBName, abPhrasing, baPhrasing,
- shortName, ordered);
+ shortName, ordered, orderTypeGuid);
instance.cache(relationType);
return relationType;
}
diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Lexicographical.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Lexicographical.java new file mode 100644 index 00000000000..576ce838afc --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Lexicographical.java @@ -0,0 +1,62 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.Collections; +import java.util.List; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.ArtifactNameComparator; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author Andrew M. Finkbeiner + */ +class Lexicographical implements RelationOrder { + + private ArtifactNameComparator comparator; + private RelationOrderId id; + + Lexicographical(boolean descending, RelationOrderId id) { + comparator = new ArtifactNameComparator(descending); + this.id = id; + } + + @Override + public void sort(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) { + Collections.sort(relatives, comparator); + } + + @Override + public RelationOrderId getOrderId() { + return id; + } + + @Override + public void setOrder(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + String value = artifact.getOrInitializeSoleAttributeValue("Relation Order"); + RelationOrderXmlProcessor relationOrderXmlProcessor = new RelationOrderXmlProcessor(value); + String guid = relationOrderXmlProcessor.findRelationOrderGuid(type.getTypeName(), side); + boolean isTypeToSetDefault = type.getDefaultOrderTypeGuid().equals(getOrderId().getGuid()); + if(guid == null && isTypeToSetDefault){//nothing has been saved for this type/side pair and it's the default + return; + } else if(guid != null && guid.equals(getOrderId().getGuid())){//already saved as this type + return; + } else if(guid != null && isTypeToSetDefault){//going back to the default type + relationOrderXmlProcessor.removeOrder(type.getTypeName(), getOrderId(), side); + } + List<String> list = Collections.emptyList(); + if(!isTypeToSetDefault){ + relationOrderXmlProcessor.putOrderList(type.getTypeName(), getOrderId(), side, list); + } + if(relationOrderXmlProcessor.hasEntries()){ + artifact.setSoleAttributeFromString("Relation Order", relationOrderXmlProcessor.getAsXmlString()); + } else if (value != null && value.length() > 0){ + artifact.deleteAttribute("Relation Order", value); + } + } +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrder.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrder.java new file mode 100644 index 00000000000..b112959184d --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrder.java @@ -0,0 +1,23 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.List; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author Andrew M. Finkbeiner + * + */ +public interface RelationOrder { + + RelationOrderId getOrderId(); + void setOrder(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException; + void sort(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException; +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderBaseTypes.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderBaseTypes.java new file mode 100644 index 00000000000..83d74545dc1 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderBaseTypes.java @@ -0,0 +1,36 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +/** + * @author Andrew M. Finkbeiner + * + */ +public enum RelationOrderBaseTypes implements RelationOrderId{ + + USER_DEFINED("AAT0xogoMjMBhARkBZQA", "User Defined"), + LEXICOGRAPHICAL_ASC("AAT1QW4eVE+YuzsoHFAA", "Lexicographical Ascending"), + LEXICOGRAPHICAL_DESC("AAmATn6R9m7VCXQQwuQA", "Lexicographical Descending"), + UNORDERED("AAT1uKZpeDQExlygoIAA", "Unordered"); + + private String guid; + private String prettyName; + + RelationOrderBaseTypes(String guid, String prettyName){ + this.guid = guid; + this.prettyName = prettyName; + } + + @Override + public String getGuid() { + return guid; + } + + @Override + public String prettyName(){ + return prettyName; + } +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderId.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderId.java new file mode 100644 index 00000000000..9dfa75c40cd --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderId.java @@ -0,0 +1,15 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +/** + * @author Andrew M. Finkbeiner + * + */ +public interface RelationOrderId { + String getGuid(); + String prettyName(); +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderIdComparator.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderIdComparator.java new file mode 100644 index 00000000000..4540cc132c8 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderIdComparator.java @@ -0,0 +1,21 @@ +/* + * Created on Aug 20, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.Comparator; + +/** + * @author Andrew M. Finkbeiner + * + */ +public class RelationOrderIdComparator implements Comparator<RelationOrderId> { + + @Override + public int compare(RelationOrderId o1, RelationOrderId o2) { + return o1.prettyName().compareToIgnoreCase(o2.prettyName()); + } + +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderXmlProcessor.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderXmlProcessor.java new file mode 100644 index 00000000000..be750769f42 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrderXmlProcessor.java @@ -0,0 +1,156 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.io.IOException; +import java.io.StringReader; +import java.util.Arrays; +import java.util.List; +import java.util.Map.Entry; +import org.eclipse.osee.framework.core.exception.OseeWrappedException; +import org.eclipse.osee.framework.jdk.core.type.CompositeKeyHashMap; +import org.eclipse.osee.framework.jdk.core.type.Pair; +import org.eclipse.osee.framework.jdk.core.util.io.xml.AbstractSaxHandler; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.xml.sax.Attributes; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.XMLReaderFactory; + +/** + * @author Andrew M. Finkbeiner + */ +class RelationOrderXmlProcessor { + + private static final Object ROOT_ELEMENT = "OrderList"; + + private final CompositeKeyHashMap<String, String, Pair<String, List<String>>> lists; + + public RelationOrderXmlProcessor(String value) throws OseeWrappedException { + lists = new CompositeKeyHashMap<String, String, Pair<String, List<String>>>(); + try { + if (value.trim().length() > 0) { + parseXml(value); + } + } catch (SAXException ex) { + throw new OseeWrappedException(ex); + } catch (IOException ex) { + throw new OseeWrappedException(ex); + } + } + + private void parseXml(String value) throws SAXException, IOException { + XMLReader xmlReader = XMLReaderFactory.createXMLReader(); + RelationOrderSaxHandlerLite handler = new RelationOrderSaxHandlerLite(); + xmlReader.setContentHandler(handler); + xmlReader.parse(new InputSource(new StringReader(value))); + } + + public String findRelationOrderGuid(String typeName, RelationSide side) { + Pair<String, List<String>> pair = lists.get(typeName, side.name()); + if (pair != null) { + return pair.getFirst(); + } + return null; + } + + public List<String> findOrderList(String typeName, RelationSide side, String orderTypeGuid) { + Pair<String, List<String>> pair = lists.get(typeName, side.name()); + if (pair != null) { + return pair.getSecond(); + } + return null; + } + + public String getAsXmlString() { + StringBuilder sb = new StringBuilder(); + openRoot(sb); + for (Entry<Pair<String, String>, Pair<String, List<String>>> entry : lists.entrySet()) { + writeEntry(sb, entry); + sb.append("\n"); + } + closeRoot(sb); + return sb.toString(); + } + + private void writeEntry(StringBuilder sb, Entry<Pair<String, String>, Pair<String, List<String>>> entry) { + Pair<String, String> key = entry.getKey(); + sb.append("<"); + sb.append("Order "); + sb.append("relType=\""); + sb.append(key.getFirst()); + sb.append("\" side=\""); + sb.append(key.getSecond()); + sb.append("\" orderType=\""); + + Pair<String, List<String>> value = entry.getValue(); + sb.append(value.getFirst()); + List<String> guids = value.getSecond(); + if (guids != null) { + if (guids.size() > 0) { + sb.append("\" list=\""); + } + for (int i = 0; i < guids.size(); i++) { + sb.append(guids.get(i)); + if ((i + 1) < guids.size()) { + sb.append(","); + } + } + } + sb.append("\""); + sb.append("/>"); + } + + private void openRoot(StringBuilder sb) { + sb.append("<"); + sb.append(ROOT_ELEMENT); + sb.append(">\n"); + } + + private void closeRoot(StringBuilder sb) { + sb.append("</"); + sb.append(ROOT_ELEMENT); + sb.append(">"); + } + + public void putOrderList(String typeName, RelationOrderId orderId, RelationSide side, List<String> guidList) { + lists.put(typeName, side.name(), new Pair<String, List<String>>(orderId.getGuid(), guidList)); + } + + public void removeOrder(String typeName, RelationOrderId orderId, RelationSide side) { + lists.remove(typeName, side.name()); + } + + public boolean hasEntries() { + return lists.size() > 0; + } + + private class RelationOrderSaxHandlerLite extends AbstractSaxHandler { + + @Override + public void endElementFound(String uri, String localName, String qName) throws SAXException { + } + + @Override + public void startElementFound(String uri, String localName, String qName, Attributes attributes) throws SAXException { + if ("Order".equals(localName)) { + String relationType = attributes.getValue("relType"); + String relationSide = attributes.getValue("side"); + String orderType = attributes.getValue("orderType"); + String list = attributes.getValue("list"); + if (relationType != null && orderType != null && relationSide != null) { + List<String> guidsList = null; + if (list != null) { + String[] guids = list.split(","); + guidsList = Arrays.asList(guids); + } + lists.put(relationType, relationSide, new Pair<String, List<String>>(orderType, guidsList)); + } + } + } + } +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrdering.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrdering.java new file mode 100644 index 00000000000..d5f76f97172 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/RelationOrdering.java @@ -0,0 +1,96 @@ +/* + * Created on Aug 11, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.Attribute; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author Andrew M. Finkbeiner + */ +public class RelationOrdering { + + private final Map<String, RelationOrder> orderMap; + + public RelationOrdering() { + orderMap = new ConcurrentHashMap<String, RelationOrder>(); + registerOrderType(new Lexicographical(false, RelationOrderBaseTypes.LEXICOGRAPHICAL_ASC)); + registerOrderType(new Lexicographical(true, RelationOrderBaseTypes.LEXICOGRAPHICAL_DESC)); + registerOrderType(new Unordered()); + registerOrderType(new UserDefinedOrder()); + } + + public void registerOrderType(RelationOrder order) { + orderMap.put(order.getOrderId().getGuid(), order); + } + + public void sort(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + String orderGuid = getOrderGuid(artifact, type, side); + RelationOrder order = getRelationOrder(orderGuid); + if(order == null){ + return; + } + order.sort(artifact, type, side, relatives); + } + + private RelationOrder getRelationOrder(String orderGuid) throws OseeCoreException { + RelationOrder order = orderMap.get(orderGuid); + if (order == null && !orderGuid.contains("debug")) { + throw new OseeCoreException(String.format("Unable to locate RelationOrder for guid[%s].", orderGuid)); + } + return order; + } + + private String getOrderGuid(Artifact artifact, RelationType type, RelationSide side) throws OseeCoreException { + Attribute<String> attribute = artifact.getSoleAttribute("Relation Order"); + if (attribute != null) { + RelationOrderXmlProcessor relationOrderXmlProcessor = new RelationOrderXmlProcessor(attribute.getValue()); + String relationOrderGuid = relationOrderXmlProcessor.findRelationOrderGuid(type.getTypeName(), side); + if (relationOrderGuid != null) { + return relationOrderGuid; + } + } + return type.getDefaultOrderTypeGuid(); + } + + public void setOrder(Artifact artifact, RelationType type, RelationSide side, RelationOrderId orderId, List<Artifact> relatives) throws OseeCoreException { + RelationOrder order = getRelationOrder(orderId.getGuid()); + order.setOrder(artifact, type, side, relatives); + } + + public void updateOrderOnRelationDelete(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + Attribute<String> attribute = artifact.getSoleAttribute("Relation Order"); + if (attribute != null) { + RelationOrderXmlProcessor relationOrderXmlProcessor = new RelationOrderXmlProcessor(attribute.getValue()); + String relationOrderGuid = relationOrderXmlProcessor.findRelationOrderGuid(type.getTypeName(), side); + if (relationOrderGuid != null) { + RelationOrder order = getRelationOrder(relationOrderGuid); + if(order != null){ + order.setOrder(artifact, type, side, relatives); + } + } + } + } + + public List<RelationOrderId> getRegisteredRelationOrderIds() { + Collection<RelationOrder> relationOrder = orderMap.values(); + List<RelationOrderId> ids = new ArrayList<RelationOrderId>(); + for(RelationOrder order:relationOrder){ + ids.add(order.getOrderId()); + } + Collections.sort(ids, new RelationOrderIdComparator()); + return ids; + } +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Unordered.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Unordered.java new file mode 100644 index 00000000000..785e5486fd3 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/Unordered.java @@ -0,0 +1,41 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.Collections; +import java.util.List; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author Andrew M. Finkbeiner + * + */ +class Unordered implements RelationOrder { + + @Override + public void sort(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) { + } + + @Override + public RelationOrderId getOrderId() { + return RelationOrderBaseTypes.UNORDERED; + } + + @Override + public void setOrder(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + if (!type.getDefaultOrderTypeGuid().equals(getOrderId().getGuid())) { + String value = artifact.getOrInitializeSoleAttributeValue("Relation Order"); + RelationOrderXmlProcessor relationOrderXmlProcessor = new RelationOrderXmlProcessor(value); + List<String> list = Collections.emptyList(); + relationOrderXmlProcessor.putOrderList(type.getTypeName(), getOrderId(), side, list); + artifact.setSoleAttributeFromString("Relation Order", relationOrderXmlProcessor.getAsXmlString()); + } + } + +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrder.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrder.java new file mode 100644 index 00000000000..6b21ea8f405 --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrder.java @@ -0,0 +1,68 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.artifact.Attribute; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author Andrew M. Finkbeiner + * + */ +class UserDefinedOrder implements RelationOrder{ + + @Override + public void sort(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + if(relatives != null && relatives.size() > 1){ + Attribute<String> attribute = artifact.getSoleAttribute("Relation Order"); + if(attribute != null){ + RelationOrderXmlProcessor relationOrderXmlProcessor= new RelationOrderXmlProcessor(attribute.getValue()); + String relationOrderGuid = relationOrderXmlProcessor.findRelationOrderGuid(type.getTypeName(), side); + if(relationOrderGuid != null){ + List<String> list = relationOrderXmlProcessor.findOrderList(type.getTypeName(), side, relationOrderGuid); + if(list != null){ + orderRelatives(relatives, list); + } else { + throw new OseeCoreException(String.format("Unable to find an order list for UserDefinedOrder artifact[%s] RelationType[%s] RelationSide[%s]", artifact.getGuid(), type.getTypeName(), side.name())); + } + } + } + } + } + + private void orderRelatives(List<Artifact> relatives, List<String> list) { + Collections.sort(relatives, new UserDefinedOrderComparator(list)); + } + + @Override + public RelationOrderId getOrderId() { + return RelationOrderBaseTypes.USER_DEFINED; + } + + @Override + public void setOrder(Artifact artifact, RelationType type, RelationSide side, List<Artifact> relatives) throws OseeCoreException { + if(relatives.size() > 0){ + String value = artifact.getOrInitializeSoleAttributeValue("Relation Order"); + RelationOrderXmlProcessor relationOrderXmlProcessor= new RelationOrderXmlProcessor(value); + relationOrderXmlProcessor.putOrderList(type.getTypeName(), getOrderId(), side, toGuidList(relatives)); + artifact.setSoleAttributeFromString("Relation Order", relationOrderXmlProcessor.getAsXmlString()); + } + } + + private List<String> toGuidList(List<Artifact> relatives){ + List<String> guids = new ArrayList<String>(relatives.size()); + for(Artifact art:relatives){ + guids.add(art.getGuid()); + } + return guids; + } +} diff --git a/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrderComparator.java b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrderComparator.java new file mode 100644 index 00000000000..59f8c645dec --- /dev/null +++ b/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/order/UserDefinedOrderComparator.java @@ -0,0 +1,41 @@ +/* + * Created on Aug 12, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.skynet.core.relation.order; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +/** + * @author Andrew M. Finkbeiner + * + */ +class UserDefinedOrderComparator implements Comparator<Artifact>{ + + private Map<String, Integer> value; + + UserDefinedOrderComparator(List<String> guidOrder){ + value = new HashMap<String,Integer>(guidOrder.size()); + for(int i = 0; i < guidOrder.size(); i++){ + value.put(guidOrder.get(i), i); + } + } + + @Override + public int compare(Artifact artifact1, Artifact artifact2) { + Integer val1 = value.get(artifact1.getGuid()); + Integer val2 = value.get(artifact2.getGuid()); + if(val1 == null){ + val1 = Integer.MAX_VALUE-1; + } + if(val2 == null){ + val2 = Integer.MAX_VALUE; + } + return val1 - val2; + } +} diff --git a/org.eclipse.osee.framework.skynet.core/support/OseeTypes_ProgramAndCommon.xml b/org.eclipse.osee.framework.skynet.core/support/OseeTypes_ProgramAndCommon.xml index c975147b5fa..94f116ec997 100644 --- a/org.eclipse.osee.framework.skynet.core/support/OseeTypes_ProgramAndCommon.xml +++ b/org.eclipse.osee.framework.skynet.core/support/OseeTypes_ProgramAndCommon.xml @@ -82,7 +82,7 @@ <Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:WrapText="1"/>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s31">
+ <Style ss:ID="s30">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -92,7 +92,7 @@ <Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat/>
</Style>
- <Style ss:ID="s32">
+ <Style ss:ID="s31">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -102,19 +102,19 @@ <Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat ss:Format="Short Date"/>
</Style>
- <Style ss:ID="s33">
+ <Style ss:ID="s32">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders/>
<Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat ss:Format="Short Date"/>
</Style>
- <Style ss:ID="s34">
+ <Style ss:ID="s33">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders/>
<Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat/>
</Style>
- <Style ss:ID="s35">
+ <Style ss:ID="s34">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -125,7 +125,7 @@ <Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
<Interior/>
</Style>
- <Style ss:ID="s36">
+ <Style ss:ID="s35">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -133,7 +133,7 @@ </Borders>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s37">
+ <Style ss:ID="s36">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom" ss:WrapText="1"/>
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -141,7 +141,7 @@ </Borders>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s38">
+ <Style ss:ID="s37">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -150,7 +150,7 @@ <Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat ss:Format="0"/>
</Style>
- <Style ss:ID="s39">
+ <Style ss:ID="s38">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font x:Family="Swiss" ss:Size="9"/>
@@ -158,14 +158,14 @@ <NumberFormat/>
<Protection/>
</Style>
- <Style ss:ID="s40">
+ <Style ss:ID="s39">
<Borders>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
<Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="3"/>
</Borders>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s41">
+ <Style ss:ID="s40">
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -173,7 +173,7 @@ </Borders>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s42">
+ <Style ss:ID="s41">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -182,7 +182,7 @@ </Borders>
<Font x:Family="Swiss" ss:Size="9"/>
</Style>
- <Style ss:ID="s43">
+ <Style ss:ID="s42">
<Borders>
<Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="3"/>
<Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="3"/>
@@ -191,10 +191,10 @@ </Borders>
<Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
</Style>
- <Style ss:ID="s44">
+ <Style ss:ID="s43">
<Font x:Family="Swiss" ss:Size="9" ss:Bold="1"/>
</Style>
- <Style ss:ID="s46">
+ <Style ss:ID="s45">
<Alignment ss:Horizontal="Left" ss:Vertical="Bottom"/>
<Font x:Family="Swiss" ss:Size="9"/>
<NumberFormat ss:Format="@"/>
@@ -202,10 +202,10 @@ </Styles>
<Worksheet ss:Name="skynetBase">
<Names>
- <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=skynetBase!R59C1:R62C4"
+ <NamedRange ss:Name="_FilterDatabase" ss:RefersTo="=skynetBase!R61C1:R64C4"
ss:Hidden="1"/>
</Names>
- <Table ss:ExpandedColumnCount="10" ss:ExpandedRowCount="67" x:FullColumns="1"
+ <Table ss:ExpandedColumnCount="10" ss:ExpandedRowCount="69" x:FullColumns="1"
x:FullRows="1" ss:StyleID="s21" ss:DefaultRowHeight="12">
<Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="359.25"/>
<Column ss:StyleID="s21" ss:AutoFitWidth="0" ss:Width="300.75"/>
@@ -289,13 +289,13 @@ <Cell ss:StyleID="s29"/>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s31"><Data ss:Type="String">Workspace File</Data></Cell>
- <Cell ss:StyleID="s32"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Workspace File</Data></Cell>
+ <Cell ss:StyleID="s31"><Data ss:Type="String">Artifact</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
+ <Cell ss:StyleID="s32"/>
<Cell ss:StyleID="s33"/>
- <Cell ss:StyleID="s34"/>
- <Cell ss:StyleID="s33"/>
+ <Cell ss:StyleID="s32"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5"/>
<Row ss:AutoFitHeight="0" ss:Height="14.25">
@@ -306,184 +306,200 @@ <Cell ss:StyleID="s25"><Data ss:Type="String">Tagger ID</Data></Cell>
<Cell ss:StyleID="s25"><Data ss:Type="String">Default Value</Data></Cell>
<Cell ss:StyleID="s25"><Data ss:Type="String">Validity Xml</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Min Occurrence</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Max Occurrence</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Tip Text</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Min Occurrence</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Max Occurrence</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Tip Text</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="12.75">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Name</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">unnamed</Data></Cell>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Descriptive Name</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">unnamed</Data></Cell>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Descriptive Name</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Content URL</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Description</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.EnumeratedAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Page Type</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Portrait</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String"><Page_Type><Enum>Portrait</Enum><Enum>Landscape</Enum></Page_Type></Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s37"><Data ss:Type="String">Page Type: Landscape/Portrait</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Portrait</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String"><Page_Type><Enum>Portrait</Enum><Enum>Landscape</Enum></Page_Type></Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s36"><Data ss:Type="String">Page Type: Landscape/Portrait</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Word Ole Data</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">xml</Data></Cell>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:Index="8" ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s37"><Data ss:Type="String">Word Ole Data</Data></Cell>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:Index="8" ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s36"><Data ss:Type="String">Word Ole Data</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Workflow Definition</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">vue</Data></Cell>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">xml definition of a Blam Workflow</Data></Cell>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">xml definition of a Blam Workflow</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Extension</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Annotation</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"><Data ss:Type="String">DefaultAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Static Id</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
- <Cell ss:StyleID="s39"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s38"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">General String Data</Data></Cell>
<Cell ss:StyleID="s28"/>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
- <Cell ss:StyleID="s36"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"/>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s36"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.CompressedContentAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.CompressedContentAttribute</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Native Content</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">bin</Data></Cell>
<Cell ss:StyleID="s28"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">content that will be editing by a native program</Data></Cell>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">content that will be editing by a native program</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0">
+ <Cell ss:StyleID="s39"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.WordAttribute</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Word Template Content</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">xml</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">XmlAttributeTaggerProvider</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String"><w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"><w:r><w:t></w:t></w:r></w:p></Data></Cell>
+ <Cell ss:StyleID="s39"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">value must comply with WordML xml schema</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0">
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.StringAttribute</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.DefaultAttributeDataProvider</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Relation Order</Data></Cell>
+ <Cell ss:StyleID="s39"/>
+ <Cell ss:StyleID="s39"/>
+ <Cell ss:StyleID="s39"/>
+ <Cell ss:StyleID="s39"/>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Defines relation ordering information</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s40"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.WordAttribute</Data></Cell>
<Cell ss:StyleID="s40"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
- <Cell ss:StyleID="s40"><Data ss:Type="String">Word Template Content</Data></Cell>
+ <Cell ss:StyleID="s40"><Data ss:Type="String">Whole Word Content</Data></Cell>
<Cell ss:StyleID="s40"><Data ss:Type="String">xml</Data></Cell>
<Cell ss:StyleID="s40"><Data ss:Type="String">XmlAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s40"><Data ss:Type="String"><w:p xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml"><w:r><w:t></w:t></w:r></w:p></Data></Cell>
+ <Cell ss:StyleID="s40"><Data ss:Type="String"><?xml version='1.0' encoding='UTF-8' standalone='yes'?><?mso-application progid='Word.Document'?><w:wordDocument xmlns:w='http://schemas.microsoft.com/office/word/2003/wordml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:w10='urn:schemas-microsoft-com:office:word' xmlns:sl='http://schemas.microsoft.com/schemaLibrary/2003/core' xmlns:aml='http://schemas.microsoft.com/aml/2001/core' xmlns:wx='http://schemas.microsoft.com/office/word/2003/auxHint' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:wsp='http://schemas.microsoft.com/office/word/2003/wordml/sp2' xmlns:ns0='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://eclipse.org/artifact.xsd' xmlns:st1='urn:schemas-microsoft-com:office:smarttags' w:macrosPresent='no' w:embeddedObjPresent='no' w:ocxPresent='no' xml:space='preserve'><w:body></w:body></w:wordDocument></Data></Cell>
<Cell ss:StyleID="s40"/>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s41"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s41"><Data ss:Type="Number">1</Data></Cell>
<Cell ss:StyleID="s40"><Data ss:Type="String">value must comply with WordML xml schema</Data></Cell>
</Row>
- <Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s41"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.WordAttribute</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String">org.eclipse.osee.framework.skynet.core.UriAttributeDataProvider</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String">Whole Word Content</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String">xml</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String">XmlAttributeTaggerProvider</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String"><?xml version='1.0' encoding='UTF-8' standalone='yes'?><?mso-application progid='Word.Document'?><w:wordDocument xmlns:w='http://schemas.microsoft.com/office/word/2003/wordml' xmlns:v='urn:schemas-microsoft-com:vml' xmlns:w10='urn:schemas-microsoft-com:office:word' xmlns:sl='http://schemas.microsoft.com/schemaLibrary/2003/core' xmlns:aml='http://schemas.microsoft.com/aml/2001/core' xmlns:wx='http://schemas.microsoft.com/office/word/2003/auxHint' xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' xmlns:wsp='http://schemas.microsoft.com/office/word/2003/wordml/sp2' xmlns:ns0='http://www.w3.org/2001/XMLSchema' xmlns:ns1='http://eclipse.org/artifact.xsd' xmlns:st1='urn:schemas-microsoft-com:office:smarttags' w:macrosPresent='no' w:embeddedObjPresent='no' w:ocxPresent='no' xml:space='preserve'><w:body></w:body></w:wordDocument></Data></Cell>
- <Cell ss:StyleID="s41"/>
- <Cell ss:StyleID="s42"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s42"><Data ss:Type="Number">1</Data></Cell>
- <Cell ss:StyleID="s41"><Data ss:Type="String">value must comply with WordML xml schema</Data></Cell>
- </Row>
<Row ss:AutoFitHeight="0" ss:Height="11.25"/>
<Row ss:AutoFitHeight="0"/>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s43"><Data ss:Type="String">Artifact Type Name</Data></Cell>
- <Cell ss:StyleID="s43"><Data ss:Type="String">Attribute Type Name</Data></Cell>
+ <Cell ss:StyleID="s42"><Data ss:Type="String">Artifact Type Name</Data></Cell>
+ <Cell ss:StyleID="s42"><Data ss:Type="String">Attribute Type Name</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s40"><Data ss:Type="String">Artifact</Data></Cell>
- <Cell ss:StyleID="s40"><Data ss:Type="String">Name</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Name</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s40"><Data ss:Type="String">Artifact</Data></Cell>
- <Cell ss:StyleID="s40"><Data ss:Type="String">Annotation</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Annotation</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s40"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Artifact</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Static Id</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Artifact</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Relation Order</Data></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s27"><Data ss:Type="String">FileArtifact</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">Content URL</Data></Cell>
</Row>
@@ -524,12 +540,12 @@ <Cell ss:StyleID="s28"><Data ss:Type="String">Extension</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="14.25">
- <Cell ss:StyleID="s40"><Data ss:Type="String">NativeArtifact</Data></Cell>
- <Cell ss:StyleID="s40"><Data ss:Type="String">Description</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">NativeArtifact</Data></Cell>
+ <Cell ss:StyleID="s39"><Data ss:Type="String">Description</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s31"><Data ss:Type="String">NativeArtifact</Data></Cell>
- <Cell ss:StyleID="s31"><Data ss:Type="String">Native Content</Data></Cell>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">NativeArtifact</Data></Cell>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Native Content</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5"/>
<Row ss:AutoFitHeight="0">
@@ -539,50 +555,50 @@ <Cell ss:StyleID="s25"><Data ss:Type="String">Relation type name</Data></Cell>
<Cell ss:StyleID="s25"><Data ss:Type="String">Side A Name</Data></Cell>
<Cell ss:StyleID="s25"><Data ss:Type="String">A to B Phrase</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Side B Name</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">B to A Phrase</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Short Name</Data></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Ordered</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Side B Name</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">B to A Phrase</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Short Name</Data></Cell>
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Ordered</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s36"><Data ss:Type="String">Default Hierarchical</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">parent</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">has</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">child</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">is a child of</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">DHier</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Default Hierarchical</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">parent</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">has</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">child</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">is a child of</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">DHier</Data></Cell>
<Cell><Data ss:Type="String">Yes</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">Dependency</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">artifact</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">is dependent upon</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">dependency</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">impacts</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Dep</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Dependency</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">artifact</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">is dependent upon</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">dependency</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">impacts</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Dep</Data></Cell>
<Cell><Data ss:Type="String">No</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">Supporting Info</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">is supported by</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">is supported by</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">supporting info</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">supports</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">SupIn</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Supporting Info</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">is supported by</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">is supported by</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">supporting info</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">supports</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">SupIn</Data></Cell>
<Cell><Data ss:Type="String">No</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s36"><Data ss:Type="String">Universal Grouping</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Universal Grouping</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">group</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">contains</Data></Cell>
<Cell ss:StyleID="s28"><Data ss:Type="String">members</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">belong to</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Group</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">belong to</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Group</Data></Cell>
<Cell><Data ss:Type="String">Yes</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5" ss:Span="1"/>
- <Row ss:Index="57" ss:AutoFitHeight="0" ss:Height="13.5">
- <Cell ss:StyleID="s44"><Data ss:Type="String">#the first max values specified for an <artifact type, relation type> pair is used, so put the constraint for a concreate type before the constraint for a supertype</Data></Cell>
+ <Row ss:Index="59" ss:AutoFitHeight="0" ss:Height="13.5">
+ <Cell ss:StyleID="s43"><Data ss:Type="String">#the first max values specified for an <artifact type, relation type> pair is used, so put the constraint for a concreate type before the constraint for a supertype</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
<Cell><Data ss:Type="String"># An artifact of type "Artifact Type" can be on side "A", "Side A Max" number of times for relation links of type "Relation Type".</Data></Cell>
@@ -604,18 +620,18 @@ ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="s25"><Data ss:Type="String">Side A Max</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s35"><Data ss:Type="String">Side B Max</Data><NamedCell
+ <Cell ss:StyleID="s34"><Data ss:Type="String">Side B Max</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:Index="7" ss:StyleID="Default"/>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
<Cell ss:StyleID="s27"><Data ss:Type="String">Artifact</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Default Hierarchical</Data><NamedCell
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Default Hierarchical</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="Number">1</Data><NamedCell
+ <Cell ss:StyleID="s37"><Data ss:Type="Number">1</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
<Cell ss:StyleID="Default"/>
<Cell ss:StyleID="Default"/>
@@ -623,34 +639,34 @@ <Row ss:AutoFitHeight="0" ss:Height="13.5">
<Cell ss:StyleID="s27"><Data ss:Type="String">Artifact</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Dependency</Data><NamedCell
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Dependency</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data><NamedCell
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data><NamedCell
ss:Name="_FilterDatabase"/></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
<Cell ss:StyleID="s27"><Data ss:Type="String">Artifact</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Supporting Info</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Supporting Info</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0" ss:Height="13.5">
<Cell ss:StyleID="s27"><Data ss:Type="String">Universal Group</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Universal Grouping</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Universal Grouping</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0">
<Cell ss:StyleID="s27"><Data ss:Type="String">Artifact</Data></Cell>
- <Cell ss:StyleID="s36"><Data ss:Type="String">Universal Grouping</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="Number">0</Data></Cell>
- <Cell ss:StyleID="s38"><Data ss:Type="String">UNLIMITED</Data></Cell>
+ <Cell ss:StyleID="s35"><Data ss:Type="String">Universal Grouping</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="Number">0</Data></Cell>
+ <Cell ss:StyleID="s37"><Data ss:Type="String">UNLIMITED</Data></Cell>
</Row>
<Row ss:AutoFitHeight="0"/>
<Row ss:AutoFitHeight="0">
- <Cell ss:StyleID="s46"><Data ss:Type="String">#need method to record whether allocation has been verified as complete and re-verify if changes potentially impact the allocation</Data></Cell>
+ <Cell ss:StyleID="s45"><Data ss:Type="String">#need method to record whether allocation has been verified as complete and re-verify if changes potentially impact the allocation</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
@@ -664,11 +680,11 @@ <VerticalResolution>600</VerticalResolution>
</Print>
<Selected/>
+ <TopRowVisible>18</TopRowVisible>
<Panes>
<Pane>
<Number>3</Number>
- <ActiveRow>11</ActiveRow>
- <ActiveCol>3</ActiveCol>
+ <ActiveRow>28</ActiveRow>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java index 678abe04882..562f8836a86 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactExplorer.java @@ -252,6 +252,7 @@ public class ArtifactExplorer extends ViewPart implements IRebuildMenuListener, stackComposite.getParent().layout();
}
+
@Override
public void createPartControl(Composite parent) {
try {
@@ -1378,7 +1379,7 @@ public class ArtifactExplorer extends ViewPart implements IRebuildMenuListener, treeViewer.refresh(artifact.getParent());
}
} else if (artifactModType == ArtifactModType.Changed) {
- treeViewer.update(artifact, null);
+ treeViewer.refresh(artifact, true);
} else if (artifactModType == ArtifactModType.Reverted) {
if (artifact.getParent() != null) {
treeViewer.refresh(artifact.getParent());
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactRoot.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactRoot.java new file mode 100644 index 00000000000..d5ffb0ce947 --- /dev/null +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactRoot.java @@ -0,0 +1,25 @@ +/* + * Created on Aug 13, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.ui.skynet; + +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; + +/** + * @author b1528444 + * + */ +public class ArtifactRoot { + + private Artifact artifact; + + ArtifactRoot(Artifact artifact){ + this.artifact = artifact; + } + + Artifact getArtifact(){ + return artifact; + } +} diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java index ae005581f3d..61a56c244d4 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationCellModifier.java @@ -10,9 +10,12 @@ *******************************************************************************/ package org.eclipse.osee.framework.ui.skynet; +import java.util.logging.Level; import org.eclipse.jface.viewers.ICellModifier; import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.osee.framework.skynet.core.relation.RelationLink; +import org.eclipse.osee.framework.core.exception.OseeCoreException; +import org.eclipse.osee.framework.logging.OseeLog; +import org.eclipse.osee.framework.skynet.core.relation.RelationManager; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; import org.eclipse.swt.widgets.Item; @@ -41,17 +44,27 @@ public class RelationCellModifier implements ICellModifier { } public Object getValue(Object element, String property) { - RelationLink relLink = (RelationLink) element; - return relLink.getRationale(); + WrapperForRelationLink relLink = (WrapperForRelationLink) element; + String rationale = ""; + try { + rationale = RelationManager.getRelationRationale(relLink.getArtifactA(), relLink.getArtifactB(), relLink.getRelationType()); + } catch (OseeCoreException ex) { + OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); + } + return rationale; } public void modify(Object element, String property, Object value) { // Note that it is possible for an SWT Item to be passed instead of the model element. if (element instanceof Item) { element = ((Item) element).getData(); + } + WrapperForRelationLink relLink = (WrapperForRelationLink) element; + try { + RelationManager.setRelationRationale(relLink.getArtifactA(), relLink.getArtifactB(), relLink.getRelationType(), value.toString()); + } catch (OseeCoreException ex) { + OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); } - RelationLink relLink = (RelationLink) element; - relLink.setRationale((String) value, true); treeViewer.update(element, null); } } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java index 2cb4a57cff3..0c10aa6cc35 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationContentProvider.java @@ -10,8 +10,9 @@ *******************************************************************************/ package org.eclipse.osee.framework.ui.skynet; -import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.logging.Level; import org.eclipse.jface.viewers.IContentProvider; import org.eclipse.jface.viewers.IStructuredContentProvider; @@ -20,7 +21,6 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.relation.RelationLink; import org.eclipse.osee.framework.skynet.core.relation.RelationSide; import org.eclipse.osee.framework.skynet.core.relation.RelationType; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; @@ -34,7 +34,8 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; */ public class RelationContentProvider implements ITreeContentProvider { private static Object[] EMPTY_ARRAY = new Object[0]; - private Artifact artifact; + private ArtifactRoot artifact; + private Map<Object, Object> childToParentMap = new HashMap<Object, Object>(); /* * @see IContentProvider#dispose() @@ -56,7 +57,7 @@ public class RelationContentProvider implements ITreeContentProvider { * @see IContentProvider#inputChanged(Viewer, Object, Object) */ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - this.artifact = (Artifact) newInput; + this.artifact = (ArtifactRoot) newInput; } /** @@ -68,21 +69,28 @@ public class RelationContentProvider implements ITreeContentProvider { */ public Object[] getChildren(Object parentElement) { try { - if (parentElement instanceof Artifact) { - Artifact artifact = (Artifact) parentElement; + if (parentElement instanceof ArtifactRoot) { + Artifact artifact = ((ArtifactRoot) parentElement).getArtifact(); List<RelationType> relationTypes = RelationTypeManager.getValidTypes(artifact.getArtifactType(), artifact.getBranch()); + for(RelationType type :relationTypes){ + childToParentMap.put(type, parentElement); + } return relationTypes.toArray(); } else if (parentElement instanceof RelationType) { RelationType relationType = (RelationType) parentElement; int sideAMax = - RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_A); + RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifact().getArtifactType(), RelationSide.SIDE_A); int sideBMax = - RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_B); - RelationTypeSide sideA = new RelationTypeSide(relationType, RelationSide.SIDE_A, artifact); - RelationTypeSide sideB = new RelationTypeSide(relationType, RelationSide.SIDE_B, artifact); + RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifact().getArtifactType(), RelationSide.SIDE_B); + RelationTypeSide sideA = new RelationTypeSide(relationType, RelationSide.SIDE_A, artifact.getArtifact()); + RelationTypeSide sideB = new RelationTypeSide(relationType, RelationSide.SIDE_B, artifact.getArtifact()); boolean onSideA = sideBMax > 0; boolean onSideB = sideAMax > 0; + + childToParentMap.put(sideA, parentElement); + childToParentMap.put(sideB, parentElement); + if (onSideA && onSideB) { return new Object[] {sideA, sideB}; } else if (onSideA) { @@ -92,12 +100,17 @@ public class RelationContentProvider implements ITreeContentProvider { } } else if (parentElement instanceof RelationTypeSide) { RelationTypeSide relationTypeSide = (RelationTypeSide) parentElement; - artifact.getRelatedArtifacts(relationTypeSide); // ensure the artifacts are bulk loaded; otherwise the sort will be slower - List<RelationLink> relations = artifact.getRelations(relationTypeSide); - if (!relationTypeSide.getRelationType().isOrdered()) { - Collections.sort(relations, new AlphabeticalRelationComparator(relationTypeSide.getSide())); + List<Artifact> artifacts = artifact.getArtifact().getRelatedArtifacts(relationTypeSide); + WrapperForRelationLink[] wrapper = new WrapperForRelationLink[artifacts.size()]; + for(int i = 0; i < artifacts.size(); i++){ + if(relationTypeSide.isSideA()){ + wrapper[i]=new WrapperForRelationLink(relationTypeSide.getRelationType(), artifacts.get(i), artifacts.get(i), relationTypeSide.getArtifact()); + } else { + wrapper[i]=new WrapperForRelationLink(relationTypeSide.getRelationType(), artifacts.get(i), relationTypeSide.getArtifact(), artifacts.get(i)); + } + childToParentMap.put(wrapper[i], parentElement); } - return relations.toArray(); + return wrapper; } } catch (OseeCoreException ex) { OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); @@ -110,7 +123,7 @@ public class RelationContentProvider implements ITreeContentProvider { * @see ITreeContentProvider#getParent(Object) */ public Object getParent(Object element) { - return null; + return childToParentMap.get(element); } /** @@ -123,7 +136,7 @@ public class RelationContentProvider implements ITreeContentProvider { public boolean hasChildren(Object element) { if (element instanceof RelationTypeSide) { try { - return artifact.getRelatedArtifactsCount((RelationTypeSide) element) > 0; + return artifact.getArtifact().getRelatedArtifactsCount((RelationTypeSide) element) > 0; } catch (OseeCoreException ex) { OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); return false; diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java index 241c30a0e55..7155dac4976 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationLabelProvider.java @@ -18,6 +18,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.relation.RelationLink; +import org.eclipse.osee.framework.skynet.core.relation.RelationManager; import org.eclipse.osee.framework.skynet.core.relation.RelationType; import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide; import org.eclipse.swt.graphics.Image; @@ -35,10 +36,10 @@ public class RelationLabelProvider implements ITableLabelProvider, ILabelProvide public Image getColumnImage(Object element, int columnIndex) { if (element instanceof RelationType && columnIndex == 0) { return ImageManager.getImage(FrameworkImage.RELATION); - } else if (element instanceof RelationLink && columnIndex == 0) { - RelationLink relation = (RelationLink) element; + } else if (element instanceof WrapperForRelationLink && columnIndex == 0) { + WrapperForRelationLink artifact = (WrapperForRelationLink) element; try { - return ImageManager.getImage(relation.getArtifactOnOtherSide(artifact)); + return ImageManager.getImage(artifact.getOther()); } catch (Exception ex) { OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); } @@ -65,6 +66,19 @@ public class RelationLabelProvider implements ITableLabelProvider, ILabelProvide } else if (columnIndex == 1) { return link.getRationale(); } + } else if (element instanceof WrapperForRelationLink) { + WrapperForRelationLink wrapper = (WrapperForRelationLink) element; + if (columnIndex == 0) { + return wrapper.getOther().getName(); + } else if (columnIndex == 1) { + String rationale = ""; + try{ + rationale = RelationManager.getRelationRationale(wrapper.getArtifactA(), wrapper.getArtifactB(), wrapper.getRelationType()); + } catch (OseeCoreException ex){ + + } + return rationale; + } } return ""; } diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java index 07b59eba74b..71bded131b7 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/RelationsComposite.java @@ -13,12 +13,10 @@ package org.eclipse.osee.framework.ui.skynet; import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -35,7 +33,6 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Collections;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -51,13 +48,11 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationLink; import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationSide;
import org.eclipse.osee.framework.skynet.core.relation.RelationType;
-import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.skynet.core.relation.RelationTypeSide;
-import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.skynet.core.relation.order.RelationOrderId;
import org.eclipse.osee.framework.ui.plugin.util.Displays;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.artifact.massEditor.MassArtifactEditor;
-import org.eclipse.osee.framework.ui.skynet.listener.IRebuildMenuListener;
import org.eclipse.osee.framework.ui.skynet.relation.explorer.RelationExplorerWindow;
import org.eclipse.osee.framework.ui.skynet.render.PresentationType;
import org.eclipse.osee.framework.ui.skynet.render.RendererManager;
@@ -74,6 +69,7 @@ import org.eclipse.swt.events.MouseEvent; import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.SelectionAdapter;
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;
@@ -102,7 +98,7 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv private static int COLUMN_ORDER = 1;
private MenuItem openMenuItem;
- private MenuItem openWithMenuItem;
+ // private MenuItem openWithMenuItem;
private MenuItem editMenuItem;
private MenuItem viewRelationTreeItem;
private MenuItem orderRelationMenuItem;
@@ -114,8 +110,6 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv private final RelationLabelProvider relationLabelProvider;
private final ToolBar toolBar;
- private final Map<Integer, RelationLink> artifactToLinkMap;
-
public RelationsComposite(IDirtiableEditor editor, Composite parent, int style, Artifact artifact) {
this(editor, parent, style, artifact, null);
}
@@ -130,7 +124,6 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv this.artifact = artifact;
this.editor = editor;
this.relationLabelProvider = new RelationLabelProvider(artifact);
- this.artifactToLinkMap = new HashMap<Integer, RelationLink>();
createPartControl();
OseeEventManager.addListener(this);
@@ -170,14 +163,14 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv treeViewer.setSorter(new LabelSorter() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof RelationLink && e2 instanceof RelationLink) {
+ if (e1 instanceof WrapperForRelationLink && e2 instanceof WrapperForRelationLink) {
return 0;
}
return super.compare(viewer, e1, e2);
}
});
treeViewer.setUseHashlookup(true);
- treeViewer.setInput(artifact);
+ treeViewer.setInput(new ArtifactRoot(artifact));
treeViewer.addDoubleClickListener(new DoubleClickListener());
tree.addKeyListener(new keySelectedListener());
@@ -272,85 +265,65 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv }
private void createOrderRelationTreeMenuItem(final Menu parentMenu) {
+
orderRelationMenuItem = new MenuItem(parentMenu, SWT.CASCADE);
- orderRelationMenuItem.setText("&Order Relation");
+ orderRelationMenuItem.setText("&Order Relations");
needSelectedArtifactListener.add(orderRelationMenuItem);
- orderRelationMenuItem.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- performOrderRelation();
- }
- });
+ //subMenu = new Menu(clearContents);
+ Menu subMenu = new Menu(parentMenu);
+ orderRelationMenuItem.setMenu(subMenu);
+
+ List<RelationOrderId> orderTypes = RelationManager.getRelationOrderTypes();
+ for (RelationOrderId id : orderTypes) {
+ MenuItem idMenu = new MenuItem(subMenu, SWT.CASCADE);
+ idMenu.setText(id.prettyName());
+ idMenu.addSelectionListener(new SelectionId(id));
+ }
parentMenu.addListener(SWT.Show, new Listener() {
@Override
public void handleEvent(Event event) {
- String errorMessage = checkSelectionForOrderRelation();
- orderRelationMenuItem.setEnabled(!Strings.isValid(errorMessage));
- if (errorMessage.length() > 0) {
- errorMessage = ": " + errorMessage;
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Object[] objects = selection.toArray();
+ if (objects.length == 1 && objects[0] instanceof RelationTypeSide) {
+ orderRelationMenuItem.setEnabled(true);
+ } else {
+ orderRelationMenuItem.setEnabled(false);
}
- orderRelationMenuItem.setText(String.format("&Order Relation%s", errorMessage));
}
});
orderRelationMenuItem.setEnabled(true);
}
- private Set<RelationLink> getSelectionForOrderRelation() {
- Set<RelationLink> selectedItems = new HashSet<RelationLink>();
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- Iterator<?> iter = selection.iterator();
- while (iter.hasNext()) {
- Object object = iter.next();
- if (object instanceof RelationLink) {
- selectedItems.add((RelationLink) object);
- }
+ private class SelectionId implements SelectionListener {
+
+ private RelationOrderId id;
+
+ SelectionId(RelationOrderId id){
+ this.id = id;
}
- return selectedItems;
- }
-
- private String checkSelectionForOrderRelation() {
- String errorMessage = "";
- IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- if (selection.isEmpty()) {
- errorMessage = "None Selected";
- } else {
- Set<RelationLink> selectedItems = getSelectionForOrderRelation();
- if (selectedItems.isEmpty()) {
- errorMessage = "No Artifacts Selected";
- } else if (selectedItems.size() == 1) {
- RelationLink link = selectedItems.iterator().next();
- errorMessage = String.format("Select more than 1 artifact for [%s]", link.getRelationType().getTypeName());
- } else {
- Artifact aArtifact = null;
- for (RelationLink link : selectedItems) {
- RelationType type = link.getRelationType();
- if (!type.isOrdered()) {
- errorMessage = String.format("Item with static order selected [%s]", type.getTypeName());
- break;
- }
- try {
- Artifact aSide = link.getArtifactA();
- if (aArtifact == null) {
- aArtifact = aSide;
- } else {
- if (!aSide.equals(aArtifact)) {
- errorMessage =
- String.format("Item from different link sides selected [%s]", aSide.getName());
- break;
- }
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
+
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
+ Object[] objects = selection.toArray();
+ if (objects.length == 1 && objects[0] instanceof RelationTypeSide) {
+ RelationTypeSide typeSide = (RelationTypeSide)objects[0];
+ try {
+ typeSide.getArtifact().setRelationOrder(typeSide, id);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
}
}
- return errorMessage;
}
-
+
private void createDeleteRelationMenuItem(final Menu parentMenu) {
deleteRelationMenuItem = new MenuItem(parentMenu, SWT.CASCADE);
deleteRelationMenuItem.setText("&Delete Relation");
@@ -435,67 +408,31 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv });
}
- private void createOpenWithMenuItem(Menu parentMenu) {
- openWithMenuItem = new MenuItem(parentMenu, SWT.CASCADE);
- openWithMenuItem.setText("&Open With");
- final Menu submenu = new Menu(openWithMenuItem);
- openWithMenuItem.setMenu(submenu);
- needSelectedArtifactListener.addArtifactEnabled(openWithMenuItem);
- parentMenu.addMenuListener(new OpenWithMenuListener(submenu, treeViewer, new IRebuildMenuListener() {
-
- @Override
- public void rebuildMenu() {
- createPopupMenu();
- }
-
- }));
- }
-
private void openViewer(IStructuredSelection selection) {
Object object = selection.getFirstElement();
- Artifact selectedArtifact = null;
- if (object instanceof RelationLink) {
- RelationLink link = (RelationLink) object;
- try {
- selectedArtifact = link.getArtifactOnOtherSide(artifact);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
- ArtifactEditor.editArtifact(selectedArtifact);
+ if (object instanceof WrapperForRelationLink) {
+ WrapperForRelationLink link = (WrapperForRelationLink) object;
+ ArtifactEditor.editArtifact(link.getOther());
}
}
- private void performOrderRelation() {
- try {
- Set<RelationLink> selectedItems = getSelectionForOrderRelation();
- List<RelationLink> items = new ArrayList<RelationLink>(selectedItems);
-
- RelationLink link = items.iterator().next();
- RelationSide side = link.getSide(link.getArtifactB());
- java.util.Collections.sort(items, new AlphabeticalRelationComparator(side));
- System.out.println(items);
- AWorkbench.popup("This feature is not yet supported");
- } catch (Exception ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
+ private void performMassEdit(IStructuredSelection selection) {
+ Set<Artifact> selectedArtifacts = getSelectedArtifacts(selection);
+ MassArtifactEditor.editArtifacts("Mass Edit", selectedArtifacts);
}
- private void performMassEdit(IStructuredSelection selection) {
+ private Set<Artifact> getSelectedArtifacts(IStructuredSelection selection) {
Set<Artifact> selectedArtifacts = new HashSet<Artifact>();
Iterator<?> iter = selection.iterator();
while (iter.hasNext()) {
Object object = iter.next();
- if (object instanceof RelationLink) {
- RelationLink link = (RelationLink) object;
- try {
- selectedArtifacts.add(link.getArtifactB());
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, OseeLevel.SEVERE_POPUP, ex);
- }
+ if (object instanceof WrapperForRelationLink) {
+ WrapperForRelationLink wrapped = (WrapperForRelationLink) object;
+ selectedArtifacts.add(wrapped.getOther());
}
}
- MassArtifactEditor.editArtifacts("Mass Edit", selectedArtifacts);
+ return selectedArtifacts;
}
private void createEditMenuItem(Menu parentMenu) {
@@ -509,8 +446,9 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
Object object = selection.getFirstElement();
- if (object instanceof Artifact) {
- RendererManager.openInJob((Artifact) object, PresentationType.SPECIALIZED_EDIT);
+ if (object instanceof WrapperForRelationLink) {
+ RendererManager.openInJob(((WrapperForRelationLink) object).getOther(),
+ PresentationType.SPECIALIZED_EDIT);
}
}
});
@@ -557,7 +495,7 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv public void menuShown(MenuEvent e) {
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
- boolean valid = selection.getFirstElement() instanceof RelationLink;
+ boolean valid = selection.getFirstElement() instanceof WrapperForRelationLink;
for (MenuItem item : accessControlitems) {
item.setEnabled(valid && !artifact.isReadOnly());
@@ -599,20 +537,8 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv * @param selection
*/
private void performDeleteArtifact(IStructuredSelection selection) {
- ArrayList<Artifact> artifactsToBeDeleted = new ArrayList<Artifact>(selection.size());
-
try {
- //Add all of the artifacts to a list first
- for (Object object : selection.toList()) {
- if (object instanceof RelationLink) {
- RelationLink relLink = (RelationLink) object;
- if (relLink.getArtifactA() == artifact) {
- artifactsToBeDeleted.add(relLink.getArtifactB());
- } else {
- artifactsToBeDeleted.add(relLink.getArtifactA());
- }
- }
- }
+ Set<Artifact> artifactsToBeDeleted = getSelectedArtifacts(selection);
//Ask if they are sure they want all artifacts to be deleted
if (!artifactsToBeDeleted.isEmpty()) {
@@ -650,34 +576,37 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv Object[] objects = selection.toArray();
for (Object object : objects) {
- if (object instanceof RelationLink) {
- ((RelationLink) object).delete(true);
-
- RelationType relationType = ((RelationLink) object).getRelationType();
- int sideAMax =
- RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_A);
- int sideBMax =
- RelationTypeManager.getRelationSideMax(relationType, artifact.getArtifactType(), RelationSide.SIDE_B);
- RelationTypeSide sideA = new RelationTypeSide(relationType, RelationSide.SIDE_A, artifact);
- RelationTypeSide sideB = new RelationTypeSide(relationType, RelationSide.SIDE_B, artifact);
- boolean onSideA = sideBMax > 0;
- boolean onSideB = sideAMax > 0;
- if (onSideA && onSideB) {
- treeViewer.refresh(sideA);
- } else if (onSideA) {
- treeViewer.refresh(sideA);
- treeViewer.refresh(sideB);
- } else if (onSideB) {
- treeViewer.refresh(sideB);
+ if (object instanceof WrapperForRelationLink) {
+ WrapperForRelationLink wrapper = (WrapperForRelationLink) object;
+ try {
+ wrapper.getArtifactA().deleteRelation(
+ new RelationTypeSide(wrapper.getRelationType(), RelationSide.SIDE_B, wrapper.getArtifactA()),
+ wrapper.getArtifactB());
+ Object parent = ((ITreeContentProvider) treeViewer.getContentProvider()).getParent(object);
+ if (parent != null) {
+ treeViewer.refresh(parent);
+ } else {
+ treeViewer.refresh();
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
}
} else if (object instanceof RelationType) {
RelationType relationType = (RelationType) object;
- RelationManager.deleteRelations(artifact, relationType, null);
- treeViewer.refresh(relationType);
+ try {
+ RelationManager.deleteRelations(artifact, relationType, null);
+ treeViewer.refresh(relationType);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
} else if (object instanceof RelationTypeSide) {
RelationTypeSide group = (RelationTypeSide) object;
- RelationManager.deleteRelations(artifact, group.getRelationType(), group.getSide());
- treeViewer.refresh(group);
+ try {
+ RelationManager.deleteRelations(artifact, group.getRelationType(), group.getSide());
+ treeViewer.refresh(group);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
+ }
}
}
}
@@ -737,19 +666,12 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv Object[] objects = selection.toArray();
Artifact[] artifacts = null;
- if (objects.length > 0 && objects[0] instanceof RelationLink) {
+ if (objects.length > 0 && objects[0] instanceof WrapperForRelationLink) {
artifacts = new Artifact[objects.length];
for (int index = 0; index < objects.length; index++) {
- RelationLink link = (RelationLink) objects[index];
- Artifact selectedArtifact = null;
- try {
- selectedArtifact = link.getArtifactOnOtherSide(artifact);
- } catch (OseeCoreException ex) {
- OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex);
- }
- artifacts[index] = selectedArtifact;
- artifactToLinkMap.put(selectedArtifact.getArtId(), link);
+ WrapperForRelationLink link = (WrapperForRelationLink) objects[index];
+ artifacts[index] = link.getOther();
}
}
return artifacts;
@@ -776,16 +698,15 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv event.detail = DND.DROP_COPY;
tree.setInsertMark(null, false);
}
- } else if (selected != null && selected.getData() instanceof RelationLink) {
- RelationLink targetLink = (RelationLink) selected.getData();
+ } else if (selected != null && selected.getData() instanceof WrapperForRelationLink) {
+ WrapperForRelationLink targetLink = (WrapperForRelationLink) selected.getData();
IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection();
Object obj = selection.getFirstElement();
- if (obj instanceof RelationLink) {
- RelationLink dropTarget = (RelationLink) obj;
+ if (obj instanceof WrapperForRelationLink) {
+ WrapperForRelationLink dropTarget = (WrapperForRelationLink) obj;
if (artifact.isReadOnly()) {
event.detail = DND.DROP_NONE;
-
MessageDialog.openError(
Display.getCurrent().getActiveShell(),
"Create Relation Error",
@@ -793,9 +714,7 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv return;
}
// the links must be in the same group
-
- if (targetLink.getSide(artifact).equals(dropTarget.getSide(artifact)) && targetLink.getRelationType().equals(
- dropTarget.getRelationType())) {
+ if (relationLinkIsInSameGroup(targetLink, dropTarget)) {
if (isFeedbackAfter) {
event.feedback = DND.FEEDBACK_INSERT_AFTER;
} else {
@@ -809,6 +728,17 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv }
}
+ /**
+ * @param targetLink
+ * @param dropTarget
+ * @return
+ */
+ private boolean relationLinkIsInSameGroup(WrapperForRelationLink targetLink, WrapperForRelationLink dropTarget) {
+ return targetLink.getRelationType().equals(dropTarget.getRelationType()) && //same type
+ (targetLink.getArtifactA().equals(dropTarget.getArtifactA()) || //either the A or B side is equal, meaning they are on the same side
+ targetLink.getArtifactB().equals(dropTarget.getArtifactB()));
+ }
+
@Override
public void operationChanged(DropTargetEvent event) {
if (!isCtrlPressed(event)) {
@@ -830,19 +760,12 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv TreeItem selected = treeViewer.getTree().getItem(treeViewer.getTree().toControl(event.x, event.y));
Object object = selected.getData();
try {
-
- System.out.println(event.getSource());
-
- if (object instanceof RelationLink) {//used for ordering
- RelationLink targetLink = (RelationLink) object;
- // RelationManager.addRelationAndModifyOrder(artifact, targetLink.getArtifactOnOtherSide(artifact),
- // ((ArtifactData) event.data).getArtifacts(), targetLink.getRelationType(), true);
-
- Artifact target = targetLink.getArtifactOnOtherSide(artifact);
- for (Artifact art : ((ArtifactData) event.data).getArtifacts()) {
- artifact.setRelationOrder(target, isFeedbackAfter, new RelationTypeSide(targetLink.getRelationType(),
- targetLink.getSide(artifact).oppositeSide(), artifact), art);
- target = art;
+ if (object instanceof WrapperForRelationLink) {//used for ordering
+ WrapperForRelationLink targetLink = (WrapperForRelationLink) object;
+ Artifact[] artifactsToMove = ((ArtifactData) event.data).getArtifacts();
+ for (Artifact artifactToMove : artifactsToMove) {
+ artifact.setRelationOrder(targetLink.getOther(), isFeedbackAfter, new RelationTypeSide(
+ targetLink.getRelationType(), targetLink.getRelationSide(), null), artifactToMove);
}
treeViewer.refresh();
editor.onDirtied();
@@ -864,7 +787,8 @@ public class RelationsComposite extends Composite implements IRelationModifiedEv }
private void setHelpContexts() {
- SkynetGuiPlugin.getInstance().setHelp(treeViewer.getControl(), "relation_page_tree_viewer", "org.eclipse.osee.framework.help.ui");
+ SkynetGuiPlugin.getInstance().setHelp(treeViewer.getControl(), "relation_page_tree_viewer",
+ "org.eclipse.osee.framework.help.ui");
}
/**
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderIntermediate.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderIntermediate.java new file mode 100644 index 00000000000..b5eaa02d28d --- /dev/null +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderIntermediate.java @@ -0,0 +1,109 @@ +package org.eclipse.osee.framework.ui.skynet;
+
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.jface.viewers.IPostSelectionProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+
+public class SelectionProviderIntermediate implements IPostSelectionProvider {
+
+ private final ListenerList selectionListeners = new ListenerList();
+
+ private final ListenerList postSelectionListeners = new ListenerList();
+
+ private ISelectionProvider delegate;
+
+ private ISelectionChangedListener selectionListener = new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getSelectionProvider() == delegate) {
+ fireSelectionChanged(event.getSelection());
+ }
+ }
+ };
+
+ private ISelectionChangedListener postSelectionListener = new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ if (event.getSelectionProvider() == delegate) {
+ firePostSelectionChanged(event.getSelection());
+ }
+ }
+ };
+
+ /**
+ * Sets a new selection provider to delegate to. Selection listeners
+ * registered with the previous delegate are removed before.
+ *
+ * @param newDelegate new selection provider
+ */
+ public void setSelectionProviderDelegate(ISelectionProvider newDelegate) {
+ if (delegate == newDelegate) {
+ return;
+ }
+ if (delegate != null) {
+ delegate.removeSelectionChangedListener(selectionListener);
+ if (delegate instanceof IPostSelectionProvider) {
+ ((IPostSelectionProvider)delegate).removePostSelectionChangedListener(postSelectionListener);
+ }
+ }
+ delegate = newDelegate;
+ if (newDelegate != null) {
+ newDelegate.addSelectionChangedListener(selectionListener);
+ if (newDelegate instanceof IPostSelectionProvider) {
+ ((IPostSelectionProvider)newDelegate).addPostSelectionChangedListener(postSelectionListener);
+ }
+ fireSelectionChanged(newDelegate.getSelection());
+ firePostSelectionChanged(newDelegate.getSelection());
+ }
+ }
+
+ protected void fireSelectionChanged(ISelection selection) {
+ fireSelectionChanged(selectionListeners, selection);
+ }
+
+ protected void firePostSelectionChanged(ISelection selection) {
+ fireSelectionChanged(postSelectionListeners, selection);
+ }
+
+ private void fireSelectionChanged(ListenerList list, ISelection selection) {
+ SelectionChangedEvent event = new SelectionChangedEvent(delegate, selection);
+ Object[] listeners = list.getListeners();
+ for (int i = 0; i < listeners.length; i++) {
+ ISelectionChangedListener listener = (ISelectionChangedListener) listeners[i];
+ listener.selectionChanged(event);
+ }
+ }
+
+ // IPostSelectionProvider Implementation
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionListeners.add(listener);
+ }
+
+ public void removeSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ selectionListeners.remove(listener);
+ }
+
+ public void addPostSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ postSelectionListeners.add(listener);
+ }
+
+ public void removePostSelectionChangedListener(
+ ISelectionChangedListener listener) {
+ postSelectionListeners.remove(listener);
+ }
+
+ public ISelection getSelection() {
+ return delegate == null ? null : delegate.getSelection();
+ }
+
+ public void setSelection(ISelection selection) {
+ if (delegate != null) {
+ delegate.setSelection(selection);
+ }
+ }
+
+}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderWrapper.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderWrapper.java new file mode 100644 index 00000000000..8a4e61a049b --- /dev/null +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/SelectionProviderWrapper.java @@ -0,0 +1,85 @@ +package org.eclipse.osee.framework.ui.skynet;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+
+public class SelectionProviderWrapper implements ISelectionProvider{
+
+ private ISelectionProvider provider;
+ private List selectionListeners;
+ private ISelection sel = StructuredSelection.EMPTY;
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ if (selectionListeners == null) selectionListeners = new ArrayList(1);
+ selectionListeners.add(listener);
+ if (provider != null) provider.addSelectionChangedListener(listener);
+ }
+
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ if (selectionListeners != null){
+ selectionListeners.remove(listener);
+ if (provider != null) provider.removeSelectionChangedListener(listener);
+ }
+ }
+
+ public ISelection getSelection() {
+ return provider != null ? provider.getSelection() : sel;
+ }
+
+ public void setSelection(ISelection selection) {
+ if (provider != null){
+ provider.setSelection(selection);
+ }else{
+ sel = selection;
+ if (selectionListeners != null){
+ SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
+ for (Iterator it=selectionListeners.iterator(); it.hasNext();){
+ ((ISelectionChangedListener)it.next()).selectionChanged(event);
+ }
+ }
+
+ }
+ }
+
+ public void setSelectionProvider(ISelectionProvider provider){
+ if (this.provider != provider){
+ ISelection _sel = null;
+ if (selectionListeners != null){
+ int c = selectionListeners.size();
+ ISelectionChangedListener listener;
+ if (this.provider != null){
+ for (int i=0; i<c; i++){
+ listener = (ISelectionChangedListener) selectionListeners.get(i);
+ this.provider.removeSelectionChangedListener(listener);
+ }
+ }
+
+ if (provider != null){
+ for (int i=0; i<c; i++){
+ listener = (ISelectionChangedListener) selectionListeners.get(i);
+ provider.addSelectionChangedListener(listener);
+ }
+
+ _sel = provider.getSelection();
+ }else{
+ _sel = sel;
+ }
+ }
+ this.provider = provider;
+ if (_sel != null){
+ //force a selection change event propagation
+ setSelection(_sel);
+ }
+ }
+ }
+
+ public ISelectionProvider getSelectionProvider(){
+ return provider;
+ }
+}
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java new file mode 100644 index 00000000000..723e91c513f --- /dev/null +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/WrapperForRelationLink.java @@ -0,0 +1,65 @@ +/* + * Created on Aug 14, 2009 + * + * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE + */ +package org.eclipse.osee.framework.ui.skynet; + +import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.osee.framework.skynet.core.artifact.Artifact; +import org.eclipse.osee.framework.skynet.core.relation.RelationSide; +import org.eclipse.osee.framework.skynet.core.relation.RelationType; + +/** + * @author b1528444 + * + */ +class WrapperForRelationLink implements IAdaptable{ + + private RelationType relationType; + private Artifact artifactA; + private Artifact artifactB; + private Artifact other; + + public WrapperForRelationLink(RelationType relationType, Artifact other, Artifact artifactA, Artifact artifactB) { + this.relationType = relationType; + this.artifactA = artifactA; + this.artifactB = artifactB; + this.other = other; + } + + RelationType getRelationType() { + return relationType; + } + + Artifact getArtifactA() { + return artifactA; + } + + Artifact getArtifactB() { + return artifactB; + } + + Artifact getOther() { + return other; + } + + RelationSide getRelationSide(){ + if(other.equals(artifactB)){ + return RelationSide.SIDE_B; + } else { + return RelationSide.SIDE_A; + } + } + + /* (non-Javadoc) + * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) + */ + @Override + public Object getAdapter(Class arg0) { + if(arg0.equals(Artifact.class)){ + return other; + } + return null; + } +} diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java index 51b7e368d32..9133b9d9fcb 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/editor/sections/RelationsFormSection.java @@ -61,7 +61,8 @@ public class RelationsFormSection extends ArtifactEditorFormSection { toolkit.adapt(dragDropLabel, true, true);
relationComposite =
- new RelationsComposite(getEditor(), sectionBody, SWT.NONE, getEditor().getEditorInput().getArtifact());
+ new RelationsComposite(getEditor(),sectionBody, SWT.NONE, getEditor().getEditorInput().getArtifact());
+
relationComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
section.setClient(sectionBody);
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LexicographicalRelationSort.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LexicographicalRelationSort.java index 97bb6009ec2..a24af2ab351 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LexicographicalRelationSort.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/operation/LexicographicalRelationSort.java @@ -15,10 +15,8 @@ import java.util.Collection; import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.relation.CoreRelationEnumeration;
-import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactNameComparator;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactNameComparator;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
@@ -38,9 +36,9 @@ public class LexicographicalRelationSort extends AbstractBlam { SkynetTransaction transaction = new SkynetTransaction(artifacts.get(0).getBranch());
for (Artifact parent : artifacts) {
- RelationManager.sortRelatedArtifacts(parent, CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD,
- nameComparator);
- parent.persistAttributesAndRelations(transaction);
+// RelationManager.sortRelatedArtifacts(parent, CoreRelationEnumeration.DEFAULT_HIERARCHICAL__CHILD,
+// nameComparator);
+// parent.persistAttributesAndRelations(transaction);
}
transaction.execute();
/* OseeEventManager.kickRelationModifiedEvent(RelationManager.class, RelationModType.ReOrdered, relation,
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java index d00ab063565..d7e0a3b1417 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorer.java @@ -473,7 +473,7 @@ public class GroupExplorer extends ViewPart implements IFrameworkTransactionEven } else {
rootArt = topArt;
rootItem = new GroupExplorerItem(treeViewer, rootArt, null, this);
- rootItem.getGroupItems();
+// rootItem.getGroupItems();
}
if (treeViewer != null) {
diff --git a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerItem.java b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerItem.java index 24840bc0be4..ea7b569b630 100644 --- a/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerItem.java +++ b/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/group/GroupExplorerItem.java @@ -45,19 +45,26 @@ public class GroupExplorerItem implements IAdaptable { } public boolean contains(Artifact artifact) { - for (GroupExplorerItem item : getGroupItems()) { + for (GroupExplorerItem item : getGroupItemsCached()) { if (item.getArtifact() != null && item.getArtifact().equals(artifact)) return true; } return false; } /** + * @return + */ + private List<GroupExplorerItem> getGroupItemsCached() { + return groupItems; + } + + /** * @param artifact to match with * @return UGI that contains artifact */ public GroupExplorerItem getItem(Artifact artifact) { if (this.artifact != null && this.artifact.equals(artifact)) return this; - for (GroupExplorerItem item : getGroupItems()) { + for (GroupExplorerItem item : getGroupItemsCached()) { GroupExplorerItem ugi = item.getItem(artifact); if (ugi != null) return ugi; } @@ -94,29 +101,42 @@ public class GroupExplorerItem implements IAdaptable { // Light loading; load the first time getChildren is called if (groupItems == null) { groupItems = new ArrayList<GroupExplorerItem>(); - populateUpdateCategory(); +// populateUpdateCategory(); } - List<GroupExplorerItem> items = new ArrayList<GroupExplorerItem>(); - if (groupItems != null) items.addAll(groupItems); - return items; - } - - /** - * Populate/Update this category with it's necessary children items - */ - public void populateUpdateCategory() { +// populateUpdateCategory(); +// List<GroupExplorerItem> items = new ArrayList<GroupExplorerItem>(); +// if (groupItems != null) items.addAll(groupItems); +// return items; + try { - for (GroupExplorerItem item : getGroupItems()) { - removeGroupItem(item); - } - for (Artifact art : artifact.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS)) { - addGroupItem(new GroupExplorerItem(treeViewer, art, this, groupExplorer)); + List<Artifact> related = artifact.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS); + for (Artifact art : related) { + addGroupItem(new GroupExplorerItem(treeViewer, art, this, groupExplorer)); } } catch (OseeCoreException ex) { OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); } + List<GroupExplorerItem> items = new ArrayList<GroupExplorerItem>(); + if (groupItems != null) items.addAll(groupItems); + return items; } +// /** +// * Populate/Update this category with it's necessary children items +// */ +// public void populateUpdateCategory() { +// try { +// for (GroupExplorerItem item : getGroupItems()) { +// removeGroupItem(item); +// } +// for (Artifact art : artifact.getRelatedArtifacts(CoreRelationEnumeration.UNIVERSAL_GROUPING__MEMBERS)) { +// addGroupItem(new GroupExplorerItem(treeViewer, art, this, groupExplorer)); +// } +// } catch (OseeCoreException ex) { +// OseeLog.log(SkynetGuiPlugin.class, Level.SEVERE, ex); +// } +// } + public void addGroupItem(GroupExplorerItem item) { if (!groupItems.contains(item)) { groupItems.add(item); |