Class ClassificationSystemCPQAttributesProviderImpl
java.lang.Object
de.hybris.platform.sap.productconfig.facades.impl.ClassificationSystemCPQAttributesProviderImpl
- All Implemented Interfaces:
ClassificationSystemCPQAttributesProvider
public class ClassificationSystemCPQAttributesProviderImpl
extends Object
implements ClassificationSystemCPQAttributesProvider
Default implementation of the
ClassificationSystemCPQAttributesProvider.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringClassification system type, compare the S4H classification -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,Collection<MediaModel>> addMediaEntries(Collection<ClassificationAttributeValueModel> attrValues) protected voidcheckForFormatQualifiers(Map<String, CPQImageType> mediaFormatQualifiers) convertMediaToImages(Collection<MediaModel> media, Map<String, CPQImageType> cpqMediaFormatQualifiers) protected voiddetermineAvailableClassificationSystems(List<CatalogModel> catalogs, List<ClassificationSystemModel> availableClassificationSystems, List<ClassificationSystemModel> availableClassificationSystemsMatchingPattern) protected Collection<MediaModel>protected Map<String,Collection<MediaModel>> extractValueDescriptionsFromAttributeModel(Collection<ClassificationAttributeValueModel> attrValues) protected Collection<ClassificationAttributeModel>findClassificationAttributesByCode(ClassificationSystemVersionModel systemVersion, String code) protected Collection<ClassificationAttributeValueModel>findClassificationAttributeValuesByCodePrefix(ClassificationSystemVersionModel systemVersion, String code) protected BaseStoreModelprotected ClassificationAttributeModelgetClassificationAttribute(String name, ClassificationSystemVersionModel systemVersion) Retrieves the hybris classification attribute for a characteristic name (which is part of a CPQ configuraton model).protected StringReturns substring we search for in the available classification systems.getCPQAttributes(String name, Map<String, ClassificationSystemCPQAttributesContainer> nameMap) Get CPQ related attributes for the given cstic from the hybris classification system.protected CPQImageFormatMappingprotected CPQImageFormatMappinggetCsticMedia(ClassificationSystemCPQAttributesContainer cpqAttributes) extracts all media assigned to this cstic from the CPQ hybris attribute container.getCsticValueMedia(String csticValueKey, ClassificationSystemCPQAttributesContainer cpqAttributes) extracts all media assigned to this cstic value from the CPQ hybris attribute container.getDisplayName(CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) returns the display name for the cstic.getDisplayValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) returns the display name for the cstic value.protected FlexibleSearchServiceprotected I18NServiceprotected ImagePopulatorgetLongText(CsticModel model, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) returns the long text for the cstic.getNameFromAttribute(ClassificationAttributeModel attr, ClassificationSystemVersionModel systemVersion) getOverviewValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) returns the display name for the cstic value in context of the overview page.protected ClassificationSystemVersionModelDetermines the classification system we use for retrieving the hybris classification attributes for CPQ characteristics.protected UiTypeFinderprotected ValueFormatTranslatorprotected StringgetValueKey(CsticValueModel valueModel, CsticModel csticModel) getValueLongText(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled) returns the long text for a cstic value.protected StringgetValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) booleanprotected voidlogValue(String className, String nameType, String name, String targetType, String sourceType, String value, boolean isDebugEnabled) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetClassificationAttributeDescriptionAccess(ClassificationAttributeDescriptionAccess classificationAttributeDescriptionAccess) voidsetClassificationService(ClassificationSystemService classificationService) voidsetCpqCsticImageFormatMapping(CPQImageFormatMapping cpqCsticImageFormatMapping) voidsetCpqCsticValueImageFormatMapping(CPQImageFormatMapping cpqCsticValueImageFormatMapping) voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) voidsetI18NService(I18NService i18nService) voidsetImagePopulator(ImagePopulator imagePopulator) voidsetUiTypeFinder(UiTypeFinder uiTypeFinder) voidsetValueFormatTranslator(ValueFormatTranslator valueFormatTranslator)
-
Field Details
-
CLASSIFICATION
Classification system type, compare the S4H classification- See Also:
-
-
Constructor Details
-
ClassificationSystemCPQAttributesProviderImpl
public ClassificationSystemCPQAttributesProviderImpl()
-
-
Method Details
-
getCPQAttributes
public ClassificationSystemCPQAttributesContainer getCPQAttributes(String name, Map<String, ClassificationSystemCPQAttributesContainer> nameMap) Description copied from interface:ClassificationSystemCPQAttributesProviderGet CPQ related attributes for the given cstic from the hybris classification system. It is recommended to provide a nameMap, which should be cached at least on session level, so that the results can be cached in the map and so that there is no need to query CPQ attributes on each invocation.- Specified by:
getCPQAttributesin interfaceClassificationSystemCPQAttributesProvider- Parameters:
name- cstic namenameMap- to cache results- Returns:
- CPQ attribute container
-
getNameFromAttribute
protected ClassificationSystemCPQAttributesContainer getNameFromAttribute(ClassificationAttributeModel attr, ClassificationSystemVersionModel systemVersion) -
extractValueDescriptionsFromAttributeModel
protected Map<String,String> extractValueDescriptionsFromAttributeModel(Collection<ClassificationAttributeValueModel> attrValues) -
extractCsticValueMediaFromAttributeModel
protected Map<String,Collection<MediaModel>> extractCsticValueMediaFromAttributeModel(Collection<ClassificationAttributeValueModel> attrValues) -
addMediaEntries
protected Map<String,Collection<MediaModel>> addMediaEntries(Collection<ClassificationAttributeValueModel> attrValues) -
extractCsticMediaFromAttributeModel
protected Collection<MediaModel> extractCsticMediaFromAttributeModel(ClassificationAttributeModel attr) -
extractValueNamesFromAttributeModel
protected Map<String,String> extractValueNamesFromAttributeModel(Collection<ClassificationAttributeValueModel> attrValues) -
checkForFormatQualifiers
-
getCsticMedia
Description copied from interface:ClassificationSystemCPQAttributesProviderextracts all media assigned to this cstic from the CPQ hybris attribute container. The configuration engine model does not contain any media mappings, so this can only be maintained in hybris.- Specified by:
getCsticMediain interfaceClassificationSystemCPQAttributesProvider- Parameters:
cpqAttributes- CPQ attribute container with hybris media- Returns:
- list of medias
-
getCsticValueMedia
public List<ImageData> getCsticValueMedia(String csticValueKey, ClassificationSystemCPQAttributesContainer cpqAttributes) Description copied from interface:ClassificationSystemCPQAttributesProviderextracts all media assigned to this cstic value from the CPQ hybris attribute container. The configuration engine model does not contain any media mappings, so this can only be maintained in hybris.- Specified by:
getCsticValueMediain interfaceClassificationSystemCPQAttributesProvider- Parameters:
csticValueKey- key of the cstic valuecpqAttributes- CPQ attribute container with hybris media- Returns:
- list of medias
-
convertMediaToImages
protected List<ImageData> convertMediaToImages(Collection<MediaModel> media, Map<String, CPQImageType> cpqMediaFormatQualifiers) -
getLongText
public String getLongText(CsticModel model, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) Description copied from interface:ClassificationSystemCPQAttributesProviderreturns the long text for the cstic. In case a long text is present in the CPQ attribute container it will be returned, otherwise the long text is extracted from the cstic model.- Specified by:
getLongTextin interfaceClassificationSystemCPQAttributesProvider- Parameters:
model- model of the csticcpqAttributes- CPQ attribute container with hybris long textisDebugEnabled- only iftrue, debug logs will be written- Returns:
- cstic name to be displayed
-
logValue
-
getDisplayName
public String getDisplayName(CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) Description copied from interface:ClassificationSystemCPQAttributesProviderreturns the display name for the cstic. In case a display name is present in the CPQ attribute container it will be returned, otherwise the display name is extracted from the cstic model.- Specified by:
getDisplayNamein interfaceClassificationSystemCPQAttributesProvider- Parameters:
csticModel- model of the csticcpqAttributes- CPQ attribute container with hybris cstic nameisDebugEnabled- only iftrue, debug logs will be written- Returns:
- cstic name to be displayed
-
getClassificationAttribute
protected ClassificationAttributeModel getClassificationAttribute(String name, ClassificationSystemVersionModel systemVersion) Retrieves the hybris classification attribute for a characteristic name (which is part of a CPQ configuraton model).- Parameters:
name- Language independent name of characteristicsystemVersion-- Returns:
- Classification attribute
-
getDisplayValueName
public String getDisplayValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) Description copied from interface:ClassificationSystemCPQAttributesProviderreturns the display name for the cstic value. In case a display name is present in the CPQ attribute container it will be returned, otherwise the display name is extracted from the cstic value model.- Specified by:
getDisplayValueNamein interfaceClassificationSystemCPQAttributesProvider- Parameters:
valueModel- value model of the cstic valuecsticModel- model of the csticcpqAttributes- CPQ attribute container with hybris cstic value nameisDebugEnabled- only iftrue, debug logs will be written- Returns:
- cstic name to be displayed
-
getOverviewValueName
public String getOverviewValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) Description copied from interface:ClassificationSystemCPQAttributesProviderreturns the display name for the cstic value in context of the overview page. In case a display name is present in the CPQ attribute container it will be returned, otherwise the display name is extracted from the cstic value model.- Specified by:
getOverviewValueNamein interfaceClassificationSystemCPQAttributesProvider- Parameters:
valueModel- value model of the cstic valuecsticModel- model of the csticcpqAttributes- CPQ attribute container with hybris cstic value nameisDebugEnabled- only iftrue, debug logs will be written- Returns:
- cstic name to be displayed on the overview page
-
getValueName
protected String getValueName(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer cpqAttributes, boolean isDebugEnabled) -
getValueKey
-
getSystemVersion
Determines the classification system we use for retrieving the hybris classification attributes for CPQ characteristics. Checks the classification systems that are attached to a base store.
If no system is available, null is returned.
If at least one system is available: Returns the first one which contains '300' as part of its name, as this matches the customizing proposal for SAP Integration. '300' stands for class type 300 in ERP, which is typically used for product configuration.
If no system contains '300', the first one found is returned.
NOTE The pattern '300' can also be replaced, in this case override method getClassificationSystemPattern- Returns:
- classification system Version model
-
determineAvailableClassificationSystems
protected void determineAvailableClassificationSystems(List<CatalogModel> catalogs, List<ClassificationSystemModel> availableClassificationSystems, List<ClassificationSystemModel> availableClassificationSystemsMatchingPattern) -
getClassificationSystemSubString
Returns substring we search for in the available classification systems. The first system which contains this substring will be used to determine hybris attributes for CPQ characteristics names- Returns:
- "300"
-
getBaseStore
-
isDebugEnabled
public boolean isDebugEnabled()- Specified by:
isDebugEnabledin interfaceClassificationSystemCPQAttributesProvider- Returns:
trueonly if debug log is enabled for the attribute container
-
setClassificationService
- Parameters:
classificationService- injects the classification service, required to access the hybris classification system
-
setBaseStoreService
- Parameters:
baseStoreService- injects the base store service, required to access the hybris classification system
-
getUiTypeFinder
-
setUiTypeFinder
- Parameters:
uiTypeFinder- characteristic UI type finder
-
getValueFormatTranslator
-
setValueFormatTranslator
- Parameters:
valueFormatTranslator- value format translator
-
getCpqCsticImageFormatMapping
-
setCpqCsticImageFormatMapping
- Parameters:
cpqCsticImageFormatMapping- the cpqCsticImageFormatMapping to set
-
getCpqCsticValueImageFormatMapping
-
setCpqCsticValueImageFormatMapping
public void setCpqCsticValueImageFormatMapping(CPQImageFormatMapping cpqCsticValueImageFormatMapping) - Parameters:
cpqCsticValueImageFormatMapping- the cpqCsticValueImageFormatMapping to set
-
getImagePopulator
-
setImagePopulator
- Parameters:
imagePopulator- the imagePopulator to set
-
getFlexibleSearchService
-
setFlexibleSearchService
- Parameters:
flexibleSearchService- the flexibleSearchService to set
-
getClassificationAttributeDescriptionAccess
- Returns:
- Bean for accessing the classification attribute description. Actual implementation depends on the existence of SAP integrations
-
setClassificationAttributeDescriptionAccess
public void setClassificationAttributeDescriptionAccess(ClassificationAttributeDescriptionAccess classificationAttributeDescriptionAccess) - Parameters:
classificationAttributeDescriptionAccess- the classificationAttributeDescriptionAccess to set
-
findClassificationAttributesByCode
protected Collection<ClassificationAttributeModel> findClassificationAttributesByCode(ClassificationSystemVersionModel systemVersion, String code) -
findClassificationAttributeValuesByCodePrefix
protected Collection<ClassificationAttributeValueModel> findClassificationAttributeValuesByCodePrefix(ClassificationSystemVersionModel systemVersion, String code) -
getValueLongText
public String getValueLongText(CsticValueModel valueModel, CsticModel csticModel, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled) Description copied from interface:ClassificationSystemCPQAttributesProviderreturns the long text for a cstic value. In case a long text is present in the CPQ attribute container it will be returned, otherwise the long text is extracted from the cstic value model.- Specified by:
getValueLongTextin interfaceClassificationSystemCPQAttributesProvider- Parameters:
valueModel- value model of the csticcsticModel- model of the cstichybrisNames- CPQ attribute container with hybris long text- Returns:
- cstic name to be displayed
-
getI18NService
-
setI18NService
-