Changeset 2692


Ignore:
Timestamp:
03/13/13 11:05:15 (11 years ago)
Author:
oschonef
Message:
  • fix "first record out of range" generated for empty result sets (second attempt; this time be a little less restrictive)
Location:
SRUServer/trunk/src/main/java/eu/clarin/sru/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SRUServer/trunk/src/main/java/eu/clarin/sru/server/SRURequestImpl.java

    r2688 r2692  
    6666    private CQLNode query;
    6767    private String rawQuery;
    68     private int startRecord = -1;
     68    private int startRecord = DEFAULT_START_RECORD;
    6969    private int maximumRecords = -1;
    7070    private String recordSchemaName;
     
    7676    private CQLNode scanClause;
    7777    private String rawScanClause;
    78     private int responsePosition = -1;
     78    private int responsePosition = DEFAULT_RESPONSE_POSITION;
    7979    private int maximumTerms = -1;
    8080
     
    411411
    412412
    413     int getRawStartRecord() {
    414         return startRecord;
    415     }
    416 
    417 
    418413    int getRawMaximumRecords() {
    419414        return maximumRecords;
     
    423418    String getRawScanClause() {
    424419        return rawScanClause;
    425     }
    426 
    427 
    428     int getRawResponsePosition() {
    429         return responsePosition;
    430420    }
    431421
     
    503493    @Override
    504494    public int getStartRecord() {
    505         return (startRecord > 0) ? startRecord : DEFAULT_START_RECORD;
     495        return startRecord;
    506496    }
    507497
     
    563553    @Override
    564554    public int getResponsePosition() {
    565         return (responsePosition >= 0)
    566                 ? responsePosition : DEFAULT_RESPONSE_POSITION;
     555        return responsePosition;
    567556    }
    568557
  • SRUServer/trunk/src/main/java/eu/clarin/sru/server/SRUServer.java

    r2688 r2692  
    353353        // check, of startRecord position is greater than total record set
    354354        if ((result.getTotalRecordCount() >= 0) &&
    355             (request.getRawStartRecord() > 0) &&
    356             (request.getRawStartRecord() > result.getTotalRecordCount())) {
     355            (request.getStartRecord() > 1) &&
     356            (request.getStartRecord() > result.getTotalRecordCount())) {
    357357            throw new SRUException(
    358358                    SRUConstants.SRU_FIRST_RECORD_POSITION_OUT_OF_RANGE);
Note: See TracChangeset for help on using the changeset viewer.