Class DefaultTemplateManager

java.lang.Object
com.atlassian.jira.template.DefaultTemplateManager
All Implemented Interfaces:
TemplateManager

public class DefaultTemplateManager extends Object implements TemplateManager
A manager for the email velocity templates within the system. Currently, the system initialises the template table by reading from the email-template-id-mappings.xml file. Custom templates can be added to this file - ensuring that an appropriate ID is given to the new template (e.g. >= 10000).
  • Field Details

  • Constructor Details

  • Method Details

    • getTemplate

      public Template getTemplate(Long templateId)
      Specified by:
      getTemplate in interface TemplateManager
    • getTemplate

      public Template getTemplate(SchemeEntity notificationSchemeEntity)
      Retrieve the template from the notification scheme entity.

      If the scheme entity is not related to a template id - return the default template for the event type. The eventTypeId corresponds to the default template id if there is no specific template association.

      Specified by:
      getTemplate in interface TemplateManager
      Parameters:
      notificationSchemeEntity - a notification scheme entity object
    • getDefaultTemplate

      public Template getDefaultTemplate(EventType eventType)
      Retrieve the default template for specified event type.
      Parameters:
      eventType - event type to retrieve the default template for
      Returns:
      template default template for specified event type
    • getTemplatesMap

      public Map<Long,Template> getTemplatesMap(String type)
      Retrieve a map of templates of the specified type.
      Specified by:
      getTemplatesMap in interface TemplateManager
      Parameters:
      type - String specifiying the type of template to retrieve
      Returns:
      map of template IDs to template objects
    • getTemplateContent

      public String getTemplateContent(Long templateId, String format)
      Specified by:
      getTemplateContent in interface TemplateManager
    • getTemplatePath

      protected String getTemplatePath(Long templateId, String format)
    • onCacheClear

      @EventListener public void onCacheClear(ClearCacheEvent event)