[mapguide-commits] r6195 - trunk/MgDev/Web/src/mapadmin

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Nov 1 02:00:40 EDT 2011


Author: liuar
Date: 2011-10-31 23:00:40 -0700 (Mon, 31 Oct 2011)
New Revision: 6195

Modified:
   trunk/MgDev/Web/src/mapadmin/performanceReport.php
   trunk/MgDev/Web/src/mapadmin/performanceReport_GetResult.php
   trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php
   trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php
Log:
On behalf of Ted Yang.
fix the ticket 1768: http://trac.osgeo.org/mapguide/ticket/1768
	
The submission is mainly fixed some UI defects:
1. When session is timeout, the whole performance report page should redirect to the login page, not part of the page
2. Some map needs a long time to execute the profiling map API, so we need to set the time limit longer for 15 minutes
3. The column headers of the layers info table should be correct when the content is longer than the column width
4. In IE9 quirks mode, the background div is display in the top, not cover the whole page, so change the position mode as "absolute"



Modified: trunk/MgDev/Web/src/mapadmin/performanceReport.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/performanceReport.php	2011-11-01 06:00:35 UTC (rev 6194)
+++ trunk/MgDev/Web/src/mapadmin/performanceReport.php	2011-11-01 06:00:40 UTC (rev 6195)
@@ -221,8 +221,10 @@
         .layerResultsStyle th,.layerResultsStyle td
         {
             text-align:left;
-            padding:.5em;
+            padding:6px 3px;
             border:1px solid #CCCCCC;
+            word-wrap:break-word;
+            overflow:hidden;
         }
 
         .layerResultsStyle th
@@ -306,9 +308,9 @@
 
         .bgDivStyle
         {
-            position:fixed;
-            left:0;
-            top:0;
+            position:absolute;
+            left:0px;
+            top:0px;
             background-color:#777777;
             filter:alpha(Opacity=30);
             opacity:0.6;
@@ -858,7 +860,7 @@
                     return;
 
                 MapViewerBtnOKClicked();
-            }
+             }
         }
 
         function SetBgDivSize(bgDiv)
@@ -911,6 +913,27 @@
 
         function CheckMapFrameLoaded()
         {
+            //if the session is time out, the whole page should redirect to the login page
+            var mapViewerDocumentElement = null;
+
+            try
+            {
+                mapViewerDocumentElement = document.getElementById("mapViewerFrame").contentDocument.documentElement;
+            }
+            catch(e)
+            {
+                //For IE
+                mapViewerDocumentElement = document.getElementById("mapViewerFrame").contentWindow.document.documentElement;
+            }
+
+            if(mapViewerDocumentElement.innerHTML.indexOf("MapGuide Site Administrator - Login") > 1)
+            {
+                if(mapViewerDocumentElement.innerHTML.indexOf("login.php") > 1)
+                {
+                    window.location.href="login.php?ErrorMsg=Fatal error encountered! Please login again.";
+                }
+            }
+
             if(!IsMapFrameLoaded())
                 return;
 
@@ -1274,7 +1297,7 @@
             //set tooltip position
             toolTip.style.top = elPos.y + linkObj.offsetHeight+ downMouseTop+ "px";
             toolTip.style.left = mosPos.x + downMouseLeft + "px";
-
+            
             toolTip.style.display = "block";
             toolTip.className = "showTooltip";
         }
