com.ibm.commerce.couponoffer.commands

Class AcceptCouponFromBannerAdCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, AcceptCouponFromBannerAdCmd, Protectable, 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 AcceptCouponFromBannerAdCmdImpl
    extends ControllerCommandImpl
    implements AcceptCouponFromBannerAdCmd
    This command creates an eCoupon and puts it in the wallet of the customer when she clicks on a banner ad or on the URL sent in a promotional e-mail to accept an eCoupon.

    If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName (and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of coupons can be issued for this promotion) or number of coupons already issued from this promotion is less then total number of coupons that can be issued, then a coupon may be issued. Further, the customer should not have already accepted too many coupons. If the user is unregistered and accepts the coupon from e-mail, number of coupons already accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean. Then an entry is created in the CouponWalletAccessBean. The number of accepted coupons is updated for this promotion. If the conditions are not satisfied then an error page is displayed.

    See Also:
    Serialized Form
    • Constructor Detail

      • AcceptCouponFromBannerAdCmdImpl

        public AcceptCouponFromBannerAdCmdImpl()
        Deprecated. 
        AcceptCouponFromBannerAdCmdImpl constructor,calls super.
    • Method Detail

      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Deprecated. 
        It always returns true.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        boolean
      • performExecute

        public void performExecute()
                            throws ECException
        Deprecated. 

        If the promotion in CouponPromotionAccessBean corresponding to the parameter promoName (and optionally the storeId), has an ACTIVE status and if TOTALNUMOFFER is -1 (implying any number of coupons can be issued for this promotion) or number of coupons already issued from this promotion is less then total number of coupons that can be issued, then a coupon may be issued. Further, the customer should not have already accepted too many coupons. If the user is unregistered and accepts the coupon from e-mail, number of coupons already accepted is found from the PromoAcceptedAccessBean for that user's SHOPPEREMAILID. For registered shoppers, the number of coupons accepted is found from the CouponWalletAccessBean. Then an entry is created in the CouponWalletAccessBean. The number of accepted coupons is updated for this promotion. If the conditions are not satisfied then an error page is displayed.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - If a problem is encountered while creating or finding an EJB.
      • setStoreId

        public void setStoreId(java.lang.Integer newStoreId)
        Deprecated. 
        Sets the store ID.
        Parameters:
        newStoreId - java.lang.Integer
      • validateParameters

        public void validateParameters()
                                throws ECException
        Deprecated. 
        It extracts the parameters from request and command context and checks for their correctness.

        It takes the promoName, acceptedFromType, successURL and shopperEmailId from the request. It takes storeId and userId from the commandContext. It finds the promotionId for this promoName.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException - If a problem is encountered while creating or finding an EJB.