Interface CMSCatalogVersionService

All Known Implementing Classes:
DefaultCMSCatalogVersionService

public interface CMSCatalogVersionService
Service to retrieve catalog version information
  • Method Details

    • getContentCatalogsAndVersions

      Map<CatalogModel,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. 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.
      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

      Map<CatalogModel,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.
      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
    • getWritableChildContentCatalogVersions

      List<CatalogVersionModel> getWritableChildContentCatalogVersions(PrincipalModel principal, CMSSiteModel siteModel, CatalogModel catalogModel)
      Returns child content catalog versions for a catalog to which the principal has a write access.
      Parameters:
      principal - user model
      siteModel - site model
      catalogModel - catalog model
      Returns:
      child content catalog versions
    • getWritableContentCatalogVersions

      List<CatalogVersionModel> getWritableContentCatalogVersions(PrincipalModel principal, CatalogModel catalogModel)
      Returns content catalog versions for a catalog to which the principal has a write access.
      Parameters:
      principal - user model
      catalogModel - catalog model
      Returns:
      content catalog versions for catalog
    • getSubCatalogsCatalogVersions

      List<CatalogVersionModel> getSubCatalogsCatalogVersions(ContentCatalogModel catalog)
      Returns all catalog versions for all subcatalogs of the provided catalog.
      Parameters:
      catalog - - catalog model
      Returns:
      all catalog versions for all subcatalogs
    • getSuperCatalogsCatalogVersions

      List<CatalogVersionModel> getSuperCatalogsCatalogVersions(ContentCatalogModel catalog, CMSSiteModel cmsSiteModel)
      Returns all catalog versions for all supercatalogs of the provided catalog.
      Parameters:
      catalog - - catalog model
      cmsSiteModel - - site model
      Returns:
      all catalog versions for all supercatalogs.
    • getSuperCatalogsActiveCatalogVersions

      List<CatalogVersionModel> getSuperCatalogsActiveCatalogVersions(ContentCatalogModel contentCatalog, CMSSiteModel cmsSiteModel)
      Returns all active catalog versions from all available super catalogs.
      Parameters:
      contentCatalog - - content catalog model
      cmsSiteModel - - site model
      Returns:
      all active catalog versions for all super catalogs
    • getFullHierarchyForCatalogVersion

      List<CatalogVersionModel> getFullHierarchyForCatalogVersion(CatalogVersionModel catalogVersion, CMSSiteModel cmsSiteModel)
      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.
      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
    • isContentCatalogModelAncestor

      default boolean isContentCatalogModelAncestor(ContentCatalogModel catalogModel, ContentCatalogModel ancestor)
      To check ContentCatalogModel's ancestor is ancestor
      Returns:
      boolean
    • areCatalogVersionsRelatives

      default boolean areCatalogVersionsRelatives(Collection<CatalogVersionModel> catalogVersionModels)
      To check all content catalogs in catalogVersionModels are relatives.
      Returns:
      boolean
    • getIntersectionOfCatalogVersions

      default Collection<CatalogVersionModel> getIntersectionOfCatalogVersions(Collection<CatalogVersionModel> catalogVersionModelsA, Collection<CatalogVersionModel> catalogVersionModelsB)
      Get intersection of two catalogVersionModels
      Returns:
      boolean
    • getSubCatalogsCatalogVersionsInSite

      default List<CatalogVersionModel> getSubCatalogsCatalogVersionsInSite(CMSSiteModel site, ContentCatalogModel catalog)
      Returns all catalog versions for all subcatalogs of the provided catalog in Site.
      Parameters:
      catalog - - catalog model
      Returns:
      all catalog versions for all subcatalogs