changeset 404:349c9bcdd917

Add data cage configuration for "Abflusskurve [NN + m]". flys-artifacts/trunk@1846 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 06 May 2011 16:15:18 +0000
parents 1ed48e2ddc1b
children 55c2b0d9999e
files flys-artifacts/src/main/resources/metadata/template.xml
diffstat 1 files changed, 170 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/resources/metadata/template.xml	Fri May 06 14:20:26 2011 +0000
+++ b/flys-artifacts/src/main/resources/metadata/template.xml	Fri May 06 16:15:18 2011 +0000
@@ -1,46 +1,185 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
-<DATENKORB>
-  <GEWAESSER>
-    <dc:context>
-      <dc:statement>
-        SELECT id AS river_id, name as river_name FROM rivers
-      </dc:statement>
-      <dc:elements>
-        <dc:element name="${river_name}">
-          <WSTS>
+<datacage>
+  <dc:context>
+    <dc:statement>
+      SELECT id AS river_id, name as river_name FROM rivers
+    </dc:statement>
+    <dc:elements>
+      <dc:element name="${river_name}">
+        <dc:attribute name="river-id" value="${river_id}"/>
+        <discharge-table-nn>
+          <discharge-table-gauge>
             <dc:context>
               <dc:statement>
-                SELECT id          AS wst_id, 
-                       kind        AS wst_kind,
-                       description AS wst_description
-                FROM wsts
-                WHERE river_id = ${river_id}
+                SELECT id   AS gauge_id,
+                       name AS gauge_name
+                FROM gauges WHERE river_id = ${river_id}
               </dc:statement>
               <dc:elements>
-                <WST>
-                  <dc:attribute name="TYP" value="${wst_kind}"/>
-                  <dc:attribute name="ID"  value="${wst_id}"/>
-                  <BESCHREIBUNG><dc:text>Erzeugt aus der Datei: ${wst_description}</dc:text></BESCHREIBUNG>
+                <gauge>
+                  <dc:attribute name="name" value="${gauge_name}"/>
+                  <dc:attribute name="gauge-id" value="${gauge_id}"/>
                   <dc:context>
                     <dc:statement>
-                      SELECT id   AS column_id,
-                             name AS column_name
-                      FROM wst_columns
-                      WHERE wst_id = ${wst_id}
-                      ORDER BY position
+                      SELECT description   AS gauge_desc, 
+                             d.id          AS discharge_id,
+                             ti.start_time AS g_start, 
+                             ti.stop_time  AS g_stop
+                      FROM discharge_tables d JOIN time_intervals ti 
+                      ON d.time_interval_id = ti.id
+                      WHERE d.gauge_id = ${gauge_id} AND d.kind = 1
                     </dc:statement>
-                    <dc:elements><SPALTE><dc:attribute name="ID"   value="${column_id}"/><dc:attribute name="NAME" value="${column_name}"/></SPALTE>
+                    <dc:elements>
+                      <historical>
+                        <dc:attribute name="name" value="${gauge_desc}"/>
+                        <dc:attribute name="from" value="${g_start}"/>
+                        <dc:attribute name="to" value="${g_stop}"/>
+                        <dc:attribute name="discharge-id" value="${discharge_id}"/></historical>
                     </dc:elements>
                   </dc:context>
-                </WST>
+                </gauge>
               </dc:elements>
             </dc:context>
-          </WSTS>
-        </dc:element>
-      </dc:elements>
-    </dc:context>
-  </GEWAESSER>
-</DATENKORB>
+          </discharge-table-gauge>
+          <fixations>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS fix_id,
+                       description AS fix_description
+                FROM wsts WHERE kind = 2 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <fixation>
+                  <dc:attribute name="name" value="${fix_description}"/>
+                  <dc:attribute name="fix-id" value="${fix_id}"/></fixation>
+              </dc:elements>
+            </dc:context>
+          </fixations>
+          <flood-protections>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS prot_id,
+                       description AS prot_description
+                FROM wsts WHERE kind = 5 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <flood-protection>
+                  <dc:attribute name="name" value="${prot_description}"/>
+                  <dc:attribute name="prot-id" value="${prot_id}"/>
+                  <columns>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id   AS prot_column_id,
+                               name AS prot_column_name
+                        FROM wst_columns WHERE wst_id = ${prot_id}
+                        ORDER by position
+                      </dc:statement>
+                      <dc:elements>
+                        <column>
+                            <dc:attribute name="name" value="${prot_column_name}"/>
+                            <dc:attribute name="column-id" value="${prot_column_id}"/></column>
+                      </dc:elements>
+                    </dc:context>
+                  </columns>
+                </flood-protection>
+              </dc:elements>
+            </dc:context>
+          </flood-protections>
+          <flood-water-marks>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS fw_id,
+                       description AS fw_description
+                FROM wsts WHERE kind = 4 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <flood-water-mark>
+                  <dc:attribute name="name" value="${fw_description}"/>
+                  <dc:attribute name="fw-id" value="${fw_id}"/>
+                  <columns>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id   AS fw_column_id,
+                               name AS fw_column_name
+                        FROM wst_columns WHERE wst_id = ${fw_id}
+                        ORDER by position
+                      </dc:statement>
+                      <dc:elements>
+                        <column>
+                            <dc:attribute name="name" value="${fw_column_name}"/>
+                            <dc:attribute name="column-id" value="${fw_column_id}"/></column>
+                      </dc:elements>
+                    </dc:context>
+                  </columns>
+                </flood-water-mark>
+              </dc:elements>
+            </dc:context>
+          </flood-water-marks>
+          <water-levels>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS wl_id,
+                       description AS wl_description
+                FROM wsts WHERE kind = 0 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <water-level>
+                  <dc:attribute name="name" value="${wl_description}"/>
+                  <dc:attribute name="wl-id" value="${wl_id}"/>
+                  <columns>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id   AS wl_column_id,
+                               name AS wl_column_name
+                        FROM wst_columns WHERE wst_id = ${wl_id}
+                        ORDER by position
+                      </dc:statement>
+                      <dc:elements>
+                        <column>
+                            <dc:attribute name="name" value="${wl_column_name}"/>
+                            <dc:attribute name="column-id" value="${wl_column_id}"/></column>
+                      </dc:elements>
+                    </dc:context>
+                  </columns>
+                </water-level>
+              </dc:elements>
+            </dc:context>
+          </water-levels>
+          <extra-longitudinal-sections>
+            <dc:context>
+              <dc:statement>
+                SELECT id          AS els_id,
+                       description AS els_description
+                FROM wsts WHERE kind = 1 AND river_id = ${river_id}
+              </dc:statement>
+              <dc:elements>
+                <extra-longitudinal-section>
+                  <dc:attribute name="name" value="${els_description}"/>
+                  <dc:attribute name="els-id" value="${els_id}"/>
+                  <columns>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT id   AS els_column_id,
+                               name AS els_column_name
+                        FROM wst_columns WHERE wst_id = ${els_id}
+                        ORDER by position
+                      </dc:statement>
+                      <dc:elements>
+                        <column>
+                            <dc:attribute name="name" value="${els_column_name}"/>
+                            <dc:attribute name="column-id" value="${els_column_id}"/></column>
+                      </dc:elements>
+                    </dc:context>
+                  </columns>
+                </extra-longitudinal-section>
+              </dc:elements>
+            </dc:context>
+          </extra-longitudinal-sections>
+        </discharge-table-nn>
+      </dc:element> <!-- river -->
+    </dc:elements>
+  </dc:context>
+</datacage>
 </dc:template>
 

http://dive4elements.wald.intevation.org