dinsdag 28 juli 2009

Hippo on rails

an experiment

Intro

My employer, onehippo, challenged me to create a Ruby on Rails demo connecting to the Hippo JCR repository. So I took the two examples from day.com and tweaked them into one file until I had a working example.

Preparation

To run the example application you will need to install jruby and some java library files, the onehippo cms and the hippoonrails example application.


  • To download and install jruby and rubyonrails, follow this tutorial.
  • You will also need some of these jars in your jruby/lib dir.

  • If you don't have a hippo repository, then download the hippo quickstart war file.

  • svn checkout http://forge.onehippo.org/svn/hippoonrails/tags/phonebook_1_0_1/


Getting everything to work probably took some time. If you have any questions or need some help, don't hesitate to ask them on the hippoonrails forum

If you are still here, then the next few steps should be a breeze. :-)


The example hippoonrails application


First go to your cms (quickstart) directory and run it with: mvn jetty:run-war

Go to your cms console (http://localhost:8080/cms/console) select the root node and add the node people (nt:unstructured) needed for the example application

Next go to your hippoonrails example application and start the webbrick server: jruby -S script/server
Then fire up your webbrowser and go to http://localhost:3000/people

You should be able to create a new person, edit and delete it.

That was easy now, wasn't it?
Next stop, set up your experiment with scaffold and the basewithouttables/jcr connector hack.