Guest User

Untitled

a guest
Jun 8th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xmlns:aop="http://www.springframework.org/schema/aop"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:tx="http://www.springframework.org/schema/tx"
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  7. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
  8. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
  9. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
  10. default-lazy-init="true">
  11.  
  12. <!-- =================================================================== -->
  13. <!-- AOP: Configuration and Aspects -->
  14. <!-- =================================================================== -->
  15. <aop:config>
  16. <aop:advisor id="userManagerTx" advice-ref="userManagerTxAdvice" pointcut="execution(* *..service.UserManager.*(..))" order="0"/>
  17. <aop:advisor id="userManagerSecurity" advice-ref="userSecurityAdvice" pointcut="execution(* *..service.UserManager.saveUser(..))" order="1"/>
  18. <aop:advisor id="managerTx" advice-ref="txAdvice" pointcut="execution(* *..service.*Manager.*(..))" order="2"/>
  19. </aop:config>
  20.  
  21. <!-- Enable @Transactional support -->
  22. <tx:annotation-driven/>
  23.  
  24. <!-- Enable @AspectJ support -->
  25. <aop:aspectj-autoproxy/>
  26.  
  27. <!-- Activates scanning of @Autowired -->
  28. <context:annotation-config/>
  29.  
  30. <!-- Activates scanning of @Service -->
  31. <context:component-scan base-package="org.openmrs.contrib.metadatarepository.service"/>
  32.  
  33. <tx:advice id="txAdvice">
  34. <tx:attributes>
  35. <!-- Read-only commented out to make things easier for end-users -->
  36. <!-- http://issues.appfuse.org/browse/APF-556 -->
  37. <!--tx:method name="get*" read-only="true"/-->
  38. <tx:method name="*"/>
  39. </tx:attributes>
  40. </tx:advice>
  41.  
  42. <tx:advice id="userManagerTxAdvice">
  43. <tx:attributes>
  44. <tx:method name="save*" rollback-for="UserExistsException"/>
  45. </tx:attributes>
  46. </tx:advice>
  47.  
  48. <bean id="userSecurityAdvice" class="org.openmrs.contrib.metadatarepository.service.UserSecurityAdvice"/>
  49.  
  50. <!-- =================================================================== -->
  51. <!-- Mail: Sender and Velocity configuration -->
  52. <!-- =================================================================== -->
  53. <bean id="mailEngine" class="org.openmrs.contrib.metadatarepository.service.MailEngine">
  54. <property name="mailSender" ref="mailSender"/>
  55. <property name="velocityEngine" ref="velocityEngine"/>
  56. <property name="from" value="${mail.default.from}"/>
  57. </bean>
  58.  
  59. <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
  60. <property name="host" value="${mail.host}"/>
  61. <property name="defaultEncoding" value="UTF-8"/>
  62. <!-- Uncomment if you need to authenticate with your SMTP Server -->
  63. <!--property name="username" value="${mail.username}"/>
  64. <property name="password" value="${mail.password}"/>
  65. <property name="javaMailProperties">
  66. <value>
  67. mail.smtp.auth=true
  68. </value>
  69. </property-->
  70. </bean>
  71.  
  72. <!-- Configure Velocity for sending e-mail -->
  73. <bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
  74. <property name="velocityProperties">
  75. <props>
  76. <prop key="resource.loader">class</prop>
  77. <prop key="class.resource.loader.class">
  78. org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
  79. </prop>
  80. <prop key="velocimacro.library"></prop>
  81. </props>
  82. </property>
  83. </bean>
  84.  
  85. <bean id="mailMessage" class="org.springframework.mail.SimpleMailMessage" scope="prototype">
  86. <property name="from" value="${mail.default.from}"/>
  87. </bean>
  88.  
  89. <!-- =================================================================== -->
  90. <!-- Security class from Spring Security - used to configure Password -->
  91. <!-- Encryption in UserManagerImpl. Can override in security.xml. -->
  92. <!-- =================================================================== -->
  93. <bean id="passwordEncoder" class="org.springframework.security.authentication.encoding.ShaPasswordEncoder"/>
  94. <bean id="applicationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  95. <property name="location" value="classpath:application.properties"/>
  96. </bean>
  97. <bean id="packageManager" class="org.openmrs.contrib.metadatarepository.service.impl">
  98. <property name="packagelocation" value="${packages.location}"/>
  99. </bean>
  100. </beans>
Advertisement
Add Comment
Please, Sign In to add comment