com.ibm.commerce.tools.epromotion
Class RLPromotion

java.lang.Object
  com.ibm.commerce.tools.epromotion.RLPromotion
All Implemented Interfaces:
RLConstants
Direct Known Subclasses:
RLItemLevelPromotion, RLOrderLevelPromotion, RLProductLevelPromotion

public abstract class RLPromotion
extends java.lang.Object
implements RLConstants

The promotion class is an object used to hold all of the information associated with a particular ePromotion created in the User Interface. It is intended to be extended by customers who wish to create and support their own ePromotion types.


Field Summary
static java.lang.String COPYRIGHT
IBM copyright notice field.
Fields inherited from interface com.ibm.commerce.tools.epromotion.RLConstants
CATEGORY_LEVEL_DISPLAY_FLAG, DISCOUNT_DEPLOYMENT, EC_CALCODE_ID, EC_CODE, EC_DESCRIPTION, EC_DISCOUNTNAME, EC_ENDDATE, EC_ORDERBY, EC_PRIORITY, EC_RANGE_MAX, EC_STARTDATE, EC_STATUS, ERROR_PROMOTION_DELETED_DUPLICATE_CODE, ERROR_PROMOTION_DUPLICATE_CODE, ERROR_PROMOTION_NOT_SAVED, ERROR_PROMOTION_NOT_UPDATED, MSG_PROMOTION_SAVED, MSG_PROMOTION_UPDATED, NEVER_EXPIRE, ORDER_LEVEL_DISPLAY_FLAG, PRODUCT_LEVEL_DISPLAY_FLAG, REST_OF_TIMESTRING, RLPROMOTION, RLPROMOTION_ASSIGNEDSEGMENTS, RLPROMOTION_CATEGORYLEVELBUYXGETYFREE, RLPROMOTION_CATEGORYLEVELPERCENTDISCOUNT, RLPROMOTION_CATEGORYLEVELPERITEMVALUEDISCOUNT, RLPROMOTION_CATEGORYLEVELSAMEITEMPERCENTDISCOUNT, RLPROMOTION_CATEGORYLEVELVALUEDISCOUNT, RLPROMOTION_CATENTRY_ID, RLPROMOTION_CATENTRY_TYPE, RLPROMOTION_CATGROUP_CODE, RLPROMOTION_CATGROUP_ID, RLPROMOTION_CURRENCY, RLPROMOTION_DATERANGED, RLPROMOTION_DAYSINWEEK, RLPROMOTION_DESCRIPTION, RLPROMOTION_DESCRIPTION_LONG_NL, RLPROMOTION_DESCRIPTION_NL, RLPROMOTION_DISCOUNT_ITEM_QTY, RLPROMOTION_DISCOUNT_ITEM_SKU, RLPROMOTION_DISPLAY_LEVEL, RLPROMOTION_ENDDAY, RLPROMOTION_ENDHOUR, RLPROMOTION_ENDMONTH, RLPROMOTION_ENDYEAR, RLPROMOTION_FRIDAY, RLPROMOTION_GWP_CATENTRY_ID, RLPROMOTION_INCOMBINATIONWITH, RLPROMOTION_ISEVERYDAYFLAG, RLPROMOTION_ITEMLEVELBUYXGETYFREE, RLPROMOTION_ITEMLEVELPERCENTDISCOUNT, RLPROMOTION_ITEMLEVELPERITEMVALUEDISCOUNT, RLPROMOTION_ITEMLEVELSAMEITEMPERCENTDISCOUNT, RLPROMOTION_ITEMLEVELVALUEDISCOUNT, RLPROMOTION_MAX_DISCOUNT_ITEM_QTY, RLPROMOTION_MERCHANDISE_TYPE, RLPROMOTION_MONDAY, RLPROMOTION_NAME, RLPROMOTION_ORDERLEVELFIXEDSHIPPINGDISCOUNT, RLPROMOTION_ORDERLEVELFREEGIFT, RLPROMOTION_ORDERLEVELPERCENTDISCOUNT, RLPROMOTION_ORDERLEVELVALUEDISCOUNT, RLPROMOTION_PRIORITY, RLPROMOTION_PROD_SEARCH_PAGE, RLPROMOTION_PRODUCT_SKU, RLPROMOTION_PRODUCTLEVELBUYXGETYFREE, RLPROMOTION_PRODUCTLEVELPERCENTDISCOUNT, RLPROMOTION_PRODUCTLEVELPERITEMVALUEDISCOUNT, RLPROMOTION_PRODUCTLEVELSAMEITEMPERCENTDISCOUNT, RLPROMOTION_PRODUCTLEVELVALUEDISCOUNT, RLPROMOTION_RANGES, RLPROMOTION_REQUIRED_QTY, RLPROMOTION_RESOURCES, RLPROMOTION_SATURDAY, RLPROMOTION_SHIPMODEID, RLPROMOTION_STARTDAY, RLPROMOTION_STARTHOUR, RLPROMOTION_STARTMONTH, RLPROMOTION_STARTYEAR, RLPROMOTION_SUNDAY, RLPROMOTION_TARGETSALES, RLPROMOTION_THURSDAY, RLPROMOTION_TIMERANGED, RLPROMOTION_TUESDAY, RLPROMOTION_TYPE, RLPROMOTION_VALIDFORALLCUSTOMERS, RLPROMOTION_VALUE, RLPROMOTION_VALUES, RLPROMOTION_WEDNESDAY, ZERO_STRING
Constructor Summary
RLPromotion()
Default constructor of this class
Method Summary
abstract java.lang.String generatePromotionLevelSpecificRuleXML()
Generate promotion level specific rule XML, has to be implemented by sub type.
abstract java.lang.String generatePromotionSpecificRuleXML()
Generate promotion specific rule XML, has to be implemented by sub type.
java.lang.String generateRuleXML()
Generates and returns the XML to represent a promotion
java.util.Vector getAssignedSegments()
Get the assignedSegments
java.lang.String getCurrency()
Get the currency
java.util.Vector getDayInWeek()
Get the daysInWeek
java.util.Vector getDaysInWeek()
Gets the daysInWeek
java.lang.String getDescription()
Get the description
java.lang.String getDescriptionLongNL()
Get the customers viewable long description (tranlsation-enabled).
java.lang.String getDescriptionNL()
Return the customers viewable description (tranlsation-enabled).
java.sql.Timestamp getEndTimeStamp()
Get the promotion end timestamp
java.lang.String getName()
Get the promotion name
int getPriority()
Get the promotion priority
abstract java.lang.Integer getPromotionDisplayLevel()
Get the promotion display level
java.lang.String getRlPromotionType()
Gets the rlPromotionType
java.lang.String getRLPromotionType()
Get promotion type
java.sql.Timestamp getStartTimeStamp()
Get promotion start timestamp
int getStatus()
Get promotion status
java.lang.String getTargetSalesFigure()
Get promotion target sales
boolean isDateRanged()
Check if the promotion is scheduled by date
boolean isTimeRanged()
Check if the promotion is scheduled by time
boolean isValidForAllCustomers()
Check if the promotion is valid for all customers
protected void populateFrom(java.util.Map h)
PopulateFrom is used to tell an RLPromotion to populate itself from a Map.
void populateFrom(java.lang.String xmlString)
PopulateFrom(xmlString) is used to provide an RLPromotion method to populate itself from a XML String.
abstract void populatePromotionLevelSpecificDataFrom(java.util.Map h)
Populate promotion level specific data for itself from a Map.
abstract void populatePromotionLevelSpecificDataFrom(java.lang.String xmlString)
Populate promotion level specific data for itself from XML String.
abstract void populatePromotionSpecificDataFrom(java.util.Map h)
Populate promotion specific data for itself from a Map.
abstract void populatePromotionSpecificDataFrom(java.lang.String xmlString)
Populate promotion specific data for itself from XML String.
void setAssignedSegments(java.util.Vector newAssignedSegments)
Sets the assignedSegments
void setCurrency(java.lang.String newCurrency)
Sets the currency
void setDaysInWeek(java.util.Vector newDaysInWeek)
Sets the daysInWeek
void setDescription(java.lang.String newDesc)
Because the description is stored in the CalcoDesc table, it has to be set outside of 'populate' method.
void setDescriptionLongNL(java.lang.String newDescriptionLongNL)
Because the descriptionLongNL is stored in the Calcodedsc table, it has to be set outside of 'populate' method.
void setDescriptionNL(java.lang.String newDescNL)
Because the descriptionNL is stored in the Calcodedsc table, it has to be set outside of 'populate' method.
void setEndTimeStamp(java.sql.Timestamp newEndTimeStamp)
Sets the endTimeStamp
void setName(java.lang.String newDiscountName)
Set the name of the Discount.
void setPriority(int newPriority)
Sets the priority
void setRlPromotionType(java.lang.String newRlPromotionType)
Sets the rlPromotionType
void setStartTimeStamp(java.sql.Timestamp newStartTimeStamp)
Sets the startTimeStamp
void setStatus(int newStatus)
Sets the status
void setTargetSalesFigure(java.lang.String newTargetSalesFigure)
targetSalesFigure is not stored in the XML string, it has to be set outside of 'populate' method.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

