Interface ConfigurationCartIntegrationFacade
-
- All Known Implementing Classes:
ConfigurationCartIntegrationFacadeImpl,DefaultCartIntegrationFacade
public interface ConfigurationCartIntegrationFacadeFacade containing for integration between the shopping cart and configurable products.
Pure configuration related behavior is handled by theConfigurationFacade.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description java.lang.StringaddConfigurationToCart(ConfigurationData configuration)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.default 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).java.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)insteadConfigurationDatadraftConfig(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 itemdefault 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()booleanisItemInCartByKey(java.lang.String key)Checks whether item is in cartvoidremoveConfigurationLink(java.lang.String productCode)Clears the link from a product to a runtime configurationvoidresetConfiguration(java.lang.String configId)Resets the configuration to the initial stateConfigurationDatarestoreConfiguration(KBKeyData kbKey, java.lang.String cartEntryKey)Restores a configuration from a cart entry specified by its key.CartModificationDataupdateProductConfigurationInCart(java.lang.String productCode, java.lang.String configId)Updates the current configuration in shopping cart.
-
-
-
Method Detail
-
addConfigurationToCart
java.lang.String addConfigurationToCart(ConfigurationData configuration) throws CommerceCartModificationException
Adds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Parameters:
configuration- 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
-
addProductConfigurationToCart
CartModificationData addProductConfigurationToCart(java.lang.String productCode, java.lang.Long quantity, java.lang.String configId) throws CommerceCartModificationException
Adds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Parameters:
configId- configuration to add to the shopping cartproductCode- code of product to addquantity- quantity to add- Returns:
- CartModificationData
- Throws:
CommerceCartModificationException- in case the update of the cart failed
-
updateProductConfigurationInCart
CartModificationData updateProductConfigurationInCart(java.lang.String productCode, java.lang.String configId)
Updates the current configuration in shopping cart.- Parameters:
productCode- code of product to addconfigId- configuration to add to the shopping cart- Returns:
- CartModificationData
-
removeConfigurationLink
void removeConfigurationLink(java.lang.String productCode)
Clears the link from a product to a runtime configuration- Parameters:
productCode- ID of a product
-
isItemInCartByKey
boolean isItemInCartByKey(java.lang.String key)
Checks whether item is in cart- 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) 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)insteadCopies a configuration. The implementation can decide if a deep copy is needed; if not, the input ID is simply returned.- 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
void resetConfiguration(java.lang.String configId)
Resets the configuration to the initial state- Parameters:
configId- ID of existing configuration
-
restoreConfiguration
ConfigurationData restoreConfiguration(KBKeyData kbKey, java.lang.String cartEntryKey)
Restores 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.- Parameters:
kbKey- knowledgebase keycartEntryKey- cart entry key- Returns:
- Configuration runtime object. Null if configuration could not be restored
-
findItemInCartByPK
@Deprecated(since="1808", forRemoval=true) default 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.- Parameters:
cartItemPk- Entry key- Returns:
- Corresponding order entry model
-
configureCartItem
default ConfigurationData configureCartItem(java.lang.String cartItemKey)
Returns 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.- Parameters:
cartItemKey- key of the cart item for which the runtime configuration should be retrieved- Returns:
- runtime configuration, or
nullif not available anymore
-
draftConfig
ConfigurationData draftConfig(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 item- 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
-
configureCartItemOnExistingDraft
ConfigurationData configureCartItemOnExistingDraft(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). Callers should check fornulland take appropriate action.- Parameters:
cartEntryKey- PK of cart entry as String- Returns:
- Configuration in DTO representation
-
-