public class TargetingCondition extends java.lang.Object implements Condition
XML Snippet of TargetingCondition:
<!-- 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>
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
TargetingCondition()
Constructor for TargetingCondition.
|
Modifier and Type | Method and Description |
---|---|
void | addExcludedProfile(CustomerProfile aProfile)
Adds a customer profile to the exclusion list
|
void | addExcludedProfileByKey(CustomerProfileKey aKey)
Adds a customer profile to the exclusion list
|
void | addTargetedProfile(CustomerProfile aProfile)
Adds a customer profile to the targeted list
|
void | addTargetedProfileByKey(CustomerProfileKey aKey)
Adds a customer profile to the targeted list by key
|
boolean | evaluate(PromotionContext context)
The evaluate method is used to determine if the condition has been satisfied successfully.
|
void | fromXML(org.w3c.dom.Node node)
Transforms the XML node into its corresponding real Object.
|
java.util.Vector | getExclusionKeys()
Return the excluded profile keys.
|
java.util.Vector | getInclusionKeys()
Return the targeted profile keys.
|
boolean | isTargeted(Customer customer)
Checks to see if a customer belongs to a customer profile targeted by this condition
|
protected boolean | notOnAnyExclusionList(Customer customer)
Checks to see if a customer is in a customer profile excluded by this condition
|
protected boolean | onAtLeastOneInclusionListOrEveryoneIsTargetted(Customer customer)
Checks to see if a customer is in a customer profile targeted by this condition
|
void | removeExcludedProfile(CustomerProfile aProfile)
Removes a customer profile from the exclusion list.
|
void | removeExcludedProfileByKey(CustomerProfileKey aKey)
Removes a customer profile from the exclusion list.
|
void | removeTargetedProfile(CustomerProfile aProfile)
Removes a customer profile from the inclusion list.
|
void | removeTargetedProfileByKey(CustomerProfileKey aKey)
Removes a customer profile from the targeted profile list
|
void | reset()
Resets the inclusion and exclusion list associated with this targeting condition
|
java.lang.String | toXML()
Converts the object into its corresponding XML format representation.
|
public static final java.lang.String COPYRIGHT
public TargetingCondition()
public void reset()
public void removeTargetedProfileByKey(CustomerProfileKey aKey)
public void removeExcludedProfileByKey(CustomerProfileKey aKey)
public void removeTargetedProfile(CustomerProfile aProfile)
public void removeExcludedProfile(CustomerProfile aProfile)
public void addTargetedProfileByKey(CustomerProfileKey aKey)
public void addExcludedProfileByKey(CustomerProfileKey aKey)
public void addTargetedProfile(CustomerProfile aProfile)
public void addExcludedProfile(CustomerProfile aProfile)
protected boolean onAtLeastOneInclusionListOrEveryoneIsTargetted(Customer customer)
protected boolean notOnAnyExclusionList(Customer customer)
public boolean isTargeted(Customer customer) throws PromotionConditionEvaluationException
public boolean evaluate(PromotionContext context) throws PromotionConditionEvaluationException
public void fromXML(org.w3c.dom.Node node) throws DeXMLizationException
public java.lang.String toXML() throws XMLizationException
public java.util.Vector getInclusionKeys()
public java.util.Vector getExclusionKeys()