|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.mail.template.PreRenderedMailNotificationQueueItem.Builder
public static class PreRenderedMailNotificationQueueItem.Builder
A builder for PreRenderedMailNotificationQueueItems
.
This builder unifies the different factory methods provided on the item's class.
PreRenderedMailNotificationQueueItem.with(User, String, String)
Method Summary | |
---|---|
PreRenderedMailNotificationQueueItem.Builder |
andContext(java.util.Map<java.lang.String,java.lang.Object> context)
|
PreRenderedMailNotificationQueueItem.Builder |
andContextEntry(java.lang.String key,
java.lang.Object value)
Add an entry to the context used for rendering the body. |
PreRenderedMailNotificationQueueItem.Builder |
andRelatedBodyPart(javax.activation.DataSource relatedBodyPart)
|
PreRenderedMailNotificationQueueItem.Builder |
andRelatedBodyParts(java.lang.Iterable<javax.activation.DataSource> relatedBodyParts)
|
PreRenderedMailNotificationQueueItem.Builder |
andReplyTo(java.lang.String replyToEmail)
|
PreRenderedMailNotificationQueueItem.Builder |
andSender(com.atlassian.user.User sender)
|
PreRenderedMailNotificationQueueItem.Builder |
andTemplateLocation(java.lang.String templateLocation)
Set the location of the template specified as templateFileName in the constructor. |
PreRenderedMailNotificationQueueItem |
build()
Constructs an instance of PreRenderedMailNotificationQueueItem . |
PreRenderedMailNotificationQueueItem |
render()
Constructs an instance of PreRenderedMailNotificationQueueItem and renders the body. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public PreRenderedMailNotificationQueueItem.Builder andTemplateLocation(java.lang.String templateLocation)
templateFileName
in the constructor.
For Velocity templates, e.g. any templateFileName
ending with .vm, this has to be path relative
to the webapp starting and ending with '/'. The templateLocation
is concatenated with the
templateFileName
and then fed into VelocityUtils.getRenderedContent(String, Map)
.
For any other template, e.g. any templateFileName
ending with .soy indicating that this is a Google Closure Template, the
location has to be a complete key pointing to a web-resource declaring the template.
The plugin system defines a complete key as a unique identifier for a plugin module. It is composed of a
plugin key and a module key separated by a colon.
E.g.
<atlassian-plugin key="myPluginKey" plugins-version="2">
<web-resource key="templates">
<resource type="soy" name="content" location="templates/myTemplate.soy"/>
</web-resource>
</atlassian-plugin>
would mean that the complete key and thus the templateLocation
for this file is
myPluginKey:templates
.
The builder will default to
MailNotificationQueueItem.getDefaultTemplateLocation(User, String)
.
public PreRenderedMailNotificationQueueItem.Builder andSender(com.atlassian.user.User sender)
sender
- the sender of this emailpublic PreRenderedMailNotificationQueueItem.Builder andReplyTo(java.lang.String replyToEmail)
replyToEmail
- the email address that will be used for replying topublic PreRenderedMailNotificationQueueItem.Builder andRelatedBodyPart(javax.activation.DataSource relatedBodyPart)
relatedBodyPart
- encapsulates a binary, e.g. an image, to be added to the email's related
Multipart
MultipartBuilder.makeMultipart(Collection)
public PreRenderedMailNotificationQueueItem.Builder andRelatedBodyParts(java.lang.Iterable<javax.activation.DataSource> relatedBodyParts)
andRelatedBodyPart(DataSource)
public PreRenderedMailNotificationQueueItem.Builder andContextEntry(java.lang.String key, java.lang.Object value)
public PreRenderedMailNotificationQueueItem.Builder andContext(java.util.Map<java.lang.String,java.lang.Object> context)
andContextEntry(String, Object)
public PreRenderedMailNotificationQueueItem build()
PreRenderedMailNotificationQueueItem
.
The context added to the builder will be attached to the item. You will need to call
PreRenderedMailNotificationQueueItem.render()
before attaching the task to a TaskManager
.
render()
public PreRenderedMailNotificationQueueItem render()
PreRenderedMailNotificationQueueItem
and renders the body.
The context added to the builder will not be attached to the item. This means calling
PreRenderedMailNotificationQueueItem.render()
is not necessary and in fact erroneous.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |