Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/SQRelation.java @ 8407:f1f6e32156a6
Put date range into facet descriptions for curve and measurements.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 14 Oct 2014 15:22:11 +0200 |
parents | d4c501d2c098 |
children | 5e38e2924c07 |
comparison
equal
deleted
inserted
replaced
8406:6ae0c5116d58 | 8407:f1f6e32156a6 |
---|---|
173 List<Facet> facets, | 173 List<Facet> facets, |
174 Object old | 174 Object old |
175 ) { | 175 ) { |
176 log.debug("SQRelation.computeAdvance"); | 176 log.debug("SQRelation.computeAdvance"); |
177 | 177 |
178 SQRelationAccess sqAccess = new SQRelationAccess(artifact); | |
179 | |
178 CalculationResult res = old instanceof CalculationResult | 180 CalculationResult res = old instanceof CalculationResult |
179 ? (CalculationResult)old | 181 ? (CalculationResult)old |
180 : new SQRelationCalculation( | 182 : new SQRelationCalculation(sqAccess).calculate(); |
181 new SQRelationAccess(artifact)).calculate(); | |
182 | 183 |
183 if (facets == null) { | 184 if (facets == null) { |
184 return res; | 185 return res; |
185 } | 186 } |
186 | 187 |
187 SQResult [] sqr = (SQResult [])res.getData(); | 188 SQResult [] sqr = (SQResult [])res.getData(); |
188 if (sqr == null) { | 189 if (sqr == null) { |
189 return res; | 190 return res; |
190 } | 191 } |
191 | 192 |
192 createFacets(context, facets, sqr, hash); | 193 createFacets(context, facets, sqAccess, sqr, hash); |
193 | 194 |
194 Facet csv = new DataFacet( | 195 Facet csv = new DataFacet( |
195 CSV, "CSV data", ComputeType.ADVANCE, hash, id); | 196 CSV, "CSV data", ComputeType.ADVANCE, hash, id); |
196 | 197 |
197 Facet pdf = new DataFacet( | 198 Facet pdf = new DataFacet( |
205 | 206 |
206 | 207 |
207 protected void createFacets( | 208 protected void createFacets( |
208 CallContext context, | 209 CallContext context, |
209 List<Facet> container, | 210 List<Facet> container, |
211 SQRelationAccess access, | |
210 SQResult[] sqr, | 212 SQResult[] sqr, |
211 String hash | 213 String hash |
212 ) { | 214 ) { |
213 boolean debug = log.isDebugEnabled(); | 215 boolean debug = log.isDebugEnabled(); |
214 | 216 |
229 i, | 231 i, |
230 getFractionFacetname(CURVE_INDEX, i), | 232 getFractionFacetname(CURVE_INDEX, i), |
231 Resources.getMsg( | 233 Resources.getMsg( |
232 meta, | 234 meta, |
233 I18N_FACET_CURVE, | 235 I18N_FACET_CURVE, |
234 I18N_FACET_CURVE | 236 new Object[] { |
237 access.getPeriod().getFrom(), | |
238 access.getPeriod().getTo() | |
239 } | |
235 ), | 240 ), |
236 hash, | 241 hash, |
237 stateId | 242 stateId |
238 )); | 243 )); |
239 | 244 |
243 getFractionOverviewFacetname(CURVE_INDEX, i), | 248 getFractionOverviewFacetname(CURVE_INDEX, i), |
244 sqr[res].getFractionName(i) + " - " + | 249 sqr[res].getFractionName(i) + " - " + |
245 Resources.getMsg( | 250 Resources.getMsg( |
246 meta, | 251 meta, |
247 I18N_FACET_CURVE, | 252 I18N_FACET_CURVE, |
248 I18N_FACET_CURVE | 253 new Object[] { |
254 access.getPeriod().getFrom(), | |
255 access.getPeriod().getTo() | |
256 } | |
249 ), | 257 ), |
250 hash, | 258 hash, |
251 stateId | 259 stateId |
252 )); | 260 )); |
253 | 261 |
271 i, | 279 i, |
272 getFractionFacetname(OUTLIER_INDEX, i), | 280 getFractionFacetname(OUTLIER_INDEX, i), |
273 Resources.getMsg( | 281 Resources.getMsg( |
274 meta, | 282 meta, |
275 I18N_FACET_OUTLIERS, | 283 I18N_FACET_OUTLIERS, |
276 I18N_FACET_OUTLIERS, | |
277 round | 284 round |
278 ), | 285 ), |
279 hash, | 286 hash, |
280 stateId | 287 stateId |
281 )); | 288 )); |
285 getFractionOverviewFacetname(OUTLIER_INDEX, i), | 292 getFractionOverviewFacetname(OUTLIER_INDEX, i), |
286 sqr[res].getFractionName(i) + " - " + | 293 sqr[res].getFractionName(i) + " - " + |
287 Resources.getMsg( | 294 Resources.getMsg( |
288 meta, | 295 meta, |
289 I18N_FACET_OUTLIERS, | 296 I18N_FACET_OUTLIERS, |
290 I18N_FACET_OUTLIERS, | |
291 round | 297 round |
292 ), | 298 ), |
293 hash, | 299 hash, |
294 stateId | 300 stateId |
295 )); | 301 )); |
298 index, | 304 index, |
299 i, | 305 i, |
300 getFractionFacetname(OUTLIER_CURVE_INDEX, i), | 306 getFractionFacetname(OUTLIER_CURVE_INDEX, i), |
301 Resources.getMsg( | 307 Resources.getMsg( |
302 meta, | 308 meta, |
303 I18N_FACET_OUTLIER_CURVE, | |
304 I18N_FACET_OUTLIER_CURVE, | 309 I18N_FACET_OUTLIER_CURVE, |
305 round | 310 round |
306 ), | 311 ), |
307 hash, | 312 hash, |
308 stateId | 313 stateId |
313 getFractionOverviewFacetname(OUTLIER_CURVE_INDEX, i), | 318 getFractionOverviewFacetname(OUTLIER_CURVE_INDEX, i), |
314 sqr[res].getFractionName(i) + " - " + | 319 sqr[res].getFractionName(i) + " - " + |
315 Resources.getMsg( | 320 Resources.getMsg( |
316 meta, | 321 meta, |
317 I18N_FACET_OUTLIER_CURVE, | 322 I18N_FACET_OUTLIER_CURVE, |
318 I18N_FACET_OUTLIER_CURVE, | |
319 round | 323 round |
320 ), | 324 ), |
321 hash, | 325 hash, |
322 stateId | 326 stateId |
323 )); | 327 )); |
327 i, | 331 i, |
328 getFractionFacetname(OUTLIER_MEASUREMENT_INDEX, i), | 332 getFractionFacetname(OUTLIER_MEASUREMENT_INDEX, i), |
329 Resources.getMsg( | 333 Resources.getMsg( |
330 meta, | 334 meta, |
331 I18N_FACET_OUTLIER_MEASUREMENT, | 335 I18N_FACET_OUTLIER_MEASUREMENT, |
332 I18N_FACET_OUTLIER_MEASUREMENT, | |
333 round | 336 round |
334 ), | 337 ), |
335 hash, | 338 hash, |
336 stateId | 339 stateId |
337 )); | 340 )); |
340 i, | 343 i, |
341 getFractionOverviewFacetname(OUTLIER_MEASUREMENT_INDEX, i), | 344 getFractionOverviewFacetname(OUTLIER_MEASUREMENT_INDEX, i), |
342 sqr[res].getFractionName(i) + " - " + | 345 sqr[res].getFractionName(i) + " - " + |
343 Resources.getMsg( | 346 Resources.getMsg( |
344 meta, | 347 meta, |
345 I18N_FACET_OUTLIER_MEASUREMENT, | |
346 I18N_FACET_OUTLIER_MEASUREMENT, | 348 I18N_FACET_OUTLIER_MEASUREMENT, |
347 round | 349 round |
348 ), | 350 ), |
349 hash, | 351 hash, |
350 stateId | 352 stateId |
356 i, | 358 i, |
357 getFractionFacetname(MEASURREMENT_INDEX, i), | 359 getFractionFacetname(MEASURREMENT_INDEX, i), |
358 Resources.getMsg( | 360 Resources.getMsg( |
359 meta, | 361 meta, |
360 I18N_FACET_MEASUREMENTS, | 362 I18N_FACET_MEASUREMENTS, |
361 I18N_FACET_MEASUREMENTS | 363 new Object[] { |
364 access.getPeriod().getFrom(), | |
365 access.getPeriod().getTo() | |
366 } | |
362 ), | 367 ), |
363 hash, | 368 hash, |
364 stateId | 369 stateId |
365 )); | 370 )); |
366 container.add(new SQMeasurementFacet( | 371 container.add(new SQMeasurementFacet( |
369 getFractionOverviewFacetname(MEASURREMENT_INDEX, i), | 374 getFractionOverviewFacetname(MEASURREMENT_INDEX, i), |
370 sqr[res].getFractionName(i) + " - " + | 375 sqr[res].getFractionName(i) + " - " + |
371 Resources.getMsg( | 376 Resources.getMsg( |
372 meta, | 377 meta, |
373 I18N_FACET_MEASUREMENTS, | 378 I18N_FACET_MEASUREMENTS, |
374 I18N_FACET_MEASUREMENTS | 379 new Object[] { |
380 access.getPeriod().getFrom(), | |
381 access.getPeriod().getTo() | |
382 } | |
375 ), | 383 ), |
376 hash, | 384 hash, |
377 stateId | 385 stateId |
378 )); | 386 )); |
379 } // for all fractions | 387 } // for all fractions |