Index: src/main/java/com/xpn/xwiki/plugin/activitystream/impl/ActivityStreamImpl.java
===================================================================
--- src/main/java/com/xpn/xwiki/plugin/activitystream/impl/ActivityStreamImpl.java	(revision 27198)
+++ src/main/java/com/xpn/xwiki/plugin/activitystream/impl/ActivityStreamImpl.java	(working copy)
@@ -20,6 +20,7 @@
 package com.xpn.xwiki.plugin.activitystream.impl;
 
 import java.util.List;
+import java.util.Date;
 import java.util.ArrayList;
 import java.io.StringWriter;
 import java.net.URL;
@@ -35,6 +36,7 @@
 import org.xwiki.observation.event.DocumentSaveEvent;
 import org.xwiki.observation.event.DocumentUpdateEvent;
 import org.xwiki.observation.event.Event;
+import org.xwiki.observation.event.ActionExecutionEvent;
 import org.xwiki.observation.remote.RemoteObservationManagerContext;
 
 import com.xpn.xwiki.XWikiContext;
@@ -55,6 +57,9 @@
 import com.sun.syndication.feed.synd.SyndFeedImpl;
 import com.sun.syndication.io.SyndFeedOutput;
 
+import com.xpn.xwiki.web.DownloadAction;
+import com.xpn.xwiki.web.ViewAction;
+
 /**
  * Default implementation for {@link ActivityStream}.
  * 
@@ -200,7 +205,14 @@
      */
     public void init(XWikiContext context) throws XWikiException
     {
-        // Listent to Events.
+        // Catching view events if the preference 
+        // xwiki.plugin.activitystream.catchviews is set in xwiki.cfg
+        if (hasViewActivityStream(context)) {
+          LISTENER_EVENTS.add(new ActionExecutionEvent(ViewAction.VIEW_ACTION));
+          LISTENER_EVENTS.add(new ActionExecutionEvent(DownloadAction.ACTION_NAME));
+        }
+
+        // Listen to Events.
         ObservationManager observationManager = Utils.getComponent(ObservationManager.class);
         if (observationManager.getListener(getName()) == null) {
             observationManager.addListener(this);
@@ -253,6 +265,26 @@
     }
 
     /**
+     * This method allows to check if we should record views for the current wiki
+     * @param context the XWiki context
+     * @return true if the activity stream is configured to store view events for the current wiki
+     */
+    private boolean hasViewActivityStreamForWiki(XWikiContext context) {
+        ActivityStreamPlugin plugin =
+            (ActivityStreamPlugin) context.getWiki().getPlugin(ActivityStreamPlugin.PLUGIN_NAME, context);
+        return Integer.parseInt(plugin.getActivityStreamPreference("recordviews", "0", context)) == 1;
+    }
+
+    /**
+     * This method allows to check if we should catch view events for the activity stream plugin
+     * @param context the XWiki context
+     * @return true if the activity stream is configured to catch views
+     */
+    private boolean hasViewActivityStream(XWikiContext context) {
+        return (context.getWiki().ParamAsLong("xwiki.plugin.activitystream.catchviews", 0)==1);
+    }
+
+    /**
      * This method determine if events must be store in the main wiki. If the wiki is not running in virtual mode this
      * method will always return false. If it is running in virtual mode this method retrieves the
      * platform.plugin.activitystream.usemainstore configuration option. If the option is not found the method returns
@@ -380,7 +412,10 @@
         if (doc.getDatabase() != null) {
             event.setWiki(doc.getDatabase());
         }
-        event.setDate(doc.getDate());
+        if (type.equals(ActivityEventType.VIEW) || type.equals(ActivityEventType.DOWNLOAD))
+           event.setDate(new Date());
+        else
+           event.setDate(doc.getDate());
         event.setPriority(priority);
         event.setType(type);
         event.setTitle(title);
@@ -873,10 +908,23 @@
         
         // Take events into account only once in a cluster  
         if (!Utils.getComponent(RemoteObservationManagerContext.class).isRemoteState()) {
-            String eventType;
-            String displayTitle;
-            
-            if (event instanceof DocumentSaveEvent) {
+            String eventType = "";
+            String displayTitle = "";
+            boolean recordEvent = true;
+           
+            if (event instanceof ActionExecutionEvent) {
+                // we should receive this even only if the instance is configure to catch view events
+                // we will record only if the wiki is set to record view events
+                if (hasViewActivityStreamForWiki(context)) {
+                  if (((ActionExecutionEvent)event).getActionName().equals(ViewAction.VIEW_ACTION))
+                    eventType = ActivityEventType.VIEW;
+                  else
+                    eventType = ActivityEventType.DOWNLOAD;
+                  displayTitle = currentDoc.getDisplayTitle(context);
+                } else {
+                  recordEvent = false;
+                }
+            } else if (event instanceof DocumentSaveEvent) {
                 eventType = ActivityEventType.CREATE;
                 displayTitle = currentDoc.getDisplayTitle(context);
             } else if (event instanceof DocumentUpdateEvent) {
@@ -886,15 +934,17 @@
                 eventType = ActivityEventType.DELETE;
                 displayTitle = originalDoc.getDisplayTitle(context);
             }
+           
+            if (recordEvent) { 
+                List<String> params = new ArrayList<String>();
+                params.add(displayTitle);
             
-            List<String> params = new ArrayList<String>();
-            params.add(displayTitle);
-            
-            try {
-                addDocumentActivityEvent(streamName, currentDoc, eventType, msgPrefix + eventType, params, context);
-            } catch (ActivityStreamException e) {
-                Log.error("Exception while trying to add a document activity event, updated document: [" 
-                    + wiki + ":" + currentDoc.getFullName() + "]");                
+                try {
+                     addDocumentActivityEvent(streamName, currentDoc, eventType, msgPrefix + eventType, params, context);
+                } catch (ActivityStreamException e) {
+                     Log.error("Exception while trying to add a document activity event, updated document: [" 
+                         + wiki + ":" + currentDoc.getFullName() + "]");                
+                }
             }
         }
     }
Index: src/main/java/com/xpn/xwiki/plugin/activitystream/api/ActivityEventType.java
===================================================================
--- src/main/java/com/xpn/xwiki/plugin/activitystream/api/ActivityEventType.java	(revision 27198)
+++ src/main/java/com/xpn/xwiki/plugin/activitystream/api/ActivityEventType.java	(working copy)
@@ -40,4 +40,14 @@
      * Document deletion.
      */
     String DELETE = "delete";
+
+    /**
+     * Document view.
+     */
+    String VIEW = "view";
+
+    /**
+     * Document download.
+     */
+    String DOWNLOAD = "download";
 }
