# HG changeset patch # User Sascha L. Teichmann # Date 1340278342 0 # Node ID 1f63e2ef03d235fbbf57cbc21600956a6eead3f1 # Parent d20f16a430a9f84761458a7abbf6251d5e4b301c Added more debug output about the transmitted fix overview documents. flys-client/trunk@4738 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r d20f16a430a9 -r 1f63e2ef03d2 flys-client/ChangeLog --- a/flys-client/ChangeLog Thu Jun 21 11:04:46 2012 +0000 +++ b/flys-client/ChangeLog Thu Jun 21 11:32:22 2012 +0000 @@ -1,3 +1,8 @@ +2012-06-21 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java: + Added more debug ouput about the transmitted documents. + 2012-06-21 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java: diff -r d20f16a430a9 -r 1f63e2ef03d2 flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java Thu Jun 21 11:04:46 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java Thu Jun 21 11:32:22 2012 +0000 @@ -70,6 +70,13 @@ return null; } + boolean debug = log.isDebugEnabled(); + + if (debug) { + log.debug("JSON filter: ------------------"); + log.debug(filter); + } + Document filterDoc = XMLUtils.jsonToXML(filter); if (filterDoc == null) { @@ -77,20 +84,24 @@ return null; } -/* filterDoc = XMLUtils.newDocument(); - ElementCreator ec = new ElementCreator(filterDoc, null, null); - Element f = ec.create("fixings"); - Element r = ec.create("river"); - r.setAttribute("name", "Saar"); - f.appendChild(r); - filterDoc.appendChild(f); -*/ + if (debug) { + log.debug("XML filter: ------------------"); + log.debug(XMLUtils.toString(filterDoc)); + } + try { String url = getServletContext().getInitParameter("server-url"); HttpClient client = new HttpClientImpl(url, locale); - Document resultDoc = + Document resultDoc = client.callService(url, SERVICE_NAME, filterDoc); - FixingsOverviewInfo i = getInfo(resultDoc, uuid, checkboxes, callback); + + if (debug) { + log.debug("Result XML: -----------"); + log.debug(XMLUtils.toString(resultDoc)); + } + + FixingsOverviewInfo i = + getInfo(resultDoc, uuid, checkboxes, callback); return i; } catch (ConnectionException ce) { @@ -106,7 +117,6 @@ boolean checkboxes, String callback ) { - InputStream transform = getServletContext() .getResourceAsStream(XSL_TRANSFORM); @@ -130,6 +140,12 @@ catch (IOException ioe) {} } + if (log.isDebugEnabled()) { + log.debug("--------------------------------------"); + log.debug(result); + log.debug("--------------------------------------"); + } + int rid = -1; double from = -1; double to = -1; @@ -160,6 +176,8 @@ protected List getFixEvents(Document doc) { + List list = new ArrayList(); + NodeList events = (NodeList) XMLUtils.xpath( doc, XPATH_EVENT, @@ -168,10 +186,9 @@ if (events == null || events.getLength() == 0) { log.warn("No events in Overview!"); - return null; + return list; } - List list = new ArrayList(); for (int i = 0, E = events.getLength(); i < E; i++) { Element n = (Element)events.item(i); List sectors = getSectors(n);