DS-1990: Events should contain all identifiers, not only handles.

This commit is contained in:
Pascal-Nicolas Becker
2014-05-15 21:29:53 +02:00
parent 2dec016ed2
commit b1e822a87f
13 changed files with 299 additions and 49 deletions

View File

@@ -201,6 +201,9 @@ public class Bundle extends DSpaceObject
log.info(LogManager.getHeader(context, "create_bundle", "bundle_id="
+ row.getIntColumn("bundle_id")));
// if we ever use the identifier service for bundles, we should
// create the bundle before we create the Event and should add all
// identifiers to it.
context.addEvent(new Event(Event.CREATE, Constants.BUNDLE, row.getIntColumn("bundle_id"), null));
return new Bundle(context, row);
@@ -443,7 +446,9 @@ public class Bundle extends DSpaceObject
// Add the bitstream object
bitstreams.add(b);
ourContext.addEvent(new Event(Event.ADD, Constants.BUNDLE, getID(), Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID())));
ourContext.addEvent(new Event(Event.ADD, Constants.BUNDLE, getID(),
Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID()),
lookupIdentifiers(ourContext)));
// copy authorization policies from bundle to bitstream
// FIXME: multiple inclusion is affected by this...
@@ -546,7 +551,9 @@ public class Bundle extends DSpaceObject
}
}
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(), Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID())));
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(),
Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID()),
lookupIdentifiers(ourContext)));
//Ensure that the last modified from the item is triggered !
Item owningItem = (Item) getParentObject();
@@ -606,12 +613,14 @@ public class Bundle extends DSpaceObject
if (modified)
{
ourContext.addEvent(new Event(Event.MODIFY, Constants.BUNDLE, getID(), null));
ourContext.addEvent(new Event(Event.MODIFY, Constants.BUNDLE, getID(),
null, lookupIdentifiers(ourContext)));
modified = false;
}
if (modifiedMetadata)
{
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.BUNDLE, getID(), null));
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.BUNDLE,
getID(), null, lookupIdentifiers(ourContext)));
modifiedMetadata = false;
}
@@ -628,7 +637,8 @@ public class Bundle extends DSpaceObject
log.info(LogManager.getHeader(ourContext, "delete_bundle", "bundle_id="
+ getID()));
ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(), getName()));
ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(),
getName(), lookupIdentifiers(ourContext)));
// Remove from cache
ourContext.removeCached(this, getID());