mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 12:03:09 +00:00
Item counters added to Communities and Collections REST API
This commit is contained in:
@@ -29,6 +29,7 @@ import javax.persistence.Table;
|
||||
import javax.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;
|
||||
@@ -336,4 +337,12 @@ public class Collection extends DSpaceObject implements DSpaceObjectLegacySuppor
|
||||
return collectionService;
|
||||
}
|
||||
|
||||
public int getAllItems() {
|
||||
try {
|
||||
return collectionService.countArchivedItem(this);
|
||||
} catch (ItemCountException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user