Search in sources :

Example 6 with ControllerEventListener

use of org.olat.core.gui.control.ControllerEventListener in project openolat by klemens.

the class NavigationHandler method evaluateJumpToTreeNode.

/**
 * to be called when the users clickes on a node when in the course
 *
 * @param ureq
 * @param wControl
 * @param treeModel
 * @param treeEvent
 * @param listeningController
 * @param nodecmd null or a subcmd which activates a node-specific view (e.g. opens a certain uri in a contentpackaging- buildingblock)
 * @return the NodeClickedRef
 * @return currentNodeController the current node controller that will be dispose before creating the new one
 */
public NodeClickedRef evaluateJumpToTreeNode(UserRequest ureq, WindowControl wControl, TreeModel treeModel, TreeEvent treeEvent, ControllerEventListener listeningController, String nodecmd, Controller currentNodeController) {
    NodeClickedRef ncr;
    String treeNodeId = treeEvent.getNodeId();
    TreeNode selTN = treeModel.getNodeById(treeNodeId);
    if (selTN == null) {
        selTN = treeModel.getRootNode();
    }
    if (!selTN.isAccessible()) {
        // event to match the new node
        if (selTN.getDelegate() != null) {
            selTN = selTN.getDelegate();
            treeNodeId = selTN.getIdent();
            treeEvent = new TreeEvent(MenuTree.COMMAND_TREENODE_CLICKED, treeNodeId);
        }
    }
    // check if appropriate for subtreemodelhandler
    Object userObject = selTN.getUserObject();
    if (!(userObject instanceof NodeEvaluation)) {
        // yes, appropriate
        NodeRunConstructionResult nrcr = null;
        CourseNode internCourseNode = null;
        GenericTreeModel subTreeModel;
        ControllerEventListener subtreemodelListener = null;
        if (selTN != null) {
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            CourseNode courseNode = prevEval.getCourseNode();
            if (externalTreeModels.containsKey(courseNode.getIdent())) {
                SubTree subTree = externalTreeModels.get(courseNode.getIdent());
                subtreemodelListener = subTree.getTreeModelListener();
            }
        }
        if (subtreemodelListener == null) {
            // throw new AssertException("no handler for subtreemodelcall!");
            // reattach the subtreemodellistener
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            internCourseNode = prevEval.getCourseNode();
            final OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseNode.class, Long.parseLong(internCourseNode.getIdent()));
            ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ores);
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
            nrcr = internCourseNode.createNodeRunConstructionResult(ureq, bwControl, userCourseEnv, prevEval, nodecmd);
            // remember as instance variable for next click
            subtreemodelListener = nrcr.getSubTreeListener();
            subTreeModel = (GenericTreeModel) nrcr.getSubTreeModel();
            externalTreeModels.put(internCourseNode.getIdent(), new SubTree(nrcr.getRunController(), subTreeModel, subtreemodelListener));
        } else {
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            internCourseNode = prevEval.getCourseNode();
            SubTree subTree = externalTreeModels.get(internCourseNode.getIdent());
            subtreemodelListener = subTree.getTreeModelListener();
            if (currentNodeController instanceof TitledWrapperController) {
                currentNodeController = ((TitledWrapperController) currentNodeController).getContentController();
            }
            if (subtreemodelListener != currentNodeController) {
                if (subtreemodelListener instanceof CPRunController) {
                    nrcr = ((CPRunController) subtreemodelListener).createNodeRunConstructionResult(ureq, selTN.getIdent());
                } else {
                    nrcr = new NodeRunConstructionResult((Controller) subtreemodelListener);
                }
            }
            subTreeModel = subTree.getTreeModel();
        }
        if (log.isDebug()) {
            log.debug("delegating to handler: treeNodeId = " + treeNodeId);
        }
        // used in multiple nodes.
        if (!selTN.getUserObject().equals(userObject)) {
            selTN = subTreeModel.findNodeByUserObject(userObject);
        }
        treeEvent = new TreeEvent(treeEvent.getCommand(), treeEvent.getSubCommand(), selTN.getIdent());
        boolean dispatch = true;
        String selectedNodeId = null;
        if (userObject instanceof String) {
            String sObject = (String) userObject;
            if (MenuTree.COMMAND_TREENODE_CLICKED.equals(treeEvent.getCommand()) && treeEvent.getSubCommand() == null) {
                openCourseNodeIds.add(sObject);
                if (!openTreeNodeIds.contains(sObject)) {
                    openTreeNodeIds.add(sObject);
                }
                selectedNodeId = selTN.getIdent();
            } else if (TreeEvent.COMMAND_TREENODE_OPEN.equals(treeEvent.getSubCommand())) {
                openCourseNodeIds.add(sObject);
                if (!openTreeNodeIds.contains(sObject)) {
                    openTreeNodeIds.add(sObject);
                }
                selectedNodeId = selTN.getIdent();
                dispatch = false;
            } else if (TreeEvent.COMMAND_TREENODE_CLOSE.equals(treeEvent.getSubCommand())) {
                removeChildrenFromOpenNodes(selTN);
                openCourseNodeIds.remove(sObject);
                openTreeNodeIds.remove(sObject);
                openCourseNodeIds.remove(selTN.getIdent());
                openTreeNodeIds.remove(selTN.getIdent());
                dispatch = false;
            }
        }
        if (dispatch) {
            // null as controller source since we are not a controller
            subtreemodelListener.dispatchEvent(ureq, null, treeEvent);
        // no node construction result indicates handled
        }
        ncr = new NodeClickedRef(treeModel, true, selectedNodeId, openTreeNodeIds, internCourseNode, nrcr, true);
    } else {
        // normal dispatching to a coursenode.
        // get the courseNode that was called
        NodeEvaluation prevEval = (NodeEvaluation) selTN.getUserObject();
        if (!prevEval.isVisible())
            throw new AssertException("clicked on a node which is not visible: treenode=" + selTN.getIdent() + ", " + selTN.getTitle());
        CourseNode calledCourseNode = prevEval.getCourseNode();
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(calledCourseNode));
        // might be used in both controllers with the same ID (e.g. the course folder)
        if (TreeEvent.COMMAND_TREENODE_OPEN.equals(treeEvent.getSubCommand()) || TreeEvent.COMMAND_TREENODE_CLOSE.equals(treeEvent.getSubCommand())) {
            if (isInParentLine(calledCourseNode)) {
                if (currentNodeController != null && !currentNodeController.isDisposed() && !isListening(currentNodeController)) {
                    currentNodeController.dispose();
                }
            }
            ncr = doEvaluateJumpTo(ureq, wControl, calledCourseNode, listeningController, nodecmd, treeEvent.getSubCommand(), currentNodeController);
        } else {
            if (currentNodeController != null && !currentNodeController.isDisposed() && !isListening(currentNodeController)) {
                currentNodeController.dispose();
            }
            ncr = doEvaluateJumpTo(ureq, wControl, calledCourseNode, listeningController, nodecmd, treeEvent.getSubCommand(), currentNodeController);
        }
    }
    return ncr;
}
Also used : CPRunController(org.olat.course.nodes.cp.CPRunController) AssertException(org.olat.core.logging.AssertException) OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) EditorMainController(org.olat.course.editor.EditorMainController) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) CPRunController(org.olat.course.nodes.cp.CPRunController) Controller(org.olat.core.gui.control.Controller) ContextEntry(org.olat.core.id.context.ContextEntry) TreeEvent(org.olat.core.gui.components.tree.TreeEvent) ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) CourseNode(org.olat.course.nodes.CourseNode) AbstractAccessableCourseNode(org.olat.course.nodes.AbstractAccessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) NodeEvaluation(org.olat.course.run.userview.NodeEvaluation)

