Package org.apache.jackrabbit.core.version

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


        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersion v;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_BASEVERSION).getString());
            v = session.getVersionManager().getVersion(id);
        } else {
            // note, that the method currently only works for linear version
            // graphs (i.e. simple versioning)
            v = session.getVersionManager().getHeadVersionOfNode(((NodeId) id));
        }

        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here


            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

                // add all versions to map of versions to restore
                Map<NodeId, InternalVersion> toRestore =
                    new HashMap<NodeId, InternalVersion>();
                for (Version version : versions) {
                    InternalVersion v =
                        vMgr.getVersion(((VersionImpl) version).getNodeId());
                    // check for collision
                    NodeId historyId = v.getVersionHistory().getId();
                    if (toRestore.containsKey(historyId)) {
                        throw new VersionException(
                                "Unable to restore. Two or more versions have same version history.");
                    }
                    toRestore.put(historyId, v);
View Full Code Here

                            parent,
                            CHECK_PENDING_CHANGES | ItemValidator.CHECK_LOCK | CHECK_HOLD,
                            Permission.NONE);

                    // check if given version is a baseline
                    InternalVersion v = getVersion(version);
                    if (v instanceof InternalBaseline) {
                        restore(state, name, (InternalBaseline) v);
                    } else {
                        restore(state, name, v, removeExisting);
                    }
View Full Code Here

            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

                    seenRoot |= JCR_ROOTVERSION.equals(versionName);

                    log.debug("Checking version history of node {}, version {}", nid, versionName);

                    message = intro + " (getting version " + versionName + "  failed)";
                    InternalVersion v = vh.getVersion(versionName);

                    message = intro + "(frozen node of root version " + v.getId() + " missing)";
                    if (null == v.getFrozenNode()) {
                        throw new InconsistentVersioningState(message);
                    }
                }

                if (!seenRoot) {
View Full Code Here

        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersion v;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_BASEVERSION).getString());
            v = session.getVersionManager().getVersion(id);
        } else {
            // note, that the method currently only works for linear version
            // graphs (i.e. simple versioning)
            v = session.getVersionManager().getHeadVersionOfNode(((NodeId) id));
        }

        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here

        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersion v;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_BASEVERSION).getString());
            v = session.getVersionManager().getVersion(id);
        } else {
            // note, that the method currently only works for linear version
            // graphs (i.e. simple versioning)
            v = session.getVersionManager().getHeadVersionOfNode(((NodeId) id));
        }

        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here

        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersion v;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_BASEVERSION).getString());
            v = session.getVersionManager().getVersion(id);
        } else {
            // note, that the method currently only works for linear version
            // graphs (i.e. simple versioning)
            v = session.getVersionManager().getHeadVersionOfNode(((NodeId) id));
        }

        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here

        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersion v;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_BASEVERSION).getString());
            v = session.getVersionManager().getVersion(id);
        } else {
            // note, that the method currently only works for linear version
            // graphs (i.e. simple versioning)
            v = session.getVersionManager().getHeadVersionOfNode(((NodeId) id));
        }

        return (Version) session.getNodeById(v.getId());
    }
View Full Code Here

TOP

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

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.