Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordExtractorData.java14
2 files changed, 18 insertions, 5 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
index 140d3a3b257..3343bb89b43 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/UpdateArtifactOperation.java
@@ -24,7 +24,6 @@ import java.util.logging.Level;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
-import org.eclipse.osee.framework.core.enums.DeletionFlag;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.exception.OseeExceptions;
@@ -33,12 +32,10 @@ import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.jdk.core.util.Collections;
import org.eclipse.osee.framework.jdk.core.util.Lib;
-import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.jdk.core.util.xml.Jaxp;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.linking.LinkType;
import org.eclipse.osee.framework.skynet.core.linking.WordMlLinkHandler;
import org.eclipse.osee.framework.skynet.core.word.WordUtil;
@@ -166,12 +163,14 @@ public class UpdateArtifactOperation extends AbstractOperation {
}
private Artifact getArtifact(WordExtractorData artifactElement) throws OseeCoreException {
+ Artifact artifact;
if (artifacts.size() == 1) {
return artifacts.get(0);
}
- if (Strings.isValid(artifactElement.getGuid())) {
- return ArtifactQuery.getArtifactFromId(artifactElement.getGuid(), branch, DeletionFlag.INCLUDE_DELETED);
+ artifact = artifactElement.getArtifact(branch);
+ if (artifact != null) {
+ return artifact;
}
throw new OseeArgumentException("didn't find the guid attribure in element [%s]", artifactElement);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordExtractorData.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordExtractorData.java
index 317493f52a4..66e83096586 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordExtractorData.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/artifactElement/WordExtractorData.java
@@ -5,6 +5,12 @@
*/
package org.eclipse.osee.framework.ui.skynet.render.artifactElement;
+import org.eclipse.osee.framework.core.enums.DeletionFlag;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -14,6 +20,7 @@ import org.w3c.dom.Node;
public class WordExtractorData {
private Element parent;
private String guid;
+ private Artifact artifact;
public void setGuid(String guid) {
this.guid = guid;
@@ -34,4 +41,11 @@ public class WordExtractorData {
public Element getParentEelement() {
return parent;
}
+
+ public Artifact getArtifact(Branch branch) throws OseeCoreException {
+ if (artifact == null && Strings.isValid(getGuid())) {
+ artifact = ArtifactQuery.getArtifactFromId(getGuid(), branch, DeletionFlag.INCLUDE_DELETED);
+ }
+ return artifact;
+ }
}

Back to the top