function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Holly Havelka 10Holly Havelka 10 

Help Displaying Chatter Group Files on VisualForce Page Limits

Displaying Chatter Group Files on VisualForce Page Help With Limits
Hi all,

I am running into an issue where I am only able to show (5) Chatter Groups with their respective files at a time on my visualforce page.  

Here is my controller:
public class BTInstructionalTrainingController {
        
    public Map<String, List<ContentVersion>> groupResourceMap {get; set;}
    
    public Set<String> collaborationGroups {get; set;}
    
    public BTInstructionalTrainingController(){
        
        Network portal = [SELECT Id FROM Network WHERE Name = 'Breakthrough Portal'];
        
        List<CollaborationGroupFeed> groupFeeds = [SELECT RelatedRecordId, Title, Parent.Name, NetworkScope FROM CollaborationGroupFeed WHERE Parent.Name LIKE '%#BITLibrary' ORDER By Parent.Name, Title ASC];
        
        Map<String, List<Id>> groupResouceIdMap = new Map<String, List<Id>>();
        
        List<Id> allResourcesIds = new List<Id>();
        
        for (CollaborationGroupFeed feed : groupFeeds) {
            
            if (feed.NetworkScope != portal.Id || Test.isRunningTest()){
                feed.Parent.Name = feed.Parent.Name.replace('#BITLibrary', '');
                
                List<Id> relatedRecordsList = new List<Id>();
                
                if (groupResouceIdMap.get(feed.Parent.Name) != null){
                    relatedRecordsList = groupResouceIdMap.get(feed.Parent.Name);
                }
                
                relatedRecordsList.add(feed.RelatedRecordId);
                groupResouceIdMap.put(feed.Parent.Name, relatedRecordsList);
                allResourcesIds.add(feed.RelatedRecordId);
            }
            
        }
        
        groupResourceMap = new Map<String, List<ContentVersion>>();
        
        Map<Id, ContentVersion> allResources = new Map<Id, ContentVersion>([SELECT Title, Description, CreatedBy.Name, LastModifiedDate, ContentSize, FileType FROM ContentVersion WHERE Id IN :allResourcesIds]);
        
        collaborationGroups = groupResouceIdMap.keySet();
        
        for(String collaborationGroup : collaborationGroups) {
            
            List<ContentVersion> resourcesList = new List<ContentVersion>();
            
            for(Id resourceId : groupResouceIdMap.get(collaborationGroup)) {
                resourcesList.add(allResources.get(resourceId));
            }
            
            groupResourceMap.put(collaborationGroup, resourcesList);
        }
        
    }
}


Here is my visualforce page:
<apex:page controller="BTInstructionalTrainingController">
    
    <style>
        .tableTitle {
            color: #0082C8;
            font-size: 18px;
            font-weight: bold;
            font-family: Clarendon;
        }
        .resourceTable {
            background: none !important;
            border: 0px !important;
        }
        .tableHeader {
            border: none !important;
        }
        .headerRow.tableHeader {
            border-bottom: 2px solid #B2B2B3 !important;
            background: none !important;
        }
        .apexDefaultPageBlock {
            border: 0px !important;
            background: none !important;
        }
        .dataCell {
            border: none !important;
        }
        .data2Col {
            border: none !important;
        }
    </style>
    
    <apex:pageBlock >
    <br/>
    
    <br/>
    </apex:pageBlock>
    
    <apex:pageBlock >
        <apex:pageBlockSection collapsible="false" columns="1">
            <apex:repeat value="{!collaborationGroups}" var="group">
                <apex:pageBlockSectionItem >
                    <apex:pageBlockTable value="{!groupResourceMap[group]}" var="res" headerClass="tableHeader" styleClass="resourceTable">
                        <apex:facet name="header">
                            <apex:outputText value="{!group}" styleClass="tableTitle"/>
                        </apex:facet>
                        <apex:column headerValue="Title" width="30%">
                            <apex:outputLink value="/{!res.Id}" style="color: #000 !important; text-decoration: underline; font-family: Arial,Helvetica,sans-serif; font-weight: normal;">{!res.Title}</apex:outputLink>
                        </apex:column>
                        <apex:column headerValue="Description" value="{!res.Description}" width="40%">
                        </apex:column>
                        <apex:column headerValue="File Type" value="{!res.FileType}" width="15%">
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:pageBlockSectionItem>
                <br/>
            </apex:repeat>
        </apex:pageBlockSection>
    </apex:pageBlock>
    
</apex:page>


Any thoughts on why I am restricted to just (5) Chatter Groups?

Thanks in advance for any help!