/src/test/java/com/google/ie/test/test-app-context.xml

http://thoughtsite.googlecode.com/ · XML · 140 lines · 100 code · 27 blank · 13 comment · 0 complexity · 6a4ca3957f53c0e7009b28dacd2b8e27 MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:oxm="http://www.springframework.org/schema/oxm" xmlns:aop="http://www.springframework.org/schema/aop"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="http://www.springframework.org/schema/beans
  8. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  9. http://www.springframework.org/schema/context
  10. http://www.springframework.org/schema/context/spring-context-2.5.xsd
  11. http://www.springframework.org/schema/oxm
  12. http://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd
  13. http://www.springframework.org/schema/tx
  14. http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
  15. http://www.springframework.org/schema/aop
  16. http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
  17. <!-- Scans for controllers -->
  18. <context:component-scan base-package="com.google.ie" />
  19. <bean id="appConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  20. <!--reads application.properties file-->
  21. <property name="location" value="classpath:application.properties"/>
  22. </bean>
  23. <!-- Services -->
  24. <bean id="tagService" class="com.google.ie.business.service.impl.TagServiceImpl">
  25. <property name="tagDao" ref="tagDao" />
  26. </bean>
  27. <bean id="commentService" class="com.google.ie.business.service.impl.IdeaCommentServiceImpl">
  28. <property name="commentDao" ref="commentDao" />
  29. </bean>
  30. <bean id="projectService" class="com.google.ie.business.service.impl.ProjectServiceImpl">
  31. <property name="projectDao" ref="projectDao" />
  32. </bean>
  33. <bean id="entityIndexService" class="com.google.ie.business.service.impl.EntityIndexServiceImpl">
  34. <property name="entityIndexDao" ref="entityIndexDao" />
  35. </bean>
  36. <bean id="userService" class="com.google.ie.business.service.impl.UserServiceImpl">
  37. </bean>
  38. <!--Initialize JDO pmf using config name given in jdoconfig.xml -->
  39. <bean id="persistenceManagerFactory"
  40. class="org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean">
  41. <property name="persistenceManagerFactoryName" value="transactions-optional" />
  42. </bean>
  43. <!-- Transaction manager for a JDO -->
  44. <bean id="transactionManager" class="org.springframework.orm.jdo.JdoTransactionManager"
  45. p:persistenceManagerFactory-ref="persistenceManagerFactory" />
  46. <!-- Data access objects -->
  47. <bean id="ideaDao" class="com.google.ie.business.dao.impl.IdeaDaoImpl">
  48. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  49. </bean>
  50. <bean id="ideaCategoryDao" class="com.google.ie.business.dao.impl.IdeaCategoryDaoImpl">
  51. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  52. </bean>
  53. <bean id="tagDao" class="com.google.ie.business.dao.impl.TagDaoImpl">
  54. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  55. </bean>
  56. <bean id="commentDao" class="com.google.ie.business.dao.impl.CommentDaoImpl">
  57. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  58. </bean>
  59. <bean id="auditDao" class="com.google.ie.business.dao.impl.AuditDaoImpl">
  60. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  61. </bean>
  62. <bean id="entityIndexDao" class="com.google.ie.business.dao.impl.EntityIndexDaoImpl">
  63. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  64. </bean>
  65. <bean id="userDao" class="com.google.ie.business.dao.impl.UserDaoImpl">
  66. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  67. </bean>
  68. <bean id="ideaVoteDao" class="com.google.ie.business.dao.impl.VoteDaoImpl">
  69. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  70. </bean>
  71. <bean id="projectDao" class="com.google.ie.business.dao.impl.ProjectDaoImpl">
  72. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  73. </bean>
  74. <bean id="shardedCounterDao" class="com.google.ie.business.dao.impl.ShardedCounterDaoImpl">
  75. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  76. </bean>
  77. <bean id="badWordDao" class="com.google.ie.business.dao.impl.BadWordDaoImpl">
  78. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  79. </bean>
  80. <bean id="developerDao" class="com.google.ie.business.dao.impl.DeveloperDaoImpl">
  81. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  82. </bean>
  83. <bean id="adminRequestDao" class="com.google.ie.business.dao.impl.AdminRequestDaoImpl">
  84. <property name="persistenceManagerFactory" ref="persistenceManagerFactory" />
  85. </bean>
  86. <!-- use annotation based transaction configuration -->
  87. <tx:annotation-driven/>
  88. <!--
  89. - This bean resolves specific types of exceptions to corresponding logical
  90. - view names for error views. The default behavior of DispatcherServlet
  91. - is to propagate all exceptions to the servlet container: this will happen
  92. - here with all other types of exceptions.
  93. -->
  94. <bean id="exceptionResolver"
  95. class="com.google.ie.common.exception.IdeaExchangeExceptionResolver">
  96. <property name="exceptionMappings">
  97. <props>
  98. <prop key="org.springframework.dao.DataAccessException">error/system-error</prop>
  99. <prop key="org.springframework.transaction.TransactionException">error/system-error</prop>
  100. </props>
  101. </property>
  102. <property name="defaultErrorView" value="error/system-error" />
  103. </bean>
  104. <bean id="messageSource"
  105. class="org.springframework.context.support.ResourceBundleMessageSource">
  106. <property name="basenames">
  107. <list>
  108. <value>email</value>
  109. <value>message</value>
  110. </list>
  111. </property>
  112. </bean>
  113. </beans>