MNT-12360 - Error on Alfresco Cloud accessing a content item: java.lang.OutOfMemoryError

- Fix to ensure download webscript is only using a readonly (non-buffered) txn
 - Activity creation only now performed in a new WRITE txn
 - UserAgent fix - handle as lowercase to avoid "FireFox" and "Firefox" issue - also added IE11 support to RFC5987 detection

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@86278 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2014-10-02 13:23:26 +00:00
parent a0c3fac7ba
commit f27b2d4873
4 changed files with 27 additions and 12 deletions

View File

@@ -24,6 +24,8 @@ import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.Client;
import org.alfresco.repo.Client.ClientType;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
import org.alfresco.repo.web.scripts.content.ContentGet;
import org.alfresco.service.cmr.activities.ActivityPoster;
import org.alfresco.service.cmr.repository.NodeRef;
@@ -48,6 +50,7 @@ public class SlingshotContentGet extends ContentGet
{
protected SiteService siteService;
private ActivityPoster poster;
private RetryingTransactionHelper transactionHelper;
public void setSiteService(SiteService siteService)
{
@@ -59,9 +62,12 @@ public class SlingshotContentGet extends ContentGet
this.poster = poster;
}
/* (non-Javadoc)
* @see org.alfresco.repo.web.scripts.content.ContentGet#execute(org.springframework.extensions.webscripts.WebScriptRequest, org.springframework.extensions.webscripts.WebScriptResponse)
*/
public void setTransactionHelper(RetryingTransactionHelper transactionHelper)
{
this.transactionHelper = transactionHelper;
}
@Override
public void execute(final WebScriptRequest req, final WebScriptResponse res) throws IOException
{
@@ -87,9 +93,17 @@ public class SlingshotContentGet extends ContentGet
{
filename = (String)this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
}
// post an activity - mirror the mechanism as if from the Share application
poster.postFileFolderActivity(ActivityPoster.DOWNLOADED, null, null,
site.getShortName(), null, nodeRef, filename, "documentlibrary", Client.asType(ClientType.webclient), null);
final String strFilename = filename;
transactionHelper.doInTransaction(new RetryingTransactionCallback<Void>() {
@Override
public Void execute() throws Throwable
{
// post an activity - mirror the mechanism as if from the Share application
poster.postFileFolderActivity(ActivityPoster.DOWNLOADED, null, null,
site.getShortName(), null, nodeRef, strFilename, "documentlibrary", Client.asType(ClientType.webclient), null);
return null;
}
}, false, true);
}
}
}