changeset 7553:4e999b1d7acd

issue1542: Add timeinterval-data to mainvalues made available via service.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 12 Nov 2013 11:46:24 +0100
parents 81d5939ec064
children 19a133698eaf
files artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Tue Nov 12 11:45:47 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Tue Nov 12 11:46:24 2013 +0100
@@ -320,6 +320,15 @@
         cr.addAttr(el, "value", mainValue.getValue().toString());
         cr.addAttr(el, "name", namedMainValue.getName());
         cr.addAttr(el, "type", mainValueType.getName());
+        if (mainValue.getTimeInterval() != null) {
+            // TODO instead of bulky toString, use i18n.
+            if (mainValue.getTimeInterval().getStartTime() != null) {
+                cr.addAttr(el, "starttime", ""+mainValue.getTimeInterval().getStartTime());
+            }
+            if (mainValue.getTimeInterval().getStopTime() != null) {
+                cr.addAttr(el, "stoptime", ""+mainValue.getTimeInterval().getStopTime());
+            }
+        }
 
         if (hasOfficialLine(namedMainValue, riverId)) {
             cr.addAttr(el, "official", "true");

http://dive4elements.wald.intevation.org