Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.CollectionManagementService


        UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");
        xqueryResource = test.getResource("not_setuid.xquery");
        ums.chmod(xqueryResource, 00750); //NOT SETUID

        //create a collection for the XQuery to write into
        final CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");
        final Collection colForSetUid = cms.createCollection("forSetUidWrite");

        //only allow the user 'test1' to write into the collection
        ums = (UserManagementService)colForSetUid.getService("UserManagementService", "1.0");
        ums.chmod(0700);
View Full Code Here


        xqueryResource = test.getResource("setgid.xquery");
        ums.chown(xqueryResource, ums.getAccount("test1"), "users");
        ums.chmod(xqueryResource, 02705); //setgid

        //create a collection for the XQuery to write into
        final CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");
        final Collection colForSetUid = cms.createCollection("forSetGidWrite");

        //only allow the group 'users' to write into the collection
        ums = (UserManagementService)colForSetUid.getService("UserManagementService", "1.0");
        ums.chmod(0570);
View Full Code Here

        UserManagementService ums = (UserManagementService)test.getService("UserManagementService", "1.0");
        xqueryResource = test.getResource("not_setgid.xquery");
        ums.chmod(xqueryResource, 00705); //NOT setgid

        //create a collection for the XQuery to write into
        final CollectionManagementService cms = (CollectionManagementService)test.getService("CollectionManagementService", "1.0");
        final Collection colForSetUid = cms.createCollection("forSetGidWrite");

        //only allow the group 'users' to write into the collection
        ums = (UserManagementService)colForSetUid.getService("UserManagementService", "1.0");
        ums.chmod(0070);
View Full Code Here

                    base.removeResource( res );
                }

            } else {
                log( "Removing collection: " + collection, Project.MSG_INFO );
                final CollectionManagementService service = (CollectionManagementService)base.getService( "CollectionManagementService", "1.0" );
                service.removeCollection( collection );
            }

        }
        catch( final XMLDBException e ) {
            final String msg = "XMLDB exception during remove: " + e.getMessage();
View Full Code Here

  }
 
  public static Collection addCollection(Collection parent, String name)
  throws XMLDBException
  {
    CollectionManagementService service = getCollectionManagementService(
        parent);
   
    return service.createCollection(name);
  }
View Full Code Here

   
    return service.createCollection(name);
  }
 
  public static void removeCollection(Collection parent, String name) throws XMLDBException {
    CollectionManagementService service = getCollectionManagementService(
        parent);
    service.removeCollection(name);
  }
View Full Code Here

         
          Collection rootCollection = DatabaseManager.getCollection(URI + XmldbURI.ROOT_COLLECTION, "admin", "");
         
          Collection childCollection = rootCollection.getChildCollection(COLLECTION_NAME);
          if (childCollection == null) {
              CollectionManagementService cms = (CollectionManagementService) rootCollection.getService(
                      "CollectionManagementService", "1.0");
              this.collection = cms.createCollection(COLLECTION_NAME);
          } else {
              this.collection = childCollection;
          }
         
                String existHome = System.getProperty("exist.home");
View Full Code Here

            assertNotNull(rootCol);
            IndexQueryService idxConf = (IndexQueryService) rootCol.getService("IndexQueryService", "1.0");
            idxConf.configureCollection(COLLECTION_CONFIG);
            testCol = rootCol.getChildCollection(testColName);
            if (testCol != null) {
                CollectionManagementService mgr = DBUtils.getCollectionManagementService(rootCol);
                mgr.removeCollection(testColName);
            }
            testCol = DBUtils.addCollection(rootCol, testColName);
            assertNotNull(testCol);

            String existHome = System.getProperty("exist.home");
View Full Code Here

    @After
    public void cleanDB() {
        try {
            Collection config = DatabaseManager.getCollection(BASE_URI + "/db/system/config" + testCollection, "admin", null);
            if (config != null) {
                CollectionManagementService mgmt = (CollectionManagementService) config.getService("CollectionManagementService", "1.0");
                mgmt.removeCollection(".");
            }
            Collection root = DatabaseManager.getCollection(BASE_URI + testCollection, "admin", "");
            Resource resource = root.getResource("messages.xml");
            if (resource != null) {
                root.removeResource(resource);
View Full Code Here

            Database database = (Database) cl.newInstance();
            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 testCol = mgmt.createCollection("triggers");

            for (int i = 1; i <= 2; i++) {
                mgmt = (CollectionManagementService) testCol.getService("CollectionManagementService", "1.0");
                testCol = mgmt.createCollection("sub" + i);
            }

        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

TOP

Related Classes of org.xmldb.api.modules.CollectionManagementService

Copyright © 2018 www.massapicom. 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.