Package org.opencms.ade.detailpage
Class CmsDetailPageFilter
- java.lang.Object
-
- org.opencms.ade.detailpage.CmsDetailPageFilter
-
public class CmsDetailPageFilter extends java.lang.Object
Filters and sorts a list of detail pages based on whether they are suitable detail pages for a fixed detail content.Note: Filtering on detail page types is already handled elsewhere, so this class only handles detail pages for a single type.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PREFIX_CATEGORY
Prefix for the category qualifier in a detail page entry.
-
Constructor Summary
Constructors Constructor Description CmsDetailPageFilter(CmsObject cms, java.lang.String rootPath)
Creates a new instance based on the root path of a detail resource.CmsDetailPageFilter(CmsObject cms, CmsResource resource)
Creates a new instance based on an actual detail resource.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkQualifier(java.lang.String qualifier)
Checks that a detail page qualifier matches the detail resource.java.util.stream.Stream<CmsDetailPageInfo>
filterDetailPages(java.util.List<CmsDetailPageInfo> infos)
Produces a filtered and sorted result stream of candidate detail pages for the detail resource.protected java.util.Set<CmsPath>
getCategories()
Gets the category paths, lazily initializing them first if necessary.protected java.util.Set<CmsPath>
readCategories()
Reads the categories for the resource.
-
-
-
Field Detail
-
PREFIX_CATEGORY
public static final java.lang.String PREFIX_CATEGORY
Prefix for the category qualifier in a detail page entry.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsDetailPageFilter
public CmsDetailPageFilter(CmsObject cms, CmsResource resource)
Creates a new instance based on an actual detail resource.- Parameters:
cms
- the CMS contextresource
- the detail resource
-
CmsDetailPageFilter
public CmsDetailPageFilter(CmsObject cms, java.lang.String rootPath)
Creates a new instance based on the root path of a detail resource.- Parameters:
cms
- the CMS contextrootPath
- the detail resource root path
-
-
Method Detail
-
filterDetailPages
public java.util.stream.Stream<CmsDetailPageInfo> filterDetailPages(java.util.List<CmsDetailPageInfo> infos)
Produces a filtered and sorted result stream of candidate detail pages for the detail resource.- Parameters:
infos
- the base list of detail page beans to filter/sort- Returns:
- the result stream
-
checkQualifier
protected boolean checkQualifier(java.lang.String qualifier)
Checks that a detail page qualifier matches the detail resource.- Parameters:
qualifier
- the qualifier to check- Returns:
- true if the qualifier matches the detail resource
-
getCategories
protected java.util.Set<CmsPath> getCategories()
Gets the category paths, lazily initializing them first if necessary.- Returns:
- the set of category paths
-
readCategories
protected java.util.Set<CmsPath> readCategories()
Reads the categories for the resource.- Returns:
- the categories for the resource
-
-