diff gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 204:734ac082c8d1

Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59 gnv-artifacts/trunk@259 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 22 Oct 2009 08:50:21 +0000
parents 63f65fb9f210
children d87347142702
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Wed Oct 21 11:10:28 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java	Thu Oct 22 08:50:21 2009 +0000
@@ -117,8 +117,8 @@
      */
     public void setup(Node configuration) {
         log.debug("TransitionBase.setup");
-        this.id = Config.getStringXPath(configuration, "@id");
-        this.description = Config.getStringXPath(configuration, "@description");
+        this.id = ((Element)configuration).getAttribute("id");
+        this.description = ((Element)configuration).getAttribute("description");
 
         log.info("Transition-ID = " + this.id);
         NodeList nodes = Config.getNodeSetXPath(configuration,
@@ -138,9 +138,8 @@
         this.inputValueNames = new ArrayList<String>(inputValuesNodes
                 .getLength());
         for (int i = 0; i < inputValuesNodes.getLength(); i++) {
-            Node inputValueNode = inputValuesNodes.item(i);
-            String usedinQueryValue = Config.getStringXPath(inputValueNode,
-                    "@usedinquery");
+            Element inputValueNode = (Element)inputValuesNodes.item(i);
+            String usedinQueryValue = inputValueNode.getAttribute("usedinquery");
             int usedinQuery = 1;
             if (usedinQueryValue != null) {
                 try {
@@ -150,11 +149,10 @@
                             .warn("Used in Query Value cannot be transformed into a Number");
                 }
             }
-            InputValue inputValue = new DefaultInputValue(Config
-                    .getStringXPath(inputValueNode, "@name"), Config
-                    .getStringXPath(inputValueNode, "@type"), Boolean
-                    .parseBoolean(Config.getStringXPath(inputValueNode,
-                            "@multiselect")), usedinQuery);
+            InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"), 
+                                                          inputValueNode.getAttribute("type"), 
+                                                          Boolean.parseBoolean(inputValueNode.
+                                                          getAttribute("multiselect")), usedinQuery);
             log.debug(inputValue.toString());
             this.inputValues.put(inputValue.getName(), inputValue);
             this.inputValueNames.add(inputValue.getName());

http://dive4elements.wald.intevation.org