<?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="propertyConfigurer" 
		class="magoffin.matt.xweb.util.XwebParamPropertiesPlaceholderConfigurer">
		<property name="order" value="1"/>
		<property name="locations">
			<list>
				<value>classpath:/env.properties</value>
			</list>
		</property>
		<property name="settingDao" ref="parameterDaoEnvironment"/>
	</bean>
	
	<bean id="myWebApplicationInitializer" class="magoffin.matt.ieat.web.util.AppContextInitializer">
		<property name="domainObjectFactory" ref="domainObjectFactory"/>
		<property name="applicationProperties">
			<map>
				<entry key="feature.anonymous" value="${feature.anonymous}"/>
				<entry key="feature.comments" value="${feature.comments}"/>
				<entry key="feature.recipeimages" value="${feature.recipeimages}"/>
				<entry key="feature.registration" value="${feature.registration}"/>
				<entry key="recipe.image.base.url" value="${recipe.image.base.url}"/>
				<entry key="setup.adminexists" value="false"/>
				<entry key="setup.complete" value="false"/>
				<entry key="setup.requireadmin" value="${setup.requireadmin}"/>
			</map>
		</property>
		<property name="parameterDao" ref="parameterDaoEnvironment"/>
		<property name="jdbcTemplate" ref="myJdbcTemplate"/>
		<property name="sqlAdminUserCount">
			<value>select count(*) from users where accesslevel > 0</value>
		</property>
	</bean>

	<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
		<property name="mappings">
			<props>
				<prop key="/admin.do">adminHome</prop>
				<prop key="/addIngredient.do">addIngredientForm</prop>
				<prop key="/addMeal.do">addMealForm</prop>
				<prop key="/addRecipe.do">addRecipeForm</prop>
				<prop key="/addRecipeToMeal.do">addRecipeToMealForm</prop>
				<prop key="/addRecipeIngredient.do">addIngredientPopupForm</prop>
				<prop key="/addUser.do">addUserForm</prop>
				<prop key="/alterRecipe.do">alterRecipeSizeForm</prop>
				<prop key="/chooseRecipeForMeal.do">chooseRecipeForMealPopupForm</prop>
				<prop key="/confirmAccount.do">registerConfirm</prop>
				<prop key="/confirmForgotPassword.do">forgotPasswordConfirmForm</prop>
				<prop key="/convertRecipe.do">convertRecipeSystemForm</prop>
				<prop key="/deleteMeal.do">deleteMealForm</prop>
				<prop key="/deleteRecipe.do">deleteRecipeForm</prop>
				<prop key="/deleteUser.do">deleteUserForm</prop>
				<prop key="/editMeal.do">editMealForm</prop>
				<prop key="/editRecipe.do">editRecipeForm</prop>
				<prop key="/editRecipeImage.do">editRecipeImageForm</prop>
				<prop key="/editUser.do">editUserForm</prop>
				<prop key="/emailRecipe.do">emailRecipeForm</prop>
				<prop key="/exportRecipe.do">exportRecipeForm</prop>
				<prop key="/forgotPassword.do">forgotPasswordForm</prop>
				<prop key="/help.do">help</prop>
				<prop key="/home.do">home</prop>
				<prop key="/importRecipeML.do">importRecipeMLForm</prop>
				<prop key="/index.do">recipeIndex</prop>
				<prop key="/meals.do">meals</prop>
				<prop key="/mealShoppingList.do">mealShoppingListForm</prop>
				<prop key="/logoff.do">logoff</prop>
				<prop key="/logon.do">logonForm</prop>
				<prop key="/meal.do">viewMeal</prop>
				<prop key="/recipe.do">viewRecipe</prop>
				<prop key="/recipeComments.do">recipeCommentsForm</prop>
				<prop key="/recreateSearchIndex.do">recreateSearchIndex</prop>
				<prop key="/register.do">registerForm</prop>
				<prop key="/search.do">recipeSearchForm</prop>
				<prop key="/settings.do">settingsForm</prop>
				<prop key="/user.do">viewUser</prop>
				<prop key="/users.do">userIndex</prop>
				
				<!-- Setup actions -->
				
				<prop key="/setup/wizard.do">setupWizardForm</prop>
				<prop key="/setup/lists.do">listManagerForm</prop>
				
				<!-- Service actions -->
				
				<prop key="/ingredientSearch.json">ingredientSearch</prop>
				<prop key="/messages.json">urlFilenameController</prop>
				<prop key="/setRating.do">setRecipeRating</prop>
			</props>
		</property>
	</bean>
    
	<bean id="illegalActionExceptionHandler" 
		class="magoffin.matt.xweb.util.SimpleMessageExceptionResolver">
		<property name="redirectView" value="logon-redirect"/>
		<property name="order" value="0"/>
		<property name="exceptionClass" 
			value="magoffin.matt.ieat.IllegalActionException"/>
		<property name="errorMessageKey" value="error.illegalaction"/>
		<property name="defaultErrorMessage" 
			value="Illegal action, please log in."/>
		<property name="saveRequestUrl" value="true"/>
		<property name="xwebHelper" ref="webHelper"/>
	</bean>

	<bean id="recipeNotFoundExceptionHandler" 
		class="magoffin.matt.xweb.util.SimpleMessageExceptionResolver">
		<property name="redirectView" value="recipe-index-redirect"/>
		<property name="order" value="1"/>
		<property name="exceptionClass" 
			value="org.springframework.orm.ObjectRetrievalFailureException"/>
		<property name="errorMessageKey" value="error.recipe.notfound"/>
		<property name="defaultErrorMessage" 
			value="Recipe not found."/>
		<property name="saveRequestUrl" value="false"/>
		<property name="xwebHelper" ref="webHelper"/>
	</bean>

	<bean id="exceptionMapping" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
		<property name="order" value="2"/>
		<property name="exceptionMappings">
			<props>
				<prop key="magoffin.matt.ieat.ApplicationNotConfiguredException">redirect:/setup/wizard.do</prop>
			</props>
		</property>
	</bean>

	<!-- Custom XSLT view resolver
	
		This view resolver can simplify having to create individual view defintions for 
		individual XSLT views. Using the view name the resolver will look to see if 
		a web resource exists named <xsltPathPrefix><viewName><xsltPathSuffix>. If so, 
		then the AbstractXsltView bean defined by <xsltViewTemplateName> will be obtained, 
		the <stylesheetLocation> method will be set with the resolved XSLT resource, 
		and the view returned. Obviously the <xsltViewTemplateName> bean definition 
		should have the singleton="false" property set so that new instances are created
		for each view.
	-->
	<bean id="viewResolver" class="magoffin.matt.xweb.util.DefaultXsltViewResolver">
		<property name="order" value="1"/>
		<property name="xsltViewTemplateName" value="defaultXsltViewTemplate"/>
		<property name="xsltPathPrefix" value="/WEB-INF/xsl/"/>
		<property name="xsltPathSuffix" value=".xsl"/>
	</bean>
	<bean id="jaxbNamespacePrefixMapper" class="magoffin.matt.xweb.util.JAXBNamespacePrefixMapper">
		<property name="namespaceMapping">
			<map>
				<entry key="http://msqr.us/xsd/jaxb-web"><value>x</value></entry>
				<entry key="http://msqr.us/xsd/ieat"><value>eat</value></entry>
			</map>
		</property>
		<property name="predeclareUriList">
			<list>
				<value>http://msqr.us/xsd/jaxb-web</value>
				<value>http://msqr.us/xsd/ieat</value>
			</list>
		</property>
	</bean>
	<bean id="defaultXsltViewTemplate" class="magoffin.matt.xweb.util.XwebJaxbView" 
		singleton="false">
		<property name="contentType" value="text/html; charset=UTF-8"/>
		<property name="requestContextAttribute" value="magoffin.matt.xweb.REQ"/>
		<property name="cache" value="${xslt.cache}"/>
		<property name="indent" value="false"/>
		<property name="jaxbContext" value="magoffin.matt.ieat.domain"/>
		<property name="messagesSource" ref="messageSource"/>
		<property name="webHelper" ref="webHelper"/>
		<property name="debugMessageResource" value="false"/>
		<property name="transformerFactory" ref="transformerFactory"/>
		<property name="parameterDao" ref="parameterDaoEnvironment"/>
		<property name="marshallerProperties">
			<map>
				<entry key="com.sun.xml.bind.namespacePrefixMapper">
					<ref local="jaxbNamespacePrefixMapper"/>
				</entry>
			</map>
		</property>
		<property name="appSettingsCache">
			<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean"> 
				<property name="cacheManager" ref="cacheManager"/> 
				<property name="cacheName" value="magoffin.matt.ieat.app_settings_cache"/> 
			</bean>
		</property>
	</bean>

	<bean id="jsonXsltViewTemplate" parent="defaultXsltViewTemplate" singleton="false">
		<property name="contentType" value="text/javascript; charset=UTF-8"/>
	</bean>
	<!--bean id="jsonViewResolver" parent="viewResolver">
		<property name="order" value="3"/>
		<property name="xsltViewTemplateName" value="jsonXsltViewTemplate"/>
		<property name="xsltPathPrefix" value="/WEB-INF/xsl/json/"/>
		<property name="xsltPathSuffix" value=".xsl"/>
	</bean-->
	
	<!-- webHelper: utility methods for web classes -->
	<bean id="webHelper" class="magoffin.matt.xweb.util.BasicXwebHelper"/>
	
	<!-- As a backup to the default view handler, use the XmlViewResolver to handle 
		all other views -->
	<bean id="viewResolver2" class="org.springframework.web.servlet.view.XmlViewResolver">
		<property name="order" value="10"/>
	</bean>
	
	<!-- Finally, a view resolver for JSTL views. -->
	<bean id="jspViewResolver" 
		class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
		<!--property name="order"><value>3</value></property-->
		<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> 
		<property name="prefix" value="/WEB-INF/jsp/"/>
		<property name="suffix" value=".jsp"/>
	</bean> 
	
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<!-- one of the properties available; the maximum file size in bytes -->
		<property name="maxUploadSize" value="500000"/>
	</bean>
		
	<!-- Web controllers: -->
	
	<bean id="urlFilenameController" 
		class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
	
	<bean id="home" class="magoffin.matt.ieat.web.HomeController">
		<property name="successView" value="home"/>
	</bean>
	
	<!-- Bean template for RecipeCommand actions -->
	<bean id="recipeCommandParent" abstract="true">
		<property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>

	<!-- View recipe -->
    <bean id="viewRecipe" parent="recipeCommandParent" class="magoffin.matt.ieat.web.ViewRecipeController">
 		<property name="successView" value="view-recipe"/>
	</bean>
	
	<!-- View user -->
    <bean id="viewUser" class="magoffin.matt.ieat.web.ViewUserController">
    	<property name="commandClass" value="magoffin.matt.ieat.util.UserCommand"/>
		<property name="successView" value="view-user"/>
		<property name="binderTemplate"><ref local="userCommandDynamicBinder"/></property>
	</bean>

	<!-- Recipe index -->
    <bean id="recipeIndex" class="magoffin.matt.ieat.web.IndexController">
    	<property name="commandClass" value="magoffin.matt.ieat.util.IndexCriteriaImpl"/>
		<property name="successView" value="recipe-index"/>
	</bean>
	
	<!-- Logon -->
	<bean id="logonForm" class="magoffin.matt.ieat.web.LogonForm">
    	<property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
    	<property name="webHelper" ref="webHelper"/>
		<property name="validator" ref="logonValidator"/>
		<property name="formView" value="logon"/>
		<property name="successView" value="home-redirect"/>
	</bean>
	
	<!-- Logoff -->
    <bean id="logoff" class="magoffin.matt.ieat.web.LogoffController">
		<property name="successView" value="logon-redirect"/>
	</bean>
	
	<!-- Add new Ingredient -->
	<bean id="addIngredientForm" class="magoffin.matt.ieat.web.AddIngredientForm">
		<property name="pages">
			<list>
				<value>edit-ingredient_</value>
				<value>validate-ingredient_</value>
			</list>
		</property>
		<property name="validator"><ref bean="ingredientValidator"/></property>
		<property name="commandName" value="editIngredient"/>
		<property name="successView" value="home-redirect"/>
		<property name="cancelView" value="home-redirect"/>
		<property name="allowDirtyBack" value="true"/>
	</bean>
	
	<!-- Add new Ingredient popup -->
	<bean id="addIngredientPopupForm" class="magoffin.matt.ieat.web.AddIngredientForm">
		<property name="pages">
			<list>
				<value>edit-ingredient_</value>
				<value>validate-ingredient_</value>
			</list>
		</property>
		<property name="validator"><ref bean="ingredientValidator"/></property>
		<property name="commandName" value="editIngredient"/>
		<property name="successView" value="added-recipe-ingredient_"/>
		<property name="cancelView" value="cancelled-add-recipe-ingredient"/>
		<property name="allowDirtyBack" value="true"/>
	</bean>
	
	<!-- Register form -->
	<bean id="registerForm" class="magoffin.matt.ieat.web.RegisterForm">
		<property name="pages">
			<list>
				<value>registration</value>
				<value>registration-validate</value>
			</list>
		</property>
		<property name="validator"><ref bean="userValidator"/></property>
		<property name="successView" value="registration-complete"/>
		<property name="cancelView" value="home-redirect"/>
		<property name="allowDirtyBack" value="true"/>
	</bean>
	
	<!-- Register confirmation -->
	<bean id="registerConfirm" class="magoffin.matt.ieat.web.RegisterConfirmController">
    		<property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
		<property name="successView" value="registration-confirmed"/>
		<property name="errorView" value="logon"/>
	</bean>
	
	
	<!-- Dynamic binder configuration for UserCommand objects -->
 	<bean id="userCommandInitializer" class="magoffin.matt.ieat.web.util.UserCommandInitializer"/>
	<bean id="userCommandDynamicBinder" class="magoffin.matt.xweb.util.DynamicInitializerRequestDataBinder">
		<constructor-arg index="0">
			<map>
				<entry key="index">
					<ref local="userCommandInitializer"/>
				</entry>
			</map>
		</constructor-arg>
	</bean>
	

	<!-- Dynamic binder configuration for Recipe and RecipeCommand objects -->
 	<bean id="recipeCommandInitializer" class="magoffin.matt.ieat.web.util.RecipeCommandInitializer">
 		<property name="domainObjectFactory" ref="domainObjectFactory"/>
 	</bean>
	<bean id="recipeInitializer" class="magoffin.matt.ieat.web.util.RecipeInitializer">
		<property name="domainObjectFactory" ref="domainObjectFactory"/>
	</bean>
	<bean id="mealInitializer" class="magoffin.matt.ieat.web.util.MealInitializer">
		<property name="domainObjectFactory" ref="domainObjectFactory"/>
	</bean>
	<bean id="recipeDynamicBinder" class="magoffin.matt.xweb.util.DynamicInitializerRequestDataBinder">
		<constructor-arg index="0">
			<map>
				<entry key="recipe.base">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.course">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.difficulty">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.ethnicity">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.ingredient">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.prepTime">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="recipe.step">
					<ref local="recipeInitializer"/>
				</entry>
				<entry key="index">
					<ref local="recipeCommandInitializer"/>
				</entry>
				<entry key="criteria">
					<ref local="recipeCommandInitializer"/>
				</entry>
				<entry key="criteria.ingredient">
					<ref local="recipeCommandInitializer"/>
				</entry>
				<entry key="criteria.advanced">
					<ref local="recipeCommandInitializer"/>
				</entry>
				<entry key="meal.recipe">
					<ref local="mealInitializer"/>
				</entry>
			</map>
		</constructor-arg>
	</bean>

	<!-- Add new recipe -->
	<bean name="addRecipeForm"
		class="magoffin.matt.ieat.web.AddRecipeForm">
		<property name="pages">
			<list>
				<value>choose-system</value>
				<value>edit-recipe</value>
				<value>validate-recipe</value>
			</list>
		</property>
		<property name="validator"><ref bean="recipeValidator"/></property>
		<property name="successView" value="view-recipe-redirect"/>
		<property name="cancelView" value="home-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>

	<!-- Edit recipe -->
	<bean name="editRecipeForm"
		class="magoffin.matt.ieat.web.EditRecipeForm">
		<property name="pages">
			<list>
				<value>edit-recipe</value>
				<value>validate-recipe</value>
			</list>
		</property>
		<property name="validator"><ref bean="recipeValidator"/></property>
		<property name="successView" value="view-recipe-redirect"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Add new user -->
	<bean name="addUserForm"
		class="magoffin.matt.ieat.web.AddUserForm">
		<property name="pages">
			<list>
				<value>edit-user</value>
				<value>validate-user</value>
			</list>
		</property>
		<property name="validator"><ref bean="userValidator"/></property>
		<property name="successView" value="view-user-redirect"/>
		<property name="cancelView" value="admin-home-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>

	<!-- Edit user -->
	<bean name="editUserForm"
		class="magoffin.matt.ieat.web.EditUserForm">
		<property name="pages">
			<list>
				<value>edit-user</value>
				<value>validate-user</value>
			</list>
		</property>
		<property name="validator"><ref bean="userValidator"/></property>
		<property name="successView" value="view-user-redirect"/>
		<property name="cancelView" value="view-user-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Meals home -->
	<bean id="meals" class="magoffin.matt.ieat.web.MealsHomeController">
		<property name="successView" value="meals"/>
	</bean>

	<!-- Add new Meal -->
	<bean id="addMealForm" class="magoffin.matt.ieat.web.AddMealForm">
		<property name="pages">
			<list>
				<value>edit-meal</value>
				<value>validate-meal</value>
			</list>
		</property>
		<property name="validator"><ref bean="mealValidator"/></property>
		<property name="successView" value="view-meal-redirect"/>
		<property name="cancelView" value="meals-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- View meal -->
    <bean id="viewMeal" class="magoffin.matt.ieat.web.ViewMealController">
    		<property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
		<property name="successView" value="view-meal"/>
	</bean>
	
	<!-- Edit meal -->
	<bean name="editMealForm"
		class="magoffin.matt.ieat.web.EditMealForm">
		<property name="pages">
			<list>
				<value>edit-meal</value>
				<value>validate-meal</value>
			</list>
		</property>
		<property name="validator"><ref bean="mealValidator"/></property>
		<property name="successView" value="view-meal-redirect"/>
		<property name="cancelView" value="view-meal-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>

	<!-- Add Recipe to Meal -->
	<bean id="addRecipeToMealForm" class="magoffin.matt.ieat.web.AddRecipeToMealForm">
		<property name="pages">
			<list>
				<value>choose-meal-for-recipe</value>
				<value>validate-meal-for-recipe</value>
			</list>
		</property>
		<property name="validator"><ref bean="mealRecipeValidator"/></property>
		<property name="successView" value="view-meal-redirect"/>
		<property name="cancelView" value="meals-redirect"/>
		<property name="allowDirtyBack" value="true"/>
	</bean>	
	
	<!-- Meal shopping list -->
	<bean id="mealShoppingListForm" class="magoffin.matt.ieat.web.MealShoppingListForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
		<property name="formView" value="choose-meal-system"/>
		<property name="cancelView" value="view-meal-redirect"/>
		<property name="successView" value="view-shoplist"/>
		<property name="bindOnNewForm" value="true"/>
	</bean>
		
	<!-- Convert recipe system -->
	<bean id="convertRecipeSystemForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.ConvertRecipeSystemForm">
		<property name="formView" value="convert-recipe-system"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="successView" value="view-converted-recipe"/>
		<property name="bindOnNewForm" value="true"/>
	</bean>
		
	<!-- Alter recipe size -->
	<bean id="alterRecipeSizeForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.AlterRecipeSizeForm">
		<property name="validator"><ref bean="alterRecipeSizeValidator"/></property>
		<property name="formView" value="alter-recipe-size"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="successView" value="view-converted-recipe"/>
		<property name="bindOnNewForm" value="true"/>
	</bean>
		
	<!-- Delete recipe -->
	<bean id="deleteRecipeForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.DeleteRecipeForm">
		<property name="formView" value="delete-recipe-confirm"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="indexView" value="recipe-index-redirect"/>
		<property name="searchView" value="search-recipes-redirect"/>
		<property name="bindOnNewForm" value="true"/>
	</bean>
	
	<!-- Delete user -->
	<bean id="deleteUserForm" class="magoffin.matt.ieat.web.DeleteUserForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.UserCommand"/>
		<property name="formView" value="delete-user-confirm"/>
		<property name="cancelView" value="view-user-redirect"/>
		<property name="successView" value="user-index-redirect"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Administration Home -->
    <bean id="adminHome" class="magoffin.matt.ieat.web.AdminController">
		<property name="successView" value="admin-home"/>
	</bean>
	
	<!-- User index -->
    <bean id="userIndex" class="magoffin.matt.ieat.web.UserIndexController">
    		<property name="commandClass" value="magoffin.matt.ieat.util.IndexCriteriaImpl"/>
		<property name="successView" value="user-index"/>
	</bean>
	
	<!-- Add Recipe to Meal popup -->
	<bean id="chooseRecipeForMealPopupForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.SearchForRecipesForm">
		<property name="bindOnNewForm" value="true"/>
		<property name="commandName" value="findRecipe"/>
		<property name="formView" value="add-recipe-to-meal_"/>
		<property name="successView" value="add-recipe-to-meal_"/>
		<property name="cancelView" value="cancelled-add-recipe-to-meal"/>
		<property name="validator"><ref bean="recipeSearchValidator"/></property>
	</bean>
	
	<!-- Delete meal -->
	<bean id="deleteMealForm" class="magoffin.matt.ieat.web.DeleteMealForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
		<property name="formView" value="delete-meal-confirm"/>
		<property name="cancelView" value="view-meal-redirect"/>
		<property name="successView" value="meals-redirect"/>
		<property name="bindOnNewForm" value="true"/>
	</bean>

	<!-- Recreate search index -->
	<bean id="recreateSearchIndex" class="magoffin.matt.ieat.web.RecreateSearchIndexController">
		<property name="successView" value="admin-home-redirect"/>
	</bean>
	
	<!-- Simple search for recipes -->
	<bean id="recipeSearchForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.SearchForRecipesForm">
		<property name="bindOnNewForm" value="true"/>
		<property name="sessionForm" value="true"/>
		<property name="formView" value="search-recipes"/>
		<property name="successView" value="search-recipes"/>
		<property name="cancelView" value="home-redirect"/>
	</bean>

	<!-- Service for ingredient search -->
	<bean id="ingredientSearch" class="magoffin.matt.ieat.web.SearchForIngredientsController">
		<property name="commandClass" value="magoffin.matt.ieat.web.SearchForIngredientsController$Command"/>
		<property name="successView" value="json"/>
	</bean>

	<!-- XML service to set the recipe rating -->
	<bean id="setRecipeRating" parent="recipeCommandParent" class="magoffin.matt.ieat.web.service.SetRecipeRating">
		<property name="successView" value="xml-service-response"/>
	</bean>
	
	<!-- "forgot my password" form -->
	<bean id="forgotPasswordForm" class="magoffin.matt.ieat.web.ForgotPasswordForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
		<property name="validator"><ref bean="logonValidator"/></property>
		<property name="formView" value="forgot-password"/>
		<property name="successView" value="forgot-password-complete"/>
	</bean>

	<!-- "forgot my password" confirm form -->
	<bean id="forgotPasswordConfirmForm" class="magoffin.matt.ieat.web.ForgotPasswordConfirmForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="sessionForm" value="true"/>
		<property name="validator"><ref bean="logonValidator"/></property>
		<property name="formView" value="change-password"/>
		<property name="successView" value="home-redirect"/>
	</bean>
	
	<!-- Import RecipeML recipe -->
	<bean id="importRecipeMLForm" class="magoffin.matt.ieat.web.ImportRecipeMLForm">
		<property name="commandClass" value="magoffin.matt.ieat.util.ImportRecipeCommand"/>
		<property name="pages">
			<list>
				<value>import-recipeml</value>
				<value>import-recipe-ingredients</value>
				<value>import-recipe-ingredients-validate</value>
			</list>
		</property>
		<property name="validator"><ref bean="recipeMLImportValidator"/></property>
		<property name="successView" value="view-recipe-redirect"/>
		<property name="cancelView" value="home-redirect"/>
		<property name="allowDirtyBack" value="false"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Export recipe -->
	<bean id="exportRecipeForm" class="magoffin.matt.ieat.web.ExportRecipeForm">
		<property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="formView" value="export-recipe"/>
		<property name="successView" value="export-recipe"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="rioBiz"><ref bean="recipeIOBiz"/></property>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Settings form -->
	<bean id="settingsForm" class="magoffin.matt.ieat.web.SettingsForm">
		<property name="pages">
			<list>
				<value>settings-form</value>
				<value>settings-validate</value>
			</list>
		</property>
		<property name="validator"><ref bean="userValidator"/></property>
		<property name="successView" value="home-redirect"/>
		<property name="cancelView" value="home-redirect"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>

	<!-- Email recipe form -->
	<bean id="emailRecipeForm" class="magoffin.matt.ieat.web.EmailRecipeForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.EmailRecipeCommand"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="validator"><ref bean="emailRecipeValidator"/></property>
		<property name="formView" value="email-recipe-form"/>
		<property name="successView" value="view-recipe-redirect"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
		<property name="recipeIOBiz"><ref bean="recipeIOBiz"/></property>
	</bean>

	<!-- Recipe comments form -->
	<bean id="recipeCommentsForm" class="magoffin.matt.ieat.web.RecipeCommentsForm">
    		<property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="validator"><ref bean="recipeCommentsValidator"/></property>
		<property name="formView" value="recipe-comments"/>
		<property name="successView" value="recipe-comments-redirect"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
	</bean>
	
	<!-- Popup help support -->
	<bean id="help" class="magoffin.matt.ieat.web.HelpController">
		<property name="successView" value="help"/>
	</bean>
	
	<!-- Edit recipe image form -->
	<bean id="editRecipeImageForm" class="magoffin.matt.ieat.web.EditRecipeImageForm">
		<property name="commandClass" value="magoffin.matt.ieat.web.EditRecipeImageForm$RecipeImageCommand"/>
		<property name="bindOnNewForm" value="true"/>
		<property name="binderTemplate" ref="recipeDynamicBinder"/>
		<property name="validator">
			<bean class="magoffin.matt.ieat.web.EditRecipeImageForm$RecipeImageCommandValidator"/>
		</property>
		<property name="formView" value="edit-recipe-image"/>
		<property name="cancelView" value="view-recipe-redirect"/>
		<property name="successView" value="view-recipe-redirect"/>
	</bean>
	
	<!-- Setup wizard form -->
	<bean name="setupWizardForm" class="magoffin.matt.ieat.web.setup.SetupWizard">
		<property name="commandClass">
			<value>magoffin.matt.ieat.web.setup.SetupWizard$SetupCommand</value>
		</property>
		<property name="pages">
			<list>
				<value>setup-welcome</value>
				<value>setup-features</value>
				<value>setup-db</value>
				<value>setup-filesystem</value>
				<value>setup-other</value>
				<value>setup-admin</value>
				<value>setup-confirm</value>
			</list>
		</property>
		<property name="validator">
			<bean class="magoffin.matt.ieat.web.setup.SetupWizard$SetupCommandValidator">
				<property name="fileSystemPage" value="3"/>
			</bean>
		</property>
		<property name="successView" value="setup-complete"/>
		<property name="allowDirtyBack" value="true"/>
		<property name="parameterDao" ref="parameterDaoEnvironment"/>
		<property name="userBiz" ref="userBiz"/>
		<property name="requireAdmin" value="${setup.requireadmin}"/>
		<property name="adminUserPage" value="5"/>
		<property name="originalHibernateDialect" value="${hibernate.dialect}"/>
		<property name="domainObjectFactory" ref="domainObjectFactory"/>
		<property name="defaultSettings">
			<map>
				<entry key="hibernate.dialect" value="${hibernate.dialect}"/>
				<entry key="lucene.index.base.path" value="${lucene.index.base.path}"/>
				<entry key="mail.from" value="${mail.from}"/>
				<entry key="crypto.key" value="${crypto.key}"/>
				<entry key="crypto.salt" value="${crypto.salt}"/>
				<entry key="crypto.pbe.salt" value="${crypto.pbe.salt}"/>
				<entry key="xslt.cache" value="${xslt.cache}"/>
				<entry key="recipe.image.base.path" value="${recipe.image.base.path}"/>
			</map>
		</property>
	</bean>

	<!-- ListManager -->
	<bean name="listManagerForm" class="magoffin.matt.ieat.web.setup.ListManagerForm">
		<property name="commandClass">
			<value>magoffin.matt.ieat.web.setup.ListManagerForm$ListCommand</value>
		</property>
		<property name="bindOnNewForm" value="true"/>
		<property name="formView">
			<value>lists-form</value>
		</property>
		<property name="successView">
			<value>lists-form</value>
		</property>
		<property name="domainObjectFactory">
			<ref bean="domainObjectFactory"/>
		</property>
		<property name="recipeDao">
			<ref bean="recipeDao"/>
		</property>
		<property name="baseDao">
			<ref bean="baseDao"/>
		</property>
		<property name="courseDao">
			<ref bean="courseDao"/>
		</property>
		<property name="difficultyDao">
			<ref bean="difficultyDao"/>
		</property>
		<property name="ethnicityDao">
			<ref bean="ethnicityDao"/>
		</property>
		<property name="ingredientDao">
			<ref bean="ingredientDao"/>
		</property>
		<property name="prepTimeDao">
			<ref bean="prepTimeDao"/>
		</property>
		<property name="parameterDao" ref="parameterDaoEnvironment"/>
		<property name="userBiz">
			<ref bean="userBiz"/>
		</property>
		<property name="meta">
			<map>
				<entry key="magoffin.matt.ieat.domain.impl.BaseImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="baseId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="value"/>
									<property name="displayName" value="Value"/>
									<property name="type" value="1"/>
									<property name="length" value="64"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
				<entry key="magoffin.matt.ieat.domain.impl.CourseImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="courseId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="value"/>
									<property name="displayName" value="Value"/>
									<property name="type" value="1"/>
									<property name="length" value="64"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
				<entry key="magoffin.matt.ieat.domain.impl.DifficultyImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="difficultyId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="value"/>
									<property name="displayName" value="Value"/>
									<property name="type" value="1"/>
									<property name="length" value="64"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
				<entry key="magoffin.matt.ieat.domain.impl.EthnicityImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="ethnicityId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="value"/>
									<property name="displayName" value="Value"/>
									<property name="type" value="1"/>
									<property name="length" value="64"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
				<entry key="magoffin.matt.ieat.domain.impl.IngredientImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="ingredientId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="name"/>
									<property name="displayName" value="Name"/>
									<property name="type" value="1"/>
									<property name="length" value="128"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="description"/>
									<property name="displayName" value="Description"/>
									<property name="type" value="1"/>
									<property name="length" value="512"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
				<entry key="magoffin.matt.ieat.domain.impl.PrepTimeImpl">
					<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
						<property name="properties">
							<list>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="prepTimeId"/>
									<property name="displayName" value="ID"/>
									<property name="type" value="2"/>
									<property name="primaryKey" value="true"/>
								</bean>
								<bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
									<property name="name" value="value"/>
									<property name="displayName" value="Value"/>
									<property name="type" value="1"/>
									<property name="length" value="64"/>
								</bean>
							</list>
						</property>
					</bean>
				</entry>
			</map>
		</property>
	</bean>	
	
</beans>

