ieat-servlet.xml 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC
  3. "-//SPRING//DTD BEAN//EN"
  4. "http://www.springframework.org/dtd/spring-beans.dtd">
  5. <beans>
  6. <bean id="propertyConfigurer"
  7. class="magoffin.matt.xweb.util.XwebParamPropertiesPlaceholderConfigurer">
  8. <property name="order" value="1"/>
  9. <property name="locations">
  10. <list>
  11. <value>classpath:/env.properties</value>
  12. </list>
  13. </property>
  14. <property name="settingDao" ref="parameterDaoEnvironment"/>
  15. </bean>
  16. <bean id="myWebApplicationInitializer" class="magoffin.matt.ieat.web.util.AppContextInitializer">
  17. <property name="domainObjectFactory" ref="domainObjectFactory"/>
  18. <property name="applicationProperties">
  19. <map>
  20. <entry key="feature.anonymous" value="${feature.anonymous}"/>
  21. <entry key="feature.comments" value="${feature.comments}"/>
  22. <entry key="feature.recipeimages" value="${feature.recipeimages}"/>
  23. <entry key="feature.registration" value="${feature.registration}"/>
  24. <entry key="recipe.image.base.url" value="${recipe.image.base.url}"/>
  25. <entry key="setup.adminexists" value="false"/>
  26. <entry key="setup.complete" value="false"/>
  27. <entry key="setup.requireadmin" value="${setup.requireadmin}"/>
  28. </map>
  29. </property>
  30. <property name="parameterDao" ref="parameterDaoEnvironment"/>
  31. <property name="jdbcTemplate" ref="myJdbcTemplate"/>
  32. <property name="sqlAdminUserCount">
  33. <value>select count(*) from users where accesslevel > 0</value>
  34. </property>
  35. </bean>
  36. <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  37. <property name="mappings">
  38. <props>
  39. <prop key="/admin.do">adminHome</prop>
  40. <prop key="/addIngredient.do">addIngredientForm</prop>
  41. <prop key="/addMeal.do">addMealForm</prop>
  42. <prop key="/addRecipe.do">addRecipeForm</prop>
  43. <prop key="/addRecipeToMeal.do">addRecipeToMealForm</prop>
  44. <prop key="/addRecipeIngredient.do">addIngredientPopupForm</prop>
  45. <prop key="/addUser.do">addUserForm</prop>
  46. <prop key="/alterRecipe.do">alterRecipeSizeForm</prop>
  47. <prop key="/chooseRecipeForMeal.do">chooseRecipeForMealPopupForm</prop>
  48. <prop key="/confirmAccount.do">registerConfirm</prop>
  49. <prop key="/confirmForgotPassword.do">forgotPasswordConfirmForm</prop>
  50. <prop key="/convertRecipe.do">convertRecipeSystemForm</prop>
  51. <prop key="/deleteMeal.do">deleteMealForm</prop>
  52. <prop key="/deleteRecipe.do">deleteRecipeForm</prop>
  53. <prop key="/deleteUser.do">deleteUserForm</prop>
  54. <prop key="/editMeal.do">editMealForm</prop>
  55. <prop key="/editRecipe.do">editRecipeForm</prop>
  56. <prop key="/editRecipeImage.do">editRecipeImageForm</prop>
  57. <prop key="/editUser.do">editUserForm</prop>
  58. <prop key="/emailRecipe.do">emailRecipeForm</prop>
  59. <prop key="/exportRecipe.do">exportRecipeForm</prop>
  60. <prop key="/forgotPassword.do">forgotPasswordForm</prop>
  61. <prop key="/help.do">help</prop>
  62. <prop key="/home.do">home</prop>
  63. <prop key="/importRecipeML.do">importRecipeMLForm</prop>
  64. <prop key="/index.do">recipeIndex</prop>
  65. <prop key="/meals.do">meals</prop>
  66. <prop key="/mealShoppingList.do">mealShoppingListForm</prop>
  67. <prop key="/logoff.do">logoff</prop>
  68. <prop key="/logon.do">logonForm</prop>
  69. <prop key="/meal.do">viewMeal</prop>
  70. <prop key="/recipe.do">viewRecipe</prop>
  71. <prop key="/recipeComments.do">recipeCommentsForm</prop>
  72. <prop key="/recreateSearchIndex.do">recreateSearchIndex</prop>
  73. <prop key="/register.do">registerForm</prop>
  74. <prop key="/search.do">recipeSearchForm</prop>
  75. <prop key="/settings.do">settingsForm</prop>
  76. <prop key="/user.do">viewUser</prop>
  77. <prop key="/users.do">userIndex</prop>
  78. <!-- Setup actions -->
  79. <prop key="/setup/wizard.do">setupWizardForm</prop>
  80. <prop key="/setup/lists.do">listManagerForm</prop>
  81. <!-- Service actions -->
  82. <prop key="/ingredientSearch.json">ingredientSearch</prop>
  83. <prop key="/messages.json">urlFilenameController</prop>
  84. <prop key="/setRating.do">setRecipeRating</prop>
  85. </props>
  86. </property>
  87. </bean>
  88. <bean id="illegalActionExceptionHandler"
  89. class="magoffin.matt.xweb.util.SimpleMessageExceptionResolver">
  90. <property name="redirectView" value="logon-redirect"/>
  91. <property name="order" value="0"/>
  92. <property name="exceptionClass"
  93. value="magoffin.matt.ieat.IllegalActionException"/>
  94. <property name="errorMessageKey" value="error.illegalaction"/>
  95. <property name="defaultErrorMessage"
  96. value="Illegal action, please log in."/>
  97. <property name="saveRequestUrl" value="true"/>
  98. <property name="xwebHelper" ref="webHelper"/>
  99. </bean>
  100. <bean id="recipeNotFoundExceptionHandler"
  101. class="magoffin.matt.xweb.util.SimpleMessageExceptionResolver">
  102. <property name="redirectView" value="recipe-index-redirect"/>
  103. <property name="order" value="1"/>
  104. <property name="exceptionClass"
  105. value="org.springframework.orm.ObjectRetrievalFailureException"/>
  106. <property name="errorMessageKey" value="error.recipe.notfound"/>
  107. <property name="defaultErrorMessage"
  108. value="Recipe not found."/>
  109. <property name="saveRequestUrl" value="false"/>
  110. <property name="xwebHelper" ref="webHelper"/>
  111. </bean>
  112. <bean id="exceptionMapping" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
  113. <property name="order" value="2"/>
  114. <property name="exceptionMappings">
  115. <props>
  116. <prop key="magoffin.matt.ieat.ApplicationNotConfiguredException">redirect:/setup/wizard.do</prop>
  117. </props>
  118. </property>
  119. </bean>
  120. <!-- Custom XSLT view resolver
  121. This view resolver can simplify having to create individual view defintions for
  122. individual XSLT views. Using the view name the resolver will look to see if
  123. a web resource exists named <xsltPathPrefix><viewName><xsltPathSuffix>. If so,
  124. then the AbstractXsltView bean defined by <xsltViewTemplateName> will be obtained,
  125. the <stylesheetLocation> method will be set with the resolved XSLT resource,
  126. and the view returned. Obviously the <xsltViewTemplateName> bean definition
  127. should have the singleton="false" property set so that new instances are created
  128. for each view.
  129. -->
  130. <bean id="viewResolver" class="magoffin.matt.xweb.util.DefaultXsltViewResolver">
  131. <property name="order" value="1"/>
  132. <property name="xsltViewTemplateName" value="defaultXsltViewTemplate"/>
  133. <property name="xsltPathPrefix" value="/WEB-INF/xsl/"/>
  134. <property name="xsltPathSuffix" value=".xsl"/>
  135. </bean>
  136. <bean id="jaxbNamespacePrefixMapper" class="magoffin.matt.xweb.util.JAXBNamespacePrefixMapper">
  137. <property name="namespaceMapping">
  138. <map>
  139. <entry key="http://msqr.us/xsd/jaxb-web"><value>x</value></entry>
  140. <entry key="http://msqr.us/xsd/ieat"><value>eat</value></entry>
  141. </map>
  142. </property>
  143. <property name="predeclareUriList">
  144. <list>
  145. <value>http://msqr.us/xsd/jaxb-web</value>
  146. <value>http://msqr.us/xsd/ieat</value>
  147. </list>
  148. </property>
  149. </bean>
  150. <bean id="defaultXsltViewTemplate" class="magoffin.matt.xweb.util.XwebJaxbView"
  151. singleton="false">
  152. <property name="contentType" value="text/html; charset=UTF-8"/>
  153. <property name="requestContextAttribute" value="magoffin.matt.xweb.REQ"/>
  154. <property name="cache" value="${xslt.cache}"/>
  155. <property name="indent" value="false"/>
  156. <property name="jaxbContext" value="magoffin.matt.ieat.domain"/>
  157. <property name="messagesSource" ref="messageSource"/>
  158. <property name="webHelper" ref="webHelper"/>
  159. <property name="debugMessageResource" value="false"/>
  160. <property name="transformerFactory" ref="transformerFactory"/>
  161. <property name="parameterDao" ref="parameterDaoEnvironment"/>
  162. <property name="marshallerProperties">
  163. <map>
  164. <entry key="com.sun.xml.bind.namespacePrefixMapper">
  165. <ref local="jaxbNamespacePrefixMapper"/>
  166. </entry>
  167. </map>
  168. </property>
  169. <property name="appSettingsCache">
  170. <bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">
  171. <property name="cacheManager" ref="cacheManager"/>
  172. <property name="cacheName" value="magoffin.matt.ieat.app_settings_cache"/>
  173. </bean>
  174. </property>
  175. </bean>
  176. <bean id="jsonXsltViewTemplate" parent="defaultXsltViewTemplate" singleton="false">
  177. <property name="contentType" value="text/javascript; charset=UTF-8"/>
  178. </bean>
  179. <!--bean id="jsonViewResolver" parent="viewResolver">
  180. <property name="order" value="3"/>
  181. <property name="xsltViewTemplateName" value="jsonXsltViewTemplate"/>
  182. <property name="xsltPathPrefix" value="/WEB-INF/xsl/json/"/>
  183. <property name="xsltPathSuffix" value=".xsl"/>
  184. </bean-->
  185. <!-- webHelper: utility methods for web classes -->
  186. <bean id="webHelper" class="magoffin.matt.xweb.util.BasicXwebHelper"/>
  187. <!-- As a backup to the default view handler, use the XmlViewResolver to handle
  188. all other views -->
  189. <bean id="viewResolver2" class="org.springframework.web.servlet.view.XmlViewResolver">
  190. <property name="order" value="10"/>
  191. </bean>
  192. <!-- Finally, a view resolver for JSTL views. -->
  193. <bean id="jspViewResolver"
  194. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  195. <!--property name="order"><value>3</value></property-->
  196. <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
  197. <property name="prefix" value="/WEB-INF/jsp/"/>
  198. <property name="suffix" value=".jsp"/>
  199. </bean>
  200. <bean id="multipartResolver"
  201. class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
  202. <!-- one of the properties available; the maximum file size in bytes -->
  203. <property name="maxUploadSize" value="500000"/>
  204. </bean>
  205. <!-- Web controllers: -->
  206. <bean id="urlFilenameController"
  207. class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
  208. <bean id="home" class="magoffin.matt.ieat.web.HomeController">
  209. <property name="successView" value="home"/>
  210. </bean>
  211. <!-- Bean template for RecipeCommand actions -->
  212. <bean id="recipeCommandParent" abstract="true">
  213. <property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
  214. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  215. </bean>
  216. <!-- View recipe -->
  217. <bean id="viewRecipe" parent="recipeCommandParent" class="magoffin.matt.ieat.web.ViewRecipeController">
  218. <property name="successView" value="view-recipe"/>
  219. </bean>
  220. <!-- View user -->
  221. <bean id="viewUser" class="magoffin.matt.ieat.web.ViewUserController">
  222. <property name="commandClass" value="magoffin.matt.ieat.util.UserCommand"/>
  223. <property name="successView" value="view-user"/>
  224. <property name="binderTemplate"><ref local="userCommandDynamicBinder"/></property>
  225. </bean>
  226. <!-- Recipe index -->
  227. <bean id="recipeIndex" class="magoffin.matt.ieat.web.IndexController">
  228. <property name="commandClass" value="magoffin.matt.ieat.util.IndexCriteriaImpl"/>
  229. <property name="successView" value="recipe-index"/>
  230. </bean>
  231. <!-- Logon -->
  232. <bean id="logonForm" class="magoffin.matt.ieat.web.LogonForm">
  233. <property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
  234. <property name="webHelper" ref="webHelper"/>
  235. <property name="validator" ref="logonValidator"/>
  236. <property name="formView" value="logon"/>
  237. <property name="successView" value="home-redirect"/>
  238. </bean>
  239. <!-- Logoff -->
  240. <bean id="logoff" class="magoffin.matt.ieat.web.LogoffController">
  241. <property name="successView" value="logon-redirect"/>
  242. </bean>
  243. <!-- Add new Ingredient -->
  244. <bean id="addIngredientForm" class="magoffin.matt.ieat.web.AddIngredientForm">
  245. <property name="pages">
  246. <list>
  247. <value>edit-ingredient_</value>
  248. <value>validate-ingredient_</value>
  249. </list>
  250. </property>
  251. <property name="validator"><ref bean="ingredientValidator"/></property>
  252. <property name="commandName" value="editIngredient"/>
  253. <property name="successView" value="home-redirect"/>
  254. <property name="cancelView" value="home-redirect"/>
  255. <property name="allowDirtyBack" value="true"/>
  256. </bean>
  257. <!-- Add new Ingredient popup -->
  258. <bean id="addIngredientPopupForm" class="magoffin.matt.ieat.web.AddIngredientForm">
  259. <property name="pages">
  260. <list>
  261. <value>edit-ingredient_</value>
  262. <value>validate-ingredient_</value>
  263. </list>
  264. </property>
  265. <property name="validator"><ref bean="ingredientValidator"/></property>
  266. <property name="commandName" value="editIngredient"/>
  267. <property name="successView" value="added-recipe-ingredient_"/>
  268. <property name="cancelView" value="cancelled-add-recipe-ingredient"/>
  269. <property name="allowDirtyBack" value="true"/>
  270. </bean>
  271. <!-- Register form -->
  272. <bean id="registerForm" class="magoffin.matt.ieat.web.RegisterForm">
  273. <property name="pages">
  274. <list>
  275. <value>registration</value>
  276. <value>registration-validate</value>
  277. </list>
  278. </property>
  279. <property name="validator"><ref bean="userValidator"/></property>
  280. <property name="successView" value="registration-complete"/>
  281. <property name="cancelView" value="home-redirect"/>
  282. <property name="allowDirtyBack" value="true"/>
  283. </bean>
  284. <!-- Register confirmation -->
  285. <bean id="registerConfirm" class="magoffin.matt.ieat.web.RegisterConfirmController">
  286. <property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
  287. <property name="successView" value="registration-confirmed"/>
  288. <property name="errorView" value="logon"/>
  289. </bean>
  290. <!-- Dynamic binder configuration for UserCommand objects -->
  291. <bean id="userCommandInitializer" class="magoffin.matt.ieat.web.util.UserCommandInitializer"/>
  292. <bean id="userCommandDynamicBinder" class="magoffin.matt.xweb.util.DynamicInitializerRequestDataBinder">
  293. <constructor-arg index="0">
  294. <map>
  295. <entry key="index">
  296. <ref local="userCommandInitializer"/>
  297. </entry>
  298. </map>
  299. </constructor-arg>
  300. </bean>
  301. <!-- Dynamic binder configuration for Recipe and RecipeCommand objects -->
  302. <bean id="recipeCommandInitializer" class="magoffin.matt.ieat.web.util.RecipeCommandInitializer">
  303. <property name="domainObjectFactory" ref="domainObjectFactory"/>
  304. </bean>
  305. <bean id="recipeInitializer" class="magoffin.matt.ieat.web.util.RecipeInitializer">
  306. <property name="domainObjectFactory" ref="domainObjectFactory"/>
  307. </bean>
  308. <bean id="mealInitializer" class="magoffin.matt.ieat.web.util.MealInitializer">
  309. <property name="domainObjectFactory" ref="domainObjectFactory"/>
  310. </bean>
  311. <bean id="recipeDynamicBinder" class="magoffin.matt.xweb.util.DynamicInitializerRequestDataBinder">
  312. <constructor-arg index="0">
  313. <map>
  314. <entry key="recipe.base">
  315. <ref local="recipeInitializer"/>
  316. </entry>
  317. <entry key="recipe.course">
  318. <ref local="recipeInitializer"/>
  319. </entry>
  320. <entry key="recipe.difficulty">
  321. <ref local="recipeInitializer"/>
  322. </entry>
  323. <entry key="recipe.ethnicity">
  324. <ref local="recipeInitializer"/>
  325. </entry>
  326. <entry key="recipe.ingredient">
  327. <ref local="recipeInitializer"/>
  328. </entry>
  329. <entry key="recipe.prepTime">
  330. <ref local="recipeInitializer"/>
  331. </entry>
  332. <entry key="recipe.step">
  333. <ref local="recipeInitializer"/>
  334. </entry>
  335. <entry key="index">
  336. <ref local="recipeCommandInitializer"/>
  337. </entry>
  338. <entry key="criteria">
  339. <ref local="recipeCommandInitializer"/>
  340. </entry>
  341. <entry key="criteria.ingredient">
  342. <ref local="recipeCommandInitializer"/>
  343. </entry>
  344. <entry key="criteria.advanced">
  345. <ref local="recipeCommandInitializer"/>
  346. </entry>
  347. <entry key="meal.recipe">
  348. <ref local="mealInitializer"/>
  349. </entry>
  350. </map>
  351. </constructor-arg>
  352. </bean>
  353. <!-- Add new recipe -->
  354. <bean name="addRecipeForm"
  355. class="magoffin.matt.ieat.web.AddRecipeForm">
  356. <property name="pages">
  357. <list>
  358. <value>choose-system</value>
  359. <value>edit-recipe</value>
  360. <value>validate-recipe</value>
  361. </list>
  362. </property>
  363. <property name="validator"><ref bean="recipeValidator"/></property>
  364. <property name="successView" value="view-recipe-redirect"/>
  365. <property name="cancelView" value="home-redirect"/>
  366. <property name="allowDirtyBack" value="true"/>
  367. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  368. </bean>
  369. <!-- Edit recipe -->
  370. <bean name="editRecipeForm"
  371. class="magoffin.matt.ieat.web.EditRecipeForm">
  372. <property name="pages">
  373. <list>
  374. <value>edit-recipe</value>
  375. <value>validate-recipe</value>
  376. </list>
  377. </property>
  378. <property name="validator"><ref bean="recipeValidator"/></property>
  379. <property name="successView" value="view-recipe-redirect"/>
  380. <property name="cancelView" value="view-recipe-redirect"/>
  381. <property name="allowDirtyBack" value="true"/>
  382. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  383. </bean>
  384. <!-- Add new user -->
  385. <bean name="addUserForm"
  386. class="magoffin.matt.ieat.web.AddUserForm">
  387. <property name="pages">
  388. <list>
  389. <value>edit-user</value>
  390. <value>validate-user</value>
  391. </list>
  392. </property>
  393. <property name="validator"><ref bean="userValidator"/></property>
  394. <property name="successView" value="view-user-redirect"/>
  395. <property name="cancelView" value="admin-home-redirect"/>
  396. <property name="allowDirtyBack" value="true"/>
  397. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  398. </bean>
  399. <!-- Edit user -->
  400. <bean name="editUserForm"
  401. class="magoffin.matt.ieat.web.EditUserForm">
  402. <property name="pages">
  403. <list>
  404. <value>edit-user</value>
  405. <value>validate-user</value>
  406. </list>
  407. </property>
  408. <property name="validator"><ref bean="userValidator"/></property>
  409. <property name="successView" value="view-user-redirect"/>
  410. <property name="cancelView" value="view-user-redirect"/>
  411. <property name="allowDirtyBack" value="true"/>
  412. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  413. </bean>
  414. <!-- Meals home -->
  415. <bean id="meals" class="magoffin.matt.ieat.web.MealsHomeController">
  416. <property name="successView" value="meals"/>
  417. </bean>
  418. <!-- Add new Meal -->
  419. <bean id="addMealForm" class="magoffin.matt.ieat.web.AddMealForm">
  420. <property name="pages">
  421. <list>
  422. <value>edit-meal</value>
  423. <value>validate-meal</value>
  424. </list>
  425. </property>
  426. <property name="validator"><ref bean="mealValidator"/></property>
  427. <property name="successView" value="view-meal-redirect"/>
  428. <property name="cancelView" value="meals-redirect"/>
  429. <property name="allowDirtyBack" value="true"/>
  430. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  431. </bean>
  432. <!-- View meal -->
  433. <bean id="viewMeal" class="magoffin.matt.ieat.web.ViewMealController">
  434. <property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
  435. <property name="successView" value="view-meal"/>
  436. </bean>
  437. <!-- Edit meal -->
  438. <bean name="editMealForm"
  439. class="magoffin.matt.ieat.web.EditMealForm">
  440. <property name="pages">
  441. <list>
  442. <value>edit-meal</value>
  443. <value>validate-meal</value>
  444. </list>
  445. </property>
  446. <property name="validator"><ref bean="mealValidator"/></property>
  447. <property name="successView" value="view-meal-redirect"/>
  448. <property name="cancelView" value="view-meal-redirect"/>
  449. <property name="allowDirtyBack" value="true"/>
  450. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  451. </bean>
  452. <!-- Add Recipe to Meal -->
  453. <bean id="addRecipeToMealForm" class="magoffin.matt.ieat.web.AddRecipeToMealForm">
  454. <property name="pages">
  455. <list>
  456. <value>choose-meal-for-recipe</value>
  457. <value>validate-meal-for-recipe</value>
  458. </list>
  459. </property>
  460. <property name="validator"><ref bean="mealRecipeValidator"/></property>
  461. <property name="successView" value="view-meal-redirect"/>
  462. <property name="cancelView" value="meals-redirect"/>
  463. <property name="allowDirtyBack" value="true"/>
  464. </bean>
  465. <!-- Meal shopping list -->
  466. <bean id="mealShoppingListForm" class="magoffin.matt.ieat.web.MealShoppingListForm">
  467. <property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
  468. <property name="formView" value="choose-meal-system"/>
  469. <property name="cancelView" value="view-meal-redirect"/>
  470. <property name="successView" value="view-shoplist"/>
  471. <property name="bindOnNewForm" value="true"/>
  472. </bean>
  473. <!-- Convert recipe system -->
  474. <bean id="convertRecipeSystemForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.ConvertRecipeSystemForm">
  475. <property name="formView" value="convert-recipe-system"/>
  476. <property name="cancelView" value="view-recipe-redirect"/>
  477. <property name="successView" value="view-converted-recipe"/>
  478. <property name="bindOnNewForm" value="true"/>
  479. </bean>
  480. <!-- Alter recipe size -->
  481. <bean id="alterRecipeSizeForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.AlterRecipeSizeForm">
  482. <property name="validator"><ref bean="alterRecipeSizeValidator"/></property>
  483. <property name="formView" value="alter-recipe-size"/>
  484. <property name="cancelView" value="view-recipe-redirect"/>
  485. <property name="successView" value="view-converted-recipe"/>
  486. <property name="bindOnNewForm" value="true"/>
  487. </bean>
  488. <!-- Delete recipe -->
  489. <bean id="deleteRecipeForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.DeleteRecipeForm">
  490. <property name="formView" value="delete-recipe-confirm"/>
  491. <property name="cancelView" value="view-recipe-redirect"/>
  492. <property name="indexView" value="recipe-index-redirect"/>
  493. <property name="searchView" value="search-recipes-redirect"/>
  494. <property name="bindOnNewForm" value="true"/>
  495. </bean>
  496. <!-- Delete user -->
  497. <bean id="deleteUserForm" class="magoffin.matt.ieat.web.DeleteUserForm">
  498. <property name="commandClass" value="magoffin.matt.ieat.util.UserCommand"/>
  499. <property name="formView" value="delete-user-confirm"/>
  500. <property name="cancelView" value="view-user-redirect"/>
  501. <property name="successView" value="user-index-redirect"/>
  502. <property name="bindOnNewForm" value="true"/>
  503. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  504. </bean>
  505. <!-- Administration Home -->
  506. <bean id="adminHome" class="magoffin.matt.ieat.web.AdminController">
  507. <property name="successView" value="admin-home"/>
  508. </bean>
  509. <!-- User index -->
  510. <bean id="userIndex" class="magoffin.matt.ieat.web.UserIndexController">
  511. <property name="commandClass" value="magoffin.matt.ieat.util.IndexCriteriaImpl"/>
  512. <property name="successView" value="user-index"/>
  513. </bean>
  514. <!-- Add Recipe to Meal popup -->
  515. <bean id="chooseRecipeForMealPopupForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.SearchForRecipesForm">
  516. <property name="bindOnNewForm" value="true"/>
  517. <property name="commandName" value="findRecipe"/>
  518. <property name="formView" value="add-recipe-to-meal_"/>
  519. <property name="successView" value="add-recipe-to-meal_"/>
  520. <property name="cancelView" value="cancelled-add-recipe-to-meal"/>
  521. <property name="validator"><ref bean="recipeSearchValidator"/></property>
  522. </bean>
  523. <!-- Delete meal -->
  524. <bean id="deleteMealForm" class="magoffin.matt.ieat.web.DeleteMealForm">
  525. <property name="commandClass" value="magoffin.matt.ieat.util.MealCommand"/>
  526. <property name="formView" value="delete-meal-confirm"/>
  527. <property name="cancelView" value="view-meal-redirect"/>
  528. <property name="successView" value="meals-redirect"/>
  529. <property name="bindOnNewForm" value="true"/>
  530. </bean>
  531. <!-- Recreate search index -->
  532. <bean id="recreateSearchIndex" class="magoffin.matt.ieat.web.RecreateSearchIndexController">
  533. <property name="successView" value="admin-home-redirect"/>
  534. </bean>
  535. <!-- Simple search for recipes -->
  536. <bean id="recipeSearchForm" parent="recipeCommandParent" class="magoffin.matt.ieat.web.SearchForRecipesForm">
  537. <property name="bindOnNewForm" value="true"/>
  538. <property name="sessionForm" value="true"/>
  539. <property name="formView" value="search-recipes"/>
  540. <property name="successView" value="search-recipes"/>
  541. <property name="cancelView" value="home-redirect"/>
  542. </bean>
  543. <!-- Service for ingredient search -->
  544. <bean id="ingredientSearch" class="magoffin.matt.ieat.web.SearchForIngredientsController">
  545. <property name="commandClass" value="magoffin.matt.ieat.web.SearchForIngredientsController$Command"/>
  546. <property name="successView" value="json"/>
  547. </bean>
  548. <!-- XML service to set the recipe rating -->
  549. <bean id="setRecipeRating" parent="recipeCommandParent" class="magoffin.matt.ieat.web.service.SetRecipeRating">
  550. <property name="successView" value="xml-service-response"/>
  551. </bean>
  552. <!-- "forgot my password" form -->
  553. <bean id="forgotPasswordForm" class="magoffin.matt.ieat.web.ForgotPasswordForm">
  554. <property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
  555. <property name="validator"><ref bean="logonValidator"/></property>
  556. <property name="formView" value="forgot-password"/>
  557. <property name="successView" value="forgot-password-complete"/>
  558. </bean>
  559. <!-- "forgot my password" confirm form -->
  560. <bean id="forgotPasswordConfirmForm" class="magoffin.matt.ieat.web.ForgotPasswordConfirmForm">
  561. <property name="commandClass" value="magoffin.matt.ieat.util.LogonCommand"/>
  562. <property name="bindOnNewForm" value="true"/>
  563. <property name="sessionForm" value="true"/>
  564. <property name="validator"><ref bean="logonValidator"/></property>
  565. <property name="formView" value="change-password"/>
  566. <property name="successView" value="home-redirect"/>
  567. </bean>
  568. <!-- Import RecipeML recipe -->
  569. <bean id="importRecipeMLForm" class="magoffin.matt.ieat.web.ImportRecipeMLForm">
  570. <property name="commandClass" value="magoffin.matt.ieat.util.ImportRecipeCommand"/>
  571. <property name="pages">
  572. <list>
  573. <value>import-recipeml</value>
  574. <value>import-recipe-ingredients</value>
  575. <value>import-recipe-ingredients-validate</value>
  576. </list>
  577. </property>
  578. <property name="validator"><ref bean="recipeMLImportValidator"/></property>
  579. <property name="successView" value="view-recipe-redirect"/>
  580. <property name="cancelView" value="home-redirect"/>
  581. <property name="allowDirtyBack" value="false"/>
  582. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  583. </bean>
  584. <!-- Export recipe -->
  585. <bean id="exportRecipeForm" class="magoffin.matt.ieat.web.ExportRecipeForm">
  586. <property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
  587. <property name="bindOnNewForm" value="true"/>
  588. <property name="formView" value="export-recipe"/>
  589. <property name="successView" value="export-recipe"/>
  590. <property name="cancelView" value="view-recipe-redirect"/>
  591. <property name="rioBiz"><ref bean="recipeIOBiz"/></property>
  592. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  593. </bean>
  594. <!-- Settings form -->
  595. <bean id="settingsForm" class="magoffin.matt.ieat.web.SettingsForm">
  596. <property name="pages">
  597. <list>
  598. <value>settings-form</value>
  599. <value>settings-validate</value>
  600. </list>
  601. </property>
  602. <property name="validator"><ref bean="userValidator"/></property>
  603. <property name="successView" value="home-redirect"/>
  604. <property name="cancelView" value="home-redirect"/>
  605. <property name="allowDirtyBack" value="true"/>
  606. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  607. </bean>
  608. <!-- Email recipe form -->
  609. <bean id="emailRecipeForm" class="magoffin.matt.ieat.web.EmailRecipeForm">
  610. <property name="commandClass" value="magoffin.matt.ieat.util.EmailRecipeCommand"/>
  611. <property name="bindOnNewForm" value="true"/>
  612. <property name="validator"><ref bean="emailRecipeValidator"/></property>
  613. <property name="formView" value="email-recipe-form"/>
  614. <property name="successView" value="view-recipe-redirect"/>
  615. <property name="cancelView" value="view-recipe-redirect"/>
  616. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  617. <property name="recipeIOBiz"><ref bean="recipeIOBiz"/></property>
  618. </bean>
  619. <!-- Recipe comments form -->
  620. <bean id="recipeCommentsForm" class="magoffin.matt.ieat.web.RecipeCommentsForm">
  621. <property name="commandClass" value="magoffin.matt.ieat.util.RecipeCommand"/>
  622. <property name="bindOnNewForm" value="true"/>
  623. <property name="validator"><ref bean="recipeCommentsValidator"/></property>
  624. <property name="formView" value="recipe-comments"/>
  625. <property name="successView" value="recipe-comments-redirect"/>
  626. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  627. </bean>
  628. <!-- Popup help support -->
  629. <bean id="help" class="magoffin.matt.ieat.web.HelpController">
  630. <property name="successView" value="help"/>
  631. </bean>
  632. <!-- Edit recipe image form -->
  633. <bean id="editRecipeImageForm" class="magoffin.matt.ieat.web.EditRecipeImageForm">
  634. <property name="commandClass" value="magoffin.matt.ieat.web.EditRecipeImageForm$RecipeImageCommand"/>
  635. <property name="bindOnNewForm" value="true"/>
  636. <property name="binderTemplate" ref="recipeDynamicBinder"/>
  637. <property name="validator">
  638. <bean class="magoffin.matt.ieat.web.EditRecipeImageForm$RecipeImageCommandValidator"/>
  639. </property>
  640. <property name="formView" value="edit-recipe-image"/>
  641. <property name="cancelView" value="view-recipe-redirect"/>
  642. <property name="successView" value="view-recipe-redirect"/>
  643. </bean>
  644. <!-- Setup wizard form -->
  645. <bean name="setupWizardForm" class="magoffin.matt.ieat.web.setup.SetupWizard">
  646. <property name="commandClass">
  647. <value>magoffin.matt.ieat.web.setup.SetupWizard$SetupCommand</value>
  648. </property>
  649. <property name="pages">
  650. <list>
  651. <value>setup-welcome</value>
  652. <value>setup-features</value>
  653. <value>setup-db</value>
  654. <value>setup-filesystem</value>
  655. <value>setup-other</value>
  656. <value>setup-admin</value>
  657. <value>setup-confirm</value>
  658. </list>
  659. </property>
  660. <property name="validator">
  661. <bean class="magoffin.matt.ieat.web.setup.SetupWizard$SetupCommandValidator">
  662. <property name="fileSystemPage" value="3"/>
  663. </bean>
  664. </property>
  665. <property name="successView" value="setup-complete"/>
  666. <property name="allowDirtyBack" value="true"/>
  667. <property name="parameterDao" ref="parameterDaoEnvironment"/>
  668. <property name="userBiz" ref="userBiz"/>
  669. <property name="requireAdmin" value="${setup.requireadmin}"/>
  670. <property name="adminUserPage" value="5"/>
  671. <property name="originalHibernateDialect" value="${hibernate.dialect}"/>
  672. <property name="domainObjectFactory" ref="domainObjectFactory"/>
  673. <property name="defaultSettings">
  674. <map>
  675. <entry key="hibernate.dialect" value="${hibernate.dialect}"/>
  676. <entry key="lucene.index.base.path" value="${lucene.index.base.path}"/>
  677. <entry key="mail.from" value="${mail.from}"/>
  678. <entry key="crypto.key" value="${crypto.key}"/>
  679. <entry key="crypto.salt" value="${crypto.salt}"/>
  680. <entry key="crypto.pbe.salt" value="${crypto.pbe.salt}"/>
  681. <entry key="xslt.cache" value="${xslt.cache}"/>
  682. <entry key="recipe.image.base.path" value="${recipe.image.base.path}"/>
  683. </map>
  684. </property>
  685. </bean>
  686. <!-- ListManager -->
  687. <bean name="listManagerForm" class="magoffin.matt.ieat.web.setup.ListManagerForm">
  688. <property name="commandClass">
  689. <value>magoffin.matt.ieat.web.setup.ListManagerForm$ListCommand</value>
  690. </property>
  691. <property name="bindOnNewForm" value="true"/>
  692. <property name="formView">
  693. <value>lists-form</value>
  694. </property>
  695. <property name="successView">
  696. <value>lists-form</value>
  697. </property>
  698. <property name="domainObjectFactory">
  699. <ref bean="domainObjectFactory"/>
  700. </property>
  701. <property name="recipeDao">
  702. <ref bean="recipeDao"/>
  703. </property>
  704. <property name="baseDao">
  705. <ref bean="baseDao"/>
  706. </property>
  707. <property name="courseDao">
  708. <ref bean="courseDao"/>
  709. </property>
  710. <property name="difficultyDao">
  711. <ref bean="difficultyDao"/>
  712. </property>
  713. <property name="ethnicityDao">
  714. <ref bean="ethnicityDao"/>
  715. </property>
  716. <property name="ingredientDao">
  717. <ref bean="ingredientDao"/>
  718. </property>
  719. <property name="prepTimeDao">
  720. <ref bean="prepTimeDao"/>
  721. </property>
  722. <property name="parameterDao" ref="parameterDaoEnvironment"/>
  723. <property name="userBiz">
  724. <ref bean="userBiz"/>
  725. </property>
  726. <property name="meta">
  727. <map>
  728. <entry key="magoffin.matt.ieat.domain.impl.BaseImpl">
  729. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  730. <property name="properties">
  731. <list>
  732. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  733. <property name="name" value="baseId"/>
  734. <property name="displayName" value="ID"/>
  735. <property name="type" value="2"/>
  736. <property name="primaryKey" value="true"/>
  737. </bean>
  738. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  739. <property name="name" value="value"/>
  740. <property name="displayName" value="Value"/>
  741. <property name="type" value="1"/>
  742. <property name="length" value="64"/>
  743. </bean>
  744. </list>
  745. </property>
  746. </bean>
  747. </entry>
  748. <entry key="magoffin.matt.ieat.domain.impl.CourseImpl">
  749. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  750. <property name="properties">
  751. <list>
  752. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  753. <property name="name" value="courseId"/>
  754. <property name="displayName" value="ID"/>
  755. <property name="type" value="2"/>
  756. <property name="primaryKey" value="true"/>
  757. </bean>
  758. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  759. <property name="name" value="value"/>
  760. <property name="displayName" value="Value"/>
  761. <property name="type" value="1"/>
  762. <property name="length" value="64"/>
  763. </bean>
  764. </list>
  765. </property>
  766. </bean>
  767. </entry>
  768. <entry key="magoffin.matt.ieat.domain.impl.DifficultyImpl">
  769. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  770. <property name="properties">
  771. <list>
  772. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  773. <property name="name" value="difficultyId"/>
  774. <property name="displayName" value="ID"/>
  775. <property name="type" value="2"/>
  776. <property name="primaryKey" value="true"/>
  777. </bean>
  778. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  779. <property name="name" value="value"/>
  780. <property name="displayName" value="Value"/>
  781. <property name="type" value="1"/>
  782. <property name="length" value="64"/>
  783. </bean>
  784. </list>
  785. </property>
  786. </bean>
  787. </entry>
  788. <entry key="magoffin.matt.ieat.domain.impl.EthnicityImpl">
  789. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  790. <property name="properties">
  791. <list>
  792. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  793. <property name="name" value="ethnicityId"/>
  794. <property name="displayName" value="ID"/>
  795. <property name="type" value="2"/>
  796. <property name="primaryKey" value="true"/>
  797. </bean>
  798. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  799. <property name="name" value="value"/>
  800. <property name="displayName" value="Value"/>
  801. <property name="type" value="1"/>
  802. <property name="length" value="64"/>
  803. </bean>
  804. </list>
  805. </property>
  806. </bean>
  807. </entry>
  808. <entry key="magoffin.matt.ieat.domain.impl.IngredientImpl">
  809. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  810. <property name="properties">
  811. <list>
  812. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  813. <property name="name" value="ingredientId"/>
  814. <property name="displayName" value="ID"/>
  815. <property name="type" value="2"/>
  816. <property name="primaryKey" value="true"/>
  817. </bean>
  818. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  819. <property name="name" value="name"/>
  820. <property name="displayName" value="Name"/>
  821. <property name="type" value="1"/>
  822. <property name="length" value="128"/>
  823. </bean>
  824. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  825. <property name="name" value="description"/>
  826. <property name="displayName" value="Description"/>
  827. <property name="type" value="1"/>
  828. <property name="length" value="512"/>
  829. </bean>
  830. </list>
  831. </property>
  832. </bean>
  833. </entry>
  834. <entry key="magoffin.matt.ieat.domain.impl.PrepTimeImpl">
  835. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$ListMetaData">
  836. <property name="properties">
  837. <list>
  838. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  839. <property name="name" value="prepTimeId"/>
  840. <property name="displayName" value="ID"/>
  841. <property name="type" value="2"/>
  842. <property name="primaryKey" value="true"/>
  843. </bean>
  844. <bean class="magoffin.matt.ieat.web.setup.ListManagerForm$PropertyMetaData">
  845. <property name="name" value="value"/>
  846. <property name="displayName" value="Value"/>
  847. <property name="type" value="1"/>
  848. <property name="length" value="64"/>
  849. </bean>
  850. </list>
  851. </property>
  852. </bean>
  853. </entry>
  854. </map>
  855. </property>
  856. </bean>
  857. </beans>