Package org.apache.slide.taglib.bean

Examples of org.apache.slide.taglib.bean.NodeBean


     * @throws JspException not thrown
     */
    public int doStartTag()
        throws JspException {
       
        NodeBean node = StrutsTagUtils.findNode(this, pageContext);
        if (node == null) {
            throw new JspException("The 'iterateMembers' tag must be nested " +
                "inside a 'node' tag or an iteration over nodes.");
        }
       
        int depthValue = 1;
        if (depth != null) {
            try {
                depthValue = Integer.parseInt(depth);
            } catch (NumberFormatException e) {
                if (depth.equalsIgnoreCase("infinity")) {
                    depthValue = Integer.MAX_VALUE;
                }
                else {
                    throw new JspException("The attribute 'depth' of the " +
                        "'iterateMembers' tag must contain an integer value.");
                }
            }
        }
       
        Vector members = node.getMembers(depthValue);
       
        // evaluate the includes/excludes, which can be comma separated lists
        Vector includeRolesVector = tokenizeString(includeRoles);
        Vector excludeRolesVector = tokenizeString(excludeRoles);
        Vector includeTypesVector = tokenizeString(includeTypes);
        Vector excludeTypesVector = tokenizeString(excludeTypes);
       
        Iterator i = members.iterator();
        membersIteration: while (i.hasNext()) {
            NodeBean member = (NodeBean)i.next();
           
            String nodeType = member.getType();
            if (excludeTypesVector.contains(nodeType) ||
                (!includeTypesVector.isEmpty() &&
                 !includeTypesVector.contains(nodeType))) {
                i.remove();
                continue membersIteration;
            }
           
            Vector nodeRoles = member.getRoles();
            for (int j = 0; j < nodeRoles.size(); j++) {
                String nodeRole = (String)nodeRoles.elementAt(j);
                if (excludeRolesVector.contains(nodeRole)) {
                    i.remove();
                    continue membersIteration;
View Full Code Here


                    "the 'revision' tag contains an invalid version " +
                    "number.");
            }
        }
       
        NodeBean node = StrutsTagUtils.findNode(this, pageContext);
        revision = getRevision(node, nrn, branch);
       
        return super.doStartTag();
    }
View Full Code Here

     * @throws JspException not thrown
     */
    public int doStartTag()
        throws JspException {
       
        NodeBean node = StrutsTagUtils.findNode(this, pageContext);
        if (node == null) {
            throw new JspException("The 'iterateMembers' tag must be nested " +
                "inside a 'node' tag or an iteration over nodes.");
        }
       
        if (node == null) {
            throw new JspException("The 'iterateLocks' tag must be nested " +
                "inside a 'node' tag.");
        }
       
        int depthValue = 1;
        if (depth != null) {
            try {
                depthValue = Integer.parseInt(depth);
            } catch (NumberFormatException e) {
                if (depth.equalsIgnoreCase("infinity")) {
                    depthValue = Integer.MAX_VALUE;
                }
                else {
                    throw new JspException("The attribute 'depth' of the " +
                        "'iterateMembers' tag must contain an integer value.");
                }
            }
        }
       
        Vector locks = node.getLocks(depthValue);
        setCollection(locks);
       
        return super.doStartTag();
    }
View Full Code Here

     * @param resolveLinks whether to resolve links when retrieving the node
     */
    protected NodeBean getNode(NamespaceBean namespace, String uri,
                               boolean resolveLinks) {
       
        NodeBean bean = null;
        if ((namespace != null) && (uri != null)) {
            try {
                bean = namespace.getNode(uri, resolveLinks);
            } catch (SlideException e) {
                // ignore for now
View Full Code Here

TOP

Related Classes of org.apache.slide.taglib.bean.NodeBean

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.