diff options
author | Roberto E. Escobar | 2012-07-09 22:22:56 +0000 |
---|---|---|
committer | Roberto E. Escobar | 2012-07-09 22:26:03 +0000 |
commit | e45137fef2de5dc8262207f86e82f5dc7e39506f (patch) | |
tree | de6c317808e5b6c3c98c7dfa13e1f00ece190845 | |
parent | 300519ff05bc6f4cf96ec0563c3ccc752280b592 (diff) | |
download | org.eclipse.osee-e45137fef2de5dc8262207f86e82f5dc7e39506f.tar.gz org.eclipse.osee-e45137fef2de5dc8262207f86e82f5dc7e39506f.tar.xz org.eclipse.osee-e45137fef2de5dc8262207f86e82f5dc7e39506f.zip |
refinement[ats_704RZ]: Remove Cross Branch Link attribute type
9 files changed, 0 insertions, 415 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java index 33f709942f4..72a8f704648 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/editor/SMARelationsHyperlinkComposite.java @@ -21,13 +21,11 @@ import org.eclipse.osee.ats.util.AtsUtil; import org.eclipse.osee.ats.util.widgets.dialog.AICheckTreeDialog; import org.eclipse.osee.framework.core.data.IRelationTypeSide; import org.eclipse.osee.framework.core.enums.Active; -import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.CoreRelationTypes; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; -import org.eclipse.osee.framework.skynet.core.relation.crossbranch.CrossBranchLinkManager; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; import org.eclipse.osee.framework.ui.skynet.render.RendererManager; import org.eclipse.osee.framework.ui.swt.ALayout; @@ -98,9 +96,6 @@ public class SMARelationsHyperlinkComposite extends Composite { if (smaArt instanceof AbstractReviewArtifact && ((AbstractReviewArtifact) smaArt).getActionableItemsDam().getActionableItemGuids().size() > 0) { return true; } - if (smaArt.getAttributeCount(CoreAttributeTypes.CrossBranchLink) > 0) { - return true; - } return false; } @@ -115,10 +110,6 @@ public class SMARelationsHyperlinkComposite extends Composite { for (final Artifact art : thisArt.getRelatedArtifacts(relationEnum)) { createLink(art, prefix, action, thisArt); } - for (final Artifact art : CrossBranchLinkManager.getRelatedArtifacts(thisArt, relationEnum)) { - createLink(art, prefix, action, thisArt); - - } } private void createLink(final Artifact art, String prefix, String action, Artifact thisArt) { diff --git a/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee b/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee index 1d7ece355a5..9c321501a5c 100644 --- a/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee +++ b/plugins/org.eclipse.osee.ats/support/OseeTypes_ATS.osee @@ -164,7 +164,6 @@ artifactType "Team Workflow" extends "ats.State Machine", "Abstract Access Contr attribute "ats.Proposed Resolution" attribute "ats.Team Definition" attribute "ats.User Community" - attribute "Cross Branch Link" attribute "ats.Operational Impact" attribute "ats.Operational Impact Description" attribute "ats.Operational Impact Workaround" diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java index bdf6898a0ca..b387ad1d54e 100644 --- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java +++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/enums/CoreAttributeTypes.java @@ -34,7 +34,6 @@ public final class CoreAttributeTypes { public static final IAttributeType ContentUrl = TokenFactory.createAttributeType(0x100000000000007CL, "Content URL"); public static final IAttributeType Country = TokenFactory.createAttributeType(0x1000000000000060L, "Country"); public static final IAttributeType CrewInterfaceRequirement = TokenFactory.createAttributeType(0x1000000000000082L, "Crew Interface Requirement"); - public static final IAttributeType CrossBranchLink = TokenFactory.createAttributeType(0x1000000000000056L, "Cross Branch Link"); public static final IAttributeType Csci = TokenFactory.createAttributeType(0x10000000000000A0L, "CSCI"); public static final IAttributeType DefaultMailServer = TokenFactory.createAttributeType(0x1000000000000057L, "osee.config.Default Mail Server"); public static final IAttributeType DefaultGroup = TokenFactory.createAttributeType(0x100000000000006EL, "Default Group"); diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java index e21545f128e..e08c4d879fb 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java +++ b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/FrameworkCore_Demo_Suite.java @@ -46,7 +46,6 @@ import org.eclipse.osee.framework.skynet.core.event.systems.FrameworkEventToRemo import org.eclipse.osee.framework.skynet.core.importing.ImportingSuite; import org.eclipse.osee.framework.skynet.core.importing.parsers.ParsersSuite; import org.eclipse.osee.framework.skynet.core.internal.event.EventTestSuite; -import org.eclipse.osee.framework.skynet.core.relation.CrossBranchLinkTest; import org.eclipse.osee.framework.skynet.core.relation.RelationTestSuite; import org.eclipse.osee.framework.skynet.core.revision.ConflictTest; import org.eclipse.osee.framework.skynet.core.transaction.TransactionTestSuite; @@ -64,7 +63,6 @@ import org.junit.runners.Suite; BranchSuite.class, UserManagerTest.class, AttributePurgeTest.class, - CrossBranchLinkTest.class, UpdateBookmarkIdTest.class, ArtifactEventFiltersTest.class, BranchEventFiltersTest.class, diff --git a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java b/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java deleted file mode 100644 index 89a54026b8c..00000000000 --- a/plugins/org.eclipse.osee.framework.skynet.core.test/src/org/eclipse/osee/framework/skynet/core/relation/CrossBranchLinkTest.java +++ /dev/null @@ -1,146 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.framework.skynet.core.relation; - -import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.enums.CoreArtifactTypes; -import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; -import org.eclipse.osee.framework.core.enums.CoreRelationTypes; -import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.operation.Operations; -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.BranchManager; -import org.eclipse.osee.framework.skynet.core.artifact.PurgeArtifacts; -import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery; -import org.eclipse.osee.framework.skynet.core.relation.crossbranch.CrossBranchLink; -import org.eclipse.osee.framework.skynet.core.relation.crossbranch.CrossBranchLinkManager; -import org.eclipse.osee.support.test.util.DemoSawBuilds; -import org.eclipse.osee.support.test.util.TestUtil; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * @author Donald G. Dunne - */ -public class CrossBranchLinkTest { - - public static Artifact folderArt; - - @BeforeClass - public static void setUp() throws Exception { - tearDown(); - folderArt = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.Folder, BranchManager.getCommonBranch(), - CrossBranchLinkTest.class.getSimpleName()); - folderArt.persist("CrossBranchLinkTest"); - } - - @AfterClass - public static void tearDown() throws Exception { - List<Artifact> artifacts = new ArrayList<Artifact>(); - artifacts.addAll(ArtifactQuery.getArtifactListFromName(CrossBranchLinkTest.class.getSimpleName() + "%", - BranchManager.getCommonBranch(), EXCLUDE_DELETED)); - artifacts.addAll(ArtifactQuery.getArtifactListFromName(CrossBranchLinkTest.class.getSimpleName() + "%", - DemoSawBuilds.SAW_Bld_1, EXCLUDE_DELETED)); - Operations.executeWorkAndCheckStatus(new PurgeArtifacts(artifacts)); - TestUtil.sleep(4000); - } - - @Test - public void testCrossBranchLink() throws OseeCoreException { - Artifact artifact1 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, - getClass().getSimpleName() + "-1"); - artifact1.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); - artifact1.persist(getClass().getSimpleName()); - - // test equals - CrossBranchLink linkA = new CrossBranchLink(CoreRelationTypes.SupportingInfo_SupportingInfo, artifact1); - CrossBranchLink linkB = new CrossBranchLink(CoreRelationTypes.SupportingInfo_SupportingInfo, artifact1); - Assert.assertTrue(linkA.equals(linkB)); - linkB = new CrossBranchLink(CoreRelationTypes.SupportingInfo_SupportedBy, artifact1); - Assert.assertFalse(linkA.equals(linkB)); - - // test addRelation - CrossBranchLinkManager.addRelation(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo, artifact1); - - Collection<CrossBranchLink> links = CrossBranchLinkManager.getLinks(folderArt); - Assert.assertEquals(1, links.size()); - CrossBranchLink link = links.iterator().next(); - Assert.assertEquals(CoreRelationTypes.SupportingInfo_SupportingInfo, link.getRelationEnum()); - Assert.assertEquals(artifact1, link.getArtifact()); - - Artifact artifact2 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, - getClass().getSimpleName() + "-2"); - artifact2.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); - artifact2.persist(getClass().getSimpleName()); - - CrossBranchLinkManager.addRelation(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo, artifact2); - - Artifact artifact3 = - ArtifactTypeManager.addArtifact(CoreArtifactTypes.GeneralDocument, DemoSawBuilds.SAW_Bld_1, - getClass().getSimpleName() + "-3"); - artifact3.addAttribute(CoreAttributeTypes.StaticId, CrossBranchLinkTest.class.getSimpleName()); - artifact3.persist(getClass().getSimpleName()); - - CrossBranchLinkManager.addRelation(folderArt, CoreRelationTypes.Supercedes_Supercedes, artifact3); - - // test getLinks - links = CrossBranchLinkManager.getLinks(folderArt); - Assert.assertEquals(3, links.size()); - - boolean found1 = false, found2 = false, found3 = false; - for (CrossBranchLink linkItem : links) { - if (linkItem.getArtifact().equals(artifact1)) { - Assert.assertEquals(CoreRelationTypes.SupportingInfo_SupportingInfo, linkItem.getRelationEnum()); - found1 = true; - } else if (linkItem.getArtifact().equals(artifact2)) { - Assert.assertEquals(CoreRelationTypes.SupportingInfo_SupportingInfo, linkItem.getRelationEnum()); - found2 = true; - } else if (linkItem.getArtifact().equals(artifact3)) { - Assert.assertEquals(CoreRelationTypes.Supercedes_Supercedes, linkItem.getRelationEnum()); - found3 = true; - } - } - Assert.assertTrue(found1); - Assert.assertTrue(found2); - Assert.assertTrue(found3); - - // test getRelatedArtifactCount - Assert.assertEquals(2, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo)); - Assert.assertEquals(0, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.SupportingInfo_SupportedBy)); - Assert.assertEquals(1, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.Supercedes_Supercedes)); - - // test deleteRelation - CrossBranchLinkManager.deleteRelation(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo, artifact1); - Assert.assertEquals(1, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo)); - - // test deleteRelations - CrossBranchLinkManager.addRelation(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo, artifact1); - Assert.assertEquals(2, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo)); - CrossBranchLinkManager.deleteRelations(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo); - Assert.assertEquals(0, - CrossBranchLinkManager.getRelatedArtifactCount(folderArt, CoreRelationTypes.SupportingInfo_SupportingInfo)); - } - -} diff --git a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF index 27ac030fa98..f4b12f55601 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.osee.framework.skynet.core/META-INF/MANIFEST.MF @@ -40,7 +40,6 @@ 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.crossbranch, org.eclipse.osee.framework.skynet.core.relation.order, org.eclipse.osee.framework.skynet.core.revision, org.eclipse.osee.framework.skynet.core.transaction, diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLink.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLink.java deleted file mode 100644 index be07f35d85b..00000000000 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLink.java +++ /dev/null @@ -1,166 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.framework.skynet.core.relation.crossbranch; - -import java.util.logging.Level; -import org.eclipse.osee.framework.core.data.IRelationTypeSide; -import org.eclipse.osee.framework.core.data.TokenFactory; -import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; -import org.eclipse.osee.framework.core.enums.RelationSide; -import org.eclipse.osee.framework.core.exception.OseeCoreException; -import org.eclipse.osee.framework.core.model.event.DefaultBasicGuidArtifact; -import org.eclipse.osee.framework.core.model.type.RelationType; -import org.eclipse.osee.framework.jdk.core.util.AXml; -import org.eclipse.osee.framework.logging.OseeLog; -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.artifact.search.ArtifactQuery; -import org.eclipse.osee.framework.skynet.core.internal.Activator; -import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager; - -public class CrossBranchLink { - - public Artifact artifact; - public DefaultBasicGuidArtifact guidArt; - public IRelationTypeSide relationEnum; - public boolean aSide; - public Attribute<?> matchingAttribute; - - public CrossBranchLink(Attribute<?> attr) { - this.matchingAttribute = attr; - try { - this.artifact = attr.getArtifact(); - unPack(); - } catch (OseeCoreException ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } - - public CrossBranchLink(IRelationTypeSide relationEnum, Artifact artifact) { - this.relationEnum = relationEnum; - this.artifact = artifact; - this.guidArt = artifact.getBasicGuidArtifact(); - this.aSide = relationEnum.getSide().isSideA(); - } - - public Attribute<?> getMatchingAttribute() { - return matchingAttribute; - } - - public void setMatchingAttribute(Attribute<?> matchingAttribute) { - this.matchingAttribute = matchingAttribute; - } - - public String toXml() throws OseeCoreException { - RelationType relationType = RelationTypeManager.getType(relationEnum); - StringBuffer sb = new StringBuffer(AXml.addTagData("relTypeGuid", String.valueOf(relationType.getGuid()))); - sb.append(AXml.addTagData("artGuid", artifact.getGuid())); - sb.append(AXml.addTagData("artTypeGuid", String.valueOf(artifact.getArtTypeGuid()))); - sb.append(AXml.addTagData("branchGuid", artifact.getBranchGuid())); - sb.append(AXml.addTagData("aSide", String.valueOf(relationEnum.getSide().isSideA()))); - return sb.toString(); - } - - public void store(Artifact onArtifact) throws OseeCoreException { - onArtifact.addAttribute(CoreAttributeTypes.CrossBranchLink, toXml()); - } - - public void fromXml(String xmlStr) throws OseeCoreException { - String artGuid = AXml.getTagData(xmlStr, "artGuid"); - String branchGuid = AXml.getTagData(xmlStr, "branchGuid"); - String artTypeGuid = AXml.getTagData(xmlStr, "artTypeGuid"); - Long relTypeGuid = Long.parseLong(AXml.getTagData(xmlStr, "relTypeGuid")); - aSide = AXml.getTagBooleanData(xmlStr, "aSide"); - final RelationType relationType = RelationTypeManager.getTypeByGuid(relTypeGuid); - - RelationSide side = aSide ? RelationSide.SIDE_A : RelationSide.SIDE_B; - relationEnum = TokenFactory.createRelationTypeSide(side, relationType.getGuid(), relationType.getName()); - guidArt = new DefaultBasicGuidArtifact(branchGuid, Long.valueOf(artTypeGuid), artGuid); - } - - private void unPack() throws OseeCoreException { - if (relationEnum == null) { - String xmlStr = (String) matchingAttribute.getValue(); - fromXml(xmlStr); - } - } - - public RelationType getRelationType() throws OseeCoreException { - unPack(); - return RelationTypeManager.getType(relationEnum); - } - - public Artifact getArtifact() throws OseeCoreException { - if (artifact != null) { - unPack(); - artifact = ArtifactQuery.getArtifactFromToken(guidArt); - } - return artifact; - } - - public void setArtifact(Artifact artifact) { - this.artifact = artifact; - } - - public IRelationTypeSide getRelationEnum() throws OseeCoreException { - if (relationEnum == null) { - unPack(); - } - return relationEnum; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (aSide ? 1231 : 1237); - result = prime * result + ((guidArt == null) ? 0 : guidArt.hashCode()); - result = prime * result + ((relationEnum == null) ? 0 : relationEnum.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - CrossBranchLink other = (CrossBranchLink) obj; - if (aSide != other.aSide) { - return false; - } - if (guidArt == null) { - if (other.guidArt != null) { - return false; - } - } else if (!guidArt.equals(other.guidArt)) { - return false; - } - if (relationEnum == null) { - if (other.relationEnum != null) { - return false; - } - } else if (!relationEnum.equals(other.relationEnum)) { - return false; - } - return true; - } - - @Override - public String toString() { - return String.format("[%s - %s - %s]", relationEnum, aSide, guidArt); - } -} diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLinkManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLinkManager.java deleted file mode 100644 index ecd1b87a739..00000000000 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/relation/crossbranch/CrossBranchLinkManager.java +++ /dev/null @@ -1,81 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.framework.skynet.core.relation.crossbranch; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import org.eclipse.osee.framework.core.data.IRelationTypeSide; -import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; -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; - -/** - * This class provides the ability for an artifact to link to an artifact on another branch. It is not a full featured - * link and is also omni-directional, so care must be taken when using this.<br> - * The information for this link is stored as attributes on the sideA artifact. User needs to be aware that the relation - * type, branch and artifact may not exist when the link is accessed, so care must be taken when using this.<br> - * <br> - * Link uses the Cross Branch Link attribute which must be added as a valid attribute on the SIDE_A artifact type. <br> - * <br> - * TODO Remove this class and replace with framework cross branch links when available. - * - * @author Donald G. Dunne - */ -public class CrossBranchLinkManager { - - public static void addRelation(Artifact artifact, IRelationTypeSide relationSide, Artifact otherArt) throws OseeCoreException { - CrossBranchLink newLink = new CrossBranchLink(relationSide, otherArt); - if (!getLinks(artifact).contains(newLink)) { - newLink.store(artifact); - } - } - - public static List<Artifact> getRelatedArtifacts(Artifact artifact, IRelationTypeSide relationEnum) throws OseeCoreException { - List<Artifact> artifacts = new ArrayList<Artifact>(); - for (CrossBranchLink link : getLinks(artifact)) { - if (link.getRelationType().equals(relationEnum) && link.aSide == relationEnum.getSide().isSideA()) { - artifacts.add(link.getArtifact()); - } - } - return artifacts; - } - - public static int getRelatedArtifactCount(Artifact artifact, IRelationTypeSide relationEnum) throws OseeCoreException { - return getRelatedArtifacts(artifact, relationEnum).size(); - } - - public static void deleteRelation(Artifact artifact, IRelationTypeSide relationSide, Artifact otherArt) throws OseeCoreException { - CrossBranchLink newLink = new CrossBranchLink(relationSide, otherArt); - for (CrossBranchLink link : getLinks(artifact)) { - if (link.equals(newLink)) { - link.getMatchingAttribute().delete(); - } - } - } - - public static void deleteRelations(Artifact artifact, IRelationTypeSide relationSide) throws OseeCoreException { - for (CrossBranchLink link : getLinks(artifact)) { - if (link.getRelationEnum().equals(relationSide)) { - link.getMatchingAttribute().delete(); - } - } - } - - public static Collection<CrossBranchLink> getLinks(Artifact artifact) throws OseeCoreException { - List<CrossBranchLink> links = new ArrayList<CrossBranchLink>(); - for (Attribute<?> attr : artifact.getAttributes(CoreAttributeTypes.CrossBranchLink)) { - links.add(new CrossBranchLink(attr)); - } - return links; - } -} diff --git a/plugins/org.eclipse.osee.framework.skynet.core/support/OseeTypes_Framework.osee b/plugins/org.eclipse.osee.framework.skynet.core/support/OseeTypes_Framework.osee index 01dcd1dcd6d..eff85fe8ae1 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/support/OseeTypes_Framework.osee +++ b/plugins/org.eclipse.osee.framework.skynet.core/support/OseeTypes_Framework.osee @@ -38,14 +38,6 @@ attributeType "Branch Reference" extends BranchReferenceAttribute { description "Light-weight branch reference" } -attributeType "Cross Branch Link" extends StringAttribute { - guid "AXUR3KcbcVPqyNCdQmAA" - uuid 0x1000000000000056 - dataProvider DefaultAttributeDataProvider - min 0 - max unlimited -} - attributeType "osee.config.Default Mail Server" extends StringAttribute { guid "ABMuIC3FejpGilonfAgA" uuid 0x1000000000000057 |