AIP Backup/Restore Bug Fix: Restore of an entire Site to an empty DSpace install was erroring out. The "Site" AIP needs a special case, as in reality it contains no content to restore (at least not yet -- some will be coming). Rather, it should just be used to determine the Top-Level Communities to restore, so that the recursion can begin properly.

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5274 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Tim Donohue
2010-08-17 20:57:12 +00:00
parent d81ce1c908
commit 46109a2ab3

View File

@@ -60,6 +60,7 @@ import org.dspace.content.Community;
import org.dspace.content.DSpaceObject;
import org.dspace.content.FormatIdentifier;
import org.dspace.content.Item;
import org.dspace.content.Site;
import org.dspace.content.WorkspaceItem;
import org.dspace.content.crosswalk.CrosswalkException;
import org.dspace.content.crosswalk.MetadataValidationException;
@@ -235,17 +236,33 @@ public abstract class AbstractMETSIngester
params.addProperty("ignoreParent", "true");
}
//Actually ingest the object described by the METS Manifest
dso = ingestObject(context, parent, manifest, pkgFile,
params, license);
//Figure out the type of object we are ingesting
int type = getObjectType(manifest);
//Log whether we finished an ingest (create new obj) or a restore (restore previously existing obj)
String action = "package_ingest";
if(params.restoreModeEnabled())
action = "package_restore";
log.info(LogManager.getHeader(context, action,
"Created new Object, type=" + Constants.typeText[dso.getType()] +
", handle=" + dso.getHandle() + ", dbID=" + String.valueOf(dso.getID())));
// If this is a full DSpace SITE we are ingesting
if(type==Constants.SITE)
{
//For now, do nothing -- SITE AIP has nothing that needs restoring
//But it does contain a list of Top-Level communities
//(which will be handled by recursion below)
// return the Site object
dso = Site.find(context, Site.SITE_ID);
}
else // Not a SITE manifest, that means there's content to ingest
{
//Actually ingest the object described by the METS Manifest
dso = ingestObject(context, parent, manifest, pkgFile,
params, license);
//Log whether we finished an ingest (create new obj) or a restore (restore previously existing obj)
String action = "package_ingest";
if(params.restoreModeEnabled())
action = "package_restore";
log.info(LogManager.getHeader(context, action,
"Created new Object, type=" + Constants.typeText[dso.getType()] +
", handle=" + dso.getHandle() + ", dbID=" + String.valueOf(dso.getID())));
}
// Check if the Packager is currently running recursively.
// If so, this means the Packager will attempt to recursively