com.ibm.commerce.tools.ecoupon

Class ECouponPromotionPublishCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand, ECouponPromotionPublishCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable

    Deprecated. 
    The WC54 coupon feature will be replaced by the WC56 promotion engine coupon feature.

    public class ECouponPromotionPublishCmdImpl
    extends ToolsControllerCommandImpl
    implements ECouponPromotionPublishCmd
    Marks the status of the coupon promotion, specified by the promoId in the request properties, in the CouponPromotionAccessBean as per the status in the request properties. The requested status can be delete, activate or deactivate. If the coupon promotion is already active or inactive, it sets the appropriate message in the response properties. It deactives or deletes a coupon promotion only if no coupons have been offered to the shoppers so far. Also marks the status of the corresponding calculation code in the CalculationCodeAccessBean "published" field. Sets the response properties to return to the list of coupon promotions.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • ECouponPromotionPublishCmdImpl

        public ECouponPromotionPublishCmdImpl()
        Deprecated. 
    • Method Detail

      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 
        Marks the status of the coupon promotion in the CouponPromotionAccessBean as per the status in the request properties, subject to certain constraints. The requested status can be delete, activate or deactivate.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException -

        Behaviour

        The command does the following

        1. It obtains the coupon promotion status for the promoId using CouponPromotionAccessBean.
          1. If checks the status passed in request. If the status in request is 2, it checks if coupons have been offered to the shoppers so far, it sets the coupon promotion status in the database as "D".
            1. Else if any of the conditions for deleting are not met, it sets "CannotDelete" message in the response properties and returns to the coupon promotion list view.
              1. If the status in request is activate, and the status is already "A" in database, sets "AlreadyActive" message in the response properties and returns to the coupon promotion list view. Else it sets the coupon promotion status in the database as "A".
                1. If the status in request is deactivate, and the status is already "I" in database, sets "AlreadyInActive" message in the response properties and returns to the coupon promotion list view.
                  1. Else it checks if no coupons have been offered to the shoppers so far, it sets the coupon promotion status in the database as "I".
                    1. Else if any of the conditions for deactivating are not met, it sets "CannotDeactive" message in the response properties and returns to the coupon promotion list view.
                      1. Sets the status in the CalculationCodeAccessBean "published" field and refreshes the calculation registry.
                        1. Sets the response properties to return to the list of coupon promotions.
      • validateParameters

        public void validateParameters()
                                throws ECException
        Deprecated. 
        Validates the parameters of the command.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        Here is a summary of all the parameters passed in request properties hashtable.
        Parameter Name Valid Type Optional/Mandatory
        ECECouponConstant.EC_Promo_IdString - Name of promotion Mandatory
        ECECouponConstant.EC_StatusString - Status of promotion Mandatory

        Behaviour

        The command does the following

        1. It extracts the coupon promotion ID and the promotion status from the request properties.
          1. It creates a coupon promotion access bean and initializes it with the promotion ID.