Class SortCriteria

java.lang.Object
org.ametys.plugins.repository.query.SortCriteria

public class SortCriteria extends Object
A sort criteria allows to sort query results.
Warning : methods of this class support a boolean "normalize" which suppose that the patch at https://issues.apache.org/jira/browse/JCR-3443 has been applied.
  • Constructor Details

  • Method Details

    • addCriterion

      public void addCriterion(String metadataPath, boolean ascending, boolean normalize)
      Add a sort criteria to the criteria list, using a metadata name.
      Order of adding is important. First added has more weight during sort.
      Parameters:
      metadataPath - The name of the metadata to sort, or the path to the metadata if composite
      ascending - The order for sorting results
      normalize - true to normalize string properties (remove accents and lower case)
    • addJCRPropertyCriterion

      public void addJCRPropertyCriterion(String jcrProperty, boolean ascending, boolean normalize)
      Add a sort criteria to the criteria list, using a JCR property name.
      Order of adding is important. First added has more weight during sort.
      Parameters:
      jcrProperty - The name of the JCR property to sort
      ascending - The order for sorting results
      normalize - true to normalize string properties (remove accents and lower case)
    • getCriteria

      Get the criteria.
      Returns:
      an unmodifiable view of the criteria list.
    • build

      public String build()
      Build the criteria.
      Returns:
      The formal view of the criteria.