changeset 213:7ea004d0ffbc

The ChartOutputTab calls the out() operation of a Collection now - no longer the out() of its first artifact. flys-client/trunk@1655 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 07 Apr 2011 11:31:19 +0000
parents e3ea3c74b7f5
children 29c6d9573ae7
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, 18 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Apr 07 10:33:48 2011 +0000
+++ b/flys-client/ChangeLog	Thu Apr 07 11:31:19 2011 +0000
@@ -1,3 +1,10 @@
+2011-04-07  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:
+	  Adjusted the code to trigger the out() operation of the Collection
+	  instead of the out() operation of the first Artifact in that Collection.
+
 2011-04-07  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Thu Apr 07 10:33:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Thu Apr 07 11:31:19 2011 +0000
@@ -1,5 +1,7 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.Date;
+
 import com.google.gwt.core.client.GWT;
 
 import com.smartgwt.client.widgets.Canvas;
@@ -75,19 +77,13 @@
     protected String getImgUrl() {
         Config config = Config.getInstance();
         String server = config.getServerUrl();
-        String uuid   = collection.getItem(0).identifier();
-        String hash   = collection.getItem(0).hash();
 
         String imgUrl = GWT.getModuleBaseURL();
         imgUrl += "chart";
-        imgUrl += "?target=chart";
+        imgUrl += "?uuid=" + collection.identifier();
+        imgUrl += "&type=" + mode.getName();
         imgUrl += "&server=" + server;
-        imgUrl += "&mode=img";
-        imgUrl += "&width=600";
-        imgUrl += "&height=400";
-        imgUrl += "&points=false";
-        imgUrl += "&uuid=" + uuid;
-        imgUrl += "&hash=" + hash;
+        imgUrl += "&timestamp=" + new Date().getTime();
 
         GWT.log("IMAGE URL = " + imgUrl);
 
--- a/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java	Thu Apr 07 10:33:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/ChartOutputServiceImpl.java	Thu Apr 07 11:31:19 2011 +0000
@@ -2,8 +2,6 @@
 
 import java.io.OutputStream;
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
 
 import org.w3c.dom.Document;
 
@@ -11,10 +9,10 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import de.intevation.artifacts.common.utils.ClientProtocolUtils;
+
 import de.intevation.artifacts.httpclient.http.HttpClient;
 import de.intevation.artifacts.httpclient.http.HttpClientImpl;
-import de.intevation.artifacts.httpclient.objects.Artifact;
-import de.intevation.artifacts.httpclient.utils.ArtifactProtocolUtils;
 
 
 /**
@@ -35,23 +33,14 @@
 
             String serverUrl = req.getParameter("server");
             String uuid      = req.getParameter("uuid");
-            String hash      = req.getParameter("hash");
-            String width     = req.getParameter("width");
-            String height    = req.getParameter("height");
-            String target    = req.getParameter("target");
+            String type      = req.getParameter("type");
             String mimeType  = "image/png";
 
-            Map opts = new HashMap();
-            opts.put("width", width);
-            opts.put("height", height);
-            opts.put("mimeType", mimeType);
-            opts.put("points", "false");
-
-            Document chart = ArtifactProtocolUtils.createChartDocument(
-                new Artifact(hash, uuid), opts);
+            Document request = ClientProtocolUtils.newOutCollectionDocument(
+                uuid, type);
 
             HttpClient client = new HttpClientImpl(serverUrl);
-            client.out(new Artifact(uuid, hash), chart, target, out);
+            client.collectionOut(request, uuid, "chart", out);
 
             out.close();
             out.flush();

http://dive4elements.wald.intevation.org