CompositeItem root = mo.getLogicalStruct();
ArrayList<AbstractItem> children = root.getChildren();
ArrayList toc = new ArrayList();
for (AbstractItem item : children) {
CompositeItem ci = (CompositeItem)item;
DescriptiveMetadataHandler handler = new XSLTDescriptiveMetadataHandler();
DescriptiveMetadata dmd =mo.getDmdMap().get(ci.getDmdID());
Map md = null;
if (dmd == null) {
md = new HashMap();
md.put("id", ci.getId());
md.put("title", ci.getLabel());
} else {
md = handler.getMetadata(dmd.getDmd(), "simple");
}
md.put("firstPage", ci.getFirst().getId());
md.put("lastPage", ci.getLast().getId());
toc.add(md);
}