[Dive4elements-commits] [PATCH 5 of 5] Add HWSLines and HWSPoints to datacage for the map

Wald Commits scm-commit at wald.intevation.org
Wed Mar 20 16:37:31 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1363793822 -3600
# Node ID d43ef9f709cd7c54f03abad59e62f3c027335d09
# Parent  4b1d8f3674285c4008850805755a65bbb77dc0d4
Add HWSLines and HWSPoints to datacage for the map

diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/artifacts/map.xml
--- a/flys-artifacts/doc/conf/artifacts/map.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/artifacts/map.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -20,7 +20,8 @@
                         <facet name="floodmap.wmsbackground"/>
                         <facet name="floodmap.kms"/>
                         <facet name="floodmap.qps"/>
-                        <facet name="floodmap.hws"/>
+                        <facet name="floodmap.hws_lines"/>
+                        <facet name="floodmap.hws_points"/>
                         <facet name="floodmap.hydr_boundaries"/>
                         <facet name="floodmap.hydr_boundaries_poly"/>
                         <facet name="floodmap.catchment"/>
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/artifacts/winfo.xml
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/artifacts/winfo.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -554,7 +554,8 @@
                         <facet name="floodmap.wmsbackground"/>
                         <facet name="floodmap.kms"/>
                         <facet name="floodmap.qps"/>
-                        <facet name="floodmap.hws"/>
+                        <facet name="floodmap.hws_lines"/>
+                        <facet name="floodmap.hws_points"/>
                         <facet name="floodmap.hydr_boundaries"/>
                         <facet name="floodmap.hydr_boundaries_poly"/>
                         <facet name="floodmap.catchment"/>
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/conf.xml
--- a/flys-artifacts/doc/conf/conf.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/conf.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -105,6 +105,12 @@
             <artifact-factory name="qsectors" description="Factory to create an artifact to host qsectors."
                 ttl="3600000"
                 artifact="de.intevation.flys.artifacts.QSectorArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
+            <artifact-factory name="wmshwslinesfactory" description="Factory to create an artifact that generates WMS facets for HWS Lines"
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.WMSHWSLinesArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
+            <artifact-factory name="wmshwspointsfactory" description="Factory to create an artifact that generates WMS facets for HWS Points"
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.WMSHWSPointsArtifact">de.intevation.artifactdatabase.DefaultArtifactFactory</artifact-factory>
 
             <!-- MINFO specific Artifacts -->
             <artifact-factory name="minfo" description="Factory to create an artifact to be used in module minfo."
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -1260,7 +1260,7 @@
                   </dc:elements>
                 </dc:context>
               </dc:macro>
-              <dc:macro name="flood-map-hwslines">
+              <dc:macro name="hwslines">
                 <dc:context>
                   <dc:statement>
                     SELECT count(*) as km_exists, name as name
@@ -1269,7 +1269,24 @@
                    <dc:elements>
                     <dc:if test="$km_exists>0">
                       <line>
-                        <dc:attribute name="factory" value="wmslinefactory"/>
+                        <dc:attribute name="factory" value="wmshwslinesfactory"/>
+                        <dc:attribute name="ids" value="${river_id};${name}"/>
+                        <dc:attribute name="name" value="${name}"/>
+                      </line>
+                    </dc:if>
+                  </dc:elements>
+                </dc:context>
+              </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>
@@ -1436,9 +1453,14 @@
                     <dc:call-macro name="flood-map-km"/>
                     <dc:call-macro name="flood-map-qps"/>
                   </kilometrage>
-                  <hwslines>
-                    <dc:call-macro name="flood-map-hwslines"/>
-                  </hwslines>
+                  <hws>
+                    <hws_lines>
+                      <dc:call-macro name="hwslines"/>
+                    </hws_lines>
+                    <hws_points>
+                      <dc:call-macro name="hwspoints"/>
+                    </hws_points>
+                  </hws>
                   <dc:call-macro name="flood-map-uesk"/>
                   <gaugelocations>
                     <dc:call-macro name="flood-map-gaugelocations"/>
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/themes.xml
--- a/flys-artifacts/doc/conf/themes.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/themes.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -203,7 +203,8 @@
         <mapping from="floodmap.riveraxis" to="RiverAxis" />
         <mapping from="floodmap.kms" to="Kms" />
         <mapping from="floodmap.qps" to="Qps" />
-        <mapping from="floodmap.hws" to="Hws" />
+        <mapping from="floodmap.hws_lines" to="Hws" />
+        <mapping from="floodmap.hws_points" to="HwsPoints" />
         <mapping from="floodmap.hydr_boundaries" to="HydrBoundariesLines" />
         <mapping from="floodmap.hydr_boundaries_poly" to="HydrBoundariesPolys" />
         <mapping from="floodmap.catchment" to="Catchment" />
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/themes/default/floodmap.xml
--- a/flys-artifacts/doc/conf/themes/default/floodmap.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/themes/default/floodmap.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -80,6 +80,14 @@
         </inherits>
     </theme>
 
