<?xml version="1.0" encoding="UTF-8"?>
<!--
  This file is part of the Meeds project (https://meeds.io/).
  Copyright (C) 2022 Meeds Association
  contact@meeds.io
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 3 of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
  You should have received a copy of the GNU Lesser General Public License
  along with this program; if not, write to the Free Software Foundation,
  Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
  xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">
  
  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginSettingService</target-component>
    <component-plugin>
      <name>notification.groups</name>
      <set-method>registerGroupConfig</set-method>
      <type>org.exoplatform.commons.api.notification.plugin.GroupProviderPlugin</type>
      <description>Initial the default groups.</description>
      <init-params>
        <object-param>
          <name>group.task</name>
          <description>The information of group task</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.GroupConfig">
            <field name="id">
              <string>task</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.group.Task</string>
            </field>
            <field name="order">
              <string>100</string>
            </field>
          </object>
        </object-param>       
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskAssignPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskAssignPlugin</name>
          <description>The template of TaskAssignPlugin</description>
          <object
            type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskAssignPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskAssignPlugin</string>
            </field>
            <field name="order">
              <string>1</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>daily</string>
                </value>
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
            <field name="mutable">
              <boolean>false</boolean>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  
  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskCoworkerPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskCoworkerPlugin</name>
          <description>The template of TaskCoworkerPlugin</description>
          <object
            type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskCoworkerPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskCoworkerPlugin</string>
            </field>
            <field name="order">
              <string>2</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>daily</string>
                </value>
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
            <field name="mutable">
              <boolean>false</boolean>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  
  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskDueDatePlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskDueDatePlugin</name>
          <description>The template of TaskDueDatePlugin</description>
          <object
            type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskDueDatePlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskDueDatePlugin</string>
            </field>
            <field name="order">
              <string>3</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  
  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskCompletedPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskCompletedPlugin</name>
          <description>The template of TaskCompletedPlugin</description>
          <object
            type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskCompletedPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskCompletedPlugin</string>
            </field>
            <field name="order">
              <string>4</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>weekly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskCommentPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskCommentPlugin</name>
          <description>The template of TaskCommentPlugin</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskCommentedPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskCommentedPlugin</string>
            </field>
            <field name="order">
              <string>5</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>daily</string>
                </value>
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskMentionPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskMentionPlugin</name>
          <description>The template of TaskMentionPlugin</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskMentionedPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskMentionedPlugin</string>
            </field>
            <field name="order">
              <string>6</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>daily</string>
                </value>
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
            <field name="mutable">
              <boolean>false</boolean>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.service.setting.PluginContainer</target-component>
    <component-plugin>
      <name>notification.plugins</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.task.integration.notification.TaskEditionPlugin</type>
      <description>Initial information for plugin.</description>
      <init-params>
        <object-param>
          <name>template.TaskEditionPlugin</name>
          <description>The template of TaskEditionPlugin</description>
          <object
                  type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>TaskEditionPlugin</string>
            </field>
            <field name="resourceBundleKey">
              <string>UINotification.label.TaskEditionPlugin</string>
            </field>
            <field name="order">
              <string>7</string>
            </field>
            <field name="defaultConfig">
              <collection type="java.util.ArrayList">
                <value>
                  <string>daily</string>
                </value>
                <value>
                  <string>Instantly</string>
                </value>
              </collection>
            </field>
            <field name="groupId">
              <string>task</string>
            </field>
            <field name="bundlePath">
              <string>locale.notification.TaskNotification</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  <!-- template channel register -->
  <external-component-plugins>
    <target-component>org.exoplatform.commons.api.notification.channel.ChannelManager</target-component>
    <component-plugin>
      <name>mail.channel.task.template</name>
      <set-method>registerTemplateProvider</set-method>
      <type>org.exoplatform.task.integration.notification.MailTemplateProvider</type>
      <init-params>
        <value-param>
          <name>channel-id</name>
          <value>MAIL_CHANNEL</value>
        </value-param>
      </init-params>
    </component-plugin>
    <component-plugin profiles="push-notifications">
      <name>web.channel.task.template</name>
      <set-method>registerTemplateProvider</set-method>
      <type>org.exoplatform.task.integration.notification.PushTemplateProvider</type>
      <init-params>
        <value-param>
          <name>channel-id</name>
          <value>PUSH_CHANNEL</value>
        </value-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
</configuration>