Interface CCPControllerHelper
- All Known Implementing Classes:
CCPControllerHelperImpl
public interface CCPControllerHelper
Provides tools for configurator OCC controllers
-
Method Summary
Modifier and TypeMethodDescriptioncompileCsticKey(CsticData cstic, UiGroupData uiGroup) Compiles characteristic keycompilePricingResult(String configId, PricingData priceSummary, List<PriceValueUpdateData> valuePrices) Compiles pricing supplement in WS format, which represents value prices and price summary), from the pricing DTO datacompileValuePriceInput(UiGroupData uiGroup) Compiles the facade layer input for the call for value prices from the provided UI groupConverts price data into the DTO structure we use for OCC exposalcreateAttributeSupplementDTO(PriceValueUpdateData valuePrices) Creates characteristic supplements DTO from the bean representing value prices for a characteristiccreatePriceSupplements(Map<String, PriceDataPair> prices) Creates a list of characteristic value supplements DTO from value pricesvoiddeleteCstics(UiGroupData group) Deletes characteristics that form a UI group (by initializing the respective list)determineFirstGroupId(List<UiGroupData> uiGroups) Searches for the first standard group with visible characteristics.voidfilterGroups(ConfigurationData configData, String requestedGroupId) Filters group data of given configuration by removing characteristic data from groups that are not matching the requested group Id.voidfilterGroups(List<UiGroupData> groups, String requestedGroupId) Filters the given group list by removing characteristic data from groups that are not matching the requested group Id and are not a conflict group.default ConfigurationDatagetConfigurationFromTemplate(String productCode, String configIdTemplate) Copies the values of another configuration that is already existing into a new configuration that is managed by commerce.getFlattened(UiGroupData uiGroup) Flattens the UI group hierarchy, i.e.Returns image handlergetUiGroup(String configId, String groupId) Gets UI group for provided idgetUiGroup(List<UiGroupData> groupList, String groupId) Finds UI group in a list of groupsReturns UI key generatorbooleanhasSubGroups(UiGroupData group) Checks if a UI groups has sub groupsbooleanisNotRequestedGroup(UiGroupData group, String requestedGroupId) Checks if UI group does not match the provided group IDmapDTOData(ConfigurationData configData) Maps configuration from DTO to WS representationreadDefaultConfiguration(String productCode) Provides default configuration for product codedefault ConfigurationDatareadDefaultConfiguration(String productCode, boolean forceReset) Provides default configuration for product code.
-
Method Details
-
readDefaultConfiguration
Provides default configuration for product code- Parameters:
productCode- Code of CCP configurable product- Returns:
- Default configuration
-
readDefaultConfiguration
Provides default configuration for product code. If parameter forceReset is true it will always return a new configuration independent of an existing configuration for the given product code.- Parameters:
productCode- Code of CCP configurable productforceReset- If true it returns a new configuration- Returns:
- Default configuration
-
determineFirstGroupId
Searches for the first standard group with visible characteristics. It first searches in the groups of the given list before searching in subgroups. Groups of typeGroupType.CONFLICTandGroupType.CONFLICT_HEADERare ignored.- Parameters:
uiGroups- List of UI groups- Returns:
- Id of first group
-
filterGroups
Filters group data of given configuration by removing characteristic data from groups that are not matching the requested group Id. No filtering if requested group id is null.- Parameters:
configData- Configuration data to filterrequestedGroupId- Group id for which data should be completely returned
-
mapDTOData
Maps configuration from DTO to WS representation- Parameters:
configData- Configuration in DTO format- Returns:
- Configuration in WS format
-
compilePricingResult
ConfigurationSupplementsWsDTO compilePricingResult(String configId, PricingData priceSummary, List<PriceValueUpdateData> valuePrices) Compiles pricing supplement in WS format, which represents value prices and price summary), from the pricing DTO data- Parameters:
configId- Configuration idpriceSummary- Price summary in DTO formatvaluePrices- Value prices in DTO format- Returns:
- Configuration supplement in WS format
-
getUiGroup
Gets UI group for provided id- Parameters:
configId- Configuration idgroupId- Group id- Returns:
- Ui group in DTO representation
-
compileValuePriceInput
Compiles the facade layer input for the call for value prices from the provided UI group- Parameters:
uiGroup- UI group- Returns:
- List of characteristic keys for the facade layer call
-
compileCsticKey
Compiles characteristic key- Parameters:
cstic- CharacteristicuiGroup- Group the characteristic belongs to- Returns:
- Key
-
convertEntrytoWsDTO
Converts price data into the DTO structure we use for OCC exposal- Parameters:
entry- Price data, with characteristic value id as key- Returns:
- DTO holding the supplementary price data per value
-
createAttributeSupplementDTO
Creates characteristic supplements DTO from the bean representing value prices for a characteristic- Parameters:
valuePrices- Value prices- Returns:
- Price supplements on characteristic level
-
createPriceSupplements
Creates a list of characteristic value supplements DTO from value prices- Parameters:
prices- Map of value prices- Returns:
- List of characteristic value supplements
-
deleteCstics
Deletes characteristics that form a UI group (by initializing the respective list)- Parameters:
group- UI group
-
filterGroups
Filters the given group list by removing characteristic data from groups that are not matching the requested group Id and are not a conflict group. Sub-groups are also taken into account. No filtering if requested group id is null.- Parameters:
groups- List of groups to filterrequestedGroupId- The group id for which data should be completely returned
-
getFlattened
Flattens the UI group hierarchy, i.e. brings the tree of UI groups in a stream consisting of all UI groups- Parameters:
uiGroup- Root group- Returns:
- Strem of UI groups
-
getImageHandler
ImageHandler getImageHandler()Returns image handler- Returns:
- Image handler
-
getUiGroup
Finds UI group in a list of groups- Parameters:
groupList- List of UI groups we want to searchgroupId- Group id (which is unique)- Returns:
- Group that matches provided groupId
-
getUniqueUIKeyGenerator
UniqueUIKeyGenerator getUniqueUIKeyGenerator()Returns UI key generator- Returns:
- UI key generator
-
hasSubGroups
Checks if a UI groups has sub groups- Parameters:
group- UI group- Returns:
- Does UI group have sub groups?
-
isNotRequestedGroup
Checks if UI group does not match the provided group ID- Parameters:
group- UI grouprequestedGroupId- Group ID that we expect to find- Returns:
- Group does not match ID?
-
getConfigurationFromTemplate
Copies the values of another configuration that is already existing into a new configuration that is managed by commerce. This API does not support product variants- Parameters:
productCode- Code of CCP configurable productconfigIdTemplate- ID of configuration template- Returns:
- Configuration carrying attribute values of the configuration template
-