org.kuali.rice.kew.mail.service.impl
Class StyleableEmailContentServiceImpl
java.lang.Object
org.kuali.rice.kew.mail.service.impl.BaseEmailContentServiceImpl
org.kuali.rice.kew.mail.service.impl.StyleableEmailContentServiceImpl
- All Implemented Interfaces:
- EmailContentService
public class StyleableEmailContentServiceImpl
- extends BaseEmailContentServiceImpl
EmailContentService that serves EmailContent customizable via XSLT style sheets
The global email style name is: kew.email.style
If this style is not found, the resource 'defaultEmailStyle.xsl' will be retrieved
relative to this class.
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
Method Summary |
protected static void |
addCDataElement(Document doc,
Element baseElement,
String elementName,
Object elementData)
|
protected static void |
addDelegatorElement(Document doc,
Element baseElement,
ActionItem actionItem)
|
protected void |
addDocumentHeaderXML(Document document,
DocumentRouteHeaderValue documentHeader,
Node node,
String elementName)
This method handles converting the DocumentRouteHeaderValue into an XML representation. |
protected static void |
addObjectXML(Document doc,
Object o,
Node node,
String name)
|
protected void |
addSummarizedActionItem(Document doc,
ActionItem actionItem,
Person user,
Node node,
DocumentRouteHeaderValue routeHeader)
This method is used to add the given ActionItem to the given Document in a summarized
form for use in weekly or daily type reminder e-mails. |
protected static void |
addTextElement(Document doc,
Element baseElement,
String elementName,
Object elementData)
|
protected static void |
addTimestampElement(Document doc,
Element baseElement,
String elementName,
Date elementData)
|
protected static void |
addWorkgroupRequestElement(Document doc,
Element baseElement,
ActionItem actionItem)
|
EmailContent |
generateDailyReminder(Person user,
Collection<ActionItem> actionItems)
|
protected EmailContent |
generateEmailContent(String styleName,
Document doc)
|
EmailContent |
generateFeedback(FeedbackForm form)
|
EmailContent |
generateImmediateReminder(Person user,
ActionItem actionItem,
DocumentType documentType)
This method generates an EmailContent object using the given parameters. |
protected EmailContent |
generateReminderForActionItems(Person user,
Collection<ActionItem> actionItems,
String name,
String style)
|
EmailContent |
generateWeeklyReminder(Person user,
Collection<ActionItem> actionItems)
|
protected static DocumentBuilder |
getDocumentBuilder(boolean coalesce)
|
DocumentRouteHeaderValue |
getRouteHeader(ActionItem actionItem)
|
protected Map<String,DocumentRouteHeaderValue> |
getRouteHeaders(Collection<ActionItem> actionItems)
|
protected Templates |
getStyle(String styleName)
This method retrieves the style from the system using the given name. |
void |
setGlobalEmailStyleSheet(String globalEmailStyleSheet)
|
protected void |
setStandardAttributes(Element e)
|
void |
setStyleService(StyleService styleService)
|
protected static String |
transform(Templates style,
Document doc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_EMAIL_STYLESHEET_RESOURCE_LOC
protected final String DEFAULT_EMAIL_STYLESHEET_RESOURCE_LOC
- See Also:
- Constant Field Values
styleService
protected StyleService styleService
styleHelper
protected EmailStyleHelper styleHelper
globalEmailStyleSheet
protected String globalEmailStyleSheet
routeHeaderService
protected RouteHeaderService routeHeaderService
StyleableEmailContentServiceImpl
public StyleableEmailContentServiceImpl()
setStyleService
public void setStyleService(StyleService styleService)
setGlobalEmailStyleSheet
public void setGlobalEmailStyleSheet(String globalEmailStyleSheet)
getDocumentBuilder
protected static DocumentBuilder getDocumentBuilder(boolean coalesce)
addObjectXML
protected static void addObjectXML(Document doc,
Object o,
Node node,
String name)
throws Exception
- Throws:
Exception
addTextElement
protected static void addTextElement(Document doc,
Element baseElement,
String elementName,
Object elementData)
addCDataElement
protected static void addCDataElement(Document doc,
Element baseElement,
String elementName,
Object elementData)
addTimestampElement
protected static void addTimestampElement(Document doc,
Element baseElement,
String elementName,
Date elementData)
addDelegatorElement
protected static void addDelegatorElement(Document doc,
Element baseElement,
ActionItem actionItem)
addWorkgroupRequestElement
protected static void addWorkgroupRequestElement(Document doc,
Element baseElement,
ActionItem actionItem)
addSummarizedActionItem
protected void addSummarizedActionItem(Document doc,
ActionItem actionItem,
Person user,
Node node,
DocumentRouteHeaderValue routeHeader)
throws Exception
- This method is used to add the given
ActionItem
to the given Document
in a summarized
form for use in weekly or daily type reminder e-mails.
- Parameters:
doc
- - Document to have the ActionItem added toactionItem
- - the action item being addeduser
- - the current usernode
- - the node object to add the actionItem XML to (defaults to the doc variable if null is passed in)
- Throws:
Exception
getRouteHeader
public DocumentRouteHeaderValue getRouteHeader(ActionItem actionItem)
getRouteHeaders
protected Map<String,DocumentRouteHeaderValue> getRouteHeaders(Collection<ActionItem> actionItems)
transform
protected static String transform(Templates style,
Document doc)
getStyle
protected Templates getStyle(String styleName)
- This method retrieves the style from the system using the given name. If none is found the default style xsl file
defined by
DEFAULT_EMAIL_STYLESHEET_RESOURCE_LOC
is used.
- Parameters:
styleName
-
- Returns:
- a valid
Templates
using either the given styleName or the default xsl style file
generateEmailContent
protected EmailContent generateEmailContent(String styleName,
Document doc)
generateReminderForActionItems
protected EmailContent generateReminderForActionItems(Person user,
Collection<ActionItem> actionItems,
String name,
String style)
setStandardAttributes
protected void setStandardAttributes(Element e)
generateImmediateReminder
public EmailContent generateImmediateReminder(Person user,
ActionItem actionItem,
DocumentType documentType)
- This method generates an
EmailContent
object using the given parameters. Part of this operation includes
serializing the given ActionItem
to XML. The following objects and methods are included in the serialization:
- Parameters:
user
- - the current useractionItem
- - the action item being addeddocumentType
- - the document type that the custom email style sheet will come fromnode
- - the node object to add the actionItem XML to (defaults to the doc variable if null is passed in)
- Throws:
Exception
addDocumentHeaderXML
protected void addDocumentHeaderXML(Document document,
DocumentRouteHeaderValue documentHeader,
Node node,
String elementName)
throws Exception
- This method handles converting the DocumentRouteHeaderValue into an XML representation. The reason we can't just use
propertiesToXml like we have elsewhere is because the doc header has a String attached to it that has the XML document
content in it. The default serialization of this will serialize this as a String so we will end up with escaped XML
in our output which we won't be able to process with the email stylesheet. So we need to read the xml content from
the document and parse it into a DOM object so it can be appended to our output.
- Throws:
Exception
generateWeeklyReminder
public EmailContent generateWeeklyReminder(Person user,
Collection<ActionItem> actionItems)
generateDailyReminder
public EmailContent generateDailyReminder(Person user,
Collection<ActionItem> actionItems)
generateFeedback
public EmailContent generateFeedback(FeedbackForm form)
Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.