VOL: Open Layers Add-on - Filtering WFS layers?

Hello all,

Its’ great that OpenLayers wrapper has been implemented for Vaadin. I’m starting to use it and it seems awesome!

I am a newbie and maybe this question is stupid, but I’m trying to use filtering in WFS in a similar way as done in WMS (see post below).

https://vaadin.com/forum/-/message_boards/view_message/442699

Is it possible? The filtering should be either CQL or with openlayers filters. For example:



          new OpenLayers.Layer.Vector("WFS", {
                strategies: [new OpenLayers.Strategy.BBOX()]
,
                protocol: new OpenLayers.Protocol.WFS({
                    url:  "http://demo.opengeo.org/geoserver/wfs",
                    featureType: "tasmania_roads",
                    featureNS: "http://www.openplans.org/topp"
                }),
                styleMap: new OpenLayers.StyleMap({
                    strokeWidth: 3,
                    strokeColor: "#333333"
                }),
                filter: new OpenLayers.Filter.Logical({
                    type: OpenLayers.Filter.Logical.OR,
                    filters: [
                        new OpenLayers.Filter.Comparison({
                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
                            property: "TYPE",
                            value: "highway"
                        }),
                        new OpenLayers.Filter.Comparison({
                            type: OpenLayers.Filter.Comparison.EQUAL_TO,
                            property: "TYPE",
                            value: "road"
                        })
                    ]
                })
            })

Thanks in advance!

Sergio

Hi,

I’m clad you like it.

I have never used WFS servers myself (except in some demos and test) and don’t remember directly if there is currently filtering support available. I do remember that WMS layer has such a feature, so if it is missing from WFS I bet it should be quite easy to add.

cheers,
matti

Thank you for your answer,

So you are suggesting to try to implement it myself? I’ll have a try but as I said I’m new to Vaadin. In fact I am not a Java programmer but rather C++ (yes I’m the devil).

I already took a look to the Vaadin book and tutorial, so I’m familiar to the development of Vaadin custom widgets.

I didn’t find any documentation on VOL. I have downloaded the source code and took a look. It seems that there are already some filter wrappers (org.vaadin.vol.wrappers) and some filter classes (org.vaadin.vol.filter) , but are not used in the code.

Am I missing anything? Do you have any suggestion on where I should start messing with your code?

Thank you in advance!

Cheers!

Sergio

Ok, not necessary the most easiest part to start working with Vaadin add-ons, especially if java world isn’t that familiar yet either. If it gets too complicated I’d just put all my bets for a good issue report to the development site of the add-on. And if you really need results soon, you should
go for Pro
and let one of our experts tackle this issue.

You’d have add code to both server and client side components and also modify those GWT overlay classes that actually command the underlaying OpenLayers library. Classes you could look as a reference would be WebMapServiceLayerStyled and its ‘V’ prefixed client side counterpart. Also their superclasses might be good to check out.

cheers,
matti