Class DefaultConfigurationService

java.lang.Object
de.hybris.platform.cpq.productconfig.services.impl.DefaultConfigurationService
All Implemented Interfaces:
ConfigurationService

public class DefaultConfigurationService extends Object implements ConfigurationService
Default implementation of ConfigurationService
  • Constructor Details

  • Method Details

    • getCacheAccessService

      protected CacheAccessService<DefaultCacheKey,ConfigurationSummaryData> getCacheAccessService()
    • getCacheKeyService

      protected CacheKeyService getCacheKeyService()
    • getConfigurationSummary

      public ConfigurationSummaryData getConfigurationSummary(String configId)
      Description copied from interface: ConfigurationService
      Retrieves the CPQ configuration summary
      Specified by:
      getConfigurationSummary in interface ConfigurationService
      Parameters:
      configId - CPQ configuration Id
      Returns:
      CPQ configuration summary
    • getConfigurationSummaryFromEngine

      protected ConfigurationSummaryData getConfigurationSummaryFromEngine(String configId)
    • createConfiguration

      public String createConfiguration(String productCode)
      Description copied from interface: ConfigurationService
      Creates a new configuration, based on a root product code
      Specified by:
      createConfiguration in interface ConfigurationService
      Parameters:
      productCode - Root product code
      Returns:
      Configuration Identifier
    • deleteConfiguration

      public boolean deleteConfiguration(String configId)
      Description copied from interface: ConfigurationService
      Delete the configuration for given configId
      Specified by:
      deleteConfiguration in interface ConfigurationService
      Parameters:
      configId - CPQ configuration Id
      Returns:
      true if deletion was successful
    • cloneConfiguration

      public String cloneConfiguration(String configId, boolean permanent)
      Description copied from interface: ConfigurationService
      Clones the configuration for given configId
      Specified by:
      cloneConfiguration in interface ConfigurationService
      Parameters:
      configId - CPQ configuration Id
      permanent - indicates whether clone should be permanent
      Returns:
      CPQ configuration Id of cloned configuration
    • removeCachedConfigurationSummary

      public void removeCachedConfigurationSummary(String configId)
      Description copied from interface: ConfigurationService
      Removes a cached configuration summary if present. Tolerates summary not being present
      Specified by:
      removeCachedConfigurationSummary in interface ConfigurationService
      Parameters:
      configId - Configuration identifier
    • getNumberOfConfigurationIssues

      public int getNumberOfConfigurationIssues(String configId)
      Description copied from interface: ConfigurationService
      get's the total number of configuration issues
      Specified by:
      getNumberOfConfigurationIssues in interface ConfigurationService
      Parameters:
      configId - Identifies the CPQ configuration
      Returns:
      number of configuration issues
    • hasConfigurationIssues

      public boolean hasConfigurationIssues(String configId)
      Description copied from interface: ConfigurationService
      Checks if a configuration has issues
      Specified by:
      hasConfigurationIssues in interface ConfigurationService
      Parameters:
      configId - Configuration ID
      Returns:
      Issues?
    • getLifecycleStrategyDeterminationService

      protected StrategyDeterminationService<ConfigurationLifecycleStrategy> getLifecycleStrategyDeterminationService()
    • makeConfigurationPermanent

      public void makeConfigurationPermanent(String configId)
      Description copied from interface: ConfigurationService
      Marks 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:
      makeConfigurationPermanent in interface ConfigurationService
      Parameters:
      configId - config id
    • getLineItems

      public List<ConfigurationSummaryLineItemData> getLineItems(String configId)
      Description copied from interface: ConfigurationService
      get's the list of line items
      Specified by:
      getLineItems in interface ConfigurationService
      Parameters:
      configId - Identifies the CPQ configuration
      Returns:
      line items
    • validateStringParameterNotNullOrEmpty

      protected static void validateStringParameterNotNullOrEmpty(String parameter, String messsage)
    • getConfigurationSummary

      public ConfigurationSummaryData getConfigurationSummary(String configId, AbstractOrderEntryModel entry)
      Description copied from interface: ConfigurationService
      Retrieves 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:
      getConfigurationSummary in interface ConfigurationService
      Parameters:
      configId - CPQ configuration Id
      entry - entry containing this CPQ configurable product
      Returns:
      CPQ configuration summary
    • getNumberOfConfigurationIssues

      public int getNumberOfConfigurationIssues(String configId, AbstractOrderEntryModel entry)
      Description copied from interface: ConfigurationService
      Get'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:
      getNumberOfConfigurationIssues in interface ConfigurationService
      Parameters:
      configId - Identifies the CPQ configuration
      entry - entry containing this CPQ configurable product
      Returns:
      number of configuration issues
    • hasConfigurationIssues

      public boolean hasConfigurationIssues(String configId, AbstractOrderEntryModel entry)
      Description copied from interface: ConfigurationService
      Checks 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:
      hasConfigurationIssues in interface ConfigurationService
      Parameters:
      configId - Configuration ID
      entry - entry containing this CPQ configurable product
      Returns:
      Issues?
    • getServiceLayerHelper

      protected ConfigurationServiceLayerHelper getServiceLayerHelper()
    • getImpersonationService

      protected de.hybris.platform.commerceservices.impersonation.ImpersonationService getImpersonationService()
    • readConfigurationTab

      public CpqConfigurationData readConfigurationTab(String configId, Integer tabId, boolean forceSendBusinessContext)
      Description copied from interface: ConfigurationService
      Retrieves the CPQ configuration tab/group data.
      Specified by:
      readConfigurationTab in interface ConfigurationService
      Parameters:
      configId - CPQ configuration Id
      tabId - Requested tab id
      forceSendBusinessContext - flag indicating force send of the business context to CPQ
      Returns:
      CPQ configuration tab data
    • getSelectedTabId

      protected Integer getSelectedTabId(CpqConfigurationData configurationTabFromEngine)
    • readConfigurationTabFromEngine

      protected CpqConfigurationData readConfigurationTabFromEngine(String configId, Integer tabId, boolean forceSendBusinessContext)
    • updateAttribute

      public void updateAttribute(String configId, Integer attributeCode, ChangeAttributeValueData changeAttribute)
      Description copied from interface: ConfigurationService
      Updates configuration attribute
      Specified by:
      updateAttribute in interface ConfigurationService
      Parameters:
      configId - configuration id
      attributeCode - standard attribute code
      changeAttribute - 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: ConfigurationService
      Updates quantity of the configuration attribute value
      Specified by:
      updateAttributeValueQuantity in interface ConfigurationService
      Parameters:
      configId - configuration id
      attributeCode - standard attribute code
      attributeValueId - attribute value id
      changeAttributeValueQuantity - data structure containing information about updated vaiue quantity
    • invalidateConfigurationCache

      protected void invalidateConfigurationCache(String configId)
    • getConfigurationTabsCacheAccessService

      protected CacheAccessService<DefaultCacheKey,Map<String,CpqConfigurationData>> getConfigurationTabsCacheAccessService()