Class EmailTemplateLoadServiceImpl

java.lang.Object
ch.tocco.nice2.userbase.impl.EmailTemplateLoadServiceImpl
All Implemented Interfaces:
EmailTemplateLoadService

@Component public class EmailTemplateLoadServiceImpl extends Object implements EmailTemplateLoadService
  • Constructor Details

  • Method Details

    • load

      @Deprecated public EmailTemplate load(String uniqueId, String businessUnitUniqueId)
      Deprecated.
      Description copied from interface: EmailTemplateLoadService
      Loads a email template for the specified business unit. Note: you probably need to load it in privileged mode to have read permission in another business unit.
      Specified by:
      load in interface EmailTemplateLoadService
      Parameters:
      uniqueId - unique id of template
      businessUnitUniqueId - unique id of business unit
      Returns:
      the email template
    • load

      @Deprecated public EmailTemplate load(String uniqueId, Entity businessUnitEntity)
      Deprecated.
      Specified by:
      load in interface EmailTemplateLoadService
      Parameters:
      uniqueId - unique id of template
      businessUnitEntity - business unit entity
      Returns:
      the email template
      See Also:
    • load

      public EmailTemplate load(Entity emailTemplateEntity)
      Description copied from interface: EmailTemplateLoadService
      Loads a email template.
      Specified by:
      load in interface EmailTemplateLoadService
      Parameters:
      emailTemplateEntity - template entity
      Returns:
      the email template
    • getTemplate

      public Optional<EmailTemplate> getTemplate(String uniqueId)
      Description copied from interface: EmailTemplateLoadService
      Load email template with given uniqueId from the user's current BusinessUnit. ==== In case the current **user is in a business unit**, the template returned is selected as follows: 1. If in the current BusinessUnit a template with the correct uniqueId exists, it is returned. 2. Otherwise, If a template with the uniqueId and no BusinessUnit association exists, it is returned. 3. Otherwise, Optional.empty() is returned. In case the **user is not in a business unit** (e.g. he is in the {BusinessUnit.NULL_BUSINESS_UNIT}): 1. If a template with the uniqueId and no BusinessUnit exists, it is returned. 2. Otherwise, Optional.empty() is returned. Use #load if you prefer an exception is thrown if the email template is missing.
      Specified by:
      getTemplate in interface EmailTemplateLoadService
      Parameters:
      uniqueId - Unique id of the template
      Returns:
      The EmailTemplate
    • load

      public EmailTemplate load(String uniqueId)
      Description copied from interface: EmailTemplateLoadService
      Load email template with given uniqueId from the user's current BusinessUnit. ==== In case the current **user is in a business unit**, the template returned is selected as follows: 1. If in the current BusinessUnit a template with the correct uniqueId exists, it is returned. 2. Otherwise, If a template with the uniqueId and no BusinessUnit association exists, it is returned. 3. Otherwise, a RuntimeException is is thrown. In case the **user is not in a business unit** (e.g. he is in the {BusinessUnit.NULL_BUSINESS_UNIT}): 1. If a template with the uniqueId and no BusinessUnit exists, it is returned. 2. Otherwise, a RuntimeException is is thrown. Use #load if you prefer Optional.empty() is returned if the email template is missing.
      Specified by:
      load in interface EmailTemplateLoadService
      Parameters:
      uniqueId - Unique id of the template
      Returns:
      The EmailTemplate