[mapguide-trac] #354: Problem in the GenerateFilter() method of the MgSelection class

MapGuide Open Source trac_mapguide at osgeo.org
Tue Nov 25 04:26:17 EST 2008


#354: Problem in the GenerateFilter() method of the MgSelection class
---------------------------------------------------+------------------------
 Reporter:  pchevalier                             |         Owner:         
     Type:  defect                                 |        Status:  closed 
 Priority:  medium                                 |     Milestone:         
Component:  Feature Service                        |       Version:  2.0.0  
 Severity:  major                                  |    Resolution:  invalid
 Keywords:  bug GenerateFilter MgSelection FeatId  |   External_id:         
---------------------------------------------------+------------------------
Changes (by bscott):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 I found the problem.
 There is no error in the GenerateFilter command.
 The error come while posting xml data from the client js to the server
 aspx command.

 Here and example of what's going on with FeatID = 250.

 1) we get the XmlSelection from the Client API
 <FeatureSet>
   <Layer id="2c8890dc-0000-1000-8000-000c29aacf8c">
     <Class id="Schema1:uf_poly">
       <ID>+gAAAA==</ID>
     </Class>
   </Layer>
 </FeatureSet>

 2) we post this xml string to the server aspx, on the server we now have
 this string
 <FeatureSet>
   <Layer id="2c8890dc-0000-1000-8000-000c29aacf8c">
     <Class id="Schema1:uf_poly">
       <ID> gAAAA==</ID>
     </Class>
   </Layer>
 </FeatureSet>

 3) as we are creating a new MgSelection with this wrong value, the
 GenerateFilter command can't process it properly.

 Here is base64 representation of some FeatId
 247 : 9wAAAA==
 248 : +AAAAA==
 249 : +QAAAA==
 250 : +gAAAA==
 251 : +wAAAA==
 252 : /AAAAA==

 The little program failed with featIds 248,249,250,251, they all starts
 with +

 I'm pretty sure many of you who has experiences Selection/generateFilter
 problem have this same behavior.

 In the sample application, if you replace your URLEncode function ( witch
 is using the escape function)
 by encodeURIComponent your program runs properly without any errors :)


 Bruno Scott

 Bruno Scott

-- 
Ticket URL: <http://trac.osgeo.org/mapguide/ticket/354#comment:4>
MapGuide Open Source <http://mapguide.osgeo.org/>
MapGuide Open Source Internals


More information about the mapguide-trac mailing list