public class DefaultPromotion extends java.lang.Object implements Promotion
<Promotion impl="com.ibm.commerce.marketing.promotion.DefaultPromotion"> <!-- this identifies the promotion. --> <PromotionKey> <!-- Name of the promotion --> <PromotionName>DollarsOffPromotionOne</PromotionName> <!-- The store which owns this promotion. Store key is defined as the combination of the DN of the organization that owns this store and a store name --> <StoreKey> <DN>o=Root Organization</DN> <Identifier>BlueStore 201</Identifier> </StoreKey> <!-- Versions of a promotion. Statistics are associated with the version number,promotions with the same promotion key and version number but different revision are considered different revisions of the same promotion. Promotions with the same key but different version numbers are considered distinct promotions. --> <Version>0</Version> <Revision>0</Revision> </PromotionKey> <!-- Promotions are group by groups, and groups are scoped by store, refer to promotion organization for details on what a group is, its role and the default groups --> <PromotionGroupKey> <GroupName>OrderLevelPromotion</GroupName> <StoreKey> <DN>o=Root Organization</DN> <Identifier>BlueStore 201</Identifier> </StoreKey> </PromotionGroupKey> <!-- Various descriptions of the promotion --> <TypedNLDescription impl="com.ibm.commerce.marketing.promotion.TypedNLDescription"> <DefaultLocale>en_US</DefaultLocale> <Description locale="en_US" type="admin">[en_US:admin]A sample promotion</Description> <Description locale="en_US" type="long">[en_US:long]A sample promotion</Description> <Description locale="en_US" type="short">[en_US:short]A sample promotion</Description> <Description locale="fr_FR" type="admin">[fr_FR:admin]A sample promotion</Description> <Description locale="fr_FR" type="long">[fr_FR:long]A sample promotion</Description> <Description locale="fr_FR" type="short">[fr_FR:short]A sample promotion</Description> </TypedNLDescription> <!-- Priority of the promotion the higher the more important --> <Priority>1000</Priority> <!-- Exclusiveness of the promotion. Possible values are: 0: not exclusive at all 1: exclusive at the group level 2: exclusive at a global level 3: a backward compatibility mode that mimics the combinability of order level promotions with product level promotions in previous releases --> <Exclusive>3</Exclusive> <!-- For future use, always empty for now --> <ExemptPolicyList /> <!-- For future use, always empty for now --> <ExplicitlyAppliedPolicyList /> <!-- Status of the promotion: 0: inactive 1: active 2: deleted 3: suspended 4: obsolete --> <Status>1</Status> <!-- Audit trail, last update time and last person who updated the promotion --> <LastUpdate>01-09-2003 12:00:00</LastUpdate> <LastUpdateBy> <CustomerKey> <LogonId>wcsadmin</LogonId> </CustomerKey> </LastUpdateBy> <!-- How many times this promotion can be applied to the current order, possible values are: -1: unlimited positive number: the limit --> <PerOrderLimit>1</PerOrderLimit> <!-- How many times this promotion can be applied to a shopper, possible values are: -1: unlimited, positive number: the limit This value is only valid for a registered shopper, for none registered shoppers there is no way to control how many times a shopper can redeem a promotion. --> <PerShopperLimit>-1</PerShopperLimit> <!-- How many times this promotion can be redeemed overall. Possible values are: -1: unlimited, positive number: the limit --> <ApplicationLimit>-1</ApplicationLimit> <!-- Schedule information of this promotion --> <Schedule impl="com.ibm.commerce.marketing.promotion.schedule.PromotionSchedule"> <DateRange impl="com.ibm.commerce.marketing.promotion.schedule.DateRangeSchedule"> <Start inclusive="true">01-09-2003</Start> <End inclusive="true">31-12-2004</End> </DateRange> <TimeWithinADay impl="com.ibm.commerce.marketing.promotion.schedule.TimeRangeWithinADaySchedule"> <Start inclusive="true">00:00:00</Start> <End inclusive="false">23:59:59</End> </TimeWithinADay> <Week impl= "com.ibm.commerce.marketing.promotion.schedule.WeekDaySchedule"> <WeekDay>Sunday</WeekDay> <WeekDay>Monday</WeekDay> <WeekDay>Tuesday</WeekDay> <WeekDay>Wednesday</WeekDay> <WeekDay>Thursday</WeekDay> <WeekDay>Friday</WeekDay> <WeekDay>Saturday</WeekDay> </Week> </Schedule> <!-- Type of promotion: 0: targeted 1: private, that is, a coupon promotion --> <PromotionType>0</PromotionType> <!-- Optional, if default promotion code manager and resolver are used, this is the promotion code for this promotion, if not, this can be left empty or used as cue for promotion code generation --> <PromotionCodeCue>PXO002</PromotionCodeCue> <!-- Whether a code is required to redeem this promotion. --> <PromotionCodeRequired>false</PromotionCodeRequired> <!-- Check the target condition or not --> <CheckTargetingConditionAtRuntime>true</CheckTargetingConditionAtRuntime> <!-- When a promotion code is entered, should the target condition be checked --> <SkipTargetingConditionOnProperPromotionCodeEntered>false</SkipTargetingConditionOnProperPromotionCodeEntered> <!-- Do not change this element--> <PromotionCodeCondition impl= "com.ibm.commerce.marketing.promotion.condition.PromotionCodeCondition" /> <!-- Targeting condition based on customer segments defined in WebSphere Commerce --> <Targeting impl= "com.ibm.commerce.marketing.promotion.condition.TargetingCondition"> <TargetedProfile> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>EmptyNester</ProfileName> </CustomerProfileKey> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>DINK Couple</ProfileName> </CustomerProfileKey> </TargetedProfile> <ExcludedProfile> <CustomerProfileKey> <OwnerDN>o=Root Organization</OwnerDN> <ProfileName>Employee</ProfileName> </CustomerProfileKey> </ExcludedProfile> </Targeting> <!-- Custom condition can be added here for example: <CustomConditions> <Condition impl= "com.myCompany.condition.custom.MyOtherMoreComplexCondition"> <!-- Where myCompany is a custom package name. --> <ConfigParameter1>XXXX</ConfigParameter1> <ConfigParameter2> <CP2.1>YYYY</CP2.1> <CP2.2>ZZZZ</CP2.2> </ConfigParameter2> </Condition> </CustomConditions> --> <CustomConditions /> <!-- This is core of a promotion definition. It follows the model introduced in appendix B --> <PurchaseCondition impl= "com.ibm.commerce.marketing.promotion.condition.PurchaseCondition"> <!-- Matches the pattern targeted by the current promotion: the following pattern matches the entire order, for details refer to the promotion purchase condition model document --> <Pattern impl="com.ibm.commerce.marketing.promotion.condition.Pattern"> <!-- A pattern is made up of multiple constraint, each specifying a list of items that make up part of the pattern. There must be no cross-sections between constraints --> <Constraint impl= "com.ibm.commerce.marketing.promotion.condition.Constraint"> <!-- Quantity requirement of this constraint --> <WeightedRange impl= "com.ibm.commerce.marketing.promotion.condition.WeightedRange"> <!-- minimum number of item is 1 --> <LowerBound>1</LowerBound> <!-- Maximum number of item is not limited --> <UpperBound>-1</UpperBound> <!-- Match as many as items that satisfy the criteria defined in the filter chain next --> <Weight>1</Weight> </WeightedRange> <!-- Selection criteria --> <FilterChain impl= "com.ibm.commerce.marketing.promotion.condition.FilterChain"> <!-- Multiple filters can be specified, the are applied in a contiguous fashion, that is, connected using a logical "and". --> <!-- The dummy filter returns anything passed to it, it effectively selects anything --> <Filter impl= "com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <!-- The combination of the quantity requirement and the filter chain would return everything present in the shopcart as one big matched pattern --> </Constraint> </Pattern> <!-- Once pattern is matched, rewards are assigned, for details refer to the purchase condition model document --> <Distribution impl= "com.ibm.commerce.marketing.promotion.reward.Distribution"> <!-- A volume based distribution on the spending total is performed, spending total is measure in CAD --> <Type>Volume</Type> <Base>Cost</Base> <Currency>CAD</Currency> <!-- Not all matched patterns are rewarded, for example, a combination of shirts and pants priced over $120 if a combination of shirts and pants which is priced at $100, it should be eliminated, for most cases this filter is not required and therefore a DummyPatternFilter is used --> <PatternFilter impl= "com.ibm.commerce.marketing.promotion.condition.DummyPatternFilter" /> <!-- First range 100 <= spending <= 200 --> <Range impl= "com.ibm.commerce.marketing.promotion.reward.DistributionRange"> <UpperBound>200</UpperBound> <LowerBound>100</LowerBound> <!-- For future purchase, choice not supported in this release --> <RewardChoice> <!-- This reward, if the spending total of ALL matched patterns falls into the range of 100 to 200 --> <Reward impl= "com.ibm.commerce.marketing.promotion.reward.DefaultReward"> <AdjustmentFunction impl="com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <!-- Reward can be associated with a sub set of the items that make up the pattern,the input of this filter chain will be one matched pattern, and a sub set of items that make up that pattern is returned and adjustments are associated with the returned items also known as affected items --> <FilterChain impl= "com.ibm.commerce.marketing.promotion.condition.FilterChain"> <Filter impl= "com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <!-- the adjustment --> <Adjustment impl= "com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>15</AmountOff> <Currency>CAD</Currency> <!-- This adjustment is applied to the entire order, possible values are: (case insentitive) wholeOrder: The entire order, that is, $15 dollars off an entire order AllAffectedItems: Affected items returned by the filter chain defined above, that is, $15 dollars off all of the affected items as a whole. IndividualAffectedItems: Adjustments are applied to affected items individually, that is, $15 dollars off each and every affected item. --> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> </AdjustmentFunction> </Reward> </RewardChoice> </Range> <!-- Another range, $200 < spending --> <Range impl="com.ibm.commerce.marketing.promotion.reward.DistributionRange"> <UpperBound>-1</UpperBound> <LowerBound>200</LowerBound> <LowerBoundIncluded>false</LowerBoundIncluded> <RewardChoice> <Reward impl= "com.ibm.commerce.marketing.promotion.reward.DefaultReward"> <AdjustmentFunction impl= "com.ibm.commerce.marketing.promotion.reward.AdjustmentFunction"> <FilterChain impl="com.ibm.commerce.marketing.promotion.condition.FilterChain"> <Filter impl="com.ibm.commerce.marketing.promotion.condition.DummyFilter" /> </FilterChain> <Adjustment impl="com.ibm.commerce.marketing.promotion.reward.FixedAmountOffAdjustment"> <AmountOff>45</AmountOff> <Currency>CAD</Currency> <AdjustmentType>wholeOrder</AdjustmentType> </Adjustment> </AdjustmentFunction> </Reward> </RewardChoice> </Range> </Distribution> </PurchaseCondition> </Promotion>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copy right.
|
Constructor and Description |
---|
DefaultPromotion()
Default Constructor for Promotion.
|
Modifier and Type | Method and Description |
---|---|
void | addCustomCondition(Condition aRestriction)
Adds a custom condition to this promotion.
|
void | addExemptedPolicy(PromotionPolicyKey aKey)
Appends a policy to the list of policies from which this promotion is explicitly exempted.
|
void | addExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
Adds a promotion policy to the list of policies that are explicitly marked as applicable to a promotion.
|
boolean | checkTargetingConditionAtRuntime()
Returns if to check targeting condition at runtime.
|
void | clearExemptedPolicyList()
Resets the exempted policies list.
|
void | clearExplicitlyAppliedPolicyList()
Resets the list of promotion policies that are marked as explicitly applicable.
|
boolean | evaluate(PromotionContext context)
Evaluates if this promotion is applicable to an order or not.
|
void | fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
CampaignKey | getCampaignKey()
Returns the campaignKey.
|
java.lang.String | getCode()
Returns the visualCue.
|
java.lang.String | getCorrespondingRBDTypeName()
Deprecated.
This method is intended for internal usage.
|
com.ibm.commerce.marketing.promotion.CouponAttribute | getCouponAttribute()
Returns the coupon attributes associated with the promotion.
|
java.lang.String | getCurrency()
Returns the currency.
|
java.util.Iterator | getCustomConditions()
Returns the list of custom conditions.
|
Description | getDescription()
Gets the description of the promotion.
|
java.lang.String | getDescription(java.util.Locale alocale, int atype)
Returns the specified type of the description of the promotion in a particular locale.
|
int | getExclusiveLevel()
Returns the exclusive level.
|
java.util.Iterator | getExemptedPolicies()
Returns a list of explicitly exempted promotion policies.
|
java.util.Iterator | getExplicitlyAppliedPolicies()
Returns an iterator of all the promotion policies that are explicitly marked as applicable to this promotion.
|
com.ibm.commerce.marketing.promotion.group.PromotionGroupKey | getGroupKey()
Returns the group that this promotion belongs to.
|
PromotionKey | getKey()
Returns the key.
|
java.util.Date | getLastUpdate()
Returns the lastUpdate date.
|
CustomerKey | getLastUpdateBy()
Returns the customer key representing who last updates the promotion.
|
java.lang.String | getName()
Returns the name of promotion.
|
int | getPerOrderLimit()
Returns the perOrderLimit.
|
int | getPerShopperLimit()
Returns the perShopperLimit.
|
java.lang.Integer | getPriority()
Returns the priority.
|
Condition | getPromotionCodeCondition()
Returns the condition of promotion code.
|
Condition | getPurchaseCondition()
Returns the purchaseCondition.
|
int | getRevision()
Returns the revision.
|
Schedule | getSchedule()
Returns the schedule associated with the promotion.
|
int | getStatus()
Returns the status of the promotion.
|
Condition | getTargetingCondition()
Returns the targeting condition.
|
java.math.BigDecimal | getTargetSales()
Returns the target sales figure
|
int | getTotalApplicationCountLimit()
Returns the totalApplicationCountLimit.
|
int | getType()
Returns the type of the promotion.
|
int | getVersion()
Returns the version of this promotion.
|
boolean | ignoreTargettingConditionUponProperPromotionCodeEntry()
Returns true if targeting condition is to be checked at runtime.
|
boolean | isPromotionCodeRequired()
Returns the promotionCodeRequired.
|
void | removeExemptedPolicy(PromotionPolicyKey aKey)
Removes a promotion policy from the exempted list.
|
void | removeExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
Removes a promotion policy from the list of policies explicitly marked as applicable to this promotion.
|
void | setCampaignKey(CampaignKey aCampaignKey)
Sets the campaignKey.
|
void | setCheckTargetingConditionAtRuntime(boolean aCheckTargetingConditionAtRuntime)
Sets the the boolean value of checking targeting condition at runtime.
|
void | setCode(java.lang.String visualCue)
Sets the visualCue.
|
void | setCorrespondingRBDTypeName(java.lang.String string)
Deprecated.
This method is intended for internal usage.
|
void | setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute aCouponAttribute)
Sets the coupon attributes associated with the promotion.
|
void | setCurrency(java.lang.String aCurrency)
Sets the currency.
|
void | setCustomConditions(java.util.Vector restrictions)
Sets the other restrictions that may be added.
|
void | setDescription(Description aDescription)
Sets the description of the promotion.
|
void | setDescription(java.util.Locale aLocale, int aType, java.lang.String aDescription)
Sets the specified type of the description of the promotion in a particular locale.
|
void | setExclusiveLevel(int anExclusive)
Sets the exclusive level.
|
void | setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aKey)
Sets the group this promotion belongs to.
|
void | setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
Sets to ignore targeting condition upon a correct code entry.
|
void | setKey(PromotionKey akey)
Sets the key of the promotion.
|
void | setLastUpdate(java.util.Date aLastUpdate)
Sets the last update date of the promotion.
|
void | setLastUpdateBy(CustomerKey aLastUpdateBy)
Sets the customer key representing who last update the promotion.
|
void | setPerOrderLimit(int aPerOrderLimit)
Sets the per order redemption limit.
|
void | setPerShopperLimit(int aPerShopperLimit)
Sets the the maximum number of times a promotion can be applied to any shopper.
|
void | setPriority(java.lang.Integer aPriority)
Sets the priority.
|
void | setPromotionCodeCondition(Condition aPromotionCodeCondition)
Sets the promotion code condition.
|
void | setPromotionCodeRequired(boolean aPromotionCodeRequired)
Sets if promotion code is required.
|
void | setPurchaseCondition(Condition aPurchaseCondition)
Sets the purchaseCondition.
|
void | setSchedule(Schedule aSchedule)
Sets the schedule of the promotion.
|
void | setStatus(int aStatus)
Sets the status of the promotion.
|
void | setTargetingCondition(Condition aTargetingCondition)
Sets the targeting condition.
|
void | setTargetSales(java.math.BigDecimal decimal)
Sets the target sales figure, null is allowed
|
void | setTotalApplicationCountLimit(int aTotalApplicationCountLimit)
Sets the limit of how many times a promotion can be redeemed overall.
|
void | setType(int aType)
Sets the type of promotion.
0: targeted 1: private |
java.lang.String | toString() |
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public PromotionKey getKey()
public java.lang.String getDescription(java.util.Locale alocale, int atype)
public int getExclusiveLevel()
public java.util.Date getLastUpdate()
public CustomerKey getLastUpdateBy()
public java.lang.String getName()
public java.lang.Integer getPriority()
public Schedule getSchedule()
public int getStatus()
public void setDescription(java.util.Locale aLocale, int aType, java.lang.String aDescription)
public void setExclusiveLevel(int anExclusive)
public void setKey(PromotionKey akey)
public void setLastUpdate(java.util.Date aLastUpdate)
public void setLastUpdateBy(CustomerKey aLastUpdateBy)
public void setPriority(java.lang.Integer aPriority)
public void setSchedule(Schedule aSchedule)
public void setStatus(int aStatus)
public Condition getPromotionCodeCondition()
public Condition getTargetingCondition()
public void setPromotionCodeCondition(Condition aPromotionCodeCondition)
public void setTargetingCondition(Condition aTargetingCondition)
public boolean ignoreTargettingConditionUponProperPromotionCodeEntry()
public void setIgnoreTargetingConditionUponProperPromotionCodeEntry(boolean ignore)
public void addCustomCondition(Condition aRestriction)
public java.util.Iterator getCustomConditions()
public com.ibm.commerce.marketing.promotion.group.PromotionGroupKey getGroupKey()
public void setGroupKey(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aKey)
public int getPerOrderLimit()
public int getPerShopperLimit()
public int getTotalApplicationCountLimit()
public void setCustomConditions(java.util.Vector restrictions)
public void setPerOrderLimit(int aPerOrderLimit)
public void setPerShopperLimit(int aPerShopperLimit)
public void setTotalApplicationCountLimit(int aTotalApplicationCountLimit)
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
public java.lang.String toXML() throws XMLizationException
public int getRevision()
public int getType()
public int getVersion()
public void setType(int aType)
public java.lang.String getCode()
public void setCode(java.lang.String visualCue)
public boolean isPromotionCodeRequired()
public void setPromotionCodeRequired(boolean aPromotionCodeRequired)
public Condition getPurchaseCondition()
public void setPurchaseCondition(Condition aPurchaseCondition)
public java.lang.String getCurrency()
public void setCurrency(java.lang.String aCurrency)
public CampaignKey getCampaignKey()
public void setCampaignKey(CampaignKey aCampaignKey)
public void addExemptedPolicy(PromotionPolicyKey aKey)
public void removeExemptedPolicy(PromotionPolicyKey aKey)
public java.util.Iterator getExemptedPolicies()
public void clearExemptedPolicyList()
public void addExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
public void removeExplicitlyAppliedPolicy(PromotionPolicyKey aKey)
public java.util.Iterator getExplicitlyAppliedPolicies()
public void clearExplicitlyAppliedPolicyList()
public boolean checkTargetingConditionAtRuntime()
public void setCheckTargetingConditionAtRuntime(boolean aCheckTargetingConditionAtRuntime)
public com.ibm.commerce.marketing.promotion.CouponAttribute getCouponAttribute()
public void setCouponAttribute(com.ibm.commerce.marketing.promotion.CouponAttribute aCouponAttribute)
public boolean evaluate(PromotionContext context) throws PromotionRuntimeException
public java.math.BigDecimal getTargetSales()
public void setTargetSales(java.math.BigDecimal decimal)
public java.lang.String getCorrespondingRBDTypeName()
public void setCorrespondingRBDTypeName(java.lang.String string)
public java.lang.String toString()
public Description getDescription()
public void setDescription(Description aDescription)