<?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.
-->
<!--

  ************************************************************

  NOTE:

  The following configuration file contains the spring bean
  configuration needed to run the pluto-portal in memory
  mode.  Optional services are available which allow
  persistence to an rdbms, xml files, etc. . . however,
  we strongly recomend that if you are looking at these
  advanced features that you consider an enterprise portal
  such as Apache Jetspeed.

  Service Functions Include:
   - Preference Persistence
   - User Attribute Persistence
   - Portlet Registry
   - Page Registry
  ************************************************************

  -->

<beans>

    <bean id="RequiredContainerServices"
          name="OptionalContainerServices"
          class="org.apache.pluto.driver.services.container.ContainerServicesImpl"
          singleton="true">
      <constructor-arg><ref bean="PortalContext"/></constructor-arg>
      <constructor-arg><ref bean="DriverConfiguration"/></constructor-arg>
    </bean>

    <bean id="PortalContext"
          class="org.apache.pluto.driver.services.container.PortalContextImpl">
        <constructor-arg><ref bean="DriverConfiguration"/></constructor-arg>
    </bean>



    <!-- ================================================ -->
    <!-- The single top element of the configuration tree -->
    <!-- ================================================ -->
    <bean id="DriverConfiguration"
          class="org.apache.pluto.driver.config.impl.DriverConfigurationImpl">

      <!-- ===== Portal Services ===== -->
      <constructor-arg><ref bean="PortalURLParser"/></constructor-arg>
      <constructor-arg><ref bean="PropertyConfigService"/></constructor-arg>
      <constructor-arg><ref bean="RenderConfigService"/></constructor-arg>
      <constructor-arg><ref bean="SupportedModesService"/></constructor-arg>
      <constructor-arg><ref bean="SupportedWindowStatesService"/></constructor-arg>

      <!-- === Container Services === -->
      <constructor-arg><ref bean="PortalCallbackService"/></constructor-arg>

      <!--  Optional Container Services -->
      <!--
      <property name="portletPreferencesService"><ref bean="PortletPreferencesService"/></property>
      <property name="userAttributeService"><ref bean="UserAttributeService"/></property>
      -->
    </bean>

    <!-- ================================================ -->
    <!-- The single top element of the administration tree -->
    <!-- ================================================ -->
    <bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
      <property name="renderConfigAdminService"><ref bean="RenderConfigService"/></property>
    </bean>


    <!-- ================================================ -->
    <!-- Portal Services injected into the Configuration  -->
    <!-- ================================================ -->
    <bean id="PortalURLParser"
          class="org.apache.geronimo.pluto.impl.PortalURLParserImpl"
          factory-method="getParser"
          singleton="true">
    </bean>

    <bean id="PropertyConfigService"
          class="org.apache.geronimo.pluto.impl.PropertyConfigServiceImpl"
          singleton="true">
    </bean>

    <bean id="RenderConfigService"
          class="org.apache.geronimo.pluto.impl.RenderConfigServiceImpl"
          singleton="true">
    </bean>
    
    <bean id="SupportedModesService"
          class="org.apache.pluto.driver.services.impl.resource.SupportedModesServiceImpl"
          singleton="true">
          <constructor-arg><ref bean="PropertyConfigService"/></constructor-arg>
    </bean>

    <bean id="SupportedWindowStatesService"
          class="org.apache.pluto.driver.services.impl.resource.SupportedWindowStateServiceImpl"
          singleton="true">
          <constructor-arg><ref bean="PropertyConfigService"/></constructor-arg>
    </bean>

    <!-- ================================================ -->
    <!-- Container Services injected into  Configuration  -->
    <!-- ================================================ -->
    <bean id="PortalCallbackService"
          class="org.apache.pluto.driver.services.container.PortalCallbackServiceImpl"
          singleton="true">
    </bean>

    <!-- ================================================ -->
    <!-- PortalServices for Geronimo                      -->
    <!-- ================================================ -->
    <bean id="GeronimoPortalServices"
          class="org.apache.geronimo.pluto.PortalContainerServicesGBean"
          factory-method="getSingleton"
          singleton="true">
      <property name="renderConfigService"><ref bean="RenderConfigService"/></property>
      <property name="portalCallbackService"><ref bean="PortalCallbackService"/></property>
      <property name="propertyConfigService"><ref bean="PropertyConfigService"/></property>
      <property name="driverConfiguration"><ref bean="DriverConfiguration"/></property>
      <property name="adminConfiguration"><ref bean="AdminConfiguration"/></property>   
    </bean>

</beans>
