changeset 982:cd9414538f10

Added possibility to switch to FullScreen-Mode of the MapClient. gnv/trunk@1161 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 07 Jun 2010 09:54:47 +0000
parents 10bee74ab915
children 45ea5feb94c0
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/config/struts-config.xml gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp gnv/src/main/webapp/scripts/viewport.jsp
diffstat 11 files changed, 171 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/ChangeLog	Mon Jun 07 09:54:47 2010 +0000
@@ -1,3 +1,36 @@
+2010-06-07  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/webapp/WEB-INF/config/struts-config.xml: 
+	  Added the Action "mapclient" for switching to the FullScreen-Mode of the 
+	  MapClient.
+
+	* src/main/webapp/scripts/viewport.jsp: 
+	  Integrated the Viewport to render tne Mapclient in FullScreen-Mode.
+
+	* src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java : 
+	  Added Action for handling the businesslogic to switch the Mapclient to the 
+	  FullScreen-Mode.
+
+	* src/main/resources/applicationMessages.properties,
+	  src/main/resources/applicationMessages_en.properties:
+	  Added i18n for the Link-labeling for switching to the FullScreen-Mode.
+	
+	* src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp: 
+	  Added JSP-Page wich will be used to render the gui for the 
+	  FullScreen-Mode of the Mapclient.
+
+	* src/main/webapp/WEB-INF/jsp/wmslayout.jsp,
+	  src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: 
+	  Extracted header for the html-page whcih will contain the mapclient so
+	  that it could be used in several pages.
+
+	* src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: 
+	  Added JSP-Fragment which contains the gui for the FullScreen-Mode of the
+	  Mapclient.
+
+	* src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: 
+	  Added link for switching to the fullscreenmode 
+
 2010-06-04  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/resources/applicationMessages.properties: 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java	Mon Jun 07 09:54:47 2010 +0000
@@ -0,0 +1,38 @@
+/**
+ *
+ */
+package de.intevation.gnv.action;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+/**
+ * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
+ *
+ */
+public class MapClientStandaloneAction extends ArtifactDatabaseActionBase {
+
+    public final static String MAPCLIENTSTANDALONE_KEY = 
+                          "de.intevation.gnv.action.MapClientStandaloneAction";
+    /**
+     * Constructor
+     */
+    public MapClientStandaloneAction() {
+        super();
+    }
+
+    @Override
+    public ActionForward execute(ActionMapping mapping, ActionForm form,
+                                 HttpServletRequest request,
+                                 HttpServletResponse response) throws Exception {
+        
+        request.setAttribute(MAPCLIENTSTANDALONE_KEY, true);
+        return super.execute(mapping, form, request, response);
+    }
+    
+
+}
--- a/gnv/src/main/resources/applicationMessages.properties	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages.properties	Mon Jun 07 09:54:47 2010 +0000
@@ -129,7 +129,7 @@
 
 
 # the map client
-
+gnvview.mapclient.fullscreen = Vollbild
 gnviewer.mapclient.layercontrol = Layerkontrolle
 gnviewer.mapclient.layercontrol.baselayer = Hintergrundlayer
 gnviewer.mapclient.layercontrol.overlay = Generierte Layer
--- a/gnv/src/main/resources/applicationMessages_en.properties	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages_en.properties	Mon Jun 07 09:54:47 2010 +0000
@@ -127,7 +127,7 @@
 
 
 # the map client
-
+gnvview.mapclient.fullscreen = Full screen
 gnviewer.mapclient.layercontrol = Layercontrol
 gnviewer.mapclient.layercontrol.baselayer = Baselayer
 gnviewer.mapclient.layercontrol.overlay = Overlay
--- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml	Mon Jun 07 09:54:47 2010 +0000
@@ -156,6 +156,15 @@
                 name="selectfis"
                 path="/gnv/selectFis.do"/>
         </action>
