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

<beans>

	<bean id="help.DataSource"
		class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="close">
		<property name="driverClassName">
			<value>org.hsqldb.jdbcDriver</value>
		</property>
		<property name="url">
			<value>jdbc:hsqldb:mem:sakai-help</value>
		</property>
		<property name="username">
			<value>sa</value>
		</property>
		<property name="password">
			<value></value>
		</property>
	</bean>

	<bean id="helpTransactionManager"
		class="org.springframework.orm.hibernate3.HibernateTransactionManager">
		<property name="sessionFactory">
			<ref bean="helpSessionFactory" />
		</property>
	</bean>

	<bean id="org.sakaiproject.api.app.help.HelpManager"
		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
		<property name="transactionManager">
			<ref bean="helpTransactionManager" />
		</property>
		<property name="target">
			<bean
				class="org.sakaiproject.component.app.help.HelpManagerImpl"
				singleton="true">
				<property name="contextSize">
					<value>6</value>
				</property>
				<property name="restConfiguration">
					<ref bean="org.sakaiproject.api.app.help.RestConfiguration" />
				</property>
				<property name="sessionFactory">
					<ref bean="helpSessionFactory" />
				</property>
				<property name="toolManager">
					<ref bean="org.sakaiproject.tool.api.ActiveToolManager" />
				</property>
				<property name="serverConfigurationService">
					<ref bean="org.sakaiproject.component.api.ServerConfigurationService"/>
				</property>
				<property name="txManager">
					<ref bean="helpTransactionManager" />
				</property>
			</bean>
		</property>
		<property name="transactionAttributes">
			<props>
				<prop key="*">PROPAGATION_REQUIRED</prop>
			</props>
		</property>
	</bean>
	
	<bean id="helpSessionFactory"
		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

		<property name="dataSource">
			<ref local="help.DataSource" />
		</property>

		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.HSQLDialect
				</prop>
				<prop key="hibernate.show_sql">false</prop>
				<prop key="hibernate.query.substitutions">
					true 1, false 0, yes 'Y', no 'N'
				</prop>
				<prop key="hibernate.jdbc.use_streams_for_binary">
					true
				</prop>
				<prop key="hibernate.cache.use_query_cache">true</prop>
				<prop key="hibernate.cache.provider_class">
					org.hibernate.cache.EhCacheProvider
				</prop>
			</props>
		</property>

		<!--  update the database schema when starting -->
		<property name="schemaUpdate">
			<value>true</value>
		</property>

		<property name="mappingResources">
			<list>
				<value>
					org/sakaiproject/component/app/help/model/ResourceBean.hbm.xml
				</value>
				<value>
					org/sakaiproject/component/app/help/model/SourceBean.hbm.xml
				</value>
				<value>
					org/sakaiproject/component/app/help/model/ContextBean.hbm.xml
				</value>
				<value>
					org/sakaiproject/component/app/help/model/CategoryBean.hbm.xml
				</value>
			</list>
		</property>

	</bean>
	
	<bean id="org.sakaiproject.api.app.help.RestConfiguration"
		class="org.sakaiproject.component.app.help.RestConfigurationImpl">
		<property name="organization">
			<value>sakai</value>
		</property>
		<property name="restCredentials">
			<value>user:pass</value>
		</property>
		<property name="restUrl">
			<value>http://</value>
		</property>
		<property name="restDomain">
			<value>sakaihelp</value>
		</property>
		<property name="cacheInterval">
		    <value>7200000</value>
		</property>
	</bean>
	
</beans>
