Package javax.jcr

Examples of javax.jcr.Workspace.copy()


            // success
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to copy.
        modifyPrivileges(parentPath, PrivilegeRegistry.REP_WRITE, true);
        wsp.copy(srcPath, destPath);
    }

    public void testWorkspaceMove() throws RepositoryException, NotExecutableException {
        Workspace wsp = getTestSession().getWorkspace();
        String parentPath = childNode.getParent().getPath();
View Full Code Here


                Workspace ws = sInfo.getSession().getWorkspace();
                String destPath = getDestinationPath(destParentNodeId, destName, sInfo);
                if (ws.getName().equals(srcWorkspaceName)) {
                    // inner-workspace copy
                    String srcPath = pathForId(srcNodeId, sInfo);
                    ws.copy(srcPath, destPath);
                } else {
                    SessionInfoImpl srcInfo = getSessionInfoImpl(obtain(sInfo, srcWorkspaceName));
                    try {
                        String srcPath = pathForId(srcNodeId, srcInfo);
                        ws.copy(srcWorkspaceName, srcPath, destPath);
View Full Code Here

                    ws.copy(srcPath, destPath);
                } else {
                    SessionInfoImpl srcInfo = getSessionInfoImpl(obtain(sInfo, srcWorkspaceName));
                    try {
                        String srcPath = pathForId(srcNodeId, srcInfo);
                        ws.copy(srcWorkspaceName, srcPath, destPath);
                    } finally {
                        dispose(srcInfo);
                    }
                }
                return null;
View Full Code Here

        Workspace workspace = b1.getSession().getWorkspace();
        workspace.clone(workspace.getName(), b1.getPath(),
                a2.getPath() + "/b2", false);

        // copy source tree to destination
        workspace.copy(s.getPath(), testRootNode.getPath() + "/d");

        // verify source contains shared set with 2 entries
        Node[] shared1 = getSharedSet(b1);
        assertEquals(2, shared1.length);
View Full Code Here

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

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

        }

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

            // success
        }

        // adding jcr:nodeTypeManagement privilege will grant permission to copy.
        modifyPrivileges(parentPath, PrivilegeRegistry.REP_WRITE, true);
        wsp.copy(srcPath, destPath);
    }

    public void testWorkspaceMove() throws RepositoryException, NotExecutableException {
        Workspace wsp = getTestSession().getWorkspace();
        String parentPath = childNode.getParent().getPath();
View Full Code Here

                Workspace ws = sInfo.getSession().getWorkspace();
                String destPath = getDestinationPath(destParentNodeId, destName, sInfo);
                if (ws.getName().equals(srcWorkspaceName)) {
                    // inner-workspace copy
                    String srcPath = pathForId(srcNodeId, sInfo);
                    ws.copy(srcPath, destPath);
                } else {
                    SessionInfoImpl srcInfo = getSessionInfoImpl(obtain(sInfo, srcWorkspaceName));
                    try {
                        String srcPath = pathForId(srcNodeId, srcInfo);
                        ws.copy(srcWorkspaceName, srcPath, destPath);
View Full Code Here

                    ws.copy(srcPath, destPath);
                } else {
                    SessionInfoImpl srcInfo = getSessionInfoImpl(obtain(sInfo, srcWorkspaceName));
                    try {
                        String srcPath = pathForId(srcNodeId, srcInfo);
                        ws.copy(srcWorkspaceName, srcPath, destPath);
                    } finally {
                        dispose(srcInfo);
                    }
                }
                return null;
View Full Code Here

        Workspace workspace = b1.getSession().getWorkspace();
        workspace.clone(workspace.getName(), b1.getPath(),
                a2.getPath() + "/b2", false);

        // copy source tree to destination
        workspace.copy(s.getPath(), testRootNode.getPath() + "/d");

        // verify source contains shared set with 2 entries
        Node[] shared1 = getSharedSet(b1);
        assertEquals(2, shared1.length);
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.