Package org.apache.jackrabbit.jcr2spi.hierarchy

Examples of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry


     * @param parent
     * @param state
     * @return
     */
    private static boolean containedInTree(ItemState parent, ItemState state) {
        HierarchyEntry he = state.getHierarchyEntry();
        HierarchyEntry pHe = parent.getHierarchyEntry();
        // short cuts first
        if (he == pHe || he.getParent() == pHe) {
            return true;
        }
        if (!parent.isNode() || he == pHe.getParent()) {
            return false;
        }
        // none of the simple cases: walk up hierarchy
        HierarchyEntry pe = he.getParent();
        while (pe != null) {
            if (pe == pHe) {
                return true;
            }
            pe = pe.getParent();
        }

        // state isn't descendant of 'parent'
        return false;
    }
View Full Code Here


        if (version.getSession() == this) {
            nodeState = (NodeState) ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            Path parentPath = p.getAncestor(1);
            HierarchyEntry parentEntry = getHierarchyManager().lookup(parentPath);
            if (parentEntry != null) {
                // make sure the parent entry is up to date
                parentEntry.invalidate(false);
            }
            nodeState = getHierarchyManager().getNodeState(p);
        }
        return nodeState;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry

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.