Examples of OSQuery


Examples of com.sun.syndication.feed.module.opensearch.entity.OSQuery

        link.setHref("http://www.jahia.org/opensearch-description.xml");
        link.setType("application/opensearchdescription+xml");
        link.setTitle("Jahia Open Search");
        osm.setLink(link);

        OSQuery query = new OSQuery();
        query.setRole("request");
        query.setSearchTerms(searchString);
        osm.addQuery(query);

        List<OpenSearchModule> modules = feed.getModules();
        modules.add(osm);
        feed.setModules(modules);
View Full Code Here

Examples of com.sun.syndication.feed.module.opensearch.entity.OSQuery

    {
      OpenSearchModule osMod = new OpenSearchModuleImpl();
      osMod.setTotalResults(qRes.getHitCount());
      osMod.setStartIndex(qRes.getStart());
      osMod.setItemsPerPage(qRes.getPageSize());
      OSQuery osq = new OSQuery();
      osq.setRole("request");
        try
        {
            osq.setSearchTerms(URLEncoder.encode(query, "UTF-8"));
          }
        catch(UnsupportedEncodingException e)
          {
            log.error(e);
          }
        osq.setStartPage(1 + (qRes.getStart() / qRes.getPageSize()));
        osMod.addQuery(osq);
        return osMod;
          }
View Full Code Here

Examples of com.sun.syndication.feed.module.opensearch.entity.OSQuery

    {
      OpenSearchModule osMod = new OpenSearchModuleImpl();
      osMod.setTotalResults(totalResults);
      osMod.setStartIndex(start);
      osMod.setItemsPerPage(pageSize);
      OSQuery osq = new OSQuery();
      osq.setRole("request");
        try
        {
            osq.setSearchTerms(URLEncoder.encode(query, "UTF-8"));
        }
        catch(UnsupportedEncodingException e)
        {
            log.error(e);
        }
        osq.setStartPage(1 + (start / pageSize));
        osMod.addQuery(osq);
        return osMod;
    }
View Full Code Here

Examples of org.rometools.feed.module.opensearch.entity.OSQuery

        return (foundSomething) ? osm : null;
    }
 
  private static OSQuery parseQuery(Element e){
   
    OSQuery query = new OSQuery();
   
        String att = e.getAttributeValue("role");
        query.setRole(att);
       
        att = e.getAttributeValue("osd");
    query.setOsd(att);
       
        att = e.getAttributeValue("searchTerms");
    query.setSearchTerms(att);
           
        att = e.getAttributeValue("title");
    query.setTitle(att);
       
    try{

      // someones mistake should not cause the parser to fail, since these are only optional attributes
     
      att = e.getAttributeValue("totalResults");
          if(att != null){
            query.setTotalResults(Integer.parseInt(att));
          }
         
          att = e.getAttributeValue("startPage");
      if(att != null){
              query.setStartPage(Integer.parseInt(att));
      }
     
    } catch(NumberFormatException ex){
      System.err.println("Warning: Exception caught while trying to parse a non-numeric Query attribute " + ex.getMessage());
    }
View Full Code Here

Examples of org.rometools.feed.module.opensearch.entity.OSQuery

        if(osm.getQueries() != null){
         
          List queries = osm.getQueries();
         
          for (Iterator iter = queries.iterator(); iter.hasNext();) {
        OSQuery query = (OSQuery) iter.next();
        if(query != null){
              element.addContent(generateQueryElement(query));
        }
      }
        }         
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.