Mercurial > dive4elements > gnv-client
changeset 56:737d8bf63701
Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
gnv-artifacts/trunk@38 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 08 Sep 2009 10:39:50 +0000 |
parents | 6ded86ce30dd |
children | f01592cd6419 |
files | gnv-artifacts/Changelog gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultInputValue.java gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java gnv-artifacts/src/test/ressources/GNVArtifactsTestCase_Configuration.xml |
diffstat | 5 files changed, 37 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/gnv-artifacts/Changelog Tue Sep 08 09:35:53 2009 +0000 +++ b/gnv-artifacts/Changelog Tue Sep 08 10:39:50 2009 +0000 @@ -1,3 +1,11 @@ +2009-09-08 Tim Englich <tim.englich@intevation.de> + + * src/test/ressources/GNVArtifactsTestCase_Configuration.xml, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/transition/TransitionBase.java, + src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Edited: + Required Inputelements integrated in BAsicArtifact-Descibe-Output + 2009-09-08 Tim Englich <tim.englich@intevation.de> * src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Added,
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Tue Sep 08 09:35:53 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Tue Sep 08 10:39:50 2009 +0000 @@ -3,6 +3,7 @@ */ package de.intevation.gnv.artifacts; +import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -16,6 +17,7 @@ import de.intevation.artifactdatabase.Config; import de.intevation.artifactdatabase.DefaultArtifact; import de.intevation.gnv.artifacts.context.GNVArtifactContext; +import de.intevation.gnv.transition.InputValue; import de.intevation.gnv.transition.Transition; import de.intevation.gnv.transition.TransitionFactory; @@ -159,8 +161,19 @@ protected void createModel(Element parent, Document document){ Element modelNode = createElement(document,"model"); - // TODO mit leben füllen. - + if (this.current != null){ + Collection<InputValue> inputValues = this.current.getRequiredInputValues(); + if (inputValues != null){ + Iterator<InputValue> it = inputValues.iterator(); + while(it.hasNext()){ + InputValue inputValue = it.next(); + Element inputNode = createElement(document,"input"); + inputNode.setAttribute("name", inputValue.getName()); + inputNode.setAttribute("type", inputValue.getType()); + modelNode.appendChild(inputNode); + } + } + } parent.appendChild(modelNode); }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Tue Sep 08 09:35:53 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Tue Sep 08 10:39:50 2009 +0000 @@ -34,4 +34,12 @@ return this.type; } + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "InputValue "+name+" ==> "+type; + } + }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Tue Sep 08 09:35:53 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Tue Sep 08 10:39:50 2009 +0000 @@ -95,6 +95,7 @@ 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")); + log.debug(inputValue.toString()); this.inputValues.add(inputValue); }
--- a/gnv-artifacts/src/test/ressources/GNVArtifactsTestCase_Configuration.xml Tue Sep 08 09:35:53 2009 +0000 +++ b/gnv-artifacts/src/test/ressources/GNVArtifactsTestCase_Configuration.xml Tue Sep 08 10:39:50 2009 +0000 @@ -11,15 +11,17 @@ <artifacts> <artifact name="timeSeries"> <transitions> + <transition id="timeSeries.start" description="timeSeries.start.description" transition="de.intevation.gnv.transition.DefaultTransition"> <queryID>mesh</queryID> <reachableTransitions> <transition>timeSeries.end</transition> </reachableTransitions> + <inputvalues> + <inputvalue name="meshid" type="Integer"/> + </inputvalues> </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>