[mapguide-commits] r8959 - in branches/3.0/MgDev: . Common/MapGuideCommon/Controller Server/src/Services/Feature Server/src/Services/Mapping Web/src/schemareport

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu May 12 08:08:23 PDT 2016


Author: jng
Date: 2016-05-12 08:08:23 -0700 (Thu, 12 May 2016)
New Revision: 8959

Modified:
   branches/3.0/MgDev/
   branches/3.0/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
   branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.cpp
   branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.h
   branches/3.0/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
   branches/3.0/MgDev/Web/src/schemareport/displayschemafunctions.php
Log:
Merged revision(s) 8871, 8912, 8921-8922, 8942 from sandbox/adsk/3.1n:
Fix #2585: the total entries is not correct with Oracle data source.

It is because the initial vale of total entries is -1. We should set it to 0.
........
Fix the issue that DateTime value cannot be displayed in selection panel.
........
In some special FDO provider such as Autodesk RealDWG provider, the 'Geometry' property is already in property mappings. In method MgHtmlController::WriteSelectedFeatureAttributes(), we will first add all mapping properties, then add geometry property. We need to check if 'Geometry' is added to avoid adding it twice.
........
Some providers such as Sqlite provider, CreateCommand(FdoCommandType_Select) will return a extended select command. So we need to check if it is really a extended select command before using it. 
........
Fix the defect that zoom raster image results in server crash.
It is because if the displayed size of image is very small, the width or height may be 0. And we will use the width and height as the parameters of RESAMPLE. FDO Raster provider will crash in this case. I set width or height to 1 if its value is 0 to avoid the error.
........



Property changes on: branches/3.0/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev:8276-8286,8288-8292,8297,8299,8301,8303,8314-8315,8318,8335,8340,8354-8355,8365,8373
/sandbox/adsk/2.6l:8727
/sandbox/adsk/3.0m:8563,8584,8607,8625,8694-8695
/sandbox/jng/convenience_apis:8262-8268,8271-8363
/sandbox/jng/createruntimemap:7486-7555
/sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
/sandbox/jng/geos34x:8256-8259
/sandbox/jng/rfc155:8874-8884
/sandbox/jng/tiling:8174-8208
/sandbox/jng/v30:8212-8227
/sandbox/rfc94:5099-5163
/trunk/MgDev:8595,8616-8618,8626,8682,8700,8728,8844,8956
   + /branches/2.4/MgDev:6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev:8276-8286,8288-8292,8297,8299,8301,8303,8314-8315,8318,8335,8340,8354-8355,8365,8373
/sandbox/adsk/2.6l:8727
/sandbox/adsk/3.0m:8563,8584,8607,8625,8694-8695
/sandbox/adsk/3.1n:8871,8912,8921-8922,8942
/sandbox/jng/convenience_apis:8262-8268,8271-8363
/sandbox/jng/createruntimemap:7486-7555
/sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
/sandbox/jng/geos34x:8256-8259
/sandbox/jng/rfc155:8874-8884
/sandbox/jng/tiling:8174-8208
/sandbox/jng/v30:8212-8227
/sandbox/rfc94:5099-5163
/trunk/MgDev:8595,8616-8618,8626,8682,8700,8728,8844,8956

Modified: branches/3.0/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- branches/3.0/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2016-05-12 15:06:39 UTC (rev 8958)
+++ branches/3.0/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2016-05-12 15:08:23 UTC (rev 8959)
@@ -533,7 +533,8 @@
                     }
                 }
             }
-            propNames->Add(selLayer->GetFeatureGeometryName()); //Don't forget geometry
+            if (!propNames->Contains(selLayer->GetFeatureGeometryName()))
+                propNames->Add(selLayer->GetFeatureGeometryName()); //Don't forget geometry
             xmlOut.append(L"</LayerMetadata>\n");
             Ptr<MgReader> reader = selectionSet->GetSelectedFeatures(selLayer, selLayer->GetFeatureClassName(), propNames);
             while(reader->ReadNext())
@@ -612,7 +613,7 @@
                                 //ToXmlString() won't work with dates before Jan 1, 1970, so use yyyy-mm-dd hh:mm:ss
                                 STRING dateStr;
                                 STRING str;
-                                if (dt->IsDate())
+                                if (dt->GetYear() != -1)
                                 {
                                     MgUtil::Int32ToString(dt->GetYear(), str);
                                     dateStr += str;
@@ -625,9 +626,9 @@
                                     MgUtil::PadLeft(str, 2, L'0');
                                     dateStr += str;
                                 }
