Hi Florian,

thx for the info.

Yes, on server side I only return 5 hits except for the last page where I only 
return 1 (total numItems = 16).

I am just a bit confused about the display in the Chemistry Workbench 
QueryFrame:
When I set skipCount to 0 with maxHits = 5 it properly only shows up 5 hits.
But when I set skipCount to 5 it fetches all the pages up to the end and shows 
11 hits
[cid:5EA16AC0-7015-4A7D-8690-4F120273DF55]

In the code of the QueryFrame the ItemIterable (variable “page") then 
automatically fetches the next page when getting to the end of one page.

results = model.query(text, searchAllVersionsCheckBox.isSelected(), maxHits);
...
ItemIterable<QueryResult> page = results.getPage(maxHits);
for (QueryResult qr : page)
{
// with skipCount > 0 here at every 5th loop the next page is automatically 
fetched from server
...
}
...

When I set numItems like Alfresco Demo Server does then it is displayed 
properly (Alfresco seems to set numItems to 5 for first page, 10 for second 
page and so on …).
But this setting of numItems is wrong when I understood you correctly.

So I am just wondering if I do sth. wrong or this is an issue elsewhere?

tia

Cheers
Sascha

P. +84 166 456-3331
shome...@apollon.de

turning technology.

apollon GmbH+Co. KG
Maximilianstr. 104
75172 Pforzheim / Germany
www.apollon.de

Geschäftsführer: Eugen Müller (Vors.), Ingrid Müller (stv. Vors.),
Peter Schellhorn, Norbert Weckerle
Amtsgericht Mannheim HRA 500441
PhG: Meyle+Müller Verwaltungs-GmbH HRB 500138

apollon auf der dmexco Köln 14./15. September 2016
Halle 6.1 / Stand A-064
Schnell Tickets sichern!
On Aug 19, 2016, at 5:32 PM, Florian Müller 
<f...@apache.org<mailto:f...@apache.org>> wrote:

Hi Sascha,

You are right, totalNumItems should stay the same for each page (assuming that 
the data in the repository doesn't change).
Some repositories don't always return a value for totalNumItems, but that's OK 
from the spec point of view.

If the client sets maxItems to 5 the server MUST NOT return more than 5 hits. 
It may return fewer hits (because there are no more hits or because of any 
server constraints), but never more.

OpenCMIS doesn't have a TCK test for that, yet. It may be worth adding one...


- Florian


Hi all,
I am currently struggling with the paging of a query result set.
Did I understand it correctly that “numItems” should contain the whole
number of items (if the repository knows about it)?
So for example a repository only contains 16 documents all from type
cmis:document and we have a query like:
“SELECT cmis:name FROM cmis:document ORDER BY cmis:name”
When we set the page size (maxItems) to 5 and the skipCount to 0 then
I assume that the server should pass the first 5 results (the first
page) and set the numItems to 16.
When we want the second page we set skipCount to 5 (and leave maxItems
= 5) and still numItems is 16.
Third page with a skipCount of 10 and still numItems = 16. And so on…
Is this correct?
Cause when I do it this way on the server the QueryFrame in the CMIS
Workbench gives me 11 hits for skipCount = 5 and maxItems = 5 (the
ItemIterable in the loop just goes through all pages).
I compared with Alfresco CMIS Demo server. For this the Workbench
QueryFrame properly only shows up 5 hits for every page but it seems
the Alfresco Server does set “numItems” to the summed up number of
items until current page (numItems = 5 for skipCount = 0, numItems =
10 for skipCount = 5).
I strongly assume Alfresco is right here.
tia
Cheers
Sascha
P. +84 166 456-3331
shome...@apollon.de<mailto:shome...@apollon.de>
turning technology.
apollon GmbH+Co. KG
Maximilianstr. 104
75172 Pforzheim / Germany
www.apollon.de
Geschäftsführer: Eugen Müller (Vors.), Ingrid Müller (stv. Vors.),
Peter Schellhorn, Norbert Weckerle
Amtsgericht Mannheim HRA 500441
PhG: Meyle+Müller Verwaltungs-GmbH HRB 500138
apollon auf der dmexco Köln 14./15. September 2016
Halle 6.1 / Stand A-064
Schnell kostenlose Tickets downloaden – nur vom 18.7. bis 15.8.2016

Reply via email to