|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.rss.RSSGenerator
public class RSSGenerator
The master class for generating different kinds of Feeds (including RSS1.0, 2.0 and Atom).
This class can produce quite a few different styles of feeds. The following modes are available:
Field Summary | |
---|---|
static String |
ATOM
Parameter value to represent Atom feeds. |
static String |
MODE_BLOG
Parameter value to represent a 'blog' style feed. |
static String |
MODE_FULL
Parameter value to represent a 'full' style feed. |
static String |
MODE_WIKI
Parameter value to represent a 'wiki' style feed. |
static String |
PROP_CHANNEL_DESCRIPTION
Defines the property name for the RSS channel description. |
static String |
PROP_CHANNEL_LANGUAGE
Defines the property name for the RSS channel language. |
static String |
PROP_CHANNEL_TITLE
Defins the property name for the RSS channel title. |
static String |
PROP_GENERATE_RSS
Defines the property name for the RSS generator main switch. |
static String |
PROP_INTERVAL
Defines the property name for the RSS generation interval in seconds. |
static String |
PROP_RSS_AUTHOR
Defines the property name for the RSS author. |
static String |
PROP_RSS_AUTHOREMAIL
Defines the property name for the RSS author email. |
static String |
PROP_RSS_COPYRIGHT
Property name for the RSS copyright info. |
static String |
PROP_RSSAUTHOR
Just for compatibilty. |
static String |
PROP_RSSAUTHOREMAIL
Just for compatibilty. |
static String |
PROP_RSSFILE
Defines the property name for the RSS file that the wiki should generate. |
static String |
RSS10
Parameter value to represent RSS 1.0 feeds. |
static String |
RSS20
Parameter value to represent RSS 2.0 feeds. |
Constructor Summary | |
---|---|
RSSGenerator(WikiEngine engine,
Properties properties)
Initialize the RSS generator for a given WikiEngine. |
Method Summary | |
---|---|
static String |
format(String s)
Does the required formatting and entity replacement for XML. |
String |
generate()
Generates the RSS resource. |
protected String |
generateBlogRSS(WikiContext wikiContext,
List changed,
Feed feed)
Creates RSS from modifications as if this page was a blog (using the WeblogPlugin). |
String |
generateFeed(WikiContext wikiContext,
List changed,
String mode,
String type)
Generates a feed based on a context and list of changes. |
protected String |
generateFullWikiRSS(WikiContext wikiContext,
Feed feed)
Generates an RSS feed for the entire wiki. |
protected String |
generateWikiPageRSS(WikiContext wikiContext,
List changed,
Feed feed)
Create RSS/Atom as if this page was a wikipage (in contrast to Blog mode). |
static String |
getContentType(String mode)
Returns the content type of this RSS feed. |
boolean |
isEnabled()
Returns true if RSS generation is enabled. |
void |
setEnabled(boolean enabled)
Turns RSS generation on or off. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String RSS10
public static final String RSS20
public static final String ATOM
public static final String MODE_BLOG
public static final String MODE_WIKI
public static final String MODE_FULL
public static final String PROP_CHANNEL_DESCRIPTION
public static final String PROP_CHANNEL_LANGUAGE
public static final String PROP_CHANNEL_TITLE
public static final String PROP_GENERATE_RSS
public static final String PROP_RSSFILE
public static final String PROP_INTERVAL
public static final String PROP_RSS_AUTHOR
public static final String PROP_RSS_AUTHOREMAIL
public static final String PROP_RSS_COPYRIGHT
public static final String PROP_RSSAUTHOR
public static final String PROP_RSSAUTHOREMAIL
Constructor Detail |
---|
public RSSGenerator(WikiEngine engine, Properties properties) throws NoRequiredPropertyException
engine
- The WikiEngine.properties
- The properties.
NoRequiredPropertyException
- If something is missing from the given property set.Method Detail |
---|
public static String format(String s)
s
- String to format.
public String generate()
public static String getContentType(String mode)
mode
- the RSS mode: RSS10
, RSS20
or ATOM
.
public String generateFeed(WikiContext wikiContext, List changed, String mode, String type) throws ProviderException, IllegalArgumentException
wikiContext
- The WikiContextchanged
- A list of Entry objectsmode
- The mode (wiki/blog)type
- The type (RSS10, RSS20, ATOM). Default is RSS 1.0
ProviderException
- If the underlying provider failed.
IllegalArgumentException
- If an illegal mode is given.public boolean isEnabled()
true
if RSS generation is enabled.
public void setEnabled(boolean enabled)
generate()
or
generateFeed(WikiContext, List, String, String)
methods output anything.
enabled
- whether RSS generation is considered enabled.protected String generateFullWikiRSS(WikiContext wikiContext, Feed feed)
wikiContext
- A WikiContextfeed
- A Feed to generate the feed to.
protected String generateWikiPageRSS(WikiContext wikiContext, List changed, Feed feed)
wikiContext
- The WikiContextchanged
- A List of changed WikiPages.feed
- A Feed object to fill.
protected String generateBlogRSS(WikiContext wikiContext, List changed, Feed feed) throws ProviderException
wikiContext
- The WikiContext, as usual.changed
- A list of the changed pages.feed
- A valid Feed object. The feed will be used to create the RSS/Atom, depending
on which kind of an object you want to put in it.
ProviderException
- If reading of pages was not possible.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |