[Geoserver-devel] Make WFS stored queries workspaces aware

Dear all,
as you may know WFS 2.0.x [1] stored queries are handled in a global way in GeoServer and are identified by their ID.

In certain use cases it would be necessary to have two stored queries with the same ID, but producing different results depending on the workspace.
Currently handling this requirement \ necessity requires instantiating several GeoServer instances.

The solution we have think of for the above is to implement support for per workspace stored queries:

  • when creating a stored query, if a workspace virtual service end-point is used, then the query will belong to that workspace:

    • but that stored query will only be visible \ usable from that workspace virtual end-point
  • if no workspace virtual service is used, then the stored query will be global, as it is now

In terms of stored queries usage (list stored queries, execute a stored query, etc …):

  • when targeting the global GeoServer end-point, only global stored queries will be visible:

    • hence two stored queries of different workspaces can have the same id
  • when targeting a workspace virtual service end-point, the workspace stored queries and global stored queries that don’t collide (don’t have the same id) will be considered:

  • considering also global queries will allow the definition of more generic stored queries, hence removing the need of duplication

  • considering global queries will be activated by default, but can be deactivated (flag in the workspace definition)

In terms of backwards compatibility:

  • global stored queries will be stored as they are now, so no data directory migration need

  • for backwards compatibility, a flag deactivating per workspace stored queries will be added:

  • if an user was using a virtual service end-point for creating stored-queries (we can do that now but the stored query will be global anyway), it can use that global flag to deactivate the new functionality

Technically speaking, the described functionalities would be implemented using a new org.geoserver.wfs.DefaultWebFeatureService20.getStoredQueryProvider() that is workspaces aware (using LocalWorkspace).

Feedback is welcome :slight_smile:

Should a GSIP be created for this?

Kind regards,
Nuno Oliveira

[1] http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#225

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts! 
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

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

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

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.

On Tue, 30 Jul 2019 at 08:13, Nuno Oliveira <nuno.oliveira@anonymised.com> wrote:

The solution we have think of for the above is to implement support for per workspace stored queries:

  • when creating a stored query, if a workspace virtual service end-point is used, then the query will belong to that workspace:
    • but that stored query will only be visible \ usable from that workspace virtual end-point

I like the approach, each virtual end-point is in effects its own service - in addition to per workspace use this should also cover per layer use?


Jody Garnett

t this stage it would only be by workspace.

On Tue, 2019-07-30 at 15:26 -0700, Jody Garnett wrote:

On Tue, 30 Jul 2019 at 08:13, Nuno Oliveira <nuno.oliveira@anonymised.com> wrote:

The solution we have think of for the above is to implement support for per workspace stored queries:

  • when creating a stored query, if a workspace virtual service end-point is used, then the query will belong to that workspace:
    • but that stored query will only be visible \ usable from that workspace virtual end-point

I like the approach, each virtual end-point is in effects its own service - in addition to per workspace use this should also cover per layer use?


Jody Garnett

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts! 
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

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

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

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.

Hi,
Is this solved? Would be great for our Inspire work.
Regards,
Tomas Funquist

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html

Hi,
yes, this has been merged on master:
https://osgeo-org.atlassian.net/browse/GEOS-9386

… is available on the nightly builds:
https://build.geoserver.org/geoserver/master/

Best regards,
Nuno Oliveira

On Wed, 2019-12-11 at 05:01 -0700, ToFu wrote:

Hi,
Is this solved? Would be great for our Inspire work.
Regards, 
Tomas Funquist

--
Sent from: [http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html](http://osgeo-org.1560.x6.nabble.com/GeoServer-Dev-f3819232.html)

_______________________________________________
Geoserver-devel mailing list
[Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-devel](https://lists.sourceforge.net/lists/listinfo/geoserver-devel)

-- 
Regards,
Nuno Oliveira
==
GeoServer Professional Services from the
experts! 
Visit http://goo.gl/it488V for more information.
==

Nuno Miguel Carvalho Oliveira
@nmcoliveira
Software Engineer

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

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

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati 
personali (Reg. UE 2016/679 - Regolamento generale sulla 
protezione dei dati “GDPR”), si precisa che ogni 
circostanza inerente alla presente email (il suo contenuto, 
gli eventuali allegati, etc.) è un dato la cui conoscenza 
è riservata al/i solo/i destinatario/i indicati dallo 
scrivente. Se il messaggio Le è giunto per errore, è 
tenuta/o a cancellarlo, ogni altra operazione è illecita. 
Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to 
which it is addressed and may contain information that 
is privileged, confidential or otherwise protected from 
disclosure. We remind that - as provided by European 
Regulation 2016/679 “GDPR” - copying, dissemination or 
use of this e-mail or the information herein by anyone 
other than the intended recipient is prohibited. If you 
have received this email by mistake, please notify 
us immediately by telephone or e-mail.