Class PortalManager.CatDiscrimComparator

  • All Implemented Interfaces:
    java.util.Comparator<Category>
    Enclosing class:
    PortalManager

    public static class PortalManager.CatDiscrimComparator
    extends Category.NameComparator<Category>
    implements java.util.Comparator<Category>
    Compare categories to find the most relavant one for portal resolution.

    Each category gets point (in this order) :

    • 1pt by Navigate Level (First RootNavigate = +3 , Second RootNavigate = +2, Second RootNavigate = +1)
    • x2 for each contextual categories
    • 1pt for categories matching current workspace categories (since JCMS-10344)
    • 1pt for categories matching current portal category
    Since:
    jcms-5.5.0
    Author:
    Jean-Philippe Encausse
    • Field Detail

      • contextCategories

        protected final Category[] contextCategories
      • rootNav

        protected final Category[] rootNav
      • currentWorkspaceCategories

        protected final java.util.Set<Category> currentWorkspaceCategories
      • currentPortalCategory

        protected final Category currentPortalCategory
      • catWeightMap

        protected final java.util.Map<Category,​java.lang.Integer> catWeightMap
    • Constructor Detail

      • CatDiscrimComparator

        public CatDiscrimComparator​(Category[] contextCategories,
                                    Category[] rootNav)