Class SortCriteria
java.lang.Object
org.ametys.plugins.repository.query.SortCriteria
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.
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.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCriterion
(String metadataPath, boolean ascending, boolean normalize) Add a sort criteria to the criteria list, using a metadata name.void
addJCRPropertyCriterion
(String jcrProperty, boolean ascending, boolean normalize) Add a sort criteria to the criteria list, using a JCR property name.build()
Build the criteria.Get the criteria.
-
Constructor Details
-
SortCriteria
public SortCriteria()
-
-
Method Details
-
addCriterion
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 compositeascending
- The order for sorting resultsnormalize
-true
to normalize string properties (remove accents and lower case)
-
addJCRPropertyCriterion
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 sortascending
- The order for sorting resultsnormalize
-true
to normalize string properties (remove accents and lower case)
-
getCriteria
Get the criteria.- Returns:
- an unmodifiable view of the criteria list.
-
build
Build the criteria.- Returns:
- The formal view of the criteria.
-