Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

4. Service Modules

indent
1
1

4.1 Class Diagram

4.2 Class Descriptions.

4.2.1 EmailCentralService Interface

This is the interface that defines the methods available for the other web applications to utilize when they are required
to send out emails to a single or a list of recipients. The service includes the following methods:

  1. public void sendBulkEmail(EmailModel emailModel, String summaryReportTemplate, boolean defaultSort)
  2. public void sendBulkEmailWithTemplate(EmailModel emailModel, String velocityTemplate, Map context, String summaryReportTemplate, boolean defaultSort)
  3. public Map<String, Integer> sendBulkEmailWithCounts(EmailModel emailModel)
  4. public Map<String, Object> generateEmailPreviewWithTemplate(EmailModel emailModel, String type, String velocityTemplate, Map context)
  5. public Map<String, Object> generateSummaryReportPreview(EmailModel emailModel)
  6. public void sendEmailWithAttachments(EmailModel emailModel, List<File> attachments)
  7. public void sendEmailWithTemplateAndAttachments(EmailModel emailModel, String velocityTemplate, Map context, List<File> attachments)
  8. public void sendEmailWithAttachmentsFromDataSource(EmailModel emailModel, List<File> attachments, boolean useApplicationConfig)
  9. public void newEmail(String velocityTemplate, Map context, String to, String from, String subject, boolean html)
  10. Wiki Markup
    <span style="color: #000091">public</span> <span style="color: #910091">void</span> newEmail(String velocityTemplate, Map context, String\[\] tos, String from, String subject, boolean html)
  11. public void newEmail(String velocityTemplate, Map context, String to, String subject, boolean html)
  12. public void
    Wiki Markup
    newEmail(String velocityTemplate, Map context, String\[\] tos, String subject, boolean html)
  13. public void newEmail(String body, String to, String subject, boolean html)
  14. Wiki Markup
    <span style="color: #000091">public</span> <span style="color: #910091">void</span> newEmail(String from, List<EmailPerson) to, String subject, String body, String\[\] cc, String\[\] bcc, String\[\] rr, String velocityTemplate)
  15. Wiki Markup
    <span style="color: #000091">public</span> <span style="color: #910091">void</span> newEmail(String body, String\[\] tos, String from, String subject, String\[\] cc, String\[\] bcc, boolean html, List<File> attachments)
  16. Wiki Markup
    <span style="color: #000091">public</span> <span style="color: #910091">void</span> newEmail(String body, String from, String\[\] tos, String subject, String\[\] cc, String\[\] bcc, boolean html, List<DataSource> attachments, boolean overrideFromAddress)
  17. Wiki Markup
    <span style="color: #000091">public</span> <span style="color: #910091">void</span> newEmail(String from, String\[\] to, String subject, String body, String\[\] cc, String\[\] bcc, String\[\] rr)
  18. public List getMessageQueue()
  19. public void batchSend()
  20. public boolean validateEmailAddress(String emailAddress)
  21. public List getMessageQueue()
  22. public List<String Object> getMessageQueueStatistics(Date fromDate, Date thruDate, String emailFrom, String emailTo, String status)
  23. public void batchSend()
  24. public void delete()
  25. public boolean validateEmailAddress(String emailAddress)
4.2.3 EmailCentralService Implementation

This is the implementation class for the EmailCentralService. It contains an EmailService object (in csf common-legacy module) to
perform its tasks.

4.2.3.1 sendBulkEmail

Wiki Markup
This method obtains an EmailModelDomain Object. It will then process the data and call the newEmail method to sendsave the email and
the summary report&nbsp;for to the intended recipients. The call to the newEmail method should be configured with the following parameters:
\\
newEmail(String from, String\[\] to, String subject, String body, String\[\] cc, String\[\] bcc, String\[\] rr);
The following attributes in the EmailModel Object will affect the generation of email:

  1. a list of email addresses of the recipients specified in the "To" field <required>
  2. a list of email addresses of the recipients specified in the "cc" field <optional>
  3. a list of email addresses of the recipients specified in the "Bcc" field <optional>
  4. a list of email addresses of the recipients speicified in the "Report Recipient" field <optional>
  5. email subject<optional>
  6. email text <required>
