Project

General

Profile

Download (8.41 KB) Statistics
| Branch: | Tag: | Revision:
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:context="http://www.springframework.org/schema/context"
4
	xmlns:tx="http://www.springframework.org/schema/tx"
5
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
6
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
7
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
8
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
9
    ">
10
	<context:component-scan base-package="eu/etaxonomy/cdm/remote" />
11

    
12

    
13
	<!-- 
14
	  ======= HandlerMappings =======
15
	  -->
16
	<!--
17
		first we try to find the controller using the simpleurlmapping, then
18
		the classname this follows the principal of "convention over
19
		configuration"
20
	-->
21
	<bean
22
		class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
23
		<property name="order" value="1" />
24
		<property name="interceptors">
25
			<list>
26
				<!--<ref bean="contentNegociationHandlerInterceptor" /> -->
27
				<ref bean="localeContextHandlerInterceptor" />
28
			</list>
29
		</property>
30
		<property name="pathMatcher">
31
		  <!--  must match the pathMatcher as set in AnnotationMethodHandlerAdapter -->
32
		  <bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
33
		</property>
34
	</bean>
35

    
36
	<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
37
		<property name="order" value="0" />
38
		<property name="mappings">
39
    <!-- 
40
			<props>
41
				<prop key="/index.do">urlFilenameViewController
42
				</prop>
43
				<prop key="/">welcomeFileViewController
44
				</prop>
45
			</props>
46
	 -->
47
	 
48
	 	<!-- Needed for spring remoting with the http invoker -->
49
	 	<!-- The configuration of the services is imported from httpinvokerServices.xml -->
50
			<props>
51
				<prop key="/agent.service">httpAgentService</prop>
52
				<prop key="/annotation.service">httpAnnotationService</prop>
53
				<prop key="/auditevent.service">httpAuditEventService</prop>
54
				<prop key="/classification.service">httpClassificationService</prop>
55
				<prop key="/collection.service">httpCollectionService</prop>
56
				<prop key="/common.service">httpCommonService</prop>
57
				<prop key="/description.service">httpDescriptionService</prop>
58
				<prop key="/featurenode.service">httpFeatureNodeService</prop>
59
				<prop key="/featuretree.service">httpFeatureTreeService</prop>
60
				<prop key="/group.service">httpGroupService</prop>
61
				<prop key="/identificationkey.service">httpIdentificationKeyService</prop>
62
				<prop key="/location.service">httpLocationService</prop>
63
				<prop key="/marker.service">httpMarkerService</prop>
64
				<prop key="/media.service">httpMediaService</prop>
65
				<prop key="/name.service">httpNameService</prop>
66
				<prop key="/occurrence.service">httpOccurrenceService</prop>
67
				<prop key="/polytomouskeynode.service">httpPolytomousKeyNodeService</prop>
68
				<prop key="/polytomouskey.service">httpPolytomousKeyService</prop>
69
				<prop key="/reference.service">httpReferenceService</prop>
70
				<prop key="/service.service">httpServiceService</prop>
71
				<prop key="/taxonnode.service">httpTaxonNodeService</prop>
72
				<prop key="/taxon.service">httpTaxonService</prop>
73
				<prop key="/term.service">httpTermService</prop>
74
				<prop key="/user.service">httpUserService</prop>
75
				<prop key="/vocabulary.service">httpVocabularyService</prop>
76
			</props>
77
		</property>
78
	</bean>
79
    
80
	<!-- 
81
	======= HandlerAdapters =======
82
	-->
83
	<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
84
	   <property name="pathMatcher">
85
	        <!--  must match the pathMatcher as set in DefaultAnnotationHandlerMapping -->
86
            <bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
87
       </property>
88
	</bean>
89

    
90
	<!-- needed when using SimpleUrlHandlerMapping 	-->
91
	<bean
92
		class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
93
		
94
	<!-- needed for HTTPInvoker  -->	
95
	<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter" />
96
    
97
    
98
	<!-- 
99
	======= HandlerInterceptors =======
100
	-->
101
	<!-- 
102
	<bean id="datasourceContextHandlerInterceptor"
