Class DefaultProductCarouselFacade
java.lang.Object
de.hybris.platform.acceleratorfacades.productcarousel.impl.DefaultProductCarouselFacade
- All Implemented Interfaces:
ProductCarouselFacade
Facade to fetch list of products for a given product carousel component.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncollectProducts(ProductCarouselComponentModel component) Fetch list of products to be displayed for a given product carousel component.protected List<ProductData>Fetches list of products for a given product carousel component when not in preview (i.e., no cmsTicketId in present in the session).protected List<ProductData>Fetches list of products for a given product carousel component when in preview (i.e., cmsTicketId in present in the session).protected CMSPreviewServiceprotected List<ProductModel>getDisplayableProductsForCategory(CategoryModel component) If in versioning preview then returns the products from the providedCategoryModelelse returns the full list of products without the session catalog version filtering out the ones from different versions.protected List<ProductModel>If in versioning preview then returns the products from the providedProductCarouselComponentModelelse returns the full list of products without the session catalog version filtering out the ones from different versions.protected List<CategoryModel>If in versioning preview then returns the categories from the providedCategoryModelelse returns the full list of categories without the session catalog version filtering out the ones from different versions.protected ModelServiceprotected ProductCarouselRendererServiceprotected Converter<ProductModel,ProductData> protected ProductFacadeprotected ProductDatagetProductForOptions(ProductModel productModel, Collection<ProductOption> options) Convert from productModel to productDataprotected SearchRestrictionServiceprotected SessionServiceprotected booleanChecks if we are in preview mode by checking the presence of a cmsTicketId in session.protected <T extends ItemModel>
TrefreshComponent(T component) Returns the component based on the type of preview.voidsetCmsPreviewService(CMSPreviewService cmsPreviewService) voidsetModelService(ModelService modelService) voidsetProductCarouselRendererService(ProductCarouselRendererService productCarouselRendererService) voidsetProductConfiguredPopulator(ConfigurablePopulator<ProductModel, ProductData, ProductOption> productConfiguredPopulator) voidsetProductConverter(Converter<ProductModel, ProductData> productConverter) voidsetProductFacade(ProductFacade productFacade) voidsetSearchRestrictionService(SearchRestrictionService searchRestrictionService) voidsetSessionService(SessionService sessionService)
-
Field Details
-
PRODUCT_OPTIONS
-
-
Constructor Details
-
DefaultProductCarouselFacade
public DefaultProductCarouselFacade()
-
-
Method Details
-
collectProducts
Description copied from interface:ProductCarouselFacadeFetch list of products to be displayed for a given product carousel component.- Specified by:
collectProductsin interfaceProductCarouselFacade- Parameters:
component- the product carousel component model- Returns:
- a list of
ProductModelfor the catalog versions in session
-
fetchProductsForNonPreviewMode
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
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 modeloptions- 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 providedProductCarouselComponentModelelse 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 providedCategoryModelelse 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
If in versioning preview then returns the products from the providedCategoryModelelse 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
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
-
setProductFacade
-
getSessionService
-
setSessionService
-
getProductCarouselRendererService
-
setProductCarouselRendererService
public void setProductCarouselRendererService(ProductCarouselRendererService productCarouselRendererService) -
getSearchRestrictionService
-
setSearchRestrictionService
-
getModelService
-
setModelService
-
getProductConverter
-
setProductConverter
-
getProductConfiguredPopulator
protected ConfigurablePopulator<ProductModel,ProductData, getProductConfiguredPopulator()ProductOption> -
setProductConfiguredPopulator
public void setProductConfiguredPopulator(ConfigurablePopulator<ProductModel, ProductData, ProductOption> productConfiguredPopulator) -
getCmsPreviewService
-
setCmsPreviewService
-