Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java @ 958:ae198bef4ba0
Added configurations for river WMSe (currently for Saar, Mosel, Elbe).
flys-artifacts/trunk@2377 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 20 Jul 2011 15:06:16 +0000 |
parents | 32d0a543e3e8 |
children | ee105e5d5ead |
comparison
equal
deleted
inserted
replaced
957:e91996b46e3c | 958:ae198bef4ba0 |
---|---|
71 "/themes/theme"; | 71 "/themes/theme"; |
72 | 72 |
73 public static final String XPATH_THEME_MAPPINGS = | 73 public static final String XPATH_THEME_MAPPINGS = |
74 "/themes/mappings/mapping"; | 74 "/themes/mappings/mapping"; |
75 | 75 |
76 public static final String XPATH_RIVER_WMS = | |
77 "/artifact-database/floodmap/river-wms"; | |
78 | |
76 /** | 79 /** |
77 * Creates a new FLYSArtifactContext object and initialize all | 80 * Creates a new FLYSArtifactContext object and initialize all |
78 * components required by the application. | 81 * components required by the application. |
79 * | 82 * |
80 * @param config The artifact server configuration. | 83 * @param config The artifact server configuration. |
86 configureTransitions(config, context); | 89 configureTransitions(config, context); |
87 configureStates(config, context); | 90 configureStates(config, context); |
88 configureOutGenerators(config, context); | 91 configureOutGenerators(config, context); |
89 configureThemes(config, context); | 92 configureThemes(config, context); |
90 configureThemesMappings(config, context); | 93 configureThemesMappings(config, context); |
94 configureRiverWMS(config, context); | |
91 | 95 |
92 return context; | 96 return context; |
93 } | 97 } |
94 | 98 |
95 | 99 |
358 | 362 |
359 logger.debug("Found " + mapping.size() + " theme/facet mappings."); | 363 logger.debug("Found " + mapping.size() + " theme/facet mappings."); |
360 | 364 |
361 context.put(FLYSContext.THEME_MAPPING, mapping); | 365 context.put(FLYSContext.THEME_MAPPING, mapping); |
362 } | 366 } |
367 | |
368 | |
369 protected void configureRiverWMS(Document cfg, FLYSContext context) { | |
370 Map<String, String> riverWMS = new HashMap<String, String>(); | |
371 | |
372 NodeList rivers = (NodeList) XMLUtils.xpath( | |
373 cfg, XPATH_RIVER_WMS, XPathConstants.NODESET); | |
374 | |
375 int num = rivers != null ? rivers.getLength() : 0; | |
376 | |
377 for (int i = 0; i < num; i++) { | |
378 Element e = (Element) rivers.item(i); | |
379 | |
380 String river = e.getAttribute("river"); | |
381 String url = e.getAttribute("url"); | |
382 | |
383 if (river != null && url != null) { | |
384 riverWMS.put(river, url); | |
385 } | |
386 } | |
387 | |
388 logger.debug("Found " + riverWMS.size() + " river WMS."); | |
389 | |
390 context.put(FLYSContext.RIVER_WMS, riverWMS); | |
391 } | |
363 } | 392 } |
364 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 393 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |