changeset 254:6838e4112eeb

Bugfix: the current locale string is used to fetch chart images now. flys-client/trunk@1864 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 09 May 2011 11:21:50 +0000
parents aea3ab5997b2
children e4f0bef52689
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java
diffstat 3 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon May 09 10:31:54 2011 +0000
+++ b/flys-client/ChangeLog	Mon May 09 11:21:50 2011 +0000
@@ -1,3 +1,10 @@
+2011-05-09  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java:
+	  Bugfix: the current locale string is used to fetch the chart image now
+	  which enables the client to present localized charts.
+
 2011-05-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/ProjectList.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Mon May 09 10:31:54 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Mon May 09 11:21:50 2011 +0000
@@ -76,19 +76,15 @@
      */
     protected String getImgUrl() {
         Config config = Config.getInstance();
-        String server = config.getServerUrl();
 
         String imgUrl = GWT.getModuleBaseURL();
         imgUrl += "chart";
         imgUrl += "?uuid=" + collection.identifier();
         imgUrl += "&type=" + mode.getName();
-        imgUrl += "&server=" + server;
+        imgUrl += "&server=" + config.getServerUrl();
+        imgUrl += "&locale=" + config.getLocale();
         imgUrl += "&timestamp=" + new Date().getTime();
 
-        GWT.log("IMAGE URL = " + imgUrl);
-
-        // TODO Build the correct url that points to the OUT() resource of the
-        // collection.
         return imgUrl;
     }
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java	Mon May 09 10:31:54 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java	Mon May 09 11:21:50 2011 +0000
@@ -34,12 +34,13 @@
             String serverUrl = req.getParameter("server");
             String uuid      = req.getParameter("uuid");
             String type      = req.getParameter("type");
+            String locale    = req.getParameter("locale");
             String mimeType  = "image/png";
 
             Document request = ClientProtocolUtils.newOutCollectionDocument(
                 uuid, type);
 
-            HttpClient client = new HttpClientImpl(serverUrl);
+            HttpClient client = new HttpClientImpl(serverUrl, locale);
             client.collectionOut(request, uuid, "chart", out);
 
             out.close();

http://dive4elements.wald.intevation.org