changeset 2683:f5af3adb3b95

Improved datacage configuration for floodmaps and maps and modified the WMS layer artifacts to support names for layers. flys-artifacts/trunk@4383 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 May 2012 11:14:17 +0000
parents 0795c296f718
children 14188f8daefb
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/map.xml flys-artifacts/doc/conf/artifacts/winfo.xml flys-artifacts/doc/conf/conf.xml flys-artifacts/doc/conf/meta-data.xml flys-artifacts/doc/conf/themes.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/RiverAxisArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSBuildingsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSCatchmentArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFixpointsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodplainArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHwsArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryPolyArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSLineArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java
diffstat 20 files changed, 560 insertions(+), 195 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/ChangeLog	Thu May 10 11:14:17 2012 +0000
@@ -1,3 +1,38 @@
+2012-05-10  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java: Added
+	  new facet types 'floodmap.hydr_boundaries' and
+	  'floodmap.hydr_boundaries_poly'
+
+	* doc/conf/artifacts/winfo.xml,
+	  doc/conf/artifacts/map.xml: Registered 'floodmap.hydr_boundaries' and
+	  'floodmap.hydr_boundaries_poly' for floodmap and map output types.
+
+	* doc/conf/conf.xml:
+
+	* doc/conf/themes.xml: Added themes for 'floodmap.hydr_boundaries' and
+	  'floodmap.hydr_boundaries_poly'.
+
+	* doc/conf/meta-data.xml: Improved datacage configuration specific to
+	  floodmaps and maps.
+
+	* src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryPolyArtifact.java:
+	  New artifacts to save information about hydrological boundaries.
+
+	* src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSFixpointsArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSHwsArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSCatchmentArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSBuildingsArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/RiverAxisArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSLineArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/WMSFloodplainArtifact.java:
+	  Moved the methods getRiverId() and getTitle() into WMSDBArtifact.
+
 2012-05-10  Ingo Weinzierl <ingo@intevation.de>
 
 	* doc/conf/mapserver/wsplgen_layer.vm,
--- a/flys-artifacts/doc/conf/artifacts/map.xml	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/map.xml	Thu May 10 11:14:17 2012 +0000
@@ -21,6 +21,8 @@
                         <facet name="floodmap.kms"/>
                         <facet name="floodmap.qps"/>
                         <facet name="floodmap.hws"/>
+                        <facet name="floodmap.hydr_boundaries"/>
+                        <facet name="floodmap.hydr_boundaries_poly"/>
                         <facet name="floodmap.catchment"/>
                         <facet name="floodmap.floodplain"/>
                         <facet name="floodmap.lines"/>
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/winfo.xml	Thu May 10 11:14:17 2012 +0000
@@ -464,6 +464,8 @@
                         <facet name="floodmap.kms"/>
                         <facet name="floodmap.qps"/>
                         <facet name="floodmap.hws"/>
+                        <facet name="floodmap.hydr_boundaries"/>
+                        <facet name="floodmap.hydr_boundaries_poly"/>
                         <facet name="floodmap.catchment"/>
                         <facet name="floodmap.floodplain"/>
                         <facet name="floodmap.lines"/>
--- a/flys-artifacts/doc/conf/conf.xml	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/doc/conf/conf.xml	Thu May 10 11:14:17 2012 +0000
@@ -32,6 +32,12 @@
             <artifact-factory name="wmshwsfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks."
                 ttl="3600000"
                 artifact="de.intevation.flys.artifacts.WMSHwsArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
+            <artifact-factory name="wmshydrboundariesfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks."
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.WMSHydrBoundaryArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
+            <artifact-factory name="wmshydrboundariespolyfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks."
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.WMSHydrBoundaryPolyArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
             <artifact-factory name="wmscatchmentfactory" description="Factory to create an artifact that generates WMS facets for CrossSectionTracks."
                 ttl="3600000"
                 artifact="de.intevation.flys.artifacts.WMSCatchmentArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
--- a/flys-artifacts/doc/conf/meta-data.xml	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Thu May 10 11:14:17 2012 +0000
@@ -622,6 +622,86 @@
                   </dc:elements>
                 </dc:context>
               </dc:macro>
