Mercurial > dive4elements > river
changeset 4324:4980659b2f22
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.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 30 Oct 2012 12:49:17 +0100 (2012-10-30) |
parents | 33d6d4025d0f |
children | 7320830987a3 |
files | flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/MeasurementStationInfoService.java |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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); }