public abstract class AbstractEmailMessageHandler extends Object implements EmailMessageHandler
Constructor and Description |
---|
AbstractEmailMessageHandler() |
Modifier and Type | Method and Description |
---|---|
protected org.alfresco.service.cmr.repository.NodeRef |
addAttachment(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef folder,
org.alfresco.service.cmr.repository.NodeRef mainContentNode,
String fileName)
Adds new node into Alfresco repository and mark its as an attachment.
|
protected void |
addAttachments(org.alfresco.service.cmr.repository.NodeRef spaceNodeRef,
org.alfresco.service.cmr.repository.NodeRef nodeRef,
EmailMessage message)
Extracts the attachments from the given message and adds them to the space.
|
protected org.alfresco.service.cmr.repository.NodeRef |
addContentNode(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef parent,
String name,
boolean overwrite)
Add new node into Alfresco repository with specified parameters.
|
protected org.alfresco.service.cmr.repository.NodeRef |
addContentNode(org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef parent,
String name,
org.alfresco.service.namespace.QName assocType,
boolean overwrite)
Add new node into Alfresco repository with specified parameters.
|
protected void |
addEmailedAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef,
EmailMessage message)
Add emailed aspect to the specified node.
|
static String |
encodeSubject(String subject)
Subject field is used as name of the content, so we need to replace characters that are forbidden in file names.
|
protected ContentService |
getContentService() |
protected org.alfresco.service.cmr.dictionary.DictionaryService |
getDictionaryService() |
protected org.alfresco.service.cmr.repository.MimetypeService |
getMimetypeService() |
protected org.alfresco.service.cmr.repository.NodeService |
getNodeService() |
void |
setContentService(ContentService contentService) |
void |
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService) |
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
protected void |
writeContent(org.alfresco.service.cmr.repository.NodeRef nodeRef,
InputStream content,
String mimetype,
String encoding)
Write content to the node from InputStream.
|
protected void |
writeContent(org.alfresco.service.cmr.repository.NodeRef nodeRef,
String content,
String mimetype)
Write the string as content to the node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processMessage
protected ContentService getContentService()
public void setContentService(ContentService contentService)
contentService
- Alfresco Content Service.protected org.alfresco.service.cmr.dictionary.DictionaryService getDictionaryService()
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
dictionaryService
- Alfresco dictionary serviceprotected org.alfresco.service.cmr.repository.NodeService getNodeService()
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- Alfresco Node Service.protected org.alfresco.service.cmr.repository.MimetypeService getMimetypeService()
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService
- the the service to determine mimetype and encodingprotected void writeContent(org.alfresco.service.cmr.repository.NodeRef nodeRef, String content, String mimetype)
nodeRef
- Target node.content
- Text for writting.mimetype
- MIME content type. For exaple you can set this parameter to "text/html" or "text/xml", etc.protected void writeContent(org.alfresco.service.cmr.repository.NodeRef nodeRef, InputStream content, String mimetype, String encoding)
nodeRef
- Target node.content
- Content stream.mimetype
- MIME content type.encoding
- Encoding. Can be null for text based content, n which case the best guess.protected void addEmailedAspect(org.alfresco.service.cmr.repository.NodeRef nodeRef, EmailMessage message)
nodeRef
- Target node.message
- Mail message that will be used for extracting necessary informationprotected org.alfresco.service.cmr.repository.NodeRef addContentNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef parent, String name, org.alfresco.service.namespace.QName assocType, boolean overwrite)
nodeService
- Alfresco Node Serviceparent
- Parent nodename
- Name of the new nodeoverwrite
- if true then overwrite an existing node with the same name. if false the name is changed to make it unique.assocType
- Association type that should be set between parent node and the new one.protected org.alfresco.service.cmr.repository.NodeRef addContentNode(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef parent, String name, boolean overwrite)
nodeService
- Alfresco Node Serviceparent
- Parent nodename
- Name of the new nodeoverwrite
- whether a new node should overwrite an existing node with the same name or have its name
mangled to be alongside the existing node.protected org.alfresco.service.cmr.repository.NodeRef addAttachment(org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef folder, org.alfresco.service.cmr.repository.NodeRef mainContentNode, String fileName)
nodeService
- Alfresco Node Service.folder
- Space/Folder to add.mainContentNode
- Main content node. Any mail is added into Alfresco as one main content node and several its attachments. Each attachment related with its main node.fileName
- File name for the attachment.protected void addAttachments(org.alfresco.service.cmr.repository.NodeRef spaceNodeRef, org.alfresco.service.cmr.repository.NodeRef nodeRef, EmailMessage message)
spaceNodeRef
- the space to add the documents intonodeRef
- the node to which the documents will be attachedmessage
- the email messagepublic static String encodeSubject(String subject)
subject
- the string of the email subjectCopyright © 2005–2017 Alfresco Software. All rights reserved.