[mapguide-commits] r6786 - branches/2.4/MgDev/Web/src/mapviewerjava

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jun 18 07:40:53 PDT 2012


Author: jng
Date: 2012-06-18 07:40:52 -0700 (Mon, 18 Jun 2012)
New Revision: 6786

Modified:
   branches/2.4/MgDev/Web/src/mapviewerjava/mainframe.jsp
   branches/2.4/MgDev/Web/src/mapviewerjava/taskframe.jsp
Log:
#1684: Pass MAPNAME to the task pane frame. This ensures that on initial load and on the click of the home button the frame will always at a minimum have the parameters of: SESSION, MAPNAME and LOCALE. This fix is for the Java viewer.

Modified: branches/2.4/MgDev/Web/src/mapviewerjava/mainframe.jsp
===================================================================
--- branches/2.4/MgDev/Web/src/mapviewerjava/mainframe.jsp	2012-06-18 14:39:52 UTC (rev 6785)
+++ branches/2.4/MgDev/Web/src/mapviewerjava/mainframe.jsp	2012-06-18 14:40:52 UTC (rev 6786)
@@ -34,6 +34,7 @@
 String username = "";
 String password = "";
 String locale = "";
+String mapName = "";
 int curFlyout = 0;
 Hashtable cmds = new Hashtable();
 %>
@@ -127,6 +128,14 @@
     }
 
     String mapDefinitionUrl = URLEncoder.encode(mapDef, "UTF-8");
+    // NOTE:
+    //
+    // We don't open a MgMap because it is being created by mapframe.jsp that is also probably running
+    // as this script is running. However the naming convention is fixed enough that we can figure out
+    // what to pass to the Task Pane
+    MgResourceIdentifier resId = new MgResourceIdentifier(mapDef);
+    mapName = resId.GetName();
+    
     String title = webLayout.GetTitle();
 
     boolean showLegend = infoPane.IsLegendBandVisible();
@@ -149,7 +158,7 @@
     //
     String srcToolbar = showToolbar ? ( "src=\"" + vpath + "toolbar.jsp?LOCALE=" + locale + "\"" ) : "";
     String srcStatusbar = showStatusbar ? ( "src=\"" + vpath + "statusbar.jsp?LOCALE=" + locale + "\"" ) : "";
-    String srcTaskFrame = showTaskPane? ("src=\"" + vpath + "taskframe.jsp?WEBLAYOUT=" + URLEncoder.encode(webLayoutDefinition, "UTF-8") + "&DWF=" + (forDwf!=0? "1": "0") + "&SESSION=" + (sessionId != ""? sessionId: "") + "&LOCALE=" + locale + "\"") : "";
+    String srcTaskFrame = showTaskPane? ("src=\"" + vpath + "taskframe.jsp?MAPNAME=" + mapName + "&WEBLAYOUT=" + URLEncoder.encode(webLayoutDefinition, "UTF-8") + "&DWF=" + (forDwf!=0? "1": "0") + "&SESSION=" + (sessionId != ""? sessionId: "") + "&LOCALE=" + locale + "\"") : "";
     String srcTaskBar = "src=\"" + vpath + "taskbar.jsp?LOCALE=" + locale + "\"";
 
     //view center

Modified: branches/2.4/MgDev/Web/src/mapviewerjava/taskframe.jsp
===================================================================
--- branches/2.4/MgDev/Web/src/mapviewerjava/taskframe.jsp	2012-06-18 14:39:52 UTC (rev 6785)
+++ branches/2.4/MgDev/Web/src/mapviewerjava/taskframe.jsp	2012-06-18 14:40:52 UTC (rev 6786)
@@ -29,6 +29,7 @@
 String webLayoutId = "";
 int dwf = 0;
 String locale = "";
+String mapName = "";
 %>
 
 <%
@@ -69,13 +70,13 @@
             String query = url.substring(index+1);
 
             if(query.length() > 0)
-                url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", path, sessionId, URLEncoder.encode(webLayoutId, "UTF-8"), dwf, locale, query);
+                url = String.format("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s&%s", path, sessionId, mapName, URLEncoder.encode(webLayoutId, "UTF-8"), dwf, locale, query);
             else
-                url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", path, sessionId, URLEncoder.encode(webLayoutId, "UTF-8"), dwf, locale);
+                url = String.format("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", path, sessionId, mapName, URLEncoder.encode(webLayoutId, "UTF-8"), dwf, locale);
         }
         else
         {
-            url = String.format("%s?SESSION=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", taskPaneUrl, sessionId, URLEncoder.encode(webLayoutId), dwf, locale);
+            url = String.format("%s?SESSION=%s&MAPNAME=%s&WEBLAYOUT=%s&DWF=%s&LOCALE=%s", taskPaneUrl, sessionId, mapName, URLEncoder.encode(webLayoutId), dwf, locale);
         }
         String templ = LoadTemplate("/viewerfiles/taskframe.templ");
         String[] vals = { vpath + "tasklist.jsp",
@@ -103,6 +104,7 @@
     locale = ValidateLocaleString(GetParameter(request, "LOCALE"));
     webLayoutId = ValidateResourceId(GetParameter(request, "WEBLAYOUT"));
     dwf = GetIntParameter(request, "DWF");
+    mapName = ValidateMapName(GetParameter(request, "MAPNAME"));
 }
 
 void OnError(String title, String msg, PrintWriter outStream, HttpServletRequest request) throws FileNotFoundException, IOException



More information about the mapguide-commits mailing list