Interface NewsSource


  • @Unstable
    public interface NewsSource
    Query the news items for a given source of news (e.g. news located in a xwiki.org blog, news located in a Discourse category, etc).
    Since:
    15.1RC1
    Version:
    $Id: a04fbaf96d18dae138a67c4093fb526173c5eb46 $
    • Method Detail

      • forUser

        NewsSource forUser​(UserReference userReference)
        Filter the news for a given user (if the source supports that).
        Parameters:
        userReference - the reference to the user for which to return news for
        Returns:
        the news source itself to allow for a fluent API
      • forCategories

        NewsSource forCategories​(Set<NewsCategory> wantedCategories)
        Filter the news so that only items matching the passed categories are returned.
        Parameters:
        wantedCategories - the set of categories to filter for
        Returns:
        the news source itself to allow for a fluent API
      • forXWikiVersion

        NewsSource forXWikiVersion​(org.xwiki.extension.version.Version targetXWikiVersion)
        Filter the news for a given XWiki version (if the source supports it).
        Parameters:
        targetXWikiVersion - the XWiki version to return news for
        Returns:
        the news source itself to allow for a fluent API
      • forExtraParameters

        NewsSource forExtraParameters​(Map<String,​Object> extraParameters)
        Filter the news in a way that's source-dependent. This is for future extensibility to allow some source implementations to filter on additional constraints without having to change the news source API.
        Parameters:
        extraParameters - the map of extra parameters to filter against
        Returns:
        the news source itself to allow for a fluent API
      • withCount

        NewsSource withCount​(int count)
        Filter the news to only return a certain number of news items.
        Parameters:
        count - the max number of new items to return
        Returns:
        the news source itself to allow for a fluent API