Package org.olat.core.util.tree

Examples of org.olat.core.util.tree.Visitor


          }
          insertParent.insert(moveCopyFrom, insertPos);

          moveCopyFrom.setDirty(true);
          //mark subtree as dirty
          TreeVisitor tv = new TreeVisitor( new Visitor() {
            public void visit(INode node) {
              CourseEditorTreeNode cetn = (CourseEditorTreeNode)node;
              cetn.setDirty(true);
            }
          },moveCopyFrom,true);
View Full Code Here


    CourseEditorTreeNode rootNode = (CourseEditorTreeNode) editorModel.getRootNode();
    final List<CourseNode> nodes = new ArrayList<CourseNode>();
    // visitor class: takes all assessable nodes if not the exclude node and
    // 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)) {
View Full Code Here

    FileUtils.copyDirToDir(getIsolatedCourseFolder().getBasefile(), exportDirectory);
    // export any node data
    File fExportedDataDir = new File(exportDirectory, EXPORTED_DATA_FOLDERNAME);
    fExportedDataDir.mkdirs();
    log.info("exportToFilesystem: exporting course "+this+": exporting all nodes...");
    Visitor visitor = new NodeExportVisitor(fExportedDataDir, this);
    TreeVisitor tv = new TreeVisitor(visitor, getEditorTreeModel().getRootNode(), true);
    tv.visitAll();
    log.info("exportToFilesystem: exporting course "+this+": exporting all nodes...done.");
   
    //OLAT-5368: do intermediate commit to avoid transaction timeout
View Full Code Here

    /*
     * the tree is visited and the book keeping lists are filled. the visitor
     * itself does not delete or modify neither runstructure nor editor tree
     * model. The whole complexity of published is encapsulated in the visitor.
     */
    Visitor nodePublishV = new NodePublishVisitor(editorRoot, nodesIdsToPublish, existingCourseRun);
    TreeVisitor tv = new TreeVisitor(nodePublishV, editorRoot, visitChildrenFirst);
    tv.visitAll();
    /*
     *
     */
 
View Full Code Here

   */
  private Map<String, List<String>> checkReferencesFor(TreeNode tn) {
    final CourseEditorTreeModel cetm = CourseFactory.getCourseEditSession(ores.getResourceableId()).getEditorTreeModel();
     //create a list of all nodes in the selected subtree
    final Set<String> allSubTreeids = new HashSet<String>();
    TreeVisitor tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        allSubTreeids.add(node.getIdent());
      }
    }, tn, true);
    tv.visitAll();
     //find all references pointing from outside the subtree into the subtree or
     //on the subtree root node.
    final Map<String, List<String>> allRefs = new HashMap<String, List<String>>();
    tv = new TreeVisitor(new Visitor() {
      public void visit(INode node) {
        List referencingNodes = euce.getCourseEditorEnv().getReferencingNodeIdsFor(node.getIdent());
        // subtract the inner nodes. This allows to delete a whole subtree if
        // only references residing completly inside the subtree are active.
        referencingNodes.removeAll(allSubTreeids);
View Full Code Here

     */
    String currentNodeWas = currentCourseNodeId;
    // reset all
    softRefs = new HashMap();
    nodeRefs = new HashMap<String, Set<String>>();
    Visitor v = new CollectConditionExpressionsVisitor();
    (new TreeVisitor(v, cetm.getRootNode(), true)).visitAll();
    for (Iterator iter = softRefs.keySet().iterator(); iter.hasNext();) {
      String nodeId = (String) iter.next();
      List conditionExprs = (List) softRefs.get(nodeId);
      for (int i = 0; i < conditionExprs.size(); i++) {
View Full Code Here

    DirectedGraph dg = new DefaultDirectedGraph();
    DirectedEdgeFactory def = new EdgeFactories.DirectedEdgeFactory();
    /*
     * add the course structure as directed graph, where
     */
    Visitor v = new Convert2DGVisitor(dg);
    (new TreeVisitor(v, cetm.getRootNode(), true)).visitAll();
    /*
     * iterate over nodeRefs, add each not existing node id as vertex, for each
     * key - child relation add an edge to the directed graph.
     */
 
View Full Code Here

    for (Iterator iter = refs.iterator(); iter.hasNext();) {
      ReferenceImpl ref = (ReferenceImpl) iter.next();
      refM.delete(ref);
    }
    // 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();
View Full Code Here

    String result = ScoreAccountingHelper.createCourseResultsOverviewTable(users, nodes, course, locale);
    String fileName = ExportUtil.createFileNameWithTimeStamp(course.getCourseTitle(), "xls");
    ExportUtil.writeContentToFile(fileName, result, exportDirectory, charset);
   
    // archive all nodes content
    Visitor archiveV = new NodeArchiveVisitor(locale, course, exportDirectory, charset);
    TreeVisitor tv = new TreeVisitor(archiveV, course.getRunStructure().getRootNode(), true);
    tv.visitAll();
    // archive all course log files
    //OLATadmin gets all logfiles independent of the visibility configuration   
    boolean isOresOwner = (oresRights.length > 0)?oresRights[0]:false;
View Full Code Here

    if (isRestrictedEdit()) {
      Set keys = history.keySet();
      /*
       *
       */
      Visitor v = new Visitor() {
        /*
         * a history key is built as follows
         * sectionkey+"/"+itemkey+"/"+questionkey+"/"+responsekey
         */
        String sectionKey = null;
View Full Code Here

TOP

Related Classes of org.olat.core.util.tree.Visitor

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.