<?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>
    <key>org.exoplatform.wiki.rendering.cache.PageRenderingCacheService</key>
    <type>org.exoplatform.wiki.rendering.cache.impl.PageRenderingCacheServiceImpl</type>
  </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 wiki markup cache</description>
      <init-params>
        <object-param>
          <name>wiki.PageRenderingCache</name>
          <description>The wiki markup cache configuration</description>
          <object type="org.exoplatform.services.cache.ExoCacheConfig">
            <field name="name"><string>wiki.PageRenderingCache</string></field>
            <field name="maxSize"><int>${cache.exo.wiki.PageRenderingCache.Capacity:1000}</int></field>
            <field name="liveTime"><long>${cache.exo.wiki.PageRenderingCache.TimeToLive:-1}</long></field>
            <field name="implementation"><string>org.exoplatform.services.cache.concurrent.ConcurrentFIFOExoCache</string></field> 
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  
  
  <external-component-plugins>
    <target-component>org.exoplatform.services.jcr.impl.ext.action.SessionActionCatalog</target-component>
    <component-plugin>
      <name>Last Update Action</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin</type>
      <description>add actions plugin</description>
      <init-params>
        <object-param>
          <name>actions</name>
          <object type="org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin$ActionsConfig">
            <field  name="actions">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.jcr.impl.ext.action.ActionConfiguration">
                    <field  name="eventTypes"><string>addNode,checkin</string></field>
                    <field  name="nodeTypes"><string>wiki:page</string></field>
                    <field  name="actionClassName"><string>org.exoplatform.wiki.rendering.cache.impl.UpdatePageRenderingCacheAction</string></field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>Last Update Action</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin</type>
      <description>add actions plugin</description>
      <init-params>
        <object-param>
          <name>actions</name>
          <object type="org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin$ActionsConfig">
            <field  name="actions">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.jcr.impl.ext.action.ActionConfiguration">
                    <field  name="eventTypes"><string>addMixin</string></field>
                    <field  name="nodeTypes"><string>wiki:removed</string></field>
                    <field  name="actionClassName"><string>org.exoplatform.wiki.rendering.cache.impl.UpdatePageRenderingCacheAction</string></field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
    <component-plugin>
      <name>Last Update Action</name>
      <set-method>addPlugin</set-method>
      <type>org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin</type>
      <description>add actions plugin</description>
      <init-params>
        <object-param>
          <name>actions</name>
          <object type="org.exoplatform.services.jcr.impl.ext.action.AddActionsPlugin$ActionsConfig">
            <field  name="actions">
              <collection type="java.util.ArrayList">
                <value>
                  <object type="org.exoplatform.services.jcr.impl.ext.action.ActionConfiguration">
                    <field  name="eventTypes"><string>changeProperty</string></field>
                    <field  name="nodeTypes"><string>wiki:renamed,wiki:moved</string></field>
                    <field  name="actionClassName"><string>org.exoplatform.wiki.rendering.cache.impl.UpdatePageRenderingCacheAction</string></field>
                  </object>
                </value>
              </collection>
            </field>
          </object>
        </object-param>
      </init-params>
    </component-plugin>
  </external-component-plugins>
  
  
</configuration>
