Hi all,
I have been working on making GeoServer capable of storing styles natively in alternate languages. The most obvious use case being a better integration for the css styling extension. The work is worth a GSIP but I wanted to post here to start some initial discussion before doing up the first draft of the proposal.
For the impatient the current state of the work can be found here:
https://github.com/jdeolive/geoserver/compare/style-plug
The approach is to create an extension point named “StyleHandler” (which will replace the current “Styles.Handler” enum) that can parse, encode, and validate styles. With the new extension point the task then becomes updating all the bits around it. Which will require some changes to a few different subsystems.
Catalog/Config
A couple of changes to StyleInfo:
- An additional property: the style format/language identifier
- Changing the “SLDVersion” property to the more generic “FormatVersion” property.
WMS
To support styles directly in a WMS request (via SLD or SLD_BODY) the idea is to add an additional “STYLE_FORMAT” parameter to identifier the format. In the implementation I have now i have continued to use SLD and SLD_BODY parameters for the style content, even though in non SLD cases it is a misnomer. We could add more generic parameters and make the SLD specific ones an alias for them… what do folks prefer?
Web UI
What I have done thus far is simply add a format field to the style editor page. When creating a new style the user can choose the style format.
In the interest of simplicity I thought it best to simply disable the drop down when editing a style:
Rationale being that since style handlers might not support both parsing and encoding, like the css module transforming the same style between formats would be tricky.
Rest API
The final bit is the rest api. Nothing too exciting here except that now folks will be able to upload files in different formats.
That is about it… let me know what you think!
-Justin
–
Justin Deoliveira
VP Engineering | Boundless
jdeolive@anonymised.com
@boundlessgeo