Changeset 6725 for TI01-discovery-API


Ignore:
Timestamp:
12/03/10 13:03:07 (9 years ago)
Author:
mnagni
Message:

The start-howMany did not fulfill the document specification (first record has to be "1" not "0").
Small correction on the connection.close() logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/services/discovery/model/SearchAgent.java

    r6722 r6725  
    9191                if (conn != null) { 
    9292                        try { 
    93                                 conn.close(); 
     93                                if (!conn.isClosed()) 
     94                                        conn.close(); 
    9495                        } catch (SQLException e) { 
    9596                                logHelper.logMessage("closeConnectionError", Level.ERROR, e); 
     
    115116 
    116117                /* -- selects the interval of documents -- */ 
    117                 long start = (searchType.getStart() > 0 && searchType.getStart() < toFilter.size()) ? searchType.getStart() : 0; 
     118                long start = (searchType.getStart() > 0 && searchType.getStart() < toFilter.size() + 1) ? searchType.getStart() : 1; 
    118119 
    119120                long howMany = searchType.getHowMany(); 
    120121                if (howMany > 0) { 
    121                         howMany = (toFilter.size() >= howMany + start) ? howMany + start : toFilter.size(); 
     122                        howMany = (toFilter.size() >= howMany + start - 1) ? howMany + start - 1: toFilter.size(); 
    122123                } else { 
    123124                        howMany = toFilter.size(); 
    124125                } 
    125126 
    126                 toFilter = toFilter.subList((int) start, (int) howMany); 
     127                toFilter = toFilter.subList((int) start - 1, (int) howMany); 
    127128                PresentAgent present = new PresentAgent(); 
    128129                res = present.doPresent(conn, toFilter, searchType.getRetrieveCriteria()); 
     
    411412 
    412413                BoundingBoxType bb = spatialType.getBoundingBox(); 
    413                 String bbox = " SetSRID('BOX3D(" + bb.getLimitWest() + " " + bb.getLimitSouth() + ", " + bb.getLimitWest() 
     414                String bbox = " SetSRID('BOX3D(" + bb.getLimitWest() + " " + bb.getLimitSouth() + ", " + bb.getLimitEast() 
    414415                                + " " + bb.getLimitNorth() + ")'::box3d, 4326)"; 
    415416 
Note: See TracChangeset for help on using the changeset viewer.