August 2007

REST Workshop Slides Available

You may or may not know about Burton Group’s Catalyst Conference that’s held twice a year; once in North America and once in Europe. But at the North American conference we offer in-depth, 4-8 hour workshops on a variety of subjects. This year, I created and delivered a four hour workshop on REST, though it went for 4.5 hours and could easily have been six. The workshop gave a concise overview of REST, a lengthy tutorial on how to build RESTful systems, and a brief comparison of REST with WS-*. It even include working code to illustrate most of the concepts.

Well, after just a little bit of cajoling on my part, Burton Group is making the REST Workshop slides available—for free—to everyone. Yes, they’re behind a registration wall. And, yes, you’re likely to be contacted by us if you download them. But, if I do say so myself, it’s a really good deck. It was even rated the best workshop at Catalyst by attendees. Now, paging through some slides is not going to make you all knowledgeable, but if you haven’t got your mind fully around REST, maybe they’ll help. More important to the readers of this blog is that you now have a resource that you can repurpose to help sell and explain REST to your colleagues and managers.

As mentioned, the workshop as delivered also showcased some running code. I’ve left the code out of this offering for several reasons. Mainly code quality. I wrote the services in Java using Restlet 1.0 (and the clients in Ruby). But Restlet’s a moving target, and is now at 1.4. Furthermore, I wrote it fast, while learning Restlet at the same time. And I ignored everything except what was being demonstrated, like error handling and comments. In other words, while it all works, it’s ugly and out of date. BTW, this explains why a number of slides are given over to Restlet architecture.

Aside: Restlet rocks. The Restlet mailing list rocks. Jerome Louvel rocks. The documentation, well, it doesn’t rock. Note to Tim O’Reilly: Please give Jermoe enough money to live on for 6-12 months and have him write a Restlet book.

Burton Group also asked me to create a “Take 5″ on the subject. A Take 5 is an audio enhanced five minute PowerPoint show on a pertinent topic. The REST Take 5 is really 15 minutes, but gives a good 40,000 foot, managerial overview of REST. (That link goes straight to the 10MB PPT deck, unless you need to register or login. You’ll need to view the deck in slide show mode to hear the voice over.) Give it a listen over your coffee this morning, email the link to your boss and the EA team, speak truth to power and all that.

Anyway, I hope you go through the trouble of downloading this material. Largely, it was you that created it (you might even find yourself quoted in there); I just compiled it. Of course, any errors are mine, so let me know if you find any and I’ll fix them. And let me know if you’d like to have me present this to your organization (it’s much better with a narrator to provide the details and answer questions).

Tech
Web Services

Comments (5)

Permalink

On WordPress and Atompub

In my earlier post about appfs I noted that WordPress wasn’t up to snuff as far as supporting Atompub. Offline, Tim Bray, Elias Torres, and I had a brief discussion. It seems that many of the bugs that I’ve fixed, and many more besides, have already been fixed by Elias. The patch submitted to WordPress is here: http://trac.wordpress.org/ticket/4191. Alas, while this patch is tagged for inclusion in 2.3, there doesn’t seem to be much activity around it.

I had indicated that I will fix WordPress Atompub bugs as I find them, and keep a working version over here. But given everything Elias has already done (and the WordPress team has not), I’m no longer sure that’s a good idea. It looks like us WordPress users are simply out in the cold for a while when it comes to proper Atompub support.

I will continue to maintain and enhance appfs, but I think I’ll start testing against Abdera.

Tech

Comments (2)

Permalink

Mounting Atompub Resources Locally

