Class 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CmsDetailPageFilter

        public CmsDetailPageFilter​(CmsObject cms,
                                   CmsResource resource)
        Creates a new instance based on an actual detail resource.
        Parameters:
        cms - the CMS context
        resource - 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 context
        rootPath - the detail resource root path
    • Method Detail

      • filterDetailPages

        public java.util.stream.Stream<CmsDetailPageInfofilterDetailPages​(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<CmsPathgetCategories()
        Gets the category paths, lazily initializing them first if necessary.
        Returns:
        the set of category paths
      • readCategories

        protected java.util.Set<CmsPathreadCategories()
        Reads the categories for the resource.
        Returns:
        the categories for the resource