Class ActivityStreamClientInteraction

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.activities.activitystream.ActivityStreamClientInteraction
All Implemented Interfaces:
LogEnabled, Component, Serviceable

Component gathering methods for the activity stream service
  • Field Details

  • Constructor Details

  • Method Details

    • service

      public void service(ServiceManager serviceManager) throws ServiceException
      Specified by:
      service in interface Serviceable
      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 empty
      limit - The max number of activities
      Returns:
      the retained activities
    • getDateOfLastActivity

      public ZonedDateTime getDateOfLastActivity(String projectName, List<String> excludeActivityTypes)
      Get the date of last activity regardless the current user's rights
      Parameters:
      projectName - The project's name
      excludeActivityTypes - 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 name
      includeActivityTypes - 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

      public Set<String> getAllowedEventTypes(Set<Project> projects)
      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 projects
      activityTypes - 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