comparison 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
comparison
equal deleted inserted replaced
8241:a65afd85d516 8242:f8ea1a7ecde6
83 river); 83 river);
84 84
85 log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id); 85 log.debug("Requested type: " + type + " with sq_ti_id: " + sq_ti_id);
86 Collection <Load> loads; 86 Collection <Load> loads;
87 if (type.equals("off_epoch")) { 87 if (type.equals("off_epoch")) {
88 /* TODO */ 88 loads = allLoadData.findUniqueTiOfficialLoads(fromD, toD);
89 loads = null;
90 } else if (type.equals("sq_time_intervals")) { 89 } else if (type.equals("sq_time_intervals")) {
91 loads = allLoadData.findUniqueTimeIntervalLoads(fromD, toD); 90 loads = allLoadData.findUniqueTimeIntervalLoads(fromD, toD);
92 91
93 for (Iterator<Load> it = loads.iterator(); it.hasNext();) { 92 for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
94 /* Skip loads without time interval for this info type. */ 93 /* Skip loads without time interval for this info type. */
97 } 96 }
98 } 97 }
99 } else { 98 } else {
100 if (!sq_ti_id.isEmpty()) { 99 if (!sq_ti_id.isEmpty()) {
101 Integer id = Integer.parseInt(sq_ti_id); 100 Integer id = Integer.parseInt(sq_ti_id);
102 log.debug("Finding only items for id");
103 loads = allLoadData.findLoads(fromD, toD, id); 101 loads = allLoadData.findLoads(fromD, toD, id);
104 } else { 102 } else {
105 log.debug("Finding everything.");
106 loads = allLoadData.findLoads(fromD, toD); 103 loads = allLoadData.findLoads(fromD, toD);
104 }
105 for (Iterator<Load> it = loads.iterator(); it.hasNext();) {
106 /* Skip epochs . */
107 if (it.next().isEpoch()) {
108 it.remove();
109 }
107 } 110 }
108 } 111 }
109 112
110 return buildDocument(loads); 113 return buildDocument(loads);
111 } 114 }

http://dive4elements.wald.intevation.org