public class AdmPurgeCategories extends AdmPurge
Modifier and Type | Class and Description |
---|---|
class |
AdmPurgeCategories.CatalogPath
Inner class that defines a product catalog path.
|
protected class |
AdmPurgeCategories.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.
|
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 |
---|
AdmPurgeCategories() |
Modifier and Type | Method and Description |
---|---|
protected AdmPurge.Context |
createContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Creates the servlet context inner class.
|
private void |
findDeadEnds(AdmPurgeCategories.Context ctx)
Finds all dead-end category relationships.
|
protected java.util.ArrayList<AdmPurgeCategories.CatalogPath> |
getPurgeRecords(AdmPurge.Context ctx)
Returns a collection of records that match the purge criteria.
|
private boolean |
hasChildren(AdmPurgeCategories.Context ctx,
java.lang.String namepath)
Answers if a category is referenced by other categories.
|
private boolean |
hasProducts(AdmPurgeCategories.Context ctx,
java.lang.String codepath)
Answers if a cateogry has products.
|
protected boolean |
purgeRecords(AdmPurge.Context ctx)
Purges the records that match the purge criteria.
|
protected void |
readParameters(BaseServlet.Context baseCtx,
boolean post)
Reads the parameters passed to the servlet via the http request object.
|
private void |
recurseCatalog(AdmPurgeCategories.Context ctx,
java.lang.String codepath,
java.lang.String namepath,
Category parent)
Recurses through the given parent category's subcategories.
|
protected void |
setTemplateData(BaseServlet.Context baseCtx)
Sets the various data required by the html template.
|
editFormFields, getNextURL, getPurgeCount, getPurgeDate, getTemplateName, resetFormFields, setCookieValues, setSessionValues, setTemplateError
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
protected void readParameters(BaseServlet.Context baseCtx, boolean post)
doGet
and doPost
method.
Overrides readParameters
in AdmPurge
.readParameters
in class AdmPurge
baseCtx
- (Context) The current servlet context.post
- (boolean) true
if the method is invoked from
doPost
, otherwise false
.protected void setTemplateData(BaseServlet.Context baseCtx)
writePage
method.
Overrides setTemplateData
in AdmPurge
.setTemplateData
in class AdmPurge
baseCtx
- (Context) The current servlet context.protected java.util.ArrayList<AdmPurgeCategories.CatalogPath> getPurgeRecords(AdmPurge.Context ctx)
getPurgeRecords
in AdmPurge
.getPurgeRecords
in class AdmPurge
ctx
- (Context) The current servlet context.protected boolean purgeRecords(AdmPurge.Context ctx) throws java.lang.Exception
purgeRecords
in AdmPurge
.purgeRecords
in class AdmPurge
ctx
- (Context) The current servlet context.true
if the records purge successfully,
otherwise false
.java.lang.Exception
- - if an error occurs during the purge
processing.private void recurseCatalog(AdmPurgeCategories.Context ctx, java.lang.String codepath, java.lang.String namepath, Category parent) throws java.lang.Exception
ctx
- (Context) The current servlet context.codepath
- (String) The delimited code path for the parent.namepath
- (String) The delimited name path for the parent.parent
- (Category) The parent category for any subcategories.java.lang.Exception
- - if an error occurs during processing.private void findDeadEnds(AdmPurgeCategories.Context ctx) throws java.lang.Exception
ctx
- (Context) The current servlet context.java.lang.Exception
- - if an error occurs during processing.private boolean hasChildren(AdmPurgeCategories.Context ctx, java.lang.String namepath) throws java.lang.Exception
ctx
- (Context) The current servlet context.namepath
- (String) The delimited name path for the category
to check.true
if the category is referenced,
otherwise false
.java.lang.Exception
- - if an error occurs during processing.private boolean hasProducts(AdmPurgeCategories.Context ctx, java.lang.String codepath) throws java.lang.Exception
ctx
- (Context) The current servlet context.codepath
- (String) The delimited code path for the category
to check.true
if the category has products,
otherwise false
..java.lang.Exception
- - if an error occurs during processing.protected AdmPurge.Context createContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
createContext
in AdmPurge
.
Invoked by doPost
and doGet
methods.createContext
in class AdmPurge
request
- (HttpServletRequest) The servlet's incoming request.response
- (HttpServletResponse) The servlet's outgoing response.