[mapguide-commits] r6785 - branches/2.4/MgDev/Web/src/mapviewernet

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jun 18 07:39:55 PDT 2012


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

Modified:
   branches/2.4/MgDev/Web/src/mapviewernet/mainframe.aspx
   branches/2.4/MgDev/Web/src/mapviewernet/taskframe.aspx
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 .net viewer.

Modified: branches/2.4/MgDev/Web/src/mapviewernet/mainframe.aspx
===================================================================
--- branches/2.4/MgDev/Web/src/mapviewernet/mainframe.aspx	2012-06-18 13:31:48 UTC (rev 6784)
+++ branches/2.4/MgDev/Web/src/mapviewernet/mainframe.aspx	2012-06-18 14:39:52 UTC (rev 6785)
@@ -33,6 +33,7 @@
 String username = "";
 String password = "";
 String locale = "";
+String mapName = "";
 int curFlyout = 0;
 NameValueCollection cmds = null;
 </script>
@@ -126,6 +127,14 @@
             defHome = true;
         }
         String mapDefinitionUrl = HttpUtility.UrlEncode(mapDef);
+        // NOTE:
+        //
+        // We don't open a MgMap because it is being created by mapframe.aspx 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();
 
         bool showLegend = infoPane.IsLegendBandVisible();
@@ -152,7 +161,7 @@
         //
         String srcToolbar = showToolbar ? ("src=\"" + vpath + "toolbar.aspx?LOCALE=" + locale + "\"") : "";
         String srcStatusbar = showStatusbar ? ("src=\"" + vpath + "statusbar.aspx?LOCALE=" + locale + "\"") : "";
-        String srcTaskFrame = showTaskPane ? ("src=\"" + vpath + "taskframe.aspx?WEBLAYOUT=" + HttpUtility.UrlEncode(webLayoutDefinition) + "&DWF=" + (forDwf != 0 ? "1" : "0") + "&SESSION=" + (sessionId != "" ? sessionId : "") + "&LOCALE=" + locale + "\"") : "";
+        String srcTaskFrame = showTaskPane ? ("src=\"" + vpath + "taskframe.aspx?MAPNAME=" + mapName + "&WEBLAYOUT=" + HttpUtility.UrlEncode(webLayoutDefinition) + "&DWF=" + (forDwf != 0 ? "1" : "0") + "&SESSION=" + (sessionId != "" ? sessionId : "") + "&LOCALE=" + locale + "\"") : "";
         String srcTaskBar = "src=\"" + vpath + "taskbar.aspx?LOCALE=" + locale + "\"";
 
         //view center

Modified: branches/2.4/MgDev/Web/src/mapviewernet/taskframe.aspx
===================================================================
--- branches/2.4/MgDev/Web/src/mapviewernet/taskframe.aspx	2012-06-18 13:31:48 UTC (rev 6784)
+++ branches/2.4/MgDev/Web/src/mapviewernet/taskframe.aspx	2012-06-18 14:39:52 UTC (rev 6785)
@@ -28,6 +28,7 @@
 String webLayoutId = "";
 int dwf = 0;
 String locale = "";
+String mapName = "";
 </script>
 
 <%
@@ -69,14 +70,14 @@
             String query = url.Substring(index+1);
 
             if(query.Length > 0)
-                url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}&{5}", path, sessionId, HttpUtility.UrlEncode(webLayoutId), dwf, locale, query);
+                url = String.Format("{0}?SESSION={1}&MAPNAME={2}&WEBLAYOUT={3}&DWF={4}&LOCALE={5}&{6}", path, sessionId, mapName, HttpUtility.UrlEncode(webLayoutId), dwf, locale, query);
             else
-                url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}", path, sessionId, HttpUtility.UrlEncode(webLayoutId), dwf, locale);
+                url = String.Format("{0}?SESSION={1}&MAPNAME={2}&WEBLAYOUT={3}&DWF={4}&LOCALE={5}", path, sessionId, mapName, HttpUtility.UrlEncode(webLayoutId), dwf, locale);
 
         }
         else
         {
-            url = String.Format("{0}?SESSION={1}&WEBLAYOUT={2}&DWF={3}&LOCALE={4}", taskPaneUrl, sessionId, HttpUtility.UrlEncode(webLayoutId), dwf, locale);
+            url = String.Format("{0}?SESSION={1}&MAPNAME={2}&WEBLAYOUT={3}&DWF={4}&LOCALE={5}", taskPaneUrl, sessionId, mapName, HttpUtility.UrlEncode(webLayoutId), dwf, locale);
         }
         String templ = LoadTemplate(Request, "../viewerfiles/taskframe.templ");
         String[] vals = {
@@ -113,6 +114,7 @@
     sessionId = ValidateSessionId(GetParameter(parameters, "SESSION"));
     locale = ValidateLocaleString(GetParameter(parameters, "LOCALE"));
     webLayoutId = ValidateResourceId(GetParameter(parameters, "WEBLAYOUT"));
+    mapName = ValidateMapName(GetParameter(parameters, "MAPNAME"));
     dwf = GetIntParameter(parameters, "DWF");
 }
 



More information about the mapguide-commits mailing list