AnsweredAssumed Answered

maxItems issue

Question asked by mauro.lorenzutti on Jun 29, 2010
Hi All,

I'm working with "service/cmis/queries" webscript and I have a problem while implementing results pagination. I use the following xml to query the webscript:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cmis:query xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
<cmis:statement>'.$query.'</cmis:statement>
<cmis:includeAllowableActions>false</cmis:includeAllowableActions>
<cmis:searchAllVersions>false</cmis:searchAllVersions>
<cmis:maxItems>'.$results_for_page.'</cmis:maxItems>
<cmis:skipCount>'.$skipcount.'</cmis:skipCount>
</cmis:query>

I execute a query that provides 47 rows and this is what happens if I play with maxItems option:

- if maxItems==10 then I get the following (wrong) result:
<opensearch:totalResults>11</opensearch:totalResults>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>10</opensearch:itemsPerPage>
<cmisra:numItems>11</cmisra:numItems>

- if maxItems==50 then I get the following (correct) result:
<opensearch:totalResults>47</opensearch:totalResults>
<opensearch:startIndex>0</opensearch:startIndex>
<opensearch:itemsPerPage>50</opensearch:itemsPerPage>
<cmisra:numItems>47</cmisra:numItems>

The error is related on the value of totalResults: in the case maxItems is minor then the total results then the value provided by the webscript is wrong.

I tried this on Alfresco Community - v3.2.0 (r2 2440).
I just checked in alfresco issues and forums but I didn't find any report about this problem…

Thank you in advance for any help you may give me.

Regards,
Mauro

Outcomes