|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |
WEB-INF.cftags.componentcoldbox.system.FrameworkSupertype
coldbox.system.Plugin
coldbox.system.plugins.FeedReader
public class FeedReader
A feed reader plug-in that processes Atom, RDF and RSS formats. The recommended method for general usage is readFeed().
Constructor Summary | |
---|---|
init(any controller)
Plug-in constructor |
Method Summary | |
---|---|
private string |
URLToCacheKey(string feedURL)
Convert a url to a cache key representation |
package string |
createUserAgent()
Creates a ColdBox user agent used in HTTP requests |
package string |
downloadFeed(string feedURL)
|
void |
expireCachedFeed(string feedURL)
If the feed exists and it has expired, it removes it other it does nothing |
void |
flushCache()
Flushes the entire file cache by removing all the entries |
numeric |
getCacheSize()
Returns the number of elements in the cache directory (only used for file caching) |
any |
getCachedFeed(string feedURL)
Get the feed content from the cache, if missing a blank structure is returned |
string |
getcacheLocation()
The cache location (absolute path) |
string |
getcachePrefix()
|
numeric |
getcacheTimeout()
The cache timeout in minutes |
string |
getcacheType()
|
numeric |
gethttpTimeout()
The http timeout in seconds |
private string |
getlockName()
|
boolean |
getuseCache()
Whether using file cache or not |
boolean |
isFeedCached(string feedURL)
Checks if a feed is cached or not |
boolean |
isFeedExpired(string feedURL)
Checks if a feed has expired or not |
struct |
parseFeed(xml xmlDoc, [string itemsType='array'], [numeric maxItems='0'])
This parses a feed as a XML document and returns the results as a structure of elements |
private query |
readCacheDir([string filter='*'])
Read the cache directory using a filter |
struct |
readFeed(string feedURL, [string itemsType='array'], [numeric maxItems='0'])
Read a feed sourced from HTTP or from cache |
boolean |
removeCachedFeed(string feedURL)
Purges a feed from the cache, returns false if feed is not found |
struct |
retrieveFeed(string feedURL, [string itemsType='array'], [numeric maxItems='0'])
This method does a cfhttp call on the feed url and returns a universal parsed feed structure |
void |
setCachedFeed(string feedURL, any feedStruct)
Copy feed content into the cache |
void |
setcacheLocation(string cacheLocation)
The cache location (absolute path) |
void |
setcachePrefix(string cachePrefix)
|
void |
setcacheTimeout(numeric cacheTimeout)
Set the cache timeout in minutes |
void |
setcacheType(string cacheType)
|
void |
sethttpTimeout(numeric httpTimeout)
Set the http timeout in seconds |
private void |
setlockName(string lockName)
|
void |
setuseCache(boolean useCache)
Set whether to use file caching or not |
Methods inherited from class WEB-INF.cftags.component |
---|
|
Constructor Detail |
---|
public init(any controller)
controller
Method Detail |
---|
private string URLToCacheKey(string feedURL)
feedURL
- The feed url to parse or retrieve from cachepackage string createUserAgent()
package string downloadFeed(string feedURL)
feedURL
- The url to retrieve the feed from.public void expireCachedFeed(string feedURL)
feedURL
- The url to check if its in the cachepublic void flushCache()
public numeric getCacheSize()
public any getCachedFeed(string feedURL)
feedURL
- The url to check if its in the cachepublic string getcacheLocation()
public string getcachePrefix()
public numeric getcacheTimeout()
public string getcacheType()
public numeric gethttpTimeout()
private string getlockName()
public boolean getuseCache()
public boolean isFeedCached(string feedURL)
feedURL
- The url to check if its in the cachepublic boolean isFeedExpired(string feedURL)
feedURL
- The url to check if its in the cachepublic struct parseFeed(xml xmlDoc, [string itemsType='array'], [numeric maxItems='0'])
xmlDoc
- The XML document (saved as a ColdFusion object) to parse and normalizeitemsType
- The type of the items either query or array, array is used by defaultmaxItems
- The maximum number of entries to retrieve, default is display allprivate query readCacheDir([string filter='*'])
filter
- The file filter to use if sent else * is defaultpublic struct readFeed(string feedURL, [string itemsType='array'], [numeric maxItems='0'])
feedURL
- The feed url to parse or retrieve from cacheitemsType
- The type of the items either query or array, array is used by defaultmaxItems
- The maximum number of entries to retrieve, default is display allpublic boolean removeCachedFeed(string feedURL)
feedURL
- The url to purge from the cachepublic struct retrieveFeed(string feedURL, [string itemsType='array'], [numeric maxItems='0'])
feedURL
- The url to retrieve the feed from.itemsType
- The type of the items either query or array, array is defaultmaxItems
- The max number of entries to retrieve, default is allpublic void setCachedFeed(string feedURL, any feedStruct)
feedURL
- The feed url to store in the cachefeedStruct
- The content of the feed to cachepublic void setcacheLocation(string cacheLocation)
cacheLocation
public void setcachePrefix(string cachePrefix)
cachePrefix
public void setcacheTimeout(numeric cacheTimeout)
cacheTimeout
public void setcacheType(string cacheType)
cacheType
public void sethttpTimeout(numeric httpTimeout)
httpTimeout
private void setlockName(string lockName)
lockName
public void setuseCache(boolean useCache)
useCache
|
ColdBox Platform Version 3.7.0 | ||||
FRAMES |