Package javax.jcr

Examples of javax.jcr.Workspace.clone()


                try {
                String srcPath = pathForId(srcNodeId, srcInfo);
                String destPath = getDestinationPath(destParentNodeId, destName, sInfo);

                Workspace wsp = sInfo.getSession().getWorkspace();
                wsp.clone(srcWorkspaceName, srcPath, destPath, removeExisting);
                } finally {
                    dispose(srcInfo);
                }
                return null;
            }
View Full Code Here


        globalAssetItem.getNode().addMixin("mix:shareable");
        globalAssetItem.checkin("add mix:shareable");
      }
       
           String path = rulesFolder.getPath() + "/" + globalAssetItem.getName();
            workspace.clone(workspace.getName(), globalAssetItem.getNode().getPath(), path, false)
       
             Node ruleNode = rulesFolder.getNode(globalAssetItem.getName());
            AssetItem rule = new AssetItem( this.rulesRepository, ruleNode );        

            return rule;
View Full Code Here

                }
                node.addMixin(MIX_SHAREABLE);
                node.save();
            }
            Workspace workspace = session.getRepositorySession().getWorkspace();
            workspace.clone(workspace.getName(), node.getPath(), newBinding.getLocator().getRepositoryPath(), false);

        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
View Full Code Here

                try {
                String srcPath = pathForId(srcNodeId, srcInfo);
                String destPath = getDestinationPath(destParentNodeId, destName, sInfo);

                Workspace wsp = sInfo.getSession().getWorkspace();
                wsp.clone(srcWorkspaceName, srcPath, destPath, removeExisting);
                } finally {
                    dispose(srcInfo);
                }
                return null;
            }
View Full Code Here

                }
                node.addMixin(MIX_SHAREABLE);
                node.save();
            }
            Workspace workspace = session.getRepositorySession().getWorkspace();
            workspace.clone(workspace.getName(), node.getPath(), newBinding.getLocator().getRepositoryPath(), false);

        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
View Full Code Here

        Node c = b1.addNode("c");
        b1.save();

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

        Node[] shared = getSharedSet(b1);
        assertEquals(2, shared.length);
        b1 = shared[0];
View Full Code Here

        ensureMixinType(b1, mixShareable);
        b1.save();

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

        // add child c
        b1.addNode("c");
        b1.save();
View Full Code Here

        Workspace workspace = b1.getSession().getWorkspace();

        try {
            // clone (1st attempt, without mix:shareable, should fail)
            workspace.clone(workspace.getName(), b1.getPath(),
                    a2.getPath() + "/b2", false);
            fail("Cloning a node into the same workspace should fail.");
        } catch (RepositoryException e) {
            // expected
        }
View Full Code Here

        // add mixin
        ensureMixinType(b1, mixShareable);
        b1.save();

        // clone (2nd attempt, with mix:shareable)
        workspace.clone(workspace.getName(), b1.getPath(),
                a2.getPath() + "/b2", false);
    }

    /**
     * Verify that Node.isSame returns <code>true</code> for shareable nodes
View Full Code Here

        ensureMixinType(b1, mixShareable);
        b1.save();

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

        Node[] shared = getSharedSet(b1);
        assertEquals(2, shared.length);
        b1 = shared[0];
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.