Class LeavesOrClosestAncestorsCatalogLookupStrategy
java.lang.Object
de.hybris.platform.personalizationcms.strategy.LeavesOrClosestAncestorsCatalogLookupStrategy
- All Implemented Interfaces:
CxCatalogLookupStrategy
- Direct Known Subclasses:
AllCatalogsHierarchyLookupStrategy
public class LeavesOrClosestAncestorsCatalogLookupStrategy
extends Object
implements CxCatalogLookupStrategy
Implementation of
CxCatalogLookupStrategy that looks first in the leaves catalogs and go up 1 level until it
finds a catalog with personalization.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CatalogVersionServiceprotected List<CatalogVersionModel>getCatalogVersionsFromLeafCatalogs(Collection<CatalogVersionModel> allCatalogsVersions, Set<CatalogModel> leafCatalogs) protected CxCatalogServiceprotected Set<CatalogModel>getLeafCatalogs(Collection<CatalogModel> sessionCatalogs) protected intprotected List<CatalogVersionModel>getPersonalizationCvsFromLeaves(Collection<CatalogModel> sessionCatalogs, int recursionLevel) protected List<CatalogModel>getType()protected booleanisLeafCatalog(CatalogModel catalog, Collection<CatalogModel> sessionCatalogs) In this context, a "leaf" catalog is a catalog that doesn't have any child present in the session.voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCxCatalogService(CxCatalogService cxCatalogService) voidsetMaxRecursions(int maxRecursions)
-
Constructor Details
-
LeavesOrClosestAncestorsCatalogLookupStrategy
public LeavesOrClosestAncestorsCatalogLookupStrategy()
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceCxCatalogLookupStrategy
-
getCatalogVersionsForCalculation
- Specified by:
getCatalogVersionsForCalculationin interfaceCxCatalogLookupStrategy
-
getSessionCatalogs
-
getPersonalizationCvsFromLeaves
protected List<CatalogVersionModel> getPersonalizationCvsFromLeaves(Collection<CatalogModel> sessionCatalogs, int recursionLevel) -
getLeafCatalogs
-
getCatalogVersionsFromLeafCatalogs
protected List<CatalogVersionModel> getCatalogVersionsFromLeafCatalogs(Collection<CatalogVersionModel> allCatalogsVersions, Set<CatalogModel> leafCatalogs) -
isLeafCatalog
In this context, a "leaf" catalog is a catalog that doesn't have any child present in the session.- Parameters:
catalog- catalog version to check for childrensessionCatalogs- the current catalogs in the session- Returns:
- true if catalog is a leaf for this session
-
getCatalogVersionService
-
setCxCatalogService
-
getCxCatalogService
-
setCatalogVersionService
-
getMaxRecursions
protected int getMaxRecursions() -
setMaxRecursions
public void setMaxRecursions(int maxRecursions)
-