Class ActivityStreamClientInteraction
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.activities.activitystream.ActivityStreamClientInteraction
- All Implemented Interfaces:
LogEnabled
,Component
,Serviceable
public class ActivityStreamClientInteraction
extends AbstractLogEnabled
implements Component, Serviceable
Component gathering methods for the activity stream service
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetActivities
(List<String> projectNames, List<String> filterEventTypes, int limit) Get the activities of the given projects and of the given event typesgetActivities
(List<String> projectNames, List<String> filterEventTypes, Date fromDate, Date untilDate, String pattern, int limit) Get the activities of the given projects and of the given event typesgetActivitiesForCurrentUser
(int limit) Get the activities for the current user with the allowed event types get from the user projects.getActivitiesForCurrentUser
(String pattern, Set<String> categories, Set<String> activityTypes, int limit) Get the activities for the current user with the allowed event types get from the user projects.getActivitiesForCurrentUser
(String pattern, Set<String> categories, Set<String> activityTypes, Date fromDate, Date untilDate, int limit) Get the activities for the current user with the allowed event types get from the user projects.getActivitiesForCurrentUser
(Set<Project> projects, Set<String> activityTypes, Date fromDate, Date untilDate, String pattern, int limit) Get the activities for the current user with the allowed event types get from the given projects.getAllowedEventTypes
(Set<Project> projects) Get the list of allowed event types for the given projectsgetDateOfLastActivity
(String projectName, List<String> excludeActivityTypes) Get the date of last activity regardless the current user's rightsgetDateOfLastActivityByActivityType
(String projectName, Collection<String> includeActivityTypes) Get the date of last activity regardless the current user's rightslong
Get the number of unread events for the current uservoid
service
(ServiceManager serviceManager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
ACTIVITY_STREAM_USER_PREF_CONTEXT
the user preferences context for activity stream- See Also:
-
ACTIVITY_STREAM_USER_PREF_LAST_UPDATE
the id of user preferences for the last update of activity stream- See Also:
-
-
Constructor Details
-
ActivityStreamClientInteraction
public ActivityStreamClientInteraction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getActivities
public List<Map<String,Object>> getActivities(List<String> projectNames, List<String> filterEventTypes, int limit) Get the activities of the given projects and of the given event types- Parameters:
projectNames
- the names of the projects. Can not be null.filterEventTypes
- the type of events to retain. Can be empty to get all activities.limit
- The max number of activities- Returns:
- the retained activities
-
getActivities
public List<Map<String,Object>> getActivities(List<String> projectNames, List<String> filterEventTypes, Date fromDate, Date untilDate, String pattern, int limit) Get the activities of the given projects and of the given event types- Parameters:
projectNames
- the names of the projects. Can not be null.filterEventTypes
- the type of events to retain. Can be empty to get all activities.fromDate
- To get activities after the given date. Can be null.untilDate
- To get activities before the given date. Can be null.pattern
- A filter pattern. Can be null or emptylimit
- The max number of activities- Returns:
- the retained activities
-
getDateOfLastActivity
Get the date of last activity regardless the current user's rights- Parameters:
projectName
- The project's nameexcludeActivityTypes
- the types of activity to ignore from this search- Returns:
- the date of last activity or null if no activity found or an error occurred
-
getDateOfLastActivityByActivityType
public ZonedDateTime getDateOfLastActivityByActivityType(String projectName, Collection<String> includeActivityTypes) Get the date of last activity regardless the current user's rights- Parameters:
projectName
- The project's nameincludeActivityTypes
- the types of activity to ignore from this search- Returns:
- the date of last activity or null if no activity found or an error occurred
-
getAllowedEventTypes
Get the list of allowed event types for the given projects- Parameters:
projects
- The projects- Returns:
- The allowed event types
-
getNumberOfUnreadActivitiesForCurrentUser
Get the number of unread events for the current user- Returns:
- the number of unread events or -1 if user never read events
-
getActivitiesForCurrentUser
Get the activities for the current user with the allowed event types get from the user projects.- Parameters:
limit
- The max number of results- Returns:
- The activities for the user projects
-
getActivitiesForCurrentUser
public List<Map<String,Object>> getActivitiesForCurrentUser(String pattern, Set<String> categories, Set<String> activityTypes, int limit) Get the activities for the current user with the allowed event types get from the user projects.- Parameters:
pattern
- Pattern to search on activity. Can null or empty to not filter on pattern.activityTypes
- the type of activities to retrieve. Can null or empty to not filter on activity types.categories
- the categories of projects to retrieve. Can null or empty to not filter on themes.limit
- The max number of results- Returns:
- The activities for the user projects
-
getActivitiesForCurrentUser
public List<Map<String,Object>> getActivitiesForCurrentUser(String pattern, Set<String> categories, Set<String> activityTypes, Date fromDate, Date untilDate, int limit) Get the activities for the current user with the allowed event types get from the user projects.- Parameters:
pattern
- Pattern to search on activity. Can null or empty to not filter on pattern.activityTypes
- the type of activities to retrieve. Can null or empty to not filter on activity types.categories
- the categories of projects to retrieve. Can null or empty to not filter on themes.fromDate
- To get activities after the given date. Can be null.untilDate
- To get activities before the given date. Can be null.limit
- The max number of results- Returns:
- The activities for the user projects
-
getActivitiesForCurrentUser
public List<Map<String,Object>> getActivitiesForCurrentUser(Set<Project> projects, Set<String> activityTypes, Date fromDate, Date untilDate, String pattern, int limit) Get the activities for the current user with the allowed event types get from the given projects.- Parameters:
projects
- the projectsactivityTypes
- the type of activities to retrieve. Can null or empty to not filter on activity types.fromDate
- To get activities after the given date. Can be null.untilDate
- To get activities before the given date. Can be null.pattern
- Pattern to search on activity. Can null or empty to not filter on pattern.limit
- The max number of results- Returns:
- The activities for the user projects
-