mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
Fix for DS-1029: AIP Backup & Restore unable to auto-create metadata fields on restore/ingest ('createMetadataFields' option is ignored). Essentially all this does is slightly reorganize the logic. We need to ensure the 'finishObject()' method (which does various "finishing" work to auto-create any missing metadata fields as needed) is called *before* an Item is created.
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6764 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -502,6 +502,11 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
|||||||
// have subclass manage license since it may be extra package file.
|
// have subclass manage license since it may be extra package file.
|
||||||
addLicense(context, item, license, collection, params);
|
addLicense(context, item, license, collection, params);
|
||||||
|
|
||||||
|
// Subclass hook for final checks and rearrangements
|
||||||
|
// (this allows subclasses to do some final validation / changes as
|
||||||
|
// necessary)
|
||||||
|
finishObject(context, dso, params);
|
||||||
|
|
||||||
// Finally, if item is still in the workspace, then we actually need
|
// Finally, if item is still in the workspace, then we actually need
|
||||||
// to install it into the archive & assign its handle.
|
// to install it into the archive & assign its handle.
|
||||||
if(wsi!=null)
|
if(wsi!=null)
|
||||||
@@ -522,10 +527,20 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
|||||||
//Add template item if one is referenced from manifest (only for Collections)
|
//Add template item if one is referenced from manifest (only for Collections)
|
||||||
addTemplateItem(context, dso, manifest, pkgFile, params, callback);
|
addTemplateItem(context, dso, manifest, pkgFile, params, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Subclass hook for final checks and rearrangements
|
||||||
|
// (this allows subclasses to do some final validation / changes as
|
||||||
|
// necessary)
|
||||||
|
finishObject(context, dso, params);
|
||||||
}// end if Community/Collection
|
}// end if Community/Collection
|
||||||
else if (type == Constants.SITE)
|
else if (type == Constants.SITE)
|
||||||
{
|
{
|
||||||
// Do nothing -- Crosswalks will handle anything necessary to ingest at Site-level
|
// Do nothing by default -- Crosswalks will handle anything necessary to ingest at Site-level
|
||||||
|
|
||||||
|
// Subclass hook for final checks and rearrangements
|
||||||
|
// (this allows subclasses to do some final validation / changes as
|
||||||
|
// necessary)
|
||||||
|
finishObject(context, dso, params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -537,11 +552,6 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester
|
|||||||
// -- Step 6 --
|
// -- Step 6 --
|
||||||
// Finish things up!
|
// Finish things up!
|
||||||
|
|
||||||
// Subclass hook for final checks and rearrangements
|
|
||||||
// (this allows subclasses to do some final validation / changes as
|
|
||||||
// necessary)
|
|
||||||
finishObject(context, dso, params);
|
|
||||||
|
|
||||||
// Update the object to make sure all changes are committed
|
// Update the object to make sure all changes are committed
|
||||||
PackageUtils.updateDSpaceObject(dso);
|
PackageUtils.updateDSpaceObject(dso);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user