Class DefaultCatalogLevelService
- java.lang.Object
-
- de.hybris.platform.cms2.multicountry.service.impl.DefaultCatalogLevelService
-
- All Implemented Interfaces:
CatalogLevelService
public class DefaultCatalogLevelService extends java.lang.Object implements CatalogLevelService
Default implementation of theCatalogLevelService
-
-
Constructor Summary
Constructors Constructor Description DefaultCatalogLevelService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<ContentCatalogModel>getAllSubCatalogs(ContentCatalogModel catalog)Finds all child catalogs associated to the given content catalogprotected java.util.Set<ContentCatalogModel>getAllSubCatalogs(java.util.Collection<ContentCatalogModel> contentCatalogs)Find all children catalogs for the given content catalogs (called recursively).java.util.Collection<ContentCatalogModel>getAllSuperCatalogs(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel)Find all super catalogs associated to the given content catalog.protected java.util.Set<ContentCatalogModel>getAllSuperCatalogs(java.util.Collection<ContentCatalogModel> contentCatalogs, java.util.List<ContentCatalogModel> siteCatalogs)Find all parent catalogs for the given content catalogs (called recursively)intgetCatalogLevel(ContentCatalogModel catalog)Determines the level of the given content catalog in the catalog hierarchyprotected CMSAdminSiteServicegetCmsAdminSiteService()protected java.util.Comparator<ContentSlotModel>getCmsItemCatalogLevelComparator()java.util.List<CatalogVersionModel>getLevelCatalogVersions(AbstractPageModel page, java.util.List<ContentCatalogModel> catalogs)Finds all catalog versions hierarchy related to a given page for a given list of catalogs.java.util.List<ContentSlotModel>getSortedMultiCountryContentSlots(java.util.List<ContentSlotModel> list)Orders the given content slots according to the catalog level where the slots are defined.booleanisBottomLevel(ContentCatalogModel catalog)Determines if the given content catalog is a leaf level catalogbooleanisIntermediateLevel(ContentCatalogModel catalog)Determines if the given content catalog is an intermediate level catalog, such that it has a parent and at least one child catalog associationsbooleanisTopLevel(ContentCatalogModel catalog)Determines if the given content catalog is a root level catalogvoidsetCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)voidsetCmsItemCatalogLevelComparator(java.util.Comparator<ContentSlotModel> cmsItemCatalogLevelComparator)
-
-
-
Method Detail
-
isTopLevel
public boolean isTopLevel(ContentCatalogModel catalog)
Description copied from interface:CatalogLevelServiceDetermines if the given content catalog is a root level catalog- Specified by:
isTopLevelin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog to be evaluated- Returns:
- TRUE if the given content catalog is a root level catalog; FALSE otherwise
-
isBottomLevel
public boolean isBottomLevel(ContentCatalogModel catalog)
Description copied from interface:CatalogLevelServiceDetermines if the given content catalog is a leaf level catalog- Specified by:
isBottomLevelin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog to be evaluated- Returns:
- TRUE if the given content catalog is a leaf level catalog; FALSE otherwise
-
isIntermediateLevel
public boolean isIntermediateLevel(ContentCatalogModel catalog)
Description copied from interface:CatalogLevelServiceDetermines if the given content catalog is an intermediate level catalog, such that it has a parent and at least one child catalog associations- Specified by:
isIntermediateLevelin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog to be evaluated- Returns:
- TRUE if the given content catalog is a intermediate level catalog; FALSE otherwise
-
getCatalogLevel
public int getCatalogLevel(ContentCatalogModel catalog)
Description copied from interface:CatalogLevelServiceDetermines the level of the given content catalog in the catalog hierarchy- Specified by:
getCatalogLevelin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog to be evaluated- Returns:
- the catalog level in the catalog hierarchy
-
getAllSuperCatalogs
protected java.util.Set<ContentCatalogModel> getAllSuperCatalogs(java.util.Collection<ContentCatalogModel> contentCatalogs, java.util.List<ContentCatalogModel> siteCatalogs)
Find all parent catalogs for the given content catalogs (called recursively)- Parameters:
contentCatalogs- - the content catalogs which parent catalogs should be foundsiteCatalogs- - the catalogs of a site which are used for searching- Returns:
- all parent catalogs
-
getAllSuperCatalogs
public java.util.Collection<ContentCatalogModel> getAllSuperCatalogs(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel)
Description copied from interface:CatalogLevelServiceFind all super catalogs associated to the given content catalog. All catalogs belong to the active site.- Specified by:
getAllSuperCatalogsin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog to be evaluatedcmsSiteModel- - the site model- Returns:
- a list of all super catalogs associated to the given catalog; never NULL
-
getAllSubCatalogs
protected java.util.Set<ContentCatalogModel> getAllSubCatalogs(java.util.Collection<ContentCatalogModel> contentCatalogs)
Find all children catalogs for the given content catalogs (called recursively).- Parameters:
contentCatalogs- - the content catalogs which children catalogs should be found- Returns:
- all children catalogs
-
getAllSubCatalogs
public java.util.Collection<ContentCatalogModel> getAllSubCatalogs(ContentCatalogModel catalog)
Description copied from interface:CatalogLevelServiceFinds all child catalogs associated to the given content catalog- Specified by:
getAllSubCatalogsin interfaceCatalogLevelService- Parameters:
catalog- - the content catalog- Returns:
- a list of all child content catalogs associated to the given catalog; never NULL
-
getSortedMultiCountryContentSlots
public java.util.List<ContentSlotModel> getSortedMultiCountryContentSlots(java.util.List<ContentSlotModel> list)
Description copied from interface:CatalogLevelServiceOrders the given content slots according to the catalog level where the slots are defined. This uses theCMSItemCatalogLevelComparatorto determine the ordering.- Specified by:
getSortedMultiCountryContentSlotsin interfaceCatalogLevelService- Parameters:
list- - the content slots to be sorted- Returns:
- a sorted list of content slots
-
getLevelCatalogVersions
public java.util.List<CatalogVersionModel> getLevelCatalogVersions(AbstractPageModel page, java.util.List<ContentCatalogModel> catalogs)
Description copied from interface:CatalogLevelServiceFinds all catalog versions hierarchy related to a given page for a given list of catalogs. For example, if a page is localized and contains contents from the local and root catalogs, then the result will contain the online root catalog along with the staged version of the local catalog.- Specified by:
getLevelCatalogVersionsin interfaceCatalogLevelService- Parameters:
page- - the page to find the catalog versions hierarchycatalogs- - list of content catalogs in the catalog hierarchy- Returns:
- all catalog versions related to a given page
-
getCmsAdminSiteService
protected CMSAdminSiteService getCmsAdminSiteService()
-
setCmsAdminSiteService
public void setCmsAdminSiteService(CMSAdminSiteService cmsAdminSiteService)
-
getCmsItemCatalogLevelComparator
protected java.util.Comparator<ContentSlotModel> getCmsItemCatalogLevelComparator()
-
setCmsItemCatalogLevelComparator
public void setCmsItemCatalogLevelComparator(java.util.Comparator<ContentSlotModel> cmsItemCatalogLevelComparator)
-
-