crafter.core.rest-context.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2007-2019 Crafter Software Corporation. All Rights Reserved.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven/>
<bean id="crafter.cacheRestController" class="org.craftercms.core.controller.rest.CacheRestController">
<property name="cacheTemplate" ref="crafter.cacheTemplate"/>
<property name="storeService" ref="crafter.contentStoreService"/>
</bean>
<bean id="crafter.contentStoreRestController" class="org.craftercms.core.controller.rest.ContentStoreRestController">
<property name="storeService" ref="crafter.contentStoreService"/>
<property name="allowedUrlPatterns" value="${crafter.core.rest.content.store.url.allowedPatterns}"/>
<property name="forbiddenUrlPatterns" value="${crafter.core.rest.content.store.url.forbiddenPatterns}"/>
</bean>
<!-- Main REST view resolver -->
<bean id="crafter.mainViewResolver" class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="defaultViews">
<list>
<ref bean="crafter.jsonView"/>
<ref bean="crafter.xmlView"/>
</list>
</property>
</bean>
<!-- JSON -->
<bean id="crafter.coreObjectMapper" class="org.craftercms.commons.jackson.CustomSerializationObjectMapper">
<property name="serializers">
<list>
<bean class="org.craftercms.core.util.json.jackson.Dom4jDocumentJsonSerializer"/>
</list>
</property>
</bean>
<bean id="crafter.jsonView" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
<property name="objectMapper" ref="crafter.coreObjectMapper"/>
<property name="disableCaching" value="${crafter.core.rest.views.json.disableCaching}"/>
<property name="prefixJson" value="${crafter.core.rest.views.json.prefixJson}"/>
<property name="extractValueFromSingleKeyModel"
value="${crafter.core.rest.views.json.renderSingleAttributeAsRootObject}"/>
</bean>
<!-- XML -->
<bean id="crafter.xmlMarshaller" class="org.craftercms.core.util.xml.marshalling.xstream.CrafterXStreamMarshaller">
<property name="unsupportedClasses" value="org.springframework.validation.BindingResult"/>
</bean>
<bean id="crafter.xmlView" class="org.springframework.web.servlet.view.xml.MarshallingView">
<constructor-arg ref="crafter.xmlMarshaller"/>
</bean>
</beans> © 2015 - 2025 Weber Informatics LLC | Privacy Policy