Search in sources :

Example 6 with LogicalStructMap

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

the class MCRSimpleModelXMLConverter method buildLogicalPages.

private static void buildLogicalPages(MCRMetsSimpleModel msm, Mets mets, Map<MCRMetsSection, String> sectionIdMap, Map<String, String> idToNewIDMap) {
    LogicalStructMap logicalStructMap = (LogicalStructMap) mets.getStructMap(LogicalStructMap.TYPE);
    MCRMetsSection rootSection = msm.getRootSection();
    String type = rootSection.getType();
    String label = rootSection.getLabel();
    String id = rootSection.getId();
    LogicalDiv logicalDiv = new LogicalDiv(id, type, label);
    sectionIdMap.put(rootSection, id);
    for (MCRMetsSection metsSection : rootSection.getMetsSectionList()) {
        buildLogicalSubDiv(metsSection, logicalDiv, sectionIdMap, idToNewIDMap);
    }
    logicalStructMap.setDivContainer(logicalDiv);
}
Also used : LogicalStructMap(org.mycore.mets.model.struct.LogicalStructMap) LogicalDiv(org.mycore.mets.model.struct.LogicalDiv) MCRMetsSection(org.mycore.mets.model.simple.MCRMetsSection)

Example 7 with LogicalStructMap

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

the class MCRMETSDefaultGenerator method createMets.

private Mets createMets() throws IOException {
    Mets mets = new Mets();
    String owner = getOwner();
    // add dmdsec
    DmdSec dmdSec = new DmdSec("dmd_" + owner);
    // add amdsec
    AmdSec amdSec = new AmdSec("amd_" + owner);
    // file sec
    FileSec fileSec = new FileSec();
    for (MCRMetsFileUse fileUse : MCRMetsFileUse.values()) {
        FileGrp fileGrp = new FileGrp(fileUse.toString());
        fileSec.addFileGrp(fileGrp);
    }
    // physical structure
    PhysicalStructMap physicalStructMap = new PhysicalStructMap();
    PhysicalDiv physicalDiv = new PhysicalDiv("phys_" + owner, "physSequence");
    physicalStructMap.setDivContainer(physicalDiv);
    // logical structure
    MCRILogicalStructMapTypeProvider typeProvider = getTypeProvider();
    LogicalStructMap logicalStructMap = new LogicalStructMap();
    LogicalDiv logicalDiv = new LogicalDiv("log_" + owner, typeProvider.getType(MCRObjectID.getInstance(owner)), owner, amdSec.getId(), dmdSec.getId());
    logicalDiv.setDmdId(dmdSec.getId());
    logicalStructMap.setDivContainer(logicalDiv);
    // struct Link
    StructLink structLink = new StructLink();
    // create internal structure
    structureMets(getDerivatePath(), getIgnorePaths(), fileSec, physicalDiv, logicalDiv, structLink, 0);
    hrefIdMap.clear();
    // add to mets
    mets.addDmdSec(dmdSec);
    mets.addAmdSec(amdSec);
    mets.setFileSec(fileSec);
    mets.addStructMap(physicalStructMap);
    mets.addStructMap(logicalStructMap);
    mets.setStructLink(structLink);
    return mets;
}
Also used : AmdSec(org.mycore.mets.model.sections.AmdSec) PhysicalStructMap(org.mycore.mets.model.struct.PhysicalStructMap) FileGrp(org.mycore.mets.model.files.FileGrp) StructLink(org.mycore.mets.model.struct.StructLink) DmdSec(org.mycore.mets.model.sections.DmdSec) MCRMetsFileUse(org.mycore.mets.model.simple.MCRMetsFileUse) PhysicalDiv(org.mycore.mets.model.struct.PhysicalDiv) LogicalStructMap(org.mycore.mets.model.struct.LogicalStructMap) LogicalDiv(org.mycore.mets.model.struct.LogicalDiv) FileSec(org.mycore.mets.model.files.FileSec)

Example 8 with LogicalStructMap

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

the class MCRMETSHierarchyGenerator method createLogicalStruct.

/**
 * Creates the logical struct map.
 *
 * @return a newly created logical struct map
 */
protected LogicalStructMap createLogicalStruct() {
    LogicalStructMap lsm = newLogicalStructMap();
    mergeOldLogicalStructMap(lsm);
    return lsm;
}
Also used : LogicalStructMap(org.mycore.mets.model.struct.LogicalStructMap)

Example 9 with LogicalStructMap

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

the class MCRXMLSimpleModelConverter method buidRootSection.

private static MCRMetsSection buidRootSection(Mets mets, Map<String, MCRMetsSection> idSectionMap, Map<String, MCRMetsFile> idFileMap) {
    IStructMap structMap = mets.getStructMap(LogicalStructMap.TYPE);
    LogicalStructMap logicalStructMap = (LogicalStructMap) structMap;
    LogicalDiv divContainer = logicalStructMap.getDivContainer();
    return buildSection(divContainer, idSectionMap, null, idFileMap);
}
Also used : IStructMap(org.mycore.mets.model.struct.IStructMap) LogicalStructMap(org.mycore.mets.model.struct.LogicalStructMap) LogicalDiv(org.mycore.mets.model.struct.LogicalDiv)

Aggregations

LogicalStructMap (org.mycore.mets.model.struct.LogicalStructMap)9 LogicalDiv (org.mycore.mets.model.struct.LogicalDiv)8 FileGrp (org.mycore.mets.model.files.FileGrp)4 PhysicalDiv (org.mycore.mets.model.struct.PhysicalDiv)4 PhysicalStructMap (org.mycore.mets.model.struct.PhysicalStructMap)4 ArrayList (java.util.ArrayList)3 File (org.mycore.mets.model.files.File)3 DmdSec (org.mycore.mets.model.sections.DmdSec)3 PhysicalSubDiv (org.mycore.mets.model.struct.PhysicalSubDiv)3 IOException (java.io.IOException)2 URISyntaxException (java.net.URISyntaxException)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 Objects (java.util.Objects)2 LogManager (org.apache.logging.log4j.LogManager)2 Logger (org.apache.logging.log4j.Logger)2 MCRException (org.mycore.common.MCRException)2 MCRObjectID (org.mycore.datamodel.metadata.MCRObjectID)2