[mapguide-commits] r1349 - in trunk/MgDev: Common/MapGuideCommon/Controller Common/MapGuideCommon/Services Server/src/Services/Rendering Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Mar 22 16:18:50 EDT 2007


Author: chrisclaydon
Date: 2007-03-22 16:18:50 -0400 (Thu, 22 Mar 2007)
New Revision: 1349

Modified:
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
   trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h
   trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
   trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
   trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
   trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
   trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
Log:
RFC15 Addendum 2 Server & Web Tier QueryFeatures updates

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -168,7 +168,8 @@
     INT32 selectionVariant,
     INT32 maxFeatures,
     bool persist,
-    bool bIgnoreScaleRange)
+    bool bIgnoreScaleRange,
+    CREFSTRING featureFilter)
 {
     // Create a Resource Service instance
     Ptr<MgResourceService> resourceService = (MgResourceService*)GetService(MgServiceType::ResourceService);
@@ -190,7 +191,7 @@
 
     // Call the C++ API
     Ptr<MgFeatureInformation> featureInfo = service->QueryFeatures(map, layerNames, selectionGeometry,
-        selectionVariant, maxFeatures, bIgnoreScaleRange);
+        selectionVariant, featureFilter, maxFeatures, bIgnoreScaleRange);
 
     if(persist)
     {

Modified: trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Common/MapGuideCommon/Controller/HtmlController.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -135,7 +135,8 @@
         INT32 selectionVariant,
         INT32 maxFeatures,
         bool persist,
-        bool bIgnoreScaleRange);
+        bool bIgnoreScaleRange,
+        CREFSTRING featureFilter);
 
     //////////////////////////////////////////////////////////////////
     /// \brief

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -174,7 +174,7 @@
                         MgCommand::knObject, map,                       // Argument#1
                         MgCommand::knObject, selection,                 // Argument#2
                         MgCommand::knString, &format,                   // Argument#3
-                        MgCommand::knInt32, bKeepSelection,             // Argument#4
+                        MgCommand::knInt8, (INT8)bKeepSelection,        // Argument#4
                         MgCommand::knNone);                             // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -244,7 +244,7 @@
                         MgCommand::knObject, map,           // Argument#1
                         MgCommand::knObject, selection,     // Argument#2
                         MgCommand::knString, &format,       // Argument#3
-                        MgCommand::knInt32, bKeepSelection, // Argument#4
+                        MgCommand::knInt8, (INT8)bKeepSelection, // Argument#4
                         MgCommand::knNone);                 // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -350,7 +350,7 @@
                         MgCommand::knInt32, height,             // Argument#5
                         MgCommand::knObject, backgroundColor,   // Argument#6
                         MgCommand::knString, &format,           // Argument#7
-                        MgCommand::knInt32, bKeepSelection,     // Argument#8
+                        MgCommand::knInt8, (INT8)bKeepSelection,// Argument#8
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -463,7 +463,7 @@
                         MgCommand::knInt32, height,             // Argument#6
                         MgCommand::knObject, backgroundColor,   // Argument#7
                         MgCommand::knString, &format,           // Argument#8
-                        MgCommand::knInt32, bKeepSelection,     // Argument#9
+                        MgCommand::knInt8, (INT8)bKeepSelection,// Argument#9
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -550,12 +550,12 @@
 MgFeatureInformation* MgProxyRenderingService::QueryFeatures(
     MgMap* map,
     MgStringCollection* layerNames,
-    MgGeometry* geometry,
+    MgGeometry* filterGeometry,
     INT32 selectionVariant, // Within, Touching, Topmost
     INT32 maxFeatures)
 {
     // Call the updated QueryFeatures API
-    return QueryFeatures(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+    return QueryFeatures(map, layerNames, filterGeometry, selectionVariant, L"", maxFeatures, false);
 }
 
 /////////////////////////////////////////////////////////////////
@@ -591,8 +591,9 @@
 MgFeatureInformation* MgProxyRenderingService::QueryFeatures(
     MgMap* map,
     MgStringCollection* layerNames,
-    MgGeometry* geometry,
+    MgGeometry* filterGeometry,
     INT32 selectionVariant, // Within, Touching, Topmost
+    CREFSTRING featureFilter,
     INT32 maxFeatures,
     bool bIgnoreScaleRange)
 {
@@ -600,15 +601,16 @@
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::QueryFeatures,  // Command Code
-                        6,                                      // No of arguments
+                        7,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         BUILD_VERSION(1,0,0),                   // Operation version
                         MgCommand::knObject, map,               // Argument#1
                         MgCommand::knObject, layerNames,        // Argument#2
-                        MgCommand::knObject, geometry,          // Argument#3
-                        MgCommand::knInt32, selectionVariant,   // Argument#4
-                        MgCommand::knInt32, maxFeatures,        // Argument#5
-                        MgCommand::knInt32, bIgnoreScaleRange,  // Argument#6
+                        MgCommand::knObject, filterGeometry,    // Argument#3
+                        MgCommand::knInt32,  selectionVariant,  // Argument#4
+                        MgCommand::knString, &featureFilter,    // Argument#5
+                        MgCommand::knInt32,  maxFeatures,       // Argument#6
+                        MgCommand::knInt8, (INT8)bIgnoreScaleRange, // Argument#7
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());
@@ -630,7 +632,7 @@
 /// <param name="layerName">Input
 /// Active layer name for which to query features
 /// </param>
-/// <param name="geometry">Input
+/// <param name="filterGeometry">Input
 /// geometry object specifying the selection area
 /// </param>
 /// <param name="selectionVariant">Input
@@ -646,12 +648,12 @@
 MgBatchPropertyCollection* MgProxyRenderingService::QueryFeatureProperties(
     MgMap* map,
     MgStringCollection* layerNames,
-    MgGeometry* geometry,
+    MgGeometry* filterGeometry,
     INT32 selectionVariant, 
     INT32 maxFeatures)
 {
     // Call the updated QueryFeatureProperties API
-    return QueryFeatureProperties(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+    return QueryFeatureProperties(map, layerNames, filterGeometry, selectionVariant, L"", maxFeatures, false);
 }
 
 
@@ -668,7 +670,7 @@
 /// <param name="layerName">Input
 /// Active layer name for which to query features
 /// </param>
-/// <param name="geometry">Input
+/// <param name="filterGeometry">Input
 /// geometry object specifying the selection area
 /// </param>
 /// <param name="selectionVariant">Input
@@ -688,8 +690,9 @@
 MgBatchPropertyCollection* MgProxyRenderingService::QueryFeatureProperties(
     MgMap* map,
     MgStringCollection* layerNames,
-    MgGeometry* geometry,
-    INT32 selectionVariant, 
+    MgGeometry* filterGeometry,
+    INT32 selectionVariant,
+    CREFSTRING featureFilter,
     INT32 maxFeatures,
     bool bIgnoreScaleRange)
 {
@@ -697,15 +700,16 @@
     cmd.ExecuteCommand(m_connProp,                              // Connection
                         MgCommand::knObject,                    // Return type expected
                         MgRenderingServiceOpId::QueryFeatureProperties,  // Command Code
-                        6,                                      // No of arguments
+                        7,                                      // No of arguments
                         Rendering_Service,                      // Service Id
                         BUILD_VERSION(1,0,0),                   // Operation version
                         MgCommand::knObject, map,               // Argument#1
                         MgCommand::knObject, layerNames,        // Argument#2
-                        MgCommand::knObject, geometry,          // Argument#3
+                        MgCommand::knObject, filterGeometry,    // Argument#3
                         MgCommand::knInt32, selectionVariant,   // Argument#4
-                        MgCommand::knInt32, maxFeatures,        // Argument#5
-                        MgCommand::knInt32, bIgnoreScaleRange,  // Argument#6
+                        MgCommand::knString, &featureFilter,    // Argument#5
+                        MgCommand::knInt32, maxFeatures,        // Argument#6
+                        MgCommand::knInt8, (INT8)bIgnoreScaleRange,  // Argument#7
                         MgCommand::knNone);                     // End of arguments
 
     SetWarning(cmd.GetWarningObject());

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ProxyRenderingService.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -371,7 +371,7 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -388,7 +388,7 @@
     virtual MgFeatureInformation* QueryFeatures(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
+        MgGeometry* filterGeometry,
         INT32 selectionVariant, 
         INT32 maxFeatures);
 
@@ -406,12 +406,15 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
     /// Input
     /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param featureFilter
+    /// Input
+    /// an XML selection string containing the required feature IDs
     /// \param maxFeatures
     /// Input
     /// the maximum number of features to return
@@ -426,8 +429,9 @@
     virtual MgFeatureInformation* QueryFeatures(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
-        INT32 selectionVariant, 
+        MgGeometry* filterGeometry,
+        INT32 selectionVariant,
+        CREFSTRING featureFilter, 
         INT32 maxFeatures,
         bool bIgnoreScaleRange);
 
@@ -444,7 +448,7 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -461,7 +465,7 @@
     virtual MgBatchPropertyCollection* QueryFeatureProperties(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
+        MgGeometry* filterGeometry,
         INT32 selectionVariant, 
         INT32 maxFeatures);
 
@@ -478,7 +482,7 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -499,8 +503,9 @@
     virtual MgBatchPropertyCollection* QueryFeatureProperties(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
-        INT32 selectionVariant, 
+        MgGeometry* filterGeometry,
+        INT32 selectionVariant,
+        CREFSTRING featureFilter,
         INT32 maxFeatures,
         bool bIgnoreScaleRange);
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Common/MapGuideCommon/Services/RenderingService.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -374,7 +374,7 @@
     /// \param layerNames
     /// Input
     /// Active layer names for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -391,7 +391,7 @@
     virtual MgFeatureInformation* QueryFeatures(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
+        MgGeometry* filterGeometry,
         INT32 selectionVariant, 
         INT32 maxFeatures) = 0;
 
@@ -409,12 +409,15 @@
     /// \param layerNames
     /// Input
     /// Active layer names for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
     /// Input
     /// selection criterion - 0=Within, 1=Touching, 2=Topmost
+    /// \param featureFilter
+    /// Input
+    /// an XML selection string containing the required feature IDs
     /// \param maxFeatures
     /// Input
     /// the maximum number of features to return
@@ -429,8 +432,9 @@
     virtual MgFeatureInformation* QueryFeatures(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
-        INT32 selectionVariant, 
+        MgGeometry* filterGeometry,
+        INT32 selectionVariant,
+        CREFSTRING featureFilter, 
         INT32 maxFeatures,
         bool bIgnoreScaleRange) = 0;
 
@@ -447,7 +451,7 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -464,7 +468,7 @@
     virtual MgBatchPropertyCollection* QueryFeatureProperties(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
+        MgGeometry* filterGeometry,
         INT32 selectionVariant, 
         INT32 maxFeatures) = 0;
 
@@ -481,7 +485,7 @@
     /// \param layerName
     /// Input
     /// Active layer name for which to query features
-    /// \param geometry
+    /// \param filterGeometry
     /// Input
     /// geometry object specifying the selection area
     /// \param selectionVariant
@@ -502,8 +506,9 @@
     virtual MgBatchPropertyCollection* QueryFeatureProperties(
         MgMap* map,
         MgStringCollection* layerNames,
-        MgGeometry* geometry,
-        INT32 selectionVariant, 
+        MgGeometry* filterGeometry,
+        INT32 selectionVariant,
+        CREFSTRING featureFilter,
         INT32 maxFeatures,
         bool bIgnoreScaleRange) = 0;
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatureProperties.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -41,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (6 == m_packet.m_NumArguments)
+    if (7 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -52,12 +52,14 @@
         INT32 selectionVariant = 0;
         m_stream->GetInt32(selectionVariant);
 
+        STRING featureFilter;
+        m_stream->GetString(featureFilter);
+
         INT32 maxFeatures = 0;
         m_stream->GetInt32(maxFeatures);
 
-        INT32 iIgnoreScale = 0;
-        m_stream->GetInt32(iIgnoreScale);
-        bool bIgnoreScale = (iIgnoreScale != 0);
+        bool bIgnoreScale = false;
+        m_stream->GetBoolean(bIgnoreScale);
 
         BeginExecution();
 
@@ -70,6 +72,8 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_INT32(selectionVariant);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureFilter.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bIgnoreScale);
@@ -78,7 +82,8 @@
         Validate();
 
         Ptr<MgBatchPropertyCollection> info =
-            m_service->QueryFeatureProperties(map, layerNames, geom, selectionVariant, maxFeatures, bIgnoreScale);
+            m_service->QueryFeatureProperties(map, layerNames, geom, selectionVariant, 
+            featureFilter, maxFeatures, bIgnoreScale);
 
         EndExecution(info);
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/OpQueryFeatures.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -41,7 +41,7 @@
 
     ACE_ASSERT(m_stream != NULL);
 
-    if (6 == m_packet.m_NumArguments)
+    if (7 == m_packet.m_NumArguments)
     {
         Ptr<MgMap> map = (MgMap*)m_stream->GetObject();
         map->SetDelayedLoadResourceService(m_resourceService);
@@ -52,12 +52,14 @@
         INT32 selectionVariant = 0;
         m_stream->GetInt32(selectionVariant);
 
+        STRING featureFilter;
+        m_stream->GetString(featureFilter);
+
         INT32 maxFeatures = 0;
         m_stream->GetInt32(maxFeatures);
 
-        INT32 iIgnoreScale = 0;
-        m_stream->GetInt32(iIgnoreScale);
-        bool bIgnoreScale = (iIgnoreScale != 0);
+        bool bIgnoreScale = false;
+        m_stream->GetBoolean(bIgnoreScale);
 
         BeginExecution();
 
@@ -70,6 +72,8 @@
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_INT32(selectionVariant);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
+        MG_LOG_OPERATION_MESSAGE_ADD_STRING(featureFilter.c_str());
+        MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_INT32(maxFeatures);
         MG_LOG_OPERATION_MESSAGE_ADD_SEPARATOR();
         MG_LOG_OPERATION_MESSAGE_ADD_BOOL(bIgnoreScale);
@@ -78,7 +82,8 @@
         Validate();
 
         Ptr<MgFeatureInformation> info =
-            m_service->QueryFeatures(map, layerNames, geom, selectionVariant, maxFeatures, bIgnoreScale);
+            m_service->QueryFeatures(map, layerNames, geom, selectionVariant, 
+                featureFilter, maxFeatures, bIgnoreScale);
 
         EndExecution(info);
     }

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderDynamicOverlay.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -53,9 +53,8 @@
         STRING format;
         m_stream->GetString(format);
 
-        INT32 iKeepSelection = 0;
-        m_stream->GetInt32(iKeepSelection);
-        bool bKeepSelection = (iKeepSelection != 0);
+        bool bKeepSelection = false;
+        m_stream->GetBoolean(bKeepSelection);
 
         BeginExecution();
 

Modified: trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/OpRenderMap.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -53,9 +53,8 @@
         STRING format;
         m_stream->GetString(format);
 
-        INT32 iKeepSelection = 0;
-        m_stream->GetInt32(iKeepSelection);
-        bool bKeepSelection = (iKeepSelection != 0);
+        bool bKeepSelection = false;
+        m_stream->GetBoolean(bKeepSelection);
 
         BeginExecution();
 
@@ -98,9 +97,8 @@
         STRING format;
         m_stream->GetString(format);
 
-        INT32 iKeepSelection = 0;
-        m_stream->GetInt32(iKeepSelection);
-        bool bKeepSelection = (iKeepSelection != 0);
+        bool bKeepSelection = false;
+        m_stream->GetBoolean(bKeepSelection);
 
         BeginExecution();
 
@@ -154,9 +152,8 @@
         STRING format;
         m_stream->GetString(format);
 
-        INT32 iKeepSelection = 0;
-        m_stream->GetInt32(iKeepSelection);
-        bool bKeepSelection = (iKeepSelection != 0);
+        bool bKeepSelection = false;
+        m_stream->GetBoolean(bKeepSelection);
 
         BeginExecution();
 

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -502,7 +502,7 @@
                                                               INT32       maxFeatures)
 {
     // Call updated QueryFeatures API
-    return QueryFeatures(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+    return QueryFeatures(map, layerNames, geometry, selectionVariant, L"", maxFeatures, false);
 }
 
 
@@ -510,6 +510,7 @@
                                                               MgStringCollection* layerNames,
                                                               MgGeometry* geometry,
                                                               INT32       selectionVariant, // Within, Touching, Topmost
+                                                              CREFSTRING  featureFilter,
                                                               INT32       maxFeatures,
                                                               bool bIgnoreScaleRange)
 {
@@ -524,9 +525,10 @@
     //create return structure and selection set to fill out
     ret = new MgFeatureInformation();
     Ptr<MgSelection> sel = new MgSelection(map);
+
     FeatureInfoRenderer fir(sel, maxFeatures, map->GetViewScale());
 
-    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fir, bIgnoreScaleRange);
+    RenderForSelection(map, layerNames, geometry, selectionVariant, featureFilter, maxFeatures, &fir, bIgnoreScaleRange);
 
     //fill out the output object with the info we collected
     //in the FeatureInfoRenderer for the first feature we hit
@@ -553,19 +555,20 @@
 
 MgBatchPropertyCollection* MgServerRenderingService::QueryFeatureProperties( MgMap* map,
                                     MgStringCollection* layerNames,
-                                    MgGeometry* geometry,
+                                    MgGeometry* filterGeometry,
                                     INT32 selectionVariant, // Within, Touching, Topmost
                                     INT32 maxFeatures)
 {
     // Call updated QueryFeatureProperties API
-    return QueryFeatureProperties(map, layerNames, geometry, selectionVariant, maxFeatures, false);
+    return QueryFeatureProperties(map, layerNames, filterGeometry, selectionVariant, L"", maxFeatures, false);
 }
 
 
 MgBatchPropertyCollection* MgServerRenderingService::QueryFeatureProperties( MgMap* map,
                                     MgStringCollection* layerNames,
-                                    MgGeometry* geometry,
+                                    MgGeometry* filterGeometry,
                                     INT32 selectionVariant, // Within, Touching, Topmost
+                                    CREFSTRING featureFilter,
                                     INT32 maxFeatures,
                                     bool bIgnoreScaleRange)
 {
@@ -580,7 +583,7 @@
     Ptr<MgSelection> sel;   //TODO: do we need this for this API? new MgSelection(map);
     FeaturePropRenderer fpr(sel, maxFeatures, map->GetViewScale());
 
-    RenderForSelection(map, layerNames, geometry, selectionVariant, maxFeatures, &fpr, bIgnoreScaleRange);
+    RenderForSelection(map, layerNames, filterGeometry, selectionVariant, featureFilter, maxFeatures, &fpr, bIgnoreScaleRange);
 
     ret = fpr.GetProperties();
     //ret->SetSelection(sel);
@@ -832,12 +835,13 @@
                          MgStringCollection* layerNames,
                          MgGeometry* geometry,
                          INT32 selectionVariant,
+                         CREFSTRING featureFilter,
                          INT32 maxFeatures,
                          FeatureInfoRenderer* selRenderer,
                          bool bIgnoreScaleRange)
 {
     ACE_DEBUG ((LM_DEBUG, ACE_TEXT("RenderForSelection(): ** START **\n")));
-    if (NULL == map || NULL == geometry)
+    if (NULL == map || (NULL == geometry && featureFilter.empty()))
         throw new MgNullArgumentException(L"MgServerRenderingService.RenderForSelection", __LINE__, __WFILE__, NULL, L"", NULL);
 
     if (maxFeatures < 0)
@@ -859,13 +863,10 @@
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
-    //convert the map coordinate system from srs wkt to a mentor cs structure
-    STRING srs = map->GetMapSRS();
-    Ptr<MgCoordinateSystem> mapCs = (srs.empty()) ? NULL : m_pCSFactory->Create(srs);
-
     // begin map stylization
     RS_Bounds b(0, 0, 1, 1);    // not used
     RS_Color bgcolor(0, 0, 0, 255); // not used
+    STRING srs = map->GetMapSRS();
     RS_MapUIInfo mapInfo(sessionId, map->GetName(), map->GetObjectId(), srs, L"", bgcolor);
 
     selRenderer->StartMap(&mapInfo, b, map->GetViewScale(), map->GetDisplayDpi(), map->GetMetersPerUnit());
@@ -983,6 +984,8 @@
 
             Ptr<MgCoordinateSystem> layerCs;
 
+            //convert the map coordinate system from srs wkt to a mentor cs structure
+            Ptr<MgCoordinateSystem> mapCs = (srs.empty()) ? NULL : m_pCSFactory->Create(srs);
             if (mapCs)
             {
                 STRING srcwkt = L"";
@@ -1024,30 +1027,47 @@
                 trans = new MgCoordinateSystemTransform(mapCs, layerCs);
             }
 
-            //if we have a valid transform, get the request geom in layer's space
-            Ptr<MgGeometricEntity> queryGeom = SAFE_ADDREF(geometry);
+            Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
+            if(geometry != NULL)
+            {
+                //if we have a valid transform, get the request geom in layer's space
+                Ptr<MgGeometricEntity> queryGeom = SAFE_ADDREF(geometry);
 
-            if (trans)
-            {
-                //get selection geometry in layer space
-                queryGeom = geometry->Transform(trans);
+                if (trans)
+                {
+                    //get selection geometry in layer space
+                    queryGeom = geometry->Transform(trans);
+                }
+                
+                //set the spatial filter for the selection
+                options->SetSpatialFilter(layer->GetFeatureGeometryName(), (MgGeometry*)(queryGeom.p), /*MgFeatureSpatialOperations*/selectionVariant);
             }
 
-            //execute the spatial query
-            Ptr<MgFeatureQueryOptions> options = new MgFeatureQueryOptions();
-            STRING geomPropName = layer->GetFeatureGeometryName();
-
-            //set the spatial filter for the selection
-            options->SetSpatialFilter(geomPropName, (MgGeometry*)(queryGeom.p), /*MgFeatureSpatialOperations*/selectionVariant);
-
             try
             {
-                if (!vl->GetFilter().empty())
+                if(!featureFilter.empty())
                 {
+                    //set the feature filter, if any
+                    MgSelection selectionFilter(map, featureFilter);
+                    Ptr<MgReadOnlyLayerCollection> layers = selectionFilter.GetLayers();
+                    if(layers != NULL)
+                    {
+                        for(int i = 0; i < layers->GetCount(); i++)
+                        {
+                            Ptr<MgLayerBase> layer = layers->GetItem(i);
+                            STRING className = layer->GetFeatureClassName();
+                            STRING filter = selectionFilter.GenerateFilter(layer, className);
+                            options->SetFilter(filter);
+                        }
+                    }
+                }
+                else if(!vl->GetFilter().empty())
+                {
                     //set layer feature filter if any
                     options->SetFilter(vl->GetFilter());
                 }
 
+
                 // TODO: can FeatureName be an extension name rather than a FeatureClass?
                 Ptr<MgFeatureReader> rdr = m_svcFeature->SelectFeatures(featResId, vl->GetFeatureName(), options);
                 RSMgFeatureReader rsrdr(rdr, m_svcFeature, featResId, options, vl->GetGeometry());

Modified: trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h
===================================================================
--- trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Server/src/Services/Rendering/ServerRenderingService.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -111,19 +111,21 @@
                                         MgStringCollection* layerNames,
                                         MgGeometry* geometry,
                                         INT32 selectionVariant, // Within, Touching, Topmost
+                                        CREFSTRING featureFilter,
                                         INT32 maxFeatures,
                                         bool bIgnoreScaleRange);
 
     virtual MgBatchPropertyCollection* QueryFeatureProperties( MgMap* map,
                                         MgStringCollection* layerNames,
-                                        MgGeometry* geometry,
+                                        MgGeometry* filterGeometry,
                                         INT32 selectionVariant, // Within, Touching, Topmost
                                         INT32 maxFeatures);
 
     virtual MgBatchPropertyCollection* QueryFeatureProperties( MgMap* map,
                                         MgStringCollection* layerNames,
-                                        MgGeometry* geometry,
+                                        MgGeometry* filterGeometry,
                                         INT32 selectionVariant, // Within, Touching, Topmost
+                                        CREFSTRING featureFilter,
                                         INT32 maxFeatures,
                                         bool bIgnoreScaleRange);
 
@@ -158,7 +160,8 @@
     void RenderForSelection(MgMap* map,
                          MgStringCollection* layerNames,
                          MgGeometry* geometry,
-                         INT32 selectionVariant, 
+                         INT32 selectionVariant,
+                         CREFSTRING featureFilter, 
                          INT32 maxFeatures,
                          FeatureInfoRenderer* selRenderer,
                          bool bIgnoreScaleRange);

Modified: trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -60,6 +60,10 @@
 
     // Get the ignore scale flag
     m_bIgnoreScale = params->GetParameterValue(MgHttpResourceStrings::reqRenderingIgnoreScale) == L"1";
+
+    // Get the feature filter
+    m_featureFilter = params->GetParameterValue(MgHttpResourceStrings::reqRenderingFeatureFilter);
+
 }
 
 /// <summary>
@@ -109,7 +113,7 @@
     // Call the HTML controller to process the request
     MgHtmlController controller(m_siteConn);
     Ptr<MgByteReader> featureDescriptionInfo = controller.QueryMapFeatures(
-        m_mapName, layerNames, geometry, selectionVariant, m_maxFeatures, m_persist, m_bIgnoreScale);
+        m_mapName, layerNames, geometry, selectionVariant, m_maxFeatures, m_persist, m_bIgnoreScale, m_featureFilter);
 
     // Set the result
     hResult->SetResultObject(featureDescriptionInfo, featureDescriptionInfo->GetMimeType());

Modified: trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Web/src/HttpHandler/HttpQueryMapFeatures.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -56,6 +56,7 @@
     STRING  m_layerNames;
     STRING  m_geometry;
     STRING  m_selectionVariant;
+    STRING  m_featureFilter;
     INT32   m_maxFeatures;
     bool    m_persist;
     bool    m_bIgnoreScale;

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.cpp	2007-03-22 20:18:50 UTC (rev 1349)
@@ -223,6 +223,7 @@
 const STRING MgHttpResourceStrings::reqRenderingSelection = L"SELECTION";
 const STRING MgHttpResourceStrings::reqRenderingSelectionVariant = L"SELECTIONVARIANT";
 const STRING MgHttpResourceStrings::reqRenderingGeometry = L"GEOMETRY";
+const STRING MgHttpResourceStrings::reqRenderingFeatureFilter = L"FEATUREFILTER";
 const STRING MgHttpResourceStrings::reqRenderingBaseMapLayerGroupName = L"BASEMAPLAYERGROUPNAME";
 const STRING MgHttpResourceStrings::reqRenderingTileColumn = L"TILECOL";
 const STRING MgHttpResourceStrings::reqRenderingTileRow = L"TILEROW";

Modified: trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-22 18:17:56 UTC (rev 1348)
+++ trunk/MgDev/Web/src/HttpHandler/HttpResourceStrings.h	2007-03-22 20:18:50 UTC (rev 1349)
@@ -162,6 +162,7 @@
     static const STRING reqRenderingSelection;
     static const STRING reqRenderingSelectionVariant;
     static const STRING reqRenderingGeometry;
+    static const STRING reqRenderingFeatureFilter;
     static const STRING reqRenderingBaseMapLayerGroupName;
     static const STRING reqRenderingTileColumn;
     static const STRING reqRenderingTileRow;



More information about the mapguide-commits mailing list