Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fxi opened this issue Feb 4, 2019 · 7 comments
Closed

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

fxi opened this issue Feb 4, 2019 · 7 comments
Assignees
Milestone

Comments

@fxi
Copy link

fxi commented Feb 4, 2019

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 eblondel self-assigned this Feb 4, 2019
@eblondel eblondel added this to the 0.4 milestone Feb 4, 2019
@eblondel
Copy link
Owner

eblondel commented Feb 4, 2019

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 eblondel added the bug label Feb 4, 2019
@eblondel eblondel changed the title GSServiceSettings$new Disable OGC service doesn't work for worskpace settings Feb 4, 2019
@eblondel
Copy link
Owner

eblondel commented Feb 4, 2019

@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:

  • for the global service settings, running an UPDATE operation to disable the WxS services works
  • for the workspace service settings, running an UPDATE doesn't work (And here you keep the checkbox 'checked' while it shouldn't), while the update request worked setting the property enabled to false in the rest config (with no effect on the checkbox). Instead a DELETE operation has to be applied, which deletes the service config. Unfortunately for me, this was not explicitely mentioned in the API doc, and the tests are not able to catch this.

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
Copy link
Author

fxi commented Feb 4, 2019

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 !

@eblondel eblondel added the funded label Feb 5, 2019
@fxi
Copy link
Author

fxi commented Feb 5, 2019

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
Copy link
Owner

eblondel commented Feb 5, 2019

You're welcome!

@eblondel eblondel closed this as completed Feb 5, 2019
@eblondel
Copy link
Owner

eblondel commented May 2, 2019

@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
Copy link
Author

fxi commented May 2, 2019

@eblondel Thanks for the notification !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants