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);
}
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;
}
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;
}
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);
}
Aggregations