|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.arsdigita.acs.spam.Spam
Utility classes and procedural abstractions for spam.
Constructor Summary | |
Spam()
|
Method Summary | |
static int |
checkpointLoggingFrequency()
Checkpoint the last user_id message was sent to, every n msgs |
static void |
checkSpamDropZone()
Look for a set of files with names specified from the daily_spam_files table. |
static String |
createMultiPartHtmlMessageBody(String qp_body_plain,
String qp_body_html)
Creates a multipart/alternative MIME message with a plain text part and HTML part The two parts should be passed in encoded as quoted-printable text. |
static String |
dateWidget(String column)
Return html code fragment for date input |
static String |
encodeQuotedPrintable(String msg)
Replaces/removes bad characters from msg |
static String |
fileLocation(String filename)
Returns the absolute path to the spam file. |
static String |
getDaemonEnabledP()
Returns the state of the spam daemon. |
static String |
getEmailSendingEnabledP()
Returns the state of sending spam. |
static String |
getSpamFromFilesystem(String filename)
Returns the file from the dropzone as a string. |
static String |
getUseBulkmailP()
Returns the state of using bulkmail. |
static String |
htmlSelectValueOptions(String[] option,
String[] value,
String selected_value)
Generate html option tags with values for an html selection widget. |
static String |
htmlSelectValueOptions(String sql,
String option,
String value,
String selected_value)
Generate html option tags with values for an html selection widget. |
static String |
integerOptionList(int begin,
int end,
String selected_value)
Returns html code fragment for an option list of integer values |
static String |
postNewSpamMessage(String spam_id,
String template_p,
String from_address,
String title,
String body_plain,
String body_html,
String body_aol,
String target_users_description,
String target_users_query,
String send_date,
String creation_user,
String status)
Insert a message to be sent by the spam daemon at a scheduled time send_date. |
static String |
readFileAsString(String filename)
Reads the file and returns the contents as a string |
static String |
removalBlurb(String subsection,
String filetype)
Gets the standard site-wide or subsection-specific removal blurb, for attaching to outgoing email. |
static String |
sanitizeFilename(String filename)
Remove any pathname metachars from filename, allow only a very clean set of characters |
static int |
sendMsgToRecipients(String recipients_query,
String spam_id,
String from_address,
String body_plain,
String body_html,
String body_aol,
AdSet msg_plain_headers,
AdSet msg_html_headers,
AdSet msg_aol_headers,
String template_p,
String title,
String bulkmail_id)
Sends out a spam for spam_id. |
static String |
sendScheduledSpamMessages()
Calls on the spam daemon to send out all spam. |
static void |
sendSpamMessage(AdSet spam_row_set)
Extract the msg bodies and target recipients list query from the spam msg, and send email to the recipients. |
static void |
setDaemonActive(String val)
Enable/disable the spam daemon. |
static void |
setEmailSending(String val)
Enable/disable the sending of spam. |
static void |
setUseBulkMailP(String val)
Enable/disable use of bulk mailer for sending of spam. |
static String |
spamMimeBoundary()
Really, this should make sure to generate a boundary string that does not appear in the content. |
static String |
systemDefaultFromAddress()
Returns the default from address for spam messages set in the parameters file |
static String |
timeWidget(String column)
Returns html code fragment for time input |
static String |
userClassDescription(AdSet setid)
Takes an AdSet of key/value pairs and produces a human-readable description of the class of users specified. |
static Vector |
userClassParameters()
Returns the list of parameter var names used to define a user class. |
static String |
userClassQuery(AdSet setid)
Takes an AdSet of key/value pairs and produces a query for the class of users specified (one user per row returned). |
static String |
verifyDate(AdSet date)
Takes date values from an AdSet and checks that they are valid. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public Spam()
Method Detail |
public static String getDaemonEnabledP()
public static String getEmailSendingEnabledP()
public static String getUseBulkmailP()
public static void setEmailSending(String val)
public static void setDaemonActive(String val)
public static void setUseBulkMailP(String val)
public static String sendScheduledSpamMessages() throws SQLException, ACSException, FileNotFoundException, IOException
public static void sendSpamMessage(AdSet spam_row_set) throws SQLException
spam_row_set
- Contains a spam row from spam_history.public static String timeWidget(String column) throws SQLException, ACSException
column
- The base name for the input variables in a form.public static String dateWidget(String column) throws SQLException, ACSException
column
- The base name for the input variables in a form.public static String htmlSelectValueOptions(String sql, String option, String value, String selected_value) throws SQLException, ACSException
sql
- The sql query used to obtain valuesoption
- The column from sql to use as the value of the option.value
- The column from sql to use as the name of the option.selected_value
- The value to mark as selected.public static String htmlSelectValueOptions(String[] option, String[] value, String selected_value)
option
- An array containing the values for each option.value
- An array contaiing the names for each option.selected_value
- The value to mark as selected.public static String verifyDate(AdSet date) throws SQLException, ACSException
date
- An AdSet containing "year", "month", and "day" fields.public static String integerOptionList(int begin, int end, String selected_value)
begin
- The begin number for option list.end
- The end number for the option list.selected_value
- the value to mark as selected.public static String postNewSpamMessage(String spam_id, String template_p, String from_address, String title, String body_plain, String body_html, String body_aol, String target_users_description, String target_users_query, String send_date, String creation_user, String status) throws DataSourceException, ACSException
spam_id
- Spam_id of the message.template_p
- Is this message in template format?from_address
- Address to send from.title
- Title of the spam.body_plain
- Message body for plain messages.body_html
- Message body for html messages.body_aol
- Message body for aol messages.target_users_description
- Description for the group of users to send spam to.target_users_query
- Query that returns the group of users to spam.send_date
- A string of the form "YYYY-MM-DD HH24:MI:SS" or else an empty string.creation_user
- User_id of creator.status
- Status of spam state.public static Vector userClassParameters()
public static String userClassDescription(AdSet setid) throws ACSException, SQLException
public static String userClassQuery(AdSet setid) throws SQLException, ACSException
set_id
- An AdSet containing all the parameters of the user class.public static String sanitizeFilename(String filename)
filename
- The filename to sanitize.public static String fileLocation(String filename)
filename
- The name of the file.public static String getSpamFromFilesystem(String filename) throws FileNotFoundException, IOException
filename
- The name of the file.public static void checkSpamDropZone() throws SQLException, ACSException, FileNotFoundException, IOException
public static String spamMimeBoundary()
public static int checkpointLoggingFrequency()
public static int sendMsgToRecipients(String recipients_query, String spam_id, String from_address, String body_plain, String body_html, String body_aol, AdSet msg_plain_headers, AdSet msg_html_headers, AdSet msg_aol_headers, String template_p, String title, String bulkmail_id) throws SQLException
public static String encodeQuotedPrintable(String msg)
msg
- The message to encodepublic static String removalBlurb(String subsection, String filetype)
subsection
- filetype
- public static String readFileAsString(String filename) throws FileNotFoundException, IOException
filename
- The file to readpublic static String systemDefaultFromAddress()
public static String createMultiPartHtmlMessageBody(String qp_body_plain, String qp_body_html)
qp_body_plain
- Alternative plain messageqp_body_html
- Alternative html message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |