Package org.exist.collections

Examples of org.exist.collections.Collection.store()


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

            //store test data
            IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
            root.store(txn, broker, info, XML1, false);
            info = root.validateXMLResource(txn, broker, doc2uri.lastSegment(), XML2);
            root.store(txn, broker, info, XML2, false);
            root.addBinaryResource(txn, broker, doc3uri.lastSegment(), BINARY.getBytes(), null);

            txnManager.commit(txn);
View Full Code Here


            //store test data
            IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
            root.store(txn, broker, info, XML1, false);
            info = root.validateXMLResource(txn, broker, doc2uri.lastSegment(), XML2);
            root.store(txn, broker, info, XML2, false);
            root.addBinaryResource(txn, broker, doc3uri.lastSegment(), BINARY.getBytes(), null);

            txnManager.commit(txn);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

    final Txn txn = transact.beginTransaction();
    try
    {
      final IndexInfo info = collection.validateXMLResource(txn, broker, docName, content);
      //TODO : unlock the collection here ?
      collection.store(txn, broker, info, content, false);
      transact.commit(txn);
    }
    catch(final Exception e)
    {
      transact.abort(txn);
View Full Code Here

        broker.saveCollection(transaction, root);
   
    //store test document
        IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create(documentName), testDocument);
        assertNotNull(info);
        root.store(transaction, broker, info, new InputSource(new StringReader(testDocument)), false);
       
        //commit the transaction
        transact.commit(transaction);
        System.out.println("Transaction commited ...");
  }
View Full Code Here

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

          IndexInfo info = col.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
              assertNotNull(info);
              col.store(txn, broker, info, XML1, false);
             
              //XXX: need to simulate unfinished transaction & crash
              txnManager.commit(txn);

          } catch (Exception e) {
View Full Code Here

              assertNotNull(txn);

           
          IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
              assertNotNull(info);
              root.store(txn, broker, info, XML1, false);

              txnManager.commit(txn);
             
          } catch (Exception e) {
              e.printStackTrace();
View Full Code Here

              mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);
 
              System.out.println("store "+doc1uri);
              IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
              assertNotNull(info);
              root.store(txn, broker, info, XML1, false);
 
              txnManager.commit(txn);
          } catch (Exception e) {
              e.printStackTrace();
              txnManager.abort(txn);
View Full Code Here

              mgr.addConfiguration(txn, broker, root, COLLECTION_CONFIG);
 
              System.out.println("store "+doc1uri);
              IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), wrongXML);
              assertNotNull(info);
              root.store(txn, broker, info, wrongXML, false);
 
              txnManager.commit(txn);
          } catch (Exception e) {
              //e.printStackTrace();
              txnManager.abort(txn);
View Full Code Here

          root.appendChild(selfLink);

          final IndexInfo info = collection.validateXMLResource(transaction, broker, FEED_DOCUMENT_URI, doc);
          setPermissions(broker, root, info.getDocument());
          // TODO : We should probably unlock the collection here
          collection.store(transaction, broker, info, doc, false);
          transact.commit(transaction);
          response.setStatusCode(204);
          response.setHeader("Location", request.getModuleBase() + request.getPath());

        } catch (final IOException ex) {
View Full Code Here

                + " already exists.");
          }
          final IndexInfo info = collection.validateXMLResource(transaction, broker, entryURI, doc);
          setPermissions(broker, root, info.getDocument());
          // TODO : We should probably unlock the collection here
          collection.store(transaction, broker, info, doc, false);

          // Update the updated element
          DOMDB.replaceTextElement(transaction, feedRoot,
              Atom.NAMESPACE_STRING, "updated", currentDateTime,
              true);
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.