Class MailPlugin

java.lang.Object
org.imixs.workflow.engine.plugins.AbstractPlugin
org.imixs.workflow.engine.plugins.MailPlugin
org.imixs.marty.profile.MailPlugin
All Implemented Interfaces:
org.imixs.workflow.Plugin
Direct Known Subclasses:
MailPlugin

public class MailPlugin extends org.imixs.workflow.engine.plugins.MailPlugin
This Plugin extends the Imixs Workflow MailPlugin.

The Plugin translates recipient addresses with the mail address stored in the users profile

In addition this plugin adds the attachments from a snapshot workItem into the mail body if the tag was found. A attachment can be named:

 
     <attachments>order.pdf</attachments>
  
  <attachments><itemvalue>_ordernumber</itemvalue>.pdf</attachments>
 
 
 

An Attachment can also be taken from a textblock. *

 
  
     <attachments textblock="my_block"></attachments>
 
 
Version:
2.0
Author:
rsoika
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
    static String
     
    static String
     
    static String
     

    Fields inherited from class org.imixs.workflow.engine.plugins.MailPlugin

    CONTENTTYPE_TEXT_HTML, CONTENTTYPE_TEXT_PLAIN, ERROR_INVALID_XSL_FORMAT, ERROR_MAIL_MESSAGE, INVALID_ADDRESS, MAIL_SESSION_NAME

    Fields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin

    INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.mail.internet.InternetAddress
    this helper method creates an internet address from a string if the string has illegal characters like whitespace the string will be surrounded with "".
    org.imixs.workflow.ItemCollection
    Helper method to load a text-block workitem
    org.imixs.workflow.ItemCollection
    run(org.imixs.workflow.ItemCollection documentContext, org.imixs.workflow.ItemCollection documentActivity)
    This method adds the attachments of the blob workitem to the MimeMessage

    Methods inherited from class org.imixs.workflow.engine.plugins.MailPlugin

    close, getBody, getCharSet, getContentType, getFrom, getMailMessage, getMailSession, getMultipart, getRecipients, getRecipientsBCC, getRecipientsCC, getReplyTo, getSubject, initMailMessage, isHTMLMail, setCharSet, transformXSLBody

    Methods inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin

    getCtx, getWorkflowService, init, mergeFieldList, uniqueList

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SNAPSHOTID

      public static String SNAPSHOTID
    • PROFILESERVICE_NOT_BOUND

      public static String PROFILESERVICE_NOT_BOUND
    • PROPERTYSERVICE_NOT_BOUND

      public static String PROPERTYSERVICE_NOT_BOUND
    • INVALID_EMAIL

      public static String INVALID_EMAIL
  • Constructor Details

    • MailPlugin

      public MailPlugin()
  • Method Details

    • run

      public org.imixs.workflow.ItemCollection run(org.imixs.workflow.ItemCollection documentContext, org.imixs.workflow.ItemCollection documentActivity) throws org.imixs.workflow.exceptions.PluginException
      This method adds the attachments of the blob workitem to the MimeMessage
      Specified by:
      run in interface org.imixs.workflow.Plugin
      Overrides:
      run in class org.imixs.workflow.engine.plugins.MailPlugin
      Throws:
      org.imixs.workflow.exceptions.PluginException
    • getInternetAddress

      public jakarta.mail.internet.InternetAddress getInternetAddress(String aAddr) throws jakarta.mail.internet.AddressException
      this helper method creates an internet address from a string if the string has illegal characters like whitespace the string will be surrounded with "". If you subclass this MailPlugin Class you can overwrite this method to return a different mail-address name or lookup a mail attribute in a directory like a ldap directory.
      Overrides:
      getInternetAddress in class org.imixs.workflow.engine.plugins.MailPlugin
      Parameters:
      aAddr -
      Returns:
      Throws:
      jakarta.mail.internet.AddressException
    • loadTextBlock

      public org.imixs.workflow.ItemCollection loadTextBlock(String name)
      Helper method to load a text-block workitem
      Parameters:
      name -
      Returns: