Class DefaultConfigurationService
java.lang.Object
de.hybris.platform.cpq.productconfig.services.impl.DefaultConfigurationService
- All Implemented Interfaces:
ConfigurationService
Default implementation of
ConfigurationService-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConfigurationService(CacheAccessService<DefaultCacheKey, ConfigurationSummaryData> cacheAccessService, CacheKeyService cacheKeyService, StrategyDeterminationService<ConfigurationLifecycleStrategy> lifecycleStrategyDeterminationService, BusinessContextService businessContextService, ConfigurationServiceLayerHelper serviceLayerHelper, de.hybris.platform.commerceservices.impersonation.ImpersonationService impersonationService, de.hybris.platform.servicelayer.event.EventService eventService) Constructor that gets the mandatory beans injectedDefaultConfigurationService(CacheAccessService<DefaultCacheKey, ConfigurationSummaryData> cacheAccessService, CacheKeyService cacheKeyService, StrategyDeterminationService<ConfigurationLifecycleStrategy> lifecycleStrategyDeterminationService, BusinessContextService businessContextService, ConfigurationServiceLayerHelper serviceLayerHelper, de.hybris.platform.commerceservices.impersonation.ImpersonationService impersonationService, de.hybris.platform.servicelayer.event.EventService eventService, CacheAccessService<DefaultCacheKey, Map<String, CpqConfigurationData>> configurationTabsCacheAccessService) Constructor that gets the mandatory beans injected -
Method Summary
Modifier and TypeMethodDescriptioncloneConfiguration(String configId, boolean permanent) Clones the configuration for given configIdcreateConfiguration(String productCode) Creates a new configuration, based on a root product codebooleandeleteConfiguration(String configId) Delete the configuration for given configIdprotected CacheKeyServicegetConfigurationSummary(String configId) Retrieves the CPQ configuration summarygetConfigurationSummary(String configId, AbstractOrderEntryModel entry) Retrieves the CPQ configuration summary.protected ConfigurationSummaryDatagetConfigurationSummaryFromEngine(String configId) protected CacheAccessService<DefaultCacheKey,Map<String, CpqConfigurationData>> protected de.hybris.platform.commerceservices.impersonation.ImpersonationServicegetLineItems(String configId) get's the list of line itemsintgetNumberOfConfigurationIssues(String configId) get's the total number of configuration issuesintgetNumberOfConfigurationIssues(String configId, AbstractOrderEntryModel entry) Get's the total number of configuration issues.protected IntegergetSelectedTabId(CpqConfigurationData configurationTabFromEngine) protected ConfigurationServiceLayerHelperbooleanhasConfigurationIssues(String configId) Checks if a configuration has issuesbooleanhasConfigurationIssues(String configId, AbstractOrderEntryModel entry) Checks if a configuration has issues.protected voidinvalidateConfigurationCache(String configId) voidmakeConfigurationPermanent(String configId) Marks a persisted configuration as permanent.
Should be called when the UI is 'done' configuring.readConfigurationTab(String configId, Integer tabId, boolean forceSendBusinessContext) Retrieves the CPQ configuration tab/group data.protected CpqConfigurationDatareadConfigurationTabFromEngine(String configId, Integer tabId, boolean forceSendBusinessContext) voidremoveCachedConfigurationSummary(String configId) Removes a cached configuration summary if present.voidupdateAttribute(String configId, Integer attributeCode, ChangeAttributeValueData changeAttribute) Updates configuration attributevoidupdateAttributeValueQuantity(String configId, Integer attributeCode, Integer attributeValueId, ChangeAttributeValueQuantityData changeAttributeValueQuantity) Updates quantity of the configuration attribute valueprotected static voidvalidateStringParameterNotNullOrEmpty(String parameter, String messsage)
-
Constructor Details
-
DefaultConfigurationService
public DefaultConfigurationService(CacheAccessService<DefaultCacheKey, ConfigurationSummaryData> cacheAccessService, CacheKeyService cacheKeyService, StrategyDeterminationService<ConfigurationLifecycleStrategy> lifecycleStrategyDeterminationService, BusinessContextService businessContextService, ConfigurationServiceLayerHelper serviceLayerHelper, de.hybris.platform.commerceservices.impersonation.ImpersonationService impersonationService, de.hybris.platform.servicelayer.event.EventService eventService) Constructor that gets the mandatory beans injected- Parameters:
cacheAccessService- configuration summary cache access servicecacheKeyService- cache key servicelifecycleStrategyDeterminationService- For telling which engine is active (productive or mock)businessContextService- for determining the current ownerserviceLayerHelper- service layer helperimpersonationService- impersonation serviceeventService- event service
-
DefaultConfigurationService
public DefaultConfigurationService(CacheAccessService<DefaultCacheKey, ConfigurationSummaryData> cacheAccessService, CacheKeyService cacheKeyService, StrategyDeterminationService<ConfigurationLifecycleStrategy> lifecycleStrategyDeterminationService, BusinessContextService businessContextService, ConfigurationServiceLayerHelper serviceLayerHelper, de.hybris.platform.commerceservices.impersonation.ImpersonationService impersonationService, de.hybris.platform.servicelayer.event.EventService eventService, CacheAccessService<DefaultCacheKey, Map<String, CpqConfigurationData>> configurationTabsCacheAccessService) Constructor that gets the mandatory beans injected- Parameters:
cacheAccessService- configuration summary cache access servicecacheKeyService- cache key servicelifecycleStrategyDeterminationService- For telling which engine is active (productive or mock)businessContextService- for determining the current ownerserviceLayerHelper- service layer helperimpersonationService- impersonation serviceeventService- event serviceconfigurationTabsCacheAccessService- configuration tabs cache access service
-
-
Method Details
-
getCacheAccessService
-
getCacheKeyService
-
getConfigurationSummary
Description copied from interface:ConfigurationServiceRetrieves the CPQ configuration summary- Specified by:
getConfigurationSummaryin interfaceConfigurationService- Parameters:
configId- CPQ configuration Id- Returns:
- CPQ configuration summary
-
getConfigurationSummaryFromEngine
-
createConfiguration
Description copied from interface:ConfigurationServiceCreates a new configuration, based on a root product code- Specified by:
createConfigurationin interfaceConfigurationService- Parameters:
productCode- Root product code- Returns:
- Configuration Identifier
-
deleteConfiguration
Description copied from interface:ConfigurationServiceDelete the configuration for given configId- Specified by:
deleteConfigurationin interfaceConfigurationService- Parameters:
configId- CPQ configuration Id- Returns:
- true if deletion was successful
-
cloneConfiguration
Description copied from interface:ConfigurationServiceClones the configuration for given configId- Specified by:
cloneConfigurationin interfaceConfigurationService- Parameters:
configId- CPQ configuration Idpermanent- indicates whether clone should be permanent- Returns:
- CPQ configuration Id of cloned configuration
-
removeCachedConfigurationSummary
Description copied from interface:ConfigurationServiceRemoves a cached configuration summary if present. Tolerates summary not being present- Specified by:
removeCachedConfigurationSummaryin interfaceConfigurationService- Parameters:
configId- Configuration identifier
-
getNumberOfConfigurationIssues
Description copied from interface:ConfigurationServiceget's the total number of configuration issues- Specified by:
getNumberOfConfigurationIssuesin interfaceConfigurationService- Parameters:
configId- Identifies the CPQ configuration- Returns:
- number of configuration issues
-
hasConfigurationIssues
Description copied from interface:ConfigurationServiceChecks if a configuration has issues- Specified by:
hasConfigurationIssuesin interfaceConfigurationService- Parameters:
configId- Configuration ID- Returns:
- Issues?
-
getLifecycleStrategyDeterminationService
protected StrategyDeterminationService<ConfigurationLifecycleStrategy> getLifecycleStrategyDeterminationService() -
makeConfigurationPermanent
Description copied from interface:ConfigurationServiceMarks a persisted configuration as permanent.
Should be called when the UI is 'done' configuring. Afterwards admin/server is required to do any changes. UI/Client scope is not sufficient anymore to do changes.- Specified by:
makeConfigurationPermanentin interfaceConfigurationService- Parameters:
configId- config id
-
getLineItems
Description copied from interface:ConfigurationServiceget's the list of line items- Specified by:
getLineItemsin interfaceConfigurationService- Parameters:
configId- Identifies the CPQ configuration- Returns:
- line items
-
validateStringParameterNotNullOrEmpty
-
getConfigurationSummary
public ConfigurationSummaryData getConfigurationSummary(String configId, AbstractOrderEntryModel entry) Description copied from interface:ConfigurationServiceRetrieves the CPQ configuration summary. As a rule, CPQ configuration can be retrieved only for the origin user or a user from the same company. However, there are some processes in commerce which run asynchronous with the anonymous user and need to retrieve the CPQ configuration. In these cases, the required authorization is already verified by the parent process. This method allows such processes to retrieve the CPQ configuration summary even if the process is running with anonymous user.- Specified by:
getConfigurationSummaryin interfaceConfigurationService- Parameters:
configId- CPQ configuration Identry- entry containing this CPQ configurable product- Returns:
- CPQ configuration summary
-
getNumberOfConfigurationIssues
Description copied from interface:ConfigurationServiceGet's the total number of configuration issues. As a rule, CPQ configuration can be retrieved only for the origin user or a user from the same company. However, there are some processes in commerce which run asynchronous with the anonymous user and need to retrieve the CPQ configuration. In these cases, the required authorization is already verified by the parent process. This method allows such processes to retrieve the number of issues in the CPQ configuration even if the process is running with anonymous user.- Specified by:
getNumberOfConfigurationIssuesin interfaceConfigurationService- Parameters:
configId- Identifies the CPQ configurationentry- entry containing this CPQ configurable product- Returns:
- number of configuration issues
-
hasConfigurationIssues
Description copied from interface:ConfigurationServiceChecks if a configuration has issues. As a rule, CPQ configuration can be retrieved only for the origin user or a user from the same company. However, there are some processes in commerce which run asynchronous with the anonymous user and need to retrieve the CPQ configuration. In these cases, the required authorization is already verified by the parent process. This method allows such processes to verify whether the CPQ configuration has issues even if the process is running with anonymous user.- Specified by:
hasConfigurationIssuesin interfaceConfigurationService- Parameters:
configId- Configuration IDentry- entry containing this CPQ configurable product- Returns:
- Issues?
-
getServiceLayerHelper
-
getImpersonationService
protected de.hybris.platform.commerceservices.impersonation.ImpersonationService getImpersonationService() -
readConfigurationTab
public CpqConfigurationData readConfigurationTab(String configId, Integer tabId, boolean forceSendBusinessContext) Description copied from interface:ConfigurationServiceRetrieves the CPQ configuration tab/group data.- Specified by:
readConfigurationTabin interfaceConfigurationService- Parameters:
configId- CPQ configuration IdtabId- Requested tab idforceSendBusinessContext- flag indicating force send of the business context to CPQ- Returns:
- CPQ configuration tab data
-
getSelectedTabId
-
readConfigurationTabFromEngine
protected CpqConfigurationData readConfigurationTabFromEngine(String configId, Integer tabId, boolean forceSendBusinessContext) -
updateAttribute
public void updateAttribute(String configId, Integer attributeCode, ChangeAttributeValueData changeAttribute) Description copied from interface:ConfigurationServiceUpdates configuration attribute- Specified by:
updateAttributein interfaceConfigurationService- Parameters:
configId- configuration idattributeCode- standard attribute codechangeAttribute- data structure containing information about updated attribute vaiues or quantity
-
updateAttributeValueQuantity
public void updateAttributeValueQuantity(String configId, Integer attributeCode, Integer attributeValueId, ChangeAttributeValueQuantityData changeAttributeValueQuantity) Description copied from interface:ConfigurationServiceUpdates quantity of the configuration attribute value- Specified by:
updateAttributeValueQuantityin interfaceConfigurationService- Parameters:
configId- configuration idattributeCode- standard attribute codeattributeValueId- attribute value idchangeAttributeValueQuantity- data structure containing information about updated vaiue quantity
-
invalidateConfigurationCache
-
getConfigurationTabsCacheAccessService
protected CacheAccessService<DefaultCacheKey,Map<String, getConfigurationTabsCacheAccessService()CpqConfigurationData>>
-