Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#327 closed defect (fixed)

Query: The matched objects excluded by layer filter are listed in Query result.

Reported by: jennyhe Owned by: madair
Priority: P2 Milestone: Future
Component: Widgets Version: 1.1.1
Severity: Major Keywords:
Cc: christine.bao@… Browser: All
External ID: 1277730 Operating System: All
state: New


Report from Autodesk QA


  1. Load the attached package.
  2. Open the flexible web layout by IE.
  3. Query -> Property Filter -> Autogenerated_SDF_ID, Equal, 11 -> Execute query

Results: One record named "11" are listed in Results panel.

Expected results: Query should do against the layer but not the data source.

Attachments (4)

1277730.mgp (170.9 KB ) - added by jennyhe 14 years ago.
GetFilterAPI.patch (2.5 KB ) - added by christinebao 14 years ago.
QueryFilter.patch (1.6 KB ) - added by christinebao 14 years ago.
SerializeFilter.patch (593 bytes ) - added by christinebao 14 years ago.

Download all attachments as: .zip

Change History (9)

by jennyhe, 14 years ago

Attachment: 1277730.mgp added

by christinebao, 14 years ago

Attachment: GetFilterAPI.patch added

by christinebao, 14 years ago

Attachment: QueryFilter.patch added

comment:1 by christinebao, 14 years ago

The indeed of this defect is: Query widget only considers the query condition inside the widget, but ignore the query condition of the layer.
For example, if the layer has a filter "Autogenerated_SDF_ID < 2", the layer in map should only display one feature with Autogenerated_SDF_ID = 1. When user input Autogenerated_SDF_ID=3 as query widget's condition, there should be no result matching because the real condition should be "Autogenerated_SDF_ID < 2 AND Autogenerated_SDF_ID = 3". However currently only "Autogenerated_SDF_ID = 3" is set as query condition, so another feature (Autogenerated_SDF_ID = 3) besides the original one (Autogenerated_SDF_ID = 1) shows in map.

Tech diagnosis:

  1. MgLayerBase should have an API to get the filter.
  2. query.php function Execute() should consider the filter if exist.

Based on the above tech diagnosis, attach patch for fixing this defect.
There are two patches:

  1. GetFilterAPI.patch is to add an API in MgLayerBase to get the filter when parsing layer definition model.
  2. QueryFilter.patch is to consider layer filter if exists.

As you can see, I added an new API GetFilter() to get the filter of layer definition. Is there any other way to approach this without a new API? I see a function in MgSelectionBase for generate filter, however it is for a difference usage, isn't it?

STRING GenerateFilter(MgLayerBase* layer, CREFSTRING className);

Thank you for reviewing!

comment:2 by chrisclaydon, 14 years ago

The patches look good Christine. Please remove the /// false otherwise. from the method documentation in LayerBase.h - it look like it is just left over from a cut and paste.

comment:4 by christinebao, 14 years ago

Resolution: fixed
Status: newclosed

Submit the patches for fixing this defect.

by christinebao, 14 years ago

Attachment: SerializeFilter.patch added

comment:5 by christinebao, 14 years ago

MgMap::Open(resourceService, mapName) needs to serialize/deserialize, so m_filter should be serialized/deserialized in MgLayer, otherwise browser can't get the value.

Attach patch for review.

This patch is tested by the above ticket, and Query widget can get the expected filter.

Note: See TracTickets for help on using tickets.