Example 7 with ControllerEventListener

use of org.olat.core.gui.control.ControllerEventListener in project OpenOLAT by OpenOLAT.

the class ScormRuntimeController method doLayout.

private void doLayout(UserRequest ureq) {
    RepositoryEntry entry = getRepositoryEntry();
    ScormPackageConfig scormConfig = ScormMainManager.getInstance().getScormPackageConfig(entry.getOlatResource());
    DeliveryOptions config = scormConfig == null ? null : scormConfig.getDeliveryOptions();
    final OLATResource resource = entry.getOlatResource();
    WindowControl bwControl = getSubWindowControl("Layout");
    final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config, "Knowledge Transfer#_scorm_layout");
    deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() {

        @Override
        public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
            if (source == deliveryOptionsCtrl && (event == Event.DONE_EVENT || event == Event.CHANGED_EVENT)) {
                DeliveryOptions newConfig = deliveryOptionsCtrl.getDeliveryOptions();
                ScormPackageConfig sConfig = ScormMainManager.getInstance().getScormPackageConfig(resource);
                if (sConfig == null) {
                    sConfig = new ScormPackageConfig();
                }
                sConfig.setDeliveryOptions(newConfig);
                ScormMainManager.getInstance().setScormPackageConfig(resource, sConfig);
            }
        }
    });
    pushController(ureq, translate("tab.layout"), deliveryOptionsCtrl);
    setActiveTool(deliveryOptionsLink);
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) OLATResource(org.olat.resource.OLATResource) Event(org.olat.core.gui.control.Event) RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) RepositoryEntryRuntimeController(org.olat.repository.ui.RepositoryEntryRuntimeController) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) Controller(org.olat.core.gui.control.Controller) DeliveryOptions(org.olat.core.gui.control.generic.iframe.DeliveryOptions) DeliveryOptionsConfigurationController(org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController) UserRequest(org.olat.core.gui.UserRequest)

