Skip to content

Commit

Permalink
Assign ID to logical <div>s in imported METS files which don't have o…
Browse files Browse the repository at this point in the history
…ne (kitodo#5931)
  • Loading branch information
matthias-ronge authored Feb 21, 2024
1 parent 5764cac commit dfe56a1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,14 @@ public DivXmlElementAccess() {
*/
DivXmlElementAccess(LogicalDivision logicalDivision) {
super(logicalDivision);
metsReferrerId = logicalDivision instanceof DivXmlElementAccess
? ((DivXmlElementAccess) logicalDivision).metsReferrerId
: KitodoUUID.randomUUID();
String obtainedReferrerId = null;
if (logicalDivision instanceof DivXmlElementAccess) {
obtainedReferrerId = ((DivXmlElementAccess) logicalDivision).metsReferrerId;
}
if (Objects.isNull(obtainedReferrerId)) {
obtainedReferrerId = KitodoUUID.randomUUID();
}
metsReferrerId = obtainedReferrerId;
}

/**
Expand Down

0 comments on commit dfe56a1

Please sign in to comment.