Hi Jody,
Sorry for the delay in the reply.
Regarding the documentation, yes this is not easy to document ... I will
have to use a lot of examples.
By the way, this module includes an UI which helps design and manage the
rules (it is also possible to test the rules in the UI).
No changes in the core will be required.
I have used the GeoServerFilter and ExtensionPriority extension points,
basically I wrap the HttpServeletRequest with a custom wrapper that will
provide the transformed request info.
The work is pretty much done ... tomorrow I will do a pull request for this.
Regards,
--
==
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 Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 333 8128928
http://www.geo-solutions.ithttp://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.
2016-01-24 19:49 GMT+00:00 Jody Garnett <[email protected]>:
> +1 That sounds really cool, and very tricky to document!
>
> Can you do what you need with a community module or will some changes to
> core be required?
> On Sun, Jan 24, 2016 at 6:15 AM Nuno Miguel Carvalho Oliveira <
> [email protected]> wrote:
>
>> Hi,
>>
>> This community module will allow entering specific request parameters as
>> URL path fragments (*REST like URLs*) instead of using the query string.
>>
>> For example, we want to be able to apply a cql_filter using a URL in
>> the following form:
>>
>> http://<host>:<port>/geoserver/<workspace>/<layer>*/<filter>/*
>> ows?service=WMS&version=1.3.0&request=GetMap
>>
>> As a simple example of usage, if the <filter> is something like:
>>
>> cql_filter=seq='*K140M*'
>>
>> the URL would become:
>>
>> http://<host>:<port>/geoserver/<workspace>/<layer>/*K140M**/*
>> ows?service=WMS&version=1.3.0&request=GetMap
>>
>> and the proposed community module will translate the URL to this new one:
>>
>> http://<host>:<port>/geoserver/<workspace>/<layer>/
>> ows?service=WMS&version=1.3.0&request=GetMap&*cql_filter=seq='K140M'*
>>
>> This community module could be used to enable *REST like URLs* for
>> clients that are not able to consume OGC protocols directly.
>>
>>
>> This module is configured by a set of rules that will allow us to select
>> the URLs that should be transformed and describe the transformation to be
>> applied:
>>
>> <Rules>
>> <Rule *match*="^.*?(/(a-zA-Z0-9_\-]+))/[^/]+$"
>> *parameter*="cql_filter"
>> *remove*="$1"
>> *transform*="seq='$2'"/>
>> <Rule .../>
>> </Rules>
>>
>> The *match *attribute contains a Java Regular Expression
>> <https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html>
>> that is used for two proposes:
>>
>> - selecting the URLs that should be transformed
>> - extract the pieces of information (*groups*) than can be used to
>> describe the transformation.
>>
>> The *parameter *attribute defines the parameter that should be added to
>> the query, in this case the 'cql_filter' parameter.
>>
>> The *remove *attribute must reference a valid group of the *match *expression
>> (typically the must external one) which will be removed from the original
>> URL.
>>
>> The *transform *attribute defines the parameter value content. The
>> *transform* string can reference any valid group of the *match*
>> expression.
>>
>>
>> This module can be implemented as Servlet Filter which will give us total
>> control over when it should be executed (regarding the filters chain), but
>> this will make it harder to implement a "plug and play" behavior.
>>
>> Another option is to implement this module as a filter that extends the
>> *GeoServerFilter* and *ExtensionPriority *interfaces, this will make
>> very easy to implement the "plug and play" behavior but the filter will be
>> executed by the
>> *SpringDelegatingFilter* filter which is executed only after the
>> *AdvancedDispatchFilter* filter and I'm not sure to understand all the
>> implications of this.
>>
>>
>> Any feedback on this is welcome.
>>
>> Best regards,
>>
>> Nuno Oliveira
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
>> _______________________________________________
>> Geoserver-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>
> --
> --
> Jody Garnett
>
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel