Class NotificationNotifiersScriptService
- java.lang.Object
-
- org.xwiki.notifications.notifiers.script.NotificationNotifiersScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("notification.notifiers") @Singleton public class NotificationNotifiersScriptService extends Object implements org.xwiki.script.service.ScriptService
Script service for the notification notifiers.- Since:
- 9.7RC1
- Version:
- $Id: 80a039c70035581874b1fd103d6f98542dca12e8 $
-
-
Constructor Summary
Constructors Constructor Description NotificationNotifiersScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getFeed(int entryNumber)
Get the RSS notifications feed of the given user.String
getFeed(String userId, int entryNumber)
Get the RSS notifications feed of the given user.String
getNotificationCount(NotificationParameters parameters, boolean forcePlaceHolder)
Request asynchronously the notifications for the given parameters to retrieve their number.String
getNotifications(NotificationParameters parameters, boolean forcePlaceHolder)
Request asynchronously the notifications for the given parameters to display them.org.xwiki.rendering.block.Block
render(CompositeEvent event)
Generate a rendering Block for a given event to display as notification.
-
-
-
Method Detail
-
render
public org.xwiki.rendering.block.Block render(CompositeEvent event) throws NotificationException
Generate a rendering Block for a given event to display as notification.- Parameters:
event
- the event to render- Returns:
- a rendering block ready to display the event
- Throws:
NotificationException
- if an error happens
-
getFeed
public String getFeed(int entryNumber) throws NotificationException
Get the RSS notifications feed of the given user.- Parameters:
entryNumber
- number of entries to get- Returns:
- the notifications RSS feed
- Throws:
NotificationException
- if an error occurs- Since:
- 10.1RC1
-
getFeed
public String getFeed(String userId, int entryNumber) throws NotificationException
Get the RSS notifications feed of the given user.- Parameters:
userId
- id of the userentryNumber
- number of entries to get- Returns:
- the notifications RSS feed
- Throws:
NotificationException
- if an error occurs- Since:
- 10.1RC1
-
getNotificationCount
public String getNotificationCount(NotificationParameters parameters, boolean forcePlaceHolder) throws NotificationException
Request asynchronously the notifications for the given parameters to retrieve their number. This will return a piece of HTML with a placeholder for the asynchronous answer, which will be automatically filled with the number once the request is done.- Parameters:
parameters
- theNotificationParameters
used to make the request. You can retrieve it by usingforcePlaceHolder
-true
if the script service should always return a placeholder, even when the data is immediately available (useful in case of AJAX request).NotificationSourcesScriptService.getNotificationParameters(Map)
.- Returns:
- the HTML of an asynchronous placeholder.
- Throws:
NotificationException
- in case of error during the request.- Since:
- 12.2
-
getNotifications
public String getNotifications(NotificationParameters parameters, boolean forcePlaceHolder) throws NotificationException
Request asynchronously the notifications for the given parameters to display them. This will return a piece of HTML with a placeholder for the asynchronous answer, which will be automatically filled with the notifications once the request is done.- Parameters:
parameters
- theNotificationParameters
used to make the request. You can retrieve it by usingforcePlaceHolder
-true
if the script service should always return a placeholder, even when the data is immediately available (useful in case of AJAX request).NotificationSourcesScriptService.getNotificationParameters(Map)
.- Returns:
- the HTML of an asynchronous placeholder.
- Throws:
NotificationException
- in case of error during the request.- Since:
- 12.2
-
-