Interface CCPControllerHelper

All Known Implementing Classes:
CCPControllerHelperImpl

public interface CCPControllerHelper
Provides tools for configurator OCC controllers
  • Method Details

    • readDefaultConfiguration

      ConfigurationData readDefaultConfiguration(String productCode)
      Provides default configuration for product code
      Parameters:
      productCode - Code of CCP configurable product
      Returns:
      Default configuration
    • readDefaultConfiguration

      default ConfigurationData readDefaultConfiguration(String productCode, boolean forceReset)
      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 product
      forceReset - If true it returns a new configuration
      Returns:
      Default configuration
    • determineFirstGroupId

      String determineFirstGroupId(List<UiGroupData> uiGroups)
      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 type GroupType.CONFLICT and GroupType.CONFLICT_HEADER are ignored.
      Parameters:
      uiGroups - List of UI groups
      Returns:
      Id of first group
    • filterGroups

      void filterGroups(ConfigurationData configData, String requestedGroupId)
      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 filter
      requestedGroupId - Group id for which data should be completely returned
    • mapDTOData

      ConfigurationWsDTO mapDTOData(ConfigurationData configData)
      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 id
      priceSummary - Price summary in DTO format
      valuePrices - Value prices in DTO format
      Returns:
      Configuration supplement in WS format
    • getUiGroup

      UiGroupData getUiGroup(String configId, String groupId)
      Gets UI group for provided id
      Parameters:
      configId - Configuration id
      groupId - Group id
      Returns:
      Ui group in DTO representation
    • compileValuePriceInput

      List<String> compileValuePriceInput(UiGroupData uiGroup)
      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

      String compileCsticKey(CsticData cstic, UiGroupData uiGroup)
      Compiles characteristic key
      Parameters:
      cstic - Characteristic
      uiGroup - 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

      CsticSupplementsWsDTO createAttributeSupplementDTO(PriceValueUpdateData valuePrices)
      Creates characteristic supplements DTO from the bean representing value prices for a characteristic
      Parameters:
      valuePrices - Value prices
      Returns:
      Price supplements on characteristic level
    • createPriceSupplements

      List<CsticValueSupplementsWsDTO> createPriceSupplements(Map<String,PriceDataPair> prices)
      Creates a list of characteristic value supplements DTO from value prices
      Parameters:
      prices - Map of value prices
      Returns:
      List of characteristic value supplements
    • deleteCstics

      void deleteCstics(UiGroupData group)
      Deletes characteristics that form a UI group (by initializing the respective list)
      Parameters:
      group - UI group
    • filterGroups

      void filterGroups(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. Sub-groups are also taken into account. No filtering if requested group id is null.
      Parameters:
      groups - List of groups to filter
      requestedGroupId - The group id for which data should be completely returned
    • getFlattened

      Stream<UiGroupData> getFlattened(UiGroupData uiGroup)
      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

      UiGroupData getUiGroup(List<UiGroupData> groupList, String groupId)
      Finds UI group in a list of groups
      Parameters:
      groupList - List of UI groups we want to search
      groupId - Group id (which is unique)
      Returns:
      Group that matches provided groupId
    • getUniqueUIKeyGenerator

      UniqueUIKeyGenerator getUniqueUIKeyGenerator()
      Returns UI key generator
      Returns:
      UI key generator
    • hasSubGroups

      boolean hasSubGroups(UiGroupData group)
      Checks if a UI groups has sub groups
      Parameters:
      group - UI group
      Returns:
      Does UI group have sub groups?
    • isNotRequestedGroup

      boolean isNotRequestedGroup(UiGroupData group, String requestedGroupId)
      Checks if UI group does not match the provided group ID
      Parameters:
      group - UI group
      requestedGroupId - Group ID that we expect to find
      Returns:
      Group does not match ID?
    • getConfigurationFromTemplate

      default ConfigurationData getConfigurationFromTemplate(String productCode, String configIdTemplate)
      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 product
      configIdTemplate - ID of configuration template
      Returns:
      Configuration carrying attribute values of the configuration template