Package org.olat.core.util.nodes

Examples of org.olat.core.util.nodes.INode


    TreeModel tm = buildTreeModel();
    olatMenuTree.setTreeModel(tm);
    content = new Panel("content");
    // no child -> show a blank page
    if (tm.getRootNode().getChildCount() > 0) {
      INode firstNode = tm.getRootNode();
      olatMenuTree.setSelectedNodeId(firstNode.getIdent());
      olatMenuTree.addListener(this);

      Object uobject = tm.getRootNode().getUserObject();
      contentCtr = getContentCtr(uobject, ureq);
      listenTo(contentCtr); // auto dispose later
View Full Code Here


    MenuTree tree = (MenuTree) source;
   
    // unique ID used for DOM component identification
    String compPrefix = renderer.getComponentPrefix(tree);
   
    INode selNode = tree.getSelectedNode();
    TreeNode root = tree.getTreeModel().getRootNode();
    if (root == null) return; // tree is completely empty

    if (tree.isExpandServerOnly()) {
      // render only the expanded path using no javascript
      List selPath = new ArrayList(5);
      INode cur = selNode;
      if (cur == null) cur = root;
      // if no selection, select the first node to
      // expand the children
      // add all elems from selected path to reversed list -> first elem is
      // selected nodeid of the root node     
     
      while (cur != null) {
        selPath.add(0, cur);
        cur = cur.getParent();
      }
      target.append("\n<div class=\"b_tree\">");
      target.append("<ul class=\"b_tree_l0\">");
      renderLevel(target, 0, root, selPath, ubu, renderer.getGlobalSettings().getAjaxFlags(), compPrefix, tree.markingTreeNode);
      target.append("</ul>");
View Full Code Here

    }
  }

  private void renderLevel(StringOutput target, int level, TreeNode curRoot, List selPath, URLBuilder ubu, AJAXFlags flags, String componentPrefix, TreeNode markedNode) { 
    //TODO make performant
    INode curSel = null;
    if (level < selPath.size()) {
      curSel = (INode) selPath.get(level);
    }

    // get css class
View Full Code Here

  public void render(Renderer renderer, StringOutput target, Component source, URLBuilder ubu, Translator translator,
      RenderResult renderResult, String[] args) {
    MenuTree tree = (MenuTree) source;
    String compPrefix = renderer.getComponentPrefix(tree);
   
    INode selNode = tree.getSelectedNode();
    TreeNode root = tree.getTreeModel().getRootNode();
    if (root == null) return; // tree is completely empty

    List selPath = new ArrayList(5);
    INode cur = selNode;
    if (cur == null) cur = root; // if no selection, select the first node to
    // expand the children
    // add all elems from selected path to reversed list -> first elem is
    // selected nodeid of the root node
   
    while (cur != null) {
      selPath.add(0, cur);
      cur = cur.getParent();
    }
   
    // render overview information for screenreaders
    if (tree.isDirtyForUser() && selNode != null) {
      // this is the case when a new subtree expanded (parent is the node we just clicked).
View Full Code Here

  /**
   * @param target
   */
  private void renderLevel(StringOutput target, int level, TreeNode curRoot, List selPath, URLBuilder ubu, AJAXFlags flags, String componentPrefix, TreeNode markedNode) {

    INode curSel = null;
    if (level < selPath.size()) {
      curSel = (INode) selPath.get(level);
    }

    target.append("<ul><li>");
View Full Code Here

    if (!visitChildrenFirst) {
      v.visit(node);
    }
    int chdCnt = node.getChildCount();
    for (int i = 0; i < chdCnt; i++) {
      INode chd = node.getChildAt(i);
      doVisit(chd);
    }
    if (visitChildrenFirst) {
      v.visit(node);
    }
View Full Code Here

    // par = par.getParent());
    // return (par == sourceTree);
    ICourse course = CourseFactory.getCourseEditSession(ores.getResourceableId());
    if (sourceTree.getIdent().equals(prospectChild.getIdent())) return true;
    for (int i = 0; i < sourceTree.getChildCount(); i++) {
      INode child = sourceTree.getChildAt(i);
      if (checkIfIsChild(prospectChild, course.getEditorTreeModel().getCourseEditorNodeById(child.getIdent()))) return true;
    }
    return false;
  }
View Full Code Here

    // add portal
    myPortal = PortalFactory.createPortal("guestportal", getWindowControl(), ureq);
    welcome.put("myPortal", myPortal.getInitialComponent());

    // Activate correct position in menu
    INode firstNode = tm.getRootNode().getChildAt(0);
    olatMenuTree.setSelectedNodeId(firstNode.getIdent());

    columnLayoutCtr = new LayoutMain3ColsController(ureq, getWindowControl(), olatMenuTree, null, welcome, null);
    listenTo(columnLayoutCtr); // cleanup on dispose
    // add background image to home site
    columnLayoutCtr.addCssClassToMain("o_home");
View Full Code Here

      String key = cn.getIdent();
      dg.addVertex(key);
      /*
       * add edge from parent to child. This directed edge represents the visibility accessability inheritance direction.
       */
      INode parent = tmp.getParent();
      if(parent!=null) {
        dg.addVertex(parent.getIdent());
        Edge toParent = def.createEdge( parent.getIdent(),key);
        dg.addEdge(toParent);
      }
    }
View Full Code Here

  public void doIndexCourse(SearchResourceContext repositoryResourceContext, ICourse course, CourseNode courseNode, OlatFullIndexer indexWriter) throws IOException,InterruptedException  {
    // loop over all child nodes
    int childCount = courseNode.getChildCount();
    for (int i=0;i<childCount; i++) {
      INode childCourseNode = courseNode.getChildAt(i);
      if (childCourseNode instanceof CourseNode) {
        if (log.isDebug()) log.debug("Analyse CourseNode child ... childCourseNode=" + childCourseNode);
        // go further with resource
        CourseNodeIndexer courseNodeIndexer = CourseNodeIndexerFactory.getInstance().getCourseNodeIndexer( (CourseNode)childCourseNode);
        if (courseNodeIndexer != null) {
          if (log.isDebug()) log.debug("courseNodeIndexer=" + courseNodeIndexer);
           try {
            courseNodeIndexer.doIndex(repositoryResourceContext, course, (CourseNode)childCourseNode, indexWriter);
          } catch (Exception e) {
            log.warn("Can not index course node=" + childCourseNode.getIdent(), e);
          }
        } else {
          if (log.isDebug()) log.debug("No CourseNodeIndexer for " + childCourseNode);       
          // go further, index my child nodes
          doIndexCourse(repositoryResourceContext, course, (CourseNode)childCourseNode, indexWriter);
View Full Code Here

TOP

Related Classes of org.olat.core.util.nodes.INode

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.