summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2010-12-01 19:24:02 (EST)
committer Ryan D. Brooks2010-12-01 19:24:02 (EST)
commit3aea9430988d38b5eecf7de10a756c2be7517855 (patch)
tree58314ca4b5ded90d168ef2ed62a0c1f55c39e501
parent5e51d64f91080047870e3f05f38345410e5dfcb7 (diff)
downloadorg.eclipse.osee-3aea9430988d38b5eecf7de10a756c2be7517855.zip
org.eclipse.osee-3aea9430988d38b5eecf7de10a756c2be7517855.tar.gz
org.eclipse.osee-3aea9430988d38b5eecf7de10a756c2be7517855.tar.bz2
bug[ats_7QF9T]: Artifact import fixes
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/parsers/ExcelArtifactExtractor.java83
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java10
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/FrameworkUi_Demo_Suite.java34
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java215
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ImportTestSuite.java23
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_Base.xml205
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_SimpleChild.xml196
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_attributeCopyTest.xml205
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportOperationFactory.java64
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportWizard.java46
12 files changed, 1020 insertions, 81 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/parsers/ExcelArtifactExtractor.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/parsers/ExcelArtifactExtractor.java
index ef9e189..ea4bbfc 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/parsers/ExcelArtifactExtractor.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/parsers/ExcelArtifactExtractor.java
@@ -14,9 +14,12 @@ import java.io.File;
import java.io.FileFilter;
import java.io.InputStreamReader;
import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
import java.util.logging.Level;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
@@ -80,6 +83,33 @@ public class ExcelArtifactExtractor extends AbstractArtifactExtractor {
private final DoubleKeyHashMap<String, Integer, RoughArtifact> relationHelper =
new DoubleKeyHashMap<String, Integer, RoughArtifact>();
+ private static enum RowTypeEnum {
+ PARAGRAPH_NO(CoreAttributeTypes.ParagraphNumber.getName()),
+ ARTIFACT_NAME(CoreAttributeTypes.Name.getName()),
+ GUID("GUID"),
+ HRID("Human Readable Id"),
+ OTHER("");
+
+ private final static Map<String, RowTypeEnum> rawStringToRowType = new HashMap<String, RowTypeEnum>();
+
+ public String _rowType;
+
+ RowTypeEnum(String rowType) {
+ _rowType = rowType;
+ }
+
+ public static synchronized RowTypeEnum fromString(String value) {
+ if (rawStringToRowType.isEmpty()) {
+ for (RowTypeEnum enumStatus : RowTypeEnum.values()) {
+ RowTypeEnum.rawStringToRowType.put(enumStatus._rowType, enumStatus);
+ }
+ }
+ RowTypeEnum returnVal = rawStringToRowType.get(value);
+ return returnVal != null ? returnVal : OTHER;
+ }
+ }
+ private final Map<Integer, RowTypeEnum> rowIndexToRowTypeMap = new HashMap<Integer, RowTypeEnum>();
+
private final Matcher guidMatcher;
private final RoughArtifactCollector collector;
@@ -132,8 +162,15 @@ public class ExcelArtifactExtractor extends AbstractArtifactExtractor {
rowCount++;
this.headerRow = headerRow.clone();
for (int i = 0; i < this.headerRow.length; i++) {
- if (headerRow[i] != null && headerRow[i].trim().length() == 0) {
+ String value = headerRow[i];
+ if (value != null) {
+ value = value.trim();
+ }
+ if (!Strings.isValid(value)) {
this.headerRow[i] = null;
+ } else {
+ RowTypeEnum rowTypeEnum = RowTypeEnum.fromString(value);
+ rowIndexToRowTypeMap.put(i, rowTypeEnum);
}
}
}
@@ -154,26 +191,42 @@ public class ExcelArtifactExtractor extends AbstractArtifactExtractor {
collector.addRoughRelation(new RoughRelation(row[0], guida, guidb, row[5]));
} else {
RoughArtifact roughArtifact = new RoughArtifact(RoughArtifactKind.PRIMARY);
- for (int i = 0; i < row.length; i++) {
- if (headerRow[i] != null) {
- if (headerRow[i].equalsIgnoreCase("Outline Number")) {
- if (row[i] == null) {
- throw new OseeArgumentException("Outline Number must not be blank");
+ if (!rowIndexToRowTypeMap.isEmpty()) {
+ for (int rowIndex = 0; rowIndex < row.length; rowIndex++) {
+ RowTypeEnum rowType = rowIndexToRowTypeMap.get(rowIndex);
+
+ String rowValue = row[rowIndex];
+
+ if (Strings.isValid(rowValue)) {
+ switch (rowType) {
+ case PARAGRAPH_NO:
+ roughArtifact.setSectionNumber(row[rowIndex]);
+ roughArtifact.addAttribute(CoreAttributeTypes.ParagraphNumber, rowValue);
+ break;
+ case ARTIFACT_NAME:
+ roughArtifact.addAttribute(CoreAttributeTypes.Name, rowValue);
+ break;
+ case GUID:
+ roughArtifact.setGuid(rowValue);
+ break;
+ case HRID:
+ roughArtifact.setHumandReadableId(rowValue);
+ break;
+ case OTHER:
+ roughArtifact.addAttribute(headerRow[rowIndex], rowValue);
+ break;
}
- roughArtifact.setSectionNumber(row[i]);
- } else if (headerRow[i].equalsIgnoreCase("GUID")) {
- roughArtifact.setGuid(row[i]);
- } else if (headerRow[i].equalsIgnoreCase("Human Readable Id")) {
- roughArtifact.setHumandReadableId(row[i]);
} else {
- if (Strings.isValid(row[i])) {
- roughArtifact.addAttribute(headerRow[i], row[i]);
+ //complain only if row value invalid and parsing paragraph numbers
+ if (rowType == RowTypeEnum.PARAGRAPH_NO) {
+ throw new OseeArgumentException("%s must not be blank", CoreAttributeTypes.ParagraphNumber);
}
}
+
}
}
- collector.addRoughArtifact(roughArtifact);
+ collector.addRoughArtifact(roughArtifact);
relationHelper.put(primaryDescriptor.getName(), Integer.valueOf(rowCount), roughArtifact);
}
}
@@ -199,4 +252,4 @@ public class ExcelArtifactExtractor extends AbstractArtifactExtractor {
}
-} \ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java
index 100683a..7fc43f8 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/GuidBasedArtifactResolver.java
@@ -11,9 +11,11 @@
package org.eclipse.osee.framework.skynet.core.importing.resolvers;
import java.util.List;
+import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact;
@@ -39,6 +41,12 @@ public class GuidBasedArtifactResolver extends NewArtifactImportResolver {
List<Artifact> descendants = root.getDescendants();
Artifact realArtifact = null;
+ if (roughArtifact.getGuid() == null) {
+ OseeLog.format(GuidBasedArtifactResolver.class, Level.INFO,
+ "Guid based resolver is comparing a null GUID. roughArtifactifact: [%s]. Attributes: [%s]", roughArtifact,
+ roughArtifact.getAttributes());
+ }
+
for (Artifact artifact : descendants) {
if (guidsMatch(roughArtifact, artifact)) {
roughArtifact.translateAttributes(artifact);
@@ -52,4 +60,4 @@ public class GuidBasedArtifactResolver extends NewArtifactImportResolver {
return realArtifact;
}
-} \ No newline at end of file
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java
index 30a1005..7f3bed4 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/importing/resolvers/NewArtifactImportResolver.java
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.osee.framework.skynet.core.importing.resolvers;
+import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactProcessor;
import org.eclipse.osee.framework.skynet.core.artifact.ArtifactTypeManager;
@@ -36,6 +38,9 @@ public class NewArtifactImportResolver implements IArtifactImportResolver {
public Artifact resolve(final RoughArtifact roughArtifact, final Branch branch, Artifact realParent, Artifact root) throws OseeCoreException {
IArtifactType artifactType = getArtifactType(roughArtifact.getRoughArtifactKind());
+ OseeLog.format(NewArtifactImportResolver.class, Level.INFO, "New artifact: [%s]. Attributes: [%s]",
+ roughArtifact, roughArtifact.getAttributes());
+
Artifact realArtifact =
ArtifactTypeManager.getFactory(artifactType).makeNewArtifact(branch, artifactType, roughArtifact.getGuid(),
roughArtifact.getHumanReadableId(), new ArtifactProcessor() {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/FrameworkUi_Demo_Suite.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/FrameworkUi_Demo_Suite.java
index 0a9d9a3..cebade1 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/FrameworkUi_Demo_Suite.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/FrameworkUi_Demo_Suite.java
@@ -26,28 +26,30 @@ import org.eclipse.osee.framework.ui.skynet.test.cases.ViewWordChangeAndDiffTest
import org.eclipse.osee.framework.ui.skynet.test.cases.WordArtifactElementExtractorTest;
import org.eclipse.osee.framework.ui.skynet.test.cases.WordEditTest;
import org.eclipse.osee.framework.ui.skynet.test.cases.WordTrackedChangesTest;
+import org.eclipse.osee.framework.ui.skynet.test.importer.ImportTestSuite;
import org.eclipse.osee.framework.ui.skynet.test.renderer.RendererTestSuite;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
-@Suite.SuiteClasses({//
-BlamXWidgetTest.class, //
- EmailGroupsBlamTest.class, //
- ResultsEditorConverterTest.class, //
- ArtifactPasteConfigurationTest.class, //
- ArtifactPasteOperationTest.class, //
- RelationOrderRendererTest.class, //
- InterArtifactDropTest.class, //
- WordEditTest.class, //
- WordTrackedChangesTest.class, //
- PreviewAndMultiPreviewTest.class, //
- ViewWordChangeAndDiffTest.class, //
- WordArtifactElementExtractorTest.class, //
- AttributeTypeEditPresenterTest.class, //
- ArtifactPromptChangeTest.class, //
- RendererTestSuite.class})
+@Suite.SuiteClasses({
+ BlamXWidgetTest.class,
+ EmailGroupsBlamTest.class,
+ ResultsEditorConverterTest.class,
+ ArtifactPasteConfigurationTest.class,
+ ArtifactPasteOperationTest.class,
+ RelationOrderRendererTest.class,
+ InterArtifactDropTest.class,
+ WordEditTest.class,
+ WordTrackedChangesTest.class,
+ PreviewAndMultiPreviewTest.class,
+ ViewWordChangeAndDiffTest.class,
+ WordArtifactElementExtractorTest.class,
+ AttributeTypeEditPresenterTest.class,
+ ArtifactPromptChangeTest.class,
+ RendererTestSuite.class,
+ ImportTestSuite.class})
/**
* @author Donald G. Dunne
*/
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java
new file mode 100644
index 0000000..cdba3c3
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ArtifactImportWizardTest.java
@@ -0,0 +1,215 @@
+/*******************************************************************************
+ * 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.ui.skynet.test.importer;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.operation.IOperation;
+import org.eclipse.osee.framework.core.operation.Operations;
+import org.eclipse.osee.framework.logging.SevereLoggingMonitor;
+import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+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.PurgeArtifacts;
+import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact;
+import org.eclipse.osee.framework.skynet.core.importing.RoughArtifactKind;
+import org.eclipse.osee.framework.skynet.core.importing.operations.RoughArtifactCollector;
+import org.eclipse.osee.framework.skynet.core.importing.parsers.ExcelArtifactExtractor;
+import org.eclipse.osee.framework.skynet.core.importing.resolvers.IArtifactImportResolver;
+import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
+import org.eclipse.osee.framework.ui.skynet.Import.ArtifactImportOperationFactory;
+import org.eclipse.osee.framework.ui.skynet.Import.MatchingStrategy;
+import org.eclipse.osee.support.test.util.DemoSawBuilds;
+import org.eclipse.osee.support.test.util.TestUtil;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @link ArtifactImportWizard
+ * @author Karol M. Wilk
+ */
+public final class ArtifactImportWizardTest {
+
+ private static SevereLoggingMonitor monitorLog = null;
+ private static Artifact myRootArtifact = null;
+ private static String inputFilesLocation =
+ ArtifactImportWizardTest.class.getProtectionDomain().getCodeSource().getLocation() + "src";
+
+ @Test
+ public void simpleImportNobodyGetsDeleted() throws Exception {
+ int numberOfFirstLevelDescendants = myRootArtifact.getDescendants().size();
+
+ buildAndRunCoreTest("artifactExcelImportInput_Base.xml");
+
+ Assert.assertTrue("Unexpected number of descendants.",
+ numberOfFirstLevelDescendants == myRootArtifact.getDescendants().size());
+ }
+
+ @Test
+ public void removeSimpleChild() throws Exception {
+ //D will be deleted...
+ int numberOfDescendants = myRootArtifact.getDescendants().size();
+
+ buildAndRunCoreTest("artifactExcelImportInput_SimpleChild.xml");
+
+ List<Artifact> afterArtifacts = myRootArtifact.getDescendants();
+ Assert.assertTrue("Unexpected number of artifacts.", numberOfDescendants - 1 == afterArtifacts.size());
+
+ //look for D
+ Assert.assertFalse(afterArtifacts.contains("D"));
+
+ }
+
+ @Test
+ public void attributeCopyTest() throws Exception {
+ // add imported paragraph number to sample artifacts, result should have copied that imported paragraph over...
+
+ // copy imported paragraph over... because they will be matched on guid...
+ Map<String, String> answerParagraphNumbers = new HashMap<String, String>();
+ answerParagraphNumbers.put("B", "3");
+ answerParagraphNumbers.put("D", "2");
+
+ int numberOfDescendants = myRootArtifact.getDescendants().size();
+
+ buildAndRunCoreTest("artifactExcelImportInput_attributeCopyTest.xml");
+
+ List<Artifact> afterArtifacts = myRootArtifact.getDescendants();
+ Assert.assertTrue("Unexpected number of artifacts.", numberOfDescendants == afterArtifacts.size());
+
+ //check if artifacts have correct attributes copied over
+ for (Artifact artifact : afterArtifacts) {
+ String artifactName = artifact.getName();
+ List<?> attributes = artifact.getAttributes(CoreAttributeTypes.ParagraphNumber);
+ for (Object attribute : attributes) {
+ String paragraphNumberAnswer = answerParagraphNumbers.get(artifactName);
+ if (paragraphNumberAnswer != null) {
+ Assert.assertTrue(String.format("Expected attribute: %s, on Artifact %s, wasn't copied. ",
+ CoreAttributeTypes.ParagraphNumber, artifact), paragraphNumberAnswer.equals(attribute.toString()));
+ }
+ }
+ }
+ }
+
+ private void buildAndRunCoreTest(String nameOfExcelImportFile) throws Exception {
+ File inputExcelFile = new File(getResourcePath(nameOfExcelImportFile));
+ Assert.assertTrue(inputExcelFile.isFile());
+
+ IArtifactImportResolver resolver =
+ MatchingStrategy.GUID.getResolver(CoreArtifactTypes.SystemRequirement, null, true, true);
+
+ RoughArtifactCollector collector = new RoughArtifactCollector(new RoughArtifact(RoughArtifactKind.PRIMARY));
+ collector.reset();
+
+ IOperation operation =
+ ArtifactImportOperationFactory.createArtifactAndRoughToRealOperation(inputExcelFile, myRootArtifact,
+ new ExcelArtifactExtractor(), resolver, collector, Arrays.asList(CoreArtifactTypes.SystemRequirement),
+ true, true, false);
+ Operations.executeWork(operation);
+
+ Assert.assertFalse(collector.getRoughArtifacts().size() == 0);
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ //@formatter:off
+ /*
+ setup artifact tree of this form:
+ ArtifactImportWizardTest_Root
+ |
+ `--A
+ |\.__ C
+ | |
+ | `._ D
+ B
+ */
+ //@formatter:on
+
+ SkynetTransaction transaction = new SkynetTransaction(DemoSawBuilds.SAW_Bld_1, "ArtifactImportWizardTest");
+
+ myRootArtifact =
+ ArtifactTypeManager.getFactory(CoreArtifactTypes.Folder).makeNewArtifact(DemoSawBuilds.SAW_Bld_1,
+ CoreArtifactTypes.Folder, "ArtifactImportWizardTest_Root", "ArtifatImpWizaTestGUID", "12345", null);
+
+ OseeSystemArtifacts.getDefaultHierarchyRootArtifact(DemoSawBuilds.SAW_Bld_1).addChild(myRootArtifact);
+
+ Artifact artifactA =
+ ArtifactTypeManager.getFactory(CoreArtifactTypes.SoftwareRequirement).makeNewArtifact(DemoSawBuilds.SAW_Bld_1,
+ CoreArtifactTypes.SoftwareRequirement, "A", "AAAAAAAAAAAAAAAAAAAAAA", "A2345", null);
+ myRootArtifact.addChild(artifactA);
+
+ artifactA.addChild(ArtifactTypeManager.getFactory(CoreArtifactTypes.SoftwareRequirement).makeNewArtifact(
+ DemoSawBuilds.SAW_Bld_1, CoreArtifactTypes.SoftwareRequirement, "C", "CCCCCCCCCCCCCCCCCCCCCC", "C2345", null));
+
+ artifactA.addChild(ArtifactTypeManager.getFactory(CoreArtifactTypes.Requirement).makeNewArtifact(
+ DemoSawBuilds.SAW_Bld_1, CoreArtifactTypes.Requirement, "D", "DDDDDDDDDDDDDDDDDDDDDD", "D2345", null));
+
+ myRootArtifact.addChild(ArtifactTypeManager.getFactory(CoreArtifactTypes.SoftwareRequirement).makeNewArtifact(
+ DemoSawBuilds.SAW_Bld_1, CoreArtifactTypes.SoftwareRequirement, "B", "BBBBBBBBBBBBBBBBBBBBBB", "B2345", null));
+
+ myRootArtifact.persist(transaction);
+ transaction.execute();
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ new PurgeArtifacts(myRootArtifact.getDescendants()).execute();
+ new PurgeArtifacts(Collections.singletonList(myRootArtifact)).execute();
+ }
+
+ @BeforeClass
+ public static void setUpOnce() throws Exception {
+ monitorLog = TestUtil.severeLoggingStart();
+ }
+
+ @AfterClass
+ public static void tearDownOnce() throws Exception {
+ TestUtil.severeLoggingEnd(monitorLog);
+ }
+
+ private static String getResourcePath(String name) {
+ String path = inputFilesLocation + ArtifactImportWizardTest.class.getResource(name).getPath();
+ path = path.substring(path.indexOf("C:"), path.length());
+ return path;
+ }
+
+ // private void displayArtifactTree(Artifact artifact) throws OseeCoreException {
+ // displayArtifactTree(artifact, 0);
+ // }
+ //
+ // private void displayArtifactTree(Artifact artifact, int depth) throws OseeCoreException {
+ // for (int indentCount = 0; indentCount < depth; indentCount++) {
+ // System.out.print(" ");
+ // }
+ // System.out.println(artifact.getName());
+ //
+ // int longestArtifactNameLength = artifact.getName().length();
+ // if (longestArtifactNameLength > depth) {
+ // depth = longestArtifactNameLength;
+ // }
+ //
+ // List<Artifact> children = artifact.getChildren();
+ // if (!children.isEmpty()) {
+ // for (Artifact child : children) {
+ // displayArtifactTree(child, depth + 1);
+ // }
+ // }
+ // }
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ImportTestSuite.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ImportTestSuite.java
new file mode 100644
index 0000000..474edeb
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/ImportTestSuite.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.ui.skynet.test.importer;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ArtifactImportWizardTest.class})
+/**
+ * @author Karol M. Wilk
+ */
+public class ImportTestSuite {
+ //
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_Base.xml b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_Base.xml
new file mode 100644
index 0000000..4aaf34f
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_Base.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <Author>brian</Author>
+ <LastAuthor>b1797896</LastAuthor>
+ <Created>2001-05-25T14:25:49Z</Created>
+ <LastSaved>2010-11-03T17:28:09Z</LastSaved>
+ <Company>SDRC</Company>
+ <Version>11.9999</Version>
+ </DocumentProperties>
+ <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <SLATE_x0020_Macro_x0020_Version dt:dt="string">' CodeVersion: 2.48</SLATE_x0020_Macro_x0020_Version>
+ </CustomDocumentProperties>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>8070</WindowHeight>
+ <WindowWidth>13260</WindowWidth>
+ <WindowTopX>120</WindowTopX>
+ <WindowTopY>45</WindowTopY>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s21" ss:Name="Normal_SL8_MSExcel_va053c234266640">
+ <Alignment ss:Vertical="Top"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s23" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s24" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s25" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ </Style>
+ <Style ss:ID="s26" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s27" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s28" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s29" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s30" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="System Requirement">
+ <Names>
+ <NamedRange ss:Name="_FilterDatabase"
+ ss:RefersTo="='System Requirement'!R1C1:R1C6" ss:Hidden="1"/>
+ </Names>
+ <Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="5" x:FullColumns="1"
+ x:FullRows="1" ss:StyleID="s23">
+ <Column ss:StyleID="s24" ss:AutoFitWidth="0" ss:Width="81.75"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="80.25"/>
+ <Column ss:StyleID="s23" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="72"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:Width="78.75"/>
+ <Row ss:AutoFitHeight="0" ss:Height="38.25" ss:StyleID="s25">
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Imported Paragraph Number</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">GUID</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Effectivity</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Req Type</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Qualification Method</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Verification Level</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">AAAAAAAAAAAAAAAAAAAAAA</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1.1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">CCCCCCCCCCCCCCCCCCCCCC</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1.2</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">DDDDDDDDDDDDDDDDDDDDDD</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">2</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">BBBBBBBBBBBBBBBBBBBBBB</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>600</HorizontalResolution>
+ <VerticalResolution>4</VerticalResolution>
+ </Print>
+ <Selected/>
+ <FreezePanes/>
+ <FrozenNoSplit/>
+ <SplitHorizontal>1</SplitHorizontal>
+ <TopRowBottomPane>1</TopRowBottomPane>
+ <ActivePane>2</ActivePane>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ </Pane>
+ <Pane>
+ <Number>2</Number>
+ <ActiveRow>5</ActiveRow>
+ <RangeSelection>R6</RangeSelection>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ <AutoFilter x:Range="R1C1:R1C6" xmlns="urn:schemas-microsoft-com:office:excel">
+ </AutoFilter>
+ <ConditionalFormatting xmlns="urn:schemas-microsoft-com:office:excel">
+ <Range>R1:R65536</Range>
+ <Condition>
+ <Qualifier>Equal</Qualifier>
+ <Value1>&quot;&quot;</Value1>
+ <Format Style='mso-background-source:auto'/>
+ </Condition>
+ </ConditionalFormatting>
+ </Worksheet>
+</Workbook>
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_SimpleChild.xml b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_SimpleChild.xml
new file mode 100644
index 0000000..9af568c
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_SimpleChild.xml
@@ -0,0 +1,196 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <Author>brian</Author>
+ <LastAuthor>b1797896</LastAuthor>
+ <Created>2001-05-25T14:25:49Z</Created>
+ <LastSaved>2010-11-03T17:28:09Z</LastSaved>
+ <Company>SDRC</Company>
+ <Version>11.9999</Version>
+ </DocumentProperties>
+ <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <SLATE_x0020_Macro_x0020_Version dt:dt="string">' CodeVersion: 2.48</SLATE_x0020_Macro_x0020_Version>
+ </CustomDocumentProperties>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>8070</WindowHeight>
+ <WindowWidth>13260</WindowWidth>
+ <WindowTopX>120</WindowTopX>
+ <WindowTopY>45</WindowTopY>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s21" ss:Name="Normal_SL8_MSExcel_va053c234266640">
+ <Alignment ss:Vertical="Top"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s23" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s24" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s25" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ </Style>
+ <Style ss:ID="s26" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s27" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s28" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s29" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s30" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="System Requirement">
+ <Names>
+ <NamedRange ss:Name="_FilterDatabase"
+ ss:RefersTo="='System Requirement'!R1C1:R1C6" ss:Hidden="1"/>
+ </Names>
+ <Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="4" x:FullColumns="1"
+ x:FullRows="1" ss:StyleID="s23">
+ <Column ss:StyleID="s24" ss:AutoFitWidth="0" ss:Width="81.75"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="80.25"/>
+ <Column ss:StyleID="s23" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="72"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:Width="78.75"/>
+ <Row ss:AutoFitHeight="0" ss:Height="38.25" ss:StyleID="s25">
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Imported Paragraph Number</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">GUID</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Effectivity</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Req Type</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Qualification Method</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Verification Level</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">AAAAAAAAAAAAAAAAAAAAAA</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1.1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">CCCCCCCCCCCCCCCCCCCCCC</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">2</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">BBBBBBBBBBBBBBBBBBBBBB</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>600</HorizontalResolution>
+ <VerticalResolution>4</VerticalResolution>
+ </Print>
+ <Selected/>
+ <FreezePanes/>
+ <FrozenNoSplit/>
+ <SplitHorizontal>1</SplitHorizontal>
+ <TopRowBottomPane>1</TopRowBottomPane>
+ <ActivePane>2</ActivePane>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ </Pane>
+ <Pane>
+ <Number>2</Number>
+ <ActiveRow>4</ActiveRow>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ <AutoFilter x:Range="R1C1:R1C6" xmlns="urn:schemas-microsoft-com:office:excel">
+ </AutoFilter>
+ <ConditionalFormatting xmlns="urn:schemas-microsoft-com:office:excel">
+ <Range>R1:R65536</Range>
+ <Condition>
+ <Qualifier>Equal</Qualifier>
+ <Value1>&quot;&quot;</Value1>
+ <Format Style='mso-background-source:auto'/>
+ </Condition>
+ </ConditionalFormatting>
+ </Worksheet>
+</Workbook>
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_attributeCopyTest.xml b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_attributeCopyTest.xml
new file mode 100644
index 0000000..c2346c6
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/test/importer/artifactExcelImportInput_attributeCopyTest.xml
@@ -0,0 +1,205 @@
+<?xml version="1.0"?>
+<?mso-application progid="Excel.Sheet"?>
+<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:o="urn:schemas-microsoft-com:office:office"
+ xmlns:x="urn:schemas-microsoft-com:office:excel"
+ xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
+ xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
+ xmlns:html="http://www.w3.org/TR/REC-html40">
+ <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <Author>brian</Author>
+ <LastAuthor>b1797896</LastAuthor>
+ <Created>2001-05-25T14:25:49Z</Created>
+ <LastSaved>2010-11-03T17:28:09Z</LastSaved>
+ <Company>SDRC</Company>
+ <Version>11.9999</Version>
+ </DocumentProperties>
+ <CustomDocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
+ <SLATE_x0020_Macro_x0020_Version dt:dt="string">' CodeVersion: 2.48</SLATE_x0020_Macro_x0020_Version>
+ </CustomDocumentProperties>
+ <ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
+ <WindowHeight>8070</WindowHeight>
+ <WindowWidth>13260</WindowWidth>
+ <WindowTopX>120</WindowTopX>
+ <WindowTopY>45</WindowTopY>
+ <ProtectStructure>False</ProtectStructure>
+ <ProtectWindows>False</ProtectWindows>
+ </ExcelWorkbook>
+ <Styles>
+ <Style ss:ID="Default" ss:Name="Normal">
+ <Alignment ss:Vertical="Bottom"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s21" ss:Name="Normal_SL8_MSExcel_va053c234266640">
+ <Alignment ss:Vertical="Top"/>
+ <Borders/>
+ <Font/>
+ <Interior/>
+ <NumberFormat/>
+ <Protection/>
+ </Style>
+ <Style ss:ID="s23" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s24" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ </Style>
+ <Style ss:ID="s25" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ </Style>
+ <Style ss:ID="s26" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s27" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font x:Family="Swiss" ss:Bold="1"/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s28" ss:Parent="s21">
+ <Alignment ss:Horizontal="Left" ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s29" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Font/>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ <Style ss:ID="s30" ss:Parent="s21">
+ <Alignment ss:Vertical="Top" ss:WrapText="1"/>
+ <Borders>
+ <Border ss:Position="Bottom" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Left" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Right" ss:LineStyle="Continuous" ss:Weight="1"/>
+ <Border ss:Position="Top" ss:LineStyle="Continuous" ss:Weight="1"/>
+ </Borders>
+ <Interior ss:Color="#FFFFFF" ss:Pattern="Solid"/>
+ </Style>
+ </Styles>
+ <Worksheet ss:Name="System Requirement">
+ <Names>
+ <NamedRange ss:Name="_FilterDatabase"
+ ss:RefersTo="='System Requirement'!R1C1:R1C6" ss:Hidden="1"/>
+ </Names>
+ <Table ss:ExpandedColumnCount="6" ss:ExpandedRowCount="5" x:FullColumns="1"
+ x:FullRows="1" ss:StyleID="s23">
+ <Column ss:StyleID="s24" ss:AutoFitWidth="0" ss:Width="81.75"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="80.25"/>
+ <Column ss:StyleID="s23" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="72"/>
+ <Column ss:StyleID="s23" ss:AutoFitWidth="0" ss:Width="70.5"/>
+ <Column ss:StyleID="s23" ss:Width="78.75"/>
+ <Row ss:AutoFitHeight="0" ss:Height="38.25" ss:StyleID="s25">
+ <Cell ss:StyleID="s26"><Data ss:Type="String">Imported Paragraph Number</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">GUID</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Effectivity</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Req Type</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Qualification Method</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ <Cell ss:StyleID="s27"><Data ss:Type="String">Verification Level</Data><NamedCell
+ ss:Name="_FilterDatabase"/></Cell>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">AAAAAAAAAAAAAAAAAAAAAA</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">1.1</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">CCCCCCCCCCCCCCCCCCCCCC</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">2</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">DDDDDDDDDDDDDDDDDDDDDD</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ <Row ss:AutoFitHeight="0" ss:Height="25.5">
+ <Cell ss:StyleID="s28"><Data ss:Type="Number">3</Data></Cell>
+ <Cell ss:StyleID="s29"><Data ss:Type="String">BBBBBBBBBBBBBBBBBBBBBB</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"><Data ss:Type="String">Info</Data></Cell>
+ <Cell ss:StyleID="s30"/>
+ <Cell ss:StyleID="s30"/>
+ </Row>
+ </Table>
+ <WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
+ <Print>
+ <ValidPrinterInfo/>
+ <HorizontalResolution>600</HorizontalResolution>
+ <VerticalResolution>4</VerticalResolution>
+ </Print>
+ <Selected/>
+ <FreezePanes/>
+ <FrozenNoSplit/>
+ <SplitHorizontal>1</SplitHorizontal>
+ <TopRowBottomPane>1</TopRowBottomPane>
+ <ActivePane>2</ActivePane>
+ <Panes>
+ <Pane>
+ <Number>3</Number>
+ </Pane>
+ <Pane>
+ <Number>2</Number>
+ <ActiveRow>5</ActiveRow>
+ <RangeSelection>R6</RangeSelection>
+ </Pane>
+ </Panes>
+ <ProtectObjects>False</ProtectObjects>
+ <ProtectScenarios>False</ProtectScenarios>
+ </WorksheetOptions>
+ <AutoFilter x:Range="R1C1:R1C6" xmlns="urn:schemas-microsoft-com:office:excel">
+ </AutoFilter>
+ <ConditionalFormatting xmlns="urn:schemas-microsoft-com:office:excel">
+ <Range>R1:R65536</Range>
+ <Condition>
+ <Qualifier>Equal</Qualifier>
+ <Value1>&quot;&quot;</Value1>
+ <Format Style='mso-background-source:auto'/>
+ </Condition>
+ </ConditionalFormatting>
+ </Worksheet>
+</Workbook>
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportOperationFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportOperationFactory.java
index 96e6342..e1d69ff 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportOperationFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportOperationFactory.java
@@ -13,14 +13,19 @@ package org.eclipse.osee.framework.ui.skynet.Import;
import java.io.File;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.operation.CompositeOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact;
import org.eclipse.osee.framework.skynet.core.importing.RoughArtifactKind;
import org.eclipse.osee.framework.skynet.core.importing.operations.CompleteArtifactImportOperation;
+import org.eclipse.osee.framework.skynet.core.importing.operations.FilterArtifactTypesByAttributeTypes;
import org.eclipse.osee.framework.skynet.core.importing.operations.RoughArtifactCollector;
import org.eclipse.osee.framework.skynet.core.importing.operations.RoughToRealArtifactOperation;
import org.eclipse.osee.framework.skynet.core.importing.operations.SourceToRoughArtifactOperation;
@@ -41,9 +46,9 @@ public final class ArtifactImportOperationFactory {
}
public static IOperation createOperation(File sourceFile, Artifact destinationArtifact, IArtifactExtractor extractor, IArtifactImportResolver resolver, boolean stopOnError) throws OseeCoreException {
- RoughArtifactCollector collector = new RoughArtifactCollector(new RoughArtifact(RoughArtifactKind.PRIMARY));
SkynetTransaction transaction =
new SkynetTransaction(destinationArtifact.getBranch(), "Artifact Import Wizard transaction");
+ RoughArtifactCollector collector = new RoughArtifactCollector(new RoughArtifact(RoughArtifactKind.PRIMARY));
List<IOperation> ops = new ArrayList<IOperation>();
ops.add(new SourceToRoughArtifactOperation(extractor, sourceFile, collector));
@@ -52,4 +57,61 @@ public final class ArtifactImportOperationFactory {
ops.add(new CompleteArtifactImportOperation(transaction, destinationArtifact));
return new CompositeOperation("Artifact Import", SkynetGuiPlugin.PLUGIN_ID, ops);
}
+
+ public static IOperation createArtifactAndRoughToRealOperation(File sourceFile, Artifact destinationArtifact, IArtifactExtractor extractor, IArtifactImportResolver resolver, RoughArtifactCollector collector, Collection<IArtifactType> selectionArtifactTypes, boolean stopOnError, boolean deleteUnMatched, boolean runFilterByAttributes) {
+ List<IOperation> ops = new ArrayList<IOperation>();
+ ops.add(createArtifactsCompOperation(
+ "Artifact Import - SourceToRoughArtifact, FilterArtifactTypesByAttributeTypes", sourceFile,
+ destinationArtifact, extractor, collector, selectionArtifactTypes, runFilterByAttributes));
+ ops.add(createRoughToRealOperation(
+ "Artifact Import - RoughToRealArtifactOperation, ArtifactValidationCheckOperation, CompleteArtifactImportOperation",
+ destinationArtifact, resolver, stopOnError, collector, deleteUnMatched));
+ return new CompositeOperation("Artifact Import - ArtifactAndRoughToRealOperation, RoughToRealOperation",
+ SkynetGuiPlugin.PLUGIN_ID, ops);
+ }
+
+ /**
+ * @see ArtifactImportPage
+ */
+ public static IOperation createArtifactsCompOperation(String opDescription, File sourceFile, Artifact destinationArtifact, IArtifactExtractor extractor, RoughArtifactCollector collector, Collection<IArtifactType> selectionArtifactTypes, boolean runFilterByAttributes) {
+ List<IOperation> ops = new ArrayList<IOperation>();
+ ops.add(new SourceToRoughArtifactOperation(extractor, sourceFile, collector));
+ if (runFilterByAttributes) {
+ ops.add(new FilterArtifactTypesByAttributeTypes(destinationArtifact.getBranch(), collector,
+ selectionArtifactTypes));
+ }
+ return new CompositeOperation(opDescription, SkynetGuiPlugin.PLUGIN_ID, ops);
+ }
+
+ /**
+ * @see ArtifactImportWizard
+ */
+ public static IOperation createRoughToRealOperation(String opName, final Artifact destinationArtifact, IArtifactImportResolver resolver, boolean stopOnError, RoughArtifactCollector collector, boolean deleteUnmatchedArtifacts) {
+ SkynetTransaction transaction =
+ new SkynetTransaction(destinationArtifact.getBranch(), "Artifact Import Wizard transaction");
+
+ List<IOperation> ops = new ArrayList<IOperation>();
+ ops.add(new RoughToRealArtifactOperation(transaction, destinationArtifact, collector, resolver,
+ deleteUnmatchedArtifacts));
+ final List<Artifact> children = new ArrayList<Artifact>();
+ AbstractOperation operation = new AbstractOperation("Fetch Descendants", SkynetGuiPlugin.PLUGIN_ID) {
+ @Override
+ protected void doWork(IProgressMonitor monitor) throws Exception {
+ try {
+ children.addAll(destinationArtifact.getDescendants());
+ } catch (OseeCoreException ex) {
+ reportError("Unable to get artifact children: artifact:[%s] branch:[%s]", destinationArtifact.getGuid(),
+ destinationArtifact.getBranch().getGuid(), ex);
+ }
+ }
+
+ private void reportError(String message, String arg1, String arg2, Exception ex) throws Exception {
+ throw new Exception(String.format(message, arg1, arg2), ex);
+ }
+ };
+ ops.add(operation);
+ ops.add(new ArtifactValidationCheckOperation(children, stopOnError));
+ ops.add(new CompleteArtifactImportOperation(transaction, destinationArtifact));
+ return new CompositeOperation(opName, SkynetGuiPlugin.PLUGIN_ID, ops);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java
index 7f53728..2ad9c8a 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportPage.java
@@ -14,7 +14,6 @@ import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
import java.util.logging.Level;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -24,7 +23,6 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
-import org.eclipse.osee.framework.core.operation.CompositeOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.jdk.core.util.Strings;
@@ -36,9 +34,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.importing.ArtifactExtractorContributionManager;
import org.eclipse.osee.framework.skynet.core.importing.RoughArtifact;
import org.eclipse.osee.framework.skynet.core.importing.RoughArtifactKind;
-import org.eclipse.osee.framework.skynet.core.importing.operations.FilterArtifactTypesByAttributeTypes;
import org.eclipse.osee.framework.skynet.core.importing.operations.RoughArtifactCollector;
-import org.eclipse.osee.framework.skynet.core.importing.operations.SourceToRoughArtifactOperation;
import org.eclipse.osee.framework.skynet.core.importing.parsers.IArtifactExtractor;
import org.eclipse.osee.framework.skynet.core.importing.parsers.IArtifactExtractorDelegate;
import org.eclipse.osee.framework.ui.plugin.util.DirectoryOrFileSelector;
@@ -432,12 +428,13 @@ public class ArtifactImportPage extends WizardDataTransferPage {
final File sourceFile = selectionLatch.currentSelected.sourceFile;
final IArtifactExtractor extractor = selectionLatch.currentSelected.extractor;
- List<IOperation> ops = new ArrayList<IOperation>();
- ops.add(new SourceToRoughArtifactOperation(extractor, sourceFile, collector));
- ops.add(new FilterArtifactTypesByAttributeTypes(destinationArtifact.getBranch(), collector,
- selectedArtifactTypes));
+ IOperation op =
+ ArtifactImportOperationFactory.createArtifactsCompOperation("Extracting data from source", sourceFile,
+ destinationArtifact, extractor, collector, selectedArtifactTypes, true);
+
selectedArtifactTypes.clear();
- if (executeOperation(new CompositeOperation("Extracting data from source", SkynetGuiPlugin.PLUGIN_ID, ops))) {
+
+ if (executeOperation(op)) {
artifactTypeSelectPanel.setAllowedArtifactTypes(selectedArtifactTypes);
try {
if (getArtifactType() != null) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportWizard.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportWizard.java
index e1408f0..39b4f6c 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportWizard.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/Import/ArtifactImportWizard.java
@@ -11,26 +11,17 @@
package org.eclipse.osee.framework.ui.skynet.Import;
import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.AbstractOperation;
-import org.eclipse.osee.framework.core.operation.CompositeOperation;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.importing.operations.CompleteArtifactImportOperation;
import org.eclipse.osee.framework.skynet.core.importing.operations.RoughArtifactCollector;
-import org.eclipse.osee.framework.skynet.core.importing.operations.RoughToRealArtifactOperation;
import org.eclipse.osee.framework.skynet.core.importing.resolvers.IArtifactImportResolver;
-import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
-import org.eclipse.osee.framework.ui.skynet.ArtifactValidationCheckOperation;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.ui.IImportWizard;
import org.eclipse.ui.IWorkbench;
@@ -48,7 +39,6 @@ public class ArtifactImportWizard extends Wizard implements IImportWizard {
setDialogSettings(SkynetGuiPlugin.getInstance().getDialogSettings());
setWindowTitle("OSEE Artifact Import Wizard");
setNeedsProgressMonitor(true);
-
setHelpAvailable(true);
}
@@ -90,37 +80,15 @@ public class ArtifactImportWizard extends Wizard implements IImportWizard {
public boolean performFinish() {
final Artifact destinationArtifact = mainPage.getDestinationArtifact();
final boolean isDeleteUnmatchedSelected = mainPage.isDeleteUnmatchedSelected();
- final String opName = "Importing Artifacts onto: " + destinationArtifact;
final RoughArtifactCollector roughItems = mainPage.getCollectedArtifacts();
final IArtifactImportResolver resolver = getResolver();
- Operations.executeAsJob(new AbstractOperation(opName, SkynetGuiPlugin.PLUGIN_ID) {
- @Override
- protected void doWork(IProgressMonitor monitor) throws Exception {
- SkynetTransaction transaction = null;
- transaction = new SkynetTransaction(destinationArtifact.getBranch(), "Artifact Import Wizard transaction");
- List<Artifact> children = new ArrayList<Artifact>();
- try {
- children = destinationArtifact.getDescendants();
- } catch (OseeCoreException ex) {
- reportError("Unable to get artifact children: artifact:[%s] branch:[%s]", destinationArtifact.getGuid(),
- destinationArtifact.getBranch().getGuid(), ex);
- }
- List<IOperation> subOps = new ArrayList<IOperation>();
- subOps.add(new RoughToRealArtifactOperation(transaction, destinationArtifact, roughItems, resolver,
- isDeleteUnmatchedSelected));
- subOps.add(new ArtifactValidationCheckOperation(children, false));
- subOps.add(new CompleteArtifactImportOperation(transaction, destinationArtifact));
- IOperation ret = new CompositeOperation(opName, SkynetGuiPlugin.PLUGIN_ID, subOps);
- Operations.executeWorkAndCheckStatus(ret, monitor);
- }
-
- private void reportError(String message, String arg1, String arg2, Exception ex) throws Exception {
- throw new Exception(String.format(message, arg1, arg2), ex);
- }
-
- }, true);
- return true;
+ final String opName = String.format("Importing Artifacts onto: [%s]", destinationArtifact);
+ IOperation operation =
+ ArtifactImportOperationFactory.createRoughToRealOperation(opName, destinationArtifact, resolver, false,
+ roughItems, isDeleteUnmatchedSelected);
+ Job job = Operations.executeAsJob(operation, true);
+ return job != null;
}
private IArtifactImportResolver getResolver() {