use of org.mycore.datamodel.metadata.MCRMetaXML in project mycore by MyCoRe-Org.
the class MCRMODSWrapper method setMODS.
public void setMODS(Element mods) {
MCRObjectMetadata om = object.getMetadata();
if (om.getMetadataElement(DEF_MODS_CONTAINER) != null) {
om.removeMetadataElement(DEF_MODS_CONTAINER);
}
MCRMetaXML modsContainer = new MCRMetaXML(MODS_CONTAINER, null, 0);
List<MCRMetaXML> list = Collections.nCopies(1, modsContainer);
MCRMetaElement defModsContainer = new MCRMetaElement(MCRMetaXML.class, DEF_MODS_CONTAINER, false, true, list);
om.setMetadataElement(defModsContainer);
modsContainer.addContent(mods);
}
Aggregations