Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormegumi.telles2017-08-14 13:57:48 -0400
committerMegumi Telles2017-08-15 17:34:52 -0400
commit22fca604da5703cb30c799a15471e93c565db750 (patch)
tree2c184120303eebcba7f3093ddff66fdd52e09d61
parentb8afd26e92c88d44fa185e18784e70ceb2bfdba8 (diff)
downloadorg.eclipse.osee-22fca604da5703cb30c799a15471e93c565db750.tar.gz
org.eclipse.osee-22fca604da5703cb30c799a15471e93c565db750.tar.xz
org.eclipse.osee-22fca604da5703cb30c799a15471e93c565db750.zip
feature[ats_TW1426]: Use branch view artifact for set view
-rw-r--r--plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java26
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerViewApplicability.java6
4 files changed, 8 insertions, 33 deletions
diff --git a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
index 596c4f52fa..91b0164db4 100644
--- a/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
+++ b/plugins/org.eclipse.osee.define/src/org/eclipse/osee/define/blam/operation/PublishWithSpecifiedTemplate.java
@@ -402,8 +402,7 @@ public class PublishWithSpecifiedTemplate extends AbstractBlam {
BranchId isArtBranch = art.getBranch();
if (isArtBranch != null) {
if (ViewApplicabilityUtil.isBranchOfProductLine(isArtBranch)) {
- branchViews =
- ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(isArtBranch));
+ branchViews = ViewApplicabilityUtil.getBranchViews(isArtBranch);
branchViewWidget.setDataStrings(branchViews.values());
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
index a7985ca1f6..0634998f09 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/branch/ViewApplicabilityUtil.java
@@ -10,23 +10,18 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.branch;
-import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
-
import org.eclipse.jface.window.Window;
import org.eclipse.osee.framework.core.data.ApplicabilityId;
import org.eclipse.osee.framework.core.data.ApplicabilityToken;
-import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.BranchId;
-import org.eclipse.osee.framework.core.data.BranchViewData;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.model.access.PermissionStatus;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -104,26 +99,11 @@ public class ViewApplicabilityUtil {
return null;
}
- public static List<BranchViewData> getBranchViewData(BranchId branch) {
- ApplicabilityEndpoint applEndpoint = getApplicabilityEndpoint(branch);
- List<BranchViewData> views = new ArrayList<>();
- if (applEndpoint != null) {
- views.addAll(applEndpoint.getViews());
- }
- return views;
- }
-
public static Map<Long, String> getBranchViews(BranchId branch) {
Map<Long, String> viewsToBranchData = new HashMap<Long, String>();
- for (BranchViewData view : ViewApplicabilityUtil.getBranchViewData(branch)) {
- for (ArtifactId art : view.getBranchViews()) {
- try {
- Artifact artifact = ArtifactQuery.getArtifactFromId(art, branch);
- viewsToBranchData.put(art.getId(), artifact.getName());
- } catch (ArtifactDoesNotExist e) {
- // Do Nothing
- }
- }
+ List<Artifact> branchViews = ArtifactQuery.getArtifactListFromType(CoreArtifactTypes.BranchView, branch);
+ for (Artifact art : branchViews) {
+ viewsToBranchData.put(art.getId(), art.getName());
}
return viewsToBranchData;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
index 346f7a5ee9..b95df4ce83 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/change/view/ChangeReportPageViewApplicability.java
@@ -89,8 +89,7 @@ public class ChangeReportPageViewApplicability {
}
private String getArtifactViewApplicabiltyText() {
- Map<Long, String> branchViews =
- ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(getBranch()));
+ Map<Long, String> branchViews = ViewApplicabilityUtil.getBranchViews(getBranch());
String result = branchViews.get(editor.getViewId());
return String.format("<form><p><b>Branch View:</b> %s</p></form>", result == null ? "Not Set" : result);
}
@@ -117,8 +116,7 @@ public class ChangeReportPageViewApplicability {
}
private boolean changeView() {
- Map<Long, String> branchViews =
- ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(getBranch()));
+ Map<Long, String> branchViews = ViewApplicabilityUtil.getBranchViews(getBranch());
ViewBranchViewFilterTreeDialog dialog =
new ViewBranchViewFilterTreeDialog("Select Branch View", "Select Branch View", branchViews);
Collection<String> values = new ArrayList<>();
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerViewApplicability.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerViewApplicability.java
index 978dac9250..91759d4da6 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerViewApplicability.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/explorer/ArtifactExplorerViewApplicability.java
@@ -103,8 +103,7 @@ public class ArtifactExplorerViewApplicability {
button.setEnabled(true);
viewId = explorer.getViewId();
}
- branchViews =
- ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(explorer.getBranch()));
+ branchViews = ViewApplicabilityUtil.getBranchViews(explorer.getBranch());
result = branchViews.get(viewId);
}
}
@@ -116,8 +115,7 @@ public class ArtifactExplorerViewApplicability {
}
private boolean changeView() {
- Map<Long, String> branchViews =
- ViewApplicabilityUtil.getBranchViews(ViewApplicabilityUtil.getParentBranch(explorer.getBranch()));
+ Map<Long, String> branchViews = ViewApplicabilityUtil.getBranchViews(explorer.getBranch());
ViewBranchViewFilterTreeDialog dialog =
new ViewBranchViewFilterTreeDialog("Select Branch View", "Select Branch View", branchViews);
Collection<String> values = new ArrayList<>();

Back to the top