Class LeavesOrClosestAncestorsCatalogLookupStrategy
- java.lang.Object
-
- de.hybris.platform.personalizationcms.strategy.LeavesOrClosestAncestorsCatalogLookupStrategy
-
- All Implemented Interfaces:
CxCatalogLookupStrategy
- Direct Known Subclasses:
AllCatalogsHierarchyLookupStrategy
public class LeavesOrClosestAncestorsCatalogLookupStrategy extends java.lang.Object implements CxCatalogLookupStrategy
Implementation ofCxCatalogLookupStrategy
that looks first in the leaves catalogs and go up 1 level until it finds a catalog with personalization.
-
-
Constructor Summary
Constructors Constructor Description LeavesOrClosestAncestorsCatalogLookupStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CatalogVersionService
getCatalogVersionService()
java.util.List<CatalogVersionModel>
getCatalogVersionsForCalculation()
protected java.util.List<CatalogVersionModel>
getCatalogVersionsFromLeafCatalogs(java.util.Collection<CatalogVersionModel> allCatalogsVersions, java.util.Set<CatalogModel> leafCatalogs)
protected CxCatalogService
getCxCatalogService()
protected java.util.Set<CatalogModel>
getLeafCatalogs(java.util.Collection<CatalogModel> sessionCatalogs)
protected int
getMaxRecursions()
protected java.util.List<CatalogVersionModel>
getPersonalizationCvsFromLeaves(java.util.Collection<CatalogModel> sessionCatalogs, int recursionLevel)
protected java.util.List<CatalogModel>
getSessionCatalogs()
CxCatalogLookupType
getType()
protected boolean
isLeafCatalog(CatalogModel catalog, java.util.Collection<CatalogModel> sessionCatalogs)
In this context, a "leaf" catalog is a catalog that doesn't have any child present in the session.void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setCxCatalogService(CxCatalogService cxCatalogService)
void
setMaxRecursions(int maxRecursions)
-
-
-
Method Detail
-
getType
public CxCatalogLookupType getType()
- Specified by:
getType
in interfaceCxCatalogLookupStrategy
-
getCatalogVersionsForCalculation
public java.util.List<CatalogVersionModel> getCatalogVersionsForCalculation()
- Specified by:
getCatalogVersionsForCalculation
in interfaceCxCatalogLookupStrategy
-
getSessionCatalogs
protected java.util.List<CatalogModel> getSessionCatalogs()
-
getPersonalizationCvsFromLeaves
protected java.util.List<CatalogVersionModel> getPersonalizationCvsFromLeaves(java.util.Collection<CatalogModel> sessionCatalogs, int recursionLevel)
-
getLeafCatalogs
protected java.util.Set<CatalogModel> getLeafCatalogs(java.util.Collection<CatalogModel> sessionCatalogs)
-
getCatalogVersionsFromLeafCatalogs
protected java.util.List<CatalogVersionModel> getCatalogVersionsFromLeafCatalogs(java.util.Collection<CatalogVersionModel> allCatalogsVersions, java.util.Set<CatalogModel> leafCatalogs)
-
isLeafCatalog
protected boolean isLeafCatalog(CatalogModel catalog, java.util.Collection<CatalogModel> sessionCatalogs)
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
protected CatalogVersionService getCatalogVersionService()
-
setCxCatalogService
public void setCxCatalogService(CxCatalogService cxCatalogService)
-
getCxCatalogService
protected CxCatalogService getCxCatalogService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getMaxRecursions
protected int getMaxRecursions()
-
setMaxRecursions
public void setMaxRecursions(int maxRecursions)
-
-