public class DefaultConfiguratorSettingsResolutionStrategy extends java.lang.Object implements ConfiguratorSettingsResolutionStrategy
ConfiguratorSettingsResolutionStrategy.| Constructor and Description |
|---|
DefaultConfiguratorSettingsResolutionStrategy() |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Collection<java.util.List<CategoryModel>> |
getAllCategoryPathsForProduct(ProductModel product)
Collects all category paths for given product.
|
protected CategoryService |
getCategoryService() |
java.util.List<AbstractConfiguratorSettingModel> |
getConfiguratorSettingsForProduct(ProductModel product)
This implementation merges
AbstractConfiguratorSettingModel of given product respecting the following rules:
Settings with different qualifiers are simply combined
In case of qualifier collisions the winner is the setting that is closer to the product in category hierarchy
If there is a collision between setting qualifier on the same distance in category hierarchy,
random one of the settings will be taken. |
protected java.util.List<ProductModel> |
getProductHierarchy(ProductModel product) |
protected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> |
getSettingsCutByIndex(java.util.Collection<java.util.List<CategoryModel>> paths,
int index)
Collects configurator settings from section of given category paths at given index,
so for index=1 only second items (if any) of each path will be considered.
|
protected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> |
getSettingsMappedByQualifier(ProductModel product)
Builds a map configurator qualifier to configurator collected from all categories of given product.
|
protected ProductModel |
getSuperiorProduct(ProductModel product) |
protected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> |
mergeConfiguratorSettings(java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> first,
java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> second)
Merges one map of configurator settings into the other.
|
protected AbstractConfiguratorSettingModel |
processConfiguratorSettingAmbiguity(AbstractConfiguratorSettingModel option1,
AbstractConfiguratorSettingModel option2)
The method decides which of the conflicting configurator settings to take.
|
void |
setCategoryService(CategoryService categoryService) |
public DefaultConfiguratorSettingsResolutionStrategy()
public java.util.List<AbstractConfiguratorSettingModel> getConfiguratorSettingsForProduct(ProductModel product)
AbstractConfiguratorSettingModel of given product respecting the following rules:
processConfiguratorSettingAmbiguity(de.hybris.platform.product.model.AbstractConfiguratorSettingModel, de.hybris.platform.product.model.AbstractConfiguratorSettingModel).ConfigurationCategoryModel.getConfiguratorSettings(). The list is built from
root categories to leafs. Order of items from different categories of the same level is not defined,
e.g., if a product has super categories A with settings A1 and A2
and B with settings B1 and B2, the result list can be
either [A1, A2, B1, B2] or [B1, B2, A1, A2].getConfiguratorSettingsForProduct in interface ConfiguratorSettingsResolutionStrategyproduct - product of collect configurator settings forConfigurationCategoryModelprotected java.util.List<ProductModel> getProductHierarchy(ProductModel product)
protected ProductModel getSuperiorProduct(ProductModel product)
protected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> getSettingsMappedByQualifier(ProductModel product)
product - product to gather configurator settings fromprotected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> getSettingsCutByIndex(java.util.Collection<java.util.List<CategoryModel>> paths, int index)
paths - category pathsindex - which items of each of the paths to takeprocessConfiguratorSettingAmbiguity(AbstractConfiguratorSettingModel, AbstractConfiguratorSettingModel)getAllCategoryPathsForProduct(ProductModel)protected java.util.Collection<java.util.List<CategoryModel>> getAllCategoryPathsForProduct(ProductModel product)
product - productprotected java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> mergeConfiguratorSettings(java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> first, java.util.Map<java.lang.String,AbstractConfiguratorSettingModel> second)
first - map setting qualifier to settingsecond - map setting qualifier to settingprotected AbstractConfiguratorSettingModel processConfiguratorSettingAmbiguity(AbstractConfiguratorSettingModel option1, AbstractConfiguratorSettingModel option2)
Qualifier.
The default implementation simply returns the first option.
option1 - first optionoption2 - second optionprotected CategoryService getCategoryService()
public void setCategoryService(CategoryService categoryService)
Copyright © 2018 SAP SE. All Rights Reserved.