// Repositioning to move/copy course node
String nodeId = moveCopyController.getCopyNodeId();
if (nodeId != null) {
menuTree.setSelectedNodeId(nodeId);
euce.getCourseEditorEnv().setCurrentCourseNodeId(nodeId);
CourseNode copyNode = cetm.getCourseNode(nodeId);
initNodeEditor(ureq, copyNode);
}
euce.getCourseEditorEnv().validateCourse();
StatusDescription[] courseStatus = euce.getCourseEditorEnv().getCourseStatus();
updateCourseStatusMessages(ureq.getLocale(), courseStatus);
} else if (event == Event.FAILED_EVENT) {
getWindowControl().setError("Error in copy of subtree.");
} else if (event == Event.CANCELLED_EVENT) {
// user canceled
}
} else if (source == insertNodeController) {
cmc.deactivate();
if (event == Event.DONE_EVENT) {
// Activate new node in menu and create necessary edit controllers
// necessary if previous action was a delete node action
tabbedNodeConfig.setVisible(true);
main.setPage(VELOCITY_ROOT + "/index.html");
CourseNode newNode = insertNodeController.getInsertedNode();
menuTree.setSelectedNodeId(newNode.getIdent());
// update the current node in the editor course environment
euce.getCourseEditorEnv().setCurrentCourseNodeId(newNode.getIdent());
euce.getCourseEditorEnv().validateCourse();
StatusDescription[] courseStatus = euce.getCourseEditorEnv().getCourseStatus();
updateCourseStatusMessages(ureq.getLocale(), courseStatus);
initNodeEditor(ureq, newNode);
}
// in all cases:
removeAsListenerAndDispose(insertNodeController);
insertNodeController = null;
} else if (source == deleteDialogController){
removeAsListenerAndDispose(deleteDialogController);
deleteDialogController = null;
if (DialogBoxUIFactory.isYesEvent(event)){
// delete confirmed
String ident = menuTree.getSelectedNode().getIdent();
// udpate the current node in the course editor environment
euce.getCourseEditorEnv().setCurrentCourseNodeId(ident);
CourseNode activeNode = cetm.getCourseNode(ident);
cetm.markDeleted(activeNode);
menuTree.setDirty(true);
CourseFactory.saveCourseEditorTreeModel(course.getResourceableId());