-                                if (dt->IsTime())
+                                if (dt->GetHour() != -1)
                                 {
-                                    if (dt->IsDate())
+                                    if (dt->GetYear() != -1)
                                     {
                                         dateStr += L" ";
                                     }

Modified: branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.cpp
===================================================================
--- branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2016-05-12 15:06:39 UTC (rev 8958)
+++ branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.cpp	2016-05-12 15:08:23 UTC (rev 8959)
@@ -50,7 +50,7 @@
     // For SDF/SHP providers, they do not support ordering. But, they can support ordering through the FdoIExtendedSelect
     // command, provided that only a single property is being ordered on. So if it is the case that normal ordering is
     // not supported, we should try for extended select if the conditions are met.
-    bool bTryExtendedSelect = false;
+    m_bUseExtendedSelect = false;
     if (NULL != options)
     {
         Ptr<MgStringCollection> orderProps = options->GetOrderingProperties();
@@ -65,7 +65,7 @@
                 {
                     if (FdoCommandType_ExtendedSelect == cmds[i] && orderProps->GetCount() == 1)
                     {
-                        bTryExtendedSelect = true;
+                        m_bUseExtendedSelect = true;
                         break;
                     }
                 }
@@ -74,7 +74,7 @@
     }
 
     // Create FdoISelect command
-    if (bTryExtendedSelect)
+    if (m_bUseExtendedSelect)
         m_command = (FdoIExtendedSelect*)fdoConn->CreateCommand(FdoCommandType_ExtendedSelect);
     else
         m_command = (FdoISelect*)fdoConn->CreateCommand(FdoCommandType_Select);
@@ -219,7 +219,7 @@
 
     CHECKNULL((FdoISelect*)m_command, L"MgSelectCommand.Execute");
     FdoIExtendedSelect* extSelect = dynamic_cast<FdoIExtendedSelect*>(m_command.p);
-    if (NULL != extSelect)
+    if (m_bUseExtendedSelect && NULL != extSelect)
     {
         FdoPtr<FdoIScrollableFeatureReader> scReader = extSelect->ExecuteScrollable();
         CHECKNULL((FdoIScrollableFeatureReader*)scReader, L"MgSelectCommand.Execute");

Modified: branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.h
===================================================================
--- branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.h	2016-05-12 15:06:39 UTC (rev 8958)
+++ branches/3.0/MgDev/Server/src/Services/Feature/SelectCommand.h	2016-05-12 15:08:23 UTC (rev 8959)
@@ -80,6 +80,7 @@
     FdoPtr<FdoFilter> m_filter;
 
     MgFdoFilterCollection* GetSubFilters();
+    bool m_bUseExtendedSelect;
 };
 
 #endif

Modified: branches/3.0/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- branches/3.0/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2016-05-12 15:06:39 UTC (rev 8958)
+++ branches/3.0/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2016-05-12 15:08:23 UTC (rev 8959)
@@ -730,6 +730,10 @@
                     double pixelsPerMapUnit = dr->GetMetersPerUnit() / METERS_PER_INCH * dr->GetDpi() / dr->GetMapScale();
                     int width = (int)(extent.width() * pixelsPerMapUnit + 0.5);
                     int height = (int)(extent.height() * pixelsPerMapUnit + 0.5);
+                    // if width or height is 0, raster provider will throw an exception. 
+                    // we set it to 1 to avoid the exception.
+                    if (0 == width) width = 1;
+                    if (0 == height) height = 1;
 
                     //perform the raster query
                     FdoPtr<FdoIFeatureReader> fdoReader;


Property changes on: branches/3.0/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/2.4/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:6738-6741,6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:8365
/sandbox/adsk/2.4j/Server/src/Services/Mapping/MappingUtil.cpp:6327-6535
/sandbox/jng/createruntimemap/Server/src/Services/Mapping/MappingUtil.cpp:7486-7555
/sandbox/rfc94/Server/src/Services/Mapping/MappingUtil.cpp:5099-5163
/trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:6250-6326
   + /branches/2.4/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:6738-6741,6749-6756,6777-6783,6785-6787,6789,6791-6794,6796-6801,6954-6962,6986-7006
/branches/2.6/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:8365
/sandbox/adsk/2.4j/Server/src/Services/Mapping/MappingUtil.cpp:6327-6535
/sandbox/adsk/3.1n/Server/src/Services/Mapping/MappingUtil.cpp:8942
/sandbox/jng/createruntimemap/Server/src/Services/Mapping/MappingUtil.cpp:7486-7555
/sandbox/rfc94/Server/src/Services/Mapping/MappingUtil.cpp:5099-5163
/trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp:6250-6326

Modified: branches/3.0/MgDev/Web/src/schemareport/displayschemafunctions.php
===================================================================
--- branches/3.0/MgDev/Web/src/schemareport/displayschemafunctions.php	2016-05-12 15:06:39 UTC (rev 8958)
+++ branches/3.0/MgDev/Web/src/schemareport/displayschemafunctions.php	2016-05-12 15:08:23 UTC (rev 8959)
@@ -120,7 +120,7 @@
     //
     //NOTE: If MapGuide supported scrollable readers like FDO, we'd have also tried 
     //that as well.
-    $totalEntries = -1;
+    $totalEntries = 0;
     $featureName = $schemaName . ":" . $className;
     $canCount = false;
     $gotCount = false;



More information about the mapguide-commits mailing list