+              <dc:macro name="flood-map-hydr-boundaries">
+                <hydr_boundaries_lines>
+                  <dc:call-macro name="flood-map-hydr-boundaries-lines"/>
+                </hydr_boundaries_lines>
+                <hydr_boundaries_polygons>
+                  <dc:call-macro name="flood-map-hydr-boundaries-poly"/>
+                </hydr_boundaries_polygons>
+              </dc:macro>
+              <dc:macro name="flood-map-hydr-boundaries-lines">
+                <bfg>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT count(*) as km_exists, name as name
+                      FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
+                    </dc:statement>
+                     <dc:elements>
+                      <dc:if test="$km_exists>0">
+                        <hydrboundary>
+                          <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
+                          <dc:attribute name="ids" value="${river_id};${name}"/>
+                          <dc:attribute name="name" value="${name}"/>
+                        </hydrboundary>
+                      </dc:if>
+                    </dc:elements>
+                  </dc:context>
+                </bfg>
+                <land>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT count(*) as km_exists, name as name
+                      FROM hydr_boundaries WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
+                    </dc:statement>
+                     <dc:elements>
+                      <dc:if test="$km_exists>0">
+                        <hydrboundary>
+                          <dc:attribute name="factory" value="wmshydrboundariesfactory"/>
+                          <dc:attribute name="ids" value="${river_id};${name}"/>
+                          <dc:attribute name="name" value="${name}"/>
+                        </hydrboundary>
+                      </dc:if>
+                    </dc:elements>
+                  </dc:context>
+                </land>
+              </dc:macro>
+              <dc:macro name="flood-map-hydr-boundaries-poly">
+                <bfg>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT count(*) as km_exists, name as name
+                      FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 1 GROUP BY name
+                    </dc:statement>
+                     <dc:elements>
+                      <dc:if test="$km_exists>0">
+                        <hws>
+                          <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
+                          <dc:attribute name="ids" value="${river_id};${name}"/>
+                          <dc:attribute name="name" value="${name}"/>
+                        </hws>
+                      </dc:if>
+                    </dc:elements>
+                  </dc:context>
+                </bfg>
+                <land>
+                  <dc:context>
+                    <dc:statement>
+                      SELECT count(*) as km_exists, name as name
+                      FROM hydr_boundaries_poly WHERE river_id = ${river_id} AND kind = 2 GROUP BY name
+                    </dc:statement>
+                     <dc:elements>
+                      <dc:if test="$km_exists>0">
+                        <hws>
+                          <dc:attribute name="factory" value="wmshydrboundariespolyfactory"/>
+                          <dc:attribute name="ids" value="${river_id};${name}"/>
+                          <dc:attribute name="name" value="${name}"/>
+                        </hws>
+                      </dc:if>
+                    </dc:elements>
+                  </dc:context>
+                </land>
+              </dc:macro>
               <dc:macro name="flood-map-catchments">
                 <dc:context>
                   <dc:statement>
@@ -630,11 +710,11 @@
                   </dc:statement>
                    <dc:elements>
                     <dc:if test="$km_exists>0">
-                      <catchments>
+                      <catchment>
                         <dc:attribute name="factory" value="wmscatchmentfactory"/>
                         <dc:attribute name="ids" value="${river_id};${name}"/>
                         <dc:attribute name="name" value="${name}"/>
-                      </catchments>
+                      </catchment>
                     </dc:if>
                   </dc:elements>
                 </dc:context>
@@ -658,15 +738,16 @@
               <dc:macro name="flood-map-lines">
                 <dc:context>
                   <dc:statement>
-                    SELECT count(*) as km_exists
-                    FROM lines WHERE river_id = ${river_id}
+                    SELECT count(*) as km_exists, name as name
+                    FROM lines WHERE river_id = ${river_id} GROUP BY name
                   </dc:statement>
                    <dc:elements>
                     <dc:if test="$km_exists>0">
-                      <lines>
+                      <line>
                         <dc:attribute name="factory" value="wmslinefactory"/>
-                        <dc:attribute name="ids" value="${river_id}"/>
-                      </lines>
+                        <dc:attribute name="ids" value="${river_id};${name}"/>
+                        <dc:attribute name="name" value="${name}"/>
+                      </line>
                     </dc:if>
                   </dc:elements>
                 </dc:context>
@@ -674,15 +755,16 @@
               <dc:macro name="flood-map-buildings">
                 <dc:context>
                   <dc:statement>
