Even though you can limit the maximum size of the resources that can be uploaded in WCM, you may still wish to perform an occasional audit for large files. The FindLargeResources module, developed for APAR PK75187 (going back to Portal 22.214.171.124), was created for such a task.
Users can experience poor performance when viewing large resources that have been uploaded into Image, File, and Rich Text Components (including the Ephox EditLive!). You may wish to periodically review large items in an effort to improve user experience. For example, you may have a content author who is uploading unnecessarily high-res images that needs to be identified and educated.
You could use the WCM API to determine the size of images for Image and File Components, but that would be very slow because each item would have to be retrieved individually. Furthermore, there is no API tool to find the size of embedded images in Rich Text fields. So, the FindLargeResources module fills these gaps.
The following lines should be added to the WCMConfigService.properties file in <Portal directory>/wcm/shared/app/config/wcmservices
connect.businesslogic.module.findlargeresources.class=com.ibm.workplace.wcm.services.statistics.FindLargeResourcesModule connect.businesslogic.module.findlargeresources.remoteaccess=true connect.businesslogic.module.findlargeresources.autoload=false
Also, append findlargeresources to this key: ‘connect.businesslogic.module’
Restart the server for the changes to take effect. You should then be able to execute the module by entering a URL in your browser, similar to the following:
The module will find all Image File and Rich Text Component’s resources that are greater than the minimum size specified by the “min_size” parameter (in bytes). If no size is specified, it will look by default for resources greater then 1 Mb. For Rich Text Components, it will not find resources that are less than 2 Mbs.
The result will output each resource item’s name, path, type and size.