public class ActivityStreamClientInteraction extends AbstractLogEnabled implements Component, Serviceable, PluginAware
Modifier and Type | Field and 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 and Description |
---|
ActivityStreamClientInteraction() |
Modifier and Type | Method and Description |
---|---|
private boolean |
_classifyEventType(Map<String,Map<String,Object>> allowedEventTypes,
String eventTypeId,
I18nizableText eventTypeLabel) |
private boolean |
_classifyEventType(String withPrefix,
String toAllowedEventType,
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) |
Set<String> |
getAllowedEventTypes(List<Project> projects)
Get the list of allowed event types for the given projects
|
Map<String,Map<String,Object>> |
getAllowedEventTypes(String projectName)
Get the allowed event types classified by categories
|
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
|
List<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>> |
getProjectEvents(String projectName,
List<String> filterEventTypes,
int limit)
Get the events of the given project and of the given event types
|
private 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) |
getLogger, setLogger
private ProjectManager _projectManager
private EventTypeExtensionPoint _eventTypeExtensionPoint
private CurrentUserProvider _currentUserProvider
private RightManager _rightManager
private Repository _repository
private String _pluginName
public ActivityStreamClientInteraction()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic List<Map<String,Object>> getProjectEvents(String projectName, List<String> filterEventTypes, int limit)
projectName
- the project's namefilterEventTypes
- the type of events to retainlimit
- The max number of eventspublic List<Map<String,Object>> getEvents(List<String> projectNames, List<String> filterEventTypes, int limit)
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 eventsprivate String _getXPathQuery(Expression expr, SortCriteria sortCriteria)
private NodeIterator _query(String jcrQuery)
public Map<String,Map<String,Object>> getAllowedEventTypes(String projectName)
projectName
- The project's nameprivate boolean _classifyEventType(Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
private boolean _classifyEventType(String withPrefix, String toAllowedEventType, Map<String,Map<String,Object>> allowedEventTypes, String eventTypeId, I18nizableText eventTypeLabel)
public Set<String> getAllowedEventTypes(List<Project> projects)
projects
- The projectsprivate Set<String> _getAllowedEventTypesByProject(Project project)
public List<Map<String,Object>> getEventsForCurrentUser(int limit)
limit
- The max number of resultsprivate List<Project> getProjectsForCurrentUser()
private List<String> transformProjectsToName(List<Project> userProjects)