Package org.jahia.services.content.decorator

Examples of org.jahia.services.content.decorator.JCRVersion


        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;
        while (baseSourceVersion == null) {
            JCRVersion[] successors = sourceVersion.getSuccessors();
            for (JCRVersion successor : successors) {
                if (targetHistoryList.contains(successor.getName())) {
                    baseSourceVersion = sourceVersion;
                    baseTargetVersion = successor;
                    break;
                }
            }
            try {
                sourceVersion = sourceVersion.getLinearPredecessor();
            } catch (NullPointerException e) {
                sourceVersion = null;
            }               
        }
        logger.debug("compare "+sourceNode.getPath()+" version : "+baseSourceVersion.getName()+" with (source) "+sourceNode.getBaseVersion().getName());
        List<Diff> sourceDiff = compare(baseSourceVersion.getFrozenNode(), sourceNode, "");
        logger.debug("compare "+targetNode.getPath()+" version : "+baseTargetVersion.getName()+" with (target) "+targetNode.getBaseVersion().getName());
        List<Diff> targetDiff = compare(baseTargetVersion.getFrozenNode(), targetNode, "");

        sourceDiff.removeAll(targetDiff);

        // Check for conflicts in changed properties
        Map<String, PropertyChangedDiff> changedProperties = new HashMap<String, PropertyChangedDiff>();
View Full Code Here


            logger.debug("Checkin "+absPath  +" in "+getName()+", was "+getBaseVersion(absPath).getName());
            return JCRObservationManager.doWorkspaceWriteCall(getSession(), JCRObservationManager.NODE_CHECKIN, new JCRCallback<JCRVersion>() {
                public JCRVersion doInJCR(JCRSessionWrapper session) throws RepositoryException {
                    try {
                        JCRNodeWrapper node = session.getNode(absPath);
                        JCRVersion result = (JCRVersion) node.getProvider().getNodeWrapper(versionManager.checkin(node.getRealNode().getPath()), session);

                        if (session.getLocale() != null) {
                            try {
                                versionManager.checkin(node.getI18N(session.getLocale()).getPath());
                            } catch (ItemNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.jahia.services.content.decorator.JCRVersion

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.