Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-09-07 11:14:49 -0400
committerDonald Dunne2016-09-08 18:53:11 -0400
commitd327cc40693784dbf9d5049f35ca6013a00a61a1 (patch)
tree1b6c1a4910ff0baf4dd447f234f7e7216b4e015b
parent1ba100d20b2ddc92b5c46659286579f9d741563a (diff)
downloadorg.eclipse.osee-d327cc40693784dbf9d5049f35ca6013a00a61a1.tar.gz
org.eclipse.osee-d327cc40693784dbf9d5049f35ca6013a00a61a1.tar.xz
org.eclipse.osee-d327cc40693784dbf9d5049f35ca6013a00a61a1.zip
bug[ats_ATS305531]: ATS Work Item report failing on Peer Reviews
-rw-r--r--plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/query/AtsQueryImpl.java1
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java45
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/ev/ActivityIdColumnUI.java5
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/EvNavigateItems.java2
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkItemAndPackageReport.java172
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageCollectionProvider.java52
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageQBDReport.java82
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageSearchProvider.java58
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleSearchProvider.java52
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java29
10 files changed, 302 insertions, 196 deletions
diff --git a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/query/AtsQueryImpl.java b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/query/AtsQueryImpl.java
index 4faf32d52b..053ef21c03 100644
--- a/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/query/AtsQueryImpl.java
+++ b/plugins/org.eclipse.osee.ats.core.client/src/org/eclipse/osee/ats/core/client/internal/query/AtsQueryImpl.java
@@ -27,6 +27,7 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IRelationTypeSide;
import org.eclipse.osee.framework.core.enums.QueryOption;
+import org.eclipse.osee.framework.jdk.core.util.ElapsedTime;
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.artifact.search.QueryBuilderArtifact;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
index 69d509f8d3..c93763a54e 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
@@ -11,9 +11,7 @@
package org.eclipse.osee.ats.column;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
import java.util.logging.Level;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -40,19 +38,20 @@ import org.eclipse.swt.widgets.Control;
/**
* Allows the selection of active work packages with the option to toggle on inActive.
- *
+ *
* @param workPackages contains the valid list of active and inactive Work Packages
* @author Donald G. Dunne
*/
public class WorkPackageFilterTreeDialog extends FilteredTreeDialog {
private IAtsWorkPackage selection;
XCheckBox showAll = new XCheckBox("Show All Work Packages");
- private final Collection<IAtsWorkPackage> allValidWorkPackages;
private boolean removeFromWorkPackage;
+ private boolean showRemoveCheckbox = true;
+ private final IWorkPackageProvider workPackageProvider;
- public WorkPackageFilterTreeDialog(String title, String message, Collection<IAtsWorkPackage> allValidWorkPackages) {
+ public WorkPackageFilterTreeDialog(String title, String message, IWorkPackageProvider workPackageProvider) {
super(title, message, new ArrayTreeContentProvider(), new StringLabelProvider());
- this.allValidWorkPackages = allValidWorkPackages;
+ this.workPackageProvider = workPackageProvider;
}
@Override
@@ -92,7 +91,9 @@ public class WorkPackageFilterTreeDialog extends FilteredTreeDialog {
};
});
- createRemoveCheckbox(comp1);
+ if (showRemoveCheckbox) {
+ createRemoveCheckbox(comp1);
+ }
return comp1;
}
@@ -136,27 +137,27 @@ public class WorkPackageFilterTreeDialog extends FilteredTreeDialog {
public void setInput() {
try {
- super.setInput(filterInput(allValidWorkPackages));
+ if (showAll != null && showAll.isChecked()) {
+ super.setInput(workPackageProvider.getAllWorkPackages());
+ } else {
+ super.setInput(workPackageProvider.getActiveWorkPackages());
+ }
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, ex);
}
}
- private Collection<? extends IAtsWorkPackage> filterInput(Collection<? extends IAtsWorkPackage> input2) throws OseeCoreException {
- List<IAtsWorkPackage> filtered = new ArrayList<>();
- boolean all = false;
- if (showAll != null && showAll.isChecked()) {
- all = true;
- }
- for (IAtsWorkPackage workPkg : input2) {
- if (all || workPkg.isActive()) {
- filtered.add(workPkg);
- }
- }
- return filtered;
- }
-
public boolean isRemoveFromWorkPackage() {
return removeFromWorkPackage;
}
+
+ public void setShowRemoveCheckbox(boolean showRemoveCheckbox) {
+ this.showRemoveCheckbox = showRemoveCheckbox;
+ }
+
+ public static interface IWorkPackageProvider {
+ public Collection<IAtsWorkPackage> getActiveWorkPackages();
+
+ public Collection<IAtsWorkPackage> getAllWorkPackages();
+ }
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/ev/ActivityIdColumnUI.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/ev/ActivityIdColumnUI.java
index acc6cee005..9422530931 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/ev/ActivityIdColumnUI.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/ev/ActivityIdColumnUI.java
@@ -30,6 +30,7 @@ import org.eclipse.osee.ats.column.WorkPackageFilterTreeDialog;
import org.eclipse.osee.ats.core.client.action.ActionManager;
import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact;
import org.eclipse.osee.ats.core.column.AtsColumnId;
+import org.eclipse.osee.ats.ev.WorkPackageCollectionProvider;
import org.eclipse.osee.ats.internal.Activator;
import org.eclipse.osee.ats.internal.AtsClientService;
import org.eclipse.osee.ats.util.xviewer.column.XViewerAtsColumn;
@@ -121,7 +122,8 @@ public class ActivityIdColumnUI extends XViewerAtsColumn implements IMultiColumn
AWorkbench.popup("Options Invalid", result.getText());
} else {
WorkPackageFilterTreeDialog dialog = new WorkPackageFilterTreeDialog("Select Work Package",
- getMessage(awas, commonWorkPackageOptions, uniqueWorkPackageOptions), commonWorkPackageOptions);
+ getMessage(awas, commonWorkPackageOptions, uniqueWorkPackageOptions),
+ new WorkPackageCollectionProvider(commonWorkPackageOptions));
dialog.setInput();
if (dialog.open() == Window.OK) {
boolean removeFromWorkPackage = dialog.isRemoveFromWorkPackage();
@@ -194,4 +196,5 @@ public class ActivityIdColumnUI extends XViewerAtsColumn implements IMultiColumn
OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
}
}
+
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/EvNavigateItems.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/EvNavigateItems.java
index 5ea1b996ce..a34d4e0af1 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/EvNavigateItems.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/EvNavigateItems.java
@@ -26,7 +26,7 @@ public class EvNavigateItems {
try {
XNavigateItem evItems = new XNavigateItem(parent, "Earned Value", AtsImage.E_BOXED);
new WorkPackageConfigReport(evItems);
- new WorkItemAndPackageReport(evItems);
+ new WorkPackageQBDReport(evItems);
items.add(evItems);
} catch (Exception ex) {
OseeLog.log(Activator.class, Level.SEVERE, "Can't create Goals section");
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkItemAndPackageReport.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkItemAndPackageReport.java
deleted file mode 100644
index 449f43476c..0000000000
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkItemAndPackageReport.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2015 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.ats.ev;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
-import org.eclipse.osee.ats.api.IAtsWorkItem;
-import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
-import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
-import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
-import org.eclipse.osee.ats.column.PercentCompleteTotalColumn;
-import org.eclipse.osee.ats.core.column.AtsAttributeValueColumnHandler;
-import org.eclipse.osee.ats.core.util.AtsUtilCore;
-import org.eclipse.osee.ats.internal.Activator;
-import org.eclipse.osee.ats.internal.AtsClientService;
-import org.eclipse.osee.framework.core.util.XResultData;
-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.artifact.search.QueryBuilderArtifact;
-import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
-import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
-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;
-import org.eclipse.osee.framework.ui.skynet.results.XResultDataUI;
-import org.eclipse.osee.framework.ui.skynet.results.html.ResultsEditorHtmlTab;
-import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage;
-import org.eclipse.osee.framework.ui.skynet.results.html.XResultPage.Manipulations;
-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;
-
-/**
- * @author Donald G. Dunne
- */
-public class WorkItemAndPackageReport extends XNavigateItemAction {
-
- public static final String TITLE = "Work Item and Package Report";
-
- public WorkItemAndPackageReport(XNavigateItem parent) {
- super(parent, TITLE, PluginUiImage.ADMIN);
- }
-
- @Override
- public void run(TableLoadOption... tableLoadOptions) {
- ResultsEditor.open(new IResultsEditorProvider() {
-
- private List<IResultsEditorTab> tabs;
-
- @Override
- public String getEditorName() {
- return TITLE;
- }
-
- @Override
- public List<IResultsEditorTab> getResultsEditorTabs() {
- if (tabs == null) {
- tabs = new LinkedList<>();
- createWorkItemTab(tabs);
- }
- return tabs;
- }
-
- });
- }
-
- private void createWorkItemTab(List<IResultsEditorTab> tabs) {
- List<XViewerColumn> columns = getColumns();
- XResultData results = new XResultData(false);
-
- List<IResultsXViewerRow> rows = new ArrayList<>();
- WorkPackageConfigLoader loader = new WorkPackageConfigLoader();
- loader.load();
-
- QueryBuilderArtifact queryBuilder = ArtifactQuery.createQueryBuilder(AtsUtilCore.getAtsBranch());
- queryBuilder.andIsOfType(AtsArtifactTypes.AbstractWorkflowArtifact).andExists(AtsAttributeTypes.WorkPackageGuid);
- for (Artifact workItemArt : queryBuilder.getResults()) {
-
- try {
- IAtsWorkItem item = AtsClientService.get().getWorkItemFactory().getWorkItem(workItemArt);
- String workPackageGuid = workItemArt.getSoleAttributeValue(AtsAttributeTypes.WorkPackageGuid);
- WorkPackageData data = loader.getWorkPackageData(workPackageGuid);
- if (data == null) {
- results.errorf("Work Package with guid [%s] from workflow %s does not exist. Ignoring...\n",
- workPackageGuid, item.toStringWithId());
- } else {
- rows.add(new ResultsXViewerRow(new String[] {
- workItemArt.getArtifactTypeName(),
- workItemArt.getName(),
- workItemArt.getSoleAttributeValue(AtsAttributeTypes.AtsId, ""),
- getTeamDefName(item),
- item.getStateMgr().getCurrentStateName(),
- AtsAttributeValueColumnHandler.getColumnText(item, AtsAttributeTypes.PercentComplete, false, false,
- AtsClientService.get().getServices()),
- PercentCompleteTotalColumn.getInstance().getColumnText(workItemArt, null, 0),
- item.getStateMgr().getAssigneesStr(),
- workItemArt.getSoleAttributeValue(AtsAttributeTypes.Points, ""),
- workItemArt.getSoleAttributeValue(AtsAttributeTypes.PointsNumeric, ""),
- data.getCountryName(),
- data.getProgramName(),
- data.getInsertionName(),
- data.getInsertionActivityName(),
- data.getWorkPackageName(),
- data.getColorTeam(),
- data.getWorkPackageProgram(),
- data.getWorkPackageId(),
- data.getActivityId()}));
- }
- } catch (Exception ex) {
- String errorStr = String.format("Exception processing workflow %s - %s. See log for details.\n",
- workItemArt.toStringWithId(), ex.getMessage());
- OseeLog.log(Activator.class, Level.SEVERE, errorStr, ex);
- results.errorf(errorStr);
- }
- }
- if (!results.isErrors()) {
- results.log("No Errors Found\n");
- }
- results.log("\nSee Next Tab for Results");
- XResultPage resultPage = XResultDataUI.getReport(results, getName(), Manipulations.HTML_MANIPULATIONS);
- tabs.add(new ResultsEditorHtmlTab(resultPage));
- tabs.add(new ResultsEditorTableTab(TITLE + " Report", columns, rows));
- }
-
- private String getTeamDefName(IAtsWorkItem item) {
- if (item.getParentTeamWorkflow() != null) {
- return item.getParentTeamWorkflow().getTeamDefinition().getName();
- }
- Collection<IAtsTeamDefinition> teamDefs =
- AtsClientService.get().getWorkItemService().getActionableItemService().getCorrespondingTeamDefinitions(item);
- if (!teamDefs.isEmpty()) {
- return org.eclipse.osee.framework.jdk.core.util.Collections.toString(", ", teamDefs);
- }
- return "unknown";
- }
-
- private List<XViewerColumn> getColumns() {
- List<XViewerColumn> columns = Arrays.asList( //
- WorkPackageReportColumns.getDefaultColumn("Type", 40), WorkPackageReportColumns.getDefaultColumn("Title", 160),
- WorkPackageReportColumns.getDefaultColumn("ATS ID", 40), WorkPackageReportColumns.getDefaultColumn("Team", 40),
- WorkPackageReportColumns.getDefaultColumn("State", 40),
- WorkPackageReportColumns.getDefaultColumn("Workflow Percent Complete", 40),
- WorkPackageReportColumns.getDefaultColumn("Total Percent Complete", 40),
- WorkPackageReportColumns.getDefaultColumn("Assignees", 40),
- WorkPackageReportColumns.getDefaultColumn("Points", 40),
- WorkPackageReportColumns.getDefaultColumn("Points Numeric", 40), WorkPackageReportColumns.countryColumn,
- WorkPackageReportColumns.programColumn, WorkPackageReportColumns.insertionColumn,
- WorkPackageReportColumns.insertionActivityColumn, WorkPackageReportColumns.workPackageNameColumn,
- WorkPackageReportColumns.wpColorTeamColumn, WorkPackageReportColumns.wpProgramColumn,
- WorkPackageReportColumns.wpIdColumn, WorkPackageReportColumns.wpActivityIdColumn
- //
- );
- return columns;
- }
-
-}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageCollectionProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageCollectionProvider.java
new file mode 100644
index 0000000000..da3dd539a0
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageCollectionProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.ats.ev;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import org.eclipse.osee.ats.api.ev.IAtsWorkPackage;
+import org.eclipse.osee.ats.column.WorkPackageFilterTreeDialog.IWorkPackageProvider;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+
+/**
+ * Provides work packages from give collection
+ *
+ * @author Donald G. Dunne
+ */
+public class WorkPackageCollectionProvider implements IWorkPackageProvider {
+
+ private final Collection<IAtsWorkPackage> workPackages;
+
+ public WorkPackageCollectionProvider(Collection<IAtsWorkPackage> workPackages) {
+ this.workPackages = workPackages;
+ }
+
+ @Override
+ public Collection<IAtsWorkPackage> getActiveWorkPackages() {
+ return filterInput(false);
+ }
+
+ @Override
+ public Collection<IAtsWorkPackage> getAllWorkPackages() {
+ return filterInput(true);
+ }
+
+ private Collection<IAtsWorkPackage> filterInput(boolean showAll) throws OseeCoreException {
+ java.util.List<IAtsWorkPackage> filtered = new ArrayList<>();
+ for (IAtsWorkPackage workPkg : workPackages) {
+ if (showAll || workPkg.isActive()) {
+ filtered.add(workPkg);
+ }
+ }
+ return filtered;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageQBDReport.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageQBDReport.java
new file mode 100644
index 0000000000..e8df567fec
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageQBDReport.java
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * Copyright (c) 2015 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.ats.ev;
+
+import java.util.Collection;
+import java.util.List;
+import org.eclipse.jface.window.Window;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.api.ev.IAtsWorkPackage;
+import org.eclipse.osee.ats.column.WorkPackageFilterTreeDialog;
+import org.eclipse.osee.ats.core.util.AtsUtilCore;
+import org.eclipse.osee.ats.world.IWorldEditorProvider;
+import org.eclipse.osee.ats.world.WorldEditor;
+import org.eclipse.osee.ats.world.WorldEditorSimpleSearchProvider;
+import org.eclipse.osee.ats.world.WorldEditorSimpleSearchProvider.IWorldEditorSimpleSearchProvider;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.core.data.IArtifactToken;
+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.plugin.PluginUiImage;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkPackageQBDReport extends XNavigateItemAction implements IWorldEditorSimpleSearchProvider {
+
+ public static final String TITLE = "Work Package QBD Report";
+ private IAtsWorkPackage selectedWorkPackage;
+
+ public WorkPackageQBDReport(XNavigateItem parent) {
+ super(parent, TITLE, PluginUiImage.ADMIN);
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) {
+
+ WorkPackageFilterTreeDialog dialog =
+ new WorkPackageFilterTreeDialog(getName(), "Select Work Package", new WorkPackageSearchProvider());
+ dialog.setShowRemoveCheckbox(false);
+ dialog.setInput();
+ if (dialog.open() == Window.OK) {
+ selectedWorkPackage = dialog.getSelection();
+ WorldEditor.open(new WorldEditorSimpleSearchProvider(this));
+ }
+ }
+
+ @Override
+ public String getSearchName() {
+ return TITLE + " for [" + selectedWorkPackage.getName() + "]";
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) {
+ List<IArtifactToken> workItemTokens =
+ ArtifactQuery.getArtifactTokenListFromSoleAttributeInherited(AtsArtifactTypes.AbstractWorkflowArtifact,
+ AtsAttributeTypes.WorkPackageGuid, selectedWorkPackage.getGuid(), AtsUtilCore.getAtsBranch());
+ List<Artifact> workItems = ArtifactQuery.getArtifactListFromTokens(workItemTokens, AtsUtilCore.getAtsBranch());
+ return workItems;
+ }
+
+ @Override
+ public IWorldEditorProvider copyProvider() {
+ return new WorldEditorSimpleSearchProvider(this);
+ }
+
+ public void setSelectedWorkPackage(IAtsWorkPackage selectedWorkPackage) {
+ this.selectedWorkPackage = selectedWorkPackage;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageSearchProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageSearchProvider.java
new file mode 100644
index 0000000000..f83f4ed061
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/ev/WorkPackageSearchProvider.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.ats.ev;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.ev.IAtsWorkPackage;
+import org.eclipse.osee.ats.column.WorkPackageFilterTreeDialog.IWorkPackageProvider;
+import org.eclipse.osee.ats.core.util.AtsUtilCore;
+import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.IArtifactToken;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
+
+/**
+ * Provides work packages from quick search
+ *
+ * @author Donald G. Dunne
+ */
+public class WorkPackageSearchProvider implements IWorkPackageProvider {
+
+ public WorkPackageSearchProvider() {
+ }
+
+ @Override
+ public Collection<IAtsWorkPackage> getActiveWorkPackages() {
+ Collection<IArtifactToken> selectableWorkPackageTokens =
+ ArtifactQuery.getArtifactTokenListFromTypeAndActive(AtsArtifactTypes.WorkPackage, AtsUtilCore.getAtsBranch());
+ Collection<IAtsWorkPackage> items = new LinkedList<>();
+ for (Artifact art : ArtifactQuery.getArtifactListFromTokens(selectableWorkPackageTokens,
+ AtsUtilCore.getAtsBranch())) {
+ items.add(AtsClientService.get().getConfigItemFactory().getWorkPackage(art));
+ }
+ return items;
+ }
+
+ @Override
+ public Collection<IAtsWorkPackage> getAllWorkPackages() {
+ Collection<IArtifactToken> selectableWorkPackageTokens =
+ ArtifactQuery.getArtifactTokenListFromType(AtsArtifactTypes.WorkPackage, AtsUtilCore.getAtsBranch());
+ Collection<IAtsWorkPackage> items = new LinkedList<>();
+ for (Artifact art : ArtifactQuery.getArtifactListFromTokens(selectableWorkPackageTokens,
+ AtsUtilCore.getAtsBranch())) {
+ items.add(AtsClientService.get().getConfigItemFactory().getWorkPackage(art));
+ }
+ return items;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleSearchProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleSearchProvider.java
new file mode 100644
index 0000000000..a1440c11e4
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldEditorSimpleSearchProvider.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 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.ats.world;
+
+import java.util.Collection;
+import org.eclipse.osee.ats.world.search.WorldSearchItem.SearchType;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorldEditorSimpleSearchProvider extends WorldEditorProvider {
+
+ private final IWorldEditorSimpleSearchProvider worldEditorSimpleSearchProvider;
+
+ public WorldEditorSimpleSearchProvider(IWorldEditorSimpleSearchProvider worldEditorSimpleSearchProvider) {
+ super(null, new TableLoadOption[] {TableLoadOption.None});
+ this.worldEditorSimpleSearchProvider = worldEditorSimpleSearchProvider;
+ }
+
+ @Override
+ public IWorldEditorProvider copyProvider() {
+ return worldEditorSimpleSearchProvider.copyProvider();
+ }
+
+ @Override
+ public String getName() {
+ return worldEditorSimpleSearchProvider.getSearchName();
+ }
+
+ @Override
+ public Collection<Artifact> performSearch(SearchType searchType) {
+ return worldEditorSimpleSearchProvider.performSearch(searchType);
+ }
+
+ public static interface IWorldEditorSimpleSearchProvider {
+ public Collection<Artifact> performSearch(SearchType searchType);
+
+ public String getSearchName();
+
+ public IWorldEditorProvider copyProvider();
+ }
+}
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
index 42eb27f2f2..713b884df2 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/search/ArtifactQuery.java
@@ -843,4 +843,33 @@ public class ArtifactQuery {
"and txs.GAMMA_ID = attr.GAMMA_ID and attr.art_id = art.art_id " + //
"and txs.TX_CURRENT = 1 and attr.ATTR_TYPE_ID = 1152921504606847153 and value = 'false')";
+ private static String attributeTokenQuery = "select art.art_id, art.art_type_id, art.guid, attr.value " + //
+ "from osee_txs txsArt, osee_txs txsAttr, osee_artifact art, osee_attribute attr where art.art_type_id in ( ART_IDS_HERE ) " + //
+ "and txsArt.BRANCH_ID = ? and art.GAMMA_ID = txsArt.GAMMA_ID and txsArt.TX_CURRENT = 1 " + //
+ "and txsAttr.BRANCH_ID = ? and attr.GAMMA_ID = txsAttr.GAMMA_ID and txsAttr.TX_CURRENT = 1 " + //
+ "and art.ART_ID = attr.art_id and attr.ATTR_TYPE_ID = ? and value = ? ";
+
+ public static List<IArtifactToken> getArtifactTokenListFromSoleAttributeInherited(IArtifactType artifactType, IAttributeType attributetype, String value, BranchId branch) {
+
+ ArtifactType artifactTypeFull = ArtifactTypeManager.getType(artifactType);
+ List<Long> artTypeIds = new LinkedList<>();
+ String ids = "";
+ for (ArtifactType artType : artifactTypeFull.getAllDescendantTypes()) {
+ artTypeIds.add(artType.getId());
+ ids += artType.getId().toString() + ",";
+ }
+ artTypeIds.add(artifactTypeFull.getId());
+ ids = ids.replaceFirst(",$", "");
+
+ JdbcStatement chStmt = ConnectionHandler.getStatement();
+ try {
+ String query = attributeTokenQuery.replaceFirst("ART_IDS_HERE", ids);
+ chStmt.runPreparedQuery(query, branch.getId(), branch.getId(), attributetype.getId(), value);
+ List<IArtifactToken> tokens = extractTokensFromQuery(chStmt);
+ return tokens;
+ } finally {
+ chStmt.close();
+ }
+ }
+
}

Back to the top