eblondel / geosapi

R interface to GeoServer REST API
https://github.com/eblondel/geosapi/wiki
Other
34 stars 5 forks source link

Disable OGC service doesn't work for worskpace settings #45

Closed fxi closed 5 years ago

fxi commented 5 years ago

Hi @eblondel,

Hope you started well this year !

I have encountered a small glitch. Maybe it's an misunderstanding of mine :

# Update service : disable it
setting <- GSServiceSettings$new( service = 'WMS' )
setting$setEnabled( FALSE )
gsman$updateServiceSettings(setting, service = 'wms', ws = 'foo')

Should have disabled it, but apparently it doesn't:

image

Thanks for looking at this.

CC: @PierreLacroix

eblondel commented 5 years ago

Hi @fxi hope the year started well for you and your team. i'm going to have a look asap to this, and report to you.

eblondel commented 5 years ago

@fxi, @PierreLacroix first apologies for this glitch. This issue escaped to the latest enhancements because of wrong 'vocabulary' I followed and some differences in the Geoserver REST API whether we deal with the global config or the workspace config. Until now, i was thinking that enabling/disabling were operated with an UPDATE operation, which makes senses (in principle), and this is in line with the piece of code you tried.

But I've realized that Geoserver doesn't treat an OGC service enabling/disabling (what we have as checkbox in the Web Interface) in the same way depending if you look at global service or workspace service:

I've pushed some fix for this, and tried out on GeoServer 2.14.

It's important that you don't use the updateServiceSettings method for that, but rather the shortcuts i've put in place such as disableWMS, disableWFS, disableWCS. Depending if you disable a global or workspace setting, geosapi will apply the right operation behind (UPDATE, DELETE).

Let me know

fxi commented 5 years ago

Thanks for this! To wrap it up, after updating geosapi, enableWxS for enabling and disableWxS for disabling. Keep updateServiceSettings for other settings such as title. I will look at this tomorrow first thing. Have a nice evening !

fxi commented 5 years ago

So, I've modified my wrapper/bridge around geosapi and it seems to work well. Each CRUD operation we do in our app is now fully reproduced in GeoServer through geosapi. If our "in-depth" tests show something else, I will reopen this issue or create a new one. Thanks for your efficiency !

eblondel commented 5 years ago

You're welcome!

eblondel commented 5 years ago

@fxi just to let you know that i've submitted geosapi in CRAN, and it has been accepted for publication. Soon i'll create a tag in github to match this release.

fxi commented 5 years ago

@eblondel Thanks for the notification !