public class OrderItemShippingModeListDataBean extends SmartDataBeanImpl implements SmartDataBean, Delegator
This OrderItemShippingModeListDataBean
databean filters the allowable shipping modes and gives the estimated
shipping charge for the given orderItems.
Inputs:
orderItemId
sets one orderItem to the databean.orderItemIds
sets a list of orderItems to the databean.allowableShippingModeIds
sets a list of allowable shipping modes to the databean.
If this parameter is not set, the databean retrieves the union of allowable shipping modes for each passed orderItem.calculateShippingCharge
is set to true, it gives the estimated shipping charge for each shipping mode.resolveFulfillmentCenter
is set to true, it resolves the fulfillment centers for the orderItems before
calculating shipping charge.calculateShippingAdjustment
is set to true, the returned estimated shipping charge includes shipping
promotions and shipping adjustments.checkAppliedItems
is true in default. If you do not want to filter non-applicable shipping modes,
set this flag to false.
But ordinarily, users do not need to care about this flag.Output:
Use shippingModes
to get a list of filtered shipping mode databeans.
Use shippingCharges
to get a list of estimated shipping charges for each shipping mode.
<c:remove var="orderItemShippingModeList"/>
<wcbase:useBean id="orderItemShippingModeList" classname="com.ibm.commerce.fulfillment.beans.OrderItemShippingModeListDataBean">
<c:set target="${orderItemShippingModeList}" property="orderItemIds" value="${orderItemIds}"/>
<c:set target="${orderItemShippingModeList}" property="resolveFulfillmentCenter" value="true"/>
<c:set target="${orderItemShippingModeList}" property="calculateShippingCharge" value="true"/>
<c:set target="${orderItemShippingModeList}" property="calculateShippingAdjustment" value="true"/>
</wcbase:useBean>
<table>
<tr>
<th>Shipping Mode ID</th>
<th>Shipping Mode Description</th>
<th>Shipping Charge</th>
</tr>
<c:forEach items="${orderItemShippingModeList.shippingModes}" var="shippingMode" varStatus="status">
<tr>
<td><c:out value="${shippingMode.shippingModeId}"/></td>
<td><c:out value="${shippingMode.description.description}"/></td>
<td><c:out value="${orderItemShippingModeList.shippingCharges[status.index]}"/></td>
</tr>
</c:forEach>
</table>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
The IBM copyright notice field.
|
emptyString
Constructor and Description |
---|
OrderItemShippingModeListDataBean() |
Modifier and Type | Method and Description |
---|---|
CommandContext |
getCommandContext()
Returns the command context.
|
Protectable |
getDelegate()
This method gets the delegate.
|
FormattedMonetaryAmountDataBean[] |
getShippingCharges()
Returns the shipping charges corresponding to the available shipping
modes.
|
ShippingModeDataBean[] |
getShippingModes()
Returns the shipping modes available to the order.
|
void |
populate()
This method populates the data bean according to the passed parameters.
|
void |
setAllowableShippingModeIds(java.lang.Integer[] anAllowableShippingModeIds)
Sets the inAllowableShippingModeIds.
|
void |
setCalculateShippingAdjustment(boolean abCalculateShippingAdjustment)
This method sets whether to calculate the shipping adjustments of the shipping modes.
|
void |
setCalculateShippingCharge(boolean abCalculateShippingCharge)
Sets whether to calculate the shipping charges of the shipping modes.
|
void |
setCheckAppliedItems(boolean abCheckAppliedItems)
This method sets whether to filter shipping modes by checking applied items.
|
void |
setCommandContext(CommandContext aCommandContext)
Sets the command context.
|
void |
setOrderItemId(java.lang.Long anOrderItemId)
Sets the orderItem ID.
|
void |
setOrderItemIds(java.lang.Long[] aOrderItemIds)
Sets the orderItem IDs.
|
void |
setRequestProperties(TypedProperty aRequestProperties)
Sets the request properties.
|
void |
setResolveFulfillmentCenter(boolean abResolveFulfillmentCenter)
Sets whether to resolve a fulfillment center before calculating shipping
charges.
|
fulfills, getHttpRequest, getHttpResponse, getResources, getViewCommandContext, setHttpRequest, setHttpResponse, setViewCommandContext
getRequestProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRequestProperties
public static final java.lang.String COPYRIGHT
public Protectable getDelegate() throws java.lang.Exception
getDelegate
in interface Delegator
java.lang.Exception
Delegator.getDelegate()
public void populate() throws java.lang.Exception
This method populates the data bean according to the passed parameters.
retrieveAllowalbeShippingModes(Item)
to retrieve all allowable shipping modes
for the order item.calculateShippingCharge
parameter is true:
resolveFulfillmentCenter
parameter is true, it
calls #resolveFulfillmentCenter(Item)
to try to resolve the fulfillment centers
for the specified shipping mode and shipping address. If the resolve fulfillment center succeeds,
it means this shipping mode is applicable to the order item and the shipping address.#calculateShippingCharge(Item, Integer)
method to calculate
the shipping charge for the orderItem using the specified shipping mode.calculateShippingCharge
parameter is false or not indicated, returns a zero shipping charge for the specified
shipping mode for the item.populate
in interface SmartDataBean
populate
in class SmartDataBeanImpl
java.lang.Exception
public void setOrderItemId(java.lang.Long anOrderItemId)
anOrderItemId
- the orderItem ID.public void setOrderItemIds(java.lang.Long[] aOrderItemIds)
aOrderItemIds
- the orderItem IDs.public void setAllowableShippingModeIds(java.lang.Integer[] anAllowableShippingModeIds)
anAllowableShippingModeIds
- the inAllowableShippingModeIds.public void setCalculateShippingCharge(boolean abCalculateShippingCharge)
abCalculateShippingCharge
- Set to true to calculate the shipping charges.public void setCalculateShippingAdjustment(boolean abCalculateShippingAdjustment)
abCalculateShippingAdjustment
- true if the shipping charges are to be calculated.public void setCheckAppliedItems(boolean abCheckAppliedItems)
abCheckAppliedItems
- true if non-applicable shipping modes are to be filtered.public void setResolveFulfillmentCenter(boolean abResolveFulfillmentCenter)
ResolveFulfillmentCenterCmd
or
GetEligibleFulfillmentCentersCmd
. Set to true
if the fulfillment center affects either the shipping mode availability or the shipping
charge. The default value is false.abResolveFulfillmentCenter
- true if fulfillment center is to be resolved.public ShippingModeDataBean[] getShippingModes()
public FormattedMonetaryAmountDataBean[] getShippingCharges()
getShippingModes()
public void setRequestProperties(TypedProperty aRequestProperties) throws java.lang.Exception
orderId
- see setOrderItemId(Long)
calculateShippingCharge
- see
setCalculateShippingCharge(boolean)
resolveFulfillmentCenter
- see
setResolveFulfillmentCenter(boolean)
setRequestProperties
in interface InputDataBean
setRequestProperties
in class InputDataBeanImpl
aRequestProperties
- the request properties.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.InputDataBean#setRequestProperties(com.ibm.commerce.datatype.TypedProperty)
public CommandContext getCommandContext()
getCommandContext
in interface SmartDataBean
getCommandContext
in class SmartDataBeanImpl
SmartDataBean.getCommandContext()
public void setCommandContext(CommandContext aCommandContext)
setCommandContext
in interface SmartDataBean
setCommandContext
in class SmartDataBeanImpl
aCommandContext
- the command context.SmartDataBean.setCommandContext(com.ibm.commerce.command.CommandContext)