public class ProductDetails extends MainServlet
Modifier and Type | Class and Description |
---|---|
class |
ProductDetails.Context
Inner class used to store servlet context information.
|
class |
ProductDetails.DisplayableAttribute
Inner class used to define a displayable product attribute.
|
FlashServlet.Stack
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
static java.lang.String |
SN_PRODUCT
The session's key for the current product value.
|
protected static java.lang.String |
SN_RELPRODUCTS
The session's key for a product's current set of related products value.
|
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_SPECIAL
SN_CART, SN_LOGON_STATUS, SN_SECPROFILE, SN_USER, SN_USERSFI
BROWSER_IE, BROWSER_NN, BROWSER_XX, RESP_NULL, RESP_REDIRECTED, RQST_AJAX, RQST_NULL
Constructor and Description |
---|
ProductDetails() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addToStockNotification(ProductDetails.Context ctx)
Processes a request for stock notification and, if no errors occur,
adds the request to the restock notification table.
|
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.
|
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 Product |
getProductFromDb(ProductDetails.Context ctx,
java.lang.String code,
java.lang.String uom)
Retrieves the requested product from the database.
|
protected java.lang.String |
getTemplateName(BaseServlet.Context baseCtx)
Returns the name of the html template file used by the servlet.
|
protected java.lang.String |
getUserEmailAddress(ProductDetails.Context ctx)
Determine the correct email address to use for this session & user.
|
protected boolean |
processCart(ProductDetails.Context ctx,
java.util.ArrayList<Product> products,
java.util.ArrayList<java.lang.Integer> quantities,
java.util.ArrayList<UnitMeasure> orderuoms,
java.util.ArrayList<UnitMeasure> priceuoms)
Performs the requested cart or favorites processing.
|
protected boolean |
processMainProduct(ProductDetails.Context ctx)
Retrieves the submitted values for the main product and then adds the
product to the cart or favorites.
|
protected boolean |
processRelatedProduct(ProductDetails.Context ctx)
Retrieves the submitted values for a single related product and then
adds the product to the cart or favorites.
|
protected boolean |
processRelatedProducts(ProductDetails.Context ctx)
Retrieves the submitted values for any selected related products and then
adds the products to the cart or favorites.
|
protected void |
readParameters(BaseServlet.Context baseCtx,
boolean post)
Reads the parameters passed to the servlet via the http request object.
|
protected void |
resetFormFields(BaseServlet.Context baseCtx)
Resets the values for the html template's form fields.
|
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.
|
protected boolean |
setTemplateError(ProductDetails.Context ctx,
java.lang.String errName)
Sets the html template error fields for the given error name.
|
protected void |
setTemplateFavorites(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the favorites data required by the html template. |
protected void |
setTemplateOnOrderFromSupplier(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the on order information from supplier data required by
the html template. |
protected void |
setTemplateProduct(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the product data required by the html template. |
protected void |
setTemplateProductAttributes(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the product attributes data required by the html template. |
protected void |
setTemplateQuantityBreaks(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the quantity price break data required by the html
template. |
protected boolean |
setTemplateRelatedProducts(ProductDetails.Context ctx,
boolean inclSelectable)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the related products data required by the html template. |
protected void |
setTemplateWarehouseQuantities(ProductDetails.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the warehouse quantity data required by the html template. |
confirmSession, getPreviousCategoryList, getPreviousCategoryPath, hasSubcategories, hasSubcategories, isOmitNoStock, isPreshopRequest, isUserHelpRequest, setTemplateCategoryPath, sortCategoryProductData, writePageImpl
confirmCart, confirmRequest, confirmRetail, confirmWholesale, createNewCart, createNewSessionImpl, getPageTitle, getServletPath, getUser, initTemplateDataImpl, isLogonRequest, requestComplete, requiresLogon, resetCart, resetCategories, resetProducts, setDefaultUser, setSessionCart, setSFIShoppingUser, useExistingSessionImpl, writeCookie
createNewSession, 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, writeTempCookie
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
private static final long serialVersionUID
public static final java.lang.String SN_PRODUCT
protected static final java.lang.String SN_RELPRODUCTS
protected boolean editFormFields(BaseServlet.Context baseCtx)
doPost
method.
Overrides editFormFields
in BaseServlet
.editFormFields
in class BaseServlet
baseCtx
- (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 BaseServlet
baseCtx
- (Context) The current servlet context.protected java.lang.String getTemplateName(BaseServlet.Context baseCtx)
writePage
method.
Overrides getTemplateName
in BaseServlet
.getTemplateName
in class BaseServlet
baseCtx
- (Context) The current servlet context.protected void readParameters(BaseServlet.Context baseCtx, boolean post)
doGet
and doPost
method.
Overrides readParameters
in BaseServlet
.readParameters
in class BaseServlet
baseCtx
- (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 BaseServlet
baseCtx
- (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 BaseServlet
baseCtx
- (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 BaseServlet
baseCtx
- (Context) The current servlet context.protected void setTemplateData(BaseServlet.Context baseCtx)
writePage
method.
Overrides setTemplateData
in BaseServlet
.setTemplateData
in class BaseServlet
baseCtx
- (Context) The current servlet context.protected boolean setTemplateError(ProductDetails.Context ctx, java.lang.String errName)
ctx
- (Context) The current servlet context.errName
- (String) The name of error that is to be set, used
to determine which message (or messages) to retrieve from the
message properties.false
.protected void setTemplateProduct(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the product data required by the html template.ctx
- (Context) The current servlet context.protected java.lang.String getUserEmailAddress(ProductDetails.Context ctx)
ctx
- (Context) The servlet's current context.protected void setTemplateProductAttributes(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the product attributes data required by the html template.ctx
- (Context) The servlet's current context.protected void setTemplateQuantityBreaks(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the quantity price break data required by the html
template.
Note: This method is overridden by CDProductDetails
. Any
significant changes made here may also need to be made in the overridden
version.
ctx
- (Context) The servlet's current context.protected void setTemplateWarehouseQuantities(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the warehouse quantity data required by the html template.ctx
- (Context) The servlet's current context.protected void setTemplateOnOrderFromSupplier(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the on order information from supplier data required by
the html template.ctx
- (Context) The servlet's current context.protected void setTemplateFavorites(ProductDetails.Context ctx)
setTemplateData
to
retrieve and set the favorites data required by the html template.ctx
- (Context) The current servlet context.protected boolean setTemplateRelatedProducts(ProductDetails.Context ctx, boolean inclSelectable)
setTemplateData
to
retrieve and set the related products data required by the html template.ctx
- (Context) The servlet's current context.inclSelectable
- (boolean) true
if selectable related
products can be selected and added to the cart or favorites,
otherwise false
.true
if the related product information
is successfully retrieved and set, otherwise false
.protected boolean addToStockNotification(ProductDetails.Context ctx)
ctx
- (Context) The servlet's current context.false
.protected Product getProductFromDb(ProductDetails.Context ctx, java.lang.String code, java.lang.String uom)
ctx
- (Context) The servlet's current context.code
- (String) The product code for the desired record.uom
- (String) The unit of measure code for the desired record.Product
object for the requested product,
or null
if the product was not retrieved.protected boolean processCart(ProductDetails.Context ctx, java.util.ArrayList<Product> products, java.util.ArrayList<java.lang.Integer> quantities, java.util.ArrayList<UnitMeasure> orderuoms, java.util.ArrayList<UnitMeasure> priceuoms)
ctx
- (Context) The servlet's current context.products
- (ArrayList) The products to process.quantities
- (ArrayList) The quantities to process.orderuoms
- (ArrayList) The order units of measure to process.priceuoms
- (ArrayList) The price units of measure to process.true
if the processing is successful,
otherwise false
.protected boolean processMainProduct(ProductDetails.Context ctx)
ctx
- (Context) The servlet's current context.true
if the product is successfully added,
otherwise false
.protected boolean processRelatedProduct(ProductDetails.Context ctx)
ctx
- (Context) The servlet's current context.true
if the product is successfully added,
otherwise false
.protected boolean processRelatedProducts(ProductDetails.Context ctx)
ctx
- (Context) The servlet's current context.true
if the products are successfully added,
otherwise false
.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 MainServlet
request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.