Skip to content

Commit

Permalink
Merge pull request #9 from fcrepo4-labs/fedora-uris
Browse files Browse the repository at this point in the history
Add support for object-to-object linking in migrated resources.
  • Loading branch information
ruebot committed May 6, 2015
2 parents f110262 + 5284e9c commit 49f4af1
Show file tree
Hide file tree
Showing 7 changed files with 414 additions and 68 deletions.
209 changes: 174 additions & 35 deletions pom.xml
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<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>

Expand Down Expand Up @@ -52,7 +53,7 @@
<version>4.3.6</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
Expand Down Expand Up @@ -101,6 +102,13 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-webapp</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
</dependency>
</dependencies>

<repositories>
Expand All @@ -116,7 +124,7 @@
<enabled>true</enabled>
</snapshots>
</repository>

</repositories>

<pluginRepositories>
Expand All @@ -133,49 +141,180 @@
</pluginRepository>
</pluginRepositories>


<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.12</version>
<configuration>
<configuration>
<properties>
<cargo.servlet.port>${fcrepo.dynamic.test.port}</cargo.servlet.port>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-webapp</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-build-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
<failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
<configLocation>fcrepo-checkstyle/checkstyle.xml</configLocation>
<suppressionsLocation>fcrepo-checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
<executions>
<execution>
<id>checkstyle</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${checkstyle.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.fcrepo</groupId>
<artifactId>fcrepo-build-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<configuration>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
<failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
<configLocation>fcrepo-checkstyle/checkstyle.xml</configLocation>
<suppressionsLocation>fcrepo-checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
</configuration>
<executions>
<execution>
<id>checkstyle</id>
<phase>verify</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-test-resources</phase>
<configuration>
<portNames>
<!-- reserve ports for integration tests -->
<portName>fcrepo.dynamic.jms.port</portName>
<portName>fcrepo.dynamic.test.port</portName>
<portName>fcrepo.dynamic.stomp.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<!-- export ports for integration tests to system.env-->
<systemPropertyVariables>
<fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
<fcrepo.dynamic.test.port>${fcrepo.dynamic.test.port}</fcrepo.dynamic.test.port>
<fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
<integration-test>true</integration-test>
</systemPropertyVariables>
</configuration>
<executions>
<execution>
<id>perform-it</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify-it</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>start-cargo</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-cargo</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>jetty7x</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>jetty7x</containerId>
<artifactInstaller>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-distribution</artifactId>
<version>7.6.15.v20140411</version>
</artifactInstaller>
<systemProperties>
<fcrepo.dynamic.jms.port>${fcrepo.dynamic.jms.port}</fcrepo.dynamic.jms.port>
<fcrepo.dynamic.stomp.port>${fcrepo.dynamic.stomp.port}</fcrepo.dynamic.stomp.port>
</systemProperties>
</container>
</configuration>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>
22 changes: 16 additions & 6 deletions src/main/java/org/fcrepo/migration/MigrationIDMapper.java
Expand Up @@ -3,24 +3,34 @@
/**
* An interface whose implementations represent methods to
* convert Fedora 3 PIDs into fedora 4 paths.
*
* At one point it was thought that this should be more sophisticated
* to support more advanced mapping (ie, passing more information about
* the object, but in order to use this to resolve the "fedora:info/pid"
* URI's within fedora's RELS-EXT we only have the pid. Therefore
* implementations that need to do something more sophisticated, should
* build a mapping using whatever tooling it needs (and has available)
* such that it can return the result with just the PID.
*
* @author mdurbin
*/
public interface MigrationIDMapper {

/**
* Takes a Fedora 3 Object reference and returns the path
* Takes a Fedora 3 pid and returns the path
* that object would have in Fedora 4.
* @param object an ObjectReference for a Fedora 3 object.
* @param pid a PID for a Fedora 3 object.
* @return a path suitable for use in Fedora 4.
*/
public String mapObjectPath(ObjectReference object);
public String mapObjectPath(String pid);

/**
* Takes a Fedora 3 DatastreamInfo object and returns the path
* Takes a Fedora 3 PID and DSID and returns the path
* that datastream would have in Fedora 4.
* @param dsInfo a DatastreamInfo for a Fedora 3 datastream
* @param pid a PID for the Fedora 3 object
* @param dsid the DS id for the Fedora 3 datastream
* @return a path suitable for use in Fedora 4.
*/
public String mapDatastreamPath(DatastreamInfo dsInfo);
public String mapDatastreamPath(String pid, String dsid);

}

0 comments on commit 49f4af1

Please sign in to comment.