[Geoserver-devel] GWC and workspace specific styles

Hi,
as you probably know it’s currently impossible to use workspace specific
styles with GWC, any attempt to use them just fails with exception.

Which basically means, GWC does not work at all in a multitenancy setup.
There is this “workspace” extra param that can be used, but it is not a good solution,
people need to know it has to be added, it’s not transparent as the integrated
GWC strives to be.

After talking with the n-th user that would have liked to use virtual services, but
was blocked by this issue, I got a little frustrated and asked myself “how hard
can it be?”.

After a couple of hours of hacking, the answer seems to be “not much”.
I’ve leveraged the support for prefixed style names in the catalog and
modified a bit the integration, so that everywhere a style name was used,
a prefixed name is now used instead.

I’ve then modified the tests for the “workspace” param to just remove it,
updated the many mock tests we have to use prefixedName, and voilà,
it seems to be working ok, it can be seeded and truncated,
and used in the GWC preview.

I’ve then checked the direct integration, which at first was not fully working
because the WMSWorkspaceQualifier was not qualifying styles too (a bit
trickier than qualifying layers, as a style can be both local and global).
After changing this also direct integration seems to be working ok, whether
a style is not specified, specified without or with prefix.

Anyways… would be nice if someone else could check this pull request?
https://github.com/geoserver/geoserver/pull/908

Going to have a look also at http://jira.codehaus.org/browse/GEOS-6512,
it was reported against the opengeo suite (sigh!), but I guess it can be reproduced
also with a standard geoserver.

Cheers

Andrea

···

==

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

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.


On Sun, Feb 1, 2015 at 11:47 AM, Andrea Aime <andrea.aime@anonymised.com>
wrote:

Going to have a look also at http://jira.codehaus.org/browse/GEOS-6512,
it was reported against the opengeo suite (sigh!), but I guess it can be
reproduced
also with a standard geoserver.

Turns out this one was quicker to fix. I did not push because it depends on
pull 908,
but you can review the changes here, it was a simple logic mistake in the
WMS workspace qualifier:

https://github.com/aaime/geoserver/commit/c88de8f3d085fad228878561dc9f7a57467a32b5

Cheers
Andrea

--

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

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.

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

I was looking at the same two problems in a different way. I’d considered the prefix route on styles but hadn’t noticed that solution to the LayerGroups issue and wanted to solve both. So I ended up working on improving the workspace parameter filter option instead, which lead to some improvements in GWC I’m still working on, specifically GWC ticket #170. The work I did should still be able to simplify the Style filter and make it more robust, while also making other new parameter filters with similarly dynamic behaviour easier to write and generally helping to avoid ‘leaking’ of parameterized tile caches, particular when using the RexExp filter.

I don’t think my route would have been backportable, and would have been a stretch to make it into GWC 1.7.x/GS 2.7.x now that we are beta so, even though it sort of obsoletes what I’ve been working on for the past few days, I’m glad to see this.

···

On 1 February 2015 at 03:22, Andrea Aime <andrea.aime@anonymised.com> wrote:


Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/


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

On Sun, Feb 1, 2015 at 11:47 AM, Andrea Aime <andrea.aime@anonymised.com268…> wrote:

Going to have a look also at http://jira.codehaus.org/browse/GEOS-6512,

it was reported against the opengeo suite (sigh!), but I guess it can be reproduced
also with a standard geoserver.

Turns out this one was quicker to fix. I did not push because it depends on pull 908,
but you can review the changes here, it was a simple logic mistake in the WMS workspace qualifier:

https://github.com/aaime/geoserver/commit/c88de8f3d085fad228878561dc9f7a57467a32b5

Cheers

Andrea

==

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

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.


Kevin Smith

Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo

http://boundlessgeo.com/

On Mon, Feb 2, 2015 at 8:31 PM, Kevin Smith <ksmith@anonymised.com> wrote:

