<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>
    <key>org.exoplatform.forum.ext.activity.ForumTaskManager</key>
    <type>org.exoplatform.forum.ext.activity.ForumTaskManager</type>
    <init-params>
      <value-param>
        <name>async-execution</name>
        <value>${integ.forum.ForumTaskManager.asyncExecution:true}</value>
      </value-param>
      <value-param>
        <name>maxPersistSize</name> <!-- Max number of task to process in period time -->
        <value>${integ.forum.ForumTaskManager.maxPersistSize:10}</value>
      </value-param>
      <value-param>
        <name>periodTime</name><!-- The time to repeat interval call process task -->
        <value>${integ.forum.ForumTaskManager.periodTime:2000}</value>
      </value-param>
      <value-param>
        <name>thread-priority</name>
        <value>${integ.forum.ForumTaskManager.threadPriority:1}</value><!--10: HIGH, 5: NORMAL; 1: LOW-->
      </value-param>
    </init-params>
  </component>

  <external-component-plugins>
   <target-component>org.exoplatform.social.core.processor.I18NActivityProcessor</target-component>
   <component-plugin>
     <name>poll:spaces</name> <!-- activity type -->
     <set-method>addActivityResourceBundlePlugin</set-method>
     <type>org.exoplatform.social.core.processor.ActivityResourceBundlePlugin</type>
     <init-params>
       <object-param>
         <name>locale.forum.integration.integration</name> <!-- resource bundle key file -->
         <description>activity key type resource bundle mapping for poll:activity</description>
         <object type="org.exoplatform.social.core.processor.ActivityResourceBundlePlugin">
           <field name="activityKeyTypeMapping">
             <map type="java.util.HashMap">
               <entry>
                 <key><string>update_poll</string></key>
                 <value><string>PollUIActivity.label.update_poll</string></value>
               </entry>
             </map>
           </field>
         </object>
       </object-param>
     </init-params>
   </component-plugin>
   <component-plugin>
     <name>ks-forum:spaces</name> <!-- activity type -->
     <set-method>addActivityResourceBundlePlugin</set-method>
     <type>org.exoplatform.social.core.processor.ActivityResourceBundlePlugin</type>
     <init-params>
       <object-param>
         <name>locale.forum.integration.integration</name> <!-- resource bundle key file -->
         <description>activity key type resource bundle mapping for exosocial:spaces</description>
         <object type="org.exoplatform.social.core.processor.ActivityResourceBundlePlugin">
           <field name="activityKeyTypeMapping">
             <map type="java.util.HashMap">
               <entry>
                 <key><string>forum.update-topic-title</string></key>
                 <value><string>ForumUIActivity.forum.update-topic-title</string></value>
               </entry>
               <entry>
                 <key><string>forum.update-topic-content</string></key>
                 <value><string>ForumUIActivity.forum.update-topic-content</string></value>
               </entry>
               <entry>
                 <key><string>forum.update-topic-rate</string></key>
                 <value><string>ForumUIActivity.forum.update-topic-rate</string></value>
               </entry>
               <entry>
                 <key><string>forum.closed-topic</string></key>
                 <value><string>ForumUIActivity.forum.closed-topic</string></value>
               </entry>
               <entry>
                 <key><string>forum.opened-topic</string></key>
                 <value><string>ForumUIActivity.forum.opened-topic</string></value>
               </entry>
               <entry>
                 <key><string>forum.locked-topic</string></key>
                 <value><string>ForumUIActivity.forum.locked-topic</string></value>
               </entry>
               <entry>
                 <key><string>forum.unlocked-topic</string></key>
                 <value><string>ForumUIActivity.forum.unlocked-topic</string></value>
               </entry>
               <entry>
                 <key><string>forum.approved-topic</string></key>
                 <value><string>ForumUIActivity.forum.approved-topic</string></value>
               </entry>
                <entry>
                 <key><string>forum.unapproved-topic</string></key>
                 <value><string>ForumUIActivity.forum.unapproved-topic</string></value>
               </entry>
                <entry>
                 <key><string>forum.move-topic</string></key>
                 <value><string>ForumUIActivity.forum.move-topic</string></value>
               </entry>
                <entry>
                 <key><string>forum.update-post</string></key>
                 <value><string>ForumUIActivity.forum.update-post</string></value>
               </entry>
               <entry>
                 <key><string>forum.add-poll</string></key>
                 <value><string>ForumUIActivity.forum.add-poll</string></value>
               </entry>
               <entry>
                 <key><string>forum.update-poll</string></key>
                 <value><string>ForumUIActivity.forum.update-poll</string></value>
               </entry>
               <entry>
                 <key><string>forum.close-poll</string></key>
                 <value><string>ForumUIActivity.forum.close-poll</string></value>
               </entry>
               <entry>
                 <key><string>forum.remove-poll</string></key>
                 <value><string>ForumUIActivity.forum.remove-poll</string></value>
               </entry>
             </map>
           </field>
         </object>
       </object-param>
     </init-params>
   </component-plugin>
  </external-component-plugins>

 <!-- Social integration -->
   <external-component-plugins>
    <target-component>org.exoplatform.social.core.space.spi.SpaceService</target-component>
    <component-plugin>
      <name>ForumDataInitialize</name>
      <set-method>addSpaceListener</set-method>
      <type>org.exoplatform.forum.ext.impl.ForumDataInitialize</type>
      <init-params>
				<value-param>
					<name>portletName</name>
					<value>ForumPortlet</value>
				</value-param>
			</init-params>
    </component-plugin>
    <component-plugin>
      <name>PollDataInitialize</name>
      <set-method>addSpaceListener</set-method>
      <type>org.exoplatform.forum.ext.impl.PollDataInitialize</type>
      <init-params>
        <value-param>
          <name>portletName</name>
          <value>PollPortlet</value>
        </value-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
	
   <external-component-plugins>
    <target-component>org.exoplatform.forum.service.ForumService</target-component>
    <component-plugin>
      <name>ForumEventListener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.forum.ext.impl.ForumSpaceActivityPublisher</type>
    </component-plugin>
  </external-component-plugins>
  
  <external-component-plugins>
    <target-component>org.exoplatform.poll.service.PollService</target-component>
    <component-plugin>
      <name>PollEventListener</name>
      <set-method>addListenerPlugin</set-method>
      <type>org.exoplatform.forum.ext.impl.PollSpaceActivityPublisher</type>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.social.core.space.spi.SpaceService</target-component>
    <component-plugin>
      <name>portlets.prefs.required</name>
      <set-method>setPortletsPrefsRequired</set-method>
      <type>org.exoplatform.social.core.application.PortletPreferenceRequiredPlugin</type>
      <init-params>      
        <values-param>
          <name>portletsPrefsRequired</name>
          <value>ForumPortlet</value>
          <value>FAQPortlet</value>
          <value>PollPortlet</value>
        </values-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
	
	<!-- configure activies plugin -->
	<external-component-plugins>
    <target-component>org.exoplatform.webui.ext.UIExtensionManager</target-component>
    <component-plugin>
      <name>add.forum.activity.plugin</name>
      <set-method>registerUIExtensionPlugin</set-method>
      <type>org.exoplatform.webui.ext.UIExtensionPlugin</type>
      <init-params>
        <object-param>
          <name>Forum Space 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>ks-forum:spaces</string></field>
            <field name="component"><string>org.exoplatform.forum.ext.impl.ForumUIActivity</string></field>
            <field name="activityBuiderClass"><string>org.exoplatform.forum.ext.impl.ForumSpaceUIActivityBuilder</string></field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>add.poll.activity.plugin</name>
      <set-method>registerUIExtensionPlugin</set-method>
      <type>org.exoplatform.webui.ext.UIExtensionPlugin</type>
      <init-params>
        <object-param>
          <name>Poll Space 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>ks-poll:spaces</string></field>
            <field name="component"><string>org.exoplatform.forum.ext.impl.PollUIActivity</string></field>
            <field name="activityBuiderClass"><string>org.exoplatform.forum.ext.impl.PollSpaceUIActivityBuilder</string></field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  <!-- End social intergration -->

	<external-component-plugins>
		<!-- The full qualified name of the ResourceBundleService -->
		<target-component>org.exoplatform.services.resources.ResourceBundleService</target-component>
		<component-plugin>
			<!-- The name of the plugin -->
			<name>Forum-Social integration ResourceBundle Plugin</name>
			<!-- The name of the method to call on the ResourceBundleService in order to register the ResourceBundles -->
			<set-method>addResourceBundle</set-method>
			<!-- The full qualified name of the BaseResourceBundlePlugin -->
			<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.forum.integration.integration</value>
				</values-param>
				<values-param>
					<name>portal.resource.names</name>
					<description>The properties files of the portal , those file will be merged
						into one ResoruceBundle properties </description>
					<value>locale.forum.integration.integration</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.forum.notification.plugin.PollActivityChildPlugin</type>
      <description>Initial information for poll child notification plugin.</description>
      <init-params>
        <value-param>
          <name>templatePath</name>
          <value><![CDATA[classpath:/groovy/forum/social-integration/plugin/notification/PollActivity.gtmpl]]></value>
        </value-param>
        <object-param>
          <name>template.PollActivityChildPlugin</name>
          <description>The template of PollActivityChildPlugin</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>ks-poll:spaces</string>
            </field>
            <field name="bundlePath">
              <string>locale.forum.integration.notification.ForumNotification</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>addChildPlugin</set-method>
      <type>org.exoplatform.forum.notification.plugin.ForumActivityChildPlugin</type>
      <description>Initial information for forum child notification plugin.</description>
      <init-params>
        <value-param>
          <name>templatePath</name>
          <value><![CDATA[classpath:/groovy/forum/social-integration/plugin/notification/ForumActivity.gtmpl]]></value>
        </value-param>
        <object-param>
          <name>template.ForumActivityChildPlugin</name>
          <description>The template of ForumActivityChildPlugin</description>
          <object type="org.exoplatform.commons.api.notification.plugin.config.PluginConfig">
            <field name="pluginId">
              <string>ks-forum:spaces</string>
            </field>
            <field name="bundlePath">
              <string>locale.forum.integration.notification.ForumNotification</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 profiles="all">
			<name>SOC_ACTIVITY_MIGRATION</name>
			<set-method>addEventListener</set-method>
			<type>org.exoplatform.forum.addons.rdbms.listener.ForumActivityUpdaterListener</type>
		</component-plugin>
	</external-component-plugins>
	
	<external-component-plugins>
		<target-component>org.exoplatform.commons.api.event.EventManager</target-component>
		<component-plugin profiles="all">
			<name>SOC_ACTIVITY_MIGRATION</name>
			<set-method>addEventListener</set-method>
			<type>org.exoplatform.forum.addons.rdbms.listener.PollActivityUpdaterListener</type>
		</component-plugin>
	</external-component-plugins>

</configuration>