Example 8 with ControllerEventListener

use of org.olat.core.gui.control.ControllerEventListener in project OpenOLAT by OpenOLAT.

the class GUIDemoMainController method handleOwnMenuTreeEvent.

@Override
protected Controller handleOwnMenuTreeEvent(Object uobject, final UserRequest ureq) {
    if (uobject.equals("guidemo-autocompletion")) {
        // for a demo of autocompletion, do a user search
        ListProvider provider = new ListProvider() {

            public void getResult(String searchValue, ListReceiver receiver) {
                Map<String, String> userProperties = new HashMap<String, String>();
                // We can only search in mandatory User-Properties due to problems
                // with hibernate query with join and not existing rows
                userProperties.put(UserConstants.FIRSTNAME, searchValue);
                userProperties.put(UserConstants.LASTNAME, searchValue);
                userProperties.put(UserConstants.EMAIL, searchValue);
                List<Identity> res = BaseSecurityManager.getInstance().getVisibleIdentitiesByPowerSearch(searchValue, userProperties, false, null, null, null, null, null);
                int maxEntries = 15;
                boolean hasMore = false;
                for (Iterator<Identity> it_res = res.iterator(); (hasMore = it_res.hasNext()) && maxEntries > 0; ) {
                    maxEntries--;
                    Identity ident = it_res.next();
                    User u = ident.getUser();
                    String key = ident.getKey().toString();
                    String displayKey = ident.getName();
                    String first = u.getProperty(UserConstants.FIRSTNAME, getLocale());
                    String last = u.getProperty(UserConstants.LASTNAME, getLocale());
                    String displayText = last + " " + first;
                    receiver.addEntry(key, displayKey, displayText, CSSHelper.CSS_CLASS_USER);
                }
                if (hasMore) {
                    receiver.addEntry("-1", ".....");
                }
            }
        };
        Controller c = new AutoCompleterController(ureq, getWindowControl(), provider, null, true, 60, 3, null);
        // for demo only, normally use in parent controller
        c.addControllerListener(new ControllerEventListener() {

            public void dispatchEvent(UserRequest uureq, Controller source, Event event) {
                EntriesChosenEvent ece = (EntriesChosenEvent) event;
                String sel = ece.getEntries().toString();
                getWindowControl().setInfo("selected entrie(s):" + sel);
            }
        });
        return c;
    }
    return null;
}
Also used : User(org.olat.core.id.User) HashMap(java.util.HashMap) ListProvider(org.olat.core.gui.control.generic.ajax.autocompletion.ListProvider) Controller(org.olat.core.gui.control.Controller) AutoCompleterController(org.olat.core.gui.control.generic.ajax.autocompletion.AutoCompleterController) GenericMainController(org.olat.core.gui.control.generic.layout.GenericMainController) ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) Event(org.olat.core.gui.control.Event) EntriesChosenEvent(org.olat.core.gui.control.generic.ajax.autocompletion.EntriesChosenEvent) AutoCompleterController(org.olat.core.gui.control.generic.ajax.autocompletion.AutoCompleterController) Identity(org.olat.core.id.Identity) ListReceiver(org.olat.core.gui.control.generic.ajax.autocompletion.ListReceiver) EntriesChosenEvent(org.olat.core.gui.control.generic.ajax.autocompletion.EntriesChosenEvent) UserRequest(org.olat.core.gui.UserRequest)

