changeset 5437:b582df0c7b00

Add Jetties to floodmap
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 26 Mar 2013 17:31:55 +0100
parents 7dcf604a4bf7
children 91b14ade2149
files 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/doc/conf/themes/default/floodmap.xml flys-artifacts/doc/conf/themes/second/floodmap.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java flys-backend/src/main/java/de/intevation/flys/backend/FLYSCredentials.java flys-backend/src/main/java/de/intevation/flys/model/Jetty.java 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 13 files changed, 128 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/artifacts/map.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/artifacts/map.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -32,6 +32,7 @@
                         <facet name="floodmap.floodmaps"/>
                         <facet name="floodmap.gauge_location"/>
                         <facet name="floodmap.externalwms"/>
+                        <facet name="floodmap.jetties"/>
                     </facets>
                 </outputmode>
             </outputmodes>
--- a/flys-artifacts/doc/conf/artifacts/winfo.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/artifacts/winfo.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -566,6 +566,7 @@
                         <facet name="floodmap.floodmaps"/>
                         <facet name="floodmap.gauge_location"/>
                         <facet name="floodmap.externalwms"/>
+                        <facet name="floodmap.jetties"/>
                     </facets>
                 </outputmode>
                 <outputmode name="wsplgen_report" description="output.wsplgen_report" mime-type="text/xml" type="report">
--- a/flys-artifacts/doc/conf/conf.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/conf.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -111,6 +111,9 @@
             <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>
+            <artifact-factory name="wmsjettiesfactory" description="Factory to create an artifact to be used in WINFO"
+                ttl="3600000"
+                artifact="de.intevation.flys.artifacts.WMSJettiesArtifact">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."
--- a/flys-artifacts/doc/conf/meta-data.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/meta-data.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -1561,6 +1561,27 @@
                 </dc:element>
               </dc:elements>
             </dc:context>
+            <dc:context>
+              <dc:statement>
+                SELECT DISTINCT
+                j.kind_id AS jetty_kind_id,
+                jk.name AS jetty_kind
+                FROM jetties j
+                JOIN jetty_kinds jk ON j.kind_id = jk.id
+                WHERE river_id = ${river_id}
+              </dc:statement>
+              <dc:if test="dc:has-result()">
+                <jetties>
+                  <dc:elements>
+                    <jetty>
+                      <dc:attribute name="description" value="${jetty_kind}"/>
+                      <dc:attribute name="factory" value="wmsjettiesfactory"/>
+                      <dc:attribute name="ids" value="${river_id};${jetty_kind};${jetty_kind_id}"/>
+                    </jetty>
+                  </dc:elements>
+                </jetties>
+              </dc:if>
+            </dc:context>
           </dc:macro>
             <dc:macro name="flood-map-fixpoints">
               <dc:context>
--- a/flys-artifacts/doc/conf/themes.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/themes.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -214,6 +214,7 @@
         <mapping from="floodmap.fixpoints" to="Fixpoints" />
         <mapping from="floodmap.floodmaps" to="Floodmaps" />
         <mapping from="floodmap.gauge_location" to="GaugeLocation" />
+        <mapping from="floodmap.jetties" to="Jetties" />
         <mapping from="other.wq" to="WQPoints" />
         <mapping from="other.wkms" to="WKms" />
         <mapping from="other.wkms.marks" to="WKmsAnnotation" />
--- a/flys-artifacts/doc/conf/themes/default/floodmap.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/themes/default/floodmap.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -121,4 +121,12 @@
             <inherit from="Map" />
         </inherits>
     </theme>
+
+    <theme name="Jetties">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
 <!--/themegroup-->
--- a/flys-artifacts/doc/conf/themes/second/floodmap.xml	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/doc/conf/themes/second/floodmap.xml	Tue Mar 26 17:31:55 2013 +0100
@@ -121,4 +121,12 @@
             <inherit from="Map" />
         </inherits>
     </theme>
