[Geoserver-devel] REST API - Use prefixed layer names in lists and links

This has been an ongoing issue, and has a number of associated JIRA tickets:

The issue is that layers of the same name in different workspaces show up identically when listing layers using the rest API (not noted in most of these issues is that this also affects the layer list shown when viewing a layer group).
This also presents as a legitimate error for links to layers, as links also use the unprefixed name and therefore always go to the default / first layer with that name.

There has been a bunch of ongoing discussion, which ultimately boils down to we should probably use prefixed layer names. However, this is a little bit of an API change.

I have a PR with a (potential) fix (and further details) here: https://github.com/geoserver/geoserver/pull/2733

There’s enough of a change in behaviour that this probably shouldn’t get back-ported, but otherwise I don’t think it is too problematic - After my fix, prefixed names are only used in lists of layers, not in the layer details (this is consistent with how we currently handle stores or resources in the rest API). Examples can be seen in the PR description.

Any comments/discussion?

Torben

Any comments/discussion?

Encouragement and enthusiasm :slight_smile:

Discussion

Resource REST URLs include workspace and datastore

Is there any point of including workspace in the path, consistent with
coverages and feature types?

from:

http://localhost:8080/geoserver/rest/layers/sf%3Aroads.xml

nice to have:

http://localhost:8080/geoserver/rest/sf/layers/roads.xml

Is there any point of including workspace in the path, consistent with
coverages and feature types?

from:

http://localhost:8080/geoserver/rest/layers/sf%3Aroads.xml

nice to have:

http://localhost:8080/geoserver/rest/sf/layers/roads.xml

Thats probably worth adding (to nitpick, it would be http://localhost:8080/
geoserver/rest/workspaces/sf/layers/roads.xml )
Although if we went that route, we should still support
http://localhost:8080/geoserver/rest/layers/sf%3Aroads.xml for backwards
compatibility.

Torben

On 25 January 2018 at 14:45, Torben Barsballe <tbarsballe@anonymised.com>
wrote:

nice to have:

http://localhost:8080/geoserver/rest/sf/layers/roads.xml

Thats probably worth adding (to nitpick, it would be
http://localhost:8080/geoserver/rest/workspaces/sf/layers/roads.xml )

Agreed, although it is hard to make the rest api consistent.

Although if we went that route, we should still support
http://localhost:8080/geoserver/rest/layers/sf%3Aroads.xml for backwards
compatibility.

Agreed.

Adding a workspaces endpoint for layers was actually pretty easy.
The PR has been updated accordingly. I have also added updated API docs to the PR.

Torben

···

On Thu, Jan 25, 2018 at 2:54 PM, Jody Garnett <jody.garnett@anonymised.com> wrote:

On 25 January 2018 at 14:45, Torben Barsballe <tbarsballe@anonymised.com> wrote:

Agreed, although it is hard to make the rest api consistent.

Agreed.

nice to have:

http://localhost:8080/geoserver/rest/sf/layers/roads.xml

Thats probably worth adding (to nitpick, it would be http://localhost:8080/geoserver/rest/workspaces/sf/layers/roads.xml )
Although if we went that route, we should still support http://localhost:8080/geoserver/rest/layers/sf%3Aroads.xml for backwards compatibility.

Looking good, thanks Torben!

Cheers
Andrea

···

On Thu, Jan 25, 2018 at 11:08 PM, Torben Barsballe <tbarsballe@anonymised.com> wrote:

This has been an ongoing issue, and has a number of associated JIRA tickets:

The issue is that layers of the same name in different workspaces show up identically when listing layers using the rest API (not noted in most of these issues is that this also affects the layer list shown when viewing a layer group).
This also presents as a legitimate error for links to layers, as links also use the unprefixed name and therefore always go to the default / first layer with that name.

There has been a bunch of ongoing discussion, which ultimately boils down to we should probably use prefixed layer names. However, this is a little bit of an API change.

I have a PR with a (potential) fix (and further details) here: https://github.com/geoserver/geoserver/pull/2733

There’s enough of a change in behaviour that this probably shouldn’t get back-ported, but otherwise I don’t think it is too problematic - After my fix, prefixed names are only used in lists of layers, not in the layer details (this is consistent with how we currently handle stores or resources in the rest API). Examples can be seen in the PR description.

Any comments/discussion?

Torben


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.