public abstract class AccountServlet extends MainServlet
MainServlet
that provides default
functionality for account maintenance servlet processing and defines method
signatures for specific servlet requirements.Modifier and Type | Class and Description |
---|---|
protected class |
AccountServlet.Context
Inner class used to store servlet context information.
|
FlashServlet.Stack
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
The class' serialization version id.
|
static java.lang.String |
SN_BILLINFO
The session's key for the current billing information customer.
|
static java.lang.String |
SN_SHIPINFO
The session's key for the current shipping information customer.
|
static java.lang.String |
SN_USERINFO
The session's key for the current contact and logon information user.
|
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 |
---|
AccountServlet() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
allowAdmin(AccountServlet.Context ctx)
Answers if various admin-only fields are to be displayed and if they are
changeable by the user.
|
protected boolean |
allowCatalog(AccountServlet.Context ctx)
Answers if the topmost category and default category are to be displayed
and if they are changeable by the user.
|
protected boolean |
allowLogonId(AccountServlet.Context ctx)
Answers if logon id is to be displayed and if it is enterable by the user.
|
protected void |
assignDefaultUserCatalog(AccountServlet.Context ctx)
Assigns the topmost category and default category from the default user to
the current user being maintained.
|
protected MainServlet.Context |
createContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates the servlet context inner class.
|
protected User |
getAccountObject(AccountServlet.Context ctx)
Returns the account (user) to process.
|
protected java.lang.String |
getURLForAdminCreate(AccountServlet.Context ctx)
Returns the URL for the admin account create servlet (billing info).
|
protected java.lang.String |
getURLForAdminSelect(AccountServlet.Context ctx)
Returns the URL for the admin account selection servlet.
|
protected java.lang.String |
getURLForProfile(AccountServlet.Context ctx)
Returns the URL for the account profile servlet.
|
protected java.lang.String |
getURLForSfiSelect(AccountServlet.Context ctx)
Returns the URL for the SFI/CSR account selection servlet.
|
protected Category |
getValidDefaultCategory(AccountServlet.Context ctx)
Returns a
Category object suitable for use as the user's
default start category. |
protected boolean |
isCheckOut(AccountServlet.Context ctx)
Answers if check out processing is being performed.
|
protected boolean |
isOneTimeShipto(AccountServlet.Context ctx)
Answers if the account being maintained is a one-time ship-to account (user
is a shopping user and the user's ship-to customer id = *onetime).
|
protected void |
readParameters(BaseServlet.Context baseCtx,
boolean post)
Reads the parameters passed to the servlet via the http request object.
|
protected boolean |
requiresLogon(BaseServlet.Context baseCtx)
Answers if the servlet requires a valid non-default user to log on in
order to continue processing.
|
protected void |
runMiniSync(AccountServlet.Context ctx)
Performs user and customer mini-sync with the backend ERP system (if
configured in properties).
|
protected void |
setAccountObject(AccountServlet.Context ctx)
Sets the account (user) in the session to reflect the results of an edit.
|
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 |
updatePageExpired(AccountServlet.Context ctx)
Sets all servlet requests in the stack for account maintenance related
functions to expired.
|
confirmSession, getPreviousCategoryList, getPreviousCategoryPath, hasSubcategories, hasSubcategories, isOmitNoStock, isPreshopRequest, isUserHelpRequest, setTemplateCategoryPath, sortCategoryProductData, writePageImpl
confirmCart, confirmRequest, confirmRetail, confirmWholesale, createNewCart, createNewSessionImpl, getPageTitle, getServletPath, getUser, initTemplateDataImpl, isLogonRequest, requestComplete, resetCart, resetCategories, resetProducts, setDefaultUser, setSessionCart, setSFIShoppingUser, useExistingSessionImpl, writeCookie
createNewSession, determineBrowser, doGet, doPost, editFormFields, getCookie, getInvokerName, getInvokerName, getInvokerParams, getInvokerParams, getInvokerPath, getInvokerPath, getInvokerURL, getNextURL, getPageParams, getRequestURL, getServletName, getServletName, getServletParams, getServletParams, getServletPath, getServletURL, getServletURL, getTemplateMessage, getTemplateMessage, getTemplateMessage, getTemplateMessage, getTemplateMessage, getTemplateName, initTemplateData, isPrintable, isServerTomcat, log, qualifyURL, redirectURL, resetFormFields, setP3PCompactPolicy, setTemplateData, 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_BILLINFO
public static final java.lang.String SN_SHIPINFO
public static final java.lang.String SN_USERINFO
protected boolean requiresLogon(BaseServlet.Context baseCtx)
false
for public
shopping functions and true
for admin, SAT and SFI/CSR functions.
This method should be overridden by a subclass if the subclass requires
something different than the default.
Overrides requiresLogon
in FlashServlet
.requiresLogon
in class FlashServlet
baseCtx
- (Context) The current servlet context.true
if the servlet requires a non-default
user to log on, otherwise false
.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 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 boolean allowAdmin(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.true
if the admin-only fields are vieweable
and changeable, otherwise false
.protected boolean allowCatalog(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.true
if the category fields are viewable
and changeable, otherwise false
.protected boolean allowLogonId(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.true
if the logon id field is viewable
and enterable, otherwise false
.protected void assignDefaultUserCatalog(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context..protected User getAccountObject(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected void setAccountObject(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected java.lang.String getURLForAdminCreate(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected java.lang.String getURLForAdminSelect(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected java.lang.String getURLForSfiSelect(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected java.lang.String getURLForProfile(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected Category getValidDefaultCategory(AccountServlet.Context ctx)
Category
object suitable for use as the user's
default start category. The value returned will either be the current
default start category or the topmost category, depending on whether the
default category is a valid descendant (child) of the topmost category.
The default category could become invalid, for example, if the catalog undergoes some kind of reorganization via the admin functions. This method ensures that the default category presented to the user is valid for their assigned topmost category.
ctx
- (Context) The current servlet context.protected boolean isCheckOut(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.true
if check out is being processed,
otherwise false
.protected boolean isOneTimeShipto(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.true
if one-time ship-to account, otherwise
false
.protected void runMiniSync(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.protected void updatePageExpired(AccountServlet.Context ctx)
ctx
- (Context) The current servlet context.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.