Examples of validateXMLResource()


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

            info = root.validateXMLResource(transaction, broker, doc02uri.lastSegment(), XML2);
            assertNotNull(info);
            root.store(transaction, broker, info, XML2, false);

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

            System.out.println("store "+doc11uri);
            root.addBinaryResource(transaction, broker, doc11uri.lastSegment(), BINARY.getBytes(), null);
View Full Code Here

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

      try {
            pool = BrokerPool.getInstance();
            Subject admin = pool.getSecurityManager().authenticate("admin", "");
            broker = pool.get(admin);
            Collection collection = broker.getOrCreateCollection(null, TestConstants.TEST_COLLECTION_URI);
            IndexInfo info = collection.validateXMLResource(null, broker, TestConstants.TEST_XML_URI, XML);
            //TODO : unlock the collection here ?
            collection.store(null, broker, info, XML, false);
            @SuppressWarnings("unused")
      org.exist.dom.DocumentImpl doc = info.getDocument();
            broker.flush();
View Full Code Here

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

   
    try {
      Collection root = broker.getOrCreateCollection(transaction, TEST_COLLECTION);
      broker.saveCollection(transaction, root);
     
      IndexInfo info = root.validateXMLResource(transaction, broker, XmldbURI.create(docName), data);
      //TODO : unlock the collection here ?
      root.store(transaction, broker, info, data, false);
    
      mgr.commit(transaction);
     
View Full Code Here

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

            int j = 0;
            for (Iterator<DocumentImpl> i = test.iterator(broker); i.hasNext() && j < files.length; j++) {
                DocumentImpl doc = i.next();
                InputSource is = new InputSource(files[j].toURI().toASCIIString());
                assertNotNull(is);
                IndexInfo info = test.validateXMLResource(transaction, broker, doc.getURI(), is);
                assertNotNull(info);
                test.store(transaction, broker, info, is, false);
            }
            generator.releaseAll();
            transact.commit(transaction);
View Full Code Here

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

        CollectionConfigurationManager mgr = broker.getBrokerPool().getConfigurationManager();
        mgr.addConfiguration(transaction, broker, test, COLLECTION_CONFIG);

        InputSource is = new InputSource(new File("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);
        System.out.println("Transaction commited ...");
View Full Code Here

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

        File[] files = generator.generate(broker, test, generateXQ);
        for (int i = 0; i < files.length; i++) {
            File file = files[i];
            is = new InputSource(file.toURI().toASCIIString());
            assertNotNull(is);
            info = test.validateXMLResource(transaction, broker, XmldbURI.create(file.getName()), is);
            assertNotNull(info);
            test.store(transaction, broker, info, is, false);
        }
        generator.releaseAll();
        transact.commit(transaction);
View Full Code Here

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

           
            // store some documents. Will be replaced below
            for (int i = 0; i < files.length; i++) {
                f = files[i];
                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 pass invalid couments ?
                    System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
View Full Code Here

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

           
            // replace some documents
            for (int i = 0; i < files.length; i++) {
                f = files[i];
                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 pass invalid couments ?
                    System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
View Full Code Here

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

//                  TODO : why pass invalid couments ?
                    System.err.println("Error found while parsing document: " + f.getName() + ": " + e.getMessage());
                }
            }
   
            info = test2.validateXMLResource(transaction, broker, XmldbURI.create("test_string.xml"), TEST_XML);
            assertNotNull(info);
            //TODO : unlock the collection here ?
           
            test2.store(transaction, broker, info, TEST_XML, false);           
            // remove last document
View Full Code Here

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 = 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);

            System.out.println("Moving document test.xml to new_test.xml ...");
      broker.moveResource(transaction, info.getDocument(), root, XmldbURI.create("new_test.xml"));
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.