Skip to content

Commit

Permalink
added catalogue-id with same value as node
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenHankiewicz committed Nov 17, 2022
1 parent 0a9f9ba commit cde9922
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ public void addNodeIdToTopStruct(String nodeId) throws MetadataTypeNotAllowedExc
addNodeId(logical, nodeId);
}

public void addCatalogueId(String id) throws MetadataTypeNotAllowedException {
if (StringUtils.isNotBlank(id)) {
Metadata cid = new Metadata(prefs.getMetadataTypeByName("CatalogIDDigital"));
cid.setValue(id);
logical.addMetadata(cid);
}
}

private void addNodeId(DocStruct ds, String nodeId) throws MetadataTypeNotAllowedException {
if (StringUtils.isNotBlank(nodeId)) {
Metadata nodeid = new Metadata(prefs.getMetadataTypeByName("NodeId"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ public void startImport(ImportSet importSet) {
}
try {
dManager.addNodeIdToTopStruct(nodeId);
dManager.addCatalogueId(nodeId);
} catch (MetadataTypeNotAllowedException e) {
updateLog(
"Metadata field definition for nodeId is missing (needed to link document with ead-nodes)! Please update the ruleset.",
Expand Down

0 comments on commit cde9922

Please sign in to comment.