com.ibm.commerce.tools.ecoupon

Class UpdateECouponPromotionTaskCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, UpdateECouponPromotionTaskCmd, 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 UpdateECouponPromotionTaskCmdImpl
    extends TaskCommandImpl
    implements UpdateECouponPromotionTaskCmd
    This command is invoked by the ECouponPromotionUpdateCmdImpl to update ecoupon promotion related tables.
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • UpdateECouponPromotionTaskCmdImpl

        public UpdateECouponPromotionTaskCmdImpl()
        Deprecated. 
        UpdateECouponPromotionTaskCmdImpl constructor.
    • Method Detail

      • getError

        public java.lang.String getError()
        Deprecated. 
        Gets the error. This is null if no error is raised.
        Specified by:
        getError in interface UpdateECouponPromotionTaskCmd
        Returns:
        java.lang.String error message
      • getErrorMessageString

        public java.lang.String getErrorMessageString()
        Deprecated. 
        Gets the error message string. This is null if no error is raised.
        Specified by:
        getErrorMessageString in interface UpdateECouponPromotionTaskCmd
        Returns:
        java.lang.String error message string
      • getLanguageId

        public java.lang.Integer getLanguageId()
        Deprecated. 
        Gets the language ID.
        Returns:
        java.lang.Integer language ID
      • getPromoId

        public java.lang.Integer getPromoId()
        Deprecated. 
        Gets the coupon promotion ID.
        Returns:
        java.lang.Integer coupon promotion ID
      • getXml

        public java.util.Hashtable getXml()
        Deprecated. 
        Gets the coupon promotion XML.
        Returns:
        java.lang.String coupon promotion XML
      • performExecute

        public void performExecute()
                            throws ECException,
                                   ECSystemException,
                                   ECApplicationException
        Deprecated. 
        Updates the coupon promotion general parameters, shopper viewable description, purchase condition, discount type and amount for the specified promotion ID using the coupon promotion parameters in the input XML. Coupon promotion cannot be updated if it is active, its name and purchase condition type cannot be changed. Returns an appropriate error message if the coupon promotion cannot be updated.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
        ECSystemException
        ECApplicationException -

        Behaviour

        The command does the following

        1. Gets the coupon promotion input variables from XML using the populateXml method defined in ECouponDetailsDataBean. If any parameter is missing, it raises ECApplicationException with ECMessage._ERR_CMD_MISSING_PARAM message and the name of the missing parameter.
          1. Invokes the updateGeneral() method to update the general coupon promotion parameters using the CouponPromotionAccessBean.
            1. Invokes the updatePromoDesc() method to update the coupon promotion shopper viewable description using the PromoDescriptionAccessBean. If the description for a language already exists, it overrides the existing description, else it creates a new entry for the description in the new language. Throws an ECSystemException with error message as ECECouponConstant.ECOUPON_UPDATE_GENERAL_ERROR if NamingException or RemoteException occurs.
              1. Invokes the updatePromoProd() method to update the coupon promotion product purchase condition using the PromoProdAccessBean. Obtains the list of the product catalog entries in the existing product purchase condition. Converts the catalog entries to SKUs using the CatalogEntryAccessBean. If a product SKU exists in both the old and the new(updated) product purchase condition, updates the associated required purchase amount. If a product SKU exists only in the old product purchase condition, removes it. If a product SKU exists only in the new product purchase condition, creates a new table entry. Important to note that the input contains product SKUS whereas database stores catalog entry ID.
                1. Invokes the updatePromoCat() method to update the coupon promotion category purchase condition using the PromoCatAccessBean. Obtains the list of the catalog group IDs in the existing category purchase condition. Converts the catalog group IDs to corresponding member identifiers using the CatalogGroupAccessBean. If a catalog group member ID exists in both the old and the new(updated) category purchase condition, updates the associated required purchase maximum and minimum amount and quantities. If a catalog group member ID exists only in the old category purchase condition, removes it. If a catalog group member ID exists only in the new category purchase condition, creates a new table entry. Important to note that the input contains catalog group member IDs whereas database stores catalog group IDs.
                  1. Invokes the updatePromoOrder() method to update the coupon promotion order purchase condition using the PromoOrderAccessBean. Involves updating the minimum and maximum order amount.
                    1. Invokes the updatePromoDiscount() method to update the coupon promotion discount details using the calculation code related access beans. Obtains the calculation code associated with the coupon promotion using the CalculationCodeAccessBean. Updates the time range using the CalculationCodeAccessBean. Updates the calculation code description using the CalculationCodeDescriptionAccessBean. Creates a new entry if a description in the currently used language doesn't exist. Updates the products or categories to be discounted using the CatalogEntryCalculationCodeAccessBean or CatalogGroupCalculationCodeAccessBean respectively depending on the purchase condition type. Updates the type of discount (fixed or percentage) and the discount amount using the CalculationRuleAccessBean, CalculationRuleScaleRelationshipAccessBean, CalculationRangeAccessBean and CalculationRangeLookupResultAccessBean.
                      1. Invokes the RefreshRegistryCmd to update the calculation code registry.
      • setLanguageId

        public void setLanguageId(java.lang.Integer newLanguageId)
        Deprecated. 
        Sets the language ID.
        Specified by:
        setLanguageId in interface UpdateECouponPromotionTaskCmd
        Parameters:
        newLanguageId - language ID
      • setLocale

        public void setLocale(java.util.Locale newLocale)
        Deprecated. 
        Sets the locale.
        Specified by:
        setLocale in interface UpdateECouponPromotionTaskCmd
        Parameters:
        newLocale - locale
      • setPromoId

        public void setPromoId(java.lang.Integer newPromoId)
        Deprecated. 
        Sets the coupon promotion ID.
        Specified by:
        setPromoId in interface UpdateECouponPromotionTaskCmd
        Parameters:
        newPromoId - coupon promotion ID
      • setStoreId

        public void setStoreId(java.lang.Integer newStoreId)
        Deprecated. 
        Sets the store ID.
        Specified by:
        setStoreId in interface UpdateECouponPromotionTaskCmd
        Parameters:
        newStoreId - store ID
      • setXml

        public void setXml(java.util.Hashtable newXml)
        Deprecated. 
        Sets the coupon promotion XML.
        Specified by:
        setXml in interface UpdateECouponPromotionTaskCmd
        Parameters:
        newXmlFile - coupon promotion XML