[mapguide-commits] r4446 - trunk/MgDev/Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Dec 16 21:59:13 EST 2009


Author: christinebao
Date: 2009-12-16 21:59:12 -0500 (Wed, 16 Dec 2009)
New Revision: 4446

Modified:
   trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
Log:
Fix ticket http://trac.osgeo.org/mapguide/ticket/1208
SelectFeatures doesn't work if filter is secondary property.

Modified: trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2009-12-16 19:24:28 UTC (rev 4445)
+++ trunk/MgDev/Server/src/Services/Feature/ServerSelectFeatures.cpp	2009-12-17 02:59:12 UTC (rev 4446)
@@ -1236,6 +1236,10 @@
             bool bForceOneToOne = true;
             Ptr<MgStringCollection> attributeNameDelimiters = new MgStringCollection();
 
+            //Store all the secondary's name, and if the filter property doesn't contain secondary's name, 
+            //it applies only to the primary.
+            Ptr<MgStringCollection> secondaryNames = new MgStringCollection();
+
             // For each join (attributeRelate) to a secondary source need to do the following
             for (int attributeRelateIndex = 0; attributeRelateIndex < attributeRelates->GetCount(); attributeRelateIndex++)
             {
@@ -1249,6 +1253,9 @@
                 STRING attributeRelateName = (STRING)attributeRelate->GetName();
                 STRING secondaryConnectionName = attributeRelateName;
 
+                if(!secondaryNames->Contains(attributeRelateName))
+                    secondaryNames->Add(attributeRelateName);
+
                 // Get the RelateType (join type).  Default is Left Outer join.
                 MdfModel::AttributeRelate::RelateType relateType = attributeRelate->GetRelateType();
 
@@ -1364,8 +1371,18 @@
                 FdoString* filterText = filter->ToString();
                 if(NULL != filterText)
                 {
-                    if(NULL == wcsstr(filterText, name.c_str()))
+                    bool match = false;
+                    for(int i = 0; i < secondaryNames->GetCount(); i ++)
                     {
+                        STRING secondaryName = secondaryNames->GetItem(i);
+                        if(NULL != wcsstr(filterText, secondaryName.c_str()))
+                        {
+                            match = true;
+                            break;
+                        }
+                    }
+                    if(!match)
+                    {
                         // Add the filter to the query because it only applies to the primary
                         query->SetFilter(filter);
                     }



More information about the mapguide-commits mailing list