Refactor ItemCounter and ItemCountDAO to act like other DSpace beans. Also ensure they do not cache a Context object.

This commit is contained in:
Tim Donohue
2024-05-15 09:22:35 -05:00
parent 1517e8cd0f
commit 78f1e4190e
15 changed files with 77 additions and 268 deletions

View File

@@ -28,7 +28,6 @@ import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import org.dspace.authorize.AuthorizeException;
import org.dspace.browse.ItemCountException;
import org.dspace.content.comparator.NameAscendingComparator;
import org.dspace.content.factory.ContentServiceFactory;
import org.dspace.content.service.CollectionService;
@@ -335,18 +334,4 @@ public class Collection extends CacheableDSpaceObject implements DSpaceObjectLeg
}
return collectionService;
}
/**
* return count of the collection items
*
* @return int
*/
public int countArchivedItems() {
try {
return collectionService.countArchivedItems(this);
} catch (ItemCountException e) {
throw new RuntimeException(e);
}
}
}