changeset 1370:9085cffbb7c4

Made the URL of Artifact server available via ServletContext parameter. flys-client/trunk@3075 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 13:41:05 +0000
parents 1fae113b93fd
children 2582c06c3774
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputService.java flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputServiceAsync.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java flys-client/src/main/webapp/WEB-INF/web.xml
diffstat 6 files changed, 30 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/ChangeLog	Tue Oct 25 13:41:05 2011 +0000
@@ -1,3 +1,17 @@
+2011-10-25  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/webapp/WEB-INF/web.xml: Added a context parameter that might be
+	  used to determine the URL of the Artifact server.
+
+	* src/main/java/de/intevation/flys/client/client/services/MapOutputServiceAsync.java,
+	  src/main/java/de/intevation/flys/client/client/services/MapOutputService.java,
+	  src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java:
+	  Removed the URL parameter from doOut(). This parameter is fetched from
+	  ServletContext.
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java:
+	  Modified the call of MapOutputService.doOut().
+
 2011-10-25  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue 118/203
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputService.java	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputService.java	Tue Oct 25 13:41:05 2011 +0000
@@ -16,6 +16,6 @@
 @RemoteServiceRelativePath("map")
 public interface MapOutputService extends RemoteService {
 
-    void doOut(Collection collection, String serverUrl) throws ServerException;
+    void doOut(Collection collection) throws ServerException;
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputServiceAsync.java	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/services/MapOutputServiceAsync.java	Tue Oct 25 13:41:05 2011 +0000
@@ -10,9 +10,6 @@
  */
 public interface MapOutputServiceAsync {
 
-    public void doOut(
-        Collection collection,
-        String     serverUrl,
-        AsyncCallback<Void> callback);
+    public void doOut(Collection collection, AsyncCallback<Void> callback);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 25 13:41:05 2011 +0000
@@ -84,8 +84,7 @@
 
         floodMap = new FloodMap(getSrid(), getMaxExtent());
 
-        mapService.doOut(collection,  "http://localhost:8181",
-            new AsyncCallback<Void>() {
+        mapService.doOut(collection, new AsyncCallback<Void>() {
                 public void onFailure(Throwable caught) {
                     GWT.log("MAP ERROR: " + caught.getMessage());
                 }
--- a/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Tue Oct 25 13:41:05 2011 +0000
@@ -31,20 +31,19 @@
         Logger.getLogger(MapOutputServiceImpl.class);
 
 
-    public void doOut(Collection collection, String serverUrl)
+    public void doOut(Collection collection)
     throws ServerException
     {
-        String url = (String) getServletContext().getAttribute("server-url");
-
         logger.info("MapOutputServiceImpl.doOut");
 
+        String url  = getServletContext().getInitParameter("server-url");
         String uuid = collection.identifier();
 
         try {
             Document request = ClientProtocolUtils.newOutCollectionDocument(
                 uuid, "floodmap", "floodmap");
 
-            HttpClient client = new HttpClientImpl(serverUrl);
+            HttpClient client = new HttpClientImpl(url);
             InputStream    is = client.collectionOut(request, uuid, "floodmap");
 
             Document response = XMLUtils.parseDocument(is);
--- a/flys-client/src/main/webapp/WEB-INF/web.xml	Tue Oct 25 13:32:16 2011 +0000
+++ b/flys-client/src/main/webapp/WEB-INF/web.xml	Tue Oct 25 13:41:05 2011 +0000
@@ -4,6 +4,11 @@
     "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
+
+    <context-param>
+        <param-name>server-url</param-name>
+        <param-value>http://localhost:8181</param-value>
+    </context-param>
   
   <!-- Servlets -->
   <servlet>
@@ -184,16 +189,16 @@
     <servlet-class>de.intevation.flys.client.server.ChartOutputServiceImpl</servlet-class>
   </servlet>
 
+  <servlet>
+    <servlet-name>MapOutputService</servlet-name>
+    <servlet-class>de.intevation.flys.client.server.MapOutputServiceImpl</servlet-class>
+  </servlet>
+
   <servlet-mapping>
     <servlet-name>MapOutputService</servlet-name>
     <url-pattern>/flys/map</url-pattern>
   </servlet-mapping>
 
-  <servlet>
-    <servlet-name>MapOutputService</servlet-name>
-    <servlet-class>de.intevation.flys.client.server.MapOutputServiceImpl</servlet-class>
-  </servlet>
-
   <servlet-mapping>
     <servlet-name>ChartOutputService</servlet-name>
     <url-pattern>/flys/chart</url-pattern>

http://dive4elements.wald.intevation.org