Interface ProductConfigurationService
- All Known Subinterfaces:
ProductConfigurationRuleAwareService
- All Known Implementing Classes:
ProductConfigurationRuleAwareServiceImpl,ProductConfigurationServiceImpl
public interface ProductConfigurationService
ProductConfigurationService provides access to the configuration engine implementation.
-
Method Summary
Modifier and TypeMethodDescriptionintGet the number of errors (conflict, not filled mandatory fields), as it is set at the cart itemdefault intcountNumberOfIncompleteCstics(InstanceModel rootInstance) Returns the number of incomplete csticsdefault intcountNumberOfSolvableConflicts(ConfigModel configModel) Returns the number of inconsistent cstics (solvable conflicts)createConfigurationForVariant(String baseProductCode, String variantProductCode) Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.createConfigurationFromExternal(KBKey kbKey, String externalConfiguration) Creates a configuration from the external string representation (which contains the configuration in XML format)default ConfigModelcreateConfigurationFromExternal(KBKey kbKey, String externalConfiguration, String cartEntryKey) Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry keydefault ConfigModelcreateConfigurationFromExternal(KBKey kbKey, String externalConfiguration, String cartEntryKey, ConfigurationRetrievalOptions retrievalOptions) Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key/** Create aConfigModelbased on aConfigurationfor the provided product code.createDefaultConfiguration(KBKey kbKey) Based on the hybris product code, provided via theKBKey.productCode, the configuration engine will provide a default configuration for the requested product.extractKbKey(String productCode, String externalConfig) Extracts the KBKey from the external configurationintgetTotalNumberOfIssues(ConfigModel configModel) Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)booleanhasKbForDate(String productCode, Date kbDate) Checks whether a kb version exists for a given product and datebooleanisKbVersionValid(KBKey kbKey) Checks whether kb version exists and is valid for specified datevoidreleaseSession(String configId) Releases the configuration sessions identified by the provided ID and all associated resources.default voidreleaseSession(String configId, boolean keepModel) Releases the configuration sessions identified by the provided ID and all associated resources.retrieveConfigurationModel(String configId) Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.retrieveExternalConfiguration(String configId) Retrieve the actual configuration model for the requestedconfigIdin a XML format.voidupdateConfiguration(ConfigModel model) Update the configuration model within the configuration engine.
-
Method Details
-
createDefaultConfiguration
Based on the hybris product code, provided via theKBKey.productCode, the configuration engine will provide a default configuration for the requested product.- Parameters:
kbKey- The product code for the configurable product- Returns:
- The configurable product with default configuration
-
createConfigurationForVariant
Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.- Parameters:
baseProductCode- The product code for the configurable base productvariantProductCode- The product code for the specific product variant- Returns:
- The configurable product with default configuration
-
updateConfiguration
Update the configuration model within the configuration engine.- Parameters:
model- Updated model
-
retrieveConfigurationModel
Retrieve the actual configuration model for the requestedconfigIdin theConfigModelformat.- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration
-
retrieveExternalConfiguration
Retrieve the actual configuration model for the requestedconfigIdin a XML format.- Parameters:
configId- Unique configuration ID- Returns:
- The actual configuration as XML string
-
createConfigurationFromExternal
Creates a configuration from the external string representation (which contains the configuration in XML format)- Parameters:
externalConfiguration- Configuration as XML stringkbKey- Key attributes needed to create a model- Returns:
- Configuration model
-
createConfigurationFromExternal
default ConfigModel createConfigurationFromExternal(KBKey kbKey, String externalConfiguration, String cartEntryKey) Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key- Parameters:
externalConfiguration- Configuration as XML stringkbKey- Key attributes needed to create a modelcartEntryKey- cartEntryKey this config belongs to- Returns:
- Configuration model
-
createConfigurationFromExternal
default ConfigModel createConfigurationFromExternal(KBKey kbKey, String externalConfiguration, String cartEntryKey, ConfigurationRetrievalOptions retrievalOptions) Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key- Parameters:
externalConfiguration- Configuration as XML stringkbKey- Key attributes needed to create a modelcartEntryKey- cartEntryKey this config belongs toretrievalOptions- options to modify behavior- Returns:
- Configuration model
-
createConfigurationFromExternalSource
/** Create aConfigModelbased on aConfigurationfor the provided product code.- Parameters:
extConfig- Configuration in a data structure- Returns:
- Configuration model
-
releaseSession
Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Parameters:
configId- session id
-
releaseSession
Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.- Parameters:
configId- session idkeepModel- signifies whether config model should be kept despite releasing session
-
calculateNumberOfIncompleteCsticsAndSolvableConflicts
Get the number of errors (conflict, not filled mandatory fields), as it is set at the cart item- Parameters:
configId- id of the configuration- Returns:
- Total number of errors
-
hasKbForDate
Checks whether a kb version exists for a given product and date- Parameters:
productCode- product codekbDate- date of the knowledgebase- Returns:
- true if KB version for the date exists
-
isKbVersionValid
Checks whether kb version exists and is valid for specified date- Parameters:
kbKey- knowledgebase key- Returns:
- true if KB version exists and is valid
-
getTotalNumberOfIssues
Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)- Parameters:
configModel- configuration model- Returns:
- total number of issues
-
countNumberOfIncompleteCstics
Returns the number of incomplete cstics- Parameters:
rootInstance- InstanceModel- Returns:
- number of incomplete cstics
-
countNumberOfSolvableConflicts
Returns the number of inconsistent cstics (solvable conflicts)- Parameters:
configModel- ConfigModel- Returns:
- number of inconsistent cstics
-
extractKbKey
Extracts the KBKey from the external configuration- Parameters:
externalConfig- external configproductCode- product code- Returns:
- returns the kBKey of the given external config
-