Package gov.loc.www.zing.cql.xcql

Examples of gov.loc.www.zing.cql.xcql.OperandType


            }
            catch (CQLParseException e) {
                log.error("parse problem: \""+query+"\"",e);
                RelationType rt=new RelationType("", null);
                SearchClauseType sct=new SearchClauseType("", rt, "");
                OperandType ot=new OperandType();
                ot.setSearchClause(sct);
                ert.setXQuery(ot);
            }
            catch (IOException e) {
                log.error(e,e);
                RelationType rt=new RelationType("", null);
                SearchClauseType sct=new SearchClauseType("", rt, "");
                OperandType ot=new OperandType();
                ot.setSearchClause(sct);
                ert.setXQuery(ot);
            }
        }
        else { // sadly, just because the request didn't include it doesn't mean
               // that the response gets to omit it.  So, provide an empty query
            ert.setQuery("");
            RelationType rt=new RelationType("", null);
            SearchClauseType sct=new SearchClauseType("", rt, "");
            OperandType ot=new OperandType();
            ot.setSearchClause(sct);
            ert.setXQuery(ot);
        }
        ert.setResultSetTTLrequest.getResultSetTTL());
        ert.setRecordPacking( request.getRecordPacking());
        ert.setSortKeys(      request.getSortKeys());
View Full Code Here


            ert.setRecordSchema("default");
        response.setEchoedSearchRetrieveRequest(ert);
    }

    private OperandType toOperandType(CQLNode node) {
        OperandType ot=new OperandType();
        if(node instanceof CQLBooleanNode) {
            CQLBooleanNode cbn=(CQLBooleanNode)node;
            TripleType tt=new TripleType();
            if(cbn instanceof CQLAndNode)
                tt.set_boolean(new BooleanType("and", null));
            else if(cbn instanceof CQLOrNode)
                tt.set_boolean(new BooleanType("or", null));
            else if(cbn instanceof CQLNotNode)
                tt.set_boolean(new BooleanType("not", null));
            else tt.set_boolean(new BooleanType("prox", null));

            tt.setLeftOperand(toOperandType(cbn.left));
            tt.setRightOperand(toOperandType(cbn.right));
            ot.setTriple(tt);
        }
        else if(node instanceof CQLTermNode) {
            CQLTermNode ctn=(CQLTermNode)node;
            SearchClauseType sct=new SearchClauseType();
            sct.setIndex(getQualifier(ctn));
            RelationType rt=new RelationType();
            rt.setValue(ctn.getRelation().getBase());
            sct.setRelation(rt);
            sct.setTerm(ctn.getTerm());
            ot.setSearchClause(sct);
        }
        else {
            log.error("Found a node on the parse tree of type: "+node);
        }
        return ot;
View Full Code Here

TOP

Related Classes of gov.loc.www.zing.cql.xcql.OperandType

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.