Example 9 with ControllerEventListener

use of org.olat.core.gui.control.ControllerEventListener in project OpenOLAT by OpenOLAT.

the class NavigationHandler method evaluateJumpToTreeNode.

/**
 * to be called when the users clickes on a node when in the course
 *
 * @param ureq
 * @param wControl
 * @param treeModel
 * @param treeEvent
 * @param listeningController
 * @param nodecmd null or a subcmd which activates a node-specific view (e.g. opens a certain uri in a contentpackaging- buildingblock)
 * @return the NodeClickedRef
 * @return currentNodeController the current node controller that will be dispose before creating the new one
 */
public NodeClickedRef evaluateJumpToTreeNode(UserRequest ureq, WindowControl wControl, TreeModel treeModel, TreeEvent treeEvent, ControllerEventListener listeningController, String nodecmd, Controller currentNodeController) {
    NodeClickedRef ncr;
    String treeNodeId = treeEvent.getNodeId();
    TreeNode selTN = treeModel.getNodeById(treeNodeId);
    if (selTN == null) {
        selTN = treeModel.getRootNode();
    }
    if (!selTN.isAccessible()) {
        // event to match the new node
        if (selTN.getDelegate() != null) {
            selTN = selTN.getDelegate();
            treeNodeId = selTN.getIdent();
            treeEvent = new TreeEvent(MenuTree.COMMAND_TREENODE_CLICKED, treeNodeId);
        }
    }
    // check if appropriate for subtreemodelhandler
    Object userObject = selTN.getUserObject();
    if (!(userObject instanceof NodeEvaluation)) {
        // yes, appropriate
        NodeRunConstructionResult nrcr = null;
        CourseNode internCourseNode = null;
        GenericTreeModel subTreeModel;
        ControllerEventListener subtreemodelListener = null;
        if (selTN != null) {
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            CourseNode courseNode = prevEval.getCourseNode();
            if (externalTreeModels.containsKey(courseNode.getIdent())) {
                SubTree subTree = externalTreeModels.get(courseNode.getIdent());
                subtreemodelListener = subTree.getTreeModelListener();
            }
        }
        if (subtreemodelListener == null) {
            // throw new AssertException("no handler for subtreemodelcall!");
            // reattach the subtreemodellistener
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            internCourseNode = prevEval.getCourseNode();
            final OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseNode.class, Long.parseLong(internCourseNode.getIdent()));
            ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ores);
            WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl);
            nrcr = internCourseNode.createNodeRunConstructionResult(ureq, bwControl, userCourseEnv, prevEval, nodecmd);
            // remember as instance variable for next click
            subtreemodelListener = nrcr.getSubTreeListener();
            subTreeModel = (GenericTreeModel) nrcr.getSubTreeModel();
            externalTreeModels.put(internCourseNode.getIdent(), new SubTree(nrcr.getRunController(), subTreeModel, subtreemodelListener));
        } else {
            TreeNode internNode = getFirstInternParentNode(selTN);
            NodeEvaluation prevEval = (NodeEvaluation) internNode.getUserObject();
            internCourseNode = prevEval.getCourseNode();
            SubTree subTree = externalTreeModels.get(internCourseNode.getIdent());
            subtreemodelListener = subTree.getTreeModelListener();
            if (currentNodeController instanceof TitledWrapperController) {
                currentNodeController = ((TitledWrapperController) currentNodeController).getContentController();
            }
            if (subtreemodelListener != currentNodeController) {
                if (subtreemodelListener instanceof CPRunController) {
                    nrcr = ((CPRunController) subtreemodelListener).createNodeRunConstructionResult(ureq, selTN.getIdent());
                } else {
                    nrcr = new NodeRunConstructionResult((Controller) subtreemodelListener);
                }
            }
            subTreeModel = subTree.getTreeModel();
        }
        if (log.isDebug()) {
            log.debug("delegating to handler: treeNodeId = " + treeNodeId);
        }
        // used in multiple nodes.
        if (!selTN.getUserObject().equals(userObject)) {
            selTN = subTreeModel.findNodeByUserObject(userObject);
        }
        treeEvent = new TreeEvent(treeEvent.getCommand(), treeEvent.getSubCommand(), selTN.getIdent());
        boolean dispatch = true;
        String selectedNodeId = null;
        if (userObject instanceof String) {
            String sObject = (String) userObject;
            if (MenuTree.COMMAND_TREENODE_CLICKED.equals(treeEvent.getCommand()) && treeEvent.getSubCommand() == null) {
                openCourseNodeIds.add(sObject);
                if (!openTreeNodeIds.contains(sObject)) {
                    openTreeNodeIds.add(sObject);
                }
                selectedNodeId = selTN.getIdent();
            } else if (TreeEvent.COMMAND_TREENODE_OPEN.equals(treeEvent.getSubCommand())) {
                openCourseNodeIds.add(sObject);
                if (!openTreeNodeIds.contains(sObject)) {
                    openTreeNodeIds.add(sObject);
                }
                selectedNodeId = selTN.getIdent();
                dispatch = false;
            } else if (TreeEvent.COMMAND_TREENODE_CLOSE.equals(treeEvent.getSubCommand())) {
                removeChildrenFromOpenNodes(selTN);
                openCourseNodeIds.remove(sObject);
                openTreeNodeIds.remove(sObject);
                openCourseNodeIds.remove(selTN.getIdent());
                openTreeNodeIds.remove(selTN.getIdent());
                dispatch = false;
            }
        }
        if (dispatch) {
            // null as controller source since we are not a controller
            subtreemodelListener.dispatchEvent(ureq, null, treeEvent);
        // no node construction result indicates handled
        }
        ncr = new NodeClickedRef(treeModel, true, selectedNodeId, openTreeNodeIds, internCourseNode, nrcr, true);
    } else {
        // normal dispatching to a coursenode.
        // get the courseNode that was called
        NodeEvaluation prevEval = (NodeEvaluation) selTN.getUserObject();
        if (!prevEval.isVisible())
            throw new AssertException("clicked on a node which is not visible: treenode=" + selTN.getIdent() + ", " + selTN.getTitle());
        CourseNode calledCourseNode = prevEval.getCourseNode();
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrap(calledCourseNode));
        // might be used in both controllers with the same ID (e.g. the course folder)
        if (TreeEvent.COMMAND_TREENODE_OPEN.equals(treeEvent.getSubCommand()) || TreeEvent.COMMAND_TREENODE_CLOSE.equals(treeEvent.getSubCommand())) {
            if (isInParentLine(calledCourseNode)) {
                if (currentNodeController != null && !currentNodeController.isDisposed() && !isListening(currentNodeController)) {
                    currentNodeController.dispose();
                }
            }
            ncr = doEvaluateJumpTo(ureq, wControl, calledCourseNode, listeningController, nodecmd, treeEvent.getSubCommand(), currentNodeController);
        } else {
            if (currentNodeController != null && !currentNodeController.isDisposed() && !isListening(currentNodeController)) {
                currentNodeController.dispose();
            }
            ncr = doEvaluateJumpTo(ureq, wControl, calledCourseNode, listeningController, nodecmd, treeEvent.getSubCommand(), currentNodeController);
        }
    }
    return ncr;
}
Also used : CPRunController(org.olat.course.nodes.cp.CPRunController) AssertException(org.olat.core.logging.AssertException) OLATResourceable(org.olat.core.id.OLATResourceable) WindowControl(org.olat.core.gui.control.WindowControl) EditorMainController(org.olat.course.editor.EditorMainController) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) CPRunController(org.olat.course.nodes.cp.CPRunController) Controller(org.olat.core.gui.control.Controller) ContextEntry(org.olat.core.id.context.ContextEntry) TreeEvent(org.olat.core.gui.components.tree.TreeEvent) ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) TitledWrapperController(org.olat.core.gui.control.generic.title.TitledWrapperController) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) CourseNode(org.olat.course.nodes.CourseNode) AbstractAccessableCourseNode(org.olat.course.nodes.AbstractAccessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) NodeEvaluation(org.olat.course.run.userview.NodeEvaluation)

