Class DefaultCMSCatalogVersionService
java.lang.Object
de.hybris.platform.cms2.catalogversion.service.impl.DefaultCMSCatalogVersionService
- All Implemented Interfaces:
CMSCatalogVersionService
Default implementation of
CMSCatalogVersionService-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareCatalogVersionsRelatives(Collection<CatalogVersionModel> catalogVersionModels) To check all content catalogs in catalogVersionModels are relatives.protected BaseSiteServiceprotected CatalogLevelServiceprotected Map<CatalogModel,Set<CatalogVersionModel>> getCatalogsAndVersions(boolean canRead, boolean canWrite, Predicate<Map.Entry<CatalogModel, Set<CatalogVersionModel>>> catalogTypePredicate) Returns all catalogs and catalog versions which the current user has READ and/or WRITE permission for.protected CatalogVersionServiceprotected CatalogLevelServiceprotected Comparator<CatalogVersionModel>getContentCatalogsAndVersions(boolean canRead, boolean canWrite, CMSSiteModel cmsSiteModel) Returns all content catalogs and catalog versions which the current user has READ and/or WRITE permission for.getFullHierarchyForCatalogVersion(CatalogVersionModel catalogVersion, CMSSiteModel cmsSiteModel) Returns a sorted list of catalog versions based on the site's catalogs hierarchy.getIntersectionOfCatalogVersions(Collection<CatalogVersionModel> catalogVersionModelsA, Collection<CatalogVersionModel> catalogVersionModelsB) Get intersection of two catalogVersionModelsgetProductCatalogsAndVersions(boolean canRead, boolean canWrite, BaseSiteModel baseSiteModel) Returns all product catalogs and catalog versions which the current user has READ and/or WRITE permission for.protected SessionSearchRestrictionsDisablerReturns all catalog versions for all subcatalogs of the provided catalog.getSubCatalogsCatalogVersionsInSite(CMSSiteModel site, ContentCatalogModel catalog) Returns all catalog versions for all subcatalogs of the provided catalog in Site.getSuperCatalogsActiveCatalogVersions(ContentCatalogModel contentCatalog, CMSSiteModel cmsSiteModel) Returns all active catalog versions from all available super catalogs.getSuperCatalogsCatalogVersions(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel) Returns all catalog versions for all supercatalogs of the provided catalog.protected UserServicegetWritableChildContentCatalogVersions(PrincipalModel principal, CMSSiteModel cmsSiteModel, CatalogModel catalogModel) Returns child content catalog versions for a catalog to which the principal has a write access.getWritableContentCatalogVersions(PrincipalModel principal, CatalogModel catalogModel) Returns content catalog versions for a catalog to which the principal has a write access.booleanisContentCatalogModelAncestor(ContentCatalogModel catalogModel, ContentCatalogModel ancestor) To check ContentCatalogModel's ancestor is ancestorvoidsetBaseSiteService(BaseSiteService baseSiteService) voidsetCatalogLevelService(CatalogLevelService catalogLevelService) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCmsCatalogLevelService(CatalogLevelService cmsCatalogLevelService) voidsetCmsCatalogVersionLevelComparator(Comparator<CatalogVersionModel> cmsCatalogVersionLevelComparator) voidsetSessionSearchRestrictionDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionDisabler) voidsetUserService(UserService userService)
-
Constructor Details
-
DefaultCMSCatalogVersionService
public DefaultCMSCatalogVersionService()
-
-
Method Details
-
getContentCatalogsAndVersions
public Map<CatalogModel,Set<CatalogVersionModel>> getContentCatalogsAndVersions(boolean canRead, boolean canWrite, CMSSiteModel cmsSiteModel) Description copied from interface:CMSCatalogVersionServiceReturns all content catalogs and catalog versions which the current user has READ and/or WRITE permission for. It only returns catalogs that contain at-least a non active version for which we have the required permissions. An active catalog version is always considered readable.- Specified by:
getContentCatalogsAndVersionsin interfaceCMSCatalogVersionService- Parameters:
canRead- includes all catalog versions for which the user has read access when set totruecanWrite- includes all catalog versions for which the user has write access when set tofalsecmsSiteModel- model containing the content catalogs defined for the site- Returns:
- all catalogs and catalog versions permitted to the current user
-
getProductCatalogsAndVersions
public Map<CatalogModel,Set<CatalogVersionModel>> getProductCatalogsAndVersions(boolean canRead, boolean canWrite, BaseSiteModel baseSiteModel) Description copied from interface:CMSCatalogVersionServiceReturns all product catalogs and catalog versions which the current user has READ and/or WRITE permission for.- Specified by:
getProductCatalogsAndVersionsin interfaceCMSCatalogVersionService- Parameters:
canRead- includes all catalog versions for which the user has read access when set totruecanWrite- includes all catalog versions for which the user has write access when set tofalsebaseSiteModel- model containing the product catalogs defined for the site- Returns:
- all catalogs and catalog versions permitted to the current user
-
getCatalogsAndVersions
protected Map<CatalogModel,Set<CatalogVersionModel>> getCatalogsAndVersions(boolean canRead, boolean canWrite, Predicate<Map.Entry<CatalogModel, Set<CatalogVersionModel>>> catalogTypePredicate) Returns all catalogs and catalog versions which the current user has READ and/or WRITE permission for. The result contains all types of catalogs, which includes content catalogs and product catalogs. An active catalog version is always considered readable.- Parameters:
canRead- includes all catalog versions for which the user has read access are active when set totruecanWrite- includes all catalog versions for which the user has write access when set tofalsecatalogTypePredicate- determines which type of catalogs should be returned in the result set: content or product catalogs- Returns:
- all catalogs and catalog versions permitted to the current user
-
getWritableChildContentCatalogVersions
public List<CatalogVersionModel> getWritableChildContentCatalogVersions(PrincipalModel principal, CMSSiteModel cmsSiteModel, CatalogModel catalogModel) Description copied from interface:CMSCatalogVersionServiceReturns child content catalog versions for a catalog to which the principal has a write access.- Specified by:
getWritableChildContentCatalogVersionsin interfaceCMSCatalogVersionService- Parameters:
principal- user modelcmsSiteModel- site modelcatalogModel- catalog model- Returns:
- child content catalog versions
-
getWritableContentCatalogVersions
public List<CatalogVersionModel> getWritableContentCatalogVersions(PrincipalModel principal, CatalogModel catalogModel) Description copied from interface:CMSCatalogVersionServiceReturns content catalog versions for a catalog to which the principal has a write access.- Specified by:
getWritableContentCatalogVersionsin interfaceCMSCatalogVersionService- Parameters:
principal- user modelcatalogModel- catalog model- Returns:
- content catalog versions for catalog
-
getSubCatalogsCatalogVersions
Description copied from interface:CMSCatalogVersionServiceReturns all catalog versions for all subcatalogs of the provided catalog.- Specified by:
getSubCatalogsCatalogVersionsin interfaceCMSCatalogVersionService- Parameters:
catalog- - catalog model- Returns:
- all catalog versions for all subcatalogs
-
getSubCatalogsCatalogVersionsInSite
public List<CatalogVersionModel> getSubCatalogsCatalogVersionsInSite(CMSSiteModel site, ContentCatalogModel catalog) Description copied from interface:CMSCatalogVersionServiceReturns all catalog versions for all subcatalogs of the provided catalog in Site.- Specified by:
getSubCatalogsCatalogVersionsInSitein interfaceCMSCatalogVersionServicecatalog- - catalog model- Returns:
- all catalog versions for all subcatalogs
-
getSuperCatalogsCatalogVersions
public List<CatalogVersionModel> getSuperCatalogsCatalogVersions(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel) Description copied from interface:CMSCatalogVersionServiceReturns all catalog versions for all supercatalogs of the provided catalog.- Specified by:
getSuperCatalogsCatalogVersionsin interfaceCMSCatalogVersionService- Parameters:
catalog- - catalog modelcmsSiteModel- - site model- Returns:
- all catalog versions for all supercatalogs.
-
getSuperCatalogsActiveCatalogVersions
public List<CatalogVersionModel> getSuperCatalogsActiveCatalogVersions(ContentCatalogModel contentCatalog, CMSSiteModel cmsSiteModel) Description copied from interface:CMSCatalogVersionServiceReturns all active catalog versions from all available super catalogs.- Specified by:
getSuperCatalogsActiveCatalogVersionsin interfaceCMSCatalogVersionService- Parameters:
contentCatalog- - content catalog modelcmsSiteModel- - site model- Returns:
- all active catalog versions for all super catalogs
-
getFullHierarchyForCatalogVersion
public List<CatalogVersionModel> getFullHierarchyForCatalogVersion(CatalogVersionModel catalogVersion, CMSSiteModel cmsSiteModel) Description copied from interface:CMSCatalogVersionServiceReturns a sorted list of catalog versions based on the site's catalogs hierarchy. The first element in the list is the catalog version from the top catalog level. The last element in the list is the provided catalog version.- Specified by:
getFullHierarchyForCatalogVersionin interfaceCMSCatalogVersionService- Parameters:
catalogVersion- - catalog version model. This could be an active or non-active catalog version (Staged or Online)cmsSiteModel- - site model- Returns:
- a sorted list of catalog versions
-
areCatalogVersionsRelatives
Description copied from interface:CMSCatalogVersionServiceTo check all content catalogs in catalogVersionModels are relatives.- Specified by:
areCatalogVersionsRelativesin interfaceCMSCatalogVersionService- Returns:
- boolean
-
isContentCatalogModelAncestor
public boolean isContentCatalogModelAncestor(ContentCatalogModel catalogModel, ContentCatalogModel ancestor) Description copied from interface:CMSCatalogVersionServiceTo check ContentCatalogModel's ancestor is ancestor- Specified by:
isContentCatalogModelAncestorin interfaceCMSCatalogVersionService- Returns:
- boolean
-
getIntersectionOfCatalogVersions
public Collection<CatalogVersionModel> getIntersectionOfCatalogVersions(Collection<CatalogVersionModel> catalogVersionModelsA, Collection<CatalogVersionModel> catalogVersionModelsB) Description copied from interface:CMSCatalogVersionServiceGet intersection of two catalogVersionModels- Specified by:
getIntersectionOfCatalogVersionsin interfaceCMSCatalogVersionService- Returns:
- boolean
-
getBaseSiteService
-
setBaseSiteService
-
getCatalogVersionService
-
setCatalogVersionService
-
getUserService
-
setUserService
-
getCatalogLevelService
-
setCatalogLevelService
-
getSessionSearchRestrictionDisabler
-
setSessionSearchRestrictionDisabler
public void setSessionSearchRestrictionDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionDisabler) -
getCmsCatalogVersionLevelComparator
-
setCmsCatalogVersionLevelComparator
public void setCmsCatalogVersionLevelComparator(Comparator<CatalogVersionModel> cmsCatalogVersionLevelComparator) -
getCmsCatalogLevelService
-
setCmsCatalogLevelService
-