annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 85:dbd141c6bb97

Added Support for VerticalProfiles for InstantaneousPoints gnv-artifacts/trunk@115 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 23 Sep 2009 14:32:55 +0000
parents c8d1f7b9e5a8
children 1b12021905b9
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;
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
11 import java.util.HashSet;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
12 import java.util.Iterator;
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
13 import java.util.List;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
14 import java.util.Map;
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
15 import java.util.Set;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17 import org.apache.log4j.Logger;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 import org.w3c.dom.Document;
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
19 import org.w3c.dom.Element;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 import org.w3c.dom.Node;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 import org.w3c.dom.NodeList;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 import de.intevation.artifactdatabase.Config;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24 import de.intevation.gnv.artifacts.GNVArtifactBase;
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
25 import de.intevation.gnv.geobackend.base.Result;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
26 import de.intevation.gnv.geobackend.base.query.QueryExecutor;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
27 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
28 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
29 import de.intevation.gnv.geobackend.util.DateUtils;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
30 import de.intevation.gnv.transition.describedata.DefaultKeyValueDescribeData;
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
31 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
32 import de.intevation.gnv.transition.describedata.MinMaxDescribeData;
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
33 import de.intevation.gnv.transition.describedata.NamedArrayList;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
34 import de.intevation.gnv.transition.describedata.NamedCollection;
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
35 import de.intevation.gnv.transition.describedata.SingleValueDescribeData;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
36 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
37 import de.intevation.gnv.utils.ArtifactXMLUtilities;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 * @author Tim Englich <tim.englich@intevation.de>
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 *
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 public abstract class TransitionBase implements Transition {
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
44
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
45 /**
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
46 * The UID of this Class
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
47 */
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
48 private static final long serialVersionUID = 2411169179001645426L;
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
49
52
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 * 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
52 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 private String id = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
57 private String description = null;
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
58
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
59 protected String dataName = null;
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
60
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
61 private boolean dataMultiSelect = false;
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
62
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63 protected String queryID = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 private Collection<String> reachableTransitions = null;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
67 protected Collection<String> inputValueNames = null;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
68
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
69 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
70
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 private Transition parent = null;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
72
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
73 private Map<String,InputData> inputData = null;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
74
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
75 protected Collection<Object> descibeData = null;
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
76
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
77 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
78 * Constructor
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
79 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 public TransitionBase() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81 super();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
82 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
83
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#getID()
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 String getID() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88 return this.id;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
89 }
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
90
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
91 /**
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
92 * @see de.intevation.gnv.transition.Transition#getDescription()
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
93 */
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
94 public String getDescription() {
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
95 return this.description;
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
96 }
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
97
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
98 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
99 * @see de.intevation.gnv.transition.Transition#reachableTransitions()
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 Collection<String> reachableTransitions() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
102 return this.reachableTransitions;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
103 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
104
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
105 /**
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
106 * @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
107 */
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
108 public Collection<InputValue> getRequiredInputValues() {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
109 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
110 }
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
111
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
112 /**
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
113 * @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
114 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
115 public void setup(Node configuration) {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
116
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
117 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
118 this.description = Config.getStringXPath(configuration,"@description");
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
119
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
120 log.info("Transition-ID = "+ this.id);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
121 NodeList nodes = Config.getNodeSetXPath(configuration,"reachableTransitions/transition");
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
122 this.reachableTransitions = new ArrayList<String>(nodes.getLength());
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
123 for (int i = 0 ; i < nodes.getLength(); i++){
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
124 String reachableTransition = nodes.item(i).getTextContent();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
125 log.info("ReachableTransition ==> "+ reachableTransition);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
126 this.reachableTransitions.add(reachableTransition);
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
127
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
128 }
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
129
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
130 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,"inputvalues/inputvalue");
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
131 this.inputValues = new HashMap<String,InputValue>(inputValuesNodes.getLength());
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
132 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
133 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
134 Node inputValueNode = inputValuesNodes.item(i);
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
135 String usedinQueryValue = Config.getStringXPath(inputValueNode,"@usedinquery");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
136 int usedinQuery = 1;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
137 if (usedinQueryValue != null){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
138 try {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
139 usedinQuery = Integer.parseInt(usedinQueryValue);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
140 } catch (NumberFormatException e) {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
141 log.warn("Used in Query Value cannot be transformed into a Number");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
142 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
143 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
144 InputValue inputValue = new DefaultInputValue(
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
145 Config.getStringXPath(inputValueNode,"@name"),
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
146 Config.getStringXPath(inputValueNode,"@type"),
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
147 Boolean.parseBoolean(Config.getStringXPath(inputValueNode,"@multiselect")),
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
148 usedinQuery);
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
149 log.debug(inputValue.toString());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
150 this.inputValues.put(inputValue.getName(),inputValue);
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
151 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
152 }
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
153
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
154 this.queryID = Config.getStringXPath(configuration,"queryID");
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
155 log.info("QueryID ==> "+ this.queryID);
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
156
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
157 this.dataName = Config.getStringXPath(configuration,"dataname");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
158
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
159 String dataMultiSelectValue = Config.getStringXPath(configuration,"data-multiselect");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
160 if (dataMultiSelectValue != null){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
161 this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
162 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
163
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
164 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
165
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
166 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
167 * @see de.intevation.gnv.transition.Transition#getParent()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
168 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
169 public Transition getParent() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
170 return this.parent;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
171 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
172
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
173 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
174 * @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
175 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
176 public void setParent(Transition transition) {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
177 this.parent = transition;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
178 }
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
179
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
180 /**
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
181 * @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
182 */
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
183 public void putInputData(Collection<InputData> inputData) throws TransitionException {
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
184 log.debug("TransitionBase.putInputData");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
185 if (inputData != null){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
186 Iterator<InputData> it = inputData.iterator();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
187 while(it.hasNext()){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
188 InputData tmpItem = it.next();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
189 InputValue inputValue = this.inputValues.get(tmpItem.getName());
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
190 if (inputValue != null){
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
191 if (this.inputData == null){
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
192 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
193 }
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
194 this.setSelection(tmpItem);
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
195 this.inputData.put(tmpItem.getName(),tmpItem);
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
196
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
197 }else{
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
198 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
199 log.warn(errMsg+ "Value will be ignored");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
200
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
201 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
202 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
203 }else{
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
204 log.warn("No Inputdata given");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
205 }
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
206 }
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
207
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
208 private void setSelection(InputData inputData){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
209 log.debug("TransitionBase.setSelection");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
210
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
211 Object o = this.getDescribeData(inputData.getName());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
212 if(o != null){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
213 if (o instanceof Collection<?>){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
214 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>)o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
215
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
216 String value = inputData.getValue();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
217 String[] selectedValues = value.split(",");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
218 Set<String> selectedItems = new HashSet<String>(selectedValues.length);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
219 for (int i = 0; i < selectedValues.length; i++){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
220 selectedItems.add(selectedValues[i].trim());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
221 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
222 // Selektion umsetzen
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
223 Iterator<KeyValueDescibeData> it = values.iterator();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
224 while (it.hasNext()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
225 KeyValueDescibeData data = it.next();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
226 String key = ""+data.getKey();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
227 boolean selected = selectedItems.contains(key);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
228 data.setSelected(selected);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
229 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
230 }else if (o instanceof MinMaxDescribeData){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
231 MinMaxDescribeData data = (MinMaxDescribeData)o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
232 if (inputData.getName().equals(data.getMinName())){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
233 // TODO: m�ssen die werte geparst werden?
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
234 data.setMinValue(inputData.getValue());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
235 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
236 if (inputData.getName().equals(data.getMaxName())){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
237 // TODO: m�ssen die werte geparst werden?
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
238 data.setMaxValue(inputData.getValue());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
239 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
240 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
241 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
242 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
243
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
244 private Object getDescribeData(String name){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
245 if (this.descibeData != null){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
246 Iterator<Object> it = this.descibeData.iterator();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
247 while (it.hasNext()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
248 Object o = it.next();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
249 if (o instanceof NamedCollection<?>){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
250 if (name.equals(((NamedCollection<?>)o).getName())){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
251 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
252 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
253 }else if (o instanceof MinMaxDescribeData){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
254 if (name.equals(((MinMaxDescribeData)o).getMinName())){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
255 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
256 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
257 if (name.equals(((MinMaxDescribeData)o).getMaxName())){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
258 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
259 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
260 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
261 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
262 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
263 return null;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
264
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
265 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
266
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
267 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
268 * @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
269 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
270 public boolean isTransitionReachable(String transitionID) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
271 log.debug("TransitionBase.isTransitionReachable");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
272 boolean returnValue = false;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
273 Iterator<String> transitions = reachableTransitions.iterator();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
274 while (transitions.hasNext()){
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
275 if(transitions.next().equals(transitionID)){
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
276 log.debug("Transition "+transitionID+" wird unterst�tzt.");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
277 returnValue = true;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
278 break;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
279 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
280 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
281 return returnValue;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
282 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
283
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
284 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
285 * @see de.intevation.gnv.transition.Transition#advance()
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
286 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
287 public void advance() throws TransitionException {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
288 log.debug("TransitionBase.advance");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
289 try {
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
290 List<String> list = new ArrayList<String>();
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
291
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
292
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
293 Iterator<String> it = this.inputValueNames.iterator();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
294 int i = 0;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
295 while (it.hasNext()){
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
296 String value = it.next();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
297 InputData data = this.inputData.get(value);
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
298 if (data != null && this.inputValues.containsKey(data.getName())){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
299 int size = this.inputValues.get(data.getName()).usedInQueries();
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
300 String type = this.inputValues.get(data.getName()).getType();
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
301 String requestValue = data.getValue();
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
302 if (type.equalsIgnoreCase("string")){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
303 requestValue = this.prepareInputData4DBQuery(requestValue);
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
304 }else if (type.equalsIgnoreCase("date")){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
305 requestValue = this.prepareInputData4DateDBQuery(requestValue);
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
306 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
307 for (int j = 0; j < size; j++){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
308 list.add(requestValue);
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
309 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
310 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
311 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
312 String[] filterValues = list.toArray(new String[0]);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
313 Collection<Result> result = null;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
314 try {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
315 if (this.queryID != null){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
316 QueryExecutor queryExecutor = QueryExecutorFactory.getInstance().getQueryExecutor();
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
317 result = queryExecutor.executeQuery(this.queryID, filterValues);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
318 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
319 this.purifyResult(result);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
320 } catch (RuntimeException e) {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
321 log.error(e,e);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
322 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
323 } catch (QueryException e) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
324 log.error(e,e);
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
325 throw new TransitionException(e);
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 }
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
328
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
329 private String prepareInputData4DateDBQuery(String value){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
330 if (value != null){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
331 String[] values = value.split(",");
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
332 String newValue = "";
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
333 for (int i = 0; i < values.length; i++){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
334 if (newValue.length() > 0){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
335 newValue= newValue + " , ";
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
336 }
84
c8d1f7b9e5a8 Bugfixed in Querypreparation
Tim Englich <tim.englich@intevation.de>
parents: 83
diff changeset
337 newValue = newValue + "to_date('"+values[i].trim()+"', 'YYYY.MM.DD HH24:MI:SS')"; // TODO JUST HACK FIND A BETTER RESOLUTION
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
338 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
339 return newValue;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
340 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
341
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
342 return value;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
343 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
344 private String prepareInputData4DBQuery(String value){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
345 if (value != null){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
346 String[] values = value.split(",");
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
347 String newValue = "";
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
348 for (int i = 0; i < values.length; i++){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
349 if (newValue.length() > 0){
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
350 newValue= newValue + " , ";
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
351 }
84
c8d1f7b9e5a8 Bugfixed in Querypreparation
Tim Englich <tim.englich@intevation.de>
parents: 83
diff changeset
352 newValue = newValue + "'"+values[i].trim()+"'";
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
353 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
354 return newValue;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
355 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
356
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
357 return value;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
358
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
359 }
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
360
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
361 /**
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
362 * @param result
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
363 */
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
364 protected void purifyResult(Collection<Result> result) {
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
365 if (this.descibeData == null){
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
366 this.descibeData = new ArrayList<Object>();
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
367 }
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
368 Iterator<Result> rit = result.iterator();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
369 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>(this.dataName,result.size());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
370 keyValueDescibeData.setMultiSelect(this.dataMultiSelect);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
371 while(rit.hasNext()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
372 Result resultValue = rit.next();
82
5eb62df21f9a Added Support for Vertical Profiles Marnet, STAUN, IMIS
Tim Englich <tim.englich@intevation.de>
parents: 81
diff changeset
373 keyValueDescibeData.add(new DefaultKeyValueDescribeData(resultValue.getString("KEY"), resultValue.getString("VALUE")));
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
374 }
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
375 this.descibeData.add(keyValueDescibeData);
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
376 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
377
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
378 /**
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
379 * @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
380 */
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
381 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
382
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
383 if(this.descibeData != null){
76
2473440671ce Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
384 ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities();
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
385 Iterator<Object> it = this.descibeData.iterator();
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
386 Node staticNode = xmlutilities.createArtifactElement(document, "static");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
387 Node dynamic = xmlutilities.createArtifactElement(document, "dynamic");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
388 rootNode.appendChild(staticNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
389 rootNode.appendChild(dynamic);
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
390 while (it.hasNext()){
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
391
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
392 Object o = it.next();
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
393 if (o instanceof Collection<?>){
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
394 // TODO: HACK:
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
395 // BESSERE L�SUNG FINDEN
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
396 String name = null;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
397 boolean multiselect = false;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
398 if (o instanceof NamedCollection<?>){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
399 NamedCollection<?> nc = ((NamedCollection<?>)o);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
400 name = nc.getName();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
401 multiselect = nc.isMultiSelect();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
402 }else{
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
403 Object[] names = this.inputValueNames.toArray();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
404 name = names[names.length-1].toString();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
405 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
406
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
407
78
969faa37a11b Added Multiselectsupport for InputValues
Tim Englich <tim.englich@intevation.de>
parents: 77
diff changeset
408 Element selectNode = xmlutilities.createXFormElement(document,multiselect ? "select" : "select1");
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
409 selectNode.setAttribute("ref", name);
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
410
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
411 Element lableNode = xmlutilities.createXFormElement(document, "label");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
412 lableNode.setTextContent(name);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
413 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
414
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
415 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>)o;
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
416 Iterator<KeyValueDescibeData> resultIt = values.iterator();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
417 while (resultIt.hasNext()){
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
418 KeyValueDescibeData result = resultIt.next();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
419 Element itemNode = xmlutilities.createXFormElement(document, "item");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
420
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
421 if (result.isSelected()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
422 itemNode.setAttribute("selected", "true");
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
423 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
424
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
425
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
426 Element choiceLableNode = xmlutilities.createXFormElement(document, "label");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
427 choiceLableNode.setTextContent(result.getValue());
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
428 itemNode.appendChild(choiceLableNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
429
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
430 Element choicValueNode = xmlutilities.createXFormElement(document, "value");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
431 choicValueNode.setTextContent(""+result.getKey());
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
432 itemNode.appendChild(choicValueNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
433 choiceNode.appendChild(itemNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
434 }
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
435 selectNode.appendChild(lableNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
436 selectNode.appendChild(choiceNode);
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
437
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
438 if (!it.hasNext()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
439 dynamic.appendChild(selectNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
440 }else{
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
441 staticNode.appendChild(selectNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
442 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
443
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
444 }else if (o instanceof MinMaxDescribeData){
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
445 MinMaxDescribeData descibeData = (MinMaxDescribeData)o;
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
446 Object min = descibeData.getMinValue();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
447 Object max = descibeData.getMaxValue();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
448 if (min instanceof GregorianCalendar){
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
449 Date d = ((GregorianCalendar)min).getTime();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
450 min = DateUtils.getPatternedDateAmer(d);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
451 }
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
452
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
453 if (max instanceof GregorianCalendar){
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
454 Date d = ((GregorianCalendar)max).getTime();
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
455 max = DateUtils.getPatternedDateAmer(d);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
456 }
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
457
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
458 Element inputMinNode = xmlutilities.createXFormElement(document, "input");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
459 inputMinNode.setAttribute("ref", "minvalue");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
460 Element inputMinLableNode = xmlutilities.createXFormElement(document, "label");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
461 inputMinLableNode.setTextContent("minvalue");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
462 inputMinNode.appendChild(inputMinLableNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
463
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
464 Element inputMinValueNode = xmlutilities.createXFormElement(document, "value");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
465 inputMinValueNode.setTextContent(min.toString());
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
466 inputMinNode.appendChild(inputMinValueNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
467
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
468 Element inputMaxNode = xmlutilities.createXFormElement(document, "input");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
469 inputMaxNode.setAttribute("ref", "maxvalue");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
470 Element inputMaxLableNode = xmlutilities.createXFormElement(document, "label");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
471 inputMaxLableNode.setTextContent("maxvalue");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
472 inputMaxNode.appendChild(inputMaxLableNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
473
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
474 Element inputMaxValueNode = xmlutilities.createXFormElement(document, "value");
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
475 inputMaxValueNode.setTextContent(max.toString());
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
476 inputMaxNode.appendChild(inputMaxValueNode);
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
477
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
478
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
479 if (!it.hasNext()){
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
480 dynamic.appendChild(inputMinNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
481 dynamic.appendChild(inputMaxNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
482 }else{
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
483 staticNode.appendChild(inputMinNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
484 staticNode.appendChild(inputMaxNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
485 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
486 }else if (o instanceof SingleValueDescribeData){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
487
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
488 SingleValueDescribeData svdb = (SingleValueDescribeData)o;
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
489
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
490 Element inputNode = xmlutilities.createXFormElement(document, "input");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
491 inputNode.setAttribute("ref", svdb.getName());
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
492
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
493 Element inputLableNode = xmlutilities.createXFormElement(document, "label");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
494 inputLableNode.setTextContent(svdb.getName());
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
495 inputNode.appendChild(inputLableNode);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
496
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
497 Element inputValueNode = xmlutilities.createXFormElement(document, "value");
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
498 inputValueNode.setTextContent(svdb.getValue());
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
499 inputNode.appendChild(inputValueNode);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
500
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
501
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
502 if (!it.hasNext()){
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
503 dynamic.appendChild(inputNode);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
504 }else{
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
505 staticNode.appendChild(inputNode);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
506 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
507 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
508
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
509 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
510 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
511 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
512
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
513 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
514 * @see de.intevation.gnv.transition.Transition#getDescibeData()
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
515 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
516 public Collection<Object> getDescibeData() {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
517 return this.descibeData;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
518 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
519
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
520 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
521 * @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
522 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
523 public void setDescibeData(Collection<Object> descibeData) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
524 this.descibeData = descibeData;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
525
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
526 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
527
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
528 /**
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
529 * @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
530 */
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
531 public Collection<InputData> getInputData() throws TransitionException {
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
532 return this.inputData != null ? this.inputData.values() : null;
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
533 }
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
534 }

http://dive4elements.wald.intevation.org