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

Externalization of the catalog metadata template #6899

Closed
3 of 5 tasks
mattiagiupponi opened this issue Jan 29, 2021 · 0 comments · Fixed by #6894
Closed
3 of 5 tasks

Externalization of the catalog metadata template #6899

mattiagiupponi opened this issue Jan 29, 2021 · 0 comments · Fixed by #6894
Labels
feature A new feature to be added to the codebase
Milestone

Comments

@mattiagiupponi
Copy link
Contributor

Externalization of the catalog metadata template

Overview

At the moment the catalog XML template is hardcoded and requires a manual change in order to change the template.
This proposal, meant to externalize the metadata XML as a configuration variable in order to let the user change the template without touch the code

Proposed By

@mattiagiupponi

Assigned to Release

This proposal is for GeoNode 3.x.

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

The benefits include letting the user/developer change the catalog metadata XML without touch the code, by changing an environment variable

Proposal

A new settings variable has been added in the settings.py named CATALOG_METADATA_TEMPLATE. By default, it takes the full_metadata.xml template in order to keep the backward compatibility
In settings.py this line has been added

CATALOG_METADATA_TEMPLATE = os.getenv("CATALOG_METADATA_TEMPLATE", "catalogue/full_metadata.xml")

The code can be easily called with

settings.CATALOG_METADATA_TEMPLATE

The catalog variable is available also in the context_processor in order to let also the template read the value from the variable.
Example from transaction_insert.xml

{% include CATALOG_METADATA_TEMPLATE %}

Backwards Compatibility

Since the default value is the old template, is totally compatible

Future evolution

Explain which could be future evolutions.

Feedback

Update this section with relevant feedbacks, if any.

Voting

Project Steering Committee:

  • Alessio Fabiani:
  • Francesco Bartoli:
  • Giovanni Allegri:
  • Simone Dalmasso:
  • Toni Schoenbuchner:
  • Florian Hoedt:

Links

@mattiagiupponi mattiagiupponi linked a pull request Jan 29, 2021 that will close this issue
11 tasks
@mattiagiupponi mattiagiupponi added the feature A new feature to be added to the codebase label Jan 29, 2021
@afabiani afabiani added this to the 4.0.0 milestone Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature to be added to the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants