mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-12 20:43:18 +00:00
Item counters added to Communities and Collections REST API
This commit is contained in:
@@ -25,6 +25,7 @@ import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.dspace.browse.ItemCountException;
|
||||
import org.dspace.content.comparator.NameAscendingComparator;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.CommunityService;
|
||||
@@ -264,4 +265,11 @@ public class Community extends DSpaceObject implements DSpaceObjectLegacySupport
|
||||
return communityService;
|
||||
}
|
||||
|
||||
public int getAllItems() {
|
||||
try {
|
||||
return communityService.getArchivedItems(this);
|
||||
} catch (ItemCountException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user