Package org.exist.xmldb

Examples of org.exist.xmldb.CollectionManagementServiceImpl.copy()


        source.storeResource(resSource);

        //as the 'test3' user copy the collection
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test3", "test3");
        cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");
        cms.copy("/db/securityTest3/source", "/db/securityTest3", "copy-of-source");


        UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
        final Collection copyOfSource = test.getChildCollection("copy-of-source");
        Permission permissions = ums.getPermissions(copyOfSource);
View Full Code Here


        sub.storeResource(resSub);

        //as the 'test3' user copy the collection
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test3", "test3");
        cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");
        cms.copy("/db/securityTest3/source", "/db/securityTest3", "copy-of-source");

        final Collection copyOfSource = test.getChildCollection("copy-of-source");
        assertNotNull(copyOfSource);
        assertEquals(2, copyOfSource.listResources().length);
       
View Full Code Here

        ums.chmod(resDestSource1, 0777);
       
        //as the 'test3' user copy the collection
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test3", "test3");
        cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");
        cms.copy("/db/securityTest3/source", "/db/securityTest3", "copy-of-source");
       
        final Collection copyOfSource = test.getChildCollection("copy-of-source");
        assertNotNull(copyOfSource);
        assertEquals(2, copyOfSource.listResources().length);
        ums = (UserManagementService) copyOfSource.getService("UserManagementService", "1.0");
View Full Code Here

        //now copy /db/securityTest2/src to /db/securityTest2/parentCollection/src
        //as "user3:guest", it should have it's group set to the primary group of "user3" i.e. 'guest'
        //as the collection is NOT setGid and it should NOT have it's setGid bit set
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test3", "test3");
        cms = (CollectionManagementServiceImpl)test.getService("CollectionManagementService", "1.0");
        cms.copy("src", "/db/securityTest2/parentCollection", "src");
        parentCollection = DatabaseManager.getCollection(baseUri + "/db/securityTest2/parentCollection", "test3", "test3");
        ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");

        srcCollection = test.getChildCollection("src");
        final Collection destCollection = parentCollection.getChildCollection("src");
View Full Code Here

        //now copy /db/securityTest2/src to /db/securityTest2/parentCollection/src
        //as "user3:guest", it should inherit the group ownership 'users' from the parent
        //collection which is setGid and it should have its setGid bit set
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test3", "test3");
        cms = (CollectionManagementServiceImpl)test.getService("CollectionManagementService", "1.0");
        cms.copy("src", "/db/securityTest2/parentCollection", "src");
        parentCollection = DatabaseManager.getCollection(baseUri + "/db/securityTest2/parentCollection", "test3", "test3");
        ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");

        final Collection destCollection = parentCollection.getChildCollection("src");
View Full Code Here

                        service.copyResource( XmldbURI.xmldbUriFor( resource ), XmldbURI.xmldbUriFor( destination ), XmldbURI.xmldbUriFor( name ) );
                    }

                } else {
                    log( "Copying collection: " + collection, Project.MSG_INFO );
                    service.copy( XmldbURI.xmldbUriFor( collection ), XmldbURI.xmldbUriFor( destination ), XmldbURI.xmldbUriFor( name ) );
                }
            }
        }
        catch( final XMLDBException e ) {
            final String msg = "XMLDB exception during copy: " + e.getMessage();
View Full Code Here

           
        } else {
            try {
                final CollectionManagementServiceImpl service = (CollectionManagementServiceImpl) collection.getService("CollectionManagementService", "1.0");
                // DWES to check not sure about XmldbURI.xmldbUriFor() here.
                service.copy(XmldbURI.xmldbUriFor(collection.getName()), destination, null);

            } catch (final XMLDBException e) {
    logger.error("Cannot copy collection: ", e);
                throw new XPathException(this, "Cannot copy collection: " + e.getMessage(), e);
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.