<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
Copyright 2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<beans>

  <!-- Profiler DAO-->
  <bean id="profilerImpl" class="org.apache.jetspeed.profiler.impl.JetspeedProfilerImpl" init-method="init">
       <constructor-arg index="0"><value>META-INF/profiler-ojb.xml</value></constructor-arg>
       <constructor-arg index="1"><value>j1</value></constructor-arg>
    </bean>
  
  <!-- Profiler -->  
  <bean id="org.apache.jetspeed.profiler.Profiler" 
        name="profiler"
        parent="baseTransactionProxy"        
  >        
        <property name="proxyInterfaces">
            <value>org.apache.jetspeed.profiler.Profiler</value>
        </property>
        <property name="target">
            <ref bean="profilerImpl"/>
        </property>
        <property name="transactionAttributes">
            <props>             
                <prop key="setRuleForPrincipal">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
                <prop key="store*">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
                <prop key="delete*">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.profiler.ProfilerException</prop>
                <prop key="*">PROPAGATION_SUPPORTS</prop>
            </props>
        </property>            
  </bean>
    
  <bean id="PsmlDocumentHandler"      
       class="org.apache.jetspeed.page.document.CastorFileSystemDocumentHandler" >         
       <constructor-arg index="0"><value>/META-INF/page-mapping.xml</value></constructor-arg>
       <constructor-arg index="1"><value>.psml</value></constructor-arg>
       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.Page</value></constructor-arg>       
       <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
  </bean>
  
  <bean id="LinkDocumentHandler"       
       class="org.apache.jetspeed.page.document.CastorFileSystemDocumentHandler" >         
       <constructor-arg index="0"><value>/META-INF/page-mapping.xml</value></constructor-arg>
       <constructor-arg index="1"><value>.link</value></constructor-arg>
       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.Link</value></constructor-arg>       
       <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
  </bean>
  
  <bean id="DocumentSetDocumentHandler"        
       class="org.apache.jetspeed.page.document.CastorFileSystemDocumentHandler" >         
       <constructor-arg index="0"><value>/META-INF/page-mapping.xml</value></constructor-arg>
       <constructor-arg index="1"><value>.ds</value></constructor-arg>
       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.DocumentSet</value></constructor-arg>      
       <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
  </bean>
  
  <bean id="FolderMetaDataDocumentHandler"         
       class="org.apache.jetspeed.page.document.CastorFileSystemDocumentHandler" >         
       <constructor-arg index="0"><value>/META-INF/page-mapping.xml</value></constructor-arg>
       <constructor-arg index="1"><value>folder.metadata</value></constructor-arg>
       <constructor-arg index="2" ><value>org.apache.jetspeed.om.folder.FolderMetaData</value></constructor-arg>       
       <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
  </bean>
  
  <bean id="PageSecurityDocumentHandler"       
       class="org.apache.jetspeed.page.document.CastorFileSystemDocumentHandler" >         
       <constructor-arg index="0"><value>/META-INF/page-mapping.xml</value></constructor-arg>
       <constructor-arg index="1"><value>page.security</value></constructor-arg>
       <constructor-arg index="2" ><value>org.apache.jetspeed.om.page.PageSecurity</value></constructor-arg>       
       <constructor-arg index="3" ><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="4" ><ref bean="PageFileCache"/></constructor-arg>
  </bean>
  
  <bean id="DocumentHandlerFactory"        
       class="org.apache.jetspeed.page.document.DocumentHandlerFactoryImpl" >      
        <constructor-arg>
        <map>
          <entry key=".psml">
            <ref bean="PsmlDocumentHandler" />
          </entry>
          <entry key=".link">
            <ref bean="LinkDocumentHandler" />
          </entry>  
          <entry key=".ds">
            <ref bean="DocumentSetDocumentHandler" />
          </entry>  
          <entry key="folder.metadata">
            <ref bean="FolderMetaDataDocumentHandler" />
          </entry>        
          <entry key="page.security">
            <ref bean="PageSecurityDocumentHandler" />
          </entry>        
        </map>
       </constructor-arg>
  </bean>
  
  <bean id="FolderHandler"         
       class="org.apache.jetspeed.page.document.FileSystemFolderHandler" >         
       <constructor-arg index="0"><value>${applicationRoot}/WEB-INF/pages</value></constructor-arg>
       <constructor-arg index="1"><ref bean="DocumentHandlerFactory"/></constructor-arg>
       <constructor-arg index="2"><ref bean="PageFileCache"/></constructor-arg>        
  </bean>
    
    
  <!-- PageManager -->
  <bean id="org.apache.jetspeed.page.PageManager" 
       name="pageManager"
       class="org.apache.jetspeed.page.impl.CastorXmlPageManager">         
       <constructor-arg index="0"><ref bean="IdGenerator"/></constructor-arg>
       <constructor-arg index="1"><ref bean="DocumentHandlerFactory"/></constructor-arg>
       <constructor-arg index="2"><ref bean="FolderHandler"/></constructor-arg>
       <constructor-arg index="3"><ref bean="PageFileCache"/></constructor-arg>        
       <!-- size of profiled page context LRU cache, default=100 -->
       <constructor-arg index="4"><value>100</value></constructor-arg>
       <!-- profiling enabled flag, default=true -->
       <constructor-arg index="5"><value>true</value></constructor-arg>
       <!-- permissions security enabled flag, default=false -->
       <constructor-arg index="6"><value>false</value></constructor-arg>
       <!-- constraints security enabled flag, default=true -->
       <constructor-arg index="7"><value>true</value></constructor-arg>
  </bean>

</beans>
