Package org.exist.collections

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


            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);
View Full Code Here


            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);
        } catch (Exception e) {
View Full Code Here

   
    final TransactionManager transact = broker.getBrokerPool().getTransactionManager();
    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)
View Full Code Here

        Collection root = broker.getOrCreateCollection(transaction, TestConstants.TEST_COLLECTION_URI);
        assertNotNull(root);
        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);
View Full Code Here

              txnManager = pool.getTransactionManager();
              assertNotNull(txnManager);
              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);
View Full Code Here

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

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

              txnManager.commit(txn);
             
View Full Code Here

 
              CollectionConfigurationManager mgr = pool.getConfigurationManager();
              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) {
View Full Code Here

 
              CollectionConfigurationManager mgr = pool.getConfigurationManager();
              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) {
View Full Code Here

          selfLink.setAttribute("rel", "self");
          selfLink.setAttribute("type", Atom.MIME_TYPE);
          selfLink.setAttribute("href", "#");
          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);
View Full Code Here

                for(final Observer observer : observers) {
                    collection.addObserver(observer);
                }
                if (uri != null || res.inputSource!=null) {
                    setupParser(collection, res);
                    info = collection.validateXMLResource(txn, broker, resURI, (uri != null) ? new InputSource(uri) : res.inputSource);
                } else if (res.root != null) {
                    info = collection.validateXMLResource(txn, broker, resURI, res.root);
                } else {
                    info = collection.validateXMLResource(txn, broker, resURI, res.content);
                }
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.