Skip to content

Fix parsing of content type fields from METS#373

Open
ThomasEdvardsen wants to merge 6 commits intokeeps:masterfrom
NationalLibraryOfNorway:fix-issue-372-content-types
Open

Fix parsing of content type fields from METS#373
ThomasEdvardsen wants to merge 6 commits intokeeps:masterfrom
NationalLibraryOfNorway:fix-issue-372-content-types

Conversation

@ThomasEdvardsen
Copy link
Copy Markdown
Contributor

What changed

  • setIPContentType now reads mets/@TYPE and uses mets/@csip:OTHERTYPE only when TYPE=OTHER
  • contentInformationType is now populated during parsing for both main and representation METS
    • uses mets/@csip:CONTENTINFORMATIONTYPE
    • uses mets/@csip:OTHERCONTENTINFORMATIONTYPE only when CONTENTINFORMATIONTYPE=OTHER
  • Added unit tests to cover the four reported cases plus edge cases:
    • TYPE="Text" ignores OTHERTYPE
    • TYPE="Other" uses OTHERTYPE
    • CONTENTINFORMATIONTYPE="GeoData" ignores OTHERCONTENTINFORMATIONTYPE
    • CONTENTINFORMATIONTYPE="OTHER" uses OTHERCONTENTINFORMATIONTYPE
    • error when OTHER is set but corresponding other field is empty
    • blank CONTENTINFORMATIONTYPE leaves default

Why

Parsing currently:

Related

Closes #372

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jan 25, 2026
@dosubot
Copy link
Copy Markdown

dosubot bot commented Jan 25, 2026

Related Documentation

Checked 5 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the java Pull requests that update java code label Jan 25, 2026
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 25, 2026
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Jan 25, 2026
@ThomasEdvardsen
Copy link
Copy Markdown
Contributor Author

Im sorry for the massive changes, but its required by the Checkstyle job 😳

@luis100 luis100 requested review from AntonioG70 and hmiguim February 3, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update java code size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E-ARK SIP parse ignores CONTENTINFORMATIONTYPE and misreads TYPE/OTHERTYPE for contentType

1 participant