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
-
public class CampaignSourceRulesTranslator extends SingleValueTranslator
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_SEPARATORor 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 Constructor Description CampaignSourceRulesTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigureMode(StandardColumnDescriptor descriptor)protected voidconfigureSelectionStrategy(StandardColumnDescriptor descriptor)protected voidconfigureSeparator(StandardColumnDescriptor descriptor)protected java.lang.ObjectconvertToJalo(java.lang.String expression, Item item)Converts a non-null and non-empty string into a jalo attribute value.protected java.lang.StringconvertToString(java.lang.Object o)Converts a non-null jalo attribute value into its string representation.protected java.util.Set<SourceRule>findSourceRules(java.lang.String expression)protected java.util.Set<SourceRule>findSourceRulesHavingLatestVersion(java.lang.String[] codes)protected ModelServicegetModelService()protected RuleDaogetRuleDao()voidinit(StandardColumnDescriptor descriptor)Called once per header creation to allow configuring this translator using column modifiers etc.protected booleanisAppendMode()protected booleanisRuleSelectionEarliest()protected AbstractRuleModelselectOldestRule(java.util.List<AbstractRuleModel> rules)-
Methods inherited from class de.hybris.platform.impex.jalo.translators.SingleValueTranslator
exportValue, getEmptyValue, importValue, isEmpty
-
Methods 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
-
-
-
-
Method Detail
-
init
public void init(StandardColumnDescriptor descriptor)
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
protected void configureSelectionStrategy(StandardColumnDescriptor descriptor)
-
configureMode
protected void configureMode(StandardColumnDescriptor descriptor)
-
configureSeparator
protected void configureSeparator(StandardColumnDescriptor descriptor)
-
convertToJalo
protected java.lang.Object convertToJalo(java.lang.String expression, Item item)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
protected java.util.Set<SourceRule> findSourceRules(java.lang.String expression)
-
findSourceRulesHavingLatestVersion
protected java.util.Set<SourceRule> findSourceRulesHavingLatestVersion(java.lang.String[] codes)
-
isRuleSelectionEarliest
protected boolean isRuleSelectionEarliest()
-
selectOldestRule
protected AbstractRuleModel selectOldestRule(java.util.List<AbstractRuleModel> rules)
-
convertToString
protected java.lang.String convertToString(java.lang.Object o)
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
protected RuleDao getRuleDao()
-
getModelService
protected ModelService getModelService()
-
isAppendMode
protected boolean isAppendMode()
-
-