Package javax.jcr

Examples of javax.jcr.Workspace.move()


        // 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


      }
      Node calendarNode2cut = calendarTaxonomy.getNode("calendarTest");
      assertNotNull(calendarNode2cut);
      String cutPath = calendarNode2cut.getPath();
      String pastedPath = sportsTaxonomy.getPath() + cutPath.substring(cutPath.lastIndexOf("/"));
      workspace.move(cutPath, pastedPath);
      // use other admin session to check
      Session otherAdminSession =
         repository.login(new SimpleCredentials("admin", "admin".toCharArray()), workspaceName);
      assertNotSame(adminSession_, otherAdminSession);
      try
View Full Code Here

      String destPath2Paste = sportsTaxonomy.getPath() + 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("/"));

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

      catch (Exception e)
      {
         e.printStackTrace();
      }

      workspace.move(cutNode.getPath(), ecmNode.getPath() + "/" + copyNode.getName());
      try
      {
         Node node = (Node)session.getItem("/jcr:system/cms/cutNode");
         fail("Node is not cut on source node");
      }
View Full Code Here

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

        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.
        modify(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.
        modify(parentPath, REP_WRITE, true);
        wsp.move(srcPath, destPath);
    }

    @Test
    public void testSessionMove() throws Exception {
        String parentPath = childNode.getParent().getPath();
View Full Code Here

      try
      {
         String srcAbsPath = ctx.getParameter(0);
         String destAbsPath = ctx.getParameter(1);
         Workspace workspace = ctx.getSession().getWorkspace();
         workspace.move(srcAbsPath, destAbsPath);
         output = "Node [" + srcAbsPath + "] has been moved to [" + destAbsPath + "] successfully \n";
      }
      catch (ParameterNotFoundException e)
      {
         output = "Can't execute command - " + e.getMessage() + "\n";
View Full Code Here

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

        try {
            wsp.move(srcPath, destPath);
            fail("Missing write privilege.");
        } 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.