Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt style metadata to manage style title #144

Open
giohappy opened this issue Apr 26, 2021 · 0 comments
Open

Adopt style metadata to manage style title #144

giohappy opened this issue Apr 26, 2021 · 0 comments

Comments

@giohappy
Copy link

giohappy commented Apr 26, 2021

The current approach(es) to manage and retrieve style titles, and consequently legends, is a grey area, where a mix of solutions are implemented in GeoNode and its client.
The root issue is that the declaration of the style must be done inside the style body itself, and for this reason it also differs between style formats (SLD, CSS, etc.).

For a CSS it can be defined with the @styleTitle attribute. For an SLD the usual approach is to rely on the UserStyle.Title element.
This approach has several drawbacks, last but not least the difficulty for the client to take control of the title while the style content is being edited.

Geoserver provides a very useful feature for styles: metadata. A style can have associated metadata, that currently can be managed through style REST API PUT requestsm and can be retrieved doing a style REST API GET request with the XML format.

An example of a custom title metadata attribute is shown here below:

<?xml version="1.0" encoding="UTF-8"?>
<style>
   <name>circle_7___0925f5c0-a696-11eb-80b1-65a870ee53bc</name>
   <workspace>
      <name>geonode</name>
   </workspace>
   <format>css</format>
   <languageVersion>
      <version>1.0.0</version>
   </languageVersion>
   <filename>circle_7___0925f5c0-a696-11eb-80b1-65a870ee53bc.css</filename>
   <metadata>
      <entry key="title">Circle 7</entry>
   </metadata>
   <dateCreated>2021-04-26 13:48:20.461 UTC</dateCreated>
   <dateModified>2021-04-26 13:48:46.502 UTC</dateModified>
</style>

Currently neither MapStore nor GeoNode rely on this capability, but this would make the management of title far more robust and indepdent from the style format.

To have this in place the followin steps are requred:

@giohappy giohappy self-assigned this Apr 26, 2021
@giohappy giohappy changed the title Adopt styles metadata to manage style title Adopt style metadata to manage style title Apr 26, 2021
@giohappy giohappy added the Epic label Apr 26, 2021
@giohappy giohappy removed the 2.1.x label Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant