comparison flys-artifacts/doc/conf/meta-data.xml @ 2424:092e519ff461

merged flys-artifacts/2.6.1
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:26 +0200
parents 867ebe191799
children 700f28bfd7ef
comparison
equal deleted inserted replaced
2392:8112ec686a9a 2424:092e519ff461
1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
3 <datacage>
4 <dc:macro name="load-system">
5 <dc:context connection="system">
6 <dc:statement>
7 SELECT id AS river_id, name as river_name FROM rivers
8 WHERE lower(name) LIKE lower(${river})
9 </dc:statement>
10 <dc:elements>
11 <dc:comment>
12 Base-data macros (mostly data imported from wst-files)
13 </dc:comment>
14 <dc:macro name="basedata_0">
15 <dc:comment comment=" BASEDATA ---------------------------"/>
16 <basedata>
17 <dc:context>
18 <dc:statement>
19 SELECT id AS prot_id,
20 description AS prot_description
21 FROM wsts WHERE kind = 0 AND river_id = ${river_id}
22 </dc:statement>
23 <dc:elements>
24 <basedata>
25 <dc:attribute name="name" value="${prot_description}"/>
26 <dc:context>
27 <dc:statement>
28 SELECT id AS prot_column_id,
29 name AS prot_column_name,
30 position AS prot_rel_pos
31 FROM wst_columns WHERE wst_id = ${prot_id}
32 ORDER by position
33 </dc:statement>
34 <dc:elements>
35 <column>
36 <dc:attribute name="name" value="${prot_column_name}"/>
37 <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/>
38 <dc:attribute name="factory" value="staticwkms"/>
39 </column>
40 </dc:elements>
41 </dc:context>
42 </basedata>
43 </dc:elements>
44 </dc:context>
45 </basedata>
46 </dc:macro>
47 <dc:macro name="basedata_0_wq">
48 <dc:comment comment=" BASEDATA ---------------------------"/>
49 <basedata>
50 <dc:context>
51 <dc:statement>
52 SELECT id AS prot_id,
53 description AS prot_description
54 FROM wsts WHERE kind = 0 AND river_id = ${river_id}
55 </dc:statement>
56 <dc:elements>
57 <basedata>
58 <dc:attribute name="name" value="${prot_description}"/>
59 <dc:context>
60 <dc:statement>
61 SELECT id AS prot_column_id,
62 name AS prot_column_name,
63 position AS prot_rel_pos
64 FROM wst_columns WHERE wst_id = ${prot_id}
65 ORDER by position
66 </dc:statement>
67 <dc:elements>
68 <column>
69 <dc:attribute name="name" value="${prot_column_name}"/>
70 <dc:attribute name="ids" value="base_data-wstv-${prot_rel_pos}-${prot_id}"/>
71 <dc:attribute name="factory" value="wqinterpol"/>
72 </column>
73 </dc:elements>
74 </dc:context>
75 </basedata>
76 </dc:elements>
77 </dc:context>
78 </basedata>
79 </dc:macro>
80
81 <dc:macro name="basedata_1_additionals">
82 <dc:comment comment=".ZUS -------------------------------"/>
83 <additionals>
84 <dc:context>
85 <dc:statement>
86 SELECT id AS prot_id,
87 description AS prot_description
88 FROM wsts WHERE kind = 1 AND river_id = ${river_id}
89 </dc:statement>
90 <dc:elements>
91 <additional>
92 <dc:attribute name="name" value="${prot_description}"/>
93 <dc:context>
94 <dc:statement>
95 SELECT id AS prot_column_id,
96 name AS prot_column_name,
97 position AS prot_rel_pos
98 FROM wst_columns WHERE wst_id = ${prot_id}
99 ORDER by position
100 </dc:statement>
101 <dc:elements>
102 <column>
103 <dc:attribute name="name" value="${prot_column_name}"/>
104 <dc:attribute name="ids" value="additionals-wstv-${prot_rel_pos}-${prot_id}"/>
105 <dc:attribute name="factory" value="staticwkms"/>
106 </column>
107 </dc:elements>
108 </dc:context>
109 </additional>
110 </dc:elements>
111 </dc:context>
112 </additionals>
113 </dc:macro>
114
115 <dc:macro name="basedata_2_fixations_wst">
116 <fixations>
117 <dc:context>
118 <dc:statement>
119 SELECT id AS prot_id,
120 description AS prot_description
121 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
122 </dc:statement>
123 <dc:elements>
124 <fixation>
125 <dc:attribute name="name" value="${prot_description}"/>
126 <dc:attribute name="ids" value="fixations-wstv-A-${prot_id}"/>
127 <dc:attribute name="factory" value="wqinterpol"/>
128 </fixation>
129 </dc:elements>
130 </dc:context>
131 </fixations>
132 </dc:macro>
133
134 <dc:macro name="basedata_2_fixations_wqkms">
135 <fixations>
136 <dc:context>
137 <dc:statement>
138 SELECT id AS prot_id,
139 description AS prot_description
140 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
141 </dc:statement>
142 <dc:elements>
143 <fixation>
144 <dc:attribute name="name" value="${prot_description}"/>
145 <dc:context>
146 <dc:statement>
147 SELECT id AS prot_column_id,
148 name AS prot_column_name,
149 position AS prot_rel_pos
150 FROM wst_columns WHERE wst_id = ${prot_id}
151 ORDER by position
152 </dc:statement>
153 <dc:elements>
154 <column>
155 <dc:attribute name="name" value="${prot_column_name}"/>
156 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
157 <dc:attribute name="factory" value="wqinterpol"/>
158 </column>
159 </dc:elements>
160 </dc:context>
161 </fixation>
162 </dc:elements>
163 </dc:context>
164 </fixations>
165 </dc:macro>
166
167 <dc:macro name="basedata_2_fixations">
168 <fixations>
169 <dc:context>
170 <dc:statement>
171 SELECT id AS prot_id,
172 description AS prot_description
173 FROM wsts WHERE kind = 2 AND river_id = ${river_id}
174 </dc:statement>
175 <dc:elements>
176 <fixation>
177 <dc:attribute name="name" value="${prot_description}"/>
178 <dc:context>
179 <dc:statement>
180 SELECT id AS prot_column_id,
181 name AS prot_column_name,
182 position AS prot_rel_pos
183 FROM wst_columns WHERE wst_id = ${prot_id}
184 ORDER by position
185 </dc:statement>
186 <dc:elements>
187 <column>
188 <dc:attribute name="name" value="${prot_column_name}"/>
189 <dc:attribute name="ids" value="fixations-wstv-${prot_rel_pos}-${prot_id}"/>
190 <dc:attribute name="factory" value="staticwkms"/>
191 </column>
192 </dc:elements>
193 </dc:context>
194 </fixation>
195 </dc:elements>
196 </dc:context>
197 </fixations>
198 </dc:macro>
199
200 <dc:macro name="basedata_4_heightmarks-points">
201 <heightmarks>
202 <dc:context>
203 <dc:statement>
204 SELECT id AS prot_id,
205 description AS prot_description
206 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
207 </dc:statement>
208 <dc:elements>
209 <heightmark>
210 <dc:attribute name="name" value="${prot_description}"/>
211 <dc:context>
212 <dc:statement>
213 SELECT id AS prot_column_id,
214 name AS prot_column_name,
215 position AS prot_rel_pos
216 FROM wst_columns WHERE wst_id = ${prot_id}
217 ORDER by position
218 </dc:statement>
219 <dc:elements>
220 <column>
221 <dc:attribute name="name" value="${prot_column_name}"/>
222 <dc:attribute name="ids" value="heightmarks_points-wstv-${prot_rel_pos}-${prot_id}"/>
223 <dc:attribute name="factory" value="staticwkms"/>
224 </column>
225 </dc:elements>
226 </dc:context>
227 </heightmark>
228 </dc:elements>
229 </dc:context>
230 </heightmarks>
231 </dc:macro>
232
233 <dc:macro name="basedata_4_heightmarks-wq">
234 <heightmarks>
235 <dc:context>
236 <dc:statement>
237 SELECT id AS prot_id,
238 description AS prot_description
239 FROM wsts WHERE kind = 4 AND river_id = ${river_id}
240 </dc:statement>
241 <dc:elements>
242 <heightmark>
243 <dc:attribute name="name" value="${prot_description}"/>
244 <dc:context>
245 <dc:statement>
246 SELECT id AS prot_column_id,
247 name AS prot_column_name,
248 position AS prot_rel_pos
249 FROM wst_columns WHERE wst_id = ${prot_id}
250 ORDER by position
251 </dc:statement>
252 <dc:elements>
253 <column>
254 <dc:attribute name="name" value="${prot_column_name}"/>
255 <dc:attribute name="ids" value="heightmarks_annotations-wstv-${prot_rel_pos}-${prot_id}"/>
256 <dc:attribute name="factory" value="wqinterpol"/>
257 </column>
258 </dc:elements>
259 </dc:context>
260 </heightmark>
261 </dc:elements>
262 </dc:context>
263 </heightmarks>
264 </dc:macro>
265
266 <dc:macro name="basedata_5_flood-protections">
267 <flood_protections>
268 <dc:attribute name="id" value="flood-protections-${river_id}"/>
269 <dc:context>
270 <dc:statement>
271 SELECT id AS prot_id,
272 description AS prot_description
273 FROM wsts WHERE kind = 5 AND river_id = ${river_id}
274 </dc:statement>
275 <dc:elements>
276 <flood_protection>
277 <dc:attribute name="name" value="${prot_description}"/>
278 <dc:attribute name="db-id" value="${prot_id}"/>
279 <dc:attribute name="factory" value="staticwkms"/>
280 <columns>
281 <dc:context>
282 <dc:statement>
283 SELECT id AS prot_column_id,
284 name AS prot_column_name,
285 position AS prot_rel_pos
286 FROM wst_columns WHERE wst_id = ${prot_id}
287 ORDER by position
288 </dc:statement>
289 <dc:elements>
290 <column>
291 <dc:attribute name="name" value="${prot_column_name}"/>
292 <dc:attribute name="ids" value="flood_protection-wstv-${prot_rel_pos}-${prot_id}"/>
293 <dc:attribute name="factory" value="staticwkms"/>
294 </column>
295 </dc:elements>
296 </dc:context>
297 </columns>
298 </flood_protection>
299 </dc:elements>
300 </dc:context>
301 </flood_protections>
302 </dc:macro>
303
304 <dc:macro name="mainvalues">
305 <mainvalue>
306 <dc:attribute name="factory" value="mainvalue"/>
307 <dc:attribute name="ids" value="${river_id}"/>
308 </mainvalue>
309 </dc:macro>
310
311 <dc:macro name="annotations">
312 <annotation>
313 <dc:attribute name="factory" value="annotations"/>
314 <dc:attribute name="ids" value="${river_id}"/>
315 </annotation>
316 </dc:macro>
317
318 <dc:macro name="cross_sections">
319 <cross_sections>
320 <dc:attribute name="id" value="flood-protections-${river_id}"/>
321 <dc:context>
322 <dc:statement>
323 SELECT id AS prot_id,
324 description AS prot_description
325 FROM cross_sections WHERE river_id = ${river_id}
326 </dc:statement>
327 <dc:elements>
328 <cross_section>
329 <dc:attribute name="name" value="${prot_description}"/>
330 <dc:attribute name="ids" value="${prot_id}"/>
331 <dc:attribute name="factory" value="crosssections"/>
332 </cross_section>
333 </dc:elements>
334 </dc:context>
335 </cross_sections>
336 </dc:macro>
337
338 <dc:macro name="hyks">
339 <hyks>
340 <dc:attribute name="id" value="hyk-${river_id}"/>
341 <dc:context>
342 <dc:statement>
343 SELECT id AS hyk_id,
344 description AS hyk_description
345 FROM hyks WHERE river_id = ${river_id}
346 </dc:statement>
347 <dc:elements>
348 <hyk>
349 <dc:attribute name="name" value="${hyk_description}"/>
350 <dc:attribute name="ids" value="${hyk_id}"/>
351 <dc:attribute name="factory" value="hyk"/>
352 </hyk>
353 </dc:elements>
354 </dc:context>
355 </hyks>
356 </dc:macro>
357
358 <dc:comment>
359
360 + River-Node
361
362 </dc:comment>
363
364 <river>
365 <dc:attribute name="name" value="${river_name}"/>
366
367 <dc:choose>
368 <dc:when test="dc:contains($parameters, 'recommended')">
369 <dc:comment>
370 Recommendations (client shall load immediately).
371 </dc:comment>
372 <dc:if test="dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section'))">
373 <dc:call-macro name="annotations"/>
374 </dc:if>
375 <dc:if test="dc:contains($artifact-outs, 'cross_section')">
376 <dc:call-macro name="cross_sections"/>
377 <dc:call-macro name="hyks"/>
378 </dc:if>
379 </dc:when>
380 <dc:otherwise>
381 <dc:comment>
382 Non - Recommendations.
383 </dc:comment>
384 <dc:if test="dc:contains($artifact-outs, 'cross_section')">
385 <dc:call-macro name="basedata_0"/>
386 <dc:call-macro name="basedata_1_additionals"/>
387 <dc:call-macro name="cross_sections"/>
388 </dc:if>
389 <dc:if test="dc:contains($artifact-outs, 'discharge_longitudinal_section')">
390 <dc:call-macro name="basedata_0"/>
391 <dc:call-macro name="basedata_4_heightmarks-points"/>
392 </dc:if>
393 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
394 <dc:call-macro name="basedata_0_wq"/>
395 <dc:call-macro name="basedata_4_heightmarks-wq"/>
396 </dc:if>
397 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences'))">
398 <dc:call-macro name="basedata_0"/>
399 <dc:call-macro name="basedata_1_additionals"/>
400 <dc:comment comment=" FIXATIONS ---------------------------"/>
401 <dc:call-macro name="basedata_2_fixations"/>
402 <dc:comment comment=" HOEHENMARKEN ---------------------------"/>
403 <dc:call-macro name="basedata_4_heightmarks-points"/>
404 <dc:call-macro name="annotations"/>
405 </dc:if>
406 <dc:comment comment="--- non-recommendations---"/>
407 </dc:otherwise>
408 </dc:choose>
409
410
411 <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
412
413 <!-- base data -->
414 <dc:call-macro name="basedata_0"/>
415
416 <!-- extra-longitudinal-sections -->
417 <dc:call-macro name="basedata_1_additionals"/>
418
419 <!-- fixations -->
420 <dc:call-macro name="basedata_2_fixations"/>
421
422 <!-- flood water marks-->
423 <dc:call-macro name="basedata_4_heightmarks-points"/>
424
425 <!-- flood protection -->
426 <dc:call-macro name="basedata_5_flood-protections"/>
427
428 </dc:if>
429 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and (dc:contains($parameters, 'recommended'))">
430 <!--dc:call-macro name="basedata_2_fixations_wst"/-->
431 </dc:if>
432
433 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve') and not (dc:contains($parameters, 'recommended'))">
434 <discharge_table_nn>
435 <discharge_table_gauge>
436 <dc:context>
437 <dc:statement>
438 SELECT id AS gauge_id,
439 name AS gauge_name
440 FROM gauges WHERE river_id = ${river_id}
441 </dc:statement>
442 <dc:elements>
443 <gauge>
444 <dc:attribute name="name" value="${gauge_name}"/>
445 <dc:attribute name="db-id" value="${gauge_id}"/>
446 <dc:context>
447 <dc:statement>
448 SELECT description AS gauge_desc,
449 d.id AS discharge_id,
450 ti.start_time AS g_start,
451 ti.stop_time AS g_stop
452 FROM discharge_tables d JOIN time_intervals ti
453 ON d.time_interval_id = ti.id
454 WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
455 </dc:statement>
456 <dc:elements>
457 <historical>
458 <dc:attribute name="name" value="${gauge_desc}"/>
459 <dc:attribute name="from" value="${g_start}"/>
460 <dc:attribute name="to" value="${g_stop}"/>
461 <dc:attribute name="db-id" value="${discharge_id}"/></historical>
462 </dc:elements>
463 </dc:context>
464 </gauge>
465 </dc:elements>
466 </dc:context>
467 </discharge_table_gauge>
468
469 </discharge_table_nn>
470
471 <dc:call-macro name="basedata_2_fixations_wst"/>
472
473 <dc:call-macro name="basedata_5_flood-protections"/>
474
475 <!-- former waterlevels -->
476 <dc:call-macro name="basedata_0"/>
477
478 <dc:call-macro name="basedata_1_additionals"/>
479
480 <!-- former flood-water-marks -->
481 <dc:call-macro name="basedata_4_heightmarks-points"/>
482 </dc:if>
483 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')"><!-- or (dc:contains($artifact-outs, 'discharge_curve'))"-->
484 <!-- && parameter contains recommended/ation -->
485 <computed_discharge_curve>
486 <dc:call-macro name="mainvalues"/>
487 </computed_discharge_curve>
488 <dc:call-macro name="basedata_2_fixations_wst"/>
489 </dc:if>
490
491 <dc:if test="dc:contains($artifact-outs, 'duration_curve')">
492 <dc:call-macro name="mainvalues"/>
493 </dc:if>
494
495 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section')">
496 <longitudinal_section>
497 <dc:call-macro name="annotations"/>
498 </longitudinal_section>
499 </dc:if>
500 <dc:if test="dc:contains($artifact-outs, 'map')">
501 <map>
502 <dc:choose>
503 <dc:when test="dc:contains($parameters, 'recommended')">
504 </dc:when>
505 <dc:otherwise>
506 <dc:call-macro name="flood-map-complete"/>
507 </dc:otherwise>
508 </dc:choose>
509 </map>
510 </dc:if>
511 <dc:if test="dc:contains($artifact-outs, 'floodmap')">
512 <floodmap>
513 <dc:choose>
514 <dc:when test="dc:contains($parameters, 'recommended')">
515 <dc:call-macro name="flood-map-recommended"/>
516 </dc:when>
517 <dc:when test="dc:contains($parameters, 'dem')">
518 <dc:call-macro name="flood-map-dem"/>
519 </dc:when>
520 <dc:otherwise>
521 <dc:call-macro name="flood-map-complete"/>
522 </dc:otherwise>
523 </dc:choose>
524 </floodmap>
525 <dc:macro name="flood-map-recommended">
526 <dc:comment>
527 FIXME: Following two macros look identical to me.
528 </dc:comment>
529 <kilometrage>
530 <riveraxis>
531 <dc:attribute name="factory" value="riveraxis"/>
532 <dc:attribute name="ids" value="${river_id}"/>
533 </riveraxis>
534 </kilometrage>
535 <rastermap>
536 <background>
537 <dc:attribute name="factory" value="wmsbackground"/>
538 <dc:attribute name="ids" value="${river_id}"/>
539 </background>
540 </rastermap>
541 </dc:macro>
542 <dc:macro name="flood-map-dem">
543 <dems>
544 <dc:context>
545 <dc:statement>
546 SELECT id AS dem_id,
547 lower AS dem_lower,
548 upper AS dem_upper
549 FROM dem WHERE river_id = ${river_id}
550 </dc:statement>
551 <dc:elements>
552 <dem>
553 <dc:attribute name="factory" value="demfactory"/>
554 <dc:attribute name="ids" value="${dem_id}"/>
555 <dc:attribute name="description" value="${dem_lower}-${dem_upper}"/>
556 </dem>
557 </dc:elements>
558 </dc:context>
559 </dems>
560 </dc:macro>
561 <dc:macro name="flood-map-km">
562 <dc:context>
563 <dc:statement>
564 SELECT count(*) as km_exists
565 FROM river_axes_km WHERE river_id = ${river_id}
566 </dc:statement>
567 <dc:elements>
568 <dc:if test="$km_exists>0">
569 <km>
570 <dc:attribute name="factory" value="wmskmfactory"/>
571 <dc:attribute name="ids" value="${river_id}"/>
572 </km>
573 </dc:if>
574 </dc:elements>
575 </dc:context>
576 </dc:macro>
577 <dc:macro name="flood-map-qps">
578 <dc:context>
579 <dc:statement>
580 SELECT count(*) as km_exists
581 FROM cross_section_tracks WHERE river_id = ${river_id}
582 </dc:statement>
583 <dc:elements>
584 <dc:if test="$km_exists>0">
585 <qps>
586 <dc:attribute name="factory" value="wmsqpsfactory"/>
587 <dc:attribute name="ids" value="${river_id}"/>
588 </qps>
589 </dc:if>
590 </dc:elements>
591 </dc:context>
592 </dc:macro>
593 <dc:macro name="flood-map-hws">
594 <dc:context>
595 <dc:statement>
596 SELECT count(*) as km_exists
597 FROM hws WHERE river_id = ${river_id}
598 </dc:statement>
599 <dc:elements>
600 <dc:if test="$km_exists>0">
601 <hws>
602 <dc:attribute name="factory" value="wmshwsfactory"/>
603 <dc:attribute name="ids" value="${river_id}"/>
604 </hws>
605 </dc:if>
606 </dc:elements>
607 </dc:context>
608 </dc:macro>
609 <dc:macro name="flood-map-catchments">
610 <dc:context>
611 <dc:statement>
612 SELECT count(*) as km_exists
613 FROM catchment WHERE river_id = ${river_id}
614 </dc:statement>
615 <dc:elements>
616 <dc:if test="$km_exists>0">
617 <catchments>
618 <dc:attribute name="factory" value="wmscatchmentfactory"/>
619 <dc:attribute name="ids" value="${river_id}"/>
620 </catchments>
621 </dc:if>
622 </dc:elements>
623 </dc:context>
624 </dc:macro>
625 <dc:macro name="flood-map-floodplain">
626 <dc:context>
627 <dc:statement>
628 SELECT count(*) as km_exists
629 FROM floodplain WHERE river_id = ${river_id}
630 </dc:statement>
631 <dc:elements>
632 <dc:if test="$km_exists>0">
633 <floodplain>
634 <dc:attribute name="factory" value="wmsfloodplainfactory"/>
635 <dc:attribute name="ids" value="${river_id}"/>
636 </floodplain>
637 </dc:if>
638 </dc:elements>
639 </dc:context>
640 </dc:macro>
641 <dc:macro name="flood-map-lines">
642 <dc:context>
643 <dc:statement>
644 SELECT count(*) as km_exists
645 FROM lines WHERE river_id = ${river_id}
646 </dc:statement>
647 <dc:elements>
648 <dc:if test="$km_exists>0">
649 <lines>
650 <dc:attribute name="factory" value="wmslinefactory"/>
651 <dc:attribute name="ids" value="${river_id}"/>
652 </lines>
653 </dc:if>
654 </dc:elements>
655 </dc:context>
656 </dc:macro>
657 <dc:macro name="flood-map-buildings">
658 <dc:context>
659 <dc:statement>
660 SELECT count(*) as km_exists
661 FROM buildings WHERE river_id = ${river_id}
662 </dc:statement>
663 <dc:elements>
664 <dc:if test="$km_exists>0">
665 <buildings>
666 <dc:attribute name="factory" value="wmsbuildingsfactory"/>
667 <dc:attribute name="ids" value="${river_id}"/>
668 </buildings>
669 </dc:if>
670 </dc:elements>
671 </dc:context>
672 </dc:macro>
673 <dc:macro name="flood-map-fixpoints">
674 <dc:context>
675 <dc:statement>
676 SELECT count(*) as km_exists
677 FROM fixpoints WHERE river_id = ${river_id}
678 </dc:statement>
679 <dc:elements>
680 <dc:if test="$km_exists>0">
681 <fixpoints>
682 <dc:attribute name="factory" value="wmsfixpointsfactory"/>
683 <dc:attribute name="ids" value="${river_id}"/>
684 </fixpoints>
685 </dc:if>
686 </dc:elements>
687 </dc:context>
688 </dc:macro>
689 <dc:macro name="flood-map-complete">
690 <kilometrage>
691 <riveraxis>
692 <dc:attribute name="factory" value="riveraxis"/>
693 <dc:attribute name="ids" value="${river_id}"/>
694 </riveraxis>
695 <dc:call-macro name="flood-map-km"/>
696 <dc:call-macro name="flood-map-qps"/>
697 <dc:call-macro name="flood-map-hws"/>
698 <dc:call-macro name="flood-map-catchments"/>
699 <dc:call-macro name="flood-map-floodplain"/>
700 <dc:call-macro name="flood-map-lines"/>
701 <dc:call-macro name="flood-map-buildings"/>
702 <dc:call-macro name="flood-map-fixpoints"/>
703 </kilometrage>
704 <rastermap>
705 <background>
706 <dc:attribute name="factory" value="wmsbackground"/>
707 <dc:attribute name="ids" value="${river_id}"/>
708 </background>
709 </rastermap>
710 </dc:macro>
711 </dc:if>
712 </river>
713 </dc:elements>
714 </dc:context>
715 </dc:macro>
716
717 <dc:choose>
718 <dc:comment>
719 User specific part
720 ------------------
721 </dc:comment>
722 <dc:when test="dc:contains($parameters, 'user-id')">
723
724
725 <old_calculations>
726 <dc:context connection="user">
727 <dc:comment>
728 Get the user and collection-id.
729 </dc:comment>
730 <dc:statement>
731 SELECT u.id AS user_id, c.id AS collection_id, c.name as collection_name
732 FROM collections c JOIN users u ON c.user_id = u.id
733 WHERE u.gid = CAST(${user-id} AS uuid)
734 ORDER BY c.creation DESC
735 </dc:statement>
736
737
738 <dc:comment>
739 SHOW W-DIFFERENCES
740 </dc:comment>
741
742 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'w_differences') or (dc:contains($artifact-outs, 'discharge_longitudinal_section')))">
743 <differences>
744 <dc:elements>
745 <dc:context>
746 <dc:statement>
747 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation
748 FROM master_artifacts m
749 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
750 AND EXISTS (
751 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
752 </dc:statement>
753 <dc:elements>
754 <dc:context>
755 <dc:statement>
756 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description
757 FROM outs as o, facets as f, artifacts as a
758 WHERE f.name = 'w_differences' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
759 </dc:statement>
760 <dc:elements>
761 <dc:element name="${facet_name}">
762 <dc:attribute name="description" value="${facet_description}"/>
763 <dc:attribute name="factory" value="winfo"/>
764 <dc:attribute name="artifact-id" value="${aid}"/>
765 <dc:attribute name="ids" value="${aid}"/>
766 <dc:attribute name="out" value="w_differences"/>
767 </dc:element>
768 </dc:elements>
769 </dc:context>
770 </dc:elements>
771 </dc:context>
772 </dc:elements>
773 </differences>
774 </dc:if>
775
776 <dc:if test="dc:contains($artifact-outs, 'computed_discharge_curve')">
777 <computed_discharge_curves>
778 <dc:elements>
779 <dc:context>
780 <dc:statement>
781 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation
782 FROM master_artifacts m
783 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
784 AND EXISTS (
785 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
786 </dc:statement>
787 <dc:elements>
788 <dc:context>
789 <dc:statement>
790 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description
791 FROM outs as o, facets as f, artifacts as a
792 WHERE f.name = 'computed_discharge_curve.q' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
793 </dc:statement>
794 <dc:elements>
795 <dc:element name="${facet_name}">
796 <dc:attribute name="description" value="${facet_description}"/>
797 <dc:attribute name="factory" value="winfo"/>
798 <dc:attribute name="artifact-id" value="${aid}"/>
799 <dc:attribute name="ids" value="${aid}"/>
800 <dc:attribute name="out" value="computed_discharge_curve"/>
801 </dc:element>
802 </dc:elements>
803 </dc:context>
804 </dc:elements>
805 </dc:context>
806 </dc:elements>
807 </computed_discharge_curves>
808 </dc:if>
809
810
811 <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))">
812 <waterlevels>
813 <dc:elements>
814 <dc:context>
815 <dc:statement>
816 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation
817 FROM master_artifacts m
818 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
819 AND EXISTS (
820 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
821 </dc:statement>
822 <dc:elements>
823 <dc:context>
824 <dc:statement>
825 SELECT id AS out_id
826 FROM outs
827 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
828 </dc:statement>
829 <dc:elements>
830 <dc:context>
831 <dc:statement>
832 SELECT name AS facet_name, num as facet_num, description AS facet_description
833 FROM facets
834 WHERE out_id = ${out_id}
835 ORDER BY num ASC, name DESC
836 </dc:statement>
837 <longitudinal_section_columns>
838 <dc:attribute name="description" value="${river} ${a_creation}"/>
839 <dc:elements>
840 <dc:element name="${facet_name}">
841 <dc:attribute name="description" value="${facet_description}"/>
842 <dc:attribute name="ids" value="${facet_num}"/>
843 <dc:attribute name="factory" value="winfo"/>
844 <dc:attribute name="artifact-id" value="${a_gid}"/>
845 <dc:attribute name="out" value="longitudinal_section"/>
846 </dc:element>
847 </dc:elements>
848 </longitudinal_section_columns>
849 </dc:context>
850 </dc:elements>
851 </dc:context>
852 </dc:elements>
853 </dc:context>
854 </dc:elements>
855 </waterlevels>
856 </dc:if>
857
858 <dc:comment>
859 WATERLEVELS - ONLY SHOW Ws
860 </dc:comment>
861
862 <dc:if test="dc:contains($artifact-outs, 'waterlevels')">
863 <waterlevels>
864 <dc:elements>
865 <dc:context>
866 <dc:statement>
867 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation
868 FROM master_artifacts m
869 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
870 AND EXISTS (
871 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
872 </dc:statement>
873 <dc:elements>
874
875 <dc:context>
876 <dc:statement>
877 SELECT id AS out_id
878 FROM outs
879 WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
880 </dc:statement>
881 <dc:elements>
882 <dc:context>
883 <dc:statement>
884 SELECT name AS facet_name, num as facet_num, description AS facet_description
885 FROM facets
886 WHERE out_id = ${out_id} and name = 'longitudinal_section.w'
887 ORDER BY num ASC, name DESC
888 </dc:statement>
889 <waterlevels>
890 <dc:attribute name="description" value="${river} ${a_creation} ${collection_name}"/>
891 <dc:elements>
892 <dc:element name="${facet_name}">
893 <dc:attribute name="description" value="${facet_description}"/>
894 <dc:attribute name="ids" value="${facet_num}"/>
895 <dc:attribute name="factory" value="winfo"/>
896 <dc:attribute name="artifact-id" value="${a_gid}"/>
897 <dc:attribute name="out" value="longitudinal_section"/>
898 </dc:element>
899 </dc:elements>
900 </waterlevels>
901 </dc:context>
902 </dc:elements>
903 </dc:context>
904 </dc:elements>
905 </dc:context>
906 </dc:elements>
907 </waterlevels>
908 </dc:if>
909
910 <dc:comment>
911 SHOW FLOODMAPS
912 </dc:comment>
913
914 <dc:if test="dc:contains($artifact-outs, 'floodmap') or dc:contains($artifact-outs, 'map')">
915 <floodmap>
916 <dc:elements>
917 <dc:context>
918 <dc:statement>
919 SELECT m.id AS a_id, m.state AS a_state, m.gid AS a_gid, m.creation AS a_creation
920 FROM master_artifacts m
921 WHERE m.collection_id = ${collection_id} AND m.gid &lt;&gt; CAST(${artifact-id} AS uuid)
922 AND EXISTS (
923 SELECT id FROM artifact_data ad WHERE ad.artifact_id = m.id AND k = 'river' AND v = ${river})
924 </dc:statement>
925 <dc:elements>
926 <dc:context>
927 <dc:statement>
928 SELECT a.gid as aid, f.id AS fid, f.name AS facet_name, f.num AS facet_num, f.description as facet_description
929 FROM outs as o, facets as f, artifacts as a
930 WHERE f.name = 'floodmap.wsplgen' and f.out_id = o.id and o.artifact_id = ${a_id} and a.id = ${a_id}
931 </dc:statement>
932 <dc:elements>
933 <dc:element name="${facet_name}">
934 <dc:attribute name="description" value="${facet_description}"/>
935 <dc:attribute name="factory" value="winfo"/>
936 <dc:attribute name="artifact-id" value="${aid}"/>
937 <dc:attribute name="ids" value="${aid}"/>
938 <dc:attribute name="out" value="floodmap"/>
939 </dc:element>
940 </dc:elements>
941 </dc:context>
942 </dc:elements>
943 </dc:context>
944 </dc:elements>
945 </floodmap>
946 </dc:if>
947
948 </dc:context>
949 </old_calculations>
950
951
952 <dc:comment>
953 Include System specific part when 'load-system' is in parameters.
954 -----------------------------------------------------------------
955 </dc:comment>
956 <dc:choose>
957 <dc:when test="dc:contains($parameters,'load-system')">
958 <dc:call-macro name="load-system"/>
959 </dc:when>
960 </dc:choose>
961 </dc:when>
962
963
964 <dc:comment>
965 Include System specific part only if no user ID is given.
966 ---------------------------------------------------------
967 </dc:comment>
968 <dc:otherwise>
969 <dc:call-macro name="load-system"/>
970 </dc:otherwise>
971 </dc:choose>
972 </datacage>
973 </dc:template>

http://dive4elements.wald.intevation.org