Class DefaultProductCarouselFacade

java.lang.Object
de.hybris.platform.acceleratorfacades.productcarousel.impl.DefaultProductCarouselFacade
All Implemented Interfaces:
ProductCarouselFacade

public class DefaultProductCarouselFacade extends Object implements ProductCarouselFacade
Facade to fetch list of products for a given product carousel component.
  • Field Details

  • Constructor Details

    • DefaultProductCarouselFacade

      public DefaultProductCarouselFacade()
  • Method Details

    • collectProducts

      public List<ProductData> collectProducts(ProductCarouselComponentModel component)
      Description copied from interface: ProductCarouselFacade
      Fetch list of products to be displayed for a given product carousel component.
      Specified by:
      collectProducts in interface ProductCarouselFacade
      Parameters:
      component - the product carousel component model
      Returns:
      a list of ProductModel for the catalog versions in session
    • fetchProductsForNonPreviewMode

      protected List<ProductData> fetchProductsForNonPreviewMode(ProductCarouselComponentModel component)
      Fetches list of products for a given product carousel component when not in preview (i.e., no cmsTicketId in present in the session).
      Parameters:
      component - The product carousel component model
      Returns:
      List list of available products
    • fetchProductsForPreviewMode

      protected List<ProductData> fetchProductsForPreviewMode(ProductCarouselComponentModel component)
      Fetches list of products for a given product carousel component when in preview (i.e., cmsTicketId in present in the session).
      Parameters:
      component - The product carousel component model
      Returns:
      List list of available products
    • getProductForOptions

      protected ProductData getProductForOptions(ProductModel productModel, Collection<ProductOption> options)
      Convert from productModel to productData
      Parameters:
      productModel - The product model
      options - The product options
      Returns:
      productData The product data
    • isPreview

      protected boolean isPreview()
      Checks if we are in preview mode by checking the presence of a cmsTicketId in session.
      Returns:
      true if in preview mode
    • getDisplayableProductsForProductCarousel

      protected List<ProductModel> getDisplayableProductsForProductCarousel(ProductCarouselComponentModel component)
      If in versioning preview then returns the products from the provided ProductCarouselComponentModel else returns the full list of products without the session catalog version filtering out the ones from different versions. This is needed when the session catalog version is not the active version. This is possible through CMS tooling.
      Parameters:
      productCarouselComponentModel - the product carousel model
      Returns:
      a list of ProductModel
    • getListOfCategoriesForProductCarousel

      protected List<CategoryModel> getListOfCategoriesForProductCarousel(ProductCarouselComponentModel component)
      If in versioning preview then returns the categories from the provided CategoryModel else returns the full list of categories without the session catalog version filtering out the ones from different versions. This is needed when the session catalog version is not the active version. This is possible through CMS tooling
      Parameters:
      productCarouselComponentModel - the product carousel model
      Returns:
      a list of CategoryModel
    • getDisplayableProductsForCategory

      protected List<ProductModel> getDisplayableProductsForCategory(CategoryModel component)
      If in versioning preview then returns the products from the provided CategoryModel else returns the full list of products without the session catalog version filtering out the ones from different versions. This is needed when the session catalog version is not the active version. This is possible through CMS tooling
      Parameters:
      CategoryModel - the category model
      Returns:
      a list of ProductModel
    • refreshComponent

      protected <T extends ItemModel> T refreshComponent(T component)
      Returns the component based on the type of preview. If in versioning preview, returns the component as is, else returns component by re-fetching it again without the session catalog version.
      Parameters:
      component - the component
      Returns:
      the refreshed component
    • getProductFacade

      protected ProductFacade getProductFacade()
    • setProductFacade

      public void setProductFacade(ProductFacade productFacade)
    • getSessionService

      protected SessionService getSessionService()
    • setSessionService

      public void setSessionService(SessionService sessionService)
    • getProductCarouselRendererService

      protected ProductCarouselRendererService getProductCarouselRendererService()
    • setProductCarouselRendererService

      public void setProductCarouselRendererService(ProductCarouselRendererService productCarouselRendererService)
    • getSearchRestrictionService

      protected SearchRestrictionService getSearchRestrictionService()
    • setSearchRestrictionService

      public void setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
    • getModelService

      protected ModelService getModelService()
    • setModelService

      public void setModelService(ModelService modelService)
    • getProductConverter

      protected Converter<ProductModel,ProductData> getProductConverter()
    • setProductConverter

      public void setProductConverter(Converter<ProductModel,ProductData> productConverter)
    • getProductConfiguredPopulator

      protected ConfigurablePopulator<ProductModel,ProductData,ProductOption> getProductConfiguredPopulator()
    • setProductConfiguredPopulator

      public void setProductConfiguredPopulator(ConfigurablePopulator<ProductModel,ProductData,ProductOption> productConfiguredPopulator)
    • getCmsPreviewService

      protected CMSPreviewService getCmsPreviewService()
    • setCmsPreviewService

      public void setCmsPreviewService(CMSPreviewService cmsPreviewService)