<?xml version="1.0" encoding="ISO-8859-1"?>
<!--

    Copyright (C) 2009 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_2.xsd http://www.exoplatform.org/xml/ns/kernel_1_2.xsd"
   xmlns="http://www.exoplatform.org/xml/ns/kernel_1_2.xsd">

  <!-- GROOVY REST SERVICES -->
  <component>
    <type>org.exoplatform.platform.gadget.services.GroovyScript2RestLoader.GroovyScript2RestLoaderExt</type>
    <component-plugins>
        <component-plugin>
          <name>test</name>
          <set-method>addPlugin</set-method>
          <type>org.exoplatform.services.jcr.ext.script.groovy.GroovyScript2RestLoaderPlugin</type>
          <init-params>
            <value-param>
              <name>repository</name>
              <value>repository</value>
            </value-param>
            <value-param>
              <name>workspace</name>
              <value>portal-system</value>
            </value-param>
            <value-param>
              <name>node</name>
              <value>/exo:gadget-groovy</value>
            </value-param>
            
            <properties-param>
              <name>Monitoring.groovy</name>
              <property name="autoload" value="true" />
              <property name="path" value="war:/groovy/Monitoring/Monitoring.groovy" />
            </properties-param>
        
            <properties-param>
              <name>Statistics.groovy</name>
              <property name="autoload" value="true" />
              <property name="path" value="war:/groovy/Statistics/Statistics.groovy" />
            </properties-param>
        
            <properties-param>
              <name>calgad.groovy</name>
              <property name="autoload" value="true" />
              <property name="path" value="war:/groovy/eXoCalendar/calgad.groovy" />
            </properties-param>
        
            <properties-param>
              <name>Suggestion.groovy</name>
              <property name="autoload" value="true" />
              <property name="path" value="war:/groovy/FriendSuggestion/Suggestion.groovy" />
            </properties-param>
        
          </init-params>
        </component-plugin>
    </component-plugins>
    <init-params>
       <object-param>
          <name>observation.config</name>
          <object type="org.exoplatform.services.jcr.ext.script.groovy.ObservationListenerConfiguration">
             <field name="repository">
                <string>repository</string>
             </field>
             <field name="workspaces">
                <collection type="java.util.ArrayList">
                   <value>
                      <string>portal-system</string>
                   </value>
                </collection>
             </field>
          </object>
       </object-param>
    </init-params>
  </component>
   
  <!-- LOGIN HISTORY -->
  <external-component-plugins>
    <target-component>org.exoplatform.platform.gadget.services.LoginHistory.LoginHistoryService</target-component>
    <component-plugin>
      <name>LoginHistoryService.addConfiguration</name>
      <set-method>addConfiguration</set-method>
      <type>org.exoplatform.platform.gadget.services.LoginHistory.LoginHistoryPlugin</type>
      <description>Configure login history statistic limits (0 means unlimited)</description>
      <priority>50</priority>
      <init-params>
        <value-param>
          <name>MaxNumOfUserLoginHistoryEntries</name>
          <value>0</value>
        </value-param>
        <value-param>
          <name>DaysForKeepingUserStatistic</name>
          <value>0</value>
        </value-param>
        <value-param>
          <name>DaysForKeepingGlobalStatistic</name>
          <value>0</value>
        </value-param>   
      </init-params>
    </component-plugin>
  </external-component-plugins> 
  

  <!-- LISTENERS -->
  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>exo.core.security.ConversationRegistry.register</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.platform.gadget.services.LoginHistory.LoginHistoryListener</type>
      <description>Listener for user login event</description>
    </component-plugin>
  </external-component-plugins>

   
  <!-- JOBS --> 
  <external-component-plugins>
    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
    <component-plugin>
      <name>ForumsWeeklyStatisticJob</name>
      <set-method>addPeriodJob</set-method>
      <type>org.exoplatform.services.scheduler.PeriodJob</type>
      <description>add a ForumsWeeklyStatisticJob job to the JobSchedulerService</description>
      <init-params>
        <properties-param>
          <name>job.info</name>
          <description>save the Forums Weekly Statistic data  periodically</description>
          <property name="jobName" value="periodically"/>
          <property name="groupName" value="KnowlegedSuite"/>
          <property name="job" value="org.exoplatform.platform.gadget.services.ForumStatistics.ForumsWeeklyStatisticJob"/>
          <property name="repeatCount" value="0"/>
          <property name="period" value="43200000"/> <!--12 hours-->    
          <property name="startTime" value="+0"/>
          <property name="endTime" value=""/>               
        </properties-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

</configuration>
