Package org.brixcms.jcr.JcrUtil

Examples of org.brixcms.jcr.JcrUtil.ParentLimiter


    public void restoreNodes(List<JcrNode> nodes, final JcrNode targetRootNode) {
        if (nodes.isEmpty()) {
            throw new IllegalStateException("List 'nodes' must contain at least one node.");
        }

        ParentLimiter limiter = null;

        // targetRootNode is only applicable for regular Site nodes (not even
        // global container)

        final String siteRoot = SitePlugin.get().getSiteRootPath();

        if (targetRootNode.getDepth() > 0) {
            final String commonParent = getCommonParentPath(nodes);
            limiter = new ParentLimiter() {
                public boolean isFinalParent(JcrNode node, JcrNode parent) {
                    if (node.getPath().startsWith(siteRoot) && node instanceof GlobalContainerNode == false) {
                        return parent.getPath().equals(commonParent);
                    } else {
                        return parent.getDepth() == 0;
View Full Code Here

TOP

Related Classes of org.brixcms.jcr.JcrUtil.ParentLimiter

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.