[Users] Question using GeoExt with WFS servers

Bart van den Eijnden bartvde at opengeo.org
Wed Oct 24 11:47:12 CEST 2012


Hey Chris,

thanks for the feedback, glad that it worked. The code I pointed you at has a TODO which says push to GeoExt ;-)

Pull requests are always welcome of course.

Best regards,
Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Oct 24, 2012, at 11:44 AM, Christopher Eykamp <christopher.eykamp at tudor.lu> wrote:

> Hi Bart,
> 
> Thank you -- this code does exactly what I was looking for.  
> 
> I do find it strange that GeoExt does not do this by default, as it appears to have the parsing code already built in, and the amount of extra processing involved would be minimal.
> 
> In any case, my immediate problem is solved, so thank you for your help!
> 
> Chris
> 
> 
> 
> 
> On 10/23/2012 11:46 AM, Bart van den Eijnden wrote:
>> Hi,
>> 
>> the OpenLayers WFS GetCapabilities parser provides this info, but the GeoExt reader is only interested in the feature types, not the service metadata.
>> 
>> You can do a similar thing as what is done here:
>> 
>> https://github.com/opengeo/gxp/blob/master/src/script/plugins/WMSSource.js#L37
>> 
>> Best regards,
>> Bart
>> 
>> -- 
>> Bart van den Eijnden
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>> 
>> 
>> 
>> On Oct 23, 2012, at 11:34 AM, Christopher Eykamp <christopher.eykamp at tudor.lu> wrote:
>> 
>>> Hello!
>>> 
>>> This is probably a very simple question but I just can't seem to figure it out.
>>> 
>>> I am writing a Javascript app to retrieve layer information from a WFS server using a GetCapabilities request using GeoExt. GetCapabilities returns information about the WFS server -- the server's name, who runs it, etc., in addition to information on the data layers it has on offer.
>>> 
>>> My basic code looks like this:
>>> 
>>> =====
>>> var store = new GeoExt.data.WFSCapabilitiesStore({ url: serverURL });
>>> 
>>> store.on('load', successFunction);
>>> store.on('exception', failureFunction);
>>> store.load();
>>> =====
>>> 
>>> This works as expected, and when the loading completes, successFunction is called.
>>> 
>>> successFunction looks like this:
>>> 
>>> =====
>>> successFunction = function(dataProxy, records, options) { 
>>>    doSomeStuff();
>>> }
>>> =====
>>> 
>>> dataProxy is a Ext.data.DataProxy object, records is a list of records, one for each layer on the WFS server, and options is empty.
>>> 
>>> And here is where I'm stuck: In this function, I can get access to all the layer information regarding data offered by the server. But I also want to extract the server information that is contained in the XML fetched during the store.load() (see below). I can't figure out how to get it out of the dataProxy object, where I'm sure it must be squirreled away.
>>> 
>>> Any ideas?
>>> 
>>> The fields I want are contained in this snippet:
>>> 
>>> =====
>>> <ows:ServiceIdentification>
>>>   <ows:Title>G_WIS_testIvago</ows:Title>
>>>   <ows:Abstract/>
>>>   <ows:Keywords>
>>>      <ows:Keyword/>
>>>   </ows:Keywords>
>>>   <ows:ServiceType>WFS</ows:ServiceType>
>>>   <ows:ServiceTypeVersion>1.1.0</ows:ServiceTypeVersion>
>>>   <ows:Fees/>
>>>   <ows:AccessConstraints/>
>>> =====
>>> 
>>> Thank you!
>>> 
>>> Chris Eykamp
>>> _______________________________________________
>>> Users mailing list
>>> Users at geoext.org
>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20121024/8b3d9380/attachment.htm 


More information about the Users mailing list