Package javax.jcr.version

Examples of javax.jcr.version.VersionManager.checkout()


    protected void setUp() throws Exception {
        super.setUp();

        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        versionManager.checkout(path);
    }

    /**
     * @throws RepositoryException
     */
 
View Full Code Here


                    jcrNodeWrapper.setProperty("j:published", Boolean.TRUE);
                    try {
                        JCRNodeWrapper destNode = destinationSession
                                .getNode(jcrNodeWrapper.getCorrespondingNodePath(destinationWorkspace));
                        if (!destinationVersionManager.isCheckedOut(destNode.getPath())) {
                            destinationVersionManager.checkout(destNode.getPath());
                        }
                        destNode.setProperty("j:published", Boolean.TRUE);
                    } catch (ItemNotFoundException e) {
                    }
                }
View Full Code Here

                    logger.debug("Setting last published for {}", node.getPath());
                }
//            if (!sourceSession.getWorkspace().getName().equals(LIVE_WORKSPACE)) {
                VersionManager versionManager = node.getSession().getWorkspace().getVersionManager();
                if (!versionManager.isCheckedOut(node.getPath())) {
                    versionManager.checkout(node.getPath());
                }
                node.setProperty("j:lastPublished", calendar);

                String userID = destinationSession.getUserID();
                if ((userID != null) && (userID.startsWith(JahiaLoginModule.SYSTEM))) {
View Full Code Here

                }
            }
            JahiaAccessManager.setDeniedPaths(denied);

            if (!destinationVersionManager.isCheckedOut(destinationParentPath)) {
                destinationVersionManager.checkout(destinationParentPath);
            }
            String destinationPath;
            if (destinationParentPath.equals("/")) {
                destinationPath = "/" + sourceNode.getName();
            } else {
View Full Code Here

                        try {
                            JCRNodeWrapper node = destinationSession.getNode(oldPath);
                            recurseCheckout(node, null, destinationVersionManager);
                            JCRNodeWrapper oldParent = node.getParent();
                            if (!destinationVersionManager.isCheckedOut(oldParent.getPath())) {
                                destinationVersionManager.checkout(oldParent.getPath());
                            }
                            node.remove();
                            node.getSession().save();
                        } catch (RepositoryException e) {
                            e.printStackTrace();
View Full Code Here

                            e.printStackTrace();
                        }
                    }
                } else {
                    // Non shareable node has been moved
                    destinationVersionManager
                            .checkout(StringUtils.substringBeforeLast(correspondingNodePath, "/")); // previous parent
                    destinationVersionManager.checkout(destinationParentPath); // new parent
                    recurseCheckout(destinationSession.getNode(correspondingNodePath), null,
                            destinationVersionManager); // node and sub nodes
View Full Code Here

                    }
                } else {
                    // Non shareable node has been moved
                    destinationVersionManager
                            .checkout(StringUtils.substringBeforeLast(correspondingNodePath, "/")); // previous parent
                    destinationVersionManager.checkout(destinationParentPath); // new parent
                    recurseCheckout(destinationSession.getNode(correspondingNodePath), null,
                            destinationVersionManager); // node and sub nodes

                    destinationSession.move(correspondingNodePath, destinationPath);
                    destinationSession.save();
View Full Code Here

                for (String uuid : uuids) {
                    try {
                        JCRNodeWrapper node = sourceSession.getNodeByIdentifier(uuid);
                        VersionManager vm = sourceSession.getWorkspace().getVersionManager();
                        if (!vm.isCheckedOut(node.getPath())) {
                            vm.checkout(node.getPath());
                        }
                        if (first && !node.isNodeType("jmix:publication")) {
                            node.addMixin("jmix:publication");
                            first = false;
                        }
View Full Code Here

                    // First version ever apart root version
                    versionManager.checkpoint(node.getPath());
                    String label = "uploaded_at_"+ new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss").format(node.getProperty("jcr:created").getDate().getTime());
                    versionService.addVersionLabel(node,label);
                }
                versionManager.checkout(node.getPath());
                GWTFileManagerUploadServlet.Item item = GWTFileManagerUploadServlet.getItem(tmpName);
                InputStream is = null;
                try {
                    is = item.getStream();
                    node.getFileContent().uploadFile(is, item.getContentType());
View Full Code Here

                                    public Object doInJCR(final JCRSessionWrapper frozensession) throws RepositoryException {
                                        JCRNodeWrapper destinationNode = session.getNodeByUUID(node.getIdentifier());
                                        VersionManager versionManager = session.getWorkspace().getVersionManager();
                                        String path = destinationNode.getPath();
                                        if (!versionManager.isCheckedOut(path)) {
                                            versionManager.checkout(path);
                                        }

                                        // Todo: first get frozen node for this label
                                        frozensession.setVersionLabel(label);
                                        frozensession.setVersionDate(versionDate);
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.