Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominic Guss2018-09-06 11:52:10 -0400
committerDominic Guss2018-09-10 14:49:31 -0400
commitc996a252d8395b4de587410ecd0f3be47d499a80 (patch)
tree6f30a72ff57a34eff4257b869c9512b53b4a5d59
parenta85f0d3f73bad6ccb520d95a8392ebc8accb0feb (diff)
downloadorg.eclipse.osee-c996a252d8395b4de587410ecd0f3be47d499a80.tar.gz
org.eclipse.osee-c996a252d8395b4de587410ecd0f3be47d499a80.tar.xz
org.eclipse.osee-c996a252d8395b4de587410ecd0f3be47d499a80.zip
bug[ats_TW10431]: bug[ats_TW10431]: Fix data type of Dispo set date
Change-Id: Ie0a4f4b1ec1b55a228f24ed09b4fa59ab33643ca Signed-off-by: Dominic Guss <Dominic.Guss@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java3
-rw-r--r--plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java7
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java17
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java2
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java7
-rw-r--r--plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java2
-rw-r--r--plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java4
-rw-r--r--plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/JacksonFeature.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/DateAttribute.java12
-rw-r--r--plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js12
10 files changed, 36 insertions, 33 deletions
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
index 71331fc222..641f246bca 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSet.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.disposition.model;
+import java.util.Date;
import java.util.List;
import org.eclipse.osee.framework.jdk.core.type.Identifiable;
@@ -34,5 +35,5 @@ public interface DispoSet extends Identifiable<String> {
String getRerunList();
- String getTime();
+ Date getTime();
}
diff --git a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
index 0d7a52757b..b987e1d35e 100644
--- a/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
+++ b/plugins/org.eclipse.osee.disposition.rest.model/src/org/eclipse/osee/disposition/model/DispoSetData.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.disposition.model;
+import java.util.Date;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
@@ -28,7 +29,7 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
private OperationReport operationSummary;
private String ciSet;
private String rerunList;
- private String time;
+ private Date time;
public DispoSetData() {
@@ -97,11 +98,11 @@ public class DispoSetData extends DispoSetDescriptorData implements DispoSet {
}
@Override
- public String getTime() {
+ public Date getTime() {
return time;
}
- public void setTime(String time) {
+ public void setTime(Date time) {
this.time = time;
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
index 798846e4a9..2ee9e2b2df 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoApiImpl.java
@@ -70,6 +70,11 @@ public class DispoApiImpl implements DispoApi {
private DispoImporterFactory importerFactory;
private DispoUpdateBroadcaster updateBroadcaster;
private volatile DispoApiConfiguration config;
+ private final Date newDate;
+
+ public DispoApiImpl() {
+ newDate = new Date();
+ }
@Override
public DispoApiConfiguration getConfig() {
@@ -534,8 +539,8 @@ public class DispoApiImpl implements DispoApi {
Note genOpNotes = generateOperationNotes(operation);
notesList.add(genOpNotes);
newSet.setNotesList(notesList);
- DispoSetArtifact dispoSetArtifact = new DispoSetArtifact(author);
- newSet.setTime(dispoSetArtifact.getTime());
+ newDate.setTime(System.currentTimeMillis());
+ newSet.setTime(newDate);
// Generate report
getWriter().updateOperationSummary(author, branch, setToEdit.getGuid(), report);
@@ -568,8 +573,8 @@ public class DispoApiImpl implements DispoApi {
private Note generateOperationNotes(String operation) {
Note operationNote = new Note();
- Date date = new Date();
- operationNote.setDateString(date.toString());
+ newDate.setTime(System.currentTimeMillis());
+ operationNote.setDateString(newDate.toString());
operationNote.setType("SYSTEM");
operationNote.setContent(operation);
return operationNote;
@@ -664,10 +669,10 @@ public class DispoApiImpl implements DispoApi {
}
DispoSetData dispoSetData = new DispoSetData();
+ newDate.setTime(System.currentTimeMillis());
+ dispoSetData.setTime(newDate);
dispoSetData.setRerunList(DispoStrings.BATCH_RERUN_LIST + sb.toString() + DispoStrings.BATCH_RERUN_LIST_END);
ArtifactReadable author = getQuery().findUser();
- DispoSetArtifact dispoSetArtifact = new DispoSetArtifact(author);
- dispoSetData.setTime(dispoSetArtifact.getTime());
storageProvider.get().updateDispoSet(author, branch, destSetId, dispoSetData);
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
index dce0180ee7..17badfa768 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoDataFactory.java
@@ -12,6 +12,7 @@
package org.eclipse.osee.disposition.rest.internal;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -55,6 +56,7 @@ public class DispoDataFactory {
public DispoSetData creteSetDataFromDescriptor(DispoSetDescriptorData descriptor) {
DispoSetData newSet = new DispoSetData();
newSet.setName(descriptor.getName());
+ newSet.setTime(new Date());
newSet.setImportPath(descriptor.getImportPath());
newSet.setImportState("NONE");
newSet.setNotesList(new ArrayList<Note>());
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
index 0feca233bb..036554d298 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/DispoSetArtifact.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.disposition.rest.internal;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -100,10 +99,8 @@ public class DispoSetArtifact extends BaseIdentity<String> implements DispoSet {
}
@Override
- public String getTime() {
- Date date = artifact.getSoleAttributeValue(DispoConstants.DispoTime, null);
- SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy");
- return sdf.format(date);
+ public Date getTime() {
+ return artifact.getSoleAttributeValue(DispoConstants.DispoTime, null);
}
}
diff --git a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
index e231006f02..f5099213fd 100644
--- a/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
+++ b/plugins/org.eclipse.osee.disposition.rest/src/org/eclipse/osee/disposition/rest/internal/OrcsStorageImpl.java
@@ -276,7 +276,7 @@ public class OrcsStorageImpl implements Storage {
String importPath = newData.getImportPath();
String ciSet = newData.getCiSet();
String rerunList = newData.getRerunList();
- String time = newData.getTime();
+ Date time = newData.getTime();
JSONArray notesList = null;
if (newData.getNotesList() != null) {
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java
index eb98c28ff6..28dd15d263 100644
--- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java
+++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/DateAttribute.java
@@ -20,11 +20,7 @@ import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
* @author Ryan D. Brooks
*/
public class DateAttribute extends CharacterBackedAttribute<Date> {
- public static final DateFormat MMDDYY = new SimpleDateFormat("MM/dd/yyyy");
- public static final DateFormat HHMM = new SimpleDateFormat("hh:mm");
public final DateFormat MMDDYYHHMM = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
- public final DateFormat MMDDYYYYHHMMSSAMPM = new SimpleDateFormat("MMM dd,yyyy hh:mm:ss a");
- public final DateFormat ALLDATETIME = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
@Override
public Date getValue() throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/JacksonFeature.java b/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/JacksonFeature.java
index 9a48a4f2df..1f47f2e356 100644
--- a/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/JacksonFeature.java
+++ b/plugins/org.eclipse.osee.jaxrs/src/org/eclipse/osee/jaxrs/JacksonFeature.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.osee.jaxrs;
-import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -94,7 +93,7 @@ public class JacksonFeature implements Feature {
private static JacksonJsonProvider newJacksonJsonProvider() {
ObjectMapper objectMapper = new ObjectMapper();
- objectMapper.setDateFormat(new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a"));
+ objectMapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, true);
objectMapper.configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
objectMapper.configure(SerializationConfig.Feature.WRAP_EXCEPTIONS, true);
objectMapper.configure(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS, true);
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/DateAttribute.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/DateAttribute.java
index c918650883..abea277072 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/DateAttribute.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/attribute/primitives/DateAttribute.java
@@ -23,15 +23,11 @@ import org.eclipse.osee.orcs.core.annotations.OseeAttribute;
*/
@OseeAttribute("DateAttribute")
public class DateAttribute extends CharacterBackedAttribute<Date> {
- public static final DateFormat MMDDYY = new SimpleDateFormat("MM/dd/yyyy");
- public static final DateFormat HHMM = new SimpleDateFormat("hh:mm");
- public final DateFormat MMDDYYHHMM = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
- public final DateFormat MMDDYYYYHHMMSSAMPM = new SimpleDateFormat("MMM dd,yyyy hh:mm:ss a");
- public final DateFormat ALLDATETIME = new SimpleDateFormat("E MMM dd HH:mm:ss z yyyy");
+ private static final DateFormat MMDDYYHHMM = new SimpleDateFormat("MM/dd/yyyy hh:mm a");
/**
* Return current date or null if not set
- *
+ *
* @return date or null if not set
*/
@Override
@@ -52,7 +48,7 @@ public class DateAttribute extends CharacterBackedAttribute<Date> {
/**
* Sets date
- *
+ *
* @param value value or null to clear
*/
@Override
@@ -75,7 +71,7 @@ public class DateAttribute extends CharacterBackedAttribute<Date> {
/**
* Return date in format given by pattern or "" if not set
- *
+ *
* @param pattern DateAttribute.MMDDYY, etc...
* @return formated date
*/
diff --git a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
index 8b9fb042e6..8745546895 100644
--- a/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
+++ b/plugins/org.eclipse.osee.web.ui/src/dispo/js/adminController.js
@@ -1,7 +1,8 @@
app.controller('adminController', [
'$scope',
'$rootScope',
- '$modal',
+ '$modal',
+ '$filter',
'Program',
'Set',
'Report',
@@ -10,7 +11,7 @@ app.controller('adminController', [
'MultiItemEdit',
'Config',
'uiGridConstants',
- function($scope, $rootScope, $modal, Program, Set, Report, CopySet, CopySetCoverage, MultiItemEdit, Config, uiGridConstants) {
+ function($scope, $rootScope, $modal, $filter, Program, Set, Report, CopySet, CopySetCoverage, MultiItemEdit, Config, uiGridConstants) {
$scope.readOnly = true;
$scope.programSelection = null;
$scope.modalShown = false;
@@ -326,6 +327,7 @@ app.controller('adminController', [
newSet.$save({
programId: $scope.programSelection
}, function(data) {
+ data.time = formatDate(data.time);
$scope.sets.push(data);
});
}
@@ -817,5 +819,9 @@ app.controller('adminController', [
$modalInstance.dismiss('cancel');
};
}
+
+ var formatDate = function(time) {
+ return $filter('date')(new Date(time), 'EEE MMM dd HH:mm:ss UTC yyyy');
+ }
}
- ]); \ No newline at end of file
+ ]);

Back to the top