Package org.exist.xmldb

Examples of org.exist.xmldb.XPathQueryServiceImpl.beginProtected()


            .getCollection("xmldb:exist://" + collection, "admin", null);
                if (testCollection == null)
                    return;
                XPathQueryServiceImpl service = (XPathQueryServiceImpl) testCollection
            .getService("XQueryService", "1.0");
        service.beginProtected();
        try {
          ResourceSet result = service.query(query);
          System.out.println("Result: " + result.getSize());
        } finally {
          service.endProtected();
View Full Code Here


    public void queryCollection() {
        try {
            Collection root = DatabaseManager.getCollection("xmldb:exist:///db/protected", "admin", null);
            XPathQueryServiceImpl service = (XPathQueryServiceImpl) root.getService("XQueryService", "1.0");
            try {
                service.beginProtected();
                ResourceSet result = service.query("collection('/db/protected/test5')//book");
                assertEquals(result.getSize(), DOCUMENT_COUNT);
            } finally {
                service.endProtected();
            }
View Full Code Here

    public void queryRoot() {
        try {
            Collection root = DatabaseManager.getCollection("xmldb:exist:///db/protected", "admin", null);
            XPathQueryServiceImpl service = (XPathQueryServiceImpl) root.getService("XQueryService", "1.0");
            try {
                service.beginProtected();
                ResourceSet result = service.query("//book");
                assertEquals(result.getSize(), COLLECTION_COUNT * DOCUMENT_COUNT);
            } finally {
                service.endProtected();
            }
View Full Code Here

            XPathQueryServiceImpl service = (XPathQueryServiceImpl) root.getService("XQueryService", "1.0");
            Random random = new Random();
            for (int i = 0; i < COLLECTION_COUNT; i++) {
                String docURI = "doc('/db/protected/test" + i + "/xdb" + random.nextInt(DOCUMENT_COUNT) + ".xml')";
                try {
                    service.beginProtected();
                    ResourceSet result = service.query(docURI + "//book");
                    assertEquals(result.getSize(), 1);
                } finally {
                    service.endProtected();
                }
View Full Code Here

        public void run() {
            try {
                Collection collection = DatabaseManager.getCollection("xmldb:exist:///db/test", "admin", null);
                XPathQueryServiceImpl service = (XPathQueryServiceImpl) collection.getService("XQueryService", "1.0");
                service.beginProtected();
                try {
                    if (start > 0)
                        service.declareVariable("start", new Integer(start));
                    service.query(query);
                } finally {
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.