Examples of nextVersion()


Examples of javax.jcr.version.VersionIterator.nextVersion()

        JCRVersionHistory vh = (JCRVersionHistory) sourceNode.getVersionHistory();

        VersionIterator targetHistory = targetNode.getVersionHistory().getAllLinearVersions();
        List<String> targetHistoryList = new ArrayList<String>();
        while (targetHistory.hasNext()) {
            targetHistoryList.add(targetHistory.nextVersion().getName());
        }

        JCRVersion sourceVersion = vh.getVersion(sourceNode.getBaseVersion().getName());
        JCRVersion baseSourceVersion = null;
        JCRVersion baseTargetVersion = null;
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public VersionIterator getAllVersions() throws RepositoryException {
        VersionIterator all = getRealNode().getAllVersions();
        List l = new ArrayList();
        while (all.hasNext()) {
            Version v = all.nextVersion();
            l.add(getProvider().getNodeWrapper(v, (JCRSessionWrapper) getSession()));
        }
        return new VersionIteratorImpl(l.iterator(), l.size());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public VersionIterator getAllLinearVersions() throws RepositoryException {
        VersionIterator vi = getRealNode().getAllLinearVersions();
        List l = new ArrayList();
        while (vi.hasNext()) {
            l.add((Version) getProvider().getNodeWrapper((Node) vi.nextVersion(), (JCRSessionWrapper) getSession()));
        }
        return new VersionIteratorImpl(l.iterator(), l.size());
    }

    public NodeIterator getAllLinearFrozenNodes() throws RepositoryException {
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public List<VersionInfo> getVersionInfos(Session session, JCRNodeWrapper node) throws RepositoryException {
        VersionHistory versionHistory = session.getWorkspace().getVersionManager().getVersionHistory(node.getPath());

        VersionIterator versions = versionHistory.getAllVersions();
        if (versions.hasNext()) {
            versions.nextVersion();
            // the first is the root version, which has no properties, so we will ignore it.
        }
        Set<VersionInfo> versionList = new TreeSet<VersionInfo>();
        while (versions.hasNext()) {
            Version v = versions.nextVersion();
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

            versions.nextVersion();
            // the first is the root version, which has no properties, so we will ignore it.
        }
        Set<VersionInfo> versionList = new TreeSet<VersionInfo>();
        while (versions.hasNext()) {
            Version v = versions.nextVersion();
            String[] versionLabels = versionHistory.getVersionLabels(v);
            if (versionLabels != null && versionLabels.length > 0) {
                for (String string : versionLabels) {
                    VersionInfo versionInfo = new VersionInfo(v, string, 0);
                    versionList.add(versionInfo);
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()


        Version lastVersion = null;
        Version closestVersion = null;
        if (vi.hasNext()) {
            vi.nextVersion();
            // the first is the root version, which has no properties, so we will ignore it.
        }
        String nodeTitle = null;
        StringBuffer propertyString = null;
        while (vi.hasNext()) {
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

            // the first is the root version, which has no properties, so we will ignore it.
        }
        String nodeTitle = null;
        StringBuffer propertyString = null;
        while (vi.hasNext()) {
            Version v = vi.nextVersion();
            if (logger.isDebugEnabled()) {
                try {
                    Node frozenNode = v.getFrozenNode();
                    propertyString = new StringBuffer();
                    PropertyIterator propertyIterator = frozenNode.getProperties();
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public static Version findVersionByLabel(VersionHistory vh, String label) throws RepositoryException {
        if (label != null && !"".equals(label.trim())) {
            if (vh.hasVersionLabel(label.trim())) {
                VersionIterator allVersions = vh.getAllVersions();
                while (allVersions.hasNext()) {
                    Version version = allVersions.nextVersion();
                    if (Arrays.asList(vh.getVersionLabels(version)).contains(label.trim())) {
                        return version;
                    }
                }
            }
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

        }
        try {
            versionHistory = versionManager.getVersionHistory(subPageEditNode.getPath());
            VersionIterator allVersions = versionHistory.getAllVersions();
            while (allVersions.hasNext()) {
                Version version = allVersions.nextVersion();
                StringBuilder builder = new StringBuilder();

                builder.append(version.getName());
                String[] strings = versionHistory.getVersionLabels(version);
                if (strings != null && strings.length > 0) {
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public void testLinearVersions() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionableNode.getVersionHistory().getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionableNode.restore(version, true);
        // append new base version
        expected.append(versionableNode.getBaseVersion().getName()).append(",");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.