|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softslate.commerce.customer.core.ActionUtils
Provides static methods that assist with actions in the Struts layer.
Field Summary | |
(package private) static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
ActionUtils()
|
Method Summary | |
static java.lang.String |
parseGenericTemplate(BaseForm baseForm,
java.lang.String template)
Parses a string template with variables contained in a given BaseForm . |
static java.lang.String |
parseLostPasswordTemplate(Customer customer,
BaseForm baseForm,
java.lang.String template)
Parses a string template with variables contained in a given BaseForm and
Customer . |
static java.lang.StringBuffer |
replaceOrderItems(java.lang.StringBuffer source,
java.util.Collection orderItems)
Parses a StringBuffer , inserting order item data. |
static java.lang.StringBuffer |
replaceValue(java.lang.StringBuffer source,
java.lang.String value,
java.lang.String token)
Replaces the given token, or placeholder, with the given value in the given StringBuffer . |
static void |
sendMultipartEmail(java.lang.String toEmails,
java.lang.String ccEmails,
java.lang.String bccEmails,
java.lang.String fromEmail,
java.lang.String smtpServer,
java.lang.String subject,
java.lang.String textMessage,
java.lang.String htmlMessage)
Sends a multipart text and HTML email from the store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static org.apache.commons.logging.Log log
Constructor Detail |
public ActionUtils()
Method Detail |
public static java.lang.String parseGenericTemplate(BaseForm baseForm, java.lang.String template)
BaseForm
. Used to parse email templates for dynamically
generated emails the store generates.
The string template may have a number of placeholders deliniated by "%%".
(E.g. "%%STORE_NAME%%"). This method replaces the placeholders with
values from the BaseForm
, be they settings from the
database such as the store's name, or values from the current user's
order.
baseForm
- Contains variables that will be used to replace the template's
placeholders.template
- A String
containing placeholders that this
method will replace.
public static java.lang.StringBuffer replaceValue(java.lang.StringBuffer source, java.lang.String value, java.lang.String token)
StringBuffer
.
source
- The StringBuffer
being parsed.value
- The value the placeholder is being replaced with.token
- The placeholder being replaced.
StringBuffer
.public static java.lang.StringBuffer replaceOrderItems(java.lang.StringBuffer source, java.util.Collection orderItems)
StringBuffer
, inserting order item data. Loops
through the "%%START_ITEMS%%" and "%%END_ITEMS%%" placeholders, inserting
data from a given Collection
of
OrderItem
objects. Used to parse the invoice email template upon order completion.
source
- The StringBuffer
being parsed.orderItems
- A Collection
of
OrderItem
objects whose data is used to parse the source.
StringBuffer
.public static java.lang.String parseLostPasswordTemplate(Customer customer, BaseForm baseForm, java.lang.String template)
BaseForm
and
Customer
. Used
to parse the lost password email template.
The string template may have a number of placeholders deliniated by "%%".
(E.g. "%%USERNAME%%"). This method replaces the placeholders with values
from the BaseForm
and Customer
, be they
settings from the database such as the store's name, or the current
customer's user name and password.
customer
- The current Customer
whose lost password is
being emailed.baseForm
- Contains variables that will be used to replace the template's
placeholders.template
- The template for the lost password email, which is being
parsed.
public static void sendMultipartEmail(java.lang.String toEmails, java.lang.String ccEmails, java.lang.String bccEmails, java.lang.String fromEmail, java.lang.String smtpServer, java.lang.String subject, java.lang.String textMessage, java.lang.String htmlMessage) throws java.lang.Exception
toEmails
- A comma-separated list of email addresses the email is being
sent to.ccEmails
- A comma-separated list of email addresses the email is being
copied to.bccEmails
- A comma-separated list of email addresses the email is being
blind copied to.fromEmail
- The email address used as the email's from address.smtpServer
- The SMTP server to be used to send the email.subject
- The subject used for the email.textMessage
- The message for the text part of the email.htmlMessage
- The message for the HTML part of the email.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |