One thing that I haven't made that clear about BottomFeeder is that it's been designed for extensibility via plugins - I've created a number myself - the Posting Tool and the Enclosure Handler. I've packaged TypeLess as a plugin, as well as a number of games that Steve Kelly fixed up for later releases of VisualWorks. I've also done some additional work on Bob Westergaard's scripting plugin. All of this stuff either ships with BottomFeeder, or is available for download via the update tool.
The plugin mechanism is pretty simple. There are a number of events that BottomFeeder reports that make it easy for applications to deal with things happening:
- #bfOnline - reported when the application goes online
- #bfOffline - reported when the application goes offline
- #bottomFeederStarting: - reported when BottomFeeder is starting. The RSSFeedViewer instance is sent as an argument
- #bottomFeederQuitting: - reported when BottomFeeder is quitting. This happens both in development and in deployment - the RssFeedViewer instance is sent as an argument
- #quitting - reported in deployment only, when BottomFeeder is quitting. BottomFeeder will not quit until all handlers have returned
- #addedFeedList: - reported when a feed list has been added. The FeedList is sent as an argument
- #addedFeed: - reported when a feed has been added. The Feed is sent as an argument
- #newItemsFor: - reported when there are new items in a feed. The Feed is sent as an argument
- #removeFeed: - reported when a feed is removed. The Feed url is sent as an argument
- #removeFeedList: - reported when a feedlist is removed. The Feedlist url is sent as an argument
The other thing you need to do is register your plugin with BottomFeeder. The way you do this is to add a small message to the #postLoad action of your plugin parcel (the plugin should be packaged as a parcel). That snippet looks like this:
#{RSS.RSSFeedViewer} ifDefinedDo: [:cls |
cls registerPluginClass: BlogTools.PostingTool
startupMessage: #openWith:
label: 'CST Blog Tool'].
That's the message send that's used by the Posting Tool to register itself. There are actually two forms of registration possible, depending on what your plugin is going to do:
- registerPluginClass: aClass startupMessage: aSymbol label: aString
- registerPluginClass: aClass startupMessage: aSymbol label: aString isForUI: aBoolean
You can send the second to specify that there's really no UI if necessary; the first will assume one and add an item to the 'plugins' menu. Finally, there's a way to unregister a plugin as well. This code should be put into the parcel preUnload: block:
unregisterPluginClass: aClass
With that, you can properly unhook the menu addition. That's pretty much it. You should probably be familiar with the codebase for BottomFeeder to work with this, but that's easy enough - it's all in the public store.