com.ibm.commerce.tools.promotions
Class CreateDiscountCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.tools.promotions.CreateDiscountCmdImpl
All Implemented Interfaces:
CreateDiscountCmd, ECCommand, ECPromotionsConstants, ECTargetableCommand, TaskCommand

public class CreateDiscountCmdImpl
extends TaskCommandImpl
implements CreateDiscountCmd, ECPromotionsConstants

This task command which implements CreateDiscountCmd interface is creating a discount AccessBean used within the implementation: CalculationCodeAccessBean,CalculationCodeDescriptionAccessBean, CalculationRangeAccessBean,CalculationRuleAccessBean,CalculationRuleMemberGroupRelationshipAccessBean, CalculationRuleScaleRelationshipAccessBean,CalculationScaleAccessBean,CatalogEntryCalculationCodeAccessBean,CalculationCodeMemberGroupAccessBean

See Also:
Serialized Form

Field Summary
protected  java.lang.String adminDescription
          description for admin use
protected  boolean allShoppers
          return true if this is for all shoppers
protected  java.util.Vector assignedShopperGroups
          customer profile that discount targets to
protected  java.lang.Integer calCodeId
          calCodeId
protected  java.lang.Integer calRuleId
          calRuleId
protected  java.lang.Integer calScaleId
          calScaleId
protected  java.lang.String code
          discount code
static java.lang.String COPYRIGHT
          IBM Copyright
protected  java.lang.String currency
          discount currency
protected  java.lang.String description
          description for shopper use
protected  java.util.Vector discountValueVector
          a vector of discount value for each range
protected  java.lang.Integer discSubType
          discount sub-type
protected  java.lang.Integer discType
          discount type
protected  java.sql.Timestamp endTimestamp
          end timestamp
protected  java.lang.Integer groupBy
          group by
protected  boolean hasDateTimeRange
          true if the discount has date or time ranged
protected  java.lang.Integer langId
          language ID
protected  java.util.Vector rangeFromVector
          a vector of range from values
protected  java.lang.Integer rangeType
          range type
protected  java.sql.Timestamp startTimestamp
          start timestamp
protected  java.lang.Integer storeId
          store ID
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.tools.promotions. CreateDiscountCmd
defaultCommandClassName, Name
 
Fields inherited from interface com.ibm.commerce.tools.promotions. ECPromotionsConstants
BY_AMOUNT_PER_UNIT, BY_FIXED_AMOUNT, BY_PERCENTAGE, CONTRACT_DISPLAY, CUMULATIVE_FALSE, CURRENCY_RANGE, DISCOUNT_PUBLISHED, DISCOUNT_RESOURCES, DO_NOT_GROUP, EC_Calcode_Id, EC_Code, EC_EndDate, EC_Orderby, EC_Range_Max, EC_StartDate, EC_Status, ERROR_DISCOUNT_APPLIED, ERROR_DISCOUNT_DUPLICATE_CODE, ERROR_DISCOUNT_NOT_SAVED, ITEM_DISPLAY, MSG_DISCOUNT_APPLIED, MSG_DISCOUNT_SAVED, ORDER_DISPLAY, ORDER_LEVEL, ORDERITEM_DISPLAY, PRODUCT_DISPLAY, PRODUCT_LEVEL, QTY_RANGE, REST_OF_TIMESTRING, ZERO_STRING
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
CreateDiscountCmdImpl()
          Create a Discount Object.
 
