类 AbstractRssFeedView

java.lang.Object
cn.taketoday.context.support.ApplicationObjectSupport
cn.taketoday.web.view.AbstractView
cn.taketoday.web.view.feed.AbstractFeedView<com.rometools.rome.feed.rss.Channel>
cn.taketoday.web.view.feed.AbstractRssFeedView
所有已实现的接口:
cn.taketoday.beans.factory.Aware, cn.taketoday.beans.factory.BeanNameAware, cn.taketoday.context.ApplicationContextAware, View

public abstract class AbstractRssFeedView extends AbstractFeedView<com.rometools.rome.feed.rss.Channel>
Abstract superclass for RSS Feed views, using the ROME package.

NOTE: this is based on the com.rometools variant of ROME, version 1.5. Please upgrade your build dependency.

Application-specific view classes will extend this class. The view will be held in the subclass itself, not in a template. Main entry points are the AbstractFeedView.buildFeedMetadata(java.util.Map<java.lang.String, java.lang.Object>, T, cn.taketoday.web.RequestContext) and buildFeedItems(java.util.Map<java.lang.String, java.lang.Object>, cn.taketoday.web.RequestContext).

Thanks to Jettro Coenradie and Sergio Bossa for the original feed view prototype!

从以下版本开始:
4.0
作者:
Arjen Poutsma, Juergen Hoeller, Harry Yang
另请参阅:
  • 构造器详细资料

    • AbstractRssFeedView

      public AbstractRssFeedView()
  • 方法详细资料

    • newFeed

      protected com.rometools.rome.feed.rss.Channel newFeed()
      Create a new Channel instance to hold the entries.

      By default returns an RSS 2.0 channel, but the subclass can specify any channel.

      指定者:
      newFeed 在类中 AbstractFeedView<com.rometools.rome.feed.rss.Channel>
      返回:
      the newly created Feed instance
    • buildFeedEntries

      protected final void buildFeedEntries(Map<String,Object> model, com.rometools.rome.feed.rss.Channel channel, RequestContext context) throws Exception
      Invokes buildFeedItems(Map, RequestContext) to get a list of feed items.
      指定者:
      buildFeedEntries 在类中 AbstractFeedView<com.rometools.rome.feed.rss.Channel>
      参数:
      model - the model Map
      channel - the feed to add entries to
      context - in case we need locale etc. Shouldn't look at attributes.
      抛出:
      Exception - any exception that occurred during building
    • buildFeedItems

      protected abstract List<com.rometools.rome.feed.rss.Item> buildFeedItems(Map<String,Object> model, RequestContext context) throws Exception
      Subclasses must implement this method to build feed items, given the model.

      Note that the passed-in HTTP response is just supposed to be used for setting cookies or other HTTP headers. The built feed itself will automatically get written to the response after this method returns.

      参数:
      model - the model Map
      context - in case we need locale etc. Shouldn't look at attributes.
      返回:
      the feed items to be added to the feed
      抛出:
      Exception - any exception that occurred during document building
      另请参阅:
      • Item