@@ -1377,39 +1400,50 @@
         {
             if ((4 == xmlHttp.readyState || "complete" == xmlHttp.readyState)&& 200 == xmlHttp.status)
             {
-                var profileResult = document.getElementById("resultsTab");
-                var result = xmlHttp.responseText;
-                var btnClear = document.getElementById("btnClearSpan");
-                var loadingImg = document.getElementById("ajax_loading_img");
-
-                if(Trim(result) == "mapNotExist")
+                //if the session is time out, the whole page should redirect to the login page
+                if(xmlHttp.responseText.indexOf("MapGuide Site Administrator - Login") > 1)
                 {
-                    alert("The selected map resource is no longer available. Select a different map resource to continue.");
-                    btnClear.style.display = "inline";
-                    loadingImg.style.display = "none";
-                    SetRunButtonState(true);
-                    return;
+                    if(xmlHttp.responseText.indexOf("login.php") > 1)
+                        {
+                            window.location.href="login.php?ErrorMsg=Fatal error encountered! Please login again.";
+                        }
                 }
+                else
+                {
+                    var profileResult = document.getElementById("resultsTab");
+                    var result = xmlHttp.responseText;
+                    var btnClear = document.getElementById("btnClearSpan");
+                    var loadingImg = document.getElementById("ajax_loading_img");
 
-                profileResult.innerHTML = xmlHttp.responseText;
+                    if(Trim(result) == "mapNotExist")
+                    {
+                        alert("The selected map resource is no longer available. Select a different map resource to continue.");
+                        btnClear.style.display = "inline";
+                        loadingImg.style.display = "none";
+                        SetRunButtonState(true);
+                        return;
+                    }
 
-                btnClear.style.display = "inline";
-                loadingImg.style.display = "none";
+                    profileResult.innerHTML = xmlHttp.responseText;
 
-                CollapseSettingTab();
-                ExpandResultsTab();
-                SetRunButtonState(true);
+                    btnClear.style.display = "inline";
+                    loadingImg.style.display = "none";
 
-                SetLayerJsArray();
-                SetRecentSettingJsArray();
+                    CollapseSettingTab();
+                    ExpandResultsTab();
+                    SetRunButtonState(true);
 
-                SetRecentSettingsContent();
+                    SetLayerJsArray();
+                    SetRecentSettingJsArray();
 
-                SaveLastRunSettings();
+                    SetRecentSettingsContent();
 
-                //make the layer table default sorting
-                var layerTableHeader = document.getElementById("layerHeaderTable");
-                SortLayers.sortByColumn(layerTableHeader.tHead.rows[0].children[0]);
+                    SaveLastRunSettings();
+
+                    //make the layer table default sorting
+                    var layerTableHeader = document.getElementById("layerHeaderTable");
+                    SortLayers.sortByColumn(layerTableHeader.tHead.rows[0].children[0]);
+                }
             }
         }
 
@@ -2100,7 +2134,7 @@
                                                                 Choose a center point and scale from the map viewer or enter the values manually.
                                                             </div>
                                                             <input type="button" id="mapViewerBtn" value="Select Settings..." onClick="SelectMapSettings();"  disabled="disabled" style="width:160px; height: 28px;font-weight: bold;">
-                                                            <div id="mapViewerDialog" align="center" class="mapViewerDialogStyle">
+                                                            <div id="mapViewerDialog" align="center" class="mapViewerDialogStyle" onkeydown="MapViewerKeyUp(event);">
                                                                 <table width="100%" style="margin:0px; padding: 0px;" cellspacing="0" cellpadding="0">
                                                                     <tr>
                                                                         <td style="border-bottom:1px solid #000000; " >

Modified: trunk/MgDev/Web/src/mapadmin/performanceReport_GetResult.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/performanceReport_GetResult.php	2011-11-01 06:00:35 UTC (rev 6194)
+++ trunk/MgDev/Web/src/mapadmin/performanceReport_GetResult.php	2011-11-01 06:00:40 UTC (rev 6195)
@@ -12,6 +12,9 @@
     // Are we cancelling?  If so, there is nothing to do.
     CheckForCancel( 'performanceReport.php' );
 
+    //sometimes the profiling map API needs a long time to response
+    set_time_limit(900);
+
     // Define Local values
     $confirmationMsg = "";
     $errorMsg = "";
@@ -448,17 +451,17 @@
                             <!--the table head is in a different div so when the table scrolls, the head will be fixed -->
                             <!--Also, the table head columns are set with some customer attribute to help to sort the table data from the client site-->
                             <tr>