4.2.3.2 sendBulkEmailWithTemplate

This method obtains an EmailModel Object, a velocity template name and a map that contains the values for the variables in the template.
It will use the velocity template and the map to generate the text for the email. Then, it will call the sendBulkEmail method to sendcreate
and save the email message and the summary report to report for intended recipients.

4.2.3.3 sendBulkEmailWithCounts

This method obtains an EmailModel Object. It will call the sendBulkEmail method to send the to create and save the email message and the summary
report to intended
recipients. Then, it will call the BatchSend to send out the email and return the counts of successful and failed delivery.

4.2.3.4 generateEmailPreviewWithTemplate

This method obtains an EmailModel Object, a string to specify the type of preview, a velocity template name, and a Map that contains the values
for the variables within the velocity template. It will use the velocity template and the map to generate the text for the email. Then, it will
updated the email test tect to the email model object and put the updated object into the returned Map. If a summary report preview is required, it
will call the generateSummaryReportPreview method to add the attributes necessary to generate the summary report preview to the returned map.

4.2.3.5 generateSummaryReportPreview

This private method adds the objects/attributes necessary to create a preview of the summary report. The objects to be added are as follows:

  1. A String that contains the content of the summary report
4.2.3.6 sendEmailWithAttachments

This method accepts an EmailModel object and a list of attachments. It will then call newEmail method to create and save the message(s) in database.

4.2.3.7 sendEmailWithTemplateAndAttachments

This method accepts an EmailModel object, a velocity template name, a map of replaced values, and a list of File objects (attachments). It will then
merge the velocity template with the replace values. Afterwards, it will call sendEmailWithAttachments to create and save the message(s) in database.

4.2.3.8 sendEmailWithAttachmentsFromDataSource

 This method accepts an EmailModel object and a list of DataSource objects(attachments)  and a boolean to signal the system to use the from
 address in the applicationConfiguration or not. It will then call newEmail method to create and save the message(s) in databaseThese sets of methods are the same public methods available in the EmailService in the CSF common-legacy module.

4.2.3.
7 prepare
9 newEmail

These 3 sets of methods are static the same public methods available in the EmailService in the CSF common-legacy module.

4.2.3.
8 getMessageQueue
10 sendReportRecipientEmail
4.2.3.11 createReportRecipientContent

This method is a public method migrated over from the EmailServiceImpl in common-legacy module.

4.2.3.12 saveMessage
4.2.3.13 saveMessageWithAttachmentAsDataSource
4.2.3.14 updateDataToEmailEvent
4.2.3.15 updateApplicationConfigurationParametersToEmailEvent
4.2.3.
9
16 updateMessageContent
4.2.3.17 createMimeMessagePreparatorForEmailWithCcBccAttachments
4.2.3.18 createMimeMessagePreparatorForEmail
4.2.3.19 prepare
4.2.3.20 batchSend

This method is a public method migrated over from the EmailServiceImpl in common-legacy module.

4.2.3.
10 createReportRecipientContent
21 sendMessage

These methods are public methods that are This method is a public method migrated over from the EmailServiceImpl in common-legacy module.

4.2.3.
11 createMessage
22 getMessageQueue

This method is a public method migrated over from the EmailServiceImpl in common-legacy module.

4.2.3.
12 sendMessage

These methods are public methods that are migrated over from the EmailServiceImpl in common-legacy module.

23 getMessageQueueStatistics
4.2.3.
13
24 validateEmailAddress

This method takes an input of email address in String and validate if the email address is valid. If the email address is valid, it will return
true. If not, it will return false. The input email address is validated according to the following conditions:

  1. The system will create a new InternetAddress object using the input email address and then invoke the validate method of the InternetAddress object to verify it is a real email address
4.2.3.25 delete
4.2.3.26 getTemplatePath
4.2.3.27 getFileSeparator
4.2.3.28 isTomcatServer
4.2.3.29 isErrorInEmailMetaData
4.2.3.30 getMimeType
4.2.3.31 handleException
4.2.3.32 nonNullizeArray