Technical Description of the issue:
When querying Alfresco using a Java CMIS client and the AtomPub binding, specifying descending order on a date field the results are coming back sorted in ascending order. If the Web Service binding is used then the dates are sorted correctly.
Customers Description of the problem:
Descending date sort is not working using new CMIS binding (http://<server>:<port>/alfresco/cmisatom). Results are being sorted
in ascending order. If I change to the deprecated CMIS binding (http://<server>:<port>/alfresco/service/cmis), the descending date
sort works correctly.
This was reproduced locally in 4.1.5 and 126.96.36.199 when retrieving from session cache via getObjectByPath.
Steps to reproduce:
1. With a java cmis client Create session
2. Retrieve folder contents with session.getObjectByPath
3. Set operationcontent orderBy to DESC
4. Retrieve folder children
String orderBy = "cmis:creationDate DESC";
System.out.println("Testing sort on" + orderBy);
Folder folder = (Folder)session.getObjectByPath("/Sites/training/documentlibrary");
OperationContext operationContext = session.getDefaultContext();
ItemIterable<CmisObject> page = folder.getChildren(operationContext).skipTo(0).getPage(20);
for( CmisObject cmisObject : page )
Children should come back sorted in DESC order per the OrderBy clause set on operationContext.
Children are returned in ASC order instead.
Analysis to date
I've noted that in 4.2 and above this does not happen, the results are returned in the order specified however cannot find an existing Jira.
I've also noticed if a query is performed against the Repo via session.Query rather than retrieving from Cache then the results
are returned in the order specified.