Package org.exist.collections

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


            assertNotNull(is);
            IndexInfo info = coll.validateXMLResource(transaction,
                broker, XmldbURI.create("test" + fileCount
                    + ".xml"), is);
            assertNotNull(info);
            coll.store(transaction, broker, info, is, false);
                        transact.commit(transaction);
                    }
          generator.releaseAll();
        }
      } catch (Exception e) {
View Full Code Here


            File existDir = existHome==null ? new File(".") : new File(existHome);
            File f = new File(existDir,"samples/biblio.rdf");
            assertNotNull(f);
            IndexInfo info = test.validateXMLResource(transaction, broker, TestConstants.TEST_XML_URI, new InputSource(f.toURI().toASCIIString()));
            assertNotNull(info);
            test.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
           
            Collection dest = broker.getOrCreateCollection(transaction, TestConstants.DESTINATION_COLLECTION_URI);
            assertNotNull(dest);
            broker.saveCollection(transaction, dest);           
            broker.moveCollection(transaction, test, dest, XmldbURI.create("test3"));
View Full Code Here

            File existDir = existHome==null ? new File(".") : new File(existHome);
            File f = new File(existDir,"samples/biblio.rdf");
            assertNotNull(f);
            IndexInfo info = test2.validateXMLResource(transaction, broker, TestConstants.TEST_XML_URI, 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 ...");
           
            transaction = transact.beginTransaction();
View Full Code Here

            docs = new DefaultDocumentSet();

            IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("test_string.xml"), XML);
            assertNotNull(info);
            root.store(transaction, broker, info, XML, false);

            docs.add(info.getDocument());

            info = root.validateXMLResource(transaction, broker, XmldbURI.create("test_string2.xml"), XML2);
            assertNotNull(info);
View Full Code Here

            docs.add(info.getDocument());

            info = root.validateXMLResource(transaction, broker, XmldbURI.create("test_string2.xml"), XML2);
            assertNotNull(info);
            root.store(transaction, broker, info, XML2, false);

            docs.add(info.getDocument());

            transact.commit(transaction);
        } catch (Exception e) {
View Full Code Here

            transaction = transact.beginTransaction();
            File file = createDocument();
            IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"),
                    new InputSource(file.toURI().toASCIIString()));
            assertNotNull(info);
            root.store(transaction, broker, info, new InputSource(file.toURI().toASCIIString()), false);
            broker.saveCollection(transaction, root);

            transact.commit(transaction);

            transact.getJournal().flushToLog(true);
View Full Code Here

                f = files[i];
                assertNotNull(f);
                try {
                    info = test.validateXMLResource(transaction, broker, XmldbURI.create(f.getName()), new InputSource(f.toURI().toASCIIString()));
                    assertNotNull(info);
                    test.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

            String existHome = System.getProperty("exist.home");
            File existDir = existHome==null ? new File(".") : new File(existHome);
            File f = new File(existDir,"samples/biblio.rdf");
            IndexInfo info = test.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"),
                    new InputSource(f.toURI().toASCIIString()));
            test.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
           
            Collection dest = broker.getOrCreateCollection(transaction, XmldbURI.ROOT_COLLECTION_URI.append("destination"));
            broker.saveCollection(transaction, dest);
           
            broker.copyCollection(transaction, test, dest, XmldbURI.create("test3"));
View Full Code Here

            String existHome = System.getProperty("exist.home");
            File existDir = existHome==null ? new File(".") : new File(existHome);
            File f = new File(existDir,"samples/biblio.rdf");
            assertNotNull(f);
            IndexInfo info = test2.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"), new InputSource(f.toURI().toASCIIString()));
            test2.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
           
            transaction = transact.beginTransaction();
View Full Code Here

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

      broker.copyResource(transaction, info.getDocument(), testCollection, XmldbURI.create("new_test.xml"));
      broker.saveCollection(transaction, testCollection);

      transact.commit(transaction);
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.