Package org.exist.xmldb

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


    public void copyCollection_doesNotPreservePermissions() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");

        //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");
View Full Code Here


    public void copyCollection_doesPreservePermissions_whenDestCollectionExists() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");
       
        //pre-create the dest collection and grant access to all (0777)
        Collection dest = cms.createCollection("copy-of-source");
        UserManagementService ums = (UserManagementService)dest.getService("UserManagementService", "1.0");
        ums.chmod(0777);
View Full Code Here

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");
       
        //pre-create the dest collection and grant access to all (0777)
        Collection dest = cms.createCollection("copy-of-source");
        UserManagementService ums = (UserManagementService)dest.getService("UserManagementService", "1.0");
        ums.chmod(0777);

        //as the 'test3' user copy the collection
        test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test3", "test3");
View Full Code Here

    public void copyCollectionWithResource_doesNotPreservePermissions() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");

        //create resource owned by "test1", and group "users" in /db/securityTest3/source
        final Resource resSource = source.createResource("source.xml", XMLResource.RESOURCE_TYPE);
        resSource.setContent("<test/>");
        source.storeResource(resSource);
View Full Code Here

    public void copyCollectionWithResources_withSubCollectionWithResource_doesNotPreservePermissions() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");

        //create resource owned by "test1", and group "users" in /db/securityTest3/source
        Resource resSource = source.createResource("source1.xml", XMLResource.RESOURCE_TYPE);
        resSource.setContent("<test/>");
        source.storeResource(resSource);
View Full Code Here

    public void copyCollectionWithResources_destResourceExists_destResourceIsWritable_preservePermissions() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest3", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl) test.getService("CollectionManagementService", "1.0");

        //create collection owned by "test1", and group "users" in /db/securityTest3
        Collection source = cms.createCollection("source");

        //create resource owned by "test1", and group "users" in /db/securityTest3/source
        Resource resSource = source.createResource("source1.xml", XMLResource.RESOURCE_TYPE);
        resSource.setContent("<test1/>");
        source.storeResource(resSource);
View Full Code Here

        resSource = source.createResource("source2.xml", XMLResource.RESOURCE_TYPE);
        resSource.setContent("<test2/>");
        source.storeResource(resSource);
       
        //pre-create the destination and set writable by all
        final Collection dest = cms.createCollection("copy-of-source");
        UserManagementService ums = (UserManagementService) dest.getService("UserManagementService", "1.0");
        ums.chmod(0777);
       
        //pre-create a destination resource and set access for all
        Resource resDestSource1 = dest.createResource("source1.xml", XMLResource.RESOURCE_TYPE);
View Full Code Here

    public void noSetGid_copyCollection_collectionGroupIsUsersPrimaryGroup() throws XMLDBException {
        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl)test.getService("CollectionManagementService", "1.0");

        //create the /db/securityTest2/src collection
        Collection srcCollection = cms.createCollection("src");

        //create /db/securityTest2/parentCollection with owner "test1:users" and mode "rwxrwxrwx"
        Collection parentCollection = cms.createCollection("parentCollection");
        UserManagementService ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");
        ums.chmod("rwxrwxrwx");
View Full Code Here

        //create the /db/securityTest2/src collection
        Collection srcCollection = cms.createCollection("src");

        //create /db/securityTest2/parentCollection with owner "test1:users" and mode "rwxrwxrwx"
        Collection parentCollection = cms.createCollection("parentCollection");
        UserManagementService ums = (UserManagementService)parentCollection.getService("UserManagementService", "1.0");
        ums.chmod("rwxrwxrwx");

        //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'
View Full Code Here

        Collection test = DatabaseManager.getCollection(baseUri + "/db/securityTest2", "test1", "test1");
        CollectionManagementServiceImpl cms = (CollectionManagementServiceImpl)test.getService("CollectionManagementService", "1.0");
        UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");

        //create the /db/securityTest2/src collection with owner "test1:extusers" and default mode
        Collection srcCollection = cms.createCollection("src");
        ums = (UserManagementService)srcCollection.getService("UserManagementService", "1.0");
        ums.chgrp("extusers");

        //create /db/securityTest2/parentCollection with owner "test1:users" and mode "rwxrwsrwx"
        Collection parentCollection = cms.createCollection("parentCollection");
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.