public class QuickOrder extends MainServlet
| Modifier and Type | Class and Description |
|---|---|
protected class |
QuickOrder.Context
Inner class used to store servlet context information.
|
protected class |
QuickOrder.SearchResult
Inner class that defines auto complete search result data that is sent
to the browser.
|
FlashServlet.Stack| Modifier and Type | Field and Description |
|---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
DISPLAY_MODE, SN_ADMINMODE, SN_CATEGORIES, SN_CATEGORIES_LISTONLY, SN_CATEGORIES_PATH, SN_CATEGORY, SN_CONTINUE_PAGEURL, SN_PRODUCTS, SN_PRODUCTS_INSTOCK, SN_PRODUCTS_NOSTOCK, SN_PRODUCTS_PAFILTERS, SN_PRODUCTS_PAGEHIST, SN_PRODUCTS_PAGENUM, SN_PRODUCTS_PAGEURL, SOURCE_CATALOG, SOURCE_FAVORITES, SOURCE_SEARCH, SOURCE_SHOPCART, SOURCE_SPECIALSN_CART, SN_LOGON_STATUS, SN_SECPROFILE, SN_USER, SN_USERSFIBROWSER_IE, BROWSER_NN, BROWSER_XX, RESP_NULL, RESP_REDIRECTED, RQST_AJAX, RQST_NULL| Constructor and Description |
|---|
QuickOrder() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addToCart(QuickOrder.Context ctx)
Handles processing for an add to cart request.
|
private void |
addToCart(QuickOrder.Context ctx,
CartLine cartline)
Adds the given cart line to the database and to the session's cache of
all cart lines.
|
private void |
addToCartResponse(QuickOrder.Context ctx)
Sends a JSON formatted response to the browser for an add to cart request.
|
private boolean |
addToCartValidate(QuickOrder.Context ctx)
Validates the submitted add to cart product values (product, units)
with the Flash database and the ERP database.
|
private boolean |
appendMessage(QuickOrder.Context ctx,
java.lang.String msgname)
Appends the text for the given message name to the current set of response
messages.
|
protected MainServlet.Context |
createContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates the servlet context inner class.
|
protected boolean |
editFormFields(BaseServlet.Context baseCtx)
Edits the values from the html template's form fields.
|
private java.lang.String |
formatCartLinePrice(QuickOrder.Context ctx,
CartLine cartline)
Returns a formatted price for the given cart line.
|
protected java.lang.String |
getNextURL(BaseServlet.Context baseCtx)
Returns the next URL (including parameters) to be processed when this
servlet's processing has been successfully completed (no edit errors, etc.).
|
protected java.lang.String |
getTemplateName(BaseServlet.Context baseCtx)
Returns the name of the html template file used by the servlet.
|
protected void |
readParameters(BaseServlet.Context baseCtx,
boolean post)
Reads the parameters passed to the servlet via the http request object.
|
private void |
removeFromCart(QuickOrder.Context ctx)
Handles processing for a remove from cart request.
|
private void |
removeFromCartResponse(QuickOrder.Context ctx)
Sends a JSON formatted response to the browser for a remove from cart
request.
|
protected void |
resetFormFields(BaseServlet.Context baseCtx)
Resets the values for the html template's form fields.
|
private void |
search(QuickOrder.Context ctx)
Handles processing for an auto complete search request.
|
private void |
searchResponse(QuickOrder.Context ctx,
java.util.ArrayList<QuickOrder.SearchResult> results)
Sends a JSON formatted response to the browser for an auto complete
search request.
|
protected void |
setCookieValues(BaseServlet.Context baseCtx)
Adds one or more values to the http session cookies.
|
protected void |
setSessionValues(BaseServlet.Context baseCtx)
Adds one or more values to the http session object.
|
protected void |
setTemplateData(BaseServlet.Context baseCtx)
Sets the various data required by the html template.
|
private void |
updateCart(QuickOrder.Context ctx)
Handles processing for an update cart request.
|
private void |
updateCartResponse(QuickOrder.Context ctx)
Sends a JSON formatted response to the browser for an update cart request.
|
private void |
writeResponse(QuickOrder.Context ctx,
java.lang.String response)
Writes a JSON formatted response to the http response output stream.
|
confirmSession, getPreviousCategoryList, getPreviousCategoryPath, hasSubcategories, hasSubcategories, isOmitNoStock, isPreshopRequest, isUserHelpRequest, setTemplateCategoryPath, sortCategoryProductData, writePageImplconfirmCart, confirmRequest, confirmRetail, confirmWholesale, createNewCart, createNewSessionImpl, getPageTitle, getServletPath, getUser, initTemplateDataImpl, isLogonRequest, requestComplete, requiresLogon, resetCart, resetCategories, resetProducts, setDefaultUser, setSessionCart, setSFIShoppingUser, useExistingSessionImpl, writeCookiecreateNewSession, determineBrowser, doGet, doPost, getCookie, getInvokerName, getInvokerName, getInvokerParams, getInvokerParams, getInvokerPath, getInvokerPath, getInvokerURL, getPageParams, getRequestURL, getServletName, getServletName, getServletParams, getServletParams, getServletPath, getServletURL, getServletURL, getTemplateMessage, getTemplateMessage, getTemplateMessage, getTemplateMessage, getTemplateMessage, initTemplateData, isPrintable, isServerTomcat, log, qualifyURL, redirectURL, setP3PCompactPolicy, showSiteError, showSiteError, showSiteError, useExistingSession, writeCookie, writeTempCookiedoDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, serviceprivate static final long serialVersionUID
protected boolean editFormFields(BaseServlet.Context baseCtx)
doPost method.
Overrides editFormFields in BaseServlet.editFormFields in class BaseServletbaseCtx - (Context) The current servlet context.true if all the edits are successful,
otherwise false.protected java.lang.String getNextURL(BaseServlet.Context baseCtx)
writeURL method.
Overrides getNextURL in BaseServlet.getNextURL in class BaseServletbaseCtx - (Context) The current servlet context.protected java.lang.String getTemplateName(BaseServlet.Context baseCtx)
writePage method.
Overrides getTemplateName in BaseServlet.getTemplateName in class BaseServletbaseCtx - (Context) The current servlet context.protected void readParameters(BaseServlet.Context baseCtx, boolean post)
doGet and doPost method.
Overrides readParameters in BaseServlet.readParameters in class BaseServletbaseCtx - (Context) The current servlet context.post - (boolean) true if the method is invoked from
doPost, otherwise false.protected void resetFormFields(BaseServlet.Context baseCtx)
doGet and doPost methods.
Overrides resetFormFields in BaseServlet.resetFormFields in class BaseServletbaseCtx - (Context) The current servlet context.protected void setCookieValues(BaseServlet.Context baseCtx) throws java.io.IOException
writeURL method. Calls should be made to writeCookie for each cookie that needs to be set.
Overrides setCookieValues in BaseServlet.setCookieValues in class BaseServletbaseCtx - (Context) The current servlet context.java.io.IOException - - if an error occurs when adding the
cookie to the response header.protected void setSessionValues(BaseServlet.Context baseCtx)
writeURL method.
Overrides setSessionValues in BaseServlet.setSessionValues in class BaseServletbaseCtx - (Context) The current servlet context.protected void setTemplateData(BaseServlet.Context baseCtx)
writePage method.
Overrides setTemplateData in BaseServlet.setTemplateData in class BaseServletbaseCtx - (Context) The current servlet context.private void addToCart(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void addToCart(QuickOrder.Context ctx, CartLine cartline) throws java.lang.Exception
ctx - (Context) The current servlet context.cartline - (CartLine) The cart line to add.java.lang.Exception - - if a processing error occurs during the add.private void addToCartResponse(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private boolean addToCartValidate(QuickOrder.Context ctx) throws java.lang.Exception
ctx - (Context) The current servlet context.true if no errors were detected or if
only warning errors were detected, otherwise false.java.lang.Exception - - if a processing error occurs during the validation.private void updateCart(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void updateCartResponse(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void removeFromCart(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void removeFromCartResponse(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void search(QuickOrder.Context ctx)
ctx - (Context) The current servlet context.private void searchResponse(QuickOrder.Context ctx, java.util.ArrayList<QuickOrder.SearchResult> results)
ctx - (Context) The current servlet context.results - (ArrayList) The current set of search results.private boolean appendMessage(QuickOrder.Context ctx, java.lang.String msgname)
ctx - (Context) The current servlet context.msgname - (String) The name of message to append. Used to
determine which message (or messages) to retrieve from the
message properties.false.private java.lang.String formatCartLinePrice(QuickOrder.Context ctx, CartLine cartline)
ctx - (Context) The current servlet context.cartline - (CartLine) The cart line to format.private void writeResponse(QuickOrder.Context ctx, java.lang.String response)
ctx - (Context) The current servlet context.response - (String) The JSON response to write.protected MainServlet.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
createContext in MainServlet.
Invoked by doPost and doGet methods.createContext in class MainServletrequest - (HttpServletRequest) The servlet's incoming request.response - (HttpServletResponse) The servlet's outgoing response.