Examples of CourseNode


Examples of org.olat.course.nodes.CourseNode

        }
        if ("CourseNode".equals(tokenType)) {
          String repoKey = allTokens.get(0).split("[:]")[1];
          RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(Long.parseLong(repoKey));
          ICourse course = CourseFactory.loadCourse(re.getOlatResource());
          CourseNode courseNode = course.getRunStructure().getNode(tokenKey);
          return courseNode.getShortTitle();
        }
        if ("Identity".equals(tokenType)) {
          Identity identity  = ManagerFactory.getManager().loadIdentityByKey(Long.parseLong(tokenKey));
          User user = identity.getUser();
          return user.getProperty(UserConstants.LASTNAME, locale) + " " + user.getProperty(UserConstants.FIRSTNAME, locale) ;
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

    if (path.isCourseType()) {
      // A course node is being requested
      OLATResourceable oresCourse = OLATResourceManager.getInstance()
          .findResourceable(path.getCourseId(), CourseModule.getCourseTypeName());
      ICourse course = CourseFactory.loadCourse(oresCourse);
      CourseNode node = course.getEditorTreeModel().getCourseNode(path.getNodeId());
      // Check access
      hasAccess = hasAccess(identity, path.getToken(), course, node);
    } else {
      // A learning resource is being requested
      hasAccess = hasAccess(identity, path.getToken(), feed);
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

      TreeEvent te = (TreeEvent) event;
      if (te.getCommand().equals(TreeEvent.COMMAND_TREENODE_CLICKED)) {
        // user chose a position to insert a new node
        String nodeId = te.getNodeId();
        TreePosition tp = insertModel.getTreePosition(nodeId);
        CourseNode selectedNode = insertModel.getCourseNode(tp.getParentTreeNode());
        CourseEditorTreeNode insertParent = course.getEditorTreeModel().getCourseEditorNodeById(selectedNode.getIdent());

        // check if insert position is within the to-be-copied tree
        if (checkIfIsChild(insertParent, moveCopyFrom)) {         
          this.showError("movecopynode.error.overlap");
          fireEvent(ureq, Event.CANCELLED_EVENT);
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

    }
  }

  private void recursiveCopy(CourseEditorTreeNode copyFrom2, CourseEditorTreeNode insertParent, int pos, boolean firstIteration, ICourse course) {   
    // create copy of course node
    CourseNode copyOfNode = copyFrom2.getCourseNode().createInstanceForCopy(firstIteration);
    copyNodeId = copyOfNode.getIdent();
    // Insert at desired position   
    course.getEditorTreeModel().insertCourseNodeAt(copyOfNode, insertParent.getCourseNode(), pos);
    CourseEditorTreeNode insertedEditorTreeNode = course.getEditorTreeModel().getCourseEditorNodeById(copyOfNode.getIdent());
    for (int i = 0; i < copyFrom2.getChildCount(); i++) {
      recursiveCopy(course.getEditorTreeModel().getCourseEditorNodeById(copyFrom2.getChildAt(i).getIdent()), insertedEditorTreeNode, i, false, course);
    }
  }
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

    if (nodeIdentList.size() > 0) {
      // there are nodes to be selected
      keysList.add(NO_NODE_SELECTED_IDENTIFYER);
      valuesList.add("- " + translator.translate("form.easy.nodePassed.select") + " -");
      for (int i = 0; i < nodeIdentList.size(); i++) {
        CourseNode courseNode = (CourseNode) nodeIdentList.get(i);
        keysList.add(courseNode.getIdent());
        valuesList.add(courseNode.getShortName() + " (Id:" + courseNode.getIdent() + ")");
        if (courseNode.getIdent().equals(nodePassedInitVal)) selectedNodeIsInList = true;
      }
    } else {
      // no nodes to be selected
      keysList.add(NO_NODE_SELECTED_IDENTIFYER);
      valuesList.add("- " + translator.translate("form.easy.nodePassed.noNodes"));
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

          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);

        Component nodeComp = currentNodeController.getInitialComponent();
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

      if (event instanceof OlatCmdEvent) {
        OlatCmdEvent oe = (OlatCmdEvent) event;
        String cmd = oe.getCommand();
        if (cmd.equals(OlatCmdEvent.GOTONODE_CMD)) {
          String subcmd = oe.getSubcommand(); // "69680861018558";
          CourseNode identNode = uce.getCourseEnvironment().getRunStructure().getNode(subcmd);
          updateTreeAndContent(ureq, identNode);
          oe.accept();
        }
      }
    }
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

      return true;
    }
    // check children now
    int count = node.getChildCount();
    for (int i = 0; i < count; i++) {
      CourseNode cn = (CourseNode) node.getChildAt(i);
      if (checkForAssessableNodes(cn)) return true;
    }
    return false;
  }
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

    // puts
    // them into the nodes list
    Visitor visitor = new Visitor() {
      public void visit(INode node) {
        CourseEditorTreeNode editorNode = (CourseEditorTreeNode) node;
        CourseNode courseNode = editorModel.getCourseNode(node.getIdent());
        if (!editorNode.isDeleted() && (courseNode != excludeNode)) {
          if(checkIfNodeIsAssessable(courseNode)) {
            nodes.add(courseNode);
          }
        }
View Full Code Here

Examples of org.olat.course.nodes.CourseNode

   */
  static List<Map<String,Object>> addAssessableNodeAndDataToList(int recursionLevel, CourseNode courseNode, UserCourseEnvironment userCourseEnv, boolean discardEmptyNodes, boolean discardComments) {
    // 1) Get list of children data using recursion of this method
    List<Map<String, Object>> childrenData = new ArrayList<Map<String, Object>>(50);
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      List<Map<String, Object>> childData = addAssessableNodeAndDataToList( (recursionLevel + 1),  child, userCourseEnv, discardEmptyNodes, discardComments);
      if (childData != null)
        childrenData.addAll(childData);
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.