<beans>
  <!-- 
      Model-Glue Framework Definition

      What follows is low-level plumbing for Model-Glue.  This allows you
      to create some seriously custom Model-Glue deployments without 
      editing the stock Model-Glue distribution:  instead, you can replace
      key portions of the framework with your own implementations.  Edit at 
      your own peril. 
  -->
  
  <!-- This is Model-Glue itself! -->  
  <bean id="modelGlue" class="ModelGlue.unity.framework.ModelGlue">
     <constructor-arg name="version">
       <value>(Unknown: Subversion Checkout)</value>
     </constructor-arg>
     <constructor-arg name="modelGlueConfiguration">
       <ref bean="modelGlueConfiguration" />
     </constructor-arg>
     <property name="statebuilder">
       <ref bean="stateBuilder" />
     </property>
     <property name="IOCContainer">
       <ref bean="coldSpringAdapter" />
     </property>
     <property name="beanMaker">
       <ref bean="beanMaker" />
     </property>
  </bean>
  <!-- 
      The default coldspring adapter
  -->
  <bean id="coldSpringAdapter" class="ModelGlue.unity.ioc.ColdSpringAdapter" />

  <!--
      Legacy ChiliBeans-based "ConfigBeans"
  -->
  <bean id="chiliBeansAdapter" class="ModelGlue.unity.ioc.ChiliBeansAdapter">
	  <constructor-arg name="BeanMappings"><value>/ModelGlue/unity/config</value></constructor-arg>
  </bean>


	<!--
    This defines what ORM service to use, such as Reactor.
		<bean id="ormAdapter" class="ModelGlue.unity.orm.ReactorAdapter">
			<constructor-arg name="framework"><ref bean="ModelGlue" /></constructor-arg>
		</bean>
		
		<bean id="ormService" class="reactor.reactorFactory">
			<constructor-arg name="configuration"><ref bean="reactorConfiguration" /></constructor-arg>
		</bean>
	-->
	
	<!-- Reactor adapter/service -->
	<bean id="ormAdapter.Reactor" class="ModelGlue.unity.orm.ReactorAdapter">
		<constructor-arg name="framework"><ref bean="ModelGlue" /></constructor-arg>
	</bean>
	
	<bean id="ormService.Reactor" class="reactor.reactorFactory">
		<constructor-arg name="configuration"><ref bean="reactorConfiguration" /></constructor-arg>
	</bean>

	<!-- Transfer adapter/service -->
	<bean id="ormAdapter.Transfer" class="ModelGlue.unity.orm.transfer.TransferAdapter">
		<constructor-arg name="framework"><ref bean="ModelGlue" /></constructor-arg>
	</bean>
	
	<bean id="ormService.Transfer" class="transfer.TransferFactory">
		 <constructor-arg name="configuration"><ref bean="transferConfiguration" /></constructor-arg>
	</bean>
	    
  <!-- 
      This controls what class builds the initial state collection.
    
      If you need to implement a custom builder to support something like
      SES, this is what you'd want to change.
  -->
  <bean id="stateBuilder" class="ModelGlue.unity.statebuilder.StateBuilder" />

  <!--
      This the controller to use for generic ORM interaction (uses the ormAdapter).
  -->
  <bean id="ormController" class="ModelGlue.unity.controller.GenericORMController" autowire="false">
    <constructor-arg name="modelGlue"><ref bean="modelGlue" /></constructor-arg>
    <constructor-arg name="name"><value>ORMController</value></constructor-arg>
    <constructor-arg name="debug"><value>false</value></constructor-arg>
  </bean>

  <!--
      This defines what class builds the configuration path 
      and asks the eventLoader to configure the framework.
  -->
  <bean id="frameworkLoader" class="ModelGlue.unity.loader.FrameworkLoader" />
    
  <!--
      This defines what class reads the file at the configurationPath 
      determined by the frameworkLoader and loads event-handlers/controllers 
      from the file it defines.
  -->
  <bean id="eventLoader" class="ModelGlue.unity.loader.XmlConfigurationLoader" />
  
  <!--
      This defines the view generator used by extended event-handlers 
      to generate their views.
  -->
  <bean id="viewGenerator" class="ModelGlue.unity.view.ViewGenerator">
    <constructor-arg name="modelGlueConfiguration"><ref bean="modelGlueConfiguration" /></constructor-arg>
  </bean>

  <!--
		This defines the bean maker to use.
  -->
  <bean id="beanMaker" class="ModelGlue.Util.CollectionBeanMaker" />
	
	
	<!-- If they're running a 1.x app on 2.x core, they'll need these.... -->
	<bean id="modelGlueConfiguration" class="ModelGlue.unity.framework.ModelGlueConfiguration">
    <!-- Be sure to change reload to false when you go to production! -->
    <property name="reload"><value>false</value></property>
    <property name="rescaffold"><value>true</value></property>
    <property name="rescaffoldKey"><value>scaffold</value></property>
    <property name="rescaffoldPassword"><value>true</value></property>
    <property name="debug"><value>true</value></property>
    <property name="defaultEvent"><value>page.index</value></property>
    <property name="reloadPassword"><value>true</value></property>
    <property name="viewMappings"><value></value></property>
    <property name="generatedViewMapping"><value></value></property>
    <property name="configurationPath"><value>config/ModelGlue.xml</value></property>
    <property name="scaffoldConfigurationPath"><value>/ModelGlue/unity/config/ScaffoldingConfiguration.xml</value></property>
		<property name="scaffoldPath"><value>config/scaffolds/Scaffolds.xml</value></property>
    <property name="statePrecedence"><value>form</value></property>
    <property name="reloadKey"><value>init</value></property>
    <property name="eventValue"><value>event</value></property>
    <property name="defaultTemplate"><value>index.cfm</value></property>
    <property name="defaultExceptionHandler"><value>exception</value></property>
    <property name="defaultCacheTimeout"><value>5</value></property>
    <property name="defaultScaffolds"><value>list,edit,view,commit,delete</value></property>
  </bean>
</beans>