-                    SELECT count(*) as km_exists
-                    FROM buildings WHERE river_id = ${river_id}
+                    SELECT count(*) as km_exists, name as name
+                    FROM buildings WHERE river_id = ${river_id} GROUP BY name
                   </dc:statement>
                    <dc:elements>
                     <dc:if test="$km_exists>0">
-                      <buildings>
+                      <building>
                         <dc:attribute name="factory" value="wmsbuildingsfactory"/>
-                        <dc:attribute name="ids" value="${river_id}"/>
-                      </buildings>
+                        <dc:attribute name="ids" value="${river_id};${name}"/>
+                        <dc:attribute name="name" value="${name}"/>
+                      </building>
                     </dc:if>
                   </dc:elements>
                 </dc:context>
@@ -690,15 +772,16 @@
               <dc:macro name="flood-map-fixpoints">
                 <dc:context>
                   <dc:statement>
-                    SELECT count(*) as km_exists
-                    FROM fixpoints WHERE river_id = ${river_id}
+                    SELECT count(*) as km_exists, name as name
+                    FROM fixpoints WHERE river_id = ${river_id} GROUP BY name
                   </dc:statement>
                    <dc:elements>
                     <dc:if test="$km_exists>0">
-                      <fixpoints>
+                      <fixpoint>
                         <dc:attribute name="factory" value="wmsfixpointsfactory"/>
-                        <dc:attribute name="ids" value="${river_id}"/>
-                      </fixpoints>
+                        <dc:attribute name="ids" value="${river_id};${name}"/>
+                        <dc:attribute name="name"  value="${name}"/>
+                      </fixpoint>
                     </dc:if>
                   </dc:elements>
                 </dc:context>
@@ -719,7 +802,7 @@
                             <dc:if test="$uesg_exist>0">
                               <floodmaps>
                                 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
-                                <dc:attribute name="ids" value="${river_id}_${name}"/>
+                                <dc:attribute name="ids" value="${river_id};${name}"/>
                                 <dc:attribute name="name" value="${name}"/>
                               </floodmaps>
                             </dc:if>
@@ -738,7 +821,7 @@
                             <dc:if test="$uesg_exist>0">
                               <floodmaps>
                                 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
-                                <dc:attribute name="ids" value="${river_id}_${name}"/>
+                                <dc:attribute name="ids" value="${river_id};${name}"/>
                                 <dc:attribute name="name" value="${name}"/>
                               </floodmaps>
                             </dc:if>
@@ -759,7 +842,7 @@
                             <dc:if test="$uesg_exist>0">
                               <floodmaps>
                                 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
-                                <dc:attribute name="ids" value="${river_id}_${name}"/>
+                                <dc:attribute name="ids" value="${river_id};${name}"/>
                                 <dc:attribute name="name" value="${name}"/>
                               </floodmaps>
                             </dc:if>
@@ -778,7 +861,7 @@
                             <dc:if test="$uesg_exist>0">
                               <floodmaps>
                                 <dc:attribute name="factory" value="wmsfloodmapsfactory"/>
-                                <dc:attribute name="ids" value="${river_id}_${name}"/>
+                                <dc:attribute name="ids" value="${river_id};${name}"/>
                                 <dc:attribute name="name" value="${name}"/>
                               </floodmaps>
                             </dc:if>
@@ -790,6 +873,22 @@
                 </uesk>
               </dc:macro>
               <dc:macro name="flood-map-complete">
+                  <buildings>
+                    <dc:call-macro name="flood-map-buildings"/>
+                  </buildings>
+                  <catchments>
+                    <dc:call-macro name="flood-map-catchments"/>
+                  </catchments>
+                  <fixpoints>
+                    <dc:call-macro name="flood-map-fixpoints"/>
+                  </fixpoints>
+                  <hws>
+                    <dc:call-macro name="flood-map-hws"/>
+                  </hws>
+                  <hydrboundaries>
+                    <dc:call-macro name="flood-map-hydr-boundaries"/>
+                    <dc:call-macro name="flood-map-floodplain"/>
+                  </hydrboundaries>
                   <kilometrage>
                       <riveraxis>
                           <dc:attribute name="factory" value="riveraxis"/>
@@ -797,18 +896,11 @@
                       </riveraxis>
                     <dc:call-macro name="flood-map-km"/>
                     <dc:call-macro name="flood-map-qps"/>
