Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java @ 9757:d536a2184ddf 3.2.x
Put WMS services config in line with other config files
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 12 Oct 2022 15:42:04 +0200 |
parents | 0a5239a1e46e |
children |
comparison
equal
deleted
inserted
replaced
9756:a14836131b23 | 9757:d536a2184ddf |
---|---|
6 * documentation coming with Dive4Elements River for details. | 6 * documentation coming with Dive4Elements River for details. |
7 */ | 7 */ |
8 | 8 |
9 package org.dive4elements.river.client.server; | 9 package org.dive4elements.river.client.server; |
10 | 10 |
11 import java.io.InputStream; | 11 import java.io.File; |
12 | 12 |
13 import java.util.Map; | 13 import java.util.Map; |
14 import java.util.HashMap; | 14 import java.util.HashMap; |
15 | 15 |
16 import org.w3c.dom.Document; | 16 import org.w3c.dom.Document; |
41 throws ServerException | 41 throws ServerException |
42 { | 42 { |
43 log.info("MapUrlServiceImpl.getUrls"); | 43 log.info("MapUrlServiceImpl.getUrls"); |
44 Map<String, String> urls = new HashMap<String, String>(); | 44 Map<String, String> urls = new HashMap<String, String>(); |
45 | 45 |
46 InputStream in = getServletContext().getResourceAsStream( | 46 File file = new File( |
47 "/WEB-INF/wms-services.xml"); | 47 getServletContext().getInitParameter("wms-services-file")); |
48 | 48 |
49 Document doc = XMLUtils.parseDocument(in); | 49 Document doc = XMLUtils.parseDocument(file); |
50 | 50 |
51 NodeList list = doc.getElementsByTagName("wms"); | 51 NodeList list = doc.getElementsByTagName("wms"); |
52 for (int i = 0; i < list.getLength(); i++) { | 52 for (int i = 0; i < list.getLength(); i++) { |
53 Element e = (Element) list.item(i); | 53 Element e = (Element) list.item(i); |
54 urls.put(e.getAttribute("url"), e.getAttribute("name")); | 54 urls.put(e.getAttribute("url"), e.getAttribute("name")); |