Interface ProductConfigurationService
-
- All Known Subinterfaces:
ProductConfigurationRuleAwareService
- All Known Implementing Classes:
MockConfigurationService
,ProductConfigurationRuleAwareServiceImpl
,ProductConfigurationServiceImpl
public interface ProductConfigurationService
ProductConfigurationService provides access to the configuration engine implementation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description int
calculateNumberOfIncompleteCsticsAndSolvableConflicts(java.lang.String configId)
Get the number of errors (conflict, not filled mandatory fields), as it is set at the cart itemConfigModel
createConfigurationForVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)
Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.ConfigModel
createConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration)
Creates a configuration from the external string representation (which contains the configuration in XML format)default ConfigModel
createConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration, java.lang.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 ConfigModel
createConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration, java.lang.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 keyConfigModel
createConfigurationFromExternalSource(Configuration extConfig)
/** Create aConfigModel
based on aConfiguration
for the provided product code.ConfigModel
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.KBKey
extractKbKey(java.lang.String productCode, java.lang.String externalConfig)
Extracts the KBKey from the external configurationint
getTotalNumberOfIssues(ConfigModel configModel)
Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)boolean
hasKbForDate(java.lang.String productCode, java.util.Date kbDate)
Checks whether a kb version exists for a given product and dateboolean
hasKbForVersion(KBKey kbKey, java.lang.String externalConfig)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 use {@link ProductConfigurationService#isKbVersionValid)} insteadboolean
isKbVersionValid(KBKey kbKey)
Checks whether kb version exists and is valid for specified datevoid
releaseSession(java.lang.String configId)
Releases the configuration sessions identified by the provided ID and all associated resources.default void
releaseSession(java.lang.String configId, boolean keepModel)
Releases the configuration sessions identified by the provided ID and all associated resources.ConfigModel
retrieveConfigurationModel(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format.java.lang.String
retrieveExternalConfiguration(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in a XML format.void
updateConfiguration(ConfigModel model)
Update the configuration model within the configuration engine.
-
-
-
Method Detail
-
createDefaultConfiguration
ConfigModel 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.- Parameters:
kbKey
- The product code for the configurable product- Returns:
- The configurable product with default configuration
-
createConfigurationForVariant
ConfigModel createConfigurationForVariant(java.lang.String baseProductCode, java.lang.String variantProductCode)
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
void updateConfiguration(ConfigModel model)
Update the configuration model within the configuration engine.- Parameters:
model
- Updated model
-
retrieveConfigurationModel
ConfigModel retrieveConfigurationModel(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in theConfigModel
format.- Parameters:
configId
- Unique configuration ID- Returns:
- The actual configuration
-
retrieveExternalConfiguration
java.lang.String retrieveExternalConfiguration(java.lang.String configId)
Retrieve the actual configuration model for the requestedconfigId
in a XML format.- Parameters:
configId
- Unique configuration ID- Returns:
- The actual configuration as XML string
-
createConfigurationFromExternal
ConfigModel createConfigurationFromExternal(KBKey kbKey, java.lang.String externalConfiguration)
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, java.lang.String externalConfiguration, java.lang.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, java.lang.String externalConfiguration, java.lang.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
ConfigModel createConfigurationFromExternalSource(Configuration extConfig)
/** Create aConfigModel
based on aConfiguration
for the provided product code.- Parameters:
extConfig
- Configuration in a data structure- Returns:
- Configuration model
-
releaseSession
void releaseSession(java.lang.String configId)
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
default void releaseSession(java.lang.String configId, boolean keepModel)
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
int calculateNumberOfIncompleteCsticsAndSolvableConflicts(java.lang.String configId)
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
boolean hasKbForDate(java.lang.String productCode, java.util.Date kbDate)
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
-
hasKbForVersion
@Deprecated(since="1808", forRemoval=true) boolean hasKbForVersion(KBKey kbKey, java.lang.String externalConfig)
Deprecated, for removal: This API element is subject to removal in a future version.since 18.08 use {@link ProductConfigurationService#isKbVersionValid)} insteadChecks whether kb version specified in the external config still exists- Parameters:
kbKey
- knowledgebase key which is used to extract product codeexternalConfig
- external configuration- Returns:
- true if KB version specified in the external config exists
-
isKbVersionValid
boolean isKbVersionValid(KBKey kbKey)
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
int getTotalNumberOfIssues(ConfigModel configModel)
Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)- Parameters:
configModel
- configuration model- Returns:
- total number of issues
-
extractKbKey
KBKey extractKbKey(java.lang.String productCode, java.lang.String externalConfig)
Extracts the KBKey from the external configuration- Parameters:
externalConfig
- external configproductCode
- product code- Returns:
- returns the kBKey of the given external config
-
-