+                <action path="/mapclient" 
+                type="de.intevation.gnv.action.MapClientStandaloneAction"
+                scope="request"
+                validate="false">
+            <forward
+                name="success"
+                path="/WEB-INF/jsp/wmsstandalone.jsp"/>
+        </action>
+        
         <action path="/export" 
                 type="de.intevation.gnv.action.DoExportAction"
                 scope="request"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -0,0 +1,11 @@
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
+<div id="title">
+    <h1 class="headline">BSH Generischer Viewer</h1>
+</div>
+<div id="cap" style="height: 100%; width: 100%; overflow: auto">
+    <div id="remoteinput">
+        <div id="urlinput" style="width: 96%"><!-- Just a Comment --></div>
+        <div id="urlbutton"><!-- Just a Comment --></div>
+    </div>
+    <div id="capgrid"><!-- Just a Comment --></div>
+</div>
\ No newline at end of file
--- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -1,3 +1,8 @@
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
+<div>
+  <a target="blank" href="<%=response.encodeURL("mapclient.do?uid="+System.currentTimeMillis())%>"><bean:message key="gnvview.mapclient.fullscreen"/></a>
+</div>
+<br/>
 <div id="cap" style="height: 100%; width: 100%; overflow: auto">
     <div id="remoteinput">
         <div id="urlinput" style="width: 96%"><!-- Just a Comment --></div>
@@ -5,4 +10,4 @@
     </div>
     <div id="capgrid"><!-- Just a Comment --></div>
 </div>
-<div id="mapcontainer" style="width: 400px; height: 400px"><!-- Just a Comment --></div>
\ No newline at end of file
+<div id="mapcontainer" style="width: 100%; height: 100%"><!-- Just a Comment --></div>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -0,0 +1,39 @@
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
+<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%>
+<%
+boolean standalone = request.getAttribute(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null;
+%>
+    
+<head>
+        <title>
+            <bean:message key="gnviewer.app.title"/>
+        </title>
+        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
+        <meta http-equiv="Content-Script-Type" content="text/javascript"/>
+        <meta http-equiv="Content-Style-Type" content="text/css"/>
+        <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/>
+        <meta http-equiv="pragma" content="no-cache"/>
+        <meta http-equiv="cache-control" content="no-cache"/>
+        <meta name="robots" content="noindex"/>
+        
+        <link rel="stylesheet" type="text/css" href="scripts/ext/ext-2.3.0/resources/css/ext-all.css"></link>
+        <link rel="stylesheet" type="text/css" href="scripts/geoext/geoext-0.6/resources/css/geoext-all.css"></link>
+        <link rel="stylesheet" type="text/css" href="scripts/openlayers/OpenLayers-2.9/theme/default/style.css"></link>
+        <link rel="stylesheet" type="text/css" href="styles/gnv.css"/>
+        <link rel="stylesheet" type="text/css" href="styles/ol_style.css"/>
+        
+        <script type="text/javascript" src="scripts/ext/ext-2.3.0/adapter/ext/ext-base.js"></script>
+        <script type="text/javascript" src="scripts/ext/ext-2.3.0/ext-all.js"></script>
+        <script type="text/javascript" src="scripts/openlayers/OpenLayers-2.9/OpenLayers.js"></script>
+        <script type="text/javascript" src="scripts/geoext/geoext-0.6/script/GeoExt.js"></script>
+        <script type="text/javascript" src="scripts/olutils.js"></script>
+        <script type="text/javascript" src="<%=response.encodeURL("scripts/layers.jsp?uid="+System.currentTimeMillis())%>"></script>
+        <script type="text/javascript" src="<%=response.encodeURL("scripts/viewport.jsp?uid="+System.currentTimeMillis()+"&"+MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY+"="+standalone)%>"></script>
+         
+         <!-- save necessary variables here -->
+         <script type="text/javascript">
+             var options, layer, extent, map, mapPanel, infoControls;
+             var controls,layers, mouseLoc, grid;
+             var infoActive = false;
+         </script>
+    </head>
\ No newline at end of file
--- a/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -3,48 +3,8 @@
 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>
 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
-<%
-    String serverPath  = (String) request.getAttribute("mapserver");
-    String mapfilePath = (String) request.getAttribute("mapfile");
-    String layerName   = (String) request.getAttribute("layer");
-    String timeToLive  = (String) request.getAttribute("ttl");
-    SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request);
-%>
 <html xmlns="http://www.w3.org/1999/xhtml">
