mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Activity Service - add REST API for User Feed Controls & general cleanup/fixes
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9187 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,8 +24,11 @@
|
||||
*/
|
||||
package org.alfresco.repo.activities.script;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
|
||||
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.namespace.QName;
|
||||
|
||||
@@ -46,6 +49,11 @@ public final class Activity extends BaseScopableProcessorExtension
|
||||
{
|
||||
this.activityService = activityService;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Post Activity
|
||||
*/
|
||||
|
||||
/**
|
||||
* Post a custom activity type
|
||||
@@ -108,4 +116,42 @@ public final class Activity extends BaseScopableProcessorExtension
|
||||
{
|
||||
activityService.postActivity(activityType, siteId, appTool, nodeRef, name, typeQName, parentNodeRef);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Manage User Feed Controls
|
||||
*/
|
||||
|
||||
/**
|
||||
* For current user, get feed controls
|
||||
*
|
||||
* @return array of user feed controls
|
||||
*/
|
||||
public FeedControl[] getFeedControls()
|
||||
{
|
||||
List<FeedControl> feedControls = activityService.getFeedControls();
|
||||
return (FeedControl[])feedControls.toArray(new FeedControl[feedControls.size()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* For current user, set feed control (opt-out) for a site or an appTool or a site/appTool combination
|
||||
*
|
||||
* @param siteId - required (optional, if appToolId is supplied)
|
||||
* @param appToolId - required (optional, if siteId is supplied)
|
||||
*/
|
||||
public void setFeedControl(String siteId, String appToolId)
|
||||
{
|
||||
activityService.setFeedControl(new FeedControl(siteId, appToolId));
|
||||
}
|
||||
|
||||
/**
|
||||
* For current user, unset feed control
|
||||
*
|
||||
* @param siteId - required (optional, if appToolId is supplied)
|
||||
* @param appToolId - required (optional, if siteId is supplied)
|
||||
*/
|
||||
public void unsetFeedControl(String siteId, String appToolId)
|
||||
{
|
||||
activityService.unsetFeedControl(new FeedControl(siteId, appToolId));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user