Package org.apache.oodt.cas.filemgr.structs

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(JOB_ID, this.jobId);

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


    }
   
    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

            e.printStackTrace();
            fail(e.getMessage());
        }
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
       
        List<Product> products = fmClient.query(query, genericFile);
        assertEquals(products.get(0).getProductId(), testProduct.getProductId());
    }
View Full Code Here

        ProductType genericFile = fmClient.getProductTypeByName("GenericFile");
        assertEquals("04.00", (met = fmClient.getCatalogValues(met, genericFile)).getMetadata("DataVersion"));
        assertEquals("4.0", fmClient.getOrigValues(met, genericFile).getMetadata("DataVersion"));
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
        query = fmClient.getCatalogQuery(query, genericFile);
        assertEquals("04.00", ((TermQueryCriteria) query.getCriteria().get(0)).getValue());
    }
View Full Code Here

            e.printStackTrace();
            fail(e.getMessage());
        }
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
       
        List<Product> products = fmClient.query(query, genericFile);
        assertEquals(products.get(0).getProductId(), testProduct.getProductId());
    }
View Full Code Here

        ProductType genericFile = fmClient.getProductTypeByName("GenericFile");
        assertEquals("04.00", (met = fmClient.getCatalogValues(met, genericFile)).getMetadata("DataVersion"));
        assertEquals("4.0", fmClient.getOrigValues(met, genericFile).getMetadata("DataVersion"));
       
        Query query = new Query();
        TermQueryCriteria termQuery = new TermQueryCriteria();
        termQuery.setElementName("DataVersion");
        termQuery.setValue("4.0");
        query.addCriterion(termQuery);
        query = fmClient.getCatalogQuery(query, genericFile);
        assertEquals("04.00", ((TermQueryCriteria) query.getCriteria().get(0)).getValue());
    }
View Full Code Here

        String element;
        if (c instanceof TermQueryPanel) {
          element = database.getElementID(((TermQueryPanel) c).getElement());
          String criteria = ((TermQueryPanel) c).getText();
          if (!element.equals("") && !criteria.equals("")) {
            TermQueryCriteria tc = new TermQueryCriteria();
            tc.setElementName(element);
            tc.setValue(criteria);
            q.addCriterion(tc);
          }
        } else if (c instanceof RangeQueryPanel) {
          element = database.getElementID(((RangeQueryPanel) c).getElement());
          String startCriteria = ((RangeQueryPanel) c).getStart();
View Full Code Here

    }
   
    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

        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

        bqc.setOperator(BooleanQueryCriteria.AND);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
      }
      TermQueryCriteria tqc = new TermQueryCriteria();
      tqc.setElementName("ProductStructure");
      tqc.setValue("Flat");
      try{
        bqc.addTerm(tqc);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
      }
      tqc = new TermQueryCriteria();
      tqc.setElementName("Filename");
      tqc.setValue("tempProduct1");
      try{
        bqc.addTerm(tqc);
      }catch (Exception e){
        e.printStackTrace();
            fail(e.getMessage());
View Full Code Here

TOP

Related Classes of org.apache.oodt.cas.filemgr.structs.TermQueryCriteria

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.