Moving the thread the the geoserver mailing list (I did send the first mail to geotools-devel by mistake)
On Tue, Oct 2, 2012 at 3:13 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:
Hey Andrea, +1 on the community module but some feedback inline as well for things to think about.
On Tue, Oct 2, 2012 at 4:34 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:
Hi all,
I want to propose a new community module, a customizable WFS output format which
will leverage XSLT to transform GML2/3 outputs into any text output.Cool. One thing to consider is how the folks did this for app-schema. If you look for instance at GML3OutputFormat you will see support for an xslt transformation. In that case it is very specific but it would be good to think about how to do this in a general way that would be supported by the core wfs module.
Hmm… this would be a core change, but I need the module on 2.2.x as well.
How about a community module, and when the code is moved to extension in 2.2.x it is instead moved
into core on master?
The configuration will be XML based, one configuration file
file stored in $GEOSERVER_DATA_DIR/wfs-xslt/configuration.xml, with a format as follows:Can we throw this under a directory named “wfs” to avoid proliferating new directories at the top level, eventually having it customizable per workspace as well (although i understand this can be put off as a future improvement).
Ah, indeed I have no mandate to make it work on a per workspace basis, but sure, I can put the configuration in a wfs directory.
It would also be good to have this customizable on a layer by layer basis. Which i would think is kind of important for general use right? Just thinking out loud but how often the case that you want a strctly general transform to be applied to all GML output, i would think tweaking the output of a single layer would make more sense. Although I guess this could also be done with a global file and just select the types you want.
Both use cases have a reason to exist, XLST can be used as a general format translator or as something very specific to
a certain layer.
What about adding bits to the configuration so that both can be achieved?
text/xml; subtype=gml/2.1.2
text/plain
txt
/path/to/the/xslt/file
…
When looking for a matching transformation the layer would be used as well.
There is a significant downside though, the general transformations can be advertised
among the wfs output formats in the caps document, the per layer one would make no
sense instead, and would probably have to be hidden instead, so they would end up
being a hidden contract between the server and the client (that’s why I did not want
to support them in the first place).
The format will not have a configuration GUI for the time being, but will be accompanied
by a REST configuration extension mimicking the configuration file structure:/rest/wfs-xslt/formats/.xml
Again I think this shoudl fall under the existing /services/wfs endpoint. I would think something like:
/rest/services/wfs/transforms/…
ANd if supported on a layer by layer basis i think also available under the layer endpoint as well.
/rest/workspaces/…/featureTypes//transforms/…
Works for me (besides the doubts about the meaningfullness of a per layer output format in
the WFS framework).
Cool, agreed this will be a very powerful feature that is well received. I do think it is worth thinking about maybe a tighter integration with the core wfs/restconfig/etc… modules rather than as an add on.
About adding this to core, I also have the following hesitations:
- XSLT can become memory bound, it all depends on what transformation sheet is used → it can be a bomb,
not a very dangerous one since the admin controls the transformation sheet, but we also know that not all
geoserver managers are equally skilled - core location is for code that is very popular, are we sure xslt transformations warrant this kind of status out of the box?
Imho it would not set a good precedent for future decisions.
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