Class CampaignSourceRulesTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
de.hybris.platform.impex.jalo.translators.SingleValueTranslator
de.hybris.platform.ruleengineservices.impex.impl.CampaignSourceRulesTranslator
The translator that updates source rules against Campaign using the source rule with provided code and version resolved by one
of the available strategies
- ruleSelection=earliest - selects source rule with minimum version
- ruleSelection=latest - select source rule with maximum version
- mode=append - appends rule to the end of the list
- mode=replace - replaces the list
DEFAULT_SEPARATOR or
define your own separator by adding extra meta data separator=[char].
eg. INSERT_UPDATE
Campaign[disable.interceptor.types=validate];code[unique=true];sourceRules[translator=de.hybris.platform.
ruleengineservices.impex.impl.CampaignSourceRulesTranslator,mode=append,ruleSelection=latest,separator=","]; ;campaign-name;ruleA,ruleB;-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureMode(StandardColumnDescriptor descriptor) protected voidconfigureSelectionStrategy(StandardColumnDescriptor descriptor) protected voidconfigureSeparator(StandardColumnDescriptor descriptor) protected ObjectconvertToJalo(String expression, Item item) Converts a non-null and non-empty string into a jalo attribute value.protected StringConverts a non-null jalo attribute value into its string representation.protected Set<SourceRule>findSourceRules(String expression) protected Set<SourceRule>findSourceRulesHavingLatestVersion(String[] codes) protected ModelServiceprotected RuleDaovoidinit(StandardColumnDescriptor descriptor) Called once per header creation to allow configuring this translator using column modifiers etc.protected booleanprotected booleanprotected AbstractRuleModelselectOldestRule(List<AbstractRuleModel> rules) Methods inherited from class de.hybris.platform.impex.jalo.translators.SingleValueTranslator
exportValue, getEmptyValue, importValue, isEmptyMethods inherited from class de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
clearStatus, createTranslator, createTranslator, createTranslator, debug, error, getColumnDescriptor, getFlexibleSearch, info, isDebugEnabled, isInfoEnabled, setEmpty, setError, validate, warn, wasEmpty, wasUnresolved
-
Constructor Details
-
CampaignSourceRulesTranslator
public CampaignSourceRulesTranslator()
-
-
Method Details
-
init
Description copied from class:AbstractValueTranslatorCalled once per header creation to allow configuring this translator using column modifiers etc.- Overrides:
initin classAbstractValueTranslator- Parameters:
descriptor- descriptor where the value to translate belongs to
-
configureSelectionStrategy
-
configureMode
-
configureSeparator
-
convertToJalo
Description copied from class:SingleValueTranslatorConverts a non-null and non-empty string into a jalo attribute value.- Specified by:
convertToJaloin classSingleValueTranslator- Parameters:
expression- string to translateitem- item instance the translated value will be set to as attribute- Returns:
- Object translated value
-
findSourceRules
-
findSourceRulesHavingLatestVersion
-
isRuleSelectionEarliest
protected boolean isRuleSelectionEarliest() -
selectOldestRule
-
convertToString
Description copied from class:SingleValueTranslatorConverts a non-null jalo attribute value into its string representation.- Specified by:
convertToStringin classSingleValueTranslator- Parameters:
o- value to translate- Returns:
- translated value
-
getRuleDao
-
getModelService
-
isAppendMode
protected boolean isAppendMode()
-