Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/context/FLYSContextFactory.java @ 5152:b26465581abf
Add a configurable path prefix to relative DGM path to allways have an absolute path.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 01 Mar 2013 10:35:38 +0100 |
parents | 442fbb290fa8 |
children |
comparison
equal
deleted
inserted
replaced
5151:240ff7aeb6de | 5152:b26465581abf |
---|---|
81 | 81 |
82 public static final String XPATH_MODULES = "/artifact-database/modules/module"; | 82 public static final String XPATH_MODULES = "/artifact-database/modules/module"; |
83 | 83 |
84 private static final String XPATH_ZOOM_SCALES = "/artifact-database/options/zoom-scales/zoom-scale"; | 84 private static final String XPATH_ZOOM_SCALES = "/artifact-database/options/zoom-scales/zoom-scale"; |
85 | 85 |
86 private static final String XPATH_DGM_PATH = "/artifact-database/options/dgm-path/text()"; | |
87 | |
88 | |
86 /** | 89 /** |
87 * Creates a new FLYSArtifactContext object and initialize all | 90 * Creates a new FLYSArtifactContext object and initialize all |
88 * components required by the application. | 91 * components required by the application. |
89 * | 92 * |
90 * @param config The artifact server configuration. | 93 * @param config The artifact server configuration. |
100 configureThemes(config, context); | 103 configureThemes(config, context); |
101 configureThemesMappings(config, context); | 104 configureThemesMappings(config, context); |
102 configureFloodmapWMS(config, context); | 105 configureFloodmapWMS(config, context); |
103 configureModules(config, context); | 106 configureModules(config, context); |
104 configureZoomScales(config, context); | 107 configureZoomScales(config, context); |
108 configureDGMPath(config, context); | |
105 | 109 |
106 return context; | 110 return context; |
111 } | |
112 | |
113 | |
114 private void configureDGMPath(Document config, FLYSContext context) { | |
115 String dgmPath = (String) XMLUtils.xpath( | |
116 config, | |
117 XPATH_DGM_PATH, | |
118 XPathConstants.STRING); | |
119 | |
120 context.put("dgm-path", dgmPath); | |
107 } | 121 } |
108 | 122 |
109 | 123 |
110 protected void configureZoomScales(Document config, FLYSContext context) { | 124 protected void configureZoomScales(Document config, FLYSContext context) { |
111 NodeList list = (NodeList)XMLUtils.xpath( | 125 NodeList list = (NodeList)XMLUtils.xpath( |