|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.droplet.EmptyFormHandler atg.droplet.GenericFormHandler atg.commerce.order.purchase.PurchaseProcessFormHandler atg.commerce.order.purchase.CommitOrderFormHandler
public class CommitOrderFormHandler
The CommitOrderFormHandler is used to submit the Order for final confirmation. This calls the OrderManager's processOrder method. If there are no errors with processing the Order, then the current Order in the user's ShoppingCart will be set to null and the submitted Order will become the ShoppingCart's last Order.
GenericFormHandler
,
PurchaseProcessFormHandler
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
static java.lang.String |
MSG_COMMIT_ERROR
|
static java.lang.String |
MSG_ORDER_ALREADY_SUBMITTED
|
static java.lang.String |
MSG_ORDER_EMPTY
|
static java.lang.String |
MSG_ORDER_NOT_CURRENT
|
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessFormHandler |
---|
LOCK_NAME_ATTRIBUTE_NAME, PARAM_TRANSACTION_CREATED, PARAM_VALUE_TRUE |
Fields inherited from class atg.droplet.GenericFormHandler |
---|
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
CommitOrderFormHandler()
Creates a new CommitOrderFormHandler instance. |
Method Summary | |
---|---|
void |
commitOrder(Order pOrder,
DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is called between preCommitOrder and postCommitOrder . |
boolean |
getAllowEmptyOrders()
Return the allowEmptyOrders property. |
java.lang.String |
getCommitOrderErrorURL()
Returns property CommitOrderErrorURL |
java.lang.String |
getCommitOrderSuccessURL()
Returns property CommitOrderSuccessURL |
java.lang.String |
getOrderId()
Return the OrderId property. |
java.util.HashMap |
getProcessOrderMap(java.util.Locale pLocale)
This method calls the OrderManager.getProcessOrderMap(pLocale, map)> to get the process order map
and adds site ID and sales channel to the map if specified. |
java.lang.String |
getSalesChannel()
Returns the salesChannel. |
java.lang.String |
getSiteId()
Returns the site ID to be recorded in the order |
boolean |
handleCommitOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method is used to submit the current order. |
void |
postCommitOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called after all processing is done by the handleCommitOrder method. |
void |
preCommitOrder(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Called before any processing is done by the handleCommitOrder method. |
void |
setAllowEmptyOrders(boolean pAllowEmptyOrders)
Set the allowEmptyOrders property. |
void |
setCommitOrderErrorURL(java.lang.String pCommitOrderErrorURL)
Sets property CommitOrderErrorURL |
void |
setCommitOrderSuccessURL(java.lang.String pCommitOrderSuccessURL)
Sets property CommitOrderSuccessURL |
void |
setOrderId(java.lang.String pOrderId)
Set the OrderId property. |
void |
setSalesChannel(java.lang.String pSalesChannel)
Sets the salesChannel. |
void |
setSiteId(java.lang.String pSiteId)
Sets the site ID to be recorded in the order |
Methods inherited from class atg.droplet.EmptyFormHandler |
---|
afterGet, beforeGet |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String MSG_COMMIT_ERROR
public static final java.lang.String MSG_ORDER_ALREADY_SUBMITTED
public static final java.lang.String MSG_ORDER_EMPTY
public static final java.lang.String MSG_ORDER_NOT_CURRENT
Constructor Detail |
---|
public CommitOrderFormHandler()
CommitOrderFormHandler
instance.
Method Detail |
---|
public java.lang.String getSalesChannel()
public void setSalesChannel(java.lang.String pSalesChannel)
pSalesChannel
- public void setOrderId(java.lang.String pOrderId)
pOrderId
- a String
valuepublic java.lang.String getOrderId()
String
valuepublic void setSiteId(java.lang.String pSiteId)
pSiteId
- a String
valuepublic java.lang.String getSiteId()
String
valuepublic void setAllowEmptyOrders(boolean pAllowEmptyOrders)
pAllowEmptyOrders
- if false
, handleCommit
adds a form exception if called for an order with no itemspublic boolean getAllowEmptyOrders()
boolean
valuepublic void setCommitOrderSuccessURL(java.lang.String pCommitOrderSuccessURL)
pCommitOrderSuccessURL
- a String
valuepublic java.lang.String getCommitOrderSuccessURL()
String
valuepublic void setCommitOrderErrorURL(java.lang.String pCommitOrderErrorURL)
pCommitOrderErrorURL
- a String
valuepublic java.lang.String getCommitOrderErrorURL()
String
valuepublic void preCommitOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
pRequest
- the request objectpResponse
- the response object
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occurspublic void postCommitOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
By the time this method is called the order has been committed to the database by calling OrderManager.processOrder. If an application modifies the order within its own postCommitOrder method, that method is responsible for saving the new state of the order by calling OrderManager.updateOrder.
pRequest
- the request objectpResponse
- the response object
javax.servlet.ServletException
- if an error occurs
java.io.IOException
- if an error occurspublic boolean handleCommitOrder(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
Assuming the order is not a duplicate submission, the form handler calls OrderManager.processOrder to actually place the order. If placing the order succeeds, then the form handler sets the shopping cart lastOrder to the current (just submitted) order and the currentOrder to null. Finally, it calls the postCommitOrder method for any application-specific post-processing.
pRequest
- the servlet's requestpResponse
- the servlet's response
boolean
value
javax.servlet.ServletException
- if there was an error while executing the code
java.io.IOException
- if there was an error with servlet iopublic void commitOrder(Order pOrder, DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws javax.servlet.ServletException, java.io.IOException
preCommitOrder
and postCommitOrder
. This method
calls the getProcessOrderMap(Locale)
to get the process order map and calls the Order Manager
to process the order.
pOrder
- pRequest
- pResponse
-
javax.servlet.ServletException
java.io.IOException
public java.util.HashMap getProcessOrderMap(java.util.Locale pLocale) throws CommerceException
OrderManager.getProcessOrderMap(pLocale, map)> to get the process order map
and adds site ID and sales channel to the map if specified.
- Returns:
-
- Throws:
CommerceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |