@Role
public interface NotificationFilterManager
Modifier and Type | Method and Description |
---|---|
org.xwiki.rendering.block.Block |
displayFilter(NotificationFilter filter,
NotificationFilterPreference preference)
Render a
NotificationFilter using an associated NotificationFilterPreference . |
Collection<NotificationFilter> |
getAllFilters(boolean allWikis)
Get all notifications filters.
|
Collection<NotificationFilter> |
getAllFilters(DocumentReference user,
boolean onlyEnabled)
Get all notifications filters that are enabled to the given user.
|
default Collection<NotificationFilter> |
getAllFilters(DocumentReference user,
boolean onlyEnabled,
NotificationFilter.FilteringPhase filteringPhase)
Get all notifications filters that are enabled to the given user and matching the requested filtering moment.
|
default Collection<NotificationFilter> |
getAllFilters(WikiReference wikiReference)
Get all notifications filters from the given wikis.
|
Stream<NotificationFilter> |
getEnabledFilters(Collection<NotificationFilter> filters,
Map<String,Boolean> filterActivation)
Goes through every given
NotificationFilter . |
Stream<NotificationFilter> |
getFiltersRelatedToNotificationPreference(Collection<NotificationFilter> filters,
NotificationPreference preference)
Get from the filters the one that match the given notification preference.
|
Map<String,Boolean> |
getToggeableFilterActivations(DocumentReference user)
For all toggeable notification filters, get if the filter is enabled regarding the user profile.
|
Stream<NotificationFilter> |
getToggleableFilters(Collection<NotificationFilter> filters)
Get from the given filter the one that are toggleable.
|
Collection<NotificationFilter> getAllFilters(boolean allWikis) throws NotificationException
allWikis
- include filters from all wikis or only the current oneNotificationException
- if error happens@Unstable default Collection<NotificationFilter> getAllFilters(WikiReference wikiReference) throws NotificationException
wikiReference
- include filters from the given wiki.NotificationException
- if error happensCollection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled) throws NotificationException
user
- reference to the useronlyEnabled
- either or not only filters enabled for the user should be collectedNotificationException
- if an error happens@Unstable default Collection<NotificationFilter> getAllFilters(DocumentReference user, boolean onlyEnabled, NotificationFilter.FilteringPhase filteringPhase) throws NotificationException
user
- reference to the useronlyEnabled
- either or not only filters enabled for the user should be collectedfilteringPhase
- when the filter should be used (null
means any phase)NotificationException
- if an error happensStream<NotificationFilter> getFiltersRelatedToNotificationPreference(Collection<NotificationFilter> filters, NotificationPreference preference)
filters
- a collection of notification filterspreference
- a notification preferenceStream<NotificationFilter> getToggleableFilters(Collection<NotificationFilter> filters)
filters
- a list of notification filtersMap<String,Boolean> getToggeableFilterActivations(DocumentReference user) throws NotificationException
user
- the user to useNotificationException
- if an error happensStream<NotificationFilter> getEnabledFilters(Collection<NotificationFilter> filters, Map<String,Boolean> filterActivation)
NotificationFilter
. One of the filters implements
ToggleableNotificationFilter
, checks if the given user has disabled this filter. If so, remove the
filter from the set.filters
- the filters that should be examinedfilterActivation
- the map of filters associated to their active statusorg.xwiki.rendering.block.Block displayFilter(NotificationFilter filter, NotificationFilterPreference preference) throws NotificationException
NotificationFilter
using an associated NotificationFilterPreference
.filter
- the filter to usepreference
- the notification preference to useNotificationException
- if an error happensCopyright © 2004–2022 XWiki. All rights reserved.