changeset 677:8315b0a40329

Improved ExceptionHandling during WMS-Publishing. gnv/trunk@812 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 22 Mar 2010 09:49:48 +0000
parents 707e142e7d44
children 2943f69e006f
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/WMSAction.java gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp
diffstat 3 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Mar 19 13:15:59 2010 +0000
+++ b/gnv/ChangeLog	Mon Mar 22 09:49:48 2010 +0000
@@ -1,3 +1,10 @@
+2010-03-22  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/webapp/WEB-INF/jsp/wmslayout.jsp,
+	  src/main/java/de/intevation/gnv/action/WMSAction.java (execute): 
+	  Improved ExceptionHandling during WMS-Publishing.
+	  Now the OL-GUI will only be shown if the WMS was published succsessfull.
+
 2010-03-19  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (publishWMS),
--- a/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java	Fri Mar 19 13:15:59 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java	Mon Mar 22 09:49:48 2010 +0000
@@ -123,6 +123,7 @@
             if (mapserverPath != null && 
                 mapfilePath != null   &&
                 layer != null){
+                request.setAttribute("wms_published", Boolean.TRUE);
                 return super.execute(mapping, form, request, response);
             }else{
                 return super.getExceptionForward(mapping);
--- a/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Fri Mar 19 13:15:59 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Mon Mar 22 09:49:48 2010 +0000
@@ -29,6 +29,7 @@
             var map, layer;
 
             function init() {
+                <%if(request.getAttribute("wms_published") != null){ %>
                 map        = new OpenLayers.Map('map');
                 var server = '<%=serverPath%>?MAP=<%=mapfilePath%>';
                 layer      = new OpenLayers.Layer.WMS(
@@ -45,6 +46,7 @@
 
                 map.addLayer(layer);
                 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
+                <%}%>
             }
         </script>
     </head>
@@ -62,7 +64,7 @@
         <jsp:include page="header.jsp" />
          <jsp:include page="index.jsp" />
         <jsp:include page="footer.jsp" />
-
+        <%if(request.getAttribute("wms_published") != null){ %>
         <div class="outerMap">
             <div id="wms">
                 <table>
@@ -78,6 +80,7 @@
             </div>
             <div id="map"></div>
         </div>
+        <%}%>
     </div>
     </body>
 </html>

http://dive4elements.wald.intevation.org