changeset 916:a1a5dc2b9e34

Improved the DEM datacage panel to display the DEMs only. flys-client/trunk@2779 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 16 Sep 2011 13:24:36 +0000
parents 89a47098bcbd
children b48c36076e17 3a4c14b4a8f1
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataService.java flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java flys-client/src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java
diffstat 7 files changed, 95 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/ChangeLog	Fri Sep 16 13:24:36 2011 +0000
@@ -1,3 +1,23 @@
+2011-09-16  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java,
+	  src/main/java/de/intevation/flys/client/client/services/MetaDataServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/MetaDataService.java:
+	  Added a further 'parameters' parameter to be able to adjust the metadata
+	  query more precise.
+
+	* src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java:
+	  Added a further 'parameters' attribute and a constructor. The
+	  'parameters' attribute is used for the metadata query as well as the
+	  user and the outs.
+
+	* src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java:
+	  The parameters for the metadata query can now be adjusted by overriding
+	  getUser(), getOuts() and getParameters().
+
+	* src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java:
+	  This panel now able to only  display the DEMs in the datacage panel.
+
 2011-09-16  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue265
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataService.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataService.java	Fri Sep 16 13:24:36 2011 +0000
@@ -12,7 +12,7 @@
 {
     DataCageTree getMetaData(
         String serverUrl, String locale,
-        String artifactId, String userId, String outs
+        String artifactId, String userId, String outs, String parameters
     ) throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataServiceAsync.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/MetaDataServiceAsync.java	Fri Sep 16 13:24:36 2011 +0000
@@ -11,6 +11,7 @@
         String                      artifactId,
         String                      userId,
         String                      outs,
+        String                      parameters,
         AsyncCallback<DataCageTree> 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/DatacagePanel.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacagePanel.java	Fri Sep 16 13:24:36 2011 +0000
@@ -59,8 +59,9 @@
     protected void createWidget() {
         widget = new DatacageWidget(
             artifact,
-            user,
+            getUser(),
             getOuts(),
+            getParameters(),
             false);
 
         widget.setHeight100();
@@ -75,6 +76,18 @@
     }
 
 
-    public abstract String getOuts();
+    public User getUser() {
+        return user;
+    }
+
+
+    public String getOuts() {
+        return null;
+    }
+
+
+    public String getParameters() {
+        return null;
+    }
 }
 // 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/DatacageWidget.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Fri Sep 16 13:24:36 2011 +0000
@@ -57,6 +57,7 @@
     protected Artifact artifact;
     protected User     user;
     protected String   outs;
+    protected String   parameters;
 
     protected TreeGrid treeGrid;
     protected Tree     tree;
@@ -79,13 +80,29 @@
         this(artifact, user, outs, true);
     }
 
-    public DatacageWidget(Artifact artifact, User user, String outs,
-         boolean showButton) {
+    public DatacageWidget(
+        Artifact   artifact,
+        User       user,
+        String     outs,
+        boolean    showButton
+    ) {
+        this(artifact, user, outs, null, showButton);
+    }
+
+
+    public DatacageWidget(
+        Artifact   artifact,
+        User       user,
+        String     outs,
+        String     parameters,
+        boolean    showButton
+    ) {
         this();
 
-        this.artifact = artifact;
-        this.user     = user;
-        this.outs     = outs;
+        this.artifact   = artifact;
+        this.user       = user;
+        this.outs       = outs;
+        this.parameters = parameters;
 
         toLoad = new ToLoad();
 
@@ -130,6 +147,18 @@
     }
 
 
+    public DatacageWidget(
+        Artifact        artifact,
+        User            user,
+        String          outs,
+        DatacageHandler handler,
+        String          parameters
+    ) {
+        this(artifact, user, outs, handler);
+        this.parameters = parameters;
+    }
+
+
     /**
      * @param handler Handler to be added (notified on add-action).
      */
@@ -253,6 +282,7 @@
             artifactId,
             userId,
             outs,
+            parameters,
             new AsyncCallback<DataCageTree>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("Could not load meta data.");
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java	Fri Sep 16 13:24:36 2011 +0000
@@ -9,7 +9,8 @@
 
 public class DemDatacagePanel extends DatacagePanel {
 
-    public static final String WATERLEVEL_OUTS = "longitudinal_section";
+    public static final String OUT        = "floodmap";
+    public static final String PARAMETERS = "dem:true";
 
 
     public DemDatacagePanel() {
@@ -23,8 +24,20 @@
 
 
     @Override
+    public User getUser() {
+        return null;
+    }
+
+
+    @Override
     public String getOuts() {
-        return WATERLEVEL_OUTS;
+        return OUT;
+    }
+
+
+    @Override
+    public String getParameters() {
+        return PARAMETERS;
     }
 
 
--- a/flys-client/src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java	Fri Sep 16 12:56:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/MetaDataServiceImpl.java	Fri Sep 16 13:24:36 2011 +0000
@@ -35,7 +35,8 @@
         String locale,
         String artifactId,
         String userId,
-        String outs
+        String outs,
+        String parameters
     ) throws ServerException
     {
         System.out.println("MetaDataService.getMetaData");
@@ -67,6 +68,12 @@
             meta.appendChild(outsEl);
         }
 
+        if (parameters != null) {
+            Element paramsEl = ec.create("parameters");
+            paramsEl.setAttribute("value", parameters);
+            meta.appendChild(paramsEl);
+        }
+
         doc.appendChild(meta);
 
         HttpClient client = new HttpClientImpl(url, locale);

http://dive4elements.wald.intevation.org