Class Feed

java.lang.Object
org.apache.wiki.rss.Feed
Direct Known Subclasses:
AtomFeed, RSS10Feed, RSS20Feed

public abstract class Feed
extends java.lang.Object
Represents an abstract feed.
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.lang.String m_channelDescription  
    protected java.lang.String m_channelLanguage  
    protected java.lang.String m_channelTitle  
    protected java.util.List<Entry> m_entries  
    protected java.lang.String m_feedURL  
    protected java.lang.String m_mode  
    protected Context m_wikiContext  
    static java.lang.String VAR_BLOGNAME
    Wiki variable storing the blog's name.
  • Constructor Summary

    Constructors
    Constructor Description
    Feed​(Context context)
    Create a new Feed for a particular WikiContext.
  • Method Summary

    Modifier and Type Method Description
    void addEntry​(Entry e)
    Adds a new Entry to the Feed, at the end of the list.
    static java.lang.String format​(java.lang.String s)
    Does the required formatting and entity replacement for XML.
    java.lang.String getChannelDescription()  
    java.lang.String getChannelLanguage()  
    java.lang.String getChannelTitle()  
    java.lang.String getFeedURL()  
    protected java.lang.String getMimeType​(javax.servlet.ServletContext c, java.lang.String name)
    A helper method for figuring out the MIME type for an enclosure.
    static java.lang.String getSiteName​(Context context)
    Figure out a site name for a feed.
    abstract java.lang.String getString()
    Returns the XML for the feed contents in a String format.
    void setChannelDescription​(java.lang.String description)  
    void setChannelLanguage​(java.lang.String language)  
    void setChannelTitle​(java.lang.String title)  
    void setFeedURL​(java.lang.String feedurl)  
    void setMode​(java.lang.String mode)
    Set the mode of the Feed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Feed

      public Feed​(Context context)
      Create a new Feed for a particular WikiContext.
      Parameters:
      context - The WikiContext.
  • Method Details

    • getSiteName

      public static java.lang.String getSiteName​(Context context)
      Figure out a site name for a feed.
      Parameters:
      context - the wiki context
      Returns:
      the site name
    • setMode

      public void setMode​(java.lang.String mode)
      Set the mode of the Feed. It can be any of the following: As the Entry list itself is generated elsewhere, this mostly just affects the way that the layout and metadata for each entry is generated.
      Parameters:
      mode - As defined in RSSGenerator.
    • addEntry

      public void addEntry​(Entry e)
      Adds a new Entry to the Feed, at the end of the list.
      Parameters:
      e - The Entry to add.
    • getString

      public abstract java.lang.String getString()
      Returns the XML for the feed contents in a String format. All subclasses must implement.
      Returns:
      valid XML, ready to be shoved out.
    • getChannelDescription

      public java.lang.String getChannelDescription()
      Returns:
      Returns the m_channelDescription.
    • setChannelDescription

      public void setChannelDescription​(java.lang.String description)
      Parameters:
      description - The m_channelDescription to set.
    • getChannelLanguage

      public java.lang.String getChannelLanguage()
      Returns:
      Returns the m_channelLanguage.
    • setChannelLanguage

      public void setChannelLanguage​(java.lang.String language)
      Parameters:
      language - The m_channelLanguage to set.
    • getChannelTitle

      public java.lang.String getChannelTitle()
      Returns:
      Returns the m_channelTitle.
    • setChannelTitle

      public void setChannelTitle​(java.lang.String title)
      Parameters:
      title - The m_channelTitle to set.
    • getFeedURL

      public java.lang.String getFeedURL()
      Returns:
      Returns the m_feedURL.
    • setFeedURL

      public void setFeedURL​(java.lang.String feedurl)
      Parameters:
      feedurl - The m_feedURL to set.
    • getMimeType

      protected java.lang.String getMimeType​(javax.servlet.ServletContext c, java.lang.String name)
      A helper method for figuring out the MIME type for an enclosure.
      Parameters:
      c - A ServletContext
      name - The filename
      Returns:
      Something sane for a MIME type.
    • format

      public static java.lang.String format​(java.lang.String s)
      Does the required formatting and entity replacement for XML.
      Parameters:
      s - The String to format. Null is safe.
      Returns:
      A formatted string.