comparison artifacts/doc/conf/meta-data.xml @ 6264:e8f152163a1e double-precision

merge changes from default into double-precision branch
author Tom Gottfried <tom.gottfried@intevation.de>
date Tue, 11 Jun 2013 09:40:56 +0200
parents f58a4aafcdf6
children 1366057e017e
comparison
equal deleted inserted replaced
6203:a3fb76cf79b6 6264:e8f152163a1e
3 <datacage> 3 <datacage>
4 4
5 <dc:comment> 5 <dc:comment>
6 User specific part 6 User specific part
7 ------------------ 7 ------------------
8 This is a hack because we currently have no way to supress empty
9 folders (either in the client or in the datacage).
8 </dc:comment> 10 </dc:comment>
9 <dc:if test="dc:contains($parameters, 'user-id') and not(dc:contains($artifact-outs, 'floodmap-hws'))"> 11 <dc:if test="dc:contains($parameters, 'user-id') and
12 not(dc:contains($artifact-outs, 'floodmap-hws')) and
13 not($current-state-id = 'state.winfo.uesk.dgm')">
10 <dc:call-macro name="load-user"/> 14 <dc:call-macro name="load-user"/>
11 </dc:if> 15 </dc:if>
12 16
13 <dc:call-macro name="load-system"/> 17 <dc:call-macro name="load-system"/>
14 18
30 <dc:call-macro name="generate-user-content"/> 34 <dc:call-macro name="generate-user-content"/>
31 </old_calculations> 35 </old_calculations>
32 </dc:macro> 36 </dc:macro>
33 37
34 <dc:macro name="generate-system-content"> 38 <dc:macro name="generate-system-content">
35 <dc:call-macro name="user-range"> 39 <dc:call-macro name="artifact-range">
36 <dc:call-macro name="km-filtered-wsts"> 40 <dc:call-macro name="km-filtered-wsts">
37 <dc:choose> 41 <dc:choose>
38 <dc:when test="dc:contains($parameters, 'recommended')"> 42 <dc:when test="dc:contains($parameters, 'recommended')">
39 <dc:comment> 43 <dc:comment>
40 Recommendations (client shall load immediately). 44 Recommendations (client shall load immediately).
184 <dc:when test="$out = 'bed_difference_year'"> 188 <dc:when test="$out = 'bed_difference_year'">
185 <dc:call-macro name="basedata_0"/> 189 <dc:call-macro name="basedata_0"/>
186 <dc:call-macro name="basedata_1_additionals"/> 190 <dc:call-macro name="basedata_1_additionals"/>
187 <dc:call-macro name="basedata_2_fixations"/> 191 <dc:call-macro name="basedata_2_fixations"/>
188 <dc:call-macro name="basedata_3_officials"/> 192 <dc:call-macro name="basedata_3_officials"/>
193 <dc:call-macro name="basedata_6_delta_w"/>
189 <dc:call-macro name="annotations_per_type"/> 194 <dc:call-macro name="annotations_per_type"/>
190 <dc:call-macro name="morph_width"/> 195 <dc:call-macro name="morph_width"/>
191 </dc:when> 196 </dc:when>
192 <dc:when test="$out = 'bed_difference_epoch'"> 197 <dc:when test="$out = 'bed_difference_epoch'">
193 <dc:call-macro name="basedata_0"/> 198 <dc:call-macro name="basedata_0"/>
240 <dc:call-macro name="mainvalues"/> 245 <dc:call-macro name="mainvalues"/>
241 </computed_discharge_curve> 246 </computed_discharge_curve>
242 </dc:when> 247 </dc:when>
243 <dc:when test="$out = 'minfo-heights'"> 248 <dc:when test="$out = 'minfo-heights'">
244 <dc:call-macro name="minfo-heights"/> 249 <dc:call-macro name="minfo-heights"/>
245 <dc:macro name="minfo-heights">
246 <bedheights>
247 <dc:call-macro name="bed-heights-single"/>
248 <dc:call-macro name="bed-heights-epoch"/>
249 </bedheights>
250 </dc:macro>
251 </dc:when> 250 </dc:when>
252 <dc:when test="$out = 'minfo-heights-epoch'"> 251 <dc:when test="$out = 'minfo-heights-epoch'">
253 <bedheights> 252 <bedheights>
254 <dc:call-macro name="bed-heights-epoch"/> 253 <dc:call-macro name="bed-heights-epoch"/>
255 </bedheights> 254 </bedheights>
256 </dc:when> 255 </dc:when>
257 <dc:when test="$out = 'waterlevels'"> 256 <dc:when test="$out = 'waterlevels'">
258 <dc:if test="current-state-id != 'state.winfo.uesk.wsp'"> 257 <dc:if test="$current-state-id != 'state.winfo.uesk.wsp'">
259 <dc:call-macro name="basedata_0"/> 258 <dc:call-macro name="basedata_0"/>
260 <dc:call-macro name="basedata_1_additionals"/> 259 <dc:call-macro name="basedata_1_additionals"/>
261 <dc:call-macro name="basedata_2_fixations"/> 260 <dc:call-macro name="basedata_2_fixations"/>
262 <dc:call-macro name="basedata_4_heightmarks-points"/> 261 <dc:call-macro name="basedata_4_heightmarks-points"/>
263 <dc:call-macro name="basedata_5_flood-protections"/> 262 <dc:call-macro name="basedata_5_flood-protections"/>
270 </dc:call-macro> 269 </dc:call-macro>
271 </dc:call-macro> 270 </dc:call-macro>
272 </dc:macro> 271 </dc:macro>
273 272
274 <dc:macro name="generate-user-content"> 273 <dc:macro name="generate-user-content">
275 <dc:call-macro name="user-range"> 274 <dc:call-macro name="artifact-range">
276 <dc:call-macro name="km-filtered-userdata"> 275 <dc:call-macro name="all-user-artifacts">
277 <dc:choose> 276 <dc:call-macro name="km-filtered-user-artifacts">
278 <dc:when test="dc:contains($parameters, 'recommended')"> 277 <dc:choose>
279 <dc:comment> 278 <dc:when test="dc:contains($parameters, 'recommended')">
280 Recommendations (client shall load immediately). 279 <dc:comment>
281 </dc:comment> 280 Recommendations (user)
282 <dc:iterate var="out" container="artifact-outs"> 281 </dc:comment>
283 <dc:choose> 282 <dc:iterate var="out" container="artifact-outs">
284 <dc:when test="$out = 'longitudinal_section'"> 283 <dc:choose>
285 <dc:call-macro name="officiallines_user"/> 284 <dc:when test="$out = 'longitudinal_section'">
286 </dc:when> 285 <dc:call-macro name="officiallines_user"/>
287 </dc:choose> 286 </dc:when>
288 </dc:iterate> 287 </dc:choose>
289 </dc:when> 288 </dc:iterate>
290 <dc:otherwise> 289 </dc:when>
291 <dc:comment> 290 <dc:otherwise>
292 Non Recommendations 291 <dc:comment>
293 </dc:comment> 292 Non Recommendations (user)
294 <dc:iterate var="out" container="artifact-outs"> 293 </dc:comment>
295 <dc:choose> 294 <dc:iterate var="out" container="artifact-outs">
296 <dc:when test="$out = 'longitudinal_section'"> 295 <dc:choose>
297 <dc:call-macro name="longitudinal"/> 296 <dc:when test="$out = 'longitudinal_section'">
298 <dc:call-macro name="differences"/> 297 <dc:call-macro name="longitudinal"/>
299 </dc:when> 298 <dc:call-macro name="differences"/>
300 <dc:when test="$out = 'discharge_longitudinal_section'"> 299 </dc:when>
301 <dc:call-macro name="longitudinal"/> 300 <dc:when test="$out = 'discharge_longitudinal_section'">
302 <dc:call-macro name="differences"/> 301 <dc:call-macro name="longitudinal"/>
303 </dc:when> 302 <dc:call-macro name="differences"/>
304 <dc:when test="$out = 'w_differences'"> 303 </dc:when>
305 <dc:call-macro name="longitudinal"/> 304 <dc:when test="$out = 'w_differences'">
306 <dc:call-macro name="differences"/> 305 <dc:call-macro name="longitudinal"/>
307 </dc:when> 306 <dc:call-macro name="differences"/>
308 <dc:when test="$out = 'fix_deltawt_curve'"> 307 </dc:when>
309 <dc:call-macro name="delta-wt"/> 308 <dc:when test="$out = 'fix_deltawt_curve'">
310 </dc:when> 309 <dc:call-macro name="delta-wt"/>
311 <dc:when test="$out = 'reference_curve'"> 310 </dc:when>
312 <dc:call-macro name="reference-curves"/> 311 <dc:when test="$out = 'reference_curve'">
313 </dc:when> 312 <dc:call-macro name="reference-curves"/>
314 <dc:when test="$out = 'computed_discharge_curve'"> 313 </dc:when>
315 <dc:call-macro name="computed-discharge-curve"/> 314 <dc:when test="$out = 'computed_discharge_curve'">
316 </dc:when> 315 <dc:call-macro name="computed-discharge-curve"/>
317 <dc:when test="$out = 'cross_section'"> 316 </dc:when>
318 <dc:call-macro name="waterlevels"/> 317 <dc:when test="$out = 'cross_section'">
319 </dc:when> 318 <dc:call-macro name="waterlevels"/>
320 <dc:when test="$out = 'fix_longitudinal_section_curve'"> 319 </dc:when>
321 <dc:call-macro name="longitudinal-section"/> 320 <dc:when test="$out = 'fix_longitudinal_section_curve'">
322 </dc:when> 321 <dc:call-macro name="longitudinal-section"/>
323 <dc:when test="$out = 'fix_derivate_curve'"> 322 </dc:when>
324 <dc:call-macro name="fix-derivate-curve"/> 323 <dc:when test="$out = 'fix_derivate_curve'">
325 </dc:when> 324 <dc:call-macro name="fix-derivate-curve"/>
326 <dc:when test="$out = 'fix_wq_curve'"> 325 </dc:when>
327 <dc:call-macro name="fix-wq-curve"/> 326 <dc:when test="$out = 'fix_wq_curve'">
328 </dc:when> 327 <dc:call-macro name="fix-wq-curve"/>
329 <dc:when test="$out = 'duration_curve'"> 328 </dc:when>
330 <dc:call-macro name="duration-curve"/> 329 <dc:when test="$out = 'duration_curve'">
331 </dc:when> 330 <dc:call-macro name="duration-curve"/>
332 <dc:when test="$out = 'waterlevels'"> 331 </dc:when>
333 <dc:call-macro name="waterlevels-fix"/> 332 <dc:when test="$out = 'waterlevels'">
334 </dc:when> 333 <dc:call-macro name="waterlevels-fix"/>
335 <dc:when test="$out = 'fix_wq_curve'"> 334 </dc:when>
336 <dc:call-macro name="waterlevels-fix"/> 335 <dc:when test="$out = 'fix_wq_curve'">
337 </dc:when> 336 <dc:call-macro name="waterlevels-fix"/>
338 <dc:when test="$out = 'floodmap'"> 337 </dc:when>
339 <dc:call-macro name="flood-map"/> 338 <dc:when test="$out = 'floodmap'">
340 </dc:when> 339 <dc:call-macro name="flood-map"/>
341 <dc:when test="$out = 'map'"> 340 </dc:when>
342 <dc:call-macro name="flood-map"/> 341 <dc:when test="$out = 'map'">
343 </dc:when> 342 <dc:call-macro name="flood-map"/>
344 <dc:when test="$out = 'bedheight_middle'"> 343 </dc:when>
345 <dc:call-macro name="waterlevels-discharge"/> 344 <dc:when test="$out = 'bedheight_middle'">
346 <dc:call-macro name="waterlevels-fix"/> 345 <dc:call-macro name="waterlevels-discharge"/>
347 </dc:when> 346 <dc:call-macro name="waterlevels-fix"/>
348 <dc:when test="$out = 'floodmap-hws'"> 347 </dc:when>
349 <dc:call-macro name="floodmap-hws-user"/> 348 <dc:when test="$out = 'floodmap-hws'">
350 </dc:when> 349 <dc:call-macro name="floodmap-hws-user"/>
351 <dc:when test="$out = 'flow_velocity'"> 350 </dc:when>
352 <dc:call-macro name="bedquality-bed"/> 351 <dc:when test="$out = 'flow_velocity'">
353 <dc:call-macro name="bedquality-load"/> 352 <dc:call-macro name="bedquality-bed"/>
354 </dc:when> 353 <dc:call-macro name="bedquality-load"/>
355 <dc:when test="$out = 'bed_longitudinal_section'"> 354 </dc:when>
356 <dc:call-macro name="bedquality-bed"/> 355 <dc:when test="$out = 'bed_longitudinal_section'">
357 <dc:call-macro name="bedquality-load"/> 356 <dc:call-macro name="bedquality-bed"/>
358 <dc:call-macro name="bedquality-density"/> 357 <dc:call-macro name="bedquality-load"/>
359 <dc:call-macro name="bedquality-porosity"/> 358 <dc:call-macro name="bedquality-density"/>
360 </dc:when> 359 <dc:call-macro name="bedquality-porosity"/>
361 <dc:when test="$out = 'sedimentload_ls'"> 360 </dc:when>
362 <dc:call-macro name="differences"/> 361 <dc:when test="$out = 'sedimentload_ls'">
363 <dc:call-macro name="bedheight-differences"/> 362 <dc:call-macro name="differences"/>
364 <dc:call-macro name="flow-velocity"/> 363 <dc:call-macro name="bedheight-differences"/>
365 <dc:call-macro name="sediment-load"/> 364 <dc:call-macro name="flow-velocity"/>
366 </dc:when> 365 <dc:call-macro name="sediment-load"/>
367 <dc:when test="$out = 'bed_difference_year'"> 366 </dc:when>
368 <dc:call-macro name="waterlevels-discharge"/> 367 <dc:when test="$out = 'bed_difference_year'">
369 <dc:call-macro name="bedheight-differences"/> 368 <dc:call-macro name="waterlevels-discharge"/>
370 <dc:call-macro name="differences"/> 369 <dc:call-macro name="bedheight-differences"/>
371 <dc:call-macro name="waterlevels-fix"/> 370 <dc:call-macro name="differences"/>
372 <dc:call-macro name="delta-wt-ls"/> 371 <dc:call-macro name="waterlevels-fix"/>
373 </dc:when> 372 <dc:call-macro name="delta-wt-ls"/>
374 <dc:when test="$out = 'bed_difference_epoch'"> 373 </dc:when>
375 <dc:call-macro name="waterlevels-discharge"/> 374 <dc:when test="$out = 'bed_difference_epoch'">
376 <dc:call-macro name="bedheight-differences"/> 375 <dc:call-macro name="waterlevels-discharge"/>
377 <dc:call-macro name="differences"/> 376 <dc:call-macro name="bedheight-differences"/>
378 <dc:call-macro name="waterlevels-fix"/> 377 <dc:call-macro name="differences"/>
379 <dc:call-macro name="delta-wt-ls"/> 378 <dc:call-macro name="waterlevels-fix"/>
380 </dc:when> 379 <dc:call-macro name="delta-wt-ls"/>
381 </dc:choose> 380 </dc:when>
382 </dc:iterate> 381 </dc:choose>
383 </dc:otherwise> 382 </dc:iterate>
384 </dc:choose> 383 </dc:otherwise>
384 </dc:choose>
385 </dc:call-macro>
385 </dc:call-macro> 386 </dc:call-macro>
386 </dc:call-macro> 387 </dc:call-macro>
387 </dc:macro> 388 </dc:macro>
388 389
389 <!-- Macros to load user data --> 390 <!-- Macros to load user data -->
390 391
391 <dc:macro name="select-facets">
392 <dc:context>
393 <dc:statement>
394 SELECT a.gid AS aid,
395 f.id AS fid,
396 f.name AS facet_name,
397 f.num AS facet_num,
398 f.description AS facet_description
399 FROM artifacts a
400 JOIN outs o ON o.artifact_id = a.id
401 JOIN facets f ON f.out_id = o.id
402 WHERE a.id = ${a_id}
403 AND f.name = ${facet_type}
404 </dc:statement>
405 <dc:if test="dc:has-result()">
406 <dc:macro-body/>
407 </dc:if>
408 </dc:context>
409 </dc:macro>
410
411 <dc:macro name="differences"> 392 <dc:macro name="differences">
412 <dc:variable name="facet_type" value="w_differences"/> 393 <dc:filter expr="$facet_name = 'w_differences'">
413 <dc:call-macro name="select-facets"> 394 <dc:if test="dc:has-result()">
414 <differences> 395 <differences>
415 <dc:for-each> 396 <dc:for-each>
416 <w_differences 397 <w_differences
417 description="{$facet_description}" 398 description="{$facet_description}"
418 factory="winfo" 399 factory="winfo" target_out="{$out}"
419 artifact-id="{$aid}" 400 artifact-id="{$aid}"
420 ids="{$aid}" 401 ids="{$aid}"
421 out="w_differences"/> 402 out="w_differences"/>
422 </dc:for-each> 403 </dc:for-each>
423 </differences> 404 </differences>
424 </dc:call-macro> 405 </dc:if>
406 </dc:filter>
425 </dc:macro> 407 </dc:macro>
426 408
427 <dc:macro name="reference-curves"> 409 <dc:macro name="reference-curves">
428 <dc:variable name="facet_type" value="reference_curve"/> 410 <dc:filter expr="$facet_name = 'reference_curve'">
429 <dc:call-macro name="select-facets"> 411 <dc:if test="dc:has-result()">
430 <reference_curves> 412 <reference_curves>
431 <dc:for-each> 413 <dc:for-each>
432 <dc:element name="${facet_name}"> 414 <dc:element name="${facet_name}">
433 <dc:attribute name="description" value="${facet_description}"/> 415 <dc:attribute name="description" value="${facet_description}"/>
434 <dc:attribute name="factory" value="winfo"/> 416 <dc:attribute name="factory" value="winfo"/>
435 <dc:attribute name="artifact-id" value="${aid}"/> 417 <dc:attribute name="target_out" value="${out}"/>
436 <dc:attribute name="ids" value="${aid}"/> 418 <dc:attribute name="artifact-id" value="${a_id}"/>
437 <dc:attribute name="out" value="reference_curve"/> 419 <dc:attribute name="ids" value="${a_id}"/>
438 </dc:element> 420 <dc:attribute name="out" value="reference_curve"/>
439 </dc:for-each> 421 </dc:element>
440 </reference_curves> 422 </dc:for-each>
441 </dc:call-macro> 423 </reference_curves>
424 </dc:if>
425 </dc:filter>
442 </dc:macro> 426 </dc:macro>
443 427
444 <dc:macro name="computed-discharge-curve"> 428 <dc:macro name="computed-discharge-curve">
445 <dc:variable name="facet_type" value="computed_discharge_curve.q"/> 429 <dc:filter expr="$facet_name = 'computed_discharge_curve.q'">
446 <dc:call-macro name="select-facets">
447 <computed_discharge_curves>
448 <dc:for-each>
449 <dc:element name="${facet_name}">
450 <dc:attribute name="description" value="${facet_description}"/>
451 <dc:attribute name="factory" value="winfo"/>
452 <dc:attribute name="artifact-id" value="${aid}"/>
453 <dc:attribute name="ids" value="${aid}"/>
454 <dc:attribute name="out" value="computed_discharge_curve"/>
455 </dc:element>
456 </dc:for-each>
457 </computed_discharge_curves>
458 </dc:call-macro>
459 </dc:macro>
460
461 <dc:macro name="flood-map">
462 <dc:variable name="facet_type" value="floodmap.wsplgen"/>
463 <dc:call-macro name="select-facets">
464 <floodmap>
465 <dc:for-each>
466 <dc:element name="${facet_name}">
467 <dc:attribute name="description" value="${facet_description}"/>
468 <dc:attribute name="factory" value="winfo"/>
469 <dc:attribute name="artifact-id" value="${aid}"/>
470 <dc:attribute name="ids" value="${aid}"/>
471 <dc:attribute name="out" value="floodmap"/>
472 </dc:element>
473 </dc:for-each>
474 </floodmap>
475 </dc:call-macro>
476 </dc:macro>
477
478 <dc:macro name="waterlevels">
479 <dc:context>
480 <dc:statement>
481 SELECT id AS out_id
482 FROM outs
483 WHERE artifact_id = ${a_id} AND name = 'cross_section'
484 </dc:statement>
485 <dc:if test="dc:has-result()">
486 <waterlevels>
487 <dc:for-each>
488 <dc:context>
489 <dc:statement>
490 SELECT name AS facet_name, num AS facet_num, description AS facet_description
491 FROM facets
492 WHERE out_id = ${out_id}
493 ORDER BY num ASC, name DESC
494 </dc:statement>
495 <longitudinal_section_columns description="{$river} {$a_creation}">
496 <dc:for-each>
497 <dc:element name="${facet_name}">
498 <dc:attribute name="description" value="${facet_description}"/>
499 <dc:attribute name="ids" value="${facet_num}"/>
500 <dc:attribute name="factory" value="winfo"/>
501 <dc:attribute name="artifact-id" value="${a_gid}"/>
502 <dc:attribute name="out" value="cross_section"/>
503 </dc:element>
504 </dc:for-each>
505 </longitudinal_section_columns>
506 </dc:context>
507 </dc:for-each>
508 </waterlevels>
509 </dc:if>
510 </dc:context>
511 </dc:macro>
512
513 <dc:macro name="longitudinal">
514 <dc:context>
515 <dc:statement>
516 SELECT id AS out_id
517 FROM outs
518 WHERE artifact_id = ${a_id}
519 AND name = 'longitudinal_section'
520 </dc:statement>
521 <dc:if test="dc:has-result()">
522 <waterlevels>
523 <dc:for-each>
524 <dc:context>
525 <dc:statement>
526 SELECT name AS facet_name,
527 num AS facet_num,
528 description AS facet_description
529 FROM facets
530 WHERE out_id = ${out_id}
531 ORDER BY num ASC, name DESC
532 </dc:statement>
533 <longitudinal_section_columns description="{$river} {$a_creation}">
534 <dc:for-each>
535 <dc:element name="${facet_name}">
536 <dc:attribute name="description" value="${facet_description}"/>
537 <dc:attribute name="ids" value="${facet_num}"/>
538 <dc:attribute name="factory" value="winfo"/>
539 <dc:attribute name="artifact-id" value="${a_gid}"/>
540 <dc:attribute name="out" value="longitudinal_section"/>
541 </dc:element>
542 </dc:for-each>
543 </longitudinal_section_columns>
544 </dc:context>
545 </dc:for-each>
546 </waterlevels>
547 </dc:if>
548 </dc:context>
549 </dc:macro>
550
551 <dc:macro name="longitudinal-section">
552 <dc:context>
553 <dc:statement>
554 SELECT id AS out_id
555 FROM outs
556 WHERE artifact_id = ${a_id}
557 AND name = 'fix_longitudinal_section_curve'
558 </dc:statement>
559 <dc:if test="dc:has-result()">
560 <waterlevels>
561 <dc:for-each>
562 <dc:context>
563 <dc:statement>
564 SELECT name AS facet_name,
565 num AS facet_num,
566 description AS facet_description
567 FROM facets
568 WHERE out_id = ${out_id} AND (
569 name LIKE 'fix_deviation_ls%' OR
570 name LIKE 'fix_sector_average_ls%' OR
571 name LIKE 'fix_analysis_events_ls%' OR
572 name LIKE 'fix_reference_events_ls%')
573 ORDER BY num ASC, name DESC
574 </dc:statement>
575 <waterlevels description="{$river} {$a_creation} {$collection_name}">
576 <dc:for-each>
577 <dc:element name="${facet_name}">
578 <dc:attribute name="description" value="${facet_description}"/>
579 <dc:attribute name="ids" value="${facet_num}"/>
580 <dc:attribute name="factory" value="fixanalysis"/>
581 <dc:attribute name="artifact-id" value="${a_gid}"/>
582 <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
583 </dc:element>
584 </dc:for-each>
585 </waterlevels>
586 </dc:context>
587 </dc:for-each>
588 </waterlevels>
589 </dc:if>
590 </dc:context>
591 </dc:macro>
592
593 <dc:macro name="delta-wt">
594 <dc:context>
595 <dc:statement>
596 SELECT id AS out_id
597 FROM outs
598 WHERE artifact_id = ${a_id}
599 AND name = 'fix_deltawt_curve'
600 </dc:statement>
601 <dc:if test="dc:has-result()">
602 <waterlevels>
603 <dc:for-each>
604 <dc:context>
605 <dc:statement>
606 SELECT name AS facet_name,
607 num AS facet_num,
608 description AS facet_description
609 FROM facets
610 WHERE out_id = ${out_id} and (
611 name LIKE 'fix_sector_average_dwt%' OR
612 name LIKE 'fix_deviation_dwt%' OR
613 name = 'fix_analysis_events_dwt' OR
614 name = 'fix_reference_events_dwt' OR
615 name = 'fix_analysis_periods_dwt')
616 ORDER BY num ASC, name DESC
617 </dc:statement>
618 <waterlevels description="{$river} {$a_creation} {$collection_name}">
619 <dc:for-each>
620 <dc:element name="${facet_name}">
621 <dc:attribute name="description" value="${facet_description}"/>
622 <dc:attribute name="ids" value="${facet_num}"/>
623 <dc:attribute name="factory" value="fixanalysis"/>
624 <dc:attribute name="artifact-id" value="${a_gid}"/>
625 <dc:attribute name="out" value="fix_deltawt_curve"/>
626 </dc:element>
627 </dc:for-each>
628 </waterlevels>
629 </dc:context>
630 </dc:for-each>
631 </waterlevels>
632 </dc:if>
633 </dc:context>
634 </dc:macro>
635
636 <dc:macro name="delta-wt-ls">
637 <dc:context>
638 <dc:statement>
639 SELECT id AS out_id
640 FROM outs
641 WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve'
642 </dc:statement>
643 <dc:if test="dc:has-result()">
644 <waterlevels>
645 <dc:for-each>
646 <dc:context>
647 <dc:statement>
648 SELECT name AS facet_name, num AS facet_num, description AS facet_description
649 FROM facets
650 WHERE out_id = ${out_id} and (
651 name LIKE 'fix_sector_average_dwt%' OR
652 name LIKE 'fix_deviation_dwt%')
653 ORDER BY num ASC, name DESC
654 </dc:statement>
655 <waterlevels description="{$river} {$a_creation} {$collection_name}">
656 <dc:for-each>
657 <dc:element name="${facet_name}">
658 <dc:attribute name="description" value="${facet_description}"/>
659 <dc:attribute name="ids" value="${facet_num}"/>
660 <dc:attribute name="factory" value="fixanalysis"/>
661 <dc:attribute name="artifact-id" value="${a_gid}"/>
662 <dc:attribute name="out" value="fix_deltawt_curve"/>
663 </dc:element>
664 </dc:for-each>
665 </waterlevels>
666 </dc:context>
667 </dc:for-each>
668 </waterlevels>
669 </dc:if>
670 </dc:context>
671 </dc:macro>
672
673 <dc:macro name="fix-derivate-curve">
674 <dc:context>
675 <dc:statement>
676 SELECT id AS out_id
677 FROM outs
678 WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve'
679 </dc:statement>
680 <dc:if test="dc:has-result()">
681 <waterlevels>
682 <dc:for-each>
683 <dc:context>
684 <dc:statement>
685 SELECT name AS facet_name, num AS facet_num, description AS facet_description
686 FROM facets
687 WHERE out_id = ${out_id} and name = 'fix_derivate_curve'
688 ORDER BY num ASC, name DESC
689 </dc:statement>
690 <waterlevels description="{$river} {$a_creation} {$collection_name}">
691 <dc:for-each>
692 <dc:element name="${facet_name}">
693 <dc:attribute name="description" value="${facet_description}"/>
694 <dc:attribute name="ids" value="${facet_num}"/>
695 <dc:attribute name="factory" value="fixanalysis"/>
696 <dc:attribute name="artifact-id" value="${a_gid}"/>
697 <dc:attribute name="out" value="fix_derivate_curve"/>
698 </dc:element>
699 </dc:for-each>
700 </waterlevels>
701 </dc:context>
702 </dc:for-each>
703 </waterlevels>
704 </dc:if>
705 </dc:context>
706 </dc:macro>
707
708 <dc:macro name="fix-wq-curve">
709 <dc:context>
710 <dc:statement>
711 SELECT id AS out_id
712 FROM outs
713 WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve'
714 </dc:statement>
715 <dc:if test="dc:has-result()">
716 <waterlevels>
717 <dc:for-each>
718 <dc:context>
719 <dc:statement>
720 SELECT name AS facet_name, num AS facet_num, description AS facet_description
721 FROM facets
722 WHERE out_id = ${out_id} and (
723 name LIKE 'fix_sector_average_wq%' OR
724 name = 'fix_wq_curve' OR
725 name LIKE 'fix_analysis_events_wq%' OR
726 name LIKE 'fix_reference_events_wq%' )
727 ORDER BY num ASC, name DESC
728 </dc:statement>
729 <waterlevels description="{$river} {$a_creation} {$collection_name}">
730 <dc:for-each>
731 <dc:element name="${facet_name}">
732 <dc:attribute name="description" value="${facet_description}"/>
733 <dc:attribute name="ids" value="${facet_num}"/>
734 <dc:attribute name="factory" value="fixanalysis"/>
735 <dc:attribute name="artifact-id" value="${a_gid}"/>
736 <dc:attribute name="out" value="fix_wq_curve"/>
737 </dc:element>
738 </dc:for-each>
739 </waterlevels>
740 </dc:context>
741 </dc:for-each>
742 </waterlevels>
743 </dc:if>
744 </dc:context>
745 </dc:macro>
746
747 <dc:macro name="duration-curve">
748 <dc:context>
749 <dc:statement>
750 SELECT a.gid AS aid,
751 f.id AS fid,
752 f.name AS facet_name,
753 f.num AS facet_num,
754 f.description AS facet_description
755 FROM outs AS o, facets AS f, artifacts AS a
756 WHERE
757 (f.name = 'duration_curve.q' OR f.name = 'duration_curve.w') AND
758 f.out_id = o.id AND
759 o.artifact_id = ${a_id} AND
760 a.id = ${a_id}
761 </dc:statement>
762 <dc:if test="dc:has-result()"> 430 <dc:if test="dc:has-result()">
763 <computed_discharge_curves> 431 <computed_discharge_curves>
764 <dc:for-each> 432 <dc:for-each>
765 <dc:element name="${facet_name}"> 433 <dc:element name="${facet_name}">
766 <dc:attribute name="description" value="${facet_description}"/> 434 <dc:attribute name="description" value="${facet_description}"/>
767 <dc:attribute name="factory" value="winfo"/> 435 <dc:attribute name="factory" value="winfo"/>
768 <dc:attribute name="artifact-id" value="${aid}"/> 436 <dc:attribute name="target_out" value="${out}"/>
769 <dc:attribute name="ids" value="${aid}"/> 437 <dc:attribute name="artifact-id" value="${a_id}"/>
438 <dc:attribute name="ids" value="${a_id}"/>
439 <dc:attribute name="out" value="computed_discharge_curve"/>
440 </dc:element>
441 </dc:for-each>
442 </computed_discharge_curves>
443 </dc:if>
444 </dc:filter>
445 </dc:macro>
446
447 <dc:macro name="flood-map">
448 <dc:filter expr="$facet_name = 'floodmap.wsplgen'">
449 <dc:if test="dc:has-result()">
450 <floodmap>
451 <dc:for-each>
452 <dc:variable name="combined_desc" expr="concat($facet_description, ' ', $a_creation, ' ', $collection_name)"/>
453 <dc:element name="${facet_name}">
454 <dc:attribute name="description" value="${combined_desc}"/>
455 <dc:attribute name="factory" value="winfo"/>
456 <dc:attribute name="target_out" value="${out}"/>
457 <dc:attribute name="artifact-id" value="${a_id}"/>
458 <dc:attribute name="ids" value="${a_id}"/>
459 <dc:attribute name="out" value="floodmap"/>
460 </dc:element>
461 </dc:for-each>
462 </floodmap>
463 </dc:if>
464 </dc:filter>
465 </dc:macro>
466
467 <dc:macro name="waterlevels">
468 <dc:filter expr="$out_name = 'cross_section'">
469 <dc:if test="dc:has-result()">
470 <waterlevels>
471 <dc:group expr="concat($river, ' ', $a_creation)">
472 <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment>
473 <longitudinal_section_columns description="{dc:group-key()}">
474 <dc:for-each>
475 <dc:element name="${facet_name}">
476 <dc:attribute name="description" value="${facet_description}"/>
477 <dc:attribute name="ids" value="${facet_num}"/>
478 <dc:attribute name="factory" value="winfo"/>
479 <dc:attribute name="target_out" value="${out}"/>
480 <dc:attribute name="artifact-id" value="${a_gid}"/>
481 <dc:attribute name="out" value="cross_section"/>
482 </dc:element>
483 </dc:for-each>
484 </longitudinal_section_columns>
485 </dc:group>
486 </waterlevels>
487 </dc:if>
488 </dc:filter>
489 </dc:macro>
490
491 <dc:macro name="longitudinal">
492 <dc:filter expr="$out_name = 'longitudinal_section'">
493 <dc:if test="dc:has-result()">
494 <waterlevels>
495 <dc:group expr="concat($river, ' ', $a_creation)">
496 <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment>
497 <longitudinal_section_columns description="{dc:group-key()}">
498 <dc:for-each>
499 <dc:element name="${facet_name}">
500 <dc:attribute name="description" value="${facet_description}"/>
501 <dc:attribute name="ids" value="${facet_num}"/>
502 <dc:attribute name="factory" value="winfo"/>
503 <dc:attribute name="target_out" value="${out}"/>
504 <dc:attribute name="artifact-id" value="${a_gid}"/>
505 <dc:attribute name="out" value="longitudinal_section"/>
506 </dc:element>
507 </dc:for-each>
508 </longitudinal_section_columns>
509 </dc:group>
510 </waterlevels>
511 </dc:if>
512 </dc:filter>
513 </dc:macro>
514
515 <dc:macro name="longitudinal-section">
516 <dc:filter expr="$out_name = 'fix_longitudinal_section_curve' and
517 (starts-with($facet_name, 'fix_deviation_ls') or
518 starts-with($facet_name, 'fix_sector_average_ls') or
519 starts-with($facet_name, 'fix_analysis_events_ls') or
520 starts-with($facet_name, 'fix_reference_events_ls'))">
521 <dc:if test="dc:has-result()">
522 <waterlevels>
523 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
524 <waterlevels description="{dc:group-key()}">
525 <dc:for-each>
526 <dc:element name="${facet_name}">
527 <dc:attribute name="description" value="${facet_description}"/>
528 <dc:attribute name="ids" value="${facet_num}"/>
529 <dc:attribute name="factory" value="fixanalysis"/>
530 <dc:attribute name="target_out" value="${out}"/>
531 <dc:attribute name="artifact-id" value="${a_gid}"/>
532 <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
533 </dc:element>
534 </dc:for-each>
535 </waterlevels>
536 </dc:group>
537 </waterlevels>
538 </dc:if>
539 </dc:filter>
540 </dc:macro>
541
542 <dc:macro name="delta-wt">
543 <dc:filter expr="$out_name = 'fix_deltawt_curve' and
544 ($facet_name = 'fix_analysis_events_dwt' or
545 $facet_name = 'fix_analysis_periods_dwt' or
546 $facet_name = 'fix_reference_events_dwt' or
547 starts-with($facet_name, 'fix_deviation_dwt') or
548 starts-with($facet_name, 'fix_sector_average_dwt'))">
549 <dc:if test="dc:has-result()">
550 <waterlevels>
551 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
552 <waterlevels description="{dc:group-key()}">
553 <dc:for-each>
554 <dc:element name="${facet_name}">
555 <dc:attribute name="description" value="${facet_description}"/>
556 <dc:attribute name="ids" value="${facet_num}"/>
557 <dc:attribute name="factory" value="fixanalysis"/>
558 <dc:attribute name="target_out" value="${out}"/>
559 <dc:attribute name="artifact-id" value="${a_gid}"/>
560 <dc:attribute name="out" value="fix_deltawt_curve"/>
561 </dc:element>
562 </dc:for-each>
563 </waterlevels>
564 </dc:group>
565 </waterlevels>
566 </dc:if>
567 </dc:filter>
568 </dc:macro>
569
570 <dc:macro name="delta-wt-ls">
571 <dc:filter expr="$out_name = 'fix_deltawt_curve' and
572 (starts-with($facet_name, 'fix_sector_average_dwt') or
573 starts-with($facet_name, 'fix_deviation_dwt'))">
574 <dc:if test="dc:has-result()">
575 <waterlevels>
576 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
577 <waterlevels description="{dc:group-key()}">
578 <dc:for-each>
579 <dc:element name="${facet_name}">
580 <dc:attribute name="description" value="${facet_description}"/>
581 <dc:attribute name="ids" value="${facet_num}"/>
582 <dc:attribute name="factory" value="fixanalysis"/>
583 <dc:attribute name="target_out" value="${out}"/>
584 <dc:attribute name="artifact-id" value="${a_gid}"/>
585 <dc:attribute name="out" value="fix_deltawt_curve"/>
586 </dc:element>
587 </dc:for-each>
588 </waterlevels>
589 </dc:group>
590 </waterlevels>
591 </dc:if>
592 </dc:filter>
593 </dc:macro>
594
595 <dc:macro name="fix-derivate-curve">
596 <dc:filter expr="$out_name = 'fix_derivate_curve' and $facet_name = 'fix_derivate_curve'">
597 <dc:if test="dc:has-result()">
598 <waterlevels>
599 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
600 <waterlevels description="{dc:group-key()}">
601 <dc:for-each>
602 <dc:element name="${facet_name}">
603 <dc:attribute name="description" value="${facet_description}"/>
604 <dc:attribute name="ids" value="${facet_num}"/>
605 <dc:attribute name="factory" value="fixanalysis"/>
606 <dc:attribute name="target_out" value="${out}"/>
607 <dc:attribute name="artifact-id" value="${a_gid}"/>
608 <dc:attribute name="out" value="fix_derivate_curve"/>
609 </dc:element>
610 </dc:for-each>
611 </waterlevels>
612 </dc:group>
613 </waterlevels>
614 </dc:if>
615 </dc:filter>
616 </dc:macro>
617
618 <dc:macro name="fix-wq-curve">
619 <dc:filter expr="$out_name = 'fix_wq_curve' and
620 (starts-with($facet_name, 'fix_analysis_events_wq') or
621 starts-with($facet_name, 'fix_reference_events_wq') or
622 starts-with($facet_name, 'fix_sector_average_wq') or
623 $facet_name = 'fix_wq_curve')">
624 <dc:if test="dc:has-result()">
625 <waterlevels>
626 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
627 <waterlevels description="{dc:group-key()}">
628 <dc:for-each>
629 <dc:element name="${facet_name}">
630 <dc:attribute name="description" value="${facet_description}"/>
631 <dc:attribute name="ids" value="${facet_num}"/>
632 <dc:attribute name="factory" value="fixanalysis"/>
633 <dc:attribute name="target_out" value="${out}"/>
634 <dc:attribute name="artifact-id" value="${a_gid}"/>
635 <dc:attribute name="out" value="fix_wq_curve"/>
636 </dc:element>
637 </dc:for-each>
638 </waterlevels>
639 </dc:group>
640 </waterlevels>
641 </dc:if>
642 </dc:filter>
643 </dc:macro>
644
645 <dc:macro name="duration-curve">
646 <dc:filter expr="$facet_name = 'duration_curve.q' or $facet_name = 'duration_curve.w'">
647 <dc:if test="dc:has-result()">
648 <computed_discharge_curves>
649 <dc:for-each>
650 <dc:element name="${facet_name}">
651 <dc:attribute name="description" value="${facet_description}"/>
652 <dc:attribute name="factory" value="winfo"/>
653 <dc:attribute name="target_out" value="${out}"/>
654 <dc:attribute name="artifact-id" value="${a_id}"/>
655 <dc:attribute name="ids" value="${a_id}"/>
770 <dc:attribute name="out" value="duration_curve"/> 656 <dc:attribute name="out" value="duration_curve"/>
771 </dc:element> 657 </dc:element>
772 </dc:for-each> 658 </dc:for-each>
773 </computed_discharge_curves> 659 </computed_discharge_curves>
774 </dc:if> 660 </dc:if>
775 </dc:context> 661 </dc:filter>
776 </dc:macro> 662 </dc:macro>
777 663
778 <dc:comment>TODO doesnt work nicely for fix/wq-diags.</dc:comment> 664 <dc:comment>TODO doesnt work nicely for fix/wq-diags. Aheinecke (27.5.2013): Why?</dc:comment>
779 <dc:macro name="waterlevels-fix"> 665 <dc:macro name="waterlevels-fix">
780 <dc:context> 666 <dc:filter expr="$out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w'">
781 <dc:statement>
782 SELECT id AS out_id
783 FROM outs
784 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
785 </dc:statement>
786 <dc:if test="dc:has-result()"> 667 <dc:if test="dc:has-result()">
787 <waterlevels> 668 <waterlevels>
788 <dc:for-each> 669 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
789 <dc:context> 670 <waterlevels description="{dc:group-key()}">
790 <dc:statement> 671 <dc:for-each>
791 SELECT name AS facet_name, num AS facet_num, description AS facet_description 672 <dc:element name="${facet_name}">
792 FROM facets 673 <dc:attribute name="description" value="${facet_description}"/>
793 WHERE out_id = ${out_id} and name = 'longitudinal_section.w' 674 <dc:attribute name="ids" value="${facet_num}"/>
794 ORDER BY num ASC, name DESC 675 <dc:attribute name="factory" value="winfo"/>
795 </dc:statement> 676 <dc:attribute name="target_out" value="${out}"/>
796 <waterlevels description="{$river} {$a_creation} {$collection_name}"> 677 <dc:attribute name="artifact-id" value="${a_gid}"/>
797 <dc:for-each> 678 <dc:attribute name="out" value="longitudinal_section"/>
798 <dc:element name="${facet_name}"> 679 </dc:element>
799 <dc:attribute name="description" value="${facet_description}"/> 680 </dc:for-each>
800 <dc:attribute name="ids" value="${facet_num}"/> 681 </waterlevels>
801 <dc:attribute name="factory" value="winfo"/> 682 </dc:group>
802 <dc:attribute name="artifact-id" value="${a_gid}"/>
803 <dc:attribute name="out" value="longitudinal_section"/>
804 </dc:element>
805 </dc:for-each>
806 </waterlevels>
807 </dc:context>
808 </dc:for-each>
809 </waterlevels> 683 </waterlevels>
810 </dc:if> 684 </dc:if>
811 </dc:context> 685 </dc:filter>
812 </dc:macro> 686 </dc:macro>
813 687
814 <dc:macro name="floodmap-hws-user"> 688 <dc:macro name="floodmap-hws-user">
815 <dc:context> 689 <dc:comment>No grouping in this?</dc:comment>
816 <dc:statement> 690 <dc:filter expr="$out_name = 'floodmap' and $facet_name = 'floodmap.usershape'">
817 SELECT id AS out_id 691 <own-hws>
818 FROM outs 692 <dc:for-each>
819 WHERE artifact_id = ${a_id} AND name = 'floodmap' 693 <dc:element name="${facet_name}">
820 </dc:statement> 694 <dc:attribute name="description" value="${facet_description}"/>
821 <dc:for-each> 695 <dc:attribute name="ids" value="${facet_num}"/>
822 <dc:context> 696 <dc:attribute name="factory" value="winfo"/>
823 <dc:statement> 697 <dc:attribute name="target_out" value="${out}"/>
824 SELECT name AS facet_name, 698 <dc:attribute name="artifact-id" value="${a_gid}"/>
825 num AS facet_num, 699 <dc:attribute name="out" value="floodmap"/>
826 description AS facet_description 700 </dc:element>
827 FROM facets 701 </dc:for-each>
828 WHERE out_id = ${out_id} AND name = 'floodmap.usershape' 702 </own-hws>
829 ORDER BY num ASC, name DESC 703 </dc:filter>
830 </dc:statement>
831 <own-hws>
832 <dc:for-each>
833 <dc:element name="${facet_name}">
834 <dc:attribute name="description" value="${facet_description}"/>
835 <dc:attribute name="ids" value="${facet_num}"/>
836 <dc:attribute name="factory" value="winfo"/>
837 <dc:attribute name="artifact-id" value="${a_gid}"/>
838 <dc:attribute name="out" value="floodmap"/>
839 </dc:element>
840 </dc:for-each>
841 </own-hws>
842 </dc:context>
843 </dc:for-each>
844 </dc:context>
845 </dc:macro> 704 </dc:macro>
846 705
847 <dc:macro name="bedquality-bed"> 706 <dc:macro name="bedquality-bed">
848 <dc:context> 707 <dc:filter expr="$out_name = 'bed_longitudinal_section' and
849 <dc:statement> 708 ($facet_name = 'bed_longitudinal_section.bed_diameter_toplayer' or
850 SELECT id AS oid 709 $facet_name = 'bed_longitudinal_section.bed_diameter_sublayer')">
851 FROM outs AS o
852 WHERE
853 o.artifact_id = ${a_id} AND
854 o.name='bed_longitudinal_section'
855 </dc:statement>
856 <dc:if test="dc:has-result()"> 710 <dc:if test="dc:has-result()">
857 <bed_quality_bed> 711 <bed_quality_bed>
858 <dc:for-each> 712 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
859 <quality-bed description="{$river} {$a_creation} {$collection_name}"> 713 <quality-bed description="{dc:group-key()}">
860 <dc:context> 714 <dc:for-each>
861 <dc:statement> 715 <dc:element name="${facet_name}">
862 SELECT a.gid AS aid, 716 <dc:attribute name="factory" value="minfo"/>
863 f.id AS fid, 717 <dc:attribute name="target_out" value="${out}"/>
864 f.name AS facet_name, 718 <dc:attribute name="description" value="${facet_description}"/>
865 f.num AS facet_num, 719 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
866 f.description AS facet_description 720 <dc:attribute name="artifact-id" value="${a_id}"/>
867 FROM outs AS o, facets AS f, artifacts AS a 721 <dc:attribute name="out" value="bed_longitudinal_section"/>
868 WHERE 722 </dc:element>
869 (f.name = 'bed_longitudinal_section.bed_diameter_toplayer' 723 </dc:for-each>
870 OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND
871 f.out_id = o.id AND
872 o.artifact_id = ${a_id} AND
873 a.id = ${a_id}
874 </dc:statement>
875 <dc:for-each>
876 <dc:element name="${facet_name}">
877 <dc:attribute name="factory" value="minfo"/>
878 <dc:attribute name="description" value="${facet_description}"/>
879 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
880 <dc:attribute name="artifact-id" value="${aid}"/>
881 <dc:attribute name="out" value="bed_longitudinal_section"/>
882 </dc:element>
883 </dc:for-each>
884 </dc:context>
885 </quality-bed> 724 </quality-bed>
886 </dc:for-each> 725 </dc:group>
887 </bed_quality_bed> 726 </bed_quality_bed>
888 </dc:if> 727 </dc:if>
889 </dc:context> 728 </dc:filter>
890 </dc:macro> 729 </dc:macro>
891 730
892 <dc:macro name="bedquality-load"> 731 <dc:macro name="bedquality-load">
893 <dc:context> 732 <dc:filter expr="$out_name = 'bed_longitudinal_section' and
894 <dc:statement> 733 $facet_name = 'bed_longitudinal_section.bedload_diameter'">
895 SELECT id AS oid
896 FROM outs AS o
897 WHERE
898 o.artifact_id = ${a_id} AND
899 o.name='bed_longitudinal_section'
900 </dc:statement>
901 <dc:if test="dc:has-result()"> 734 <dc:if test="dc:has-result()">
902 <bed_quality_load> 735 <bed_quality_load>
903 <dc:for-each> 736 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
904 <quality-load description="{$river} {$a_creation} {$collection_name}"> 737 <quality-load description="{dc:group-key()}">
905 <dc:context> 738 <dc:for-each>
906 <dc:statement> 739 <dc:element name="${facet_name}">
907 SELECT a.gid AS aid, 740 <dc:attribute name="factory" value="minfo"/>
908 f.id AS fid, 741 <dc:attribute name="target_out" value="${out}"/>
909 f.name AS facet_name, 742 <dc:attribute name="description" value="${facet_description}"/>
910 f.num AS facet_num, 743 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
911 f.description AS facet_description 744 <dc:attribute name="artifact-id" value="${a_id}"/>
912 FROM outs AS o, facets AS f, artifacts AS a 745 <dc:attribute name="out" value="bed_longitudinal_section"/>
913 WHERE 746 </dc:element>
914 f.name = 'bed_longitudinal_section.bedload_diameter' AND 747 </dc:for-each>
915 f.out_id = o.id AND
916 o.artifact_id = ${a_id} AND
917 a.id = ${a_id}
918 </dc:statement>
919 <dc:for-each>
920 <dc:element name="${facet_name}">
921 <dc:attribute name="factory" value="minfo"/>
922 <dc:attribute name="description" value="${facet_description}"/>
923 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
924 <dc:attribute name="artifact-id" value="${aid}"/>
925 <dc:attribute name="out" value="bed_longitudinal_section"/>
926 </dc:element>
927 </dc:for-each>
928 </dc:context>
929 </quality-load> 748 </quality-load>
930 </dc:for-each> 749 </dc:group>
931 </bed_quality_load> 750 </bed_quality_load>
932 </dc:if> 751 </dc:if>
933 </dc:context> 752 </dc:filter>
934 </dc:macro> 753 </dc:macro>
935 754
936 <dc:macro name="bedquality-density"> 755 <dc:macro name="bedquality-density">
937 <dc:context> 756 <dc:filter expr="$out_name = 'bed_longitudinal_section' and
938 <dc:statement> 757 ($facet_name = 'bed_longitudinal_section.sediment_density_toplayer' or
939 SELECT id AS oid 758 $facet_name = 'bed_longitudinal_section.sediment_density_sublayer')">
940 FROM outs AS o
941 WHERE
942 o.artifact_id = ${a_id} AND
943 o.name='bed_longitudinal_section'
944 </dc:statement>
945 <dc:if test="dc:has-result()"> 759 <dc:if test="dc:has-result()">
946 <bed_quality_density> 760 <bed_quality_density>
947 <dc:for-each> 761 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
948 <density description="{$river} {$a_creation} {$collection_name}"> 762 <density description="{dc:group-key()}">
949 <dc:context> 763 <dc:for-each>
950 <dc:statement> 764 <dc:element name="${facet_name}">
951 SELECT a.gid AS aid, 765 <dc:attribute name="factory" value="minfo"/>
952 f.id AS fid, 766 <dc:attribute name="target_out" value="${out}"/>
953 f.name AS facet_name, 767 <dc:attribute name="description" value="${facet_description}"/>
954 f.num AS facet_num, 768 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
955 f.description AS facet_description 769 <dc:attribute name="artifact-id" value="${a_id}"/>
956 FROM outs AS o, facets AS f, artifacts AS a 770 <dc:attribute name="out" value="bed_longitudinal_section"/>
957 WHERE 771 </dc:element>
958 (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR 772 </dc:for-each>
959 f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND
960 f.out_id = o.id AND
961 o.artifact_id = ${a_id} AND
962 a.id = ${a_id}
963 </dc:statement>
964 <dc:for-each>
965 <dc:element name="${facet_name}">
966 <dc:attribute name="factory" value="minfo"/>
967 <dc:attribute name="description" value="${facet_description}"/>
968 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
969 <dc:attribute name="artifact-id" value="${aid}"/>
970 <dc:attribute name="out" value="bed_longitudinal_section"/>
971 </dc:element>
972 </dc:for-each>
973 </dc:context>
974 </density> 773 </density>
975 </dc:for-each> 774 </dc:group>
976 </bed_quality_density> 775 </bed_quality_density>
977 </dc:if> 776 </dc:if>
978 </dc:context> 777 </dc:filter>
979 </dc:macro> 778 </dc:macro>
980 779
981 <dc:macro name="bedquality-porosity"> 780 <dc:macro name="bedquality-porosity">
982 <dc:context> 781 <dc:filter expr="$out_name = 'bed_longitudinal_section' and
983 <dc:statement> 782 ($facet_name = 'bed_longitudinal_section.porosity_toplayer' or
984 SELECT id AS oid 783 $facet_name = 'bed_longitudinal_section.porosity_sublayer')">
985 FROM outs AS o
986 WHERE
987 o.artifact_id = ${a_id} AND
988 o.name='bed_longitudinal_section'
989 </dc:statement>
990 <dc:if test="dc:has-result()"> 784 <dc:if test="dc:has-result()">
991 <bed_quality_porosity> 785 <bed_quality_porosity>
992 <dc:for-each> 786 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
993 <porosity description="{$river} {$a_creation} {$collection_name}"> 787 <porosity description="{dc:group-key()}">
994 <dc:context> 788 <dc:for-each>
995 <dc:statement> 789 <dc:element name="${facet_name}">
996 SELECT a.gid AS aid, 790 <dc:attribute name="factory" value="minfo"/>
997 f.id AS fid, 791 <dc:attribute name="target_out" value="${out}"/>
998 f.name AS facet_name, 792 <dc:attribute name="description" value="${facet_description}"/>
999 f.num AS facet_num, 793 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1000 f.description AS facet_description 794 <dc:attribute name="artifact-id" value="${a_id}"/>
1001 FROM outs AS o, facets AS f, artifacts AS a 795 <dc:attribute name="out" value="bed_longitudinal_section"/>
1002 WHERE 796 </dc:element>
1003 (f.name = 'bed_longitudinal_section.porosity_toplayer' OR 797 </dc:for-each>
1004 f.name = 'bed_longitudinal_section.porosity_sublayer') AND
1005 f.out_id = o.id AND
1006 o.artifact_id = ${a_id} AND
1007 a.id = ${a_id}
1008 </dc:statement>
1009 <dc:for-each>
1010 <dc:element name="${facet_name}">
1011 <dc:attribute name="factory" value="minfo"/>
1012 <dc:attribute name="description" value="${facet_description}"/>
1013 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1014 <dc:attribute name="artifact-id" value="${aid}"/>
1015 <dc:attribute name="out" value="bed_longitudinal_section"/>
1016 </dc:element>
1017 </dc:for-each>
1018 </dc:context>
1019 </porosity> 798 </porosity>
1020 </dc:for-each> 799 </dc:group>
1021 </bed_quality_porosity> 800 </bed_quality_porosity>
1022 </dc:if> 801 </dc:if>
1023 </dc:context> 802 </dc:filter>
1024 </dc:macro> 803 </dc:macro>
1025 804
1026 <dc:macro name="flow-velocity"> 805 <dc:macro name="flow-velocity">
1027 <dc:context> 806 <dc:filter expr="$out_name = 'flow_velocity' and
1028 <dc:statement> 807 ($facet_name = 'flow_velocity.totalchannel' or
1029 SELECT id AS oid 808 $facet_name = 'flow_velocity.mainchannel' or
1030 FROM outs AS o 809 $facet_name = 'flow_velocity.totalchannel.filtered' or
1031 WHERE 810 $facet_name = 'flow_velocity.mainchannel.filtered')">
1032 o.artifact_id = ${a_id} and o.name='flow_velocity'
1033 </dc:statement>
1034 <dc:if test="dc:has-result()"> 811 <dc:if test="dc:has-result()">
1035 <flow-velocity> 812 <flow-velocity>
1036 <dc:for-each> 813 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
1037 <flow description="{$river} {$a_creation} {$collection_name}"> 814 <flow description="{dc:group-key()}">
1038 <dc:context> 815 <dc:for-each>
1039 <dc:statement> 816 <dc:element name="${facet_name}">
1040 SELECT a.gid AS aid, 817 <dc:attribute name="factory" value="minfo"/>
1041 f.id AS fid, 818 <dc:attribute name="target_out" value="${out}"/>
1042 f.name AS facet_name, 819 <dc:attribute name="description" value="${facet_description}"/>
1043 f.num AS facet_num, 820 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1044 f.description AS facet_description 821 <dc:attribute name="artifact-id" value="${a_id}"/>
1045 FROM outs AS o, facets AS f, artifacts AS a 822 <dc:attribute name="out" value="flow_velocity"/>
1046 WHERE 823 </dc:element>
1047 (f.name = 'flow_velocity.totalchannel' OR 824 </dc:for-each>
1048 f.name = 'flow_velocity.mainchannel' OR
1049 f.name = 'flow_velocity.totalchannel.filtered' OR
1050 f.name = 'flow_velocity.mainchannel.filtered') AND
1051 f.out_id = o.id AND
1052 o.artifact_id = ${a_id} AND
1053 a.id = ${a_id}
1054 </dc:statement>
1055 <dc:for-each>
1056 <dc:element name="${facet_name}">
1057 <dc:attribute name="factory" value="minfo"/>
1058 <dc:attribute name="description" value="${facet_description}"/>
1059 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1060 <dc:attribute name="artifact-id" value="${aid}"/>
1061 <dc:attribute name="out" value="flow_velocity"/>
1062 </dc:element>
1063 </dc:for-each>
1064 </dc:context>
1065 </flow> 825 </flow>
1066 </dc:for-each> 826 </dc:group>
1067 </flow-velocity> 827 </flow-velocity>
1068 </dc:if> 828 </dc:if>
1069 </dc:context> 829 </dc:filter>
1070 </dc:macro> 830 </dc:macro>
1071 831
1072 <dc:macro name="sediment-load"> 832 <dc:macro name="sediment-load">
1073 <dc:context> 833 <dc:filter expr="$out_name = 'sedimentload_ls' and starts-with($facet_name, 'sedimentload')">
1074 <dc:statement>
1075 SELECT id AS oid
1076 FROM outs AS o
1077 WHERE
1078 o.artifact_id = ${a_id} and o.name='sedimentload_ls'
1079 </dc:statement>
1080 <dc:if test="dc:has-result()"> 834 <dc:if test="dc:has-result()">
1081 <sediment-load> 835 <sediment-load>
1082 <dc:for-each> 836 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
1083 <load description="{$river} {$a_creation} {$collection_name}"> 837 <load description="{dc:group-key()}">
1084 <dc:context> 838 <dc:for-each>
1085 <dc:statement> 839 <dc:element name="${facet_name}">
1086 SELECT a.gid AS aid, 840 <dc:attribute name="factory" value="minfo"/>
1087 f.id AS fid, 841 <dc:attribute name="target_out" value="${out}"/>
1088 f.name AS facet_name, 842 <dc:attribute name="description" value="${facet_description}"/>
1089 f.num AS facet_num, 843 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1090 f.description AS facet_description 844 <dc:attribute name="artifact-id" value="${a_id}"/>
1091 FROM outs AS o, facets AS f, artifacts AS a 845 <dc:attribute name="out" value="sedimentload_ls"/>
1092 WHERE f.name LIKE 'sedimentload%' AND 846 </dc:element>
1093 f.out_id = o.id AND 847 </dc:for-each>
1094 o.artifact_id = ${a_id} AND
1095 a.id = ${a_id}
1096 </dc:statement>
1097 <dc:for-each>
1098 <dc:element name="${facet_name}">
1099 <dc:attribute name="factory" value="minfo"/>
1100 <dc:attribute name="description" value="${facet_description}"/>
1101 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1102 <dc:attribute name="artifact-id" value="${aid}"/>
1103 <dc:attribute name="out" value="sedimentload_ls"/>
1104 </dc:element>
1105 </dc:for-each>
1106 </dc:context>
1107 </load> 848 </load>
1108 </dc:for-each> 849 </dc:group>
1109 </sediment-load> 850 </sediment-load>
1110 </dc:if> 851 </dc:if>
1111 </dc:context> 852 </dc:filter>
1112 </dc:macro> 853 </dc:macro>
1113 854
1114 <dc:macro name="bedheight-differences"> 855 <dc:macro name="bedheight-differences">
1115 <dc:context> 856 <dc:filter expr="($out_name = 'bed_difference_year' or $out_name = 'bed_difference_epoch') and
1116 <dc:statement> 857 (starts-with($facet_name, 'bedheight_difference.year') or starts-with($facet_name, 'bedheight_difference.epoch'))">
1117 SELECT id AS oid,
1118 name AS o_name
1119 FROM outs AS o
1120 WHERE
1121 o.artifact_id = ${a_id} AND
1122 (o.name = 'bed_difference_year' OR
1123 o.name = 'bed_differnece_epoch')
1124 </dc:statement>
1125 <dc:if test="dc:has-result()"> 858 <dc:if test="dc:has-result()">
1126 <bedheight-differences> 859 <bedheight-differences>
1127 <dc:for-each> 860 <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
1128 <difference description="{$river} {$a_creation} {$collection_name}"> 861 <difference description="{dc:group-key()}">
1129 <dc:context> 862 <dc:for-each>
1130 <dc:statement> 863 <dc:element name="${facet_name}">
1131 SELECT a.gid AS aid, 864 <dc:attribute name="factory" value="minfo"/>
1132 f.id AS fid, 865 <dc:attribute name="target_out" value="${out}"/>
1133 f.name AS facet_name, 866 <dc:attribute name="description" value="${facet_description}"/>
1134 f.num AS facet_num, 867 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1135 f.description AS facet_description 868 <dc:attribute name="artifact-id" value="${a_id}"/>
1136 FROM outs AS o, facets AS f, artifacts AS a 869 <dc:attribute name="out" value="${out}"/>
1137 WHERE (f.name LIKE 'bedheight_difference.year%' OR 870 </dc:element>
1138 f.name LIKE 'bedheight_difference.epoch%') AND 871 </dc:for-each>
1139 f.out_id = o.id AND
1140 o.artifact_id = ${a_id} AND
1141 a.id = ${a_id}
1142 </dc:statement>
1143 <dc:for-each>
1144 <dc:element name="${facet_name}">
1145 <dc:attribute name="factory" value="minfo"/>
1146 <dc:attribute name="description" value="${facet_description}"/>
1147 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1148 <dc:attribute name="artifact-id" value="${aid}"/>
1149 <dc:choose>
1150 <dc:when test="dc:contains($o_name, 'bed_difference_year')">
1151 <dc:attribute name="out" value="bed_difference_year"/>
1152 </dc:when>
1153 <dc:otherwise>
1154 <dc:attribute name="out" value="bed_difference_epoch"/>
1155 </dc:otherwise>
1156 </dc:choose>
1157 </dc:element>
1158 </dc:for-each>
1159 </dc:context>
1160 </difference> 872 </difference>
1161 </dc:for-each> 873 </dc:group>
1162 </bedheight-differences> 874 </bedheight-differences>
1163 </dc:if> 875 </dc:if>
1164 </dc:context> 876 </dc:filter>
1165 </dc:macro> 877 </dc:macro>
1166 878
1167 <dc:macro name="waterlevels-discharge"> 879 <dc:macro name="waterlevels-discharge">
1168 <dc:context> 880 <dc:filter expr="$out_name = 'discharge_longitudinal_section' and $facet_name = 'discharge_longitudinal_section.w">
1169 <dc:statement>
1170 SELECT id AS oid
1171 FROM outs AS o
1172 WHERE
1173 o.artifact_id = ${a_id} AND
1174 o.name = 'discharge_longitudinal_section'
1175 </dc:statement>
1176 <dc:if test="dc:has-result()"> 881 <dc:if test="dc:has-result()">
1177 <waterlevels-discharge> 882 <waterlevels-discharge>
1178 <dc:for-each> 883 <dc:group expr="concat($oid, ' ', $river, ' ', $a_id, ' ', $a_creation, ' ', $collection_name)">
1179 <discharge description="{$oid} {$river} {$a_id} {$a_creation} {$collection_name}"> 884 <discharge description="{dc:group-key()}">
1180 <dc:context> 885 <dc:for-each>
1181 <dc:statement> 886 <dc:element name="${facet_name}">
1182 SELECT a.gid AS aid, 887 <dc:attribute name="factory" value="winfo"/>
1183 f.id AS fid, 888 <dc:attribute name="target_out" value="${out}"/>
1184 f.name AS facet_name, 889 <dc:attribute name="description" value="${facet_description}"/>
1185 f.num AS facet_num, 890 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1186 f.description AS facet_description 891 <dc:attribute name="artifact-id" value="${a_id}"/>
1187 FROM outs AS o, facets AS f, artifacts AS a 892 <dc:attribute name="out" value="longitudinal_section"/>
1188 WHERE f.name = 'discharge_longitudinal_section.w' AND 893 </dc:element>
1189 f.out_id = o.id AND 894 </dc:for-each>
1190 o.artifact_id = ${a_id} AND
1191 a.id = ${a_id}
1192 </dc:statement>
1193 <dc:for-each>
1194 <dc:element name="${facet_name}">
1195 <dc:attribute name="factory" value="winfo"/>
1196 <dc:attribute name="description" value="${facet_description}"/>
1197 <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
1198 <dc:attribute name="artifact-id" value="${aid}"/>
1199 <dc:attribute name="out" value="longitudinal_section"/>
1200 </dc:element>
1201 </dc:for-each>
1202 </dc:context>
1203 </discharge> 895 </discharge>
1204 </dc:for-each> 896 </dc:group>
1205 </waterlevels-discharge> 897 </waterlevels-discharge>
1206 </dc:if> 898 </dc:if>
1207 </dc:context> 899 </dc:filter>
1208 </dc:macro> 900 </dc:macro>
1209 <!-- Macros to load system data --> 901 <!-- Macros to load system data -->
1210 902
1211 <dc:macro name="annotations"> 903 <dc:macro name="annotations">
1212 <annotation factory="annotations" ids="{$river_id}"/> 904 <annotation factory="annotations" ids="{$river_id}" target_out="{$out}" />
1213 </dc:macro> 905 </dc:macro>
1214 906
1215 <dc:macro name="mainvalues"> 907 <dc:macro name="mainvalues">
1216 <wmainvalue factory="mainvalue" ids="{$river_id}:w"/> 908 <wmainvalue factory="mainvalue" ids="{$river_id}:w" target_out="{$out}" />
1217 <qmainvalue factory="mainvalue" ids="{$river_id}:q"/> 909 <qmainvalue factory="mainvalue" ids="{$river_id}:q" target_out="{$out}" />
1218 </dc:macro> 910 </dc:macro>
1219 911
1220 <dc:macro name="cross_sections"> 912 <dc:macro name="cross_sections">
1221 <cross_sections id="flood-protections-{$river_id}"> 913 <cross_sections id="flood-protections-{$river_id}">
1222 <dc:context connection="system"> 914 <dc:context connection="system">
1230 AND csl.km BETWEEN ${fromkm} AND ${tokm} 922 AND csl.km BETWEEN ${fromkm} AND ${tokm}
1231 </dc:statement> 923 </dc:statement>
1232 <dc:for-each> 924 <dc:for-each>
1233 <cross_section name="{$prot_description}" 925 <cross_section name="{$prot_description}"
1234 ids="{$prot_id}" 926 ids="{$prot_id}"
1235 factory="crosssections"/> 927 factory="crosssections" target_out="{$out}" />
1236 </dc:for-each> 928 </dc:for-each>
1237 </dc:context> 929 </dc:context>
1238 </cross_sections> 930 </cross_sections>
1239 </dc:macro> 931 </dc:macro>
1240 932
1249 JOIN hyk_entries he ON he.hyk_id = h.id 941 JOIN hyk_entries he ON he.hyk_id = h.id
1250 WHERE river_id = ${river_id} 942 WHERE river_id = ${river_id}
1251 AND he.km BETWEEN ${fromkm} AND ${tokm} 943 AND he.km BETWEEN ${fromkm} AND ${tokm}
1252 </dc:statement> 944 </dc:statement>
1253 <dc:for-each> 945 <dc:for-each>
1254 <hyk name="{$hyk_description}" 946 <hyk name="{$hyk_description}"
1255 ids="{$hyk_id}" 947 ids="{$hyk_id}"
1256 factory="hyk"/> 948 factory="hyk" target_out="{$out}" />
1257 </dc:for-each> 949 </dc:for-each>
1258 </dc:context> 950 </dc:context>
1259 </hyks> 951 </hyks>
1260 </dc:macro> 952 </dc:macro>
1261 953
1277 969
1278 <dc:macro name="basedata_2_fixations_wqkms"> 970 <dc:macro name="basedata_2_fixations_wqkms">
1279 <dc:call-macro name="fixings-macro"> 971 <dc:call-macro name="fixings-macro">
1280 <column name="{$wst_column_name}" 972 <column name="{$wst_column_name}"
1281 ids="fixations-wstv-{$wst_column_position}-{$wst_id}" 973 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1282 factory="wqinterpol" 974 factory="wqinterpol" target_out="{$out}"
1283 info="{$info} [km {$deffrom} - {$defto}]"/> 975 info="{$info} [km {$deffrom} - {$defto}]"/>
1284 </dc:call-macro> 976 </dc:call-macro>
1285 </dc:macro> 977 </dc:macro>
1286 978
1287 <dc:macro name="basedata_2_fixations"> 979 <dc:macro name="basedata_2_fixations">
1288 <dc:call-macro name="fixings-macro"> 980 <dc:call-macro name="fixings-macro">
1289 <column name="{$wst_column_name}" 981 <column name="{$wst_column_name}"
1290 ids="fixations-wstv-{$wst_column_position}-{$wst_id}" 982 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1291 factory="staticwqkms" 983 factory="staticwqkms" target_out="{$out}"
1292 info="{$info} [km {$deffrom} - {$defto}]"/> 984 info="{$info} [km {$deffrom} - {$defto}]"/>
1293 </dc:call-macro> 985 </dc:call-macro>
1294 </dc:macro> 986 </dc:macro>
1295 987
1296 <dc:macro name="basedata_3_officials"> 988 <dc:macro name="basedata_3_officials">
1300 <dc:group expr="$wst_description"> 992 <dc:group expr="$wst_description">
1301 <official name="{dc:group-key()}"> 993 <official name="{dc:group-key()}">
1302 <dc:for-each> 994 <dc:for-each>
1303 <column name="{$wst_column_name}" 995 <column name="{$wst_column_name}"
1304 ids="additionals-wstv-{$wst_column_position}-{$wst_id}" 996 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1305 factory="staticwqkms" 997 factory="staticwqkms" target_out="{$out}"
1306 info="{$info} [km {$deffrom} - {$defto}]"/> 998 info="{$info} [km {$deffrom} - {$defto}]"/>
1307 </dc:for-each> 999 </dc:for-each>
1308 </official> 1000 </official>
1309 </dc:group> 1001 </dc:group>
1310 </officiallines> 1002 </officiallines>
1319 <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')"> 1011 <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')">
1320 <heightmark name="{dc:group-key()}"> 1012 <heightmark name="{dc:group-key()}">
1321 <dc:for-each> 1013 <dc:for-each>
1322 <column name="{$wst_column_name}" 1014 <column name="{$wst_column_name}"
1323 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" 1015 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
1324 factory="staticwkms" 1016 factory="staticwkms" target_out="{$out}"
1325 info="{$info} [km {$deffrom} - {$defto}]"/> 1017 info="{$info} [km {$deffrom} - {$defto}]"/>
1326 </dc:for-each> 1018 </dc:for-each>
1327 </heightmark> 1019 </heightmark>
1328 </dc:group> 1020 </dc:group>
1329 </heightmarks> 1021 </heightmarks>
1338 <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')"> 1030 <dc:group expr="dc:replace($wst_description, 'HW-Marken/', '')">
1339 <relativepoint name="{dc:group-key()}"> 1031 <relativepoint name="{dc:group-key()}">
1340 <dc:for-each> 1032 <dc:for-each>
1341 <column name="{$wst_column_name}" 1033 <column name="{$wst_column_name}"
1342 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}" 1034 ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
1343 factory="staticwkms" 1035 factory="staticwkms" target_out="{$out}"
1344 info="{$info} [km {$deffrom} - {$defto}]"/> 1036 info="{$info} [km {$deffrom} - {$defto}]"/>
1345 </dc:for-each> 1037 </dc:for-each>
1346 </relativepoint> 1038 </relativepoint>
1347 </dc:group> 1039 </dc:group>
1348 </heightmarks> 1040 </heightmarks>
1367 <dc:group expr="dc:replace($wst_description, 'HW-Schutzanlagen/', '')"> 1059 <dc:group expr="dc:replace($wst_description, 'HW-Schutzanlagen/', '')">
1368 <flood_protection name="{dc:group-key()}"> 1060 <flood_protection name="{dc:group-key()}">
1369 <dc:for-each> 1061 <dc:for-each>
1370 <column name="{$wst_column_name}" 1062 <column name="{$wst_column_name}"
1371 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" 1063 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
1372 factory="staticwkms" 1064 factory="staticwkms" target_out="{$out}"
1373 info="{$info} [km {$deffrom} - {$defto}]"/> 1065 info="{$info} [km {$deffrom} - {$defto}]"/>
1374 </dc:for-each> 1066 </dc:for-each>
1375 </flood_protection> 1067 </flood_protection>
1376 </dc:group> 1068 </dc:group>
1377 </flood_protections> 1069 </flood_protections>
1380 </dc:macro> 1072 </dc:macro>
1381 1073
1382 <dc:macro name="annotations_per_type"> 1074 <dc:macro name="annotations_per_type">
1383 <annotations> 1075 <annotations>
1384 <dc:context> 1076 <dc:context>
1385 <all_annotations factory="annotations" ids="{$river_id}"/> 1077 <all_annotations factory="annotations" ids="{$river_id}" target_out="{$out}" />
1386 <dc:statement> 1078 <dc:statement>
1387 SELECT id AS anno_id, 1079 SELECT id AS anno_id,
1388 name AS anno_description 1080 name AS anno_description
1389 FROM annotation_types 1081 FROM annotation_types
1390 </dc:statement> 1082 </dc:statement>
1391 <dc:for-each> 1083 <dc:for-each>
1392 <annotation name="{$anno_description}" 1084 <annotation name="{$anno_description}"
1393 factory="annotations" 1085 factory="annotations" target_out="{$out}"
1394 ids="{$river_id}:{$anno_description}"/> 1086 ids="{$river_id}:{$anno_description}"/>
1395 </dc:for-each> 1087 </dc:for-each>
1396 </dc:context> 1088 </dc:context>
1397 </annotations> 1089 </annotations>
1398 </dc:macro> 1090 </dc:macro>
1404 <dc:group expr="dc:replace($wst_description, 'Fixierungen/', '')"> 1096 <dc:group expr="dc:replace($wst_description, 'Fixierungen/', '')">
1405 <relativepoint name="{dc:group-key()}"> 1097 <relativepoint name="{dc:group-key()}">
1406 <dc:for-each> 1098 <dc:for-each>
1407 <column name="{$wst_column_name}" 1099 <column name="{$wst_column_name}"
1408 ids="fixations-wstv-{$wst_column_position}-{$wst_id}" 1100 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
1409 factory="staticwkms" 1101 factory="staticwkms" target_out="{$out}"
1410 info="{$info} [km {$deffrom} - {$defto}]"/> 1102 info="{$info} [km {$deffrom} - {$defto}]"/>
1411 </dc:for-each> 1103 </dc:for-each>
1412 </relativepoint> 1104 </relativepoint>
1413 </dc:group> 1105 </dc:group>
1414 </fixations> 1106 </fixations>
1423 <dc:group expr="$wst_description"> 1115 <dc:group expr="$wst_description">
1424 <relativepoint name="{dc:group-key()}"> 1116 <relativepoint name="{dc:group-key()}">
1425 <dc:for-each> 1117 <dc:for-each>
1426 <column name="{$wst_column_name}" 1118 <column name="{$wst_column_name}"
1427 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}" 1119 ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
1428 factory="staticwkms" 1120 factory="staticwkms" target_out="{$out}"
1429 info="{$info} [km {$deffrom} - {$defto}]"/> 1121 info="{$info} [km {$deffrom} - {$defto}]"/>
1430 </dc:for-each> 1122 </dc:for-each>
1431 </relativepoint> 1123 </relativepoint>
1432 </dc:group> 1124 </dc:group>
1433 </flood_protections> 1125 </flood_protections>
1442 <dc:group expr="$wst_description"> 1134 <dc:group expr="$wst_description">
1443 <relativepoint name="{dc:group-key()}"> 1135 <relativepoint name="{dc:group-key()}">
1444 <dc:for-each> 1136 <dc:for-each>
1445 <column name="{$wst_column_name}" 1137 <column name="{$wst_column_name}"
1446 ids="additionals-wstv-{$wst_column_position}-{$wst_id}" 1138 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1447 factory="staticwkms" 1139 factory="staticwkms" target_out="{$out}"
1448 info="{$info} [km {$deffrom} - {$defto}]"/> 1140 info="{$info} [km {$deffrom} - {$defto}]"/>
1449 </dc:for-each> 1141 </dc:for-each>
1450 </relativepoint> 1142 </relativepoint>
1451 </dc:group> 1143 </dc:group>
1452 </additionals> 1144 </additionals>
1145 </dc:if>
1146 </dc:filter>
1147 </dc:macro>
1148
1149 <dc:macro name="basedata_6_delta_w">
1150 <dc:filter expr="$kind=6">
1151 <dc:if test="dc:has-result()">
1152 <delta_w>
1153 <dc:group expr="$wst_description">
1154 <relativepoint name="{dc:group-key()}">
1155 <dc:for-each>
1156 <column name="{$wst_column_name}"
1157 ids="delta_w-wstv-{$wst_column_position}-{$wst_id}"
1158 factory="staticwkms" target_out="{$out}"
1159 info="{$info} [km {$deffrom} - {$defto}]"/>
1160 </dc:for-each>
1161 </relativepoint>
1162 </dc:group>
1163 </delta_w>
1453 </dc:if> 1164 </dc:if>
1454 </dc:filter> 1165 </dc:filter>
1455 </dc:macro> 1166 </dc:macro>
1456 1167
1457 <dc:macro name="discharge_table_gauge"> 1168 <dc:macro name="discharge_table_gauge">
1464 <dc:if test="dc:has-result()"> 1175 <dc:if test="dc:has-result()">
1465 <discharge_table_nn> 1176 <discharge_table_nn>
1466 <discharge_table_gauge> 1177 <discharge_table_gauge>
1467 <dc:for-each> 1178 <dc:for-each>
1468 <gauge name="{$gauge_name}" 1179 <gauge name="{$gauge_name}"
1469 factory="gaugedischarge" 1180 factory="gaugedischarge" target_out="{$out}"
1470 from="{$g_start}" 1181 from="{$g_start}"
1471 to="{$g_stop}" 1182 to="{$g_stop}"
1472 ids="{$gauge_name}"/> 1183 ids="{$gauge_name}"/>
1473 </dc:for-each> 1184 </dc:for-each>
1474 </discharge_table_gauge> 1185 </discharge_table_gauge>
1486 <dc:macro name="discharge_fix_wq"> 1197 <dc:macro name="discharge_fix_wq">
1487 <dc:call-macro name="discharge_table_gauge"/> 1198 <dc:call-macro name="discharge_table_gauge"/>
1488 </dc:macro> 1199 </dc:macro>
1489 1200
1490 <dc:macro name="qsectors"> 1201 <dc:macro name="qsectors">
1491 <qsector factory="qsectors" ids="{$river_id}"/> 1202 <qsector factory="qsectors" ids="{$river_id}" target_out="{$out}" />
1492 </dc:macro> 1203 </dc:macro>
1493 1204
1494 <dc:macro name="flood-map-recommended"> 1205 <dc:macro name="flood-map-recommended">
1495 <kilometrage> 1206 <kilometrage>
1496 <riveraxis factory="riveraxis" ids="{$river_id}"/> 1207 <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" />
1497 </kilometrage> 1208 </kilometrage>
1498 <rastermap> 1209 <rastermap>
1499 <background factory="wmsbackground" ids="{$river_id}"/> 1210 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" />
1500 </rastermap> 1211 </rastermap>
1501 </dc:macro> 1212 </dc:macro>
1502 1213
1503 <dc:macro name="minfo-heights"> 1214 <dc:macro name="minfo-heights">
1504 <bedheights> 1215 <bedheights>
1512 <dc:context> 1223 <dc:context>
1513 <dc:statement> 1224 <dc:statement>
1514 SELECT id AS bedh_id, 1225 SELECT id AS bedh_id,
1515 year AS bedh_year, 1226 year AS bedh_year,
1516 description AS bedh_descr 1227 description AS bedh_descr
1517 FROM bed_height_single WHERE river_id = ${river_id} 1228 FROM bed_height_single
1229 WHERE river_id = ${river_id}
1230 AND lower(description) NOT LIKE '%epoch%'
1518 </dc:statement> 1231 </dc:statement>
1519 <dc:for-each> 1232 <dc:for-each>
1520 <height factory="bedheight" 1233 <height factory="bedheight" target_out="{$out}"
1521 ids="bedheight-single-{$bedh_id}-{$bedh_year}" 1234 ids="bedheight-single-{$bedh_id}-{$bedh_year}"
1522 description="{$bedh_descr}"/> 1235 description="{$bedh_descr}"/>
1523 </dc:for-each> 1236 </dc:for-each>
1524 </dc:context> 1237 </dc:context>
1525 </single> 1238 </single>
1527 1240
1528 <dc:macro name="bed-heights-epoch"> 1241 <dc:macro name="bed-heights-epoch">
1529 <epoch> 1242 <epoch>
1530 <dc:context> 1243 <dc:context>
1531 <dc:statement> 1244 <dc:statement>
1532 SELECT id AS bedh_id, 1245 SELECT id AS bedh_id,
1533 time_interval_id AS bedh_interval_id, 1246 year AS bedh_year,
1534 description AS bedh_descr 1247 description AS bedh_descr
1535 FROM bed_height_epoch WHERE river_id = ${river_id} 1248 FROM bed_height_single
1249 WHERE river_id = ${river_id}
1250 AND lower(description) LIKE '%epoch%'
1536 </dc:statement> 1251 </dc:statement>
1537 <dc:for-each> 1252 <dc:for-each>
1538 <height factory="bedheight" 1253 <height factory="bedheight" target_out="{$out}"
1539 ids="bedheight-epoch-{$bedh_id}-{$bedh_interval_id}" 1254 ids="bedheight-single-{$bedh_id}-{$bedh_year}"
1540 description="{$bedh_descr}"/> 1255 description="{$bedh_descr}"/>
1541 </dc:for-each> 1256 </dc:for-each>
1542 </dc:context> 1257 </dc:context>
1543 </epoch> 1258 </epoch>
1544 </dc:macro> 1259 </dc:macro>
1554 <flowvelocitymeasurement> 1269 <flowvelocitymeasurement>
1555 <dc:for-each> 1270 <dc:for-each>
1556 <dc:comment>TODO: Why has this an id and factory?</dc:comment> 1271 <dc:comment>TODO: Why has this an id and factory?</dc:comment>
1557 <flow_velocity_measurement name="{$fvmd}" 1272 <flow_velocity_measurement name="{$fvmd}"
1558 ids="{$fvmid}" 1273 ids="{$fvmid}"
1559 factory="flowvelocity"> 1274 factory="flowvelocity" target_out="{$out}" >
1560 <dc:context> 1275 <dc:context>
1561 <dc:statement> 1276 <dc:statement>
1562 SELECT id, description, station, datetime, v, w, q 1277 SELECT id, description, station, datetime, v, w, q
1563 FROM flow_velocity_measure_values 1278 FROM flow_velocity_measure_values
1564 WHERE measurements_id = ${fvmid} 1279 WHERE measurements_id = ${fvmid}
1565 AND station BETWEEN ${fromkm} AND ${tokm} 1280 AND station BETWEEN ${fromkm} AND ${tokm}
1566 </dc:statement> 1281 </dc:statement>
1567 <dc:for-each> 1282 <dc:for-each>
1568 <measurement_value name="{$description} - {$station} - {$datetime}" 1283 <measurement_value name="{$description} - {$station} - {$datetime}"
1569 ids="{$id}" 1284 ids="{$id}"
1570 factory="flowvelocity"/> 1285 factory="flowvelocity" target_out="{$out}" />
1571 </dc:for-each> 1286 </dc:for-each>
1572 </dc:context> 1287 </dc:context>
1573 </flow_velocity_measurement> 1288 </flow_velocity_measurement>
1574 </dc:for-each> 1289 </dc:for-each>
1575 </flowvelocitymeasurement> 1290 </flowvelocitymeasurement>
1595 WHERE morphologic_width_id = ${width_id} 1310 WHERE morphologic_width_id = ${width_id}
1596 </dc:statement> 1311 </dc:statement>
1597 <dc:for-each> 1312 <dc:for-each>
1598 <morphologic-width name="{$from_station} - {$to_station}" 1313 <morphologic-width name="{$from_station} - {$to_station}"
1599 ids="{$width_id}" 1314 ids="{$width_id}"
1600 factory="morph-width"/> 1315 factory="morph-width" target_out="{$out}" />
1601 </dc:for-each> 1316 </dc:for-each>
1602 </dc:context> 1317 </dc:context>
1603 </dc:for-each> 1318 </dc:for-each>
1604 </morph_width> 1319 </morph_width>
1605 </dc:if> 1320 </dc:if>
1615 FROM bed_height_single WHERE river_id = ${river_id} 1330 FROM bed_height_single WHERE river_id = ${river_id}
1616 </dc:statement> 1331 </dc:statement>
1617 <dc:if test="dc:has-result()"> 1332 <dc:if test="dc:has-result()">
1618 <soundings_width> 1333 <soundings_width>
1619 <dc:for-each> 1334 <dc:for-each>
1620 <height factory="bedheight" 1335 <height factory="bedheight" target_out="{$out}"
1621 ids="bedheight-singlevalues-{$bedh_id}-{$bedh_year}" 1336 ids="bedheight-singlevalues-{$bedh_id}-{$bedh_year}"
1622 description="{$bedh_descr}"/> 1337 description="{$bedh_descr}"/>
1623 </dc:for-each> 1338 </dc:for-each>
1624 </soundings_width> 1339 </soundings_width>
1625 </dc:if> 1340 </dc:if>
1644 1359
1645 <dc:macro name="basedata_0"> 1360 <dc:macro name="basedata_0">
1646 <dc:call-macro name="basedata_0_macro"> 1361 <dc:call-macro name="basedata_0_macro">
1647 <column name="{$wst_column_name}" 1362 <column name="{$wst_column_name}"
1648 ids="base_data-wstv-{$wst_column_position}-{$wst_id}" 1363 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
1649 factory="staticwqkms" 1364 factory="staticwqkms" target_out="{$out}"
1650 info="{$info} [km {$deffrom} - {$defto}]"/> 1365 info="{$info} [km {$deffrom} - {$defto}]"/>
1651 </dc:call-macro> 1366 </dc:call-macro>
1652 </dc:macro> 1367 </dc:macro>
1653 1368
1654 <dc:macro name="basedata_0_wq"> 1369 <dc:macro name="basedata_0_wq">
1655 <dc:call-macro name="basedata_0_macro"> 1370 <dc:call-macro name="basedata_0_macro">
1656 <column name="{$wst_column_name}" 1371 <column name="{$wst_column_name}"
1657 ids="base_data-wstv-{$wst_column_position}-{$wst_id}" 1372 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
1658 factory="wqinterpol" 1373 factory="wqinterpol" target_out="{$out}"
1659 info="{$info} [km {$deffrom} - {$defto}]"/> 1374 info="{$info} [km {$deffrom} - {$defto}]"/>
1660 </dc:call-macro> 1375 </dc:call-macro>
1661 </dc:macro> 1376 </dc:macro>
1662 1377
1663 <dc:macro name="basedata_1_additionals_macro"> 1378 <dc:macro name="basedata_1_additionals_macro">
1678 1393
1679 <dc:macro name="basedata_1_additionals"> 1394 <dc:macro name="basedata_1_additionals">
1680 <dc:call-macro name="basedata_1_additionals_macro"> 1395 <dc:call-macro name="basedata_1_additionals_macro">
1681 <column name="{$wst_column_name}" 1396 <column name="{$wst_column_name}"
1682 ids="additionals-wstv-{$wst_column_position}-{$wst_id}" 1397 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
1683 factory="staticwqkms" 1398 factory="staticwqkms" target_out="{$out}"
1684 info="{$info} [km {$deffrom} - {$defto}]"/> 1399 info="{$info} [km {$deffrom} - {$defto}]"/>
1685 </dc:call-macro> 1400 </dc:call-macro>
1686 </dc:macro> 1401 </dc:macro>
1687 1402
1688 <dc:macro name="basedata_1_additionals_marks"> 1403 <dc:macro name="basedata_1_additionals_marks">
1689 <dc:call-macro name="basedata_1_additionals_macro"> 1404 <dc:call-macro name="basedata_1_additionals_macro">
1690 <column name="{$wst_column_name}" 1405 <column name="{$wst_column_name}"
1691 ids="additionalsmarks-wstv-{$wst_column_position}-{$wst_id}" 1406 ids="additionalsmarks-wstv-{$wst_column_position}-{$wst_id}"
1692 factory="staticwkms" 1407 factory="staticwkms" target_out="{$out}"
1693 info="{$info} [km {$deffrom} - {$defto}]"/> 1408 info="{$info} [km {$deffrom} - {$defto}]"/>
1694 </dc:call-macro> 1409 </dc:call-macro>
1695 </dc:macro> 1410 </dc:macro>
1696 1411
1697 <!-- Floodmap part --> 1412 <!-- Floodmap part -->
1731 <dc:macro name="flood-map-recommended"> 1446 <dc:macro name="flood-map-recommended">
1732 <dc:comment> 1447 <dc:comment>
1733 FIXME: Following two macros look identical to me. 1448 FIXME: Following two macros look identical to me.
1734 </dc:comment> 1449 </dc:comment>
1735 <kilometrage> 1450 <kilometrage>
1736 <riveraxis factory="riveraxis" ids="{$river_id}"/> 1451 <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" />
1737 </kilometrage> 1452 </kilometrage>
1738 <rastermap> 1453 <rastermap>
1739 <background factory="wmsbackground" ids="{$river_id}"/> 1454 <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" />
1740 </rastermap> 1455 </rastermap>
1741 </dc:macro> 1456 </dc:macro>
1742 1457
1743 <dc:macro name="flood-map-dem"> 1458 <dc:macro name="flood-map-dem">
1744 <dems> 1459 <dems>
1748 r.a AS dem_lower, 1463 r.a AS dem_lower,
1749 r.b AS dem_upper, 1464 r.b AS dem_upper,
1750 d.name AS name, 1465 d.name AS name,
1751 t.start_time AS start_time, 1466 t.start_time AS start_time,
1752 t.stop_time AS stop_time, 1467 t.stop_time AS stop_time,
1753 'Projektion: ' || d.projection || '$' || 1468 'Projektion: ' || d.projection || '&lt;BR&gt;' ||
1754 'Rasterweite: ' || d.resolution || 'm$' || 1469 'Rasterweite: ' || d.resolution || 'm&lt;BR&gt;' ||
1755 'Format: ' || d.format || '$' || 1470 'Format: ' || d.format || '&lt;BR&gt;' ||
1756 'Zeitraum: ' 1471 'Zeitraum: '
1757 AS info 1472 AS info
1758 FROM dem d 1473 FROM dem d
1759 JOIN ranges r ON d.range_id = r.id 1474 JOIN ranges r ON d.range_id = r.id
1760 LEFT JOIN time_intervals t ON d.time_interval_id = t.id 1475 LEFT JOIN time_intervals t ON d.time_interval_id = t.id
1761 WHERE d.river_id = ${river_id} 1476 WHERE d.river_id = ${river_id}
1762 </dc:statement> 1477 AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b))
1763 <dc:for-each> 1478 </dc:statement>
1764 <dem factory="demfactory" 1479 <dc:for-each>
1480 <dem factory="demfactory" target_out="{$out}"
1765 ids="{$dem_id}" 1481 ids="{$dem_id}"
1766 name="{$name}" 1482 name="{$name}"
1767 info="{dc:replace($info, '$', '&lt;BR&gt;')}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/> 1483 info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/>
1768 </dc:for-each> 1484 </dc:for-each>
1769 </dc:context> 1485 </dc:context>
1770 </dems> 1486 </dems>
1771 </dc:macro> 1487 </dc:macro>
1772 1488
1773 <dc:macro name="filter_hws_ddg"> 1489 <dc:macro name="filter_hws_ddg">
1774 <dc:macro name="durchlass_damm_graben"> 1490 <dc:macro name="durchlass_damm_graben">
1775 <dc:macro name="ddg_factory"> 1491 <dc:macro name="ddg_factory">
1776 <dc:for-each> 1492 <dc:for-each>
1777 <hws factory="hwsfactory" name="{$hws_name}"/> 1493 <hws factory="hwsfactory" name="{$hws_name}" target_out="{$out}" />
1778 </dc:for-each> 1494 </dc:for-each>
1779 </dc:macro> 1495 </dc:macro>
1780 1496
1781 <dc:filter expr="$hws_kind=1"> 1497 <dc:filter expr="$hws_kind=1">
1782 <dc:if test="dc:has-result()"> 1498 <dc:if test="dc:has-result()">
1859 FROM hydr_boundaries 1575 FROM hydr_boundaries
1860 WHERE river_id = ${river_id} 1576 WHERE river_id = ${river_id}
1861 AND kind = 2 1577 AND kind = 2
1862 </dc:statement> 1578 </dc:statement>
1863 <dc:for-each> 1579 <dc:for-each>
1864 <line factory="wmshydrboundariesfactory" 1580 <line factory="wmshydrboundariesfactory" target_out="{$out}"
1865 ids="{$river_id};{$name};2" 1581 ids="{$river_id};{$name};2"
1866 name="{$name}"/> 1582 name="{$name}"/>
1867 </dc:for-each> 1583 </dc:for-each>
1868 </dc:context> 1584 </dc:context>
1869 <dc:context> 1585 <dc:context>
1873 FROM hydr_boundaries_poly 1589 FROM hydr_boundaries_poly
1874 WHERE river_id = ${river_id} 1590 WHERE river_id = ${river_id}
1875 AND kind = 2 1591 AND kind = 2
1876 </dc:statement> 1592 </dc:statement>
1877 <dc:for-each> 1593 <dc:for-each>
1878 <line factory="wmshydrboundariespolyfactory" 1594 <line factory="wmshydrboundariespolyfactory" target_out="{$out}"
1879 ids="{$river_id};{$name};2" 1595 ids="{$river_id};{$name};2"
1880 name="{$name}"/> 1596 name="{$name}"/>
1881 </dc:for-each> 1597 </dc:for-each>
1882 </dc:context> 1598 </dc:context>
1883 </federal> 1599 </federal>
1894 </dc:statement> 1610 </dc:statement>
1895 <dc:comment> What about all other line kinds?</dc:comment> 1611 <dc:comment> What about all other line kinds?</dc:comment>
1896 <dc:if test="dc:has-result()"> 1612 <dc:if test="dc:has-result()">
1897 <lines> 1613 <lines>
1898 <dc:for-each> 1614 <dc:for-each>
1899 <line factory="wmshydrboundariesfactory" 1615 <line factory="wmshydrboundariesfactory" target_out="{$out}"
1900 ids="{$river_id};{$name};1" 1616 ids="{$river_id};{$name};1"
1901 name="{$name}"/> 1617 name="{$name}"/>
1902 </dc:for-each> 1618 </dc:for-each>
1903 </lines> 1619 </lines>
1904 </dc:if> 1620 </dc:if>
1919 </dc:statement> 1635 </dc:statement>
1920 <dc:if test="dc:has-result()"> 1636 <dc:if test="dc:has-result()">
1921 <sobek_areas> 1637 <sobek_areas>
1922 <dc:for-each> 1638 <dc:for-each>
1923 <boundary name="{$sectie}" 1639 <boundary name="{$sectie}"
1924 factory="wmshydrboundariespolyfactory" 1640 factory="wmshydrboundariespolyfactory" target_out="{$out}"
1925 ids="{$river_id};{$sectie};1;{$sectie_id};-1"/> 1641 ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
1926 </dc:for-each> 1642 </dc:for-each>
1927 </sobek_areas> 1643 </sobek_areas>
1928 </dc:if> 1644 </dc:if>
1929 </dc:context> 1645 </dc:context>
1939 </dc:statement> 1655 </dc:statement>
1940 <dc:if test="dc:has-result()"> 1656 <dc:if test="dc:has-result()">
1941 <sobek_flooded> 1657 <sobek_flooded>
1942 <dc:for-each> 1658 <dc:for-each>
1943 <boundary name="{$sobek}" 1659 <boundary name="{$sobek}"
1944 factory="wmshydrboundariespolyfactory" 1660 factory="wmshydrboundariespolyfactory" target_out="{$out}"
1945 ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/> 1661 ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
1946 </dc:for-each> 1662 </dc:for-each>
1947 </sobek_flooded> 1663 </sobek_flooded>
1948 </dc:if> 1664 </dc:if>
1949 </dc:context> 1665 </dc:context>
1957 AND b.sobek IS NULL 1673 AND b.sobek IS NULL
1958 AND b.sectie is NULL 1674 AND b.sectie is NULL
1959 </dc:statement> 1675 </dc:statement>
1960 <dc:for-each> 1676 <dc:for-each>
1961 <boundary name="{$name}" 1677 <boundary name="{$name}"
1962 factory="wmshydrboundariespolyfactory" 1678 factory="wmshydrboundariespolyfactory" target_out="{$out}"
1963 ids="{$river_id};{$name}"/> 1679 ids="{$river_id};{$name}"/>
1964 </dc:for-each> 1680 </dc:for-each>
1965 </dc:context> 1681 </dc:context>
1966 </areas> 1682 </areas>
1967 </dc:macro> 1683 </dc:macro>
1988 WHERE river_id = ${river_id} AND kind = 111 1704 WHERE river_id = ${river_id} AND kind = 111
1989 </dc:statement> 1705 </dc:statement>
1990 <dc:if test="dc:has-result()"> 1706 <dc:if test="dc:has-result()">
1991 <bfg> 1707 <bfg>
1992 <dc:for-each> 1708 <dc:for-each>
1993 <floodmaps factory="wmsfloodmapsfactory" 1709 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
1994 ids="{$river_id};{$name}" 1710 ids="{$river_id};{$name}"
1995 name="{$name}"/> 1711 name="{$name}"/>
1996 </dc:for-each> 1712 </dc:for-each>
1997 </bfg> 1713 </bfg>
1998 </dc:if> 1714 </dc:if>
2004 WHERE river_id = ${river_id} AND kind = 112 1720 WHERE river_id = ${river_id} AND kind = 112
2005 </dc:statement> 1721 </dc:statement>
2006 <dc:if test="dc:has-result()"> 1722 <dc:if test="dc:has-result()">
2007 <federal> 1723 <federal>
2008 <dc:for-each> 1724 <dc:for-each>
2009 <floodmaps factory="wmsfloodmapsfactory" 1725 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
2010 ids="{$river_id};{$name}" 1726 ids="{$river_id};{$name}"
2011 name="{$name}"/> 1727 name="{$name}"/>
2012 </dc:for-each> 1728 </dc:for-each>
2013 </federal> 1729 </federal>
2014 </dc:if> 1730 </dc:if>
2030 WHERE river_id = ${river_id} AND kind = 121 1746 WHERE river_id = ${river_id} AND kind = 121
2031 </dc:statement> 1747 </dc:statement>
2032 <dc:if test="dc:has-result()"> 1748 <dc:if test="dc:has-result()">
2033 <bfg> 1749 <bfg>
2034 <dc:for-each> 1750 <dc:for-each>
2035 <floodmaps factory="wmsfloodmapsfactory" 1751 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
2036 ids="{$river_id};{$name}" 1752 ids="{$river_id};{$name}"
2037 name="{$name}"/> 1753 name="{$name}"/>
2038 </dc:for-each> 1754 </dc:for-each>
2039 </bfg> 1755 </bfg>
2040 </dc:if> 1756 </dc:if>
2047 WHERE river_id = ${river_id} AND kind = 122 1763 WHERE river_id = ${river_id} AND kind = 122
2048 </dc:statement> 1764 </dc:statement>
2049 <dc:if test="dc:has-result()"> 1765 <dc:if test="dc:has-result()">
2050 <federal> 1766 <federal>
2051 <dc:for-each> 1767 <dc:for-each>
2052 <floodmaps factory="wmsfloodmapsfactory" 1768 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
2053 ids="{$river_id};{$name}" 1769 ids="{$river_id};{$name}"
2054 name="{$name}"/> 1770 name="{$name}"/>
2055 </dc:for-each> 1771 </dc:for-each>
2056 </federal> 1772 </federal>
2057 </dc:if> 1773 </dc:if>
2078 FROM floodmaps 1794 FROM floodmaps
2079 WHERE river_id = ${river_id} AND kind = 200 AND source = 1795 WHERE river_id = ${river_id} AND kind = 200 AND source =
2080 ${source} 1796 ${source}
2081 </dc:statement> 1797 </dc:statement>
2082 <dc:for-each> 1798 <dc:for-each>
2083 <floodmaps factory="wmsfloodmapsfactory" 1799 <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
2084 ids="{$river_id};{$name}" 1800 ids="{$river_id};{$name}"
2085 name="{$name}"/> 1801 name="{$name}"/>
2086 </dc:for-each> 1802 </dc:for-each>
2087 </dc:context> 1803 </dc:context>
2088 </year> 1804 </year>
2108 </dc:statement> 1824 </dc:statement>
2109 <dc:if test="dc:has-result()"> 1825 <dc:if test="dc:has-result()">
2110 <floodplain> 1826 <floodplain>
2111 <dc:filter expr="$kind_id=1"> 1827 <dc:filter expr="$kind_id=1">
2112 <dc:for-each> 1828 <dc:for-each>
2113 <floody factory="wmsfloodplainfactory" 1829 <floody factory="wmsfloodplainfactory" target_out="{$out}"
2114 description="{$kind_name}" 1830 description="{$kind_name}"
2115 ids="{$river_id};{$kind_name};{$kind_id}"/> 1831 ids="{$river_id};{$kind_name};{$kind_id}"/>
2116 </dc:for-each> 1832 </dc:for-each>
2117 </dc:filter> 1833 </dc:filter>
2118 <dc:filter expr="kind_id!=1"> 1834 <dc:filter expr="$kind_id != 1">
2119 <other> 1835 <dc:if test="dc:has-result()">
2120 <dc:for-each> 1836 <other>
2121 <floody factory="wmsfloodplainfactory" 1837 <dc:for-each>
2122 description="{$layer_name}" 1838 <floody factory="wmsfloodplainfactory" target_out="{$out}"
2123 ids="{$river_id};{$layer_name};{$kind_id}"/> 1839 description="{$layer_name}"
2124 </dc:for-each> 1840 ids="{$river_id};{$layer_name};{$kind_id}"/>
2125 </other> 1841 </dc:for-each>
1842 </other>
1843 </dc:if>
2126 </dc:filter> 1844 </dc:filter>
2127 </floodplain> 1845 </floodplain>
2128 </dc:if> 1846 </dc:if>
2129 </dc:context> 1847 </dc:context>
2130 </dc:macro> 1848 </dc:macro>
2135 availble 1853 availble
2136 </dc:comment> 1854 </dc:comment>
2137 1855
2138 <dc:macro name="hwspoints_by_kind_factory"> 1856 <dc:macro name="hwspoints_by_kind_factory">
2139 <dc:for-each> 1857 <dc:for-each>
2140 <hws factory="wmshwspointsfactory" 1858 <hws factory="wmshwspointsfactory" target_out="{$out}"
2141 ids="{$river_id};{$hws_name}" 1859 ids="{$river_id};{$hws_name}"
2142 name="{$hws_name}"/> 1860 name="{$hws_name}"/>
2143 </dc:for-each> 1861 </dc:for-each>
2144 </dc:macro> 1862 </dc:macro>
2145 1863
2266 availble 1984 availble
2267 </dc:comment> 1985 </dc:comment>
2268 1986
2269 <dc:macro name="hwslines_by_kind_factory"> 1987 <dc:macro name="hwslines_by_kind_factory">
2270 <dc:for-each> 1988 <dc:for-each>
2271 <hws factory="wmshwslinesfactory" 1989 <hws factory="wmshwslinesfactory" target_out="{$out}"
2272 ids="{$river_id};{$hws_name}" 1990 ids="{$river_id};{$hws_name}"
2273 name="{$hws_name}"/> 1991 name="{$hws_name}"/>
2274 </dc:for-each> 1992 </dc:for-each>
2275 </dc:macro> 1993 </dc:macro>
2276 1994
2401 </dc:statement> 2119 </dc:statement>
2402 <dc:if test="dc:has-result()"> 2120 <dc:if test="dc:has-result()">
2403 <floodmarks> 2121 <floodmarks>
2404 <dc:for-each> 2122 <dc:for-each>
2405 <floodmark name="{$year}" 2123 <floodmark name="{$year}"
2406 factory="wmsfloodmarkfactory" 2124 factory="wmsfloodmarkfactory" target_out="{$out}"
2407 ids="{$river_id};{$year};{$year}"/> 2125 ids="{$river_id};{$year};{$year}"/>
2408 </dc:for-each> 2126 </dc:for-each>
2409 </floodmarks> 2127 </floodmarks>
2410 </dc:if> 2128 </dc:if>
2411 </dc:context> 2129 </dc:context>
2412 </dc:macro> 2130 </dc:macro>
2413 2131
2414 <dc:macro name="catchments"> 2132 <dc:macro name="catchments">
2415 <catchments> 2133 <catchments>
2416 <catchment_wms factory="externalwmsfactory" 2134 <catchment_wms factory="externalwmsfactory" target_out="{$out}"
2417 ids="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiete (WMS)" /> 2135 ids="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiete (WMS)" />
2418 <dc:call-macro name="flood-map-gaugelocations"/> 2136 <dc:call-macro name="flood-map-gaugelocations"/>
2419 </catchments> 2137 </catchments>
2420 </dc:macro> 2138 </dc:macro>
2421 2139
2422 <dc:macro name="flood-map-gaugelocations"> 2140 <dc:macro name="flood-map-gaugelocations">
2423 <gaugelocations> 2141 <gaugelocations>
2424 <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)"/> 2142 <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)" target_out="{$out}" />
2425 <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)"/> 2143 <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)" target_out="{$out}" />
2426 <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)"/> 2144 <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)" target_out="{$out}" />
2427 <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)"/> 2145 <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)" target_out="{$out}" />
2428 </gaugelocations> 2146 </gaugelocations>
2429 </dc:macro> 2147 </dc:macro>
2430 2148
2431 <dc:macro name="flood-map-riveraxis"> 2149 <dc:macro name="flood-map-riveraxis">
2432 <dc:context> 2150 <dc:context>
2443 <axis> 2161 <axis>
2444 <dc:filter expr="$kind_id=1"> 2162 <dc:filter expr="$kind_id=1">
2445 <dc:for-each> 2163 <dc:for-each>
2446 <actual description="{$kind_name}" 2164 <actual description="{$kind_name}"
2447 ids="{$river_id};{$kind_name};{$kind_id}" 2165 ids="{$river_id};{$kind_name};{$kind_id}"
2448 factory="riveraxis"/> 2166 factory="riveraxis" target_out="{$out}" />
2449 </dc:for-each> 2167 </dc:for-each>
2450 </dc:filter> 2168 </dc:filter>
2451 <dc:filter expr="$kind_id!=1"> 2169 <dc:filter expr="$kind_id!=1">
2452 <other> 2170 <other>
2453 <dc:for-each> 2171 <dc:for-each>
2454 <misc-axis description="{$layer_name}" 2172 <misc-axis description="{$layer_name}"
2455 ids="{$river_id};{$layer_name};{$kind_id}" 2173 ids="{$river_id};{$layer_name};{$kind_id}"
2456 factory="riveraxis"/> 2174 factory="riveraxis" target_out="{$out}" />
2457 </dc:for-each> 2175 </dc:for-each>
2458 </other> 2176 </other>
2459 </dc:filter> 2177 </dc:filter>
2460 </axis> 2178 </axis>
2461 </dc:if> 2179 </dc:if>
2466 <dc:context> 2184 <dc:context>
2467 <dc:statement> 2185 <dc:statement>
2468 SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id} 2186 SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id}
2469 </dc:statement> 2187 </dc:statement>
2470 <dc:for-each> 2188 <dc:for-each>
2471 <kilometrage factory="wmskmfactory" ids="{$river_id}"/> 2189 <kilometrage factory="wmskmfactory" ids="{$river_id}" target_out="{$out}" />
2472 </dc:for-each> 2190 </dc:for-each>
2473 </dc:context> 2191 </dc:context>
2474 </dc:macro> 2192 </dc:macro>
2475 2193
2476 <dc:macro name="flood-map-fixpoints"> 2194 <dc:macro name="flood-map-fixpoints">
2480 FROM fixpoints 2198 FROM fixpoints
2481 WHERE river_id = ${river_id} 2199 WHERE river_id = ${river_id}
2482 GROUP BY name 2200 GROUP BY name
2483 </dc:statement> 2201 </dc:statement>
2484 <dc:for-each> 2202 <dc:for-each>
2485 <fixpoints factory="wmsfixpointsfactory" 2203 <fixpoints factory="wmsfixpointsfactory" target_out="{$out}"
2486 ids="{$river_id};{$name}"/> 2204 ids="{$river_id};{$name}"/>
2487 </dc:for-each> 2205 </dc:for-each>
2488 </dc:context> 2206 </dc:context>
2489 </dc:macro> 2207 </dc:macro>
2490 2208
2502 <dc:if test="dc:has-result()"> 2220 <dc:if test="dc:has-result()">
2503 <qps> 2221 <qps>
2504 <dc:filter expr="$kind_id=1"> 2222 <dc:filter expr="$kind_id=1">
2505 <dc:for-each> 2223 <dc:for-each>
2506 <actual description="{$kind_name}" 2224 <actual description="{$kind_name}"
2507 factory="wmsqpsfactory" 2225 factory="wmsqpsfactory" target_out="{$out}"
2508 ids="{$river_id};{$kind_name};{$kind_id}"/> 2226 ids="{$river_id};{$kind_name};{$kind_id}"/>
2509 </dc:for-each> 2227 </dc:for-each>
2510 </dc:filter> 2228 </dc:filter>
2511 <dc:filter expr="kind_id=0"> 2229 <dc:filter expr="$kind_id = 0">
2512 <other> 2230 <dc:if test="dc:has-result()">
2513 <dc:for-each> 2231 <other>
2514 <misc-qps description="{$layer_name}" 2232 <dc:for-each>
2515 factory="wmsqpsfactory" 2233 <misc-qps description="{$layer_name}"
2516 ids="{$river_id};{$layer_name};{$kind_id}"/> 2234 factory="wmsqpsfactory" target_out="{$out}"
2517 </dc:for-each> 2235 ids="{$river_id};{$layer_name};{$kind_id}"/>
2518 </other> 2236 </dc:for-each>
2237 </other>
2238 </dc:if>
2519 </dc:filter> 2239 </dc:filter>
2520 </qps> 2240 </qps>
2521 </dc:if> 2241 </dc:if>
2522 </dc:context> 2242 </dc:context>
2523 </dc:macro> 2243 </dc:macro>
2536 </dc:statement> 2256 </dc:statement>
2537 <dc:if test="dc:has-result()"> 2257 <dc:if test="dc:has-result()">
2538 <dc:filter expr="$building_kind_id!=0"> 2258 <dc:filter expr="$building_kind_id!=0">
2539 <dc:for-each> 2259 <dc:for-each>
2540 <buildings description="{$building_kind}" 2260 <buildings description="{$building_kind}"
2541 factory="wmsbuildingsfactory" 2261 factory="wmsbuildingsfactory" target_out="{$out}"
2542 ids="{$river_id};{$building_kind};{$building_kind_id}"/> 2262 ids="{$river_id};{$building_kind};{$building_kind_id}"/>
2543 </dc:for-each> 2263 </dc:for-each>
2544 </dc:filter> 2264 </dc:filter>
2545 <dc:filter expr="$building_kind_id=0"> 2265 <dc:filter expr="$building_kind_id=0">
2546 <other> 2266 <other>
2547 <dc:for-each> 2267 <dc:for-each>
2548 <buildings description="{$building_name}" 2268 <buildings description="{$building_name}"
2549 factory="wmsbuildingsfactory" 2269 factory="wmsbuildingsfactory" target_out="{$out}"
2550 ids="{$river_id};{$building_name}"/> 2270 ids="{$river_id};{$building_name}"/>
2551 </dc:for-each> 2271 </dc:for-each>
2552 </other> 2272 </other>
2553 </dc:filter> 2273 </dc:filter>
2554 </dc:if> 2274 </dc:if>
2564 </dc:statement> 2284 </dc:statement>
2565 <dc:if test="dc:has-result()"> 2285 <dc:if test="dc:has-result()">
2566 <jetties> 2286 <jetties>
2567 <dc:for-each> 2287 <dc:for-each>
2568 <jetty description="{$jetty_kind}" 2288 <jetty description="{$jetty_kind}"
2569 factory="wmsjettiesfactory" 2289 factory="wmsjettiesfactory" target_out="{$out}"
2570 ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/> 2290 ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/>
2571 </dc:for-each> 2291 </dc:for-each>
2572 </jetties> 2292 </jetties>
2573 </dc:if> 2293 </dc:if>
2574 </dc:context> 2294 </dc:context>
2617 <dc:for-each> 2337 <dc:for-each>
2618 <dc:element name="${olname}"> 2338 <dc:element name="${olname}">
2619 <dc:attribute name="name" value="${olname}"/> 2339 <dc:attribute name="name" value="${olname}"/>
2620 <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/> 2340 <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/>
2621 <dc:attribute name="factory" value="staticwkms"/> 2341 <dc:attribute name="factory" value="staticwkms"/>
2342 <dc:attribute name="target_out" value="${out}"/>
2622 <dc:attribute name="out" value="${out}"/> 2343 <dc:attribute name="out" value="${out}"/>
2623 </dc:element> 2344 </dc:element>
2624 </dc:for-each> 2345 </dc:for-each>
2625 </dc:context> 2346 </dc:context>
2626 </dc:for-each> 2347 </dc:for-each>
2638 w.id AS wst_id, 2359 w.id AS wst_id,
2639 wc.id AS wst_column_id, 2360 wc.id AS wst_column_id,
2640 wc.position AS wst_column_position, 2361 wc.position AS wst_column_position,
2641 wc.description AS info, 2362 wc.description AS info,
2642 w.description AS wst_description, 2363 w.description AS wst_description,
2643 wc.name AS wst_column_name, 2364 COALESCE(wc.name, '') AS wst_column_name,
2644 wr.a AS deffrom, 2365 wr.a AS deffrom,
2645 wr.b AS defto 2366 wr.b AS defto
2646 FROM wst_columns wc 2367 FROM wst_columns wc
2647 JOIN wsts w ON wc.wst_id = w.id 2368 JOIN wsts w ON wc.wst_id = w.id
2648 JOIN wst_ranges wr ON wc.id = wr.wst_column_id 2369 JOIN wst_ranges wr ON wc.id = wr.wst_column_id
2651 </dc:statement> 2372 </dc:statement>
2652 <dc:macro-body/> 2373 <dc:macro-body/>
2653 </dc:context> 2374 </dc:context>
2654 </dc:macro> 2375 </dc:macro>
2655 2376
2656 <dc:macro name="km-filtered-userdata"> 2377 <dc:macro name="all-user-artifacts">
2657 <dc:context connection="user"> 2378 <dc:context connection="user">
2658 <dc:comment>Select collections and masterartifacts.</dc:comment> 2379 <dc:comment>Select collections and masterartifacts.</dc:comment>
2659 <dc:statement> 2380 <dc:statement>
2660 SELECT c.name AS collection_name, 2381 SELECT c.name AS collection_name,
2661 ma.id AS a_id, 2382 ma.id AS a_id,
2663 ma.gid AS a_gid, 2384 ma.gid AS a_gid,
2664 ma.creation AS a_creation, 2385 ma.creation AS a_creation,
2665 COALESCE(ma.ld_mode, '') AS ld_m, 2386 COALESCE(ma.ld_mode, '') AS ld_m,
2666 COALESCE(ma.ld_locations, '') AS ld_l, 2387 COALESCE(ma.ld_locations, '') AS ld_l,
2667 COALESCE(ma.ld_from, '') AS ld_f, 2388 COALESCE(ma.ld_from, '') AS ld_f,
2668 COALESCE(ma.ld_to, '') AS ld_t 2389 COALESCE(ma.ld_to, '') AS ld_t,
2390 o.name AS out_name,
2391 o.id AS out_id,
2392 f.name AS facet_name,
2393 f.num AS facet_num,
2394 f.description AS facet_description,
2395 f.id AS fid
2669 FROM users u 2396 FROM users u
2670 JOIN collections c ON c.user_id = u.id 2397 JOIN collections c ON c.user_id = u.id
2671 JOIN master_artifacts_range ma ON ma.collection_id = c.id 2398 JOIN master_artifacts_range ma ON ma.collection_id = c.id
2399 JOIN outs o ON o.artifact_id = ma.id
2400 JOIN facets f ON f.out_id = o.id
2672 WHERE u.gid = CAST(${user-id} AS UUID) 2401 WHERE u.gid = CAST(${user-id} AS UUID)
2673 AND ma.gid &lt;&gt; CAST(${artifact-id} AS uuid) 2402 AND ma.gid &lt;&gt; CAST(${artifact-id} AS uuid)
2674 AND EXISTS ( 2403 AND EXISTS (
2675 SELECT id 2404 SELECT id
2676 FROM artifact_data ad 2405 FROM artifact_data ad
2677 WHERE ad.artifact_id = ma.id 2406 WHERE ad.artifact_id = ma.id
2678 AND k = 'river' 2407 AND k = 'river'
2679 AND v = ${river}) 2408 AND v = ${river})
2680 </dc:statement> 2409 </dc:statement>
2681 <dc:for-each> 2410 <dc:virtual-column name="deffrom" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)">
2682 <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/> 2411 <dc:virtual-column name="defto" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)">
2683 <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/> 2412 <dc:macro-body/>
2684 <dc:if test="not (($tokm &lt; $from) or $fromkm &gt; $tokm)"> 2413 </dc:virtual-column>
2685 <dc:macro-body/> 2414 </dc:virtual-column>
2686 </dc:if>
2687 </dc:for-each>
2688 </dc:context> 2415 </dc:context>
2689 </dc:macro> 2416 </dc:macro>
2690 2417
2691 <dc:macro name="user-range"> 2418 <dc:macro name="km-filtered-user-artifacts">
2692 <dc:choose> 2419 <dc:filter expr="not($deffrom &gt; $tokm or $defto &lt; $fromkm)">
2693 <dc:when test="dc:contains($parameters, 'user-id')"> 2420 <dc:macro-body/>
2694 <dc:context connection="user"> 2421 </dc:filter>
2695 <dc:statement> 2422 </dc:macro>
2696 SELECT COALESCE(ld_mode, '') AS ldm, 2423
2697 COALESCE(ld_locations, '') AS ldl, 2424 <dc:macro name="artifact-range">
2698 COALESCE(ld_from, '') AS ldf, 2425 <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
2699 COALESCE(ld_to, '') AS ldt 2426 <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
2700 FROM master_artifacts_range 2427 <dc:macro-body/>
2701 WHERE gid = CAST(${artifact-id} AS uuid)
2702 </dc:statement>
2703 <dc:for-each>
2704 <dc:variable name="fromkm" type="number" expr="dc:fromValue($ldm, $ldl, $ldf)"/>
2705 <dc:variable name="tokm" type="number" expr="dc:toValue($ldm, $ldl, $ldt)"/>
2706 <dc:macro-body/>
2707 </dc:for-each>
2708 </dc:context>
2709 </dc:when>
2710 <dc:otherwise>
2711 <dc:variable name="fromkm" type="number" expr="dc:fromValue('', '', '')"/>
2712 <dc:variable name="tokm" type="number" expr="dc:toValue('', '', '')"/>
2713 <dc:macro-body/>
2714 </dc:otherwise>
2715 </dc:choose>
2716 </dc:macro> 2428 </dc:macro>
2717 2429
2718 </datacage> 2430 </datacage>
2719 </dc:template> 2431 </dc:template>

http://dive4elements.wald.intevation.org