Package org.xmldb.api.modules

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


       
        Collection col = null;
        try {
            col = DatabaseManager.getCollection(baseUri + "/db", uid, pwd);
            CollectionManagementService cms = (CollectionManagementService)col.getService("CollectionManagementService", "1.0");
            cms.createCollection(collectionName);
        } catch(final XMLDBException xmldbe) {
            throw new ApiException(xmldbe);
        } finally {
            if(col != null) {
                try {
View Full Code Here


            null);
      CollectionManagementService service =
        (CollectionManagementService) root.getService(
            "CollectionManagementService",
        "1.0");
      testCollection = service.createCollection("test");
      assertNotNull(testCollection);
     
      Resource xr = testCollection.createResource("hamlet.xml", "XMLResource");
            String existHome = System.getProperty("exist.home");
            File existDir = existHome == null ? new File(".") : new File(existHome);
View Full Code Here

            File existDir = existHome == null ? new File(".") : new File(existHome);
      File f = new File(existDir,"samples/shakespeare/hamlet.xml");
      xr.setContent(f);
      testCollection.storeResource(xr);
     
      xmlrpcCollection = service.createCollection("xmlrpc");
      assertNotNull(xmlrpcCollection);
     
      Resource br = xmlrpcCollection.createResource(TestConstants.TEST_MODULE_URI.toString(), "BinaryResource");
      ((EXistResource) br).setMimeType(MimeType.XQUERY_TYPE.getName());
            br.setContent(XmlRpcTest.MODULE_DATA);
View Full Code Here

            Database database = (Database) cl.newInstance();
            database.setProperty("create-database", "true");
            DatabaseManager.registerDatabase(database);
            Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
            CollectionManagementService cms = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            Collection test = cms.createCollection(TEST_COLLECTION);
            UserManagementService ums = (UserManagementService) test.getService("UserManagementService", "1.0");
            // change ownership to guest
            Account guest = ums.getAccount(GUEST_UID);
            ums.chown(guest, guest.getPrimaryGroup());
            ums.chmod(Permission.DEFAULT_COLLECTION_PERM);
View Full Code Here

    @Test
    public void createCollections() throws XMLDBException {

        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        CollectionManagementService service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_TMP_COLLECTION);
        assertNotNull(validationCollection);
View Full Code Here

        Collection testCollection = DatabaseManager.getCollection(ROOT_URI + "/" + TEST_COLLECTION);
        CollectionManagementService service = (CollectionManagementService) testCollection.getService("CollectionManagementService", "1.0");
        Collection validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_TMP_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_XSD_COLLECTION);
        assertNotNull(validationCollection);
View Full Code Here

        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_TMP_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_XSD_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_DTD_COLLECTION);
        assertNotNull(validationCollection);
    }
View Full Code Here

        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_XSD_COLLECTION);
        assertNotNull(validationCollection);

        validationCollection = service.createCollection(TestTools.VALIDATION_HOME_COLLECTION + "/" + TestTools.VALIDATION_DTD_COLLECTION);
        assertNotNull(validationCollection);
    }
}
View Full Code Here

    @Test
    public void create() throws XMLDBException {
        Collection root = DatabaseManager.getCollection(ROOT_URI, ADMIN_UID, ADMIN_PWD);
        CollectionManagementService service = (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
        Collection testCollection = service.createCollection(TestConstants.SPECIAL_NAME);
        assertNotNull(testCollection);
    }

    @Test
    public void testRead() throws XMLDBException {
View Full Code Here

        database.setProperty("create-database", "true");
        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(Permission.DEFAULT_COLLECTION_PERM);
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.