Package org.xmldb.api.modules

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


       String fullCollPath = ROOT_URI + collPath.toString();
       System.out.println("Storing configuration '" + confName + "' to '" + collPath + "'" );
       Collection configColl = DatabaseManager.getCollection(fullCollPath, "admin", null);
       if(configColl == null) {
          CollectionManagementService cms = (CollectionManagementService)testCollection.getService("CollectionManagementService", "1.0");
            configColl = cms.createCollection(collPath.toString());
            UserManagementService ums = (UserManagementService) configColl.getService("UserManagementService", "1.0");
            ums.chmod("rwxr-xr-x");
       }
       assertNotNull(configColl);
       Resource res = configColl.createResource(confName.toString(), "XMLResource");
View Full Code Here


            // direct child of the root collection, e.g. /db/test.
            // the example will fail otherwise.
            Collection root = DatabaseManager.getCollection(URI + XmldbURI.ROOT_COLLECTION);
            CollectionManagementService mgtService =
                (CollectionManagementService)root.getService("CollectionManagementService", "1.0");
            col = mgtService.createCollection(collection.substring((XmldbURI.ROOT_COLLECTION + "/").length()));
        }
    File f = new File(file);
        // create new XMLResource
    XMLResource document = (XMLResource)col.createResource(f.getName(), "XMLResource");
    document.setContent(f);
View Full Code Here

   
    static public final Collection createCollection(Collection parentColl, String name) throws XMLDBException, XPathException {
        final Collection child = parentColl.getChildCollection(name);
        if (child == null) {
          final CollectionManagementService mgtService = (CollectionManagementService) parentColl.getService("CollectionManagementService", "1.0");
            return mgtService.createCollection(name);
        }
        return child;
    }
   
    static public final Collection createCollectionPath(Collection parentColl, String relPath) throws XMLDBException, XPathException {
View Full Code Here

        service = (XPathQueryService) root.getService("XQueryService", "1.0");

        CollectionManagementService cms = (CollectionManagementService)
          root.getService("CollectionManagementService", "1.0");
        //Creates the 'test' collection
        test = cms.createCollection("test");
        assertNotNull(test);

        storeResource(test, "test.xq", "BinaryResource", "application/xquery", "doc('test.xml')");
        storeResource(test, "test1.xq", "BinaryResource", "application/xquery", "doc('/test.xml')");
View Full Code Here

                "");
        CollectionManagementService service =
            (CollectionManagementService) root.getService(
                "CollectionManagementService",
                "1.0");
        testCollection = service.createCollection("test");
        assertNotNull(testCollection);
    }

    private void initServer() {
        if (server == null) {
View Full Code Here

                        properties.getProperty("xmldb.user"), properties.getProperty("xmldb.password"));
        CollectionManagementService mgr = (CollectionManagementService)
          root.getService("CollectionManagementService", "1.0");
                UserManagementService umgr = (UserManagementService)
                    root.getService("UserManagementService", "1.0");
        collection = mgr.createCollection(COLLECTION);
                Permission perms = umgr.getPermissions(collection);
                perms.setMode(0744);
                umgr.setPermissions(collection, perms);
      }
    } catch (Exception e) {
View Full Code Here

                DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            CollectionManagementService service =
                (CollectionManagementService) root.getService(
                    "CollectionManagementService",
                    "1.0");
            testCollection = service.createCollection(TEST_COLLECTION_NAME);
            assertNotNull(testCollection);
           
            service =
                (CollectionManagementService) testCollection.getService(
                    "CollectionManagementService",
View Full Code Here

            service =
                (CollectionManagementService) testCollection.getService(
                    "CollectionManagementService",
                    "1.0");
           
            Collection xsl1 = service.createCollection("xsl1");
            assertNotNull(xsl1);
           
            Collection xsl3 = service.createCollection("xsl3");
            assertNotNull(xsl3);
           
View Full Code Here

                    "1.0");
           
            Collection xsl1 = service.createCollection("xsl1");
            assertNotNull(xsl1);
           
            Collection xsl3 = service.createCollection("xsl3");
            assertNotNull(xsl3);
           
            service =
                (CollectionManagementService) xsl1.getService(
                    "CollectionManagementService",
View Full Code Here

            service =
                (CollectionManagementService) xsl1.getService(
                    "CollectionManagementService",
                    "1.0");
           
            Collection xsl2 = service.createCollection("xsl2");
            assertNotNull(xsl2);
           
           
            String  doc1 = "<?xml version='1.0' encoding='UTF-8'?>\n" +
            "<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>\n"+
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.