Package org.apache.jackrabbit.core.version

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


     * {@inheritDoc}
     */
    public VersionHistory getVersionHistory(String absPath)
            throws RepositoryException {
        NodeStateEx state = getNodeState(absPath);
        InternalVersionHistory vh = getVersionHistory(state);
        return (VersionHistory) session.getNodeById(vh.getId());
    }
View Full Code Here


                vhid = vhi.getVersionHistoryId();
            }

            message = intro + " (getting the InternalVersionHistory)";

            InternalVersionHistory vh = null;

            try {
                vh = versionManager.getVersionHistoryOfNode(nid);
            }
            catch (ItemNotFoundException ex) {
                // it's ok if we get here if the node didn't claim to be versioned
                if (isVersioned) {
                    throw ex;
                }
            }

            if (vh == null) {
                if (isVersioned) {
                    message = intro + "getVersionHistoryOfNode returned null";
                    throw new InconsistentVersioningState(message);   
                }
            } else {
                vhid = vh.getId();

                // additional checks, see JCR-3101

                message = intro + " (getting the version names failed)";
                Name[] versionNames = vh.getVersionNames();
                boolean seenRoot = false;

                for (Name versionName : versionNames) {
                    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);
                    }
View Full Code Here

            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

                vhid = vhi.getVersionHistoryId();
            }

            message = intro + " (getting the InternalVersionHistory)";

            InternalVersionHistory vh = null;
           
            try {
                vh = versionManager.getVersionHistoryOfNode(nid);
            }
            catch (ItemNotFoundException ex) {
                // it's ok if we get here if the node didn't claim to be versioned
                if (isVersioned) {
                    throw ex;
                }
            }

            if (vh == null) {
                if (isVersioned) {
                    message = intro + "getVersionHistoryOfNode returned null";
                    throw new InconsistentVersioningState(message);   
                }
            } else {
                vhid = vh.getId();
               
                // additional checks, see JCR-3101

                message = intro + " (getting the version names failed)";
                Name[] versionNames = vh.getVersionNames();
                boolean seenRoot = false;

                for (Name versionName : versionNames) {
                    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);
                    }
View Full Code Here

            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

     */
    protected AbstractVersionHistory createVersionHistoryInstance(
            NodeId id, NodeState state, NodeDefinition def,
            ItemLifeCycleListener[] listeners) throws RepositoryException {

        InternalVersionHistory history =
                session.getVersionManager().getVersionHistory(id);
        return new VersionHistoryImpl(this, session, id, state, def, listeners, history);
    }
View Full Code Here

     */
    protected AbstractVersionHistory createVersionHistoryInstance(
            NodeId id, NodeState state, NodeDefinition def,
            ItemLifeCycleListener[] listeners) throws RepositoryException {

        InternalVersionHistory history =
                session.getVersionManager().getVersionHistory(id);
        return new XAVersionHistory(this, session, id, state, def, listeners, history);
    }
View Full Code Here

        // check state of this instance
        sanityCheck();

        boolean isFull = checkVersionable();

        InternalVersionHistory vh;
        if (isFull) {
            NodeId id = NodeId.valueOf(getProperty(NameConstants.JCR_VERSIONHISTORY).getString());
            vh = session.getVersionManager().getVersionHistory(id);
        } else {
            vh = session.getVersionManager().getVersionHistoryOfNode((NodeId) id);
        }
        return (VersionHistory) session.getNodeById(vh.getId());
    }
View Full Code Here

TOP

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

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.