Package com.levigo.jadice.server.mail
Class MailBodyCreatorNode
- java.lang.Object
-
- com.levigo.jadice.server.internal.NodeInternal
-
- com.levigo.jadice.server.Node
-
- com.levigo.jadice.server.mail.MailBodyCreatorNode
-
public class MailBodyCreatorNode extends Node
ThisNode
tries to create the title page for an email that contains the most important information of the mail header (To, From, CC, subject, ...) and a list of all attachments of this mail (seeAttachmentDirectory
).If possible (i.e. the given stream is plain text oder HTML) the mail body part is merged together with the title page. Else, they occur in different pages.
Even though this
Node
is located on client side, it is not recommended to use it directly but via the scriptEmailConversion.groovy
Its worker respects
PageCountLimit
s.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MailBodyCreatorNode.HtmlProcessingMode
The possible options to handle images in the html body when performing email conversions.-
Nested classes/interfaces inherited from class com.levigo.jadice.server.Node
Node.Cardinality
-
-
Field Summary
Fields Modifier and Type Field Description static String
BINARY_BODY_PLACEHOLDER_MIMETYPE
MIME type to signalize that the converted mail has a binary body that cannot be treated by this node.static URI
DEFAULT_STYLE_SHEET
-
Constructor Summary
Constructors Constructor Description MailBodyCreatorNode()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttachmentDirectory
getAttachmentDirectory()
StreamDescriptor
getHeaderInformation()
MailBodyCreatorNode.HtmlProcessingMode
getHtmlProcessingMode()
URI
getStyleSheet()
String
getWorkerClassName()
Return the node's associatedcom.levigo.jadice.server.core.NodeWorker
full qualified class's name.boolean
isAllowExternalHTTPResolution()
Get whether to allow the resolution (loading) of external HTTP resources.boolean
isGenerateHyperlinks()
void
setAllowExternalHTTPResolution(boolean allowExternalURLResolution)
Set whether to allow the resolution (loading) of external HTTP resources.void
setAttachmentDirectory(AttachmentDirectory attachmentDirectory)
void
setGenerateHyperlinks(boolean generate)
Determine if the resulting PDF document shall have hyperlinks to external locations (default:true
.void
setHeaderInformation(StreamDescriptor headerInformation)
Set a specialStreamDescriptor
if this one contains the header information that shall be rendered within the mail.void
setHtmlProcessingMode(MailBodyCreatorNode.HtmlProcessingMode htmlProcessingMode)
Determine if the handling of images in the html body of emails should be handled differently.void
setStyleSheet(URI styleSheet)
protected void
validateConfiguration()
-
Methods inherited from class com.levigo.jadice.server.Node
addTransportReceiver, appendSuccessor, apply, equals, getInputCardinality, getJob, getOutputCardinality, getPredecessors, getSubsidiaryNodes, getSuccessors, getTransportSender, getUUID, hashCode, initialize, prependPredecessor, remove
-
-
-
-
Field Detail
-
DEFAULT_STYLE_SHEET
public static final URI DEFAULT_STYLE_SHEET
-
BINARY_BODY_PLACEHOLDER_MIMETYPE
public static final String BINARY_BODY_PLACEHOLDER_MIMETYPE
MIME type to signalize that the converted mail has a binary body that cannot be treated by this node.See usage in e.g.
EmailConversion.groovy
- See Also:
- Constant Field Values
-
-
Method Detail
-
getWorkerClassName
public String getWorkerClassName()
Description copied from class:Node
Return the node's associatedcom.levigo.jadice.server.core.NodeWorker
full qualified class's name. By default, the worker class name is- The same as the node name with the trailing "Node" replaced by "Worker" if the node name ends in "Node"
- The node class name with an appended "Worker" otherwise.
This behavior can be overridden in concrete subclasses.
- Overrides:
getWorkerClassName
in classNode
- Returns:
- the full qualified class name of the worker of this node.
-
getStyleSheet
public URI getStyleSheet()
- Returns:
- The URI of the style sheet that is used for rendering.
-
setStyleSheet
public void setStyleSheet(URI styleSheet)
-
getAttachmentDirectory
public AttachmentDirectory getAttachmentDirectory()
- Returns:
- An
AttachmentDirectory
that lists all attachment of the email to render
-
setAttachmentDirectory
public void setAttachmentDirectory(AttachmentDirectory attachmentDirectory)
-
getHeaderInformation
public StreamDescriptor getHeaderInformation()
- Returns:
- A special
StreamDescriptor
descriptor hat contains the header information, if this property was set. Else null.
-
setHeaderInformation
public void setHeaderInformation(StreamDescriptor headerInformation)
Set a specialStreamDescriptor
if this one contains the header information that shall be rendered within the mail. If not set the information is taken from theStreamBundle
sStreamDescriptor
s.- Parameters:
headerInformation
- contains the information of the mail header
-
isAllowExternalHTTPResolution
public boolean isAllowExternalHTTPResolution()
Get whether to allow the resolution (loading) of external HTTP resources.- Returns:
true
iff resolution of external HTTP resources is allowed.
-
setAllowExternalHTTPResolution
public void setAllowExternalHTTPResolution(boolean allowExternalURLResolution)
Set whether to allow the resolution (loading) of external HTTP resources.- Parameters:
allowExternalURLResolution
-true
if resolving resources from external URLs shall be allowed.false
otherwise
-
validateConfiguration
protected void validateConfiguration() throws ConfigurationException
- Overrides:
validateConfiguration
in classNode
- Throws:
ConfigurationException
-
isGenerateHyperlinks
public boolean isGenerateHyperlinks()
-
setGenerateHyperlinks
public void setGenerateHyperlinks(boolean generate)
Determine if the resulting PDF document shall have hyperlinks to external locations (default:true
. This setting is only evaluated for e-mails with HTML body.- Parameters:
generate
- iftrue
hyperlinks will be embedded in the resulting PDF document- Since:
- jadice server 5.2.3.0
-
getHtmlProcessingMode
public MailBodyCreatorNode.HtmlProcessingMode getHtmlProcessingMode()
-
setHtmlProcessingMode
public void setHtmlProcessingMode(MailBodyCreatorNode.HtmlProcessingMode htmlProcessingMode)
Determine if the handling of images in the html body of emails should be handled differently. Options can be found in the documentation ofMailBodyCreatorNode.HtmlProcessingMode
.- Parameters:
htmlProcessingMode
- the chosen option of how to handle images in the html body when performing email conversions.- Since:
- jadice server 5.7.0.0
-
-