Package com.jalios.jcms.portlet
Class PortalManager.CatDiscrimComparator
- java.lang.Object
-
- com.jalios.jstore.BasicStorable.CdateComparator<T>
-
- com.jalios.jcms.comparator.BasicComparator<T>
-
- com.jalios.jcms.Category.NameComparator<Category>
-
- com.jalios.jcms.portlet.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.comparator.BasicComparator
BasicComparator.StringComparisonMethod
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<Category,java.lang.Integer>
catWeightMap
protected Category[]
contextCategories
protected Category
currentPortalCategory
protected java.util.Set<Category>
currentWorkspaceCategories
protected Category[]
rootNav
-
Fields inherited from class com.jalios.jcms.comparator.BasicComparator
channel, comparisonMethod, contextMap, jcmsContext, language, locale
-
-
Constructor Summary
Constructors Constructor Description CatDiscrimComparator(Category[] contextCategories, Category[] rootNav)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Category c1, Category c2)
-
Methods inherited from class com.jalios.jcms.comparator.BasicComparator
compareString
-
Methods inherited from class com.jalios.jstore.BasicStorable.CdateComparator
compareDate
-
-
-
-
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
-
-