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

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


        if(scanClause!=null) {
            ert.setScanClause(scanClause);
            try {
                CQLTermNode node=Utilities.getFirstTerm(new CQLParser(CQLParser.V1POINT1).parse(scanClause));
                if(node!=null) {
                    SearchClauseType sct=new SearchClauseType();
                    sct.setTerm(node.getTerm());
                    RelationType rt=new RelationType();
                    rt.setValue(node.getRelation().getBase());
                    sct.setRelation(rt);
                    sct.setIndex(getQualifier(node));
                    ert.setXScanClause(sct);
                }
                else {
                    SearchClauseType sct=new SearchClauseType();
                    sct.setTerm("Unrecognized node");
                    RelationType rt=new RelationType();
                    rt.setValue("");
                    sct.setRelation(rt);
                    sct.setIndex("");
                    ert.setXScanClause(sct);
                }
            }
            catch(java.io.IOException e) {
                log.error(e);
            }
            catch(org.z3950.zing.cql.CQLParseException e) {
                log.error(e);
                SearchClauseType sct=new SearchClauseType();
                sct.setTerm("CQLParseException");
                RelationType rt=new RelationType();
                rt.setValue("");
                sct.setRelation(rt);
                sct.setIndex("");
                ert.setXScanClause(sct);
            }
        }
        else {
            SearchClauseType sct=new SearchClauseType();
            sct.setTerm("");
            RelationType rt=new RelationType();
            rt.setValue("");
            sct.setRelation(rt);
            sct.setIndex("");
            ert.setXScanClause(sct);
        }


        response.setEchoedScanRequest(ert);
View Full Code Here


                ert.setXQuery(toOperandType(root));
            }
            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());
View Full Code Here

            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);
        }
View Full Code Here

TOP

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

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.