Class DefaultCMSCatalogVersionService

    • Constructor Detail

      • DefaultCMSCatalogVersionService

        public DefaultCMSCatalogVersionService()
    • 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 interface CMSCatalogVersionService
        Parameters:
        canRead - includes all catalog versions for which the user has read access when set to true
        canWrite - includes all catalog versions for which the user has write access when set to false
        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 interface CMSCatalogVersionService
        Parameters:
        canRead - includes all catalog versions for which the user has read access when set to true
        canWrite - includes all catalog versions for which the user has write access when set to false
        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 to true
        canWrite - includes all catalog versions for which the user has write access when set to false
        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
      • 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 interface CMSCatalogVersionService
        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
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
      • setCatalogVersionService

        public void setCatalogVersionService​(CatalogVersionService catalogVersionService)
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)
      • setCatalogLevelService

        public void setCatalogLevelService​(CatalogLevelService catalogLevelService)