comparison gwt-client/src/main/java/org/dive4elements/river/client/server/RiverInfoServiceImpl.java @ 8412:17db08570637

SCHEMA CHANGE: removed superfluous columns station and river_id from measurement_stations and adapted other components accordingly.
author Tom Gottfried <tom@intevation.de>
date Wed, 15 Oct 2014 19:20:26 +0200
parents 238fc722f87a
children 71144e25a6c9
comparison
equal deleted inserted replaced
8411:b8c6cb36607e 8412:17db08570637
127 try { 127 try {
128 Document result = client.callService(url, "measurementstationinfo", doc); 128 Document result = client.callService(url, "measurementstationinfo", doc);
129 129
130 DefaultRiverInfo riverinfo = getRiverInfo(result); 130 DefaultRiverInfo riverinfo = getRiverInfo(result);
131 List<MeasurementStation> mstations = createMeasurementStations( 131 List<MeasurementStation> mstations = createMeasurementStations(
132 result, riverinfo.getName(), riverinfo.isKmUp()); 132 result, riverinfo.getName());
133 133
134 riverinfo.setMeasurementStations(mstations); 134 riverinfo.setMeasurementStations(mstations);
135 135
136 log.debug("Finished MeasurementStationInfoService."); 136 log.debug("Finished MeasurementStationInfoService.");
137 137
199 return null; 199 return null;
200 } 200 }
201 } 201 }
202 202
203 private List<MeasurementStation> createMeasurementStations( 203 private List<MeasurementStation> createMeasurementStations(
204 Document result, String rivername, boolean kmup) { 204 Document result, String rivername) {
205 205
206 NodeList stationnodes = (NodeList) XMLUtils.xpath( 206 NodeList stationnodes = (NodeList) XMLUtils.xpath(
207 result, 207 result,
208 XPATH_STATIONS, 208 XPATH_STATIONS,
209 XPathConstants.NODESET, 209 XPathConstants.NODESET,
226 ArtifactNamespaceContext.NAMESPACE_URI, "name"); 226 ArtifactNamespaceContext.NAMESPACE_URI, "name");
227 String mstart = stationele.getAttributeNS( 227 String mstart = stationele.getAttributeNS(
228 ArtifactNamespaceContext.NAMESPACE_URI, "start"); 228 ArtifactNamespaceContext.NAMESPACE_URI, "start");
229 String mend = stationele.getAttributeNS( 229 String mend = stationele.getAttributeNS(
230 ArtifactNamespaceContext.NAMESPACE_URI, "end"); 230 ArtifactNamespaceContext.NAMESPACE_URI, "end");
231 String mstation = stationele.getAttributeNS(
232 ArtifactNamespaceContext.NAMESPACE_URI, "station");
233 String mtype = stationele.getAttributeNS( 231 String mtype = stationele.getAttributeNS(
234 ArtifactNamespaceContext.NAMESPACE_URI, "type"); 232 ArtifactNamespaceContext.NAMESPACE_URI, "type");
235 String riverside = stationele.getAttributeNS( 233 String riverside = stationele.getAttributeNS(
236 ArtifactNamespaceContext.NAMESPACE_URI, "riverside"); 234 ArtifactNamespaceContext.NAMESPACE_URI, "riverside");
237 String mid = stationele.getAttributeNS( 235 String mid = stationele.getAttributeNS(
256 254
257 MeasurementStation station = new DefaultMeasurementStation( 255 MeasurementStation station = new DefaultMeasurementStation(
258 rivername, 256 rivername,
259 mname, 257 mname,
260 parseInteger(mid), 258 parseInteger(mid),
261 parseDouble(mstation),
262 parseDouble(mstart), 259 parseDouble(mstart),
263 parseDouble(mend), 260 parseDouble(mend),
264 kmup,
265 riverside, 261 riverside,
266 mtype, 262 mtype,
267 moperator, 263 moperator,
268 parseDate(mstarttime), 264 parseDate(mstarttime),
269 parseDate(mstoptime), 265 parseDate(mstoptime),

http://dive4elements.wald.intevation.org