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


  <component>
    <key>org.exoplatform.services.wcm.publication.WCMPublicationService</key>
    <type>org.exoplatform.services.wcm.publication.WCMPublicationServiceImpl</type>
    <component-plugins>
      <component-plugin>
        <name>States and versions based publication</name>
        <set-method>addPublicationPlugin</set-method>
        <type>org.exoplatform.services.wcm.publication.lifecycle.stageversion.StageAndVersionPublicationPlugin</type>
        <description>This publication lifecycle publish a web content or DMS document to a portal page with more state and version.</description>
      </component-plugin>
      <component-plugin>
        <name>Simple publication</name>
        <set-method>addPublicationPlugin</set-method>
        <type>org.exoplatform.services.wcm.publication.lifecycle.simple.SimplePublicationPlugin</type>
        <description>This publication lifecycle publish a web content or DMS document to a portal page without version</description>
      </component-plugin>
    </component-plugins>
  </component>

  <component>
    <key>org.exoplatform.services.wcm.publication.WCMComposer</key>
    <type>org.exoplatform.services.wcm.publication.WCMComposerImpl</type>
    <init-params>
      <value-param>
        <name>useCache</name>
        <value>false</value>
      </value-param>
      <value-param>
        <name>useDefaultLanguage</name>
        <value>true</value>
      </value-param>
      <value-param>
      	<name>sharedGroup</name>
      	<value>*:/platform/users</value>
      </value-param>
    </init-params>
  </component>

  <external-component-plugins>
    <target-component>org.exoplatform.services.cache.CacheService</target-component>
    <component-plugin>
      <name>addExoCacheConfig</name>
      <set-method>addExoCacheConfig</set-method>
      <type>org.exoplatform.services.cache.ExoCacheConfigPlugin</type>
      <description>Configures the cache for query service</description>
      <init-params>
        <object-param>
          <name>cache.config.wcm.composer</name>
          <description>The default cache configuration</description>
          <object type="org.exoplatform.services.cache.ExoCacheConfig">
            <field name="name">
              <string>wcm.composer</string>
            </field>
            <field name="maxSize">
              <int>300</int>
            </field>
            <field name="liveTime">
              <long>600</long>
            </field>
            <field name="distributed">
              <boolean>false</boolean>
            </field>
            <field name="implementation">
              <string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>

  <!-- 
	WE USE THIS HANDLER TO ENROLL DOCUMENTS (UNTIL DMS 2.5.1)
	-->
  <external-component-plugins>
    <target-component>org.exoplatform.services.wcm.core.WebSchemaConfigService</target-component>
    <component-plugin>
      <name>StageAndVersionPublicationHandler</name>
      <set-method>addWebSchemaHandler</set-method>
      <type>org.exoplatform.services.wcm.publication.lifecycle.stageversion.StageAndVersionPublicationHandler</type>
    </component-plugin>
  </external-component-plugins>

  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>org.exoplatform.portal.config.DataStorage.pageCreated</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.page.CreatePageEventListener</type>
      <description>this listener update publication state of content when page is created</description>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.config.DataStorage.pageUpdated</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.page.UpdatePageEventListener</type>
      <description>this listener update publication state of content when page is updated</description>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.config.DataStorage.pageRemoved</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.page.RemovePageEventListener</type>
      <description>this listener update publication state of content when page is removed</description>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.mop.navigation.navigation_updated</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.navigation.UpdateNavigationEventListener</type>
      <description>this listener update publication state of content when navigation is updated</description>
    </component-plugin>
    <component-plugin>
      <name>org.exoplatform.portal.mop.navigation.navigation_destroyed</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.navigation.RemoveNavigationEventListener</type>
      <description>this listener update publication state of content when navigation is removed</description>
    </component-plugin>
  </external-component-plugins>
  <!-- 
	WE USE CMS CONTENT EVENT LISTENER TO ENROLL CONTENTS (DMS like exo:article OR WCM like exo:webContent) 
	THIS EVENT ISN'T BROADCASTED FOR UPLOADED DOCUMENTS (UNTIL DMS 2.5.1)
	-->
  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>CmsService.event.postCreate</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.post.PostCreateContentEventListener</type>
      <description>this listener will force the created document enroll to publication lifecycle</description>
    </component-plugin>
    <component-plugin>
      <name>CmsService.event.postEdit</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.post.PostEditContentEventListener</type>
      <description>this listener will change state of document to draft after editing</description>
    </component-plugin>
    <component-plugin>
      <name>FormGenerator.event.postCreate</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.post.PostCreateNodeTypeEventListener</type>
      <description>this listener will reinit the composer templates list when creating a new nodetype</description>
    </component-plugin>
  </external-component-plugins>
  
  <external-component-plugins>
    <target-component>org.exoplatform.services.listener.ListenerService</target-component>
    <component-plugin>
      <name>WebDavService.event.postUpload</name>
      <set-method>addListener</set-method>
      <type>org.exoplatform.services.wcm.publication.listener.post.PostWebDavUploadEventListener</type>
      <description>this listener will change state of document to draft after uploading a file from webdav</description>
    </component-plugin>
  </external-component-plugins>  
</configuration>
