changeset 566:5aea89b9a350

Modified the GUI that the Form with the MapViewer-Interface-Request-Body only will be shown using an explicit Action-Call. gnv/trunk@681 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Fri, 12 Feb 2010 09:55:59 +0000
parents 8355d7cacd09
children 83ff52574604
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/jsp/header.jsp
diffstat 4 files changed, 76 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Feb 12 09:29:54 2010 +0000
+++ b/gnv/ChangeLog	Fri Feb 12 09:55:59 2010 +0000
@@ -1,3 +1,20 @@
+2010-02-12  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/webapp/WEB-INF/config/struts-config.xml: 
+	  Added new Action for Calling the Page with the Form for simmulating 
+	  the MapViewer-Interface-request.
+	  Using the URL
+	  http://localhost:8080/gnv/mvcall.do
+	  you will retrieve the Formular with the MapViewer-Interface-Request-body
+
+	* src/main/webapp/WEB-INF/jsp/header.jsp: 
+	  Added an Switch that will manage that the GUI with the Form of the
+	  MapViewer-Interface-Document only will be displaied if it is requested.
+
+	* src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java (execute):
+	  Added new Action for handling the Request that should show the Form 
+	  for insterting the MapViewer-Interface-Document.
+
 2010-02-12  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java	Fri Feb 12 09:55:59 2010 +0000
@@ -0,0 +1,46 @@
+/**
+ *
+ */
+package de.intevation.gnv.action.mapviewer;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import de.intevation.gnv.action.ArtifactDatabaseActionBase;
+
+/**
+ * @author Tim Englich <tim.englich@intevation.de>
+ *
+ */
+public class ShowMapViewerCallBodyAction extends ArtifactDatabaseActionBase {
+
+    /**
+     * the logger, used to log exceptions and additionally information
+     */
+    private static Logger log = Logger
+            .getLogger(ShowMapViewerCallBodyAction.class);
+    
+    /**
+     * Constructor
+     */
+    public ShowMapViewerCallBodyAction() {
+        super();
+    }
+
+    @Override
+    public ActionForward execute(ActionMapping mapping, ActionForm form,
+                                 HttpServletRequest request,
+                                 HttpServletResponse response) throws Exception {
+        log.debug("ShowMapViewerCallBodyAction.execute");
+        request.setAttribute("MAPVIEWERCALL", new Boolean(true));
+        return super.execute(mapping, form, request, response);
+    }
+    
+    
+
+}
--- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Feb 12 09:29:54 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Feb 12 09:55:59 2010 +0000
@@ -25,6 +25,14 @@
                 name="success"
                 path="/WEB-INF/jsp/mainlayout.jsp"/>
         </action>
+        <action path="/mvcall" 
+                type="de.intevation.gnv.action.mapviewer.ShowMapViewerCallBodyAction"
+                scope="request"
+                validate="false">
+           <forward
+                name="success"
+                path="/WEB-INF/jsp/mainlayout.jsp"/>
+        </action>
         <action path="/start" 
                 type="de.intevation.gnv.action.FetchArtifactFactoriesAction"
                 scope="request"
--- a/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Fri Feb 12 09:29:54 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Fri Feb 12 09:55:59 2010 +0000
@@ -8,6 +8,8 @@
     exceptionMessage = (exceptionMessage != null ? exceptionMessage.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null);
     exceptionMessage = (exceptionMessage != null && exceptionMessage.toString().endsWith(".") ? exceptionMessage.toString().substring(0,exceptionMessage.toString().length()-1) : exceptionMessage);
     
+    boolean showmapviewercallBody = request.getAttribute("MAPVIEWERCALL") != null;
+    
 %>
 <%@page import="de.intevation.gnv.action.CommunicationKeys"%><html:xhtml />
 <!-- Kopfleiste-->
@@ -32,7 +34,9 @@
             
         </div>
         <br/>
-        <jsp:include page="includes/display_mapviewercall_inc.jsp" />
+         <%if (showmapviewercallBody){ %>
+            <jsp:include page="includes/display_mapviewercall_inc.jsp" />
+        <%}%>
     </div>
     <div class="errormsg" id="load_error">
          <%if (exceptionMessage != null){ %>

http://dive4elements.wald.intevation.org