int memberCount = group.getMembers().length + group.getMemberGroups().length;
row.addCell().addContent(memberCount == 0 ? "-" : String.valueOf(memberCount));
Cell cell = row.addCell();
String groupName = group.getName();
DSpaceObject collectionOrCommunity = null;
String collectionOrCommunityName = null;
int id;
id = FlowGroupUtils.getCollectionId(groupName);
if (id > -1)
{
Collection collection = Collection.find(context, id);
if (collection != null)
{
collectionOrCommunityName = collection.getMetadata("name");
collectionOrCommunity = collection;
}
}
else
{
id = FlowGroupUtils.getCommunityId(groupName);
if (id > -1)
{
Community community = Community.find(context, id);
if (community != null)
{
collectionOrCommunityName = community.getMetadata("name");
collectionOrCommunity = community;
}
}
}
if (collectionOrCommunity != null)
{
if (collectionOrCommunityName == null)
collectionOrCommunityName = "";
else if (collectionOrCommunityName.length() > MAX_COLLECTION_OR_COMMUNITY_NAME)
collectionOrCommunityName = collectionOrCommunityName.substring(0,MAX_COLLECTION_OR_COMMUNITY_NAME-3) + "...";
cell.addContent(collectionOrCommunityName + " ");
Highlight highlight = cell.addHighlight("fade");
highlight.addContent("[");
highlight.addXref(contextPath+"/handle/"+collectionOrCommunity.getHandle(), T_collection_link);
highlight.addContent("]");
}
}