com.ibm.commerce.fulfillment.beans

Class OrderShippingModeListDataBean

  • java.lang.Object
    • com.ibm.commerce.fulfillment.beans.OrderShippingModeListDataBean
  • All Implemented Interfaces:
    DataBean, InputDataBean, SmartDataBean, Delegator, java.io.Serializable


    public class OrderShippingModeListDataBean
    extends java.lang.Object
    implements SmartDataBean, Delegator

    This data bean lists the shipping modes available to a given order, and optionally calculates the shipping charge of each shipping mode.

    Options:
    • resolveFulfillmentCenter. If this parameter is set to true, the databean will resolve the fulfillment centers of the given items before calculating the shipping charge. Because some shipping charge configuration is related to the fulfillment center.
    • calculateShippingCharge. If this parameter is set to true, this databean will return the shipping charge of each shipping mode.
    • calculateShippingAdjustment. If this parameter is set to true, while calculating the shipping charge, will add the shipping adjustment of the shipping promotion result.
    • checkAppliedItems. This parameter is set to true in default. When it is true, not-applicable shipping modes will be filtered. And this is the most popular behavior. Only if customer does not want to filter not-applicable shipping modes, they can set this flag to false. In default, this flag needs not to be set.
    Usages:
    • retrieve shipping modes allowed by the contracts.
    • retrieve shipping modes with shipping charge. In other words, to filtering out the shipping mode with no shipping charge calculated.
    • calculate shipping charge.
    • calculate shipping charge with promotion adjustment. Note: as promotion is qualified for whole order, not per order item, the result may be different to the real charge.
    Usage and options mapping table:
      retrieve shipping modes allowed by the contracts retrieve shipping modes with shipping charge calculate shipping charge calculate shipping charge with promotion adjustment
    resolveFulfillmentCenter   true true true
    calculateShippingCharge   true true true
    calculateShippingAdjustment       true

    Notes: Flag-checkAppliedItems needs not to be set in default. Only if customer does not want to filter not-applicable shipping modes, they can set it to false.

    JSP usage example:

     <wcbase:useBean id="orderShippingModeList" classname="com.ibm.commerce.fulfillment.beans.OrderShippingModeListDataBean">
            <c:set target="${orderShippingModeList}" property="order" value="${orderBean}"/>
            <c:set target="${orderShippingModeList}" property="calculateShippingCharge" value="true"/>
            <c:set target="${orderShippingModeList}" property="calculateShippingAdjustment" value="true"/>
            <c:set target="${orderShippingModeList}" property="resolveFulfillmentCenter" value="true"/>
     </wcbase:useBean>
     
     <table>
            <tr>
                    <th>Shipping Mode</th>
                    <th>Shipping Charge</th>
            </tr>
            <c:forEach items="${orderShippingModeList.shippingModes}" var="shippingMode" varStatus="status">
                    <tr>
                            <td><c:out value="${shippingMode.description.description}"/></td>
                            <td><c:out value="${orderShippingModeList.shippingCharges[status.index]}"/></td>
                    </tr>     
            </c:forEach>
     </table>
     

    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

      • OrderShippingModeListDataBean

        public OrderShippingModeListDataBean()
        The OrderShippingModeListDataBean constructor.
    • Method Detail

      • getRequestProperties

        public TypedProperty getRequestProperties()
        This method returns the request properties.
        Specified by:
        getRequestProperties in interface InputDataBean
        Returns:
        the request properties.
        See Also:
        InputDataBean#getRequestProperties()
      • setRequestProperties

        public void setRequestProperties(TypedProperty aRequestProperties)
                                  throws java.lang.Exception
        This method sets the request properties. The following request properties will be recognized:
        Specified by:
        setRequestProperties in interface InputDataBean
        Parameters:
        aRequestProperties - the request properties.
        Throws:
        java.lang.Exception - Thrown if there is a problem when setting the request properties. This particular method should not throw any exception because it just stores the request properties.
        See Also:
        InputDataBean#setRequestProperties(com.ibm.commerce.datatype.TypedProperty)
      • setOrderId

        public void setOrderId(java.lang.Long anOrderId)
        This method sets the order ID.
        Parameters:
        anOrderId - the order ID.
      • setOrder

        public void setOrder(OrderDataBean adbOrder)
        This method sets the order.
        Parameters:
        adbOrder - the order.
      • setCalculateShippingCharge

        public void setCalculateShippingCharge(boolean abCalculateShippingCharge)
        This method sets whether to calculate the shipping charges of the shipping modes. False by default.
        Parameters:
        abCalculateShippingCharge - true if the shipping charges are to be calculated.
      • setCalculateShippingAdjustment

        public void setCalculateShippingAdjustment(boolean abCalculateShippingAdjustment)
        This method sets whether to calculate the shipping adjustments of the shipping modes. False by default.
        Parameters:
        abCalculateShippingAdjustment - true if the shipping charges are to be calculated.
      • setCheckAppliedItems

        public void setCheckAppliedItems(boolean abCheckAppliedItems)
        This method sets whether to filter shipping modes by checking applied items. Its default value is true.Not applicable shipping modes will be filtered.
        Parameters:
        abCheckAppliedItems - true if not-applicable shipping modes are to be filtered.
      • setResolveFulfillmentCenter

        public void setResolveFulfillmentCenter(boolean abResolveFulfillmentCenter)
        This method sets whether to resolve fulfillment center before calculating shipping charges. Either ResolveFulfillmentCenterCmd or GetEligibleFulfillmentCentersCmd is called. Should be set to true if fulfillment center affects shipping mode availability and/or shipping charge. False by default.
        Parameters:
        abResolveFulfillmentCenter - true if fulfillment center is to be resolved.
      • getShippingModes

        public ShippingModeDataBean[] getShippingModes()
        This method returns the shipping modes available to the order.
        Returns:
        the available shipping modes.
      • getDelegate

        public Protectable getDelegate()
                                throws java.lang.Exception
        This method returns the delegate of this databean.
        Specified by:
        getDelegate in interface Delegator
        Returns:
        the delegate of this databean.
        Throws:
        java.lang.Exception
        See Also:
        Delegator.getDelegate()
      • populate

        public void populate()
                      throws java.lang.Exception
        This method is used to populate the XXXpopulateDataBean.
        Specified by:
        populate in interface SmartDataBean
        Throws:
        java.lang.Exception