Package org.apache.jackrabbit.core.version

Examples of org.apache.jackrabbit.core.version.NodeStateEx


    /**
     * {@inheritDoc}
     */
    public Node createConfiguration(String absPath) throws RepositoryException {
        if (session.nodeExists(absPath)) {
            NodeStateEx state = getNodeState(absPath,
                    ItemValidator.CHECK_LOCK | ItemValidator.CHECK_PENDING_CHANGES_ON_NODE | ItemValidator.CHECK_HOLD,
                    Permission.VERSION_MNGMT);
            // check versionable
            if (!checkVersionable(state)) {
                throw new UnsupportedRepositoryOperationException("Node not full versionable: " + absPath);
            }
            if (state.getPropertyValue(NameConstants.JCR_CONFIGURATION) != null) {
                String msg = "Node is already a configuration root: " + absPath;
                log.error(msg);
                throw new UnsupportedRepositoryOperationException(msg);
            }

View Full Code Here


            throws RepositoryException {
        try {
            if (options > 0 || permissions > 0) {
                session.getValidator().checkModify(node, options, permissions);
            }
            return new NodeStateEx(
                    stateMgr,
                    ntReg,
                    (NodeState) stateMgr.getItemState(node.getNodeId()),
                    node.getQName());
        } catch (ItemStateException e) {
View Full Code Here

    public Version checkin(final String absPath, final Calendar created)
            throws RepositoryException {
        return perform(new SessionWriteOperation<Version> () {
            public Version perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(
                        absPath,
                        CHECK_LOCK | CHECK_HOLD | CHECK_PENDING_CHANGES_ON_NODE,
                        Permission.VERSION_MNGMT);
                NodeId baseId = checkoutCheckin(state, true, false, created);
                return (Version) session.getNodeById(baseId);
View Full Code Here

     */
    public void checkout(final String absPath) throws RepositoryException {
        perform(new SessionWriteOperation<NodeId> () {
            public NodeId perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(
                        absPath,
                        CHECK_LOCK | CHECK_HOLD,
                        Permission.VERSION_MNGMT);
                return checkoutCheckin(state, false, true, null);
            }
View Full Code Here

     */
    public Version checkpoint(final String absPath) throws RepositoryException {
        return perform(new SessionWriteOperation<Version> () {
            public Version perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(
                        absPath,
                        CHECK_LOCK | CHECK_HOLD | CHECK_PENDING_CHANGES_ON_NODE,
                        Permission.VERSION_MNGMT);
                NodeId baseId = checkoutCheckin(state, true, true, null);
                return (Version) session.getNodeById(baseId);
View Full Code Here

    public VersionHistory getVersionHistory(final String absPath)
            throws RepositoryException {
        return perform(new SessionOperation<VersionHistory> () {
            public VersionHistory perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(absPath);
                InternalVersionHistory vh = getVersionHistory(state);
                if (vh == null) {
                    throw new InconsistentVersioningState("Couldn't get version history for node " + state.getNodeId());
                }
                return (VersionHistory) session.getNodeById(vh.getId());
            }
            public String toString() {
                return "versionManager.getVersionHistory(" + absPath + ")";
View Full Code Here

    public Version getBaseVersion(final String absPath)
            throws RepositoryException {
        return perform(new SessionOperation<Version> () {
            public Version perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(absPath);
                InternalVersion v = getBaseVersion(state);
                return (Version) session.getNodeById(v.getId());
            }
            public String toString() {
                return "versionManager.getBaseVersion(" + absPath + ")";
View Full Code Here

            final String absPath, final String versionName,
            final boolean removeExisting) throws RepositoryException {
        perform(new SessionWriteOperation<Object> () {
            public Object perform(SessionContext context)
                    throws RepositoryException {
                NodeStateEx state = getNodeState(
                        absPath,
                        CHECK_PENDING_CHANGES | CHECK_LOCK | CHECK_HOLD,
                        Permission.NONE);
                restore(state, context.getQName(versionName), removeExisting);
                return this;
View Full Code Here

                    Path path = context.getQPath(absPath);
                    Path parentPath = path.getAncestor(1);
                    Name name = path.getName();
                    NodeImpl parent = context.getItemManager().getNode(parentPath);

                    NodeStateEx state = getNodeState(
                            parent,
                            CHECK_PENDING_CHANGES | ItemValidator.CHECK_LOCK | CHECK_HOLD,
                            Permission.NONE);

                    // check if given version is a baseline
View Full Code Here

     * @param removeExisting the remove existing flag
     * @throws RepositoryException if an error occurs
     */
    protected void restore(NodeImpl node, Version version, boolean removeExisting)
            throws RepositoryException {
        NodeStateEx state = getNodeState(
                node.getPath(),
                CHECK_PENDING_CHANGES | CHECK_LOCK | CHECK_HOLD,
                Permission.NONE);
        InternalVersion v = getVersion(version);
        restore(state, v, removeExisting);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.version.NodeStateEx

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.