# HG changeset patch # User Raimund Renkert # Date 1326292126 0 # Node ID f7b3d5833f3b4900397bdccfd95afc7b8ec10afc # Parent 8c911c935b58dabf3966f3dbd8fa1ae3006fe107 Updated the MapOutputService to be able to request the new output type 'map'. flys-client/trunk@3652 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/ChangeLog --- a/flys-client/ChangeLog Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/ChangeLog Wed Jan 11 14:28:46 2012 +0000 @@ -1,3 +1,14 @@ +2012-01-11 Raimund Renkert + + * src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java: + Find the output mode in collection to request the correct map. + + * src/main/java/de/intevation/flys/client/client/FLYSConstants.java, + src/main/java/de/intevation/flys/client/client/FLYSConstants.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties, + src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties: + Added i18n string for error message. + 2012-01-11 Raimund Renkert Issue 435. diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java Wed Jan 11 14:28:46 2012 +0000 @@ -476,6 +476,8 @@ String error_no_map_config(); + String error_no_map_output_type(); + String warning_use_first_feature(); String error_no_valid_gfi_url(); diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties Wed Jan 11 14:28:46 2012 +0000 @@ -248,6 +248,7 @@ error_no_theme_styles_found=No style for the selected theme found. error_no_feature_selected = No object selected. error_no_map_config = No Map configuration found. +error_no_map_output_type = No Map output found. warning_use_first_feature = You have more that one object selected. The first one is used. error_no_valid_gfi_url = No valid GetFeatureInfo response found. error_gfi_req_failed = GetFeatureInfo request failed. diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties Wed Jan 11 14:28:46 2012 +0000 @@ -248,6 +248,7 @@ error_no_theme_styles_found=Es konnten keine Stile f\u00fcr das gew\u00e4hlte Thema gefunden werden. error_no_feature_selected = Kein Objekt ausgew\u00e4hlt. error_no_map_config = Es konnte keine Kartenkonfiguration gefunden werden. +error_no_map_output_type = Es konnte kein Ausgabemodus f\u00fcr Karten gefunden werden. warning_use_first_feature = Sie haben mehr als ein Objekt ausgew\u00e4hlt. Das erste Objekt wird benutzt. error_no_valid_gfi_url = Ung\u00fcltige GetFeatureInfo URL. error_gfi_req_failed = Die GetFeatureInfo Anfrage ist fehlgeschlagen. diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties --- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties Wed Jan 11 14:28:46 2012 +0000 @@ -248,6 +248,7 @@ error_no_theme_styles_found=No style for the selected theme found. error_no_feature_selected = No object selected. error_no_map_config = No Map configuration found. +error_no_map_output_type = No Map output found. warning_use_first_feature = You have more that one object selected. The first one is used. error_no_valid_gfi_url = No valid GetFeatureInfo response found. error_gfi_req_failed = GetFeatureInfo request failed. diff -r 8c911c935b58 -r f7b3d5833f3b flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java Wed Jan 11 11:20:36 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/MapOutputServiceImpl.java Wed Jan 11 14:28:46 2012 +0000 @@ -3,6 +3,8 @@ import java.io.InputStream; import java.io.IOException; +import java.util.Map; + import org.w3c.dom.Document; import org.apache.log4j.Logger; @@ -19,7 +21,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.shared.model.OutputMode; import de.intevation.flys.client.client.services.MapOutputService; @@ -34,6 +36,7 @@ public static final String ERROR_NO_MAP_CONFIG = "error_no_map_config"; + public static final String ERROR_NO_MAP_OUTPUT_TYPE = "error_no_map_output_type"; public MapConfig doOut(Collection collection) throws ServerException @@ -43,12 +46,24 @@ String url = getServletContext().getInitParameter("server-url"); String uuid = collection.identifier(); + Map modes = collection.getOutputModes(); + String requestMode = ""; + if (modes.containsKey("floodmap")) { + requestMode = "floodmap"; + } + else if (modes.containsKey("map")) { + requestMode = "map"; + } + else { + throw new ServerException(ERROR_NO_MAP_OUTPUT_TYPE); + } + try { Document request = ClientProtocolUtils.newOutCollectionDocument( - uuid, "floodmap", "floodmap"); + uuid, requestMode, requestMode); HttpClient client = new HttpClientImpl(url); - InputStream is = client.collectionOut(request, uuid, "floodmap"); + InputStream is = client.collectionOut(request, uuid, requestMode); Document response = XMLUtils.parseDocument(is);