Search in sources :

Example 1 with MCRMetaXML

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);
}
Also used : MCRMetaElement(org.mycore.datamodel.metadata.MCRMetaElement) MCRObjectMetadata(org.mycore.datamodel.metadata.MCRObjectMetadata) MCRMetaXML(org.mycore.datamodel.metadata.MCRMetaXML)

Aggregations

MCRMetaElement (org.mycore.datamodel.metadata.MCRMetaElement)1 MCRMetaXML (org.mycore.datamodel.metadata.MCRMetaXML)1 MCRObjectMetadata (org.mycore.datamodel.metadata.MCRObjectMetadata)1