java.lang.Object | +--com.ibm.commerce.price.commands.PriceCalculationHelper
This PriceCalculationHelper
Class provides utility methods for
performing the price calculation.
Field Summary | |
---|---|
static java.math.BigDecimal |
BIG_DECIMAL_ZERO String of big decimal "0" |
static java.lang.String |
COPYRIGHT IBM copyright notice field. |
static java.lang.Double |
DOUBLE_ZERO String of "0" for dboule type |
static java.lang.String |
ERRTASK_NAME String of RetrievePriceErrorView |
static java.lang.Integer |
INTEGER_ZERO String of "0" for integer type |
static java.lang.Long |
LONG_ZERO String of "0" for Long type |
static java.lang.Object |
NULL String of object NULL |
Constructor Summary | |
---|---|
PriceCalculationHelper() PriceCalculationHelper constructor comment. |
Method Summary | |
---|---|
void |
createPriceBusinessPolicy(java.lang.String aPriceListName,
java.lang.Long aPriceListOwner, java.lang.Integer aStoreEntityId,
java.lang.String aPolicyName) Creates a price business policy. |
void |
deletePriceBusinessPolicy(java.lang.String aPriceListId,
java.lang.Integer aStoreEntityId) Deletes a price business policy. |
java.lang.Long[] |
findAllMasterCatalogPriceLists(
StoreAccessBean aStoreAB) Retrieves the price lists associated with master catalog (Fast Method). |
java.lang.String |
genMarkers(int num) Generates parameter markers for the IN search predicate. |
java.lang.Long[] |
getAllMasterCatalogPriceLists(
StoreAccessBean aStoreAB) Retrieves the price lists associated with master catalog (Alternative Method). |
java.util.Hashtable |
getAllPolicyPriceLists(
StoreAccessBean aStoreAB) Retrieves the price list business policies. |
java.util.Hashtable |
getAllPolicyPriceProperties(
StoreAccessBean aStoreAB) Retrieves the price list business policy properties. |
java.util.Vector |
getAllStandardPriceListAccessBeans() Retrieves the standard price list access beans. |
java.util.Vector |
getAllStandardPriceLists() Retrieves the ids of standard price list. |
MonetaryAmount |
getDynamicKitPrice(java.lang.String aCurrency,
CommandContext aCommandContext,
java.lang.String astrConfigurationId,
OrderItemAccessBean aabOrderItem) get dynamic kit price |
MonetaryAmount |
getDynamicKitPrice(java.lang.String aCurrency,
CommandContext aCommandContext,
java.lang.String astrConfigurationId,
OrderItemAccessBean aabOrderItem,
java.util.Vector avecOrderItemComponents) get dynamic kit price |
java.lang.String |
getInPredicate(java.lang.Object[] objects) Composes the IN search predicate. |
static
PriceCalculationHelper |
getInstance() Get PriceCalculationHelper instance |
java.lang.Long |
getMemberIdFromPrcPolicyProperties(
TypedProperty aparam) Get member Id from properties retrieved from price policy |
java.lang.String |
getPolicyPriceList(java.lang.String aPolicyProperties) Retrieves the price list associated with a policy. |
java.lang.String |
getPolicyProductSet(java.lang.String aPolicyProperties) Retrieves the product set associated with a policy. |
void |
handlePriceNotFoundException(
ItemPriceInfo aItemPriceInfo, java.lang.String aCurrency,
java.lang.String aClassName) Handles the price not found exception. |
boolean |
isBestPrice(
QualifyingOfferInfo offerInfo,
java.math.BigDecimal aPriceValue) Compares two prices for the best. |
boolean |
processOfferPricesVector(
QualifyingOfferInfo offerInfo, java.util.Vector offerPricesVector,
java.lang.String requestedCurrency,
OfferAccessBean offer,
StoreAccessBean storeAB) Process the prices for a specific offer. |
void |
setPriceListProductSetId(java.lang.String aPriceListId,
java.lang.String aProductSetId) Sets the product set id in the price list. |
MonetaryAmount |
setRoundCustomizedPrice(MonetaryAmount aPrice,
StoreAccessBean aStoreAB) Rounds up the input price. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll,
toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
public static final java.lang.Object NULL
public static final java.math.BigDecimal BIG_DECIMAL_ZERO
public static final java.lang.Double DOUBLE_ZERO
public static final java.lang.Integer INTEGER_ZERO
public static final java.lang.Long LONG_ZERO
public static final java.lang.String ERRTASK_NAME
Constructor Detail |
---|
public PriceCalculationHelper()
Method Detail |
---|
public void createPriceBusinessPolicy(java.lang.String aPriceListName, java.lang.Long aPriceListOwner, java.lang.Integer aStoreEntityId, java.lang.String aPolicyName) throws ECException, java.sql.SQLException
aPriceListName
- the name of the price list for the
policy.aPriceListOwner
- the owner id of the price list.aStoreEntityId
- the id the store.aPolicyName
- the name for the policy.ECException
java.sql.SQLException
public void deletePriceBusinessPolicy(java.lang.String aPriceListId, java.lang.Integer aStoreEntityId) throws ECException
aPriceListId
- the id of the price list.aStoreEntityId
- the id the store.ECException
public java.lang.Long[] findAllMasterCatalogPriceLists(StoreAccessBean aStoreAB) throws ECException
aStoreAB
- the access bean of the store which owns the master
catalog.
ECException
public java.lang.Long[] getAllMasterCatalogPriceLists(StoreAccessBean aStoreAB) throws ECException
aStoreAB
- the access bean of the store which owns the master
catalog.
ECException
public java.util.Hashtable getAllPolicyPriceLists(StoreAccessBean aStoreAB) throws ECException
aStoreAB
- the access bean of the store which owns the
policies.
ECException
public java.util.Hashtable getAllPolicyPriceProperties(StoreAccessBean aStoreAB) throws ECException
aStoreAB
- the access bean of the store which owns the
policies.
ECException
public java.util.Vector getAllStandardPriceListAccessBeans() throws ECException
ECException
public java.util.Vector getAllStandardPriceLists() throws ECException
ECException
public MonetaryAmount getDynamicKitPrice(java.lang.String aCurrency, CommandContext aCommandContext, java.lang.String astrConfigurationId, OrderItemAccessBean aabOrderItem) throws ECException
aCurrency
- the currencyaCommandContext
- the command context for this classaabOrderItem
- the orderItem accessbeanECException
public MonetaryAmount getDynamicKitPrice(java.lang.String aCurrency, CommandContext aCommandContext, java.lang.String astrConfigurationId, OrderItemAccessBean aabOrderItem, java.util.Vector avecOrderItemComponents) throws ECException
aCurrency
- the currencyaCommandContext
- the command context for this classaabOrderItem
- the orderItem accessbeanavecOrderItemComponents
- a vector of orderItemsECException
public java.lang.String getInPredicate(java.lang.Object[] objects)
objects
-public java.lang.String genMarkers(int num)
public static PriceCalculationHelper getInstance()
public java.lang.Long getMemberIdFromPrcPolicyProperties(TypedProperty aparam) throws ECException
aparam
- the TypedPropertyECException
public java.lang.String getPolicyPriceList(java.lang.String aPolicyProperties) throws ECException
aPolicyProperties
- the properties defined in the policy.
ECException
public java.lang.String getPolicyProductSet(java.lang.String aPolicyProperties) throws ECException
aPolicyProperties
- the properties defined in the policy.
ECException
public void handlePriceNotFoundException(ItemPriceInfo aItemPriceInfo, java.lang.String aCurrency, java.lang.String aClassName) throws ECException
aItemPriceInfo
- the item pricing info for a catalog
entry.aCurrency
- the currency for the catalog entry.aClassName
- the name of the Class that detects the
exception.ECException
public boolean isBestPrice(QualifyingOfferInfo offerInfo, java.math.BigDecimal aPriceValue)
offerInfo
- the offer info containing the price for
comparison.aPriceValue
- the second price for comparison.
public boolean processOfferPricesVector(QualifyingOfferInfo offerInfo, java.util.Vector offerPricesVector, java.lang.String requestedCurrency, OfferAccessBean offer, StoreAccessBean storeAB) throws ECException
offerInfo
- a qualified offer info.offerPricesVector
- a vector of prices for an offer.requestedCurrency
- the shopper's requested currency.offer
- offer access beanstoreAB
- the store access bean.ECException
public void setPriceListProductSetId(java.lang.String aPriceListId, java.lang.String aProductSetId) throws ECException
aPriceListId
- the price list IDaProductSetId
- the product set IDECException
public MonetaryAmount setRoundCustomizedPrice(MonetaryAmount aPrice, StoreAccessBean aStoreAB) throws ECSystemException
aPrice
- the price monetary amount.
ECSystemException