Example 10 with ControllerEventListener

use of org.olat.core.gui.control.ControllerEventListener in project OpenOLAT by OpenOLAT.

the class NavigationHandler method reloadTreeAfterChanges.

public NodeClickedRef reloadTreeAfterChanges(CourseNode courseNode) {
    TreeEvaluation treeEval = new TreeEvaluation();
    GenericTreeModel treeModel = new GenericTreeModel();
    CourseNode rootCn = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
    NodeEvaluation rootNodeEval = rootCn.eval(userCourseEnv.getConditionInterpreter(), treeEval, filter);
    TreeNode treeRoot = rootNodeEval.getTreeNode();
    treeModel.setRootNode(treeRoot);
    TreeNode treeNode = treeEval.getCorrespondingTreeNode(courseNode.getIdent());
    NodeClickedRef nclr;
    if (treeNode == null) {
        nclr = null;
    } else {
        Object uObject = treeNode.getUserObject();
        if (uObject instanceof NodeEvaluation) {
            NodeEvaluation nodeEval = (NodeEvaluation) uObject;
            ControllerEventListener subtreemodelListener = null;
            if (externalTreeModels.containsKey(courseNode.getIdent())) {
                SubTree subTree = externalTreeModels.get(courseNode.getIdent());
                subtreemodelListener = subTree.getTreeModelListener();
                reattachExternalTreeModels(treeEval);
            }
            openTreeNodeIds = convertToTreeNodeIds(treeEval, openCourseNodeIds);
            selectedCourseNodeId = nodeEval.getCourseNode().getIdent();
            if (subtreemodelListener == null) {
                nclr = new NodeClickedRef(treeModel, true, selectedCourseNodeId, openTreeNodeIds, nodeEval.getCourseNode(), null, false);
            } else {
                nclr = new NodeClickedRef(treeModel, true, selectedCourseNodeId, openTreeNodeIds, nodeEval.getCourseNode(), null, true);
            }
        } else {
            nclr = null;
        }
    }
    return nclr;
}
Also used : ControllerEventListener(org.olat.core.gui.control.ControllerEventListener) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) TreeEvaluation(org.olat.course.run.userview.TreeEvaluation) GenericTreeModel(org.olat.core.gui.components.tree.GenericTreeModel) CourseNode(org.olat.course.nodes.CourseNode) AbstractAccessableCourseNode(org.olat.course.nodes.AbstractAccessableCourseNode) STCourseNode(org.olat.course.nodes.STCourseNode) NodeEvaluation(org.olat.course.run.userview.NodeEvaluation)

