<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:property-placeholder location="classpath:serviceconfig/olat.properties, classpath:olat.local.properties" />
<bean id="onyxModule" class="de.bps.onyx.plugin.OnyxModule" init-method="init" destroy-method="destroy">
	<property name="onyxPluginWSLocation" value="${onyx.plugin.wslocation}" />
	<property name="configName" value="${onyx.plugin.configname}" />
</bean>

<bean id="IQControllerCreatorOnyx" class="de.bps.onyx.plugin.course.nodes.iq.IQControllerCreatorOnyx" lazy-init="true"/>


<!-- The Handlers which are registered by the QTIMOdule at the repository -->
<bean id="QTITestHandlerOnyx" class="de.bps.ims.qti.repository.handlers.QTITestHandlerOnyx"></bean>
<bean id="QTISurveyHandlerOnyx" class="de.bps.ims.qti.repository.handlers.QTISurveyHandlerOnyx"></bean>

<bean id="SurveyValidatorOnyx" class="de.bps.ims.qti.fileresource.SurveyFileResourceValidatorOnyx" />

<bean id="TestValidatorOnyx" class="de.bps.ims.qti.fileresource.TestFileResourceValidatorOnyx" />

<!-- update job for onyx results -->
<bean id="updateQtiResultsTriggerOnyx" class="org.springframework.scheduling.quartz.CronTriggerBean">
    <property name="jobDetail" ref="updateOnyxResults.${onyx.update.results.job}" />
    <property name="cronExpression" value="0 0 2 * * ?"/><!-- 2am, daily -->
</bean>

<bean id="updateOnyxResults.enabled" class="org.springframework.scheduling.quartz.JobDetailBean">
	  <property name="jobClass" value="de.bps.jobs.UpdateOnyxResults" />
	    <property name="jobDataAsMap">
	    <map>
	      <entry key="timeout" value="18000000"/><!-- 30 minutes -->
	    </map>
	  </property>
	</bean>	
	
<bean id="updateOnyxResults.disabled" class="org.springframework.scheduling.quartz.JobDetailBean">
	<!-- NOTE: reusing the notifications.DummyJob here -->
	<property name="jobClass" value="org.olat.core.commons.scheduler.DummyJob" />
</bean>

<!-- REST API properties -->
<bean id="OnyxCustomConfigCreator" class="de.bps.onyx.plugin.restapi.config.OnyxCustomConfigCreator" lazy-init="true"/>

</beans>
