Skip to content

Commit

Permalink
Merge pull request sakaiproject#519 from bkirschn/master
Browse files Browse the repository at this point in the history
SAK-29160 Extend Resources to include the amount of storage used in the site
  • Loading branch information
bethkirschner committed May 15, 2015
2 parents e457c65 + 1570c7b commit 5ddaf2d
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public List<ContentItem> getContentCollectionForSite(EntityView view) {
private List<ContentItem> getSiteListItems(String siteId) {
List<ContentItem> rv = new ArrayList<ContentItem>();
String wsCollectionId = contentHostingService.getSiteCollection(siteId);
boolean allowUpdateSite = siteService.allowUpdateSite(siteId);

try
{
// mark the site collection as expanded
Expand All @@ -179,6 +181,10 @@ private List<ContentItem> getSiteListItems(String siteId) {
ContentItem item = new ContentItem();
item.setType("collection");
item.setSize(contentHostingService.getCollectionSize(id));
if (allowUpdateSite) // to be consistent with UI
item.setQuota(Long.toString(contentHostingService.getQuota(collection)));
item.setUsage(Long.toString(collection.getBodySizeK() * 1024));

List<String> collectionMembers = collection.getMembers();
if (collectionMembers != null)
{
Expand Down Expand Up @@ -515,6 +521,12 @@ public static class ContentItem {

@Getter @Setter
private String copyrightAlert;

@Getter @Setter
private String quota;

@Getter @Setter
private String usage;
}

/**
Expand Down

0 comments on commit 5ddaf2d

Please sign in to comment.