Class ActivityStreamClientInteraction
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.events.activitystream.ActivityStreamClientInteraction
-
- All Implemented Interfaces:
LogEnabled
,PluginAware
,Component
,Serviceable
public class ActivityStreamClientInteraction extends AbstractLogEnabled implements Component, Serviceable, PluginAware
Component gathering methods for the activity stream service
-
-
Field Summary
Fields Modifier and Type Field Description private CurrentUserProvider
_currentUserProvider
private EventTypeExtensionPoint
_eventTypeExtensionPoint
private String
_pluginName
private ProjectManager
_projectManager
private Repository
_repository
private RightManager
_rightManager
static String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description ActivityStreamClientInteraction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_classifyEventType(String withPrefix, String toAllowedEventType, Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
private boolean
_classifyEventType(Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
private Set<String>
_getAllowedEventTypesByProject(Project project)
private String
_getXPathQuery(Expression expr, SortCriteria sortCriteria)
private NodeIterator
_query(String jcrQuery)
Map<String,Map<String,Object>>
getAllowedEventTypes(String projectName)
Get the allowed event types classified by categoriesSet<String>
getAllowedEventTypes(List<Project> projects)
Get the list of allowed event types for the given projectsList<Map<String,Object>>
getEvents(List<String> projectNames, List<String> filterEventTypes, int limit)
Get the events of the given projects and of the given event typesList<Map<String,Object>>
getEventsForCurrentUser(int limit)
Get the events for the current user with the allowed event types get into the user projects.List<Map<String,Object>>
getEventsForCurrentUser(List<Project> projects, int limit)
Get the events for the current user with the allowed event types get into the given projects.List<Map<String,Object>>
getProjectEvents(String projectName, List<String> filterEventTypes, int limit)
Get the events of the given project and of the given event typesprivate List<Project>
getProjectsForCurrentUser()
void
service(ServiceManager serviceManager)
void
setPluginInfo(String pluginName, String featureName, String id)
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.private List<String>
transformProjectsToName(List<Project> userProjects)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_projectManager
private ProjectManager _projectManager
-
_eventTypeExtensionPoint
private EventTypeExtensionPoint _eventTypeExtensionPoint
-
_currentUserProvider
private CurrentUserProvider _currentUserProvider
-
_rightManager
private RightManager _rightManager
-
_repository
private Repository _repository
-
_pluginName
private String _pluginName
-
-
Constructor Detail
-
ActivityStreamClientInteraction
public ActivityStreamClientInteraction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
getProjectEvents
public List<Map<String,Object>> getProjectEvents(String projectName, List<String> filterEventTypes, int limit)
Get the events of the given project and of the given event types- Parameters:
projectName
- the project's namefilterEventTypes
- the type of events to retainlimit
- The max number of events- Returns:
- the retained events
-
getEvents
public List<Map<String,Object>> getEvents(List<String> projectNames, List<String> filterEventTypes, int limit)
Get the events 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 events.limit
- The max number of events- Returns:
- the retained events
-
_getXPathQuery
private String _getXPathQuery(Expression expr, SortCriteria sortCriteria)
-
_query
private NodeIterator _query(String jcrQuery)
-
getAllowedEventTypes
public Map<String,Map<String,Object>> getAllowedEventTypes(String projectName)
Get the allowed event types classified by categories- Parameters:
projectName
- The project's name- Returns:
- The allowed event types
-
_classifyEventType
private boolean _classifyEventType(Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
-
_classifyEventType
private boolean _classifyEventType(String withPrefix, String toAllowedEventType, Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
-
getAllowedEventTypes
public Set<String> getAllowedEventTypes(List<Project> projects)
Get the list of allowed event types for the given projects- Parameters:
projects
- The projects- Returns:
- The allowed event types
-
_getAllowedEventTypesByProject
private Set<String> _getAllowedEventTypesByProject(Project project)
-
getEventsForCurrentUser
public List<Map<String,Object>> getEventsForCurrentUser(int limit)
Get the events for the current user with the allowed event types get into the user projects.- Parameters:
limit
- The max number of results- Returns:
- The events for the user projects
-
getEventsForCurrentUser
public List<Map<String,Object>> getEventsForCurrentUser(List<Project> projects, int limit)
Get the events for the current user with the allowed event types get into the given projects.- Parameters:
projects
- the projectslimit
- The max number of results- Returns:
- The events for the user projects
-
getProjectsForCurrentUser
private List<Project> getProjectsForCurrentUser()
-
transformProjectsToName
private List<String> transformProjectsToName(List<Project> userProjects)
-
-