Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2020-02-13 19:26:13 +0000
committerdonald.g.dunne2020-02-17 19:45:51 +0000
commit4411049f032e352d320084e5ca943449be766b62 (patch)
treeab03809e74dcf38b17af1692e368ab88f2bd8238
parent88e4dcd738899e072409bda98db547901e36f1b1 (diff)
downloadorg.eclipse.osee-testing_p2.tar.gz
org.eclipse.osee-testing_p2.tar.xz
org.eclipse.osee-testing_p2.zip
feature[TW16544]: Create Version Parallel Config Viewertesting_p2
-rw-r--r--plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsTeamDefinitionService.java2
-rw-r--r--plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionServiceImpl.java19
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/CreateNewVersionItem.java3
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ParallelConfigurationView.java149
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ReleaseVersionItem.java3
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/NavigateViewItems.java16
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/IResultsXViewerRow.java15
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/ResultsXViewerRow.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewerContentProvider.java10
9 files changed, 217 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsTeamDefinitionService.java b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsTeamDefinitionService.java
index 8a040d19ad8..deecf0f973f 100644
--- a/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsTeamDefinitionService.java
+++ b/plugins/org.eclipse.osee.ats.api/src/org/eclipse/osee/ats/api/team/IAtsTeamDefinitionService.java
@@ -130,4 +130,6 @@ public interface IAtsTeamDefinitionService {
Collection<IAtsTeamDefinition> getTeamDefs(Collection<TeamDefinition> jTeamDefs);
+ Collection<IAtsTeamDefinition> getTeamDefHoldingVersions();
+
}
diff --git a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionServiceImpl.java b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionServiceImpl.java
index d95d169726d..733038672e7 100644
--- a/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats.core/src/org/eclipse/osee/ats/core/config/TeamDefinitionServiceImpl.java
@@ -518,13 +518,24 @@ public class TeamDefinitionServiceImpl implements IAtsTeamDefinitionService {
}
@Override
- public Collection<IAtsTeamDefinition> getTeamDefs(Collection<TeamDefinition> jTeamDefs) {
+ public Collection<IAtsTeamDefinition> getTeamDefs(Collection<TeamDefinition> teamDefs) {
+ List<IAtsTeamDefinition> teamDefs2 = new LinkedList<>();
+ for (TeamDefinition teamDef : teamDefs) {
+ teamDefs2.add(atsApi.getQueryService().getConfigItem(teamDef.getId()));
+ }
+ return teamDefs2;
+
+ }
+
+ @Override
+ public Collection<IAtsTeamDefinition> getTeamDefHoldingVersions() {
List<IAtsTeamDefinition> teamDefs = new LinkedList<>();
- for (TeamDefinition jTeamDef : jTeamDefs) {
- teamDefs.add(atsApi.getQueryService().getConfigItem(jTeamDef.getId()));
+ for (TeamDefinition teamDef : atsApi.getConfigService().getConfigurations().getIdToTeamDef().values()) {
+ if (!teamDef.getVersions().isEmpty()) {
+ teamDefs.add(teamDef);
+ }
}
return teamDefs;
-
}
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/CreateNewVersionItem.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/CreateNewVersionItem.java
index 99984a64560..3674e101ce8 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/CreateNewVersionItem.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/CreateNewVersionItem.java
@@ -54,7 +54,8 @@ public class CreateNewVersionItem extends XNavigateItemAction {
* @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
*/
public CreateNewVersionItem(XNavigateItem parent, IAtsTeamDefinition teamDefHoldingVersions) {
- super(parent, "Create New " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + "Version(s)",
+ super(parent,
+ "Create New " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + "Version(s) (Admin)",
FrameworkImage.VERSION);
this.teamDefHoldingVersions = teamDefHoldingVersions;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ParallelConfigurationView.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ParallelConfigurationView.java
new file mode 100644
index 00000000000..460f92bda7e
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ParallelConfigurationView.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2020 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.ide.config.version;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import org.eclipse.jface.window.Window;
+import org.eclipse.nebula.widgets.xviewer.core.model.SortDataType;
+import org.eclipse.nebula.widgets.xviewer.core.model.XViewerAlign;
+import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
+import org.eclipse.osee.ats.api.team.IAtsTeamDefinition;
+import org.eclipse.osee.ats.api.version.IAtsVersion;
+import org.eclipse.osee.ats.ide.internal.AtsClientService;
+import org.eclipse.osee.ats.ide.util.widgets.dialog.TeamDefinitionDialog;
+import org.eclipse.osee.framework.core.data.BranchId;
+import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
+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.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 ParallelConfigurationView extends XNavigateItemAction {
+
+ public static final String TITLE = "Pallel Configuration View";
+ private static enum Columns {
+ AtsVersion,
+ Branch,
+ AllowCreate,
+ AllowCommit,
+ Released;
+ };
+
+ public ParallelConfigurationView(XNavigateItem parent) {
+ super(parent, TITLE, PluginUiImage.ADMIN);
+ }
+
+ @Override
+ public void run(TableLoadOption... tableLoadOptions) throws Exception {
+ IAtsTeamDefinition teamDef;
+ TeamDefinitionDialog dialog = new TeamDefinitionDialog(TITLE, "Select Team");
+ dialog.setMultiSelect(false);
+ dialog.setInput(AtsClientService.get().getTeamDefinitionService().getTeamDefHoldingVersions());
+ if (dialog.open() == Window.OK) {
+ teamDef = dialog.getSelectedFirst();
+
+ ResultsEditor.open(new IResultsEditorProvider() {
+
+ private List<IResultsEditorTab> tabs;
+
+ @Override
+ public String getEditorName() {
+ return String.format("%s - %s", TITLE, teamDef.toStringWithId());
+ }
+
+ @Override
+ public List<IResultsEditorTab> getResultsEditorTabs() {
+ if (tabs == null) {
+ tabs = new LinkedList<>();
+ tabs.add(createDataTab(teamDef));
+ }
+ return tabs;
+ }
+ });
+ }
+ }
+
+ private IResultsEditorTab createDataTab(IAtsTeamDefinition teamDef) {
+ List<IResultsXViewerRow> rows = new ArrayList<>();
+ for (IAtsVersion ver : AtsClientService.get().getVersionService().getVersions(teamDef)) {
+ rows.add(new VersionRow(ver, null));
+ }
+
+ List<XViewerColumn> columns = Arrays.asList(
+ new XViewerColumn(Columns.AtsVersion.name(), Columns.AtsVersion.name(), 260, XViewerAlign.Left, true, SortDataType.String,
+ false, ""),
+ new XViewerColumn(Columns.Branch.name(), Columns.Branch.name(), 260, XViewerAlign.Left, true,
+ SortDataType.String, false, ""),
+ new XViewerColumn(Columns.AllowCreate.name(), Columns.AllowCreate.name(), 126, XViewerAlign.Left, true,
+ SortDataType.String, false, ""),
+ new XViewerColumn(Columns.AllowCommit.name(), Columns.AllowCommit.name(), 126, XViewerAlign.Left, true,
+ SortDataType.String, false, ""),
+ new XViewerColumn(Columns.Released.name(), Columns.Released.name(), 126, XViewerAlign.Left, true,
+ SortDataType.String, false, ""));
+
+ return new ResultsEditorTableTab("Versions", columns, rows);
+ }
+
+ public static class VersionRow extends ResultsXViewerRow {
+
+ private final IAtsVersion version;
+ private final VersionRow parent;
+
+ public VersionRow(IAtsVersion version, VersionRow parent) {
+ this.version = version;
+ this.parent = parent;
+ setData(version.getArtifactId());
+ values.add(version.getName());
+ BranchId baselineBranch = version.getBaselineBranch();
+ if (baselineBranch.isValid()) {
+ values.add(BranchManager.getBranchName(baselineBranch));
+ } else {
+ values.add("");
+ }
+ values.add(String.valueOf(version.isAllowCreateBranch()));
+ values.add(String.valueOf(version.isAllowCommitBranch()));
+ values.add(String.valueOf(version.isReleased()));
+ }
+
+ @Override
+ public boolean hasChildren() {
+ return getChildren().size() > 0;
+ }
+
+ @Override
+ public Collection<IResultsXViewerRow> getChildren() {
+ List<IResultsXViewerRow> rows = new ArrayList<>();
+ for (IAtsVersion version : AtsClientService.get().getVersionService().getParallelVersions(version)) {
+ rows.add(new VersionRow(version, this));
+ }
+ return rows;
+ }
+
+ @Override
+ public IResultsXViewerRow getParent() {
+ return parent;
+ }
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ReleaseVersionItem.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ReleaseVersionItem.java
index 56e70f38239..96e48bafcf5 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ReleaseVersionItem.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/config/version/ReleaseVersionItem.java
@@ -46,7 +46,8 @@ public class ReleaseVersionItem extends XNavigateItemAction {
* @param teamDefHoldingVersions Team Definition Artifact that is related to versions or null for popup selection
*/
public ReleaseVersionItem(XNavigateItem parent, IAtsTeamDefinition teamDefHoldingVersions) {
- super(parent, "Release " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + "Version",
+ super(parent,
+ "Release " + (teamDefHoldingVersions != null ? teamDefHoldingVersions + " " : "") + "Version (Admin)",
FrameworkImage.VERSION);
this.teamDefHoldingVersions = teamDefHoldingVersions;
}
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/NavigateViewItems.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/NavigateViewItems.java
index 43da8d1a98d..c1c45df3c4b 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/NavigateViewItems.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/navigate/NavigateViewItems.java
@@ -49,6 +49,7 @@ import org.eclipse.osee.ats.ide.config.version.CreateNewVersionItem;
import org.eclipse.osee.ats.ide.config.version.GenerateFullVersionReportItem;
import org.eclipse.osee.ats.ide.config.version.GenerateVersionReportItem;
import org.eclipse.osee.ats.ide.config.version.MassEditTeamVersionItem;
+import org.eclipse.osee.ats.ide.config.version.ParallelConfigurationView;
import org.eclipse.osee.ats.ide.config.version.ReleaseVersionItem;
import org.eclipse.osee.ats.ide.ev.EvNavigateItems;
import org.eclipse.osee.ats.ide.export.AtsExportAction;
@@ -188,6 +189,8 @@ public final class NavigateViewItems implements XNavigateViewItems, IXNavigateCo
addExtensionPointItems(item, items);
+ createVersionsSection(item, items);
+
createEmailItems(item, items);
createReportItems(item, items);
@@ -240,7 +243,6 @@ public final class NavigateViewItems implements XNavigateViewItems, IXNavigateCo
private void createAdminItems(XNavigateItem parent, List<XNavigateItem> items) {
if (AtsClientService.get().getUserService().isAtsAdmin()) {
- createVersionsSection(parent, items);
createWorkDefinitionsSection(parent, items);
createExampleItems(parent, items);
XNavigateItem adminItems = new XNavigateItem(parent, "Admin", PluginUiImage.ADMIN);
@@ -346,14 +348,20 @@ public final class NavigateViewItems implements XNavigateViewItems, IXNavigateCo
private void createVersionsSection(XNavigateItem parent, List<XNavigateItem> items) {
try {
XNavigateItem releaseItems = new XNavigateItem(parent, "Versions", FrameworkImage.VERSION);
- new MassEditTeamVersionItem("Team Versions", releaseItems, FrameworkImage.VERSION);
+ new ParallelConfigurationView(releaseItems);
new SearchNavigateItem(releaseItems,
new VersionTargetedForTeamSearchItem(null, null, false, LoadView.WorldEditor));
new SearchNavigateItem(releaseItems, new NextVersionSearchItem(null, LoadView.WorldEditor));
- new ReleaseVersionItem(releaseItems, null);
- new CreateNewVersionItem(releaseItems, null);
new GenerateVersionReportItem(releaseItems);
new GenerateFullVersionReportItem(releaseItems);
+
+ // Admin
+ if (AtsClientService.get().getUserService().isAtsAdmin()) {
+ new MassEditTeamVersionItem("Team Versions (Admin)", releaseItems, FrameworkImage.VERSION);
+ new CreateNewVersionItem(releaseItems, null);
+ new ReleaseVersionItem(releaseItems, null);
+ }
+
items.add(releaseItems);
} catch (OseeCoreException ex) {
OseeLog.log(Activator.class, Level.SEVERE, "Can't create Goals section");
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/IResultsXViewerRow.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/IResultsXViewerRow.java
index c60c92231cf..c9534bc35ea 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/IResultsXViewerRow.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/IResultsXViewerRow.java
@@ -10,6 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.results.table;
+import java.util.Collection;
+import java.util.Collections;
+
/**
* @author Donald G. Dunne
*/
@@ -21,4 +24,16 @@ public interface IResultsXViewerRow {
public Object getData();
+ default public boolean hasChildren() {
+ return false;
+ }
+
+ default public Collection<IResultsXViewerRow> getChildren() {
+ return Collections.emptyList();
+ }
+
+ default IResultsXViewerRow getParent() {
+ return null;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/ResultsXViewerRow.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/ResultsXViewerRow.java
index d30f75183bf..779bf794b73 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/ResultsXViewerRow.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/ResultsXViewerRow.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.results.table;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -18,9 +19,13 @@ import java.util.List;
*/
public class ResultsXViewerRow implements IResultsXViewerRow {
- private final List<String> values;
+ protected final List<String> values;
private Object data;
+ public ResultsXViewerRow() {
+ values = new ArrayList<String>();
+ }
+
public ResultsXViewerRow(List<String> values, Object data) {
this.data = data;
this.values = values;
@@ -48,6 +53,10 @@ public class ResultsXViewerRow implements IResultsXViewerRow {
return values.toArray(new String[values.size()]);
}
+ public void addValue(String value) {
+ values.add(value);
+ }
+
@Override
public Object getData() {
return data;
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewerContentProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewerContentProvider.java
index dc684e15868..88d17926f48 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewerContentProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/results/table/xresults/ResultsXViewerContentProvider.java
@@ -34,16 +34,26 @@ public class ResultsXViewerContentProvider implements ITreeContentProvider {
if (parentElement instanceof Collection) {
return ((Collection) parentElement).toArray();
}
+ if (parentElement instanceof IResultsXViewerRow) {
+ Collection<IResultsXViewerRow> children = ((IResultsXViewerRow) parentElement).getChildren();
+ return children.toArray(new IResultsXViewerRow[children.size()]);
+ }
return EMPTY_ARRAY;
}
@Override
public Object getParent(Object element) {
+ if (element instanceof IResultsXViewerRow) {
+ return ((IResultsXViewerRow) element).getParent();
+ }
return null;
}
@Override
public boolean hasChildren(Object element) {
+ if (element instanceof IResultsXViewerRow) {
+ return ((IResultsXViewerRow) element).hasChildren();
+ }
return false;
}

Back to the top