use of org.mycore.mets.model.struct.Fptr in project mycore by MyCoRe-Org.
the class MCRSimpleModelXMLConverter method buildLogicalSubDiv.
private static void buildLogicalSubDiv(MCRMetsSection metsSection, LogicalDiv parent, Map<MCRMetsSection, String> sectionIdMap, Map<String, String> idToNewIDMap) {
String id = metsSection.getId();
LogicalDiv logicalSubDiv = new LogicalDiv(id, metsSection.getType(), metsSection.getLabel());
if (metsSection.getAltoLinks().size() > 0) {
Fptr fptr = new Fptr();
List<Seq> seqList = fptr.getSeqList();
Seq seq = new Seq();
seqList.add(seq);
metsSection.getAltoLinks().forEach(al -> {
Area area = new Area();
seq.getAreaList().add(area);
area.setBetype("IDREF");
area.setBegin(al.getBegin());
area.setEnd(al.getEnd());
String oldID = al.getFile().getId();
if (!idToNewIDMap.containsKey(oldID)) {
throw new MCRException("Could not get new id for: " + oldID);
}
area.setFileId(idToNewIDMap.get(oldID));
});
logicalSubDiv.getFptrList().add(fptr);
}
sectionIdMap.put(metsSection, id);
parent.add(logicalSubDiv);
int count = 1;
for (MCRMetsSection section : metsSection.getMetsSectionList()) {
buildLogicalSubDiv(section, logicalSubDiv, sectionIdMap, idToNewIDMap);
}
}
Aggregations