apache apachecon app apple asf atom atomprotocol atompub barcamprdu blogapps blogging businessblogging conferences family feeds foss general glassfish google humor ibm java javaone links linux mac microsoft movies music netbeans opensocial opensource photos politics rest roller rome rss socialnetworking socialsite socialsoftware sun triangle trianglebloggers vacation webdev webservices wiki
Dave Winer's Outline Processor Markup Language (OPML) is the weblogging world's format of choice for exchanging RSS feed information, bookmarks, and, of course, outlines. Roller doesn't store information in OPML format, but Roller can import bookmarks in OPML format and with some minor customizations Roller can also produce OPML output for bookmarks and other data.
Producing OPML output of your Roller bookmarks is easy. Here is how you'd do it in Roller 0.9.7. Just login to your Roller account, go to the Website:Pages page and add a new page. I called my page _BookmarksOPML, because names that start with an underbar are not displayed in the Roller Nav Bar (on my page the NavBar is shown under the word NAVIGATION on the right side of my page). Next, I entered the following Velocity template code for the page:
<opml version="1.1">
<head><title>Dave's bookmarks</title></head>
<body>
<outline text="Blogroll">
#set( $links = $vHelper.getFolder("Blogroll").getBookmarks() )
#foreach( $link in $links )
<outline text="$link.name" link="$link.url" />
#end
#set( $links = $vHelper.getFolder("Java blogs").getBookmarks() )
#foreach( $link in $links )
<outline text="$link.name" link="$link.url" />
#end
</outline>
</body>
</opml>
There is only one real trick here: the use of the $vHelper object. That object is placed into the Velocity context to allow you access to Java objects that represent your weblog entries, bookmarks, etc. To see what methods are available on the $vHelper object see the Javadocs for VelocityHelper. Most Roller users would never need to use $vHelper. Their needs should be completely satisfied by the ordinary Roller VelociMacros. For those who want to add new macros, however, $vHelper is a necessity.
In the code above, I use $vHelper to fetch two of my bookmark folders, "Blogroll" and "Java blogs". A bookmark folder is also a Java object (FolderData). From a Bookmark Folder, I can fetch bookmark objects (BookmarkData). I use a Velocity #foreach to iterate through the bookmarks in each folder and to spit out the bookmark names and URLs in OPML format.
So, does it work? Sure. The URL is below if you want to try it yourself.
http://www.rollerweblogger.org/page/roller/BookmarksOPML
Here is what my new OPML page looks like in Philip Pearson's recently Script-dotted C# OPML browser:
This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)
This is a personal weblog, I do not speak for my employer.
Allen Gilliland
Anil Gangolli
Dan Axon
Danese Cooper
Film Babble Blog
Geertjan's Weblog
Henri Yandell
James Robertson
Jim Grisanzio
Josh Staiger
Linda Skrocki
Pat Chanezon
Rama
Ruby Sinreich
Simon Phipps
Tim Bray
Will Snow
Janne Jalkanen
Joe Gregorio
Matt Raible
Mike Cannon Brookes
Rafe Colburn
Sam Ruby
Simon Brown
My other sites