Mercurial > dive4elements > river
changeset 550:605debcbb6a0
Adjusted the return values of the CSVExportService, so that GWT can handle those values better.
flys-client/trunk@2063 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 07 Jun 2011 12:51:57 +0000 (2011-06-07) |
parents | e74bf6bfeeb6 |
children | 13c7f90917fc |
files | flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportService.java flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java |
diffstat | 4 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportService.java Tue Jun 07 10:03:19 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportService.java Tue Jun 07 12:51:57 2011 +0000 @@ -19,7 +19,7 @@ /** * This method returns a list of DistanceInfoObjects for a specific river. */ - List getCSV( + List<String[]> getCSV( String serverUrl, String locale, String uuid,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportServiceAsync.java Tue Jun 07 10:03:19 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/CSVExportServiceAsync.java Tue Jun 07 12:51:57 2011 +0000 @@ -14,6 +14,6 @@ String locale, String uuid, String name, - AsyncCallback<List> cb); + AsyncCallback<List<String[]>> cb); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java Tue Jun 07 10:03:19 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java Tue Jun 07 12:51:57 2011 +0000 @@ -5,6 +5,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.VLayout; @@ -72,13 +73,13 @@ dataTable.setShowHeaderContextMenu(false); exportService.getCSV(url, locale, uuid, name, - new AsyncCallback<List>() { + new AsyncCallback<List<String[]>>() { public void onFailure(Throwable caught) { GWT.log("Could not recieve csv."); - GWT.log(caught.getMessage()); + SC.warn(caught.getMessage()); } - public void onSuccess(List l) { + public void onSuccess(List<String[]> l) { GWT.log("Recieved csv with " + l.size() + " lines."); setData(l); }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java Tue Jun 07 10:03:19 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/CSVExportServiceImpl.java Tue Jun 07 12:51:57 2011 +0000 @@ -34,7 +34,7 @@ public static final String ERROR_NO_EXPORT_FOUND = "error_no_export_found"; - public List getCSV( + public List<String[]> getCSV( String url, String locale, String uuid, @@ -62,7 +62,7 @@ Reader reader = new InputStreamReader (in, "UTF-8"); CSVReader csvReader = new CSVReader (reader); - return csvReader.readAll (); + return (List<String[]>) csvReader.readAll (); } catch (IOException ce) { System.err.println(ce.getLocalizedMessage());