Package org.olat.course.run.navigation

Examples of org.olat.course.run.navigation.NodeClickedRef


   
    // evaluate scoring
    uce.getScoreAccounting().evaluateAll();
   
    // build menu (treemodel)
    NodeClickedRef nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), null, null, null);
    if (!nclr.isVisible()) {
      getWindowControl().setWarning(translate("rootnode.invisible"));
      VelocityContainer noaccess = createVelocityContainer("noaccess");   
      configButton = LinkFactory.createButton("command.config", noaccess, this);
      previewLayoutCtr.setCol3(noaccess);
      return;
    }
     
    treeModel = nclr.getTreeModel();
    luTree.setTreeModel(treeModel);
    previewLayoutCtr.setCol1(luTree);
   
    detail = createVelocityContainer("detail");
   
    configButton = LinkFactory.createButton("command.config", detail, this);
   
    content = new Panel("building_block_content");
    currentNodeController = nclr.getRunController();
    currentNodeController.addControllerListener(this);
    content.setContent(currentNodeController.getInitialComponent());
    detail.put("content", content);
    detail.contextPut("time", DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, ureq.getLocale())
        .format(new Date(uce.getCourseEnvironment().getCurrentTimeMillis())));
View Full Code Here


        TreeEvent tev = (TreeEvent)event;
       
        // goto node:
        // after a click in the tree, evaluate the model anew, set the tree
        // model anew, and set the selection of the tree again
        NodeClickedRef nclr = navHandler.evaluateJumpToTreeNode(ureq, getWindowControl(), treeModel, tev, this, null);
        if (!nclr.isVisible()) {
          getWindowControl().setWarning(translate("warn.notvisible"));
          return;
        }
        if (nclr.isHandledBySubTreeModelListener()) return;
       
        // set the new treemodel
        treeModel = nclr.getTreeModel();
        luTree.setTreeModel(treeModel);
       
        // set the new tree selection
        luTree.setSelectedNodeId(nclr.getSelectedNodeId());

        // dispose old node controller
        if (currentNodeController != null) {
          currentNodeController.dispose();
        }
        // get the controller (in this case it is a preview controller)
        currentNodeController = nclr.getRunController();
       
        CourseNode cn = nclr.getCalledCourseNode();
        Condition c = cn.getPreConditionVisibility();
        String visibilityExpr = (c.getConditionExpression() == null? translate("details.visibility.none") : c.getConditionExpression());
        detail.contextPut("visibilityExpr", visibilityExpr);
        detail.contextPut("coursenode", cn);
View Full Code Here

   * @param calledCourseNode the node to jump to, if null = jump to root node
   * @return true if the node jumped to is visible
   */
  private boolean updateTreeAndContent(UserRequest ureq, CourseNode calledCourseNode) {
    // build menu (treemodel)
    NodeClickedRef nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), calledCourseNode, this, null);
    if (!nclr.isVisible()) {
      // if not root -> fallback to root. e.g. when a direct node jump fails
      if (calledCourseNode != null) {
        nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), null, null, null);
      }
      if (!nclr.isVisible()) {
        getWindowControl().setWarning(translate("msg.nodenotavailableanymore"));
        content.setContent(null);
        luTree.setTreeModel(new GenericTreeModel());
        return false;
      }
    }

    treeModel = nclr.getTreeModel();
    luTree.setTreeModel(treeModel);
    String selNodeId = nclr.getSelectedNodeId();
    luTree.setSelectedNodeId(selNodeId);

    // dispose old node controller
    if (currentNodeController != null) {
      currentNodeController.dispose();
    }
    currentNodeController = nclr.getRunController();
    content.setContent(currentNodeController.getInitialComponent());
    // enableCustomCourseCSS(ureq);
    return true;
  }
View Full Code Here

   * @param nodecmd An optional command used to activate the run view or NULL if not available
   * @return true if the node jumped to is visible
   */
  private boolean updateTreeAndContent(UserRequest ureq, CourseNode calledCourseNode, String nodecmd) {
    // build menu (treemodel)
    NodeClickedRef nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), calledCourseNode, this, nodecmd);
    if (!nclr.isVisible()) {
      // if not root -> fallback to root. e.g. when a direct node jump fails
      if (calledCourseNode != null) {
        nclr = navHandler.evaluateJumpToCourseNode(ureq, getWindowControl(), null, null, null);
      }
      if (!nclr.isVisible()) {
        MessageController msgController = MessageUIFactory.createInfoMessage(ureq, this.getWindowControl(),  translate("course.noaccess.title"), translate("course.noaccess.text"));
        contentP.setContent(msgController.getInitialComponent());         
        luTree.setTreeModel(new GenericTreeModel());
        return false;
      }
    }

    treeModel = nclr.getTreeModel();
    luTree.setTreeModel(treeModel);
    String selNodeId = nclr.getSelectedNodeId();
    luTree.setSelectedNodeId(selNodeId);
    CourseNode courseNode = nclr.getCalledCourseNode();
    updateState(courseNode);

    // dispose old node controller
    if (currentNodeController != null) {
      currentNodeController.dispose();
    }
    currentNodeController = nclr.getRunController();
    contentP.setContent(currentNodeController.getInitialComponent());
    // enableCustomCourseCSS(ureq);

    return true;
  }
View Full Code Here

       
        //getWindowControl().setInfo("time: "+System.currentTimeMillis());
        // goto node:
        // after a click in the tree, evaluate the model anew, and set the
        // selection of the tree again
        NodeClickedRef nclr = navHandler.evaluateJumpToTreeNode(ureq, getWindowControl(), treeModel, tev, this, null);
        if (!nclr.isVisible()) {
          getWindowControl().setWarning(translate("msg.nodenotavailableanymore"));
          return;
        }
        // a click to a subtree's node
        if (nclr.isHandledBySubTreeModelListener()) return;

        // set the new treemodel
        treeModel = nclr.getTreeModel();
        luTree.setTreeModel(treeModel);

        // set the new tree selection
        String nodeId = nclr.getSelectedNodeId();
        luTree.setSelectedNodeId(nodeId);
        currentCourseNode = nclr.getCalledCourseNode();
        updateState(currentCourseNode);

        // dispose old node controller
        if (currentNodeController != null) {
          currentNodeController.dispose();
        }

        currentNodeController = nclr.getRunController();
        Component nodeComp = currentNodeController.getInitialComponent();
        contentP.setContent(nodeComp);
       
        // set glossary wrapper dirty after menu click to make it reload the glossary
        // stuff properly when in AJAX mode
View Full Code Here

TOP

Related Classes of org.olat.course.run.navigation.NodeClickedRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.