Package javax.jcr

Examples of javax.jcr.Workspace.move()


         + newsSrcPath.substring(newsSrcPath.lastIndexOf("/")));
      // otherAdminSession.getItem(destPath2Paste) ;

      otherAdminSession.refresh(false);

      workspace.move(newsSrcPath, destPath2Paste);
      try
      {
         otherAdminSession.getItem(newsSrcPath);
         fail(newsSrcPath + " don't be cut");
      }
View Full Code Here


      String srcPath = testTaxonomy.getPath();
      String destPath = sportsTaxonomy.getPath() + srcPath.substring(srcPath.lastIndexOf("/"));
      System.out.println("Move from " + srcPath + " to " + destPath);

      workspace.move(srcPath, destPath);
      try
      {
         adminSession_.getItem(destPath);
      }
      catch (Exception e)
View Full Code Here

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

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

        // move
        Workspace workspace = b.getSession().getWorkspace();

        // move shareable node
        String newPath = a2.getPath() + "/b";
        workspace.move(b.getPath(), newPath);
        // move was performed using the workspace, so refresh the session
        b.getSession().refresh(false);
        assertEquals(newPath, b.getPath());
    }
View Full Code Here

        String srcPath = childNode.getPath();
        String destPath = parentPath + "/"+ nodeName3;

        checkReadOnly(parentPath);
        try {
            wsp.move(srcPath, destPath);
            fail("Missing write privilege.");
        } catch (AccessDeniedException e) {
            // success
        }
View Full Code Here

        }

        // with simple write privilege moving a node is not allowed.
        modifyPrivileges(parentPath, Privilege.JCR_WRITE, true);
        try {
            wsp.move(srcPath, destPath);
            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);
        wsp.move(srcPath, destPath);
    }

    public void testSessionMove() throws RepositoryException, NotExecutableException {
        Session s = getTestSession();
        String parentPath = childNode.getParent().getPath();
View Full Code Here

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

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

        // move
        Workspace workspace = b.getSession().getWorkspace();

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

     */
    public void move(String srcPath, String destPath) {
        Workspace workspace = session.getWorkspace();
        try {

            workspace.move(srcPath, destPath);

        } catch (javax.jcr.nodetype.ConstraintViolationException cve) {
            throw new ObjectContentManagerException("Cannot move the object from " + srcPath + " to " + destPath + "."
                    + " Violation of a nodetype or attempt to move under a property detected", cve);

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.