Method Summary
 void createCalCodeBean()
          Create and populate the calCodeBean
 void createCalCodeMgpBean()
          Create and populate calcodeMgp Bean
 void createCalDescBean()
          Create and populate the calDescBean
 void createCalRangeBean()
          Create and populate the calRangeBean
 void createCalRuleBean()
          Create and populate the calRuleBean
 void createCalRuleMgpBean()
          Create and populate the calRuleMgpBean
 void createCalRuleScaleBean()
          Create and populate the calRuleScaleBean
 void createCalScaleBean()
          Create and populate the calScaleBean
 void createCatencalcd()
          Create and populate CatalogEntryCalculationCode Bean.
 java.lang.String getAdminDescription()
          Provide the property Administration Description.
 java.util.Vector getAssignedShopperGroups()
          Provide the property assignedShopperGroups.
 java.lang.Integer getCalCodeId()
          Provide the property Calculation Code.
 java.lang.String getCode()
          Provide the property Code, A character string that uniquely identifies this CalculationCode.
 java.lang.String getCurrency()
          Provide the property Currency.
 java.lang.String getDescription()
          Provide the property Shopper's Description.
 java.util.Vector getDiscountValueVector()
          Provide the property Discount Values.
 java.lang.Integer getDiscSubType()
          Provide the subtypes of discount.
 java.lang.Integer getDiscType()
          Provide the property Discount Type.
 java.sql.Timestamp getEndTimestamp()
          Provide the property End Timestamp of the discount Obj.
 java.lang.Integer getGroupBy()
          Provide the property GroupBy.
 java.lang.Integer getLangId()
          Provide the property Language ID.
 java.util.Vector getRangeFromVector()
          Vector of the values that each Discount Range starts from.
 java.lang.Integer getRangeType()
          Provide the property Discount Range type.
 java.sql.Timestamp getStartTimestamp()
          Provide the property Start Timestamp of the discount Obj.
 boolean isReadyToCallExecute()
          true if is ready to call execution method
 void performExecute()
          Task command execution method, doing the actual work, populating the tables, creating objects.
 void setAdminDescription(java.lang.String newAdminDescription)
          set the property Administration Description.
 void setAllShoppers(boolean newAllShoppers)
          set the property allShoppers, if the discount is for all shoppers, this will be set to true.
 void setAssignedShopperGroups(java.util.Vector newAssignedShopperGroups)
          set the property assignedShopperGroups
 void setCalCodeId(java.lang.Integer newCalCodeId)
          Set the property Calculation Code ID.
 void setCode(java.lang.String newCode)
          Set the property code.
 void setCurrency(java.lang.String newCurrency)
          Set the property Currency.
 void setDescription(java.lang.String newDescription)
          Set the property Shopper's Description.
 void setDiscountValueVector(java.util.Vector newDiscountValueVector)
          Set the property DiscountValueVector.
 void setDiscSubType(java.lang.Integer newDiscSubType)
          Set the property Discount Sub-Type.
 void setDiscType(java.lang.Integer newDiscType)
          Set the property Discount Type.
 void setEndTimestamp(java.sql.Timestamp newEndTimestamp)
          Set the property EndTimestamp.
 void setGroupBy(java.lang.Integer newGroupBy)
          Set the property GroupBy.
 void setHasDateTimeRange(boolean newHasDateTimeRange)
          Set the property hasDateTimeRange, this will be true if the Discount Obj has the Time Limit or Schedule.
 void setLangId(java.lang.Integer newLangId)
          Set the property LanguageId, this method will be removed in release.
 void setRangeFromVector(java.util.Vector newRangeFromVector)
          Set the property RangeFromVector.
 void setRangeType(java.lang.Integer newRangeType)
          Set the property Range Type.
 void setStartTimestamp(java.sql.Timestamp newStartTimestamp)
          Set the property startTimestamp.
 void setStoreId(java.lang.Integer newStoreId)
          Set the property storeId, this method will be removed in next release.
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM Copyright
See Also:
Constant Field Values

code

protected java.lang.String code
discount code

storeId

protected java.lang.Integer storeId
store ID

langId

protected java.lang.Integer langId
language ID

groupBy

protected java.lang.Integer groupBy
group by

description

protected java.lang.String description
description for shopper use

currency

protected java.lang.String currency
discount currency

assignedShopperGroups

protected java.util.Vector assignedShopperGroups
customer profile that discount targets to

allShoppers

protected boolean allShoppers
return true if this is for all shoppers

hasDateTimeRange

protected boolean hasDateTimeRange
true if the discount has date or time ranged

startTimestamp

protected java.sql.Timestamp startTimestamp
start timestamp

endTimestamp

protected java.sql.Timestamp endTimestamp
end timestamp

rangeFromVector

protected java.util.Vector rangeFromVector
a vector of range from values

discountValueVector

protected java.util.Vector discountValueVector
a vector of discount value for each range