RLPromotion

public RLPromotion()
Default constructor of this class
Method Detail

generatePromotionLevelSpecificRuleXML

public abstract java.lang.String generatePromotionLevelSpecificRuleXML()
Generate promotion level specific rule XML, has to be implemented by sub type.
Returns:
java.lang.String

generatePromotionSpecificRuleXML

public abstract java.lang.String generatePromotionSpecificRuleXML()
Generate promotion specific rule XML, has to be implemented by sub type.
Returns:
java.lang.String

generateRuleXML

public java.lang.String generateRuleXML()
Generates and returns the XML to represent a promotion
Returns:
java.lang.String

getAssignedSegments

public java.util.Vector getAssignedSegments()
Get the assignedSegments
Returns:
java.util.Vector

getCurrency

public java.lang.String getCurrency()
Get the currency
Returns:
java.lang.String

getDayInWeek

public java.util.Vector getDayInWeek()
Get the daysInWeek
Returns:
java.lang.String

getDescription

public java.lang.String getDescription()
Get the description
Returns:
java.lang.String

getDescriptionLongNL

public java.lang.String getDescriptionLongNL()
Get the customers viewable long description (tranlsation-enabled).
Returns:
java.lang.String

getDescriptionNL

public java.lang.String getDescriptionNL()
Return the customers viewable description (tranlsation-enabled).
Returns:
java.lang.String

