/activeobjects-plugin/src/main/resources/META-INF/spring/web-context.xml

https://bitbucket.org/activeobjects/ao-plugin · XML · 70 lines · 61 code · 8 blank · 1 comment · 0 complexity · 6232d14ac3d9649c5458151ba8aa0d99 MD5 · raw file

  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. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
  4. <bean id="handler" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  5. <property name="mappings">
  6. <props>
  7. <prop key="/tables/**">tablesController</prop>
  8. </props>
  9. </property>
  10. <property name="interceptors">
  11. <list>
  12. <bean class="com.atlassian.plugin.web.springmvc.interceptor.ContentTypeInterceptor"/>
  13. <bean class="com.atlassian.plugin.web.springmvc.interceptor.SystemAdminAuthorisationInterceptor">
  14. <constructor-arg index="0" ref="userManager"/>
  15. <constructor-arg index="1" ref="loginUriProvider"/>
  16. <constructor-arg index="2" ref="applicationProperties"/>
  17. </bean>
  18. <bean class="com.atlassian.plugin.web.springmvc.interceptor.WebSudoAuthorisationInterceptor">
  19. <constructor-arg ref="webSudoManager"/>
  20. </bean>
  21. <bean class="com.atlassian.plugin.web.springmvc.interceptor.XsrfTokenInterceptor">
  22. <property name="applicationProperties" ref="applicationProperties"/>
  23. <property name="xsrfTokenGenerator" ref="xsrfTokenGenerator"/>
  24. <property name="redirectPath" value="/directories/list?timeout=true"/>
  25. </bean>
  26. </list>
  27. </property>
  28. </bean>
  29. <bean id="xsrfTokenGenerator" class="com.atlassian.plugin.web.springmvc.xsrf.SimpleXsrfTokenGenerator"/>
  30. <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
  31. <property name="prefix" value="/templates/"/>
  32. <property name="suffix" value=".vm"/>
  33. <property name="exposeSpringMacroHelpers" value="true"/>
  34. <!--<property name="contentType" value="text/html; charset=UTF-8"/>--> <!-- this should ensure Sitemesh decoration but doesn't, so instead we use a ContentTypeInterceptor -->
  35. <property name="attributesMap">
  36. <map>
  37. <entry key="i18n" value-ref="i18nResolver"/>
  38. <entry key="helpPathResolver" value-ref="helpPathResolver"/>
  39. <entry key="applicationProperties" value-ref="applicationProperties"/>
  40. <entry key="webResourceManager" value-ref="webResourceManager"/>
  41. <entry key="webInterfaceManager" value-ref="webInterfaceManager"/>
  42. <entry key="xsrfTokenGenerator" value-ref="xsrfTokenGenerator"/>
  43. </map>
  44. </property>
  45. </bean>
  46. <bean id="velocityConfig" class="org.springframework.web.servlet.view.velocity.VelocityConfigurer"/>
  47. <bean id="messageSource" class="com.atlassian.plugin.web.springmvc.message.ApplicationMessageSource">
  48. <property name="i18nResolver" ref="i18nResolver"/>
  49. </bean>
  50. <bean id="tablesController" class="org.springframework.web.servlet.mvc.multiaction.MultiActionController">
  51. <property name="delegate">
  52. <bean class="com.atlassian.activeobjects.admin.tables.TablesController">
  53. <constructor-arg ref="databaseProviderFactory"/>
  54. <constructor-arg ref="simpleNameConverters"/>
  55. <constructor-arg ref="tenantAwareDataSourceProvider"/>
  56. <constructor-arg ref="errorService"/>
  57. <constructor-arg ref="pluginInformationFactory"/>
  58. <constructor-arg ref="tenantContext"/>
  59. </bean>
  60. </property>
  61. </bean>
  62. </beans>