Wave robots using the Grails Wave plugin

I had when I first got access to Wave, I wrote a blog about how to create a Wave Robot using Grails. This blog can be read at Graversen.org.

Now David Trattnig has created a plugin to Grails for developing Wave applications. I had to try it out and see how it works.

The first project I tried the plugin on was a failure. I got some error, which I did not think the Wave plugin had created. Just me fumbling around. So I created a new project to see if it was better. The result was much better on the second try. I got a functional robot working without much code.

When you run the commands.

grails install-plugin wave

grails create-wave-robot

You get all the objects you need to create a robot, which is bacisly just one file as a service. You can then start coding in this file. The plugin automaticly handles the creation of the URL mappings needed for the Robot to work.

In Wave you normaly have to create the capabilities.xml file as a seperate file outsite the code. This is irretating to be working with and you have to make sure to update the file. With this plugin all you need to do is to change the begining of the Robot file to something like.

static robotName = "Grails Test"
static robotVersion = "0.1"
static imageUrl = "http://masteringwave.com/header.png"
static profileUrl = "http://masteringwave.com"
static robotCapabilities = [EventType.BLIP_SUBMITTED,EventType.BLIP_CREATED ]

With this information the cababilites xml file can be created.

The development of the plugin can be performed in the processEvents method. Like the following really meaning full code.

public void processEvents(RobotMessageBundle eventsBundle) {
for (event in eventsBundle.events) {
if (event.type == EventType.BLIP_SUBMITTED) {
def blip = event.blip
def textView = blip.document
textView.append("processed check")

Using this frame work is really easy and takes care of some of the irritating features you always need to use when developing Robots.  It does requires some knowledge of Grails/Groovy.

I have not tested the function for embedding waves, but it should also be fairly simple to do. You should just insert the Groovytag.

&lt;g:waveEmbed waveId=<span>"googlewave.com!w+BmNwtyw5qH.1"/&gt;
Bookmark and Share

Published by


Daniel Graversen

Founder of masteringwave.com and SAP Integration consultant at figaf.com

One thought on “Wave robots using the Grails Wave plugin”

  1. It’s exciting to think that Grails may capture the functionality of Wave in the usual easy-to-access Groovy and Grails fashion. Sadly to say, I am still waiting for my account to be activated..

Leave a Reply

Your email address will not be published. Required fields are marked *