Class CsticTypeMapperImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.facades.impl.CsticTypeMapperImpl
-
- All Implemented Interfaces:
CsticTypeMapper
public class CsticTypeMapperImpl extends java.lang.Object implements CsticTypeMapper
Default implementation of theCsticTypeMapper.
-
-
Field Summary
-
Fields inherited from interface de.hybris.platform.sap.productconfig.facades.CsticTypeMapper
READ_ONLY_AUTHOR
-
-
Constructor Summary
Constructors Constructor Description CsticTypeMapperImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadjustMaxLength(CsticData data)protected booleancheckReadonly(CsticValueModel csticValue, boolean isDebugEnabled)protected booleancontainsHTML(java.lang.String longText, boolean isDebugEnabled)protected CsticValueDatacreateDomainValue(CsticModel csticModel, CsticValueModel csticValueModel, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled, boolean isDebugEnabledNameProvider, boolean useDeltaPrices)protected java.util.List<CsticValueData>createDomainValues(CsticModel model, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled, boolean useDeltaPrices)protected java.lang.StringemptyIfNull(java.lang.String value)protected voidfillPlaceholder(CsticModel model, CsticData data)java.lang.StringgenerateUniqueKey(CsticModel model, java.lang.String prefix)Generates a key that identifies this characteristic uniquely within this configuration.protected IntervalInDomainHelpergetIntervalHandler()protected ConfigurationMessageMappergetMessagesMapper()protected ClassificationSystemCPQAttributesProvidergetNameProvider()protected PricingConfigurationParametergetPricingConfigurationParameters()protected ConfigPricinggetPricingFactory()protected ProviderFactorygetProviderFactory()protected UniqueUIKeyGeneratorgetUiKeyGenerator()protected UiTypeFindergetUiTypeFinder()protected ValueFormatTranslatorgetValueFormatTranslator()protected java.lang.StringgetValueForUiTypeWithAdditionalValue(CsticData data, CsticModel model, java.lang.String value)protected java.lang.StringgetValueFromCstcData(CsticData data, boolean isDebugEnabled)protected voidhandlePriceData(CsticModel model, CsticData data, java.util.List<CsticValueData> domainValues)Adds zero prices with currency to the domain-values if the cstic is price relevant.protected voidhandleRetraction(CsticData data, CsticModel model, boolean isDebugEnabled)Handles the retraction of a cstic which means that all user inputs to this cstic are discarded.protected java.lang.StringidentifyPriceRelevanceAndCurrency(CsticModel csticModel, CsticData csticData)Checks the CsticModel for price relevance (i.e.protected booleanisUiTypeDrownDownAndNullValue(UiType uiType, java.lang.String value)protected booleanisUiTypeMultiselectionValue(UiType uiType)protected booleanisUiTypeReadOnly(UiType uiType)protected booleanisUiTypeWithAdditionalValue(UiType uiType)CsticDatamapCsticModelToData(CsticModel model, java.lang.String prefix, java.util.Map<java.lang.String,ClassificationSystemCPQAttributesContainer> nameMap)Maps a single characteristic.protected voidmapNumericSpecifics(CsticModel model, CsticData data)voidsetIntervalHandler(IntervalInDomainHelper intervalHandler)voidsetMessagesMapper(ConfigurationMessageMapper messagesMapper)voidsetNameProvider(ClassificationSystemCPQAttributesProvider nameProvider)protected voidsetPrice(CsticValueModel csticValueModel, CsticValueData domainValue, boolean useDeltaPrices)voidsetPricingFactory(ConfigPricing pricingFactory)voidsetProviderFactory(ProviderFactory providerFactory)voidsetUiKeyGenerator(UniqueUIKeyGenerator uiKeyGenerator)voidsetUiTypeFinder(UiTypeFinder uiTypeFinder)voidsetValueFormatTranslator(ValueFormatTranslator valueFormatTranslator)voidupdateCsticModelValuesFromData(CsticData data, CsticModel model)Updates a single characteristic.
-
-
-
Method Detail
-
mapCsticModelToData
public CsticData mapCsticModelToData(CsticModel model, java.lang.String prefix, java.util.Map<java.lang.String,ClassificationSystemCPQAttributesContainer> nameMap)
Description copied from interface:CsticTypeMapperMaps a single characteristic. Model -> DTO.- Specified by:
mapCsticModelToDatain interfaceCsticTypeMapper- Parameters:
model- source - characteristic Modelprefix- name of the group, this characteristic belongs tonameMap- cache for hybris classification system access- Returns:
- target - characteristic DTO
-
adjustMaxLength
protected void adjustMaxLength(CsticData data)
-
fillPlaceholder
protected void fillPlaceholder(CsticModel model, CsticData data)
-
emptyIfNull
protected java.lang.String emptyIfNull(java.lang.String value)
-
mapNumericSpecifics
protected void mapNumericSpecifics(CsticModel model, CsticData data)
-
createDomainValues
protected java.util.List<CsticValueData> createDomainValues(CsticModel model, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled, boolean useDeltaPrices)
-
handlePriceData
protected void handlePriceData(CsticModel model, CsticData data, java.util.List<CsticValueData> domainValues)
Adds zero prices with currency to the domain-values if the cstic is price relevant.- Parameters:
model-data-domainValues-
-
createDomainValue
protected CsticValueData createDomainValue(CsticModel csticModel, CsticValueModel csticValueModel, ClassificationSystemCPQAttributesContainer hybrisNames, boolean isDebugEnabled, boolean isDebugEnabledNameProvider, boolean useDeltaPrices)
-
setPrice
protected void setPrice(CsticValueModel csticValueModel, CsticValueData domainValue, boolean useDeltaPrices)
-
checkReadonly
protected boolean checkReadonly(CsticValueModel csticValue, boolean isDebugEnabled)
-
updateCsticModelValuesFromData
public void updateCsticModelValuesFromData(CsticData data, CsticModel model)
Description copied from interface:CsticTypeMapperUpdates a single characteristic. DTO -> Model.- Specified by:
updateCsticModelValuesFromDatain interfaceCsticTypeMapper- Parameters:
data- source - characteristic DTOmodel- target - characteristic Model
-
getValueForUiTypeWithAdditionalValue
protected java.lang.String getValueForUiTypeWithAdditionalValue(CsticData data, CsticModel model, java.lang.String value)
-
isUiTypeDrownDownAndNullValue
protected boolean isUiTypeDrownDownAndNullValue(UiType uiType, java.lang.String value)
-
isUiTypeWithAdditionalValue
protected boolean isUiTypeWithAdditionalValue(UiType uiType)
-
isUiTypeMultiselectionValue
protected boolean isUiTypeMultiselectionValue(UiType uiType)
-
handleRetraction
protected void handleRetraction(CsticData data, CsticModel model, boolean isDebugEnabled)
Handles the retraction of a cstic which means that all user inputs to this cstic are discarded. This is needed for conflict solving- Parameters:
data-model-
-
getValueFromCstcData
protected java.lang.String getValueFromCstcData(CsticData data, boolean isDebugEnabled)
-
generateUniqueKey
public java.lang.String generateUniqueKey(CsticModel model, java.lang.String prefix)
Description copied from interface:CsticTypeMapperGenerates a key that identifies this characteristic uniquely within this configuration.- Specified by:
generateUniqueKeyin interfaceCsticTypeMapper- Parameters:
model- characteristic modelprefix- ui group name the cstic belongs to- Returns:
- unique key
-
containsHTML
protected boolean containsHTML(java.lang.String longText, boolean isDebugEnabled)
-
identifyPriceRelevanceAndCurrency
protected java.lang.String identifyPriceRelevanceAndCurrency(CsticModel csticModel, CsticData csticData)
Checks the CsticModel for price relevance (i.e. at least one assignable value has a value price). It sets the priceRelevant-flag at csticData and returns the relevant currency (ISO) if the cstic is price relevant.- Parameters:
csticModel- model to be checkedcsticData- DTO to be modified- Returns:
- currency (ISO) if cstic is price relevant otherwise null
-
setUiTypeFinder
public void setUiTypeFinder(UiTypeFinder uiTypeFinder)
- Parameters:
uiTypeFinder-
-
getUiTypeFinder
protected UiTypeFinder getUiTypeFinder()
-
setPricingFactory
public void setPricingFactory(ConfigPricing pricingFactory)
- Parameters:
pricingFactory-
-
getPricingFactory
protected ConfigPricing getPricingFactory()
- Returns:
- pricingFactory
-
setValueFormatTranslator
public void setValueFormatTranslator(ValueFormatTranslator valueFormatTranslator)
- Parameters:
valueFormatTranslator- the valueFormatTranslator to set
-
getValueFormatTranslator
protected ValueFormatTranslator getValueFormatTranslator()
- Returns:
- the valueFormatTranslator
-
setNameProvider
public void setNameProvider(ClassificationSystemCPQAttributesProvider nameProvider)
- Parameters:
nameProvider- hybris characteristic and value name provider
-
getNameProvider
protected ClassificationSystemCPQAttributesProvider getNameProvider()
- Returns:
- the hybris characteristic and value name provider
-
setUiKeyGenerator
public void setUiKeyGenerator(UniqueUIKeyGenerator uiKeyGenerator)
- Parameters:
uiKeyGenerator- for generating uniqueKeys
-
getUiKeyGenerator
protected UniqueUIKeyGenerator getUiKeyGenerator()
-
getIntervalHandler
protected IntervalInDomainHelper getIntervalHandler()
-
setIntervalHandler
public void setIntervalHandler(IntervalInDomainHelper intervalHandler)
- Parameters:
intervalHandler-
-
isUiTypeReadOnly
protected boolean isUiTypeReadOnly(UiType uiType)
-
getPricingConfigurationParameters
protected PricingConfigurationParameter getPricingConfigurationParameters()
- Returns:
- the pricingConfigurationParameter
-
getProviderFactory
protected ProviderFactory getProviderFactory()
-
setProviderFactory
public void setProviderFactory(ProviderFactory providerFactory)
- Parameters:
providerFactory- the provider factory to set
-
getMessagesMapper
protected ConfigurationMessageMapper getMessagesMapper()
-
setMessagesMapper
public void setMessagesMapper(ConfigurationMessageMapper messagesMapper)
- Parameters:
messagesMapper- the messages mapper to set
-
-