Resolving another small METS validation bug in AIP code. The METS @ID attribute doesn't allow a "/" (slash). Fixing the generated @ID value so that it instead includes the Handle with any slashes replaced with dashes. Also fixed a possible NullPointerException if Handle==null.

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5425 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2010-10-13 17:59:35 +00:00
parent baae889ed0
commit 15de1cc640

View File

@@ -733,8 +733,12 @@ public abstract class AbstractMETSDisseminator
// Create the METS manifest in memory
Mets mets = new Mets();
// this ID should be globally unique
mets.setID("DSpace-" + Constants.typeText[dso.getType()] +"-" + dso.getHandle());
String identifier = "DB-ID-" + dso.getID();
if(dso.getHandle()!=null)
identifier = dso.getHandle().replace('/', '-');
// this ID should be globally unique (format: DSpace_[objType]_[handle with slash replaced with a dash])
mets.setID("DSpace_" + Constants.typeText[dso.getType()] + "_" + identifier);
// identifies the object described by this document
mets.setOBJID(makePersistentID(dso));