@Component @Named(value="notification.preferences") @Singleton public class NotificationPreferenceScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
NotificationPreferenceScriptService() |
Modifier and Type | Method and Description |
---|---|
boolean |
hasAnyEnabledNotificationPreferences() |
void |
saveNotificationPreferences(String json)
Update notification preferences of the given user.
|
void |
saveNotificationPreferences(String json,
org.xwiki.model.reference.DocumentReference userReference)
Save preferences given as JSON.
|
void |
setStartDate(Date startDate)
Set the start date for the current user.
|
void |
setStartDate(String userId,
Date startDate)
Set the start date for every notification preference of the given user.
|
public void saveNotificationPreferences(String json, org.xwiki.model.reference.DocumentReference userReference) throws NotificationException
json
- a list of preferences as JSONuserReference
- reference of the user concerned by the preferencesNotificationException
- if error happenspublic void saveNotificationPreferences(String json) throws NotificationException
json
- a list of notification preferences represented as JSONNotificationException
- if an error occurspublic void setStartDate(Date startDate) throws NotificationException
startDate
- the date before which we ignore notificationsNotificationException
- if an error occurspublic void setStartDate(String userId, Date startDate) throws NotificationException
userId
- id of the userstartDate
- the date before which we ignore notificationsNotificationException
- if an error occurspublic boolean hasAnyEnabledNotificationPreferences() throws NotificationException
NotificationException
- if an error occursCopyright © 2004–2017 XWiki. All rights reserved.