Package org.apache.jackrabbit.jcr2spi.state

Examples of org.apache.jackrabbit.jcr2spi.state.NodeState


     */
    private void notifyUUIDorMIXINRemoved(Name propName) {
        if (NameConstants.JCR_UUID.equals(propName)) {
            setUniqueID(null);
        } else if (NameConstants.JCR_MIXINTYPES.equals(propName)) {
            NodeState state = (NodeState) internalGetItemState();
            if (state != null) {
                state.setMixinTypeNames(Name.EMPTY_ARRAY);
            }
        }
    }
View Full Code Here


    public static Operation create(NodeState parentState, Path.Element srcName,
                                   Path.Element beforeName) throws ItemNotFoundException, RepositoryException {
        // make sure the parent hierarchy entry has its child entries loaded
        assertChildNodeEntries(parentState);

        NodeState insert = parentState.getChildNodeState(srcName.getName(), srcName.getNormalizedIndex());
        NodeState before = (beforeName == null) ? null : parentState.getChildNodeState(beforeName.getName(), beforeName.getNormalizedIndex());
        return new ReorderNodes(parentState, insert, before);
    }
View Full Code Here

            String msg = "Cannot move the root node.";
            log.debug(msg);
            throw new RepositoryException(msg);
        }

        NodeState srcState = getNodeState(srcPath, hierMgr);
        NodeState srcParentState = getNodeState(srcPath.getAncestor(1), hierMgr);
        NodeState destParentState = getNodeState(destPath.getAncestor(1), hierMgr);
        Name destName = destElement.getName();

        if (sessionMove) {
            NodeEntry destEntry = (NodeEntry) destParentState.getHierarchyEntry();

            // force child node entries list to be present before the move is executed
            // on the hierarchy entry.
            assertChildNodeEntries(srcParentState);
            assertChildNodeEntries(destParentState);
View Full Code Here

            String msg = "Unable to resolve merge conflict. Specified version is not in jcr:mergeFailed property: " + safeGetJCRPath();
            log.error(msg);
            throw new VersionException(msg);
        }

        NodeState versionState = session.getVersionState(version);
        session.getVersionStateManager().resolveMergeConflict(getNodeState(), versionState, done);
    }
View Full Code Here

            }
            targetNode.checkIsLocked();
            // NOTE: check for nodetype constraint violation is left to the 'server'
        }

        NodeState versionState = session.getVersionState(version);
        session.getVersionStateManager().restore(targetNode.getNodeState(), relQPath, versionState, removeExisting);
    }
View Full Code Here

     *
     * @param version
     * @return the NodeState associated with the specified version.
     */
    NodeState getVersionState(Version version) throws RepositoryException {
        NodeState nodeState;
        if (version.getSession() == this) {
            nodeState = (NodeState) ((NodeImpl) version).getItemState();
        } else {
            Path p = getQPath(version.getPath());
            Path parentPath = p.getAncestor(1);
View Full Code Here

         * @inheritDoc
         * @see OperationVisitor#visit(RemoveVersion)
         */
        public void visit(RemoveVersion operation) throws VersionException, AccessDeniedException, ReferentialIntegrityException, RepositoryException {
            NodeId versionId = (NodeId) operation.getRemoveId();
            NodeState vhState = operation.getParentState();
            service.removeVersion(sessionInfo, (NodeId) vhState.getWorkspaceId(), versionId);
        }
View Full Code Here

        Path targetPath = getQPath(absPath);

        boolean isGranted;
        // The given abs-path may point to a non-existing item
        if (itemManager.nodeExists(targetPath)) {
            NodeState nState = getHierarchyManager().getNodeState(targetPath);
            isGranted = getAccessManager().isGranted(nState, actionsArr);
        } else if (itemManager.propertyExists(targetPath)) {
            PropertyState pState = getHierarchyManager().getPropertyState(targetPath);
            isGranted = getAccessManager().isGranted(pState, actionsArr);
        } else {
            NodeState parentState = null;
            Path parentPath = targetPath;
            while (parentState == null) {
                parentPath = parentPath.getAncestor(1);
                if (itemManager.nodeExists(parentPath)) {
                    parentState = getHierarchyManager().getNodeState(parentPath);
View Full Code Here

            String msg = "Unable to resolve merge conflict. Specified version is not in jcr:mergeFailed property: " + safeGetJCRPath();
            log.error(msg);
            throw new VersionException(msg);
        }

        NodeState versionState = session.getVersionState(version);
        session.getVersionStateManager().resolveMergeConflict(getNodeState(), versionState, done);
    }
View Full Code Here

            }
            targetNode.checkIsLocked();
            // NOTE: check for nodetype constraint violation is left to the 'server'
        }

        NodeState versionState = session.getVersionState(version);
        session.getVersionStateManager().restore(targetNode.getNodeState(), relQPath, versionState, removeExisting);
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.state.NodeState

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.