[DS-899] Last modified timestamp doesn't trigger on bitstream delete bugfix

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6887 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Kevin Van de Velde
2011-12-07 16:23:00 +00:00
parent 7936c6d997
commit 1f08bc6702
2 changed files with 27 additions and 1 deletions

View File

@@ -491,6 +491,14 @@ public class Bundle extends DSpaceObject
// Place the bitstream in the list of bitstreams in this bundle
bitstreams.add(bitstreamMap.get(bitstreamId));
}
//The order of the bitstreams has changed, ensure that we update the last modified of our item
Item owningItem = (Item) getParentObject();
if(owningItem != null)
{
owningItem.updateLastModified();
owningItem.update();
}
}
@@ -531,7 +539,16 @@ public class Bundle extends DSpaceObject
}
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(), Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID())));
//Ensure that the last modified from the item is triggered !
Item owningItem = (Item) getParentObject();
if(owningItem != null)
{
owningItem.updateLastModified();
owningItem.update();
}
// In the event that the bitstream to remove is actually
// the primary bitstream, be sure to unset the primary
// bitstream.

View File

@@ -306,6 +306,15 @@ public class Item extends DSpaceObject
return myDate;
}
/**
* Method that updates the last modified date of the item
* The modified boolean will be set to true and the actual date update will occur on item.update().
*/
void updateLastModified()
{
modified = true;
}
/**
* Set the "is_archived" flag. This is public and only
* <code>WorkflowItem.archive()</code> should set this.