Minor update:  A couple of errors in the installation instructions have been fixed and atom-tools has revved to 0.9.4, fixing all known issues.  If you’re using appfs, you should upgrade your atom-tools gem.
$ mkdir myblog
$ appfs.rb myblog
$ cd myblog
$ ls -l
dr-xr-xr-x 1 placey placey 4096 2007-08-02 11:25 WordPress_Workspace
$ cd WordPress_Workspace
$ ls -l
dr-xr-xr-x 1 placey placey 4096 2007-08-02 11:25 WordPress_Media
dr-xr-xr-x 1 placey placey 4096 2007-08-02 11:25 WordPress_Posts
$ cd WordPress_Posts
$ ls -l
dr-xr-xr-x 1 placey placey 4096 2007-08-02 11:25 drafts
dr-xr-xr-x 1 placey placey 4096 2007-08-02 11:25 published
$ cd published
$ ls -l
-rw-rw-rw- 1 placey placey 0 2007-08-02 11:25 First_Post
$ cat First_Post
This is a test. This is <em>nothing</em> but a test. If this had been an actual post, then I wouldn’t have many readers.
$ vim First_Post
This is a test. This is <em>nothing</em> but a test. If this had been an actual post, then I wouldn’t have many readers. Look *RedCloth* support.
:wq
$ cat First_Post
This is a test. This is <em>nothing</em> but a test. If this had been an actual post, then I wouldn’t have many readers. Look <strong>RedCloth</strong> support.
$ vim New_Post
I can create new posts. too. The title will be the filename with underscores replaced by spaces.
:wq
$ ls -l
-rw-rw-rw- 1 placey placey 0 2007-08-02 11:25 First_Post
-rw-rw-rw- 1 placey placey 0 2007-08-02 11:25 New_Post
$ cd ../drafts
$ vim Another_Post
When I create files in the “drafts” directory, they are published as drafts in the Atompub server (if it supports it).
:wq
$ rm Another_Post
$ vim Yet_Another_Post
This post is worthy of publishing.
$ mv Yet_Another_Post ../published


Installation instructions. Usage Instructions.appfs leverages Fuse (Filesystem in Userspace) and the Fuse Ruby binding, FuseFS, as well as the Atom-Tools Ruby library by Brendan Taylor. appfs simply glues the two together.If you want to play with this and don’t have an Atompub enabled server, I have created an anonymous account on a WordPress install I care nothing about. You can access this server at:url: http://72.249.21.88/nonintersecting/wp-app.php/service
user: anon
pass: sekrit

(Incidentally, that’s a valid appfs config file.)

appfs is tested only against a (heavily patched) WordPress 2.2. I would love people to try it against other Atompub servers.

In this first release there are a number of limitations, all of which will be addressed in the near future.

Limitations

  • No support for media entries
  • No support for categories
  • XHTML content only
  • Cannot create/delete workspaces or collections

I decided to use WordPress 2.2 in order to test appfs. That may have not been the best decision as the Atompub code in WordPress is chock full of bugs. The good news is that I fixed all the bugs that I found. I’ve reported them to the WordPress developers, but most won’t be fixed until 2.4. So I’ll make the fixes available here.

WordPress 2.2 Atompub bugs fixed here

  • Service document uses Atompub 09 formatting
  • Draft entries not included in a feed
  • If the above worked, drafts would have been shown to all feed consumers, not just the draft entry authors (enhancement, not a bug)
  • Entries updated from draft to published are not actually updated
  • Atom parser doesn’t parse properly

To fix that last one, I grabbed Elias Torres‘ PHP Atom Parser, phpatomlib, and updated the wp-app.php code accordingly. Elias is the original author of the Atompub support in WordPress, but his code has been assumed into the trunk, so Elias broke out the parser for continual refinement (fortunately).

To use these fixes, backup your existing wp-app.php file and replace it with this one. Then drop the latest version of the atomlib.php parser (Revision 7, copied here for convenience) into the same (WordPress top level) directory.

Update: Tim Bray found some more lingering issues in WordPress’s support for Atompub. I fixed these and updated the local version of wp-app.php. This does not guarantee that WordPress can now be made fully Atompub compliant. Unfortunately, the Ape is having some issues of its own right now. But I’ll squash ‘em as I find ‘em.

Also unfortunately, fixing the WordPress issues exposed similar issues with atom-tools. I have fixes if needed, but Brendan is pretty responsive and hopefully will put out an 0.9.4 soon.

Tech
Web Services

Comments (7)

Permalink