com.softslate.commerce.customer.order
Class BillingAddressForm
java.lang.Object
org.apache.struts.action.ActionForm
com.softslate.commerce.customer.core.BaseForm
com.softslate.commerce.customer.order.BillingAddressForm
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- AddressesForm
- public class BillingAddressForm
- extends BaseForm
Struts form class representing a user's billing address. The class can be
used for submissions of billing address information. It is also a superclass
of CheckoutAddressesForm
,
which is used for submissions to "/CheckoutAddresses.do", where both billing
and delivery addresses, as well as a shipping option, are submitted.
The validate
method of this class loops through the
"billingRequired" database setting and makes sure each required field is
populated. It also checks to make sure the submitted state or province
corresponds to the submitted country.
- Author:
- David Tobey
- See Also:
- Serialized Form
Fields inherited from class com.softslate.commerce.customer.core.BaseForm |
|
Fields inherited from class org.apache.struts.action.ActionForm |
multipartRequestHandler, servlet |
Methods inherited from class com.softslate.commerce.customer.core.BaseForm |
getBusinessObjectFactory, getErrors, getMapping, getMessage, getMessages, getRequest, getSettingsBean, getUser, initializeProperties, setBusinessObjectFactory, setErrors, setMapping, setMessages, setRequest, setSettingsBean, setUser |
Methods inherited from class org.apache.struts.action.ActionForm |
getMultipartRequestHandler, getServlet, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
log
static org.apache.commons.logging.Log log
billingFirstName
private java.lang.String billingFirstName
billingLastName
private java.lang.String billingLastName
billingOrganization
private java.lang.String billingOrganization
billingAddress1
private java.lang.String billingAddress1
billingAddress2
private java.lang.String billingAddress2
billingCity
private java.lang.String billingCity
billingState
private java.lang.String billingState
billingOther
private java.lang.String billingOther
billingPostalCode
private java.lang.String billingPostalCode
billingCountry
private java.lang.String billingCountry
billingPhone1
private java.lang.String billingPhone1
billingPhone2
private java.lang.String billingPhone2
billingEmail1
private java.lang.String billingEmail1
billingEmail2
private java.lang.String billingEmail2
billingExtra1
private java.lang.String billingExtra1
billingExtra2
private java.lang.String billingExtra2
billingExtra3
private java.lang.String billingExtra3
billingExtra4
private java.lang.String billingExtra4
billingExtra5
private java.lang.String billingExtra5
billingNotes
private java.lang.String billingNotes
BillingAddressForm
public BillingAddressForm()
getBillingAddress1
public java.lang.String getBillingAddress1()
getBillingAddress2
public java.lang.String getBillingAddress2()
getBillingCity
public java.lang.String getBillingCity()
getBillingCountry
public java.lang.String getBillingCountry()
getBillingEmail1
public java.lang.String getBillingEmail1()
getBillingEmail2
public java.lang.String getBillingEmail2()
getBillingExtra1
public java.lang.String getBillingExtra1()
getBillingExtra2
public java.lang.String getBillingExtra2()
getBillingFirstName
public java.lang.String getBillingFirstName()
getBillingLastName
public java.lang.String getBillingLastName()
getBillingNotes
public java.lang.String getBillingNotes()
getBillingOrganization
public java.lang.String getBillingOrganization()
getBillingPhone1
public java.lang.String getBillingPhone1()
getBillingPhone2
public java.lang.String getBillingPhone2()
getBillingPostalCode
public java.lang.String getBillingPostalCode()
getBillingState
public java.lang.String getBillingState()
getBillingOther
public java.lang.String getBillingOther()
setBillingAddress1
public void setBillingAddress1(java.lang.String string)
setBillingAddress2
public void setBillingAddress2(java.lang.String string)
setBillingCity
public void setBillingCity(java.lang.String string)
setBillingCountry
public void setBillingCountry(java.lang.String string)
setBillingEmail1
public void setBillingEmail1(java.lang.String string)
setBillingEmail2
public void setBillingEmail2(java.lang.String string)
setBillingExtra1
public void setBillingExtra1(java.lang.String string)
setBillingExtra2
public void setBillingExtra2(java.lang.String string)
getBillingExtra3
public java.lang.String getBillingExtra3()
setBillingExtra3
public void setBillingExtra3(java.lang.String billingExtra3)
getBillingExtra4
public java.lang.String getBillingExtra4()
setBillingExtra4
public void setBillingExtra4(java.lang.String billingExtra4)
getBillingExtra5
public java.lang.String getBillingExtra5()
setBillingExtra5
public void setBillingExtra5(java.lang.String billingExtra5)
setBillingFirstName
public void setBillingFirstName(java.lang.String string)
setBillingLastName
public void setBillingLastName(java.lang.String string)
setBillingNotes
public void setBillingNotes(java.lang.String string)
setBillingOrganization
public void setBillingOrganization(java.lang.String string)
setBillingPhone1
public void setBillingPhone1(java.lang.String string)
setBillingPhone2
public void setBillingPhone2(java.lang.String string)
setBillingPostalCode
public void setBillingPostalCode(java.lang.String string)
setBillingState
public void setBillingState(java.lang.String string)
setBillingOther
public void setBillingOther(java.lang.String string)
validate
public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
validateBillingFields
public void validateBillingFields()
isBillingFieldValid
public boolean isBillingFieldValid(java.lang.String thisFieldString,
java.lang.String thisValue)
validateBillingStateField
public void validateBillingStateField()
stateAndCountryMatch
public boolean stateAndCountryMatch(java.lang.String state,
java.lang.String country)
- Checks to make sure this form's state and country match. In other words,
if the given state is contained in the
npcState
table, the
given country must correspond to that state's country. If the given state
is a 'Other' state, the given country must have its allowOtherStates flag
set.
- Parameters:
state
- The string representing the state to be checked. This will be
the two-letter state code from the code
field
of the npcState
table, or some other string
inputted by the user (if it is a 'Other' state).country
- The string representing the country to be checked. This will
be the two-letter country code from the code
field of the npcCountry
table.
- Returns:
- true, if the state and country are a match. false, if not.
prepareStateAndOtherFields
public void prepareStateAndOtherFields(Customer customer)
- Prepares the billingState and billingOther fields for presentation in a
form. Determines if a given
Customer
's billing address
uses a 'Other' state and if so populates the billingOther and
billingState fields accordingly. If it does use a 'Other' state, this
method populates the billingState field with the string "Other" and
populates the billingOther field with the value of billingState, so the
address forms will accurately represent the customer's state.
- Parameters:
customer
- The given customer whose address fields are being prepared.
isOtherState
public boolean isOtherState(java.lang.String state)
- /** Determines if a given state is a 'Other' state. In other words,
determines if the value of the state is contained in the
npcState
database table or if it corresponds to a state or
province in a foreign country not supported by npcState
.
- Parameters:
state
- The string representing the state to be checked. This will be
the two-letter state code from the code
field
of the npcState
table, or some other string
inputted by the user (if it is a 'Other' state).
- Returns:
- true, if the given state is a 'Other' state.
Copyright © SoftSlate, Inc. 20032005