Class ConfigDataMergeProcessorImpl

java.lang.Object
de.hybris.platform.sap.productconfig.frontend.util.impl.ConfigDataMergeProcessorImpl
All Implemented Interfaces:
ConfigDataMergeProcessor

public class ConfigDataMergeProcessorImpl extends Object implements ConfigDataMergeProcessor
Default implementation of ConfigDataMergeProcessor.
Used to merge the UI user input with the existing data from the session. This enables us to not send the entire configuration to the UI and to keep the request small.

Implementation note: The bean must have prototype scope as we use class members to process the path to the group which is currently selected for display.
  • Constructor Details

    • ConfigDataMergeProcessorImpl

      public ConfigDataMergeProcessorImpl()
  • Method Details

    • setTokenizerGroupId

      protected void setTokenizerGroupId(StringTokenizer tokenizerGroupId)
    • setTokenizerPath

      protected void setTokenizerPath(StringTokenizer tokenizerPath)
    • completeInput

      public void completeInput(ConfigurationData targetConfigData)
      Description copied from interface: ConfigDataMergeProcessor
      Fetches the actual configuration sate from the underlying layers and uses it to complete the given partial configuration state to build a complete and fully update state. So after the method call the given configuration will contain all values and each value will be updated to the most recent user input.
      Specified by:
      completeInput in interface ConfigDataMergeProcessor
      Parameters:
      targetConfigData - partial configuration to complete
    • mergeConfigurationData

      public void mergeConfigurationData(ConfigurationData source, ConfigurationData target)
      Description copied from interface: ConfigDataMergeProcessor
      Merges the source configuration into the target configuration. User input in the target configuration has the highest priority, so that it will be kept. The corresponding values of the source configuration are considered out dated and will be discarded.
      Specified by:
      mergeConfigurationData in interface ConfigDataMergeProcessor
      Parameters:
      source - source configuration, missing data in the target configuration will be read from here
      target - target configuration, any values present will be kept, only missing data is read from source configuration
    • populateChangedValue

      protected void populateChangedValue(ConfigurationData target)
    • prepareSourceConfiguration

      protected Map<String,Object> prepareSourceConfiguration(ConfigurationData source)
    • processGroup

      protected void processGroup(UiGroupData group, Map<String,Object> sourceConfigMap)
    • updateTargetConfiguration

      protected void updateTargetConfiguration(ConfigurationData target, Map<String,Object> sourceConfigMap)
      Restores the data which was passed from the UI. If a group with empty parents is provided, the parent groups are also equipped with the group ID's, because we need this info later on when digesting the user inputs.

      This information is retrieved from to strings, containing the list of group ID's and a list of indices which indicate where to find these groups: UiGroupForDisplayData.getPath(), UiGroupForDisplayData.getGroupIdPath().

      . Content can look like this: "MainGroup,SubGroup" and "groups[0].subGroups[3]"
      Parameters:
      target -
      sourceConfigMap -
    • updateGroupList

      protected void updateGroupList(List<UiGroupData> groups, Map<String,Object> sourceConfigMap)
      Update list of groups, calls itself recursively for sub groups
      Parameters:
      groups -
      sourceConfigMap -
    • updateGroup

      protected boolean updateGroup(UiGroupData group, Map<String,Object> sourceConfigMap)
    • removeOutdatedConflictGroups

      protected void removeOutdatedConflictGroups(List<UiGroupData> groups, List<Integer> outdatedConflictGroupIndices)
    • updateCstics

      protected void updateCstics(UiGroupData group, Map<String,Object> sourceConfigMap)
    • insertChangedValue

      protected void insertChangedValue(CsticData cstic)
    • isChangedCsticWithAssignedValidationType

      protected boolean isChangedCsticWithAssignedValidationType(CsticData cstic)
    • updateCsticValues

      protected void updateCsticValues(CsticData cstic, CsticData sourceCstic)
    • getConfigFacade

      protected ConfigurationFacade getConfigFacade()
    • setConfigFacade

      public void setConfigFacade(ConfigurationFacade configFacade)
      Parameters:
      configFacade - config facade, which is used to fetch the last complete configuration state