diff --git a/config/alfresco/public-rest-context.xml b/config/alfresco/public-rest-context.xml
index 5878c4fd8e..df5faa069a 100644
--- a/config/alfresco/public-rest-context.xml
+++ b/config/alfresco/public-rest-context.xml
@@ -258,6 +258,8 @@
org.alfresco.documentlibrary.file-created
org.alfresco.documentlibrary.file-deleted
org.alfresco.documentlibrary.file-liked
+ org.alfresco.documentlibrary.file-previewed
+ org.alfresco.documentlibrary.file-downloaded
org.alfresco.documentlibrary.inline-edit
org.alfresco.documentlibrary.folder-liked
org.alfresco.documentlibrary.folder-added
diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/activity.post.json.js b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/activity.post.json.js
index 658236a63d..3bf6f0b63b 100644
--- a/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/activity.post.json.js
+++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/activity.post.json.js
@@ -82,6 +82,8 @@ function postActivity()
case "file-added":
case "file-updated":
case "file-liked":
+ case "file-previewed":
+ case "file-downloaded":
case "folder-liked":
case "google-docs-checkout":
case "google-docs-checkin":
diff --git a/config/alfresco/templates/webscripts/org/alfresco/slingshot/download.get.desc.xml b/config/alfresco/templates/webscripts/org/alfresco/slingshot/download.get.desc.xml
new file mode 100644
index 0000000000..92a58f7f4e
--- /dev/null
+++ b/config/alfresco/templates/webscripts/org/alfresco/slingshot/download.get.desc.xml
@@ -0,0 +1,12 @@
+
+ DownloadContent
+ Slingshot download content webscript - posts an activity for Site content download then delegates to standard ContentGet implementation
+ /slingshot/node/content{property}/{store_type}/{store_id}/{id}?a={attach?}
+ /slingshot/node/content{property}/{store_type}/{store_id}/{id}/{filename}?a={attach?}
+ /slingshot/node/{store_type}/{store_id}/{id}/content{property}?a={attach?}
+ /slingshot/node/{store_type}/{store_id}/{id}/content{property}/{filename}?a={attach?}
+ argument
+ user
+ required
+ internal
+
\ No newline at end of file
diff --git a/config/alfresco/web-scripts-application-context.xml b/config/alfresco/web-scripts-application-context.xml
index 0b76195beb..5229341c30 100644
--- a/config/alfresco/web-scripts-application-context.xml
+++ b/config/alfresco/web-scripts-application-context.xml
@@ -2060,4 +2060,10 @@
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/slingshot/web/scripts/SlingshotContentGet.java b/source/java/org/alfresco/slingshot/web/scripts/SlingshotContentGet.java
new file mode 100644
index 0000000000..819db53e79
--- /dev/null
+++ b/source/java/org/alfresco/slingshot/web/scripts/SlingshotContentGet.java
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2005-2014 Alfresco Software Limited.
+ *
+ * This file is part of Alfresco
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ */
+package org.alfresco.slingshot.web.scripts;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.alfresco.model.ContentModel;
+import org.alfresco.repo.web.scripts.content.ContentGet;
+import org.alfresco.service.cmr.activities.ActivityService;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.site.SiteInfo;
+import org.alfresco.service.cmr.site.SiteService;
+import org.springframework.extensions.surf.util.StringBuilderWriter;
+import org.springframework.extensions.webscripts.WebScriptRequest;
+import org.springframework.extensions.webscripts.WebScriptResponse;
+import org.springframework.extensions.webscripts.json.JSONWriter;
+
+/**
+ * Share specific ContentGet implementation.
+ *
+ * Checks to see if:
+ * a) the request is an explicit download (attachment)
+ * b) the requested NodeRef within the context of a Share Site
+ *
+ * If both tests are true then generates an Activity feed item to record the Download request.
+ * All other requests and any further processing is performed by the super class.
+ *
+ * @author Kevin Roast
+ */
+public class SlingshotContentGet extends ContentGet
+{
+ protected SiteService siteService;
+ protected ActivityService activityService;
+
+ public void setSiteService(SiteService siteService)
+ {
+ this.siteService = siteService;
+ }
+
+ public void setActivityService(ActivityService activityService)
+ {
+ this.activityService = activityService;
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.repo.web.scripts.content.ContentGet#execute(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.WebScriptResponse)
+ */
+ @Override
+ public void execute(final WebScriptRequest req, final WebScriptResponse res) throws IOException
+ {
+ // are we downloading content as an attachment?
+ if (Boolean.valueOf(req.getParameter("a")))
+ {
+ // is this node part of a Site context?
+ Map templateVars = req.getServiceMatch().getTemplateVars();
+ String storeType = templateVars.get("store_type");
+ String storeId = templateVars.get("store_id");
+ String nodeId = templateVars.get("id");
+
+ // create the NodeRef and ensure it is valid
+ if (storeType != null && storeId != null && nodeId != null)
+ {
+ final NodeRef nodeRef = new NodeRef(storeType, storeId, nodeId);
+ final SiteInfo site = this.siteService.getSite(nodeRef);
+ if (site != null)
+ {
+ // found a valid parent Site - gather the details to post an Activity
+ String filename = templateVars.get("filename");
+ if (filename == null || filename.length() == 0)
+ {
+ filename = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
+ }
+ StringBuilderWriter out = new StringBuilderWriter(256);
+ final JSONWriter json = new JSONWriter(out);
+ json.startObject();
+ json.writeValue("title", filename);
+ json.writeValue("nodeRef", nodeRef.toString());
+ json.writeValue("page", "document-details?nodeRef=" + nodeRef.toString());
+ json.endObject();
+
+ // post an activity - mirror the mechanism as if from the Share application
+ this.activityService.postActivity(
+ "org.alfresco.documentlibrary.file-downloaded",
+ site.getShortName(),
+ "documentlibrary",
+ out.toString());
+ }
+ }
+ }
+ super.execute(req, res);
+ }
+}
\ No newline at end of file