diff artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java @ 8242:f8ea1a7ecde6

(issue1448) Fix info service for epoch / periods and off epoch This also includes a bit cleanup to move the sqRelationTimeInterval check to the creation of the load list in SedimentLoadData allLoads.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 09 Sep 2014 11:13:37 +0200
parents b207eeb66edd
children 02162b60cf9c
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java	Tue Sep 09 10:53:50 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java	Tue Sep 09 11:13:37 2014 +0200
@@ -85,8 +85,7 @@
         log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id);
         Collection <Load> loads;
         if (type.equals("off_epoch")) {
-            /* TODO */
-            loads = null;
+            loads = allLoadData.findUniqueTiOfficialLoads(fromD, toD);
         } else if (type.equals("sq_time_intervals")) {
             loads = allLoadData.findUniqueTimeIntervalLoads(fromD, toD);
 
@@ -99,12 +98,16 @@
         } else {
             if (!sq_ti_id.isEmpty()) {
                 Integer id = Integer.parseInt(sq_ti_id);
-                log.debug("Finding only items for id");
                 loads = allLoadData.findLoads(fromD, toD, id);
             } else {
-                log.debug("Finding everything.");
                 loads = allLoadData.findLoads(fromD, toD);
             }
+            for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
+                /* Skip epochs . */
+                if (it.next().isEpoch()) {
+                    it.remove();
+                }
+            }
         }
 
         return buildDocument(loads);

http://dive4elements.wald.intevation.org