Package org.exist.storage

Examples of org.exist.storage.DBBroker.saveCollection()


            txn = txnManager.beginTransaction();
            assertNotNull(txn);

            final Collection root = broker.getOrCreateCollection(txn, col1uri);
            assertNotNull(root);
            broker.saveCollection(txn, root);

            final CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);

            //store test data
View Full Code Here


        transact = pool.getTransactionManager();
              assertNotNull(transact);
              transaction = transact.beginTransaction();
              assertNotNull(transaction);
              Collection collection = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
              broker.saveCollection(transaction, collection);
 
              IndexInfo info = collection.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"), xml);
              //TODO : unlock the collection here ?
              collection.store(transaction, broker, info, xml, false);
              transact.commit(transaction);
View Full Code Here

            assertNotNull(transaction);
            System.out.println("Transaction started ...");

            Collection root = broker.getOrCreateCollection(transaction, col1uri);
            assertNotNull(root);
            broker.saveCollection(transaction, root);

            CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(transaction, broker, root, COLLECTION_CONFIG);

            System.out.println("store "+doc1uri);
View Full Code Here

           
            System.out.println("Transaction started ...");

            Collection root = broker.getOrCreateCollection(txn, col1uri);
            assertNotNull(root);
            broker.saveCollection(txn, root);

            Collection test2 = broker.getOrCreateCollection(txn, col2uri);
            assertNotNull(test2);
            broker.saveCollection(txn, test2);
View Full Code Here

            assertNotNull(root);
            broker.saveCollection(txn, root);

            Collection test2 = broker.getOrCreateCollection(txn, col2uri);
            assertNotNull(test2);
            broker.saveCollection(txn, test2);

            CollectionConfigurationManager mgr = pool.getConfigurationManager();
            mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);

            doc1 = storeDocument(txn, broker, root, doc1uri, XML1);
View Full Code Here

        System.out.println("MOVING...");
            final TransactionManager txnManager = pool.getTransactionManager();
            final Txn txn = txnManager.beginTransaction();
          try {
              Collection col2 = broker.getOrCreateCollection(txn, col2uri);
          broker.saveCollection(txn, col2);

                DocumentImpl doc1 = col1.getDocument(broker, doc1uri.lastSegment());
              broker.moveResource(txn, doc1, col2, doc4uri.lastSegment());

              txnManager.commit(txn);
View Full Code Here

            final TransactionManager txnManager = pool.getTransactionManager();
            final Txn txn = txnManager.beginTransaction();
            try {
                DocumentImpl doc1 = col1.getDocument(broker, doc1uri.lastSegment());
                broker.removeXMLResource(txn, doc1);
                broker.saveCollection(txn, col1);
                txnManager.commit(txn);
            } catch(Exception e) {
                e.printStackTrace();
                txnManager.abort(txn);
                fail(e.getMessage());
View Full Code Here

          TestConstants.TEST_COLLECTION_URI);
            assertNotNull(root);
            Permission perms = root.getPermissions();
            // collection is world-writable
            perms.setMode(0744);
      broker.saveCollection(transaction, root);

            Collection test = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI2);
            assertNotNull(test);
            perms = test.getPermissions();
            // collection is world-writable
View Full Code Here

            Collection test = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI2);
            assertNotNull(test);
            perms = test.getPermissions();
            // collection is world-writable
            perms.setMode(0744);
      broker.saveCollection(transaction, test);

      IndexInfo info = test.validateXMLResource(transaction, broker,
          XmldbURI.create("document.xml"), DATA);
      assertNotNull(info);
      test.store(transaction, broker, info, DATA, false);
View Full Code Here

                    TestConstants.TEST_COLLECTION_URI2.append("test4"));
            assertNotNull(childCol1);
            perms = childCol1.getPermissions();
            // collection only accessible to user
            perms.setMode(0744);
            broker.saveCollection(transaction, childCol1);

            info = childCol1.validateXMLResource(transaction, broker,
          XmldbURI.create("document.xml"), DATA);
      assertNotNull(info);
      childCol1.store(transaction, broker, info, DATA, false);
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.