Class IMAPImportService
- java.lang.Object
-
- org.imixs.archive.importer.mail.IMAPImportService
-
public class IMAPImportService extends Object
The EmailImportAdapter scans a IMAP accountThe method creates for each email in the INBOX a workitem based on the configuration defined by the import source.
After the message was imported successfully, the message will be moved form the INBOX into an archive folder. If the archive folder does not exist, the method creates the folder. The folder name can be configured by the property 'archive.folder'. The default name is 'imixs-archive'
The email message can be converted into HTML or PDF in case the option 'detach.mode' is set to ALL. To generate the message in PDF format a gotenberg service is expected to convert HTML to PDF. The gotenberg service endpoint can be defined by the option 'gotenberg.service'
To access a mail store the IMAPImportService injects IMAPAuthenticator's. These authenticator classes can be used to authenticate against a Mail Store. The authenticator to be used can be defined in the optional property imap.authenticator. If not defined, the service defaults to the IMAPBaasicAuthenticator implementation.
- Version:
- 1.0
- Author:
- rsoika
-
-
Field Summary
Fields Modifier and Type Field Description static StringARCHIVE_DEFAULT_NAMEstatic StringDEFAULT_NO_SUBJECTstatic StringDETACH_MODE_ALLstatic StringDETACH_MODE_NONEstatic StringDETACH_MODE_PDFprotected javax.enterprise.inject.Instance<IMAPAuthenticator>imapAuthenticatorsstatic StringOPTION_ARCHIVE_FOLDERstatic StringOPTION_DEBUGstatic StringOPTION_DETACH_MODEstatic StringOPTION_GOTENBERG_SERVICEstatic StringOPTION_IMAP_AUTHENTICATORstatic StringOPTION_PRESERVE_ORIGINstatic StringOPTION_SUBJECT_REGEX
-
Constructor Summary
Constructors Constructor Description IMAPImportService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.imixs.workflow.ItemCollectioncreateWorkitem(org.imixs.workflow.ItemCollection source)Creates and processes a new workitem with a given filedatavoidonEvent(DocumentImportEvent event)This method reacts on a CDI ImportEvent and reads documents form a IMAP server.
-
-
-
Field Detail
-
OPTION_DEBUG
public static final String OPTION_DEBUG
- See Also:
- Constant Field Values
-
OPTION_ARCHIVE_FOLDER
public static final String OPTION_ARCHIVE_FOLDER
- See Also:
- Constant Field Values
-
OPTION_SUBJECT_REGEX
public static final String OPTION_SUBJECT_REGEX
- See Also:
- Constant Field Values
-
OPTION_IMAP_AUTHENTICATOR
public static final String OPTION_IMAP_AUTHENTICATOR
- See Also:
- Constant Field Values
-
OPTION_DETACH_MODE
public static final String OPTION_DETACH_MODE
- See Also:
- Constant Field Values
-
OPTION_PRESERVE_ORIGIN
public static final String OPTION_PRESERVE_ORIGIN
- See Also:
- Constant Field Values
-
OPTION_GOTENBERG_SERVICE
public static final String OPTION_GOTENBERG_SERVICE
- See Also:
- Constant Field Values
-
DETACH_MODE_PDF
public static final String DETACH_MODE_PDF
- See Also:
- Constant Field Values
-
DETACH_MODE_ALL
public static final String DETACH_MODE_ALL
- See Also:
- Constant Field Values
-
DETACH_MODE_NONE
public static final String DETACH_MODE_NONE
- See Also:
- Constant Field Values
-
ARCHIVE_DEFAULT_NAME
public static final String ARCHIVE_DEFAULT_NAME
- See Also:
- Constant Field Values
-
DEFAULT_NO_SUBJECT
public static final String DEFAULT_NO_SUBJECT
- See Also:
- Constant Field Values
-
imapAuthenticators
@Inject @Any protected javax.enterprise.inject.Instance<IMAPAuthenticator> imapAuthenticators
-
-
Method Detail
-
onEvent
public void onEvent(@Observes DocumentImportEvent event)This method reacts on a CDI ImportEvent and reads documents form a IMAP server.Depending on the DETACH_MODE the method will detach file attachments form the email.
-
createWorkitem
public org.imixs.workflow.ItemCollection createWorkitem(org.imixs.workflow.ItemCollection source) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelExceptionCreates and processes a new workitem with a given filedata- Returns:
- Throws:
org.imixs.workflow.exceptions.ModelExceptionorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.AccessDeniedException
-
-