[GeoNetwork-devel] [GeoNetwork opensource Developer website] #601: CSW startPosition + maxRecords does not work (Simple fix)

#601: CSW startPosition + maxRecords does not work (Simple fix)
-------------------------+--------------------------------------------------
Reporter: jesseeichar | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.6.5
Component: General | Version: v2.6.3
Keywords: |
-------------------------+--------------------------------------------------
Doing a CSW request of the type: results_with_summary if the startPosition
is not == 1 the wrong result is returned. Here are some requests and
results:

Request (works correctly):

{{{
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
service="CSW" version="2.0.2" startPosition="1" maxRecords="10"
resultType="results_with_summary">
     <csw:Query typeNames="csw:Record">
         <csw:Constraint version="1.1.0">
             <Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;/&gt;
         </csw:Constraint>
     </csw:Query>
</csw:GetRecords>
}}}

Response: (It is correct)

{{{
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd&quot;&gt;
   <csw:SearchStatus timestamp="2011-09-06T10:49:50" />
   <geonet:Summary xmlns:geonet="http://www.fao.org/geonetwork&quot;
count="3456" type="local" hitsusedforsummary="1000">
     [snip...]
   </geonet:Summary>
   <csw:SearchResults numberOfRecordsMatched="3456"
numberOfRecordsReturned="10" elementSet="summary" nextRecord="11">
     [snip...]
   </csw:SearchResults>
</csw:GetRecordsResponse>

}}}

Request with startPosition == 11:
{{{
<?xml version="1.0"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
service="CSW" version="2.0.2" resultType="results_with_summary"
startPosition="11" maxRecords="10" >
     <csw:Query typeNames="csw:Record">
         <csw:Constraint version="1.1.0">
             <Filter xmlns="http://www.opengis.net/ogc&quot;
xmlns:gml="http://www.opengis.net/gml&quot;/&gt;
         </csw:Constraint>
     </csw:Query>
</csw:GetRecords>
}}}

Response (incorrect because no records are returned):

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd&quot;&gt;
   <csw:SearchStatus timestamp="2011-09-06T10:51:54" />
   <geonet:Summary xmlns:geonet="http://www.fao.org/geonetwork&quot;
count="3456" type="local" hitsusedforsummary="1000">
     [snip...]
   </geonet:Summary>
   <csw:SearchResults numberOfRecordsMatched="3456"
numberOfRecordsReturned="0" elementSet="summary" nextRecord="11" />
</csw:GetRecordsResponse>

Fix is attached

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/601&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/geonetwork/&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.