frassle/documentation


[This is a draft chapter in the as-yet-nonexistent Frassle Developer's Manual.]

The frassle studio allows users to build and customize dynamic websites without any programming. But what if the options the studio gives you don't meet your needs? Frassle provides a plugin API so that you can build custom page elements.

There are currently three kinds of plugins in frassle:

  • block display styles, which define a format for a set of notes. The content of each block comes from a content stream specified by the user, and the block display style controls how the query results are displayed: headlines, full text, etc.
  • widgets, which are programmatic elements that do not necessarily display a set of notes. A widget may display the current time, or some user's category tree, or just a static piece of text.
  • themes, which provide a Cascading Style Sheet (CSS) for use in studio pages and sites.

Although these plugin types serve different purposes, they have some common structure:

  • Don't call us, we'll call you. When it's time to render a page that includes your plugin, frassle loads your files and invokes the appropriate functions.
  • Drop-in deployment. Simply put plugin files into the appropriate frassle/plugins directory, and you're ready to start using them. No need to restart your server.
  • Separate code and template files. Each plugin has a template file, interpreted using the HTML::Template system, and optionally a program code file written in Perl.
  • Full API access. Because your plugin code runs within the same Perl environment as frassle itself, you have full access to frassle's Perl interfaces and the attached database. This is powerful but dangerous; because a plugin can potentially harm your data or expose security vulnerabilities, you should not run untrusted plugins.
  • Automatic options interface. You specify what configuration options are available for your plugin, and frassle automatically generates the interface for users to edit these options. When your plugin is called to render, frassle tells you what options apply.
  • [coming soon] Caching. Concisely specify caching options for the output of your plugin. Frassle handles the mechanics of storing and serving the cached output, as well as expiring the cache as soon as it is invalidated.

If you know the basics of HTML and Perl, you can create plugins that customize the appearance and functionality of your frassle sites. In the following sections, we'll look at each plugin type and go through the code of an example plugin.

1. Themes

2. Widgets

3. Block Display Styles

[To be continued...]

Frassle has a lot of different stuff in it. I'm searching for a short explanation that explains the unifying themes. Here's attempt #1:

Frassle is an interpersonal content management system—a connection point for conversations you're engaged in. It is designed to help you find relevant discource, participate in it, and share it with others.

All of this is made possible by the content of your blog and other blogs that hook into frassle via RSS. Frassle's aggregator helps you follow news sources you care about. Your blog collects thoughts (soon including private ones). Throughout, frassle threads each post in context—whether it's a comment, a response in a frassle blog, or a response aggregated from an external source. Finally, the frassle content studio lets you build dynamic web pages and RSS feeds that present content from sources you choose.

None of frassle's functions are brand new, but the coherent way that these functions are integrated is new.

Here are the slides from our OSCOM 4 talk, Interpersonal Content Management. As usual, they don't stand on their own apart from our speaking and demonstration, but they might be useful.

Josh and I did our talk on frassle this morning at 9:15am (central european time). The talk went extremely well, with no major flukes or omissions. It was a little tough to get the audience to wake up after OSCOM's likely rowdiest night, but I think we generated some interest.

Those who saw our talk at Berkman would likely be pleased to know we shortened our time-to-demo by quite a bit, and delivered the whole talk roughly within the allotted time. Thanks again for your help in tuning our presentation!

link

Jessica has asked for new comment notifications in frassle. I think most of what she wants will be possible with the frassle publisher. In the publisher, you can build pages out of elements called blocks that contain a list of frassle notes. A note in frassle is a blog post or comment, authored in frassle or read from an external source with the aggregator—we intentionally treat these all the same.

The way you choose which notes show up in a block is by writing a noteset expression. This is a little computer program that frassle reads. Here are a couple of examples.

feed="http://frassle.rura.org/Directory/rss?id=1"
This selects the most recent 10 notes from my blog.

feed="http://blogs.law.harvard.edu/jkbaumga/xml/rss.xml" | feed="http://frassle.rura.org/Directory/rss?id=1"
This takes the most recent 10 notes from both my blog and j's scratchpad. If I've been slacking and j's written 10 new entries in the last hour, it could be entirely from her blog. But probably it will be mixed. The "|" symbol is pronouced or.

feed="http://frassle.rura.org/Directory/rss?id=1" & body_word_count > 40
Selects the most recent 10 notes from my blog that have over 40 words in their body. This is good for differentiating pointers to random stuff on the web from deeper articles.

feed="http://frassle.rura.org/Directory/rss?id=1" & body_word_count > 40 & cat="/computers"
Articles I've written and categorized under computers.

feed="http://frassle.rura.org/Directory/rss?id=1" & body_word_count > 40 & not( cat="/computers" )
Articles I've written that might be of interest to people who aren't utter geeks.

Now the good part…

responds_to( feed="http://frassle.rura.org/Directory/rss?id=1" )
Recent responses to stuff on my blog! This will include notes where I respond to myself, which is probably not too useful for a "recent comments" list, so we can tweak it:

responds_to( feed="http://frassle.rura.org/Directory/rss?id=1" ) & not( feed="http://frassle.rura.org/Directory/rss?id=1" )
Now we get recent responses to stuff on my blog, but only stuff that I haven't written. I can put this is a block on the side of my page, with "Quick Links List" style to display the commenter's name, date, and the comment title.