|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.commerce.command.AbstractECCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.price.commands.SelectContractPricesCmdImpl
This SelectContractPricesCmd
Task Command Implementation
selects the best offer among all the qualified offers for the input catalog
entry.
If the command is successful retrieving the price, it will return the best price, the offer id and access bean, the T&C id and the trading agreement id that determined the price.
If unsuccessful, the command throws the ECApplicationException specifying an Error Message (ERR_RETRIEVE_PRICE), an Error Code (ERR_CODE_NO_PRICE) and the Error View (RetrievePriceErrorView).
Behaviour The best offer will be selected based on the following criteria:
Exception Conditions
If ErrorMode is false, these errors will be ignored and a null value price will be passed back to the caller.
Field Summary | |
static java.lang.String |
COPYRIGHT
|
Fields inherited from class com.ibm.commerce.command.AbstractECCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.price.commands.SelectContractPricesCmd |
defaultCommandClassName, NAME |
Constructor Summary | |
SelectContractPricesCmdImpl()
|
Method Summary | |
protected QualifyingOfferInfo |
findBestOffer(java.util.Hashtable aOfferInfoHash,
ItemPriceInfo aItemPriceInfo)
Finds the best offer for a catalog entry. |
ItemPriceInfo[] |
getItemPriceInfo()
Returns the internal item info structure. |
void |
performExecute()
Executes main business logic of the command. |
protected void |
selectOffer()
Selects the best offer for a catalog entry. |
protected void |
selectTradingOffers()
Selects the best offer for a catalog entry for each trading agreement. |
void |
setCurrency(java.lang.String astrCurrency)
Sets the currency to be used for finding the price (Optional). |
void |
setErrorMode(boolean aErrorMode)
Sets the flag to indicate if exception will be thrown when the price cannot be found for the input catentry (Optional). |
void |
setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
Sets the item info structure for internal use on calculating the prices. |
void |
setStoreId(java.lang.Integer aStoreId)
Sets the id of the input store to be used for calculating the price (Optional). |
void |
validateParameters()
Checks mandatory parameters. |
Methods inherited from class com.ibm.commerce.command.AbstractECCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Field Detail |
public static final java.lang.String COPYRIGHT
Constructor Detail |
public SelectContractPricesCmdImpl()
Method Detail |
protected QualifyingOfferInfo findBestOffer(java.util.Hashtable aOfferInfoHash, ItemPriceInfo aItemPriceInfo) throws ECException
aOfferInfoHash
- the list of offers for selection.aItemPriceInfo
- the item price info.
public ItemPriceInfo[] getItemPriceInfo()
getItemPriceInfo
in interface SelectContractPricesCmd
com.ibm.commerce.price.commands.SelectContractPricesCmd
public void performExecute() throws ECException
performExecute
in interface ECCommand
performExecute
in class AbstractECCommand
com.ibm.commerce.command.ECCommand
com.ibm.commerce.command.CommandException
- The superclass for all ECExceptions.protected void selectOffer() throws ECException
protected void selectTradingOffers() throws ECException
public void setCurrency(java.lang.String astrCurrency)
setCurrency
in interface SelectContractPricesCmd
com.ibm.commerce.price.commands.SelectContractPricesCmd
astrCurrency
- The currency to look up the price.
If the currency is not specified then the "negotiated" currency is used for
the store Id and shopper's preferred currency. (The negotiated currency is
the currency returned from the getCurrency() method of the currency manager).public void setErrorMode(boolean aErrorMode)
setErrorMode
in interface SelectContractPricesCmd
com.ibm.commerce.price.commands.SelectContractPricesCmd
aErrorMode
- The indicator to decide if an exception will be thrown when the
price cannot be found.
A true value (default) means throw exception.
A false value means do not throw exception and returns a null value pricepublic void setItemPriceInfo(ItemPriceInfo[] aItemPriceInfo)
setItemPriceInfo
in interface SelectContractPricesCmd
com.ibm.commerce.price.commands.SelectContractPricesCmd
aItemPriceInfo
- the item info structure for storing information
such as the trading agreements, price lists that will be used for
calculating the prices of the items.public void setStoreId(java.lang.Integer aStoreId)
setStoreId
in interface SelectContractPricesCmd
com.ibm.commerce.price.commands.SelectContractPricesCmd
aStoreId
- The reference number of a store to be used for calculating the
price. If the store id is not specified then the store id of the command context
will be used.public void validateParameters() throws ECException
validateParameters
in interface ECCommand
validateParameters
in class AbstractECCommand
com.ibm.commerce.command.ECCommand
ECException.
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |