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
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)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stringprotected Stringprotected RouteHeaderServiceprotected EmailStyleHelperprotected StyleServiceFields inherited from class org.kuali.rice.kew.mail.service.impl.BaseEmailContentServiceImpl
defaultEmailFromAddress, deploymentEnvironment -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddCDataElement(Document doc, Element baseElement, String elementName, Object elementData) protected static voidaddDelegatorElement(Document doc, Element baseElement, ActionItem actionItem) protected voidaddDocumentHeaderXML(Document document, DocumentRouteHeaderValue documentHeader, Node node, String elementName) This method handles converting the DocumentRouteHeaderValue into an XML representation.protected static voidaddObjectXML(Document doc, Object o, Node node, String name) protected voidaddSummarizedActionItem(Document doc, ActionItem actionItem, org.kuali.rice.kim.api.identity.Person user, Node node, DocumentRouteHeaderValue routeHeader) This method is used to add the givenActionItemto the givenDocumentin a summarized form for use in weekly or daily type reminder e-mails.protected static voidaddTextElement(Document doc, Element baseElement, String elementName, Object elementData) protected static voidaddTimestampElement(Document doc, Element baseElement, String elementName, Date elementData) protected static voidaddWorkgroupRequestElement(Document doc, Element baseElement, ActionItem actionItem) generateDailyReminder(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems) protected EmailContentgenerateEmailContent(String styleName, Document doc) generateFeedback(FeedbackForm form) generateImmediateReminder(org.kuali.rice.kim.api.identity.Person user, ActionItem actionItem, DocumentType documentType) This method generates anEmailContentobject using the given parameters.protected EmailContentgenerateReminderForActionItems(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems, String name, String style) generateWeeklyReminder(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems) protected static DocumentBuildergetDocumentBuilder(boolean coalesce) getRouteHeader(ActionItem actionItem) protected Map<String,DocumentRouteHeaderValue> getRouteHeaders(Collection<ActionItem> actionItems) protected TemplatesThis method retrieves the style from the system using the given name.voidsetGlobalEmailStyleSheet(String globalEmailStyleSheet) protected voidvoidsetStyleService(StyleService styleService) protected static StringMethods inherited from class org.kuali.rice.kew.mail.service.impl.BaseEmailContentServiceImpl
getActionListUrl, getApplicationEmailAddress, getCustomEmailAttribute, getDeploymentEnvironment, getDocumentTypeEmailAddress, getPreferencesUrl, getRouteLogUrl, setDefaultEmailFromAddress, setDeploymentEnvironment
-
Field Details
-
DEFAULT_EMAIL_STYLESHEET_RESOURCE_LOC
- See Also:
-
styleService
-
styleHelper
-
globalEmailStyleSheet
-
routeHeaderService
-
-
Constructor Details
-
StyleableEmailContentServiceImpl
public StyleableEmailContentServiceImpl()
-
-
Method Details
-
setStyleService
-
setGlobalEmailStyleSheet
-
getDocumentBuilder
-
addObjectXML
-
addTextElement
-
addCDataElement
-
addTimestampElement
-
addDelegatorElement
-
addWorkgroupRequestElement
protected static void addWorkgroupRequestElement(Document doc, Element baseElement, ActionItem actionItem) -
addSummarizedActionItem
protected void addSummarizedActionItem(Document doc, ActionItem actionItem, org.kuali.rice.kim.api.identity.Person user, Node node, DocumentRouteHeaderValue routeHeader) throws Exception This method is used to add the givenActionItemto the givenDocumentin 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
-
getRouteHeaders
-
transform
-
getStyle
This method retrieves the style from the system using the given name. If none is found the default style xsl file defined byDEFAULT_EMAIL_STYLESHEET_RESOURCE_LOCis used.- Parameters:
styleName-- Returns:
- a valid
Templatesusing either the given styleName or the default xsl style file
-
generateEmailContent
-
generateReminderForActionItems
protected EmailContent generateReminderForActionItems(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems, String name, String style) -
setStandardAttributes
-
generateImmediateReminder
public EmailContent generateImmediateReminder(org.kuali.rice.kim.api.identity.Person user, ActionItem actionItem, DocumentType documentType) This method generates anEmailContentobject using the given parameters. Part of this operation includes serializing the givenActionItemto XML. The following objects and methods are included in the serialization:PersonPerson.getPrincipalName()DocumentRouteHeaderValueDocumentRouteHeaderValue#getInitiatorUser()DocumentRouteHeaderValue.getDocumentType()Person
- 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(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems) -
generateDailyReminder
public EmailContent generateDailyReminder(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems) -
generateFeedback
-