public class Products extends Home
Modifier and Type | Class and Description |
---|---|
protected class |
Products.Context
Inner class used to store servlet context information.
|
class |
Products.SelectableFilter
Inner class used to define a selectable product attribute filter.
|
FlashServlet.Stack
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
static java.lang.String |
SN_COMPARE_LIST
The session's key for the list of products to compare.
|
protected static java.lang.String |
SN_PRODUCTS_ATTFILTERS
The session's key for the catalog's current list of selected attribute
filters.
|
protected static java.lang.String |
SN_PRODUCTS_INFILTERS
The session's key for the catalog's current list of filtered products.
|
protected static java.lang.String |
SN_PRODUCTS_PAGESTYLE
The session's key for the catalog's current page number.
|
protected static java.lang.String |
SN_PRODUCTS_PRCFILTERS
The session's key for the catalog's current entered price filters.
|
protected static java.lang.String |
SN_PRODUCTS_SELNOSTOCK
The session's key for the catalog's current omit no stock flag.
|
MINIMUM_ROWS
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 |
---|
Products() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addToCompares(Products.Context ctx,
java.util.ArrayList<Product> products)
Adds the given collection of products to the collection of products
to compare.
|
protected Home.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 boolean |
getCompareProducts(Products.Context ctx,
java.util.ArrayList<Product> products)
Retrieves products that the user selected for comparison and places them
into the given collection for products.
|
protected boolean |
getManyProducts(Products.Context ctx,
java.util.ArrayList<Product> products,
java.util.ArrayList<java.lang.Integer> quantities)
Retrieves the "Add To Cart" or "Add To Favorites" products and quantities
and places the values into the given collections for products and quantities.
|
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 boolean |
getOneProduct(Products.Context ctx,
java.util.ArrayList<Product> products,
java.util.ArrayList<java.lang.Integer> quantities)
Retrieves the "Buy Now" product and quantity and places the values into
the given collections for products and quantities.
|
protected java.lang.String |
getTemplateName(BaseServlet.Context baseCtx)
Returns the name of the html template file used by the servlet.
|
protected boolean |
isPrintable(BaseServlet.Context baseCtx)
Answers if the servlet allows for a printable version to be displayed.
|
protected boolean |
isProductFilteringActive(Products.Context ctx)
Answers if product filtering of attributes or pricing is active based on
isProductFilteringAttrsActive and isProductFilteringPriceActive . |
protected boolean |
isProductFilteringAttrsActive(Products.Context ctx)
Answers if product filtering of attributes is active based on properties
(
ProductSearch.Show.Attributes )and the current page source code
(catalog, search, special, etc.). |
protected boolean |
isProductFilteringPriceActive(Products.Context ctx)
Answers if product filtering of pricing is active based on shopping user
security profile (
getShowNoPrices ) and the current page source code
(catalog, search, special, etc.). |
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 |
setProductList(Products.Context ctx)
Sets the current list of products based on the current omit no stock flag.
|
protected void |
setProductList(Products.Context ctx,
java.lang.String snProdKey,
java.lang.String snStockKey,
java.lang.String snAttrKey,
boolean realtime)
Sets the current list of products based on the current omit no stock flag.
|
protected void |
setProductListFiltered(Products.Context ctx,
java.lang.String snAttrKey)
Sets the current list of products based on the current selected and entered
filters.
|
protected void |
setProductListFilteredAttrs(Products.Context ctx,
java.util.ArrayList<java.lang.String[]> searchattrs)
Sets the current list of products based on the current set of selected
attribute filters.
|
protected void |
setProductListFilteredPrice(Products.Context ctx,
java.lang.String[] prcfilters)
Sets the current list of products based on the current entered price
filters.
|
protected void |
setRealtimeInfo(Products.Context ctx,
int begindex,
int endindex)
Sets the realtime data for a given set of products within the current
list of products.
|
protected void |
setRealtimeInfo(Products.Context ctx,
int begindex,
int endindex,
java.lang.String snPgHstKey)
Sets the realtime data for a given set of products within the current
list of products.
|
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(Products.Context ctx,
java.lang.String errName)
Sets the html template error fields for the given error name.
|
protected void |
setTemplateFavorites(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the favorites data required by the html template. |
protected void |
setTemplateFilters(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the selectable attribute filters and entered price
filters data required by the html template. |
protected void |
setTemplateHeader(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the page header data required by the html template. |
protected void |
setTemplateListName(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the list name data required by the html template. |
protected void |
setTemplateProducts(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the product data required by the html template. |
protected void |
setTemplateRelatedProducts(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the related products data required by the html template. |
protected void |
setTemplateSubcategories(Products.Context ctx)
Invoked by this class' implementation of
setTemplateData to
retrieve and set the subcategory data required by the html template. |
setTemplateMode0, setTemplateMode1, setTemplateMode2, setTemplateSubcategories
setTemplatePagingBegIndex, setTemplatePagingEndIndex, setTemplatePagingLinks
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, 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_COMPARE_LIST
protected static final java.lang.String SN_PRODUCTS_INFILTERS
protected static final java.lang.String SN_PRODUCTS_PAGESTYLE
protected static final java.lang.String SN_PRODUCTS_ATTFILTERS
protected static final java.lang.String SN_PRODUCTS_PRCFILTERS
protected static final java.lang.String SN_PRODUCTS_SELNOSTOCK
protected boolean isPrintable(BaseServlet.Context baseCtx)
isPrintable
in BaseServlet
.isPrintable
in class BaseServlet
baseCtx
- (Context) The current servlet context.true
if the servlet allows a printable
version to be displayed.protected boolean editFormFields(BaseServlet.Context baseCtx)
doPost
method.
Overrides editFormFields
in BaseServlet
.editFormFields
in class Home
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 Home
baseCtx
- (Context) The current servlet context.protected java.lang.String getTemplateName(BaseServlet.Context baseCtx)
writePage
method.
Overrides getTemplateName
in BaseServlet
.getTemplateName
in class Home
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 Home
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 Home
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 Home
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 Home
baseCtx
- (Context) The current servlet context.protected void setTemplateData(BaseServlet.Context baseCtx)
writePage
method.
Overrides setTemplateData
in BaseServlet
.setTemplateData
in class Home
baseCtx
- (Context) The current servlet context.protected boolean setTemplateError(Products.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 setTemplateHeader(Products.Context ctx)
setTemplateData
to
retrieve and set the page header data required by the html template.ctx
- (Context) The current servlet context.protected void setTemplateListName(Products.Context ctx)
setTemplateData
to
retrieve and set the list name data required by the html template.ctx
- (Context) The current servlet context.protected void setTemplateProducts(Products.Context ctx)
setTemplateData
to
retrieve and set the product data required by the html template.ctx
- (Context) The current servlet context.protected void setTemplateFavorites(Products.Context ctx)
setTemplateData
to
retrieve and set the favorites data required by the html template.ctx
- (Context) The current servlet context.protected void setTemplateFilters(Products.Context ctx)
setTemplateData
to
retrieve and set the selectable attribute filters and entered price
filters data required by the html template.ctx
- (Context) The current servlet context.protected void setTemplateRelatedProducts(Products.Context ctx)
setTemplateData
to
retrieve and set the related products data required by the html template.ctx
- (Context) The servlet's current context.protected void setTemplateSubcategories(Products.Context ctx)
setTemplateData
to
retrieve and set the subcategory data required by the html template.ctx
- (Context) The current servlet context.protected boolean addToCompares(Products.Context ctx, java.util.ArrayList<Product> products)
ctx
- (Context) The current servlet context.products
- (ArrayList) The collection of products to add.true
if the products are successfully
added, otherwise false
.protected boolean getCompareProducts(Products.Context ctx, java.util.ArrayList<Product> products)
ctx
- (Context) The current servlet context.products
- (ArrayList) The collection of products to add to.true
if the products are successfully
retrieved, otherwise false
.protected boolean getOneProduct(Products.Context ctx, java.util.ArrayList<Product> products, java.util.ArrayList<java.lang.Integer> quantities)
ctx
- (Context) The current servlet context.products
- (ArrayList) The collection of products to add to.quantities
- (ArrayList) The collection of quantities to add to.true
if the product and quantity are
successfully retrieved, otherwise false
.protected boolean getManyProducts(Products.Context ctx, java.util.ArrayList<Product> products, java.util.ArrayList<java.lang.Integer> quantities)
ctx
- (Context) The current servlet context.products
- (ArrayList) The collection of products to add to.quantities
- (ArrayList) The collection of quantities to add to.true
if the products and quantities are
successfully retrieved, otherwise false
.protected boolean isProductFilteringActive(Products.Context ctx)
isProductFilteringAttrsActive
and isProductFilteringPriceActive
.ctx
- (Context) The current servlet context.protected boolean isProductFilteringAttrsActive(Products.Context ctx)
ProductSearch.Show.Attributes
)and the current page source code
(catalog, search, special, etc.).ctx
- (Context) The current servlet context.protected boolean isProductFilteringPriceActive(Products.Context ctx)
getShowNoPrices
) and the current page source code
(catalog, search, special, etc.).ctx
- (Context) The current servlet context.protected void setProductList(Products.Context ctx)
ctx.products
context variable.ctx
- (Context) The current servlet context.protected void setProductList(Products.Context ctx, java.lang.String snProdKey, java.lang.String snStockKey, java.lang.String snAttrKey, boolean realtime)
ctx.products
context variable.ctx
- (Context) The current servlet context.snProdKey
- (String) The session key for the current list of
products.snStockKey
- (String) The session key for the current list of
products with stock.snAttrKey
- (String) The session key for the current list of
product attribute filters.realtime
- (boolean) true
if realtime info should be
retrieved to obtain the list of products with stock, otherwise
false
.protected void setProductListFiltered(Products.Context ctx, java.lang.String snAttrKey)
ctx.products
context variable.ctx
- (Context) The current servlet context.snAttrKey
- (String) The session key for the current list of
product attribute filters.protected void setProductListFilteredAttrs(Products.Context ctx, java.util.ArrayList<java.lang.String[]> searchattrs)
ctx.products
context variable.ctx
- (Context) The current servlet context.searchattrs
- (ArrayList) The collection of search attributes
that will be sent to the configured product search interface.
product attribute filters.protected void setProductListFilteredPrice(Products.Context ctx, java.lang.String[] prcfilters)
ctx.products
context variable.ctx
- (Context) The current servlet context.prcfilters
- (String[]) The current price filters where the 1st
element is low price and the 2nd element is high price.protected void setRealtimeInfo(Products.Context ctx, int begindex, int endindex)
ctx
- (Context) The current servlet context.begindex
- (int) The index of the first product within the list
for which realtime data is desired.endindex
- (int) The index of the last product within the list
for which realtime data is desired.protected void setRealtimeInfo(Products.Context ctx, int begindex, int endindex, java.lang.String snPgHstKey)
ctx
- (Context) The current servlet context.begindex
- (int) The index of the first product within the list
for which realtime data is desired.endindex
- (int) The index of the last product within the list
for which realtime data is desired.snPgHstKey
- (String) The session key for the current page
history.protected Home.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
createContext
in Home
.
Invoked by doPost
and doGet
methods.createContext
in class Home
request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.