changeset 87:c8cd1b918901

Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache. flys-client/trunk@1599 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 28 Mar 2011 17:04:17 +0000
parents eae92a05282e
children 4d7c6a63602b
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/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItem.java flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java
diffstat 6 files changed, 46 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/ChangeLog	Mon Mar 28 17:04:17 2011 +0000
@@ -1,3 +1,21 @@
+2011-03-28  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/CollectionItem.java,
+	  src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java:
+	  A CollectionItem has a hash() method now. The value comes from the
+	  Collection's DESCRIBE document.
+
+	* src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java:
+	  The hash value of a collection item is parsed from DESCRIBE document.
+
+	* src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java:
+	  Appended the hash value of the artifact to the URL of the chart image.
+	  This bypasses the browser cache of a previous chart image.
+
+	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  A parameterization change will always remove all output tabs before
+	  updating the output tab panel.
+
 2011-03-28  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ChartOutputTab.java	Mon Mar 28 17:04:17 2011 +0000
@@ -77,6 +77,7 @@
         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";
@@ -87,7 +88,7 @@
         imgUrl += "&height=400";
         imgUrl += "&points=false";
         imgUrl += "&uuid=" + uuid;
-        imgUrl += "&hash=" + "TODO-HASH";
+        imgUrl += "&hash=" + hash;
 
         GWT.log("IMAGE URL = " + imgUrl);
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Mon Mar 28 17:04:17 2011 +0000
@@ -250,13 +250,13 @@
         OutputMode[] outs        = desc.getOutputModes();
 
         setArtifact(art);
+        clearOutputTabs();
 
         if (outs != null) {
             User user = getFlys().getCurrentUser();
             createNewCollection(user.identifier());
         }
         else {
-            clearOutputTabs();
             updateView();
         }
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/AddArtifactServiceImpl.java	Mon Mar 28 17:04:17 2011 +0000
@@ -144,6 +144,9 @@
         String uuid = XMLUtils.xpathString(
             node, "@art:uuid", ArtifactNamespaceContext.INSTANCE);
 
+        String hash = XMLUtils.xpathString(
+            node, "@art:hash", ArtifactNamespaceContext.INSTANCE);
+
         if (uuid == null || uuid.equals("")) {
             System.err.println("Found an invalid CollectionItem!");
         }
@@ -156,7 +159,7 @@
 
         List<OutputMode> modes = parseOutputModes(outputmodes);
 
-        return new DefaultCollectionItem(uuid, modes);
+        return new DefaultCollectionItem(uuid, hash, modes);
     }
 
 
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItem.java	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionItem.java	Mon Mar 28 17:04:17 2011 +0000
@@ -21,6 +21,14 @@
 
 
     /**
+     * Returns the hash of the wrapped artifact.
+     *
+     * @return the hash of the wrapped artifact.
+     */
+    String hash();
+
+
+    /**
      * Returns the output modes of the wrapped artifact.
      *
      * @return the output modes of the wrapped artifact.
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java	Mon Mar 28 16:20:45 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/DefaultCollectionItem.java	Mon Mar 28 17:04:17 2011 +0000
@@ -13,6 +13,9 @@
     /** The identifier that specifies the artifact related to this item.*/
     protected String identifier;
 
+    /** The hash that specifies the artifact related to this item.*/
+    protected String hash;
+
     /** The list of output modes supported by the artifact of this item.*/
     protected List<OutputMode> outputModes;
 
@@ -31,8 +34,12 @@
      * @param identifier The identifier of an artifact.
      * @param outputModes The output modes supported by this item.
      */
-    public DefaultCollectionItem(String identifier, List<OutputMode> modes) {
+    public DefaultCollectionItem(
+        String           identifier,
+        String           hash,
+        List<OutputMode> modes) {
         this.identifier  = identifier;
+        this.hash        = hash;
         this.outputModes = modes;
     }
 
@@ -42,6 +49,11 @@
     }
 
 
+    public String hash() {
+        return hash;
+    }
+
+
     public List<OutputMode> getOutputModes() {
         return outputModes;
     }

http://dive4elements.wald.intevation.org