}
// even if we do not show the menu, we need to build parse the manifest and
// find the first node to display at startup
VFSItem mani = rootContainer.resolve("imsmanifest.xml");
if (mani == null || !(mani instanceof VFSLeaf)) { throw new OLATRuntimeException("error.manifest.missing", null, this.getClass()
.getPackage().getName(), "CP " + rootContainer + " has no imsmanifest", null); }
// initialize tree model in any case
ctm = new CPManifestTreeModel((VFSLeaf) mani);
if (showMenu) {
// the menu is only initialized when needed.
cpTree = new MenuTree("cpDisplayTree");
cpTree.setTreeModel(ctm);
cpTree.addListener(this);
}
LoggingResourceable nodeInfo = null;
if (activateFirstPage) {
// set content to first accessible child or root node if no children
// available
TreeNode node = ctm.getRootNode();
if (node == null) throw new OLATRuntimeException(CPDisplayController.class, "root node of content packaging was null, file:"
+ rootContainer, null);
while (node != null && !node.isAccessible()) {
if (node.getChildCount() > 0) {
node = (TreeNode) node.getChildAt(0);
} else node = null;