Class NotificationSourcesScriptService
- java.lang.Object
-
- org.xwiki.notifications.sources.script.NotificationSourcesScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("notification.sources") @Singleton public class NotificationSourcesScriptService extends Object implements org.xwiki.script.service.ScriptService
Script service for the notification sources.- Since:
- 9.7RC1
- Version:
- $Id: dec6e766e8d8406470506506761c0c7079fd7d83 $
-
-
Constructor Summary
Constructors Constructor Description NotificationSourcesScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.xwiki.notifications.CompositeEvent>
getEvents(int expectedCount)
List<org.xwiki.notifications.CompositeEvent>
getEvents(int expectedCount, Date untilDate, String[] blackList)
List<org.xwiki.notifications.CompositeEvent>
getEvents(int expectedCount, Date untilDate, List<String> blackList)
long
getEventsCount(int maxCount)
Return the number of events to display as notifications concerning the current user.NotificationParameters
getNotificationParameters(Map<String,String> parameters)
Create aNotificationParameters
object to be used to retrieve the notifications of the given user.
-
-
-
Method Detail
-
getEvents
public List<org.xwiki.notifications.CompositeEvent> getEvents(int expectedCount) throws org.xwiki.notifications.NotificationException
- Parameters:
expectedCount
- number of expected events- Returns:
- the matching events for the current user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
public List<org.xwiki.notifications.CompositeEvent> getEvents(int expectedCount, Date untilDate, String[] blackList) throws org.xwiki.notifications.NotificationException
- Parameters:
expectedCount
- number of expected eventsuntilDate
- do not return events happened after this dateblackList
- array of events id to exclude from the search- Returns:
- the matching events for the current user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens- Since:
- 10.1RC1
-
getEvents
public List<org.xwiki.notifications.CompositeEvent> getEvents(int expectedCount, Date untilDate, List<String> blackList) throws org.xwiki.notifications.NotificationException
- Parameters:
expectedCount
- number of expected eventsuntilDate
- do not return events happened after this dateblackList
- list of events id to exclude from the search- Returns:
- the matching events for the current user, could be less than expectedCount but not more
- Throws:
org.xwiki.notifications.NotificationException
- if error happens
-
getEventsCount
public long getEventsCount(int maxCount) throws org.xwiki.notifications.NotificationException
Return the number of events to display as notifications concerning the current user.- Parameters:
maxCount
- maximum number of events to count- Returns:
- the list of events to display as notifications
- Throws:
org.xwiki.notifications.NotificationException
- if an error happens
-
getNotificationParameters
public NotificationParameters getNotificationParameters(Map<String,String> parameters) throws org.xwiki.notifications.NotificationException
Create aNotificationParameters
object to be used to retrieve the notifications of the given user.- Parameters:
parameters
- a map of parameters to use, see the documentation fromDefaultNotificationParametersFactory.ParametersKey
to see the available parameters and accepted values.- Returns:
- an instance of
NotificationParameters
that can be used to retrieve events. - Throws:
org.xwiki.notifications.NotificationException
- in case of errors.- Since:
- 12.2
-
-