Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-10814

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.

    Details

    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 4.1.5
    • Fix Version/s: 4.1.9
    • Component/s: CMIS
    • Labels:
      None
    • Environment:
      Postgres,Tomcat, opencmis 0.8

      Description

      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.

      Supporting evidence:
      This was reproduced locally in 4.1.5 and 4.1.7.3 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();
      operationContext.setMaxItemsPerPage(20);
      operationContext.setOrderBy(orderBy);
      ItemIterable<CmisObject> page = folder.getChildren(operationContext).skipTo(0).getPage(20);
      for( CmisObject cmisObject : page )

      { System.out.println(cmisObject.getName() + " - " + cmisObject.getCreationDate().getTime()); }

      Expected Behaviour
      Children should come back sorted in DESC order per the OrderBy clause set on operationContext.

      Observed Behaviour
      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.

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  rwalker Ray Walker [X] (Inactive)
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 1 day, 4 hours
                    1d 4h

                      Structure Helper Panel