Class DefaultCMSCatalogVersionService
- java.lang.Object
-
- de.hybris.platform.cms2.catalogversion.service.impl.DefaultCMSCatalogVersionService
-
- All Implemented Interfaces:
CMSCatalogVersionService
public class DefaultCMSCatalogVersionService extends java.lang.Object implements CMSCatalogVersionService
Default implementation ofCMSCatalogVersionService
-
-
Constructor Summary
Constructors Constructor Description DefaultCMSCatalogVersionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BaseSiteService
getBaseSiteService()
protected CatalogLevelService
getCatalogLevelService()
protected java.util.Map<CatalogModel,java.util.Set<CatalogVersionModel>>
getCatalogsAndVersions(boolean canRead, boolean canWrite, java.util.function.Predicate<java.util.Map.Entry<CatalogModel,java.util.Set<CatalogVersionModel>>> catalogTypePredicate)
Returns all catalogs and catalog versions which the current user has READ and/or WRITE permission for.protected CatalogVersionService
getCatalogVersionService()
java.util.Map<CatalogModel,java.util.Set<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.java.util.List<CatalogVersionModel>
getFullHierarchyForCatalogVersion(CatalogVersionModel catalogVersion, CMSSiteModel cmsSiteModel)
Returns a sorted list of catalog versions based on the site's catalogs hierarchy.java.util.Map<CatalogModel,java.util.Set<CatalogVersionModel>>
getProductCatalogsAndVersions(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 SessionSearchRestrictionsDisabler
getSessionSearchRestrictionDisabler()
java.util.List<CatalogVersionModel>
getSubCatalogsCatalogVersions(ContentCatalogModel catalog)
Returns all catalog versions for all subcatalogs of the provided catalog.java.util.List<CatalogVersionModel>
getSuperCatalogsActiveCatalogVersions(ContentCatalogModel contentCatalog, CMSSiteModel cmsSiteModel)
Returns all active catalog versions from all available super catalogs.java.util.List<CatalogVersionModel>
getSuperCatalogsCatalogVersions(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel)
Returns all catalog versions for all supercatalogs of the provided catalog.protected UserService
getUserService()
java.util.List<CatalogVersionModel>
getWritableChildContentCatalogVersions(PrincipalModel principal, CMSSiteModel cmsSiteModel, CatalogModel catalogModel)
Returns child content catalog versions for a catalog to which the principal has a write access.java.util.List<CatalogVersionModel>
getWritableContentCatalogVersions(PrincipalModel principal, CatalogModel catalogModel)
Returns content catalog versions for a catalog to which the principal has a write access.void
setBaseSiteService(BaseSiteService baseSiteService)
void
setCatalogLevelService(CatalogLevelService catalogLevelService)
void
setCatalogVersionService(CatalogVersionService catalogVersionService)
void
setSessionSearchRestrictionDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionDisabler)
void
setUserService(UserService userService)
-
-
-
Method Detail
-
getContentCatalogsAndVersions
public java.util.Map<CatalogModel,java.util.Set<CatalogVersionModel>> getContentCatalogsAndVersions(boolean canRead, boolean canWrite, CMSSiteModel cmsSiteModel)
Description copied from interface:CMSCatalogVersionService
Returns 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:
getContentCatalogsAndVersions
in interfaceCMSCatalogVersionService
- Parameters:
canRead
- includes all catalog versions for which the user has read access when set totrue
canWrite
- includes all catalog versions for which the user has write access when set tofalse
cmsSiteModel
- model containing the content catalogs defined for the site- Returns:
- all catalogs and catalog versions permitted to the current user
-
getProductCatalogsAndVersions
public java.util.Map<CatalogModel,java.util.Set<CatalogVersionModel>> getProductCatalogsAndVersions(boolean canRead, boolean canWrite, BaseSiteModel baseSiteModel)
Description copied from interface:CMSCatalogVersionService
Returns all product catalogs and catalog versions which the current user has READ and/or WRITE permission for.- Specified by:
getProductCatalogsAndVersions
in interfaceCMSCatalogVersionService
- Parameters:
canRead
- includes all catalog versions for which the user has read access when set totrue
canWrite
- includes all catalog versions for which the user has write access when set tofalse
baseSiteModel
- model containing the product catalogs defined for the site- Returns:
- all catalogs and catalog versions permitted to the current user
-
getCatalogsAndVersions
protected java.util.Map<CatalogModel,java.util.Set<CatalogVersionModel>> getCatalogsAndVersions(boolean canRead, boolean canWrite, java.util.function.Predicate<java.util.Map.Entry<CatalogModel,java.util.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 totrue
canWrite
- includes all catalog versions for which the user has write access when set tofalse
catalogTypePredicate
- 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 java.util.List<CatalogVersionModel> getWritableChildContentCatalogVersions(PrincipalModel principal, CMSSiteModel cmsSiteModel, CatalogModel catalogModel)
Description copied from interface:CMSCatalogVersionService
Returns child content catalog versions for a catalog to which the principal has a write access.- Specified by:
getWritableChildContentCatalogVersions
in interfaceCMSCatalogVersionService
- Parameters:
principal
- user modelcmsSiteModel
- site modelcatalogModel
- catalog model- Returns:
- child content catalog versions
-
getWritableContentCatalogVersions
public java.util.List<CatalogVersionModel> getWritableContentCatalogVersions(PrincipalModel principal, CatalogModel catalogModel)
Description copied from interface:CMSCatalogVersionService
Returns content catalog versions for a catalog to which the principal has a write access.- Specified by:
getWritableContentCatalogVersions
in interfaceCMSCatalogVersionService
- Parameters:
principal
- user modelcatalogModel
- catalog model- Returns:
- content catalog versions for catalog
-
getSubCatalogsCatalogVersions
public java.util.List<CatalogVersionModel> getSubCatalogsCatalogVersions(ContentCatalogModel catalog)
Description copied from interface:CMSCatalogVersionService
Returns all catalog versions for all subcatalogs of the provided catalog.- Specified by:
getSubCatalogsCatalogVersions
in interfaceCMSCatalogVersionService
- Parameters:
catalog
- - catalog model- Returns:
- all catalog versions for all subcatalogs
-
getSuperCatalogsCatalogVersions
public java.util.List<CatalogVersionModel> getSuperCatalogsCatalogVersions(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel)
Description copied from interface:CMSCatalogVersionService
Returns all catalog versions for all supercatalogs of the provided catalog.- Specified by:
getSuperCatalogsCatalogVersions
in interfaceCMSCatalogVersionService
- Parameters:
catalog
- - catalog modelcmsSiteModel
- - site model- Returns:
- all catalog versions for all supercatalogs.
-
getSuperCatalogsActiveCatalogVersions
public java.util.List<CatalogVersionModel> getSuperCatalogsActiveCatalogVersions(ContentCatalogModel contentCatalog, CMSSiteModel cmsSiteModel)
Description copied from interface:CMSCatalogVersionService
Returns all active catalog versions from all available super catalogs.- Specified by:
getSuperCatalogsActiveCatalogVersions
in interfaceCMSCatalogVersionService
- Parameters:
contentCatalog
- - content catalog modelcmsSiteModel
- - site model- Returns:
- all active catalog versions for all super catalogs
-
getFullHierarchyForCatalogVersion
public java.util.List<CatalogVersionModel> getFullHierarchyForCatalogVersion(CatalogVersionModel catalogVersion, CMSSiteModel cmsSiteModel)
Description copied from interface:CMSCatalogVersionService
Returns 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:
getFullHierarchyForCatalogVersion
in 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
-
getBaseSiteService
protected BaseSiteService getBaseSiteService()
-
setBaseSiteService
public void setBaseSiteService(BaseSiteService baseSiteService)
-
getCatalogVersionService
protected CatalogVersionService getCatalogVersionService()
-
setCatalogVersionService
public void setCatalogVersionService(CatalogVersionService catalogVersionService)
-
getUserService
protected UserService getUserService()
-
setUserService
public void setUserService(UserService userService)
-
getCatalogLevelService
protected CatalogLevelService getCatalogLevelService()
-
setCatalogLevelService
public void setCatalogLevelService(CatalogLevelService catalogLevelService)
-
getSessionSearchRestrictionDisabler
protected SessionSearchRestrictionsDisabler getSessionSearchRestrictionDisabler()
-
setSessionSearchRestrictionDisabler
public void setSessionSearchRestrictionDisabler(SessionSearchRestrictionsDisabler sessionSearchRestrictionDisabler)
-
-