Mercurial > dive4elements > river
comparison flys-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java @ 5834:f507086aa94b
Repaired internal references.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:31:32 +0200 |
parents | flys-client/src/main/java/de/intevation/flys/client/server/MapUrlServiceImpl.java@8d27d2d33d70 |
children | 821a02bbfb4e |
comparison
equal
deleted
inserted
replaced
5833:a2bdc0f524e8 | 5834:f507086aa94b |
---|---|
1 package de.intevation.flys.client.server; | |
2 | |
3 import java.io.InputStream; | |
4 | |
5 import java.util.Map; | |
6 import java.util.HashMap; | |
7 | |
8 import org.w3c.dom.Document; | |
9 import org.w3c.dom.NodeList; | |
10 import org.w3c.dom.Element; | |
11 | |
12 import org.apache.log4j.Logger; | |
13 | |
14 import com.google.gwt.user.server.rpc.RemoteServiceServlet; | |
15 | |
16 import de.intevation.artifacts.common.utils.XMLUtils; | |
17 | |
18 import de.intevation.flys.client.shared.exceptions.ServerException; | |
19 import de.intevation.flys.client.client.services.MapUrlService; | |
20 | |
21 | |
22 public class MapUrlServiceImpl | |
23 extends RemoteServiceServlet | |
24 implements MapUrlService | |
25 { | |
26 | |
27 private static final Logger logger = | |
28 Logger.getLogger(MapUrlServiceImpl.class); | |
29 | |
30 | |
31 public Map<String, String> getUrls() | |
32 throws ServerException | |
33 { | |
34 logger.info("MapUrlServiceImpl.getUrls"); | |
35 Map<String, String> urls = new HashMap<String, String>(); | |
36 | |
37 InputStream in = getServletContext().getResourceAsStream("/WEB-INF/wms-services.xml"); | |
38 | |
39 Document doc = XMLUtils.parseDocument(in); | |
40 | |
41 NodeList list = doc.getElementsByTagName("wms"); | |
42 for (int i = 0; i < list.getLength(); i++) { | |
43 Element e = (Element) list.item(i); | |
44 urls.put(e.getAttribute("url"), e.getAttribute("name")); | |
45 } | |
46 | |
47 return urls; | |
48 } | |
49 } | |
50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |