Class DefaultProductCarouselFacade
- java.lang.Object
-
- de.hybris.platform.acceleratorfacades.productcarousel.impl.DefaultProductCarouselFacade
-
- All Implemented Interfaces:
ProductCarouselFacade
public class DefaultProductCarouselFacade extends java.lang.Object implements ProductCarouselFacade
Facade to fetch list of products for a given product carousel component.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.List<ProductOption>
PRODUCT_OPTIONS
-
Constructor Summary
Constructors Constructor Description DefaultProductCarouselFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ProductData>
collectProducts(ProductCarouselComponentModel component)
Fetch list of products to be displayed for a given product carousel component.protected java.util.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).protected java.util.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).protected CMSPreviewService
getCmsPreviewService()
protected java.util.List<ProductModel>
getDisplayableProductsForCategory(CategoryModel component)
If in versioning preview then returns the products from the providedCategoryModel
else returns the full list of products without the session catalog version filtering out the ones from different versions.protected java.util.List<ProductModel>
getDisplayableProductsForProductCarousel(ProductCarouselComponentModel component)
If in versioning preview then returns the products from the providedProductCarouselComponentModel
else returns the full list of products without the session catalog version filtering out the ones from different versions.protected java.util.List<CategoryModel>
getListOfCategoriesForProductCarousel(ProductCarouselComponentModel component)
If in versioning preview then returns the categories from the providedCategoryModel
else returns the full list of categories without the session catalog version filtering out the ones from different versions.protected ModelService
getModelService()
protected ProductCarouselRendererService
getProductCarouselRendererService()
protected ConfigurablePopulator<ProductModel,ProductData,ProductOption>
getProductConfiguredPopulator()
protected Converter<ProductModel,ProductData>
getProductConverter()
protected ProductFacade
getProductFacade()
protected ProductData
getProductForOptions(ProductModel productModel, java.util.Collection<ProductOption> options)
Convert from productModel to productDataprotected SearchRestrictionService
getSearchRestrictionService()
protected SessionService
getSessionService()
protected boolean
isPreview()
Checks 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.void
setCmsPreviewService(CMSPreviewService cmsPreviewService)
void
setModelService(ModelService modelService)
void
setProductCarouselRendererService(ProductCarouselRendererService productCarouselRendererService)
void
setProductConfiguredPopulator(ConfigurablePopulator<ProductModel,ProductData,ProductOption> productConfiguredPopulator)
void
setProductConverter(Converter<ProductModel,ProductData> productConverter)
void
setProductFacade(ProductFacade productFacade)
void
setSearchRestrictionService(SearchRestrictionService searchRestrictionService)
void
setSessionService(SessionService sessionService)
-
-
-
Field Detail
-
PRODUCT_OPTIONS
protected static final java.util.List<ProductOption> PRODUCT_OPTIONS
-
-
Method Detail
-
collectProducts
public java.util.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 interfaceProductCarouselFacade
- Parameters:
component
- the product carousel component model- Returns:
- a list of
ProductModel
for the catalog versions in session
-
fetchProductsForNonPreviewMode
protected java.util.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 java.util.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, java.util.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 java.util.List<ProductModel> getDisplayableProductsForProductCarousel(ProductCarouselComponentModel component)
If in versioning preview then returns the products from the providedProductCarouselComponentModel
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 java.util.List<CategoryModel> getListOfCategoriesForProductCarousel(ProductCarouselComponentModel component)
If in versioning preview then returns the categories from the providedCategoryModel
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 java.util.List<ProductModel> getDisplayableProductsForCategory(CategoryModel component)
If in versioning preview then returns the products from the providedCategoryModel
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)
-
-