-                                <th style="width:15%;border-left:1px solid #CCCCCC;" columnIndex="1" onClick="SortLayers.sortByColumn(this);">Layer</th>
-                                <th style="width:20%;" columnIndex="2" onClick="SortLayers.sortByColumn(this);">Render Time</th>
-                                <th style="width:25%;" columnIndex="3" onClick="SortLayers.sortByColumn(this);">Feature Class</th>
-                                <th style="width:25%;" columnIndex="4" onClick="SortLayers.sortByColumn(this);">Coordinate System</th>
-                                <th style="width:15%;border-right:1px solid #CCCCCC;" columnIndex="5" onClick="SortLayers.sortByColumn(this);">Type</th>
+                                <th style="width:20%;border-left:1px solid #CCCCCC;" columnIndex="1" onClick="SortLayers.sortByColumn(this);">Layer</th>
+                                <th style="width:15%;" columnIndex="2" onClick="SortLayers.sortByColumn(this);">Render Time</th>
+                                <th style="width:30%;" columnIndex="3" onClick="SortLayers.sortByColumn(this);">Feature Class</th>
+                                <th style="width:22%;" columnIndex="4" onClick="SortLayers.sortByColumn(this);">Coordinate System</th>
+                                <th style="width:13%;border-right:1px solid #CCCCCC;" columnIndex="5" onClick="SortLayers.sortByColumn(this);">Type</th>
                             </tr>
                         </thead>
                     </table>
                 </div>
                 <div id="layerBody" class="layerResultsStyle">
-                    <table style="width:100%; text-align: center;margin:0px; padding: 0px;" id="layerResultsTable">
+                    <table style="width:100%; text-align: center;margin:0px; padding: 0px; table-layout: fixed;" id="layerResultsTable">
                         <tbody>
                             <?php
                                 $displayManager->OutputLayerDefinitionData();

Modified: trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php	2011-11-01 06:00:35 UTC (rev 6194)
+++ trunk/MgDev/Web/src/mapadmin/resizablepagecomponents.php	2011-11-01 06:00:40 UTC (rev 6195)
@@ -2181,6 +2181,10 @@
             $sumofRenderTime = $this->mapProfileResult->LayerProfileData->GetSumOfLayerRenderTime();
             foreach ($this->mapProfileResult->LayerProfileData->LayerProfileDataCollection as $layerProfileData)
             {
+                //TODO:workaround for FDO read layer Exception
+                if(trim($layerProfileData->LayerName) == "")
+                    continue;
+
                 //set different colors for alternate rows and when mouse move over the row it will change color
                 if(0 == $rowNumber%2)
                 {
@@ -2193,13 +2197,13 @@
 
                 //output the layer profiling information by each column,
                 //for the render time column, we set the sort key as the original number, which will be used as client sort
-                echo "<td style='width:15%;'>".$layerProfileData->LayerName."</td>","\n";
-                echo "<td style='width:20%;' sortKey='".number_format($layerProfileData->TotalRenderTime,2)."'>".
+                echo "<td style='width:20%;'>".$layerProfileData->LayerName."</td>","\n";
+                echo "<td style='width:15%;' sortKey='".number_format($layerProfileData->TotalRenderTime,2)."'>".
                         number_format($layerProfileData->TotalRenderTime,2)."&nbsp;ms&nbsp;(".
                         $layerProfileData->GetRenderTimePercentage($sumofRenderTime)."%)&nbsp;</td>","\n";
-                echo "<td style='width:25%;'>".$layerProfileData->FeatureClass."</td>","\n";
-                echo "<td style='width:25%;'>".$layerProfileData->CoordinateSystem."</td>","\n";
-                echo "<td style='width:15%;'>".$layerProfileData->LayerType."</td>","\n";
+                echo "<td style='width:30%;'>".$layerProfileData->FeatureClass."</td>","\n";
+                echo "<td style='width:22%;'>".$layerProfileData->CoordinateSystem."</td>","\n";
+                echo "<td style='width:13%;'>".$layerProfileData->LayerType."</td>","\n";
                 echo "</tr>","\n";
 
                 $rowNumber++;

Modified: trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php
===================================================================
--- trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php	2011-11-01 06:00:35 UTC (rev 6194)
+++ trunk/MgDev/Web/src/mapadmin/serverdatafunctions.php	2011-11-01 06:00:40 UTC (rev 6195)
@@ -2784,6 +2784,11 @@
                             }
                         }
                     }
+
+                    //TODO:workaround for FDO read layer Exception
+                    if(trim($tempLayerProfileData->LayerName) === "")
+                        continue;
+
                     $this->LayerProfileData->LayerProfileDataCollection[$tempLayerProfileData->LayerName] = $tempLayerProfileData;
                 }
             }



More information about the mapguide-commits mailing list