WEB-INF.cftags.component coldbox.system.FrameworkSupertype coldbox.system.Plugin coldbox.system.plugins.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 |
---|
None |
Constructor Detail |
---|
Plug-in constructor
controller
Method Detail |
---|
Convert a url to a cache key representation
feedURL
- The feed url to parse or retrieve from cacheCreates a ColdBox user agent used in HTTP requests
feedURL
- The url to retrieve the feed from.If the feed exists and it has expired, it removes it other it does nothing
feedURL
- The url to check if its in the cacheFlushes the entire file cache by removing all the entries
Returns the number of elements in the cache directory (only used for file caching)
Get the feed content from the cache, if missing a blank structure is returned. This method does NOT timeout or expire the feeds that is only done by the readFeed method.
feedURL
- The url to check if its in the cacheThe cache location (absolute path)
The cache timeout in minutes
The http timeout in seconds
Whether using file cache or not
Checks if a feed is cached or not
feedURL
- The url to check if its in the cacheChecks if a feed has expired or not. If the feed does not exist an error will be thrown.
feedURL
- The url to check if its in the cacheThis parses a feed as a XML document and returns the results as a structure of elements
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 allRead the cache directory using a filter
filter
- The file filter to use if sent else * is defaultRead a feed sourced from HTTP or from cache. Return a universal structure representation of the feed.
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 allPurges a feed from the cache, returns false if feed is not found
feedURL
- The url to purge from the cacheThis method does a cfhttp call on the feed url and returns a universal parsed feed structure. You can use this when you don't want to use the cache facilities.
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 allCopy feed content into the cache
feedURL
- The feed url to store in the cachefeedStruct
- The content of the feed to cacheThe cache location (absolute path)
cacheLocation
cachePrefix
Set the cache timeout in minutes
cacheTimeout
cacheType
Set the http timeout in seconds
httpTimeout
lockName
Set whether to use file caching or not
useCache