Search in sources :

Example 1 with AmdSec

use of org.mycore.mets.model.sections.AmdSec 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)

Aggregations

FileGrp (org.mycore.mets.model.files.FileGrp)1 FileSec (org.mycore.mets.model.files.FileSec)1 AmdSec (org.mycore.mets.model.sections.AmdSec)1 DmdSec (org.mycore.mets.model.sections.DmdSec)1 MCRMetsFileUse (org.mycore.mets.model.simple.MCRMetsFileUse)1 LogicalDiv (org.mycore.mets.model.struct.LogicalDiv)1 LogicalStructMap (org.mycore.mets.model.struct.LogicalStructMap)1 PhysicalDiv (org.mycore.mets.model.struct.PhysicalDiv)1 PhysicalStructMap (org.mycore.mets.model.struct.PhysicalStructMap)1 StructLink (org.mycore.mets.model.struct.StructLink)1