103
		class="eu.etaxonomy.cdm.remote.controller.interceptor.DatasourceContextHandlerInterceptor" /> -->
104
	<bean id="localeContextHandlerInterceptor"
105
		class="eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor" />
106
	<!-- 
107
	   === no longer needed, replaced by ContentNegotiatingViewResolver ==	   
108
	<bean id="contentNegociationHandlerInterceptor"
109
		class="eu.etaxonomy.cdm.remote.controller.interceptor.ContentNegociationHandlerInterceptor">
110
		<property name="mapping">
111
			<map>
112
				<entry key="text/json" value="json" />
113
				<entry key="application/json" value="json" />
114
				<entry key="application/xml" value="xml" />
115
			</map>
116
		</property>
117
		<property name="defaultExtension" value="xml" />
118
	</bean>
119
	 -->
120

    
121
	<!-- 
122
	 ======= ViewControllers =======
123
	 -->
124
	<bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
125
	</bean>
126
	<!--
127
		The welcome-file-list in the web.xml will is ignored since the
128
		cdmserver servlet is mapped to the root path [/] So the welcome file
129
		list is being replaced by a SimpleUrlHandlerMapping on the root path
130
		[/] which is mapped via this ViewController to the [index] view
131
	<bean id="welcomeFileViewController"
132
		class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
133
		<property name="suffix">
134
			<value>index</value>
135
		</property>
136
	</bean>
137
	-->
138

    
139

    
140
	<!-- 
141
    ======= ViewResolver =======
142
    -->
143
	<bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
144
        <property name="order" value="0"/>
145
        <property name="location" value="/WEB-INF/oai-views.xml"/>
146
        <!-- FOR DEBUGING ONLY !!!!   
147
        <property name="cache" value="false"/> 
148
         -->
149
    </bean>
150
	
151
    
152
	 <bean id="contentNegotiatingViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
153
	      <property name="order" value="1" />
154
	      <property name="mediaTypes">
155
	         <map>
156
			    <entry key="xml" value="application/xml" />
157
				<entry key="dc" value="application/xml" />
158
				<entry key="rdf" value="application/xml" />
159
				<entry key="json" value="application/json" />
160
				<entry key="json" value="application/json" />
161
	         </map>
162
	      </property>
163
	      <property name="viewResolvers">
164
	          <list>
165
			    <bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
166
			        <property name="location" value="/WEB-INF/xml-views.xml"/>
167
			        <!--
168
			            turn caching off FOR DEBUGING ONLY !!!! 
169
			        <property name="cache" value="false"/>
170
			        -->
171
			    </bean>
172
			    <bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
173
			        <property name="location" value="/WEB-INF/json-views.xml"/>
174
			        <!-- 
175
			          turn caching off FOR DEBUGING ONLY !!!! 
176
			        <property name="cache" value="false"/>
177
			        -->
178
			    </bean>
179
	          </list>
180
	      </property>
181
	</bean>
182
	
183
    <!--  
184
        === the viewResolverJsp is currently unused ===
185
	<bean id="viewResolverJsp"
186
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
187
		<property name="order" value="1" />
188
		<property name="prefix" value="/WEB-INF/jsp/" />
189
		<property name="suffix" value=".jsp" />
190
		<property name="viewNames">
191
			<!- -
192
				view names (or name patterns) that can be handled
193
			- ->
194
			<list>
195
				<value>index</value>
196
			</list>
197
		</property>
198
	</bean>
199
    -->
200

    
201
	<!-- 
202
	======= Exception Handling =======
203
	-->
204
	<bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
205
	</bean>
206
	
207
	<!-- 
208
	======= Remoting =======
209
	-->
210
	<import resource="classpath:/eu/etaxonomy/cdm/httpinvokerServices.xml"/>
211

    
212
	<!--  
213
    ======= Security ======= 
214
    -->
215
<!--    <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
216
<!--		<property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
217
<!--		<property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
218
<!--	</bean>-->
219
<!--	<bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
220
<!--		<property name="realmName"><value>Name Of Your Realm</value></property>-->
221
<!--	</bean>-->
222

    
223
</beans>
(4-4/8)