changeset 220:ee2d4134d0b3

General CodecCleanup: Remove deprecated TODOS. Organize some Imports. Remove Bug setting the returned Value of MinMaxTransitions in feedCall. gnv-artifacts/trunk@281 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 02 Nov 2009 10:58:03 +0000
parents f8cb64d5fe4f
children 21152e1bf325
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/SingleInputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java
diffstat 12 files changed, 52 insertions(+), 99 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Mon Nov 02 10:58:03 2009 +0000
@@ -1,3 +1,22 @@
+2009-11-02  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java (createCSV): 
+	  Code Cleanup: Removed obsoled TODO Flag
+	* src/main/java/de/intevation/gnv/transition/TransitionBase.java (setSelection): 
+	  Changed the Value of the min and maxvalue of the Request to the Value which is unsed to name 
+	  the Inputfields in the DescribeOutput.
+	* src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java,
+	  src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java, 
+	  src/main/java/de/intevation/gnv/transition/Transition.java,
+	  src/main/java/de/intevation/gnv/transition/SingleInputTransition.java, 
+	  src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java, 
+	  src/main/java/de/intevation/gnv/transition/MinMaxTransition.java, 
+	  src/main/java/de/intevation/gnv/transition/DefaultTransition.java, 
+	  src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java, 
+	  src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (advance),
+	  CodeCleanup: Removed needless Method validate from Transition, 
+	  because it had always returned true
+	
 2009-10-30  Tim Englich  <tim.englich@intevation.de>
 
 	* src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_*.xml:
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Mon Nov 02 10:58:03 2009 +0000
@@ -102,39 +102,26 @@
                 String transitionName = this.readTransitionName(target);
                 log.debug("Transitionsname: " + transitionName);
                 if (this.current.isTransitionReachable(transitionName)) {
-                    // 1. Prüfung ob Transition valide ist
-                    if (this.current.validate()) {
-
-                        try {
-                            Transition nextStep = this.transitions
-                                    .get(transitionName);
-                            // 2.Ergebnisse Berechnen
-                            this.current.advance(super.identifier, context.getMeta());
-                            // 3. Ergebnisse Übergeben
-                            nextStep.putInputData(this.current.getInputData(), 
-                                                  super.identifier);
-                            // 4. Umschalten auf neue Transistion
-                            this.current = nextStep;
-                            result = new ArtifactXMLUtilities()
-                                    .createSuccessReport("Advance success",
-                                            XMLUtils.newDocument());
-                        } catch (TransitionException e) {
-                            log.error(e, e);
-                            result = new ArtifactXMLUtilities()
-                                    .createExceptionReport(e
-                                            .getLocalizedMessage(), XMLUtils
-                                            .newDocument());
-                        }
-
-                    } else {
-                        String msg = "Advance nicht möglich, da die Bedingungen für den Übergang "
-                                     + "in den neuen Zustand noch nicht gegeben ist.";
-                        log.error(msg);
+                    try {
+                        Transition nextStep = this.transitions
+                                .get(transitionName);
+                        // 1.Ergebnisse Berechnen
+                        this.current.advance(super.identifier, context.getMeta());
+                        // 2. Ergebnisse Übergeben
+                        nextStep.putInputData(this.current.getInputData(), 
+                                              super.identifier);
+                        // 3. Umschalten auf neue Transistion
+                        this.current = nextStep;
                         result = new ArtifactXMLUtilities()
-                                .createExceptionReport(msg, XMLUtils
+                                .createSuccessReport("Advance success",
+                                        XMLUtils.newDocument());
+                    } catch (TransitionException e) {
+                        log.error(e, e);
+                        result = new ArtifactXMLUtilities()
+                                .createExceptionReport(e
+                                        .getLocalizedMessage(), XMLUtils
                                         .newDocument());
                     }
-
                 } else {
                     String msg = "Transitionsübergang wird nicht unterstützt.";
                     log.error(msg);
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -44,13 +44,6 @@
         super();
     }
 
-    /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        return true;
-    }
-
     @Override
     protected void purifyResult(Collection<Result> result, String uuid) {
         log.debug("CoordinateSelectionTransition.purifyResult");
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -10,17 +10,14 @@
 public class DefaultTransition extends TransitionBase {
 
     /**
+     * The UID of this Class
+     */
+    private static final long serialVersionUID = 8934030362091576766L;
+
+    /**
      * Constructor
      */
     public DefaultTransition() {
     }
 
-    /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        // TODO Validation einbauen
-        return true;
-    }
-
 }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/MinMaxTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -60,12 +60,4 @@
         this.setDescibeData(uuid, describeData);
     }
 
-    /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        // TODO: Implement ME
-        return true;
-    }
-
 }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java	Mon Nov 02 10:58:03 2009 +0000
