core-geonetwork icon indicating copy to clipboard operation
core-geonetwork copied to clipboard

Formatter / Use portal filter

Open josegar74 opened this issue 7 months ago • 0 comments

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:

  1. Load the iso19139 samples
  2. Create an iso19139 metadata
  3. 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).
  4. In the portal switcher, select the external portal -> The metadata created in 2) is not displayed
  5. In the portal switcher, select the main srv portal -> The metadata created in 2) is displayed
  6. 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

  1. 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

josegar74 avatar Jul 18 '24 14:07 josegar74