-                    <dc:call-macro name="flood-map-floodplain"/>
+                  </kilometrage>
+                  <lines>
                     <dc:call-macro name="flood-map-lines"/>
-                    <dc:call-macro name="flood-map-buildings"/>
-                    <dc:call-macro name="flood-map-fixpoints"/>
-                  </kilometrage>
+                  </lines>
                   <dc:call-macro name="flood-map-uesk"/>
-                  <catchments>
-                    <dc:call-macro name="flood-map-catchments"/>
-                  </catchments>
-                  <hws>
-                    <dc:call-macro name="flood-map-hws"/>
-                  </hws>
                   <rastermap>
                       <background>
                           <dc:attribute name="factory" value="wmsbackground"/>
--- a/flys-artifacts/doc/conf/themes.xml	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/doc/conf/themes.xml	Thu May 10 11:14:17 2012 +0000
@@ -943,6 +943,21 @@
         </fields>
     </theme>
 
+    <theme name="HydrBoundariesLines">
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="255, 0, 0"/>
+            <field name="linesize"  type="int"   display="Liniendicke" default="5" hints="h"/>
+        </fields>
+    </theme>
+
+    <theme name="HydrBoundariesPolys">
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="255, 0, 0"/>
+            <field name="linesize"  type="int"   display="Liniendicke" default="5" hints="h"/>
+            <field name="backgroundcolor" type="Color" display="Hintergrund" default="140, 200, 130"/>
+        </fields>
+    </theme>
+
 
     <!--
       Mappings are following now. A mapping maps between a name of a facet
@@ -1033,6 +1048,8 @@
         <mapping from="floodmap.kms" to="Kms"/>
         <mapping from="floodmap.qps" to="Qps"/>
         <mapping from="floodmap.hws" to="Hws"/>
+        <mapping from="floodmap.hydr_boundaries" to="HydrBoundariesLines"/>
+        <mapping from="floodmap.hydr_boundaries_poly" to="HydrBoundariesPolys"/>
         <mapping from="floodmap.catchment" to="Catchment"/>
         <mapping from="floodmap.floodplain" to="Floodplain"/>
         <mapping from="floodmap.lines" to="FloodmapLines"/>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/RiverAxisArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/RiverAxisArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -109,14 +109,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_RIVERAXIS,
-                FLOODMAP_RIVERAXIS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSBuildingsArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSBuildingsArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -84,35 +84,12 @@
             riverId = 0;
         }
 
-        public int getRiverId() {
-            if (riverId == 0) {
-                String ids = artifact.getDataAsString("ids");
-
-                try {
-                    riverId = Integer.valueOf(ids);
-                }
-                catch (NumberFormatException nfe) {
-                    logger.error("Cannot parse river id from '" + ids + "'");
-                }
-            }
-
-            return riverId;
-        }
-
         @Override
         protected String getFacetType() {
             return FLOODMAP_BUILDINGS;
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_BUILDINGS,
-                FLOODMAP_BUILDINGS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
@@ -125,7 +102,8 @@
 
         @Override
         protected Envelope getExtent() {
-            List<Building> buildings = Building.getBuildings(getRiverId());
+            List<Building> buildings =
+                Building.getBuildings(getRiverId(), getName());
 
             Envelope max = null;
 
@@ -145,7 +123,8 @@
 
         @Override
         protected String getFilter() {
-            return "river_id=" + String.valueOf(getRiverId());
+            return "river_id=" + String.valueOf(getRiverId()) +
+                " AND name='" + getName() + "'";
         }
 
         @Override
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSCatchmentArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSCatchmentArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -106,14 +106,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_CATCHMENT,
-                FLOODMAP_CATCHMENT);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSDBArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -27,6 +27,7 @@
 
 import de.intevation.flys.backend.SessionFactoryProvider;
 
+import de.intevation.flys.artifacts.resources.Resources;
 import de.intevation.flys.artifacts.states.DefaultState;
 import de.intevation.flys.artifacts.model.WMSDBLayerFacet;
 import de.intevation.flys.utils.FLYSUtils;
@@ -106,6 +107,7 @@
         protected FLYSArtifact artifact;
 
         protected String name;
+        protected int    riverId;
 
 
         public WMSDBState() {}
@@ -113,6 +115,7 @@
         public WMSDBState(FLYSArtifact artifact) {
             this.artifact = artifact;
             this.name     = null;
+            this.riverId  = 0;
         }
 
         @Override
@@ -227,6 +230,22 @@
             return null;
         }
 
+        public int getRiverId() {
+            if (riverId == 0) {
+                String   ids   = artifact.getDataAsString("ids");
+                String[] parts = ids.split(";");
+
+                try {
+                    riverId = Integer.valueOf(parts[0]);
+                }
+                catch (NumberFormatException nfe) {
+                    logger.error("Cannot parse river id from '" + parts[0] + "'");
+                }
+            }
+
+            return riverId;
+        }
+
         /**
          * Returns the name of the WMS layer. This method extracts the name
          * from 'ids' data string. It is expected, that the 'ids' string is
@@ -238,17 +257,40 @@
             if (name == null) {
                 String ids = artifact.getDataAsString("ids");
 
-                String parts[] = ids.split(";");
-                name = parts[1];
+                String parts[] = ids != null ? ids.split(";") : null;
+
+                if (parts != null && parts.length >= 2) {
+                    name = parts[1];
+                }
             }
 
             return name;
         }
 
+
+        /**
+         * Returns the name of the layer (returned by getName()) or the layer
+         * type if the name is empty. The layer type is created by an i18n
+         * string of getFacetType().
+         *
+         * @param meta A CallMeta used for i18n.
+         *
+         * @return the name of the layer or its type if name is empty.
+         */
+        protected String getTitle(CallMeta meta) {
+            String name = getName();
+
+            return name != null && name.length() > 0
+                ? name
+                : Resources.getMsg(
+                    meta,
+                    getFacetType(),
+                    getFacetType());
+        }
+
+
         protected abstract String getFacetType();
 
-        protected abstract String getTitle(CallMeta meta);
-
         protected abstract String getUrl();
 
         protected abstract String getSrid();
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFixpointsArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFixpointsArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -84,35 +84,12 @@
             riverId = 0;
         }
 
