int chdCnt = ne.getChildCount();
for (int i = 0; i < chdCnt; i++) {
NodeEvaluation neChd = ne.getNodeEvaluationChildAt(i);
if (neChd.isVisible()) {
// Build and add child generic or specific peek view
CourseNode child = neChd.getCourseNode();
Controller childViewController = null;
Controller childPeekViewController = null;
if (displayType.equals(STCourseNodeEditController.CONFIG_VALUE_DISPLAY_PEEKVIEW)) {
if (peekviewChildNodes.size() == 0) {
// Special case: no child nodes configured. This is the case when
// the node has been configured before it had any children. We just
// use the first children as they appear in the list
if (i < STCourseNodeConfiguration.MAX_PEEKVIEW_CHILD_NODES) {
childPeekViewController = child.createPeekViewRunController(ureq, wControl, userCourseEnv, neChd);
} else {
// Stop, we already reached the max count
break;
}
} else {
// Only add configured children
if (peekviewChildNodes.contains(child.getIdent())) {
childPeekViewController = child.createPeekViewRunController(ureq, wControl, userCourseEnv, neChd);
} else {
// Skip this child - not configured
continue;
}
}
}
// Add child to list
children.add(child);
childViewController = new PeekViewWrapperController(ureq, wControl, child, childPeekViewController);
listenTo(childViewController); // auto-dispose controller
myContent.put("childView_" + child.getIdent(), childViewController.getInitialComponent());
}
}
myContent.contextPut("children", children);
myContent.contextPut("nodeFactory", CourseNodeFactory.getInstance());