mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
MOB-822 - Activity feed generator - optimise to use embedded calls (as alternative to existing remote repo callbacks)
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14163 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,11 +38,14 @@ import org.alfresco.repo.domain.activities.ActivityPostEntity;
|
||||
import org.alfresco.repo.domain.activities.FeedControlDAO;
|
||||
import org.alfresco.repo.domain.activities.FeedControlEntity;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.security.permissions.AccessDeniedException;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.activities.ActivityService;
|
||||
import org.alfresco.service.cmr.activities.FeedControl;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
import org.alfresco.service.cmr.site.SiteService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
@@ -69,6 +72,7 @@ public class ActivityServiceImpl implements ActivityService
|
||||
private FeedControlDAO feedControlDAO;
|
||||
private AuthorityService authorityService;
|
||||
private FeedGenerator feedGenerator;
|
||||
private SiteService siteService;
|
||||
|
||||
private TenantService tenantService;
|
||||
|
||||
@@ -116,6 +120,11 @@ public class ActivityServiceImpl implements ActivityService
|
||||
this.tenantService = tenantService;
|
||||
}
|
||||
|
||||
public void setSiteService(SiteService siteService)
|
||||
{
|
||||
this.siteService = siteService;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.activities.ActivityService#postActivity(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
|
||||
@@ -309,7 +318,16 @@ public class ActivityServiceImpl implements ActivityService
|
||||
{
|
||||
feedUserId = feedUserId.toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
String currentUser = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||
if (! ((currentUser == null) ||
|
||||
(currentUser.equals(AuthenticationUtil.getSystemUserName())) ||
|
||||
(authorityService.isAdminAuthority(currentUser)) ||
|
||||
(currentUser.equals(feedUserId))))
|
||||
{
|
||||
throw new AccessDeniedException("Unable to get user feed entries for '" + feedUserId + "' - currently logged in as '" + currentUser +"'");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
List<ActivityFeedEntity> activityFeeds = null;
|
||||
@@ -358,9 +376,18 @@ public class ActivityServiceImpl implements ActivityService
|
||||
ParameterCheck.mandatoryString("format", format);
|
||||
|
||||
List<String> activityFeedEntries = new ArrayList<String>();
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
{
|
||||
if (siteService != null)
|
||||
{
|
||||
SiteInfo siteInfo = siteService.getSite(siteId);
|
||||
if (siteInfo == null)
|
||||
{
|
||||
throw new AccessDeniedException("No such site: " + siteId);
|
||||
}
|
||||
}
|
||||
|
||||
siteId = tenantService.getName(siteId);
|
||||
|
||||
List<ActivityFeedEntity> activityFeeds = feedDAO.selectSiteFeedEntries(siteId, format);
|
||||
|
Reference in New Issue
Block a user