Blogging Roller

Dave Johnson on social software, open source and Java

Entries tagged [javascript]

Wednesday Jan 02, 2008

Holiday project: JMaki for Roller

JMaki seal Over the holidays I avoided doing anything directly related to my current set of work tasks. Sun went quiet, which helped, and I ignored the messages that piled-up in the Roller user and dev lists. It was so quiet that I had time for a fun little project: a JMaki plugin for Roller.

JMaki makes it easy to use JavaScript widgets (Dojo, Google, YUI, etc.) from PHP, JSP, JSF and now Roller. To use a widget, all you have to do is call a method or include a tag and JMaki takes care of including the right JavaScript files and generating the right HTML for you. That's not all JMaki does, there's also a pub/sub facility to make it easy to wire widgets together via events, there's a proxy for fetching remote resources common table and tree data models. The theme is cool widgets with ease-of-development and that's what I'd like to see in Roller. You can read more about the JMaki value proposition on the Why Use JMaki page.

Here's an example. Below is a Roller page template that uses two JavaScript widgest, the Dojo Clock and the YUI Data Table. All it takes is a single line of template code to include each widget, and one widget is dynamic i.e. the table is populated via an RSS feed.


    <html>
    <head><title>JMaki test page</title></head>
    <body>

        <h1>JMaki test: dojo.clock</h1>
        $jmaki.addWidget("dojo.clock")

        <h1>JMaki test: yahoo.dataTable</h1>
        $jmaki.addWidget("yahoo.dataTable", "/roller/xhp?id=rss","","")

    </body>
    </html>

And here's what that page looks like when displayed by Roller:

JMaki Plugin for Roller w/Dojo and YUI

I'll write more about the plugin once I install it on this site. If you want some details about how the plugin was developed, you can read the email that I sent to the JMaki dev list: JMaki for Roller issues and suggestions. It links to the Java source code for the plugin.

Sunday Mar 11, 2007

Pluggable renderers and scripting languages in Roller

My next ApacheCon talk is about Roller and blogs as a web development platform. One of the things I plan to discuss is using scripting languages within Roller, something that's possible now because Roller versions 3.0 and later supports pluggable renderers. It's undocumented and a little hacky right now, but by plugging in your own custom renderers you can add support for new template and scripting languages as alternatives to Roller's built-in Velocity. Want to know more? [Read More]

Monday Jan 15, 2007

Roller, JSON and Dojo via JMaki

Alexis Moussine-Pouchkine has taken my Generating JSON for your Roller blog post a few steps further down the road. He created a screen-cast to show how easy it is to use Netbeans 5.5 and the JMaki widget wrappers to serve up Roller data in a a Dojo table. Cool stuff. I really need to find the time to take JMaki for a spin.

And BTW, I'm still working on my Dojo table example, which will be similar to what Alexis has done but it will use Dojo directly within a Roller blog -- no IDEs or JSPs required.