[Cartoweb-users] Query Table with Columns according to selected Layers

Carolin Latze carolin.latze at unifr.ch
Thu Sep 20 10:51:42 EDT 2007


Hi all,

I think I have to consult this list again, since I do not really have
any good ideas about how to solve my problem:

I wrote (or still write :-)) a plugin which should according to the
selected layer send a database request and add some new columns with
db-data to the result table. This works fine as long, as I hardcode the
layer information. But I want to have a generic plugin, which asks for
the selected layer  and builds the db request according to the layer
name (called label in layers.ini)

Now, my ideas:

First of all, I wrote a server part, which asks the mapserver for the
selected layers and for the appropriate layer label. Problem here: As
the plugin had to implement the ServerCaller interface, it was executed
too late. Next idea: I tried to put the db request into the handleResult
function. Again, the request was ok, but I think, the query table was
drawn before, so I didn't get my new columns.

Second idea: I wanted to use the layers plugin (and therefore deleted
the server part). Therefore, I inserted into the plugins initialize()
method:

        $layerPlugin = $this->cartoclient->getPluginManager()->layers;
        $layers = $layerPlugin->getSelectedLayers();
        $this->prdkt=$layers[0];

I think, what now happens, is that the plugin will be executed everytime
I connect to cartoweb.

My main problem is, that the db-request depends on the name(s) of the
selected layer(s), so I have to read them out at the moment, the user
queries map (layer) data. Does anybody have an idea how to solve this?

Thanks
Carolin

-- 
Carolin Latze
Research Assistant

Department of Computer Science
Boulevard de Pérolles 90
CH-1700 Fribourg

phone: +41 26 300 83 30




More information about the Cartoweb-users mailing list