comparison gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 173:1b2fc94766c9

Added real Coordinate-Query to TimeSeries-Mesh gnv-artifacts/trunk@212 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 13 Oct 2009 09:11:23 +0000
parents 7fb9441dd8af
children baaa1618fa27
comparison
equal deleted inserted replaced
172:b5e55f460f0b 173:1b2fc94766c9
333 requestValue = this 333 requestValue = this
334 .prepareInputData4DBQuery(requestValue); 334 .prepareInputData4DBQuery(requestValue);
335 } else if (type.equalsIgnoreCase("date")) { 335 } else if (type.equalsIgnoreCase("date")) {
336 requestValue = this 336 requestValue = this
337 .prepareInputData4DateDBQuery(requestValue); 337 .prepareInputData4DateDBQuery(requestValue);
338 } else if (type.equalsIgnoreCase("coordinate")){
339 requestValue = this
340 .prepareInputData4RegionDBQuery(requestValue);
338 } 341 }
339 for (int j = 0; j < size; j++) { 342 for (int j = 0; j < size; j++) {
340 list.add(requestValue); 343 list.add(requestValue);
341 } 344 }
342 } 345 }
357 } catch (QueryException e) { 360 } catch (QueryException e) {
358 log.error(e, e); 361 log.error(e, e);
359 throw new TransitionException(e); 362 throw new TransitionException(e);
360 } 363 }
361 } 364 }
365
366 protected String prepareInputData4RegionDBQuery(String value){
367 return value;
368 }
362 369
363 private String prepareInputData4DateDBQuery(String value) { 370 private String prepareInputData4DateDBQuery(String value) {
364 log.debug("TransitionBase.prepareInputData4DateDBQuery"); 371 log.debug("TransitionBase.prepareInputData4DateDBQuery");
365 if (value != null) { 372 if (value != null) {
366 String[] values = value.split(","); 373 String[] values = value.split(",");
403 protected void purifyResult(Collection<Result> result, String uuid) { 410 protected void purifyResult(Collection<Result> result, String uuid) {
404 log.debug("TransitionBase.purifyResult"); 411 log.debug("TransitionBase.purifyResult");
405 if (this.descibeData == null) { 412 if (this.descibeData == null) {
406 this.descibeData = new ArrayList<Object>(); 413 this.descibeData = new ArrayList<Object>();
407 } 414 }
415 NamedCollection<KeyValueDescibeData> keyValueDescibeData = extractKVP(result, "KEY", "VALUE");
416 this.descibeData.add(keyValueDescibeData);
417 }
418
419 /**
420 * @param result
421 * @return
422 */
423 protected NamedCollection<KeyValueDescibeData> extractKVP(
424 Collection<Result> result,
425 String keyid,
426 String valueid) {
408 Iterator<Result> rit = result.iterator(); 427 Iterator<Result> rit = result.iterator();
409 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>( 428 NamedCollection<KeyValueDescibeData> keyValueDescibeData = new NamedArrayList<KeyValueDescibeData>(
410 this.dataName, result.size()); 429 this.dataName, result.size());
411 keyValueDescibeData.setMultiSelect(this.dataMultiSelect); 430 keyValueDescibeData.setMultiSelect(this.dataMultiSelect);
412 while (rit.hasNext()) { 431 while (rit.hasNext()) {
413 Result resultValue = rit.next(); 432 Result resultValue = rit.next();
414 keyValueDescibeData.add(new DefaultKeyValueDescribeData(resultValue 433 keyValueDescibeData.add(new DefaultKeyValueDescribeData(resultValue
415 .getString("KEY"), resultValue.getString("VALUE"))); 434 .getString(keyid), resultValue.getString(valueid)));
416 } 435 }
417 this.descibeData.add(keyValueDescibeData); 436 return keyValueDescibeData;
418 } 437 }
419 438
420 /** 439 /**
421 * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document, 440 * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document,
422 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta) 441 * org.w3c.dom.Node, de.intevation.artifacts.CallMeta)

http://dive4elements.wald.intevation.org