Producing OPML with Roller.
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:
Roller 0.9.7 is available.
I'm going to forgo the RC nonsense and call today's release Roller 0.9.7. Release Candidates are just too much useless process for a little project like this. If somebody finds a problem with Roller 0.9.7, and they will, then we'll have Roller 0.9.7.1, 0.9.7.2 and so on.
Roller 0.9.7 Downloads Change notes
I've still got some 0.9.7 related work to wrap up, like finishing the User Guide and Castro vs. Hibernate testing, but that is no reason to hold up the release. Speaking of docs, the User Guide and Install Guide are now part of the Roller WIKI. This means that they will never be complete. Instead, with your assistance, they will be constantly evolving. Still, I'll do my best over the next week to bring the User Guide up to date with the new Roller 0.9.7 features.
We've been working on Roller 0.9.7 for so long that I almost forgot how much work Lance Lavandowska back in the early months. Lance was responsible for the new comments feature, the conversion of Roller macros to VelociMacros, adding a spell-checker for blog posts, and adding the very useful theme-switcher UI (he also added GZip compression for pages and RSS feeds, but that still has Tomcat issues). BIG round of applause for Lance!
Re: Joe Hewitt Comments
Hey Matt, don't bring JSP into it. You could probably do this in Roller 0.9.7 without even making a code change. Just use the Roller Editor UI to add a new page template to your site to produce comments in Hewitt's XML format:
#set( $comments = $allComments )
<comments>
#foreach( $comment in $comments )
<comment id="$comment.id">
<author>$comment.name</author>
<email>$entry.email</email>
<url>$entry.url</url>
<timestamp>$comment.postTime</timestamp>
<body>
$comment.content
</body>
</comment>
#end
</comments>
Assuming that the page above is named 'Comments' then the URL to call it and retrieve the comments for your post would look like this:
http://www.raibledesigns.com/comments/rd/Comments?anchor=joe_hewitt_commentsUPDATE: I made a couple of corrections and additions to the code above and the the URL; these are shown in bold.
The beauty of open source development.
Matt Raible: Aaaahhh, the beauty of open source development: 1) you don't have to work on it at all if you don't want to, 2) you only have to implement the features you want, and 3) there are no deadlines.
Roller 0.9.7 approaches.
Roller 0.9.7-RC1 should be out in the next day or two. Here are the new features:
Comments, Trackbacks, and Linkbacks * Both in-page and pop-up style comments are supported * Remember-me feature for comments * You can delete comments that you don't like * Support for Movable Type style Trackbacks * Trackbacks are treated as comments * You can send Trackback pings to other weblogs * Support for Mark Pilgrim style "for further reading" Linkbacks * Linkback searches referering sites and RSS feeds for excerpts * Linkbacks can be disabled by Roller administrator * New #showLinkbacks() macros displays Linkbacks for day MetaWeblog API * Support for both Blogger API and MetaWeblog API * Allows both titles and categories from w.bloggar and other clients. General * Simplified main page is much faster than before * Main page displays most recent posts and most popular blogs * Main page RSS feed aggregates all posts on site * Remember-me feature for logins * New VelociMacros are replacing old page macros * One click to post as public or post as private * Spell checker for posts
I don't expect Anthony to upgrade FreeRoller until the final release.
Trackback support in Roller.
I just committed the code for Trackback to Roller. Roller now acts as a Trackback server, accepting Trackback pings, and Roller can also act as a Trackback client. The Roller Editor UI now includes a Trackback page that allows you to send Trackback pings for each of your weblog entries and that allows you to view the response from the target Trackback server.
Trackbacks are displayed along with other referers (which are harvested using a Java version of Mark Pilgrim's Linkback technique) via the new #showDayReferers() macro.
I will now test Trackback by sending a ping to the Movable Type Trackback test server. It worked! Please send me a Trackback so that I can test my ability to accept pings, the Trackback URL for this entry is:http://www.rollerweblogger.org/trackback/roller?trackback_support_in_roller
Roller and nntp/rss.
Jason Broome, the author of nntp//rss, saw my MetaWeblog API post the other day. He made a small modification to his code and now Roller and nntp//rss work perfectly even in MetaWeblog API mode. Maybe those XML-RPC based weblog APIs ain't so bad after all. If you want to use Roller (0.9.7 or later) with nntp//rss, you'll need to replace your existing nntprss.jar with the following download from Jason's site:
http://www.methodize.org/nntprss/patch/0.3-metaweblog/nntprss.jar
Idea for Multi-Contribitor Blogging in Roller
I have been thinking about how to redesign the Roller main page index.jsp. Currently it show a list of the most recently updated weblogs on the site. What if we were to replace this main page with a multi-user weblog? Read more about this idea on the Roller Wiki.
MetaWeblog API support in Roller
<img src="http://www.rollerweblogger.org/resources/roller/bloggar.jpg" alt="Editing a Roller blog entry in w.bloggar"/>
Turns out, I didn't have to steal much code from Blojsom to get MetaWeblog API support going in Roller. I ended up only stealing method signatures, Javadocs, and logging statements (thanks guys!). Roller and Blojsom are so different and the Blogger and MetaWeblog APIs are so simplistic that no further theft was necessary. In the process, I learned about the simple and clean architecture of Blojsom and I learned that XML-RPC based Weblog APIs are a bit of a mess these days.
Looking at the Blojsom and Roller implementations of these APIs gives you a nice glimpse into the internals of these two Java-based weblogging systems. Take a look at the Blojsom impementations BlojsomBloggerAPIHandler.java and BlojsomMetaWeblogAPIHandler.java and you can see the essence of Blojsom: single-user blog implemented with file-system storage. Take a look at the Roller implementations BloggerAPIHandler.java and MetaWeblogAPIHandler.java and you can see the essence of Roller: multi-user blog implemented via business tier interfaces and POJOs. Take a look at channel 77 and you can see the Essence of Emeril: BAM!
In the end, I was able to implement all of the Blogger and MetaWeblog APIs except for the MetaWeblog API newMediaObject. Blojsom implements everything except getUserInfo, deletePost, getTemplate, setTemplate, getPost, and newMediaObject. I'm not sure all of those APIs are really all that useful anyway.
Even after implementing all of those APIs in the Roller "server," the job is not done. This is why I say that the APIs are a bit of a mess. Each server-side implementation is a little different. If you want to write a full-featured blogging client, then for each RPC method call you have to use conditional logic to determine based on the blogging server type which implementation is to be called. I'm not sure if this is due to a limitation of XML-RPC. Maybe XML-RPC based APIs are just too loose: after all, there is no WSDL equivalent for XML-RPC. Or, maybe XML-RPC is fine and only the differing implementations are to blame. I don't know. All I know is that I implementing the APIs is just not enough.
How can I say that? How do I know that my poor coding is not to blame? Take a look at w.bloggar and you'll see what I mean. The w.bloggar client is a very nice and full-featured blogging client. It supports titles, single-categories, multi-categories, template editing, and other things. Before I could get all of those features to work with Roller, I had to spend time tweaking the w.bloggar configuration file CMS.ini. Take a look at this troubling comment at the start of the CMS.ini file:
; Please don't change this file unless you know exactly what you're doing! ; And if you do be sure to make a backup of it. ; ;Values for *Method Options ; 0 - Not Supported Method ; 1 - Use Blogger API ; 2 - Use Blogger Pro API ; 3 - Use metaWeblog API ; 4 - Use MovableType API ; 5 - Use b2 API
This indicates a very sorry state of affairs. I was able to make all of the cool features of w.bloggar to work with Roller 0.9.7-dev by writing the configuration file section below, but other blogging clients still don't work completely. MozBlog, which appears to be somewhat flakey, and nntp//rss still don't work. Do I have to write configuration file for each blogging client I want to support? If so, I hope if they offer the same level of tweakability as w.bloggar.
[CMS-11] Name=Roller URL=http://www.rollerweblogger.org Icon=rollerbadge.jpg Service=0 Host=www.yourhost.com Page=/roller/xmlrpc Port=80 Https=0 MultiCateg=3 GetCategMethod=3 PostMethod=3 GetPostsMethod=3 TemplateMethod=1
Maybe it is time to retire the Blogging and MetaWeblog APIs. They are tired and they need some rest.
New Roller comments feature.
I just committed changes for a new Roller macro showCommentsPageLink that supports non-popup based comments for Roller. The feature still needs some tweaking, but you can try it out by commenting on this post. Next up: MetaWeblog API support.
Powered by Hibernate.
This blog is now powered by Hibernate. The upgrade went smoothly. Those asking about how Hibernate compares to Castor will have to wait a bit, I'm focusing on Roller 0.9.7 development right now and I may not have time for comparisons until after the release.
Hibernate implementation done.
As Matt reports, I have finished the Roller-Hibernate implementation and committed it to CVS. Tonight, I will upgrade this site to the latest code from CVS. Matt wants to know how it works, but I don't know yet. Hibernate has been a pleasure to work with and the results seem fast, but I have not done any benchmarks yet.
Right now, Roller has a pluggable persistence layer with two implementations Hibernate and Castor. I'm not sure how long that will last as it is no fun maintaining two implementations of the very same thing.
Into Out-of-the-Box
Dominic Da Silva points out that Roller has been added to Out-of-the-Box.
Dominic Da Silva: While reviewing the updated Out-of-the-Box 2.0 package listing, I noticed Roller in there. Well done Dave, seems they see Roller as a value added app to any Java developer's software list.
select count(*) from rolleruser;
+----------+ | count(*) | +----------+ | 659 | +----------+ 1 row in set (0.00 sec)
On FreeRoller.
Tweaking FreeRoller.
After Anthony moved FreeRoller over to the JavaLobby server, I was nervously watching the server and waiting for it to go down. Now that Roller is hosted on a big honkin' server running the latest Tomcat (4.1.24), I have nobody to blame but myself when the system slows to a crawl or crashes. Actually, Roller is built on a giant stack of open source software (Struts, Velocity, Castor, OSCache, etc.) so there is plenty of blame to go around, but I'm not the blaming type.
Unfortunately, I did not have to wait long for disappointment. Roller crashed on Saturday with an out-of-memory exception (too many cache entries in memory?), so I tweaked the OSCache settings to cache only to disk. On Sunday, Roller exhausted the Tomcat thread pool (too much OSCache disk I/O?) and crashed again. This morning, I confugured OSCache for disk and memory caching with a limit of 100 cache entries, and I have configured Tomcat for 256MB max memory. Things seem to be holding up well so far, but will FreeRoller make it through the night?
FreeRoller holding up and data-export ramblings.
I took the FreeRoller system down briefly to patch the index.jsp page and then found that, now that it is hosted on a JavaLobby server, I did not have permission to bring it back up (doh!). Later, the system crashed because (somehow) the export-user feature had become re-enabled and somebody tried to use it. BOOM! Export-user is a sure fire way to blow up Roller. Needless to say, I disabled Export-user before I restarted FreeRoller. Other than that, FreeRoller is holding up nicely at JavaLobby.
Export-user was really easy to implement and it worked well for a small data-set (on a machine with no traffic). I used Castor-JDO to load a user object and the user's entire object-graph from the database and into memory: pages, blog entries, bookmarks, folders, categories, etc. Then I use Castor-XML to serialize the entire object-graph to XML. The whole deal is about 15 lines of code which is great, but it locks up the FreeRoller everytime which is not so great.
I'm not sure what to do about export in Roller 0.9.7, or even if we'll have export in Roller 0.9.7. Maybe I should allow users to export blog entries in RSS format, bookmarks in OPML format, and page templates as text. It would be nice to wrap everything up in one nice tidy bundle instead of separate files that must be pieced back together later. Export should probably be an asynchronous operation: you request export and later you get an email telling you where you can download the exported data file - possibly a specially formatted ZIP file that cna easily be imported into another Roller installation. Any ideas? Any volunteers? ;-)
Progress on the Roller-Hibernate front.
I've been making good progress on the Hibernate impementation of the Roller backend and I may even finish up this weekend. I said that I would blog about it, but I decided not to. It is just not that exciting. The Hibernate API is similar enough to the Castor-JDO API that I have been able to use the same basic patterns in my implementation. Once I finish, I'll do some benchmarking and see how Castor and Hibernate compare. I'm still shooting for Roller 0.9.7 in April, probably during my furlough week (April 14-18).
« Previous page | Main | Next page »