public class OrderRequestAPI
extends javax.servlet.http.HttpServlet
Modifier and Type | Class and Description |
---|---|
class |
OrderRequestAPI.Context
Inner class used to store servlet context information.
|
Modifier and Type | Field and Description |
---|---|
private static boolean |
cvAllowUnknownProducts
The allow unknown products flag - indicates whether Flash should accept
products not in the product catalog.
|
private static java.text.SimpleDateFormat |
cvCreditCardDateFormat
A date formatter for dealing with credit card information.
|
private static boolean |
cvDebug
The debug flag.
|
private static java.text.SimpleDateFormat |
cvISODateFormat
A date formatter for dealing with credit card information.
|
private static boolean |
cvShipToOneTime
If the ship-to specified on the order is not currently on file,
should it be added as one-time or permanent.
|
private static java.text.SimpleDateFormat |
cvShortDateFormat
A date formatter for dealing with credit card information.
|
private static java.lang.String |
cvUnknownProductId
The product id used as a placeholder (e.g.
|
private static java.lang.String |
cvUnknownProductUom
The unit of measure used as a placeholder (e.g.
|
private static java.lang.String |
RFQ_ERRORMSG_PREF
The request for quotation error message prefix.
|
private static long |
serialVersionUID
The class' serialization version id.
|
Constructor and Description |
---|
OrderRequestAPI() |
Modifier and Type | Method and Description |
---|---|
private Customer |
addShipto(OrderRequestAPI.Context ctx)
Adds new ship-to customer based on information in the order request.
|
private void |
addToSiteActivity(OrderRequestAPI.Context ctx)
Adds the current order's values to the batch session's site activity
order values.
|
protected OrderRequestAPI.Context |
createContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates the servlet context inner class.
|
private void |
createSiteActivity(OrderRequestAPI.Context ctx)
Records the initial site activity information for the batch session.
|
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP GET requests.
|
void |
doPost(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles HTTP POST requests.
|
private Product |
findProduct(OrderRequestAPI.Context ctx,
OrderRequestLine reqline)
Finds an existing product for an order request line.
|
private Customer |
findShipto(OrderRequestAPI.Context ctx)
Finds an existing customer that matches the requested ship-to.
|
java.lang.String |
getServletInfo()
Returns information about this servlet.
|
private void |
queueSiteActivity(OrderRequestAPI.Context ctx,
boolean post)
Queues the session's activity for logging to the site activity history.
|
private java.lang.String |
takeOrder(OrderRequestAPI.Context ctx)
Creates a shopping cart and places an order.
|
private boolean |
unknownProduct(OrderRequestAPI.Context ctx,
OrderRequestLine reqline)
Puts the placeholder product in the shopping cart.
|
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
private static final long serialVersionUID
private static final java.lang.String RFQ_ERRORMSG_PREF
private static final java.text.SimpleDateFormat cvISODateFormat
private static final java.text.SimpleDateFormat cvShortDateFormat
private static final java.text.SimpleDateFormat cvCreditCardDateFormat
private static final boolean cvDebug
private static final boolean cvAllowUnknownProducts
private static final java.lang.String cvUnknownProductId
private static final java.lang.String cvUnknownProductUom
private static final boolean cvShipToOneTime
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException, javax.servlet.ServletException
doGet
in class javax.servlet.http.HttpServlet
request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.java.io.IOException
- - if an error occurs while processing the
request or response.javax.servlet.ServletException
- - if an error occurs while
processing the request or response.public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
doPost
in class javax.servlet.http.HttpServlet
request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.java.io.IOException
- - if an error occurs while processing the
request or response.javax.servlet.ServletException
- - if an error occurs while
processing the request or response.public java.lang.String getServletInfo()
getServletInfo
in interface javax.servlet.Servlet
getServletInfo
in class javax.servlet.GenericServlet
private java.lang.String takeOrder(OrderRequestAPI.Context ctx)
ctx
- (Context) The current servlet context.private Product findProduct(OrderRequestAPI.Context ctx, OrderRequestLine reqline)
ctx
- (Context) The current servlet context.reqline
- (OrderRequestLine) The order request line having the
product and uom to search.null
if no product was found.private Customer findShipto(OrderRequestAPI.Context ctx) throws java.lang.Exception
ctx
- (Context) The current servlet context.java.lang.Exception
- - if an error occurs while retrieving the
ship-to customer.private Customer addShipto(OrderRequestAPI.Context ctx) throws java.lang.Exception
ctx
- (Context) The current servlet context.java.lang.Exception
- - if an error occurs while adding the
ship-to customer.private boolean unknownProduct(OrderRequestAPI.Context ctx, OrderRequestLine reqline)
ctx
- (Context) The current servlet context.reqline
- (OrderRequestLine) The current order request line.private void addToSiteActivity(OrderRequestAPI.Context ctx)
ctx
- (Context) The current servlet context.private void createSiteActivity(OrderRequestAPI.Context ctx)
ctx
- (Context) The current servlet context.private void queueSiteActivity(OrderRequestAPI.Context ctx, boolean post)
ctx
- (Context) The current servlet context.post
- (boolean) true
if the activity occurred
during a POST operation, otherwise false
.protected OrderRequestAPI.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
doPost
method.request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.