Skip to content

Commit

Permalink
Merge pull request #2 from futures/fcrepo-legacy-api
Browse files Browse the repository at this point in the history
move legacy api to its own module
  • Loading branch information
cbeer committed Feb 8, 2013
2 parents 0246961 + 347739b commit 1c97276
Show file tree
Hide file tree
Showing 28 changed files with 695 additions and 61 deletions.
7 changes: 7 additions & 0 deletions fcrepo-dc/pom.xml
Expand Up @@ -15,6 +15,13 @@
<artifactId>fcrepo-kernel</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-legacy-api</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions fcrepo-dc/src/test/resources/spring-test/generator.xml
Expand Up @@ -17,8 +17,8 @@
<jaxrs:server address="http://localhost:8080">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.generator.DublinCore"/>
<bean class="org.fcrepo.FedoraObjects"/>
<bean class="org.fcrepo.FedoraDatastreams"/>
<bean class="org.fcrepo.api.legacy.FedoraObjects"/>
<bean class="org.fcrepo.api.legacy.FedoraDatastreams"/>
</jaxrs:serviceBeans>
</jaxrs:server>

Expand Down
35 changes: 12 additions & 23 deletions fcrepo-kernel/pom.xml
Expand Up @@ -91,11 +91,6 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-cxf-rt</artifactId>
<version>${enunciate.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
Expand All @@ -110,7 +105,6 @@

<build>
<plugins>

<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
Expand Down Expand Up @@ -156,7 +150,18 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -183,22 +188,6 @@
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
<version>${enunciate.version}</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
<configuration>
<configFile>${basedir}/src/main/enunciate/enunciate.xml</configFile>
<docsDir>${project.build.directory}/docs</docsDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Expand Up @@ -43,7 +43,7 @@ public abstract class AbstractResource extends Constants {
* Useful for constructing URLs
*/
@Context
UriInfo uriInfo;
protected UriInfo uriInfo;

/**
* Jackson JSON mapper. Should eventually be replaced by the use of proper
Expand Down
177 changes: 177 additions & 0 deletions fcrepo-legacy-api/pom.xml
@@ -0,0 +1,177 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo</artifactId>
<version>4.0-SNAPSHOT</version>
</parent>

<artifactId>fcrepo-legacy-api</artifactId>
<packaging>jar</packaging>

<name>fcrepo 3.x compatible REST API</name>

<dependencies>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-kernel</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</dependency>
<!-- test gear -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-cxf-rt</artifactId>
<version>${enunciate.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-extension-providers</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-kernel</artifactId>
<version>${project.version}</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<configuration>
<args>
<arg>-feature</arg>
</args>
</configuration>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/scala</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-cxf-plugin</artifactId>
<version>${enunciate.version}</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
<configuration>
<configFile>${basedir}/src/main/enunciate/enunciate.xml</configFile>
<docsDir>${project.build.directory}/docs</docsDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>



</project>
@@ -1,4 +1,4 @@
package org.fcrepo;
package org.fcrepo.api.legacy;

import static com.google.common.collect.ImmutableSet.builder;
import static java.util.Collections.singletonList;
Expand All @@ -7,7 +7,7 @@
import static javax.ws.rs.core.Response.created;
import static javax.ws.rs.core.Response.notAcceptable;
import static javax.ws.rs.core.Response.ok;
import static org.fcrepo.FedoraObjects.getObjectSize;
import static org.fcrepo.api.legacy.FedoraObjects.getObjectSize;
import static org.fcrepo.jaxb.responses.DatastreamProfile.DatastreamStates.A;
import static org.modeshape.jcr.api.JcrConstants.JCR_CONTENT;
import static org.modeshape.jcr.api.JcrConstants.JCR_DATA;
Expand Down Expand Up @@ -37,6 +37,7 @@
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.fcrepo.AbstractResource;
import org.fcrepo.jaxb.responses.DatastreamHistory;
import org.fcrepo.jaxb.responses.DatastreamProfile;
import org.fcrepo.jaxb.responses.ObjectDatastreams;
Expand Down
@@ -1,4 +1,4 @@
package org.fcrepo;
package org.fcrepo.api.legacy;

import static com.google.common.collect.Collections2.transform;
import static com.google.common.collect.DiscreteDomains.integers;
Expand All @@ -16,6 +16,7 @@
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import org.fcrepo.AbstractResource;
import org.fcrepo.jaxb.responses.NextPid;

import com.google.common.base.Function;
Expand Down
@@ -1,4 +1,4 @@
package org.fcrepo;
package org.fcrepo.api.legacy;

import static com.google.common.collect.ImmutableSet.builder;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
Expand All @@ -24,6 +24,7 @@

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.fcrepo.AbstractResource;
import org.fcrepo.jaxb.responses.NamespaceListing;
import org.fcrepo.jaxb.responses.NamespaceListing.Namespace;

Expand Down
@@ -1,12 +1,12 @@
package org.fcrepo;
package org.fcrepo.api.legacy;

import static com.google.common.collect.Collections2.transform;
import static com.google.common.collect.ImmutableSet.copyOf;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static javax.ws.rs.core.MediaType.TEXT_XML;
import static javax.ws.rs.core.Response.created;
import static javax.ws.rs.core.Response.ok;
import static org.fcrepo.FedoraDatastreams.getContentSize;
import static org.fcrepo.api.legacy.FedoraDatastreams.getContentSize;
import static org.fcrepo.jaxb.responses.ObjectProfile.ObjectStates.A;

import java.io.IOException;
Expand All @@ -22,6 +22,7 @@
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.fcrepo.AbstractResource;
import org.fcrepo.jaxb.responses.ObjectProfile;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
@@ -1,4 +1,4 @@
package org.fcrepo;
package org.fcrepo.api.legacy;

import static com.google.common.collect.ImmutableMap.builder;
import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
Expand All @@ -22,6 +22,7 @@

import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.map.JsonMappingException;
import org.fcrepo.AbstractResource;
import org.fcrepo.jaxb.responses.DescribeRepository;
import org.modeshape.jcr.api.nodetype.NodeTypeManager;
import org.slf4j.Logger;
Expand Down
Expand Up @@ -19,11 +19,11 @@

<jaxrs:server address="/rest">
<jaxrs:serviceBeans>
<bean class="org.fcrepo.FedoraRepository"/>
<bean class="org.fcrepo.FedoraDatastreams"/>
<bean class="org.fcrepo.FedoraIdentifiers"/>
<bean class="org.fcrepo.FedoraNamespaces"/>
<bean class="org.fcrepo.FedoraObjects"/>
<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.foxml.FedoraOXML"/>
</jaxrs:serviceBeans>
<jaxrs:extensionMappings>
Expand Down

0 comments on commit 1c97276

Please sign in to comment.