diff flys-client/src/main/java/de/intevation/flys/client/server/ArtifactHelper.java @ 5503:b660090b417d

Create a new sq relation project on measurement station record click. * Added new methods to artifact service. * Added new client-side artifact. * Updated UI to have a new row in 'Messstellen-Info'.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 28 Mar 2013 15:21:15 +0100
parents 436eec3be6ff
children
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactHelper.java	Thu Mar 28 15:17:52 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ArtifactHelper.java	Thu Mar 28 15:21:15 2013 +0100
@@ -39,7 +39,7 @@
      * Name of the factory to generate a GaugeDischargeCurveArtifact
      */
     private static final String GAUGE_DISCHARGE_CURVE_ARTIFACT = "gaugedischargecurve";
-
+    private static final String SQ_RELATION_ARTIFACT = "staticsqrelation";
 
     private ArtifactHelper() {
     }
@@ -162,5 +162,35 @@
 
         return cf;
     }
+
+
+    public static Artifact createSQRelationArtifact(
+        String serverUrl,
+        String locale,
+        String river,
+        int measurementStation)
+    throws ServerException
+    {
+        Document create = ClientProtocolUtils.newCreateDocument(
+                SQ_RELATION_ARTIFACT);
+
+        XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
+            create,
+            ArtifactNamespaceContext.NAMESPACE_URI,
+            ArtifactNamespaceContext.NAMESPACE_PREFIX);
+
+        Element root = create.getDocumentElement();
+
+        Element eriver = ec.create("river");
+        ec.addAttr(eriver, "name", river);
+
+        Element estation = ec.create("measurement_station");
+        ec.addAttr(estation, "number", String.valueOf(measurementStation));
+
+        root.appendChild(eriver);
+        root.appendChild(estation);
+
+        return sendCreate(serverUrl, locale, create);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org