# HG changeset patch # User Ingo Weinzierl # Date 1305010126 0 # Node ID 5091675676d673b42bbfa1d66526efa431d2b8d7 # Parent 7017ed659ee6dbbedc27591b3329de7dbbc98390 Fixed attributes/namespaces in the XML document that is used to fetch the CSV export of WINFO computations. flys-client/trunk@1871 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 7017ed659ee6 -r 5091675676d6 flys-client/ChangeLog --- a/flys-client/ChangeLog Mon May 09 16:22:11 2011 +0000 +++ b/flys-client/ChangeLog Tue May 10 06:48:46 2011 +0000 @@ -1,3 +1,13 @@ +2011-05-10 Ingo Weinzierl + + * src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java: + Bugfix: Use the ElementCreator from XMLUtils to add attribute to nodes + in the xml document. Then, those nodes will have the ArtifactNamespace + automatically. If we do something like + node.setAttribute("art:attr", "value") + Restlet will throw an exception, because it does not know the "art:" + namespace. + 2011-05-09 Ingo Weinzierl * pom.xml: Bugfix: replaced the goupId of the OpenCSV dependency with the diff -r 7017ed659ee6 -r 5091675676d6 flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java Mon May 09 16:22:11 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java Tue May 10 06:48:46 2011 +0000 @@ -54,20 +54,19 @@ name = name.substring(name.indexOf(".") + 1); } - Element action = ec.create("art:action"); - action.setAttribute("art:type", "csv"); - action.setAttribute("art:name", name); + Element action = ec.create("action"); + ec.addAttr(action, "type", "csv", true); + ec.addAttr(action, "name", name, true); requestDoc.appendChild(action); HttpClient client = new HttpClientImpl(url, locale); try { InputStream in = client.collectionOut(requestDoc, uuid, "export"); - Reader reader = new InputStreamReader (in, "UTF-8"); + Reader reader = new InputStreamReader (in, "UTF-8"); CSVReader csvReader = new CSVReader (reader); - String[] line; - List l = csvReader.readAll (); - return l; + + return csvReader.readAll (); } catch (IOException ce) { System.err.println(ce.getLocalizedMessage());