org.clapper.curn.plugins
Class EmptyArticleSummaryPlugIn

java.lang.Object
  extended by org.clapper.curn.plugins.EmptyArticleSummaryPlugIn
All Implemented Interfaces:
FeedConfigItemPlugIn, MainConfigItemPlugIn, PlugIn, PostFeedParsePlugIn

public class EmptyArticleSummaryPlugIn
extends java.lang.Object
implements MainConfigItemPlugIn, FeedConfigItemPlugIn, PostFeedParsePlugIn

The EmptyArticleSummaryPlugIn provides a way to handle an empty summary. It intercepts the following configuration parameters:

Section Parameter Meaning
[curn] SummaryOnly DEPRECATED. Equivalent to ReplaceEmptySummaryWith: nothing
[curn] ReplaceEmptySummaryWith How to handle an empty summary field. Possible values:
  • nothing: do nothing
  • content: use the content, if any
This setting defines the default value for feeds that don't specify their own ReplaceEmptySummaryWith parameter. If not specified, it defaults to content.
[Feedxxx] SummaryOnly DEPRECATED. Equivalent to ReplaceEmptySummaryWith: nothing
[Feedxxx] ReplaceEmptySummaryWith Overrides the global default setting for a given feed.

Version:
$Revision: 6491 $

Field Summary
static java.lang.String VAR_REPLACE_EMPTY_SUMMARY
           
static java.lang.String VAR_SUMMARY_ONLY
           
 
Constructor Summary
EmptyArticleSummaryPlugIn()
          Default constructor (required).
 
Method Summary
 java.lang.String getPlugInName()
          Get a displayable name for the plug-in.
 java.lang.String getPlugInSortKey()
          Get the sort key for this plug-in.
 void initPlugIn()
          Initialize the plug-in.
 boolean runFeedConfigItemPlugIn(java.lang.String sectionName, java.lang.String paramName, CurnConfig config, FeedInfo feedInfo)
          Called immediately after curn has read and processed a configuration item in a "feed" configuration section.
 void runMainConfigItemPlugIn(java.lang.String sectionName, java.lang.String paramName, CurnConfig config)
          Called immediately after curn has read and processed a configuration item in the main [curn] configuration section.
 boolean runPostFeedParsePlugIn(FeedInfo feedInfo, RSSChannel channel)
          Called immediately after a feed is parsed, but before it is otherwise processed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VAR_SUMMARY_ONLY

public static final java.lang.String VAR_SUMMARY_ONLY
See Also:
Constant Field Values

VAR_REPLACE_EMPTY_SUMMARY

public static final java.lang.String VAR_REPLACE_EMPTY_SUMMARY
See Also:
Constant Field Values
Constructor Detail

EmptyArticleSummaryPlugIn

public EmptyArticleSummaryPlugIn()
Default constructor (required).

Method Detail

getPlugInName

public java.lang.String getPlugInName()
Get a displayable name for the plug-in.

Specified by:
getPlugInName in interface PlugIn
Returns:
the name

getPlugInSortKey

public java.lang.String getPlugInSortKey()
Get the sort key for this plug-in.

Specified by:
getPlugInSortKey in interface PlugIn
Returns:
the sort key string.

initPlugIn

public void initPlugIn()
                throws CurnException
Initialize the plug-in. This method is called before any of the plug-in methods are called.

Specified by:
initPlugIn in interface PlugIn
Throws:
CurnException - on error

runMainConfigItemPlugIn

public void runMainConfigItemPlugIn(java.lang.String sectionName,
                                    java.lang.String paramName,
                                    CurnConfig config)
                             throws CurnException
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.

Specified by:
runMainConfigItemPlugIn in interface MainConfigItemPlugIn
Parameters:
sectionName - the name of the configuration section where the item was found
paramName - the name of the parameter
config - the CurnConfig object
Throws:
CurnException - on error
See Also:
CurnConfig

runFeedConfigItemPlugIn

public boolean runFeedConfigItemPlugIn(java.lang.String sectionName,
                                       java.lang.String paramName,
                                       CurnConfig config,
                                       FeedInfo feedInfo)
                                throws CurnException
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.

Specified by:
runFeedConfigItemPlugIn in interface FeedConfigItemPlugIn
Parameters:
sectionName - the name of the configuration section where the item was found
paramName - the name of the parameter
config - the active configuration
feedInfo - partially complete FeedInfo object for the feed. The URL is guaranteed to be present, but no other fields are.
Returns:
true to continue processing the feed, false to skip it
Throws:
CurnException - on error
See Also:
CurnConfig, FeedInfo, FeedInfo.getURL()

runPostFeedParsePlugIn

public boolean runPostFeedParsePlugIn(FeedInfo feedInfo,
                                      RSSChannel channel)
                               throws CurnException
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.

Specified by:
runPostFeedParsePlugIn in interface PostFeedParsePlugIn
Parameters:
feedInfo - the FeedInfo object for the feed that has been downloaded and parsed.
channel - the parsed channel data
Returns:
true if curn should continue to process the feed, false to skip the feed. A return value of false aborts all further processing on the feed. In particular, curn will not pass the feed along to other plug-ins that have yet to be notified of this event.
Throws:
CurnException - on error
See Also:
RSSChannel, FeedInfo


Copyright © 2004-2006 Brian M. Clapper. All Rights Reserved.