[Cartoweb-users] Creating a filter plugin

Dirk Jesko ml.dje at geocontent.de
Fri Apr 20 12:09:20 EDT 2007


Hello,

I am working on a filter plugin. So far, most of the client side is 
done. There is an ini file, that contains a list of layers and templates 
of the filter strings. The client class parses the form and generates an 
array of FilterRequest objects (FilterRequest implements CwSerializable) 
which looks like

Array
(
    [0] => FilterRequest Object
        (
            [layerId] => wzbra_branche
            [filter] => the_geom from (SELECT gid, the_geom ...) USING 
UNIQUE gid USING SRID=31468
            [className] => FilterRequest
        )

    [1] => FilterRequest Object
        (
            [layerId] => kreise
            [filter] => the_geom from (SELECT gid, the_geom FROM ...) 
USING UNIQUE gid USING SRID=31468
            [className] => FilterRequest
        )

)

Further, I created a Server class that implements 
ClientResponderAdapter. Both parts of the plugin are loaded in the ini 
files. I also have an idea about setting the filter on the server side. 
However, I am stuck with the communication between client and server:

1. How do I transfer an array of FilterRequest objects? Do I need a 
separate class in the common part?

2. How should the wsdl for the FilterRequest class look like? Probably

      <complexType name="FilterRequest">
        <all>
          <element name="layerId" type="xsd:string"/>
          <element name="filter" type="xsd:string"/>
        </all>
      </complexType>

But how do I handle the array of requests?

3. Which function on the server side should I use to handle the request 
and set the filter strings?

And finally a general question:
I would like to prevent that Cartoweb fails and shows an error message 
if the provided filter is wrong, e.g. syntax errors. Supposed a user 
provides an incorrect filter string, can I somehow test the filter and 
ignore it?


Thanks,
Dirk



More information about the Cartoweb-users mailing list