Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2017-08-16 12:30:05 -0400
committermegumi.telles2017-08-21 11:38:29 -0400
commit926dc5e87c980cebfa7803844cdc3f5eac82dffb (patch)
tree824cdcf75423976522a4f62ce1c77b376204d680
parentb5a72187d849e075a362a80615d5092c8c1a179f (diff)
downloadorg.eclipse.osee-926dc5e87c980cebfa7803844cdc3f5eac82dffb.tar.gz
org.eclipse.osee-926dc5e87c980cebfa7803844cdc3f5eac82dffb.tar.xz
org.eclipse.osee-926dc5e87c980cebfa7803844cdc3f5eac82dffb.zip
feature[ats_TW1650]: Update traceability blams for Applicability
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java40
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSubsystemToDesignTraceability.java73
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSystemLevelSSDD.java71
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java44
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java71
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/BranchTraceabilityOperation.java25
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java3
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/RequirementTraceabilityData.java25
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ScriptTraceabilityOperation.java10
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/blam/TraceReportBlam.java61
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/data/RequirementData.java19
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java3
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/report/PublishStdStpTraceability.java49
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ViewIdUtility.java50
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java40
15 files changed, 514 insertions, 70 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
index c39b20d6de..708aaff231 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/operation/DetailedTestStatusOld.java
@@ -73,7 +73,9 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
@@ -86,6 +88,8 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
* @author Ryan D. Brooks
*/
public class DetailedTestStatusOld extends AbstractBlam {
+ private static final String REQUIREMENTS_BRANCH = "Requirements Branch";
+ private static final String PROGRAM = "Program";
private static final Pattern taskNamePattern = Pattern.compile("(?:\"([^\"]+)\")? for \"([^\"]+)\"");
private static final SimpleDateFormat dateFormatter = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
private final Matcher taskNameMatcher = taskNamePattern.matcher("");
@@ -113,6 +117,8 @@ public class DetailedTestStatusOld extends AbstractBlam {
private static final String TRACE_HANDLER_CHECKBOX =
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"%s\" labelAfter=\"true\" horizontalLabel=\"true\"/>";
private Collection<String> availableTraceHandlers;
+ private XCombo branchViewWidget;
+ private XBranchSelectWidget branchWidget;
private BranchId selectedBranch;
private IAtsProgram selectedProgram;
@@ -224,10 +230,13 @@ public class DetailedTestStatusOld extends AbstractBlam {
return;
}
- BranchId requirementsBranch = variableMap.getBranch("Requirements Branch");
+ BranchId requirementsBranch = variableMap.getBranch(REQUIREMENTS_BRANCH);
BranchId scriptsBranch = variableMap.getBranch("Test Results Branch");
BranchId procedureBranch = variableMap.getBranch("Test Procedure Branch");
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
+
File scriptDir = new File(variableMap.getString("Script Root Directory"));
versions = new ArrayList<>();
for (IAtsVersion version : variableMap.getCollection(IAtsVersion.class, "Versions")) {
@@ -247,8 +256,8 @@ public class DetailedTestStatusOld extends AbstractBlam {
// Load Requirements Data
TraceabilityProviderOperation provider =
- new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, traceHandlers, false);
- RequirementTraceabilityData traceabilityData = new RequirementTraceabilityData(procedureBranch, provider);
+ new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, traceHandlers, false, viewId);
+ RequirementTraceabilityData traceabilityData = new RequirementTraceabilityData(procedureBranch, provider, viewId);
IStatus status = traceabilityData.initialize(monitor);
switch (status.getSeverity()) {
@@ -517,7 +526,7 @@ public class DetailedTestStatusOld extends AbstractBlam {
if (widgetLabel.equals("Versions")) {
versionsListViewer = (XVersionList) xWidget;
- } else if (widgetLabel.equals("Requirements Branch")) {
+ } else if (widgetLabel.equals(REQUIREMENTS_BRANCH)) {
requirementsBranchWidget = (XBranchSelectWidget) xWidget;
} else if (widgetLabel.equals("Test Procedure Branch")) {
testProcedureBranchWidget = (XBranchSelectWidget) xWidget;
@@ -527,10 +536,30 @@ public class DetailedTestStatusOld extends AbstractBlam {
@Override
public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) {
String widgetName = xWidget.getLabel();
- if (widgetName.equals("Program")) {
+ if (widgetName.equals(PROGRAM)) {
XAtsProgramComboWidget programWidget = (XAtsProgramComboWidget) xWidget;
programWidget.getComboViewer().addSelectionChangedListener(new ProgramSelectionListener());
+ } else if (xWidget.getLabel().equals(REQUIREMENTS_BRANCH)) {
+ branchWidget = (XBranchSelectWidget) xWidget;
+ branchWidget.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ BranchId branch = branchWidget.getSelection();
+ if (branch != null && branch.isInvalid()) {
+ branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
}
+
}
private void loadTasksFromWorkflow(TeamWorkFlowArtifact workflow) throws OseeCoreException {
@@ -595,6 +624,7 @@ public class DetailedTestStatusOld extends AbstractBlam {
"<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Results Branch\" toolTip=\"Select a scripts results branch.\" />");
sb.append(
"<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Test Procedure Branch\" toolTip=\"Select a test procedures branch.\" />");
+ sb.append(BRANCH_VIEW_WIDGET);
sb.append("</xWidgets>");
return sb.toString();
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSubsystemToDesignTraceability.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSubsystemToDesignTraceability.java
index 65ae9846c0..1e15eed35a 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSubsystemToDesignTraceability.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSubsystemToDesignTraceability.java
@@ -14,8 +14,10 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -29,17 +31,29 @@ import org.eclipse.osee.framework.plugin.core.util.AIFile;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.utility.ViewIdUtility;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
import org.eclipse.swt.program.Program;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Ryan D. Brooks
*/
public class PublishSubsystemToDesignTraceability extends AbstractBlam {
+ private static final String SUBSYSTEM_ROOT_ARTIFACTS = "Subsystem Root Artifacts";
private CharBackedInputStream charBak;
private ISheetWriter excelWriter;
+ private XCombo branchViewWidget;
+ private XListDropViewer viewerWidget;
+
@Override
public String getName() {
return "Publish Subsystem To Design Traceability";
@@ -54,10 +68,17 @@ public class PublishSubsystemToDesignTraceability extends AbstractBlam {
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
monitor.beginTask(getDescriptionUsage(), 100);
- List<Artifact> subsystems = variableMap.getArtifacts("Subsystem Root Artifacts");
+ List<Artifact> subsystems = variableMap.getArtifacts(SUBSYSTEM_ROOT_ARTIFACTS);
BranchId branch = subsystems.get(0).getBranch();
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
+
init();
+ Set<ArtifactId> findExcludedArtifactsByView = ViewIdUtility.findExcludedArtifactsByView(viewId, branch);
+ if (subsystems != null) {
+ ViewIdUtility.removeExcludedArtifacts(subsystems.iterator(), findExcludedArtifactsByView);
+ }
monitor.subTask("Aquiring Design Artifacts"); // bulk load for performance reasons
ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SubsystemDesign, branch);
@@ -90,14 +111,22 @@ public class PublishSubsystemToDesignTraceability extends AbstractBlam {
excelWriter.writeRow(CoreAttributeTypes.ParagraphNumber.getName(), "Paragraph Title",
CoreAttributeTypes.ParagraphNumber.getName(), "Paragraph Title");
- for (Artifact subsystemRequirement : subsystem.getDescendants()) {
+ List<Artifact> descendants = subsystem.getDescendants();
+ if (descendants != null) {
+ ViewIdUtility.removeExcludedArtifacts(descendants.iterator(), excludedArtifactIdMap);
+ }
+ for (Artifact subsystemRequirement : descendants) {
excelWriter.writeCell(subsystemRequirement.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
excelWriter.writeCell(subsystemRequirement.getName());
if (subsystemRequirement.isOfType(CoreArtifactTypes.SubsystemRequirementMSWord)) {
boolean loopNeverRan = true;
- for (Artifact subsystemDesign : subsystemRequirement.getRelatedArtifacts(
- CoreRelationTypes.Design__Design)) {
+ List<Artifact> relatedArtifacts =
+ subsystemRequirement.getRelatedArtifacts(CoreRelationTypes.Design__Design);
+ if (relatedArtifacts != null) {
+ ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
+ }
+ for (Artifact subsystemDesign : relatedArtifacts) {
if (subsystemDesign.isOfType(CoreArtifactTypes.SubsystemDesign)) {
loopNeverRan = false;
excelWriter.writeCell(subsystemDesign.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""),
@@ -125,7 +154,41 @@ public class PublishSubsystemToDesignTraceability extends AbstractBlam {
@Override
public String getXWidgetsXml() {
- return "<xWidgets><XWidget xwidgetType=\"XListDropViewer\" displayName=\"Subsystem Root Artifacts\" /></xWidgets>";
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"Subsystem Root Artifacts\" />");
+ builder.append(BRANCH_VIEW_WIDGET);
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener xModListener, boolean isEditable) {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, xModListener, isEditable);
+ if (xWidget.getLabel().equals(SUBSYSTEM_ROOT_ARTIFACTS)) {
+ viewerWidget = (XListDropViewer) xWidget;
+ viewerWidget.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ List<Artifact> arts = viewerWidget.getArtifacts();
+ if (arts != null && !arts.isEmpty()) {
+ BranchId branch = arts.iterator().next().getBranch();
+ if (branch != null && branch.isValid()) {
+ branchViews =
+ ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
+ }
}
@Override
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSystemLevelSSDD.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSystemLevelSSDD.java
index 5137c61b29..f17b3b52a2 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSystemLevelSSDD.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishSystemLevelSSDD.java
@@ -36,20 +36,32 @@ 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.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.utility.Requirements;
+import org.eclipse.osee.framework.skynet.core.utility.ViewIdUtility;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
import org.eclipse.swt.program.Program;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Ryan D. Brooks
*/
public class PublishSystemLevelSSDD extends AbstractBlam {
+ private static final String BRANCH = "Branch";
private CharBackedInputStream charBak;
private ISheetWriter excelWriter;
private List<Artifact> sysReqs;
private Artifact[] allSubsystems;
private final HashCollection<Artifact, Artifact> subsystemToRequirements;
+ private XCombo branchViewWidget;
+ private XBranchSelectWidget branchWidget;
+
@Override
public String getName() {
return "Publish System Level SSDD";
@@ -66,12 +78,25 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
}
@Override
+ public String getXWidgetsXml() throws OseeCoreException {
+ StringBuilder builder = new StringBuilder();
+ builder.append("<xWidgets>");
+ builder.append(branchXWidgetXml);
+ builder.append(BRANCH_VIEW_WIDGET);
+ builder.append("</xWidgets>");
+ return builder.toString();
+ }
+
+ @Override
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
monitor.beginTask("Generating System Level SSDD", 100);
- BranchId branch = variableMap.getBranch("Branch");
+ BranchId branch = variableMap.getBranch(BRANCH);
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
init();
+ ViewIdUtility.findExcludedArtifactsByView(viewId, branch);
monitor.subTask("Aquiring System Components"); // bulk load for performance reasons
ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.Component, branch);
@@ -82,6 +107,7 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
Artifact root = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
sysReqs = root.getChild(Requirements.SYSTEM_REQUIREMENTS).getDescendants();
+ excludeArtifacts(sysReqs.iterator());
getSubsystemList();
monitor.subTask("5.2 System Requirement Allocation To Subsystems");
@@ -98,7 +124,10 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
private void getSubsystemList() throws OseeCoreException {
for (Artifact systemRequirement : sysReqs) {
- for (Artifact subsystem : systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component)) {
+ List<Artifact> relatedArtifacts =
+ systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component);
+ excludeArtifacts(relatedArtifacts.iterator());
+ for (Artifact subsystem : relatedArtifacts) {
subsystemToRequirements.put(subsystem, systemRequirement);
}
}
@@ -132,7 +161,12 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
CoreArtifactTypes.SystemRequirementMSWord.getName(), "Notes <rationale>");
for (Artifact systemRequirement : subsystemToRequirements.getValues(subsystem)) {
- for (Artifact component : systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component)) {
+ List<Artifact> relatedArtifacts =
+ systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component);
+
+ excludeArtifacts(relatedArtifacts.iterator());
+
+ for (Artifact component : relatedArtifacts) {
if (component.equals(subsystem)) {
String rationale =
systemRequirement.getRelationRationale(component, CoreRelationTypes.Allocation__Component);
@@ -152,8 +186,10 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
excelWriter.writeCell(systemRequirement.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
excelWriter.writeCell(systemRequirement.getName());
- List<Artifact> allocatedSubsystems =
- new ArrayList<Artifact>(systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component));
+ List<Artifact> relatedArtifacts = systemRequirement.getRelatedArtifacts(CoreRelationTypes.Allocation__Component);
+ excludeArtifacts(relatedArtifacts.iterator());
+
+ List<Artifact> allocatedSubsystems = new ArrayList<Artifact>(relatedArtifacts);
Collections.sort(allocatedSubsystems);
for (Artifact allocatedSubsystem : allocatedSubsystems) {
excelWriter.writeCell("X", Arrays.binarySearch(allSubsystems, allocatedSubsystem) + 2);
@@ -162,6 +198,31 @@ public class PublishSystemLevelSSDD extends AbstractBlam {
}
@Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener xModListener, boolean isEditable) {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, xModListener, isEditable);
+ if (xWidget.getLabel().equals(BRANCH)) {
+ branchWidget = (XBranchSelectWidget) xWidget;
+ branchWidget.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ BranchId branch = branchWidget.getSelection();
+ if (branch != null && branch.isValid()) {
+ branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
+ }
+ }
+
+ @Override
public String getDescriptionUsage() {
return "Generate Traceability tables for the System Level SSDD";
}
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
index fc411feadc..fdc919c71c 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemFullTraceReport.java
@@ -43,7 +43,10 @@ import org.eclipse.osee.framework.skynet.core.artifact.Attribute;
import org.eclipse.osee.framework.skynet.core.utility.Artifacts;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
import org.eclipse.osee.framework.ui.skynet.widgets.XText;
import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
@@ -59,6 +62,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
* @author Ryan D. Brooks
*/
public class SubsystemFullTraceReport extends AbstractBlam {
+ private static final String SUBSYSTEM_REQUIREMENTS = "Subsystem Requirements";
private CharBackedInputStream charBak;
private ISheetWriter writer;
private HashCollection<Artifact, String> requirementsToCodeUnits;
@@ -74,7 +78,10 @@ public class SubsystemFullTraceReport extends AbstractBlam {
private static final String TRACE_HANDLER_CHECKBOX =
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"%s\" labelAfter=\"true\" horizontalLabel=\"true\"/>";
+
private Collection<String> availableTraceHandlers;
+ private XCombo branchViewWidget;
+ private XListDropViewer subSystem;
@Override
public String getName() {
@@ -88,12 +95,15 @@ public class SubsystemFullTraceReport extends AbstractBlam {
@Override
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- List<Artifact> artifacts = variableMap.getArtifacts("Subsystem Requirements");
+ List<Artifact> artifacts = variableMap.getArtifacts(SUBSYSTEM_REQUIREMENTS);
if (artifacts.isEmpty()) {
throw new OseeArgumentException("must specify a set of artifacts");
}
BranchId branch = artifacts.get(0).getBranch();
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
+
init();
String scriptDir = variableMap.getString(SCRIPT_ROOT_DIR);
Boolean checked = variableMap.getBoolean(USE_TRACE_IN_OSEE);
@@ -110,8 +120,8 @@ public class SubsystemFullTraceReport extends AbstractBlam {
if (!checked) {
File dir = new File(scriptDir);
if (dir.exists()) {
- ScriptTraceabilityOperation traceOperation =
- new ScriptTraceabilityOperation(dir.getParentFile(), branch, false, traceHandlers, isGitCodeStructure);
+ ScriptTraceabilityOperation traceOperation = new ScriptTraceabilityOperation(dir.getParentFile(), branch,
+ false, traceHandlers, isGitCodeStructure, viewId);
Operations.executeWorkAndCheckStatus(traceOperation, monitor);
requirementsToCodeUnits = traceOperation.getRequirementToCodeUnitsMap();
}
@@ -234,6 +244,7 @@ public class SubsystemFullTraceReport extends AbstractBlam {
availableTraceHandlers.add(handler);
}
sb.append("<XWidget xwidgetType=\"XListDropViewer\" displayName=\"Subsystem Requirements\" />");
+ sb.append(BRANCH_VIEW_WIDGET);
sb.append("</xWidgets>");
return sb.toString();
}
@@ -279,5 +290,32 @@ public class SubsystemFullTraceReport extends AbstractBlam {
}
});
}
+ if (widget.getLabel().equals(SUBSYSTEM_REQUIREMENTS)) {
+ subSystem = (XListDropViewer) widget;
+ subSystem.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ List<Artifact> arts = subSystem.getArtifacts();
+ if (arts != null && !arts.isEmpty()) {
+ BranchId branch = arts.iterator().next().getBranch();
+ if (branch != null && branch.isValid()) {
+ branchViews =
+ ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ }
+ });
+ }
+
+ if (widget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) widget;
+ branchViewWidget.setEditable(false);
+ }
+
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
index b219ce9930..46a3d8498d 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/SubsystemToLowLevelReqTraceReport.java
@@ -38,14 +38,23 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.skynet.core.relation.RelationManager;
import org.eclipse.osee.framework.skynet.core.utility.Requirements;
+import org.eclipse.osee.framework.skynet.core.utility.ViewIdUtility;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XListDropViewer;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
import org.eclipse.swt.program.Program;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Ryan D. Brooks
*/
public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
+ private static final String LOW_LEVEL_REQUIREMENTS = "Low Level Requirements";
private CharBackedInputStream charBak;
private ISheetWriter excelWriter;
private final HashMap<String, List<Artifact>> subsysToSubsysReqsMap;
@@ -53,6 +62,9 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
private final HashSet<Artifact> components;
private Collection<ArtifactType> lowerLevelTypes;
+ private XCombo branchViewWidget;
+ private XListDropViewer lowerLevel;
+
@Override
public String getName() {
return "Subsystem To Low Level Req Trace Report";
@@ -84,6 +96,9 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
BranchId branch = lowLevelReqs.get(0).getBranch();
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
+
monitor.subTask("Loading Higher Level Requirements"); // bulk load to improve performance
monitor.worked(1);
ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SubsystemRequirementMSWord, branch);
@@ -117,8 +132,12 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
if (isLowerLevelRequirement(lowLevelReq)) {
row[2] = lowLevelReq.getAttributesToStringSorted(CoreAttributeTypes.QualificationMethod);
- for (Artifact subSysReq : lowLevelReq.getRelatedArtifacts(
- CoreRelationTypes.Requirement_Trace__Higher_Level)) {
+ List<Artifact> relatedArtifacts =
+ lowLevelReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Higher_Level);
+ if (relatedArtifacts != null) {
+ ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
+ }
+ for (Artifact subSysReq : relatedArtifacts) {
row[3] = getAssociatedSubSystem(subSysReq);
row[4] = correct(subSysReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
row[5] = subSysReq.getName();
@@ -173,9 +192,12 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
if (isAllocated(higherLevelReq)) {
row[0] = correct(higherLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
row[1] = higherLevelReq.getName();
-
- for (Artifact lowerLevelReq : higherLevelReq.getRelatedArtifacts(
- CoreRelationTypes.Requirement_Trace__Lower_Level)) {
+ List<Artifact> relatedArtifacts =
+ higherLevelReq.getRelatedArtifacts(CoreRelationTypes.Requirement_Trace__Lower_Level);
+ if (relatedArtifacts != null) {
+ ViewIdUtility.removeExcludedArtifacts(relatedArtifacts.iterator(), excludedArtifactIdMap);
+ }
+ for (Artifact lowerLevelReq : relatedArtifacts) {
if (lowLevelReqs.contains(lowerLevelReq)) {
row[2] = correct(lowerLevelReq.getSoleAttributeValue(CoreAttributeTypes.ParagraphNumber, ""));
row[3] = lowerLevelReq.getName();
@@ -215,6 +237,7 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
}
}
}
+ ViewIdUtility.removeExcludedArtifacts(lowLevelReqs.iterator(), excludedArtifactIdMap);
}
private void initAllocationComponents(List<Artifact> artifacts) throws OseeCoreException {
@@ -230,6 +253,7 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
}
}
}
+ ViewIdUtility.removeExcludedArtifacts(components.iterator(), excludedArtifactIdMap);
}
private String correct(String value) {
@@ -248,6 +272,10 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
}
private void orderSubsystemReqs(Artifact subsysTopFolder) throws OseeCoreException {
+ List<Artifact> children = subsysTopFolder.getChildren();
+ if (children != null) {
+ ViewIdUtility.removeExcludedArtifacts(children.iterator(), excludedArtifactIdMap);
+ }
for (Artifact subsysFolder : subsysTopFolder.getChildren()) {
String subSysName = subsysFolder.getName();
List<Artifact> subsysReqs = subsysFolder.getDescendants();
@@ -259,7 +287,38 @@ public class SubsystemToLowLevelReqTraceReport extends AbstractBlam {
public String getXWidgetsXml() {
return "<xWidgets><XWidget xwidgetType=\"XListDropViewer\" displayName=\"Lower Level Requirements\" />" + //
"<XWidget xwidgetType=\"XListDropViewer\" displayName=\"Allocation Components\" />" + //
- "<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" displayName=\"Low Level Requirement Type(s)\" multiSelect=\"true\" /></xWidgets>";
+ "<XWidget xwidgetType=\"XArtifactTypeMultiChoiceSelect\" displayName=\"Low Level Requirement Type(s)\" multiSelect=\"true\" />" + //
+ "<XWidget xwidgetType=\"XCombo()\" displayName=\"Branch View\" horizontalLabel=\"true\"/>" + //
+ "</xWidgets>";
+ }
+
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener xModListener, boolean isEditable) {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, xModListener, isEditable);
+ if (xWidget.getLabel().equals(LOW_LEVEL_REQUIREMENTS)) {
+ lowerLevel = (XListDropViewer) xWidget;
+ lowerLevel.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ List<Artifact> arts = lowerLevel.getArtifacts();
+ if (arts != null && !arts.isEmpty()) {
+ BranchId branch = arts.iterator().next().getBranch();
+ if (branch != null && branch.isValid()) {
+ branchViews =
+ ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
+ }
}
@Override
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 4e50fad962..70d2bb74f4 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
@@ -21,6 +21,7 @@ import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.define.internal.Activator;
import org.eclipse.osee.define.traceability.data.RequirementData;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
@@ -32,6 +33,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.utility.ViewIdUtility;
/**
* @author John R. Misinco
@@ -44,22 +46,24 @@ public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
private Map<String, Artifact> testUnits;
private final Collection<? extends IArtifactType> types;
private final boolean withInheritance;
+ private final ArtifactId viewId;
- private BranchTraceabilityOperation(RequirementData requirementData, BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
+ private BranchTraceabilityOperation(RequirementData requirementData, BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance, ArtifactId viewId) {
super("Branch Traceability Provider", Activator.PLUGIN_ID);
this.requirementData = requirementData;
this.branch = branch;
this.types = types;
this.withInheritance = withInheritance;
+ this.viewId = viewId;
}
- public BranchTraceabilityOperation(IOseeBranch branch) {
- this(new RequirementData(branch), branch, Collections.singleton(CoreArtifactTypes.AbstractSoftwareRequirement),
- true);
+ public BranchTraceabilityOperation(IOseeBranch branch, ArtifactId viewId) {
+ this(new RequirementData(branch, viewId), branch,
+ Collections.singleton(CoreArtifactTypes.AbstractSoftwareRequirement), true, viewId);
}
- public BranchTraceabilityOperation(BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
- this(new RequirementData(branch, types, withInheritance), branch, types, withInheritance);
+ public BranchTraceabilityOperation(BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance, ArtifactId viewId) {
+ this(new RequirementData(branch, types, withInheritance, viewId), branch, types, withInheritance, viewId);
}
@Override
@@ -90,7 +94,12 @@ public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
requirementData.initialize(monitor);
requirementToTestUnitsMap = new HashCollection<>();
+ Set<ArtifactId> excludedArtifactIdMap = ViewIdUtility.findExcludedArtifactsByView(viewId, branch);
List<Artifact> unitsOnBranch = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.TestCase, branch);
+ if (unitsOnBranch != null) {
+ ViewIdUtility.removeExcludedArtifacts(unitsOnBranch.iterator(), excludedArtifactIdMap);
+ }
+
testUnits = new HashMap<>();
for (Artifact unit : unitsOnBranch) {
testUnits.put(convertToJavaFileName(unit.getName()), unit);
@@ -105,9 +114,13 @@ public class BranchTraceabilityOperation extends TraceabilityProviderOperation {
reqs.addAll(ArtifactQuery.getArtifactListFromType(type, branch));
}
}
+ ViewIdUtility.removeExcludedArtifacts(reqs.iterator(), excludedArtifactIdMap);
for (Artifact req : reqs) {
List<Artifact> verifiers = req.getRelatedArtifacts(CoreRelationTypes.Verification__Verifier);
+ if (verifiers != null) {
+ ViewIdUtility.removeExcludedArtifacts(verifiers.iterator(), excludedArtifactIdMap);
+ }
Collection<String> verifierNames = new HashSet<>();
String inspection = getInspectionQual(req);
if (Strings.isValid(inspection)) {
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
index 69d15c45fb..131b78b647 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/ImportTraceabilityWizard.java
@@ -17,6 +17,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.osee.define.internal.Activator;
import org.eclipse.osee.define.traceability.TraceUnitExtensionManager.TraceHandler;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -48,7 +49,7 @@ public class ImportTraceabilityWizard extends Wizard implements IImportWizard {
handlers.add(TraceUnitExtensionManager.getInstance().getTraceUnitHandlerById(handlerId));
}
Operations.executeWorkAndCheckStatus(
- new ScriptTraceabilityOperation(file, branch, true, handlers, isGitBased));
+ new ScriptTraceabilityOperation(file, branch, true, handlers, isGitBased, ArtifactId.SENTINEL));
} catch (Exception ex) {
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, "Traceability Import Error", ex);
}
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
index e7ed971c3b..cea2cd7346 100644
--- 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
@@ -18,6 +18,7 @@ import java.io.InputStreamReader;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -28,6 +29,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osee.define.internal.Activator;
import org.eclipse.osee.define.traceability.data.RequirementData;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
@@ -37,6 +39,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
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.framework.skynet.core.utility.ViewIdUtility;
/**
* @author Roberto E. Escobar
@@ -51,11 +54,14 @@ public class RequirementTraceabilityData {
private final Set<String> codeUnits = new TreeSet<>();
private final Map<String, Artifact> testProcedures = new HashMap<>();
private File testProcedureFilter;
+ private final ArtifactId viewId;
+ private Set<ArtifactId> excludedArtifactIdMap = new HashSet<>();
- public RequirementTraceabilityData(BranchId testProcedureBranch, TraceabilityProviderOperation traceabilityProvider) {
+ public RequirementTraceabilityData(BranchId testProcedureBranch, TraceabilityProviderOperation traceabilityProvider, ArtifactId viewId) {
this.testProcedureBranch = testProcedureBranch;
this.traceabilityProvider = traceabilityProvider;
this.testProcedureFilter = null;
+ this.viewId = viewId;
reset();
}
@@ -78,6 +84,8 @@ public class RequirementTraceabilityData {
this.requirementsToCodeUnits = traceabilityProvider.getRequirementToCodeUnitsMap();
this.codeUnits.addAll(traceabilityProvider.getCodeUnits());
+ excludedArtifactIdMap = ViewIdUtility.findExcludedArtifactsByView(viewId, testProcedureBranch);
+
if (monitor.isCanceled() != true) {
if (status.getSeverity() == IStatus.OK) {
getTestProcedureTraceability(testProcedureBranch);
@@ -94,8 +102,12 @@ public class RequirementTraceabilityData {
private void getTestProcedureTraceability(BranchId testProcedureBranch) throws OseeCoreException {
// Map Software Requirements from TestProcedure IOseeBranch to Requirements IOseeBranch
Map<String, Artifact> testProcedureBranchReqsToReqsBranchMap = new HashMap<>();
- for (Artifact tpRequirement : ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement,
- testProcedureBranch)) {
+ List<Artifact> artifacts =
+ ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.SoftwareRequirement, testProcedureBranch);
+ if (artifacts != null) {
+ ViewIdUtility.removeExcludedArtifacts(artifacts.iterator(), excludedArtifactIdMap);
+ }
+ for (Artifact tpRequirement : artifacts) {
testProcedureBranchReqsToReqsBranchMap.put(tpRequirement.getName(), tpRequirement);
}
@@ -104,6 +116,9 @@ public class RequirementTraceabilityData {
Artifact requirement = entry.getValue();
Set<Artifact> foundProcedures =
new HashSet<Artifact>(requirement.getRelatedArtifacts(CoreRelationTypes.Validation__Validator));
+ if (foundProcedures != null) {
+ ViewIdUtility.removeExcludedArtifacts(foundProcedures.iterator(), excludedArtifactIdMap);
+ }
Set<Artifact> toAdd = new HashSet<>();
if (testProceduresFilter.isEmpty() != true) {
for (Artifact artifact : foundProcedures) {
@@ -132,7 +147,7 @@ public class RequirementTraceabilityData {
/**
* 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) {
@@ -163,7 +178,7 @@ public class RequirementTraceabilityData {
/**
* 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
* @throws OseeCoreException
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 b003f4c32a..03d67cd9c0 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
@@ -28,6 +28,7 @@ import org.eclipse.osee.define.internal.Activator;
import org.eclipse.osee.define.traceability.TraceUnitExtensionManager.TraceHandler;
import org.eclipse.osee.define.traceability.data.RequirementData;
import org.eclipse.osee.define.traceability.data.TraceMark;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreAttributeTypes;
@@ -89,12 +90,13 @@ public class ScriptTraceabilityOperation extends TraceabilityProviderOperation {
excelWriter = new ExcelXmlWriter(charBak.getWriter());
}
- public ScriptTraceabilityOperation(File file, BranchId branch, boolean writeOutResults, Collection<TraceHandler> traceHandlers, boolean isGitBased) throws IOException {
- this(new RequirementData(branch), file, writeOutResults, traceHandlers, isGitBased);
+ public ScriptTraceabilityOperation(File file, BranchId branch, boolean writeOutResults, Collection<TraceHandler> traceHandlers, boolean isGitBased, ArtifactId viewId) throws IOException {
+ this(new RequirementData(branch, viewId), file, writeOutResults, traceHandlers, isGitBased);
}
- public ScriptTraceabilityOperation(File file, BranchId branch, boolean writeOutResults, Collection<? extends IArtifactType> types, boolean withInheritance, Collection<TraceHandler> traceHandlers, boolean isGitBased) throws IOException {
- this(new RequirementData(branch, types, withInheritance), file, writeOutResults, traceHandlers, isGitBased);
+ public ScriptTraceabilityOperation(File file, BranchId branch, boolean writeOutResults, Collection<? extends IArtifactType> types, boolean withInheritance, Collection<TraceHandler> traceHandlers, boolean isGitBased, ArtifactId viewId) throws IOException {
+ this(new RequirementData(branch, types, withInheritance, viewId), file, writeOutResults, traceHandlers,
+ isGitBased);
}
@Override
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 0546628087..b9d1fe6009 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
@@ -51,8 +51,10 @@ import org.eclipse.osee.framework.plugin.core.util.AIFile;
import org.eclipse.osee.framework.plugin.core.util.IExceptionableRunnable;
import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.plugin.core.util.OseeData;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorProvider;
import org.eclipse.osee.framework.ui.skynet.results.IResultsEditorTab;
import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
@@ -60,13 +62,22 @@ import org.eclipse.osee.framework.ui.skynet.results.html.ResultsEditorHtmlTab;
import org.eclipse.osee.framework.ui.skynet.results.table.IResultsXViewerRow;
import org.eclipse.osee.framework.ui.skynet.results.table.ResultsEditorTableTab;
import org.eclipse.osee.framework.ui.skynet.results.table.ResultsXViewerRow;
+import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
import org.eclipse.swt.program.Program;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Roberto E. Escobar
*/
public class TraceReportBlam extends AbstractBlam {
+ private static final String BRANCH = "Branch";
private final List<IResultsEditorTab> resultsTabs;
+ private XCombo branchViewWidget;
+ private XBranchSelectWidget branchWidget;
public TraceReportBlam() {
this.resultsTabs = new ArrayList<>();
@@ -101,6 +112,7 @@ public class TraceReportBlam extends AbstractBlam {
builder.append("<xWidgets>");
// builder.append("<XWidget xwidgetType=\"XFileSelectionDialog\" displayName=\"Select UI List File\" />");
builder.append("<XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Requirements Branch\" />");
+ builder.append(BRANCH_VIEW_WIDGET);
builder.append("<XWidget xwidgetType=\"XLabel\" displayName=\"Select Trace Types:\"/>");
for (TraceTypeEnum traceType : TraceTypeEnum.values()) {
builder.append(getOperationsCheckBoxes(traceType.asLabel()));
@@ -114,25 +126,6 @@ public class TraceReportBlam extends AbstractBlam {
return builder.toString();
}
- // private String getUIsFilterFromFile(IProgressMonitor monitor, String filePath) throws Exception {
- // String input;
- // File file = new File(filePath);
- // if (file == null || !file.exists()) {
- // throw new OseeArgumentException("UI list file not accessible");
- // }
- // IFileStore fileStore = EFS.getStore(file.toURI());
- // InputStream inputStream = null;
- // try {
- // inputStream = new BufferedInputStream(fileStore.openInputStream(EFS.NONE, monitor));
- // input = Lib.inputStreamToString(inputStream);
- // } finally {
- // if (inputStream != null) {
- // inputStream.close();
- // }
- // }
- // return input;
- // }
-
private List<TraceTypeEnum> getCheckedTraceItems(VariableMap variableMap) throws OseeArgumentException {
List<TraceTypeEnum> toReturn = new ArrayList<>();
for (TraceTypeEnum traceType : TraceTypeEnum.values()) {
@@ -151,6 +144,9 @@ public class TraceReportBlam extends AbstractBlam {
if (branch == null) {
throw new OseeArgumentException("Branch cannot be null");
}
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
+
List<TraceTypeEnum> traceTypes = getCheckedTraceItems(variableMap);
if (traceTypes.isEmpty()) {
throw new OseeArgumentException("Please select a trace type");
@@ -165,7 +161,7 @@ public class TraceReportBlam extends AbstractBlam {
CharBackedInputStream excelInputStream = null;
Map<String, AbstractArtifactRelationReport> reports = new LinkedHashMap<>();
List<BaseTraceDataCache> traceCache = new ArrayList<>();
- RequirementData reqData = new RequirementData(branch);
+ RequirementData reqData = new RequirementData(branch, viewId);
CodeUnitData codeUnit = null;
TestUnitData testUnit = null;
try {
@@ -229,6 +225,31 @@ public class TraceReportBlam extends AbstractBlam {
}
}
+ @Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener xModListener, boolean isEditable) {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, xModListener, isEditable);
+ if (xWidget.getLabel().equals(BRANCH)) {
+ branchWidget = (XBranchSelectWidget) xWidget;
+ branchWidget.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ BranchId branch = branchWidget.getSelection();
+ if (branch != null && branch.isValid()) {
+ branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
+ }
+ }
+
private void executeReports(IProgressMonitor monitor, Map<String, AbstractArtifactRelationReport> reports) throws OseeCoreException {
try {
monitor.beginTask("Create Reports", reports.size());
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 bb835e2d75..788aca484a 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
@@ -16,15 +16,19 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.define.traceability.TraceabilityExtractor;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.jdk.core.type.Pair;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+import org.eclipse.osee.framework.skynet.core.utility.ViewIdUtility;
/**
* @author Roberto E. Escobar
@@ -37,17 +41,20 @@ public class RequirementData extends BaseTraceDataCache {
private final TraceabilityExtractor extractor = TraceabilityExtractor.getInstance();
private final Collection<? extends IArtifactType> types;
private final boolean withInheritance;
+ private final ArtifactId viewId;
- public RequirementData(BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance) {
+ public RequirementData(BranchId branch, Collection<? extends IArtifactType> types, boolean withInheritance, ArtifactId viewId) {
super("Software Requirements Data", branch);
this.types = types;
this.withInheritance = withInheritance;
+ this.viewId = viewId;
}
- public RequirementData(BranchId branch) {
+ public RequirementData(BranchId branch, ArtifactId viewId) {
super("Software Requirements Data", branch);
types = Collections.singleton(CoreArtifactTypes.AbstractSoftwareRequirement);
withInheritance = true;
+ this.viewId = viewId;
}
@Override
@@ -59,6 +66,9 @@ public class RequirementData extends BaseTraceDataCache {
@Override
protected void doBulkLoad(IProgressMonitor monitor) throws Exception {
+ Set<ArtifactId> excludedArtifactIdMap = new HashSet<>();
+ excludedArtifactIdMap = ViewIdUtility.findExcludedArtifactsByView(viewId, getBranch());
+
List<Artifact> allSwRequirements = new ArrayList<>();
for (IArtifactType type : types) {
if (withInheritance) {
@@ -68,6 +78,7 @@ public class RequirementData extends BaseTraceDataCache {
allSwRequirements.addAll(ArtifactQuery.getArtifactListFromType(type, getBranch(), EXCLUDE_DELETED));
}
}
+ ViewIdUtility.removeExcludedArtifacts(allSwRequirements.iterator(), excludedArtifactIdMap);
populateTraceMap(monitor, allSwRequirements, allRequirementsMap);
for (Artifact requirement : getAllRequirements()) {
@@ -93,7 +104,7 @@ public class RequirementData extends BaseTraceDataCache {
/**
* Get Requirement Artifact based on traceMark mark
- *
+ *
* @return requirement artifact
*/
public Artifact getRequirementFromTraceMark(String traceMark) {
@@ -103,7 +114,7 @@ public class RequirementData extends BaseTraceDataCache {
/**
* 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 getRequirementFromTraceMarkIncludeStructuredRequirements(String traceMark) {
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java
index f6c1825ed5..b6a371538e 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/traceability/operations/TraceUnitToArtifactProcessor.java
@@ -34,6 +34,7 @@ import org.eclipse.osee.define.traceability.data.RequirementData;
import org.eclipse.osee.define.traceability.data.TestUnitData;
import org.eclipse.osee.define.traceability.data.TraceMark;
import org.eclipse.osee.define.traceability.data.TraceUnit;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.RelationTypeSide;
@@ -107,7 +108,7 @@ public class TraceUnitToArtifactProcessor implements ITraceUnitProcessor {
public void initialize(IProgressMonitor monitor) {
transaction = null;
handler = null;
- requirementData = new RequirementData(importIntoBranch);
+ requirementData = new RequirementData(importIntoBranch, ArtifactId.SENTINEL);
if (!monitor.isCanceled()) {
requirementData.initialize(monitor);
}
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
index 56efb9d3c3..3e34faf2bb 100644
--- 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
@@ -37,15 +37,24 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
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.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.blam.AbstractBlam;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
+import org.eclipse.osee.framework.ui.skynet.branch.ViewApplicabilityUtil;
+import org.eclipse.osee.framework.ui.skynet.widgets.XBranchSelectWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XCombo;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.skynet.widgets.XWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.util.SwtXWidgetRenderer;
import org.eclipse.swt.program.Program;
+import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* @author Roberto E. Escobar
*/
public class PublishStdStpTraceability extends AbstractBlam {
+ private static final String PROGRAM_BRANCH = "Program Branch";
private static final String scriptDirectory =
"<XWidget xwidgetType=\"XText\" displayName=\"Script Root Directory\" defaultValue=\"C:/UserData/workspaceScripts\"/>";
private static final String requirementsBranch =
@@ -58,7 +67,10 @@ public class PublishStdStpTraceability extends AbstractBlam {
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"Search Git Code Structure\" labelAfter=\"true\" horizontalLabel=\"true\" defaultValue=\"false\" />";
private static final String TRACE_HANDLER_CHECKBOX =
"<XWidget xwidgetType=\"XCheckBox\" displayName=\"%s\" labelAfter=\"true\" horizontalLabel=\"true\"/>";
+
private Collection<String> availableTraceHandlers;
+ private XCombo branchViewWidget;
+ private XBranchSelectWidget branchWidget;
@Override
public String getName() {
@@ -87,6 +99,7 @@ public class PublishStdStpTraceability extends AbstractBlam {
}
builder.append(requirementsBranch);
+ builder.append(BRANCH_VIEW_WIDGET);
builder.append(artifactTypeChooser);
builder.append(searchInheritedTypes);
@@ -119,7 +132,9 @@ public class PublishStdStpTraceability extends AbstractBlam {
@Override
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
- BranchId requirementsBranch = variableMap.getBranch("Program Branch");
+ BranchId requirementsBranch = variableMap.getBranch(PROGRAM_BRANCH);
+ Object view = variableMap.getValue(BRANCH_VIEW);
+ setViewId(view);
Collection<? extends IArtifactType> types =
variableMap.getCollection(ArtifactType.class, "Artifact Type(s) to Trace");
boolean searchInherited = variableMap.getBoolean("Search Inherited Types");
@@ -142,13 +157,14 @@ public class PublishStdStpTraceability extends AbstractBlam {
// Load Requirements Data
TraceabilityProviderOperation provider;
if (traceHandlers.isEmpty()) {
- provider = new BranchTraceabilityOperation(requirementsBranch, types, searchInherited);
+ provider = new BranchTraceabilityOperation(requirementsBranch, types, searchInherited, viewId);
} else {
boolean isGitBased = variableMap.getBoolean("Search Git Code Structure");
provider = new ScriptTraceabilityOperation(scriptDir, requirementsBranch, false, types, searchInherited,
- traceHandlers, isGitBased);
+ traceHandlers, isGitBased, viewId);
}
- RequirementTraceabilityData traceabilityData = new RequirementTraceabilityData(requirementsBranch, provider);
+ RequirementTraceabilityData traceabilityData =
+ new RequirementTraceabilityData(requirementsBranch, provider, viewId);
IStatus status = traceabilityData.initialize(monitor);
if (status.getSeverity() == IStatus.CANCEL) {
monitor.setCanceled(true);
@@ -187,6 +203,31 @@ public class PublishStdStpTraceability extends AbstractBlam {
}
@Override
+ public void widgetCreated(XWidget xWidget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener xModListener, boolean isEditable) {
+ super.widgetCreated(xWidget, toolkit, art, dynamicXWidgetLayout, xModListener, isEditable);
+ if (xWidget.getLabel().equals(PROGRAM_BRANCH)) {
+ branchWidget = (XBranchSelectWidget) xWidget;
+ branchWidget.addXModifiedListener(new XModifiedListener() {
+
+ @Override
+ public void widgetModified(XWidget widget) {
+ if (branchViewWidget != null) {
+ branchViewWidget.setEditable(true);
+ BranchId branch = branchWidget.getSelection();
+ if (branch != null && branch.isInvalid()) {
+ branchViews = ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(branch));
+ branchViewWidget.setDataStrings(branchViews.values());
+ }
+ }
+ }
+ });
+ } else if (xWidget.getLabel().equals(BRANCH_VIEW)) {
+ branchViewWidget = (XCombo) xWidget;
+ branchViewWidget.setEditable(false);
+ }
+ }
+
+ @Override
public Collection<String> getCategories() {
return Arrays.asList("Define.Publish");
}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ViewIdUtility.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ViewIdUtility.java
new file mode 100644
index 0000000000..ea5e3d472c
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/utility/ViewIdUtility.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2017 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.framework.skynet.core.utility;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.core.sql.OseeSql;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.ArtifactLoader;
+
+/**
+ * @author Megumi Telles
+ */
+public class ViewIdUtility {
+
+ public static Set<ArtifactId> findExcludedArtifactsByView(ArtifactId viewId, BranchId branch) {
+ Set<ArtifactId> excludedArtifactIdMap = new HashSet<>();
+ if (!viewId.equals(ArtifactId.SENTINEL)) {
+ Object[] objs = {branch, viewId, branch};
+ List<ArtifactId> excludedArtifacts =
+ ArtifactLoader.selectArtifactIds(OseeSql.LOAD_EXCLUDED_ARTIFACT_IDS.getSql(), objs, 300);
+ for (ArtifactId artId : excludedArtifacts) {
+ excludedArtifactIdMap.add(artId);
+ }
+ }
+ return excludedArtifactIdMap;
+ }
+
+ public static void removeExcludedArtifacts(Iterator<Artifact> iterator, Set<ArtifactId> excludedArtifactIdMap) {
+ while (iterator.hasNext()) {
+ Artifact artifact = iterator.next();
+ if (excludedArtifactIdMap.contains(ArtifactId.valueOf(artifact.getId()))) {
+ iterator.remove();
+ }
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
index 57da3c1f7b..3f32b9b0b5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/blam/AbstractBlam.java
@@ -14,7 +14,12 @@ package org.eclipse.osee.framework.ui.skynet.blam;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.ParserConfigurationException;
@@ -24,6 +29,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.OperationLogger;
import org.eclipse.osee.framework.core.operation.Operations;
@@ -31,6 +37,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.jdk.core.util.Lib;
import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.XWidgetParser;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
@@ -55,13 +62,20 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
private final static String titleEnd = " BLAM";
private final Pattern capitalLetter = Pattern.compile("[A-Z]+[a-z]*");
+ protected Set<ArtifactId> excludedArtifactIdMap = new HashSet<>();
+ protected Map<Long, String> branchViews;
+ protected ArtifactId viewId = ArtifactId.SENTINEL;
+
public enum BlamUiSource {
DEFAULT,
FILE
}
+ public static final String BRANCH_VIEW = "Branch View";
public static final String branchXWidgetXml =
"<xWidgets><XWidget xwidgetType=\"XBranchSelectWidget\" displayName=\"Branch\" /></xWidgets>";
+ public static final String BRANCH_VIEW_WIDGET =
+ "<XWidget xwidgetType=\"XCombo()\" displayName=\"Branch View\" horizontalLabel=\"true\"/>";
public static final String emptyXWidgetsXml = "<xWidgets/>";
private OperationLogger logger;
@@ -111,7 +125,12 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
return getXWidgetsXmlFromUiFile(getClass().getSimpleName(), Activator.PLUGIN_ID);
case DEFAULT:
default:
- return AbstractBlam.branchXWidgetXml;
+ StringBuilder sb = new StringBuilder();
+ sb.append("<xWidgets>");
+ sb.append(branchXWidgetXml);
+ sb.append(BRANCH_VIEW_WIDGET);
+ sb.append("</xWidgets>");
+ return sb.toString();
}
}
@@ -215,4 +234,23 @@ public abstract class AbstractBlam implements IDynamicWidgetLayoutListener {
return "BLAM Workflow";
}
+ public void excludeArtifacts(Iterator<Artifact> iter) {
+ while (iter.hasNext()) {
+ Artifact artifact = iter.next();
+ if (excludedArtifactIdMap.contains(ArtifactId.valueOf(artifact.getId()))) {
+ iter.remove();
+ }
+ }
+ }
+
+ public void setViewId(Object view) {
+ if (branchViews != null) {
+ for (Entry<Long, String> entry : branchViews.entrySet()) {
+ if (entry.getValue().equals(view)) {
+ viewId = ArtifactId.valueOf(entry.getKey());
+ }
+ }
+ }
+ }
+
} \ No newline at end of file

Back to the top