Package org.exist.collections

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


            File existDir = existHome==null ? new File(".") : new File(existHome);
      File f = new File(existDir,"samples/shakespeare/r_and_j.xml");
      assertNotNull(f);
            IndexInfo info = test2.validateXMLResource(transaction, broker, XmldbURI.create("new_test2.xml"),
          new InputSource(f.toURI().toASCIIString()));
      test2.store(transaction, broker, info, new InputSource(f.toURI()
          .toASCIIString()), false);

      transact.commit(transaction);

      transaction = transact.beginTransaction();
View Full Code Here


          Collection test = broker.getOrCreateCollection(transaction, TEST_COLLECTION_URI.append("test2"));
          broker.saveCollection(transaction, test);
         
          info = test.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"), TEST_XML);
          //TODO : unlock the collection here ?
          test.store(transaction, broker, info, TEST_XML, false);
 
          mgr.commit(transaction)
          System.out.println("Transaction commited ...");
         
      } catch (Exception e) {
View Full Code Here

            } finally {
              if (collection != null)
                {collection.release(Lock.WRITE_LOCK);}
            }
           
            collection.store(transaction, broker, info, source, false);
            transact.commit(transaction);
           
            LOG.debug("parsing " + docUri + " took " + (System.currentTimeMillis() - startTime) + "ms.");
            return true;
View Full Code Here

            {collection.release(Lock.WRITE_LOCK);}
        }

        // DWES why seperate store?
        if(treatAsXML){
          collection.store(transaction, broker, info, source, false);
        }

        // generic
        transact.commit(transaction);
View Full Code Here

                MimeType mime = MimeTable.getInstance().getContentTypeFor(f.getName());
                if (mime == null || mime.isXMLType()) {
                    try {
                        info = root.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                        assertNotNull(info);
                        root.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
                    } catch (SAXException e) {
                        System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
                    }
                }
            }
View Full Code Here

           
            IndexInfo info = test2.validateXMLResource(transaction, broker, TestConstants.TEST_XML_URI, TEST_XML);
            assertNotNull(info);
            //TODO : unlock the collection here ?
           
            test2.store(transaction, broker, info, TEST_XML, false);
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
           
            transaction = transact.beginTransaction();
View Full Code Here

            for (int i = 0; i < docs.length; i++) {
                f = docs[i];
                assertNotNull(f);
                info = test2.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                assertNotNull(info);
                test2.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
            }
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
           
View Full Code Here

                f = files[i];
                assertNotNull(f);
                try {
                    info = test2.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                    assertNotNull(info);
                    test2.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
                } catch (SAXException e) {
                  //TODO : why store invalid documents ?
                    System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
                }
            }
View Full Code Here

                f = files[i];
                assertNotNull(f);
                try {
                    info = test2.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                    assertNotNull(info);
                    test2.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
                } catch (SAXException e) {
                    System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
                }
            }
           
View Full Code Here

          "samples/shakespeare/hamlet.xml").toURI().toASCIIString());
      assertNotNull(is);
      IndexInfo info = test.validateXMLResource(transaction, broker,
          XmldbURI.create("hamlet.xml"), is);
      assertNotNull(info);
      test.store(transaction, broker, info, is, false);
      transact.commit(transaction);

      // initialize XML:DB driver
      Class<?> cl = Class.forName("org.exist.xmldb.DatabaseImpl");
      Database database = (Database) cl.newInstance();
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.