Examples of XPathQueryServiceImpl


Examples of org.apache.xindice.client.xmldb.services.XPathQueryServiceImpl

        this.collPath = collPath;

        services = new Hashtable();
       
        // Register all services supported by this collection implementation.
        XPathQueryServiceImpl xpath = new XPathQueryServiceImpl();
        xpath.setCollection(this);
//        xpath.setSymbolDeserializer(syms);
        registerService(xpath);

        XUpdateQueryServiceImpl xupdate = new XUpdateQueryServiceImpl();
        xupdate.setCollection(this);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.services.XPathQueryServiceImpl

     */
    public XindiceCollection(String collPath) throws XMLDBException {
        this.collPath = collPath.endsWith("/") ? collPath.substring(0, collPath.length() - 1) : collPath;

        // Register all services supported by this collection implementation.
        final XPathQueryServiceImpl xpath = new XPathQueryServiceImpl();
        xpath.setCollection(this);
        // xpath.setSymbolDeserializer(syms);
        registerService(xpath);

        final XUpdateQueryServiceImpl xupdate = new XUpdateQueryServiceImpl();
        xupdate.setCollection(this);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.services.XPathQueryServiceImpl

     */
    public XindiceCollection(String collPath) throws XMLDBException {
        this.collPath = collPath.endsWith("/") ? collPath.substring(0, collPath.length() - 1) : collPath;

        // Register all services supported by this collection implementation.
        final XPathQueryServiceImpl xpath = new XPathQueryServiceImpl();
        xpath.setCollection(this);
        // xpath.setSymbolDeserializer(syms);
        registerService(xpath);

        final XUpdateQueryServiceImpl xupdate = new XUpdateQueryServiceImpl();
        xupdate.setCollection(this);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.services.XPathQueryServiceImpl

     */
    public XindiceCollection(String collPath) throws XMLDBException {
        this.collPath = collPath.endsWith("/") ? collPath.substring(0, collPath.length() - 1) : collPath;

        // Register all services supported by this collection implementation.
        final XPathQueryServiceImpl xpath = new XPathQueryServiceImpl();
        // xpath.setSymbolDeserializer(syms);
        registerService(xpath);

        final XUpdateQueryServiceImpl xupdate = new XUpdateQueryServiceImpl();
        registerService(xupdate);
View Full Code Here

Examples of org.apache.xindice.client.xmldb.services.XPathQueryServiceImpl

     */
    public XindiceCollection(String collPath) throws XMLDBException {
        this.collPath = collPath.endsWith("/") ? collPath.substring(0, collPath.length() - 1) : collPath;

        // Register all services supported by this collection implementation.
        final XPathQueryServiceImpl xpath = new XPathQueryServiceImpl();
        xpath.setCollection(this);
        // xpath.setSymbolDeserializer(syms);
        registerService(xpath);

        final XUpdateQueryServiceImpl xupdate = new XUpdateQueryServiceImpl();
        xupdate.setCollection(this);
View Full Code Here

Examples of org.exist.xmldb.XPathQueryServiceImpl

            xpath = xp;
            System.out.println("XPath =   " + xpath);
            System.out.println("Sort-by = " + sortBy);
        }
       
        final XPathQueryServiceImpl service = (XPathQueryServiceImpl) current.getService("XPathQueryService", "1.0");
        service.setProperty(OutputKeys.INDENT, properties.getProperty("indent"));
        service.setProperty(OutputKeys.ENCODING, properties.getProperty("encoding"));

        for(final Map.Entry<String, String> mapping : namespaceMappings.entrySet()) {
            service.setNamespace(mapping.getKey(), mapping.getValue());
        }
       
        return (sortBy == null) ? service.query(xpath) : service.query(xpath, sortBy);
    }
View Full Code Here

Examples of org.exist.xmldb.XPathQueryServiceImpl

     
    Collection col = DatabaseManager.getCollection(collectionPath);
   
    System.out.println(Thread.currentThread().getName() + ": executing query: " + xquery);
   
    XPathQueryServiceImpl service = (XPathQueryServiceImpl)
      col.getService("XPathQueryService", "1.0");
   
//    service.beginProtected();
    ResourceSet result = service.query(xquery);

    System.out.println(Thread.currentThread().getName() + ": found " + result.getSize());
   
    DefaultHandler handler = new DefaultHandler();
    for (int i = 0; i < result.getSize(); i++) {
View Full Code Here

Examples of org.exist.xmldb.XPathQueryServiceImpl

      try {
        org.xmldb.api.base.Collection testCollection = DatabaseManager
            .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();
        }
      } catch (Exception e) {
        e.printStackTrace();
        fail(e.getMessage());
      }
View Full Code Here

Examples of org.exist.xmldb.XPathQueryServiceImpl

    @Test
    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();
            }
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
View Full Code Here

Examples of org.exist.xmldb.XPathQueryServiceImpl

    @Test
    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();
            }
        } catch (XMLDBException e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
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.