changeset 250:4e8f0fd8ed79

BugFix: Storage of "feeded" MinMaxValues will now work. issue79 gnv-artifacts/trunk@319 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 11 Nov 2009 09:52:16 +0000
parents cad7c220adbc
children 113b06ab2110
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java
diffstat 5 files changed, 36 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Wed Nov 11 08:31:59 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Wed Nov 11 09:52:16 2009 +0000
@@ -1,3 +1,18 @@
+2009-11-11  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java,
+	  src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java: 
+	  Added getName and added Constants for minValue and maxValue Id to
+	  enable the storage of this Values which would be put using the
+	  feed command.
+	
+	* src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe):
+	  Changed the usage of the Name of the MinMaxTransition from getMinName to getName.
+	   
+	* src/main/java/de/intevation/gnv/transition/MinMaxTransition.java (purifyResult): 
+	  Changed the Constructor of MinMaxTransition according to API-Changes of
+	  DefaultMinMaxDescribeData
+	
 2009-11-11  Tim Englich  <tim.englich@intevation.de>
 
 	* doc/conf/products/verticalprofile/conf_mesh.xml,
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java	Wed Nov 11 08:31:59 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java	Wed Nov 11 09:52:16 2009 +0000
@@ -46,12 +46,11 @@
             describeData = new ArrayList<Object>();
         }
         if (result != null && result.size() == 1) {
-
-            String minName = this.dataName;
-            String maxName = this.dataName;
+            
             Result value = result.iterator().next();
-            DescribeData values = new DefaultMinMaxDescribeData(minName,
-                    maxName, value.getObject("MIN"), value.getObject("MAX"));
+            DescribeData values = new DefaultMinMaxDescribeData(this.dataName, 
+                                                               value.getObject("MIN"), 
+                                                               value.getObject("MAX"));
             log.debug(values.toString());
             describeData.add(values);
         } else {
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Wed Nov 11 08:31:59 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Wed Nov 11 09:52:16 2009 +0000
@@ -599,14 +599,14 @@
                     
                     Element groupNode = xmlutilities.createXFormElement(
                             document, "group");
-                    groupNode.setAttribute("ref", minMaxDescibeData.getMinName());
+                    groupNode.setAttribute("ref", minMaxDescibeData.getName());
                     Element groupNodeLableNode = xmlutilities
                             .createXFormElement(document, "label");
                     groupNodeLableNode.setTextContent(RessourceFactory
                             .getInstance().getRessource(
                                     callMeta.getLanguages(),
-                                    minMaxDescibeData.getMinName(),
-                                    minMaxDescibeData.getMinName()));
+                                    minMaxDescibeData.getName(),
+                                    minMaxDescibeData.getName()));
                     groupNode.appendChild(groupNodeLableNode);
 
                     Element inputMinNode = xmlutilities.createXFormElement(
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java	Wed Nov 11 08:31:59 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java	Wed Nov 11 09:52:16 2009 +0000
@@ -17,19 +17,19 @@
     private Object minValue = null;
 
     private Object maxValue = null;
+    
+    private String name = null; 
 
-    private String minName = null;
+    private final static String minName = "minvalue";
 
-    private String maxName = null;
+    private final static String maxName = "maxvalue";
 
     /**
      * Constructor
      */
-    public DefaultMinMaxDescribeData(String minName, String maxName,
-                                     Object minValue, Object maxValue) {
+    public DefaultMinMaxDescribeData(String name, Object minValue, Object maxValue) {
         super();
-        this.minName = minName;
-        this.maxName = maxName;
+        this.name = name;
         this.minValue = minValue;
         this.maxValue = maxValue;
     }
@@ -61,14 +61,14 @@
      * @see de.intevation.gnv.transition.describedata.MinMaxDescribeData#getName()
      */
     public String getMinName() {
-        return this.minName;
+        return minName;
     }
 
     /**
      * @see de.intevation.gnv.transition.describedata.MinMaxDescribeData#getMaxName()
      */
     public String getMaxName() {
-        return this.maxName;
+        return maxName;
     }
 
     /**
@@ -85,4 +85,8 @@
         this.minValue = minValue;
     }
 
+    public String getName() {
+       return this.name;
+    }
+
 }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java	Wed Nov 11 08:31:59 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java	Wed Nov 11 09:52:16 2009 +0000
@@ -17,6 +17,8 @@
 
     public void setMaxValue(Object maxValue);
 
+    public String getName();
+    
     public String getMinName();
 
     public String getMaxName();

http://dive4elements.wald.intevation.org