I planned to update documentation on WIKI site to include section on Extension Manager, but for some reason site was down this weekend. So I decided to publish it here for everybody who are interested to be able to take a look before I move it under WIKI when WIKI will return back in business. There four major classes that together represent Extension Manager API and extension writers can leverage these classes in many ways in their code. Top level object in the hierarchy is ExtensionManager itself and you can see class diagram for this class on the right. Below is a most important members and usage examples. As added benefit publishing it in the blog, you are welcome to comment and provide suggestions on how it could be improved for final version that will be published on WIKI. I personally consider it very important to have documentation that make sense – no matter how cool application features are, if people have no clue how to use them they are.. well, useless :)

Next week will be very tough for me as deadline on my day job for the project I'm working on is January 15, so I expect next weekend spending in the office and won't have a lot of time to spend on fun stuff, like BlogEngine. When my hands are free, I will add a lot of new features that will hopefully make writing extensions for BlogEngine even more fun than it is now.

Oh, and did you check latest post on Mads blog? There is a new widget framework for BlogEngine is coming, and this is just awesome - I have some code snippets that fit right into this concept. Can't wait to get my hands on it!



Method public static bool ExtensionEnabled(string extensionName)
Description Returns true if extension is enabled.
Usage if (ExtensionManager.ExtensionEnabled(“BBCode”))
{
  a.CreateInstance(“BBCode”);
}
Method public static void ChangeStatus(string extension, bool enabled)
Description Method to enable or disable extension. If set to false, on application load extansion will not be instanciated.
Usage ExtensionManager.ChangeStatus(“BBCode”, false);
Method public static void SetAdminPage(string extension, string url)
Description Allows to set custom settings page to use instead of default page.
Usage ExtensionManager.SetAdminPage(“BBCode”, “~/path/to/mypage.aspx”);
Method public static ExtensionSettings GetSettings(string extensionName)
Description Returns ExtensionSettings object
Usage ExtensionSettings _settings = ExtensionManager.GetSettings(“BBCode”);
Method public static void SaveSettings(string extensionName, ExtensionSettings settings)
Description Changes to the settings object by default done  in memory only, you'll need to use this method to save changes to the disk.
Usage ExtensionManager. SaveSettings(“BBCode”, _settings);
Method public static bool ImportSettings(ExtensionSettings settings)
Description Unlike SaveSettings, ImportSettings only writes data to the disc if settings object is null, so it basically initializes settings first time your extension is added to ExtensionManager. You would normally use it to set default values for extension parameters.
Usage ExtensionManager.ImportSettings(_settings);
Share/Save/Bookmark
Signature

Comments

1/7/2008 4:50:47 PM #

pingback

Pingback from jwendl.net

BlogEngine ExtensionManager class

jwendl.net |

Comments are closed
<<  July 2009  >>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Protected by Commentor
256 comments approved
370 spam caught
Since December 1, 2008
Powered by Spam Counter
Enhanced with Snapshots

Subscribe to Rtur.net