comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.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 c8749d83d9b6
children b1f5f2a8840f
comparison
equal deleted inserted replaced
777:8009961db1cb 778:9a828e5a2390
49 /** 49 /**
50 * the logger, used to log exceptions and additonaly information 50 * the logger, used to log exceptions and additonaly information
51 */ 51 */
52 private static Logger log = Logger.getLogger(GNVArtifactContext.class); 52 private static Logger log = Logger.getLogger(GNVArtifactContext.class);
53 53
54 public static final String XPATH_GEOBACKEND_CONFIGURATION = 54 public static final String XPATH_GEOBACKEND_CONFIGURATION =
55 "artifact-database/geo-backend/backend-configuration"; 55 "artifact-database/geo-backend/backend-configuration";
56 56
57 public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION = 57 public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION =
58 "artifact-database/geo-backend/query-configuration"; 58 "artifact-database/geo-backend/query-configuration";
59 59
60 private final static String CACHECONFIGNODEPATH = 60 private final static String CACHECONFIGNODEPATH =
61 "/artifact-database/ehcache/configuration"; 61 "/artifact-database/ehcache/configuration";
62 62
63 private final static String CHARTCONFIGNODEPATH = 63 private final static String CHARTCONFIGNODEPATH =
64 "/artifact-database/gnv/charttemplate/configuration"; 64 "/artifact-database/gnv/charttemplate/configuration";
65 65
66 public final static String PALETTES_PATH = 66 public final static String PALETTES_PATH =
67 "/artifact-database/gnv/palettes"; 67 "/artifact-database/gnv/palettes";
68 68
75 public final static String HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION = 75 public final static String HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION =
76 "/artifact-database/gnv/horizontal-cross-section/ground/@interpolation"; 76 "/artifact-database/gnv/horizontal-cross-section/ground/@interpolation";
77 77
78 public final static String HORIZONTAL_CROSS_SECTION_SAMPLES = 78 public final static String HORIZONTAL_CROSS_SECTION_SAMPLES =
79 "/artifact-database/gnv/horizontal-cross-section/samples/@number"; 79 "/artifact-database/gnv/horizontal-cross-section/samples/@number";
80 80
81 public final static String HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS = 81 public final static String HORIZONTAL_CROSS_SECTION_EXTRAPOLATION_ROUNDS =
82 "/artifact-database/gnv/horizontal-cross-section/extrapolation/@rounds"; 82 "/artifact-database/gnv/horizontal-cross-section/extrapolation/@rounds";
83 83
84 public final static String HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH = 84 public final static String HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH =
85 "/artifact-database/gnv/shapefile-directory/@path"; 85 "/artifact-database/gnv/shapefile-directory/@path";
86 86
87 public final static String VERTICAL_CROSS_SECTION_SAMPLES = 87 public final static String VERTICAL_CROSS_SECTION_SAMPLES =
88 "/artifact-database/gnv/vertical-cross-section/samples"; 88 "/artifact-database/gnv/vertical-cross-section/samples";
89 89
90 public final static String VERTICAL_CROSS_SECTION_FILTERS = 90 public final static String VERTICAL_CROSS_SECTION_FILTERS =
91 "/artifact-database/gnv/vertical-cross-section/filters/filter"; 91 "/artifact-database/gnv/vertical-cross-section/filters/filter";
230 log.info("configuration of vertical cross section ground interpolation"); 230 log.info("configuration of vertical cross section ground interpolation");
231 String interpolation = Config.getStringXPath( 231 String interpolation = Config.getStringXPath(
232 config, 232 config,
233 VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION); 233 VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION);
234 234
235 if (interpolation == null 235 if (interpolation == null
236 || (interpolation = interpolation.trim()).length() == 0) { 236 || (interpolation = interpolation.trim()).length() == 0) {
237 interpolation = GNVArtifactContext 237 interpolation = GNVArtifactContext
238 .DEFAULT_VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION; 238 .DEFAULT_VERTICAL_CROSS_SECTION_GROUND_INTERPOLATION;
239 } 239 }
240 240
331 catch (NumberFormatException nfe) { 331 catch (NumberFormatException nfe) {
332 log.error("invalid value for height: '" + heightString + "'"); 332 log.error("invalid value for height: '" + heightString + "'");
333 } 333 }
334 } 334 }
335 } 335 }
336 log.info("samples (width x height): " + 336 log.info("samples (width x height): " +
337 sampleSize.width + " x " + sampleSize.height); 337 sampleSize.width + " x " + sampleSize.height);
338 338
339 context.put( 339 context.put(
340 GNVArtifactContext.VERTICAL_CROSS_SECTION_SAMPLES_KEY, 340 GNVArtifactContext.VERTICAL_CROSS_SECTION_SAMPLES_KEY,
341 sampleSize); 341 sampleSize);
372 372
373 context.put( 373 context.put(
374 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY, 374 GNVArtifactContext.HORIZONTAL_CROSS_SECTION_PROFILE_SAMPLES_KEY,
375 samples); 375 samples);
376 } 376 }
377 377
378 protected void configureHorizontalCrossSection( 378 protected void configureHorizontalCrossSection(
379 Document config, 379 Document config,
380 GNVArtifactContext context 380 GNVArtifactContext context
381 ) { 381 ) {
382 log.info("configuration of horizontal cross section"); 382 log.info("configuration of horizontal cross section");
433 433
434 String interpolation = Config.getStringXPath( 434 String interpolation = Config.getStringXPath(
435 config, 435 config,
436 HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION); 436 HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION);
437 437
438 if (interpolation == null 438 if (interpolation == null
439 || (interpolation = interpolation.trim()).length() == 0) { 439 || (interpolation = interpolation.trim()).length() == 0) {
440 interpolation = GNVArtifactContext 440 interpolation = GNVArtifactContext
441 .DEFAULT_HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION; 441 .DEFAULT_HORIZONTAL_CROSS_SECTION_GROUND_INTERPOLATION;
442 } 442 }
443 443
455 ) 455 )
456 { 456 {
457 log.info( 457 log.info(
458 "configuration of horizontal cross section result shape file path"); 458 "configuration of horizontal cross section result shape file path");
459 459
460 File dir = 460 File dir =
461 GNVArtifactContext. 461 GNVArtifactContext.
462 DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SHAPEFILE_PATH; 462 DEFAULT_HORIZONTAL_CROSS_SECTION_PROFILE_SHAPEFILE_PATH;
463 463
464 String path = Config.getStringXPath( 464 String path = Config.getStringXPath(
465 config, 465 config,
470 } 470 }
471 else { 471 else {
472 log.warn("No 'result-shapefile-directory' given"); 472 log.warn("No 'result-shapefile-directory' given");
473 } 473 }
474 474
475 log.info("writing shape files to '" 475 log.info("writing shape files to '"
476 + dir.getAbsolutePath() + "'"); 476 + dir.getAbsolutePath() + "'");
477 477
478 context.put( 478 context.put(
479 GNVArtifactContext 479 GNVArtifactContext
480 .HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH_KEY, 480 .HORIZONTAL_CROSS_SECTION_RESULT_SHAPEFILE_PATH_KEY,
573 } 573 }
574 else if (filename == null 574 else if (filename == null
575 || (filename = filename.trim()).length() == 0) { 575 || (filename = filename.trim()).length() == 0) {
576 log.error("Palette '" + name + "' has no 'file' attribute."); 576 log.error("Palette '" + name + "' has no 'file' attribute.");
577 } 577 }
578 else if (parameterIds == null 578 else if (parameterIds == null
579 || (parameterIds = parameterIds.trim()).length() == 0) { 579 || (parameterIds = parameterIds.trim()).length() == 0) {
580 log.error("no parameter ids given for '" + name + "'"); 580 log.error("no parameter ids given for '" + name + "'");
581 } 581 }
582 else { 582 else {
583 ArrayList<Integer> ids = new ArrayList<Integer>(); 583 ArrayList<Integer> ids = new ArrayList<Integer>();

http://dive4elements.wald.intevation.org