getEndTimeStamp

public java.sql.Timestamp getEndTimeStamp()
Get the promotion end timestamp
Returns:
java.sql.Timestamp

getName

public java.lang.String getName()
Get the promotion name
Returns:
java.lang.String

getPriority

public int getPriority()
Get the promotion priority
Returns:
int

getPromotionDisplayLevel

public abstract java.lang.Integer getPromotionDisplayLevel()
Get the promotion display level
Returns:
java.lang.Integer

getRLPromotionType

public java.lang.String getRLPromotionType()
Get promotion type
Returns:
java.lang.String

getStartTimeStamp

public java.sql.Timestamp getStartTimeStamp()
Get promotion start timestamp
Returns:
java.sql.Timestamp

getStatus

public int getStatus()
Get promotion status
Returns:
int

getTargetSalesFigure

public java.lang.String getTargetSalesFigure()
Get promotion target sales
Returns:
java.lang.String

isDateRanged

public boolean isDateRanged()
Check if the promotion is scheduled by date
Returns:
boolean

isTimeRanged

public boolean isTimeRanged()
Check if the promotion is scheduled by time
Returns:
boolean

isValidForAllCustomers

public boolean isValidForAllCustomers()
Check if the promotion is valid for all customers
Returns:
boolean

populateFrom

public void populateFrom(java.lang.String xmlString)
                  throws ParameterNotFoundException,
                         java.text.ParseException
PopulateFrom(xmlString) is used to provide an RLPromotion method to populate itself from a XML String. This XML String is generally retreived from Database, and holds RLPromotion Object information. This XML is passed from the databean to the RLPromotionFactory, and the factory passes it to the class it instantiates. Note that the execution chain continues into populatePromotionSpecificDataFrom(xmlString) where implementation specific data is retreived
Throws:
ParameterNotFoundException
java.text.ParseException

populateFrom

protected void populateFrom(java.util.Map h)
                     throws ParameterNotFoundException,
                            java.text.ParseException
PopulateFrom is used to tell an RLPromotion to populate itself from a Map. This Map is generally the Map that the Tools Framework provides, and holds user entered data. This Map is passed from the controller command to the RLPromotionFactory, and the factory passes it to the class it instantiates. Note that the execution chain continues into populatePromotionSpecificDataFrom(Map) where implementation specific data is retreived.
Parameters:
h - java.util.Hashtable
Throws:
ParameterNotFoundException
java.text.ParseException