-        public int getRiverId() {
-            if (riverId == 0) {
-                String ids = artifact.getDataAsString("ids");
-
-                try {
-                    riverId = Integer.valueOf(ids);
-                }
-                catch (NumberFormatException nfe) {
-                    logger.error("Cannot parse river id from '" + ids + "'");
-                }
-            }
-
-            return riverId;
-        }
-
         @Override
         protected String getFacetType() {
             return FLOODMAP_FIXPOINTS;
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_FIXPOINTS,
-                FLOODMAP_FIXPOINTS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodmapsArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -78,39 +78,10 @@
             Logger.getLogger(FloodmapsState.class);
 
         protected int    riverId;
-        protected String floodmapName;
 
         public FloodmapsState(WMSDBArtifact artifact) {
             super(artifact);
             riverId      = 0;
-            floodmapName = null;
-        }
-
-        public int getRiverId() {
-            if (riverId == 0) {
-                String ids = artifact.getDataAsString("ids");
-
-                try {
-                    String[] parts = ids.split("_");
-                    riverId = Integer.valueOf(parts[0]);
-                }
-                catch (NumberFormatException nfe) {
-                    logger.error("Cannot parse river id from '" + ids + "'");
-                }
-            }
-
-            return riverId;
-        }
-
-        public String getFloodmapName() {
-            if (floodmapName == null) {
-                String ids = artifact.getDataAsString("ids");
-
-                String parts[] = ids.split("_");
-                floodmapName   = parts[1];
-            }
-
-            return floodmapName;
         }
 
         @Override
@@ -119,14 +90,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_FLOODMAPS,
-                FLOODMAP_FLOODMAPS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
@@ -140,7 +103,7 @@
         @Override
         protected Envelope getExtent() {
             List<Floodmaps> floodmaps =
-                Floodmaps.getFloodmaps(getRiverId(), getFloodmapName());
+                Floodmaps.getFloodmaps(getRiverId(), getName());
 
             Envelope max = null;
 
@@ -161,7 +124,7 @@
         @Override
         protected String getFilter() {
             return "river_id=" + String.valueOf(getRiverId())
-                + " AND name='" + getFloodmapName() + "'";
+                + " AND name='" + getName() + "'";
         }
 
         @Override
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodplainArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSFloodplainArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -109,14 +109,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_FLOODPLAIN,
-                FLOODMAP_FLOODPLAIN);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHwsArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHwsArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -106,14 +106,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_HWS,
-                FLOODMAP_HWS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -0,0 +1,148 @@
+package de.intevation.flys.artifacts;
+
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+import org.apache.log4j.Logger;
+
+import com.vividsolutions.jts.geom.Envelope;
+
+import de.intevation.artifacts.ArtifactFactory;
+import de.intevation.artifacts.CallMeta;
+
+import de.intevation.artifactdatabase.state.DefaultOutput;
+import de.intevation.artifactdatabase.state.Facet;
+import de.intevation.artifactdatabase.state.State;
+
+import de.intevation.flys.model.River;
+import de.intevation.flys.model.HydrBoundary;
+
+import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.model.RiverFactory;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.utils.FLYSUtils;
+
+
+public class WMSHydrBoundaryArtifact extends WMSDBArtifact {
+
+    public static final String NAME = "hydr_boundary";
+
+
+    private static final Logger logger =
+        Logger.getLogger(WMSHydrBoundaryArtifact.class);
+
+
+    @Override
+    public void setup(
+        String          identifier,
+        ArtifactFactory factory,
+        Object          context,
+        CallMeta        callMeta,
+        Document        data)
+    {
+        logger.debug("WMSHydrBoundaryArtifact.setup");
+
+        super.setup(identifier, factory, context, callMeta, data);
+    }
+
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+
+    @Override
+    public State getCurrentState(Object cc) {
+        State s = new HydrBoundaryState(this);
+
+        List<Facet> fs = facets.get(getCurrentStateId());
+
+        DefaultOutput o = new DefaultOutput(
+            "floodmap",
+            "floodmap",
+            "image/png",
+            fs,
+            "map");
+
+        s.getOutputs().add(o);
+
+        return s;
+    }
+
+
+    public static class HydrBoundaryState extends WMSDBState implements FacetTypes
+    {
+        private static final Logger logger =
+            Logger.getLogger(HydrBoundaryState.class);
+
+        protected int riverId;
+
+        public HydrBoundaryState(WMSDBArtifact artifact) {
+            super(artifact);
+            riverId = 0;
+        }
+
+        @Override
+        protected String getFacetType() {
+            return FLOODMAP_HYDR_BOUNDARY;
+        }
+
+        @Override
+        protected String getUrl() {
+            return FLYSUtils.getUserWMSUrl(artifact.identifier());
+        }
+
+        @Override
+        protected String getSrid() {
+            River river = RiverFactory.getRiver(getRiverId());
+            return FLYSUtils.getRiverSrid(river.getName());
+        }
+
+        @Override
+        protected Envelope getExtent() {
+            List<HydrBoundary> boundaries = HydrBoundary.getHydrBoundaries(
+                getRiverId(), getName());
+
+            Envelope max = null;
+
+            for (HydrBoundary b: boundaries) {
+                Envelope env = b.getGeom().getEnvelopeInternal();
+
+                if (max == null) {
+                    max = env;
+                    continue;
+                }
+
+                max.expandToInclude(env);
+            }
+
+            return max;
+        }
+
+        @Override
+        protected String getFilter() {
+            return "river_id=" + String.valueOf(getRiverId())
+                + " AND name='" + getName() + "'";
+        }
+
+        @Override
+        protected String getDataString() {
+            String srid = getSrid();
+
+            if (FLYSUtils.isUsingOracle()) {
+                return "geom FROM hydr_boundaries USING SRID " + srid;
+            }
+            else {
+                return "geom FROM hydr_boundaries USING UNIQUE id USING SRID " + srid;
+            }
+        }
+
+        @Override
+        protected String getGeometryType() {
+            return "LINE";
+        }
+    } // end of HydrBoundaryState
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSHydrBoundaryPolyArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -0,0 +1,148 @@
+package de.intevation.flys.artifacts;
+
+import java.util.List;
+
+import org.w3c.dom.Document;
+
+import org.apache.log4j.Logger;
+
+import com.vividsolutions.jts.geom.Envelope;
+
+import de.intevation.artifacts.ArtifactFactory;
+import de.intevation.artifacts.CallMeta;
+
+import de.intevation.artifactdatabase.state.DefaultOutput;
+import de.intevation.artifactdatabase.state.Facet;
+import de.intevation.artifactdatabase.state.State;
+
+import de.intevation.flys.model.River;
+import de.intevation.flys.model.HydrBoundaryPoly;
+
+import de.intevation.flys.artifacts.model.FacetTypes;
+import de.intevation.flys.artifacts.model.RiverFactory;
+import de.intevation.flys.artifacts.resources.Resources;
+import de.intevation.flys.utils.FLYSUtils;
+
+
+public class WMSHydrBoundaryPolyArtifact extends WMSDBArtifact {
+
+    public static final String NAME = "hydr_boundary_poly";
+
+
+    private static final Logger logger =
+        Logger.getLogger(WMSHydrBoundaryPolyArtifact.class);
+
+
+    @Override
+    public void setup(
+        String          identifier,
+        ArtifactFactory factory,
+        Object          context,
+        CallMeta        callMeta,
+        Document        data)
+    {
+        logger.debug("WMSHydrBoundaryArtifact.setup");
+
+        super.setup(identifier, factory, context, callMeta, data);
+    }
+
+
+    @Override
+    public String getName() {
+        return NAME;
+    }
+
+
+    @Override
+    public State getCurrentState(Object cc) {
+        State s = new HydrBoundaryPolyState(this);
+
+        List<Facet> fs = facets.get(getCurrentStateId());
+
+        DefaultOutput o = new DefaultOutput(
+            "floodmap",
+            "floodmap",
+            "image/png",
+            fs,
+            "map");
+
+        s.getOutputs().add(o);
+
+        return s;
+    }
+
+
+    public static class HydrBoundaryPolyState extends WMSDBState implements FacetTypes
+    {
+        private static final Logger logger =
+            Logger.getLogger(HydrBoundaryPolyState.class);
+
+        protected int riverId;
+
+        public HydrBoundaryPolyState(WMSDBArtifact artifact) {
+            super(artifact);
+            riverId = 0;
+        }
+
+        @Override
+        protected String getFacetType() {
+            return FLOODMAP_HYDR_BOUNDARY_POLY;
+        }
+
+        @Override
+        protected String getUrl() {
+            return FLYSUtils.getUserWMSUrl(artifact.identifier());
+        }
+
+        @Override
+        protected String getSrid() {
+            River river = RiverFactory.getRiver(getRiverId());
+            return FLYSUtils.getRiverSrid(river.getName());
+        }
+
+        @Override
+        protected Envelope getExtent() {
+            List<HydrBoundaryPoly> boundaries = HydrBoundaryPoly.getHydrBoundaries(
+                getRiverId(), getName());
+
+            Envelope max = null;
+
+            for (HydrBoundaryPoly b: boundaries) {
+                Envelope env = b.getGeom().getEnvelopeInternal();
+
+                if (max == null) {
+                    max = env;
+                    continue;
+                }
+
+                max.expandToInclude(env);
+            }
+
+            return max;
+        }
+
+        @Override
+        protected String getFilter() {
+            return "river_id=" + String.valueOf(getRiverId())
+                + " AND name='" + getName() + "'";
+        }
+
+        @Override
+        protected String getDataString() {
+            String srid = getSrid();
+
+            if (FLYSUtils.isUsingOracle()) {
+                return "geom FROM hydr_boundaries USING SRID " + srid;
+            }
+            else {
+                return "geom FROM hydr_boundaries USING UNIQUE id USING SRID " + srid;
+            }
+        }
+
+        @Override
+        protected String getGeometryType() {
+            return "POLYGON";
+        }
+    } // end of HydrBoundaryState
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSKmArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -107,11 +107,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(meta, FLOODMAP_KMS, FLOODMAP_KMS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSLineArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSLineArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -86,13 +86,14 @@
 
         public int getRiverId() {
             if (riverId == 0) {
-                String ids = artifact.getDataAsString("ids");
+                String   ids   = artifact.getDataAsString("ids");
+                String[] parts = ids.split(";");
 
                 try {
-                    riverId = Integer.valueOf(ids);
+                    riverId = Integer.valueOf(parts[0]);
                 }
                 catch (NumberFormatException nfe) {
-                    logger.error("Cannot parse river id from '" + ids + "'");
+                    logger.error("Cannot parse river id from '" + parts[0] + "'");
                 }
             }
 
@@ -105,14 +106,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(
-                meta,
-                FLOODMAP_LINES,
-                FLOODMAP_LINES);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
@@ -125,7 +118,7 @@
 
         @Override
         protected Envelope getExtent() {
-            List<Line> lines = Line.getLines(getRiverId());
+            List<Line> lines = Line.getLines(getRiverId(), getName());
 
             Envelope max = null;
 
@@ -145,7 +138,8 @@
 
         @Override
         protected String getFilter() {
-            return "river_id=" + String.valueOf(getRiverId());
+            return "river_id=" + String.valueOf(getRiverId()) +
+                " AND name='" + getName() + "'";
         }
 
         @Override
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WMSQPSArtifact.java	Thu May 10 11:14:17 2012 +0000
@@ -105,11 +105,6 @@
         }
 
         @Override
-        protected String getTitle(CallMeta meta) {
-            return Resources.getMsg(meta, FLOODMAP_QPS, FLOODMAP_QPS);
-        }
-
-        @Override
         protected String getUrl() {
             return FLYSUtils.getUserWMSUrl(artifact.identifier());
         }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Thu May 10 10:04:12 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Thu May 10 11:14:17 2012 +0000
@@ -59,25 +59,27 @@
         }
     }
 
-    String AREA                   = "area";
-    String CROSS_SECTION_AREA     = "cross_section.area";
-    String LONGITUDINAL_SECTION_AREA = "longitudinal_section.area";
+    String AREA                        = "area";
+    String CROSS_SECTION_AREA          = "cross_section.area";
+    String LONGITUDINAL_SECTION_AREA   = "longitudinal_section.area";
 
-    String FLOODMAP_WSPLGEN       = "floodmap.wsplgen";
-    String FLOODMAP_BARRIERS      = "floodmap.barriers";
-    String FLOODMAP_USERSHAPE     = "floodmap.usershape";
-    String FLOODMAP_RIVERAXIS     = "floodmap.riveraxis";
-    String FLOODMAP_WMSBACKGROUND = "floodmap.wmsbackground";
-    String FLOODMAP_KMS           = "floodmap.kms";
-    String FLOODMAP_QPS           = "floodmap.qps";
-    String FLOODMAP_HWS           = "floodmap.hws";
-    String FLOODMAP_CATCHMENT     = "floodmap.catchment";
-    String FLOODMAP_FLOODPLAIN    = "floodmap.floodplain";
-    String FLOODMAP_LINES         = "floodmap.lines";
-    String FLOODMAP_BUILDINGS     = "floodmap.buildings";
-    String FLOODMAP_FIXPOINTS     = "floodmap.fixpoints";
-    String FLOODMAP_FLOODMAPS     = "floodmap.floodmaps";
-    String FLOODMAP_EXTERNAL_WMS  = "floodmap.externalwms";
+    String FLOODMAP_WSPLGEN            = "floodmap.wsplgen";
+    String FLOODMAP_BARRIERS           = "floodmap.barriers";
+    String FLOODMAP_USERSHAPE          = "floodmap.usershape";
+    String FLOODMAP_RIVERAXIS          = "floodmap.riveraxis";
+    String FLOODMAP_WMSBACKGROUND      = "floodmap.wmsbackground";
+    String FLOODMAP_KMS                = "floodmap.kms";
+    String FLOODMAP_QPS                = "floodmap.qps";
+    String FLOODMAP_HWS                = "floodmap.hws";
+    String FLOODMAP_HYDR_BOUNDARY      = "floodmap.hydr_boundaries";
+    String FLOODMAP_HYDR_BOUNDARY_POLY = "floodmap.hydr_boundaries_poly";
+    String FLOODMAP_CATCHMENT          = "floodmap.catchment";
+    String FLOODMAP_FLOODPLAIN         = "floodmap.floodplain";
+    String FLOODMAP_LINES              = "floodmap.lines";
+    String FLOODMAP_BUILDINGS          = "floodmap.buildings";
+    String FLOODMAP_FIXPOINTS          = "floodmap.fixpoints";
+    String FLOODMAP_FLOODMAPS          = "floodmap.floodmaps";
+    String FLOODMAP_EXTERNAL_WMS       = "floodmap.externalwms";
 
     String DISCHARGE_LONGITUDINAL_W = "discharge_longitudinal_section.w";
     String DISCHARGE_LONGITUDINAL_Q = "discharge_longitudinal_section.q";

http://dive4elements.wald.intevation.org