public class EmailServiceImpl extends FaxToMailServiceSupport implements EmailService
| Modifier and Type | Field and Description |
|---|---|
protected org.nuiton.util.beans.Binder<Attachment,Attachment> |
attachmentBinder |
serviceContext| Constructor and Description |
|---|
EmailServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Email |
addToHistory(String emailId,
HistoryType type,
FaxToMailUser user,
Date date,
String... fields) |
protected void |
browseFolderParent(MailFolder folder,
FaxToMailUser user,
MailFolderService mailFolderService) |
Map<Range,Long[]> |
computeQuantitiesByRange(MailFolder rootFolder) |
protected void |
computeUserReadableFolder(Set<MailFolder> readMailFolders,
Iterable<MailFolder> mailFolders)
Calcule recursivement l'ensemble des répertoires lisible par un utilisateur récursivement.
|
List<MailLock> |
getAllMailLocks()
Retourne la liste des vérrouillages actifs.
|
long |
getArchivedMailCount()
Retourne le nombre de mail archivé.
|
AttachmentFile |
getAttachmentFile(String attachmentId,
boolean original) |
AttachmentFile |
getAttachmentFileFromStream(InputStream contentStream)
Save content stream into attachment file content.
|
List<MailFolder> |
getChildrenRecursively(MailFolder folder) |
Set<Object> |
getDistinctValues(MailFolder folder,
String[] properties,
boolean sum) |
Email |
getEmailById(String id) |
protected Email |
getEmailById(String id,
String fetch,
String... otherFetches) |
AttachmentFile |
getEmailDetailAsAttachment(Email email)
Generate email details as PDF and return it as an printable attachment.
|
protected String |
getEmailDetailAsHtml(Email email) |
org.nuiton.util.pagination.PaginationResult<Email> |
getEmailForFolder(MailFolder folder,
FaxToMailUser currentUser,
EmailFilter filter,
org.nuiton.util.pagination.PaginationParameter page)
Recupère les demandes d'un dossier visible par un utilisateur.
|
Email |
getFullEmailById(String id) |
Email |
getFullEmailById(String id,
FaxToMailUser user) |
protected String |
getFullMailFolderPath(MailFolder folder)
Compute mail folder path (separated by /) from root to current.
|
ReplyContent |
getReplyContent(String replyId)
Get reply content on demand for lazy loading.
|
Email |
groupEmails(String email1Id,
String email2Id,
FaxToMailUser user) |
protected void |
handleEdiTransmission(Email email,
HistoryTopiaDao historyDao,
Set<String> fieldSet) |
void |
importArchive(InputStream inputStream,
File attachmentBase)
Import archive from input stream.
|
Email |
lockEmail(String emailId,
FaxToMailUser currentUser)
Vérrouille une demande par un utilisateur empechant les autres de l'ouvrir.
|
Email |
openEmail(String emailId,
FaxToMailUser user,
boolean takeEmail) |
void |
rejectEmail(String from,
String to,
String subject,
String content) |
Email |
reply(String from,
String to,
String cc,
String bcc,
String subject,
String content,
Collection<AttachmentFile> attachments,
String originalEmailId,
FaxToMailUser user)
Envoi une réponse et retourne l'email.
|
Email |
saveEmail(Email email,
Collection<Attachment> attachments,
Collection<Reply> replies,
String clientCode,
FaxToMailUser user,
String... modifiedFields) |
Email |
saveEmail(Email email,
FaxToMailUser user,
String... modifiedFields)
Save email with default email client code.
|
org.nuiton.util.pagination.PaginationResult<Email> |
search(SearchFilter emailFilter,
FaxToMailUser user,
org.nuiton.util.pagination.PaginationParameter pagination) |
void |
transmit(Collection<String> emailIds,
MailFolder newFolder,
FaxToMailUser currentUser) |
protected void |
transmitDemandToEdi(Email email)
Generate txt file to send demand to EDI system.
|
void |
transmitPendingDemandsToEdi() |
void |
unlockEmail(String emailId)
Dévérrouille une demande.
|
void |
unlockMails(List<String> mailLockIds)
Dévérrouille les mails specifiés.
|
protected void |
updateAttachments(Email email,
Collection<Attachment> attachments)
Les attachment sont copiés dans l'UI sans la valorisation des champs "originalFile" et "editedFile".
|
void |
updateRangeRowsWithEdiReturns() |
protected void |
updateReplies(Email email)
Les réponses sont modifiées par l'ui pour ne pas charger le contenu binaire, pour la sauvegarde,
il faut bien rétablir les replyContent avec ceux en base.
|
getApplicationConfig, getClientService, getConfigurationService, getDecoratorService, getEmailService, getMailFolderService, getNow, getPersistenceContext, getReferentielService, newService, setServiceContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetServiceContextprotected org.nuiton.util.beans.Binder<Attachment,Attachment> attachmentBinder
public Email getEmailById(String id)
getEmailById in interface EmailServicepublic Email getFullEmailById(String id)
getFullEmailById in interface EmailServicepublic Email getFullEmailById(String id, FaxToMailUser user)
getFullEmailById in interface EmailServiceprotected void browseFolderParent(MailFolder folder, FaxToMailUser user, MailFolderService mailFolderService)
public Email saveEmail(Email email, FaxToMailUser user, String... modifiedFields) throws InvalidClientException
saveEmail in interface EmailServiceemail - emailuser - usermodifiedFields - modified fieldsInvalidClientException - if client code is not validpublic Email saveEmail(Email email, Collection<Attachment> attachments, Collection<Reply> replies, String clientCode, FaxToMailUser user, String... modifiedFields) throws InvalidClientException
saveEmail in interface EmailServiceInvalidClientExceptionprotected void updateReplies(Email email)
email - protected void updateAttachments(Email email, Collection<Attachment> attachments)
email - attachments - protected void handleEdiTransmission(Email email, HistoryTopiaDao historyDao, Set<String> fieldSet)
public void transmitPendingDemandsToEdi()
transmitPendingDemandsToEdi in interface EmailServiceprotected void transmitDemandToEdi(Email email)
email - email to sendpublic Set<Object> getDistinctValues(MailFolder folder, String[] properties, boolean sum)
getDistinctValues in interface EmailServicepublic org.nuiton.util.pagination.PaginationResult<Email> getEmailForFolder(MailFolder folder, FaxToMailUser currentUser, EmailFilter filter, org.nuiton.util.pagination.PaginationParameter page)
getEmailForFolder in interface EmailServicefolder - folder to get demandecurrentUser - user to check rigthpage - paginationpublic List<MailFolder> getChildrenRecursively(MailFolder folder)
getChildrenRecursively in interface EmailServicepublic Map<Range,Long[]> computeQuantitiesByRange(MailFolder rootFolder)
computeQuantitiesByRange in interface EmailServicepublic Email addToHistory(String emailId, HistoryType type, FaxToMailUser user, Date date, String... fields)
addToHistory in interface EmailServicepublic Email openEmail(String emailId, FaxToMailUser user, boolean takeEmail) throws FolderNotReadableException
openEmail in interface EmailServiceFolderNotReadableExceptionpublic Email lockEmail(String emailId, FaxToMailUser currentUser) throws AlreadyLockedMailException, FolderNotReadableException
lockEmail in interface EmailServiceemailId - topiaId de la demande à vérouillercurrentUser - userAlreadyLockedMailException - if email is already locked by another userFolderNotReadableExceptionpublic void unlockEmail(String emailId)
unlockEmail in interface EmailServiceemailId - topiaId de la demande à devérouillerprotected void computeUserReadableFolder(Set<MailFolder> readMailFolders, Iterable<MailFolder> mailFolders)
readMailFolders - result mail foldersmailFolders - mail folder to allowpublic org.nuiton.util.pagination.PaginationResult<Email> search(SearchFilter emailFilter, FaxToMailUser user, org.nuiton.util.pagination.PaginationParameter pagination)
search in interface EmailServicepublic Email groupEmails(String email1Id, String email2Id, FaxToMailUser user)
groupEmails in interface EmailServicepublic Email reply(String from, String to, String cc, String bcc, String subject, String content, Collection<AttachmentFile> attachments, String originalEmailId, FaxToMailUser user) throws org.apache.commons.mail.EmailException, javax.mail.MessagingException, IOException
reply in interface EmailServicefrom - fromto - tocc - ccbcc - bccsubject - subjectcontent - contentattachments - attachementoriginalEmailId - mail topia iduser - user to add new history entry for userorg.apache.commons.mail.EmailException - if message can't be sentjavax.mail.MessagingException - if message can't be sentIOException - if message can't be sentpublic void transmit(Collection<String> emailIds, MailFolder newFolder, FaxToMailUser currentUser)
transmit in interface EmailServicepublic AttachmentFile getAttachmentFileFromStream(InputStream contentStream)
getAttachmentFileFromStream in interface EmailServicecontentStream - contentpublic AttachmentFile getAttachmentFile(String attachmentId, boolean original)
getAttachmentFile in interface EmailServicepublic ReplyContent getReplyContent(String replyId)
EmailServicegetReplyContent in interface EmailServicereplyId - reply topia idpublic List<MailLock> getAllMailLocks()
getAllMailLocks in interface EmailServicepublic void unlockMails(List<String> mailLockIds)
unlockMails in interface EmailServicemailLockIds - mail lock ids to unlockpublic void rejectEmail(String from, String to, String subject, String content) throws org.apache.commons.mail.EmailException, javax.mail.MessagingException, IOException
rejectEmail in interface EmailServiceorg.apache.commons.mail.EmailExceptionjavax.mail.MessagingExceptionIOExceptionpublic void updateRangeRowsWithEdiReturns()
updateRangeRowsWithEdiReturns in interface EmailServicepublic AttachmentFile getEmailDetailAsAttachment(Email email)
getEmailDetailAsAttachment in interface EmailServiceemail - emailprotected String getFullMailFolderPath(MailFolder folder)
folder - folder to get pathpublic void importArchive(InputStream inputStream, File attachmentBase)
EmailServiceimportArchive in interface EmailServiceinputStream - input stream of csv fileattachmentBase - base folder containing attachment listed in csv filepublic long getArchivedMailCount()
EmailServicegetArchivedMailCount in interface EmailServiceCopyright © 2014 CodeLutin. All rights reserved.