public interface MailActionsHandler
Modifier and Type | Method and Description |
---|---|
default void |
addScriptBlockForComposeWindow(Element head)
Possibility to add an additional <script> block to HTML's head element
|
default void |
addSelectorForComposeWindow(Element toSelect,
Element ccSelect,
Element bccSelect)
Possibility to enrich the placeholder selectors for recipient types TO, CC and BCC with an own functionality.
|
default void |
afterMailSent(String actionId,
MessageTemplate mt,
DMSDocForm email,
boolean isSent,
HttpServletRequest req)
This method is called after the mail has been sent the the email object (parameter "email") has been created.
|
default void |
beforeMailSent(String actionId,
MessageTemplate mt,
DMSFolder mailFolder,
Pair<FormType,String> emailFtInfo,
HttpServletRequest req)
This method is called before the mail is sent and before the permission check is performed, if the user
is able to create an email object (info available in parameter "emailFtInfo") and
is able to store this object in appropriate
DMSFolder "mailFolder". |
default JSONArray |
getMailListAsJson(Persistent ctx,
FormType emailFt)
This method can be used for manipulating the mail list in the Mail tab.
|
default void |
initForComposeWindow(String actionId,
Persistent ctx,
HttpServletRequest req)
Method containing the initial data for compose window
|
default List<DMSObject> |
modifyDMSAttachments(List<DMSObject> attachments,
Message msg)
Method to modify given list of DMS attachments that should be filled in Compose window.
|
default List<Pair<String,File>> |
modifyFileAttachments(List<Pair<String,File>> attachments,
Message msg)
Method to modify given list of
File attachments that should be filled in Compose window. |
default Pair<String,String> |
modifyMailBody(Pair<String,String> mailBody,
Message msg)
Method to modify given mail body (text/plain and text/html) that should be filled in Compose window.
|
default Map<Message.RecipientType,String> |
modifyRecipients(Map<Message.RecipientType,String> recipients,
Message msg)
Method to modify given recipients that should be filled in Compose window.
|
default String |
modifySenderAddress(String sender)
Method to modify given sender address that should be filled in Compose window.
|
default String |
modifySubject(String subject,
Message msg)
Method to modify given subject that should be filled in Compose window.
|
default void initForComposeWindow(String actionId, Persistent ctx, HttpServletRequest req)
actionId
- the id of the action defined in GUI-XML in format <xml-id>.<node-id>
(e.g. in case of default action "compose" the id is "admin.composeSC")ctx
- either a ProcessInstance
or a DMSFolder
where the new composed mail should be storedreq
- the HttpServletRequest
containing all data which are transferred from client to serverdefault Map<Message.RecipientType,String> modifyRecipients(Map<Message.RecipientType,String> recipients, Message msg)
recipients
- by default a HashMap
containing the Message.RecipientType
as key and the
appropriate recipient email addresses as string value.msg
- the referenced Message
object; can be null
Map
of recipients; the default implementation returns the value of parameter "recipients".default String modifySubject(String subject, Message msg)
subject
- the subject which should modifiedmsg
- the referenced Message
object; can be null
default Pair<String,String> modifyMailBody(Pair<String,String> mailBody, Message msg)
default String modifySenderAddress(String sender)
sender
- the sender address which should modified; it could be
null
or empty, than the MailUtil.getSender()
is usedMailBox
object in format <classname>:<oid>User
object in format <classname>:<oid>String
default List<DMSObject> modifyDMSAttachments(List<DMSObject> attachments, Message msg)
attachments
- a list of DMSObject
that should be modified;
this list is never null
, but could be empty depending on mail actionmsg
- the referenced Message
object; can be null
DMSObject
that should be added as DMS attachments;
the default implementation returns the value of parameter "attachments".default List<Pair<String,File>> modifyFileAttachments(List<Pair<String,File>> attachments, Message msg)
File
attachments that should be filled in Compose window.attachments
- a list of attachments that should be modified as Pair
containing
the filename as first parameter and the File
itself as second one;
this list is never null
, but could be empty depending on mail actionmsg
- the referenced Message
object; can be null
Pair
that should be added as file attachments;
the default implementation returns the value of parameter "attachments".default void addScriptBlockForComposeWindow(Element head)
head
- the HTML's head element as Element
default void addSelectorForComposeWindow(Element toSelect, Element ccSelect, Element bccSelect)
default void beforeMailSent(String actionId, MessageTemplate mt, DMSFolder mailFolder, Pair<FormType,String> emailFtInfo, HttpServletRequest req)
DMSFolder
"mailFolder".actionId
- the id of the action defined in GUI-XML in format <xml-id>.<node-id>
(e.g. in case of default action "compose" the id is "admin.composeSC")mt
- the MessageTemplate
object which is used for sending the mailmailFolder
- the DMSFolder
where the email object should be storedemailFtInfo
- a Pair
containing the FormType
as key an the extension as String (by default "eml")req
- the HttpServletRequest
containing all data which are transferred from client to serverdefault void afterMailSent(String actionId, MessageTemplate mt, DMSDocForm email, boolean isSent, HttpServletRequest req)
actionId
- the id of the action defined in GUI-XML in format <xml-id>.<node-id>
(e.g. in case of default action "compose" the id is "admin.composeSC")mt
- the MessageTemplate
object which was used for sending the mailemail
- the email object as DMSDocForm
where the sent Message
was stored.isSent
- flag to indicate, if the mail has been sent or not; if the Message
was put into
@enterprise mail-queue this flag has the value false
req
- the HttpServletRequest
containing all data which are transferred from client to serverdefault JSONArray getMailListAsJson(Persistent ctx, FormType emailFt) throws Exception
MailFunctions.toJSON(DMSDocForm)
, but without "parent" and
"hasChildren" attributes that must be defined manually.
The following example shows a structure of such a JSONArray
which
contains nested elements (= children):
[{"_toString":"mailtext (Support ID:52)", "objectId":"com.groiss.dms.impl.Email:4295027131", "mailstatus":"mailqueued", "subj":"mailtext (Support ID:52)", "sender":"sender@company.com", "recipient":"recipient@company.com", "maildate":1519808251000, "avwcreatedat":1519808251000, "replytoid":"<1814437681.6.1519808246976@gi>", "hasAttachments":false, "parent":"root", ====> placeholder which defines that no parent exists "hasChildren":false, }, {"_toString":"Process 34", "hasChildren":true, ====> defines that mails e.g. of a subprocess are available "subj":"Incident 34", "objectId":"<any_obj_class>:<oid1>", "parent":"root" ====> placeholder which defines that no parent exists }, ----- following element is a child of process 34 ----- {"_toString":"mailtext_inc (Support ID:34)", "objectId":"com.groiss.dms.impl.Email:4295027107" "mailstatus":"mailsent", "subj":"mailtext_inc (Support ID:34)", "sender":"sender@company.com", "recipient":"recipient@company.com", "maildate":1519807597000, "avwcreatedat":1519807597000, "replytoid":"<2083146686.2.1519807593244@gi>", "hasAttachments":true, "parent":<oid1>, ====> refers to oid of objectId-attribute of parent entry "hasChildren":false }]
ctx
- either a ProcessInstance
or a DMSFolder
where mails are stored;
in case of ProcessInstance
the function MailFunctions.getEmailsFolder(ProcessInstance, boolean)
can be calledemailFt
- the FormType
for reading the appropriate mail objectsJSONArray
containing the mail list for the client; by default null
is returned which indicates that
the default mail list loading behavior should be used by Mail tabException
@enterprise 10.0.39049 Copyright © 2024 FREQUENTIS AG. All Rights Reserved.