Closed andre-hohmann closed 4 months ago
In my opinion, this is a severe problem, because inconsistent internal metadata is created, which
@solth : According to @henning-gerhardt, i should inform you explicitly, because for me this is a blocker for the productive use of the affected versions in SLUB Dresden. Since I was informed about this behavior by Leipzig University Library, it seems to be relevant for other institutions as well.
I suppose this issue arises because the title is derived from currentProcess
, which represents the child process (in cases where the import was initiated by the child process) rather than the currently evaluated process. Therefore, the title for both processes is taken from the child.
The title should, instead, probably be derived from the processed tempProcess (first the volume, then the multi-volume work). The revised code could look like this:
private void saveTempProcessMetadata(TempProcess tempProcess) {
try (OutputStream out = ServiceManager.getFileService()
.write(ServiceManager.getProcessService().getMetadataFileUri(tempProcess.getProcess()))) {
Workpiece workpiece = tempProcess.getWorkpiece();
workpiece.setId(tempProcess.getProcess().getId().toString());
if (Objects.nonNull(rulesetManagement)) {
setProcessTitleMetadata(workpiece, tempProcess.getProcess().getTitle());
}
ServiceManager.getMetsService().save(workpiece, out);
} catch (IOException e) {
Helper.setErrorMessage(e.getLocalizedMessage(), logger, e);
}
}
private void setProcessTitleMetadata(Workpiece workpiece, String processTitle) {
Collection<String> keysForProcessTitle = rulesetManagement.getFunctionalKeys(FunctionalMetadata.PROCESS_TITLE);
if (!keysForProcessTitle.isEmpty()) {
addAllowedMetadataRecursive(workpiece.getLogicalStructure(), keysForProcessTitle, processTitle);
//addAllowedMetadataRecursive(workpiece.getPhysicalStructure(), keysForProcessTitle, processTitle);
}
}
Describe the bug If processes are created for a volume and a multivolume work, the metadata "processTitle" of the volume is assigned to both processes.
Probably, this is caused by:
4459
See also:
6024
To Reproduce Steps to reproduce the behavior:
Expected behavior The correct process title should be assigned to both processes.
Probably, this must be analyzed more deeply. It seems there are more consequences:
Release 3.6.2 - probably since 3.6.0
Desktop (please complete the following information):
Additional context
Internal METS file: Volume
``` xmlInternal METS file: MultiVolumeWork
``` xml