com.blackledge.david.tivo.multitasker.plugins
Class RSSTicker

java.lang.Object
  extended by com.blackledge.david.tivo.multitasker.plugins.RSSTicker
All Implemented Interfaces:
LocalOptionProvider, TickerTape

public class RSSTicker
extends Object
implements TickerTape, LocalOptionProvider

TickerTape that provides images, headings, and ticker content based on a list of RSS feed URLs using just SAX and DOM to parse. TODO: support shuffle/random

Version:
$Revision: 1.1 $

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.blackledge.david.tivo.multitasker.TickerTape
TickerTape.TickerTapeSegment, TickerTape.TickerTapeSegmentDefault
 
Field Summary
static String OPTION_FEEDS
           
static String OPTION_INCLUDE_STORY
           
 
Fields inherited from interface com.blackledge.david.tivo.multitasker.LocalOptionProvider
TYPE_BOOLEAN, TYPE_CLASS, TYPE_COLOR, TYPE_FILE, TYPE_FLOAT, TYPE_FOLDER, TYPE_IMAGE, TYPE_INTEGER, TYPE_STRING, TYPE_URL
 
Constructor Summary
RSSTicker()
           
 
Method Summary
protected  List getChildElementsByTagName(Element parentElement, String name)
          Often we want to work with all the subtags of a given name (or just all subtags) - this gets them for us.
 String getLocalOptionDefault(String key)
          defaults for each of the local option keys.
 Collection getLocalOptionNames()
          just the keySet of getLocalOptionPreferences()
 Map getLocalOptionPreferences()
          Add support for #OPTION_LOCAL_IMAGE_FOLDER map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class.
 TickerTape.TickerTapeSegment getNextContent()
           
protected  String getNodeValue(Node element)
          Typically we want the text value contained within a tag...
protected  Element getSingleChildElementByTagName(Element parentElement, String name)
          Often we know we want one subtag and it won't appear more than once, this gets it for us.
 void init(MultiTaskerApplication app)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_FEEDS

public static final String OPTION_FEEDS
See Also:
Constant Field Values

OPTION_INCLUDE_STORY

public static final String OPTION_INCLUDE_STORY
See Also:
Constant Field Values
Constructor Detail

RSSTicker

public RSSTicker()
Method Detail

getNextContent

public TickerTape.TickerTapeSegment getNextContent()
Specified by:
getNextContent in interface TickerTape

init

public void init(MultiTaskerApplication app)
Specified by:
init in interface TickerTape

getSingleChildElementByTagName

protected Element getSingleChildElementByTagName(Element parentElement,
                                                 String name)
Often we know we want one subtag and it won't appear more than once, this gets it for us.

Parameters:
parentElement -
name - may not be null.
Returns:
the named Tag, or null if that named tag isn't a child of this parentElement.

getChildElementsByTagName

protected List getChildElementsByTagName(Element parentElement,
                                         String name)
Often we want to work with all the subtags of a given name (or just all subtags) - this gets them for us.

Parameters:
parentElement -
name - - null means accept all tag names into the list.
Returns:
List containing only Element instances. never null

getNodeValue

protected String getNodeValue(Node element)
Typically we want the text value contained within a tag... this gets it, or null if anything along the path to getting it is null.

Parameters:
element -
Returns:
a String value (trimmed) or null

getLocalOptionNames

public Collection getLocalOptionNames()
just the keySet of getLocalOptionPreferences()

Specified by:
getLocalOptionNames in interface LocalOptionProvider
Returns:

getLocalOptionPreferences

public Map getLocalOptionPreferences()
Add support for #OPTION_LOCAL_IMAGE_FOLDER map of your option keys where the value is "Type[+],text [range]" per the MultiTaskerPreferences class. Use a LinkedHashMap to maintain the order of your options.

Specified by:
getLocalOptionPreferences in interface LocalOptionProvider
Returns:
See Also:
LocalOptionProvider.getLocalOptionPreferences()

getLocalOptionDefault

public String getLocalOptionDefault(String key)
Description copied from interface: LocalOptionProvider
defaults for each of the local option keys. Could just return null if there is no provided default. If the local option default starts with a +, it is appended (delimeted by a comma) to the getOptionDefault value, if any.

Specified by:
getLocalOptionDefault in interface LocalOptionProvider
Returns:
Option value to use if none is set or overridden.