Package org.apache.jackrabbit.jcr2spi.hierarchy

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


     */
    public Node createConfiguration(String absPath) throws UnsupportedRepositoryOperationException, RepositoryException {
        session.checkIsAlive();

        NodeImpl n = (NodeImpl) itemManager.getNode(resolver.getQPath(absPath));
        NodeEntry entry = vMgr.createConfiguration((NodeState) n.getItemState());
        return (Node) itemManager.getItem(entry);
    }
View Full Code Here


     * @see javax.jcr.version.VersionManager#createActivity(String)
     */
    public Node createActivity(String title) throws UnsupportedRepositoryOperationException, RepositoryException {
        session.checkIsAlive();

        NodeEntry entry = vMgr.createActivity(title);
        return (Node) itemManager.getItem(entry);
    }
View Full Code Here

     * Note, that the given state must not have an overlayed state.
     * @return a state holding a lock or <code>null</code> if neither the
     * given state nor any of its ancestors is locked.
     */
    private NodeState getLockHoldingState(NodeState nodeState) {
        NodeEntry entry = nodeState.getNodeEntry();
        while (!entry.hasPropertyEntry(NameConstants.JCR_LOCKISDEEP)) {
            NodeEntry parent = entry.getParent();
            if (parent == null) {
                // reached root state without finding a locked node
                return null;
            }
            entry = parent;
View Full Code Here

        NodeId lockNodeId = lockInfo.getNodeId();
        if (lockNodeId.equals(nId)) {
            lockHoldingState = nodeState;
        } else {
            NodeEntry lockedEntry = wspManager.getHierarchyManager().getNodeEntry(lockNodeId);
            try {
                lockHoldingState = lockedEntry.getNodeState();
            } catch (RepositoryException e) {
                log.warn("Cannot build LockState");
                throw new RepositoryException("Cannot build LockState", e);
            }
        }
View Full Code Here

        // shortcut: if state is new, its ancestor must be checkout
        if (nodeState.getStatus() == Status.NEW) {
            return true;
        }

        NodeEntry nodeEntry = nodeState.getNodeEntry();
        try {
            // NOTE: since the hierarchy might not be completely loaded or some
            // entry might even not be accessible, the check may not detect
            // a checked-in parent. ok, as long as the 'server' finds out upon
            // save or upon executing the workspace operation.
            while (!nodeEntry.hasPropertyEntry(NameConstants.JCR_ISCHECKEDOUT)) {
                NodeEntry parent = nodeEntry.getParent();
                if (parent == null) {
                    // reached root state without finding a jcr:isCheckedOut property
                    return true;
                }
                nodeEntry = parent;
View Full Code Here

    public static boolean isMovedState(NodeState state) {
        if (state.isRoot()) {
            // the root state cannot be moved
            return false;
        } else {
            NodeEntry ne = state.getNodeEntry();
            return ne.isTransientlyMoved();
        }
    }
View Full Code Here

            String msg = "Root node doesn't have a parent.";
            log.debug(msg);
            throw new ItemNotFoundException(msg);
        }

        NodeEntry parentEntry = getItemState().getHierarchyEntry().getParent();
        return (Node) getItemManager().getItem(parentEntry);
    }
View Full Code Here

        return service.getChildInfos(sessionInfo, nodeId);
    }

    public Iterator<PropertyId> getNodeReferences(NodeState nodeState, Name propertyName, boolean weak) {
        NodeEntry entry = nodeState.getNodeEntry();

        // Shortcut
        if (entry.getUniqueID() == null || !entry.hasPropertyEntry(NameConstants.JCR_UUID)) {
            // for sure not referenceable
            Set<PropertyId> t = Collections.emptySet();
            return t.iterator();
        }

        // Has a unique ID and is potentially mix:referenceable. Try to retrieve references
        try {
            return service.getReferences(sessionInfo, entry.getWorkspaceId(), propertyName, weak);
        } catch (RepositoryException e) {
            log.debug("Unable to determine references to {}", nodeState);
            Set<PropertyId> t = Collections.emptySet();
            return t.iterator();
        }
View Full Code Here

        Path path = info.getId().getPath();
        if (path == null) {
            entry.setUniqueID(uniqueID);
        } else if (uniqueID != null) {
            // uniqueID that applies to a parent NodeEntry -> get parentEntry
            NodeEntry parent = getAncestor(entry, path.getLength());
            parent.setUniqueID(uniqueID);
        }

        int previousStatus = entry.getStatus();
        if (Status.isTransient(previousStatus) || Status.isStale(previousStatus)) {
            log.debug("Node has pending changes; omit resetting the state.");
View Full Code Here

        // make sure uuid part of id is correct
        String uniqueID = info.getId().getUniqueID();
        if (uniqueID != null) {
            // uniqueID always applies to a parent NodeEntry -> get parentEntry
            NodeEntry parent = getAncestor(entry, info.getId().getPath().getLength());
            parent.setUniqueID(uniqueID);
        }

        int previousStatus = entry.getStatus();
        if (Status.isTransient(previousStatus) || Status.isStale(previousStatus)) {
            log.debug("Property has pending changes; omit resetting the state.");
View Full Code Here

TOP

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

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.