Developing posting plug-ins for NewsGator is very simple. In a nutshell, you must create a .NET class that implements the IBlogExtension interface. This interface looks like the following:
public interface IBlogExtension
{
// Name of plug-in, suitable for display to a user
string DisplayName { get; }
// return true if plug-in has configuration settings
bool HasConfiguration { get; }
// Return true if an editing GUI will be shown to the
// user when BlogItem is called. In this case, the
// aggregator will not display its own editing UI.
bool HasEditingGUI { get; }
// Display configuration dialog to user, if applicable
void Configure(IWin32Window parent);
// Post item to weblog. If plug-in is going to show a
// GUI for editing, it should return true to HasEditingGUI().
void BlogItem(IXPathNavigable rssFragment, bool edited);
}
Note - don't copy/paste this into your project; you need to compile against the strong-named blogExtension.dll assembly. You can download the interface assembly here.
Details:
string DisplayName { get; }
This name will be shown to the user to select a plug-in. We recommend you include both the name of the plug-in and the version in the returned string.
bool HasConfiguration { get; }
This property should return true if the plug-in has configuration options; if this is the case, it is assumed that subsequently calling Configure(...) will cause the plug-in to prompt the user for configuration information.
If there is no user-settable configuration options, and calling Configure(...) would have no effect, then the HasConfiguration property should return false.
This setting is not related to whether or not the user has already configured the plug-in; it merely indicates whether configuration options are available.
bool HasEditingGUI { get; }
NewsGator will query the plug-in to see if it has its own editing user interface to allow the user to edit a post. If the plug-in has an editing GUI, this property should return true. If the plug-in does not have an editing GUI of its own, it should return false for this property.
Note that returning true for this property will not necessarily prevent NewsGator from allowing the user to edit a post in Outlook®; the user can override this setting manually.
void Configure(IWin32Window parent)
The plug-in should display its configuration dialog, if any, to the user when this function is called. If possible, the passed-in parent window should be used as the parent of the configuration dialog.
void BlogItem(IXPathNavigable rssFragment, bool edited)
This function will be called to post an item. The item will be passed in as a RSS fragment; for example:
<rss version="2.0">
<channel>
<title>channelTitle</title>
<link>channelLink</link>
<description>channelDescription</description>
<item>
<title>My Post of the Day</title>
<description>Here is my post of the day stuff, which you've all been waiting for</description>
<category>Misc</category>
<category>Post Of Day</category>
</item>
</channel>
</rss>
The edited flag indicates whether or not the item has already been edited in NewsGator. If the flag is true, then the user has edited the post, and it is ready to be posted. If the edited flag is false, the user has not yet edited the post, and the plug-in should display its editing GUI, if available.
Testing
To test your plug-in, simply put the DLL in the "plugins" subdirectory of your NewsGator installation directory. Do not copy the BlogExtension.dll into this directory - it's already part of the NewsGator distribution.
Be aware that version 1.0 of the .NET Framework is the minimum requirement for NewsGator; we recommend you target this version of the framework for your plug-in.
Installation
When you are ready to distribute your plug-in, you should create an installer for it. Remember, don't install the BlogExtension.dll - NewsGator installations already have this DLL.
You can find the appropriate installation directory at runtime by looking at the default value of the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\RAI\NewsGator\PluginLocation\
Distribution
After you've developed and tested your plug-in,
let us know and we will probably add a link to it on our
plug-in page.