com.ibm.commerce.orderquotation.commands
Class QuotationUtility

java.lang.Object
  |
  +--com.ibm.commerce.orderquotation.commands.QuotationUtility

public class QuotationUtility
extends java.lang.Object

Miscellaneous methods.


Constructor Summary
QuotationUtility()
           
 
Method Summary
static java.lang.Integer calcBaseItemQuantity(java.lang.String theUOM, java.lang.Double theQuantity, BaseItemAccessBean theBaseItemAB)
          Calculates the base item quantity (with rounding DOWN).
static java.lang.Integer calcBaseItemQuantityUp(java.lang.String theUOM, java.lang.Double theQuantity, BaseItemAccessBean theBaseItemAB)
          Calculates the base item quantity (with rounding UP).
static QuantityAmount calcQuantityAmount( OrderItemAccessBean theOrderItemAB, CommandContext theCommandContext, java.lang.Long theReferralInterfacePolicyId)
          Calculates the quantity amount.
static  BaseItemAccessBean getBaseItemOf( OrderItemAccessBean theOrderItemAB)
          Gets the base item access bean related to the order item access bean
static java.lang.Long getDefaultContractReferralInterfacePolicyId( CommandContext commandContext, java.lang.Integer anStoreId)
          Returns the policy Id of the ReferralInterface for the default Contract ID of the specified Store ID.
static java.lang.Long getReferralInterfacePolicyIdFor(java.lang.Long theTradingAgreementId, CommandContext commandContext)
          Sets the referral interface policy id based on the trading access bean for the quotation request.
static java.lang.String mapUOM(java.lang.String theUOM, CommandContext theCommandContext, java.lang.Long theReferralInterfacePolicyId)
          Maps the unit of measure from the Websphere Commerce system to the external system.
static java.lang.String mapUOMToWCUnit(java.lang.String theUOM, CommandContext theCommandContext, java.lang.Long theReferralInterfacePolicyId)
          Maps the unit of measure to the Websphere Commerce system from the external system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuotationUtility

public QuotationUtility()
Method Detail

getReferralInterfacePolicyIdFor

public static java.lang.Long getReferralInterfacePolicyIdFor(java.lang.Long theTradingAgreementId,
CommandContext commandContext)
                                                      throws ECException
Sets the referral interface policy id based on the trading access bean for the quotation request.
Parameters:
theTradingAgreementId - The contract id.
commandContext - The command context.
Returns:
The referral interface policy id.
Throws:
ECSystemException - Raised with message _ERR_CREATE_EXCEPTION if there is a javax.ejb.CreateException, _ERR_FINDER_EXCEPTION if there is a javax.ejb.FinderException, _ERR_NAMING_EXCEPTION if there is a javax.naming.NamingException, _ERR_REMOTE_EXCEPTION if there is a java.rmi.RemoteException.
ECException

getBaseItemOf

public static BaseItemAccessBean getBaseItemOf(OrderItemAccessBean theOrderItemAB)
                                        throws ECException
Gets the base item access bean related to the order item access bean
Parameters:
theOrderItemAB - The order item access bean.
Returns:
The base item access bean.
Throws:
ECSystemException - Raised with message _ERR_CREATE_EXCEPTION if there is a javax.ejb.CreateException, _ERR_FINDER_EXCEPTION if there is a javax.ejb.FinderException, _ERR_NAMING_EXCEPTION if there is a javax.naming.NamingException, _ERR_REMOTE_EXCEPTION if there is a java.rmi.RemoteException.
ECException

mapUOM

public static java.lang.String mapUOM(java.lang.String theUOM,
CommandContext theCommandContext,
                                      java.lang.Long theReferralInterfacePolicyId)
                               throws ECException
Maps the unit of measure from the Websphere Commerce system to the external system.
Parameters:
theUOM - The unit of measure (in Websphere Commerce units) to convert.
theCommandContext - The command context.
theReferralInterfacePolicyId - The referral interface policy id.
Returns:
The unit of measure in external units.
Throws:
ECException

mapUOMToWCUnit

public static java.lang.String mapUOMToWCUnit(java.lang.String theUOM,
CommandContext theCommandContext,
                                              java.lang.Long theReferralInterfacePolicyId)
                                       throws ECException
Maps the unit of measure to the Websphere Commerce system from the external system.
Parameters:
theUOM - The unit of measure (in external units) to convert.
theCommandContext - The command context.
theReferralInterfacePolicyId - The referral interface policy id.
Returns:
The unit of measure in Websphere Commerce units.
Throws:
ECException

calcQuantityAmount

public static QuantityAmount calcQuantityAmount(OrderItemAccessBean theOrderItemAB,
CommandContext theCommandContext,
                                                java.lang.Long theReferralInterfacePolicyId)
                                         throws ECException
Calculates the quantity amount.
Parameters:
theOrderItemAB - The order item access bean data.
theCommandContext - The command context.
theReferralInterfacePolicyId - The referral interface policy id.
Returns:
A quantity amount.
Throws:
ECSystemException - Raised with message _ERR_CREATE_EXCEPTION if there is a javax.ejb.CreateException, _ERR_FINDER_EXCEPTION if there is a javax.ejb.FinderException, _ERR_NAMING_EXCEPTION if there is a javax.naming.NamingException, _ERR_REMOTE_EXCEPTION if there is a java.rmi.RemoteException.
ECException

calcBaseItemQuantityUp

public static java.lang.Integer calcBaseItemQuantityUp(java.lang.String theUOM,
                                                       java.lang.Double theQuantity,
BaseItemAccessBean theBaseItemAB)
                                                throws ECException
Calculates the base item quantity (with rounding UP).
Parameters:
theUOM - The unit of measure.
theQuantity - The quantity to use to calculate the base item quantity.
theBaseItemAB - The base item access bean.
Returns:
The base item quantity. Returns 0 if theQuantity is less than or equal to 0.
Throws:
ECException - These exceptions are allowed to percolate.

calcBaseItemQuantity

public static java.lang.Integer calcBaseItemQuantity(java.lang.String theUOM,
                                                     java.lang.Double theQuantity,
BaseItemAccessBean theBaseItemAB)
                                              throws ECException
Calculates the base item quantity (with rounding DOWN).
Parameters:
theUOM - The unit of measure.
theQuantity - The quantity to use to calculate the base item quantity.
theBaseItemAB - The base item access bean.
Returns:
The base item quantity. Returns 0 if theQuantity is less than or equal to 0.
Throws:
ECException - These exceptions are allowed to percolate.

getDefaultContractReferralInterfacePolicyId

public static java.lang.Long getDefaultContractReferralInterfacePolicyId(CommandContext commandContext,
                                                                         java.lang.Integer anStoreId)
                                                                  throws ECException
Returns the policy Id of the ReferralInterface for the default Contract ID of the specified Store ID.
Parameters:
commandContext - The command context.
anStoreId - the Store ID.
Returns:
the Policy ID.
Throws:
ECException