diff flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java @ 1376:28eb4dfe2cbf

Call Collection.doOut to retrieve a map config and use this config to build up an OpenLayers map. flys-client/trunk@3096 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 28 Oct 2011 06:12:51 +0000
parents 9085cffbb7c4
children f7b3d5833f3b
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Wed Oct 26 12:33:48 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java	Fri Oct 28 06:12:51 2011 +0000
@@ -18,6 +18,7 @@
 
 import de.intevation.flys.client.shared.exceptions.ServerException;
 import de.intevation.flys.client.shared.model.Collection;
+import de.intevation.flys.client.shared.model.MapConfig;
 
 import de.intevation.flys.client.client.services.MapOutputService;
 
@@ -31,7 +32,10 @@
         Logger.getLogger(MapOutputServiceImpl.class);
 
 
-    public void doOut(Collection collection)
+    public static final String ERROR_NO_MAP_CONFIG = "error_no_map_config";
+
+
+    public MapConfig doOut(Collection collection)
     throws ServerException
     {
         logger.info("MapOutputServiceImpl.doOut");
@@ -48,9 +52,7 @@
 
             Document response = XMLUtils.parseDocument(is);
 
-            logger.debug(XMLUtils.toString(response));
-
-            // TODO parse response document and return a MapConfig object
+            return MapHelper.parseConfig(response);
         }
         catch (ConnectionException e) {
             logger.error(e, e);
@@ -58,6 +60,8 @@
         catch (IOException ioe) {
             logger.error(ioe, ioe);
         }
+
+        throw new ServerException(ERROR_NO_MAP_CONFIG);
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org