rangeType

protected java.lang.Integer rangeType
range type

discType

protected java.lang.Integer discType
discount type

discSubType

protected java.lang.Integer discSubType
discount sub-type

calCodeId

protected java.lang.Integer calCodeId
calCodeId

calScaleId

protected java.lang.Integer calScaleId
calScaleId

calRuleId

protected java.lang.Integer calRuleId
calRuleId

adminDescription

protected java.lang.String adminDescription
description for admin use
Constructor Detail

CreateDiscountCmdImpl

public CreateDiscountCmdImpl()
Create a Discount Object.
Method Detail

createCalCodeBean

public void createCalCodeBean()
                       throws ECSystemException
Create and populate the calCodeBean
ECSystemException

createCalDescBean

public void createCalDescBean()
                       throws ECSystemException
Create and populate the calDescBean
ECSystemException

createCalRangeBean

public void createCalRangeBean()
                        throws ECSystemException
Create and populate the calRangeBean
ECSystemException

createCalRuleBean

public void createCalRuleBean()
                       throws ECSystemException
Create and populate the calRuleBean
ECSystemException

createCalRuleMgpBean

public void createCalRuleMgpBean()
                          throws ECSystemException
Create and populate the calRuleMgpBean
ECSystemException

createCalRuleScaleBean

public void createCalRuleScaleBean()
                            throws ECSystemException
Create and populate the calRuleScaleBean
ECSystemException

createCalScaleBean

public void createCalScaleBean()
                        throws ECSystemException
Create and populate the calScaleBean
ECSystemException

createCatencalcd

public void createCatencalcd()
                      throws ECSystemException
Create and populate CatalogEntryCalculationCode Bean.
Throws:
ECSystemException - If error exists during creation.

getAdminDescription

public java.lang.String getAdminDescription()
Provide the property Administration Description.
Returns:
java.lang.String

getAssignedShopperGroups

public java.util.Vector getAssignedShopperGroups()
Provide the property assignedShopperGroups.
Returns:
Vector

getCalCodeId

public java.lang.Integer getCalCodeId()
Provide the property Calculation Code.
Returns:
java.lang.Integer

getCode

public java.lang.String getCode()
Provide the property Code, A character string that uniquely identifies this CalculationCode.
Returns:
java.lang.String

getCurrency

public java.lang.String getCurrency()
Provide the property Currency.
Returns:
java.lang.String

getDescription

public java.lang.String getDescription()
Provide the property Shopper's Description.
Returns:
java.lang.String

getDiscountValueVector

public java.util.Vector getDiscountValueVector()
Provide the property Discount Values.
Returns:
java.util.Vector

getDiscSubType

public java.lang.Integer getDiscSubType()
Provide the subtypes of discount.
Returns:
java.lang.Integer

getDiscType

public java.lang.Integer getDiscType()
Provide the property Discount Type.
Returns:
java.lang.Integer

getEndTimestamp

public java.sql.Timestamp getEndTimestamp()
Provide the property End Timestamp of the discount Obj.
Returns:
java.sql.Timestamp

getGroupBy

public java.lang.Integer getGroupBy()
Provide the property GroupBy.
Returns:
java.lang.Integer

getLangId

public java.lang.Integer getLangId()
Provide the property Language ID.
Returns:
java.lang.Integer

getRangeFromVector

public java.util.Vector getRangeFromVector()
Vector of the values that each Discount Range starts from.
Returns:
java.util.Vector

getRangeType

public java.lang.Integer getRangeType()
Provide the property Discount Range type.
Returns:
java.lang.Integer

getStartTimestamp

public java.sql.Timestamp getStartTimestamp()
Provide the property Start Timestamp of the discount Obj.
Returns:
java.sql.Timestamp

isReadyToCallExecute

public boolean isReadyToCallExecute()
true if is ready to call execution method
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
true if we can execute the command false if we canot execute the command

performExecute

public void performExecute()
                    throws ECSystemException,
ECException
Task command execution method, doing the actual work, populating the tables, creating objects.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
ECSystemException
ECException

setAdminDescription

