diff --git a/dspace/CHANGES b/dspace/CHANGES index bc70af70de..6abf480f39 100644 --- a/dspace/CHANGES +++ b/dspace/CHANGES @@ -44,6 +44,7 @@ - SF patch #1490980 Fix for SF bugs #1456311, #1221954 Communities and Collections without name - included some missing i18n tags - SF patch #1490891 Submission Step 1 not authorized note and navigation back +- SF patch #1556316 for SF bugs #1552807, #1333269 and general deletion of Collection (Richard Jones) - SF bug #1515075. minor build file fix to copy correct config file diff --git a/dspace/src/org/dspace/content/Collection.java b/dspace/src/org/dspace/content/Collection.java index a3da161981..c6b1681597 100644 --- a/dspace/src/org/dspace/content/Collection.java +++ b/dspace/src/org/dspace/content/Collection.java @@ -303,7 +303,7 @@ public class Collection extends DSpaceObject } /** - * Get all the items in this collection. The order is indeterminate. + * Get the in_archive items in this collection. The order is indeterminate. * * @return an iterator over the items in the collection. * @throws SQLException @@ -322,6 +322,24 @@ public class Collection extends DSpaceObject } /** + * Get all the items in this collection. The order is indeterminate. + * + * @return an iterator over the items in the collection. + * @throws SQLException + */ + public ItemIterator getAllItems() throws SQLException + { + String myQuery = "SELECT item.* FROM item, collection2item WHERE " + + "item.item_id=collection2item.item_id AND " + + "collection2item.collection_id= ? "; + + TableRowIterator rows = DatabaseManager.queryTable(ourContext, "item", + myQuery,getID()); + + return new ItemIterator(ourContext, rows); + } + + /** * Get the internal ID of this collection * * @return the internal identifier @@ -911,8 +929,11 @@ public class Collection extends DSpaceObject "DELETE FROM subscription WHERE collection_id= ? ", getID()); + // Remove Template Item + removeTemplateItem(); + // Remove items - ItemIterator items = getItems(); + ItemIterator items = getAllItems(); while (items.hasNext()) {