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 void
adjustMaxLength(CsticData data)
protected boolean
checkReadonly(CsticValueModel csticValue, boolean isDebugEnabled)
protected boolean
containsHTML(java.lang.String longText, boolean isDebugEnabled)
protected CsticValueData
createDomainValue(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.String
emptyIfNull(java.lang.String value)
protected void
fillPlaceholder(CsticModel model, CsticData data)
java.lang.String
generateUniqueKey(CsticModel model, java.lang.String prefix)
Generates a key that identifies this characteristic uniquely within this configuration.protected IntervalInDomainHelper
getIntervalHandler()
protected ConfigurationMessageMapper
getMessagesMapper()
protected ClassificationSystemCPQAttributesProvider
getNameProvider()
protected PricingConfigurationParameter
getPricingConfigurationParameters()
protected ConfigPricing
getPricingFactory()
protected ProviderFactory
getProviderFactory()
protected UniqueUIKeyGenerator
getUiKeyGenerator()
protected UiTypeFinder
getUiTypeFinder()
protected ValueFormatTranslator
getValueFormatTranslator()
protected java.lang.String
getValueForUiTypeWithAdditionalValue(CsticData data, CsticModel model, java.lang.String value)
protected java.lang.String
getValueFromCstcData(CsticData data, boolean isDebugEnabled)
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.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.protected java.lang.String
identifyPriceRelevanceAndCurrency(CsticModel csticModel, CsticData csticData)
Checks the CsticModel for price relevance (i.e.protected boolean
isUiTypeDrownDownAndNullValue(UiType uiType, java.lang.String value)
protected boolean
isUiTypeMultiselectionValue(UiType uiType)
protected boolean
isUiTypeReadOnly(UiType uiType)
protected boolean
isUiTypeWithAdditionalValue(UiType uiType)
CsticData
mapCsticModelToData(CsticModel model, java.lang.String prefix, java.util.Map<java.lang.String,ClassificationSystemCPQAttributesContainer> nameMap)
Maps a single characteristic.protected void
mapNumericSpecifics(CsticModel model, CsticData data)
void
setIntervalHandler(IntervalInDomainHelper intervalHandler)
void
setMessagesMapper(ConfigurationMessageMapper messagesMapper)
void
setNameProvider(ClassificationSystemCPQAttributesProvider nameProvider)
protected void
setPrice(CsticValueModel csticValueModel, CsticValueData domainValue, boolean useDeltaPrices)
void
setPricingFactory(ConfigPricing pricingFactory)
void
setProviderFactory(ProviderFactory providerFactory)
void
setUiKeyGenerator(UniqueUIKeyGenerator uiKeyGenerator)
void
setUiTypeFinder(UiTypeFinder uiTypeFinder)
void
setValueFormatTranslator(ValueFormatTranslator valueFormatTranslator)
void
updateCsticModelValuesFromData(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:CsticTypeMapper
Maps a single characteristic. Model -> DTO.- Specified by:
mapCsticModelToData
in 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:CsticTypeMapper
Updates a single characteristic. DTO -> Model.- Specified by:
updateCsticModelValuesFromData
in 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:CsticTypeMapper
Generates a key that identifies this characteristic uniquely within this configuration.- Specified by:
generateUniqueKey
in 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
-
-