AnsweredAssumed Answered

not getting totalItems when running cmis query

Question asked by archiver on Mar 22, 2018
Latest reply on Mar 22, 2018 by cesarista

Hi,

 

I am trying to use cmis queries to implement pagination in my php script. However I'm facing strange behaviors from Alfresco results sets.

 

When I run the following query:

 

{
"query":{

"query":"select * from adb:sampledoc where IN_TREE('46518183-593c-481f-b30e-4a42baeb07ff') ORDER BY cmis:creationDate DESC",
"language":"cmis"
}
}

 

I get the following result set:

 

{
"list": {
"pagination": {
"count": 0,
"hasMoreItems": false,
"totalItems": 0,
"skipCount": 0,
"maxItems": 100
},
"entries": []
}
}

 

which contains totalItems, that I need for pagination.

 

However, when I run the following query:

 

{
"query":{

"query":"select * from adb:sampledoc where IN_FOLDER('bb5715ed-38b1-4b01-839a-6064dfd10f82') ORDER BY cmis:creationDate DESC",
"language":"cmis"
}
}

 

I get the following result set:

 

{
"list": {
"pagination": {
"count": 100,
"hasMoreItems": true,
"skipCount": 0,
"maxItems": 100
},
"entries": [...]
}
}

 

As you see, the totalItems is missing. Does anybody know if this is a bug or I'm doing something wrong

 

Even stranger is that, we have alfresco on other systems. running the query with IN_FOLDER gives totalItems back.

 

Any help is appreciated.

Thanks

Outcomes