public class ActivityStreamManager extends Object implements IActivityStreamManagerSPI
Modifier and Type | Field and Description |
---|---|
static String |
TRANSACTION_ATTRIBUTE_DISABLE
ITransaction attribute that when present disables activity stream observers for that transaction. |
PROPERTY_ACTIVITY_PROCESSOR_DEFAULT_VALUE, PROPERTY_NAME_ACTIVITY_PROCESSOR_CONFIG_ID
ACTION_ID_ADD, ACTION_ID_CREATE, ACTION_ID_DELETE, ACTION_ID_REMOVE, ACTION_ID_SHARE, ACTION_ID_UPDATE
Constructor and Description |
---|
ActivityStreamManager() |
Modifier and Type | Method and Description |
---|---|
void |
addAction(ActivityAction action)
Adds a new action that may be used by
activities . |
void |
addActivity(Activity activity)
Adds an activity.
|
void |
addObjectType(ActivityObjectType objectType)
Adds an object type to the global registry.
|
ISearchQueryFilter |
createActivityStructureSearchQueryFilter(String rootChannelId,
Collection<String> areaTags)
Creates a
ISearchQueryFilter that filters the activities that belongs to a part of the structure of the
portal. |
ISearchQueryFilter |
createPriorityAndUserSearchQueryFilter(double minimumPriority,
String userId)
Returns a big data search query filter that filters the activities according to the ones the specified user is
allowed to access and has a priority of at least the value specified.
|
void |
deleteAction(ActivityAction action)
Deletes an action.
|
void |
deleteActivity(String activityId)
Deletes an activity given its identifier.
|
void |
deleteObjectType(ActivityObjectType objectType)
Deletes an object type from the global registry.
|
void |
deleteOldActivities()
Removes all
activities that have reached their age deadline. |
void |
disableActivityProcessor(ChannelConfig channel)
Set the activity processor of the given channel to disabled
|
void |
disableActivityProcessor(ServiceInstanceConfig serviceInstance)
Set the activity processor of the given service instance to disabled
|
List<ActivityObjectType> |
findObjectTypes(String query,
int maxResults)
Find activity stream object types by id, given a search query.
|
ActivityAction |
getAction(String actionId)
Returns the action of given identifier.
|
Integer |
getActivitiesMaxAgeInDays()
Get the number of days an
Activity can exist before being removed. |
IActivityProcessorConfig |
getActivityProcessorConfig(String activityProcessorConfigId)
Returns the activity processor configuration with the given identifier.
|
String |
getActivityProcessorId(ChannelConfig channel)
Get the activity processor identifier of the given channel.
|
String |
getActivityProcessorId(ServiceInstanceConfig serviceInstance)
Get the activity processor identifier of the given service instance.
|
String |
getLocalActivityProcessorId(ChannelConfig channel)
Get the local activity processor identifier of the given channel.
|
String |
getLocalActivityProcessorId(ServiceInstanceConfig serviceInstance)
Get the local activity processor identifier of the given service instance.
|
ActivityObjectType |
getObjectType(String objectTypeId)
Returns the object type of given identifier.
|
List<ActivityObjectType> |
getObjectTypes()
Returns list of persisted activity object types.
|
Collection<String> |
getReadActivityIds(long minimumTimeMillis)
Returns the identifiers of activities read by the current user since the specified time millis.
|
boolean |
isActivityRead(String activityId)
Verifies if an activity was already read by the current user.
|
void |
markActivityAsRead(String activityId)
Marks an activity as read by the current user.
|
void |
markActivityAsUnread(String activityId)
Marks an activity as unread by the current user.
|
void |
registerActivityProcessor(String activityProcessorConfigPath)
Registers an activity processor configuration.
|
void |
registerDefaultActions()
Registers built-in default activity stream actions.
|
void |
registerDefaultActivityProcessors()
Registers built-in default activity processors.
|
void |
setActivitiesMaxAgeInDays(Integer days)
Set the number of days an
Activity can exist before being removed. |
void |
setActivityProcessorConfig(String activityProcessorId,
ChannelConfig channel)
Set the Activity Processor for the given channel.
|
void |
setActivityProcessorConfig(String activityProcessorId,
ServiceInstanceConfig serviceInstance)
Set the Activity Processor for the given service instance.
|
void |
setActivityProcessorInherited(ChannelConfig channel)
Set the activity processor of the given channel to be inherited from the parent channel
|
void |
setActivityProcessorInherited(ServiceInstanceConfig serviceInstance)
Set the activity processor of the given service instance to be inherited from the parent channel
|
void |
unregisterActivityProcessor(String activityProcessorConfigId)
Unregisters an activity processor configuration.
|
void |
updateActivityObject(ActivityObject activityObject,
String scope)
Updates the given activity object for the activity in the specified scopes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findObjectTypes
public static final String TRANSACTION_ATTRIBUTE_DISABLE
ITransaction
attribute that when present disables activity stream observers for that transaction.public void addActivity(Activity activity) throws PortalException
IActivityStreamManager
addActivity
in interface IActivityStreamManager
activity
- the activity to add.PortalException
public String getActivityProcessorId(ChannelConfig channel) throws PortalException
IActivityStreamManagerSPI
getActivityProcessorId
in interface IActivityStreamManagerSPI
channel
- the channel configPortalException
public String getActivityProcessorId(ServiceInstanceConfig serviceInstance) throws PortalException
IActivityStreamManagerSPI
getActivityProcessorId
in interface IActivityStreamManagerSPI
serviceInstance
- the service instancePortalException
public String getLocalActivityProcessorId(ChannelConfig channel) throws PortalException
IActivityStreamManagerSPI
getLocalActivityProcessorId
in interface IActivityStreamManagerSPI
channel
- the channel configPortalException
public String getLocalActivityProcessorId(ServiceInstanceConfig serviceInstance) throws PortalException
IActivityStreamManagerSPI
getLocalActivityProcessorId
in interface IActivityStreamManagerSPI
serviceInstance
- the service instancePortalException
public ISearchQueryFilter createActivityStructureSearchQueryFilter(String rootChannelId, Collection<String> areaTags) throws PortalException
IActivityStreamManager
ISearchQueryFilter
that filters the activities that belongs to a part of the structure of the
portal.
The filter created automatically discards the structure elements the current user does not have view permission on.
createActivityStructureSearchQueryFilter
in interface IActivityStreamManager
rootChannelId
- the identifier of the root channel of the portal area to be considered. If null
, the
portal root channel is used.areaTags
- the area tags to use to filter which part of structure is to be considered. If null
, area
tags will not be used to filter.PortalException
SearchQuery.setControlFilter(ISearchQueryFilter)
,
IBigDataSearcher.search(SearchQuery)
,
IBigDataManager.getDefaultRepository()
,
ManagerFactory.getBigDataManager()
,
ActivityDocument
public ISearchQueryFilter createPriorityAndUserSearchQueryFilter(double minimumPriority, String userId) throws PortalException
IActivityStreamManager
createPriorityAndUserSearchQueryFilter
in interface IActivityStreamManager
minimumPriority
- the minimum priority value.userId
- the user identifier,PortalException
public boolean isActivityRead(String activityId) throws PortalException
IActivityStreamManager
isActivityRead
in interface IActivityStreamManager
activityId
- the identifier of the activity to be verified.PortalException
public void markActivityAsRead(String activityId) throws PortalException
IActivityStreamManager
markActivityAsRead
in interface IActivityStreamManager
activityId
- the activity identifier.PortalException
- if the operation could not be completed.public void markActivityAsUnread(String activityId) throws PortalException
IActivityStreamManager
markActivityAsUnread
in interface IActivityStreamManager
activityId
- the activity identifier.PortalException
- if the operation could not be completed.public void deleteActivity(String activityId) throws PortalException
IActivityStreamManager
deleteActivity
in interface IActivityStreamManager
activityId
- the activity identifier.PortalException
public ActivityObjectType getObjectType(String objectTypeId) throws PortalException
IActivityStreamManager
getObjectType
in interface IActivityStreamManager
objectTypeId
- the object type identifier.PortalObjectNotFoundException
- if no object type with the given identifier was found.PortalException
public List<ActivityObjectType> getObjectTypes() throws PortalException
IActivityStreamManagerSPI
getObjectTypes
in interface IActivityStreamManagerSPI
PortalException
public List<ActivityObjectType> findObjectTypes(String query, int maxResults) throws PortalException
IActivityStreamManagerSPI
findObjectTypes
in interface IActivityStreamManagerSPI
query
- query used to search object typesmaxResults
- amount of object types to returnPortalException
public void addObjectType(ActivityObjectType objectType)
IActivityStreamManager
addObjectType
in interface IActivityStreamManager
objectType
- the object type.public void deleteObjectType(ActivityObjectType objectType) throws PortalException
IActivityStreamManager
deleteObjectType
in interface IActivityStreamManager
objectType
- the object type.PortalException
public void addAction(ActivityAction action) throws PortalException
IActivityStreamManager
activities
.addAction
in interface IActivityStreamManager
action
- the action to add.PortalException
- if the action could be be added.public ActivityAction getAction(String actionId) throws PortalException
IActivityStreamManager
getAction
in interface IActivityStreamManager
actionId
- the action identifier.PortalObjectNotFoundException
- if no action with the given identifier was found.PortalException
public void deleteAction(ActivityAction action) throws PortalException
IActivityStreamManager
deleteAction
in interface IActivityStreamManager
action
- the action to be deleted.PortalException
- if the action could not be deleted.public void registerDefaultActions() throws PortalException
IActivityStreamManagerSPI
registerDefaultActions
in interface IActivityStreamManagerSPI
PortalException
public void deleteOldActivities() throws PortalException
IActivityStreamManagerSPI
activities
that have reached their age deadline. The deadline is configured in the
activity stream global administration interface.deleteOldActivities
in interface IActivityStreamManagerSPI
PortalException
public Integer getActivitiesMaxAgeInDays() throws PortalException
IActivityStreamManagerSPI
Activity
can exist before being removed.getActivitiesMaxAgeInDays
in interface IActivityStreamManagerSPI
PortalException
public void registerDefaultActivityProcessors() throws PortalException
IActivityStreamManagerSPI
registerDefaultActivityProcessors
in interface IActivityStreamManagerSPI
PortalException
public void registerActivityProcessor(String activityProcessorConfigPath) throws PortalException
IActivityStreamManagerSPI
registerActivityProcessor
in interface IActivityStreamManagerSPI
activityProcessorConfigPath
- the path to the activity processor configuration, relative to the classpath.PortalException
- if the configuration could not be registered.public void unregisterActivityProcessor(String activityProcessorConfigId) throws PortalException
IActivityStreamManagerSPI
unregisterActivityProcessor
in interface IActivityStreamManagerSPI
activityProcessorConfigId
- the identifier of the activity processor configuration.PortalException
- if the configuration could not be unregistered.public IActivityProcessorConfig getActivityProcessorConfig(String activityProcessorConfigId) throws PortalException
getActivityProcessorConfig
in interface IActivityStreamManagerSPI
activityProcessorConfigId
- the identifier.PortalException
public void setActivitiesMaxAgeInDays(Integer days) throws PortalException
IActivityStreamManagerSPI
Activity
can exist before being removed.setActivitiesMaxAgeInDays
in interface IActivityStreamManagerSPI
days
- the number of days to set.PortalException
public void setActivityProcessorConfig(String activityProcessorId, ServiceInstanceConfig serviceInstance) throws PortalException
IActivityStreamManagerSPI
setActivityProcessorConfig
in interface IActivityStreamManagerSPI
activityProcessorId
- the activity processor IdserviceInstance
- the service instance to get the property bagPortalException
public void setActivityProcessorConfig(String activityProcessorId, ChannelConfig channel) throws PortalException
IActivityStreamManagerSPI
setActivityProcessorConfig
in interface IActivityStreamManagerSPI
activityProcessorId
- the activity processor Idchannel
- the channel to get the property bagPortalException
public void setActivityProcessorInherited(ServiceInstanceConfig serviceInstance) throws PortalException
IActivityStreamManagerSPI
setActivityProcessorInherited
in interface IActivityStreamManagerSPI
serviceInstance
- the service instancePortalException
public void setActivityProcessorInherited(ChannelConfig channel) throws PortalException
IActivityStreamManagerSPI
setActivityProcessorInherited
in interface IActivityStreamManagerSPI
channel
- the channel configPortalException
public void disableActivityProcessor(ServiceInstanceConfig serviceInstance) throws PortalException
IActivityStreamManagerSPI
disableActivityProcessor
in interface IActivityStreamManagerSPI
serviceInstance
- the service instancePortalException
public void disableActivityProcessor(ChannelConfig channel) throws PortalException
IActivityStreamManagerSPI
disableActivityProcessor
in interface IActivityStreamManagerSPI
channel
- the channel configPortalException
public Collection<String> getReadActivityIds(long minimumTimeMillis)
IActivityStreamManager
getReadActivityIds
in interface IActivityStreamManager
minimumTimeMillis
- the time millis specifying the minimum time value of activity read.public void updateActivityObject(ActivityObject activityObject, String scope) throws PortalException
IActivityStreamManagerSPI
For each activity in the specified scope, the activity's objects
and
targets
with same identifier
and
type
as the given activityObject
are updated with its properties.
To prevent excessive resource usage, this method may update only some of the activity objects, leaving the other unmodified.
This method was initially intended for public API, but it has some strange limitations and may be replaced/modified, so keeping in SPI for now.
updateActivityObject
in interface IActivityStreamManagerSPI
activityObject
- the activity object with updated information.scope
- the scope of activities to be processed.PortalException
- if the operation could not be completed.LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.