com.ibm.commerce.order.commands
Class PreProcessOrderCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.order.commands.PreProcessOrderCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, PreProcessOrderCmd, ProcessOrderCmd, TaskCommand

public class PreProcessOrderCmdImpl
extends TaskCommandImpl
implements PreProcessOrderCmd

Pre process order

See Also:
Serialized Form

Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.order.commands. PreProcessOrderCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.order.commands. ProcessOrderCmd
VAL_NOTIFY_NO, VAL_NOTIFY_YES
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
PreProcessOrderCmdImpl()
           
 
Method Summary
 java.lang.String getAvailabilityChangeURL()
          Gets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.
 java.lang.Long getBillToRn()
          Gets the reference number of the address to bill.
 java.lang.String getExternalPassword()
          Gets the external password
 java.lang.String getExternalUserId()
          Gets the external user id
 java.lang.Integer getField1()
          Gets merchant-customizable field one.
 java.math.BigDecimal getField2()
          Gets merchant-customizable field two.
 java.lang.String getField3()
          Gets merchant-customizable field three.
 java.lang.Long getMaxAvailabilityChange()
          Gets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
 java.lang.String getNoInventoryURL()
          Gets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
 java.lang.Short getNotifyMerchant()
          Determines whether the store should be notified when the order processing is complete.
 java.lang.Short getNotifyOrderSubmitted()
          Determines whether the customer should be notified when the order is successfully submitted for processing.
 java.lang.Short getNotifyShopper()
          Determines whether the customer should be notified when the order processing is complete.
 java.lang.Long getOrderRn()
          Gets the order reference number.
 java.lang.String getQuotationSubmission()
          Gets the quotationSubmission parameter.
 java.lang.String getQuoteExpiredURL()
          Gets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
 java.lang.String getQuoteExpiryPolicy()
          Gets the policy which determines the command behaviour if the order total expires or an order item's fulfillment center changes during inventory allocation.
 java.lang.String getReduceParentQuantities()
          Gets the reduceParentQuantities parameter.
  TypedProperty getResponseProperties()
          Gets the response properties object for the calling controller command to use.
protected  java.lang.String getTransferMode()
          Gets the transferMode property of the command.
 boolean isReadyToCallExecute()
          Checks the validity of the parameters
 void performExecute()
          Main business logic
protected  void reduceParentQuantities( OrderAccessBean parentOrderAB, OrderAccessBean orderAB)
          Reduce the parent order item quantity.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
 void setAvailabilityChangeURL(java.lang.String newAvailabilityChangeURL)
          Sets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.
 void setBillToRn(java.lang.Long anBillToRn)
          Sets the reference number of the address to bill.
 void setExternalPassword(java.lang.String astrExternalPassword)
          Sets the external password
 void setExternalUserId(java.lang.String astrExternalUserId)
          Sets the external user id
 void setField1(java.lang.Integer anField1)
          Sets merchant-customizable field one.
 void setField2(java.math.BigDecimal adField2)
          Sets merchant-customizable field two.
 void setField3(java.lang.String astrField3)
          Sets merchant-customizable field three.
 void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
          Sets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
 void setNoInventoryURL(java.lang.String newNoInventoryURL)
          Sets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
 void setNotificationAttributes(java.util.Hashtable aNotificationAttributes)
          Sets the notification attributes
 void setNotifyMerchant(java.lang.Short newNotifyMerchant)
          Specifies whether to notify the merchant when the order has been processed.
 void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
          Specifies whether the customer should be notified when the order is successfully submitted for processing.
 void setNotifyShopper(java.lang.Short newNotifyShopper)
          Specifies whether to notify the shopper when the order has been processed.
 void setOrderRn(java.lang.Long anOrderRn)
          Sets the order reference number.
 void setQuotationSubmission(java.lang.String astrQuotationSubmission)
          Sets the quotationSubmission parameter.
 void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
          Sets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
 void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
          Sets the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation.
 void setReduceParentQuantities(java.lang.String astrReduceParentQuantities)
          Sets the reduceParentQuantities parameter.
 void setRequestProperties( TypedProperty reqParms)
          Sets the request properties.
 void setTransferMode(java.lang.String transferMode)
          Sets the transferMode property of the command.
protected  void updateQuotationSubmissionAndReduceParentQuantities( OrderAccessBean anabOrder)
          Update the reltype of OrderQuotaionRel from select to submission and reduce the parent order quantities.
 void validateParameters()
          Checks the validity of the parameters
 
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, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

PreProcessOrderCmdImpl

public PreProcessOrderCmdImpl()
Method Detail

getAvailabilityChangeURL

public java.lang.String getAvailabilityChangeURL()
Gets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method.
Returns:
URL

getBillToRn

public java.lang.Long getBillToRn()
Gets the reference number of the address to bill.
Returns:
address id

getField1

public java.lang.Integer getField1()
Gets merchant-customizable field one.
Returns:
field1

getField2

public java.math.BigDecimal getField2()
Gets merchant-customizable field two.
Returns:
field2

getField3

public java.lang.String getField3()
Gets merchant-customizable field three.
Returns:
field3

