|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.action.ActionForm com.softslate.commerce.customer.core.BaseForm com.softslate.commerce.customer.order.BillingAddressForm
public class BillingAddressForm
Struts form class representing a user's billing address. The class is used
for submissions of billing address information in the customer account area.
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, and that fields such as emails and
phone numbers are in a valid format.
Field Summary | |
---|---|
private java.lang.String |
billingAddress1
|
private java.lang.String |
billingAddress2
|
private java.lang.String |
billingCity
|
private java.lang.String |
billingCountry
|
private java.lang.String |
billingEmail1
|
private java.lang.String |
billingEmail2
|
private java.lang.String |
billingExtra1
|
private java.lang.String |
billingExtra2
|
private java.lang.String |
billingExtra3
|
private java.lang.String |
billingExtra4
|
private java.lang.String |
billingExtra5
|
private java.lang.String |
billingFirstName
|
private java.lang.String |
billingLastName
|
private java.lang.String |
billingNotes
|
private java.lang.String |
billingOrganization
|
private java.lang.String |
billingOther
|
private java.lang.String |
billingPhone1
|
private java.lang.String |
billingPhone2
|
private java.lang.String |
billingPostalCode
|
private java.lang.String |
billingState
|
(package private) static org.apache.commons.logging.Log |
log
|
private static long |
serialVersionUID
|
Fields inherited from class org.apache.struts.action.ActionForm |
---|
multipartRequestHandler, servlet |
Constructor Summary | |
---|---|
BillingAddressForm()
|
Method Summary | |
---|---|
boolean |
doesCountryAllowOtherStates(java.lang.String country)
Determines if a given country is set to allow 'Other' states. |
java.lang.String |
getBillingAddress1()
|
java.lang.String |
getBillingAddress2()
|
java.lang.String |
getBillingCity()
|
java.lang.String |
getBillingCountry()
|
java.lang.String |
getBillingEmail1()
|
java.lang.String |
getBillingEmail2()
|
java.lang.String |
getBillingExtra1()
|
java.lang.String |
getBillingExtra2()
|
java.lang.String |
getBillingExtra3()
|
java.lang.String |
getBillingExtra4()
|
java.lang.String |
getBillingExtra5()
|
java.lang.String |
getBillingFirstName()
|
java.lang.String |
getBillingLastName()
|
java.lang.String |
getBillingNotes()
|
java.lang.String |
getBillingOrganization()
|
java.lang.String |
getBillingOther()
|
java.lang.String |
getBillingPhone1()
|
java.lang.String |
getBillingPhone2()
|
java.lang.String |
getBillingPostalCode()
|
java.lang.String |
getBillingState()
|
boolean |
isBillingFieldValid(java.lang.String thisFieldString,
java.lang.String thisValue)
For a given field, validates the value of the field in this form. |
boolean |
isOtherState(java.lang.String state)
Determines if a given state is a 'Other' state. |
void |
prepareStateAndOtherFields(Customer customer)
Prepares the billingState and billingOther fields for presentation in a form. |
void |
prepareStateAndOtherFields(Order order)
Prepares the billingState and billingOther fields for presentation in a form. |
void |
setBillingAddress1(java.lang.String string)
|
void |
setBillingAddress2(java.lang.String string)
|
void |
setBillingCity(java.lang.String string)
|
void |
setBillingCountry(java.lang.String string)
|
void |
setBillingEmail1(java.lang.String string)
|
void |
setBillingEmail2(java.lang.String string)
|
void |
setBillingExtra1(java.lang.String string)
|
void |
setBillingExtra2(java.lang.String string)
|
void |
setBillingExtra3(java.lang.String billingExtra3)
|
void |
setBillingExtra4(java.lang.String billingExtra4)
|
void |
setBillingExtra5(java.lang.String billingExtra5)
|
void |
setBillingFirstName(java.lang.String string)
|
void |
setBillingLastName(java.lang.String string)
|
void |
setBillingNotes(java.lang.String string)
|
void |
setBillingOrganization(java.lang.String string)
|
void |
setBillingOther(java.lang.String string)
|
void |
setBillingPhone1(java.lang.String string)
|
void |
setBillingPhone2(java.lang.String string)
|
void |
setBillingPostalCode(java.lang.String string)
|
void |
setBillingState(java.lang.String string)
|
boolean |
stateAndCountryMatch(java.lang.String state,
java.lang.String country)
Checks to make sure this form's state and country match. |
org.apache.struts.action.ActionErrors |
validate(org.apache.struts.action.ActionMapping mapping,
javax.servlet.http.HttpServletRequest request)
|
void |
validateBillingFields()
Validates the billing fields of this form. |
void |
validateBillingStateField()
Validate this form's state field. |
Methods inherited from class com.softslate.commerce.customer.core.BaseForm |
---|
formUtils, getBusinessObjectFactory, getErrors, getMapping, getMessage, getMessages, getRequest, getSettings, getUser, initializeProperties, setBusinessObjectFactory, setErrors, setMapping, setMessages, setRequest, setSettings, 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 |
Field Detail |
---|
private static final long serialVersionUID
static org.apache.commons.logging.Log log
private java.lang.String billingFirstName
private java.lang.String billingLastName
private java.lang.String billingOrganization
private java.lang.String billingAddress1
private java.lang.String billingAddress2
private java.lang.String billingCity
private java.lang.String billingState
private java.lang.String billingOther
private java.lang.String billingPostalCode
private java.lang.String billingCountry
private java.lang.String billingPhone1
private java.lang.String billingPhone2
private java.lang.String billingEmail1
private java.lang.String billingEmail2
private java.lang.String billingExtra1
private java.lang.String billingExtra2
private java.lang.String billingExtra3
private java.lang.String billingExtra4
private java.lang.String billingExtra5
private java.lang.String billingNotes
Constructor Detail |
---|
public BillingAddressForm()
Method Detail |
---|
public java.lang.String getBillingAddress1()
public java.lang.String getBillingAddress2()
public java.lang.String getBillingCity()
public java.lang.String getBillingCountry()
public java.lang.String getBillingEmail1()
public java.lang.String getBillingEmail2()
public java.lang.String getBillingExtra1()
public java.lang.String getBillingExtra2()
public java.lang.String getBillingFirstName()
public java.lang.String getBillingLastName()
public java.lang.String getBillingNotes()
public java.lang.String getBillingOrganization()
public java.lang.String getBillingPhone1()
public java.lang.String getBillingPhone2()
public java.lang.String getBillingPostalCode()
public java.lang.String getBillingState()
public java.lang.String getBillingOther()
public void setBillingAddress1(java.lang.String string)
public void setBillingAddress2(java.lang.String string)
public void setBillingCity(java.lang.String string)
public void setBillingCountry(java.lang.String string)
public void setBillingEmail1(java.lang.String string)
public void setBillingEmail2(java.lang.String string)
public void setBillingExtra1(java.lang.String string)
public void setBillingExtra2(java.lang.String string)
public java.lang.String getBillingExtra3()
public void setBillingExtra3(java.lang.String billingExtra3)
public java.lang.String getBillingExtra4()
public void setBillingExtra4(java.lang.String billingExtra4)
public java.lang.String getBillingExtra5()
public void setBillingExtra5(java.lang.String billingExtra5)
public void setBillingFirstName(java.lang.String string)
public void setBillingLastName(java.lang.String string)
public void setBillingNotes(java.lang.String string)
public void setBillingOrganization(java.lang.String string)
public void setBillingPhone1(java.lang.String string)
public void setBillingPhone2(java.lang.String string)
public void setBillingPostalCode(java.lang.String string)
public void setBillingState(java.lang.String string)
public void setBillingOther(java.lang.String string)
public org.apache.struts.action.ActionErrors validate(org.apache.struts.action.ActionMapping mapping, javax.servlet.http.HttpServletRequest request)
validate
in class org.apache.struts.action.ActionForm
public void validateBillingFields()
public boolean isBillingFieldValid(java.lang.String thisFieldString, java.lang.String thisValue)
thisFieldString
- The name of the field to validatethisValue
- The field's value
public void validateBillingStateField()
public boolean stateAndCountryMatch(java.lang.String state, java.lang.String country)
sscState
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.
state
- The string representing the state to be checked. This will be
the two-letter state code from the code
field
of the sscState
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 sscCountry
table.
public void prepareStateAndOtherFields(Customer customer)
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.
customer
- The given customer whose address fields are being prepared.public void prepareStateAndOtherFields(Order order)
Order
'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.
order
- The given order whose address fields are being prepared.public boolean isOtherState(java.lang.String state)
sscState
database table or if it corresponds to a state or
province in a foreign country not supported by sscState
.
state
- The string representing the state to be checked. This will be
the two-letter state code from the code
field
of the sscState
table, or some other string
inputted by the user (if it is a 'Other' state).
public boolean doesCountryAllowOtherStates(java.lang.String country)
country
- The string representing the country to be checked. This will
be the two-letter country code from the code
field of the sscCountry
table.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |