com.ibm.commerce.negotiation.commands
Class BidCreateFormCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.ControllerCommandImpl
                    |
                    +--com.ibm.commerce.negotiation.commands.BidCreateFormCmdImpl
All Implemented Interfaces:
AccCommand, BidCreateFormCmd, ControllerCommand, ECCommand, ECTargetableCommand
Direct Known Subclasses:
AutoBidCreateFormCmdImpl

public class BidCreateFormCmdImpl
extends ControllerCommandImpl
implements BidCreateFormCmd

Displays the Bid Create Form page after completing the following tasks:

  1. 1. Generate a bid reference number.
  2. 2. Verify that the user is authorized to participate in the bidding process.
  3. 3. Verify that the user has viewed the Auction rules.
See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          Copyright statement.
static java.lang.String EC_BID_FORM_CREATE_ERROR_VIEW_CMD
          The default Error View
 
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl
requestProperties, responseProperties, retriable, viewReqProperties
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.negotiation.commands. BidCreateFormCmd
defaultCommandClassName, NAME
 
Constructor Summary
BidCreateFormCmdImpl()
          BidCreateFormImpl default constructor.
 
Method Summary
protected  java.lang.String genBidReferenceKey()
          Generates and returns a unique bid reference key.
protected  java.lang.Long getAuctionReferenceNumber()
          Returns the auction reference number for which a bid is to be created.
protected  java.lang.String getBidType()
          Returns this bid type.
protected  java.lang.String getLocalErrorTaskName()
          Returns this command's error task name.
protected  void handleException(java.lang.Exception e)
          Formats an ECException based on the input exception value.
protected  boolean isBidderQualified()
          Checks if current Bidder (user) is qualified to Bid on the current auction.
 boolean isReadyToCallExecute()
          Verifies that the this command is ready to be executed.
 void performExecute()
          Executes a bid form create task.
protected  void setAuctionReferenceNumber(java.lang.String auctionReferenceKey)
          Sets the auction reference number for which a bid is to be created.
protected  void setBidType(java.lang.String bidType)
          Sets this bid type.
protected  void setLocalErrorTaskName(java.lang.String errorTaskName)
          Sets this command's error task name
 void setRequestProperties( TypedProperty requestParam)
          Saves the Mandatory and optional command parameter values.
protected  boolean validBidderStatus()
          Checks that the bidder status is valid for the current auction.
 
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
 
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkParameters, checkResourcePermission, createCommandExecutionEvent, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
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. ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command. AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command. ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getResources, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 

Field Detail
public static final java.lang.String COPYRIGHT
Copyright statement.
See Also:
Constant Field Values

EC_BID_FORM_CREATE_ERROR_VIEW_CMD

public static final java.lang.String EC_BID_FORM_CREATE_ERROR_VIEW_CMD
The default Error View
See Also:
Constant Field Values
Constructor Detail

BidCreateFormCmdImpl

public BidCreateFormCmdImpl()
BidCreateFormImpl default constructor.
Method Detail

genBidReferenceKey

protected java.lang.String genBidReferenceKey()
                                       throws ECException
Generates and returns a unique bid reference key.
Returns:
String - a unique bid reference key.
Throws:
ECException - - throws an exception if encountered during GenBidReferenceKey command execution.

getAuctionReferenceNumber

protected java.lang.Long getAuctionReferenceNumber()
Returns the auction reference number for which a bid is to be created.
Returns:
Long - Auction reference number

getBidType

protected java.lang.String getBidType()
Returns this bid type.
Returns:
java.lang.String - Regular bid, or auto bid

getLocalErrorTaskName

protected java.lang.String getLocalErrorTaskName()
Returns this command's error task name.
Returns:
tring - Error task name

handleException

protected void handleException(java.lang.Exception e)
                        throws ECException
Formats an ECException based on the input exception value.
Parameters:
e - Exception - The exception instance to be formatted.
Throws:
ECException - - could be one of many diffrenet exceptions: ECApplicationException. RemoteException, CreateException, FinderException, or NamingException.

isBidderQualified

protected boolean isBidderQualified()
                             throws ECException
Checks if current Bidder (user) is qualified to Bid on the current auction.
Returns:
boolean = true if user is qualified, otherwise false
Throws:
ECException - - thorws an exception if an error occurred while executing the bidder qualification task.

isReadyToCallExecute

public boolean isReadyToCallExecute()
Verifies that the this command is ready to be executed.
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
boolean =true if command is ready, otherwise false.

performExecute

public void performExecute()
                    throws ECException
Executes a bid form create task.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - -

setAuctionReferenceNumber

protected void setAuctionReferenceNumber(java.lang.String auctionReferenceKey)
                                  throws InvalidParameterValueException
Sets the auction reference number for which a bid is to be created.
Parameters:
auctionReferenceKey - String - String representation for auction reference number
Throws:
InvalidParameterValueException - - Throws an exception if the auction reference number is not numeric.

setBidType

protected void setBidType(java.lang.String bidType)
Sets this bid type.
Parameters:
bidType - java.lang.String - Regular or Auto bid type.

setLocalErrorTaskName

protected void setLocalErrorTaskName(java.lang.String errorTaskName)
Sets this command's error task name
Parameters:
errorTaskName - java.lang.String

setRequestProperties

public void setRequestProperties(TypedProperty requestParam)
                          throws ECApplicationException
Saves the Mandatory and optional command parameter values.
Specified by:
setRequestProperties in interface ControllerCommand
Overrides:
setRequestProperties in class ControllerCommandImpl
Parameters:
requestParam - TypedProperty
Throws:
ECApplicationException: - An exception is returned if the mandatory parameter (auction reference number) is missing, or invalid
ECApplicationException

validBidderStatus

protected boolean validBidderStatus()
                             throws ECException
Checks that the bidder status is valid for the current auction.
Returns:
boolean - true if bidder status is valid, otherwise false.
Throws:
ECException - - An exception is thrown if encountered an while showing the bidder the auction rules.