Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java @ 646:c8749d83d9b6
Added a configuration section for mapserver relevant stuff. Moved source to write meta files out to an own helper class named MetaWriter.
gnv-artifacts/trunk@733 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 04 Mar 2010 16:23:24 +0000 |
parents | a94ed2755480 |
children | dde7f51dbe1e |
rev | line source |
---|---|
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.state; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
6 import java.io.OutputStream; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
7 import java.util.ArrayList; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 import java.util.Collection; |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
9 import java.util.HashMap; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
10 import java.util.Iterator; |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
11 import java.util.List; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
12 import java.util.Locale; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
14 import javax.xml.xpath.XPathConstants; |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
15 |
631
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
16 import net.sf.ehcache.Cache; |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
17 |
480
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
18 import org.apache.log4j.Logger; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
19 import org.w3c.dom.Document; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 import org.w3c.dom.Element; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 import org.w3c.dom.Node; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
22 import org.w3c.dom.NodeList; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
23 |
616
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
24 import de.intevation.artifactdatabase.Config; |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
25 import de.intevation.artifactdatabase.XMLUtils; |
616
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
26 import de.intevation.artifacts.CallContext; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
27 import de.intevation.artifacts.CallMeta; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
28 import de.intevation.gnv.artifacts.cache.CacheFactory; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
29 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
30 import de.intevation.gnv.geobackend.base.Result; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
31 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
32 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
33 import de.intevation.gnv.geobackend.base.query.exception.QueryException; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
34 import de.intevation.gnv.state.describedata.MinMaxDescribeData; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
35 import de.intevation.gnv.state.exception.StateException; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
36 import de.intevation.gnv.utils.InputValidator; |
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
37 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
38 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
39 * @author Tim Englich <tim.englich@intevation.de> |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
40 * |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 */ |
480
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
42 public abstract class OutputStateBase |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
43 extends StateBase |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
44 implements OutputState |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
45 { |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
46 public static final String XPATH_OUTPUT_MODE = |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
47 "/art:action/art:out/@name"; |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
48 |
639
a94ed2755480
Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
631
diff
changeset
|
49 public static final String XPATH_EXPORT_MODE = |
a94ed2755480
Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
631
diff
changeset
|
50 "/art:action/art:out/art:export/@name"; |
a94ed2755480
Implemented SVG export for histograms.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
631
diff
changeset
|
51 |
480
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
52 public static final String XPATH_MIME_TYPE = |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
53 "/art:action/art:out/art:mime-type/@value"; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
54 |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
55 public static final String XPATH_EXPORTS = |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
56 "exportModes/export"; |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
57 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
58 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
59 * The UID of this Class |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
60 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
61 private static final long serialVersionUID = -1718732895737303823L; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
63 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
64 * the logger, used to log exceptions and additonaly information |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
65 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
66 private static Logger log = Logger.getLogger(OutputStateBase.class); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
67 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
68 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
69 * The different Outputmodes which are provided by an OutputState |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
70 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
71 protected Collection<OutputMode> outputModes = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
72 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
73 protected String queryODVID = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
74 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
75 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
76 * Constructor |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
77 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
78 public OutputStateBase() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
79 super(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
80 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
81 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
82 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
83 * @see de.intevation.gnv.state.OutputState#getOutputModes() |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
84 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 public Collection<OutputMode> getOutputModes() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 log.debug("OutputStateBase.getOutputModes"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
87 return this.outputModes; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
89 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
90 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
91 * @see de.intevation.gnv.state.StateBase#setup(org.w3c.dom.Node) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
92 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
93 @Override |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
94 public void setup(Node configuration) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
95 log.debug("OutputStateBase.setup"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
96 super.setup(configuration); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
97 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
98 this.queryODVID = Config.getStringXPath(configuration,"queryID-odv"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
99 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
100 NodeList outputModeList = Config.getNodeSetXPath(configuration, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
101 "outputsModes/outputsMode"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
102 if (outputModeList != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
103 log.debug(outputModeList.getLength() + " were found."); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
104 this.outputModes = new ArrayList<OutputMode>(outputModeList |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
105 .getLength()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
106 for (int i = 0; i < outputModeList.getLength(); i++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
107 Element currentNode = (Element)outputModeList.item(i); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
108 String name = currentNode.getAttribute("name"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
109 String description =currentNode.getAttribute("description"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
110 String mimeType = currentNode.getAttribute("mime-type"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
111 NodeList inputValuesList = Config.getNodeSetXPath(currentNode, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
112 "parameters/inputvalue"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
113 Collection<InputValue> inputParameters = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
114 if (inputValuesList != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
115 inputParameters = new ArrayList<InputValue>(inputValuesList |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
116 .getLength()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
117 for (int j = 0; j < inputValuesList.getLength(); j++) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
118 Element currentInputValuesNode = (Element)inputValuesList.item(j); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
119 String inputValueName = currentInputValuesNode.getAttribute("name"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
120 String inputValueType = currentInputValuesNode.getAttribute("type"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
121 String defaultValue =currentInputValuesNode.getAttribute("value"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
122 boolean isMultiselect = false; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
123 InputValue inputValue = new DefaultInputValue( |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
124 inputValueName, inputValueType, defaultValue, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
125 isMultiselect); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
126 inputParameters.add(inputValue); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
127 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
128 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
129 |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
130 // parse export modes |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
131 List<ExportMode> exportList = null; |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
132 NodeList exports = (NodeList) XMLUtils.xpath( |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
133 currentNode, XPATH_EXPORTS, XPathConstants.NODESET); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
134 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
135 if (exports != null) { |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
136 int exportSize = exports.getLength(); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
137 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
138 exportList = new ArrayList<ExportMode>(exportSize); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
139 for (int k = 0; k < exportSize; k++) { |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
140 Element exp = (Element) exports.item(k); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
141 String expName = exp.getAttribute("name"); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
142 String expDesc = exp.getAttribute("description"); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
143 String expMime = exp.getAttribute("mime-type"); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
144 |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
145 exportList.add( |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
146 new DefaultExportMode(expName, expDesc, expMime)); |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
147 } |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
148 } |
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
149 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
150 OutputMode outputMode = new DefaultOutputMode(name, |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
151 description, mimeType, inputParameters, exportList); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
152 log.debug(outputMode.toString()); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
153 this.outputModes.add(outputMode); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
154 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
155 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
156 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
157 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
158 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
159 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
160 * @see de.intevation.gnv.state.StateBase#advance() |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
161 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
162 @Override |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
163 public void advance(String uuid, CallContext context) |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
164 throws StateException |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
165 { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
166 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
167 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
168 @Override |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
169 public void initialize(String uuid, CallContext context) |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
170 throws StateException |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
480
diff
changeset
|
171 { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
172 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
173 |
480
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
174 public void out( |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
175 Document format, |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
176 Collection<InputData> inputData, |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
177 OutputStream outputStream, |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
178 String uuid, |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
179 CallMeta callMeta |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
180 ) |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
181 throws StateException |
211cad2fb5ba
Rebased "Horizonalschnitte" to own state class to break from the not
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
439
diff
changeset
|
182 { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
183 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
184 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
185 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
186 * @see de.intevation.gnv.state.OutputState#out(java.lang.String, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
187 * java.util.Collection, java.io.OutputStream) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
188 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
189 public void out(String outputMode, Collection<InputData> inputData, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
190 OutputStream outputStream) throws StateException { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
191 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
192 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
193 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
194 * @return |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
195 */ |
439
8975de9d7483
Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
429
diff
changeset
|
196 protected Object getChartResult(String uuid, CallContext callContext) { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
197 log.debug("OutputStateBase.getChartResult"); |
631
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
198 CacheFactory factory = CacheFactory.getInstance(); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
199 |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
200 if (factory.isInitialized()) { |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
201 // we use a cache |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
202 log.info("Using cache."); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
203 Cache cache = factory.getCache(); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
204 String key = "chart_" + getHash(); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
205 |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
206 net.sf.ehcache.Element value = cache.get(key); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
207 if (value != null) { |
631
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
208 log.debug("Found element in cache."); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
209 return value.getObjectValue(); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
210 } |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
211 else { |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
212 log.debug("Element not in cache, we need to ask the database"); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
213 Object result = getData(queryID); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
214 cache.put(new net.sf.ehcache.Element(key, result)); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
215 |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
216 return result; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
217 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
218 } |
631
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
219 else { |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
220 // we don't use a cache, so we have to query the database every |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
221 // single time |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
222 log.info("Not using a cache."); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
223 return getData(queryID); |
f4331a0df032
Chart and histogram output are working without using a cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
626
diff
changeset
|
224 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
225 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
226 |
439
8975de9d7483
Loop through configuration to chart generation.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
429
diff
changeset
|
227 protected Object getChartFromCache(String uuid, CallContext callContext) { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
228 log.debug("Fetch chart [" + uuid + "] from cache"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
229 CacheFactory cacheFactory = CacheFactory.getInstance(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
230 if (cacheFactory.isInitialized()) { |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
231 String key = "chart_" + getHash(); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
232 net.sf.ehcache.Element object = cacheFactory.getCache().get(key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
233 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
234 if (object != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
235 return object.getObjectValue(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
236 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
237 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
238 return null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
239 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
240 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
241 protected Collection<Result> getODVResult(String uuid) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
242 log.debug("OutputStateBase.getODVResult"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
243 // TODO add Caching? I think it's not nessessary |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
244 Collection<Result> returnValue = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
245 if (this.queryODVID != null){ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
246 returnValue = this.getData(this.queryODVID); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
247 }else{ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
248 log.warn("No Query for ODV Data is defined."); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
249 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
250 return returnValue; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
251 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
252 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
253 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
254 * @param returnValue |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
255 * @return |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
256 */ |
616
93978859fa9e
Added the Configuration and the Classes for the new Product Layer.
Tim Englich <tim.englich@intevation.de>
parents:
610
diff
changeset
|
257 protected Collection<Result> getData(String queryID) { |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
258 log.debug("OutputStateBase.getData"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
259 Collection<Result> returnValue = null; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
260 try { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
261 String[] filterValues = this.generateFilterValuesFromInputData(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
262 try { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
263 QueryExecutor queryExecutor = QueryExecutorFactory |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
264 .getInstance() |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
265 .getQueryExecutor(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
266 returnValue = queryExecutor.executeQuery(queryID,filterValues); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
267 } catch (RuntimeException e) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
268 log.error(e, e); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
269 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
270 } catch (QueryException e) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
271 log.error(e, e); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
272 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
273 return returnValue; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
274 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
275 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
276 protected void removeChartResult(String uuid) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
277 log.debug("OutputStateBase.getChartResult"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
278 if (CacheFactory.getInstance().isInitialized()) { |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
279 String key = "chart_" + getHash(); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
280 log.debug("Hash for Queryelements: " + key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
281 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
282 if (value != null) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
283 CacheFactory.getInstance().getCache().remove(key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
284 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
285 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
286 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
287 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
288 protected void removeChart(String uuid) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
289 log.debug("OutputStateBase.removeChart from cache"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
290 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
291 CacheFactory cacheFactory = CacheFactory.getInstance(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
292 if (cacheFactory.isInitialized()) { |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
293 String key = "chart_" + getHash(); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
294 net.sf.ehcache.Element object = cacheFactory.getCache().get(key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
295 if (object != null) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
296 cacheFactory.getCache().remove(key); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
297 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
298 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
299 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
300 protected void purifyChart(Object chart, String uuid) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
301 log.debug("Prufify chart [" + uuid + "]"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
302 CacheFactory cacheFactory = CacheFactory.getInstance(); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
303 if (cacheFactory.isInitialized()) { |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
304 String key = "chart_" + getHash(); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
305 cacheFactory.getCache().put(new net.sf.ehcache.Element(key, chart)); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
306 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
307 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
308 |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
309 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
310 @Override |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
311 public void feed(Collection<InputData> inputData, String uuid) |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
312 throws StateException |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
313 { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
314 putInputData(inputData, uuid); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
315 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
316 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
317 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
318 * @see de.intevation.gnv.state.StateBase#putInputData(java.util.Collection, java.lang.String) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
319 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
320 @Override |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
321 public void putInputData(Collection<InputData> inputData, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
322 String uuid) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
323 throws StateException { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
324 log.debug("OutputStateBase.putInputData"); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
325 this.removeChartResult(uuid); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
326 this.removeChart(uuid); |
610
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
327 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
328 if (inputData != null) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
329 Iterator<InputData> it = inputData.iterator(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
330 InputValidator iv = new InputValidator(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
331 while (it.hasNext()) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
332 InputData tmpItem = it.next(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
333 Object tmpObj = tmpItem.getObject(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
334 InputValue inputValue = this.inputValues.get(tmpItem.getName()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
335 if (inputValue != null) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
336 if (this.inputData == null) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
337 this.inputData = new HashMap<String, InputData>( |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
338 inputData.size()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
339 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
340 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
341 boolean valid = iv.isInputValid(tmpItem.getValue(), |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
342 inputValue.getType()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
343 if (valid) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
344 if (tmpItem.getName().equals(MINVALUEFIELDNAME)){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
345 String minValue = tmpItem.getValue(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
346 String maxValue = getInputValue4ID(inputData, MAXVALUEFIELDNAME); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
347 valid = iv.isInputValid(maxValue,inputValue.getType()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
348 if (!valid){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
349 String errMsg = "Wrong input for " + tmpItem.getValue() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
350 + " is not an " + inputValue.getType() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
351 + " Value."; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
352 log.warn(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
353 throw new StateException(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
354 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
355 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
356 valid = iv.isInputValid(minValue, |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
357 maxValue, |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
358 inputValue.getType()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
359 if (!valid){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
360 String errMsg = "MaxValue-Input is less than MinValue-Input "; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
361 log.warn(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
362 throw new StateException(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
363 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
364 }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
365 String minValue = getInputValue4ID(inputData, MINVALUEFIELDNAME); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
366 String maxValue = tmpItem.getValue(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
367 valid = iv.isInputValid(minValue,inputValue.getType()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
368 if (!valid){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
369 String errMsg = "Wrong input for " + tmpItem.getValue() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
370 + " is not an " + inputValue.getType() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
371 + " Value."; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
372 log.warn(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
373 throw new StateException(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
374 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
375 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
376 valid = iv.isInputValid(minValue, |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
377 maxValue, |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
378 inputValue.getType()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
379 if (!valid){ |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
380 String errMsg = "MaxValue-Input is less than MinValue-Input "; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
381 log.warn(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
382 throw new StateException(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
383 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
384 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
385 this.inputData.put(tmpItem.getName(), tmpItem); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
386 } else { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
387 String errMsg = "Wrong input for " + tmpItem.getValue() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
388 + " is not an " + inputValue.getType() |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
389 + " Value."; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
390 log.warn(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
391 throw new StateException(errMsg); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
392 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
393 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
394 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
395 else if (tmpObj != null && tmpObj instanceof MinMaxDescribeData) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
396 MinMaxDescribeData data = (MinMaxDescribeData) tmpObj; |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
397 if (this.inputData == null) { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
398 this.inputData = new HashMap<String, InputData>(inputData.size()); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
399 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
400 this.inputData.put(tmpItem.getName(), tmpItem); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
401 this.inputData.put("minvalue", new DefaultInputData("minvalue", (String) data.getMinValue())); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
402 this.inputData.put("maxvalue", new DefaultInputData("maxvalue", (String) data.getMaxValue())); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
403 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
404 else { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
405 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
406 String errMsg = "No Inputvalue given for Inputdata " |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
407 + tmpItem.getName(); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
408 log.warn(errMsg + "Value will be ignored"); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
409 |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
410 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
411 } |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
412 } else { |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
413 log.warn("No Inputdata given"); |
6484464d2059
Changed the mechanism for searching for specific parameter collections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
414 } |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
415 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
416 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
417 public void out(String outputMode, Collection<InputData> inputData, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
418 OutputStream outputStream, String uuid, CallMeta callMeta) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
419 throws StateException { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
420 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
421 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
422 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
423 protected String getMessage(Locale locale, String key, String value) { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
424 return RessourceFactory.getInstance().getRessource( |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
425 locale, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
426 key, |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
427 value |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
428 ); |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
429 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
430 } |
626
61f688a69a55
Split up export modes from output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
616
diff
changeset
|
431 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |