In Alfresco 5 we have added two new types of events to the activity stream – for documentDownload and Preview events. Some concerns have been raised about the number of activities that may be added to the site or user streams and also concerns around privacy – seeing what documents other users have been downloading or previewing.
Firstly, the ability of the server to process activities has been improved considerably since Alfresco 4. The activity processing is now multi-threaded and also handles more activities per stream.
Secondly, the same ACL/permission enforcement that has always been present in Alfresco is still present in 5.0 – that has not changed! So the ability to see a public document is still the same for all users and if a document is private, it will remain private. For example if you add/modify/download a document that is private to you then activity events for the action will not appear on the public activity stream for other users in the site.
The activities which are processed by the system is actually very easy to configure in the Alfresco repository – and always has been. A simple config file change is all that is need to disable certain activities from the stream processing. For example if you are still concerned about the Download and Preview activities and want to disable them, then this is how you would do it.
In the Alfresco repository tomcat instance, in the
tomcat/shared/classes/alfresco/extensionfolder create a new spring context XML file. I have called mine
configure-activities-context.xml but you can call it anything that ends in
-context.xml or add the config to an existing extension file if you prefer.
The beans that process activities work against a list of known activity types – the types that are generated by applications such as Alfresco Share. To remove the Download and Preview activities we identify the IDs of those activities which are
org.alfresco.documentlibrary.file-downloaded and remove them from the list for the
documentLibraryActivitySummaryProcessor bean definition.
<?xml version='1.0' encoding='UTF-8'?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <bean id="documentLibraryActivitySummaryProcessor" class="org.alfresco.rest.api.impl.activities.BaseActivitySummaryProcessor"> <property name="registry" ref="activitySummaryParser" /> <property name="eventTypes"> <list> <value>org.alfresco.documentlibrary.files-added</value> <value>org.alfresco.documentlibrary.files-updated</value> <value>org.alfresco.documentlibrary.files-deleted</value> <value>org.alfresco.documentlibrary.file-added</value> <value>org.alfresco.documentlibrary.file-created</value> <value>org.alfresco.documentlibrary.file-deleted</value> <value>org.alfresco.documentlibrary.file-liked</value> <value>org.alfresco.documentlibrary.inline-edit</value> <value>org.alfresco.documentlibrary.folder-liked</value> <value>org.alfresco.documentlibrary.folder-added</value> <value>org.alfresco.documentlibrary.folder-deleted</value> <value>org.alfresco.documentlibrary.folders-added</value> <value>org.alfresco.documentlibrary.folders-deleted</value> </list> </property> </bean> </beans>
Restart Alfresco and that’s it, no more Download and Preview activities. You can modify the bean config above to remove any other activity types you don’t like from the list that gets processed by the system.