| java.lang.Object org.clapper.curn.plugins.IgnoreOldArticlesPlugIn
IgnoreOldArticlesPlugIn | public class IgnoreOldArticlesPlugIn implements MainConfigItemPlugIn,FeedConfigItemPlugIn,PostFeedParsePlugIn(Code) | | The IgnoreOldArticlesPlugIn provides a way to ignore articles that
are older than a certain interval. It can be applied globally and overridden
on a per-feed basis, or it can be applied only for selected feeds. This
plug-in is especially useful when:
- You've added a new feed, but you don't want to see every article
ever published by that site.
- A feed has been out of commission for awhile and is coming back online.
- A feed's URL changes (which looks like a new feed to curn).
Age is specified using natural language strings that express durations.
(The
RetainArticlesPlugIn class uses the same time interval form.)
Examples:
- 3 days
- 1 week
- 365 days
- 12 hours, 30 minutes
Valid interval names (in English) are:
- "millisecond", "milliseconds", "ms"
- "second", "seconds", "sec", "secs"
- "minutes", "minutes", "min", "mins"
- "hour", "hours", "hr", "hrs"
- "day", "days"
- "week", "weeks"
This plug-in uses the
org.clapper.util
library's
Duration
class to parse the age/duration values. See that class for more details.
For this plug-in to work for a feed, the feed's articles must be tagged
with valid, parseable dates. If an article does not have a date, then the
current date is assumed. n
This plug-in intercepts the following configuration parameters.
Section |
Parameter |
Meaning |
Default |
[curn] |
IgnoreArticlesOlderThan |
Global default specifying how old an article must be before this
plug-in will discard it. Applies to all feeds that don't explicitly
specify this parameter. |
None. (Articles aren't suppressed by age.) |
[Feedxxx] |
IgnoreArticlesOlderThan |
Per-feed parameter specifying how old an article must be before this
plug-in will discard it. |
The global IgnoreArticlesOlderThan setting. If there is
no global setting, then the default is not to suppress articles
based on age. |
version: $Revision: 6688 $ |
VAR_IGNORE_OLD_ARTICLES | final public static String VAR_IGNORE_OLD_ARTICLES(Code) | | |
IgnoreOldArticlesPlugIn | public IgnoreOldArticlesPlugIn()(Code) | | Default constructor (required).
|
getPlugInName | public String getPlugInName()(Code) | | Get a displayable name for the plug-in.
the name |
getPlugInSortKey | public String getPlugInSortKey()(Code) | | Get the sort key for this plug-in.
the sort key string. |
initPlugIn | public void initPlugIn() throws CurnException(Code) | | Initialize the plug-in. This method is called before any of the
plug-in methods are called.
throws: CurnException - on error |
runFeedConfigItemPlugIn | public boolean runFeedConfigItemPlugIn(String sectionName, String paramName, CurnConfig config, FeedInfo feedInfo) throws CurnException(Code) | | Called immediately after curn has read and processed a
configuration item in a "feed" configuration section. All
configuration items are passed, one by one, to each loaded plug-in.
If a plug-in class is not interested in a particular configuration
item, this method should simply return without doing anything. Note
that some configuration items may simply be variable assignment;
there's no real way to distinguish a variable assignment from a
blessed configuration item.
Parameters: sectionName - the name of the configuration section wherethe item was found Parameters: paramName - the name of the parameter Parameters: config - the active configuration Parameters: feedInfo - partially complete FeedInfo objectfor the feed. The URL is guaranteed to bepresent, but no other fields are. true to continue processing the feed,false to skip it throws: CurnException - on error See Also: CurnConfig See Also: FeedInfo See Also: FeedInfo.getURL |
runMainConfigItemPlugIn | public void runMainConfigItemPlugIn(String sectionName, String paramName, CurnConfig config) throws CurnException(Code) | | Called immediately after curn has read and processed a
configuration item in the main [curn] configuration section. All
configuration items are passed, one by one, to each loaded plug-in.
If a plug-in class is not interested in a particular configuration
item, this method should simply return without doing anything. Note
that some configuration items may simply be variable assignment;
there's no real way to distinguish a variable assignment from a
blessed configuration item.
Parameters: sectionName - the name of the configuration section wherethe item was found Parameters: paramName - the name of the parameter Parameters: config - the CurnConfig object throws: CurnException - on error See Also: CurnConfig |
runPostFeedParsePlugIn | public boolean runPostFeedParsePlugIn(FeedInfo feedInfo, FeedCache feedCache, RSSChannel channel) throws CurnException(Code) | | Called immediately after a feed is parsed, but before it is
otherwise processed. This method can return false to signal
curn that the feed should be skipped. For instance, a plug-in
that filters on the parsed feed data could use this method to weed
out non-matching feeds before they are downloaded. Similarly, a
plug-in that edits the parsed data (removing or editing individual
items, for instance) could use method to do so.
Parameters: feedInfo - the FeedInfo object for the feed thathas been downloaded and parsed. Parameters: feedCache - the feed cache Parameters: channel - the parsed channel data true if curn should continue to process thefeed, false to skip the feed. A return value offalse aborts all further processing on the feed.In particular, curn will not pass the feed along toother plug-ins that have yet to be notified of this event. throws: CurnException - on error See Also: RSSChannel See Also: FeedInfo |
|
|