Examples of TermQueryCriteria


Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

    }
   
    public static QueryCriteria getQueryCriteriaFromXmlRpc(Hashtable<String, Object> criteriaHash) {
        QueryCriteria criteria = null;
        if(((String)criteriaHash.get("class")).equals(TermQueryCriteria.class.getCanonicalName())){
            criteria = new TermQueryCriteria();
            criteria.setElementName((String) criteriaHash.get("elementName"));
            ((TermQueryCriteria)criteria).setValue((String) criteriaHash.get("elementValue"));
        } else if(((String)criteriaHash.get("class")).equals(RangeQueryCriteria.class.getCanonicalName())){
            criteria = new RangeQueryCriteria();
            criteria.setElementName((String) criteriaHash.get("elementName"));
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

        if (luceneQuery instanceof TermQuery) {
            Term t = ((TermQuery) luceneQuery).getTerm();
            if (t.field().equals(freeTextBlock)) {
                // nothing for now
            } else {
                casQuery.addCriterion(new TermQueryCriteria(t.field(),
                        t.text()));
            }
        } else if (luceneQuery instanceof PhraseQuery) {
            Term[] t = ((PhraseQuery) luceneQuery).getTerms();
            if (t[0].field().equals(freeTextBlock)) {
                // nothing for now
            } else {
                for (int i = 0; i < t.length; i++)
                    casQuery.addCriterion(new TermQueryCriteria(
                            t[i].field(), t[i].text()));
            }
        } else if (luceneQuery instanceof RangeQuery) {
            Term startT = ((RangeQuery) luceneQuery).getLowerTerm();
            Term endT = ((RangeQuery) luceneQuery).getUpperTerm();
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

      if (luceneQuery instanceof TermQuery) {
         Term t = ((TermQuery) luceneQuery).getTerm();
         if (t.field().equals(FREE_TEXT_BLOCK)) {
            throw new Exception("Free text blocks not supported!");
         } else {
            return new TermQueryCriteria(t.field(), t.text());
         }
      } else if (luceneQuery instanceof PhraseQuery) {
         Term[] t = ((PhraseQuery) luceneQuery).getTerms();
         if (t[0].field().equals(FREE_TEXT_BLOCK)) {
            throw new Exception("Free text blocks not supported!");
         } else {
            BooleanQueryCriteria bqc = new BooleanQueryCriteria();
            bqc.setOperator(BooleanQueryCriteria.AND);
            for (int i = 0; i < t.length; i++) {
               bqc.addTerm(new TermQueryCriteria(t[i].field(), t[i]
                     .text()));
            }
            return bqc;
         }
      } else if (luceneQuery instanceof RangeQuery) {
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

        // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t.text());
      } else {
        String element = database.getElementID(t.field());
        if (!element.equals("") && !t.text().equals("")) {

          casQ.addCriterion(new TermQueryCriteria(element, t.text()));
        }
      }
    } else if (luceneQ instanceof PhraseQuery) {
      Term[] t = ((PhraseQuery) luceneQ).getTerms();
      if (t[0].field().equals("__FREE__")) {
        // if(casQuery.getCriteria().isEmpty()) casQuery.addCriterion(new
        // FreeTextQueryCriteria());
        // for(int i=0;i<t.length;i++)
        // ((FreeTextQueryCriteria)casQuery.getCriteria().get(0)).addValue(t[i].text());
      } else {
        for (int i = 0; i < t.length; i++) {
          String element = database.getElementID(t[i].field());
          if (!element.equals("") && !t[i].text().equals("")) {
            casQ.addCriterion(new TermQueryCriteria(element, t[i].text()));
          }
        }
      }
    } else if (luceneQ instanceof RangeQuery) {
      Term startT = ((RangeQuery) luceneQ).getLowerTerm();
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

      for (TermQueryCriteria tqc : criteria) {
        if (tqc.getElementName().equals(tc.getElem().getElementName())) {
          return;
        }
      }
      criteria.add(new TermQueryCriteria(tc.getElem().getElementName(), tc
          .getValue()));
      ((FMBrowserSession) getSession()).setCriteria(criteria);
      refreshProductPage();
      computeStartEndIdx();
      PageParameters parameters = new PageParameters();
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

     * @see org.apache.wicket.markup.html.form.Button#onSubmit()
     */
    @Override
    public void onSubmit() {
      for (int i = 0; i < criteria.size(); i++) {
        TermQueryCriteria cr = criteria.get(i);
        if (cr.getElementName().equals(crit.getElementName())) {
          criteria.remove(i);
          ((FMBrowserSession) getSession()).setCriteria(criteria);
          refreshProductPage();
          computeStartEndIdx();
          PageParameters parameters = new PageParameters();
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

   *
   * @see org.apache.oodt.pcs.query.PCSQuery#buildQuery()
   */
  public Query buildQuery() {
    Query query = new Query();
    TermQueryCriteria crit = new TermQueryCriteria(PRODUCT_NAME, this.prodName);

    query.addCriterion(crit);
    return query;
  }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

   *
   * @see org.apache.oodt.pcs.query.PCSQuery#buildQuery()
   */
  public Query buildQuery() {
    Query query = new Query();
    TermQueryCriteria crit = new TermQueryCriteria(OUTPUT_FILES,
        this.origOutputFile);

    query.addCriterion(crit);
    return query;
  }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

   *
   * @see org.apache.oodt.pcs.query.PCSQuery#buildQuery()
   */
  public Query buildQuery() {
    Query query = new Query();
    TermQueryCriteria crit = new TermQueryCriteria(FILENAME, this.fileName);
    query.addCriterion(crit);
    return query;
  }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

   *
   * @see org.apache.oodt.pcs.query.PCSQuery#buildQuery()
   */
  public Query buildQuery() {
    Query query = new Query();
    TermQueryCriteria crit = new TermQueryCriteria(INPUT_FILES,
        this.origInputFile);

    query.addCriterion(crit);
    return 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.