|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.orderitems.commands.OrderItemsCmdHelper
This is a helper class containing some useful methods used in the order item related commands.
Field Summary | |
static int |
PRICEREF_COMPLETE_REFRESH
|
static int |
PRICEREF_DEFAULT
|
static int |
PRICEREF_QUICK_COMPLETE_REFRESH
|
static int |
PRICEREF_QUICK_REFRESH
|
Constructor Summary | |
OrderItemsCmdHelper()
OrderProcessingHelper constructor comment. |
Method Summary | |
static java.lang.String[] |
getEligibleTradingAgreements(CommandContext commandContext,
java.lang.Long memberId)
Obtaints a list of eligible trading agreements to be used. |
static OrderItemsCmdHelper |
getUniqueInstance()
Get the unique instance of the OrderItemsCmdHelper object. |
static void |
insertOrderItemOffer(OrderItemAccessBean orderitemAB,
java.lang.Long[] offerIds)
Saves the offers that were used for searching the price for an orderitem. |
static void |
insertOrderItemTrading(OrderItemAccessBean orderitemAB,
java.lang.Long[] tradingIds)
Saves the trading agreements that were used for searching the price for an orderitem. |
static boolean |
isTradingAgreementValid(java.lang.Long tradingId,
java.lang.String[] eligibleTradingIds)
Verifies the input trading agreement against a list of eligible trading agreements. |
static java.lang.Long[] |
resolveTradingAgreements(CommandContext commandContext,
OrderItemAccessBean orderitemAB,
java.lang.Long[] tradingIds,
int refreshFlag)
Verifies and resolves a list of eligible trading agreements for the user. |
static java.lang.Long[] |
retrieveOffers(OrderItemAccessBean orderitemAB,
int refreshFlag,
boolean retryFlag)
Retrieves previously searched offers for an orderitem based on the Price Refresh Flag (PRICEREFFLAGS) in STORE: 0: Default, same as 1 except that it will not save the offer id. |
static java.lang.Long[] |
retrieveTradings(CommandContext commandContext,
OrderItemAccessBean orderitemAB,
int refreshFlag,
boolean retryFlag)
Retrieves previously searched offers for an orderitem based on the Price Refresh Flag (PRICEREFFLAGS) in STORE: 0: Default, same as 1 except that it will not save the trading agreement id. |
static void |
updateContractId(OrderItemAccessBean orderitemAB,
StoreAccessBean storeAB)
Saves the default contract id that provided the price for the orderitem (old support). |
static void |
updateTotalProductPrice(OrderItemAccessBean orderitemAB)
Update the total price for the order item. |
static void |
updateTradingId(OrderItemAccessBean orderitemAB,
StoreAccessBean storeAB,
java.lang.Long anTradingId)
Saves the trading agreement ids that provided the best price for the orderitem. |
static void |
verifyTradingPaymentMethods(CommandContext commandContext,
java.util.Enumeration enOrderItemABs)
Validate the trading agreements used by the orderitems in an order by checking if they define compatible payment methods and are associated with the same account as the other orderitems in the order. |
static java.lang.Long[] |
verifyTradingPaymentMethods(CommandContext commandContext,
OrderItemAccessBean orderitemAB,
java.lang.Long[] tradingIds)
Verifies if the trading agreements being used in an orderitem have defined compatible payment methods with those trading agreements that are being used in the order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PRICEREF_COMPLETE_REFRESH
public static final int PRICEREF_DEFAULT
public static final int PRICEREF_QUICK_COMPLETE_REFRESH
public static final int PRICEREF_QUICK_REFRESH
Constructor Detail |
public OrderItemsCmdHelper()
Method Detail |
public static java.lang.String[] getEligibleTradingAgreements(CommandContext commandContext, java.lang.Long memberId) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
The eligible list of trading agreements can be obtained directly from the Command Context (if no member id is provided or the input member id is the one in Command Context) or retrieved by means of the member id (if the id is provided and is different from that in the Command Context).
commandContext
- the current command context.memberId
- the id of the member.
public static OrderItemsCmdHelper getUniqueInstance()
public static void insertOrderItemOffer(OrderItemAccessBean orderitemAB, java.lang.Long[] offerIds) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.offerIds
- the ids of the offers to be saved.public static void insertOrderItemTrading(OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.tradingIds
- the ids of the tradings to be saved.public static boolean isTradingAgreementValid(java.lang.Long tradingId, java.lang.String[] eligibleTradingIds) throws ECException
tradingId
- the id of the trading agreement to be verified.eligibleTradingIds
- the ids of the list of eligible trading agreements.
public static java.lang.Long[] resolveTradingAgreements(CommandContext commandContext, OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds, int refreshFlag) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
If trading agreements are specified, the input list will be verified against the eligible list before they will be used.
If the orderitem is newly created but no trading agreements are specified, the trading agreements can be obtained from the Command Context if the input member id is the one in Command Context or retrieved by means of the member id (if the id is provided and is different from that in the Command Context). Existing orderitem will have the price refreshed according to the price refresh flag.
commandContext
- the command context.orderitemAB
- the access bean of the orderitem.tradingIds
- the input trading agreement ids.refreshFlag
- the price refresh flag.
public static java.lang.Long[] retrieveOffers(OrderItemAccessBean orderitemAB, int refreshFlag, boolean retryFlag) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.refreshFlag
- the price refresh flag.retryFlag
- the price calculation retry flag.
public static java.lang.Long[] retrieveTradings(CommandContext commandContext, OrderItemAccessBean orderitemAB, int refreshFlag, boolean retryFlag) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.refreshFlag
- the price refresh flag.retryFlag
- the price calculation retry flag.
public static void updateContractId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.storeAB
- the access bean of the store.public static void updateTotalProductPrice(OrderItemAccessBean orderitemAB) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
public static void updateTradingId(OrderItemAccessBean orderitemAB, StoreAccessBean storeAB, java.lang.Long anTradingId) throws ECException, javax.ejb.FinderException, javax.ejb.CreateException, javax.naming.NamingException, java.rmi.RemoteException, java.sql.SQLException
orderitemAB
- the access bean of the orderitem.storeAB
- the access bean of the store.anTradingId
- the id of the trading agreement.public static void verifyTradingPaymentMethods(CommandContext commandContext, java.util.Enumeration enOrderItemABs) throws ECException
public static java.lang.Long[] verifyTradingPaymentMethods(CommandContext commandContext, OrderItemAccessBean orderitemAB, java.lang.Long[] tradingIds) throws ECException
commandContext
- the command context.orderitemAB
- the access bean of the orderitem.tradingIds
- the trading agreement ids to be used in the orderitem.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |