{
Division viewer = home.addDivision("community-view","secondary");
ReferenceSet referenceSet = viewer.addReferenceSet("community-view",
ReferenceSet.TYPE_DETAIL_VIEW);
Reference communityInclude = referenceSet.addReference(community);
// If the community has any children communities also reference them.
if (subCommunities != null && subCommunities.length > 0)
{
ReferenceSet communityReferenceSet = communityInclude
.addReferenceSet(ReferenceSet.TYPE_SUMMARY_LIST,null,"hierarchy");
communityReferenceSet.setHead(T_head_sub_communities);
// Subcommunities
for (Community subCommunity : subCommunities)
{
communityReferenceSet.addReference(subCommunity);
}
}
if (collections != null && collections.length > 0)
{
ReferenceSet communityReferenceSet = communityInclude
.addReferenceSet(ReferenceSet.TYPE_SUMMARY_LIST,null,"hierarchy");
communityReferenceSet.setHead(T_head_sub_collections);