comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java @ 778:9a828e5a2390

Removed trailing whitespace gnv-artifacts/trunk@851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 29 Mar 2010 07:58:51 +0000
parents dde7f51dbe1e
children b1f5f2a8840f
comparison
equal deleted inserted replaced
777:8009961db1cb 778:9a828e5a2390
17 import org.w3c.dom.Element; 17 import org.w3c.dom.Element;
18 import org.w3c.dom.Node; 18 import org.w3c.dom.Node;
19 import org.w3c.dom.NodeList; 19 import org.w3c.dom.NodeList;
20 20
21 import de.intevation.artifactdatabase.Config; 21 import de.intevation.artifactdatabase.Config;
22 import de.intevation.artifactdatabase.XMLUtils; 22 import de.intevation.artifactdatabase.XMLUtils;
23 import de.intevation.artifacts.CallContext; 23 import de.intevation.artifacts.CallContext;
24 import de.intevation.artifacts.CallMeta; 24 import de.intevation.artifacts.CallMeta;
25 import de.intevation.gnv.artifacts.cache.CacheFactory; 25 import de.intevation.gnv.artifacts.cache.CacheFactory;
26 import de.intevation.gnv.artifacts.ressource.RessourceFactory; 26 import de.intevation.gnv.artifacts.ressource.RessourceFactory;
27 import de.intevation.gnv.geobackend.base.Result; 27 import de.intevation.gnv.geobackend.base.Result;
33 import de.intevation.gnv.utils.InputValidator; 33 import de.intevation.gnv.utils.InputValidator;
34 34
35 /** 35 /**
36 * @author Tim Englich (tim.englich@intevation.de) 36 * @author Tim Englich (tim.englich@intevation.de)
37 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) 37 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de)
38 * 38 *
39 */ 39 */
40 public abstract class OutputStateBase 40 public abstract class OutputStateBase
41 extends StateBase 41 extends StateBase
42 implements OutputState 42 implements OutputState
43 { 43 {
44 public static final String XPATH_OUTPUT_MODE = 44 public static final String XPATH_OUTPUT_MODE =
45 "/art:action/art:out/@name"; 45 "/art:action/art:out/@name";
46 46
65 65
66 /** 66 /**
67 * The different Outputmodes which are provided by an OutputState 67 * The different Outputmodes which are provided by an OutputState
68 */ 68 */
69 protected Collection<OutputMode> outputModes = null; 69 protected Collection<OutputMode> outputModes = null;
70 70
71 protected String queryODVID = null; 71 protected String queryODVID = null;
72 72
73 /** 73 /**
74 * Constructor 74 * Constructor
75 */ 75 */
90 */ 90 */
91 @Override 91 @Override
92 public void setup(Node configuration) { 92 public void setup(Node configuration) {
93 log.debug("OutputStateBase.setup"); 93 log.debug("OutputStateBase.setup");
94 super.setup(configuration); 94 super.setup(configuration);
95 95
96 this.queryODVID = Config.getStringXPath(configuration,"queryID-odv"); 96 this.queryODVID = Config.getStringXPath(configuration,"queryID-odv");
97 97
98 NodeList outputModeList = Config.getNodeSetXPath(configuration, 98 NodeList outputModeList = Config.getNodeSetXPath(configuration,
99 "outputsModes/outputsMode"); 99 "outputsModes/outputsMode");
100 if (outputModeList != null) { 100 if (outputModeList != null) {
101 log.debug(outputModeList.getLength() + " were found."); 101 log.debug(outputModeList.getLength() + " were found.");
102 this.outputModes = new ArrayList<OutputMode>(outputModeList 102 this.outputModes = new ArrayList<OutputMode>(outputModeList
168 throws StateException 168 throws StateException
169 { 169 {
170 } 170 }
171 171
172 public void out( 172 public void out(
173 Document format, 173 Document format,
174 Collection<InputData> inputData, 174 Collection<InputData> inputData,
175 OutputStream outputStream, 175 OutputStream outputStream,
176 String uuid, 176 String uuid,
177 CallMeta callMeta 177 CallMeta callMeta
178 ) 178 )
179 throws StateException 179 throws StateException
180 { 180 {
181 } 181 }
182 182
183 /** 183 /**
184 * @see de.intevation.gnv.state.OutputState#out(java.lang.String, 184 * @see de.intevation.gnv.state.OutputState#out(java.lang.String,
233 return object.getObjectValue(); 233 return object.getObjectValue();
234 } 234 }
235 } 235 }
236 return null; 236 return null;
237 } 237 }
238 238
239 protected Collection<Result> getODVResult(String uuid) { 239 protected Collection<Result> getODVResult(String uuid) {
240 log.debug("OutputStateBase.getODVResult"); 240 log.debug("OutputStateBase.getODVResult");
241 // TODO add Caching? I think it's not nessessary 241 // TODO add Caching? I think it's not nessessary
242 Collection<Result> returnValue = null; 242 Collection<Result> returnValue = null;
243 if (this.queryODVID != null){ 243 if (this.queryODVID != null){
268 } catch (QueryException e) { 268 } catch (QueryException e) {
269 log.error(e, e); 269 log.error(e, e);
270 } 270 }
271 return returnValue; 271 return returnValue;
272 } 272 }
273 273
274 protected void removeChartResult(String uuid) { 274 protected void removeChartResult(String uuid) {
275 log.debug("OutputStateBase.getChartResult"); 275 log.debug("OutputStateBase.getChartResult");
276 if (CacheFactory.getInstance().isInitialized()) { 276 if (CacheFactory.getInstance().isInitialized()) {
277 String key = "chart_" + getHash(); 277 String key = "chart_" + getHash();
278 log.debug("Hash for Queryelements: " + key); 278 log.debug("Hash for Queryelements: " + key);
319 319
320 /** 320 /**
321 * @see de.intevation.gnv.state.StateBase#putInputData(java.util.Collection, java.lang.String) 321 * @see de.intevation.gnv.state.StateBase#putInputData(java.util.Collection, java.lang.String)
322 */ 322 */
323 @Override 323 @Override
324 public void putInputData(Collection<InputData> inputData, 324 public void putInputData(Collection<InputData> inputData,
325 String uuid) 325 String uuid)
326 throws StateException { 326 throws StateException {
327 log.debug("OutputStateBase.putInputData"); 327 log.debug("OutputStateBase.putInputData");
328 this.removeChartResult(uuid); 328 this.removeChartResult(uuid);
329 this.removeChart(uuid); 329 this.removeChart(uuid);
392 + " Value."; 392 + " Value.";
393 log.warn(errMsg); 393 log.warn(errMsg);
394 throw new StateException(errMsg); 394 throw new StateException(errMsg);
395 } 395 }
396 396
397 } 397 }
398 else if (tmpObj != null && tmpObj instanceof MinMaxDescribeData) { 398 else if (tmpObj != null && tmpObj instanceof MinMaxDescribeData) {
399 MinMaxDescribeData data = (MinMaxDescribeData) tmpObj; 399 MinMaxDescribeData data = (MinMaxDescribeData) tmpObj;
400 if (this.inputData == null) { 400 if (this.inputData == null) {
401 this.inputData = new HashMap<String, InputData>(inputData.size()); 401 this.inputData = new HashMap<String, InputData>(inputData.size());
402 } 402 }
403 this.inputData.put(tmpItem.getName(), tmpItem); 403 this.inputData.put(tmpItem.getName(), tmpItem);
404 this.inputData.put("minvalue", new DefaultInputData("minvalue", (String) data.getMinValue())); 404 this.inputData.put("minvalue", new DefaultInputData("minvalue", (String) data.getMinValue()));
405 this.inputData.put("maxvalue", new DefaultInputData("maxvalue", (String) data.getMaxValue())); 405 this.inputData.put("maxvalue", new DefaultInputData("maxvalue", (String) data.getMaxValue()));
406 } 406 }
407 else { 407 else {
408 408
409 String errMsg = "No Inputvalue given for Inputdata " 409 String errMsg = "No Inputvalue given for Inputdata "
410 + tmpItem.getName(); 410 + tmpItem.getName();
411 log.warn(errMsg + "Value will be ignored"); 411 log.warn(errMsg + "Value will be ignored");
412 412
413 } 413 }

http://dive4elements.wald.intevation.org