mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged HEAD (5.2) to 5.2.N (5.2.1)
126569 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 124565 gjames: RA-884: Posting DOWNLOAD activities in a new (non-readonly) transaction git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126914 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -64,6 +64,7 @@ import org.alfresco.repo.tenant.TenantUtil;
|
||||
import org.alfresco.repo.thumbnail.ThumbnailDefinition;
|
||||
import org.alfresco.repo.thumbnail.ThumbnailHelper;
|
||||
import org.alfresco.repo.thumbnail.ThumbnailRegistry;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||
import org.alfresco.repo.version.VersionModel;
|
||||
import org.alfresco.rest.antlr.WhereClauseParser;
|
||||
import org.alfresco.rest.api.Nodes;
|
||||
@@ -190,6 +191,7 @@ public class NodesImpl implements Nodes
|
||||
private ThumbnailService thumbnailService;
|
||||
private SiteService siteService;
|
||||
private ActivityPoster poster;
|
||||
private RetryingTransactionHelper retryingTransactionHelper;
|
||||
|
||||
private enum Activity_Type
|
||||
{
|
||||
@@ -233,6 +235,7 @@ public class NodesImpl implements Nodes
|
||||
this.authorityService = sr.getAuthorityService();
|
||||
this.thumbnailService = sr.getThumbnailService();
|
||||
this.siteService = sr.getSiteService();
|
||||
this.retryingTransactionHelper = sr.getRetryingTransactionHelper();
|
||||
|
||||
if (defaultIgnoreTypesAndAspects != null)
|
||||
{
|
||||
@@ -1920,6 +1923,19 @@ public class NodesImpl implements Nodes
|
||||
}
|
||||
String attachFileName = (attach ? name : null);
|
||||
|
||||
final ActivityInfo activityInfo = getActivityInfo(getParentNodeRef(nodeRef), nodeRef);
|
||||
|
||||
//Activity posting needs a transaction
|
||||
retryingTransactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>()
|
||||
{
|
||||
@Override
|
||||
public Void execute() throws Throwable
|
||||
{
|
||||
postActivity(Activity_Type.DOWNLOADED, activityInfo);
|
||||
return null;
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
return new NodeBinaryResource(nodeRef, ContentModel.PROP_CONTENT, ci, attachFileName);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user