+    <theme name="HwsPoints">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
     <theme name="Catchment">
         <inherits>
             <inherit from="Map" />
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/doc/conf/themes/second/floodmap.xml
--- a/flys-artifacts/doc/conf/themes/second/floodmap.xml	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/doc/conf/themes/second/floodmap.xml	Wed Mar 20 16:37:02 2013 +0100
@@ -80,6 +80,14 @@
         </inherits>
     </theme>
 
+    <theme name="HwsPoints">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
     <theme name="Catchment">
         <inherits>
             <inherit from="Map" />
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Wed Mar 20 16:37:02 2013 +0100
@@ -161,7 +161,8 @@
     String FLOODMAP_WMSBACKGROUND      = "floodmap.wmsbackground";
     String FLOODMAP_KMS                = "floodmap.kms";
     String FLOODMAP_QPS                = "floodmap.qps";
-    String FLOODMAP_HWS                = "floodmap.hws";
+    String FLOODMAP_HWS_LINES          = "floodmap.hws_lines";
+    String FLOODMAP_HWS_POINTS         = "floodmap.hws_points";
     String FLOODMAP_HYDR_BOUNDARY      = "floodmap.hydr_boundaries";
     String FLOODMAP_HYDR_BOUNDARY_POLY = "floodmap.hydr_boundaries_poly";
     String FLOODMAP_CATCHMENT          = "floodmap.catchment";
diff -r 4b1d8f367428 -r d43ef9f709cd flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodMapState.java	Wed Mar 20 16:37:02 2013 +0100
@@ -427,7 +427,7 @@
             job.addLin(artifactDir + "/" + HWS_LINES_SHAPE);
             facetCreator.createShapeFacet(I18N_HWS_LINES,
                 MapfileGenerator.MS_LAYER_PREFIX + HWS_LINES,
-                FLOODMAP_HWS,2);
+                FLOODMAP_HWS_LINES,2);
         }
     }
 
diff -r 4b1d8f367428 -r d43ef9f709cd flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java
--- a/flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/model/HWSPoint.java	Wed Mar 20 16:37:02 2013 +0100
@@ -3,6 +3,7 @@
 import com.vividsolutions.jts.geom.Geometry;
 
 import java.io.Serializable;
+import java.util.List;
 
 import java.math.BigDecimal;
 
@@ -17,6 +18,10 @@
 import javax.persistence.SequenceGenerator;
 
 import org.hibernate.annotations.Type;
+import org.hibernate.Session;
+import org.hibernate.Query;
+
+import de.intevation.flys.backend.SessionHolder;
 
 @Entity
 @Table(name = "hws_points")
@@ -437,5 +442,16 @@
     {
         this.river = river;
     }
+
+    public static List<HWSPoint> getPoints(int riverId, String name) {
+        Session session = SessionHolder.HOLDER.get();
+
+        Query query = session.createQuery(
+                    "from HWSPoint where river.id =:river_id and name=:name");
+        query.setParameter("river_id", riverId);
+        query.setParameter("name", name);
+
+        return query.list();
+    }
 }
 
diff -r 4b1d8f367428 -r d43ef9f709cd 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	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Wed Mar 20 16:37:02 2013 +0100
@@ -1152,5 +1152,16 @@
 
     String welcome_open_or_create();
 
+    String official();
+
+    String inofficial();
+
+    String custom_lines();
+
+    String hws_lines();
+
+    String hws_points();
+
+
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 4b1d8f367428 -r d43ef9f709cd 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	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Wed Mar 20 16:37:02 2013 +0100
@@ -455,6 +455,11 @@
 epoch = Epoch
 bedheights = Bedheights
 datacage = Datacage
+official = Offical
+inofficial = Inofficiall
+custom_lines = Own Digitalizations
+hws_lines = Lines
+hws_points = Points
 
 startcolor = Colorrange start color
 endcolor = Colorrange end color
diff -r 4b1d8f367428 -r d43ef9f709cd 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	Wed Mar 20 16:35:47 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Wed Mar 20 16:37:02 2013 +0100
@@ -456,6 +456,11 @@
 epoch = Epoche
 bedheights = Sohlh\u00f6hen
 datacage = Datenkorb
+official = Offiziell
+inofficial = Inoffiziell
+custom_lines = Eigene Digitalisierungen
+hws_lines = Liniendaten
+hws_points = Punktdaten
 
 startcolor = Farbverlauf Startfarbe
 endcolor = Farbverlauf Endfarbe


More information about the Dive4elements-commits mailing list