Class ConfigDataMergeProcessorImpl
java.lang.Object
de.hybris.platform.sap.productconfig.frontend.util.impl.ConfigDataMergeProcessorImpl
- All Implemented Interfaces:
ConfigDataMergeProcessor
Default implementation of
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.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteInput(ConfigurationData targetConfigData) 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.protected ConfigurationFacadeprotected voidinsertChangedValue(CsticData cstic) protected booleanvoidmergeConfigurationData(ConfigurationData source, ConfigurationData target) Merges the source configuration into the target configuration.protected voidprotected voidprocessGroup(UiGroupData group, Map<String, Object> sourceConfigMap) protected voidremoveOutdatedConflictGroups(List<UiGroupData> groups, List<Integer> outdatedConflictGroupIndices) voidsetConfigFacade(ConfigurationFacade configFacade) protected voidsetTokenizerGroupId(StringTokenizer tokenizerGroupId) protected voidsetTokenizerPath(StringTokenizer tokenizerPath) protected voidupdateCstics(UiGroupData group, Map<String, Object> sourceConfigMap) protected voidupdateCsticValues(CsticData cstic, CsticData sourceCstic) protected booleanupdateGroup(UiGroupData group, Map<String, Object> sourceConfigMap) protected voidupdateGroupList(List<UiGroupData> groups, Map<String, Object> sourceConfigMap) Update list of groups, calls itself recursively for sub groupsprotected voidupdateTargetConfiguration(ConfigurationData target, Map<String, Object> sourceConfigMap) Restores the data which was passed from the UI.
-
Constructor Details
-
ConfigDataMergeProcessorImpl
public ConfigDataMergeProcessorImpl()
-
-
Method Details
-
setTokenizerGroupId
-
setTokenizerPath
-
completeInput
Description copied from interface:ConfigDataMergeProcessorFetches 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:
completeInputin interfaceConfigDataMergeProcessor- Parameters:
targetConfigData- partial configuration to complete
-
mergeConfigurationData
Description copied from interface:ConfigDataMergeProcessorMerges 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:
mergeConfigurationDatain interfaceConfigDataMergeProcessor- Parameters:
source- source configuration, missing data in the target configuration will be read from heretarget- target configuration, any values present will be kept, only missing data is read from source configuration
-
populateChangedValue
-
prepareSourceConfiguration
-
processGroup
-
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
Update list of groups, calls itself recursively for sub groups- Parameters:
groups-sourceConfigMap-
-
updateGroup
-
removeOutdatedConflictGroups
protected void removeOutdatedConflictGroups(List<UiGroupData> groups, List<Integer> outdatedConflictGroupIndices) -
updateCstics
-
insertChangedValue
-
isChangedCsticWithAssignedValidationType
-
updateCsticValues
-
getConfigFacade
-
setConfigFacade
- Parameters:
configFacade- config facade, which is used to fetch the last complete configuration state
-