@@ -57,14 +57,6 @@
     }
 
     /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        log.debug("OutputTransitionBase.validate");
-        return true;
-    }
-
-    /**
      * @see de.intevation.gnv.transition.TransitionBase#setup(org.w3c.dom.Node)
      */
     @Override
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/SingleInputTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/SingleInputTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -34,13 +34,6 @@
     }
 
     /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        return true;
-    }
-
-    /**
      * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection,
      *      java.lang.String)
      */
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -28,8 +28,6 @@
 
     public String getDescription();
 
-    public boolean validate();
-
     public void describe(Document document, Node rootNode, CallMeta callMeta, String uuid);
 
     public void setParent(Transition transition);
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Mon Nov 02 10:58:03 2009 +0000
@@ -56,6 +56,9 @@
      */
     private static Logger log = Logger.getLogger(GNVArtifactBase.class);
     
+    private static String MINVALUEFIELDNAME = "minvalue";
+    private static String MAXVALUEFIELDNAME = "maxvalue";
+    
     private final static String DESCRIBEDATAKEY = "_DESCRIBEDATA";
 
     private String id = null;
@@ -254,12 +257,10 @@
                 }
             } else if (o instanceof MinMaxDescribeData) {
                 MinMaxDescribeData data = (MinMaxDescribeData) o;
-                if (inputData.getName().equals(data.getMinName())) {
-                    // TODO: müssen die werte geparst werden?
+                if (inputData.getName().equals(MINVALUEFIELDNAME)) {
                     data.setMinValue(inputData.getValue());
                 }
-                if (inputData.getName().equals(data.getMaxName())) {
-                    // TODO: müssen die werte geparst werden?
+                if (inputData.getName().equals(MAXVALUEFIELDNAME)) {
                     data.setMaxValue(inputData.getValue());
                 }
             }
@@ -541,13 +542,13 @@
 
                     Element inputMinNode = xmlutilities.createXFormElement(
                             document, "input");
-                    inputMinNode.setAttribute("ref", "minvalue");
+                    inputMinNode.setAttribute("ref", MINVALUEFIELDNAME);
                     Element inputMinLableNode = xmlutilities
                             .createXFormElement(document, "label");
                     inputMinLableNode.setTextContent(RessourceFactory
                             .getInstance().getRessource(
-                                    callMeta.getLanguages(), "minvalue",
-                                    "minvalue"));
+                                    callMeta.getLanguages(), MINVALUEFIELDNAME,
+                                    MINVALUEFIELDNAME));
                     inputMinNode.appendChild(inputMinLableNode);
 
                     Element inputMinValueNode = xmlutilities
@@ -557,13 +558,13 @@
 
                     Element inputMaxNode = xmlutilities.createXFormElement(
                             document, "input");
-                    inputMaxNode.setAttribute("ref", "maxvalue");
+                    inputMaxNode.setAttribute("ref", MAXVALUEFIELDNAME);
                     Element inputMaxLableNode = xmlutilities
                             .createXFormElement(document, "label");
                     inputMaxLableNode.setTextContent(RessourceFactory
                             .getInstance().getRessource(
-                                    callMeta.getLanguages(), "maxvalue",
-                                    "maxvalue"));
+                                    callMeta.getLanguages(), MAXVALUEFIELDNAME,
+                                    MAXVALUEFIELDNAME));
                     inputMaxNode.appendChild(inputMaxLableNode);
 
                     Element inputMaxValueNode = xmlutilities
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -34,13 +34,6 @@
     }
 
     /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    public boolean validate() {
-        return true;
-    }
-
-    /**
      * @see de.intevation.gnv.transition.TransitionBase#advance(java.lang.String,
      *      de.intevation.artifacts.CallMeta)
      */
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -96,7 +96,6 @@
                 while (it.hasNext()) {
                     Result result = it.next();
                     int i = 0;
-                    // TODO implement me
                     String[] entries = new String[5];
                     entries[i++] = result.getString("SHAPE");
                     entries[i++] = result.getString("YORDINATE");
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Fri Oct 30 11:42:58 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Mon Nov 02 10:58:03 2009 +0000
@@ -14,8 +14,6 @@
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerException;
@@ -29,7 +27,6 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
 
 import au.com.bytecode.opencsv.CSVWriter;
 import de.intevation.artifactdatabase.Config;
@@ -90,14 +87,6 @@
     }
 
     /**
-     * @see de.intevation.gnv.transition.Transition#validate()
-     */
-    @Override
-    public boolean validate() {
-        return true;
-    }
-
-    /**
      * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String,
      *      java.util.Collection, java.io.OutputStream, java.lang.String,
      *      de.intevation.artifacts.CallMeta)

http://dive4elements.wald.intevation.org