Package gov.loc.www.zing.srw

Examples of gov.loc.www.zing.srw.EchoedSearchRetrieveRequestType


        response.setEchoedScanRequest(ert);
    }


    public void setEchoedSearchRetrieveRequestType(SearchRetrieveRequestType request, SearchRetrieveResponseType response) {
        EchoedSearchRetrieveRequestType ert=response.getEchoedSearchRetrieveRequest();
        if(ert==null) {
            ert=new EchoedSearchRetrieveRequestType();
        }
        ert.setMaximumRecords(request.getMaximumRecords());
        String query=request.getQuery();
        if(query!=null && query.length()>0) {
            ert.setQuery(query);
            try {
                CQLNode root=cqlparser.parse(query);
                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());
        ert.setRecordPacking( request.getRecordPacking());
        ert.setSortKeys(      request.getSortKeys());
        ert.setStartRecord(   request.getStartRecord());
        if(request.getExtraRequestData()!=null)
            ert.setExtraRequestData(request.getExtraRequestData());
        if(request.getVersion()!=null)
            ert.setVersion(request.getVersion());
        else
            ert.setVersion("1.1");
        if(request.getRecordSchema()!=null)
            ert.setRecordSchema(request.getRecordSchema());
        else
            ert.setRecordSchema("default");
        response.setEchoedSearchRetrieveRequest(ert);
    }
View Full Code Here

TOP

Related Classes of gov.loc.www.zing.srw.EchoedSearchRetrieveRequestType

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.