[Geoserver-devel] access to a layer's queryable flag through REST

hi,

a week ago i posted this to the users list but got no response. would
appreciate it if a GeoServer developer can find the time to give some
feedback:

quote

unless i missed the obvious, using GeoServer 2.8.5 the 'Queryable' flag
of a Layer appears in the [Edit Layer] Admin GUI page (under the [WMS
Settings] sub-heading w/in [Publishing] panel) but does not seem to be
included in the Response to either a Layer or a FeatureType GET
Requests.

is it possible to get hold of this information w/ REST calls?

if not then would it be advisable to write a WPS function to return
this information? the code of the ImportProcess suggests that it is
possible --by calling org.geoserver.catalog.LayerInfo#isQueryable().

unquote

TIA + cheers;
rsn

I had a quick look at the code (not for 2.8.5, which is way too old - you
really should upgrade), and I don't see it referenced in the REST API.

It could be added to the REST API or some other interface - feel free to
submit a PR or feature request. See
http://docs.geoserver.org/stable/en/user/introduction/gettinginvolved.html
and
http://docs.geotools.org/latest/userguide/welcome/support.html#issue-tracker
for more guidance.

Brad

Hi,
I believe you should find it in the REST representation, but it’s a bit finicky because
it’s a property that was not there in the original model, so it’s a Boolean (object reference),
null by default, and assumed to be “true” when missing (for backwards compatbilty, allows
for transparent upgrades).

Long story short, you won’t find it unless you edited it manually.
If I set it to false in the UI, then I can see:

countries

VECTOR

polygon

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“http://cloudsdi.geo-solutions.it/geoserver/rest/styles/polygon.xml” type=“application/xml”/>

test:countries

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“http://cloudsdi.geo-solutions.it/geoserver/rest/workspaces/test/datastores/world/featuretypes/countries.xml” type=“application/xml”/>

false

0

0

and then go back and edit again to re-enable it:

countries

VECTOR

polygon

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“http://cloudsdi.geo-solutions.it/geoserver/rest/styles/polygon.xml” type=“application/xml”/>

test:countries

<atom:link xmlns:atom=“http://www.w3.org/2005/Atom” rel=“alternate” href=“http://cloudsdi.geo-solutions.it/geoserver/rest/workspaces/test/datastores/world/featuretypes/countries.xml” type=“application/xml”/>

true

0

0

But normally it’s just not there. Hope this helps

Cheers
Andrea

···

On Wed, Mar 14, 2018 at 1:16 AM, Raif S. Naffah <raif@anonymised.com> wrote:

hi,

a week ago i posted this to the users list but got no response. would
appreciate it if a GeoServer developer can find the time to give some
feedback:

quote

unless i missed the obvious, using GeoServer 2.8.5 the ‘Queryable’ flag
of a Layer appears in the [Edit Layer] Admin GUI page (under the [WMS
Settings] sub-heading w/in [Publishing] panel) but does not seem to be
included in the Response to either a Layer or a FeatureType GET
Requests.

is it possible to get hold of this information w/ REST calls?

if not then would it be advisable to write a WPS function to return
this information? the code of the ImportProcess suggests that it is
possible --by calling org.geoserver.catalog.LayerInfo#isQueryable().

unquote

TIA + cheers;
rsn


Check out the vibrant tech community on one of the world’s most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Regards,

Andrea Aime

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.

thanks Andrea!

i do see it after explicitly setting/toggling the checkbox in the GUI
w/ the 2.8.5 version in both 'json' and 'xml' output formats.

On Wed, 14 Mar 2018 10:03:30 +0100, Andrea Aime wrote:

Hi,
I believe you should find it in the REST representation, but it's a
bit finicky because
it's a property that was not there in the original model, so it's a
Boolean (object reference),
null by default, and assumed to be "true" when missing (for backwards
compatbilty, allows
for transparent upgrades).

Long story short, you won't find it unless you edited it manually.
If I set it to false in the UI, then I can see:

<layer>
<name>countries</name>
<type>VECTOR</type>
<defaultStyle>
<name>polygon</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate"
href="
http://cloudsdi.geo-solutions.it/geoserver/rest/styles/polygon.xml&quot;
type=" application/xml"/> </defaultStyle>
<resource class="featureType">
<name>test:countries</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate"
href="
http://cloudsdi.geo-solutions.it/geoserver/rest/workspaces/test/datastores/world/featuretypes/countries.xml
" type="application/xml"/> </resource>
*<queryable>false</queryable>*
<attribution>
<logoWidth>0</logoWidth>
<logoHeight>0</logoHeight>
</attribution>
</layer>

and then go back and edit again to re-enable it:

<layer>
<name>countries</name>
<type>VECTOR</type>
<defaultStyle>
<name>polygon</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate"
href="
http://cloudsdi.geo-solutions.it/geoserver/rest/styles/polygon.xml&quot;
type=" application/xml"/> </defaultStyle>
<resource class="featureType">
<name>test:countries</name>
<atom:link xmlns:atom="http://www.w3.org/2005/Atom&quot; rel="alternate"
href="
http://cloudsdi.geo-solutions.it/geoserver/rest/workspaces/test/datastores/world/featuretypes/countries.xml
" type="application/xml"/> </resource>
*<queryable>true</queryable>*
<attribution>
<logoWidth>0</logoWidth>
<logoHeight>0</logoHeight>
</attribution>
</layer>

But normally it's just not there. Hope this helps

Cheers
Andrea

On Wed, Mar 14, 2018 at 1:16 AM, Raif S. Naffah <raif@anonymised.com>
wrote:

> hi,
>
> a week ago i posted this to the users list but got no response.
> would appreciate it if a GeoServer developer can find the time to
> give some feedback:
>
> quote
>
> unless i missed the obvious, using GeoServer 2.8.5 the 'Queryable'
> flag of a Layer appears in the [Edit Layer] Admin GUI page (under
> the [WMS Settings] sub-heading w/in [Publishing] panel) but does
> not seem to be included in the Response to either a Layer or a
> FeatureType GET Requests.
>
> is it possible to get hold of this information w/ REST calls?
>
> if not then would it be advisable to write a WPS function to return
> this information? the code of the ImportProcess suggests that it is
> possible --by calling org.geoserver.catalog.LayerInfo#isQueryable().
>
> unquote
>
> TIA + cheers;
> rsn
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-devel mailing list
> Geoserver-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>

--
cheers;
rsn