<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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>
  <bean id="localizationValve"
        class="org.apache.jetspeed.localization.impl.LocalizationValveImpl"
        init-method="initialize"
  >
    <constructor-arg>
      <value><!--@defaultLanguage--><!--defaultLanguage@--></value>
    </constructor-arg>
  </bean> 
  
  <bean id="capabilityValve"
        class="org.apache.jetspeed.capabilities.impl.CapabilityValveImpl"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.jetspeed.capabilities.Capabilities" />
   </constructor-arg>
  </bean> 
  
  <bean id="portalURLValve"
        class="org.apache.jetspeed.container.url.impl.PortalURLValveImpl"
        init-method="initialize"
  /> 
  
  <bean id="securityValve"
        class="org.apache.jetspeed.security.impl.SecurityValveImpl"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.jetspeed.profiler.Profiler" />
   </constructor-arg>
   <constructor-arg>
       <ref bean="org.apache.jetspeed.security.UserManager" />
   </constructor-arg>
   <constructor-arg>
       <ref bean="PortalStatistics" />
   </constructor-arg>   
  </bean> 
  
  <bean id="passwordCredentialValve"
        class="org.apache.jetspeed.security.impl.PasswordCredentialValveImpl"
        init-method="initialize"
  />
  
  <bean id="loginValidationValve"
        class="org.apache.jetspeed.security.impl.LoginValidationValveImpl"
        init-method="initialize">
	  <!-- remove (from the session) the following list of session attributes upon login -->
       <constructor-arg index="0">
            <list>
                <value>org.apache.jetspeed.powertool.actions</value>
            </list>		   
	   </constructor-arg>	  
  </bean>
  <bean id="profilerValve"
        class="org.apache.jetspeed.profiler.impl.ProfilerValveImpl"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.jetspeed.profiler.Profiler" />
   </constructor-arg>
   <constructor-arg>
       <ref bean="org.apache.jetspeed.portalsite.PortalSite" />
   </constructor-arg>
   <constructor-arg>
       <ref bean="org.apache.jetspeed.page.PageManager" />
   </constructor-arg>
  </bean> 
  
  <bean id="containerValve"
        class="org.apache.jetspeed.container.ContainerValve"
        init-method="initialize"
  /> 
  
  <bean id="actionValve"
        class="org.apache.jetspeed.pipeline.valve.impl.ActionValveImpl"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.pluto.PortletContainer" />
   </constructor-arg>
   <constructor-arg>   
       <ref bean="PortletWindowAccessor" />    
   </constructor-arg>   
  </bean> 
  
  <bean id="portletValve"
        class="org.apache.jetspeed.aggregator.PortletValve"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.jetspeed.aggregator.PortletAggregator"/>
   </constructor-arg>
  </bean> 

  <bean id="fileServerValve"
        class="org.apache.jetspeed.aggregator.FileServerValve"
        init-method="initialize"
  >
     <!-- portlet -->
     <constructor-arg index="0"><value>demo::ContentViewer</value></constructor-arg>    
     <!-- entity -->
     <constructor-arg index="1"><value>public.content.21</value></constructor-arg>    
  </bean> 
  
  <bean id="aggregatorValve"
        class="org.apache.jetspeed.aggregator.AggregatorValve"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="org.apache.jetspeed.aggregator.PageAggregator"/>
   </constructor-arg>
  </bean> 
  
  <bean id="cleanUpValve"
        class="org.apache.jetspeed.pipeline.valve.impl.CleanupValveImpl"
        init-method="initialize"
  >
  </bean> 

  <bean id="AJAXValve"
        class="org.apache.jetspeed.ajax.AJAXValve"
        init-method="initialize"
  >
   <constructor-arg>
       <ref bean="AJAXService"/>
   </constructor-arg>
  </bean> 
  
  <bean id="DecorationValve"
        class="org.apache.jetspeed.decoration.DecorationValve"
        init-method="initialize">
        <constructor-arg>
            <ref bean="DecorationFactory" />
        </constructor-arg>
		<constructor-arg>			
			 <ref bean="PortletWindowAccessor" />
		</constructor-arg>
  </bean>

  <bean id="loginViewValve"
        class="org.apache.jetspeed.login.impl.LoginJSPViewValve"
        init-method="initialize"
  >
    <constructor-arg>
      <value>/WEB-INF/templates/login</value>
    </constructor-arg>
  </bean> 
  
  <bean id="GraffitoContextValve"
        class="org.apache.portals.jetspeed.valve.GraffitoContextValve"
        init-method="initialize"
  >
   <constructor-arg>
   	<ref bean="org.apache.portals.graffito.context.CmsRequestContextManager" />
   </constructor-arg>  
  </bean>
  
  <bean id="jetspeed-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>JetspeedPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
      <ref bean="capabilityValve"/>
      <ref bean="portalURLValve"/>
      <ref bean="securityValve"/>
      <ref bean="localizationValve"/>
      <ref bean="passwordCredentialValve"/>
      <ref bean="loginValidationValve"/>
      <ref bean="GraffitoContextValve"/>
      <ref bean="profilerValve"/>
      <ref bean="DecorationValve" />
      <ref bean="containerValve"/>      
      <ref bean="actionValve"/>
      <ref bean="aggregatorValve"/>
      <ref bean="cleanUpValve"/>
    </list>
    </constructor-arg>
  </bean> 
  
  <bean id="login-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>LoginPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
      <ref bean="capabilityValve"/>
      <ref bean="localizationValve"/>
      <ref bean="loginViewValve"/>
    </list>
    </constructor-arg>
  </bean> 

  <bean id="action-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>ActionPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
        <ref bean="localizationValve"/>
        <ref bean="capabilityValve"/>
        <ref bean="portalURLValve"/>
        <ref bean="containerValve"/>
        <ref bean="actionValve"/>
    </list>
    </constructor-arg>
  </bean> 
  
  <bean id="portlet-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>PortletPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
        <ref bean="portalURLValve"/>                
        <ref bean="capabilityValve"/>
        <ref bean="securityValve"/>                
        <ref bean="localizationValve"/>
        <ref bean="profilerValve"/>                        
        <ref bean="containerValve"/>
        <ref bean="portletValve"/>    
    </list>
    </constructor-arg>
  </bean> 
  
  <bean id="ajax-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>AjaxPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
        <ref bean="portalURLValve"/>                
        <ref bean="securityValve"/>                
        <ref bean="localizationValve"/>
        <ref bean="profilerValve"/>                        
        <ref bean="containerValve"/>
        <!-- TODO: replace layout valve with Ajax valve -->
        <ref bean="layoutValve"/>
    </list>
    </constructor-arg>
  </bean> 

  <bean id="fileserver-pipeline"
        class="org.apache.jetspeed.pipeline.JetspeedPipeline"
        init-method="initialize"
  >
   <constructor-arg>
       <value>FileServerPipeline</value>
   </constructor-arg>
   <constructor-arg>
    <list>
        <ref bean="portalURLValve"/>                
        <ref bean="securityValve"/>                
        <ref bean="localizationValve"/>
        <ref bean="profilerValve"/>                        
        <ref bean="containerValve"/>
        <ref bean="fileServerValve"/>            
        <ref bean="portletValve"/>    
    </list>
    </constructor-arg>
  </bean> 
  
  <bean id='pipeline-map'
        class='java.util.HashMap'>
    <constructor-arg>
        <map>
            <entry key='/portlet'>
                <value>portlet-pipeline</value>
            </entry>            
            <entry key='/portal'>
                <value>jetspeed-pipeline</value>
            </entry>
            <entry key='/ajaxapi'>
                <value>ajax-pipeline</value>
            </entry>
            <entry key='/login'>
                <value>jetspeed-pipeline</value>
            </entry>            
            <entry key='/fileserver'>
                <value>fileserver-pipeline</value>
            </entry>                        
        </map>        
    </constructor-arg>        
  </bean>
  
</beans>
