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

Add a helper for instance customization options #901

Merged
merged 4 commits into from
Dec 9, 2022

Conversation

ZakarFin
Copy link
Member

@ZakarFin ZakarFin commented Dec 8, 2022

Previously there was an almost identical svg-markers.json in both control-base and service-print modules. One in control-base had hardcoded colors and print used placeholders. These can now be queried from a new org.oskari.util.Customization helper class (in service-base): JSONArray svgMarkers = Customization.getMarkers();. This returns the markers with the placeholders so GetAppSetup needs to replace those with the existing hard coded #000000 values.

The service logo can now be fetched as byte array with: Customization.getLogo(). This is used by printing to draw the service logo on the printout. This also adds an action route to get the logo with http://service.org/action/Logo. This enables using the same logo on the frontend with for example the "logo plugin" on the map or even the browser favicon. This makes customizing an Oskari instance easier.

The logo for printing can still be configured with oskari-ext.properties like before with the print.logo.path, but also with logo.path.print and it also enables configuring a global logo with logo.path and adding different kinds of logo images for different purposes with other qualifiers if needed. The logo defaults to the Oskari logo found under service-base resources.

This could also be improved to enable a service to override marker SVGs more easily since they are fetched from single source to both frontend and printing.


public class Customization {
private static final String SVG_MARKERS_JSON = "svg-markers.json";
private static Cache<String> CUSTOMIZATION = CacheManager.getCache("Customization");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of an overkill if we can't get the logo byte[] here as well. Maybe even if we could store the logos here.

@ZakarFin ZakarFin added this to the 2.10.0 milestone Dec 9, 2022
@ZakarFin ZakarFin merged commit 717d7d6 into oskariorg:develop Dec 9, 2022
@ZakarFin ZakarFin deleted the customization-helper branch December 9, 2022 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant