comparison gwt-client/src/main/java/org/dive4elements/river/client/server/SedimentLoadInfoServiceImpl.java @ 8230:f54c4b858213

(issue1448) Extend SedimentLoadInfo request to handle sq time intervals
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 08 Sep 2014 16:23:38 +0200
parents 238fc722f87a
children 582e970115b6
comparison
equal deleted inserted replaced
8229:0bf888783683 8230:f54c4b858213
44 public SedimentLoadInfoObject[] getSedimentLoadInfo( 44 public SedimentLoadInfoObject[] getSedimentLoadInfo(
45 String locale, 45 String locale,
46 String river, 46 String river,
47 String type, 47 String type,
48 double startKm, 48 double startKm,
49 double endKm) 49 double endKm,
50 String sq_ti_id)
50 throws ServerException 51 throws ServerException
51 { 52 {
52 log.info("SedimentLoadInfoServiceImpl.getSedimentLoadInfo"); 53 log.info("SedimentLoadInfoServiceImpl.getSedimentLoadInfo");
53 54
54 String url = getServletContext().getInitParameter("server-url"); 55 String url = getServletContext().getInitParameter("server-url");
63 Element riverEl = ec.create("river"); 64 Element riverEl = ec.create("river");
64 Element location = ec.create("location"); 65 Element location = ec.create("location");
65 Element from = ec.create("from"); 66 Element from = ec.create("from");
66 Element to = ec.create("to"); 67 Element to = ec.create("to");
67 Element typeEl = ec.create("type"); 68 Element typeEl = ec.create("type");
69 Element sqTiEl = ec.create("sq_ti_id");
68 riverEl.setTextContent(river); 70 riverEl.setTextContent(river);
69 from.setTextContent(String.valueOf(startKm)); 71 from.setTextContent(String.valueOf(startKm));
70 to.setTextContent(String.valueOf(endKm)); 72 to.setTextContent(String.valueOf(endKm));
73 sqTiEl.setTextContent(sq_ti_id);
71 typeEl.setTextContent(type); 74 typeEl.setTextContent(type);
72 75
73 location.appendChild(from); 76 location.appendChild(from);
74 location.appendChild(to); 77 location.appendChild(to);
75 riverEl.appendChild(location); 78 riverEl.appendChild(location);
76 riverEl.appendChild(typeEl); 79 riverEl.appendChild(typeEl);
80 riverEl.appendChild(sqTiEl);
77 doc.appendChild(riverEl); 81 doc.appendChild(riverEl);
78 82
79 HttpClient client = new HttpClientImpl(url, locale); 83 HttpClient client = new HttpClientImpl(url, locale);
80 84
81 try { 85 try {
147 */ 151 */
148 protected SedimentLoadInfoObject buildSedimentLoadInfoObject(Element node) { 152 protected SedimentLoadInfoObject buildSedimentLoadInfoObject(Element node) {
149 153
150 String desc = node.getAttribute("description").trim(); 154 String desc = node.getAttribute("description").trim();
151 String date = node.getAttribute("date").trim(); 155 String date = node.getAttribute("date").trim();
156 String sq_ti_date= node.getAttribute("sq_date").trim();
157 String sq_ti_id = node.getAttribute("sq_ti_id").trim();
152 158
153 if (desc.length() > 0 && date.length() > 0) { 159 if (desc.length() > 0 && date.length() > 0) {
154 return new SedimentLoadInfoObjectImpl(desc, date); 160 return new SedimentLoadInfoObjectImpl(desc, date, sq_ti_date, sq_ti_id);
155 } 161 }
156 162
157 log.warn("Invalid sediment load info object found."); 163 log.warn("Invalid sediment load info object found.");
158 164
159 return null; 165 return null;

http://dive4elements.wald.intevation.org