Aggregations

ControllerEventListener (org.olat.core.gui.control.ControllerEventListener)14 Controller (org.olat.core.gui.control.Controller)10 WindowControl (org.olat.core.gui.control.WindowControl)8 UserRequest (org.olat.core.gui.UserRequest)6 GenericTreeModel (org.olat.core.gui.components.tree.GenericTreeModel)6 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)6 TreeNode (org.olat.core.gui.components.tree.TreeNode)6 Event (org.olat.core.gui.control.Event)6 AbstractAccessableCourseNode (org.olat.course.nodes.AbstractAccessableCourseNode)6 CourseNode (org.olat.course.nodes.CourseNode)6 STCourseNode (org.olat.course.nodes.STCourseNode)6 NodeEvaluation (org.olat.course.run.userview.NodeEvaluation)6 DeliveryOptions (org.olat.core.gui.control.generic.iframe.DeliveryOptions)4 DeliveryOptionsConfigurationController (org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController)4 TitledWrapperController (org.olat.core.gui.control.generic.title.TitledWrapperController)4 Identity (org.olat.core.id.Identity)4 OLATResourceable (org.olat.core.id.OLATResourceable)4 ContextEntry (org.olat.core.id.context.ContextEntry)4 AssertException (org.olat.core.logging.AssertException)4 EditorMainController (org.olat.course.editor.EditorMainController)4