changeset 5364:51db7fbc2e77

Add HWS Lines and HWS Points folder structures to the datacage
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 21 Mar 2013 16:52:07 +0100
parents 7b35f2c070c3
children 90f1c5f67698
files flys-artifacts/doc/conf/meta-data.xml flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties
diffstat 4 files changed, 261 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- 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">
-                <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>
+
+              <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>
-                </dc:context>
+                </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">
+                <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>
+                </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>
--- 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 :
--- 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
--- 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

http://dive4elements.wald.intevation.org