[Geoserver-devel] Proposal: graduate the XSLT module to extension status

Hi PSC,
I’ve just put together a proposal to graduate the XSLT output format generator to extension status, here:
http://geoserver.org/display/GEOS/GSIP+93+promote+XSLT+community+module+to+extension

Feedback and votes welcomed :slight_smile:

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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


Hi. I looked at the documentation page. What is not clear to me is how you request a particular transform when making a getfeature request.

Otherwise +1

--
Phil Scadden, Senior Scientist GNS Science Ltd 764 Cumberland St, Private Bag 1930, Dunedin, New Zealand Ph +64 3 4799663, fax +64 3 477 5232

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.

On Sun, Apr 7, 2013 at 11:33 PM, Phil Scadden <p.scadden@anonymised.com> wrote:

Hi. I looked at the documentation page. What is not clear to me is how
you request a particular transform when making a getfeature request.

Simple, you don't.
The XSLT module is an output format generator just like the OGR output
format,
so you don't request a specific transformation, you ask for an output
format that
has been configured for that module (when you configure a XLST transform,
you
also specify what output format it generates).

So for example you might want to write a general GML -> HTML transformer,
and
when you ask or HTML, that general stylesheet will be used to perform the
transformation.
If you, as the administrator, want to provide specific stylesheet for a
certain feature type
you can as well.

The ability to use the XSLT format so that one can ask for any random
stylesheet
without providing an output format could be implemented but it would be
breaking the
WFS standard expectations, as you'd be requesting one format, .e.g, GML,
and get
back another, e.g., HTML
Not such a big deal, in the end it's a vendor parameter

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

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

+1.

···

Hi. I looked at the documentation page. What is not clear to me is how
you request a particular transform when making a getfeature request.

Simple, you don’t.
The XSLT module is an output format generator just like the OGR output format,
so you don’t request a specific transformation, you ask for an output format that
has been configured for that module (when you configure a XLST transform, you
also specify what output format it generates).

So for example you might want to write a general GML → HTML transformer, and
when you ask or HTML, that general stylesheet will be used to perform the transformation.
If you, as the administrator, want to provide specific stylesheet for a certain feature type
you can as well.

The ability to use the XSLT format so that one can ask for any random stylesheet
without providing an output format could be implemented but it would be breaking the
WFS standard expectations, as you’d be requesting one format, .e.g, GML, and get
back another, e.g., HTML
Not such a big deal, in the end it’s a vendor parameter

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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


Simple, you don't.

Okay, I will put a particular use-case to you then. Suppose you have an database file with rather ugly set of attributes. (ie highly normalised or coded attributes). In an ideal world you would construct a view that delivers human-readable form and serve that from geoserver. However, if you dont have admin access to its particular database schema, then you are stuck with what you have. At the moment you can construct FTL or make readable on the client. The XSLT would allow for an alternative through say GML->JSON or GML->HTML. However, you might have two use-cases for the same data - one where you want it pretty (say info in a popup) and another where you want the raw attributes because you are offering editing of attributes and must pass back the proper data. If you could specify which transformer to use, then you have the possibility of a GML-> pretty GML for popups and plain one for editing.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.

On Mon, Apr 8, 2013 at 10:54 PM, Phil Scadden <p.scadden@anonymised.com> wrote:

> Simple, you don't.

Okay, I will put a particular use-case to you then. Suppose you have an
database file with rather ugly set of attributes. (ie highly normalised
or coded attributes). In an ideal world you would construct a view that
delivers human-readable form and serve that from geoserver. However, if
you dont have admin access to its particular database schema, then you
are stuck with what you have. At the moment you can construct FTL or
make readable on the client. The XSLT would allow for an alternative
through say GML->JSON or GML->HTML. However, you might have two
use-cases for the same data - one where you want it pretty (say info in
a popup) and another where you want the raw attributes because you are
offering editing of attributes and must pass back the proper data. If
you could specify which transformer to use, then you have the
possibility of a GML-> pretty GML for popups and plain one for editing.

Using XSLT the way you suggest, to alter the schema seen by users,
would likely bring us to a world of pain, as it's not just a matter of
transforming the generated GML:
* you have to transform DescribeFeatureType as well
* you have to transform back all the incoming filters, referring to the
  properties you're exposing, back to the native ones
* you have to take all the GET/KVP requests, and turn them into XML
  so that they can also be back-transformed
* the same would have to happen with the tight integration we have with
  WPS (when using the local WFS as a data source)

Generally speaking, using XSLT for the task is bad because the
transformation
happens in a too specific place (WFS only) and too much on the outside
(against XML as opposed to against the data).

I have written a solution for your use case, it's the "transform" module in
GeoTools,
which can apply transformations at the data level, go back and forth,
transform
filters, and retain the ability to do writes if the store knows how to
invert your
transformations (at this time, this is true only for attribute renames):
https://github.com/geotools/geotools/tree/master/modules/unsupported/transform

The issue is that the above needs to be wired up with GeoServer, and that's
not
2 hours work. This is what is needed:
* writing a GUI to allow setting up the attribute renames/type changes/CQL
expressions to
  perform the transformation
* store the configuration in XML
* apply the transformations on the fly in ResourcePool, we likely need to
open an extension
  point to do that

I'd be very happy to work on it, but it needs a little funding so that the
devs can work on it
during working hours instead of doing the n-th thing in their space time.

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it 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

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

+1.

The XSLT module ticks all the quality boxes, including substantial documentation. I can think of a bunch of interesting uses cases, including fake complex features (unless we have reverse XSLT like deegree 2 or apache cocoon to support filters!) or an output format to simplify/translate a verbose complex feature for a low-resource simple client (to combine the performance of app-schema with the expressivity of simple features *wink*). This module makes me want to learn more XSLT; it certainly merits promotion to extension.

Kind regards,
Ben.

On 08/04/13 00:58, Andrea Aime wrote:

Hi PSC,
I've just put together a proposal to graduate the XSLT output format
generator to extension status, here:
http://geoserver.org/display/GEOS/GSIP+93+promote+XSLT+community+module+to+extension

Feedback and votes welcomed :slight_smile:

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

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

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre