wisemapping-open-source/wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml

102 lines
4.4 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<context:component-scan base-package="com.wisemapping.rest"/>
<context:annotation-config/>
<mvc:annotation-driven/>
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<value>com.wisemapping.rest.model.RestMindmap</value>
2012-03-15 05:21:46 +01:00
<value>com.wisemapping.rest.model.RestMindmapInfo</value>
2012-02-20 18:42:07 +01:00
<value>com.wisemapping.rest.model.RestMindmapList</value>
<value>com.wisemapping.rest.model.RestUser</value>
<value>com.wisemapping.rest.model.RestErrors</value>
2012-06-09 20:49:19 +02:00
<value>com.wisemapping.rest.model.RestCollaboration</value>
<value>com.wisemapping.rest.model.RestCollaborationList</value>
</list>
</property>
</bean>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="defaultContentType" value="application/json"/>
<property name="mediaTypes">
<map>
<entry key="html" value="text/html"/>
2012-02-20 18:42:07 +01:00
<entry key="xml" value="application/xml"/>
2012-02-13 01:57:11 +01:00
<entry key="json" value="application/json"/>
<entry key="freemind" value="application/freemind"/>
<entry key="pdf" value="application/pdf"/>
<entry key="png" value="image/png"/>
2012-06-03 23:12:56 +02:00
<entry key="jpg" value="image/jpeg"/>
<entry key="svg" value="image/svg+xml"/>
<entry key="wxml" value="application/wisemapping+xml"/>
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
2012-02-13 01:57:11 +01:00
<property name="prefix" value="/WEB-INF/jsp-rest/"/>
<property name="suffix" value=".jsp"/>
</bean>
</list>
</property>
<property name="defaultViews">
2012-02-13 01:57:11 +01:00
<list>
2012-03-12 14:48:54 +01:00
<bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<property name="extractValueFromSingleKeyModel" value="true"/>
</bean>
<bean class="org.springframework.web.servlet.view.xml.MarshallingView">
<constructor-arg ref="jaxbMarshaller"/>
</bean>
2012-02-13 01:57:11 +01:00
</list>
</property>
</bean>
<bean id="transformViewPdf" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="application/pdf"/>
</bean>
<bean id="transformViewPng" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="image/png"/>
</bean>
<bean id="transformViewJpeg" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="image/jpeg"/>
</bean>
<bean id="transformViewFreemind" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="application/freemind"/>
</bean>
<bean id="transformViewSvg" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="image/svg+xml"/>
</bean>
<bean id="transformViewWise" class="com.wisemapping.rest.view.TransformView">
<constructor-arg value="application/wisemapping+xml"/>
</bean>
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<list>
<value>messages</value>
</list>
</property>
</bean>
</beans>