Class CommonSystemPropertyBasedSortDefinition
java.lang.Object
org.ametys.web.frontoffice.search.metamodel.impl.CommonSystemPropertyBasedSortDefinition
- All Implemented Interfaces:
SortDefinition
This class has the purpose to functionaly have a common
And to technically rely on
This means that with the
BUT for every other kind of document (such as
SortDefinition
(for all Returnable
s) on
fields such as last validation date, first validation date, last modification date, last major validation date, etc.
And to technically rely on
SystemProperty
.
This means that with the
SystemProperty
mechanism, the sort field is already indexed for Content
s.
BUT for every other kind of document (such as
Page
for PageReturnable
, Resource
for ResourceReturnable
, etc.),
the corresponding sort fields must be manually indexed.-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
The prefix id of the sort definition -
Constructor Summary
ConstructorDescriptionCommonSystemPropertyBasedSortDefinition
(SystemProperty systemProperty, Sort.Order[] orders) Default constructor with the label of the givenSystemProperty
CommonSystemPropertyBasedSortDefinition
(SystemProperty systemProperty, I18nizableText label, Sort.Order[] orders) Default constructor -
Method Summary
-
Field Details
-
__PREFIX_ID
The prefix id of the sort definition- See Also:
-
-
Constructor Details
-
CommonSystemPropertyBasedSortDefinition
Default constructor with the label of the givenSystemProperty
- Parameters:
systemProperty
- TheSystemProperty
thisSortDefinition
is based on.orders
- The orders allowed for thisSortDefinition
-
CommonSystemPropertyBasedSortDefinition
public CommonSystemPropertyBasedSortDefinition(SystemProperty systemProperty, I18nizableText label, Sort.Order[] orders) Default constructor- Parameters:
systemProperty
- TheSystemProperty
thisSortDefinition
is based on.label
- The labelorders
- The orders allowed for thisSortDefinition
-
-
Method Details
-
getId
Description copied from interface:SortDefinition
Gets the id of the sort. It must be unique across all sort definitions- Specified by:
getId
in interfaceSortDefinition
- Returns:
- the unique id of the sort
-
getLabel
Description copied from interface:SortDefinition
Gets the label of the sort.- Specified by:
getLabel
in interfaceSortDefinition
- Returns:
- the label of the sort.
-
orders
Description copied from interface:SortDefinition
Gets the orders this sort supports.
By default toSort.Order.ASC
andSort.Order.DESC
.
Override this method to restrict to only one of them, if the other is irrelevant for instance.- Specified by:
orders
in interfaceSortDefinition
- Returns:
- the orders this sort supports
-
getField
Description copied from interface:SortDefinition
Gets the sort field- Specified by:
getField
in interfaceSortDefinition
- Returns:
- the sort field
-