Class ManufacturerAction
The execute
method of this class populates a manufacturer's
information from the database and puts it in the request and session scopes
for use by the view layer. Given a
ManufacturerForm
with its
code
property populated, it creates and initializes an instance
of Manufacturer
. It
then invokes
ManufacturerProcessor.getManufacturerFromCode(Manufacturer)
to load the manufacturer's information from the database.
In the default implementation, in addition to all of the manufacturer's
regular properties, its productListCollection
is populated with
just those Manufacturer
s falling on the current page being
displayed. The paging parameter for the number of items to display comes from
the "manufacturerPageSize" setting in the sscSetting
database
table. Which page to display is determined by the value of the
firstRow
request parameter (which is held by the incoming
ManufacturerForm
and copied to the Manufacturer
object being populated).
This method puts the initialized Manufacturer
object in the
request scope as an attribute with the name "manufacturer".
The execute
method next loads a Map
of
attribute-only SKUs and places it in the request as an attribute named
"attributeSKUs" so they may be displayed on the product page. (Attribute-only
SKUs are SKUs which are not tied to any particular product but which may
still be relevant to the one of the category's products.)
- Author:
- David Tobey
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.action.Action
servlet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
defineMetaTags
(Manufacturer manufacturer, javax.servlet.http.HttpServletRequest request) org.apache.struts.action.ActionForward
execute
(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) protected Manufacturer
initializeManufacturer
(BaseDynaForm baseForm) protected void
loadAttributeOnlySKUs
(BaseDynaForm baseForm, javax.servlet.http.HttpServletRequest request, ProductProcessor productProcessor) protected SearchList
loadProductsWithAdvancedSearch
(BaseDynaForm baseForm, Manufacturer manufacturer, String sortByParameter) protected void
saveObjectsInRequestScope
(Manufacturer manufacturer, SearchList searchList, javax.servlet.http.HttpServletRequest request, BaseDynaForm baseForm) protected boolean
shouldProductsBeLoadedFromDB
(BaseDynaForm baseForm) Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
ManufacturerAction
public ManufacturerAction()
-
-
Method Details
-
execute
public org.apache.struts.action.ActionForward execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception - Overrides:
execute
in classorg.apache.struts.action.Action
- Throws:
Exception
-
initializeManufacturer
- Throws:
Exception
-
shouldProductsBeLoadedFromDB
-
loadProductsWithAdvancedSearch
protected SearchList loadProductsWithAdvancedSearch(BaseDynaForm baseForm, Manufacturer manufacturer, String sortByParameter) throws Exception - Throws:
Exception
-
loadAttributeOnlySKUs
protected void loadAttributeOnlySKUs(BaseDynaForm baseForm, javax.servlet.http.HttpServletRequest request, ProductProcessor productProcessor) throws Exception - Throws:
Exception
-
saveObjectsInRequestScope
protected void saveObjectsInRequestScope(Manufacturer manufacturer, SearchList searchList, javax.servlet.http.HttpServletRequest request, BaseDynaForm baseForm) throws Exception - Throws:
Exception
-
defineMetaTags
protected void defineMetaTags(Manufacturer manufacturer, javax.servlet.http.HttpServletRequest request)
-