<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hi,</div><div><br></div><div>so to get this straight....you are writing the abstract and keywords in geoserver, right? how are you linking the tree node to the grid? or am I missing something?</div><div><br></div><div>How does the user activate the metadata?</div><div><br></div><div>is your working example in the web?</div><div><br></div><div>yours,</div><div><br></div><div>Rob</div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><br><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><font size="2" face="Tahoma"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Antony Scott <Antony.Scott@sustain.co.uk><br><b><span style="font-weight: bold;">An:</span></b> Andreas Hocevar <ahocevar@opengeo.org><br><b><span style="font-weight:
bold;">CC:</span></b> "users@geoext.org" <users@geoext.org><br><b><span style="font-weight: bold;">Gesendet:</span></b> Mittwoch, den 3. August 2011, 17:16:16 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b> Re: [Users] Accessing Layer Metadata (SOLVED)<br></font><br>Andreas<br><br>Perfect, that works, see below.<br><br>Many thanks<br>Antony<br><br>...........................................................................................................<br><br> var md_store = new GeoExt.data.WMSCapabilitiesStore({<br> url: "<a href="http://localhost:8080/geoserver/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" target="_blank">http://localhost:8080/geoserver/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities</a>",<br> autoLoad: true,<br> fields: ["name","title","abstract","keywords"],<br>
listeners: {<br> 'load' : function(store,records,options) <br> { <br> store.loaded = true;<br> store.filter("keywords","test");<br> }<br> }, <br> });<br> <br><br> var md_grid = new Ext.grid.GridPanel({<br> collapsible: true,<br> split: true, initialSize: 100, <br> autoScroll:true,<br> height:
200,<br> width: 320,<br> title: "Available WMS Layers",<br> region: "south",<br> viewConfig: {forceFit: true},<br> store: md_store,<br> columns: [<br> {header: "Name", dataIndex: "name", sortable: true},<br> {header: "Title", dataIndex: "title", sortable: true},<br> {header: "Abstract", dataIndex: "abstract"},<br> {header: "Keywords", dataIndex: "keywords"}<br> ]<br> });<br><br>-----Original
Message-----<br>From: Andreas Hocevar [mailto:<a ymailto="mailto:ahocevar@opengeo.org" href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>] <br>Sent: 03 August 2011 13:52<br>To: Antony Scott<br>Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>Subject: Re: [Users] Accessing Layer Metadata<br><br>You cannot filter the store before it is loaded - add a load listener to the store, and set your filter there.<br><br>Andreas.<br><br>On Aug 3, 2011, at 14:40 , Antony Scott wrote:<br><br>> Andreas,<br>> <br>> Thanks, but still having no luck, below are relevant sections of my code in case someone cam spot where I am going wrong...<br>> <br>> At the top:<br>> <br>> var md_store = new GeoExt.data.WMSCapabilitiesStore({<br>> url: "<a href="http://localhost:8080/geoserver/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities"
target="_blank">http://localhost:8080/geoserver/ows?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities</a>",<br>> fields: ["name","title","abstract","keywords"],<br>> autoLoad: true<br>> });<br>> <br>> md_store.filter("keywords","test");<br>> <br>> var md_grid = new Ext.grid.GridPanel({<br>> collapsible: true,<br>> split: true, initialSize: 100, <br>> autoScroll:true,<br>> height: 200,<br>> width: 320,<br>> title: "Available WMS Layers",<br>> region:
"south",<br>> viewConfig: {forceFit: true},<br>> store: md_store,<br>> columns: [<br>> {header: "Name", dataIndex: "name", sortable: true},<br>> {header: "Title", dataIndex: "title", sortable: true},<br>> {header: "Abstract", dataIndex: "abstract"},<br>> {header: "Keywords", dataIndex: "keywords"}<br>> ]<br>> });<br>> <br>> .....................<br>> At the bottom:<br>> xtype: 'panel',<br>>
defaults:{autoScroll:true}, <br>> region: 'west',<br>> split: true,<br>> width: 250,<br>> items: [ tree<br>> , formPanel<br>> , legendPanel<br>> ]<br>> }<br>> , md_grid<br>> ]<br>> });<br>> <br>> Currently I'm seeing all 22 of my GeoServer layers in the grid, rather than the one which I would expect the filter to return.<br>> <br>> Many thanks<br>> Antony<br>> <br>> -----Original Message-----<br>> From: Andreas Hocevar [mailto:<a ymailto="mailto:ahocevar@opengeo.org"
href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>] <br>> Sent: 03 August 2011 12:04<br>> To: Antony Scott<br>> Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>> Subject: Re: [Users] Accessing Layer Metadata<br>> <br>> Hi,<br>> <br>> you have to apply the filter *before* your tree loaders access the store. The loaders don't listen to filter changes.<br>> <br>> Andreas.<br>> <br>> On Aug 3, 2011, at 12:42 , Antony Scott wrote:<br>> <br>>> Andreas<br>>> <br>>> Many thanks - yes I tried that too, but same result, nothing I have tried actually applies the filter to my data.<br>>> <br>>> As per Rob (go Brissle..!), ideally I'd like something which was sensitive to the layers in the tree to avoid having to set a bespoke filter, but maybe that would require some extension development.<br>>> <br>>> Cheers<br>>> Antony
<br>>> <br>>> -----Original Message-----<br>>> From: Andreas Hocevar [mailto:<a ymailto="mailto:ahocevar@opengeo.org" href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>] <br>>> Sent: 03 August 2011 10:24<br>>> To: Antony Scott<br>>> Cc: <a ymailto="mailto:users@geoext.org" href="mailto:users@geoext.org">users@geoext.org</a><br>>> Subject: Re: [Users] Accessing Layer Metadata<br>>> <br>>> Hi,<br>>> <br>>> filtering a store is the same for all Ext stores. See <a href="http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.data.Store" target="_blank">http://dev.sencha.com/deploy/ext-3.4.0/docs/?class=Ext.data.Store</a>.<br>>> <br>>> In your snippet, this would be<br>>> <br>>> store.filter("keywords", "test");<br>>> <br>>> Andreas.<br>>> <br>>> On Aug 3, 2011, at 10:34 , Antony Scott wrote:<br>>> <br>>>> Good morning
all<br>>>> <br>>>> I've been trying to find a simple way of displaying the metadata for the layers I am using in a layer tree. I've managed to list all the layers in an ExtJS gridPanel, but have not been able to successfully apply a filter to the store - this, for example, seems to have no effect on the list, which displays all my GeoServer layers:<br>>>> store.filter([ { <br>>>> property : 'keywords', <br>>>> value : 'test'}]);<br>>>> <br>>>> Ideally in fact I would like to display - either in a grid, or in the tree itself - metadata for only the layers which are shown in the tree.<br>>>>
<br>>>> The other option I have looked at is storing the metadata in the SLD, though as it relates to the layer rather than the style I would prefer not to do this.<br>>>> <br>>>> Can anyone point me in the direction of a working example?<br>>>> <br>>>> Many thanks<br>>>> <br>>>> Antony<br>>>> <br>>>> Antony Scott<br>>>> <br>>>> <br>>>> Sustain is a leading carbon reduction company. Our clients have saved<br>>>> <br>>>> 4,131,800 lifetime tCO2e through working with us (June 2011)<br>>>> <br>>>> <br>>>> <br>>>> Sustain Ltd. Registered in England No. 3384793 <br>>>> Barley Wood Stables, Long Lane, Wrington, Bristol BS40 5SA, UK<br>>>> <br>>>> This e-mail and any attachments are strictly confidential and intended solely for the <br>>>> addressee. If you are not
the intended recipient of this document then you must <br>>>> immediately inform the sender and delete this e-mail and any attachments from <br>>>> your system.<br>>>> <br>>>> E-mail transmissions cannot be guaranteed to be secure or error free as information <br>>>> could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. The sender <br>>>> does not accept liability for any errors or omissions in the content of this message <br>>>> which arise as a result of e-mail transmission.<br>>>> <br>>>> <br>>>> _______________________________________________<br>>>> Users mailing list<br>>>> <a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br>>>> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users"
target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>>> <br>>> <br>>> <br>>> -- <br>>> Andreas Hocevar<br>>> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>>> Expert service straight from the developers.<br>>> <br>>> <br>>> Sustain is a leading carbon reduction company. Our clients have saved <br>>> 4,131,800 lifetime tCO2e through working with us (June 2011)<br>>> <br>>> ------------------------------------------------------------<br>>> <br>>> Sustain Ltd. Registered in England No. 3384793<br>>> Barley Wood Stables, Long Lane, Wrington, Bristol BS40 5SA, UK<br>>> <br>>> ------------------------------------------------------------<br>>> <br>>> This e-mail and any attachments are strictly confidential <br>>> and intended solely for the addressee. If you are not
the <br>>> intended recipient of this document then you must <br>>> immediately inform the sender and delete this e-mail and <br>>> any attachments from your system.<br>>> <br>>> E-mail transmissions cannot be guaranteed to be secure or <br>>> error free as information could be intercepted, corrupted, <br>>> lost, destroyed, arrive late or incomplete. The sender<br>>> does not accept liability for any errors or omissions in<br>>> the content of this message which arise as a result of <br>>> e-mail transmission.<br>>> <br>>> ------------------------------------------------------------<br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>> <br>>>
_______________________________________________<br>>> Users mailing list<br>>> <a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br>>> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>> <br>> -- <br>> Andreas Hocevar<br>> OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>> Expert service straight from the developers.<br>> <br>> <br>> Sustain is a leading carbon reduction company. Our clients have saved <br>> 4,131,800 lifetime tCO2e through working with us (June 2011)<br>> <br>> ------------------------------------------------------------<br>> <br>> Sustain Ltd. Registered in England No. 3384793<br>> Barley Wood Stables, Long Lane, Wrington, Bristol BS40 5SA, UK<br>> <br>>
------------------------------------------------------------<br>> <br>> This e-mail and any attachments are strictly confidential <br>> and intended solely for the addressee. If you are not the <br>> intended recipient of this document then you must <br>> immediately inform the sender and delete this e-mail and <br>> any attachments from your system.<br>> <br>> E-mail transmissions cannot be guaranteed to be secure or <br>> error free as information could be intercepted, corrupted, <br>> lost, destroyed, arrive late or incomplete. The sender<br>> does not accept liability for any errors or omissions in<br>> the content of this message which arise as a result of <br>> e-mail transmission.<br>> <br>> ------------------------------------------------------------<br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>> <br>>
<br>> <br>> <br>> <br>> <br>> <br>> _______________________________________________<br>> Users mailing list<br>> <a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br>> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br><br>-- <br>Andreas Hocevar<br>OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>Expert service straight from the developers.<br><br><br>Sustain is a leading carbon reduction company. Our clients have saved <br>4,131,800 lifetime tCO2e through working with us (June 2011)<br><br>------------------------------------------------------------<br><br>Sustain Ltd. Registered in England No. 3384793<br>Barley Wood Stables, Long Lane, Wrington, Bristol BS40 5SA, UK<br><br>------------------------------------------------------------<br><br>This e-mail and any
attachments are strictly confidential <br>and intended solely for the addressee. If you are not the <br>intended recipient of this document then you must <br>immediately inform the sender and delete this e-mail and <br>any attachments from your system.<br><br>E-mail transmissions cannot be guaranteed to be secure or <br>error free as information could be intercepted, corrupted, <br>lost, destroyed, arrive late or incomplete. The sender<br>does not accept liability for any errors or omissions in<br>the content of this message which arise as a result of <br>e-mail transmission.<br><br>------------------------------------------------------------<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>_______________________________________________<br>Users mailing list<br><a ymailto="mailto:Users@geoext.org" href="mailto:Users@geoext.org">Users@geoext.org</a><br><a
href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br></div></div><div style="position:fixed"></div>
</div></body></html>