uuid-datepath-idmapper has been tested against Fedora 3.5 and 3.6.1, but should work with 3.4.x. In all cases, Fedora must be configured to use Akubra as the low-level storage module (the default). uuid-datepath-idmapper is not compatible with the legacy low-level storage module.
Make uuid-datepath-idmapper and any required dependencies (e.g. java-uuid-generator) available to the classpath of the servlet container where Fedora is deployed.
For example, if Fedora is deployed with Tomcat, copy uuid-datepath-idmapper-NNN.jar and java-uuid-generator-NNN.jar to $CATALINA_HOME/webapps/fedora/WEB-INF/lib/.
As of version 0.2, uuid-datepath-idmapper also packages a with-jug-dependency.jar which includes the required java-uuid-generator classes so that you need only install a single jar. The with-all-dependencies.jar includes, as the name suggests, all dependencies of the project. However, with the exception of java-uuid-generator, those dependencies are already provided by Fedora and so the with-all-dependencies.jar is probably only useful to non-Fedora based deployment or uses of uuid-datepath-idmapper.
Update $FEDORA_HOME/server/config/spring/akubra-llstore.xml so that uuid-datepath-idmapper is used instead of the default HashPathIdMapper, e.g.:
<bean name="fallbackIdMapper" class="org.fcrepo.server.storage.lowlevel.akubra.HashPathIdMapper" singleton="true"> <constructor-arg value="##/##" /> </bean> <bean name="fsObjectStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> </bean> <bean name="fsDatastreamStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> </bean>
The fallbackIdMapper is the IdMapper that uuid-datepath-idmapper will use when encountering PIDs that are not type 1 UUIDs.
Although uuid-datepath-idmapper includes a default fallback IdMapper implementation (TrivialIdMapper), it is not intended for serious (i.e. production) use.
To configure the format of the path that uuid-datepath-idmapper will construct, add a dateFormat constructor-arg, e.g.:
<bean name="fsObjectStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg value="yyyy/MM/dd/HH/mm" /> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> </bean> <bean name="fsDatastreamStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg value="yyyy/MM/dd/HH/mm" /> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> </bean>
The default dateFormat is "yyyy/MM/dd" (e.g. 2012/01/13). For more details on supported date format patterns, consult the joda-time DateTimeFormat documentation.
As of version 0.3, uuid-datepath-idmapper also supports an IdMapperPrefixer. At this writing, the only implementation of IdMapperPrefixer is FedoraNamespacePrefixer which prefixes the path with the namespace of the Fedora PID. For example, given the type 1 UUID-based PID demo:25f814ce-f5ac-11e0-b139-2837370107a5, uuid-datepath-idmapper would return a path such as 2011/10/13/. However, configured with FedoraNamespacePrefixer, uuid-datepath-idmapper would return demo/2011/10/13/.
The following configuration example shows the use of uuid-datepath-idmapper with FedoraNamespacePrefixer as well as PrefixingHashPathIdMapper as a fallback IdMapper. PrefixingHashPathIdMapper is simply an extension of org.fcrepo.server.storage.lowlevel.akubra.HashPathIdMapper that accepts an IdMapperPrefixer.
<bean name="prefixer" class="com.yourmediashelf.fedora.akubra.FedoraNamespacePrefixer" singleton="true"> </bean> <bean name="fallbackIdMapper" class="com.yourmediashelf.fedora.akubra.PrefixingHashPathIdMapper" singleton="true"> <constructor-arg value="##/##" /> <constructor-arg> <ref bean="prefixer" /> </constructor-arg> </bean> <bean name="fsObjectStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> <constructor-arg> <ref bean="prefixer" /> </constructor-arg> </bean> <bean name="fsDatastreamStoreMapper" class="com.yourmediashelf.fedora.akubra.UUIDDatePathIdMapper" singleton="true"> <constructor-arg> <ref bean="fallbackIdMapper" /> </constructor-arg> <constructor-arg> <ref bean="prefixer" /> </constructor-arg> </bean>