com.ibm.commerce.tools.optools.order.util

Class PromotionCodeCentral

  • java.lang.Object
    • com.ibm.commerce.tools.optools.order.util.PromotionCodeCentral


  • public class PromotionCodeCentral
    extends java.lang.Object
    Utility class for promotion codes.
    If Commerce Version 7 Feature pack 1 is not enabled, this utility class only supports public promotion and order operation.
    If Commerce Version 7 Feature pack 1 is enabled, this utility class supports all promotion code types (unique promotion code and public promotion).
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM Copyright statement.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void addOrderItemPromotionCode(java.lang.Long orderItemID, java.lang.String code)
      This method adds the Promotion Code specified to the specified orderItem.
      static void addOrderPromotionCode(java.lang.Long orderID, java.lang.String code)
      This method adds the Promotion Code specified to the specified order.
      If Commerce Version 7 Feature pack 1 is not enabled, the method will only support adds the public promotion codes to the specified order.
      If Commerce Version 7 Feature pack 1 is enabled, the method will support adds the public and unique promotion codes to the specified order.
      static java.lang.String[] getOrderItemPromotionCodes(java.lang.Long orderItemID)
      This method returns the Promotion Codes associated with a specified orderItem.
      static java.lang.String[] getOrderPromotionCodes(java.lang.Long orderID)
      This method returns the Promotion Codes associated with a specified order.
      static java.lang.String[] getOrderPublicPromotionCodes(java.lang.Long orderID)
      This method returns the public Promotion Codes associated with a specified order.
      static java.lang.String[] getOrderUniquePromotionCodes(java.lang.Long orderID)
      This method returns the unique Promotion Codes associated with a specified order.
      static void removeAllCodesForOrder(java.lang.Long ordersID)
      This method removes all the Promotion Codes from the specified order.
      static void removeAllCodesForOrderItem(java.lang.Long orderItemID)
      This method removes all the Promotion Codes from the specified orderItem.
      static void removeOrderItemPromotionCode(java.lang.Long orderItemID, java.lang.String code)
      This method removes the Promotion Code specified from the specified orderItem.
      static void removeOrderPromotionCode(java.lang.Long orderID, java.lang.String code)
      This method removes the Promotion Code specified from the specified order.
      If Commerce Version 7 Feature pack 1 is not enabled, the method will only support removes the public promotion codes from the specified order.
      If Commerce Version 7 Feature pack 1 is enabled, the method will support removes the public and unique promotion codes to the specified order.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

      • getOrderPromotionCodes

        public static java.lang.String[] getOrderPromotionCodes(java.lang.Long orderID)
                                                         throws ECApplicationException,
                                                                ECSystemException
        This method returns the Promotion Codes associated with a specified order.
        Parameters:
        orderID - The order id of the order for which the promotion codes are required.
        Returns:
        array of Order Promotion codes
        Throws:
        ECApplicationException - The ECApplicationException.
        ECSystemException - The ECSystemException.
      • getOrderPublicPromotionCodes

        public static java.lang.String[] getOrderPublicPromotionCodes(java.lang.Long orderID)
                                                               throws ECApplicationException,
                                                                      ECSystemException
        This method returns the public Promotion Codes associated with a specified order.
        Parameters:
        orderID - The order id of the order for which the promotion codes are required.
        Returns:
        array of Order public Promotion codes
        Throws:
        ECApplicationException - The ECApplicationException.
        ECSystemException - The ECSystemException.
      • getOrderUniquePromotionCodes

        public static java.lang.String[] getOrderUniquePromotionCodes(java.lang.Long orderID)
                                                               throws ECApplicationException,
                                                                      ECSystemException
        This method returns the unique Promotion Codes associated with a specified order.
        Parameters:
        orderID - The order id of the order for which the promotion codes are required.
        Returns:
        array of Order unique Promotion codes
        Throws:
        ECApplicationException - The ECApplicationException.
        ECSystemException - The ECSystemException.
      • getOrderItemPromotionCodes

        public static java.lang.String[] getOrderItemPromotionCodes(java.lang.Long orderItemID)
                                                             throws ECApplicationException,
                                                                    ECSystemException
        This method returns the Promotion Codes associated with a specified orderItem.
        Parameters:
        orderItemID - The orderItem id of the orderItem for which the promotion codes are required.
        Returns:
        array of Order Promotion codes
        Throws:
        ECApplicationException - The ECApplicationException.
        ECSystemException - The ECSystemException.
      • addOrderPromotionCode

        public static void addOrderPromotionCode(java.lang.Long orderID,
                                                 java.lang.String code)
                                          throws ECApplicationException,
                                                 ECSystemException
        This method adds the Promotion Code specified to the specified order.
        If Commerce Version 7 Feature pack 1 is not enabled, the method will only support adds the public promotion codes to the specified order.
        If Commerce Version 7 Feature pack 1 is enabled, the method will support adds the public and unique promotion codes to the specified order. The method will firstly get the promotion code type and add the promotion code to the order with different logic according to the promotion type.
        Parameters:
        orderID - The order id of the order to which the promotion code is to be added.
        code - The promotion code string to be added to the specified order.
        Throws:
        ECApplicationException - The ECApplicationException.
        ECSystemException - The ECSystemException.
      • addOrderItemPromotionCode

        public static void addOrderItemPromotionCode(java.lang.Long orderItemID,
                                                     java.lang.String code)
                                              throws ECSystemException
        This method adds the Promotion Code specified to the specified orderItem.
        Parameters:
        orderItemID - The orderItem id of the orderItem to which the promotion code is to be added.
        code - The promotion code string to be added to the specified orderItem.
        Throws:
        ECSystemException - The ECSystemException.
      • removeOrderPromotionCode

        public static void removeOrderPromotionCode(java.lang.Long orderID,
                                                    java.lang.String code)
                                             throws ECSystemException
        This method removes the Promotion Code specified from the specified order.
        If Commerce Version 7 Feature pack 1 is not enabled, the method will only support removes the public promotion codes from the specified order.
        If Commerce Version 7 Feature pack 1 is enabled, the method will support removes the public and unique promotion codes to the specified order.
        Parameters:
        orderID - The order id of the order from which the promotion code is to be removed.
        code - The promotion code string to be removed from the specified order.
        Throws:
        ECSystemException - The ECSystemException.
      • removeOrderItemPromotionCode

        public static void removeOrderItemPromotionCode(java.lang.Long orderItemID,
                                                        java.lang.String code)
                                                 throws ECSystemException
        This method removes the Promotion Code specified from the specified orderItem.
        Parameters:
        orderItemID - The orderItem id of the orderItem from which the promotion code is to be removed.
        code - The promotion code string to be removed from the specified orderItem.
        Throws:
        ECSystemException - The ECSystemException.
      • removeAllCodesForOrder

        public static void removeAllCodesForOrder(java.lang.Long ordersID)
                                           throws ECSystemException
        This method removes all the Promotion Codes from the specified order.
        If Commerce Version 7 Feature pack 1 is not enabled, the method will only support removes all the public promotion codes from the specified order.
        If Commerce Version 7 Feature pack 1 is enabled, the method will support removes all the public and unique promotion codes to the specified order.
        Parameters:
        ordersID - The order id of the order from which the promotion codes are to be removed.
        Throws:
        ECSystemException - The ECSystemException.
      • removeAllCodesForOrderItem

        public static void removeAllCodesForOrderItem(java.lang.Long orderItemID)
                                               throws ECSystemException
        This method removes all the Promotion Codes from the specified orderItem.
        Parameters:
        orderItemID - The orderItem id of the orderItem from which the promotion codes are to be removed.
        Throws:
        ECSystemException - The ECSystemException.