com.softslate.commerce.customer.core
Class BaseForm

java.lang.Object
  extended by org.apache.struts.action.ActionForm
      extended by com.softslate.commerce.customer.core.BaseForm
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AddCouponForm, AdvancedSearchForm, BaseAdministratorForm, BasicPaymentForm, BillingAddressForm, CartAddForm, CartItemEditFormForm, CategorySettingsFormGeneral, CategorySettingsFormOther, CheckoutShippingForm, CheckPaymentForm, DownloadForm, EstimatedShippingForm, ExportForm, Form2EmailForm, IncompleteOrdersForm, LoginForm, LostPasswordForm, OrderDetailsForm, PayPalExpressForm, PayPalUKExpressForm, PaypointCallbackForm, PaypointForm, ProductCloneForm, ProductSettingsFormDisplay, ProductSettingsFormDownloads, ProductSettingsFormGeneral, ProductSettingsFormInventory, RegisterForm, RemoveCouponForm, RemoveItemForm, SavedCartPickupForm, ShippingForm, StoreMessagesForm, UpdatePasswordForm

public class BaseForm
extends org.apache.struts.action.ActionForm

Extends the Struts ActionForm class to provide base functionality for form classes in the system. Provides several properties common to most of the Web requests the application receives, to help action classes communicate with the rest of the application.

Within the action classes of the Struts layer, this BaseForm will be passed from method to method so that each of these properties can be accessed easily.

Author:
David Tobey
See Also:
Serialized Form

Field Summary
private  BusinessObjectFactory businessObjectFactory
          The application's business object factory.
private  org.apache.struts.action.ActionErrors errors
          An ActionErrors object that stores any errors that will be displayed to the current user within the response.
private  FormUtils formUtils
           
(package private) static org.apache.commons.logging.Log log
           
private  org.apache.struts.action.ActionMapping mapping
          The mapping corresponding to the current action of the request.
private  org.apache.struts.action.ActionMessages messages
          An ActionMessages object that can be used to store messages that will be displayed to the user within the response.
private  javax.servlet.http.HttpServletRequest request
          The current HttpServletRequest object pertaining to the submission to this BaseForm.
private static long serialVersionUID
           
private  Settings settings
          This request's settings, as loaded from the sscSetting database table.
private  User user
          The current user making the request for this BaseForm.
 
Fields inherited from class org.apache.struts.action.ActionForm
multipartRequestHandler, servlet
 
Constructor Summary
BaseForm()
           
 
Method Summary
 FormUtils formUtils()
           
 BusinessObjectFactory getBusinessObjectFactory()
           
 org.apache.struts.action.ActionErrors getErrors()
           
 org.apache.struts.action.ActionMapping getMapping()
           
 java.lang.String getMessage(java.lang.String module, java.lang.String key, java.lang.Object[] args)
          Look up and return a message from a given bundle among the Struts MessageResources objects in the application scope.
 org.apache.struts.action.ActionMessages getMessages()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 Settings getSettings()
           
 User getUser()
           
 void initializeProperties(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
          Initializes all the properties of this BaseForm by copying the objects from the request, session, and application scopes.
 void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory)
           
 void setErrors(org.apache.struts.action.ActionErrors errors)
           
 void setMapping(org.apache.struts.action.ActionMapping mapping)
           
 void setMessages(org.apache.struts.action.ActionMessages messages)
           
 void setRequest(javax.servlet.http.HttpServletRequest request)
           
 void setSettings(Settings settings)
           
 void setUser(User user)
           
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

static org.apache.commons.logging.Log log

request

private javax.servlet.http.HttpServletRequest request
The current HttpServletRequest object pertaining to the submission to this BaseForm.


messages

private org.apache.struts.action.ActionMessages messages
An ActionMessages object that can be used to store messages that will be displayed to the user within the response.


errors

private org.apache.struts.action.ActionErrors errors
An ActionErrors object that stores any errors that will be displayed to the current user within the response.


mapping

private org.apache.struts.action.ActionMapping mapping
The mapping corresponding to the current action of the request.


settings

private Settings settings
This request's settings, as loaded from the sscSetting database table.


user

private User user
The current user making the request for this BaseForm. This object lives in the user's session across requests, but can be passed throughout the Struts layer through this property.


businessObjectFactory

private BusinessObjectFactory businessObjectFactory
The application's business object factory. Available here so that any of the Struts actions processing the request can use it to easily instantiate business objects.


formUtils

private FormUtils formUtils
Constructor Detail

BaseForm

public BaseForm()
Method Detail

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)

getMessages

public org.apache.struts.action.ActionMessages getMessages()

setMessages

public void setMessages(org.apache.struts.action.ActionMessages messages)

getErrors

public org.apache.struts.action.ActionErrors getErrors()

setErrors

public void setErrors(org.apache.struts.action.ActionErrors errors)

getMapping

public org.apache.struts.action.ActionMapping getMapping()

setMapping

public void setMapping(org.apache.struts.action.ActionMapping mapping)

getSettings

public Settings getSettings()

setSettings

public void setSettings(Settings settings)

getUser

public User getUser()

setUser

public void setUser(User user)

getBusinessObjectFactory

public BusinessObjectFactory getBusinessObjectFactory()

setBusinessObjectFactory

public void setBusinessObjectFactory(BusinessObjectFactory businessObjectFactory)

initializeProperties

public void initializeProperties(org.apache.struts.action.ActionMapping mapping,
                                 javax.servlet.http.HttpServletRequest request)
Initializes all the properties of this BaseForm by copying the objects from the request, session, and application scopes. Called by action classes and within the validate method of this BaseForm.

Parameters:
mapping - The mapping corresponding to the current action of the request.
request - The HttpServletRequest object for this request.

getMessage

public java.lang.String getMessage(java.lang.String module,
                                   java.lang.String key,
                                   java.lang.Object[] args)
Look up and return a message from a given bundle among the Struts MessageResources objects in the application scope.

Parameters:
module - Name of the servlet context attribute for the message resources bundle.
key - Message key to be looked up and returned.
args - Replacement parameters for this message.
Returns:
message The message, or null if the message can't be found.

formUtils

public FormUtils formUtils()


Copyright © SoftSlate, LLC 2003–2005