Examples of TreeControlNode


Examples of org.apache.webapp.admin.TreeControlNode

        {
            // expand or contact non-leaf nodes
            String node = actionRequest.getParameter(SecurityResources.REQUEST_NODE);
            if (node != null)
            {
                TreeControlNode controlNode = control.findNode(node);
                if (controlNode != null)
                {
                    controlNode.setExpanded(!controlNode.isExpanded());
                }
            }

            // select a node
            String selectedNode = actionRequest.getParameter(SecurityResources.REQUEST_SELECT_NODE);
View Full Code Here

Examples of org.apache.webapp.admin.TreeControlNode

    }

    private void selectNode(ActionRequest actionRequest, TreeControl control, String selectedNode)
    {
        control.selectNode(selectedNode);
        TreeControlNode child = control.findNode(selectedNode);
        if (child != null)
        {
            String domain = child.getDomain();
            if (domain.equals(USER_DETAIL_DOMAIN))
            {
                if (selectedNode != null)
                {
                    actionRequest.getPortletSession().setAttribute(
View Full Code Here

Examples of org.apache.webapp.admin.TreeControlNode

    }
   
    private TreeControl buildTree(Iterator users, Locale locale)
    {

        TreeControlNode root = new TreeControlNode(SECURITY_NODE_ID, // node id
                null, // icon
                getMessage(MSG_SECURITY_ROOT, locale), // title
                SecurityResources.PORTLET_URL, null, // target window
                true, // expand initially
                SECURITY_DOMAIN); // domain

        TreeControl control = new TreeControl(root);

        TreeControlNode userTree = new TreeControlNode(USER_NODE_ID, // node id
                null, // icon
                getMessage(MSG_USER_ROOT, locale), // title
                SecurityResources.PORTLET_URL, null, // target window
                false, // expand initially
                USER_DOMAIN); // domain
        root.addChild(userTree);

        while (users.hasNext())
        {
            User user = (User) users.next();
            Principal principal = getPrincipal(user.getSubject(), UserPrincipal.class);

            TreeControlNode userNode = new TreeControlNode(principal.getName(), null, principal.getName(),
                    SecurityResources.PORTLET_URL, null, false, USER_DETAIL_DOMAIN);
            userTree.addChild(userNode);
        }

        return control;
View Full Code Here

Examples of org.apache.webapp.admin.TreeControlNode

               
                // Add the new Realm to our tree control node
                TreeControl control = (TreeControl)
                    session.getAttribute("treeControlTest");
                if (control != null) {
                    TreeControlNode parentNode = control.findNode(rform.getParentObjectName());
                    if (parentNode != null) {
                        String nodeLabel = rform.getNodeLabel();
                        String encodedName =
                            URLEncoder.encode(rObjectName,TomcatTreeBuilder.URL_ENCODING);
                        TreeControlNode childNode =
                            new TreeControlNode(rObjectName,
                                                "Realm.gif",
                                                nodeLabel,
                                                "EditRealm.do?select=" +
                                                encodedName,
                                                "content",
View Full Code Here

Examples of org.apache.webapp.admin.TreeControlNode

                // Add the new Realm to our tree control node
                TreeControl control = (TreeControl)
                    session.getAttribute("treeControlTest");
                if (control != null) {
                    TreeControlNode parentNode = control.findNode(rform.getParentObjectName());
                    if (parentNode != null) {
                        String nodeLabel = rform.getNodeLabel();                       
                        String encodedName =
                            URLEncoder.encode(rObjectName,TomcatTreeBuilder.URL_ENCODING);
                        TreeControlNode childNode =
                            new TreeControlNode(rObjectName,
                                                "Realm.gif",
                                                nodeLabel,
                                                "EditRealm.do?select=" +
                                                encodedName,
                                                "content",
View Full Code Here

Examples of org.nextime.ion.backoffice.tree.TreeControlNode

    // retrieve selected section
    TreeControl tree =
      (TreeControl) request.getSession().getAttribute("treeControlTest");
    String selectedId = request.getParameter("id");
    TreeControlNode node = tree.findNode(selectedId);

    try {
      Mapping.begin();

      Section section = Section.getInstance(selectedId);
      section.remove();
      // update tree
      try {
        TreeControlNode parent = node.getParent();
        node.remove();
        if (parent != null) {
          parent.rebuildLastChildren();
        }
      } catch (Exception e) {
      }

      Mapping.commit();
View Full Code Here

Examples of org.nextime.ion.backoffice.tree.TreeControlNode

  }
       
        // retrieve selected section
        TreeControl tree = (TreeControl)request.getSession().getAttribute("treeControlTest");
        String selectedId = request.getParameter("id") ;      
        TreeControlNode node = tree.findNode(selectedId);
               
        try {
          Mapping.begin();         
         
          Section section = Section.getInstance(selectedId);
          String newId = IdGenerator.nextSectionId();
          Section newSection = section.create(section,newId);
          newSection.setMetaData("status","offline");
          request.setAttribute("id",newId);
          // update tree
          TreeControlNode newNode = WcmTreeBuilder.buildNode(newSection);
          node.addChild(newNode);
          newNode.rebuildLast();
         
          Mapping.commit();
        } catch(Exception e) {
          Mapping.rollback();
          throw new ServletException(e);
View Full Code Here

Examples of org.nextime.ion.backoffice.tree.TreeControlNode

    // get section
    try {
      Mapping.begin();
     
      Section section = Section.getInstance(request.getParameter("id"));
      TreeControlNode node = ((TreeControl)(request.getSession().getAttribute("treeControlTest"))).findNode(request.getParameter("id"));
      // up or down ?
      if( request.getParameter("type").equals("up") ) {
        section.up();
        node.up();
      } else {
        section.down();
        node.down();
      }
     
      Mapping.commit();
    } catch (Exception e) {
      Mapping.rollback();
View Full Code Here

Examples of org.nextime.ion.backoffice.tree.TreeControlNode

        name = request.getParameter("tree");

        if (name != null) {
            getServlet().log("Tree expand/contract on " + name);

            TreeControlNode node = control.findNode(name);

            if (node != null){
                getServlet().log("Found Node: " + name);
                node.setExpanded(!node.isExpanded());
            }
        }else{
            getServlet().log("tree param is null");
        }
View Full Code Here

Examples of org.nextime.ion.backoffice.tree.TreeControlNode

      // Make the root node and tree control

      // The root node gets rendered only if its value
      // is set as an init-param in web.xml

      TreeControlNode root =
        new TreeControlNode(
          "ROOT-NODE",
          "root.gif",
          rootnodeName,
          "setUpTree.x?select=ROOT-NODE",
          "content",
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.