Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryPanel: allow case-insensitive string comparison WFS Filters #189

Open
justb4 opened this issue May 23, 2013 · 1 comment
Open

QueryPanel: allow case-insensitive string comparison WFS Filters #189

justb4 opened this issue May 23, 2013 · 1 comment

Comments

@justb4
Copy link
Contributor

justb4 commented May 23, 2013

gxp.QueryPanel allows one to construct spatial and attribute filters interactively. Attribute Filters are constructed and encoded using OpenLayers' Filter, in particular OpenLayers.Filter.Comparison. This Filter, allows a config parameter 'matchCase', which, when set to 'false' will encode an OGC Filter attribute matchCase="true" in Comparison Filters like <ogc:PropertyIsEqualTo >. Think WFS needs to be 1.1.0 or higher. It will be very useful and trivial to add a configuration parameter to QueryPanel to allow matchCase to be specified. A step further would be to add a GUI widget, maybe via plugin, to specify matchCase interactively. But to add as a configuration parameter, with a more meaningful name such as 'caseInsensitiveMatch' is quite trivial and has been proven to work.

In QueryPanel.initComponent:

   this.filterBuilder = new gxp.FilterBuilder({
        //anchor: "-8px",
        attributes: this.attributeStore,
        allowGroups: false,
        caseInsensitiveMatch: this.caseInsensitiveMatch
    });

And use this in gxp.FilterBuilder (and gxp.form.FilterField to be on the safe side):

createDefaultFilter: function() {
    return new OpenLayers.Filter.Comparison({
                        matchCase: !this.caseInsensitiveMatch});
},

This results in matchCase="true" in Comparison Filters like ogc:PropertyIsEqualTo.

I have made these changes in my GXP clone and can issue a pull request. Let me know if found useful.

Same story may be for Wildcards, but need to dive into.

justb4 added a commit to justb4/gxp that referenced this issue May 23, 2013
@ahocevar
Copy link
Contributor

This looks good. Can you turn it into a pull request? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants