Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/DischargeInfoServiceImpl.java @ 6837:9da2298ae380
(issue1353) Add river name to query for discharge Info
The previous assumption was that the official number is unique
for a gauge. This assumption is broken by having multiple variants
of a river in the database, like Donau (schleusenkanäle)
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 15 Aug 2013 15:57:13 +0200 |
parents | ea9eef426962 |
children | 238fc722f87a |
comparison
equal
deleted
inserted
replaced
6836:caf027fe0715 | 6837:9da2298ae380 |
---|---|
46 "error_no_dischargeinfo_found"; | 46 "error_no_dischargeinfo_found"; |
47 | 47 |
48 public static final String XPATH_DISTANCES = "art:discharges/art:discharge"; | 48 public static final String XPATH_DISTANCES = "art:discharges/art:discharge"; |
49 | 49 |
50 | 50 |
51 @Override | |
51 public DischargeInfoObject[] getDischargeInfo( | 52 public DischargeInfoObject[] getDischargeInfo( |
52 String locale, | 53 String locale, |
53 long gauge) | 54 long gauge, |
55 String river) | |
54 throws ServerException | 56 throws ServerException |
55 { | 57 { |
56 logger.info("DichargeInfoServiceImpl.getDischargeInfo"); | 58 logger.info("DichargeInfoServiceImpl.getDischargeInfo"); |
57 | 59 |
58 String url = getServletContext().getInitParameter("server-url"); | 60 String url = getServletContext().getInitParameter("server-url"); |
65 ArtifactNamespaceContext.NAMESPACE_PREFIX); | 67 ArtifactNamespaceContext.NAMESPACE_PREFIX); |
66 | 68 |
67 Element gaugeEl = ec.create("gauge"); | 69 Element gaugeEl = ec.create("gauge"); |
68 gaugeEl.setTextContent(String.valueOf(gauge)); | 70 gaugeEl.setTextContent(String.valueOf(gauge)); |
69 | 71 |
72 Element riverEl = ec.create("river"); | |
73 riverEl.setTextContent(river); | |
74 | |
75 gaugeEl.appendChild(riverEl); | |
70 doc.appendChild(gaugeEl); | 76 doc.appendChild(gaugeEl); |
71 | 77 |
72 HttpClient client = new HttpClientImpl(url, locale); | 78 HttpClient client = new HttpClientImpl(url, locale); |
73 | 79 |
74 try { | 80 try { |