Package org.ametys.cms.search
Class GroupSearchContentHelper
java.lang.Object
org.ametys.cms.search.GroupSearchContentHelper
- All Implemented Interfaces:
Component
,Serviceable
Helper to group search contents
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorganizeContentsInGroups
(Iterable<Content> contents, List<String> groupingFields, Set<ContentType> contentTypes, Locale locale) Create GroupSearchContent to organize the contents in a hierarchy according to a list of attributes Example Continent/Country/Cityvoid
service
(ServiceManager serviceManager)
-
Field Details
-
ROLE
The Avalon role name
-
-
Constructor Details
-
GroupSearchContentHelper
public GroupSearchContentHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
organizeContentsInGroups
public GroupSearchContent organizeContentsInGroups(Iterable<Content> contents, List<String> groupingFields, Set<ContentType> contentTypes, Locale locale) Create GroupSearchContent to organize the contents in a hierarchy according to a list of attributes Example Continent/Country/City- Parameters:
contents
- contents that need to be sortedgroupingFields
- list of attributes to group with (ordered)contentTypes
- the content typelocale
- The locale for groups. Can be null. Only useful if grouping by multilingual contents or multilingual string- Returns:
- the root group of contents
-