I was looking at the same two problems in a different way. I'd considered
the prefix route on styles but hadn't noticed that solution to the
LayerGroups issue and wanted to solve both. So I ended up working on
improving the workspace parameter filter option instead, which lead to some
improvements in GWC I'm still working on, specifically GWC ticket #170.
The work I did should still be able to simplify the Style filter and make
it more robust, while also making other new parameter filters with
similarly dynamic behaviour easier to write and generally helping to avoid
'leaking' of parameterized tile caches, particular when using the RexExp
filter.

I don't think my route would have been backportable, and would have been a
stretch to make it into GWC 1.7.x/GS 2.7.x now that we are beta so, even
though it sort of obsoletes what I've been working on for the past few
days, I'm glad to see this.

I did not try to make the work backportable either (not with that intention
at least), but I find the workspace parameter... ugh....
GWC integration must be transparent, it's the primary feature of the
integrated GW, a solution that breaks it is imho no solution, but a
temporary band-aid in
user's face (e.g., exactly where it should not be, band aids are ugly, but
if needs be, better hide them under the carpet).

I see your comments about moving the workspace, did not consider it in fact
(2.5 hours hack on a Sunday morning... that's why I asked for a review :-p
),
but I don't see a problem taking it into account in a similar way to how we
consider workspace name changes in layers... am I missing something?

Cheers
Andrea

--

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

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
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.

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

Yes my plan was ultimately to hide the Workspace parameter and have the filter added and updated automatically the way the style filter is so it would all be transparent to the user. I don’t think you’re missing anything, I just wanted to make sure workspace renames were covered.

···

On 2 February 2015 at 12:44, Andrea Aime <andrea.aime@anonymised.com> wrote:

Yes my plan was ultimately to hide the Workspace parameter and have the filter added and updated automatically the way the style filter is so it would all be transparent to the user. The backportability issues I had with my solution were that it involved API changes in GWC: BlobStoreListener ended up with a new event to handle parameterizations being purged. I wasn’t happy with either of trying to put it in 1.7 this late or waiting for 1.8. Since your solution is much less intrusive and confined to GS, it should be able to make GS 2.7 and my parameterization purge/dynamic param filter work can go into GWC 1.8.

I just wanted to make sure that case was covered but I don’t think it presents any particular issues to your approach. It was one of the rare but annoying special cases that made my approach complicated.

Kevin Smith

Software Engineer | Boundless

ksmith@anonymised.com

+1-778-785-7459

@boundlessgeo

http://boundlessgeo.com/

On Mon, Feb 2, 2015 at 8:31 PM, Kevin Smith <ksmith@anonymised.com…> wrote:

I was looking at the same two problems in a different way. I’d considered the prefix route on styles but hadn’t noticed that solution to the LayerGroups issue and wanted to solve both. So I ended up working on improving the workspace parameter filter option instead, which lead to some improvements in GWC I’m still working on, specifically GWC ticket #170. The work I did should still be able to simplify the Style filter and make it more robust, while also making other new parameter filters with similarly dynamic behaviour easier to write and generally helping to avoid ‘leaking’ of parameterized tile caches, particular when using the RexExp filter.

I don’t think my route would have been backportable, and would have been a stretch to make it into GWC 1.7.x/GS 2.7.x now that we are beta so, even though it sort of obsoletes what I’ve been working on for the past few days, I’m glad to see this.

I did not try to make the work backportable either (not with that intention at least), but I find the workspace parameter… ugh…
GWC integration must be transparent, it’s the primary feature of the integrated GW, a solution that breaks it is imho no solution, but a temporary band-aid in
user’s face (e.g., exactly where it should not be, band aids are ugly, but if needs be, better hide them under the carpet).

I see your comments about moving the workspace, did not consider it in fact (2.5 hours hack on a Sunday morning… that’s why I asked for a review :-p ),
but I don’t see a problem taking it into account in a similar way to how we consider workspace name changes in layers… am I missing something?