[Geoserver-devel] Default separator for CQL

Hi Gabriel,
the WSF filter spec uses ( and ) to separate OGC filters in a get
request. I'm looking for a separator for CQL. It seems [ and ] would do?
What I need to do is to parse something like:

CQL_FILTER=[A + B < 10][ATT1 = "Gimbo"]
or
CQL_FILTER=A + B < 10|ATT1 = "Gimbo"

into two separate filters. Does CQL have the concept of a filter list?
I need to pick up a character that has low likeliness of interfering
with the CQL itself, since our way to split OGC filters is to use
a lame StringTokenizer, that can't really manage nesting

Cheers
Andrea

Hi Andrea,
I've added the possibility to parse a list of filters separated by a delimiter
directly on the cql parser.

Take a look at http://jira.codehaus.org/browse/GEOT-1162 and
http://docs.codehaus.org/display/GEOTOOLS/CQL+User+Guide for more details.

Basically you can use the | character as separator and will get back a
List<Filter>. So, say you have tree layers and want to apply a filter only to
the one in the middle of the list, use INCLUDE on the others to mean
Filter.INCLUDE, like in:
CQL_FILTER=INCLUDE|ATT1 = "Gimbo"|INCLUDE

Hope that helps.

Gabriel

On Tuesday 13 February 2007 10:14, Andrea Aime wrote:

Hi Gabriel,
the WSF filter spec uses ( and ) to separate OGC filters in a get
request. I'm looking for a separator for CQL. It seems [ and ] would do?
What I need to do is to parse something like:

CQL_FILTER=[A + B < 10][ATT1 = "Gimbo"]
or
CQL_FILTER=A + B < 10|ATT1 = "Gimbo"

into two separate filters. Does CQL have the concept of a filter list?
I need to pick up a character that has low likeliness of interfering
with the CQL itself, since our way to split OGC filters is to use
a lame StringTokenizer, that can't really manage nesting

Cheers
Andrea

--
Gabriel Roldán (groldan@anonymised.com)
Axios Engineering (http://www.axios.es)
Tel. +34 944 41 63 84
Fax. +34 944 41 64 90

Gabriel Roldán ha scritto:

Hi Andrea,
I've added the possibility to parse a list of filters separated by a delimiter directly on the cql parser.

Take a look at http://jira.codehaus.org/browse/GEOT-1162 and http://docs.codehaus.org/display/GEOTOOLS/CQL+User+Guide for more details.

Basically you can use the | character as separator and will get back a List<Filter>. So, say you have tree layers and want to apply a filter only to the one in the middle of the list, use INCLUDE on the others to mean Filter.INCLUDE, like in:
CQL_FILTER=INCLUDE|ATT1 = "Gimbo"|INCLUDE

Sure it does :slight_smile:
Thank you Gabriel! At least we don't need fancy separator attributes for CQL... we only miss support for fid filters now, in the meantime, the
documentation (that I still have to write, lazy me) will state that if you need fid filters, you should fall back on the FEATUREIDS=xxx parameter or use the OGC Filter.
Cheers
Andrea