|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.customer.BasicCustomerProcessor
public class BasicCustomerProcessor
Processes business logic having to do with a customer's account and related objects. Created in the Struts layer in response to requests for information about an exisiting customer account, or to create new accounts.
BasicCustomerProcessor is the default implementation of the
CustomerProcessor interface for the application.
CustomerProcessor| Field Summary | |
|---|---|
(package private) static org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
BasicCustomerProcessor()
|
|
| Method Summary | |
|---|---|
java.util.Map |
addCustomer(java.util.Map parameters)
|
void |
deleteCustomer(java.util.Map parameters)
|
java.util.Map |
editCustomer(java.util.Map parameters)
|
void |
editDeleteCustomers(java.util.Map parameters)
|
Customer |
loadCustomerFromID(java.util.Map parameters)
|
java.util.Map |
loadCustomerLostPassword(java.util.Map parameters)
Loads the Customer property of this
CustomerProcesor from the database given a Map
containing the userName. |
java.util.Map |
loadCustomersAndCount(java.util.Map parameters)
|
java.util.Collection |
loadDownloadFiles()
Loads the set of download files that the customer has purchased from the database. |
int |
loadMaxCustomerID()
|
Order |
loadOrderDetails(java.util.Map parameters)
Loads all of the database information corresponding to a given order number for a given customer. |
java.util.Map |
loadOrderHistory()
Loads a customer's order history from the database. |
java.util.Map |
loadPreviousOrder(java.util.Map parameters)
Loads a previously placed order for a customer from the database, assigning it as the customer's current cart. |
java.util.Map |
loadSavedCart(java.util.Map parameters)
Loads a saved cart for a customer from the database, assigning it as the customer's current cart. |
java.util.Collection |
loadSavedCarts()
Loads a customer's list of saved carts from the database. |
java.util.Map |
processAutoLogin(java.util.Map parameters)
Processes an automatic login given a user's autoLoginToken. |
java.util.Map |
processLogin(java.util.Map parameters)
Processes a login attempt given a user name and password. |
java.util.Map |
processRegister(java.util.Map parameters)
Processes a request to register or add a new customer account into the system. |
java.util.Map |
removeSavedCart(java.util.Map parameters)
Removes a saved cart for a customer from the database, changing the order record to a status of "Saved". |
java.util.Map |
saveCart(java.util.Map parameters)
Saves an Order in the database as a saved cart, with a
status of "Saved", which a customer can pick up later. |
java.util.Map |
updateAddresses(java.util.Map parameters)
Updates a customer's address information. |
java.util.Map |
updateCustomer(java.util.Map parameters)
Updates a customer's account information. |
| Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor |
|---|
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getProductIDs, getSettings, getUser, initialize, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, updateOrderTotals, updateOrderTotals, utils |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject |
|---|
initialize |
| Field Detail |
|---|
static org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public BasicCustomerProcessor()
| Method Detail |
|---|
public java.util.Map processRegister(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorMap should have at least two keys:
userName and decryptedPassword, which will be
used for the new account. If successful, the customer
property of the current User will be populated with the new
account's information. If an account already exists with the same
userName, the returned Map will contain a key
named "resultCode" whose value is "errors.userAlreadyLoggedIn". This code
is used in the Struts layer to look up the error message.
processRegister in interface CustomerProcessorparameters - A Map containing the user name and password for
the new customer account.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map processLogin(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorMap must have two keys: userName and
password. If the login attempt succeeds, the
Customer property of the current User will be
populated with the database information for the customer account. If the
user name and password don't match an account in the database, the
returned Map will contain a key named "resultCode" whose
value is "errors.invalidLogin". This code is used in the Struts layer to
look up the error message.
processLogin in interface CustomerProcessorparameters - A Map containing the user name and password for
the customer attempting to log in.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map processAutoLogin(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorMap must have the key: autoLoginToken. If the
login succeeds, the Customer property of the current
User will be populated with the database information for the
customer account. If the autoLoginToken doesn't match an account in the
database, the returned Map will contain a key named
"resultCode" whose value is "errors.invalidLogin".
processAutoLogin in interface CustomerProcessorparameters - A Map containing the autoLoginToken for the
customer.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map updateAddresses(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorMap
should contain keys corresponding to the delivery address properties of
CustomerAddress,
and the billing address properties of Customer. The
Customer property of the current user, and the first
CustomerAddress in the
customerAddressCollection of the Customer are
modified with the incoming address information. Then the database records
for the customer and the customer address are updated in
sscCustomer and sscCustomerAddress.
updateAddresses in interface CustomerProcessorparameters - A Map containing the address information for the
current user, which is to be used to update the account.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map updateCustomer(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorMap
should contain keys corresponding to the properties of
Customer. The
Customer property of the current user is modified with the
account information contained in the incoming Map. Then the
database record for the customer is updated. Used to process a changed
user name and password.
If the incoming user name is already used by a different customer, the
returned Map will contain a key named "resultCode" whose
value is "errors.userNameNotUnique". This code is used in the Struts
layer to look up the error message.
updateCustomer in interface CustomerProcessorparameters - A Map containing the account information for the
current user, which is to be used to update the account.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map loadCustomerLostPassword(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorCustomer property of this
CustomerProcesor from the database given a Map
containing the userName. Used in the lost password form,
when a customer must be retrieved from database without a password.
If the application is set to use one-way encryption for customer passwords, this method will generate a random password and update the customer's record with it.
If the customer corresponding to the user name in the Map
does not exist in the database, the returned Map will
contain a key named "resultCode" whose value is
"errors.userNameNotFound". This code is used in the Struts layer to look
up the error message.
loadCustomerLostPassword in interface CustomerProcessorparameters - A Map containing the user name of a given
customer.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Map loadOrderHistory()
throws java.lang.Exception
CustomerProcessorCustomer property of the current User will have
its orderHistory property populated with information from
the database about all of the customer's previous orders in the store.
loadOrderHistory in interface CustomerProcessorMap with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public Order loadOrderDetails(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessor
loadOrderDetails in interface CustomerProcessorparameters - A Map containing a key named
orderNumber with the order number of a given
order.
Order populated with information from the
database.
java.lang.Exception
public java.util.Collection loadDownloadFiles()
throws java.lang.Exception
CustomerProcessorsscProductSetting table for download files associated with
products that the customer has purchased previously.
loadDownloadFiles in interface CustomerProcessorCollection of Maps, one for each file
available for download by the customer.
java.lang.Exception
public java.util.Map saveCart(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorOrder in the database as a saved cart, with a
status of "Saved", which a customer can pick up later.
saveCart in interface CustomerProcessorparameters - A Map containing arguments, by default null.
Map with a key named "resultCode", equal to "0" if
the result is successful.
java.lang.Exception
public java.util.Collection loadSavedCarts()
throws java.lang.Exception
CustomerProcessorsscOrder database table
with a status of "Saved".
loadSavedCarts in interface CustomerProcessorCollection of Order objects
representing the customer's saved carts.
java.lang.Exception
public java.util.Map loadSavedCart(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessorsscOrder database table with a status of "Saved".
loadSavedCart in interface CustomerProcessorparameters - A Map containing a key named orderID
with the order id of a given order.
Map object containing the results of the
reprocessing of the order, or null, if the
refreshSaved Carts setting is false.
java.lang.Exception
public java.util.Map removeSavedCart(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessor
removeSavedCart in interface CustomerProcessorparameters - A Map containing a key named orderID
with the order id of a given order.
java.lang.Exception
public java.util.Map loadPreviousOrder(java.util.Map parameters)
throws java.lang.Exception
CustomerProcessor
loadPreviousOrder in interface CustomerProcessorparameters - A Map containing a key named orderID
with the order id of a given order.
Map object containing the results of the
reprocessing of the order, or null, if the
refreshReorders setting is false
java.lang.Exception
public java.util.Map loadCustomersAndCount(java.util.Map parameters)
throws java.lang.Exception
loadCustomersAndCount in interface CustomerProcessorjava.lang.Exception
public java.util.Map addCustomer(java.util.Map parameters)
throws java.lang.Exception
addCustomer in interface CustomerProcessorjava.lang.Exception
public Customer loadCustomerFromID(java.util.Map parameters)
throws java.lang.Exception
loadCustomerFromID in interface CustomerProcessorjava.lang.Exception
public java.util.Map editCustomer(java.util.Map parameters)
throws java.lang.Exception
editCustomer in interface CustomerProcessorjava.lang.Exception
public void editDeleteCustomers(java.util.Map parameters)
throws java.lang.Exception
editDeleteCustomers in interface CustomerProcessorjava.lang.Exception
public void deleteCustomer(java.util.Map parameters)
throws java.lang.Exception
deleteCustomer in interface CustomerProcessorjava.lang.Exception
public int loadMaxCustomerID()
throws java.lang.Exception
loadMaxCustomerID in interface CustomerProcessorjava.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||