Package org.olat.course.nodes

Examples of org.olat.course.nodes.CourseNode


    course = CourseFactory.openCourseEditSession(re.getOlatResource().getResourceableId());
    String displayName = re.getDisplayname();
    course.getRunStructure().getRootNode().setShortTitle(Formatter.truncateOnly(displayName, 25)); //do not use truncate!
    course.getRunStructure().getRootNode().setLongTitle(displayName);
   
    CourseNode rootNode = ((CourseEditorTreeNode)course.getEditorTreeModel().getRootNode()).getCourseNode();
    rootNode.setShortTitle(Formatter.truncateOnly(displayName, 25)); //do not use truncate!
    rootNode.setLongTitle(displayName);
   
    CourseFactory.saveCourse(course.getResourceableId());
    CourseFactory.closeCourseEditSession(course.getResourceableId(), true);
  }
View Full Code Here


    GenericTreeNode node = new GenericTreeNode(courseNode.getShortTitle(), null);
    node.setAltText(courseNode.getLongTitle());
    node.setIdent(courseNode.getIdent());
    node.setIconCssClass("o_" + courseNode.getType() + "_icon");
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode childNode = (CourseNode)courseNode.getChildAt(i);
      node.addChild(buildTree(childNode));
    }
    return node;
  }
View Full Code Here

    treeNode.setIdent(courseNode.getIdent());
    treeNode.setTitle(courseNode.getShortTitle());
    treeNode.setIconCssClass(CourseNodeFactory.getInstance().getCourseNodeConfiguration(courseNode.getType()).getIconCSSClass());
    // go through all children and add them as converted tree nodes
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      treeNode.addChild(convertToTreeNode(child));
    }
    return treeNode;
  }
View Full Code Here

    for(Iterator iter = referencees.iterator(); iter.hasNext(); ) {
      ReferenceImpl ref = (ReferenceImpl)iter.next();
      if ("CourseModule".equals(ref.getSource().getResourceableTypeName())) {
        ICourse course = CourseFactory.loadCourse(ref.getSource().getResourceableId());
        CourseNode courseNode = course.getEditorTreeModel().getCourseNode(ref.getUserdata());
        String repositorySoftKey = (String) courseNode.getModuleConfiguration().get(IQEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
        Long repKey = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(repositorySoftKey, true).getKey();
        List<QTIResult> results = QTIResultManager.getInstance().selectResults(course.getResourceableId(), courseNode.getIdent(), repKey, 1);
        this.restrictedEdit = ((CoordinatorManager.getCoordinator().getLocker().isLocked(course, null)) || (results != null && results.size() > 0)) ? true : false;
      }
      if(restrictedEdit) break;
    }
    if(CoordinatorManager.getCoordinator().getLocker().isLocked(fileResource, null)) {
View Full Code Here

        for (int i = 1; i < stakeHoldersIds.size(); i++) {
          user = ((Identity) stakeHoldersIds.get(i)).getUser();
          stakeHolders.append(", ").append(user.getProperty(UserConstants.FIRSTNAME, loc)).append(" ").append(user.getProperty(UserConstants.LASTNAME, loc));
        }

        CourseNode cn = course.getEditorTreeModel().getCourseNode(element.getUserdata());
        String courseNodeTitle = cn.getShortTitle();
        result.append(translate("qti.restricted.course", courseTitle));
        result.append(translate("qti.restricted.node", courseNodeTitle));
        result.append(translate("qti.restricted.owners", stakeHolders.toString()));
      }
    }
View Full Code Here

    PersistingCourseImpl newCourse = new PersistingCourseImpl(ores.getResourceableId());
    // Put new course in course cache   
    putCourseInCache(newCourse.getResourceableId() ,newCourse);
   
    Structure initialStructure = new Structure();
    CourseNode runRootNode = new STCourseNode();
    runRootNode.setShortTitle(shortTitle);
    runRootNode.setLongTitle(longTitle);
    runRootNode.setLearningObjectives(learningObjectives);
    initialStructure.setRootNode(runRootNode);
    newCourse.setRunStructure(initialStructure);
    newCourse.saveRunStructure();

    CourseEditorTreeModel editorTreeModel = new CourseEditorTreeModel();
View Full Code Here

    // call cleanupOnDelet for nodes
    Visitor visitor = new NodeDeletionVisitor(course);
    TreeVisitor tv = new TreeVisitor(visitor, course.getRunStructure().getRootNode(), true);
    tv.visitAll();
    // delete assessment notifications
    CourseNode cn = course.getRunStructure().getRootNode();
    CourseEnvironment ce = course.getCourseEnvironment();
    SubscriptionContext sc = new SubscriptionContext(CourseModule.ORES_COURSE_ASSESSMENT, ce.getCourseResourceableId(), cn.getIdent());
    NotificationsManager.getInstance().delete(sc);
   
    clearCalenderSubscriptions(course);
    // delete course configuration
    CourseConfigManagerImpl.getInstance().deleteConfigOf(course);
View Full Code Here

   * @param course
   * @param currentNode
   */
  private static void registerReferences(ICourse course, CourseNode currentNode) {
    for (int i = 0; i < currentNode.getChildCount(); i++) {
      CourseNode childNode = (CourseNode)currentNode.getChildAt(i);
      if (childNode.needsReferenceToARepositoryEntry()) {
        ReferenceManager.getInstance().addReference(course,
          childNode.getReferencedRepositoryEntry().getOlatResource(), childNode.getIdent());
      }
      registerReferences(course, childNode);
    }
  }
View Full Code Here

    nodeListCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.action.select", 1,
        CMD_SELECT_NODE, ureq.getLocale()));
   
    // get list of course node data and populate table data model
    ICourse course = CourseFactory.loadCourse(ores);
    CourseNode rootNode = course.getRunStructure().getRootNode();
    List objectArrayList = addQTINodesAndParentsToList(0, rootNode);
   
    return objectArrayList;   
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  private List addQTINodesAndParentsToList(int recursionLevel, CourseNode courseNode) {
    // 1) Get list of children data using recursion of this method
    List childrenData = new ArrayList();
    for (int i = 0; i < courseNode.getChildCount(); i++) {
      CourseNode child = (CourseNode) courseNode.getChildAt(i);
      List childData = addQTINodesAndParentsToList( (recursionLevel + 1),  child);
      if (childData != null)
        childrenData.addAll(childData);
    }
   
View Full Code Here

TOP

Related Classes of org.olat.course.nodes.CourseNode

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.