Class DefaultBundleCommerceCartFacade
- java.lang.Object
-
- de.hybris.platform.configurablebundlefacades.order.impl.DefaultBundleCommerceCartFacade
-
- All Implemented Interfaces:
BundleCartFacade
public class DefaultBundleCommerceCartFacade extends java.lang.Object implements BundleCartFacade
Default implementation ofBundleCartFacade- Since:
- 6.4
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringFACET_SEPARATORprotected static java.lang.StringNOT_FOUND_IN_CART
-
Constructor Summary
Constructors Constructor Description DefaultBundleCommerceCartFacade()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CartModificationDataaddToCart(java.lang.String productCode, long quantity, int groupNumber)Add a product to an existing bundle.protected voidapplyDisableRules(ProductData productData, EntryGroup currentEntryGroup)protected EntryGroupcreateBundleStructure(AbstractOrderEntryModel entry, BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1905protected SearchStateDatacreateSearchStateWithBundleComponentFilter(java.lang.String searchQuery, java.lang.String componentId)protected ProductSearchPageData<SearchStateData,ProductData>encodeSearchPageData(java.lang.String urlPrefix, ProductSearchPageData<SearchStateData,ProductData> searchPageData)protected java.lang.StringencodeURL(java.lang.String url)protected voidenrichProductData(java.util.List<ProductData> searchResult, EntryGroup currentEntryGroup)Populate some extra fields of product DTO restored from solr documents.ProductSearchPageData<SearchStateData,ProductData>getAllowedProducts(java.lang.Integer groupNumber, java.lang.String searchQuery, PageableData pageableData)Constructs pageable list of products available for entry group of typeGroupType.CONFIGURABLEBUNDLEprotected BundleRuleServicegetBundleRuleService()protected BundleTemplateServicegetBundleTemplateService()protected Converter<CommerceCartModification,CartModificationData>getCartModificationConverter()protected CartServicegetCartService()protected CommerceCartServicegetCommerceCartService()protected java.lang.IntegergetEntryGroupNumber(AbstractOrderModel cartModel, int bundleNo, java.lang.String bundleTemplateId)Deprecated, for removal: This API element is subject to removal in a future version.since 1905protected EntryGroupServicegetEntryGroupService()protected ModelServicegetModelService()protected ProductSearchFacade<ProductData>getProductSearchFacade()protected ProductServicegetProductService()protected voidpatchURLs(java.lang.String urlPrefix, ProductSearchPageData<SearchStateData,ProductData> searchPageData)protected voidprocessFacetData(java.util.List<FacetData<SearchStateData>> facets)protected voidprocessFacetDatas(java.util.List<FacetValueData<SearchStateData>> facetValueDatas)protected voidremoveEntriesByGroupNumber(CartModel cart, java.lang.Integer entryGroupNumber)voidsetBundleRuleService(BundleRuleService bundleRuleService)voidsetBundleTemplateService(BundleTemplateService bundleTemplateService)voidsetCartModificationConverter(Converter<CommerceCartModification,CartModificationData> cartModificationConverter)voidsetCartService(CartService cartService)voidsetCommerceCartService(CommerceCartService commerceCartService)protected voidsetEntryGroupNumber(java.util.Map<java.lang.String,java.lang.Integer> groupsByTemplateId, AbstractOrderEntryModel entry, BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1905voidsetEntryGroupService(EntryGroupService entryGroupService)voidsetModelService(ModelService modelService)voidsetProductSearchFacade(ProductSearchFacade<ProductData> productSearchFacade)voidsetProductService(ProductService productService)CartModificationDatastartBundle(java.lang.String bundleTemplateId, java.lang.String productCode, long quantity)Start new bundle in cart based on the given bundle template and add the product to it.
-
-
-
Field Detail
-
FACET_SEPARATOR
protected static final java.lang.String FACET_SEPARATOR
- See Also:
- Constant Field Values
-
NOT_FOUND_IN_CART
protected static final java.lang.String NOT_FOUND_IN_CART
- See Also:
- Constant Field Values
-
-
Method Detail
-
startBundle
public CartModificationData startBundle(@Nonnull java.lang.String bundleTemplateId, @Nonnull java.lang.String productCode, long quantity) throws CommerceCartModificationException
Description copied from interface:BundleCartFacadeStart new bundle in cart based on the given bundle template and add the product to it.- Specified by:
startBundlein interfaceBundleCartFacade- Parameters:
bundleTemplateId- a component to add the product to. He whole bundle structure - starting from the root of the component - will be added to cart groupsproductCode- a product which will be added to the componentquantity- quantity for the product. Is limited by selection criteria of the component- Returns:
- information about the new cart entry
- Throws:
CommerceCartModificationException- if the operation is not possible- See Also:
EntryGroup,BundleSelectionCriteria
-
addToCart
public CartModificationData addToCart(@Nonnull java.lang.String productCode, long quantity, int groupNumber) throws CommerceCartModificationException
Description copied from interface:BundleCartFacadeAdd a product to an existing bundle.- Specified by:
addToCartin interfaceBundleCartFacade- Parameters:
productCode- product to addquantity- quantity of the productgroupNumber- entry group number, that defines the bundle and the component within the bundle- Returns:
- information about the new cart entry
- Throws:
CommerceCartModificationException- if the operation is not possible- See Also:
EntryGroup
-
getAllowedProducts
@Nonnull public ProductSearchPageData<SearchStateData,ProductData> getAllowedProducts(@Nonnull java.lang.Integer groupNumber, java.lang.String searchQuery, @Nonnull PageableData pageableData)
Description copied from interface:BundleCartFacadeConstructs pageable list of products available for entry group of typeGroupType.CONFIGURABLEBUNDLE- Specified by:
getAllowedProductsin interfaceBundleCartFacade- Parameters:
groupNumber- entry group number related to the componentsearchQuery- the search querypageableData- the page to return- Returns:
- the search results
-
enrichProductData
protected void enrichProductData(java.util.List<ProductData> searchResult, EntryGroup currentEntryGroup)
Populate some extra fields of product DTO restored from solr documents.- Parameters:
searchResult- products that could be added to a componentcurrentEntryGroup- bundle component the products are being selected for
-
applyDisableRules
protected void applyDisableRules(ProductData productData, EntryGroup currentEntryGroup)
-
getEntryGroupNumber
@Deprecated(since="1905", forRemoval=true) protected java.lang.Integer getEntryGroupNumber(@Nonnull AbstractOrderModel cartModel, int bundleNo, java.lang.String bundleTemplateId) throws CommerceCartModificationExceptionDeprecated, for removal: This API element is subject to removal in a future version.since 1905
-
createBundleStructure
@Deprecated(since="1905", forRemoval=true) protected EntryGroup createBundleStructure(AbstractOrderEntryModel entry, BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
setEntryGroupNumber
@Deprecated(since="1905", forRemoval=true) protected void setEntryGroupNumber(java.util.Map<java.lang.String,java.lang.Integer> groupsByTemplateId, AbstractOrderEntryModel entry, BundleTemplateModel bundleTemplate)Deprecated, for removal: This API element is subject to removal in a future version.since 1905
-
removeEntriesByGroupNumber
protected void removeEntriesByGroupNumber(@Nonnull CartModel cart, @Nonnull java.lang.Integer entryGroupNumber) throws CommerceCartModificationException
-
createSearchStateWithBundleComponentFilter
protected SearchStateData createSearchStateWithBundleComponentFilter(java.lang.String searchQuery, java.lang.String componentId)
-
encodeSearchPageData
protected ProductSearchPageData<SearchStateData,ProductData> encodeSearchPageData(java.lang.String urlPrefix, ProductSearchPageData<SearchStateData,ProductData> searchPageData)
-
patchURLs
protected void patchURLs(java.lang.String urlPrefix, ProductSearchPageData<SearchStateData,ProductData> searchPageData)
-
encodeURL
protected java.lang.String encodeURL(java.lang.String url)
-
processFacetData
protected void processFacetData(java.util.List<FacetData<SearchStateData>> facets) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
processFacetDatas
protected void processFacetDatas(java.util.List<FacetValueData<SearchStateData>> facetValueDatas) throws java.io.UnsupportedEncodingException
- Throws:
java.io.UnsupportedEncodingException
-
getBundleTemplateService
protected BundleTemplateService getBundleTemplateService()
-
setBundleTemplateService
public void setBundleTemplateService(BundleTemplateService bundleTemplateService)
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getProductService
protected ProductService getProductService()
-
setProductService
public void setProductService(ProductService productService)
-
getCartModificationConverter
protected Converter<CommerceCartModification,CartModificationData> getCartModificationConverter()
-
setCartModificationConverter
public void setCartModificationConverter(Converter<CommerceCartModification,CartModificationData> cartModificationConverter)
-
getEntryGroupService
protected EntryGroupService getEntryGroupService()
-
setEntryGroupService
public void setEntryGroupService(EntryGroupService entryGroupService)
-
getCommerceCartService
protected CommerceCartService getCommerceCartService()
-
setCommerceCartService
public void setCommerceCartService(CommerceCartService commerceCartService)
-
getProductSearchFacade
protected ProductSearchFacade<ProductData> getProductSearchFacade()
-
setProductSearchFacade
public void setProductSearchFacade(ProductSearchFacade<ProductData> productSearchFacade)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getBundleRuleService
protected BundleRuleService getBundleRuleService()
-
setBundleRuleService
public void setBundleRuleService(BundleRuleService bundleRuleService)
-
-