Interface ActivityManager
public interface ActivityManager
Provides APIs to manage activities. All methods to manipulate with
activities, comments and likes are provided. With these API types, you can:
- Store, get and update information of activities.
- Get an activity by using its Id.
- Get a list of activities by the returned result under
ListAccessfor lazy loading.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActivityEventListener(ActivityListenerPlugin activityListenerPlugin) default voidAdds an Activity Type options such as activity notification enablingvoidaddProcessor(ActivityProcessor activityProcessor) Adds a new activity processor.voidaddProcessorPlugin(BaseActivityProcessorPlugin activityProcessorPlugin) Adds a new activity processor plugin.default voidaddSystemActivityDefinition(ActivitySystemTypePlugin activitySystemTypePlugin) Add a new Type(s) or Title(s) definition marked as system to not allow to edit themdefault booleancanPinActivity(ExoSocialActivity activity, Identity identity) Return whether a user can pin or unpin an activity or notdefault booleancanPostActivityInStream(org.exoplatform.services.security.Identity viewer, Identity streamOwner) Checks whether a user can post an activity in a specific stream of user Or SpacevoiddeleteActivity(String activityId) Deletes an activity by its Id.voiddeleteActivity(ExoSocialActivity activity) Deletes a specific activity.voiddeleteComment(String activityId, String commentId) Deletes an existing comment of a specific activity by its Id.voiddeleteComment(ExoSocialActivity activity, ExoSocialActivity comment) Deletes a comment of an activity.voiddeleteLike(ExoSocialActivity activity, Identity identity) Deletes a like of an identity from a specific activity.getActivities(List<String> activityIdList) Load activities switch list of IDsdefault RealtimeListAccess<ExoSocialActivity> getActivitiesByFilterWithListAccess(Identity viewerIdentity, ActivityFilter activityFilter) Gets activities by filter.getActivitiesByPoster(Identity poster) Gets activities of a given poster.getActivitiesByPoster(Identity posterIdentity, String... activityTypes) Gets activities of a given poster that are specified by activity types.Gets activities posted by all connections with a given identity.getActivitiesOfSpaceWithListAccess(Identity spaceIdentity) Gets activities posted on a space by its Id.Gets activities posted on all space activity streams in which an identity joins.getActivitiesWithListAccess(Identity identity) Gets activities posted on the provided activity stream owner.getActivitiesWithListAccess(Identity ownerIdentity, Identity viewerIdentity) Gets activities on the provided activity stream which is viewed by another.getActivity(String activityId) Gets an activity by its Id.getActivityFeedWithListAccess(Identity identity) Gets all activities accessible by a given identity.default IdentitygetActivityStreamOwnerIdentity(String activityId) Retrieves anExoSocialActivity(activity or comment) stream ownerdefault StringgetActivityTitle(String activityId) Return specific activity titledefault StringgetActivityTitle(ExoSocialActivity activity) Return specific activity titleGet the list access of all activitiesgetCommentsWithListAccess(ExoSocialActivity activity) Gets comments of a specific activity.getCommentsWithListAccess(ExoSocialActivity activity, boolean loadSubComments) Gets comments of a specific activity.default RealtimeListAccess<ExoSocialActivity> getCommentsWithListAccess(ExoSocialActivity activity, boolean loadSubComments, boolean sortDescending) Gets comments of a specific activity.intGet the max uploaded size file in activity streamgetParentActivity(ExoSocialActivity comment) Gets an activity by its comment.getSubComments(ExoSocialActivity comment) Get all sub comments of a commentdefault ExoSocialActivityhideActivity(String activityId) Hides an activity to not be displayed in stream, but keep it accessible in standalone modedefault booleanisActivityDeletable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) Return whether an activity is deletable or notbooleanisActivityEditable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) default booleanisActivityExists(String activityId) default booleanisActivityTypeEnabled(String activityType) Checks if the Activity Type is enabled or notdefault booleanisActivityViewable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) Determines whether a user can view an activity or notdefault booleandefault booleanisNotificationEnabled(ExoSocialActivity activity) default booleanisNotificationEnabled(ExoSocialActivity activity, String username) default ExoSocialActivitypinActivity(String activityId, String userIdentityId) Pins a specific activity to space stream.voidsaveActivityNoReturn(ExoSocialActivity activity) Saves a newly created activity to the stream.voidsaveActivityNoReturn(Identity streamOwner, ExoSocialActivity activity) Saves a newly created activity to a stream.voidsaveComment(ExoSocialActivity activity, ExoSocialActivity newComment) Creates or updates a comment or a comment reply on a specific activity.voidsaveLike(ExoSocialActivity activity, Identity identity) Saves the like information of an identity to a specific activity.default List<ExoSocialActivity> shareActivity(ExoSocialActivity activityTemplate, String activityId, List<String> targetSpaces, org.exoplatform.services.security.Identity viewer) Shares an existing activity to a list of spaces identified by its pretty names with an optional messagedefault List<ExoSocialActivity> shareActivity(ExoSocialActivity activityTemplate, ActivityShareAction activityShareAction, org.exoplatform.services.security.Identity viewer) Shares an existing activity to a list of spaces identified by its pretty names with an optional messagedefault ExoSocialActivityunpinActivity(String activityId) Unpins a specific activity from space stream.voidupdateActivity(ExoSocialActivity activity) Updates an existing activity.default voidupdateActivity(ExoSocialActivity activity, boolean broadcast) Updates an existing activity.
-
Field Details
-
SHARED_ACTIVITY_ID_PARAM
- See Also:
-
-
Method Details
-
saveActivityNoReturn
Saves a newly created activity to a stream. The stream owner will beActivity.userIdin case that information has not already been set.- Parameters:
streamOwner- The activity stream owner.activity- The activity to be saved.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
saveActivityNoReturn
Saves a newly created activity to the stream. In this case, information of the stream owner has been set in the activity.- Parameters:
activity- The activity to be saved.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getActivity
Gets an activity by its Id.- Parameters:
activityId- Id of the activity.- Returns:
- The activity.
- eXo level API
- Platform
-
getParentActivity
Gets an activity by its comment. The comments included in this activity are considered as its children.- Parameters:
comment- The comment.- Returns:
- The activity containing the comment.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
updateActivity
Updates an existing activity.- Parameters:
activity- The activity to be updated.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
updateActivity
Updates an existing activity.- Parameters:
activity- The activity to be updated.broadcast- If the broadcast value is true , then the ActivityManager should broadcast the event to all the listener that register on event updateActivity * user event listener will be called in the createUser method.- eXo level API
- Platform
-
deleteActivity
Deletes a specific activity.- Parameters:
activity- The activity to be deleted.- Since:
- 1.1.1
- eXo level API
- Platform
-
deleteActivity
Deletes an activity by its Id.- Parameters:
activityId- Id of the deleted activity.- eXo level API
- Platform
-
hideActivity
Hides an activity to not be displayed in stream, but keep it accessible in standalone mode- Parameters:
activityId-- Returns:
- Hidden
ExoSocialActivity
-
saveComment
Creates or updates a comment or a comment reply on a specific activity.- Parameters:
activity- The activity.newComment- The comment to be saved.- eXo level API
- Platform
-
getCommentsWithListAccess
Gets comments of a specific activity. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
activity- The specific activity.- Returns:
- The comments.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getCommentsWithListAccess
RealtimeListAccess<ExoSocialActivity> getCommentsWithListAccess(ExoSocialActivity activity, boolean loadSubComments) Gets comments of a specific activity. The type of returned result isListAccesswhich can be lazy loaded. If loadSubComments is true, subComments will be added to the result list- Parameters:
activity- The specific activity.loadSubComments-- Returns:
- The comments.
-
getCommentsWithListAccess
default RealtimeListAccess<ExoSocialActivity> getCommentsWithListAccess(ExoSocialActivity activity, boolean loadSubComments, boolean sortDescending) Gets comments of a specific activity. The type of returned result isListAccesswhich can be lazy loaded. If loadSubComments is true, subComments will be added to the result list If sortDescending is true, the latest posted comments will be retrieved first.- Parameters:
activity- The specific activity.loadSubComments-sortDescending-- Returns:
- The comments.
-
deleteComment
Deletes an existing comment of a specific activity by its Id.- Parameters:
activityId- Id of the activity containing the deleted comment.commentId- Id of the deleted comment.- eXo level API
- Platform
-
deleteComment
Deletes a comment of an activity.- Parameters:
activity- The activity containing the deleted comment.comment- The deleted comment.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
saveLike
Saves the like information of an identity to a specific activity.- Parameters:
activity- The activity containing the like information which is saved.identity- The identity who likes the activity.- eXo level API
- Platform
-
deleteLike
Deletes a like of an identity from a specific activity.- Parameters:
activity- The activity containing the deleted like.identity- The identity of the deleted like.- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
pinActivity
Pins a specific activity to space stream.- Parameters:
activityId-ExoSocialActivitytechnical identifier} that will be pinneduserIdentityId- UserIdentityID who pin the activity.- Returns:
- pinned
ExoSocialActivity
-
unpinActivity
Unpins a specific activity from space stream.- Parameters:
activityId-ExoSocialActivitytechnical identifier that will be unpinned- Returns:
- unpinned
ExoSocialActivity
-
canPinActivity
Return whether a user can pin or unpin an activity or not- Parameters:
activity- checked activityidentity- user identity- Returns:
- true is user can pin or unpin activity, else false
-
getActivitiesWithListAccess
Gets activities posted on the provided activity stream owner. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
identity- The provided activity stream owner.- Returns:
- The activities.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getActivitiesWithListAccess
RealtimeListAccess<ExoSocialActivity> getActivitiesWithListAccess(Identity ownerIdentity, Identity viewerIdentity) Gets activities on the provided activity stream which is viewed by another. The type of returned result isListAccesswhich can be lazy loaded. For example: Mary is connected to Demo, then Demo signs in and watches the activity stream of Mary.- Parameters:
ownerIdentity- The provided activity stream owner.viewerIdentity- The identity who views the other stream.- Returns:
- Activities on the provided activity stream owner.
- Since:
- 4.0.x
- eXo level API
- Platform
-
getActivitiesByFilterWithListAccess
default RealtimeListAccess<ExoSocialActivity> getActivitiesByFilterWithListAccess(Identity viewerIdentity, ActivityFilter activityFilter) Gets activities by filter. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
viewerIdentity- The viewer identity.activityFilter- The activity filter.- Returns:
- The activities.
-
getActivitiesOfConnectionsWithListAccess
Gets activities posted by all connections with a given identity. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
identity- The identity.- Returns:
- The activities posted by all connections with the identity.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getActivitiesOfSpaceWithListAccess
Gets activities posted on a space by its Id. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
spaceIdentity- The specific stream owner identity.- Returns:
- The activities which belong to the space.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getActivitiesOfUserSpacesWithListAccess
Gets activities posted on all space activity streams in which an identity joins. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
identity- The identity to get his activities on spaces.- Returns:
- The activities of the user on spaces.
- Since:
- 4.0.x
- eXo level API
- Platform
-
getActivityFeedWithListAccess
Gets all activities accessible by a given identity. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
identity- The identity.- Returns:
- All activities of the identity.
- Since:
- 1.2.0-GA
- eXo level API
- Platform
-
getActivitiesByPoster
Gets activities of a given poster. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
poster- The identity who posted activities.- Returns:
- The activities of the poster.
- Since:
- 4.0.1-GA
- eXo level API
- Platform
-
getActivitiesByPoster
RealtimeListAccess<ExoSocialActivity> getActivitiesByPoster(Identity posterIdentity, String... activityTypes) Gets activities of a given poster that are specified by activity types. The type of returned result isListAccesswhich can be lazy loaded.- Parameters:
posterIdentity- The identity who posted activities.activityTypes- The types to get activities.- Returns:
- The activities of the poster.
- Since:
- 4.0.2-GA, 4.1.x
- eXo level API
- Platform
-
addProcessor
Adds a new activity processor.- Parameters:
activityProcessor- The activity processor to be added.- eXo level API
- Platform
-
addProcessorPlugin
Adds a new activity processor plugin.- Parameters:
activityProcessorPlugin- The activity processor plugin to be added.- eXo level API
- Platform
-
addActivityTypePlugin
Adds an Activity Type options such as activity notification enabling- Parameters:
plugin-ActivityTypePlugin
-
addActivityEventListener
-
addSystemActivityDefinition
Add a new Type(s) or Title(s) definition marked as system to not allow to edit them- Parameters:
activitySystemTypePlugin- plugin to retrieve types and titleIds
-
getAllActivitiesWithListAccess
RealtimeListAccess<ExoSocialActivity> getAllActivitiesWithListAccess()Get the list access of all activities- Returns:
-
getSubComments
Get all sub comments of a comment- Parameters:
comment-- Returns:
-
getMaxUploadSize
int getMaxUploadSize()Get the max uploaded size file in activity stream- Returns:
-
getActivities
Load activities switch list of IDs- Parameters:
activityIdList-- Returns:
-
isActivityEditable
boolean isActivityEditable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) -
isActivityViewable
default boolean isActivityViewable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) Determines whether a user can view an activity or not- Parameters:
activity-ExoSocialActivityviewer-Identity- Returns:
- true if has access, else return false
-
isActivityDeletable
default boolean isActivityDeletable(ExoSocialActivity activity, org.exoplatform.services.security.Identity viewer) Return whether an activity is deletable or not- Parameters:
activity- checked activityviewer- user identity- Returns:
- true is user can delete activity, else false
-
isActivityExists
- Parameters:
activityId-ExoSocialActivitytechnical identifier- Returns:
- true if activity exists else false
-
isActivityTypeEnabled
Checks if the Activity Type is enabled or not- Parameters:
activityType- the name of activity type to check- Returns:
- true if the activity type is enabled
-
isNotificationEnabled
- Parameters:
activity-ExoSocialActivity- Returns:
- true if the Activity Type reuses the default activity notifications, else false.
-
isNotificationEnabled
- Parameters:
activity-ExoSocialActivityusername- User for whom the notification will be sent- Returns:
- true if the Activity Notification is enabled for a given user
-
canPostActivityInStream
default boolean canPostActivityInStream(org.exoplatform.services.security.Identity viewer, Identity streamOwner) Checks whether a user can post an activity in a specific stream of user Or Space- Parameters:
viewer-streamOwner-- Returns:
- true if can post an activity, else, false
-
isEnableUserComposer
default boolean isEnableUserComposer()- Returns:
- true if user composer is enabled in main stream page, else false
-
getActivityStreamOwnerIdentity
Retrieves anExoSocialActivity(activity or comment) stream owner- Parameters:
activityId-ExoSocialActivitytechnical identifier- Returns:
- stream owner
Identity
-
getActivityTitle
Return specific activity title- Parameters:
activityId-ExoSocialActivityidentifier- Returns:
- activity title if specific type
-
getActivityTitle
Return specific activity title- Parameters:
activity-ExoSocialActivity- Returns:
- activity title if specific type
-