Package org.ametys.cms.search
Class GroupSearchContentHelper
- java.lang.Object
-
- org.ametys.cms.search.GroupSearchContentHelper
-
- All Implemented Interfaces:
Component
,Serviceable
public class GroupSearchContentHelper extends Object implements Component, Serviceable
Helper to group search contents
-
-
Constructor Summary
Constructors Constructor Description GroupSearchContentHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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/Cityvoid
service(ServiceManager serviceManager)
-
-
-
Constructor Detail
-
GroupSearchContentHelper
public GroupSearchContentHelper()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- 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
-
-