core-geonetwork
core-geonetwork copied to clipboard
Formatter / Use portal filter
Analog to https://github.com/geonetwork/core-geonetwork/pull/7890, but for formatters.
Refactored the code to reuse it in CSW and formatters.
Test case:
- Load the iso19139 samples
- Create an iso19139 metadata
- Create a portal with the name
external
and a filter-uuid:UUIDVALUE
, with the UUID of the metadata from 2), to display all metadata except the one created in 2). - In the portal switcher, select the
external
portal -> The metadata created in 2) is not displayed - In the portal switcher, select the main
srv
portal -> The metadata created in 2) is displayed - Request a formatter in the main
srv
portal --> The metadata formatter is displayed
http://localhost:8080/geonetwork/srv/api/records/UUIDVALUE/formatters/json?addSchemaLocation=true&increasePopularity=true&approved=true
- Request a formatter in the main
external
portal
http://localhost:8080/geonetwork/external/api/records/UUIDVALUE/formatters/json?addSchemaLocation=true&increasePopularity=true&approved=true
- Without the fix: the formatter is displayed
- With the fix: an error 403 is returned
Checklist
- [X] I have read the contribution guidelines
- [X] Pull request provided for
main
branch, backports managed with label - [X] Good housekeeping of code, cleaning up comments, tests, and documentation
- [X] Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
- [X] Clean commit messages, longer verbose messages are encouraged
- [ ] API Changes are identified in commit messages
- [ ] Testing provided for features or enhancements using automatic tests
- [ ] User documentation provided for new features or enhancements in manual
- [ ] Build documentation provided for development instructions in
README.md
files - [ ] Library management using
pom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation