<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2020 eXo Platform SAS.
    
    This 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 2.1 of
    the License, or (at your option) any later version.
    
    This software 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 software; if not, write to the Free
    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA, or see the FSF site: http://www.fsf.org.

-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd http://www.exoplatform.org/xml/ns/kernel_1_3.xsd" xmlns="http://www.exoplatform.org/xml/ns/kernel_1_3.xsd">

  <external-component-plugins>
    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
    <component-plugin>
      <name>DailyReminderComputingJob</name>
      <set-method>addPeriodJob</set-method>
      <type>org.exoplatform.services.scheduler.PeriodJob</type>
      <description>A cron job to daily store exact reminder date of upcoming events of next two days</description>
      <init-params>
        <properties-param>
          <name>job.info</name>
          <description>Queue Task Job</description>
          <property name="jobName" value="DailyReminderComputingJob" />
          <property name="groupName" value="Agenda" />
          <property name="job" value="org.exoplatform.agenda.job.DailyReminderComputingJob" />
          <!-- REPEAT_INDEFINITELY -->
          <property name="repeatCount" value="0" />
          <!--
            Period: each day (24 hours).
            This shouldn't be modified to ensure that reminders are computed
            each day for the next two days.
            Else, we will execute it more than needed (if the frequency is increased)
          -->
          <property name="period" value="86400000" />
          <!-- Start exceution: a minute after server startup -->
          <property name="startTime" value="+60000" />
          <!-- REPEAT_INDEFINITELY -->
          <property name="endTime" value="" />
        </properties-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>ReminderSendingJob</name>
      <set-method>addCronJob</set-method>
      <type>org.exoplatform.services.scheduler.CronJob</type>
      <description>A cron job to send reminders of next minute</description>
      <init-params>
        <properties-param>
          <name>cronjob.info</name>
          <property name="jobName" value="ReminderSendingJob" />
          <property name="groupName" value="Agenda" />
          <property name="job" value="org.exoplatform.agenda.job.AgendaEventReminderJob" />
          <!-- Period: each minute scan for reminders to send. This shouldn't be modified. -->
          <property name="expression" value="0 0/1 * * * ?" />
        </properties-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
</configuration> 
