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

Update batch PDF export to skip working copies #8292

Conversation

tylerjmchugh
Copy link
Contributor

@tylerjmchugh tylerjmchugh commented Aug 2, 2024

Records with working copies are causing the batch PDF export xslt to fail. The UUIDs are used as an ID resulting in duplicate ID values where there must only be unique values.

CSV export seems to handle this by processing the results after they are received and removing any working copies but there is not similar logic for PDF.

Ex.

  • Select at least one record with a working copy from the search page
  • Export as PDF

This results in a 400 and the below error:

image

Error at xsl:value-of on line 235 of metadata-fop.xsl:
  SXCH0003: org.apache.fop.fo.ValidationException: Property ID
  "section-37aecae5-7783-4274-b595-df02aa003ac3" (found on "fo:block") previously used; ID
  values must be unique within a document! (See position 234:-1)

This PR aims to fix this issue by omitting the working copies from the elasticsearch results.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • 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

@ianwallen ianwallen added this to the 4.4.6 milestone Aug 2, 2024
@MichelGabriel
Copy link
Contributor

I've tried to download the PDF but it seems to generate a PDF of all records, not the selected ones. I'm not really familiar with downloading PDFs so I don't know if this happens in this PR or also in GeoNetwork Main

@tylerjmchugh
Copy link
Contributor Author

I've tried to download the PDF but it seems to generate a PDF of all records, not the selected ones. I'm not really familiar with downloading PDFs so I don't know if this happens in this PR or also in GeoNetwork Main

This appears to be introduced in this PR and caused by incorrect capitalization of boolean operators in the lucene query.

The latest commit addresses this issue and I am no longer able to reproduce after this fix.

@MichelGabriel MichelGabriel self-requested a review August 14, 2024 07:16
Copy link
Contributor

@MichelGabriel MichelGabriel left a comment

Choose a reason for hiding this comment

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

It's now working as expected. Only the selected records are added to the PDF without errors.

Thanks

@ianwallen ianwallen merged commit 79c5769 into geonetwork:main Aug 14, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants