Examples of validateXMLResource()


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

            String existHome = System.getProperty("exist.home");
            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("test2.xml"), new InputSource(f.toURI().toASCIIString()));
      assertNotNull(info);
      subTestCollection.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);

      transact.commit(transaction);
      System.out.println("Transaction commited ...");
View Full Code Here

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

            for (int i = 0; i < 50; i++) {
                System.out.println("Storing " + i + " out of 50...");
                transaction = transact.beginTransaction();

                File f = new File("samples/shakespeare/macbeth.xml");
                IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"),
                        new InputSource(f.toURI().toASCIIString()));
                assertNotNull(info);
                root.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);

                transact.commit(transaction);
View Full Code Here

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

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

            File f = new File("samples/shakespeare/hamlet.xml");
            IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create("test.xml"),
                    new InputSource(f.toURI().toASCIIString()));
            assertNotNull(info);
            root.store(transaction, broker, info, new InputSource(f.toURI().toASCIIString()), false);

            transact.commit(transaction);
View Full Code Here

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

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

            Collection test = broker.getOrCreateCollection(transaction, TEST_COLLECTION);
            broker.saveCollection(transaction, test);

            IndexInfo info = test.validateXMLResource(transaction, broker, XmldbURI.create("test_string.xml"),
                TEST_XML);
            //TODO : unlock the collection here ?
            assertNotNull(info);

            test.store(transaction, broker, info, TEST_XML, false);
View Full Code Here

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

            }

            if (mime.isXMLType()) {
                final InputSource vtfis = new VirtualTempFileInputSource(vtempFile, charset);

                final IndexInfo info = collection.validateXMLResource(transaction, broker, docUri, vtfis);
                info.getDocument().getMetadata().setMimeType(contentType);
                collection.store(transaction, broker, info, vtfis, false);
                response.setStatus(HttpServletResponse.SC_CREATED);
            } else {
View Full Code Here

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

            txn = transact.beginTransaction();
           
            if(mime.isXMLType()) {
                LOG.debug("storing XML resource");
                final InputSource inputsource = new InputSource(tmp.toURI().toASCIIString());
                final IndexInfo info = collection.validateXMLResource(txn, broker, documentUri, inputsource);
                final DocumentImpl doc = info.getDocument();
                doc.getMetadata().setMimeType(contentType);
                collection.release(Lock.READ_LOCK);
                collectionLocked = false;
                collection.store(txn, broker, info, inputsource, false);
View Full Code Here

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

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

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

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

            System.out.println("STORING DOCUMENT....");
            IndexInfo info = root.validateXMLResource(txn, broker, doc1uri.lastSegment(), XML1);
            assertNotNull(info);
            System.out.println("STORING DOCUMENT....SECOND ROUND....");
            root.store(txn, broker, info, XML1, false);
            assertNotNull(info.getDocument());
            System.out.println("STORING DOCUMENT....DONE.");
View Full Code Here

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

            assertNotNull(info.getDocument());
            System.out.println("STORING DOCUMENT....DONE.");

            doc1 = info.getDocument();

            info = root.validateXMLResource(txn, broker, doc2uri.lastSegment(), XML2);
            assertNotNull(info);
            root.store(txn, broker, info, XML2, false);

            doc2 =  info.getDocument();
View Full Code Here

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

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

            System.out.println("store "+doc1uri);
            IndexInfo info = root.validateXMLResource(transaction, broker, doc1uri.lastSegment(), XML);
            assertNotNull(info);
            root.store(transaction, broker, info, XML, false);

            System.out.println("store "+doc2uri);
            BinaryDocument doc = root.addBinaryResource(transaction, broker, doc2uri.lastSegment(), BINARY.getBytes(), null);
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.