Class DigestLabelResolver

java.lang.Object
io.meeds.commons.digest.service.DigestLabelResolver

@Component public class DigestLabelResolver extends Object
Finds the wording of a digest label in the language of the recipient. The category labels and the line wordings belong to the addons, so they are looked up in the notification bundle the addon declared for its plugin; the words of the email itself live in the commons bundle.
  • Field Details

  • Constructor Details

    • DigestLabelResolver

      public DigestLabelResolver(org.exoplatform.commons.api.notification.service.setting.PluginSettingService pluginSettingService, org.exoplatform.services.resources.ResourceBundleService resourceBundleService)
  • Method Details

    • resolve

      public String resolve(String labelKey, String pluginId, Locale locale)
      Parameters:
      labelKey - the key of the wording
      pluginId - the notification type whose bundle holds it
      locale - the recipient language
      Returns:
      the wording, the commons one when the addon bundle doesn't have it, the key itself when nobody has it
    • commons

      public String commons(String key, Locale locale)
      Parameters:
      key - a key of the commons notification bundle
      locale - the recipient language
      Returns:
      the wording, the key itself when missing
    • categoryLabel

      public String categoryLabel(io.meeds.commons.digest.plugin.DigestCategoryProvider category, Locale locale)