com.ibm.commerce.tools.promotions
Class CreateDiscountCmdImpl

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

public class CreateDiscountCmdImpl
extends TaskCommandImpl
implements CreateDiscountCmd, ECPromotionsConstants

This task command which implements CreateDiscountCmd interface is creating a discount


Field Summary
protected  java.lang.String adminDescription
           
protected  boolean allShoppers
           
protected  java.util.Vector assignedShopperGroups
           
protected  java.lang.Integer calCodeId
           
protected  java.lang.Integer calRuleId
           
protected  java.lang.Integer calScaleId
           
protected  java.lang.String code
           
static java.lang.String COPYRIGHT
           
protected  java.lang.String currency
           
protected  java.lang.String description
           
protected  java.util.Vector discountValueVector
           
protected  java.lang.Integer discSubType
           
protected  java.lang.Integer discType
           
protected  java.sql.Timestamp endTimestamp
           
protected  java.lang.Integer groupBy
           
protected  boolean hasDateTimeRange
           
protected  java.lang.Integer langId
           
protected  java.util.Vector rangeFromVector
           
protected  java.lang.Integer rangeType
           
protected  java.sql.Timestamp startTimestamp
           
protected  java.lang.Integer storeId
           
 
Fields inherited from class com.ibm.commerce.command.AbstractECCommand
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
 
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()
          isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command.
 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.AbstractECCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters
 

Field Detail

adminDescription

protected java.lang.String adminDescription

allShoppers

protected boolean allShoppers

assignedShopperGroups

protected java.util.Vector assignedShopperGroups

calCodeId

protected java.lang.Integer calCodeId

calRuleId

protected java.lang.Integer calRuleId

calScaleId

protected java.lang.Integer calScaleId

code

protected java.lang.String code

COPYRIGHT

public static final java.lang.String COPYRIGHT

currency

protected java.lang.String currency

description

protected java.lang.String description

discountValueVector

protected java.util.Vector discountValueVector

discSubType

protected java.lang.Integer discSubType

discType

protected java.lang.Integer discType

endTimestamp

protected java.sql.Timestamp endTimestamp

groupBy

protected java.lang.Integer groupBy

hasDateTimeRange

protected boolean hasDateTimeRange

langId

protected java.lang.Integer langId

rangeFromVector

protected java.util.Vector rangeFromVector

rangeType

protected java.lang.Integer rangeType

startTimestamp

protected java.sql.Timestamp startTimestamp

storeId

protected java.lang.Integer storeId
Constructor Detail

CreateDiscountCmdImpl

public CreateDiscountCmdImpl()
Create a Discount Object.
Method Detail

createCalCodeBean

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

createCalCodeMgpBean

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

createCalDescBean

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

createCalRangeBean

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

createCalRuleBean

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

createCalRuleMgpBean

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

createCalRuleScaleBean

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

createCalScaleBean

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

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()
Description copied from class: AbstractECCommand
isReadyToCallExecute method is called by the Targetable Command frame work This is where client side parameter checking is performed before the execution of the command. The default implementation is to return true.

Overrides:
isReadyToCallExecute in class AbstractECCommand
Following copied from class: com.ibm.commerce.command.AbstractECCommand
Returns:
boolean - 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 AbstractECCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

setAdminDescription

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

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
Parameters:
new_hasDateTimeRange - boolean

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