Interface ProductConfigurationService

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      int calculateNumberOfIncompleteCsticsAndSolvableConflicts​(java.lang.String configId)
      Get the number of errors (conflict, not filled mandatory fields), as it is set at the cart item
      ConfigModel createConfigurationForVariant​(java.lang.String baseProductCode, java.lang.String variantProductCode)
      Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.
      ConfigModel createConfigurationFromExternal​(KBKey kbKey, java.lang.String externalConfiguration)
      Creates a configuration from the external string representation (which contains the configuration in XML format)
      default ConfigModel createConfigurationFromExternal​(KBKey kbKey, java.lang.String externalConfiguration, java.lang.String cartEntryKey)
      Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key
      default ConfigModel createConfigurationFromExternal​(KBKey kbKey, java.lang.String externalConfiguration, java.lang.String cartEntryKey, ConfigurationRetrievalOptions retrievalOptions)
      Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key
      ConfigModel createConfigurationFromExternalSource​(Configuration extConfig)
      /** Create a ConfigModel based on a Configuration for the provided product code.
      ConfigModel createDefaultConfiguration​(KBKey kbKey)
      Based on the hybris product code, provided via the KBKey.productCode, the configuration engine will provide a default configuration for the requested product.
      KBKey extractKbKey​(java.lang.String productCode, java.lang.String externalConfig)
      Extracts the KBKey from the external configuration
      int getTotalNumberOfIssues​(ConfigModel configModel)
      Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)
      boolean hasKbForDate​(java.lang.String productCode, java.util.Date kbDate)
      Checks whether a kb version exists for a given product and date
      boolean hasKbForVersion​(KBKey kbKey, java.lang.String externalConfig)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 18.08 use {@link ProductConfigurationService#isKbVersionValid)} instead
      boolean isKbVersionValid​(KBKey kbKey)
      Checks whether kb version exists and is valid for specified date
      void releaseSession​(java.lang.String configId)
      Releases the configuration sessions identified by the provided ID and all associated resources.
      default void releaseSession​(java.lang.String configId, boolean keepModel)
      Releases the configuration sessions identified by the provided ID and all associated resources.
      ConfigModel retrieveConfigurationModel​(java.lang.String configId)
      Retrieve the actual configuration model for the requested configId in the ConfigModel format.
      java.lang.String retrieveExternalConfiguration​(java.lang.String configId)
      Retrieve the actual configuration model for the requested configId in a XML format.
      void updateConfiguration​(ConfigModel model)
      Update the configuration model within the configuration engine.
    • Method Detail

      • createDefaultConfiguration

        ConfigModel createDefaultConfiguration​(KBKey kbKey)
        Based on the hybris product code, provided via the KBKey.productCode, the configuration engine will provide a default configuration for the requested product.
        Parameters:
        kbKey - The product code for the configurable product
        Returns:
        The configurable product with default configuration
      • createConfigurationForVariant

        ConfigModel createConfigurationForVariant​(java.lang.String baseProductCode,
                                                  java.lang.String variantProductCode)
        Based on the hybris product code, the configuration engine will provide a configuration for the requested product variant.
        Parameters:
        baseProductCode - The product code for the configurable base product
        variantProductCode - The product code for the specific product variant
        Returns:
        The configurable product with default configuration
      • updateConfiguration

        void updateConfiguration​(ConfigModel model)
        Update the configuration model within the configuration engine.
        Parameters:
        model - Updated model
      • retrieveConfigurationModel

        ConfigModel retrieveConfigurationModel​(java.lang.String configId)
        Retrieve the actual configuration model for the requested configId in the ConfigModel format.
        Parameters:
        configId - Unique configuration ID
        Returns:
        The actual configuration
      • retrieveExternalConfiguration

        java.lang.String retrieveExternalConfiguration​(java.lang.String configId)
        Retrieve the actual configuration model for the requested configId in a XML format.
        Parameters:
        configId - Unique configuration ID
        Returns:
        The actual configuration as XML string
      • createConfigurationFromExternal

        ConfigModel createConfigurationFromExternal​(KBKey kbKey,
                                                    java.lang.String externalConfiguration)
        Creates a configuration from the external string representation (which contains the configuration in XML format)
        Parameters:
        externalConfiguration - Configuration as XML string
        kbKey - Key attributes needed to create a model
        Returns:
        Configuration model
      • createConfigurationFromExternal

        default ConfigModel createConfigurationFromExternal​(KBKey kbKey,
                                                            java.lang.String externalConfiguration,
                                                            java.lang.String cartEntryKey)
        Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key
        Parameters:
        externalConfiguration - Configuration as XML string
        kbKey - Key attributes needed to create a model
        cartEntryKey - cartEntryKey this config belongs to
        Returns:
        Configuration model
      • createConfigurationFromExternal

        default ConfigModel createConfigurationFromExternal​(KBKey kbKey,
                                                            java.lang.String externalConfiguration,
                                                            java.lang.String cartEntryKey,
                                                            ConfigurationRetrievalOptions retrievalOptions)
        Creates a configuration from the external string representation (which contains the configuration in XML format) and links it immediately with the given cart entry key
        Parameters:
        externalConfiguration - Configuration as XML string
        kbKey - Key attributes needed to create a model
        cartEntryKey - cartEntryKey this config belongs to
        retrievalOptions - options to modify behavior
        Returns:
        Configuration model
      • createConfigurationFromExternalSource

        ConfigModel createConfigurationFromExternalSource​(Configuration extConfig)
        /** Create a ConfigModel based on a Configuration for the provided product code.
        Parameters:
        extConfig - Configuration in a data structure
        Returns:
        Configuration model
      • releaseSession

        void releaseSession​(java.lang.String configId)
        Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.
        Parameters:
        configId - session id
      • releaseSession

        default void releaseSession​(java.lang.String configId,
                                    boolean keepModel)
        Releases the configuration sessions identified by the provided ID and all associated resources. Accessing the session afterwards is not possible anymore.
        Parameters:
        configId - session id
        keepModel - signifies whether config model should be kept despite releasing session
      • calculateNumberOfIncompleteCsticsAndSolvableConflicts

        int calculateNumberOfIncompleteCsticsAndSolvableConflicts​(java.lang.String configId)
        Get the number of errors (conflict, not filled mandatory fields), as it is set at the cart item
        Parameters:
        configId - id of the configuration
        Returns:
        Total number of errors
      • hasKbForDate

        boolean hasKbForDate​(java.lang.String productCode,
                             java.util.Date kbDate)
        Checks whether a kb version exists for a given product and date
        Parameters:
        productCode - product code
        kbDate - date of the knowledgebase
        Returns:
        true if KB version for the date exists
      • hasKbForVersion

        @Deprecated(since="1808",
                    forRemoval=true)
        boolean hasKbForVersion​(KBKey kbKey,
                                java.lang.String externalConfig)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08 use {@link ProductConfigurationService#isKbVersionValid)} instead
        Checks whether kb version specified in the external config still exists
        Parameters:
        kbKey - knowledgebase key which is used to extract product code
        externalConfig - external configuration
        Returns:
        true if KB version specified in the external config exists
      • isKbVersionValid

        boolean isKbVersionValid​(KBKey kbKey)
        Checks whether kb version exists and is valid for specified date
        Parameters:
        kbKey - knowledgebase key
        Returns:
        true if KB version exists and is valid
      • getTotalNumberOfIssues

        int getTotalNumberOfIssues​(ConfigModel configModel)
        Returns the total number of issues (number of solvable conflicts + number of incomplete cstics)
        Parameters:
        configModel - configuration model
        Returns:
        total number of issues
      • extractKbKey

        KBKey extractKbKey​(java.lang.String productCode,
                           java.lang.String externalConfig)
        Extracts the KBKey from the external configuration
        Parameters:
        externalConfig - external config
        productCode - product code
        Returns:
        returns the kBKey of the given external config