-    <head>
-        <title>
-            <bean:message key="gnviewer.app.title"/>
-        </title>
-        <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-        <meta http-equiv="Content-Script-Type" content="text/javascript"/>
-        <meta http-equiv="Content-Style-Type" content="text/css"/>
-        <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/>
-        <meta http-equiv="pragma" content="no-cache"/>
-        <meta http-equiv="cache-control" content="no-cache"/>
-        <meta name="robots" content="noindex"/>
-        
-        <link rel="stylesheet" type="text/css" href="scripts/ext/ext-2.3.0/resources/css/ext-all.css"></link>
-        <link rel="stylesheet" type="text/css" href="scripts/geoext/geoext-0.6/resources/css/geoext-all.css"></link>
-        <link rel="stylesheet" type="text/css" href="scripts/openlayers/OpenLayers-2.9/theme/default/style.css"></link>
-        <link rel="stylesheet" type="text/css" href="styles/gnv.css"/>
-        <link rel="stylesheet" type="text/css" href="styles/ol_style.css"/>
-        
-        <script type="text/javascript" src="scripts/ext/ext-2.3.0/adapter/ext/ext-base.js"></script>
-        <script type="text/javascript" src="scripts/ext/ext-2.3.0/ext-all.js"></script>
-        <script type="text/javascript" src="scripts/openlayers/OpenLayers-2.9/OpenLayers.js"></script>
-        <script type="text/javascript" src="scripts/geoext/geoext-0.6/script/GeoExt.js"></script>
-        <script type="text/javascript" src="scripts/olutils.js"></script>
-        <script type="text/javascript" src="<%=response.encodeURL("scripts/layers.jsp?uid="+System.currentTimeMillis())%>"></script>
-        <script type="text/javascript" src="<%=response.encodeURL("scripts/viewport.jsp?uid="+System.currentTimeMillis())%>"></script>
-         
-         <!-- save necessary variables here -->
-         <script type="text/javascript">
-             var options, layer, extent, map, mapPanel, infoControls;
-             var controls,layers, mouseLoc, grid;
-             var infoActive = false;
-         </script>
-    </head>
-
+    <jsp:include page="/WEB-INF/jsp/includes/wms_header_inc.jsp" />
     <body id="gnviewerbody">
     <div id="overlay"></div>
     <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute;visibility:hidden;">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -0,0 +1,6 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <jsp:include page="/WEB-INF/jsp/includes/wms_header_inc.jsp" />
+    <body id="gnviewerbody">
+        <jsp:include page="/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp" />
+    </body>
+</html>
\ No newline at end of file
--- a/gnv/src/main/webapp/scripts/viewport.jsp	Fri Jun 04 12:03:12 2010 +0000
+++ b/gnv/src/main/webapp/scripts/viewport.jsp	Mon Jun 07 09:54:47 2010 +0000
@@ -1,5 +1,10 @@
 <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%>
+<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%>
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
+<%
+boolean standalone = request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null &&
+request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY).equals("true");
+%>
 OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url=";
 OpenLayers.Lang.setCode('<%=SessionModelFactory.getInstance().getSessionModel(request).getCurrentLocale().getLanguage() %>');
 Ext.BLANK_IMAGE_URL = "scripts/openlayers/OpenLayers-2.9/theme/default/img/blank.gif";
@@ -10,7 +15,6 @@
  * settings inline the code!
  */
 PROJECTION     = "EPSG:4326";
-PROJECTIONS    = [PROJECTION, 'EPSG:4326'] // Projection used in projection selector
 MAX_EXTENT     = new OpenLayers.Bounds(-17.44,29.41,40.04,77.66);
 INITIAL_CENTER = new OpenLayers.LonLat(5, 55);
 
@@ -143,8 +147,9 @@
         title: '<bean:message key="gnviewer.mapclient.wms.load.title"/>',
         collapsible: false,
         split: false,
-        contentEl: 'cap',
-        height: 400
+        height: 400,
+        contentEl: 'cap'
+        
     });
 
     var capfield = new Ext.form.TextField({
@@ -208,7 +213,7 @@
 
 /*-------------------------------- Feature grid -------------------------------*/
 
-    // create legend panel
+    // create legend paneclass="headerLineLinksl
     legendPanel = new GeoExt.LegendPanel({
         id: 'legendpanel',
         dynamic: true,
@@ -253,7 +258,7 @@
             ]
         }
         );
-    
+    <%if (!standalone){%>
     // The main panel
     new Ext.Panel({
         renderTo: "mapcontainer",
@@ -261,5 +266,20 @@
         height: 400,
         items: [mapPanel, mylegend]
     });
-
+    <%}else{ %>
+    // Create GUI
+    new Ext.Viewport({
+        layout: "border",
+        items: [
+          {
+            region: "north",
+            contentEl: "title",
+            cls: 'title',
+            height: 40
+          },
+          mylegend,
+          mapPanel
+        ]
+    });
+    <%}%>
 });

http://dive4elements.wald.intevation.org