[Dive4elements-commits] [PATCH 1 of 2] Add HWS Lines and HWS Points folder structures to the datacage

Wald Commits scm-commit at wald.intevation.org
Thu Mar 21 18:25:08 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1363881127 -3600
# Node ID 51db7fbc2e773675fc1e6ce5a7f962efd0172f68
# Parent  7b35f2c070c3f0715cdbd4184138a56b7d565ad7
Add HWS Lines and HWS Points folder structures to the datacage

diff -r 7b35f2c070c3 -r 51db7fbc2e77 flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml	Thu Mar 21 17:37:41 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Thu Mar 21 16:52:07 2013 +0100
@@ -1260,40 +1260,264 @@
                   </dc:elements>
                 </dc:context>
               </dc:macro>
+
+              <dc:macro name="hwslines_by_kind">
+                <dc:comment>
+                  Call from a context where fed_name hws_kind hws_name and river_id is
+                  availble
+                </dc:comment>
+                <Durchlass>
+                  <dc:elements filter="$hws_kind=1">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwslinesfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
+                  </dc:elements>
+                </Durchlass>
+                <Damm>
+                  <dc:elements filter="$hws_kind=2">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwslinesfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
+                  </dc:elements>
+                </Damm>
+                <Graben>
+                  <dc:elements filter="$hws_kind=3">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwslinesfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
+                  </dc:elements>
+                </Graben>
+              </dc:macro>
+
               <dc:macro name="hwslines">
-                <dc:context>
-                  <dc:statement>
-                    SELECT count(*) as km_exists, name as name
-                    FROM hws_lines WHERE river_id = ${river_id} GROUP BY name
-                  </dc:statement>
-                   <dc:elements>
-                    <dc:if test="$km_exists>0">
-                      <line>
-                        <dc:attribute name="factory" value="wmshwslinesfactory"/>
-                        <dc:attribute name="ids" value="${river_id};${name}"/>
-                        <dc:attribute name="name" value="${name}"/>
-                      </line>
-                    </dc:if>
+                <hws_lines>
+                  <official>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT DISTINCT
+                        fs.name AS fed_name,
+                        fs.id AS fed_id
+                        FROM hws_lines hws
+                        JOIN fed_states fs ON hws.fed_state_id = fs.id
+                        WHERE river_id = ${river_id}
+                        AND hws.official=1
+                      </dc:statement>
+                      <dc:elements>
+                        <dc:context>
+                          <dc:statement>
+                            SELECT DISTINCT
+                            name AS hws_name,
+                            kind_id AS hws_kind
+                            FROM hws_lines
+                            WHERE river_id = ${river_id}
+                            AND official=1
+                            AND fed_state_id = ${fed_id} ORDER BY name
+                          </dc:statement>
+                          <fedstate>
+                            <dc:attribute name="description" value="${fed_name}"/>
+                            <dc:call-macro name="hwslines_by_kind"/>
+                          </fedstate>
+                        </dc:context>
+                      </dc:elements>
+                    </dc:context>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT distinct
+                        name AS hws_name,
+                        kind_id AS hws_kind
+                        FROM hws_lines
+                        WHERE river_id = ${river_id}
+                        AND official=1
+                        AND fed_state_id IS NULL
+                        ORDER BY name
+                      </dc:statement>
+                      <hws_fed_unknown>
+                        <dc:call-macro name="hwslines_by_kind"/>
+                      </hws_fed_unknown>
+                    </dc:context>
+                  </official>
+                  <inofficial>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT DISTINCT
+                        fs.name AS fed_name,
+                        fs.id AS fed_id
+                        FROM hws_lines hws
+                        JOIN fed_states fs ON hws.fed_state_id = fs.id
+                        WHERE river_id = ${river_id}
+                        AND hws.official=0
+                      </dc:statement>
+                      <dc:elements>
+                        <dc:context>
+                          <dc:statement>
+                            SELECT DISTINCT
+                            name AS hws_name,
+                            kind_id AS hws_kind
+                            FROM hws_lines
+                            WHERE river_id = ${river_id}
+                            AND official=0
+                            AND fed_state_id = ${fed_id} ORDER BY name
+                          </dc:statement>
+                          <fedstate>
+                            <dc:attribute name="description" value="${fed_name}"/>
+                            <dc:call-macro name="hwslines_by_kind"/>
+                          </fedstate>
+                        </dc:context>
+                      </dc:elements>
+                    </dc:context>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT distinct
+                        name AS hws_name,
+                        kind_id AS hws_kind
+                        FROM hws_lines
+                        WHERE river_id = ${river_id}
+                        AND official=0
+                        AND fed_state_id IS NULL ORDER BY name
+                      </dc:statement>
+                      <hws_fed_unknown>
+                        <dc:call-macro name="hwslines_by_kind"/>
+                      </hws_fed_unknown>
+                    </dc:context>
+                  </inofficial>
+              </hws_lines>
+            </dc:macro>
+
+              <dc:macro name="hwspoints_by_kind">
+                <dc:comment>
+                  Call from a context where fed_name hws_kind hws_name and river_id is
+                  availble
+                </dc:comment>
+                <Durchlass>
+                  <dc:elements filter="$hws_kind=1">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwspointsfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
                   </dc:elements>
-                </dc:context>
+                </Durchlass>
+                <Damm>
+                  <dc:elements filter="$hws_kind=2">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwspointsfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
+                  </dc:elements>
+                </Damm>
+                <Graben>
+                  <dc:elements filter="$hws_kind=3">
+                    <hws>
+                      <dc:attribute name="factory" value="wmshwspointsfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${hws_name}"/>
+                      <dc:attribute name="name" value="${hws_name}"/>
+                    </hws>
+                  </dc:elements>
+                </Graben>
               </dc:macro>
