Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java @ 252:f1e7ddeef5bc
Added Validation if a given maxvalue is greater than a given minvalue issue19
gnv-artifacts/trunk@323 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Wed, 11 Nov 2009 15:54:31 +0000 |
parents | 3d6d89bcbf42 |
children | 6a3a02e004d9 |
rev | line source |
---|---|
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.transition; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
6 import java.io.OutputStream; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.util.ArrayList; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.util.Collection; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
10 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import org.apache.log4j.Logger; |
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:
182
diff
changeset
|
12 import org.w3c.dom.Element; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 import org.w3c.dom.Node; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
14 import org.w3c.dom.NodeList; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifactdatabase.Config; |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
17 import de.intevation.artifacts.CallMeta; |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
18 import de.intevation.gnv.artifacts.cache.CacheFactory; |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
19 import de.intevation.gnv.geobackend.base.Result; |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
20 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
21 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
22 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
23 import de.intevation.gnv.transition.exception.TransitionException; |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
24 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
25 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 * @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:
117
diff
changeset
|
27 * |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 public abstract class OutputTransitionBase extends TransitionBase implements |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
30 OutputTransition { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
31 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
32 /** |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
33 * The UID of this Class |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
34 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
35 private static final long serialVersionUID = -1718732895737303823L; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
36 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 * the logger, used to log exceptions and additonaly information |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 private static Logger log = Logger.getLogger(OutputTransitionBase.class); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
41 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
42 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
43 * The different Outputmodes which are provided by an OutputTransition |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
44 */ |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 protected Collection<OutputMode> outputModes = null; |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
46 |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
47 protected String queryODVID = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
48 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 * Constructor |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
51 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
52 public OutputTransitionBase() { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
53 super(); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
55 |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
56 /** |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 * @see de.intevation.gnv.transition.OutputTransition#getOutputModes() |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 public Collection<OutputMode> getOutputModes() { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 log.debug("OutputTransitionBase.getOutputModes"); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 return this.outputModes; |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
63 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
64 /** |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 * @see de.intevation.gnv.transition.TransitionBase#setup(org.w3c.dom.Node) |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 */ |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 @Override |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 public void setup(Node configuration) { |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 log.debug("OutputTransitionBase.setup"); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 super.setup(configuration); |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
71 |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
72 this.queryODVID = Config.getStringXPath(configuration,"queryID-odv"); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
73 |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
74 NodeList outputModeList = Config.getNodeSetXPath(configuration, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
75 "outputsModes/outputsMode"); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
76 if (outputModeList != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
77 log.debug(outputModeList.getLength() + " were found."); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
78 this.outputModes = new ArrayList<OutputMode>(outputModeList |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
79 .getLength()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
80 for (int i = 0; i < outputModeList.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:
182
diff
changeset
|
81 Element currentNode = (Element)outputModeList.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:
182
diff
changeset
|
82 String name = currentNode.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:
182
diff
changeset
|
83 String description =currentNode.getAttribute("description"); |
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:
182
diff
changeset
|
84 String mimeType = currentNode.getAttribute("mime-type"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
85 NodeList inputValuesList = Config.getNodeSetXPath(currentNode, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
86 "parameters/inputvalue"); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
87 Collection<InputValue> inputParameters = null; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
88 if (inputValuesList != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
89 inputParameters = new ArrayList<InputValue>(inputValuesList |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
90 .getLength()); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
91 for (int j = 0; j < inputValuesList.getLength(); j++) { |
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:
182
diff
changeset
|
92 Element currentInputValuesNode = (Element)inputValuesList.item(j); |
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:
182
diff
changeset
|
93 String inputValueName = currentInputValuesNode.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:
182
diff
changeset
|
94 String inputValueType = currentInputValuesNode.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:
182
diff
changeset
|
95 String defaultValue =currentInputValuesNode.getAttribute("value"); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
96 boolean isMultiselect = false; |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
97 InputValue inputValue = new DefaultInputValue( |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
98 inputValueName, inputValueType, defaultValue, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
99 isMultiselect); |
91
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
100 inputParameters.add(inputValue); |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
101 } |
bd284d8306db
Added Support for Patameters in OutputModes
Tim Englich <tim.englich@intevation.de>
parents:
86
diff
changeset
|
102 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
103 |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
104 OutputMode outputMode = new DefaultOutputMode(name, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
105 description, mimeType, inputParameters); |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 log.debug(outputMode.toString()); |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 this.outputModes.add(outputMode); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
108 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 } |
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
112 |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
113 /** |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
114 * @see de.intevation.gnv.transition.TransitionBase#advance() |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
115 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
116 @Override |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
117 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:
117
diff
changeset
|
118 throws TransitionException { |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
119 log.debug("OutputTransitionBase.advance"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
120 if (this.getChartResult(uuid) == null) { |
117
ef157bd2fa92
LanguageSupport integrated
Tim Englich <tim.englich@intevation.de>
parents:
99
diff
changeset
|
121 super.advance(uuid, callMeta); |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
122 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
123 } |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
124 |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
125 /** |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
126 * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
127 * java.util.Collection, java.io.OutputStream) |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
128 */ |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
129 public void out(String outputMode, Collection<InputData> inputData, |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
130 OutputStream outputStream) throws TransitionException { |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
131 } |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
132 |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
133 /** |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
134 * @return |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
135 */ |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
136 protected Collection<Result> getChartResult(String uuid) { |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
137 log.debug("OutputTransitionBase.getChartResult"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
138 if (CacheFactory.getInstance().isInitialized()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
139 String key = uuid + super.getID(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
140 log.debug("Hash for Queryelements: " + key); |
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:
182
diff
changeset
|
141 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
142 if (value != null) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
143 return (Collection<Result>) (value.getObjectValue()); |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
144 } |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
145 } |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
146 return null; |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
147 } |
182
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
148 |
232
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
149 protected Collection<Result> getODVResult(String uuid) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
150 log.debug("OutputTransitionBase.getODVResult"); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
151 // TODO add Caching? I think it's not nessessary |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
152 Collection<Result> returnValue = null; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
153 if (this.queryODVID != null){ |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
154 try { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
155 String[] filterValues = this.generateFilterValuesFromInputData(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
156 try { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
157 QueryExecutor queryExecutor = QueryExecutorFactory |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
158 .getInstance() |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
159 .getQueryExecutor(); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
160 returnValue = queryExecutor.executeQuery(this.queryODVID, |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
161 filterValues); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
162 } catch (RuntimeException e) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
163 log.error(e, e); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
164 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
165 } catch (QueryException e) { |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
166 log.error(e, e); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
167 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
168 }else{ |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
169 log.warn("No Query for ODV Data is defined."); |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
170 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
171 return returnValue; |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
172 } |
3d6d89bcbf42
Added special Data-Selection to the ODV-Exports of TimeSeries on TimeSeriesPoints. issue68
Tim Englich <tim.englich@intevation.de>
parents:
220
diff
changeset
|
173 |
182
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
174 protected void removeChartResult(String uuid) { |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
175 log.debug("OutputTransitionBase.getChartResult"); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
176 if (CacheFactory.getInstance().isInitialized()) { |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
177 String key = uuid + super.getID(); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
178 log.debug("Hash for Queryelements: " + key); |
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:
182
diff
changeset
|
179 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); |
182
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
180 if (value != null) { |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
181 CacheFactory.getInstance().getCache().remove(key); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
182 } |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
183 } |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
184 } |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
185 |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
186 /** |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
187 * @see de.intevation.gnv.transition.TransitionBase#purifyResult(java.util.Collection, |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
188 * java.lang.String) |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
189 */ |
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
190 @Override |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
191 protected void purifyResult(Collection<Result> result, String uuid) { |
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
192 log.debug("OutputTransitionBase.purifyResult"); |
171
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
193 if (CacheFactory.getInstance().isInitialized()) { |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
194 String key = uuid + super.getID(); |
7fb9441dd8af
Format Code to max 80 Chars per Row and Cleanup
Tim Englich <tim.englich@intevation.de>
parents:
117
diff
changeset
|
195 log.debug("Hash for Queryelements: " + key); |
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:
182
diff
changeset
|
196 CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); |
99
bb45c5097cb6
ehcache Integration for storing the chartresultvalues
Tim Englich <tim.englich@intevation.de>
parents:
91
diff
changeset
|
197 } |
86
5d4f5d26bb7a
Some Codecleanup done
Tim Englich <tim.englich@intevation.de>
parents:
64
diff
changeset
|
198 } |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
199 |
182
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
200 /** |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
201 * @see de.intevation.gnv.transition.TransitionBase#putInputData(java.util.Collection, java.lang.String) |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
202 */ |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
203 @Override |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
204 public void putInputData(Collection<InputData> inputData, |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
205 String uuid) |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
206 throws TransitionException { |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
207 log.debug("OutputTransitionBase.putInputData"); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
208 this.removeChartResult(uuid); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
209 super.putInputData(inputData, uuid); |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
210 } |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
211 |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
212 public void out(String outputMode, Collection<InputData> inputData, |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
213 OutputStream outputStream, String uuid, CallMeta callMeta) |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
214 throws TransitionException { |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
215 } |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
216 |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
217 |
4896d4f94bdc
Bugfix ChartValues were not Recalculated after feed was called second Time.
Tim Englich <tim.englich@intevation.de>
parents:
171
diff
changeset
|
218 |
64
5db77e0a8594
Integrated Output Methods and Interfacsstructure
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
219 } |