Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2011-07-21 14:10:20 -0400
committerRyan D. Brooks2011-07-21 14:10:20 -0400
commit8928fe517129769b2748b41ff809c63efc0dae05 (patch)
tree24334f625867826f7ed22edc020ff36e3268655a
parente8f21289defee0d2469b2c2742b9b6ad5d21342e (diff)
downloadorg.eclipse.osee-8928fe517129769b2748b41ff809c63efc0dae05.tar.gz
org.eclipse.osee-8928fe517129769b2748b41ff809c63efc0dae05.tar.xz
org.eclipse.osee-8928fe517129769b2748b41ff809c63efc0dae05.zip
feature[ats_E4J07]: Allow Stp/Std report BLAM to select trace types
-rw-r--r--plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.define/plugin.xml6
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ArtifactOperations.java225
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java36
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ICustomizable.java23
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/RequirementTraceabilityData.java253
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java31
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityFactory.java82
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityTable.java74
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java2
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/UiToTestBlam.java2
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java48
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/ISimpleTable.java28
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java165
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdCsciToTestTable.java169
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdTestToCsciTable.java190
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpCsciToTestTable.java120
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpTestToCsciTable.java115
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/FrameworkXWidgetProvider.java5
19 files changed, 1538 insertions, 37 deletions
diff --git a/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
index 4fd6fe61f9..7edcaa77e3 100644
--- a/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.define/META-INF/MANIFEST.MF
@@ -73,5 +73,6 @@ Import-Package: org.apache.commons.lang;version="2.4.0",
org.eclipse.osee.framework.ui.skynet.widgets.xHistory,
org.eclipse.osee.framework.ui.swt,
org.eclipse.osee.framework.ui.ws,
+ org.eclipse.osee.ote.define.artifacts,
org.eclipse.ui.forms.editor
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.eclipse.osee.define/plugin.xml b/plugins/org.eclipse.osee.define/plugin.xml
index 9c95e02c46..804e937b9b 100644
--- a/plugins/org.eclipse.osee.define/plugin.xml
+++ b/plugins/org.eclipse.osee.define/plugin.xml
@@ -208,4 +208,10 @@
classname="org.eclipse.osee.define.navigate.DefineNavigateViewItems">
</XCommonNavigateItem>
</extension>
+ <extension
+ point="org.eclipse.osee.framework.ui.skynet.BlamOperation">
+ <Operation
+ className="org.eclipse.osee.define.traceability.report.PublishStdStpTraceability">
+ </Operation>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ArtifactOperations.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ArtifactOperations.java
new file mode 100644
index 0000000000..af4debdbc7
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ArtifactOperations.java
@@ -0,0 +1,225 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import org.eclipse.osee.define.DefinePlugin;
+import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class ArtifactOperations {
+ private final Artifact artifact;
+ private List<String> partitions;
+ private String qualificationMethod;
+ private String qualificationFacility;
+
+ enum QualificationFacility {
+ UNKNOWN,
+ STE,
+ AIL,
+ SEE;
+ }
+
+ enum QualificationMethod {
+ Test("Test", "T", QualificationFacility.STE),
+ Demo("Demonstration", "D", QualificationFacility.AIL),
+ Inspection("Inspection", "I", QualificationFacility.SEE),
+ SpecialQualification("Special Qualification", "S", QualificationFacility.AIL),
+ Analysis("Analysis", "A", QualificationFacility.SEE),
+ Unspecified("Unspecified", "U", QualificationFacility.UNKNOWN);
+
+ String attributeString;
+ String shortName;
+ QualificationFacility facility;
+
+ QualificationMethod(String attributeString, String shortName, QualificationFacility facility) {
+ this.attributeString = attributeString;
+ this.shortName = shortName;
+ this.facility = facility;
+ }
+
+ public String getAttributeString() {
+ return attributeString;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public QualificationFacility getFacility() {
+ return facility;
+ }
+
+ public static QualificationMethod getMethodFromAttribute(String attribute) {
+ QualificationMethod toReturn = QualificationMethod.Unspecified;
+ for (QualificationMethod method : QualificationMethod.values()) {
+ if (method.getAttributeString().equalsIgnoreCase(attribute)) {
+ toReturn = method;
+ break;
+ }
+ }
+ return toReturn;
+ }
+ }
+
+ public ArtifactOperations(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ public String getName() {
+ return artifact.getName();
+ }
+
+ public String getParagraphNumber() throws OseeCoreException {
+ return artifact.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, "");
+ }
+
+ public List<String> getPartitions() {
+ if (partitions == null) {
+ partitions = new ArrayList<String>();
+ try {
+ partitions.addAll(artifact.getAttributesToStringList(CoreAttributeTypes.Partition));
+ Collections.sort(partitions);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(DefinePlugin.class, Level.WARNING,
+ String.format("Error obtaining partition info for [%s]", getName()), ex);
+ partitions.add("Error");
+ }
+ }
+ return partitions;
+ }
+
+ public String getQualificationMethod() {
+ if (qualificationMethod == null) {
+ processQualificationMethod();
+ }
+ return qualificationMethod;
+ }
+
+ public String getQualificationFacility() {
+ if (qualificationFacility == null) {
+ processQualificationMethod();
+ }
+ return qualificationFacility;
+ }
+
+ private void processQualificationMethod() {
+ StringBuilder qualMethodBuilder = new StringBuilder();
+ StringBuilder qualFacilityBuilder = new StringBuilder();
+ try {
+ List<String> methods =
+ new ArrayList<String>(artifact.getAttributesToStringList(CoreAttributeTypes.QualificationMethod));
+ Collections.sort(methods);
+ for (int index = 0; index < methods.size(); index++) {
+ String qualMethod = methods.get(index);
+ QualificationMethod method = QualificationMethod.getMethodFromAttribute(qualMethod);
+ qualMethodBuilder.append(method.getShortName());
+ qualFacilityBuilder.append(method.getFacility());
+ if (index + 1 < methods.size()) {
+ qualMethodBuilder.append(", ");
+ qualFacilityBuilder.append(", ");
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(DefinePlugin.class, Level.WARNING,
+ String.format("Error obtaining qualification info [%s]", getName()), ex);
+ }
+ qualificationMethod = qualMethodBuilder.toString();
+ qualificationFacility = qualFacilityBuilder.toString();
+ }
+
+ public static HashCollection<String, Artifact> sortByPartition(Collection<Artifact> source) {
+ HashCollection<String, Artifact> partitionMap = new HashCollection<String, Artifact>(false, TreeSet.class);
+ for (Artifact artifact : source) {
+ ArtifactOperations operator = new ArtifactOperations(artifact);
+ List<String> partitions = operator.getPartitions();
+ for (String key : partitions) {
+ partitionMap.put(key, artifact);
+ }
+ }
+ return partitionMap;
+ }
+
+ public static List<Artifact> sortByParagraphNumbers(Collection<Artifact> source) {
+ List<Artifact> toReturn = new ArrayList<Artifact>(source);
+ Collections.sort(toReturn, new Comparator<Artifact>() {
+ @Override
+ public int compare(Artifact art1, Artifact art2) {
+ try {
+ int toReturn = 0;
+ String paragraph1 = new ArtifactOperations(art1).getParagraphNumber();
+ String paragraph2 = new ArtifactOperations(art2).getParagraphNumber();
+ Integer[] set1 = getParagraphIndices(paragraph1);
+ Integer[] set2 = getParagraphIndices(paragraph2);
+ int length1 = set1.length;
+ int length2 = set2.length;
+
+ int size = length1 < length2 ? length1 : length2;
+ if (size == 0 && length1 != length2) {
+ toReturn = length1 < length2 ? -1 : 1;
+ } else {
+ for (int index = 0; index < size; index++) {
+ toReturn = set1[index].compareTo(set2[index]);
+ if (toReturn != 0) {
+ break;
+ }
+ }
+ }
+ return toReturn;
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ return 1;
+ }
+
+ });
+ return toReturn;
+ }
+
+ private static Integer[] getParagraphIndices(String paragraph) {
+ List<Integer> paragraphs = new ArrayList<Integer>();
+ if (Strings.isValid(paragraph)) {
+ String[] values = paragraph.split("\\.");
+ for (int index = 0; index < values.length; index++) {
+ try {
+ paragraphs.add(new Integer(values[index]));
+ } catch (Exception ex) {
+ // Do nothing;
+ }
+ }
+ }
+ return paragraphs.toArray(new Integer[paragraphs.size()]);
+ }
+
+ public String getPriority() {
+ String toReturn = null;
+ try {
+ toReturn = this.artifact.getSoleAttributeValue(CoreAttributeTypes.Category, "");
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ toReturn = "";
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java
index 57b2ab8a21..87860ceb6a 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java
@@ -10,12 +10,15 @@
*******************************************************************************/
package org.eclipse.osee.define.traceability;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.define.DefinePlugin;
import org.eclipse.osee.define.traceability.data.RequirementData;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -30,13 +33,27 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
private final IOseeBranch branch;
- private RequirementData requirementData;
+ private final RequirementData requirementData;
private HashCollection<Artifact, String> requirementToCodeUnitsMap;
private HashSet<String> codeUnits;
+ private final Collection<? extends IArtifactType> types;
+ private final boolean withInheritance;
- public BranchTraceabilityOperation(IOseeBranch branch) {
+ private BranchTraceabilityOperation(RequirementData requirementData, Branch branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
super("Branch Traceability Provider", DefinePlugin.PLUGIN_ID);
+ this.requirementData = requirementData;
this.branch = branch;
+ this.types = types;
+ this.withInheritance = withInheritance;
+ }
+
+ public BranchTraceabilityOperation(Branch branch) {
+ this(new RequirementData(branch), branch, Collections.singleton(CoreArtifactTypes.AbstractSoftwareRequirement),
+ true);
+ }
+
+ public BranchTraceabilityOperation(Branch branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
+ this(new RequirementData(branch, types, withInheritance), branch, types, withInheritance);
}
@Override
@@ -64,15 +81,18 @@ public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
@Override
protected void doWork(IProgressMonitor monitor) throws Exception {
- requirementData = new RequirementData(branch);
requirementData.initialize(monitor);
-
requirementToCodeUnitsMap = new HashCollection<Artifact, String>();
- List<Artifact> softwareReqs =
- ArtifactQuery.getArtifactListFromTypeWithInheritence(CoreArtifactTypes.AbstractSoftwareRequirement, branch,
- DeletionFlag.EXCLUDE_DELETED);
- for (Artifact req : softwareReqs) {
+ List<Artifact> reqs = new ArrayList<Artifact>();
+ for (IArtifactType type : types) {
+ if (withInheritance) {
+ reqs.addAll(ArtifactQuery.getArtifactListFromTypeWithInheritence(type, branch, DeletionFlag.EXCLUDE_DELETED));
+ } else {
+ reqs.addAll(ArtifactQuery.getArtifactListFromType(type, branch));
+ }
+ }
+ for (Artifact req : reqs) {
List<Artifact> verifiers = req.getRelatedArtifacts(CoreRelationTypes.Verification__Verifier);
Collection<String> verifierNames = new HashSet<String>();
for (Artifact verifier : verifiers) {
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ICustomizable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ICustomizable.java
new file mode 100644
index 0000000000..eda469f683
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ICustomizable.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability;
+
+import org.eclipse.osee.framework.jdk.core.type.IVariantData;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface ICustomizable {
+
+ public IVariantData getOptions();
+
+ public void setOptions(IVariantData options);
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/RequirementTraceabilityData.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/RequirementTraceabilityData.java
new file mode 100644
index 0000000000..2c5b66f6ab
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/RequirementTraceabilityData.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeSet;
+import java.util.logging.Level;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osee.define.DefinePlugin;
+import org.eclipse.osee.define.traceability.data.RequirementData;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+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.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.ote.define.artifacts.TestRunOperator;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class RequirementTraceabilityData {
+ private final IOseeBranch requirementsBranch;
+ private final IOseeBranch testProcedureBranch;
+ private final TraceabilityProviderOperation traceabilityProvider;
+ private RequirementData requirementData;
+ private HashCollection<Artifact, String> requirementsToCodeUnits;
+ private final HashCollection<String, Artifact> requirementNameToTestProcedures =
+ new HashCollection<String, Artifact>();
+ private final Set<String> codeUnits = new TreeSet<String>();
+ private final Map<String, Artifact> testProcedures = new HashMap<String, Artifact>();
+ private final Map<String, Artifact> testScripts = new HashMap<String, Artifact>();
+ private File testProcedureFilter;
+
+ public RequirementTraceabilityData(IOseeBranch requirementsBranch, IOseeBranch testProcedureBranch, TraceabilityProviderOperation traceabilityProvider) {
+ this.requirementsBranch = requirementsBranch;
+ this.testProcedureBranch = testProcedureBranch;
+ this.traceabilityProvider = traceabilityProvider;
+ this.testProcedureFilter = null;
+ reset();
+ }
+
+ private void reset() {
+ this.codeUnits.clear();
+ this.testProcedures.clear();
+ this.testScripts.clear();
+ this.requirementsToCodeUnits = null;
+ this.requirementData = null;
+ this.requirementsToCodeUnits = null;
+ }
+
+ public IStatus initialize(IProgressMonitor monitor) {
+ IStatus status = Status.CANCEL_STATUS;
+ try {
+ reset();
+ monitor.subTask("Loading traceability data...");
+ status = Operations.executeWork(traceabilityProvider, monitor);
+
+ this.requirementData = traceabilityProvider.getRequirementData();
+ this.requirementsToCodeUnits = traceabilityProvider.getRequirementToCodeUnitsMap();
+ this.codeUnits.addAll(traceabilityProvider.getCodeUnits());
+
+ if (monitor.isCanceled() != true) {
+ if (status.getSeverity() == IStatus.OK) {
+ getTestProcedureTraceability(testProcedureBranch);
+ }
+ } else {
+ status = Status.CANCEL_STATUS;
+ }
+ } catch (Exception ex) {
+ status = new Status(IStatus.ERROR, DefinePlugin.PLUGIN_ID, "Error gathering traceability data", ex);
+ }
+ return status;
+ }
+
+ private void getTestProcedureTraceability(IOseeBranch testProcedureBranch) throws OseeCoreException {
+ // Map Software Requirements from TestProcedure IOseeBranch to Requirements IOseeBranch
+ Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<String, Artifact>();
+ for (Artifact tpRequirement : ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement,
+ testProcedureBranch)) {
+ testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement);
+ }
+
+ Set<String> testProceduresFilter = getAllowedTestProcedures();
+ for (Entry<String, Artifact> entry : testProcedureBranchReqsToReqsBranchMap.entrySet()) {
+ Artifact requirement = entry.getValue();
+ Set<Artifact> foundProcedures =
+ new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator));
+ Set<Artifact> toAdd = new HashSet<Artifact>();
+ if (testProceduresFilter.isEmpty() != true) {
+ for (Artifact artifact : foundProcedures) {
+ if (testProceduresFilter.contains(artifact.getName())) {
+ toAdd.add(artifact);
+ }
+ }
+ } else {
+ toAdd = foundProcedures;
+ }
+ requirementNameToTestProcedures.put(entry.getKey(), toAdd);
+ for (Artifact artifact : toAdd) {
+ this.testProcedures.put(artifact.getName(), artifact);
+ }
+ }
+ }
+
+ public Collection<Artifact> getDirectSwRequirements() {
+ return requirementData.getDirectRequirements();
+ }
+
+ public Collection<Artifact> getAllSwRequirements() {
+ return requirementData.getAllRequirements();
+ }
+
+ /**
+ * Get Requirement Artifact based on traceMark mark if it fails, check if trace mark is a structured requirement and
+ * try again
+ *
+ * @return requirement artifact
+ */
+ public Artifact getRequirementFromTraceMark(String traceMark) {
+ return this.requirementData.getRequirementFromTraceMarkIncludeStructuredRequirements(traceMark);
+ }
+
+ /**
+ * @return the requirementsToCodeUnits
+ */
+ public HashCollection<Artifact, String> getRequirementsToCodeUnits() {
+ return requirementsToCodeUnits;
+ }
+
+ /**
+ * @return the codeUnits
+ */
+ public Set<String> getCodeUnits() {
+ return codeUnits;
+ }
+
+ /**
+ * @return the testProcedures
+ */
+ public Set<String> getTestProcedures() {
+ return testProcedures.keySet();
+ }
+
+ /**
+ * @return the requirementNameToTestProcedures
+ */
+ public HashCollection<String, Artifact> getRequirementNameToTestProcedures() {
+ return requirementNameToTestProcedures;
+ }
+
+ /**
+ * @param artifact requirement to find
+ * @return the test procedures associated with this requirement
+ */
+ public Collection<Artifact> getTestProceduresForRequirement(Artifact requirement) {
+ return getRequirementNameToTestProcedures().getValues(requirement.getName());
+ }
+
+ /**
+ * TODO need to use persisted test script NOTE: These artifact should not be persisted since they are temporary items
+ * artifacts
+ *
+ * @param artifact requirement to find
+ * @return the test scripts associated with this requirement
+ */
+ public Collection<Artifact> getTestScriptsForRequirement(Artifact artifact) {
+ Set<Artifact> toReturn = new HashSet<Artifact>();
+ Collection<String> scriptNames = getRequirementsToCodeUnits().getValues(artifact);
+ for (String script : scriptNames) {
+ Artifact testScript;
+ try {
+ testScript = TestRunOperator.getTestScriptFetcher().getNewArtifact(testProcedureBranch);
+ testScript.setName(script);
+ testScripts.put(getScriptName(script), testScript);
+ toReturn.add(testScript);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return toReturn;
+ }
+
+ public Artifact getTestProcedureByName(String name) {
+ return testProcedures.get(name);
+ }
+
+ public Artifact getTestScriptByName(String name) {
+ return testScripts.get(name);
+ }
+
+ private String getScriptName(String scriptPath) {
+ return scriptPath.substring(scriptPath.lastIndexOf(File.separatorChar) + 1,
+ scriptPath.length() - ".java".length());
+ }
+
+ public void setTestProcedureFilterFile(File filter) {
+ this.testProcedureFilter = filter;
+ }
+
+ private File getTestProcedureFilterFile() {
+ return testProcedureFilter;
+ }
+
+ private Set<String> getAllowedTestProcedures() {
+ Set<String> toReturn = new HashSet<String>();
+ File filter = getTestProcedureFilterFile();
+ if (filter != null && filter.exists() && filter.canRead()) {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(new FileInputStream(filter)));
+ String line = "";
+ while ((line = reader.readLine()) != null) {
+ toReturn.add(line.trim());
+ }
+ } catch (Exception ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ } finally {
+ if (reader != null) {
+ try {
+ reader.close();
+ } catch (IOException ex) {
+ OseeLog.log(DefinePlugin.class, Level.SEVERE, ex);
+ }
+ }
+ }
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
index a63c37a932..17e0c80275 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.define.traceability;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
@@ -21,6 +22,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.define.DefinePlugin;
import org.eclipse.osee.define.traceability.data.RequirementData;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
import org.eclipse.osee.framework.core.exception.OseeArgumentException;
@@ -49,26 +51,31 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
private final File file;
private final RequirementData requirementData;
- private final ArrayList<String> noTraceabilityFiles;
- private final CountingMap<Artifact> reqsTraceCounts;
- private final HashCollection<Artifact, String> requirementToCodeUnitsMap;
- private final HashSet<String> codeUnits;
+ private final ArrayList<String> noTraceabilityFiles = new ArrayList<String>(200);
+ private final CountingMap<Artifact> reqsTraceCounts = new CountingMap<Artifact>();
+ private final HashCollection<Artifact, String> requirementToCodeUnitsMap = new HashCollection<Artifact, String>(
+ false, LinkedList.class);
+ private final HashSet<String> codeUnits = new HashSet<String>();
private final CharBackedInputStream charBak;
private final ISheetWriter excelWriter;
private int pathPrefixLength;
private final boolean writeOutResults;
- public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults) throws IOException {
+ private ScriptTraceabilityOperation(RequirementData requirementData, File file, boolean writeOutResults) throws IOException {
super("Importing Traceability", DefinePlugin.PLUGIN_ID);
this.file = file;
- this.requirementData = new RequirementData(branch);
- noTraceabilityFiles = new ArrayList<String>(200);
- reqsTraceCounts = new CountingMap<Artifact>();
- codeUnits = new HashSet<String>();
- requirementToCodeUnitsMap = new HashCollection<Artifact, String>(false, LinkedList.class);
+ this.requirementData = requirementData;
+ this.writeOutResults = writeOutResults;
charBak = new CharBackedInputStream();
excelWriter = new ExcelXmlWriter(charBak.getWriter());
- this.writeOutResults = writeOutResults;
+ }
+
+ public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults) throws IOException {
+ this(new RequirementData(branch), file, writeOutResults);
+ }
+
+ public ScriptTraceabilityOperation(File file, IOseeBranch branch, boolean writeOutResults, Collection<? extends IArtifactType> types, boolean withInheritance) throws IOException {
+ this(new RequirementData(branch, types, withInheritance), file, writeOutResults);
}
@Override
@@ -143,7 +150,7 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
excelWriter.writeRow("SRS Requirement from Database", "Trace Count", "Partitions");
excelWriter.writeRow("% requirement coverage", null, "=1-COUNTIF(C2,&quot;0&quot;)/COUNTA(C2)");
- for (Artifact artifact : requirementData.getDirectSwRequirements()) {
+ for (Artifact artifact : requirementData.getDirectRequirements()) {
excelWriter.writeRow(artifact.getName(), String.valueOf(reqsTraceCounts.get(artifact)),
Collections.toString(",", artifact.getAttributesToStringList(CoreAttributeTypes.Partition)));
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityFactory.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityFactory.java
new file mode 100644
index 0000000000..cb55cff784
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityFactory.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import org.eclipse.osee.define.traceability.report.ISimpleTable;
+import org.eclipse.osee.define.traceability.report.StdCsciToTestTable;
+import org.eclipse.osee.define.traceability.report.StdTestToCsciTable;
+import org.eclipse.osee.define.traceability.report.StpCsciToTestTable;
+import org.eclipse.osee.define.traceability.report.StpTestToCsciTable;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ExcelXmlWriter;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TraceabilityFactory {
+
+ public enum TraceabilityStyle {
+ STP_Test_to_CSCI,
+ STP_CSCI_to_Test,
+ STD_Test_to_CSCI,
+ STD_CSCI_to_Test;
+
+ @Override
+ public String toString() {
+ return name().toUpperCase();
+ }
+
+ public String asLabel() {
+ return name().replaceAll("_", " ");
+ }
+ }
+
+ public enum OutputFormat {
+ EXCEL;
+ }
+
+ protected static ISheetWriter getSheetWriter(OutputFormat outputFormat, Writer writer) throws Exception {
+ ISheetWriter toReturn = null;
+ switch (outputFormat) {
+ case EXCEL:
+ default:
+ toReturn = new ExcelXmlWriter(writer);
+ break;
+ }
+ return toReturn;
+ }
+
+ public static TraceabilityTable getTraceabilityTable(OutputFormat outputFormat, TraceabilityStyle style, RequirementTraceabilityData sourceData) throws Exception {
+ ISimpleTable simpleTable = null;
+ StringWriter stringWriter = new StringWriter();
+ ISheetWriter sheetWriter = getSheetWriter(outputFormat, stringWriter);
+ switch (style) {
+ case STP_Test_to_CSCI:
+ simpleTable = new StpTestToCsciTable(sourceData);
+ break;
+ case STP_CSCI_to_Test:
+ simpleTable = new StpCsciToTestTable(sourceData);
+ break;
+ case STD_Test_to_CSCI:
+ simpleTable = new StdTestToCsciTable(sourceData);
+ break;
+ case STD_CSCI_to_Test:
+ simpleTable = new StdCsciToTestTable(sourceData);
+ break;
+ default:
+ throw new OseeArgumentException("Unsupported Style [%s]", style);
+ }
+ return new TraceabilityTable(stringWriter, sheetWriter, simpleTable);
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityTable.java
new file mode 100644
index 0000000000..8c0289560c
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/TraceabilityTable.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability;
+
+import java.io.StringWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.define.traceability.report.ISimpleTable;
+import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
+import org.eclipse.osee.framework.jdk.core.type.IVariantData;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class TraceabilityTable {
+ private static final Pattern WORKSHEET_START_PATTERN = Pattern.compile("(<Worksheet.*?>)");
+ private static final Pattern TABLE_START_PATTERN = Pattern.compile("(<Table.*?>)");
+
+ private CharSequence result;
+ private final StringWriter stringWriter;
+ private final ISheetWriter sheetWriter;
+ private final ISimpleTable style;
+
+ protected TraceabilityTable(StringWriter stringWriter, ISheetWriter sheetWriter, ISimpleTable style) {
+ this.stringWriter = stringWriter;
+ this.sheetWriter = sheetWriter;
+ this.style = style;
+ this.result = null;
+ }
+
+ public void setOptions(IVariantData data) {
+ if (style != null && style instanceof ICustomizable) {
+ ((ICustomizable) style).setOptions(data);
+ }
+ }
+
+ public void run(IProgressMonitor monitor) throws Exception {
+ style.initializeSheet(sheetWriter);
+ style.generateBody(sheetWriter);
+ sheetWriter.endSheet();
+ sheetWriter.endWorkbook();
+ postProcess();
+ }
+
+ private void postProcess() throws Exception {
+ String source = stringWriter.toString();
+ ChangeSet changeSet = new ChangeSet(source);
+
+ Matcher match = WORKSHEET_START_PATTERN.matcher(source);
+ if (match.find()) {
+ changeSet.insertBefore(match.start(), style.getHeaderStyles());
+ }
+ Matcher match2 = TABLE_START_PATTERN.matcher(source);
+ if (match2.find()) {
+ changeSet.insertBefore(match2.end(), style.getHeader());
+ }
+ result = changeSet.applyChangesToSelf();
+ }
+
+ @Override
+ public String toString() {
+ return result.toString();
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java
index 941d7e6ff8..17823ef1e6 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java
@@ -353,7 +353,7 @@ public class TraceReportBlam extends AbstractBlam {
private AbstractArtifactRelationReport getTraceCountReport(RequirementData reqData, List<TraceTypeEnum> traceTypes) {
ArtifactTraceCount report = new ArtifactTraceCount();
- report.setArtifacts(reqData.getDirectSwRequirements());
+ report.setArtifacts(reqData.getDirectRequirements());
addRelationToCheck(traceTypes, report, false);
return report;
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/UiToTestBlam.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/UiToTestBlam.java
index ccd39fe8ad..2fea876663 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/UiToTestBlam.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/UiToTestBlam.java
@@ -104,7 +104,7 @@ public class UiToTestBlam extends AbstractBlam {
} else {
RequirementData requirements = new RequirementData(branch);
requirements.initialize(monitor);
- toTrace.addAll(requirements.getAllSwRequirements());
+ toTrace.addAll(requirements.getAllRequirements());
}
StringWriter appendable = new StringWriter();
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java
index 1d527f0fce..19ccf68682 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java
@@ -14,10 +14,12 @@ package org.eclipse.osee.define.traceability.data;
import static org.eclipse.osee.framework.core.enums.DeletionFlag.EXCLUDE_DELETED;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.define.traceability.TraceabilityExtractor;
+import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.jdk.core.type.Pair;
@@ -30,31 +32,47 @@ import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
public class RequirementData extends BaseTraceDataCache {
private static final TraceabilityExtractor traceExtractor = TraceabilityExtractor.getInstance();
- private final List<Artifact> directSwRequirements = new ArrayList<Artifact>();
- private final HashMap<String, Artifact> allSwRequirementsMap = new HashMap<String, Artifact>();
+ private final List<Artifact> directRequirements = new ArrayList<Artifact>();
+ private final HashMap<String, Artifact> allRequirementsMap = new HashMap<String, Artifact>();
private final TraceabilityExtractor extractor = TraceabilityExtractor.getInstance();
+ private final Collection<? extends IArtifactType> types;
+ private final boolean withInheritance;
+
+ public RequirementData(IOseeBranch branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
+ super("Software Requirements Data", branch);
+ this.types = types;
+ this.withInheritance = withInheritance;
+ }
public RequirementData(IOseeBranch branch) {
super("Software Requirements Data", branch);
+ types = Collections.singleton(CoreArtifactTypes.AbstractSoftwareRequirement);
+ withInheritance = true;
}
@Override
public void reset() {
super.reset();
- this.directSwRequirements.clear();
- allSwRequirementsMap.clear();
+ this.directRequirements.clear();
+ allRequirementsMap.clear();
}
@Override
protected void doBulkLoad(IProgressMonitor monitor) throws Exception {
- List<Artifact> allSwRequirements =
- ArtifactQuery.getArtifactListFromTypeWithInheritence(CoreArtifactTypes.AbstractSoftwareRequirement,
- getBranch(), EXCLUDE_DELETED);
- populateTraceMap(monitor, allSwRequirements, allSwRequirementsMap);
+ List<Artifact> allSwRequirements = new ArrayList<Artifact>();
+ for (IArtifactType type : types) {
+ if (withInheritance) {
+ allSwRequirements.addAll(ArtifactQuery.getArtifactListFromTypeWithInheritence(type, getBranch(),
+ EXCLUDE_DELETED));
+ } else {
+ allSwRequirements.addAll(ArtifactQuery.getArtifactListFromType(type, getBranch(), EXCLUDE_DELETED));
+ }
+ }
+ populateTraceMap(monitor, allSwRequirements, allRequirementsMap);
- for (Artifact requirement : getAllSwRequirements()) {
+ for (Artifact requirement : getAllRequirements()) {
if (!requirement.isOfType(CoreArtifactTypes.IndirectSoftwareRequirement)) {
- directSwRequirements.add(requirement);
+ directRequirements.add(requirement);
}
}
monitor.worked(38);
@@ -65,12 +83,12 @@ public class RequirementData extends BaseTraceDataCache {
return traceExtractor.getCanonicalRequirementName(artifact.getName());
}
- public Collection<Artifact> getDirectSwRequirements() {
- return directSwRequirements;
+ public Collection<Artifact> getDirectRequirements() {
+ return directRequirements;
}
- public Collection<Artifact> getAllSwRequirements() {
- return allSwRequirementsMap.values();
+ public Collection<Artifact> getAllRequirements() {
+ return allRequirementsMap.values();
}
/**
@@ -79,7 +97,7 @@ public class RequirementData extends BaseTraceDataCache {
* @return requirement artifact
*/
public Artifact getRequirementFromTraceMark(String traceMark) {
- return allSwRequirementsMap.get(extractor.getCanonicalRequirementName(traceMark));
+ return allRequirementsMap.get(extractor.getCanonicalRequirementName(traceMark));
}
/**
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/ISimpleTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/ISimpleTable.java
new file mode 100644
index 0000000000..c311d6898a
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/ISimpleTable.java
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public interface ISimpleTable {
+
+ public void initializeSheet(ISheetWriter sheetWriter) throws Exception;
+
+ public String getHeader();
+
+ public String getHeaderStyles();
+
+ public void generateBody(ISheetWriter sheetWriter) throws Exception;
+
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
new file mode 100644
index 0000000000..4d7f8e4785
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.osee.define.traceability.BranchTraceabilityOperation;
+import org.eclipse.osee.define.traceability.RequirementTraceabilityData;
+import org.eclipse.osee.define.traceability.ScriptTraceabilityOperation;
+import org.eclipse.osee.define.traceability.TraceabilityFactory;
+import org.eclipse.osee.define.traceability.TraceabilityFactory.OutputFormat;
+import org.eclipse.osee.define.traceability.TraceabilityFactory.TraceabilityStyle;
+import org.eclipse.osee.define.traceability.TraceabilityProviderOperation;
+import org.eclipse.osee.define.traceability.TraceabilityTable;
+import org.eclipse.osee.framework.core.data.IArtifactType;
+import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
+import org.eclipse.osee.framework.core.exception.OseeArgumentException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.jdk.core.util.Lib;
+import org.eclipse.osee.framework.plugin.core.util.AIFile;
+import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
+import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.swt.program.Program;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class PublishStdStpTraceability extends AbstractBlam {
+
+ private static final String scriptDirectory =
+ "<XWidget xwidgetType=\"XText\" displayName=\"Script Root Directory\" defaultValue=\"C:/UserData/workspaceScripts\"/>";
+ private static final String requirementsBranch =
+ "<XWidget xwidgetType=\"XBranchSelectWidget\" " + "displayName=\"Requirements Branch\" defaultValue=\"\" toolTip=\"Select a requirements branch.\" />";
+ private static final String testProceduresBranch =
+ "<XWidget xwidgetType=\"XBranchSelectWidget\" " + "displayName=\"Test Procedures Branch\" defaultValue=\"\" toolTip=\"Select a test procedures branch.\" />";
+ private static final String artifactTypeChooser =
+ "<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" displayName=\"Artifact Type(s) to Trace\" defaultValue=\"" + CoreArtifactTypes.SoftwareRequirement + "\"/>";
+ private static final String searchInheritedTypes =
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"Search Inherited Types\" labelAfter=\"true\" horizontalLabel=\"true\" defaultValue=\"true\" />";
+
+ private static final String PULL_ALL_DATA_LABEL =
+ "Pull all data from test branch (script directory and requirements branch are not needed)";
+ private static final String pullAllDataFromBranch =
+ "<XWidget xwidgetType=\"XCheckBox\" displayName=\"" + PULL_ALL_DATA_LABEL + "\" labelAfter=\"true\" horizontalLabel=\"true\"/>";
+
+ @Override
+ public String getName() {
+ return "Publish STD/STP Traceability";
+ }
+
+ @Override
+ public String getXWidgetsXml() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select tables to generate:\"/>");
+ for (TraceabilityStyle style : TraceabilityStyle.values()) {
+ builder.append("<XWidget xwidgetType=\"XCheckBox\" displayName=\"");
+ builder.append(style.asLabel());
+ builder.append("\" labelAfter=\"true\" horizontalLabel=\"true\"/>");
+ }
+ builder.append(scriptDirectory);
+ builder.append(requirementsBranch);
+ builder.append(pullAllDataFromBranch);
+ builder.append(testProceduresBranch);
+ builder.append(artifactTypeChooser);
+ builder.append(searchInheritedTypes);
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ private List<TraceabilityStyle> getStyles(VariableMap variableMap) throws OseeArgumentException {
+ List<TraceabilityStyle> styles = new ArrayList<TraceabilityStyle>();
+ for (TraceabilityStyle style : TraceabilityStyle.values()) {
+ boolean isSelected = variableMap.getBoolean(style.asLabel());
+ if (isSelected) {
+ styles.add(style);
+ }
+ }
+ return styles;
+ }
+
+ @Override
+ public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
+ Branch requirementsBranch = variableMap.getBranch("Requirements Branch");
+ Branch testProcedureBranch = variableMap.getBranch("Test Procedures Branch");
+ Collection<? extends IArtifactType> types =
+ variableMap.getCollection(ArtifactType.class, "Artifact Type(s) to Trace");
+ boolean searchInherited = variableMap.getBoolean("Search Inherited Types");
+ File scriptDir = new File(variableMap.getString("Script Root Directory"));
+ List<TraceabilityStyle> selectedReports = getStyles(variableMap);
+
+ int totalWork = selectedReports.size() * 2 + 1;
+
+ monitor.beginTask("Generate Traceability Tables", totalWork);
+
+ if (selectedReports.size() > 0) {
+ // Load Requirements Data
+ TraceabilityProviderOperation provider;
+ if (variableMap.getBoolean(PULL_ALL_DATA_LABEL)) {
+ provider = new BranchTraceabilityOperation(testProcedureBranch, types, searchInherited);
+ } else {
+ provider = new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, types, searchInherited);
+ }
+ RequirementTraceabilityData traceabilityData =
+ new RequirementTraceabilityData(requirementsBranch, testProcedureBranch, provider);
+ IStatus status = traceabilityData.initialize(monitor);
+ if (status.getSeverity() == IStatus.CANCEL) {
+ monitor.setCanceled(true);
+ } else if (status.getSeverity() == IStatus.OK) {
+ monitor.worked(1);
+ int count = 0;
+ List<IFile> files = new ArrayList<IFile>();
+ for (TraceabilityStyle style : selectedReports) {
+ monitor.subTask(String.format("Creating table: [%s] [%s of %s]", style.asLabel(), ++count,
+ selectedReports.size()));
+
+ TraceabilityTable table =
+ TraceabilityFactory.getTraceabilityTable(OutputFormat.EXCEL, style, traceabilityData);
+ if (table != null) {
+ table.run(monitor);
+ }
+ monitor.worked(1);
+
+ if (table != null) {
+ monitor.subTask(String.format("Writing table: [%s] [%s of %s]", style.asLabel(), count,
+ selectedReports.size()));
+ String fileName = style.toString() + "." + Lib.getDateTimeString() + ".xml";
+ IFile iFile = OseeData.getIFile(fileName);
+ AIFile.writeToFile(iFile, table.toString());
+ files.add(iFile);
+ }
+ monitor.worked(1);
+ }
+ for (IFile iFile : files) {
+ Program.launch(iFile.getLocation().toOSString());
+ }
+ } else {
+ throw new Exception(status.getMessage(), status.getException());
+ }
+ }
+ monitor.subTask("Done");
+ }
+
+ @Override
+ public Collection<String> getCategories() {
+ return Arrays.asList("Define.Publish");
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdCsciToTestTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdCsciToTestTable.java
new file mode 100644
index 0000000000..328d1dfb36
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdCsciToTestTable.java
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.osee.define.traceability.ArtifactOperations;
+import org.eclipse.osee.define.traceability.RequirementTraceabilityData;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StdCsciToTestTable implements ISimpleTable {
+
+ private final RequirementTraceabilityData source;
+
+ public StdCsciToTestTable(RequirementTraceabilityData source) {
+ this.source = source;
+ }
+
+ @Override
+ public String getHeader() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Column ss:StyleID=\"s38\" ss:Width=\"63.75\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:Width=\"160.25\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:Width=\"100.75\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:Width=\"40.75\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:Width=\"180.75\"/>");
+ builder.append("<Row ss:AutoFitHeight=\"0\" ss:Height=\"13.5\">");
+ builder.append("<Cell ss:MergeAcross=\"4\" ss:StyleID=\"s22\"><Data ss:Type=\"String\">Table X.X: CSCI Requirements to Test Traceability</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:AutoFitHeight=\"0\" ss:Height=\"14.25\">");
+ builder.append("<Cell ss:MergeAcross=\"2\" ss:StyleID=\"m151274392\"><Data ss:Type=\"String\">CSCI Requirement</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m151274402\"><Data ss:Type=\"String\">Test</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m151274412\"><Data ss:Type=\"String\">Test Script / Test Procedure</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:AutoFitHeight=\"0\" ss:Height=\"14.25\">");
+ builder.append("<Cell ss:StyleID=\"s24\"><Data ss:Type=\"String\">Paragraph #</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s24\"><Data ss:Type=\"String\">Paragraph Title</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s24\"><Data ss:Type=\"String\">Requirement Type</Data></Cell>");
+ builder.append("</Row>");
+ return builder.toString();
+ }
+
+ @Override
+ public String getHeaderStyles() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Styles><Style ss:ID=\"Default\" ss:Name=\"Normal\">");
+ builder.append("<Alignment ss:Vertical=\"Bottom\"/><Borders/><Font/>");
+ builder.append("<Interior/><NumberFormat/>Protection/></Style><Style ss:ID=\"m151274392\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/></Borders>");
+ builder.append("<Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m151274402\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/></Borders>");
+ builder.append("<Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m151274412\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/></Borders>");
+ builder.append("<Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s22\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/></Borders>");
+ builder.append("<Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s24\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/>");
+ builder.append("</Style>");
+ builder.append("<Style ss:ID=\"s38\"><Alignment ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/></Style>");
+ builder.append("</Styles>");
+ return builder.toString();
+ }
+
+ @Override
+ public void initializeSheet(ISheetWriter sheetWriter) throws Exception {
+ sheetWriter.startSheet("STD - CSCI Requirements to Test Traceability", 5);
+ }
+
+ @Override
+ public void generateBody(ISheetWriter sheetWriter) throws Exception {
+ List<Artifact> requirements = ArtifactOperations.sortByParagraphNumbers(source.getAllSwRequirements());
+ for (Artifact artifact : requirements) {
+ ArtifactOperations operations = new ArtifactOperations(artifact);
+ String paragraphTitle = operations.getName();
+ String paragraphNumber = operations.getParagraphNumber();
+ String artifactType = artifact.getArtifactTypeName();
+
+ String partition =
+ org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", operations.getPartitions());
+
+ String qualificationLine = getQualificationMethod(source, artifact);
+ sheetWriter.writeRow(paragraphNumber, paragraphTitle, artifactType, partition, qualificationLine);
+ }
+ }
+
+ private String getQualificationMethod(RequirementTraceabilityData source, Artifact artifact) {
+ StringBuilder builder = new StringBuilder();
+
+ String scripts = getCodeUnitLine(source, artifact);
+ if (Strings.isValid(scripts) != false) {
+ builder.append(scripts);
+ }
+
+ String testProcedures = getTestProcedure(source, artifact);
+ if (Strings.isValid(testProcedures) != false) {
+ if (builder.length() > 0) {
+ builder.append(",\n");
+ }
+ builder.append(testProcedures);
+ }
+ if (builder.length() == 0) {
+ builder.append("None");
+ }
+ return builder.toString();
+ }
+
+ private String getCodeUnitLine(RequirementTraceabilityData source, Artifact artifact) {
+ String toReturn = "";
+ Collection<String> codeUnits = source.getRequirementsToCodeUnits().getValues(artifact);
+ if (codeUnits != null) {
+ List<String> units = new ArrayList<String>();
+ for (String codeUnit : codeUnits) {
+ if (Strings.isValid(codeUnit)) {
+ int index = codeUnit.lastIndexOf(File.separator);
+ codeUnit = codeUnit.substring(index + 1, codeUnit.length());
+ }
+ units.add(codeUnit);
+ }
+ toReturn = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", units);
+ }
+ return toReturn;
+ }
+
+ private String getTestProcedure(RequirementTraceabilityData source, Artifact artifact) {
+ String toReturn = "";
+ Collection<Artifact> testProcedures = source.getRequirementNameToTestProcedures().getValues(artifact.getName());
+ if (testProcedures != null) {
+ List<String> units = new ArrayList<String>();
+ for (Artifact testProcedure : testProcedures) {
+ units.add(testProcedure.getName());
+ }
+ toReturn = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", units);
+ }
+ return toReturn;
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdTestToCsciTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdTestToCsciTable.java
new file mode 100644
index 0000000000..bb5b6b5e04
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StdTestToCsciTable.java
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.TreeSet;
+import org.eclipse.osee.define.traceability.ArtifactOperations;
+import org.eclipse.osee.define.traceability.RequirementTraceabilityData;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StdTestToCsciTable implements ISimpleTable {
+
+ private final RequirementTraceabilityData source;
+
+ public StdTestToCsciTable(RequirementTraceabilityData source) {
+ this.source = source;
+ }
+
+ @Override
+ public String getHeader() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"32.25\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"169.5\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"82.5\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"275.25\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"169.5\"/>");
+ builder.append("<Row ss:Height=\"13.5\">");
+ builder.append("<Cell ss:MergeAcross=\"4\" ss:StyleID=\"s21\"><Data ss:Type=\"String\">Table X.X: Test to CSCI Requirements Traceability</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m15149990\"><Data ss:Type=\"String\">Test</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m15150000\"><Data ss:Type=\"String\">Test Script / Test Procedure</Data></Cell>");
+ builder.append("<Cell ss:MergeAcross=\"2\" ss:StyleID=\"m15150010\"><Data ss:Type=\"String\">CSCI Requirement</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:Index=\"3\" ss:StyleID=\"s28\"><Data ss:Type=\"String\">Paragraph #</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s28\"><Data ss:Type=\"String\">Paragraph Title</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s28\"><Data ss:Type=\"String\">Requirement Type</Data></Cell>");
+ builder.append("</Row>");
+ return builder.toString();
+ }
+
+ @Override
+ public String getHeaderStyles() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Styles><Style ss:ID=\"Default\" ss:Name=\"Normal\">");
+ builder.append("<Alignment ss:Vertical=\"Bottom\"/>");
+ builder.append("<Borders/><Font/><Interior/><NumberFormat/><Protection/></Style>");
+ builder.append("<Style ss:ID=\"m15149990\"><Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m15150000\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m15150010\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s21\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s28\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/>");
+ builder.append("</Style>");
+ builder.append("<Style ss:ID=\"s38\"><Alignment ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/></Style>");
+ builder.append("</Styles>");
+ return builder.toString();
+ }
+
+ @Override
+ public void initializeSheet(ISheetWriter sheetWriter) throws Exception {
+ sheetWriter.startSheet("STD - Test to CSCI Requirements Traceability", 5);
+ }
+
+ @Override
+ public void generateBody(ISheetWriter sheetWriter) throws Exception {
+ Collection<Artifact> directRequirements = source.getAllSwRequirements();
+ HashCollection<String, Artifact> partitionMap = ArtifactOperations.sortByPartition(directRequirements);
+
+ HashCollection<Artifact, String> requirementsToQualificationMethod = getQualificationMethods(source);
+
+ HashCollection<String, String> partitionToQualificationMethod =
+ new HashCollection<String, String>(false, TreeSet.class);
+ HashCollection<String, Artifact> qualificationMethodToRequirements =
+ new HashCollection<String, Artifact>(false, TreeSet.class);
+ for (String partition : partitionMap.keySet()) {
+ for (Artifact artifact : partitionMap.getValues(partition)) {
+
+ Collection<String> values = requirementsToQualificationMethod.getValues(artifact);
+ if (values != null) {
+ for (String codeUnit : values) {
+ if (Strings.isValid(codeUnit)) {
+ int index = codeUnit.lastIndexOf(File.separator);
+ codeUnit = codeUnit.substring(index + 1, codeUnit.length());
+ }
+ partitionToQualificationMethod.put(partition, codeUnit);
+ qualificationMethodToRequirements.put(codeUnit, artifact);
+ }
+ }
+
+ }
+ }
+
+ for (String partition : new TreeSet<String>(partitionToQualificationMethod.keySet())) {
+ List<String> units = new ArrayList<String>(partitionToQualificationMethod.getValues(partition));
+ Collections.sort(units);
+ for (String codeUnit : units) {
+ List<Artifact> artifacts =
+ ArtifactOperations.sortByParagraphNumbers(qualificationMethodToRequirements.getValues(codeUnit));
+ processRow(sheetWriter, partition, codeUnit, artifacts);
+ }
+ }
+ }
+
+ private HashCollection<Artifact, String> getQualificationMethods(RequirementTraceabilityData source) {
+ HashCollection<Artifact, String> toReturn = new HashCollection<Artifact, String>(false, LinkedList.class);
+ HashCollection<Artifact, String> requirementsToCodeUnits = source.getRequirementsToCodeUnits();
+
+ // Combine Test Scripts and Test Procedures
+ HashCollection<String, Artifact> requirementsToTestProcedures = source.getRequirementNameToTestProcedures();
+ for (Artifact requirement : source.getAllSwRequirements()) {
+ Collection<Artifact> testProcedures = requirementsToTestProcedures.getValues(requirement.getName());
+ if (testProcedures != null) {
+ for (Artifact testProcedure : testProcedures) {
+ toReturn.put(requirement, testProcedure.getName());
+ }
+ }
+ Collection<String> testScripts = requirementsToCodeUnits.getValues(requirement);
+ if (testScripts != null) {
+ toReturn.put(requirement, testScripts);
+ }
+ }
+ return toReturn;
+ }
+
+ private void processRow(ISheetWriter sheetWriter, String partition, String codeUnit, Collection<Artifact> artifacts) throws Exception {
+ List<String> paragraphTitles = new ArrayList<String>();
+ List<String> paragraphNumbers = new ArrayList<String>();
+ List<String> artifactTypes = new ArrayList<String>();
+ for (Artifact artifact : artifacts) {
+ ArtifactOperations operator = new ArtifactOperations(artifact);
+ String name = operator.getName();
+ String number = operator.getParagraphNumber();
+
+ if (paragraphTitles.contains(name) != true && paragraphNumbers.contains(number) != true) {
+ paragraphTitles.add(name);
+ artifactTypes.add(artifact.getArtifactTypeName());
+ if (Strings.isValid(number) != true) {
+ number = "-1";
+ }
+ paragraphNumbers.add(number);
+ }
+ }
+ String paragraphTitle = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", paragraphTitles);
+ String paragraphNumber = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", paragraphNumbers);
+ String artifactType = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", artifactTypes);
+ sheetWriter.writeRow(partition, codeUnit, paragraphNumber, paragraphTitle, artifactType);
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpCsciToTestTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpCsciToTestTable.java
new file mode 100644
index 0000000000..7d4260dd67
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpCsciToTestTable.java
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import java.io.IOException;
+import java.util.List;
+import org.eclipse.osee.define.traceability.ArtifactOperations;
+import org.eclipse.osee.define.traceability.RequirementTraceabilityData;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StpCsciToTestTable implements ISimpleTable {
+
+ private final RequirementTraceabilityData source;
+
+ public StpCsciToTestTable(RequirementTraceabilityData source) {
+ this.source = source;
+ }
+
+ @Override
+ public String getHeader() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"95.25\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"387.75\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"31.5\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"53.25\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"47.25\"/>");
+ builder.append("<Row ss:Height=\"13.5\">");
+ builder.append("<Cell ss:MergeAcross=\"4\" ss:StyleID=\"s21\"><Data ss:Type=\"String\">Table X.X: CSCI Requirements to Test Traceability</Data></Cell>");
+ builder.append("</Row><Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:MergeAcross=\"1\" ss:StyleID=\"m15143714\"><Data ss:Type=\"String\">CSCI Requirement</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m15143754\"><Data ss:Type=\"String\">Test</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m15143724\"><Data ss:Type=\"String\">Qual Method</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"m15143734\"><Data ss:Type=\"String\">Qual Facility</Data></Cell>");
+ builder.append("</Row><Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:StyleID=\"s26\"><Data ss:Type=\"String\">Paragraph #</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s26\"><Data ss:Type=\"String\">Paragraph Title</Data></Cell>");
+ builder.append("</Row>");
+ return builder.toString();
+ }
+
+ @Override
+ public String getHeaderStyles() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Styles><Style ss:ID=\"Default\" ss:Name=\"Normal\">");
+ builder.append("<Alignment ss:Vertical=\"Bottom\"/><Borders/><Font/>");
+ builder.append("<Interior/><NumberFormat/><Protection/></Style><Style ss:ID=\"m15143714\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m15143724\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m15143734\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"m15143754\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s21\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style><Style ss:ID=\"s26\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/><Borders>");
+ builder.append("<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/>");
+ builder.append("</Style>");
+ builder.append("<Style ss:ID=\"s38\"><Alignment ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/></Style>");
+ builder.append("</Styles>");
+ return builder.toString();
+ }
+
+ @Override
+ public void initializeSheet(ISheetWriter sheetWriter) throws IOException {
+ sheetWriter.startSheet("STP - CSCI Requirements to Test Traceability", 5);
+ }
+
+ @Override
+ public void generateBody(ISheetWriter sheetWriter) throws Exception {
+ List<Artifact> requirements = ArtifactOperations.sortByParagraphNumbers(source.getDirectSwRequirements());
+ for (Artifact artifact : requirements) {
+ processRow(sheetWriter, artifact);
+ }
+ }
+
+ private void processRow(ISheetWriter sheetWriter, Artifact artifact) throws Exception {
+ ArtifactOperations operator = new ArtifactOperations(artifact);
+ String paragraphTitle = operator.getName();
+ String paragraphNumber = operator.getParagraphNumber();
+ String qualMethod = operator.getQualificationMethod();
+ String qualFacility = operator.getQualificationFacility();
+ String partition = org.eclipse.osee.framework.jdk.core.util.Collections.toString(",\n", operator.getPartitions());
+ sheetWriter.writeRow(paragraphNumber, paragraphTitle, partition, qualMethod, qualFacility);
+ }
+}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpTestToCsciTable.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpTestToCsciTable.java
new file mode 100644
index 0000000000..a0d6ddcded
--- /dev/null
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/StpTestToCsciTable.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.define.traceability.report;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.TreeSet;
+import org.eclipse.osee.define.traceability.ArtifactOperations;
+import org.eclipse.osee.define.traceability.RequirementTraceabilityData;
+import org.eclipse.osee.framework.jdk.core.type.HashCollection;
+import org.eclipse.osee.framework.jdk.core.util.io.xml.ISheetWriter;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class StpTestToCsciTable implements ISimpleTable {
+
+ private final RequirementTraceabilityData source;
+
+ public StpTestToCsciTable(RequirementTraceabilityData source) {
+ this.source = source;
+ }
+
+ @Override
+ public void initializeSheet(ISheetWriter sheetWriter) throws IOException {
+ sheetWriter.startSheet("STP - Test to CSCI Requirements Traceability", 5);
+ }
+
+ @Override
+ public String getHeader() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"55.5\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"88.5\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"114\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"99.75\"/>");
+ builder.append("<Column ss:StyleID=\"s38\" ss:AutoFitWidth=\"0\" ss:Width=\"105\"/>");
+ builder.append("<Row ss:Height=\"13.5\">");
+ builder.append("<Cell ss:MergeAcross=\"4\" ss:StyleID=\"s31\"><Data ss:Type=\"String\">Table X.X: Test to CSCI Requirements Traceability</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"s25\"><Data ss:Type=\"String\">Test</Data></Cell>");
+ builder.append("<Cell ss:MergeAcross=\"1\" ss:StyleID=\"s25\"><Data ss:Type=\"String\">CSCI Requirement</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"s25\"><Data ss:Type=\"String\">Qual Method</Data></Cell>");
+ builder.append("<Cell ss:MergeDown=\"1\" ss:StyleID=\"s25\"><Data ss:Type=\"String\">Qual Facility</Data></Cell>");
+ builder.append("</Row>");
+ builder.append("<Row ss:Height=\"14.25\">");
+ builder.append("<Cell ss:Index=\"2\" ss:StyleID=\"s29\"><Data ss:Type=\"String\">Paragraph #</Data></Cell>");
+ builder.append("<Cell ss:StyleID=\"s29\"><Data ss:Type=\"String\">Paragraph Title</Data></Cell>");
+ builder.append("</Row>");
+ return builder.toString();
+ }
+
+ @Override
+ public String getHeaderStyles() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<Styles><Style ss:ID=\"Default\" ss:Name=\"Normal\"><Alignment ss:Vertical=\"Bottom\"/>");
+ builder.append("<Borders/><Font/><Interior/><NumberFormat/><Protection/></Style>");
+ builder.append("<Style ss:ID=\"s25\"><Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/>");
+ builder.append("<Borders><Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/></Style>");
+ builder.append("<Style ss:ID=\"s29\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/>");
+ builder.append("<Borders><Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("<Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders><Font x:Family=\"Swiss\" ss:Bold=\"1\"/>");
+ builder.append("</Style><Style ss:ID=\"s31\">");
+ builder.append("<Alignment ss:Horizontal=\"Center\" ss:Vertical=\"Bottom\"/>");
+ builder.append("<Borders><Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"3\"/>");
+ builder.append("</Borders>");
+ builder.append("<Font x:Family=\"Swiss\" ss:Bold=\"1\"/>");
+ builder.append("</Style>");
+ builder.append("<Style ss:ID=\"s38\"><Alignment ss:Vertical=\"Bottom\" ss:WrapText=\"1\"/></Style>");
+ builder.append("</Styles>");
+ return builder.toString();
+ }
+
+ @Override
+ public void generateBody(ISheetWriter sheetWriter) throws Exception {
+ Collection<Artifact> directRequirements = source.getDirectSwRequirements();
+ HashCollection<String, Artifact> partitionMap = ArtifactOperations.sortByPartition(directRequirements);
+
+ for (String partition : new TreeSet<String>(partitionMap.keySet())) {
+ Collection<Artifact> artifacts = partitionMap.getValues(partition);
+ artifacts = ArtifactOperations.sortByParagraphNumbers(artifacts);
+ for (Artifact artifact : artifacts) {
+ processRow(sheetWriter, partition, artifact);
+ }
+ }
+ }
+
+ private void processRow(ISheetWriter sheetWriter, String partition, Artifact artifact) throws Exception {
+ ArtifactOperations operator = new ArtifactOperations(artifact);
+ String paragraphTitle = operator.getName();
+ String paragraphNumber = operator.getParagraphNumber();
+ String qualMethod = operator.getQualificationMethod();
+ String qualFacility = operator.getQualificationFacility();
+
+ sheetWriter.writeRow(partition, paragraphNumber, paragraphTitle, qualMethod, qualFacility);
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/FrameworkXWidgetProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/FrameworkXWidgetProvider.java
index c22d9fc87b..2c6976fded 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/FrameworkXWidgetProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/workflow/FrameworkXWidgetProvider.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
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.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.skynet.core.attribute.BooleanAttribute;
@@ -344,6 +345,10 @@ public final class FrameworkXWidgetProvider {
xWidget = widget;
} else if (xWidgetName.equals(XArtifactTypeMultiChoiceSelect.WIDGET_ID)) {
XArtifactTypeMultiChoiceSelect widget = new XArtifactTypeMultiChoiceSelect();
+ String defaultType = xWidgetLayoutData.getDefaultValue();
+ if (Strings.isValid(defaultType)) {
+ widget.setSelected(Collections.singleton(ArtifactTypeManager.getType(defaultType)));
+ }
xWidget = widget;
} else if (xWidgetName.equals(XArtifactMultiChoiceSelect.WIDGET_ID)) {
xWidget = new XArtifactMultiChoiceSelect();

Back to the top