# HG changeset patch # User Ingo Weinzierl # Date 1350986327 -7200 # Node ID 08b6458909a9620a3efc3227ef171431629c9347 # Parent a04862abce42a8acd01da8befc41ab20d9e0a64c The service 'DischargeTablesOverview' now accepts the official number of a gauge, too. The service first tries to parse the official number (long value). If it fails, it it assumed that the the name of the gauge is specified. diff -r a04862abce42 -r 08b6458909a9 flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java Tue Oct 23 10:50:48 2012 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/DischargeTablesOverview.java Tue Oct 23 11:58:47 2012 +0200 @@ -173,6 +173,16 @@ if (gauges.getLength() > 0) { String name = ((Element) gauges.item(0)).getAttribute("name"); + + try { + long officialNumber = Long.valueOf(name); + return Gauge.getGaugeByOfficialNumber(officialNumber); + } + catch (NumberFormatException nfe) { + // it seems, that the client uses the name of the gauge instead + // of its official number + } + if (name != null && name.length() > 0) { return GaugesFactory.getGauge(name); }