[Dive4elements-commits] [PATCH 1 of 5] Add gauge name to the measurement station xml response

Wald Commits scm-commit at wald.intevation.org
Tue Oct 30 13:05:40 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1351597757 -3600
# Node ID 4980659b2f226522a1d986b54870df6638ee0e1d
# Parent  33d6d4025d0f09ec15b95f410ace9fbc016b58f7
Add gauge name to the measurement station xml response

The reference gauge should be displayed in the measurement station info panel.
Therefore the artifact service must return the name of the gauge.

diff -r 33d6d4025d0f -r 4980659b2f22 flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java	Tue Oct 30 12:06:29 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java	Tue Oct 30 12:49:17 2012 +0100
@@ -18,6 +18,7 @@
 
 import de.intevation.flys.artifacts.model.RiverFactory;
 import de.intevation.flys.model.MeasurementStation;
+import de.intevation.flys.model.Gauge;
 import de.intevation.flys.model.Range;
 import de.intevation.flys.model.River;
 import de.intevation.flys.model.TimeInterval;
@@ -109,6 +110,15 @@
                 }
             }
 
+            Gauge gauge = mstation.getGauge();
+            String gaugename = gauge.getName();
+
+            if (gaugename != null) {
+                Element egauge = ec.create("gauge");
+                ec.addAttr(egauge, "name", gaugename, true);
+                eg.appendChild(egauge);
+            }
+
             egs.appendChild(eg);
         }
 


More information about the Dive4elements-commits mailing list