Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.CollectionManagementService.createCollection()


   
    @Test
    public void idsOnEmptyCollection() throws XMLDBException {
        final Collection root = DatabaseManager.getCollection(uri, "admin", null);
        final CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
    final Collection emptyCollection = service.createCollection("empty");
        final XQueryService queryService = (XQueryService) emptyCollection.getService("XPathQueryService", "1.0");
       queryAndAssert(queryService, "/*", 0, null);
       queryAndAssert(queryService, "/id('foo')", 0, null);
    }
   
View Full Code Here


        DatabaseManager.registerDatabase(database);
       
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService service = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");

        Collection testCollection = service.createCollection(TEST_COLLECTION);
        UserManagementService ums = (UserManagementService) testCollection.getService("UserManagementService", "1.0");
        // change ownership to guest
        Account guest = ums.getAccount(GUEST_UID);
        ums.chown(guest, guest.getPrimaryGroup());
        ums.chmod("rwxr-xr-x");
View Full Code Here

        // change ownership to guest
        Account guest = ums.getAccount(GUEST_UID);
        ums.chown(guest, guest.getPrimaryGroup());
        ums.chmod("rwxr-xr-x");

        Collection testConfCollection = service.createCollection(CONF_COLL_URI.toString());
        ums = (UserManagementService) testConfCollection.getService("UserManagementService", "1.0");
        // change ownership to guest
        ums.chown(guest, guest.getPrimaryGroup());
        ums.chmod("rwxr-xr-x");
View Full Code Here

    public void collectionConfigurationService7() throws XMLDBException {

        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
       
        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        UserManagementService ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        //Configure collection automatically
        // sub2 should inherit its index configuration from the top collection
View Full Code Here

    @Test
    public void collectionConfigurationService8() throws XMLDBException {
        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);

        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        UserManagementService ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        //Configure collection automatically
        IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
View Full Code Here

    /** Overwrite configuration in a sub collection 2 times */
    @Test
    public void collectionConfigurationService9() throws XMLDBException {
        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub1 = cms.createCollection(COLLECTION_SUB1.toString());
        UserManagementService ums = (UserManagementService) sub1.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");
View Full Code Here

        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub1 = cms.createCollection(COLLECTION_SUB1.toString());
        UserManagementService ums = (UserManagementService) sub1.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(CONFIG1);
View Full Code Here

    public void collectionConfigurationService10() throws XMLDBException {

        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);

        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        UserManagementService ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(CONFIG1);
View Full Code Here

    @Test
    public void collectionConfigurationService11() throws XMLDBException {
        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);

        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        UserManagementService ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(CONFIG1);
View Full Code Here

    @Test
    public void invalidConfiguration1() throws XMLDBException {
        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);

        CollectionManagementService cms = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection sub2 = cms.createCollection(COLLECTION_SUB2.toString());
        UserManagementService ums = (UserManagementService) sub2.getService("UserManagementService", "1.0");
        ums.chmod("rwxr-xr-x");

        IndexQueryService idxConf = (IndexQueryService) testCollection.getService("IndexQueryService", "1.0");
        idxConf.configureCollection(INVALID_CONFIG1);
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.