getMaxAvailabilityChange

public java.lang.Long getMaxAvailabilityChange()
Gets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method.
Returns:
time interval

getNoInventoryURL

public java.lang.String getNoInventoryURL()
Gets the URL to redirect to if any of the order items in the order cannot be allocated or backordered.
Returns:
URL

getNotifyMerchant

public java.lang.Short getNotifyMerchant()
Determines whether the store should be notified when the order processing is complete.
Returns:
notify merchant parameter.

getNotifyOrderSubmitted

public java.lang.Short getNotifyOrderSubmitted()
Determines whether the customer should be notified when the order is successfully submitted for processing.
Returns:
notify order submitted parameter.

getNotifyShopper

public java.lang.Short getNotifyShopper()
Determines whether the customer should be notified when the order processing is complete.
Returns:
notify shopper parameter.

getQuotationSubmission

public java.lang.String getQuotationSubmission()
Gets the quotationSubmission parameter.
Returns:
quote submission parameter.

getOrderRn

public java.lang.Long getOrderRn()
Gets the order reference number.
Returns:
order id

getQuoteExpiredURL

public java.lang.String getQuoteExpiredURL()
Gets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
Returns:
URL

getQuoteExpiryPolicy

public java.lang.String getQuoteExpiryPolicy()
Gets the policy which determines the command behaviour if the order total expires or an order item's fulfillment center changes during inventory allocation.
Returns:
quote expiry policy

getReduceParentQuantities

public java.lang.String getReduceParentQuantities()
Gets the reduceParentQuantities parameter.
Returns:
reduce parent quantities parameter.

getExternalUserId

public java.lang.String getExternalUserId()
Gets the external user id
Returns:
Returns a String

setExternalUserId

public void setExternalUserId(java.lang.String astrExternalUserId)
Sets the external user id
Specified by:
setExternalUserId in interface ProcessOrderCmd
Parameters:
astrExternalUserId - The external user id to set

getExternalPassword

public java.lang.String getExternalPassword()
Gets the external password
Returns:
external password

setExternalPassword

public void setExternalPassword(java.lang.String astrExternalPassword)
Sets the external password
Specified by:
setExternalPassword in interface ProcessOrderCmd
Parameters:
astrExternalPassword - The external password to set

getResponseProperties

public TypedProperty getResponseProperties()
Gets the response properties object for the calling controller command to use.
Specified by:
getResponseProperties in interface ProcessOrderCmd
Returns:
response properties

isReadyToCallExecute

public boolean isReadyToCallExecute()
Checks the validity of the parameters
Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Returns:
boolean

performExecute

public void performExecute()
                    throws ECException
Main business logic
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException

reduceParentQuantities

protected void reduceParentQuantities(OrderAccessBean parentOrderAB,
OrderAccessBean orderAB)
                               throws FinderException,
                                      java.rmi.RemoteException,
                                      CreateException,
                                      javax.naming.NamingException,
                                      java.sql.SQLException,
ECException
Reduce the parent order item quantity.
Parameters:
parentOrderAB - parent order access bean
orderAB - child order access bean
Throws:
CreateException
java.rmi.RemoteException
javax.naming.NamingException
java.sql.SQLException
FinderException
ECException

reset

public void reset()
This method should be called after a command has been executed to reset its states variables.
Overrides:
reset in class AbstractECTargetableCommand

setAvailabilityChangeURL

public void setAvailabilityChangeURL(java.lang.String newAvailabilityChangeURL)
Sets the URL to redirect to when the estimated availability time plus the shipping offset for any order item moves into the future (as a result of allocating or backordering inventory) by more than the time interval specified by the setMaxAvailabilityChange method. This parameter is ignored if ATP inventory allocation is not enabled.
Specified by:
setAvailabilityChangeURL in interface ProcessOrderCmd
Parameters:
newAvailabilityChangeURL - URL

setBillToRn

public void setBillToRn(java.lang.Long anBillToRn)
Sets the reference number of the address to bill.
Specified by:
setBillToRn in interface ProcessOrderCmd
Parameters:
anBillToRn - address id

setField1

public void setField1(java.lang.Integer anField1)
Sets merchant-customizable field one.
Specified by:
setField1 in interface ProcessOrderCmd
Parameters:
anField1 - field1

setField2

public void setField2(java.math.BigDecimal adField2)
Sets merchant-customizable field two.
Specified by:
setField2 in interface ProcessOrderCmd
Parameters:
adField2 - field2

setField3

public void setField3(java.lang.String astrField3)
Sets merchant-customizable field three.
Specified by:
setField3 in interface ProcessOrderCmd
Parameters:
astrField3 - field3

setMaxAvailabilityChange

public void setMaxAvailabilityChange(java.lang.Long newMaxAvailabilityChange)
Sets the time interval, in seconds, used with the url set by the setAvailabilityChangeURL method. The default value is 3600 (one hour). This parameter is ignored if the availabilityChangeURL is not specified, or if ATP inventory allocation is not enabled.
Specified by:
setMaxAvailabilityChange in interface ProcessOrderCmd
Parameters:
newMaxAvailabilityChange -

setNoInventoryURL

