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)
  • Field Details

  • Constructor Details

    • StyleableEmailContentServiceImpl

      public StyleableEmailContentServiceImpl()
  • Method Details

    • 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)
    • 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, org.kuali.rice.kim.api.identity.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 to
      actionItem - - the action item being added
      user - - the current user
      node - - 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(org.kuali.rice.kim.api.identity.Person user, Collection<ActionItem> actionItems, String name, String style)
    • setStandardAttributes

      protected void setStandardAttributes(Element e)
    • generateImmediateReminder

      public EmailContent generateImmediateReminder(org.kuali.rice.kim.api.identity.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 user
      actionItem - - the action item being added
      documentType - - the document type that the custom email style sheet will come from
      node - - 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

      public EmailContent generateFeedback(FeedbackForm form)