Skip to content

Commit

Permalink
Merge pull request #2 from futures/cmis
Browse files Browse the repository at this point in the history
CMIS and fcrepo-rss support
  • Loading branch information
Edwin Shin committed Feb 28, 2013
2 parents d108c93 + 2f81c91 commit 9c3e1dd
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -32,9 +32,14 @@

<!-- CMIS dependencies derived from modeshape-web-cmis-war/pom.xml -->
<dependency>
<!--
<groupId>org.modeshape</groupId>
<artifactId>modeshape-web-cmis</artifactId>
<version>${modeshape.version}</version>
-->
<groupId>org.fcrepo</groupId>
<artifactId>modeshape-web-cmis</artifactId>
<version>3.2-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
Expand Down
111 changes: 111 additions & 0 deletions src/main/resources/spring/rest.xml
@@ -0,0 +1,111 @@
<?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:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">

<import resource="classpath:META-INF/cxf/cxf.xml"/>

<!-- Context that houses JAX-RS Resources that compose the API
as well as som utility gear. -->

<context:annotation-config/>

<!-- Mints PIDs-->
<bean class="org.fcrepo.identifiers.UUIDPidMinter"/>

<jaxrs:server address="/v3">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.api.legacy.FedoraRepository"/>
<bean class="org.fcrepo.api.legacy.FedoraDatastreams"/>
<bean class="org.fcrepo.api.legacy.FedoraIdentifiers"/>
<bean class="org.fcrepo.api.legacy.FedoraNamespaces"/>
<bean class="org.fcrepo.api.legacy.FedoraObjects"/>
<bean class="org.fcrepo.generator.DublinCore"/>
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json"/>
<entry key="xml" value="application/xml"/>
</jaxrs:extensionMappings>
<jaxrs:providers>
<ref bean="pathNotFoundExceptionMapper"/>
<ref bean="accessControlExceptionMapper"/>
<ref bean="wildcardExceptionMapper"/>
<ref bean="jaxbElementProvider"/>
<ref bean="jsonProvider"/>
</jaxrs:providers>
</jaxrs:server>

<jaxrs:server address="/rest">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.api.FedoraRepository"/>
<bean class="org.fcrepo.api.FedoraDatastreams"/>
<bean class="org.fcrepo.api.FedoraIdentifiers"/>
<bean class="org.fcrepo.api.FedoraNamespaces"/>
<bean class="org.fcrepo.api.FedoraObjects"/>
<bean class="org.fcrepo.generator.DublinCore"/>
<bean class="org.fcrepo.syndication.RSSPublisher"/>
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
<entry key="json" value="application/json"/>
<entry key="xml" value="application/xml"/>
</jaxrs:extensionMappings>
<jaxrs:providers>
<ref bean="pathNotFoundExceptionMapper"/>
<ref bean="accessControlExceptionMapper"/>
<ref bean="wildcardExceptionMapper"/>
<ref bean="jaxbElementProvider"/>
<ref bean="jsonProvider"/>
<bean class="org.apache.cxf.jaxrs.provider.XSLTJaxbProvider">
<property name="outMediaTemplates">
<map>
<entry key="text/html" value="classpath:/views/object.xslt"/>
</map>
</property>
<!--
<property name="resolver">
<bean class="org.apache.xml.resolver.helpers.BootstrapResolver"/>
</property>
-->
</bean>
</jaxrs:providers>
</jaxrs:server>

<jaxrs:server address="/rest/modeshape">
<jaxrs:serviceBeans>
<bean class="org.modeshape.web.jcr.rest.ModeShapeRestService"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
<bean class="org.modeshape.web.jcr.rest.output.HtmlBodyWriter"/>
<bean class="org.modeshape.web.jcr.rest.output.JSONBodyWriter"/>
<bean class="org.modeshape.web.jcr.rest.output.TextBodyWriter"/>
</jaxrs:providers>
</jaxrs:server>

<bean name="pathNotFoundExceptionMapper"
class="org.fcrepo.exceptionhandlers.PathNotFoundExceptionMapper"/>
<bean name="accessControlExceptionMapper"
class="org.fcrepo.exceptionhandlers.AccessControlExceptionMapper"/>
<bean name="wildcardExceptionMapper"
class="org.fcrepo.exceptionhandlers.WildcardExceptionMapper">
<property name="showStackTrace" value="true"/>
</bean>
<bean name="jaxbElementProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
<property name="marshallerProperties">
<util:map>
<entry key="jaxb.formatted.output">
<value type="java.lang.Boolean">true</value>
</entry>
</util:map>
</property>
</bean>
<bean name="jsonProvider" class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
<property name="ignoreNamespaces" value="true"/>
</bean>
</beans>

0 comments on commit 9c3e1dd

Please sign in to comment.