@Component @Named(value="notification.filters") @Singleton public class NotificationFiltersScriptService extends Object implements org.xwiki.script.service.ScriptService
Constructor and Description |
---|
NotificationFiltersScriptService() |
Modifier and Type | Method and Description |
---|---|
void |
createScopeFilterPreference(NotificationFilterType type,
Set<NotificationFormat> formats,
List<String> eventTypes,
EntityReference reference)
Create a scope notification filter preference for the current user.
|
void |
createScopeFilterPreference(NotificationFilterType type,
Set<NotificationFormat> formats,
List<String> eventTypes,
EntityReference reference,
org.xwiki.user.UserReference userReference)
Create a scope notification filter preference for the given user.
|
void |
createWikiScopeFilterPreference(NotificationFilterType type,
Set<NotificationFormat> formats,
List<String> eventTypes,
EntityReference reference,
WikiReference wikiReference)
Create a scope notification filter preference for the given user.
|
void |
deleteFilterPreference(String filterPreferenceId)
Delete a filter preference.
|
void |
deleteFilterPreference(String filterPreferenceId,
org.xwiki.user.UserReference userReference)
Delete a filter preference for the given user.
|
void |
deleteWikiFilterPreference(String filterPreferenceId,
WikiReference wikiReference)
Delete a filter preference for the given wiki.
|
org.xwiki.rendering.block.Block |
displayFilterPreference(NotificationFilter filter,
NotificationFilterPreference preference)
Get a displayable form of the given
NotificationFilterPreference . |
Set<NotificationFilterPreference> |
getFilterPreferences(NotificationFilter filter)
Get a collection of notification filters preferences that are available for the current user and that corresponds
to the given filter.
|
Set<NotificationFilterPreference> |
getFilterPreferences(NotificationFilter filter,
org.xwiki.user.UserReference userReference)
Get a collection of notification filters preferences that are available for the given user and that corresponds
to the given filter.
|
Collection<NotificationFilter> |
getFilters() |
Collection<NotificationFilter> |
getFilters(org.xwiki.user.UserReference userReference) |
Set<NotificationFilter> |
getToggleableNotificationFilters()
Get a set of notification filters that can be toggled by the current user.
|
Set<NotificationFilter> |
getToggleableNotificationFilters(org.xwiki.user.UserReference userReference)
Get a set of notification filters that can be toggled by the given user.
|
Set<NotificationFilterPreference> |
getWikiFilterPreferences(NotificationFilter filter,
WikiReference wikiReference)
Get a collection of notification filters preferences that are available for the given wiki and that corresponds
to the given filter.
|
Collection<NotificationFilter> |
getWikiFilters(WikiReference wikiReference)
Get the filters of the given wiki.
|
Set<NotificationFilter> |
getWikiToggleableNotificationFilters(WikiReference wikiReference)
Get a set of notification filters that can be toggled for the given wiki.
|
void |
setFilterPreferenceEnabled(String filterPreferenceId,
boolean enabled)
Enable or disable a filter preference.
|
void |
setFilterPreferenceEnabled(String filterPreferenceId,
boolean enabled,
org.xwiki.user.UserReference userReference)
Enable or disable a filter preference.
|
void |
setStartDate(Date startDate)
Update the start date for every filter preference that current user has.
|
void |
setStartDate(Date startDate,
org.xwiki.user.UserReference userReference)
Update the start date for every filter preference that given user has.
|
void |
setWikiFilterPreferenceEnabled(String filterPreferenceId,
boolean enabled,
WikiReference wikiReference)
Enable or disable a filter preference.
|
public Set<NotificationFilter> getToggleableNotificationFilters() throws NotificationException
NotificationException
- if an error occurs@Unstable public Set<NotificationFilter> getToggleableNotificationFilters(org.xwiki.user.UserReference userReference) throws NotificationException
userReference
- the user for which to retrieve the notification filters.NotificationException
- if an error occurs@Unstable public Set<NotificationFilter> getWikiToggleableNotificationFilters(WikiReference wikiReference) throws NotificationException
getToggleableNotificationFilters
since a WikiReference can be converted
to a UserReference by our converters, check https://jira.xwiki.org/browse/XWIKI-18496.wikiReference
- the wiki for which to retrieve the notification filters.NotificationException
- if an error occurspublic Collection<NotificationFilter> getFilters() throws NotificationException
NotificationFilter
available to the current user.NotificationException
- if an error happens@Unstable public Collection<NotificationFilter> getFilters(org.xwiki.user.UserReference userReference) throws NotificationException
userReference
- the user for which to retrieve the filters.NotificationFilter
available for the given user.NotificationException
- if the reference is not correct or if an error happens when retrieving the filters@Unstable public Collection<NotificationFilter> getWikiFilters(WikiReference wikiReference) throws NotificationException
getFilters
since a WikiReference can be converted to a UserReference by
our converters, check https://jira.xwiki.org/browse/XWIKI-18496.wikiReference
- the wiki for which to retrieve the filters.NotificationFilter
available for the given user.NotificationException
- if the reference is not correct or if an error happens when retrieving the filterspublic Set<NotificationFilterPreference> getFilterPreferences(NotificationFilter filter) throws NotificationException
filter
- the filter associated to the preferencesNotificationFilterPreference
NotificationException
- if an error occurs@Unstable public Set<NotificationFilterPreference> getFilterPreferences(NotificationFilter filter, org.xwiki.user.UserReference userReference) throws NotificationException
filter
- the filter associated to the preferencesuserReference
- the user for which to retrieve the filterNotificationFilterPreference
NotificationException
- if an error occurs@Unstable public Set<NotificationFilterPreference> getWikiFilterPreferences(NotificationFilter filter, WikiReference wikiReference) throws NotificationException
getFilterPreferences
since a WikiReference can be converted to a
UserReference by our converters, check https://jira.xwiki.org/browse/XWIKI-18496.filter
- the filter associated to the preferenceswikiReference
- the wiki for which to retrieve the filterNotificationFilterPreference
NotificationException
- if an error occurspublic org.xwiki.rendering.block.Block displayFilterPreference(NotificationFilter filter, NotificationFilterPreference preference) throws NotificationException
NotificationFilterPreference
.filter
- the filter bound to the given preferencepreference
- the filter preference to displayBlock
that can be used to display the given notification filterNotificationException
- if an error occurspublic void deleteFilterPreference(String filterPreferenceId) throws NotificationException
filterPreferenceId
- name of the filter preferenceNotificationException
- if an error happens@Unstable public void deleteFilterPreference(String filterPreferenceId, org.xwiki.user.UserReference userReference) throws NotificationException
filterPreferenceId
- name of the filter preferenceuserReference
- the user for which to delete the filter preference.NotificationException
- if an error happens@Unstable public void deleteWikiFilterPreference(String filterPreferenceId, WikiReference wikiReference) throws NotificationException
deleteFilterPreference
since a WikiReference can be converted to a
UserReference by our converters, check https://jira.xwiki.org/browse/XWIKI-18496.filterPreferenceId
- name of the filter preferencewikiReference
- the wiki for which to delete the filter preference.NotificationException
- if an error happenspublic void setFilterPreferenceEnabled(String filterPreferenceId, boolean enabled) throws NotificationException
filterPreferenceId
- id of the filter preferenceenabled
- either or not the filter preference should be enabledNotificationException
- if an error happens@Unstable public void setFilterPreferenceEnabled(String filterPreferenceId, boolean enabled, org.xwiki.user.UserReference userReference) throws NotificationException
filterPreferenceId
- id of the filter preferenceenabled
- either or not the filter preference should be enableduserReference
- the user for which to enable or disable a filter.NotificationException
- if an error happens@Unstable public void setWikiFilterPreferenceEnabled(String filterPreferenceId, boolean enabled, WikiReference wikiReference) throws NotificationException
setFilterPreferenceEnabled
since a WikiReference can be converted to a
UserReference by our converters, check https://jira.xwiki.org/browse/XWIKI-18496.filterPreferenceId
- id of the filter preferenceenabled
- either or not the filter preference should be enabledwikiReference
- the wiki for which to enable or disable a filter.NotificationException
- if an error happenspublic void setStartDate(Date startDate) throws NotificationException
startDate
- the new start dateNotificationException
- if an error occurs@Unstable public void setStartDate(Date startDate, org.xwiki.user.UserReference userReference) throws NotificationException
startDate
- the new start dateuserReference
- the user for which to set the start dateNotificationException
- if an error occurspublic void createScopeFilterPreference(NotificationFilterType type, Set<NotificationFormat> formats, List<String> eventTypes, EntityReference reference) throws NotificationException
type
- type of the filter preference to createformats
- formats concerned by the preferenceeventTypes
- the event types concerned by the preferencereference
- the reference of the wiki, the space or the page concerned by the preferenceNotificationException
- if an error occurs@Unstable public void createScopeFilterPreference(NotificationFilterType type, Set<NotificationFormat> formats, List<String> eventTypes, EntityReference reference, org.xwiki.user.UserReference userReference) throws NotificationException
type
- type of the filter preference to createformats
- formats concerned by the preferenceeventTypes
- the event types concerned by the preferencereference
- the reference of the wiki, the space or the page concerned by the preferenceuserReference
- the user for which to create the filterNotificationException
- if an error occurs@Unstable public void createWikiScopeFilterPreference(NotificationFilterType type, Set<NotificationFormat> formats, List<String> eventTypes, EntityReference reference, WikiReference wikiReference) throws NotificationException
createScopeFilterPreference
since a WikiReference can be converted to a
UserReference by our converters, check https://jira.xwiki.org/browse/XWIKI-18496.type
- type of the filter preference to createformats
- formats concerned by the preferenceeventTypes
- the event types concerned by the preferencereference
- the reference of the wiki, the space or the page concerned by the preferencewikiReference
- the wiki for which to create the filterNotificationException
- if an error occursCopyright © 2004–2022 XWiki. All rights reserved.