public class MailPlugin extends PluginActivator implements MailService, PostCreateTopicListener
Modifier and Type | Field and Description |
---|---|
private AccessControlService |
acService |
static String |
AGGREGATION |
static String |
ATTACHMENTS |
(package private) Autocomplete |
autocomplete |
static String |
BODY |
static String |
CHILD |
static String |
CHILD_TYPE |
(package private) ImageCidEmbedment |
cidEmbedment |
static String |
COMPOSITION |
(package private) MailConfigurationCache |
config |
static String |
DATE |
static String |
EMAIL_ADDRESS |
static String |
FILE |
private FilesService |
fileService |
static String |
FROM |
(package private) boolean |
isInitialized |
private static Logger |
log |
static String |
MAIL |
static String |
MESSAGE_ID |
static String |
PARENT |
static String |
PARENT_TYPE |
static String |
RECIPIENT |
static String |
RECIPIENT_TYPE |
static String |
SENDER |
static String |
SIGNATURE |
static String |
SUBJECT |
static String |
TOPIC_TYPE |
static String |
USER_ACCOUNT |
bundle, dms
Constructor and Description |
---|
MailPlugin() |
Modifier and Type | Method and Description |
---|---|
private void |
associateDefaultSender(Topic mail) |
Association |
associateRecipient(long mailId,
long addressId) |
Association |
associateRecipient(long mailId,
long addressId,
RecipientType type)
Update or create a mail recipient association.
|
private Association |
associateRecipient(long topicId,
Topic recipient,
ChildTopicsModel value) |
Association |
associateSender(long mailId,
long addressId)
Update or create a mail sender association.
|
private Association |
associateSender(long topicId,
Topic sender,
ChildTopicsModel value) |
void |
associateValidatedRecipients(long mailId,
List<Topic> recipients)
Associate all valid email addresses of each recipient.
|
private void |
checkACLsOfMigration() |
private void |
configureIfReady() |
Topic |
copyMail(long mailId,
boolean includeRecipients)
Creates a copy of the mail.
|
private void |
createAttachmentDirectory() |
private RelatedTopic |
getContactOfEmail(long addressId) |
private RelatedTopic |
getContactSignature(Topic topic,
long addressId)
Comparing contact-signatures by "E-Mail Address"-Topic ID
|
String |
getDefaultRecipientType() |
private Association |
getRecipientAssociation(long topicId,
long addressId,
long recipientId) |
ResultList<RelatedTopic> |
getRecipientTypes() |
Collection<Topic> |
getSearchParentTypes()
Returns parent of each search type.
|
private RelatedTopic |
getSender(long topicId,
boolean fetchRelatingComposite) |
private RelatedTopic |
getSender(Topic topic,
boolean fetchRelatingComposite) |
private Association |
getSenderAssociation(long topicId,
long senderId) |
void |
init()
Initialize.
|
ResultList<Topic> |
listSearchParentTypes() |
Topic |
loadConfiguration()
Load the configuration.
|
Association |
mailSender(long mailId,
long addressId) |
private void |
mapRecipients(org.apache.commons.mail.HtmlEmail email,
Map<RecipientType,List<javax.mail.internet.InternetAddress>> recipients) |
void |
postCreateTopic(Topic topic)
Sets the default sender and signature of a mail topic after creation.
|
private void |
reportException(StatusReport report,
Level level,
MailError error,
Exception e) |
List<TopicModel> |
search(String term)
Returns the parent of each search type substring match.
|
StatusReport |
send(long mailId) |
StatusReport |
send(Mail mail)
Sends a HTML mail.
|
void |
serviceArrived(PluginService service) |
void |
serviceGone(PluginService service) |
Topic |
writeTo(long recipientId)
Creates a new mail to all email addresses of the contact topic.
|
getBundleContext, getPluginName, getStaticResource, getUri, postInstall, publishDirectory, setCoreService, shutdown, start, stop, toString
public static final String AGGREGATION
public static final String COMPOSITION
public static final String CHILD
public static final String CHILD_TYPE
public static final String TOPIC_TYPE
public static final String PARENT
public static final String PARENT_TYPE
public static final String FILE
public static final String ATTACHMENTS
public static final String BODY
public static final String EMAIL_ADDRESS
public static final String DATE
public static final String FROM
public static final String MAIL
public static final String MESSAGE_ID
public static final String RECIPIENT
public static final String RECIPIENT_TYPE
public static final String SENDER
public static final String SIGNATURE
public static final String SUBJECT
public static final String USER_ACCOUNT
private AccessControlService acService
private FilesService fileService
MailConfigurationCache config
ImageCidEmbedment cidEmbedment
Autocomplete autocomplete
boolean isInitialized
public MailPlugin()
public Association associateRecipient(long mailId, long addressId)
public Association associateRecipient(long mailId, long addressId, RecipientType type)
MailService
associateRecipient
in interface MailService
mailId
- ID of a mail topic.addressId
- Email address of recipient.type
- Recipient type URI or null to choose the configured default.public void associateValidatedRecipients(long mailId, List<Topic> recipients)
MailService
associateValidatedRecipients
in interface MailService
public Association mailSender(long mailId, long addressId)
associateSender(long, long)
public Association associateSender(long mailId, long addressId)
MailService
associateSender
in interface MailService
mailId
- ID of a mail or configuration topic.addressId
- Email address of sender.public List<TopicModel> search(String term)
term
- String to search.public Topic copyMail(long mailId, boolean includeRecipients)
mailId
- ID of the mail topic to clone.includeRecipients
- Copy recipients of the origin?public Topic writeTo(long recipientId)
recipientId
- ID of a recipient contact topic.public String getDefaultRecipientType()
public ResultList<RelatedTopic> getRecipientTypes()
public ResultList<Topic> listSearchParentTypes()
getSearchParentTypes()
public Collection<Topic> getSearchParentTypes()
MailService
getSearchParentTypes
in interface MailService
public Topic loadConfiguration()
public void postCreateTopic(Topic topic)
postCreateTopic
in interface PostCreateTopicListener
public StatusReport send(long mailId)
send(Mail)
public StatusReport send(Mail mail)
MailService
send
in interface MailService
mail
- Mail topic.public void init()
init
in interface PluginContext
init
in class PluginActivator
private void configureIfReady()
private void checkACLsOfMigration()
private void createAttachmentDirectory()
private void associateDefaultSender(Topic mail)
mail
- clientState
- postCreateTopic(Topic)
private Association associateRecipient(long topicId, Topic recipient, ChildTopicsModel value)
private Association associateSender(long topicId, Topic sender, ChildTopicsModel value)
private RelatedTopic getContactOfEmail(long addressId)
private RelatedTopic getContactSignature(Topic topic, long addressId)
private Association getRecipientAssociation(long topicId, long addressId, long recipientId)
private RelatedTopic getSender(long topicId, boolean fetchRelatingComposite)
private RelatedTopic getSender(Topic topic, boolean fetchRelatingComposite)
private Association getSenderAssociation(long topicId, long senderId)
private void mapRecipients(org.apache.commons.mail.HtmlEmail email, Map<RecipientType,List<javax.mail.internet.InternetAddress>> recipients) throws org.apache.commons.mail.EmailException
org.apache.commons.mail.EmailException
private void reportException(StatusReport report, Level level, MailError error, Exception e)
public void serviceArrived(PluginService service)
serviceArrived
in interface PluginContext
serviceArrived
in class PluginActivator
public void serviceGone(PluginService service)
serviceGone
in interface PluginContext
serviceGone
in class PluginActivator
Copyright © 2015. All Rights Reserved.