Search in sources :

Example 1 with MDTYPE

use of org.mycore.mets.model.struct.MDTYPE in project mycore by MyCoRe-Org.

the class MCRMetsMods2IIIFConverter method extractMedataFromLogicalDiv.

protected List<MCRIIIFMetadata> extractMedataFromLogicalDiv(Mets mets, LogicalDiv divContainer) {
    String dmdId = divContainer.getDmdId();
    if (dmdId != null && !dmdId.isEmpty()) {
        DmdSec dmdSec = mets.getDmdSecById(dmdId);
        if (dmdSec != null) {
            MdWrap mdWrap = dmdSec.getMdWrap();
            MDTYPE mdtype = mdWrap.getMdtype();
            MCRMetsIIIFModsMetadataExtractor extractor;
            switch(mdtype) {
                case MODS:
                    extractor = new MCRMetsIIIFModsMetadataExtractor();
                    break;
                default:
                    LOGGER.info("No extractor found for mdType: {}", mdtype);
                    return Collections.emptyList();
            }
            return extractor.extractModsMetadata(mdWrap.asElement().getChild("xmlData", MCRConstants.METS_NAMESPACE));
        }
    }
    return Collections.emptyList();
}
Also used : MDTYPE(org.mycore.mets.model.struct.MDTYPE) DmdSec(org.mycore.mets.model.sections.DmdSec) MdWrap(org.mycore.mets.model.struct.MdWrap)

Aggregations

DmdSec (org.mycore.mets.model.sections.DmdSec)1 MDTYPE (org.mycore.mets.model.struct.MDTYPE)1 MdWrap (org.mycore.mets.model.struct.MdWrap)1