Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java @ 3239:fb11bd37ddb8
Improved the structure of themes.xml; moved theme groups to own XML files.
flys-artifacts/trunk@4871 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 04 Jul 2012 06:35:47 +0000 |
parents | faf73245ec73 |
children | 17ca0a43027a |
comparison
equal
deleted
inserted
replaced
3238:112c3f0fc075 | 3239:fb11bd37ddb8 |
---|---|
291 int groupNum = themeGroups != null ? themeGroups.getLength() : 0; | 291 int groupNum = themeGroups != null ? themeGroups.getLength() : 0; |
292 | 292 |
293 if (groupNum == 0) { | 293 if (groupNum == 0) { |
294 logger.warn("There are no theme groups configured!"); | 294 logger.warn("There are no theme groups configured!"); |
295 } | 295 } |
296 | |
297 logger.info("Found " + groupNum + " theme groups in configuration"); | |
296 | 298 |
297 List<ThemeGroup> groups = new ArrayList<ThemeGroup>(); | 299 List<ThemeGroup> groups = new ArrayList<ThemeGroup>(); |
298 | 300 |
299 for (int g = 0; g < groupNum; g++) { | 301 for (int g = 0; g < groupNum; g++) { |
300 Element themeGroup = (Element) themeGroups.item(g); | 302 Element themeGroup = (Element) themeGroups.item(g); |
306 if (num == 0) { | 308 if (num == 0) { |
307 logger.warn("There are no themes configured!"); | 309 logger.warn("There are no themes configured!"); |
308 return; | 310 return; |
309 } | 311 } |
310 | 312 |
311 logger.debug("Found " + num + " configured theme groups."); | 313 logger.info("Theme group has " + num + " themes."); |
312 | 314 |
313 Map<String, Theme> theThemes = new HashMap<String, Theme>(); | 315 Map<String, Theme> theThemes = new HashMap<String, Theme>(); |
314 | 316 |
315 for (int i = 0; i < num; i++) { | 317 for (int i = 0; i < num; i++) { |
316 Node theme = themes.item(i); | 318 Node theme = themes.item(i); |
321 theThemes.put(theTheme.getName(), theTheme); | 323 theThemes.put(theTheme.getName(), theTheme); |
322 } | 324 } |
323 } | 325 } |
324 String gName = themeGroup.getAttribute("name"); | 326 String gName = themeGroup.getAttribute("name"); |
325 groups.add(new ThemeGroup(gName, theThemes)); | 327 groups.add(new ThemeGroup(gName, theThemes)); |
326 logger.debug("Initialized " + theThemes.size() + "/" + num + " themes"); | 328 |
329 logger.info( | |
330 "Initialized " + theThemes.size() + "/" + num + " themes " + | |
331 "of theme-group '" + gName + "'"); | |
327 } | 332 } |
328 context.put(FLYSContext.THEMES, groups); | 333 context.put(FLYSContext.THEMES, groups); |
329 } | 334 } |
330 | 335 |
331 /** | 336 /** |