use of org.mycore.datamodel.metadata.MCRObject in project mycore by MyCoRe-Org.
the class MCRURNObjectXPathMetadataManager method insertIdentifier.
@Override
public void insertIdentifier(MCRDNBURN identifier, MCRBase obj, String additional) throws MCRPersistentIdentifierException {
String xpath = getProperties().get("Xpath");
Document xml = obj.createXML();
MCRNodeBuilder nb = new MCRNodeBuilder();
try {
nb.buildElement(xpath, identifier.asString(), xml);
MCRBase object = new MCRObject(xml);
MCRMetadataManager.update(object);
} catch (Exception e) {
throw new MCRException("Error while inscribing URN to " + obj.getId(), e);
}
}
Aggregations