Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 77:0e38f512f7e4
Some improvements an bugfixes done
gnv-artifacts/trunk@92 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Wed, 16 Sep 2009 07:49:46 +0000 |
parents | 2473440671ce |
children | 969faa37a11b |
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; |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
27 import de.intevation.gnv.transition.describedata.DefaultKeyValueDescribeData; |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
28 import de.intevation.gnv.transition.describedata.KeyValueDescibeData; |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
29 import de.intevation.gnv.transition.describedata.MinMaxDescribeData; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
30 import de.intevation.gnv.transition.exception.TransitionException; |
76
2473440671ce
Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
31 import de.intevation.gnv.utils.ArtifactXMLUtilities; |
52
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 * @author Tim Englich <tim.englich@intevation.de> |
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 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 public abstract class TransitionBase implements Transition { |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
38 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
39 /** |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
40 * The UID of this Class |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
41 */ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
42 private static final long serialVersionUID = 2411169179001645426L; |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
43 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 * 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
|
46 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 private static Logger log = Logger.getLogger(GNVArtifactBase.class); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 private String id = null; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 |
53
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
51 private String description = null; |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
52 |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
53 |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
54 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 protected String queryID = null; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 private Collection<String> reachableTransitions = null; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
59 private Collection<String> inputValueNames = null; |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
60 |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
61 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
|
62 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 private Transition parent = null; |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
64 |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
65 private Map<String,InputData> inputData = null; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
66 |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
67 protected Collection<Object> descibeData = null; |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
68 |
52
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 * Constructor |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 public TransitionBase() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 super(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
75 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 * @see de.intevation.gnv.transition.Transition#getID() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
79 public String getID() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 return this.id; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 } |
53
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 /** |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
84 * @see de.intevation.gnv.transition.Transition#getDescription() |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
85 */ |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
86 public String getDescription() { |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
87 return this.description; |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
88 } |
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
89 |
52
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 * @see de.intevation.gnv.transition.Transition#reachableTransitions() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
93 public Collection<String> reachableTransitions() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 return this.reachableTransitions; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 /** |
55
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
98 * @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
|
99 */ |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
100 public Collection<InputValue> getRequiredInputValues() { |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
101 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
|
102 } |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
103 |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
104 /** |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 * @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
|
106 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 public void setup(Node configuration) { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 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
|
110 this.description = Config.getStringXPath(configuration,"@description"); |
53
e464d9f9d967
Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents:
52
diff
changeset
|
111 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 log.info("Transition-ID = "+ this.id); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 NodeList nodes = Config.getNodeSetXPath(configuration,"reachableTransitions/transition"); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 this.reachableTransitions = new ArrayList<String>(nodes.getLength()); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 for (int i = 0 ; i < nodes.getLength(); i++){ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 String reachableTransition = nodes.item(i).getTextContent(); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 log.info("ReachableTransition ==> "+ reachableTransition); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 this.reachableTransitions.add(reachableTransition); |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 } |
55
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
121 |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
122 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,"inputvalues/inputvalue"); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
123 this.inputValues = new HashMap<String,InputValue>(inputValuesNodes.getLength()); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
124 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
|
125 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
|
126 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
|
127 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
|
128 log.debug(inputValue.toString()); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
129 this.inputValues.put(inputValue.getName(),inputValue); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
130 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
|
131 } |
6ded86ce30dd
Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents:
54
diff
changeset
|
132 |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
133 this.queryID = Config.getStringXPath(configuration,"queryID"); |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
134 log.info("QueryID ==> "+ this.queryID); |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
135 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
136 } |
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 * @see de.intevation.gnv.transition.Transition#getParent() |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
140 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
141 public Transition getParent() { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
142 return this.parent; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
143 } |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
144 |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
145 /** |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
146 * @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
|
147 */ |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
148 public void setParent(Transition transition) { |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
149 this.parent = transition; |
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 } |
57
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
151 |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
152 /** |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
153 * @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
|
154 */ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
155 public void putInputData(Collection<InputData> inputData) throws TransitionException { |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
156 log.debug("TransitionBase.putInputData"); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
157 if (inputData != null){ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
158 Iterator<InputData> it = inputData.iterator(); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
159 while(it.hasNext()){ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
160 InputData tmpItem = it.next(); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
161 InputValue inputValue = this.inputValues.get(tmpItem.getName()); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
162 if (inputValue != null){ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
163 if (this.inputData == null){ |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
164 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
|
165 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
166 // TODO validate Value; und Valueconcatenieren |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
167 this.inputData.put(tmpItem.getName(),tmpItem); |
57
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 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
|
171 log.warn(errMsg+ "Value will be ignored"); |
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 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
174 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
175 }else{ |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
176 log.warn("No Inputdata given"); |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
177 } |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
178 |
f01592cd6419
Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents:
56
diff
changeset
|
179 } |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
180 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
181 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
182 * @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
|
183 */ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
184 public boolean isTransitionReachable(String transitionID) { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
185 log.debug("TransitionBase.isTransitionReachable"); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
186 boolean returnValue = false; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
187 Iterator<String> transitions = reachableTransitions.iterator(); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
188 while (transitions.hasNext()){ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
189 if(transitions.next().equals(transitionID)){ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
190 log.debug("Transition "+transitionID+" wird unterst�tzt."); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
191 returnValue = true; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
192 break; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
193 } |
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 return returnValue; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
196 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
197 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
198 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
199 * @see de.intevation.gnv.transition.Transition#advance() |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
200 */ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
201 public void advance() throws TransitionException { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
202 log.debug("TransitionBase.advance"); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
203 try { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
204 String[] filterValues = new String[this.inputValueNames.size()]; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
205 Iterator<String> it = this.inputValueNames.iterator(); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
206 int i = 0; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
207 while (it.hasNext()){ |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
208 String value = it.next(); |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
209 InputData data = this.inputData.get(value); |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
210 filterValues[i++] = data.getValue(); |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
211 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
212 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor(); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
213 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
|
214 this.purifyResult(result); |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
215 } catch (QueryException e) { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
216 log.error(e,e); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
217 throw new TransitionException(e); |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
218 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
219 } |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
220 |
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 * @param result |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
223 */ |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
224 protected void purifyResult(Collection<Result> result) { |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
225 if (this.descibeData == null){ |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
226 this.descibeData = new ArrayList<Object>(); |
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
227 } |
68
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
228 |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
229 Iterator<Result> it = result.iterator(); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
230 Collection<KeyValueDescibeData> keyValueDescibeData = new ArrayList<KeyValueDescibeData>(result.size()); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
231 while(it.hasNext()){ |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
232 Result resultValue = it.next(); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
233 keyValueDescibeData.add(new DefaultKeyValueDescribeData(resultValue.getInteger("KEY").intValue(), resultValue.getString("VALUE"))); |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
234 } |
d117fd4b82e5
Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents:
63
diff
changeset
|
235 this.descibeData.add(keyValueDescibeData); |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
236 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
237 |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
238 /** |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
239 * @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
|
240 */ |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
241 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
|
242 |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
243 if(this.descibeData != null){ |
76
2473440671ce
Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents:
68
diff
changeset
|
244 ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities(); |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
245 Iterator<Object> it = this.descibeData.iterator(); |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
246 while (it.hasNext()){ |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
247 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
248 Object o = it.next(); |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
249 if (!it.hasNext()){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
250 if (o instanceof Collection<?>){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
251 Element selectNode = xmlutilities.createXFormElement(document,"select"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
252 // TODO: HACK: |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
253 // BESSERE L�SUNG FINDEN |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
254 Object[] names = this.inputValueNames.toArray(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
255 String name = names[names.length-1].toString(); |
61
5f47881f7c97
Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents:
59
diff
changeset
|
256 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
257 selectNode.setAttribute("ref", name); |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
258 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
259 Element lableNode = xmlutilities.createXFormElement(document, "label"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
260 lableNode.setTextContent(name); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
261 Element choiceNode = xmlutilities.createXFormElement(document, "choices"); |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
262 |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
263 Collection<KeyValueDescibeData> values = (Collection)o; |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
264 Iterator<KeyValueDescibeData> resultIt = values.iterator(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
265 while (resultIt.hasNext()){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
266 KeyValueDescibeData result = resultIt.next(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
267 Element itemNode = xmlutilities.createXFormElement(document, "item"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
268 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
269 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
270 Element choiceLableNode = xmlutilities.createXFormElement(document, "label"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
271 choiceLableNode.setTextContent(result.getValue()); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
272 itemNode.appendChild(choiceLableNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
273 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
274 Element choicValueNode = xmlutilities.createXFormElement(document, "value"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
275 choicValueNode.setTextContent(""+result.getKey()); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
276 itemNode.appendChild(choicValueNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
277 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
278 choiceNode.appendChild(itemNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
279 } |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
280 selectNode.appendChild(lableNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
281 selectNode.appendChild(choiceNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
282 rootNode.appendChild(selectNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
283 }else if (o instanceof MinMaxDescribeData){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
284 MinMaxDescribeData descibeData = (MinMaxDescribeData)o; |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
285 Object min = descibeData.getMinValue(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
286 Object max = descibeData.getMaxValue(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
287 if (min instanceof GregorianCalendar){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
288 Date d = ((GregorianCalendar)min).getTime(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
289 min = DateUtils.getPatternedDateAmer(d); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
290 } |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
291 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
292 if (max instanceof GregorianCalendar){ |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
293 Date d = ((GregorianCalendar)max).getTime(); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
294 max = DateUtils.getPatternedDateAmer(d); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
295 } |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
296 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
297 Element inputMinNode = xmlutilities.createXFormElement(document, "input"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
298 inputMinNode.setAttribute("ref", "minvalue"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
299 Element inputMinLableNode = xmlutilities.createXFormElement(document, "label"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
300 inputMinLableNode.setTextContent("minvalue"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
301 inputMinNode.appendChild(inputMinLableNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
302 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
303 Element inputMinValueNode = xmlutilities.createXFormElement(document, "value"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
304 inputMinValueNode.setTextContent(min.toString()); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
305 inputMinNode.appendChild(inputMinValueNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
306 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
307 Element inputMaxNode = xmlutilities.createXFormElement(document, "input"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
308 inputMaxNode.setAttribute("ref", "maxvalue"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
309 Element inputMaxLableNode = xmlutilities.createXFormElement(document, "label"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
310 inputMaxLableNode.setTextContent("maxvalue"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
311 inputMaxNode.appendChild(inputMaxLableNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
312 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
313 Element inputMaxValueNode = xmlutilities.createXFormElement(document, "value"); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
314 inputMaxValueNode.setTextContent(max.toString()); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
315 inputMaxNode.appendChild(inputMaxValueNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
316 |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
317 rootNode.appendChild(inputMinNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
318 rootNode.appendChild(inputMaxNode); |
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
319 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
320 } |
77
0e38f512f7e4
Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents:
76
diff
changeset
|
321 |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
322 } |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
323 } |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
324 } |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
325 |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
326 } |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
327 |
58
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
328 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
329 * @see de.intevation.gnv.transition.Transition#getDescibeData() |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
330 */ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
331 public Collection<Object> getDescibeData() { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
332 return this.descibeData; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
333 } |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
334 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
335 /** |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
336 * @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
|
337 */ |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
338 public void setDescibeData(Collection<Object> descibeData) { |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
339 this.descibeData = descibeData; |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
340 |
f31343d80d53
Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents:
57
diff
changeset
|
341 } |
59
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
342 |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
343 /** |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
344 * @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
|
345 */ |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
346 public Collection<InputData> getInputData() throws TransitionException { |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
347 return this.inputData.values(); |
2c5d8f5bced1
Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents:
58
diff
changeset
|
348 } |
52
4d6a82b96059
First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
349 } |