Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.XPathQueryService


         Group group = (Group)session.getAttribute("group");
  
         // Get a collection instance
         col = getCollection(request,response);
  
         XPathQueryService service = (XPathQueryService)col.getService("XPathQueryService",XMLDBAPIVERSION);
  
         // Get all Person elements from the database
         ResourceSet resultSet = service.query("/person");
         ResourceIterator results = resultSet.getIterator();
        
         // Clear out group object...
         group.removeAll();
        
View Full Code Here


         *
         * @return a Result containing the query result (ResourceSet) and elapsed time
         */
        public Result runQuery() throws Exception {
            Collection col = IndexedSearchTest.this.client.getCollection(IndexedSearchTest.COLLECTION_PATH);
            XPathQueryService xpathservice = (XPathQueryService) col.getService("XPathQueryService", "1.0");

            org.apache.xindice.Stopwatch aStopwatch = new org.apache.xindice.Stopwatch("Non-indexed starts-with query", true);
            ResourceSet resultSet = xpathservice.query(itsTestQuery);
            aStopwatch.stop();
            return new Result(resultSet, aStopwatch.elapsed());
        }
View Full Code Here

      throw new IllegalArgumentException("A query must be specified");
    }

    try {
      Collection col = getXmlDbCollection();
      XPathQueryService service = (XPathQueryService) col.getService(getXPathQueryService(),
        getXPathQueryServiceVersion());
      ResourceSet result = service.query(pQuery);
      if (result != null) {
        ResourceIterator i = result.getIterator();
        if (i.hasMoreResources()) {
          Class c = getManager().getHandlerClass();
          JMHandler handler = (JMHandler) c.newInstance();
View Full Code Here

    throws SAXException {

        AttributesImpl attributes = new AttributesImpl();

        try {
            XPathQueryService service =
                    (XPathQueryService) collection.getService("XPathQueryService", "1.0");
            ResourceSet resultSet = (resource == null) ?
                    service.query(query) : service.queryResource(resource, query);

            attributes.addAttribute("", QUERY_ATTR, QUERY_ATTR, "CDATA", query);
            attributes.addAttribute("", RESULTS_COUNT_ATTR,
                                    RESULTS_COUNT_ATTR, "CDATA", Long.toString(resultSet.getSize()));
View Full Code Here

    }

  Collection col;
  try {
    col = getXmlDbCollection();
    XPathQueryService service = (XPathQueryService) col.getService(getXPathQueryService(),
                                     getXPathQueryServiceVersion());
    ResourceSet result = service.query(pQuery);
    if (result != null) {
      ResourceIterator i = result.getIterator();
      if (i.hasMoreResources()) {
        JMUnmarshallerHandler handler = (JMUnmarshallerHandler) getManager().getFactory().createUnmarshaller().getUnmarshallerHandler();
        handler.setObserver(pObserver);
View Full Code Here

    throws SAXException {

        AttributesImpl attributes = new AttributesImpl();

        try {
            XPathQueryService service =
                    (XPathQueryService) collection.getService("XPathQueryService", "1.0");
            ResourceSet resultSet = (resource == null) ?
                    service.query(query) : service.queryResource(resource, query);

            attributes.addAttribute("", QUERY_ATTR, QUERY_ATTR, "CDATA", query);
            attributes.addAttribute("", RESULTS_COUNT_ATTR,
                                    RESULTS_COUNT_ATTR, "CDATA", Long.toString(resultSet.getSize()));
View Full Code Here

      if ( col.isOpen() )
      {

        try
        {
          XPathQueryService service = (XPathQueryService) col.getService("XPathQueryService", "1.0");

          rs = service.query(query);
          ResourceIterator results = rs.getIterator();

          if (results.hasMoreResources() == false)
          {
              getLogger ().debug ("DBXMLAUTH: auth failed");
View Full Code Here

    private void queryToSAX(ContentHandler handler, Collection collection, String resource) throws SAXException {

        AttributesImpl attributes = new AttributesImpl();

        try {
            XPathQueryService service =
                (XPathQueryService) collection.getService("XPathQueryService", "1.0");
            ResourceSet resultSet = (resource == null) ?
                    service.query(query) : service.queryResource(resource, query);

            attributes.addAttribute("", QUERY_ATTR, QUERY_ATTR, "CDATA", query);
            attributes.addAttribute("", RESULTS_COUNT_ATTR,
                    RESULTS_COUNT_ATTR, "CDATA", Long.toString(resultSet.getSize()));
View Full Code Here

      throw new IllegalArgumentException("A query must be specified");
    }

    try {
      Collection col = getXmlDbCollection();
      XPathQueryService service = (XPathQueryService) col.getService(getXPathQueryService(),
        getXPathQueryServiceVersion());
      ResourceSet result = service.query(pQuery);
      if (result != null) {
        ResourceIterator i = result.getIterator();
        if (i.hasMoreResources()) {
          Class c = getManager().getHandlerClass();
          JMHandler handler = (JMHandler) c.newInstance();
View Full Code Here

    throws SAXException {

        AttributesImpl attributes = new AttributesImpl();

        try {
            XPathQueryService service =
                    (XPathQueryService) collection.getService("XPathQueryService", "1.0");
            ResourceSet resultSet = (resource == null) ?
                    service.query(query) : service.queryResource(resource, query);

            attributes.addAttribute("", QUERY_ATTR, QUERY_ATTR, "CDATA", query);
            attributes.addAttribute("", RESULTS_COUNT_ATTR,
                                    RESULTS_COUNT_ATTR, "CDATA", Long.toString(resultSet.getSize()));
View Full Code Here

TOP

Related Classes of org.xmldb.api.modules.XPathQueryService

Copyright © 2018 www.massapicom. 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.