Skip to content

Commit

Permalink
Merge pull request kitodo#6080 from BartChris/fix_process_title_multi…
Browse files Browse the repository at this point in the history
…_volume

Fix wrong value for the metadata "processTitle" in process hierarchies
  • Loading branch information
solth authored May 23, 2024
2 parents 77888b7 + b02544a commit 5e8d67b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,18 +639,17 @@ private void saveTempProcessMetadata(TempProcess tempProcess) {
Workpiece workpiece = tempProcess.getWorkpiece();
workpiece.setId(tempProcess.getProcess().getId().toString());
if (Objects.nonNull(rulesetManagement)) {
setProcessTitleMetadata(workpiece);
setProcessTitleMetadata(workpiece, tempProcess.getProcess().getTitle());
}
ServiceManager.getMetsService().save(workpiece, out);
} catch (IOException e) {
Helper.setErrorMessage(e.getLocalizedMessage(), logger, e);
}
}

private void setProcessTitleMetadata(Workpiece workpiece) {
private void setProcessTitleMetadata(Workpiece workpiece, String processTitle) {
Collection<String> keysForProcessTitle = rulesetManagement.getFunctionalKeys(FunctionalMetadata.PROCESS_TITLE);
if (!keysForProcessTitle.isEmpty()) {
String processTitle = currentProcess.getProcess().getTitle();
addAllowedMetadataRecursive(workpiece.getLogicalStructure(), keysForProcessTitle, processTitle);
addAllowedMetadataRecursive(workpiece.getPhysicalStructure(), keysForProcessTitle, processTitle);
}
Expand Down

0 comments on commit 5e8d67b

Please sign in to comment.