Introduction to Caja, Part 3: Shindig

If you are serious about running a container, you probably want to use Shindig, the Apache Software Foundation's do-everything OpenSocial container framework.

Getting and Building Shindig

You can find the full documentation here, but the short version is:

$ svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ shindig
$ cd shindig
$ mvn
$ mvn -Prun

Whilst we resolve a compatibility issue, you may have to find the file features/opensocial-current/feature.xml and uncomment the line <dependency>caja</dependency>.

Also I have found that Shindig does not always run reliably after an svn update. If that happens then:

$ mvn clean
$ mvn
$ mvn -Prun

should fix it for you.

Once this is done, you should be able to browse to http://localhost:8080 and see the server. Not very exciting looking, you'll just get a directory listing!.

So now let's take a look at a Cajoled gadget served by Shindig. Take a look at http://localhost:8080/gadgets/files/samplecontainer/samplecontainer.html. We can Cajole that page by ticking the "use caja" box and hitting "reset all". You can reassure yourself that Caja is operational by right-clicking on the gadget and choosing "This Frame/View Frame Source".

OK, so now we've proved it works, how do you go about setting up Shindig to serve your own stuff?

The simplest answer is to put your gadgets in the file system and run them from there. So, for example, a new gadget could go in javascript/samplecontainer/examples/NewGadget.xml and its URL would be http://localhost:8080/gadgets/files/samplecontainer/NewGadget.xml, which would go in the "Displaying gadget" field.

Alternatively, you can host your gadget yourself, the container will fetch any URL that begins http:// or https://.