populatePromotionLevelSpecificDataFrom

public abstract void populatePromotionLevelSpecificDataFrom(java.lang.String xmlString)
                                                     throws ParameterNotFoundException
Populate promotion level specific data for itself from XML String. This XML String is generally retreived from Database, and holds RLPromotion Object information. This xml is passed from the databean to the RLPromotionFactory, and the factory passes it to the class it instantiates. Each sub type of promotion will implement this method differently according to their own attributes.
Throws:
ParameterNotFoundException

populatePromotionLevelSpecificDataFrom

public abstract void populatePromotionLevelSpecificDataFrom(java.util.Map h)
                                                     throws ParameterNotFoundException
Populate promotion level specific data for itself from a Map. This Map is generally retreived from Tools FrameWork GUI, and holds RLPromotion Object information. This map is passed from a controller command to the RLPromotionFactory, and the factory passes it to the class it instantiates. Each sub type of promotion will implement this method differently according to their own attributes.
Parameters:
h - java.util.Map
Throws:
ParameterNotFoundException

populatePromotionSpecificDataFrom

public abstract void populatePromotionSpecificDataFrom(java.lang.String xmlString)
                                                throws ParameterNotFoundException
Populate promotion specific data for itself from XML String. This XML String is generally retreived from Database, and holds RLPromotion Object information. This xml is passed from the databean to the RLPromotionFactory, and the factory passes it to the class it instantiates. Each sub type of promotion will implement this method differently according to their own attributes.
Throws:
ParameterNotFoundException

populatePromotionSpecificDataFrom

public abstract void populatePromotionSpecificDataFrom(java.util.Map h)
                                                throws ParameterNotFoundException
Populate promotion specific data for itself from a Map. This Map is generally retreived from Tools FrameWork GUI, and holds RLPromotion Object information. This map is passed from a controller command to the RLPromotionFactory, and the factory passes it to the class it instantiates. Each sub type of promotion will implement this method differently according to their own attributes.
Parameters:
h - java.util.Map
Throws:
ParameterNotFoundException

setDescription

public void setDescription(java.lang.String newDesc)
Because the description is stored in the CalcoDesc table, it has to be set outside of 'populate' method.

setDescriptionLongNL

public void setDescriptionLongNL(java.lang.String newDescriptionLongNL)
Because the descriptionLongNL is stored in the Calcodedsc table, it has to be set outside of 'populate' method.
Parameters:
newDescriptionLongNL - java.lang.String

setDescriptionNL

public void setDescriptionNL(java.lang.String newDescNL)
Because the descriptionNL is stored in the Calcodedsc table, it has to be set outside of 'populate' method.

setName

public void setName(java.lang.String newDiscountName)
Set the name of the Discount.
Parameters:
newDiscountName - java.lang.String

setTargetSalesFigure

public void setTargetSalesFigure(java.lang.String newTargetSalesFigure)
targetSalesFigure is not stored in the XML string, it has to be set outside of 'populate' method.

setAssignedSegments

public void setAssignedSegments(java.util.Vector newAssignedSegments)
Sets the assignedSegments

setCurrency

public void setCurrency(java.lang.String newCurrency)
Sets the currency

getDaysInWeek

public java.util.Vector getDaysInWeek()
Gets the daysInWeek
Returns:
Returns a java.util.Vector

setDaysInWeek

public void setDaysInWeek(java.util.Vector newDaysInWeek)
Sets the daysInWeek

setEndTimeStamp

public void setEndTimeStamp(java.sql.Timestamp newEndTimeStamp)
Sets the endTimeStamp

setPriority

public void setPriority(int newPriority)
Sets the priority

getRlPromotionType

public java.lang.String getRlPromotionType()
Gets the rlPromotionType
Returns:
Returns a String

setRlPromotionType

public void setRlPromotionType(java.lang.String newRlPromotionType)
Sets the rlPromotionType

setStartTimeStamp

public void setStartTimeStamp(java.sql.Timestamp newStartTimeStamp)
Sets the startTimeStamp

setStatus

public void setStatus(int newStatus)
Sets the status

Feedback