public void setAdminDescription(java.lang.String newAdminDescription)
set the property Administration Description.
Specified by:
setAdminDescription in interface CreateDiscountCmd

setAllShoppers

public void setAllShoppers(boolean newAllShoppers)
set the property allShoppers, if the discount is for all shoppers, this will be set to true.
Specified by:
setAllShoppers in interface CreateDiscountCmd
Parameters:
newAllShoppers - boolean

setAssignedShopperGroups

public void setAssignedShopperGroups(java.util.Vector newAssignedShopperGroups)
set the property assignedShopperGroups
Specified by:
setAssignedShopperGroups in interface CreateDiscountCmd
Parameters:
newAssignedShopperGroups - Vector

setCalCodeId

public void setCalCodeId(java.lang.Integer newCalCodeId)
Set the property Calculation Code ID.
Parameters:
newCalCodeId - java.lang.Integer

setCode

public void setCode(java.lang.String newCode)
Set the property code.
Specified by:
setCode in interface CreateDiscountCmd
Parameters:
newCode - java.lang.String

setCurrency

public void setCurrency(java.lang.String newCurrency)
Set the property Currency.
Specified by:
setCurrency in interface CreateDiscountCmd
Parameters:
newCurrency - java.lang.String

setDescription

public void setDescription(java.lang.String newDescription)
Set the property Shopper's Description.
Specified by:
setDescription in interface CreateDiscountCmd
Parameters:
newDescription - java.lang.String

setDiscountValueVector

public void setDiscountValueVector(java.util.Vector newDiscountValueVector)
Set the property DiscountValueVector.
Specified by:
setDiscountValueVector in interface CreateDiscountCmd
Parameters:
newDiscountValueVector - java.util.Vector

setDiscSubType

public void setDiscSubType(java.lang.Integer newDiscSubType)
Set the property Discount Sub-Type.
Specified by:
setDiscSubType in interface CreateDiscountCmd
Parameters:
newDiscSubType - java.lang.Integer

setDiscType

public void setDiscType(java.lang.Integer newDiscType)
Set the property Discount Type.
Specified by:
setDiscType in interface CreateDiscountCmd
Parameters:
newDiscType - java.lang.Integer

setEndTimestamp

public void setEndTimestamp(java.sql.Timestamp newEndTimestamp)
Set the property EndTimestamp.
Specified by:
setEndTimestamp in interface CreateDiscountCmd
Parameters:
newEndTimestamp - java.sql.Timestamp

setGroupBy

public void setGroupBy(java.lang.Integer newGroupBy)
Set the property GroupBy.
Specified by:
setGroupBy in interface CreateDiscountCmd
Parameters:
newGroupBy - java.lang.Integer

setHasDateTimeRange

public void setHasDateTimeRange(boolean newHasDateTimeRange)
Set the property hasDateTimeRange, this will be true if the Discount Obj has the Time Limit or Schedule.
Specified by:
setHasDateTimeRange in interface CreateDiscountCmd

setLangId

public void setLangId(java.lang.Integer newLangId)
Set the property LanguageId, this method will be removed in release.
Parameters:
newLangId - java.lang.Integer

setRangeFromVector

public void setRangeFromVector(java.util.Vector newRangeFromVector)
Set the property RangeFromVector.
Specified by:
setRangeFromVector in interface CreateDiscountCmd
Parameters:
newRangeFromVector - java.util.Vector

setRangeType

public void setRangeType(java.lang.Integer newRangeType)
Set the property Range Type.
Specified by:
setRangeType in interface CreateDiscountCmd
Parameters:
newRangeType - java.lang.Integer

setStartTimestamp

public void setStartTimestamp(java.sql.Timestamp newStartTimestamp)
Set the property startTimestamp.
Specified by:
setStartTimestamp in interface CreateDiscountCmd
Parameters:
newStartTimestamp - java.sql.Timestamp

setStoreId

public void setStoreId(java.lang.Integer newStoreId)
Set the property storeId, this method will be removed in next release.
Parameters:
newStoreId - java.lang.Integer

createCalCodeMgpBean

public void createCalCodeMgpBean()
                          throws ECSystemException
Create and populate calcodeMgp Bean
ECSystemException