<?xml version="1.0" encoding="ISO-8859-1"?>
<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.extensions.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>Authoring publication</name>
	    <set-method>addPublicationPlugin</set-method>
	    <type>org.exoplatform.services.wcm.extensions.publication.lifecycle.authoring.AuthoringPublicationPlugin</type>
	    <description>This publication lifecycle publish a web content or DMS document to a portal page with more states and version.</description>	    	    	   
	  </component-plugin>
  </component-plugins>
 </component>
   
<component>
	  <key>org.exoplatform.services.wcm.extensions.publication.PublicationManager</key>
	  <type>org.exoplatform.services.wcm.extensions.publication.impl.PublicationManagerImpl</type>
</component>	

<component>
  <type>org.exoplatform.wcm.extensions.component.rest.LifecycleConnector</type>
</component>

<external-component-plugins>
  <target-component>org.exoplatform.services.wcm.extensions.publication.PublicationManager</target-component>
  <component-plugin>
    <name>AddLifecycle</name>
    <set-method>addLifecycle</set-method>
    <type>org.exoplatform.services.wcm.extensions.publication.lifecycle.StatesLifecyclePlugin</type>
    <description>Configures</description>
    <priority>1</priority>
     <init-params>
      <object-param>
        <name>lifecycles</name>
        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig">
          <field  name="lifecycles">
            <collection type="java.util.ArrayList">
              <value>
                <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$Lifecycle">
                  <field name="name"><string>lifecycle1</string></field>
                  <field name="publicationPlugin"><string>Authoring publication</string></field>
                  <field  name="states">
                    <collection type="java.util.ArrayList">
                      <value>
                        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
                          <field name="state"><string>draft</string></field>
                          <field name="membership"><string>author:/platform/web-contributors</string></field>
                        </object>
                      </value>
                      <value>
                        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
                          <field name="state"><string>pending</string></field>
                          <field name="membership"><string>author:/platform/web-contributors</string></field>
                        </object>
                      </value>
                      <value>
                        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
                          <field name="state"><string>approved</string></field>
                          <field name="membership"><string>manager:/platform/web-contributors</string></field>
                        </object>
                      </value>
                      <value>
                        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
                          <field name="state"><string>staged</string></field>
                          <field name="membership"><string>publisher:/platform/web-contributors</string></field>
                        </object>
                      </value>
                      <value>
                        <object type="org.exoplatform.services.wcm.extensions.publication.lifecycle.impl.LifecyclesConfig$State">
                          <field name="state"><string>published</string></field>
                          <field name="membership"><string>publisher:/platform/web-contributors</string></field>
                        </object>
                      </value>
                    </collection>
                  </field>
                </object>
              </value>

            </collection>
          </field>
        </object>
      </object-param>
    </init-params>
  </component-plugin>
  <component-plugin>
    <name>AddContext</name>
    <set-method>addContext</set-method>
    <type>org.exoplatform.services.wcm.extensions.publication.context.ContextPlugin</type>
    <init-params>
      <object-param>
        <name>contexts</name>
        <object type="org.exoplatform.services.wcm.extensions.publication.context.impl.ContextConfig">
          <field  name="contexts">
            <collection type="java.util.ArrayList">
              <value>
                <object type="org.exoplatform.services.wcm.extensions.publication.context.impl.ContextConfig$Context">
                  <field name="name"><string>contextdefault</string></field>
                  <field name="priority"><string>200</string></field>
                  <field name="lifecycle"><string>lifecycle1</string></field>
                </object>
              </value>
            </collection>
          </field>
        </object>
      </object-param>
    </init-params>
  </component-plugin>
</external-component-plugins>


<external-component-plugins>
  <target-component>org.exoplatform.services.listener.ListenerService</target-component>
  <component-plugin>
    <name>PublicationService.event.postUpdateState</name>
    <set-method>addListener</set-method>
    <type>org.exoplatform.services.wcm.extensions.publication.listener.post.PostUpdateStateEventListener</type>
    <description>this listener will be called every time a content changes its current state</description>
  </component-plugin>
</external-component-plugins>

<external-component-plugins>
  	<target-component>org.exoplatform.services.jcr.RepositoryService</target-component>		
	  <component-plugin>
	    <name>add.nodeType</name>
	    <set-method>addPlugin</set-method>
	    <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
	    <priority>100</priority>
	    <init-params>
	      <values-param>
	        <name>autoCreatedInNewRepository</name>
	        <description>Node types configuration file</description>
	        <value>war:/conf/content-extended/authoring/wcm-extensions-nodetypes.xml</value>
	      </values-param>
	    </init-params>
	  </component-plugin>
	</external-component-plugins>
  
    <external-component-plugins>
    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
      <component-plugin>
        <name>changeStateJobToPublished</name>
        <set-method>addCronJob</set-method>
        <type>org.exoplatform.services.wcm.extensions.scheduler.ChangeStateCronJob</type>
        <description>add a job to change the state of content</description>
        <init-params>         
          <properties-param>
            <name>cronjob.info</name>
            <description>cron job info</description>
              <property name="jobName" value="changeStateJobToPublished"/>
              <property name="groupName" value="group"/>
              <property name="job" value="org.exoplatform.services.wcm.extensions.scheduler.impl.ChangeStateCronJobImpl"/>
              <property name="expression" value="15/120 * * * * ?"/>
          </properties-param>
          <properties-param>
            <name>changeStateCronJob.generalParams</name>
            <description>General parameters for job</description>
              <property name="fromState" value="staged"/>
              <property name="toState" value="published"/>
              <property name="predefinedPath" value="repository:collaboration:/"/>
          </properties-param>
        </init-params>
      </component-plugin>
    </external-component-plugins> 
    
    <external-component-plugins>
    <target-component>org.exoplatform.services.scheduler.JobSchedulerService</target-component>
      <component-plugin>
        <name>changeStateJobToUnpublished</name>
        <set-method>addCronJob</set-method>
        <type>org.exoplatform.services.wcm.extensions.scheduler.ChangeStateCronJob</type>
        <description>add a job to change the state of content</description>
        <init-params>         
          <properties-param>
            <name>cronjob.info</name>
            <description>cron job info</description>
              <property name="jobName" value="changeStateJobToUnpublished"/>
              <property name="groupName" value="group"/>
              <property name="job" value="org.exoplatform.services.wcm.extensions.scheduler.impl.ChangeStateCronJobImpl"/>
              <property name="expression" value="45/120 * * * * ?"/>
          </properties-param>
          <properties-param>
            <name>changeStateCronJob.generalParams</name>
            <description>General parameters for job</description>
              <property name="fromState" value="published"/>
              <property name="toState" value="unpublished"/>
              <property name="predefinedPath" value="repository:collaboration:/"/>
          </properties-param>
        </init-params>
      </component-plugin>
    </external-component-plugins>
  
  
</configuration>
