33effee5a105270c0ea94d17a7e61725ef6bedc0
[cdmlib.git] / cdmlib-remote-webapp / src / main / webapp / WEB-INF / cdmlib-remote-servlet.xml
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 <!--
37 -->
38 <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
39 <property name="order" value="0" />
40 <property name="mappings">
41 <props>
42 <prop key="/index.do">urlFilenameViewController</prop>
43 <prop key="/">welcomeFileViewController</prop>
44 </props>
45 </property>
46 </bean>
47
48 <!--
49 ======= HandlerAdapters =======
50 -->
51 <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
52 <property name="pathMatcher">
53 <!-- must match the pathMatcher as set in DefaultAnnotationHandlerMapping -->
54 <bean class="eu.etaxonomy.cdm.remote.controller.util.CdmAntPathMatcher" />
55 </property>
56 </bean>
57
58 <!-- needed when using SimpleUrlHandlerMapping -->
59 <bean
60 class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
61
62
63 <!--
64 ======= Remoting =======
65 -->
66
67 <!-- <import resource="classpath:/eu/etaxonomy/cdm/httpInvokerServices.xml"/>-->
68 <!---->
69 <!-- <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">-->
70 <!-- <property name="order" value="0" />-->
71 <!-- <property name="mappings">-->
72 <!-- -->
73 <!-- Needed for spring remoting with the http invoker -->
74 <!-- <!-- The configuration of the services is imported from httpInvokerServices.xml -->-->
75 <!-- <props>-->
76 <!-- <prop key="/remoting/agent.service">httpAgentService</prop>-->
77 <!-- <prop key="/remoting/annotation.service">httpAnnotationService</prop>-->
78 <!-- <prop key="/remoting/auditevent.service">httpAuditEventService</prop>-->
79 <!-- <prop key="/remoting/classification.service">httpClassificationService</prop>-->
80 <!-- <prop key="/remoting/collection.service">httpCollectionService</prop>-->
81 <!-- <prop key="/remoting/common.service">httpCommonService</prop>-->
82 <!-- <prop key="/remoting/database.service">httpDatabaseService</prop>-->
83 <!-- <prop key="/remoting/description.service">httpDescriptionService</prop>-->
84 <!-- <prop key="/remoting/featurenode.service">httpFeatureNodeService</prop>-->
85 <!-- <prop key="/remoting/featuretree.service">httpFeatureTreeService</prop>-->
86 <!-- <prop key="/remoting/grantedauthority.service">httpGrantedAuthorityService</prop>-->
87 <!-- <prop key="/remoting/group.service">httpGroupService</prop>-->
88 <!-- <prop key="/remoting/identificationkey.service">httpIdentificationKeyService</prop>-->
89 <!-- <prop key="/remoting/location.service">httpLocationService</prop>-->
90 <!-- <prop key="/remoting/lsidauthority.service">httpLsidAuthorityService</prop> -->
91 <!-- <prop key="/remoting/lsiddata.service">httpLsidDataService</prop> -->
92 <!-- <prop key="/remoting/lsidmetadata.service">httpLsidMetadataService</prop> -->
93 <!-- <prop key="/remoting/marker.service">httpMarkerService</prop>-->
94 <!-- <prop key="/remoting/media.service">httpMediaService</prop>-->
95 <!-- <prop key="/remoting/name.service">httpNameService</prop>-->
96 <!-- <prop key="/remoting/occurrence.service">httpOccurrenceService</prop>-->
97 <!-- <prop key="/remoting/polytomouskeynode.service">httpPolytomousKeyNodeService</prop>-->
98 <!-- <prop key="/remoting/polytomouskey.service">httpPolytomousKeyService</prop>-->
99 <!-- <prop key="/remoting/reference.service">httpReferenceService</prop>-->
100 <!-- <prop key="/remoting/service.service">httpServiceService</prop>-->
101 <!-- <prop key="/remoting/taxonnode.service">httpTaxonNodeService</prop>-->
102 <!-- <prop key="/remoting/taxon.service">httpTaxonService</prop>-->
103 <!-- <prop key="/remoting/term.service">httpTermService</prop>-->
104 <!-- <prop key="/remoting/user.service">httpUserService</prop>-->
105 <!-- <prop key="/remoting/vocabulary.service">httpVocabularyService</prop>-->
106 <!-- <prop key="/remoting/authenticationManager.service">httpAuthenticationManager</prop>-->
107 <!-- </props>-->
108 <!-- </property>-->
109 <!-- </bean>-->
110 <!---->
111 <!-- -->
112 <!-- <!-- needed for HTTPInvoker --> -->
113 <!-- <bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter" />-->
114
115
116 <!--
117 ======= HandlerInterceptors =======
118 -->
119 <!--
120 <bean id="datasourceContextHandlerInterceptor"
121 class="eu.etaxonomy.cdm.remote.controller.interceptor.DatasourceContextHandlerInterceptor" /> -->
122 <bean id="localeContextHandlerInterceptor"
123 class="eu.etaxonomy.cdm.remote.controller.interceptor.LocaleContextHandlerInterceptor" />
124
125 <!--
126 ======= ViewControllers =======
127 -->
128 <bean id="urlFilenameViewController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
129 </bean>
130 <!--
131 The welcome-file-list in the web.xml will is ignored since the
132 cdmserver servlet is mapped to the root path [/] So the welcome file
133 list is being replaced by a SimpleUrlHandlerMapping on the root path
134 [/] which is mapped via this ViewController to the [index] view
135 -->
136 <bean id="welcomeFileViewController"
137 class="org.springframework.web.servlet.mvc.UrlFilenameViewController">
138 <property name="suffix">
139 <value>index</value>
140 </property>
141 </bean>
142
143
144 <!--
145 ======= ViewResolver =======
146 -->
147
148 <bean id="viewResolverJsp"
149 class="org.springframework.web.servlet.view.InternalResourceViewResolver">
150 <property name="order" value="0" />
151 <property name="prefix" value="/WEB-INF/jsp/" />
152 <property name="suffix" value=".jsp" />
153 <property name="viewNames">
154 <!--
155 view names (or name patterns) that can be handled
156 -->
157 <list>
158 <value>index</value>
159 </list>
160 </property>
161 </bean>
162
163 <bean id="oaiViewResolver" class="org.springframework.web.servlet.view.XmlViewResolver">
164 <property name="order" value="1"/>
165 <property name="location" value="/WEB-INF/oai-views.xml"/>
166 <!-- FOR DEBUGING ONLY !!!!
167 <property name="cache" value="false"/>
168 -->
169 </bean>
170
171 <bean id="contentNegotiatingViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
172 <property name="order" value="2" />
173 <property name="mediaTypes">
174 <map>
175 <entry key="xml" value="application/xml" />
176 <entry key="dc" value="application/xml" />
177 <entry key="rdf" value="application/xml" />
178 <entry key="rdfxml" value="application/rdf+xml" />
179 <entry key="json" value="application/json" />
180 </map>
181 </property>
182 <property name="viewResolvers">
183 <list>
184 <bean id="xmlTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
185 <property name="location" value="/WEB-INF/xml-views.xml"/>
186 <!--
187 turn caching off FOR DEBUGING ONLY !!!!
188 <property name="cache" value="false"/>
189 -->
190 </bean>
191 <bean id="jsonTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
192 <property name="location" value="/WEB-INF/json-views.xml"/>
193 <!--
194 turn caching off FOR DEBUGING ONLY !!!!
195 <property name="cache" value="false"/>
196 -->
197 </bean>
198 <bean id="rdfTypeViewResolver" class="eu.etaxonomy.cdm.remote.view.PatternViewResolver">
199 <property name="location" value="/WEB-INF/rdf-views.xml"/>
200 <!--
201 turn caching off FOR DEBUGING ONLY !!!!
202 <property name="cache" value="false"/>
203 -->
204 </bean>
205 </list>
206 </property>
207 </bean>
208
209 <!--
210 ======= Exception Handling =======
211 -->
212 <bean id="exceptionResolver" class="eu.etaxonomy.cdm.remote.exception.CdmExceptionResolver">
213 </bean>
214
215 <!--
216 ======= Security =======
217 -->
218 <!-- <bean id="basicProcessingFilter" class="org.springframework.security.ui.basicauth.BasicProcessingFilter">-->
219 <!-- <property name="authenticationManager"><ref bean="authenticationManager"/></property>-->
220 <!-- <property name="authenticationEntryPoint"><ref bean="authenticationEntryPoint"/></property>-->
221 <!-- </bean>-->
222 <!-- <bean id="authenticationEntryPoint" class="org.springframework.security.ui.basicauth.BasicProcessingFilterEntryPoint">-->
223 <!-- <property name="realmName"><value>Name Of Your Realm</value></property>-->
224 <!-- </bean>-->
225
226 </beans>