Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2016-08-19 12:16:28 -0400
committerdonald.g.dunne2016-09-01 20:21:16 -0400
commitc8be0ccd9fb7f609d0c82025e12c1b95197febf6 (patch)
treee26ae6e8c8e9add1e3d6da3c908db0fa5f304cbb
parent5b0c08036553535c7906e4e1725a7e468b52b3a2 (diff)
downloadorg.eclipse.osee-c8be0ccd9fb7f609d0c82025e12c1b95197febf6.tar.gz
org.eclipse.osee-c8be0ccd9fb7f609d0c82025e12c1b95197febf6.tar.xz
org.eclipse.osee-c8be0ccd9fb7f609d0c82025e12c1b95197febf6.zip
bug[ats_ATS311068]: Sprint Summary errors on OTE Team Sprint 95
-rw-r--r--plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintPageBuilder.java19
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/XRunSprintSummaryButton.java112
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java3
-rw-r--r--plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats22
4 files changed, 150 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintPageBuilder.java b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintPageBuilder.java
index f95c4f29ce..3a7f3cc940 100644
--- a/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintPageBuilder.java
+++ b/plugins/org.eclipse.osee.ats.rest/src/org/eclipse/osee/ats/rest/internal/agile/SprintPageBuilder.java
@@ -123,14 +123,21 @@ public class SprintPageBuilder {
}
private void updateFeatureGroupSum(ArtifactReadable item, TreeMap<String, FeatureGroupSum> featureSums, double points) {
- ArtifactReadable featureGroup = item.getRelated(AtsRelationTypes.AgileFeatureToItem_FeatureGroup).getExactlyOne();
- FeatureGroupSum feature = featureSums.get(featureGroup.getName());
+ String featureGroupName = null;
+ ArtifactReadable featureGroup =
+ item.getRelated(AtsRelationTypes.AgileFeatureToItem_FeatureGroup).getAtMostOneOrNull();
+ if (featureGroup == null) {
+ featureGroupName = "UnSet";
+ } else {
+ featureGroupName = featureGroup.getName();
+ }
+ FeatureGroupSum feature = featureSums.get(featureGroupName);
if (feature == null) {
- feature = new FeatureGroupSum(featureGroup.getName(),
- featureGroup.getSoleAttributeAsString(AtsAttributeTypes.Description, ""));
+ feature = new FeatureGroupSum(featureGroupName,
+ featureGroup == null ? "" : featureGroup.getSoleAttributeAsString(AtsAttributeTypes.Description, ""));
}
feature.addToSum(points);
- featureSums.put(featureGroup.getName(), feature);
+ featureSums.put(featureGroupName, feature);
}
private boolean includeInCount(ArtifactReadable item) {
@@ -160,7 +167,7 @@ public class SprintPageBuilder {
startDate = adjustDate((Date) sprint.getSoleAttributeValue(AtsAttributeTypes.StartDate), false);
endDate = adjustDate((Date) sprint.getSoleAttributeValue(AtsAttributeTypes.EndDate), true);
} catch (Exception e) {
- throw new OseeCoreException("Date not available in sprint %s", sprint.getName());
+ throw new OseeCoreException("Start Date and End Date must be set in Sprint [%s]", sprint.getName());
}
numActionsCompleted = 0;
workCompleted = 0;
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/XRunSprintSummaryButton.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/XRunSprintSummaryButton.java
new file mode 100644
index 0000000000..843efe4f97
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/XRunSprintSummaryButton.java
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * 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.agile;
+
+import java.util.Date;
+import javax.ws.rs.core.Response;
+import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.api.agile.IAgileSprint;
+import org.eclipse.osee.ats.api.data.AtsArtifactTypes;
+import org.eclipse.osee.ats.api.data.AtsAttributeTypes;
+import org.eclipse.osee.ats.internal.Activator;
+import org.eclipse.osee.ats.internal.AtsClientService;
+import org.eclipse.osee.framework.core.data.OseeClient;
+import org.eclipse.osee.framework.core.util.Result;
+import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
+import org.eclipse.osee.framework.ui.skynet.results.ResultsEditor;
+import org.eclipse.osee.framework.ui.skynet.widgets.IArtifactWidget;
+import org.eclipse.osee.framework.ui.skynet.widgets.XButton;
+import org.eclipse.osee.framework.ui.skynet.widgets.XModifiedListener;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class XRunSprintSummaryButton extends XButton implements IArtifactWidget {
+
+ private IAgileSprint sprint;
+ private final boolean editable = false;
+ public static final String WIDGET_ID = XRunSprintSummaryButton.class.getSimpleName();
+
+ public XRunSprintSummaryButton() {
+ super("Run Sprint Summary");
+ setImage(ImageManager.getImage(AtsImage.REPORT));
+ setToolTip("Click to run Sprint Report");
+ addXModifiedListener(listener);
+ }
+
+ @Override
+ public Artifact getArtifact() {
+ return (Artifact) sprint.getStoreObject();
+ }
+
+ XModifiedListener listener = new XModifiedListener() {
+ @Override
+ public void widgetModified(org.eclipse.osee.framework.ui.skynet.widgets.XWidget widget) {
+ try {
+ runReport();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ };
+ };
+
+ private void runReport() {
+ Date startDate = ((Artifact) sprint.getStoreObject()).getSoleAttributeValue(AtsAttributeTypes.StartDate, null);
+ Date endDate = ((Artifact) sprint.getStoreObject()).getSoleAttributeValue(AtsAttributeTypes.EndDate, null);
+
+ if (startDate == null || endDate == null) {
+ AWorkbench.popup("Sprint must have start and end dates specified.");
+ return;
+ }
+
+ Response response = AtsClientService.getAgileEndpoint().getSprintSummary(sprint.getTeamUuid(), sprint.getUuid());
+ String reportHtml = response.readEntity(String.class);
+ String appServer = System.getProperty(OseeClient.OSEE_APPLICATION_SERVER);
+ if (Strings.isValid(appServer)) {
+ reportHtml = reportHtml.replaceFirst("\\/ajax", appServer + "/ajax");
+ }
+ ResultsEditor.open("Report", "Sprint Summary Report", reportHtml);
+ }
+
+ @Override
+ public Result isDirty() {
+ return Result.FalseResult;
+ }
+
+ @Override
+ public void revert() {
+ // do nothing
+ }
+
+ @Override
+ public void saveToArtifact() {
+ // do nothing
+ }
+
+ @Override
+ public void setArtifact(Artifact artifact) throws OseeCoreException {
+ if (artifact.isOfType(AtsArtifactTypes.AgileSprint)) {
+ this.sprint = (IAgileSprint) artifact;
+ }
+ }
+
+ @Override
+ public boolean isEditable() {
+ return editable;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
index 1bf4b90555..13b5f84e9c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/AtsWidgetProvider.java
@@ -14,6 +14,7 @@ package org.eclipse.osee.ats.util.widgets;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
+import org.eclipse.osee.ats.agile.XRunSprintSummaryButton;
import org.eclipse.osee.ats.api.program.IAtsProgram;
import org.eclipse.osee.ats.column.OperationalImpactWithWorkaroundXWidget;
import org.eclipse.osee.ats.column.OperationalImpactXWidget;
@@ -139,6 +140,8 @@ public class AtsWidgetProvider implements IXWidgetProvider {
return new ClosureStateMultiChoiceSelect();
} else if (widgetName.equals(XProgramSelectionWidget.WIDGET_ID)) {
return new XProgramSelectionWidget();
+ } else if (widgetName.equals(XRunSprintSummaryButton.WIDGET_ID)) {
+ return new XRunSprintSummaryButton();
}
return toReturn;
}
diff --git a/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats b/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
index b30163277f..95a28146b9 100644
--- a/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
+++ b/plugins/org.eclipse.osee.ats/support/WorkDef_Sprint.ats
@@ -14,6 +14,22 @@ workDefinition "WorkDef_Sprint" {
option FILL_VERTICALLY
}
+ widgetDefinition "Start Date" {
+ attributeName "ats.Start Date"
+ xWidgetName "XDateDam"
+ option HORIZONTAL_LABEL
+ }
+
+ widgetDefinition "End Date" {
+ attributeName "ats.End Date"
+ xWidgetName "XDateDam"
+ option HORIZONTAL_LABEL
+ }
+
+ widgetDefinition "XRunSprintReportButton" {
+ xWidgetName "XRunSprintReportButton"
+ }
+
state "Cancelled" {
type Cancelled
ordinal 3
@@ -26,6 +42,12 @@ workDefinition "WorkDef_Sprint" {
to "Cancelled"
to "Completed" AsDefault
layout {
+ composite {
+ numColumns 6
+ widget "Start Date"
+ widget "End Date"
+ widget "XRunSprintReportButton"
+ }
widget "Title"
widget "Description"
}

Back to the top