Package javax.jcr

Examples of javax.jcr.Session.move()


        }

        // with simple write privilege moving a node is not allowed.
        modifyPrivileges(parentPath, Privilege.JCR_WRITE, true);
        try {
            s.move(srcPath, destPath);
            s.save();
            fail("Missing privilege jcr:nodeTypeManagement.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here


            // success
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to move.
        modifyPrivileges(parentPath, PrivilegeRegistry.REP_WRITE, true);
        s.move(srcPath, destPath);
        s.save();
    }
      
    public void testSessionImportXML() throws RepositoryException, NotExecutableException, IOException {
        Session s = getTestSession();
View Full Code Here

        // move
        Session session = superuser;

        try {
            // move shareable node
            session.move(b.getPath(), a2.getPath() + "/b");
            session.save();
            fail("Moving a mix:shareable should fail.");
        } catch (UnsupportedRepositoryOperationException e) {
            // expected
        }
View Full Code Here

        Node[] shared = getSharedSet(b1);
        assertEquals(2, shared.length);

        // move node
        try {
            session.move(testRootNode.getPath() + "/a2", c.getPath());
            fail("Share cycle not detected on transient move.");
        } catch (RepositoryException e) {
            // expected
        }
    }
View Full Code Here

                String path = collectionNode.getPath();
                int index = path.lastIndexOf("/");
                String newPathName = path.substring(0, index);
                newPathName = newPathName + "/" + ISO9075.encode(collection.getName());
               
                session.move(collectionNode.getPath(), newPathName);
            }
           

            session.save();
        } catch (PathNotFoundException e) {
View Full Code Here

           
            //FIXME On pourrait empêcher le cut dans ce cas...
            String correctedDestinationCollectionName = NodeUtil.getCopyName(destinationCollectionName, destinationCollectionNode)
            destinationCollectionPath = destinationCollectionNode.getPath() + "/" + correctedDestinationCollectionName;
           
            session.move(cutCollectionPath, destinationCollectionPath);
            session.save();
        } catch (ItemExistsException e) {
            throw new RuntimeException(e);
        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
View Full Code Here

                String folderNodePath = folderNode.getPath();
                int index = folderNodePath.lastIndexOf("/");
                String newPathName = folderNodePath.substring(0, index);
                newPathName = newPathName + "/" + ISO9075.encode(folder.getName());
               
                session.move(folderNode.getPath(), newPathName);
            }

            session.save();
        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
View Full Code Here

           
            //FIXME On pourrait empêcher le cut dans ce cas...
            String correctedDestinationFolderName = NodeUtil.getCopyName(destinationFolderName, destinationCollectionFoldersNode)
            destinationFolderPath = destinationCollectionFoldersPath + "/" + correctedDestinationFolderName;
           
            session.move(cutFolderPath, destinationFolderPath);
            session.save();
        } catch (ItemExistsException e) {
            throw new RuntimeException(e);
        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
View Full Code Here

           
            //FIXME On pourrait empêcher le cut dans ce cas...
            String correctedDestinationStoredFileName = NodeUtil.getCopyName(destinationStoredFileName, destinationFolderNode)
            destinationStoredFilePath = destinationFolderPath + "/" + correctedDestinationStoredFileName;
           
            session.move(cutStoredFilePath, destinationStoredFilePath);
            session.save();
        } catch (ItemExistsException e) {
            throw new RuntimeException(e);
        } catch (PathNotFoundException e) {
            throw new RuntimeException(e);
View Full Code Here

        // give 'add_child_nodes' and 'nt-management' privilege
        // -> not sufficient privileges for a move
        givePrivileges(path, privilegesFromNames(new String[] {Privilege.JCR_ADD_CHILD_NODES, Privilege.JCR_NODE_TYPE_MANAGEMENT}), getRestrictions(superuser, path));
        try {
            testSession.move(childNPath, destPath);
            testSession.save();
            fail("Move requires add and remove permission.");
        } catch (AccessDeniedException e) {
            // success.
        }
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.