Graffiti 1.0 Service Pack 1 (a.k.a. v1.0.1), the very first update of Graffiti CMS, was publicly released this morning. Go download it and update your sites. Or install it if you haven't yet tried out Graffiti!
You can read the full list of included changes and fixes on the official Graffiti blog. But to sum it up, we fixed just about every bug that had been reported to us since the initial release and threw in a few new features and lots of extensibility goodness.
My favorite things in v1.0.1 are all the new events that were created to enable Graffiti plugins to add a whole lot of additional functionality to a (IMHO) elegant and flexible core. A couple of plugins I have been working on recently take advantage of the new events, such as the soon-to-be-released Blog Extensions plugin and Slide.Show Photo Gallery plugin. Here is the scoop on the new events:
- AfterInsert - DataObjectEventHandler(DataBuddyBase dataObject, EventArgs e)
- Called after an object is inserted into the database. The dataObject parameter is the object that was inserted, such as a Post or Category.
- AfterUpdate - DataObjectEventHandler(DataBuddyBase dataObject, EventArgs e)
- Called after an object is updated in the database. The dataObject parameter is the object that was inserted, such as a Post or Category.
- RenderPostBody - RenderPostBodyEventHandler(StringBuilder sb, PostEventArgs e)
- Called when the body of a post is being rendered (i.e. $post.Body). The StringBuilder param lets you append additional content to the end of the post body when it is being displayed. The PostEventArgs contains a PostRenderLocation enum that tells you whether the body is being written out to a Web page or RSS feed (or other).
- RenderHtmlHeader - RenderContentEventHandler(StringBuilder sb, EventArgs e)
- Called by the $macros.Head() method, which is used in the layout.view file to generate all of the HTML head elements needed by Graffiti, such as meta tags, javascript, etc. The StringBuilder param lets you append additional content in the HTML head section.
- RssItem** - RssPostEventHandler(XmlTextWriter writer, PostEventArgs e)
- Called while Graffiti is generating the item element in a RSS feed. By adding elements to the XmlTextWriter parameter your plugin can add additional elements to each RSS item.
- RssNamespace - RssEventHandler(XmlTextWriter writer, EventArgs e)
- Called while Graffiti is generating the namespaces in a RSS feed. The XmlTextWriter param can be used to add additional namespaces to the RSS feed. This is often needed when adding additional elements to the feed.
** Note: The RssItem event is not actually new, but the delegate changed in v1.0.1. In the initial Graffiti release it passed a RssToolkit RssItem in the params which wasn't very useful for adding additional (non-RSS-core) elements. So we changed how Graffiti generates RSS feeds to use a plain XmlTextWriter which gives more flexibility.
In addition to the actual events listed above, there were two new virtual methods added to the abstract GraffitiEvent class, which is what all Graffiti plugins inherit from. These methods are EventEnabled() and EventDisabled(), and as you can probably guess they are called when a plugin is enabled or disabled in the Graffiti control panel. Your plugin can optionally use them to do any desired setup or cleanup tasks, such as writing out a file.
We also added a few nifty utility classes to Graffiti.Core that plugins can use to do some pretty advanced stuff if needed. There's a new GRequest class that makes it easy to send HttpRequests and read the response. This is very similar to the CSRequest class that long been a part of Community Server. And there is a ManagedThreadPool class you can use to do long-running tasks (such as sending trackbacks) on a background thread.
Have fun extending Graffiti!
Tagged as
graffiti
,
plugins
Similar Posts
- Now Graffiti Powered
- Live Blogging the CSDC - Part 3
- Live Blogging the CSDC - Part 2
