Package org.apache.wiki.rss
Class Feed
java.lang.Object
org.apache.wiki.rss.Feed
public abstract class Feed extends Object
Represents an abstract feed.
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_channelDescriptionprotected Stringm_channelLanguageprotected Stringm_channelTitleprotected List<Entry>m_entriesprotected Stringm_feedURLprotected Stringm_modeprotected Contextm_wikiContextstatic StringVAR_BLOGNAMEWiki variable storing the blog's name. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidaddEntry(Entry e)Adds a new Entry to the Feed, at the end of the list.static Stringformat(String s)Does the required formatting and entity replacement for XML.StringgetChannelDescription()StringgetChannelLanguage()StringgetChannelTitle()StringgetFeedURL()protected StringgetMimeType(javax.servlet.ServletContext c, String name)A helper method for figuring out the MIME type for an enclosure.static StringgetSiteName(Context context)Figure out a site name for a feed.abstract StringgetString()Returns the XML for the feed contents in a String format.voidsetChannelDescription(String description)voidsetChannelLanguage(String language)voidsetChannelTitle(String title)voidsetFeedURL(String feedurl)voidsetMode(String mode)Set the mode of the Feed.
-
Field Details
-
m_entries
-
m_feedURL
-
m_channelTitle
-
m_channelDescription
-
m_channelLanguage
-
m_wikiContext
-
m_mode
-
VAR_BLOGNAME
Wiki variable storing the blog's name.- See Also:
- Constant Field Values
-
-
Constructor Details
-
Feed
Create a new Feed for a particular WikiContext.- Parameters:
context- The WikiContext.
-
-
Method Details
-
getSiteName
Figure out a site name for a feed.- Parameters:
context- the wiki context- Returns:
- the site name
-
setMode
Set the mode of the Feed. It can be any of the following:RSSGenerator.MODE_WIKI- to create a wiki diff list per page.RSSGenerator.MODE_BLOG- to assume that the Entries are blog entries.RSSGenerator.MODE_FULL- to create a wiki diff list for the entire blog.
- Parameters:
mode- As defined in RSSGenerator.
-
addEntry
Adds a new Entry to the Feed, at the end of the list.- Parameters:
e- The Entry to add.
-
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
- Returns:
- Returns the m_channelDescription.
-
setChannelDescription
- Parameters:
description- The m_channelDescription to set.
-
getChannelLanguage
- Returns:
- Returns the m_channelLanguage.
-
setChannelLanguage
- Parameters:
language- The m_channelLanguage to set.
-
getChannelTitle
- Returns:
- Returns the m_channelTitle.
-
setChannelTitle
- Parameters:
title- The m_channelTitle to set.
-
getFeedURL
- Returns:
- Returns the m_feedURL.
-
setFeedURL
- Parameters:
feedurl- The m_feedURL to set.
-
getMimeType
A helper method for figuring out the MIME type for an enclosure.- Parameters:
c- A ServletContextname- The filename- Returns:
- Something sane for a MIME type.
-
format
Does the required formatting and entity replacement for XML.- Parameters:
s- The String to format. Null is safe.- Returns:
- A formatted string.
-