public void setNoInventoryURL(java.lang.String newNoInventoryURL)
Sets the URL to redirect to if any of the order items in the order cannot be allocated or backordered. This parameter is ignored if ATP inventory allocation is not enabled.
Specified by:
setNoInventoryURL in interface ProcessOrderCmd
Parameters:
newNoInventoryURL - URL

setNotifyMerchant

public void setNotifyMerchant(java.lang.Short newNotifyMerchant)
Specifies whether to notify the merchant when the order has been processed. If the value set to 1, the merchant will be notified. If the value is set to 0, the merchant will not be notified.
Specified by:
setNotifyMerchant in interface ProcessOrderCmd
Parameters:
newNotifyMerchant -

setNotifyOrderSubmitted

public void setNotifyOrderSubmitted(java.lang.Short newNotifyOrderSubmitted)
Specifies whether the customer should be notified when the order is successfully submitted for processing. Valid values include :

1=Yes

0=No (default)

Specified by:
setNotifyOrderSubmitted in interface ProcessOrderCmd
Parameters:
newNotifyOrderSubmitted -

setNotifyShopper

public void setNotifyShopper(java.lang.Short newNotifyShopper)
Specifies whether to notify the shopper when the order has been processed. If the value set to 1, the shopper will be notified. If the value is set to 0, the shopper will not be notified.
Specified by:
setNotifyShopper in interface ProcessOrderCmd
Parameters:
newNotifyShopper -

setQuotationSubmission

public void setQuotationSubmission(java.lang.String astrQuotationSubmission)
Sets the quotationSubmission parameter.
Specified by:
setQuotationSubmission in interface ProcessOrderCmd
Parameters:
astrQuotationSubmission -

setOrderRn

public void setOrderRn(java.lang.Long anOrderRn)
Sets the order reference number.
Specified by:
setOrderRn in interface ProcessOrderCmd
Parameters:
anOrderRn - order id

setQuoteExpiredURL

public void setQuoteExpiredURL(java.lang.String newQuoteExpiredURL)
Sets the URL to redirect to if the order total expired in agreement with the expiry policy set by the setQuoteExpiryPolicy method.
Specified by:
setQuoteExpiredURL in interface ProcessOrderCmd
Parameters:
newQuoteExpiredURL - URL

setQuoteExpiryPolicy

public void setQuoteExpiryPolicy(java.lang.String newQuoteExpiryPolicy)
Sets the behavior of the command if the order total expires or an order item's fulfillment center changes during inventory allocation. Order total expires if the current time is greater than or equal to the order last update timestamp plus the number of seconds specified in the QUOTEGOODFOR column of the STORE table. This parameter may have three values:
  1. alwaysProceed - always proceed with processing the order after recalculating order total.
  2. stopOnBiggerTotal - proceed with processing the order if the recalculated order total is unchanged or less than the previous order total. Otherwise, redirect to a URL set by the setQuoteExpiredUrl method.
  3. neverProceed - always redirect to the URL specified by the set by the setQuoteExpiredUrl method.
Specified by:
setQuoteExpiryPolicy in interface ProcessOrderCmd
Parameters:
newQuoteExpiryPolicy - quote expiry policy

setReduceParentQuantities

public void setReduceParentQuantities(java.lang.String astrReduceParentQuantities)
Sets the reduceParentQuantities parameter.
Specified by:
setReduceParentQuantities in interface ProcessOrderCmd
Parameters:
astrReduceParentQuantities -

setRequestProperties

public void setRequestProperties(TypedProperty reqParms)
                          throws ECApplicationException
Sets the request properties.
Specified by:
setRequestProperties in interface ProcessOrderCmd
Parameters:
reqParms - request properties.
Throws:
ECApplicationException

setTransferMode

public void setTransferMode(java.lang.String transferMode)
Sets the transferMode property of the command.
Specified by:
setTransferMode in interface ProcessOrderCmd
Parameters:
transferMode - - 0 - order has been transferred without the payment information (shopping cart transfer). 1 - order has been transferred with the payment information (purchase order transfer).

getTransferMode

protected java.lang.String getTransferMode()
Gets the transferMode property of the command.
Returns:
String

updateQuotationSubmissionAndReduceParentQuantities

protected void updateQuotationSubmissionAndReduceParentQuantities(OrderAccessBean anabOrder)
                                                           throws FinderException,
                                                                  java.rmi.RemoteException,
                                                                  CreateException,
                                                                  javax.naming.NamingException,
                                                                  java.sql.SQLException,
ECException
Update the reltype of OrderQuotaionRel from select to submission and reduce the parent order quantities.
Parameters:
anabOrder - order access bean
Throws:
CreateException
java.rmi.RemoteException
javax.naming.NamingException
java.sql.SQLException
FinderException
ECException

validateParameters

public void validateParameters()
                        throws ECException
Checks the validity of the parameters
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Throws:
ECException

setNotificationAttributes

public void setNotificationAttributes(java.util.Hashtable aNotificationAttributes)
Sets the notification attributes
Specified by:
setNotificationAttributes in interface ProcessOrderCmd
Parameters:
aNotificationAttributes -