Package org.xmldb.api.modules

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


            database.setProperty("create-database", "true");
            DatabaseManager.registerDatabase(database);

            org.xmldb.api.base.Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            test = mgmt.createCollection("test");
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
View Full Code Here


        Collection root = DatabaseManager.getCollection(URI);
        CollectionManagementService mgtService =
          (CollectionManagementService) root.getService(
            "CollectionManagementService",
            "1.0");
        col = mgtService.createCollection(XSLT_COLLECTION);
        System.out.println("collection created.");
      }
     
      BrokerPool.getInstance().getConfiguration().setProperty(
          TransformerFactoryAllocator.PROPERTY_TRANSFORMER_CLASS,
View Full Code Here

    Collection root =
      DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
    CollectionManagementService service =
      (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
    testCollection = service.createCollection("test");
    Assert.assertNotNull(testCollection);
       
    File dir = new File(TEST_DIR);
    files = dir.listFiles(new XMLFilenameFilter());
    for (File file : files) {
View Full Code Here

            database.setProperty("create-database", "true");
            DatabaseManager.registerDatabase(database);

            Collection root = DatabaseManager.getCollection(XmldbURI.LOCAL_DB, "admin", "");
            CollectionManagementService mgmt = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
            Collection collection = mgmt.createCollection("protected");

            IndexQueryService idxConf = (IndexQueryService) collection.getService("IndexQueryService", "1.0");
            idxConf.configureCollection(COLLECTION_CONFIG);
            XMLResource hamlet = (XMLResource) collection.createResource("hamlet.xml", "XMLResource");
            hamlet.setContent(new File("samples/shakespeare/hamlet.xml"));
View Full Code Here

            mgmt = (CollectionManagementService) collection.getService("CollectionManagementService", "1.0");
           
            TestDataGenerator generator = new TestDataGenerator("xdb", DOCUMENT_COUNT);
            for (int i = 0; i < COLLECTION_COUNT; i++) {
                Collection currentColl = mgmt.createCollection("test" + i);
                System.out.println("Generating " + DOCUMENT_COUNT + " files...");
                File[] files = generator.generate(currentColl, generateXQ);
                for (int j = 0; j < files.length; j++) {
                    XMLResource resource = (XMLResource) currentColl.createResource("xdb" + j + ".xml", "XMLResource");
                    resource.setContent(files[j]);
View Full Code Here

      root = DatabaseManager.getCollection( XmldbURI.LOCAL_DB, "admin", "");
      CollectionManagementService service =
        (CollectionManagementService) root.getService(
          "CollectionManagementService",
          "1.0");
      root = service.createCollection("test");
      FILE_STORED = "big.xml";
      doc = (XMLResource) root.createResource(FILE_STORED, "XMLResource");
    } catch (ClassNotFoundException e) {
    } catch (InstantiationException e) {
    } catch (IllegalAccessException e) {
View Full Code Here

            if( collection == null ) {
                log( "Create collection management service for collection " + current.getName(), Project.MSG_DEBUG );
                mgtService = (CollectionManagementService)current.getService( "CollectionManagementService", "1.0" );
                log( "Create child collection " + token, Project.MSG_DEBUG );
                current = mgtService.createCollection( token );
                log( "Created collection " + current.getName() + '.', Project.MSG_DEBUG );

            } else {
                current = collection;
            }
View Full Code Here

            if( c == null ) {
                log( "Create collection management service for collection " + current.getName(), Project.MSG_DEBUG );
                mgtService = (CollectionManagementService)current.getService( "CollectionManagementService", "1.0" );
                log( "Create child collection " + segment );
                current = mgtService.createCollection( segment.toString() );
                log( "Created collection " + current.getName() + '.' );

            } else {
                current = c;
            }
View Full Code Here

  private Collection setupTestCollection() throws XMLDBException {
    Collection root = DatabaseManager.getCollection(URI, "admin", "");
    CollectionManagementService rootcms = (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
    Collection c = root.getChildCollection("test");
    if(c != null) rootcms.removeCollection("test");
    rootcms.createCollection("test");
    c = DatabaseManager.getCollection(URI+"/test", "admin", "");
    assertNotNull(c);
    return c;
  }
View Full Code Here

        Collection root = DatabaseManager.getCollection(baseURI + "/db", "admin", "");
       
        CollectionManagementService mgmt =
                (CollectionManagementService) root.getService("CollectionManagementService", "1.0");
        Collection test = mgmt.createCollection("rpctest");
        IndexQueryService idxs = (IndexQueryService) test.getService("IndexQueryService", "1.0");
        idxs.configureCollection(COLLECTION_CONFIG);

        Resource resource = test.createResource("strings.xml", "XMLResource");
        resource.setContent(new File("samples/shakespeare/macbeth.xml"));
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.