Package org.apache.webapp.admin

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


    }

    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

    }
   
    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

               
                // 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

                // 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

                // 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

                                   
                // 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

                // 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

            // Remove the specified realms
            for (int i = 0; i < realms.length; i++) {
                values[0] = realms[i];
                if (control != null) {
                    control.selectNode(null);
                    TreeControlNode node = control.findNode(realms[i]);
                    String domain = node.getDomain();
                    ObjectName fname =
                        TomcatTreeBuilder.getMBeanFactory();
                    mBServer.invoke(fname, operation,
                                values, removeRealmTypes);
                    if (node != null) {
                        node.remove();
                    } else {
                        getServlet().log("Missing TreeControlNode for " +
                                         realms[i]);
                    }
                } else {
View Full Code Here

            // Remove the specified contexts
            for (int i = 0; i < contexts.length; i++) {
                values[0] = contexts[i];
                if (control != null) {
                    control.selectNode(null);
                    TreeControlNode node = control.findNode(contexts[i]);
                    String domain = node.getDomain();
                    ObjectName fname = TomcatTreeBuilder.getMBeanFactory();
                    mBServer.invoke(fname, operation,
                                values, removeContextTypes);
                    if (node != null) {
                        node.remove();
                    } else {
                        getServlet().log("Missing TreeControlNode for " +
                                         contexts[i]);
                    }
                } else {
View Full Code Here

TOP

Related Classes of org.apache.webapp.admin.TreeControlNode

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.