Class ConfigurationCartIntegrationFacadeImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.facades.impl.ConfigurationBaseFacadeImpl
-
- de.hybris.platform.sap.productconfig.facades.impl.ConfigurationCartIntegrationFacadeImpl
-
- All Implemented Interfaces:
ConfigurationCartIntegrationFacade
public class ConfigurationCartIntegrationFacadeImpl extends ConfigurationBaseFacadeImpl implements ConfigurationCartIntegrationFacade
Default implementation ofConfigurationCartIntegrationFacade
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.sap.productconfig.facades.impl.ConfigurationBaseFacadeImpl
INTERNAL_CODE_ERP_VARIANT_PRODUCT
-
-
Constructor Summary
Constructors Constructor Description ConfigurationCartIntegrationFacadeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddConfigAttributesToCartEntry(AbstractOrderEntryModel entry)java.lang.StringaddConfigurationToCart(ConfigurationData configContent)Adds the current configuration to shopping cart.CartModificationDataaddProductConfigurationToCart(java.lang.String productCode, java.lang.Long quantity, java.lang.String configId)Adds the current configuration to shopping cart.ConfigurationDataconfigureCartItem(java.lang.String cartItemKey)Returns the runtime configuration for a configurable cart item.ConfigurationDataconfigureCartItemOnExistingDraft(java.lang.String cartEntryKey)Returns the runtime configuration for a configurable cart item, assuming that a configuration draft already exists! May returnnullin case the runtime configuration is not available (anymore).protected PKconvertStringToPK(java.lang.String pkString)Converts a string to the primary key wrapping itjava.lang.StringcopyConfiguration(java.lang.String configId, java.lang.String productCode)Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 - useConfigurationCopyStrategy.deepCopyConfiguration(String, String, String,boolean)insteadprotected AbstractOrderEntryModelcreateCartItem(ProductModel product, ConfigurationData configData, CommerceCartParameter commerceCartParameter, CartModel cart)ConfigurationDatadraftConfig(java.lang.String cartItemHandle, KBKeyData kbKey, java.lang.String configId, boolean copyRequired, java.lang.String extConfig)Creates a draft from the given external configuration for the associated cart itemprotected voidfillCommerceCartParameterForAddToCart(CommerceCartParameter parameter, CartModel cart, ProductModel product, long l, UnitModel unit, boolean forceNewEntry, java.lang.String configId)protected voidfillCommerceCartParameterForUpdate(CommerceCartParameter parameter, CartModel sessionCart, java.lang.String configId, java.lang.Long entryNumber)protected AbstractOrderEntryModelfindCartItemByPK(PK cartItemPk)AbstractOrderEntryModelfindItemInCartByPK(PK cartItemPk)Deprecated, for removal: This API element is subject to removal in a future version.since 18.08.0 - please read any cart related data via the CartFacadeCartFacade.getSessionCart()protected ConfigurationAbstractOrderEntryLinkStrategygetAbstractOrderEntryLinkStrategy()protected Converter<CommerceCartModification,CartModificationData>getCartModificationConverter()protected CartServicegetCartService()protected CommerceCartServicegetCommerceCartService()protected ConfigConsistenceCheckergetConfigConsistenceChecker()protected ConfigurationCopyStrategygetConfigCopyStrategy()protected ConfigurationOrderEntryProductInfoModelPopulatorgetConfigInfoPopulator()protected ConfigurationLifecycleStrategygetConfigLifecycleStrategy()protected ConfigurationAbstractOrderIntegrationStrategygetConfigurationAbstractOrderIntegrationStrategy()protected ProductConfigurationOrderIntegrationServicegetConfigurationPricingOrderIntegrationService()protected ModelServicegetModelService()protected AbstractOrderEntryModelgetOrCreateCartItem(ProductModel product, ConfigurationData configData)Creates a new entry in the session cart or returns the entry belonging to the current configuration and updates the price and its external configuration.protected AbstractOrderEntryModelgetOrderEntry(java.lang.String cartItemKey)protected java.lang.StringgetPKStringForConfigId(java.lang.String configId)protected ProductConfigurationPricingStrategygetProductConfigurationPricingStrategy()protected ConfigurationProductLinkStrategygetProductLinkStrategy()booleanisItemInCartByKey(java.lang.String key)Checks whether item is in cartprotected voidlinkEntryWithConfigInfos(AbstractOrderEntryModel entry, java.util.List<AbstractOrderEntryProductInfoModel> configInlineModels)voidremoveConfigurationLink(java.lang.String productCode)Clears the link from a product to a runtime configurationprotected voidremoveLinkToProduct(java.lang.String code)voidresetConfiguration(java.lang.String configId)Resets the configuration to the initial stateprotected ConfigModelrestoreConfigModel(java.lang.String cartEntryKey)ConfigurationDatarestoreConfiguration(KBKeyData kbKey, java.lang.String cartEntryKey)Restores a configuration from a cart entry specified by its key.voidsetAbstractOrderEntryLinkStrategy(ConfigurationAbstractOrderEntryLinkStrategy configurationAbstractOrderEntryLinkStrategy)voidsetCartModificationConverter(Converter<CommerceCartModification,CartModificationData> cartModificationConverter)voidsetCartService(CartService cartService)voidsetCommerceCartService(CommerceCartService commerceCartService)voidsetConfigConsistenceChecker(ConfigConsistenceChecker configConsistenceChecker)voidsetConfigCopyStrategy(ConfigurationCopyStrategy configCopyStrategy)voidsetConfigInfoPopulator(ConfigurationOrderEntryProductInfoModelPopulator configInfoPopulator)voidsetConfigLifecycleStrategy(ConfigurationLifecycleStrategy configLifecycleStrategy)voidsetConfigurationAbstractOrderIntegrationStrategy(ConfigurationAbstractOrderIntegrationStrategy configurationAbstractOrderIntegrationStrategy)voidsetConfigurationPricingOrderIntegrationService(ProductConfigurationOrderIntegrationService configurationPricingOrderIntegrationService)voidsetModelService(ModelService modelService)voidsetProductConfigurationPricingStrategy(ProductConfigurationPricingStrategy productConfigurationPricingStrategy)voidsetProductLinkStrategy(ConfigurationProductLinkStrategy configurationProductLinkStrategy)protected voidupdateCartItem(ProductModel product, java.lang.String configId, AbstractOrderEntryModel cartItem, CommerceCartParameter commerceCartParameter, CartModel cart)voidupdateKBKeyForVariants(ConfigurationData draftConfig)protected voidupdateLinkToCartItem(java.lang.String configId, java.lang.String cartItemKey)CartModificationDataupdateProductConfigurationInCart(java.lang.String productCode, java.lang.String configId)Updates the current configuration in shopping cart.-
Methods inherited from class de.hybris.platform.sap.productconfig.facades.impl.ConfigurationBaseFacadeImpl
applyAdditionalPopulators, convert, convertKbKey, createCsticGroup, createUiGroup, finalizeUiGroups, getAnalyticsService, getClassificationCacheStrategy, getConfigPricing, getConfigurationExpertModeFacade, getConfigurationModel, getConfigurationService, getConfigurationVariantUtil, getConflictPopulator, getCsticGroupsFromModel, getCsticTypeMapper, getGroupsFromInstance, getListOfCsticData, getMessagesMapper, getPricingService, getProductDao, getProductService, getUiKeyGenerator, isAnyVariantExisting, isOfferVariantSearch, isOneSubGroupConfigurable, isShowLegend, isUiGroupConfigurable, logFacadeCallDone, logFacadeCallStart, markFirstAndLastGroup, populateConfigDataFromModel, populateKbKey, setAnalyticsService, setClassificationCacheStrategy, setConfigPricing, setConfigurationExpertModeFacade, setConfigurationService, setConfigurationVariantUtil, setConflictPopulator, setCsticTypeMapper, setMessagesMapper, setOfferVariantSearch, setPricingService, setProductDao, setProductService, setUiKeyGenerator, showVariants
-
-
-
-
Method Detail
-
addConfigurationToCart
public java.lang.String addConfigurationToCart(ConfigurationData configContent) throws CommerceCartModificationException
Description copied from interface:ConfigurationCartIntegrationFacadeAdds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Specified by:
addConfigurationToCartin interfaceConfigurationCartIntegrationFacade- Parameters:
configContent- configuration to add to the shopping cart- Returns:
- key/handle to re-identify the item within the session
- Throws:
CommerceCartModificationException- in case the update of the cart failed
-
updateLinkToCartItem
protected void updateLinkToCartItem(java.lang.String configId, java.lang.String cartItemKey)
-
addProductConfigurationToCart
public CartModificationData addProductConfigurationToCart(java.lang.String productCode, java.lang.Long quantity, java.lang.String configId) throws CommerceCartModificationException
Description copied from interface:ConfigurationCartIntegrationFacadeAdds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Specified by:
addProductConfigurationToCartin interfaceConfigurationCartIntegrationFacade- Parameters:
productCode- code of product to addquantity- quantity to addconfigId- configuration to add to the shopping cart- Returns:
- CartModificationData
- Throws:
CommerceCartModificationException- in case the update of the cart failed
-
updateProductConfigurationInCart
public CartModificationData updateProductConfigurationInCart(java.lang.String productCode, java.lang.String configId)
Description copied from interface:ConfigurationCartIntegrationFacadeUpdates the current configuration in shopping cart.- Specified by:
updateProductConfigurationInCartin interfaceConfigurationCartIntegrationFacade- Parameters:
productCode- code of product to addconfigId- configuration to add to the shopping cart- Returns:
- CartModificationData
-
getOrCreateCartItem
protected AbstractOrderEntryModel getOrCreateCartItem(ProductModel product, ConfigurationData configData) throws CommerceCartModificationException
Creates a new entry in the session cart or returns the entry belonging to the current configuration and updates the price and its external configuration. The link between cart entry and configuration is established viaConfigurationData.getCartItemPK()- Parameters:
product-configData- DTO representation of configuration runtime instance- Returns:
- Corresponding cart entry model
- Throws:
CommerceCartModificationException
-
getPKStringForConfigId
protected java.lang.String getPKStringForConfigId(java.lang.String configId)
-
createCartItem
protected AbstractOrderEntryModel createCartItem(ProductModel product, ConfigurationData configData, CommerceCartParameter commerceCartParameter, CartModel cart) throws CommerceCartModificationException
-
updateCartItem
protected void updateCartItem(ProductModel product, java.lang.String configId, AbstractOrderEntryModel cartItem, CommerceCartParameter commerceCartParameter, CartModel cart)
-
removeLinkToProduct
protected void removeLinkToProduct(java.lang.String code)
-
addConfigAttributesToCartEntry
protected void addConfigAttributesToCartEntry(AbstractOrderEntryModel entry)
-
linkEntryWithConfigInfos
protected void linkEntryWithConfigInfos(AbstractOrderEntryModel entry, java.util.List<AbstractOrderEntryProductInfoModel> configInlineModels)
-
fillCommerceCartParameterForAddToCart
protected void fillCommerceCartParameterForAddToCart(CommerceCartParameter parameter, CartModel cart, ProductModel product, long l, UnitModel unit, boolean forceNewEntry, java.lang.String configId)
-
fillCommerceCartParameterForUpdate
protected void fillCommerceCartParameterForUpdate(CommerceCartParameter parameter, CartModel sessionCart, java.lang.String configId, java.lang.Long entryNumber)
- Parameters:
parameter-sessionCart-configId-
-
convertStringToPK
protected PK convertStringToPK(java.lang.String pkString)
Converts a string to the primary key wrapping it- Parameters:
pkString-- Returns:
- Primary key
-
findItemInCartByPK
@Deprecated(since="1808", forRemoval=true) public AbstractOrderEntryModel findItemInCartByPK(PK cartItemPk)Deprecated, for removal: This API element is subject to removal in a future version.since 18.08.0 - please read any cart related data via the CartFacadeCartFacade.getSessionCart()Searches the session cart for an entry specified by a primary key. In case nothing is found, null is returned.- Specified by:
findItemInCartByPKin interfaceConfigurationCartIntegrationFacade- Parameters:
cartItemPk- Entry key- Returns:
- Corresponding order entry model
-
findCartItemByPK
protected AbstractOrderEntryModel findCartItemByPK(PK cartItemPk)
-
isItemInCartByKey
public boolean isItemInCartByKey(java.lang.String key)
Description copied from interface:ConfigurationCartIntegrationFacadeChecks whether item is in cart- Specified by:
isItemInCartByKeyin interfaceConfigurationCartIntegrationFacade- Parameters:
key- /handle to re-identify the item within the session- Returns:
true, only if the item is in the cart
-
copyConfiguration
@Deprecated(since="1808", forRemoval=true) public java.lang.String copyConfiguration(java.lang.String configId, java.lang.String productCode)Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 - useConfigurationCopyStrategy.deepCopyConfiguration(String, String, String,boolean)insteadDescription copied from interface:ConfigurationCartIntegrationFacadeCopies a configuration. The implementation can decide if a deep copy is needed; if not, the input ID is simply returned.- Specified by:
copyConfigurationin interfaceConfigurationCartIntegrationFacade- Parameters:
configId- ID of existing configurationproductCode- product code of configurable product to be copied- Returns:
- ID of new configuration if a deep copy was performed; input otherwise
-
resetConfiguration
public void resetConfiguration(java.lang.String configId)
Description copied from interface:ConfigurationCartIntegrationFacadeResets the configuration to the initial state- Specified by:
resetConfigurationin interfaceConfigurationCartIntegrationFacade- Parameters:
configId- ID of existing configuration
-
restoreConfiguration
public ConfigurationData restoreConfiguration(KBKeyData kbKey, java.lang.String cartEntryKey)
Description copied from interface:ConfigurationCartIntegrationFacadeRestores a configuration from a cart entry specified by its key. This is needed if there is no SSC session connected to the cart entry yet.- Specified by:
restoreConfigurationin interfaceConfigurationCartIntegrationFacade- Parameters:
kbKey- knowledgebase keycartEntryKey- cart entry key- Returns:
- Configuration runtime object. Null if configuration could not be restored
-
restoreConfigModel
protected ConfigModel restoreConfigModel(java.lang.String cartEntryKey)
-
configureCartItem
public ConfigurationData configureCartItem(java.lang.String cartItemKey)
Description copied from interface:ConfigurationCartIntegrationFacadeReturns the runtime configuration for a configurable cart item. May returnnullin case the runtime configuration is not available (anymore). Callers should check fornulland take appropriate action.- Specified by:
configureCartItemin interfaceConfigurationCartIntegrationFacade- Parameters:
cartItemKey- key of the cart item for which the runtime configuration should be retrieved- Returns:
- runtime configuration, or
nullif not available anymore
-
getOrderEntry
protected AbstractOrderEntryModel getOrderEntry(java.lang.String cartItemKey)
-
updateKBKeyForVariants
public void updateKBKeyForVariants(ConfigurationData draftConfig)
-
draftConfig
public ConfigurationData draftConfig(java.lang.String cartItemHandle, KBKeyData kbKey, java.lang.String configId, boolean copyRequired, java.lang.String extConfig)
Description copied from interface:ConfigurationCartIntegrationFacadeCreates a draft from the given external configuration for the associated cart item- Specified by:
draftConfigin interfaceConfigurationCartIntegrationFacade- Parameters:
cartItemHandle- cart item for which a draft is to be generatedkbKey- knowledgebase for the productconfigId- configuration runtime id for the configuration attached to the cart itemcopyRequired- should the configuration be copiedextConfig- external configuration associated with the configId- Returns:
- draft configuration data
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
- Parameters:
cartService- injects the cart service for interaction with the cart
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
- Parameters:
modelService- injects the hybris model service
-
getCommerceCartService
protected CommerceCartService getCommerceCartService()
-
setCommerceCartService
public void setCommerceCartService(CommerceCartService commerceCartService)
- Parameters:
commerceCartService- injects the commerce cart service
-
getConfigInfoPopulator
protected ConfigurationOrderEntryProductInfoModelPopulator getConfigInfoPopulator()
-
setConfigInfoPopulator
public void setConfigInfoPopulator(ConfigurationOrderEntryProductInfoModelPopulator configInfoPopulator)
- Parameters:
configInfoPopulator-
-
getConfigurationPricingOrderIntegrationService
protected ProductConfigurationOrderIntegrationService getConfigurationPricingOrderIntegrationService()
-
setConfigurationPricingOrderIntegrationService
public void setConfigurationPricingOrderIntegrationService(ProductConfigurationOrderIntegrationService configurationPricingOrderIntegrationService)
- Parameters:
configurationPricingOrderIntegrationService- the configurationPricingOrderIntegrationService to set
-
getAbstractOrderEntryLinkStrategy
protected ConfigurationAbstractOrderEntryLinkStrategy getAbstractOrderEntryLinkStrategy()
-
setAbstractOrderEntryLinkStrategy
public void setAbstractOrderEntryLinkStrategy(ConfigurationAbstractOrderEntryLinkStrategy configurationAbstractOrderEntryLinkStrategy)
-
getProductConfigurationPricingStrategy
protected ProductConfigurationPricingStrategy getProductConfigurationPricingStrategy()
-
setProductConfigurationPricingStrategy
public void setProductConfigurationPricingStrategy(ProductConfigurationPricingStrategy productConfigurationPricingStrategy)
- Parameters:
productConfigurationPricingStrategy- the productConfigurationPricingStrategy to set
-
getConfigCopyStrategy
protected ConfigurationCopyStrategy getConfigCopyStrategy()
-
setConfigCopyStrategy
public void setConfigCopyStrategy(ConfigurationCopyStrategy configCopyStrategy)
-
getConfigLifecycleStrategy
protected ConfigurationLifecycleStrategy getConfigLifecycleStrategy()
-
setConfigLifecycleStrategy
public void setConfigLifecycleStrategy(ConfigurationLifecycleStrategy configLifecycleStrategy)
-
getCartModificationConverter
protected Converter<CommerceCartModification,CartModificationData> getCartModificationConverter()
-
setCartModificationConverter
public void setCartModificationConverter(Converter<CommerceCartModification,CartModificationData> cartModificationConverter)
-
removeConfigurationLink
public void removeConfigurationLink(java.lang.String productCode)
Description copied from interface:ConfigurationCartIntegrationFacadeClears the link from a product to a runtime configuration- Specified by:
removeConfigurationLinkin interfaceConfigurationCartIntegrationFacade- Parameters:
productCode- ID of a product
-
getProductLinkStrategy
protected ConfigurationProductLinkStrategy getProductLinkStrategy()
-
setProductLinkStrategy
public void setProductLinkStrategy(ConfigurationProductLinkStrategy configurationProductLinkStrategy)
-
setConfigurationAbstractOrderIntegrationStrategy
public void setConfigurationAbstractOrderIntegrationStrategy(ConfigurationAbstractOrderIntegrationStrategy configurationAbstractOrderIntegrationStrategy)
- Parameters:
configurationAbstractOrderIntegrationStrategy-
-
getConfigurationAbstractOrderIntegrationStrategy
protected ConfigurationAbstractOrderIntegrationStrategy getConfigurationAbstractOrderIntegrationStrategy()
-
getConfigConsistenceChecker
protected ConfigConsistenceChecker getConfigConsistenceChecker()
-
setConfigConsistenceChecker
public void setConfigConsistenceChecker(ConfigConsistenceChecker configConsistenceChecker)
- Parameters:
configConsistenceChecker- injects the consistency checker
-
configureCartItemOnExistingDraft
public ConfigurationData configureCartItemOnExistingDraft(java.lang.String cartEntryKey)
Description copied from interface:ConfigurationCartIntegrationFacadeReturns the runtime configuration for a configurable cart item, assuming that a configuration draft already exists! May returnnullin case the runtime configuration is not available (anymore). Callers should check fornulland take appropriate action.- Specified by:
configureCartItemOnExistingDraftin interfaceConfigurationCartIntegrationFacade- Parameters:
cartEntryKey- PK of cart entry as String- Returns:
- Configuration in DTO representation
-
-