/*
* 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
* 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