annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 65:8b75d01fa5b5

Insert Chart-Classes from old Repository gnv-artifacts/trunk@48 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 09 Sep 2009 12:02:09 +0000
parents 6ae2d4134da3
children d117fd4b82e5
rev   line source
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 *
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 package de.intevation.gnv.transition;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 import java.util.ArrayList;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 import java.util.Collection;
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
8 import java.util.Date;
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
9 import java.util.GregorianCalendar;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
10 import java.util.HashMap;
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
11 import java.util.Iterator;
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
12 import java.util.Map;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 import org.apache.log4j.Logger;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 import org.w3c.dom.Document;
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
16 import org.w3c.dom.Element;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import org.w3c.dom.Node;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 import org.w3c.dom.NodeList;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import de.intevation.artifactdatabase.Config;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 import de.intevation.gnv.artifacts.GNVArtifactBase;
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
22 import de.intevation.gnv.geobackend.base.Result;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
23 import de.intevation.gnv.geobackend.base.query.QueryExecutor;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
24 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
25 import de.intevation.gnv.geobackend.base.query.exception.QueryException;
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
26 import de.intevation.gnv.geobackend.util.DateUtils;
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
27 import de.intevation.gnv.transition.describedata.MinMaxDescribeData;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
28 import de.intevation.gnv.transition.exception.TransitionException;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 * @author Tim Englich <tim.englich@intevation.de>
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 *
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 public abstract class TransitionBase implements Transition {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 * the logger, used to log exceptions and additonaly information
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
40 public static final String XFORM_URL = "http://www.w3.org/2002/xforms";
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
41 public static final String XFORM_PREFIX = "xform";
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
42
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 private String id = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
45 private String description = null;
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
46
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
47
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
48
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 protected String queryID = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 private Collection<String> reachableTransitions = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
53 private Collection<String> inputValueNames = null;
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
54
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
55 private Map<String,InputValue> inputValues = null;
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
56
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 private Transition parent = null;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
58
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
59 private Map<String,InputData> inputData = null;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
60
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
61 protected Collection<Object> descibeData = null;
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
62
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 * Constructor
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 public TransitionBase() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 super();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
68 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 * @see de.intevation.gnv.transition.Transition#getID()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
72 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73 public String getID() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
74 return this.id;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
75 }
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
76
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
77 /**
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
78 * @see de.intevation.gnv.transition.Transition#getDescription()
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
79 */
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
80 public String getDescription() {
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
81 return this.description;
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
82 }
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
83
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
84 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
85 * @see de.intevation.gnv.transition.Transition#reachableTransitions()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
87 public Collection<String> reachableTransitions() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88 return this.reachableTransitions;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
89 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
90
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
91 /**
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
92 * @see de.intevation.gnv.transition.Transition#getRequiredInputValues()
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
93 */
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
94 public Collection<InputValue> getRequiredInputValues() {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
95 return this.inputValues.values();
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
96 }
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
97
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
98 /**
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99 * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node)
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
100 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
101 public void setup(Node configuration) {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
102
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
103 this.id = Config.getStringXPath(configuration,"@id");
54
09b4bf848c7b 2009-09-08 Tim Englich <tim.englich@intevation.de>
Tim Englich <tim.englich@intevation.de>
parents: 53
diff changeset
104 this.description = Config.getStringXPath(configuration,"@description");
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
105
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
106 log.info("Transition-ID = "+ this.id);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 NodeList nodes = Config.getNodeSetXPath(configuration,"reachableTransitions/transition");
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
108 this.reachableTransitions = new ArrayList<String>(nodes.getLength());
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
109 for (int i = 0 ; i < nodes.getLength(); i++){
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 String reachableTransition = nodes.item(i).getTextContent();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
111 log.info("ReachableTransition ==> "+ reachableTransition);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
112 this.reachableTransitions.add(reachableTransition);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
114 }
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
115
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
116 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,"inputvalues/inputvalue");
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
117 this.inputValues = new HashMap<String,InputValue>(inputValuesNodes.getLength());
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
118 this.inputValueNames = new ArrayList<String>(inputValuesNodes.getLength());
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
119 for (int i = 0 ; i < inputValuesNodes.getLength(); i++){
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
120 Node inputValueNode = inputValuesNodes.item(i);
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
121 InputValue inputValue = new DefaultInputValue(Config.getStringXPath(inputValueNode,"@name"), Config.getStringXPath(inputValueNode,"@type"));
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
122 log.debug(inputValue.toString());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
123 this.inputValues.put(inputValue.getName(),inputValue);
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
124 this.inputValueNames.add(inputValue.getName());
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
125 }
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
126
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
127 this.queryID = Config.getStringXPath(configuration,"queryID");
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
128 log.info("QueryID ==> "+ this.queryID);
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
129
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
130 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
131
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
132 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
133 * @see de.intevation.gnv.transition.Transition#getParent()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
134 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
135 public Transition getParent() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
136 return this.parent;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
137 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
138
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
139 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
140 * @see de.intevation.gnv.transition.Transition#setParent(de.intevation.gnv.transition.Transition)
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
141 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
142 public void setParent(Transition transition) {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
143 this.parent = transition;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
144 }
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
145
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
146 /**
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
147 * @see de.intevation.gnv.transition.Transition#putInputData(java.util.Collection)
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
148 */
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
149 public void putInputData(Collection<InputData> inputData) throws TransitionException {
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
150 log.debug("TransitionBase.putInputData");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
151 if (inputData != null){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
152 Iterator<InputData> it = inputData.iterator();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
153 while(it.hasNext()){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
154 InputData tmpItem = it.next();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
155 InputValue inputValue = this.inputValues.get(tmpItem.getName());
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
156 if (inputValue != null){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
157 if (this.inputData == null){
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
158 this.inputData = new HashMap<String,InputData>(inputData.size());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
159 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
160 // TODO validate Value; und Valueconcatenieren
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
161 this.inputData.put(tmpItem.getName(),tmpItem);
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
162
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
163 }else{
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
164 String errMsg = "No Inputvalue given for Inputdata "+ tmpItem.getName();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
165 log.warn(errMsg+ "Value will be ignored");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
166
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
167 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
168 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
169 }else{
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
170 log.warn("No Inputdata given");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
171 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
172
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
173 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
174
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
175 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
176 * @see de.intevation.gnv.transition.Transition#isTransitionReachable(java.lang.String)
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
177 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
178 public boolean isTransitionReachable(String transitionID) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
179 log.debug("TransitionBase.isTransitionReachable");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
180 boolean returnValue = false;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
181 Iterator<String> transitions = reachableTransitions.iterator();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
182 while (transitions.hasNext()){
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
183 if(transitions.next().equals(transitionID)){
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
184 log.debug("Transition "+transitionID+" wird unterst�tzt.");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
185 returnValue = true;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
186 break;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
187 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
188 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
189 return returnValue;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
190 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
191
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
192 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
193 * @see de.intevation.gnv.transition.Transition#advance()
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
194 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
195 public void advance() throws TransitionException {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
196 log.debug("TransitionBase.advance");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
197 try {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
198 String[] filterValues = new String[this.inputValueNames.size()];
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
199 Iterator<String> it = this.inputValueNames.iterator();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
200 int i = 0;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
201 while (it.hasNext()){
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
202 String value = it.next();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
203 InputData data = this.inputData.get(value);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
204 filterValues[i++] = data.getValue();
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
205 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
206 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
207 Collection<Result> result = queryExecutor.executeQuery(this.queryID, filterValues);
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
208 this.purifyResult(result);
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
209 } catch (QueryException e) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
210 log.error(e,e);
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
211 throw new TransitionException(e);
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
212 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
213 }
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
214
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
215 /**
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
216 * @param result
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
217 */
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
218 protected void purifyResult(Collection<Result> result) {
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
219 if (this.descibeData == null){
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
220 this.descibeData = new ArrayList<Object>();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
221 }
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
222 this.descibeData.add(result);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
223 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
224
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
225 /**
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
226 * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document, org.w3c.dom.Node)
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
227 */
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
228 public void describe(Document document, Node rootNode) {
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
229
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
230 if(this.descibeData != null){
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
231 Iterator<Object> it = this.descibeData.iterator();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
232 while (it.hasNext()){
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
233 Object o = it.next();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
234 if (o instanceof Collection<?>){
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
235 Element selectNode = this.createXFormElement(document,"select");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
236 // TODO: HACK:
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
237 // BESSERE L�SUNG FINDEN
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
238 Object[] names = this.inputValueNames.toArray();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
239 String name = names[names.length-1].toString();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
240
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
241 selectNode.setAttribute("ref", name);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
242
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
243 Element lableNode = this.createXFormElement(document, "label");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
244 lableNode.setTextContent(name);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
245 Element choiceNode = this.createXFormElement(document, "choices");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
246
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
247 Collection<Result> values = (Collection)o;
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
248 Iterator<Result> resultIt = values.iterator();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
249 while (resultIt.hasNext()){
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
250 Result result = resultIt.next();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
251 Element itemNode = this.createXFormElement(document, "item");
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
252
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
253
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
254 Element choiceLableNode = this.createXFormElement(document, "label");
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
255 choiceLableNode.setTextContent(result.getString("VALUE"));
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
256 itemNode.appendChild(choiceLableNode);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
257
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
258 Element choicValueNode = this.createXFormElement(document, "value");
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
259 choicValueNode.setTextContent(result.getString("KEY"));
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
260 itemNode.appendChild(choicValueNode);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
261
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
262 choiceNode.appendChild(itemNode);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
263 }
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
264 selectNode.appendChild(lableNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
265 selectNode.appendChild(choiceNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
266 rootNode.appendChild(selectNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
267 }else if (o instanceof MinMaxDescribeData){
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
268 MinMaxDescribeData descibeData = (MinMaxDescribeData)o;
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
269 Object min = descibeData.getMinValue();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
270 Object max = descibeData.getMaxValue();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
271 if (min instanceof GregorianCalendar){
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
272 Date d = ((GregorianCalendar)min).getTime();
63
6ae2d4134da3 Changed DateoutputFormat from German- to Anericanstyle
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
273 min = DateUtils.getPatternedDateAmer(d);
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
274 }
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
275
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
276 if (max instanceof GregorianCalendar){
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
277 Date d = ((GregorianCalendar)max).getTime();
63
6ae2d4134da3 Changed DateoutputFormat from German- to Anericanstyle
Tim Englich <tim.englich@intevation.de>
parents: 61
diff changeset
278 max = DateUtils.getPatternedDateAmer(d);
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
279 }
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
280
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
281 Element inputMinNode = this.createXFormElement(document, "input");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
282 inputMinNode.setAttribute("ref", "minvalue");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
283 Element inputMinLableNode = this.createXFormElement(document, "label");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
284 inputMinLableNode.setTextContent("minvalue");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
285 inputMinNode.appendChild(inputMinLableNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
286
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
287 Element inputMinValueNode = this.createXFormElement(document, "value");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
288 inputMinValueNode.setTextContent(min.toString());
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
289 inputMinNode.appendChild(inputMinValueNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
290
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
291 Element inputMaxNode = this.createXFormElement(document, "input");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
292 inputMaxNode.setAttribute("ref", "maxvalue");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
293 Element inputMaxLableNode = this.createXFormElement(document, "label");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
294 inputMaxLableNode.setTextContent("maxvalue");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
295 inputMaxNode.appendChild(inputMaxLableNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
296
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
297 Element inputMaxValueNode = this.createXFormElement(document, "value");
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
298 inputMaxValueNode.setTextContent(max.toString());
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
299 inputMaxNode.appendChild(inputMaxValueNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
300
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
301 rootNode.appendChild(inputMinNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
302 rootNode.appendChild(inputMaxNode);
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
303
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
304 }
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
305
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
306 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
307 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
308
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
309 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
310
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
311 private Element createXFormElement(Document document, String name) {
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
312 Element node = document.createElementNS(XFORM_URL, name);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
313 node.setPrefix(XFORM_PREFIX);
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
314 return node;
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
315 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
316
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
317 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
318 * @see de.intevation.gnv.transition.Transition#getDescibeData()
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
319 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
320 public Collection<Object> getDescibeData() {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
321 return this.descibeData;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
322 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
323
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
324 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
325 * @see de.intevation.gnv.transition.Transition#setDescibeData(java.util.Collection)
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
326 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
327 public void setDescibeData(Collection<Object> descibeData) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
328 this.descibeData = descibeData;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
329
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
330 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
331
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
332 /**
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
333 * @see de.intevation.gnv.transition.Transition#getInputData()
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
334 */
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
335 public Collection<InputData> getInputData() throws TransitionException {
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
336 return this.inputData.values();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
337 }
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
338 }

http://dive4elements.wald.intevation.org