changeset 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 a14836131b23
children 0a2e1e604f43
files gwt-client/config/wms-services.xml gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java gwt-client/src/main/webapp/WEB-INF/web.xml gwt-client/src/main/webapp/WEB-INF/wms-services.xml
diffstat 4 files changed, 14 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/config/wms-services.xml	Wed Oct 12 15:42:04 2022 +0200
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wms-services>
+  <wms name="OSM Hintergrundkarte" url="https://kartenwerkstatt.intevation.de/bfg/service?"/>
+  <wms name="Pegelonline" url="https://www.pegelonline.wsv.de/webservices/gis/wms/aktuell?"/>
+</wms-services>
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java	Wed Oct 12 15:24:10 2022 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/MapUrlServiceImpl.java	Wed Oct 12 15:42:04 2022 +0200
@@ -8,7 +8,7 @@
 
 package org.dive4elements.river.client.server;
 
-import java.io.InputStream;
+import java.io.File;
 
 import java.util.Map;
 import java.util.HashMap;
@@ -43,10 +43,10 @@
         log.info("MapUrlServiceImpl.getUrls");
         Map<String, String> urls = new HashMap<String, String>();
 
-        InputStream in = getServletContext().getResourceAsStream(
-            "/WEB-INF/wms-services.xml");
+        File file = new File(
+            getServletContext().getInitParameter("wms-services-file"));
 
-        Document doc = XMLUtils.parseDocument(in);
+        Document doc = XMLUtils.parseDocument(file);
 
         NodeList list = doc.getElementsByTagName("wms");
         for (int i = 0; i < list.getLength(); i++) {
--- a/gwt-client/src/main/webapp/WEB-INF/web.xml	Wed Oct 12 15:24:10 2022 +0200
+++ b/gwt-client/src/main/webapp/WEB-INF/web.xml	Wed Oct 12 15:42:04 2022 +0200
@@ -64,6 +64,11 @@
         <param-value>/opt/d4e/river/gwt-client/config/features.xml</param-value>
     </context-param>
 
+    <context-param>
+        <param-name>wms-services-file</param-name>
+        <param-value>/opt/d4e/river/gwt-client/config/wms-services.xml</param-value>
+    </context-param>
+
     <listener>
         <listener-class>org.dive4elements.river.client.server.BaseServletContextListener</listener-class>
     </listener>
--- a/gwt-client/src/main/webapp/WEB-INF/wms-services.xml	Wed Oct 12 15:24:10 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<wms-services>
-  <wms name="OSM Hintergrundkarte" url="https://kartenwerkstatt.intevation.de/bfg/service?"/>
-  <wms name="Pegelonline" url="https://www.pegelonline.wsv.de/webservices/gis/wms/aktuell?"/>
-</wms-services>

http://dive4elements.wald.intevation.org