[Updated 2] Atom-PubSub module for ejabberd

As requested, the Atom PubSub bridge

This module offersr an AtomPub interface to ejabberd PubSub data. Currently in two unfinished flavors, one for use with yaws embedded. One for use with ejabberd_http server

Howto

You need to have Yaws available. It will start in embedded mode, with the mod_yaws module (included).
To build, edit the Makefile to match your erlang install and make Put the resulting beams in some place where ejabberd will find them.

Also you’ll need to set the BASEURL macro in atom_pubsub.erl to your webserver hostname.

You’ll also need to add the module to your ejabberd.cfg in the mmodules section:


{mod_yaws,[{logdir, "/tmp/"},
    {servers, [
    {"localhost", 5224, "/opt/var/yaws/www", [
     {dir_listing, true},
     {appmods, {"/atom",     atom_pubsub}}
     ]}
   ]}
  ]}

What you get

The AtomPub interface passes the Atom Protocol Exerciser (though some warnings remain).

It means that any AtomPub clients will be able to post to a specific node in your PubSub tree.

It also means that your PubSub tree will also be available as an AtomFeed.

Of course, each time an item is posted through AtomPub or PubSub on a node you are subscribed to, you’ll get the notification.

Can I have it with OpenFire and Epeios ?

That’s not possible. At some point, there’s no way around hitting directly the PubSub mnesia tables. So you can’t extract the code as a component.

Moreover, it only works with PubSub nodes derived from the default node type. (because of the mnesia tables stuff)

What’s next ?

I’ll update the code soon.
A few of things I’d like to implement :

  • remove all calls to mnesia and work through mod_pubsub API.
  • add HEAD, etag and slug support (that’s a patch for ejabberd though)
  • remove that baseurl horrible macro
  • add node subscription through REST
  • as soon as ejabberd 2.1 is published remove dependency from yaws
  • add binary collections support

Mickaël Rémond from Process-One kindly offered to host atom-pubsub on the ejabberd_modules svn.


svn co https://svn.process-one.net/ejabberd-modules/atom_pubsub/trunk/

There’s a quick port to the ejabberd_http server at this location :
You need to be running ejabberd 2.1 or current trunk to have it work.


svn co https://svn.process-one.net/ejabberd-modules/atom_pubsub/branches/ejabberd_http_branch/

Check out the README for installation.

Shoot your questions in the comment or via email (anything on this weblog domain goes to my inbox)

5 comments so far

  1. Steve Ivy on

    Hi,

    Over on the DiSo project, we’ve be discussing using XMPP in a social networking context, and it looks like something based on your work here might be an important component in connecting XMPP services to stateless web-based networks.

    If you’re interested in discussing the possibilities, please join us over on the DiSo mailing list! [1]

    Cheers,

    –Steve Ivy
    http://redmonk.net / http://diso-project.org
    [1] http://groups.google.com/group/diso-project/

  2. Saimon Moore on

    Hi,

    Could you provide an example of usage?

  3. cstar on

    @Saimon : That’s a plan I have. Hang on in there😉

    Quick directions :
    Out of the box, once configured in ejabberd.cfg, if your XMPP domain is example.com and the user cstar, the service document is available at http://localhost:5280/atom/example.com/cstar .

    With an atompub client you can CRUD content according to AtomPub spec

    And any client subscribed on the pubsub side will receive notifications in pubsub format.

  4. cstar on

    @Steve interesting stuff. I’ll send you an email on the subject.

  5. Joshua Sierles on

    I can’t get this plugin to initialize under ejabberd 2.0.1. Any clues as to how to debug it?


Comments are closed.

%d bloggers like this: