changeset 676:707e142e7d44

Improved ExceptionHandling during WMS-Publishing. gnv/trunk@807 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 19 Mar 2010 13:15:59 +0000
parents 0d23f7ba53dd
children 8315b0a40329
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/WMSAction.java gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java
diffstat 4 files changed, 21 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Mar 19 12:42:08 2010 +0000
+++ b/gnv/ChangeLog	Fri Mar 19 13:15:59 2010 +0000
@@ -1,3 +1,13 @@
+2010-03-19  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (publishWMS),
+	  src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (publishWMS),
+	  src/main/java/de/intevation/gnv/action/WMSAction.java (execute): 
+	  Improved ExceptionHandling during WMS-Publishing.
+	  The responsedocument will be scanned for Exceptionreports.
+	  Also if no URL, Mapfile or Layer was retrieved from the Responsedocument 
+	  the Exceptionpage will be visualized instead an corrupt Openlayersclient.
+
 2010-03-19  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/resources/applicationMessages.properties: 
--- a/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java	Fri Mar 19 12:42:08 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java	Fri Mar 19 13:15:59 2010 +0000
@@ -11,7 +11,6 @@
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
-
 import org.w3c.dom.Document;
 
 import de.intevation.gnv.action.sessionmodel.DiagrammOptions;
@@ -121,8 +120,13 @@
             request.setAttribute("mapserver", mapserverPath);
             request.setAttribute("mapfile", mapfilePath);
             request.setAttribute("layer", layer);
-
-            return super.execute(mapping, form, request, response);
+            if (mapserverPath != null && 
+                mapfilePath != null   &&
+                layer != null){
+                return super.execute(mapping, form, request, response);
+            }else{
+                return super.getExceptionForward(mapping);
+            }
         }
         catch (Exception e) {
             logger.error(e, e);
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Fri Mar 19 12:42:08 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Fri Mar 19 13:15:59 2010 +0000
@@ -131,7 +131,7 @@
         ArtifactObject             factory,
         ArtifactObject             artifact,
         Collection<InputParameter> inputParameter
-    );
+    )throws ArtifactDatabaseClientException, ArtifactDatabaseInputException;
 
 
     /**
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java	Fri Mar 19 12:42:08 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java	Fri Mar 19 13:15:59 2010 +0000
@@ -837,7 +837,7 @@
         ArtifactObject             factory,
         ArtifactObject             artifact,
         Collection<InputParameter> inputParameter
-    ) {
+    ) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException{
         log.debug("Start wms publishing...");
 
         String target     = "wms";
@@ -847,12 +847,12 @@
         try {
             InputStream input = doPostRequest(requestURL, request);
             Document result   = XMLUtils.readDocument(input);
-
+            this.check4ExceptionReport(result);
             return result;
         }
         catch (IOException ioe) {
             log.error(ioe, ioe);
-            return null;
+            throw new ArtifactDatabaseClientException(ioe);
         }
     }
 

http://dive4elements.wald.intevation.org