annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 207:d87347142702

Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3 gnv-artifacts/trunk@263 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 23 Oct 2009 08:50:50 +0000
parents 734ac082c8d1
children ee2d4134d0b3
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;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
24 import de.intevation.artifacts.CallMeta;
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 import de.intevation.gnv.artifacts.GNVArtifactBase;
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
26 import de.intevation.gnv.artifacts.cache.CacheFactory;
117
ef157bd2fa92 LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents: 116
diff changeset
27 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
28 import de.intevation.gnv.geobackend.base.Result;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
29 import de.intevation.gnv.geobackend.base.query.QueryExecutor;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
30 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
31 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
32 import de.intevation.gnv.geobackend.util.DateUtils;
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
33 import de.intevation.gnv.transition.describedata.DefaultKeyValueDescribeData;
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
34 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
35 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
36 import de.intevation.gnv.transition.describedata.NamedArrayList;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
37 import de.intevation.gnv.transition.describedata.NamedCollection;
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
38 import de.intevation.gnv.transition.describedata.SingleValueDescribeData;
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
39 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
40 import de.intevation.gnv.utils.ArtifactXMLUtilities;
101
e01c163ea5b0 Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
41 import de.intevation.gnv.utils.InputValidator;
52
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 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 * @author Tim Englich <tim.englich@intevation.de>
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
45 *
52
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 public abstract class TransitionBase implements Transition {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
48
77
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
49 /**
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
50 * The UID of this Class
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
51 */
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
52 private static final long serialVersionUID = 2411169179001645426L;
0e38f512f7e4 Some improvements an bugfixes done
Tim Englich <tim.englich@intevation.de>
parents: 76
diff changeset
53
52
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 * 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
56 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 private static Logger log = Logger.getLogger(GNVArtifactBase.class);
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
58
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
59 private final static String DESCRIBEDATAKEY = "_DESCRIBEDATA";
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
60
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
61 private String id = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
62
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
63 private String description = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
64
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
65 protected String dataName = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
66
116
820238357bab Added Horizontal-Profile-Support for Meshes.
Tim Englich <tim.englich@intevation.de>
parents: 101
diff changeset
67 protected boolean dataMultiSelect = false;
53
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
68
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 protected String queryID = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
70
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 private Collection<String> reachableTransitions = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
72
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
73 protected Collection<String> inputValueNames = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
74
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
75 private Map<String, InputValue> inputValues = null;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
76
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
77 private Transition parent = null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
78
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
79 protected Map<String, InputData> inputData = null;
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
80
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
81
52
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 * Constructor
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 public TransitionBase() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
86 super();
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
87 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
88
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
89 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
90 * @see de.intevation.gnv.transition.Transition#getID()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
91 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
92 public String getID() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
93 return this.id;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
94 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
95
53
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 * @see de.intevation.gnv.transition.Transition#getDescription()
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
98 */
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
99 public String getDescription() {
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
100 return this.description;
e464d9f9d967 Added getDescription to a Transition
Tim Englich <tim.englich@intevation.de>
parents: 52
diff changeset
101 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
102
52
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 * @see de.intevation.gnv.transition.Transition#reachableTransitions()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
105 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
106 public Collection<String> reachableTransitions() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
107 return this.reachableTransitions;
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
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
110 /**
55
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
111 * @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
112 */
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
113 public Collection<InputValue> getRequiredInputValues() {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
114 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
115 }
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
116
6ded86ce30dd Constructs for the required Inputvalues for an Transition created
Tim Englich <tim.englich@intevation.de>
parents: 54
diff changeset
117 /**
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
118 * @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
119 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
120 public void setup(Node configuration) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
121 log.debug("TransitionBase.setup");
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
122 this.id = ((Element)configuration).getAttribute("id");
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
123 this.description = ((Element)configuration).getAttribute("description");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
124
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
125 log.info("Transition-ID = " + this.id);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
126 NodeList nodes = Config.getNodeSetXPath(configuration,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
127 "reachableTransitions/transition");
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
128 this.reachableTransitions = new ArrayList<String>(nodes.getLength());
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
129 for (int i = 0; i < nodes.getLength(); i++) {
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
130 String reachableTransition = nodes.item(i).getTextContent();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
131 log.info("ReachableTransition ==> " + reachableTransition);
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
132 this.reachableTransitions.add(reachableTransition);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
133
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
134 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
135
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
136 NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
137 "inputvalues/inputvalue");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
138 this.inputValues = new HashMap<String, InputValue>(inputValuesNodes
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
139 .getLength());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
140 this.inputValueNames = new ArrayList<String>(inputValuesNodes
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
141 .getLength());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
142 for (int i = 0; i < inputValuesNodes.getLength(); i++) {
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
143 Element inputValueNode = (Element)inputValuesNodes.item(i);
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
144 String usedinQueryValue = inputValueNode.getAttribute("usedinquery");
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
145 int usedinQuery = 1;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
146 if (usedinQueryValue != null) {
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
147 try {
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
148 usedinQuery = Integer.parseInt(usedinQueryValue);
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
149 } catch (NumberFormatException e) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
150 log
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
151 .warn("Used in Query Value cannot be transformed into a Number");
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
152 }
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
153 }
204
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
154 InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"),
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
155 inputValueNode.getAttribute("type"),
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
156 Boolean.parseBoolean(inputValueNode.
734ac082c8d1 Split the Configuration File in several small Documents to speed up the Artifactinstantiation and also make the administration of the Artifactdatabase easier. issue40 and issue59
Tim Englich <tim.englich@intevation.de>
parents: 195
diff changeset
157 getAttribute("multiselect")), usedinQuery);
56
737d8bf63701 Required Inputelements integrated in BAsicArtifact-Descibe-Outputv
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
158 log.debug(inputValue.toString());
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
159 this.inputValues.put(inputValue.getName(), inputValue);
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
160 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
161 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
162
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
163 this.queryID = Config.getStringXPath(configuration, "queryID");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
164 log.info("QueryID ==> " + this.queryID);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
165
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
166 this.dataName = Config.getStringXPath(configuration, "dataname");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
167
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
168 String dataMultiSelectValue = Config.getStringXPath(configuration,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
169 "data-multiselect");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
170 if (dataMultiSelectValue != null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
171 this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue);
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
172 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
173
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
174 }
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 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
177 * @see de.intevation.gnv.transition.Transition#getParent()
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
178 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
179 public Transition getParent() {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
180 return this.parent;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
181 }
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
182
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
183 /**
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
184 * @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
185 */
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
186 public void setParent(Transition transition) {
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
187 this.parent = transition;
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
188 }
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
189
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
190 /**
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
191 * @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
192 */
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
193 public void putInputData(Collection<InputData> inputData, String uuid)
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
194 throws TransitionException {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
195 log.debug("TransitionBase.putInputData");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
196 if (inputData != null) {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
197 Iterator<InputData> it = inputData.iterator();
101
e01c163ea5b0 Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
198 InputValidator iv = new InputValidator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
199 while (it.hasNext()) {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
200 InputData tmpItem = it.next();
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
201 InputValue inputValue = this.inputValues.get(tmpItem.getName());
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
202 if (inputValue != null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
203 if (this.inputData == null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
204 this.inputData = new HashMap<String, InputData>(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
205 inputData.size());
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
206 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
207 boolean valid = iv.isInputValid(tmpItem.getValue(),
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
208 inputValue.getType());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
209 if (valid) {
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
210 this.setSelection(tmpItem, uuid);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
211 this.inputData.put(tmpItem.getName(), tmpItem);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
212 } else {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
213 String errMsg = "Wrong input for " + tmpItem.getValue()
192
17987acf20d0 Correct misspelled Exception-Message as an Result of fixing issue35
Tim Englich <tim.englich@intevation.de>
parents: 190
diff changeset
214 + " is not an " + inputValue.getType()
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
215 + " Value.";
101
e01c163ea5b0 Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
216 log.warn(errMsg);
e01c163ea5b0 Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
217 throw new TransitionException(errMsg);
e01c163ea5b0 Inputvalidation for String, Integer and Date Values added.
Tim Englich <tim.englich@intevation.de>
parents: 99
diff changeset
218 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
219
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
220 } else {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
221 String errMsg = "No Inputvalue given for Inputdata "
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
222 + tmpItem.getName();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
223 log.warn(errMsg + "Value will be ignored");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
224
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
225 }
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
226 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
227 } else {
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
228 log.warn("No Inputdata given");
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
229 }
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
230 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
231
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
232 private void setSelection(InputData inputData, String uuid) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
233 log.debug("TransitionBase.setSelection");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
234
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
235 Object o = this.getDescribeData(inputData.getName(),uuid);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
236 if (o != null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
237 if (o instanceof Collection<?>) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
238 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>) o;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
239
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
240 String value = inputData.getValue();
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
241 String[] selectedValues = value.split(",");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
242 Set<String> selectedItems = new HashSet<String>(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
243 selectedValues.length);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
244 for (int i = 0; i < selectedValues.length; i++) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
245 selectedItems.add(selectedValues[i].trim());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
246 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
247 // Selektion umsetzen
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
248 Iterator<KeyValueDescibeData> it = values.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
249 while (it.hasNext()) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
250 KeyValueDescibeData data = it.next();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
251 String key = "" + data.getKey();
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
252 boolean selected = selectedItems.contains(key);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
253 data.setSelected(selected);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
254 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
255 } else if (o instanceof MinMaxDescribeData) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
256 MinMaxDescribeData data = (MinMaxDescribeData) o;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
257 if (inputData.getName().equals(data.getMinName())) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
258 // TODO: m�ssen die werte geparst werden?
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
259 data.setMinValue(inputData.getValue());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
260 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
261 if (inputData.getName().equals(data.getMaxName())) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
262 // TODO: m�ssen die werte geparst werden?
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
263 data.setMaxValue(inputData.getValue());
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
264 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
265 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
266 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
267 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
268
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
269 private Object getDescribeData(String name, String uuid) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
270 log.debug("TransitionBase.getDescribeData");
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
271 Collection<Object> descibeData = this.getDescibeData(uuid);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
272 if (descibeData != null) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
273 Iterator<Object> it = descibeData.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
274 while (it.hasNext()) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
275 Object o = it.next();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
276 if (o instanceof NamedCollection<?>) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
277 if (name.equals(((NamedCollection<?>) o).getName())) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
278 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
279 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
280 } else if (o instanceof MinMaxDescribeData) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
281 if (name.equals(((MinMaxDescribeData) o).getMinName())) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
282 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
283 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
284 if (name.equals(((MinMaxDescribeData) o).getMaxName())) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
285 return o;
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
286 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
287 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
288 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
289 }
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
290 return null;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
291
57
f01592cd6419 Funktionalität Feed initial bereitgestellt.
Tim Englich <tim.englich@intevation.de>
parents: 56
diff changeset
292 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
293
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
294 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
295 * @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
296 */
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
297 public boolean isTransitionReachable(String transitionID) {
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
298 log.debug("TransitionBase.isTransitionReachable");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
299 boolean returnValue = false;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
300 Iterator<String> transitions = reachableTransitions.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
301 while (transitions.hasNext()) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
302 if (transitions.next().equals(transitionID)) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
303 log.debug("Transition " + transitionID + " wird unterst�tzt.");
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
304 returnValue = true;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
305 break;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
306 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
307 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
308 return returnValue;
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
309 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
310
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
311 /**
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
312 * @see de.intevation.gnv.transition.Transition#advance(java.lang.String,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
313 * de.intevation.artifacts.CallMeta)
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
314 */
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
315 public void advance(String uuid, CallMeta callMeta)
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
316 throws TransitionException {
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
317 log.debug("TransitionBase.advance");
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
318 try {
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
319 List<String> list = new ArrayList<String>();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
320
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
321 Iterator<String> it = this.inputValueNames.iterator();
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
322 int i = 0;
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
323 while (it.hasNext()) {
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
324 String value = it.next();
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
325 InputData data = this.inputData.get(value);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
326 if (data != null
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
327 && this.inputValues.containsKey(data.getName())) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
328 int size = this.inputValues.get(data.getName())
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
329 .usedInQueries();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
330 String type = this.inputValues.get(data.getName())
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
331 .getType();
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
332 String requestValue = data.getValue();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
333 if (type.equalsIgnoreCase("string")) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
334 requestValue = this
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
335 .prepareInputData4DBQuery(requestValue);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
336 } else if (type.equalsIgnoreCase("date")) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
337 requestValue = this
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
338 .prepareInputData4DateDBQuery(requestValue);
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
339 } else if (type.equalsIgnoreCase("coordinate")){
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
340 requestValue = this
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
341 .prepareInputData4RegionDBQuery(requestValue);
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
342 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
343 for (int j = 0; j < size; j++) {
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
344 list.add(requestValue);
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
345 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
346 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
347 }
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
348 String[] filterValues = list.toArray(new String[0]);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
349 Collection<Result> result = null;
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
350 try {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
351 if (this.queryID != null) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
352 QueryExecutor queryExecutor = QueryExecutorFactory
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
353 .getInstance().getQueryExecutor();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
354 result = queryExecutor.executeQuery(this.queryID,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
355 filterValues);
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
356 }
99
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
357 this.purifyResult(result, uuid);
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
358 } catch (RuntimeException e) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
359 log.error(e, e);
81
9b41f3688610 Added Support for TimeSeriesMesh
Tim Englich <tim.englich@intevation.de>
parents: 79
diff changeset
360 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
361 } catch (QueryException e) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
362 log.error(e, e);
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
363 throw new TransitionException(e);
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
364 }
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
365 }
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
366
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
367 protected String prepareInputData4RegionDBQuery(String value){
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
368 return value;
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
369 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
370
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
371 private String prepareInputData4DateDBQuery(String value) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
372 log.debug("TransitionBase.prepareInputData4DateDBQuery");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
373 if (value != null) {
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
374 String[] values = value.split(",");
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
375 String newValue = "";
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
376 for (int i = 0; i < values.length; i++) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
377 if (newValue.length() > 0) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
378 newValue = newValue + " , ";
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
379 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
380 // TODO JUST HACK FIND A BETTER RESOLUTION
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
381 newValue = newValue + "to_date('" + values[i].trim()
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
382 + "', 'YYYY.MM.DD HH24:MI:SS')";
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
383 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
384 return newValue;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
385 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
386
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
387 return value;
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
388 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
389
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
390 private String prepareInputData4DBQuery(String value) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
391 log.debug("TransitionBase.prepareInputData4DBQuery");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
392 if (value != null) {
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
393 String[] values = value.split(",");
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
394 String newValue = "";
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
395 for (int i = 0; i < values.length; i++) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
396 if (newValue.length() > 0) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
397 newValue = newValue + " , ";
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
398 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
399 newValue = newValue + "'" + values[i].trim() + "'";
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
400 }
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
401 return newValue;
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
402 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
403
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
404 return value;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
405
83
5c8e54726a58 Added Support for Vertical Profiles Mesh
Tim Englich <tim.englich@intevation.de>
parents: 82
diff changeset
406 }
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
407
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
408 /**
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
409 * @param result
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
410 */
99
bb45c5097cb6 ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents: 88
diff changeset
411 protected void purifyResult(Collection<Result> result, String uuid) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
412 log.debug("TransitionBase.purifyResult");
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
413 Collection<Object> describeData = this.getDescibeData(uuid);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
414 if (describeData == null) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
415 describeData = new ArrayList<Object>();
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
416 }
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
417 NamedCollection<KeyValueDescibeData> keyValueDescibeData = extractKVP(result, "KEY", "VALUE");
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
418 describeData.add(keyValueDescibeData);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
419 this.setDescibeData(uuid, describeData);
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
420 }
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
421
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
422 /**
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
423 * @param result
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
424 * @return
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
425 */
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
426 protected NamedCollection<KeyValueDescibeData> extractKVP(
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
427 Collection<Result> result,
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
428 String keyid,
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
429 String valueid) {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
430 Iterator<Result> rit = result.iterator();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
431 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
432 this.dataName, result.size());
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
433 keyValueDescibeData.setMultiSelect(this.dataMultiSelect);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
434 while (rit.hasNext()) {
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
435 Result resultValue = rit.next();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
436 keyValueDescibeData.add(new DefaultKeyValueDescribeData(resultValue
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
437 .getString(keyid), resultValue.getString(valueid)));
68
d117fd4b82e5 Chartrendering integrated in Timeseries Transition
Tim Englich <tim.englich@intevation.de>
parents: 63
diff changeset
438 }
173
1b2fc94766c9 Added real Coordinate-Query to TimeSeries-Mesh
Tim Englich <tim.englich@intevation.de>
parents: 171
diff changeset
439 return keyValueDescibeData;
61
5f47881f7c97 Implementation of the MIN- / MAX-Value Representation
Tim Englich <tim.englich@intevation.de>
parents: 59
diff changeset
440 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
441
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
442 /**
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
443 * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document,
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
444 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta,
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
445 * java.lang.String)
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
446 */
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
447 public void describe(Document document, Node rootNode, CallMeta callMeta,String uuid) {
118
5ebc059064a6 Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
Tim Englich <tim.englich@intevation.de>
parents: 117
diff changeset
448 log.debug("TransitionBase.describe");
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
449 Collection<Object> descibeData = this.getDescibeData(uuid);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
450 if (descibeData != null) {
76
2473440671ce Integrate UI-Representation for Describe into the FISArtifact.
Tim Englich <tim.englich@intevation.de>
parents: 68
diff changeset
451 ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities();
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
452 Iterator<Object> it = descibeData.iterator();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
453 Node staticNode = xmlutilities.createArtifactElement(document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
454 "static");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
455 Node dynamic = xmlutilities.createArtifactElement(document,
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
456 "dynamic");
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
457 rootNode.appendChild(staticNode);
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
458 rootNode.appendChild(dynamic);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
459 while (it.hasNext()) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
460
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
461 Object o = it.next();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
462 if (o instanceof Collection<?>) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
463 String name = null;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
464 boolean multiselect = false;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
465 if (o instanceof NamedCollection<?>) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
466 NamedCollection<?> nc = ((NamedCollection<?>) o);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
467 name = nc.getName();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
468 multiselect = nc.isMultiSelect();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
469 } else {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
470 Object[] names = this.inputValueNames.toArray();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
471 name = names[names.length - 1].toString();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
472 }
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
473
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
474 Element selectNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
475 document, multiselect ? "select" : "select1");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
476 selectNode.setAttribute("ref", name);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
477
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
478 Element lableNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
479 document, "label");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
480 lableNode.setTextContent(RessourceFactory.getInstance()
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
481 .getRessource(callMeta.getLanguages(), name, name));
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
482 Element choiceNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
483 document, "choices");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
484
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
485 Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>) o;
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
486 Iterator<KeyValueDescibeData> resultIt = values.iterator();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
487 while (resultIt.hasNext()) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
488 KeyValueDescibeData result = resultIt.next();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
489 Element itemNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
490 document, "item");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
491
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
492 if (result.isSelected()) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
493 itemNode.setAttribute("selected", "true");
79
e33c61735a4e Implementation of the Static UI done
Tim Englich <tim.englich@intevation.de>
parents: 78
diff changeset
494 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
495
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
496 Element choiceLableNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
497 .createXFormElement(document, "label");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
498 choiceLableNode.setTextContent(result.getValue());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
499 itemNode.appendChild(choiceLableNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
500
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
501 Element choicValueNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
502 .createXFormElement(document, "value");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
503 choicValueNode.setTextContent("" + result.getKey());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
504 itemNode.appendChild(choicValueNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
505 choiceNode.appendChild(itemNode);
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
506 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
507 selectNode.appendChild(lableNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
508 selectNode.appendChild(choiceNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
509
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
510 if (!it.hasNext()) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
511 dynamic.appendChild(selectNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
512 } else {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
513 staticNode.appendChild(selectNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
514 }
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
515
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
516 } else if (o instanceof MinMaxDescribeData) {
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
517 MinMaxDescribeData minMaxDescibeData = (MinMaxDescribeData) o;
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
518 Object min = minMaxDescibeData.getMinValue();
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
519 Object max = minMaxDescibeData.getMaxValue();
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
520 if (min instanceof GregorianCalendar) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
521 Date d = ((GregorianCalendar) min).getTime();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
522 min = DateUtils.getPatternedDateAmer(d);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
523 }
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
524
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
525 if (max instanceof GregorianCalendar) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
526 Date d = ((GregorianCalendar) max).getTime();
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
527 max = DateUtils.getPatternedDateAmer(d);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
528 }
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
529
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
530 Element groupNode = xmlutilities.createXFormElement(
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
531 document, "group");
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
532 groupNode.setAttribute("ref", minMaxDescibeData.getMinName());
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
533 Element groupNodeLableNode = xmlutilities
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
534 .createXFormElement(document, "label");
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
535 groupNodeLableNode.setTextContent(RessourceFactory
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
536 .getInstance().getRessource(
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
537 callMeta.getLanguages(),
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
538 minMaxDescibeData.getMinName(),
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
539 minMaxDescibeData.getMinName()));
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
540 groupNode.appendChild(groupNodeLableNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
541
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
542 Element inputMinNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
543 document, "input");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
544 inputMinNode.setAttribute("ref", "minvalue");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
545 Element inputMinLableNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
546 .createXFormElement(document, "label");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
547 inputMinLableNode.setTextContent(RessourceFactory
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
548 .getInstance().getRessource(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
549 callMeta.getLanguages(), "minvalue",
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
550 "minvalue"));
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
551 inputMinNode.appendChild(inputMinLableNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
552
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
553 Element inputMinValueNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
554 .createXFormElement(document, "value");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
555 inputMinValueNode.setTextContent(min.toString());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
556 inputMinNode.appendChild(inputMinValueNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
557
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
558 Element inputMaxNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
559 document, "input");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
560 inputMaxNode.setAttribute("ref", "maxvalue");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
561 Element inputMaxLableNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
562 .createXFormElement(document, "label");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
563 inputMaxLableNode.setTextContent(RessourceFactory
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
564 .getInstance().getRessource(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
565 callMeta.getLanguages(), "maxvalue",
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
566 "maxvalue"));
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
567 inputMaxNode.appendChild(inputMaxLableNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
568
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
569 Element inputMaxValueNode = xmlutilities
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
570 .createXFormElement(document, "value");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
571 inputMaxValueNode.setTextContent(max.toString());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
572 inputMaxNode.appendChild(inputMaxValueNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
573
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
574 groupNode.appendChild(inputMinNode);
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
575 groupNode.appendChild(inputMaxNode);
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
576
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
577 if (!it.hasNext()) {
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
578 dynamic.appendChild(groupNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
579 } else {
190
baaa1618fa27 Changed the displayed-Values as defined in issue47
Tim Englich <tim.englich@intevation.de>
parents: 173
diff changeset
580 staticNode.appendChild(groupNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
581 }
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
582 } else if (o instanceof SingleValueDescribeData) {
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
583
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
584 SingleValueDescribeData svdb = (SingleValueDescribeData) o;
195
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
585
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
586 Element groupNode = xmlutilities.createXFormElement(
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
587 document, "group");
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
588 groupNode.setAttribute("ref", svdb.getName());
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
589 Element groupNodeLableNode = xmlutilities
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
590 .createXFormElement(document, "label");
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
591 groupNodeLableNode.setTextContent(RessourceFactory
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
592 .getInstance().getRessource(
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
593 callMeta.getLanguages(),
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
594 svdb.getName(),
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
595 svdb.getName()));
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
596 groupNode.appendChild(groupNodeLableNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
597
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
598 Element inputNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
599 document, "input");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
600 inputNode.setAttribute("ref", svdb.getName());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
601
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
602 Element inputLableNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
603 document, "label");
195
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
604 inputLableNode.setTextContent("");
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
605 inputNode.appendChild(inputLableNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
606
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
607 Element inputValueNode = xmlutilities.createXFormElement(
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
608 document, "value");
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
609 inputValueNode.setTextContent(svdb.getValue());
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
610 inputNode.appendChild(inputValueNode);
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
611
195
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
612 groupNode.appendChild(inputNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
613 if (!it.hasNext()) {
195
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
614 dynamic.appendChild(groupNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
615 } else {
195
63f65fb9f210 Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55
Tim Englich <tim.englich@intevation.de>
parents: 192
diff changeset
616 staticNode.appendChild(groupNode);
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
617 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
618 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
619
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
620 }
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
621 }
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
622 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
623
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
624 /**
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
625 * @see de.intevation.gnv.transition.Transition#getDescibeData()
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
626 */
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
627 protected Collection<Object> getDescibeData(String uuid) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
628 if (CacheFactory.getInstance().isInitialized()) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
629 String key = uuid + DESCRIBEDATAKEY;
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
630 log.debug("Hash for Queryelements: " + key);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
631 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
632 if (value != null) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
633 return (Collection<Object>) (value.getObjectValue());
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
634 }
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
635 }
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
636 return null;
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
637 }
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
638
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
639 /**
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
640 * @see de.intevation.gnv.transition.Transition#getDescibeData()
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
641 */
207
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
642 protected void setDescibeData(String uuid, Collection<Object> describeData) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
643
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
644 if (CacheFactory.getInstance().isInitialized()) {
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
645 String key = uuid + DESCRIBEDATAKEY;
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
646 log.debug("Hash for Queryelements: " + key);
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
647 CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, describeData));
d87347142702 Store the Results of an Artifact not in the Artifact but in an ehcache instance. issue3
Tim Englich <tim.englich@intevation.de>
parents: 204
diff changeset
648 }
58
f31343d80d53 Artifact.advance initial implementiert
Tim Englich <tim.englich@intevation.de>
parents: 57
diff changeset
649 }
59
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
650
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
651 /**
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
652 * @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
653 */
2c5d8f5bced1 Outputs integrated in describe and XForms integrated
Tim Englich <tim.englich@intevation.de>
parents: 58
diff changeset
654 public Collection<InputData> getInputData() throws TransitionException {
171
7fb9441dd8af Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents: 118
diff changeset
655 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
656 }
52
4d6a82b96059 First Implementation of the GNV-Artifacts
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
657 }

http://dive4elements.wald.intevation.org