changeset 55:6ded86ce30dd

Constructs for the required Inputvalues for an Transition created gnv-artifacts/trunk@37 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 08 Sep 2009 09:35:53 +0000
parents 09b4bf848c7b
children 737d8bf63701
files gnv-artifacts/Changelog gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultInputValue.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/InputValue.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/test/ressources/GNVArtifactsTestCase_Configuration.xml
diffstat 6 files changed, 83 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/Changelog	Tue Sep 08 09:14:35 2009 +0000
+++ b/gnv-artifacts/Changelog	Tue Sep 08 09:35:53 2009 +0000
@@ -1,3 +1,12 @@
+2009-09-08  Tim Englich  <tim.englich@intevation.de>
+
+    * src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Added,  
+      src/main/java/de/intevation/gnv/transition/InputValue.java Added,
+      src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, 
+      src/main/java/de/intevation/gnv/transition/Transition.java Edited, 
+      src/test/ressources/GNVArtifactsTestCase_Configuration.xml Edited:
+      Constructs for the required Inputvalues for an Transition created 
+      
 2009-09-08  Tim Englich  <tim.englich@intevation.de>
 
     * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java, 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultInputValue.java	Tue Sep 08 09:35:53 2009 +0000
@@ -0,0 +1,37 @@
+/**
+ *
+ */
+package de.intevation.gnv.transition;
+/**
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public class DefaultInputValue implements InputValue {
+
+    private String name = null;
+    private String type = null;
+    
+    
+    /**
+     * Constructor
+     */
+    public DefaultInputValue(String name, String type){
+        this.name = name;
+        this.type = type;
+    }
+
+    /**
+     * @see de.intevation.gnv.transition.InputValue#getName()
+     */
+    public String getName() {
+        return this.name;
+    }
+
+    /**
+     * @see de.intevation.gnv.transition.InputValue#getType()
+     */
+    public String getType() {
+        return this.type;
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/InputValue.java	Tue Sep 08 09:35:53 2009 +0000
@@ -0,0 +1,14 @@
+/**
+ *
+ */
+package de.intevation.gnv.transition;
+/**
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public interface InputValue {
+    
+    public String getName();
+    public String getType();
+
+}
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java	Tue Sep 08 09:14:35 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java	Tue Sep 08 09:35:53 2009 +0000
@@ -29,5 +29,7 @@
     public void setParent(Transition transition);
     
     public Transition getParent();
+    
+    public Collection<InputValue> getRequiredInputValues();
 
 }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Tue Sep 08 09:14:35 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Tue Sep 08 09:35:53 2009 +0000
@@ -34,6 +34,8 @@
     
     private Collection<String> reachableTransitions = null;
     
+    private Collection<InputValue> inputValues = null;
+    
     private Transition parent = null;
     /**
      * Constructor
@@ -64,6 +66,13 @@
     }
 
     /**
+     * @see de.intevation.gnv.transition.Transition#getRequiredInputValues()
+     */
+    public Collection<InputValue> getRequiredInputValues() {
+        return this.inputValues;
+    }
+
+    /**
      * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node)
      */
     public void setup(Node configuration) {
@@ -80,6 +89,15 @@
             this.reachableTransitions.add(reachableTransition);
             
         }
+        
+        NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,"inputvalues/inputvalue");
+        this.inputValues = new ArrayList<InputValue>(inputValuesNodes.getLength());
+        for (int i = 0 ; i < inputValuesNodes.getLength(); i++){
+            Node inputValueNode = inputValuesNodes.item(i);
+            InputValue inputValue = new DefaultInputValue(Config.getStringXPath(inputValueNode,"@name"), Config.getStringXPath(inputValueNode,"@type"));
+            this.inputValues.add(inputValue);
+        }
+        
         this.queryID = Config.getStringXPath(configuration,"queryID");
         log.info("QueryID ==>"+ this.queryID);
         
--- a/gnv-artifacts/src/test/ressources/GNVArtifactsTestCase_Configuration.xml	Tue Sep 08 09:14:35 2009 +0000
+++ b/gnv-artifacts/src/test/ressources/GNVArtifactsTestCase_Configuration.xml	Tue Sep 08 09:35:53 2009 +0000
@@ -17,6 +17,9 @@
                         <transition>timeSeries.end</transition>
                     </reachableTransitions>
                 </transition>
+                <inputvalues>
+                    <inputvalue name="meshid" type="Integer"/>
+                </inputvalues>
                 <transition id="timeSeries.end" description="timeSeries.end.description" transition="de.intevation.gnv.transition.DefaultTransition">
                     <queryID>mesh</queryID>
                 </transition>

http://dive4elements.wald.intevation.org