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

    Copyright (C) 2003-2011 eXo Platform SAS.

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

-->
<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">

  <component>
    <type>org.exoplatform.social.ckeditor.HTMLUploadImageProcessor</type>
  </component>

  <component profiles="all">
    <type>org.exoplatform.social.ckeditor.rest.ComposerImageControllerRest</type>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.webui.ext.UIExtensionManager</target-component>
    <component-plugin>
      <name>add.action</name>
      <set-method>registerUIExtensionPlugin</set-method>
      <type>org.exoplatform.webui.ext.UIExtensionPlugin</type>
      <init-params>
        <object-param>
          <name>Document Activity</name>
          <object type="org.exoplatform.social.webui.activity.UIActivityExtension">
            <field name="type"><string>org.exoplatform.social.webui.activity.BaseUIActivity</string></field>
            <field name="name"><string>DOC_ACTIVITY</string></field>
            <field name="component"><string>org.exoplatform.social.plugin.doc.UIDocActivity</string></field>
            <field name="activityBuiderClass"><string>org.exoplatform.social.plugin.doc.UIDocActivityBuilder</string></field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>add.action</name>
      <set-method>registerUIExtensionPlugin</set-method>
      <type>org.exoplatform.webui.ext.UIExtensionPlugin</type>
      <init-params>
        <object-param>
          <name>Document Composer</name>
          <object type="org.exoplatform.webui.ext.UIExtension">
            <field name="type"><string>org.exoplatform.social.webui.composer.UIActivityComposer</string></field>
            <field name="name"><string>DOC_ACTIVITY</string></field>
            <field name="component"><string>org.exoplatform.social.plugin.doc.UIDocActivityComposer</string></field>
            <field name="rank"><int>2</int></field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.services.resources.ResourceBundleService</target-component>
    <component-plugin>
      <name>Document Composer Plugin Resource Bundle</name>
      <set-method>addResourceBundle</set-method>
      <type>org.exoplatform.services.resources.impl.BaseResourceBundlePlugin</type>
      <init-params>
        <values-param>
          <name>classpath.resources</name>
          <description>The resources that start with the following package name should be load from file system</description>
          <value>locale.social.plugin.doc.UIDocumentComposerPlugin</value>
        </values-param>
        <values-param>
          <name>portal.resource.names</name>
          <description>The resources that start with the following package name should be load from file system</description>
          <value>locale.social.plugin.doc.UIDocumentComposerPlugin</value>
        </values-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>addChildPlugin</set-method>
      <type>org.exoplatform.social.plugin.doc.notification.plugin.DocActivityChildPlugin</type>
      <description>Initial information for forum child notification plugin.</description>
      <init-params>
        <value-param>
          <name>templatePath</name>
          <value><![CDATA[classpath:/groovy/social/plugin/doc/notification/DocumentActivity.gtmpl]]></value>
        </value-param>
        <object-param>
          <name>template.DocActivityChildPlugin</name>
          <description>The template of DocActivityChildPlugin</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>DOC_ACTIVITY</string>
            </field>
            <field name="bundlePath">
              <string>locale.social.plugin.doc.notification.DocNotification</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

	<external-component-plugins>
		<target-component>org.exoplatform.commons.api.event.EventManager</target-component>
		<component-plugin>
			<name>SOC_ACTIVITY_MIGRATION</name>
			<set-method>addEventListener</set-method>
			<type>org.exoplatform.social.addons.rdbms.listener.DocActivityUpdaterListener</type>
		</component-plugin>
	</external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.social.core.manager.ActivityManager</target-component>
    <component-plugin>
      <name>ActivityImageLinkUpdateListener</name>
      <set-method>addActivityEventListener</set-method>
      <type>org.exoplatform.social.ckeditor.listener.ActivityImageLinkUpdateListener</type>
      <init-params>
        <value-param>
          <name>personal.drive.name</name>
          <value>Personal Documents</value>
        </value-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

</configuration>