+
               <dc:macro name="hwspoints">
-                <dc:context>
-                  <dc:statement>
-                    SELECT count(*) as km_exists, name as name
-                    FROM hws_points WHERE river_id = ${river_id} GROUP BY name
-                  </dc:statement>
-                   <dc:elements>
-                    <dc:if test="$km_exists>0">
-                      <line>
-                        <dc:attribute name="factory" value="wmshwspointsfactory"/>
-                        <dc:attribute name="ids" value="${river_id};${name}"/>
-                        <dc:attribute name="name" value="${name}"/>
-                      </line>
-                    </dc:if>
-                  </dc:elements>
-                </dc:context>
-              </dc:macro>
+                <hws_points>
+                  <official>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT DISTINCT
+                        fs.name AS fed_name,
+                        fs.id AS fed_id
+                        FROM hws_points hws
+                        JOIN fed_states fs ON hws.fed_state_id = fs.id
+                        WHERE river_id = ${river_id}
+                        AND hws.official=1
+                      </dc:statement>
+                      <dc:elements>
+                        <dc:context>
+                          <dc:statement>
+                            SELECT DISTINCT
+                            name AS hws_name,
+                            kind_id AS hws_kind
+                            FROM hws_points
+                            WHERE river_id = ${river_id}
+                            AND official=1
+                            AND fed_state_id = ${fed_id} ORDER BY name
+                          </dc:statement>
+                          <fedstate>
+                            <dc:attribute name="description" value="${fed_name}"/>
+                            <dc:call-macro name="hwspoints_by_kind"/>
+                          </fedstate>
+                        </dc:context>
+                      </dc:elements>
+                    </dc:context>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT distinct
+                        name AS hws_name,
+                        kind_id AS hws_kind
+                        FROM hws_points
+                        WHERE river_id = ${river_id}
+                        AND official=1
+                        AND fed_state_id IS NULL
+                        ORDER BY name
+                      </dc:statement>
+                      <hws_fed_unknown>
+                        <dc:call-macro name="hwspoints_by_kind"/>
+                      </hws_fed_unknown>
+                    </dc:context>
+                  </official>
+                  <inofficial>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT DISTINCT
+                        fs.name AS fed_name,
+                        fs.id AS fed_id
+                        FROM hws_points hws
+                        JOIN fed_states fs ON hws.fed_state_id = fs.id
+                        WHERE river_id = ${river_id}
+                        AND hws.official=0
+                      </dc:statement>
+                      <dc:elements>
+                        <dc:context>
+                          <dc:statement>
+                            SELECT DISTINCT
+                            name AS hws_name,
+                            kind_id AS hws_kind
+                            FROM hws_points
+                            WHERE river_id = ${river_id}
+                            AND official=0
+                            AND fed_state_id = ${fed_id} ORDER BY name
+                          </dc:statement>
+                          <fedstate>
+                            <dc:attribute name="description" value="${fed_name}"/>
+                            <dc:call-macro name="hwspoints_by_kind"/>
+                          </fedstate>
+                        </dc:context>
+                      </dc:elements>
+                    </dc:context>
+                    <dc:context>
+                      <dc:statement>
+                        SELECT distinct
+                        name AS hws_name,
+                        kind_id AS hws_kind
+                        FROM hws_points
+                        WHERE river_id = ${river_id}
+                        AND official=0
+                        AND fed_state_id IS NULL ORDER BY name
+                      </dc:statement>
+                      <hws_fed_unknown>
+                        <dc:call-macro name="hwspoints_by_kind"/>
+                      </hws_fed_unknown>
+                    </dc:context>
+                  </inofficial>
+              </hws_points>
+            </dc:macro>
+
+
               <dc:macro name="flood-map-buildings">
                 <dc:context>
                   <dc:statement>
@@ -1454,12 +1678,8 @@
                     <dc:call-macro name="flood-map-qps"/>
                   </kilometrage>
                   <hws>
-                    <hws_lines>
-                      <dc:call-macro name="hwslines"/>
-                    </hws_lines>
-                    <hws_points>
-                      <dc:call-macro name="hwspoints"/>
-                    </hws_points>
+                    <dc:call-macro name="hwslines"/>
+                    <dc:call-macro name="hwspoints"/>
                   </hws>
                   <dc:call-macro name="flood-map-uesk"/>
                   <gaugelocations>
diff -r 7b35f2c070c3 -r 51db7fbc2e77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Mar 21 17:37:41 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Thu Mar 21 16:52:07 2013 +0100
@@ -1162,6 +1162,8 @@
 
     String hws_points();
 
+    String hws_fed_unknown();
+
 
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 7b35f2c070c3 -r 51db7fbc2e77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Mar 21 17:37:41 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Thu Mar 21 16:52:07 2013 +0100
@@ -460,6 +460,7 @@
 custom_lines = Own Digitalizations
 hws_lines = Lines
 hws_points = Points
+hws_fed_unknown = Unknown State
 
 startcolor = Colorrange start color
 endcolor = Colorrange end color
diff -r 7b35f2c070c3 -r 51db7fbc2e77 flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Mar 21 17:37:41 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Thu Mar 21 16:52:07 2013 +0100
@@ -461,6 +461,7 @@
 custom_lines = Eigene Digitalisierungen
 hws_lines = Liniendaten
 hws_points = Punktdaten
+hws_fed_unknown = Unbekanntes Bundesland
 
 startcolor = Farbverlauf Startfarbe
 endcolor = Farbverlauf Endfarbe


More information about the Dive4elements-commits mailing list