|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.radeox.macro.BaseMacro
org.radeox.macro.BaseLocaleMacro
com.xpn.xwiki.render.macro.rss.RSSMacro
A Radeox MacroFilter for rendering an RSS feed.
Field Summary | |
private static java.lang.String |
DESCRIPTION
|
private static java.lang.String |
NAME
|
private static char |
NEWLINE
|
private static java.lang.String[] |
PARAM_DESCRIPTION
|
private static java.lang.String[] |
PARAM_NAMES
|
Fields inherited from class org.radeox.macro.BaseLocaleMacro |
|
Fields inherited from class org.radeox.macro.BaseMacro |
description, initialContext, paramDescription |
Constructor Summary | |
RSSMacro()
|
Method Summary | |
void |
execute(java.io.Writer writer,
org.radeox.macro.parameter.MacroParameter parameter)
Process the macro. |
java.lang.String |
getDescription()
|
java.lang.String |
getLocaleKey()
|
java.lang.String |
getName()
|
java.lang.String[] |
getParamDescription()
|
private RSSMacroParameters |
processParameters(org.radeox.macro.parameter.MacroParameter parameter)
Transform the input parameters into RSSMacroParameters object. |
private void |
renderEntries(com.sun.syndication.feed.synd.SyndFeed feed,
java.io.Writer writer,
RSSMacroParameters paramObj)
Render as many of the given Channel 's items as needed,
according to the value of the optional count parameter
and the number of items in the feed. |
private void |
renderEntry(com.sun.syndication.feed.synd.SyndEntry entry,
java.io.Writer writer,
RSSMacroParameters paramObj)
Render the given RSS Item according to whether or not the
parameters call for CSS processing. |
private void |
renderEntryCSS(com.sun.syndication.feed.synd.SyndEntry entry,
java.lang.StringBuffer buf,
RSSMacroParameters paramObj)
Render the given Item using <div> tags
with CSS class attributes. |
private void |
renderEntryDefault(com.sun.syndication.feed.synd.SyndEntry entry,
java.lang.StringBuffer buf,
RSSMacroParameters paramObj)
Render the given Item using Radeox macros. |
private void |
renderImage(com.sun.syndication.feed.synd.SyndFeed feed,
java.io.Writer writer,
RSSMacroParameters paramObj)
If a parameter was passed with the name "img" and the literal value "true", render the image from the channel (if it has one.) This requires the use of named parameters. |
private void |
renderSearch(com.sun.syndication.feed.synd.SyndFeed feed,
java.io.Writer writer,
RSSMacroParameters paramObj)
CSS styles are used because there is no way to render this using 'default' because org.snipsnap.render.macro.FieldMacro only permits form submission to other snips. |
private void |
renderTitle(com.sun.syndication.feed.synd.SyndFeed feed,
java.io.Writer writer,
RSSMacroParameters paramObj)
Render the 'title' of the given RSS Channel to the Writer . |
private void |
renderTitleCSS(com.sun.syndication.feed.synd.SyndFeed feed,
java.lang.StringBuffer buf)
Render the title from the given Channel to the given StringBuffer, using CSS styled 'div' tags. |
private void |
renderTitleDefault(com.sun.syndication.feed.synd.SyndFeed feed,
java.lang.StringBuffer buf)
Render the title from the given Channel to the given StringBuffer, using standard Radeox filtering tags. |
Methods inherited from class org.radeox.macro.BaseLocaleMacro |
setInitialContext |
Methods inherited from class org.radeox.macro.BaseMacro |
compareTo, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final java.lang.String NAME
private static final java.lang.String DESCRIPTION
private static final java.lang.String[] PARAM_DESCRIPTION
private static final java.lang.String[] PARAM_NAMES
private static final char NEWLINE
Constructor Detail |
public RSSMacro()
Method Detail |
public java.lang.String getLocaleKey()
public java.lang.String getName()
public void execute(java.io.Writer writer, org.radeox.macro.parameter.MacroParameter parameter) throws java.lang.IllegalArgumentException, java.io.IOException
writer
- the output writerparameter
- the input parameters of the macro.
java.lang.IllegalArgumentException
java.io.IOException
- from calls to writer.write()
TODO Make commons-digester understand more different RSS feeds, or switch
to a better RSS library.private void renderEntries(com.sun.syndication.feed.synd.SyndFeed feed, java.io.Writer writer, RSSMacroParameters paramObj) throws java.io.IOException
Channel
's items as needed,
according to the value of the optional count
parameter
and the number of items in the feed.
writer
- the output writerparamObj
- our parameter helper object
java.io.IOException
private void renderEntry(com.sun.syndication.feed.synd.SyndEntry entry, java.io.Writer writer, RSSMacroParameters paramObj) throws java.io.IOException
Item
according to whether or not the
parameters call for CSS processing.
writer
- the output writerparamObj
- our parameter helper object
java.io.IOException
- from calls to writer.write()
private void renderEntryDefault(com.sun.syndication.feed.synd.SyndEntry entry, java.lang.StringBuffer buf, RSSMacroParameters paramObj)
Item
using Radeox macros.
__bold__
{link}
macro.{quote}
macro tags.
buf
- the StringBuffer we're using to prepare the outputparamObj
- our parameter helper objectprivate void renderEntryCSS(com.sun.syndication.feed.synd.SyndEntry entry, java.lang.StringBuffer buf, RSSMacroParameters paramObj)
Item
using <div>
tags
with CSS class attributes.
<div class='rss.item'>
<div class='rss.item.title'>
<a class='rss.item.title'>
<div class='rss.item.description'>
buf
- the StringBuffer we're using to prepare the outputparamObj
- our parameter helper object
TODO Figure out how to stop Radeox from filtering the URLsprivate void renderTitle(com.sun.syndication.feed.synd.SyndFeed feed, java.io.Writer writer, RSSMacroParameters paramObj) throws java.io.IOException
Writer
.
feed
- the RSS Channel we retrieved via the Feed URLwriter
- the output writerparamObj
- our parameter helper object
java.io.IOException
- from calls to writer.write()
private void renderTitleDefault(com.sun.syndication.feed.synd.SyndFeed feed, java.lang.StringBuffer buf)
feed
- the RSS Channel we retrieved via the Feed URLbuf
- the StringBuffer we're using to prepare the outputprivate void renderTitleCSS(com.sun.syndication.feed.synd.SyndFeed feed, java.lang.StringBuffer buf)
rss.channel.title
. If
the channel includes a link, the title will be rendered as a link to
that URL, and the <a> tag will also be of class
rss.channel.title
feed
- the RSS Channel we retrieved via the Feed URLbuf
- the StringBuffer we're using to prepare the output
TODO Figure out how to stop Radeox from filtering the URLsprivate void renderImage(com.sun.syndication.feed.synd.SyndFeed feed, java.io.Writer writer, RSSMacroParameters paramObj) throws java.io.IOException
feed
- the RSS Channel we retrieved via the Feed URLwriter
- the output writerparamObj
- our parameter helper object
java.io.IOException
- from calls to writer.write()
private void renderSearch(com.sun.syndication.feed.synd.SyndFeed feed, java.io.Writer writer, RSSMacroParameters paramObj) throws java.io.IOException
feed
- the RSS Channel we retrieved via the Feed URLwriter
- the output writerparamObj
- our parameter helper object
java.io.IOException
- from calls to writer.write()
public java.lang.String[] getParamDescription()
public java.lang.String getDescription()
private RSSMacroParameters processParameters(org.radeox.macro.parameter.MacroParameter parameter) throws java.lang.IllegalArgumentException
RSSMacroParameters
object.
parameter
- the parameters as prepared by the Radeox system.
java.lang.IllegalArgumentException
- if the 'feed' named parameter
is missing, or is a malformed URL, or if any of the other parameter values
are not of the correct types. Note that unknown parameters will simply
be ignored, and all parameters must be passed using names.RSSMacroParameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |