Class DigestCategoryPlugin

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
io.meeds.commons.digest.plugin.DigestCategoryPlugin
All Implemented Interfaces:
DigestCategoryProvider, org.exoplatform.container.component.ComponentPlugin

public class DigestCategoryPlugin extends org.exoplatform.container.component.BaseComponentPlugin implements DigestCategoryProvider
The way an addon declares the digest category it owns, in its own kernel configuration and without a single line of Java:
<external-component-plugins>
  <target-component>io.meeds.commons.digest.DigestCategoryRegistry</target-component>
  <component-plugin>
    <name>news</name>
    <set-method>addCategoryProvider</set-method>
    <type>io.meeds.commons.digest.plugin.DigestCategoryPlugin</type>
    <init-params>
      <value-param><name>id</name><value>news</value></value-param>
      <value-param><name>labelKey</name><value>digest.category.news</value></value-param>
      <value-param><name>order</name><value>30</value></value-param>
      <values-param>
        <name>pluginIds</name>
        <value>PostNewsNotificationPlugin</value>
      </values-param>
    </init-params>
  </component-plugin>
</external-component-plugins>
The kernel container is shared by every webapp, so a category declared this way reaches the digest wherever the addon lives, and whether or not that addon uses Spring at all.
  • Constructor Details

    • DigestCategoryPlugin

      public DigestCategoryPlugin(org.exoplatform.container.xml.InitParams params)
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface DigestCategoryProvider
      Returns:
      the category identifier, stored in the user settings and in the waiting digest items, for example "spaces"
    • getLabelKey

      public String getLabelKey()
      Specified by:
      getLabelKey in interface DigestCategoryProvider
      Returns:
      the resource bundle key of the category label, displayed to the user
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface DigestCategoryProvider
      Returns:
      the display order of the category, in the settings panel and in the digest email
    • getPluginIds

      public List<String> getPluginIds()
      Specified by:
      getPluginIds in interface DigestCategoryProvider
      Returns:
      the identifiers of the notification plugins this category covers, for example SpaceInvitationPlugin