+
+    <theme name="Jetties">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
 <!--/themegroup-->
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java	Tue Mar 26 17:31:55 2013 +0100
@@ -174,6 +174,7 @@
     String FLOODMAP_FLOODMAPS          = "floodmap.floodmaps";
     String FLOODMAP_GAUGE_LOCATION     = "floodmap.gauge_location";
     String FLOODMAP_EXTERNAL_WMS       = "floodmap.externalwms";
+    String FLOODMAP_JETTIES            = "floodmap.jetties";
 
     String DISCHARGE_LONGITUDINAL_W = "discharge_longitudinal_section.w";
     String DISCHARGE_LONGITUDINAL_Q = "discharge_longitudinal_section.q";
--- a/flys-backend/src/main/java/de/intevation/flys/backend/FLYSCredentials.java	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/backend/FLYSCredentials.java	Tue Mar 26 17:31:55 2013 +0100
@@ -47,6 +47,7 @@
 import de.intevation.flys.model.HYKFormation;
 import de.intevation.flys.model.HydrBoundary;
 import de.intevation.flys.model.HydrBoundaryPoly;
+import de.intevation.flys.model.Jetty;
 import de.intevation.flys.model.LocationSystem;
 import de.intevation.flys.model.MainValue;
 import de.intevation.flys.model.MainValueType;
@@ -167,6 +168,7 @@
         HYKFormation.class,
         HYKFlowZoneType.class,
         HYKFlowZone.class,
+        Jetty.class,
         LocationSystem.class,
         MainValueType.class,
         MeasurementStation.class,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/model/Jetty.java	Tue Mar 26 17:31:55 2013 +0100
@@ -0,0 +1,79 @@
+package de.intevation.flys.model;
+
+import java.io.Serializable;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+
+import com.vividsolutions.jts.geom.Geometry;
+
+import org.hibernate.Session;
+import org.hibernate.Query;
+import org.hibernate.annotations.Type;
+
+import de.intevation.flys.backend.SessionHolder;
+
+@Entity
+@Table(name = "jetties")
+public class Jetty
+implements   Serializable
+{
+    private Integer    id;
+    private River      river;
+    private Geometry   geom;
+
+    public Jetty() {
+    }
+
+
+    @Id
+    @Column(name = "id")
+    public Integer getId() {
+        return id;
+    }
+
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+
+    @OneToOne
+    @JoinColumn(name = "river_id")
+    public River getRiver() {
+        return river;
+    }
+
+
+    public void setRiver(River river) {
+        this.river = river;
+    }
+
+    @Column(name = "geom")
+    @Type(type = "org.hibernatespatial.GeometryUserType")
+    public Geometry getGeom() {
+        return geom;
+    }
+
+
+    public void setGeom(Geometry geom) {
+        this.geom = geom;
+    }
+
+    public static List<Jetty> getJetties(int riverId, int kindId) {
+        Session session = SessionHolder.HOLDER.get();
+
+        Query query = session.createQuery(
+            "from Jetty where river.id =:river_id and kind_id=:kind_id");
+        query.setParameter("kind_id", kindId);
+        query.setParameter("river_id", riverId);
+
+        return query.list();
+    }
+}
+// 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.java	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Tue Mar 26 17:31:55 2013 +0100
@@ -1164,6 +1164,7 @@
 
     String hws_fed_unknown();
 
+    String jetties();
 
 }
 // 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	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Tue Mar 26 17:31:55 2013 +0100
@@ -461,6 +461,7 @@
 hws_lines = Lines
 hws_points = Points
 hws_fed_unknown = Unknown State
+jetties = Jetties
 
 startcolor = Colorrange start color
 endcolor = Colorrange end color
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Tue Mar 26 16:34:49 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Tue Mar 26 17:31:55 2013 +0100
@@ -462,6 +462,7 @@
 hws_lines = Liniendaten
 hws_points = Punktdaten
 hws_fed_unknown = Unbekanntes Bundesland
+jetties = Buhnen
 
 startcolor = Farbverlauf Startfarbe
 endcolor = Farbverlauf Endfarbe

http://dive4elements.wald.intevation.org