Wednesday, August 13, 2008

Grails on Sakila

After spending some time on Flex and AIR in my spare time - with Peek in Grails as result - I'm happily coding in Grails again. Ahh what a pleasure ;-)

Some time ago I wanted to create a real-life demo application in Grails. Back in May or June I took the MySQL Sakila sample database and started building a Grails application on top of it. I also integrated Yahoo! User Interface Library for a better and richer user experience like using the DataTable (see also the Grails YUI DataTable example).

As I continued working on the demo application I added a YUI MenuBar and customized the Grails scaffolding templates so it generates a YUI enabled user interface.
Currently I'm only using the YUI DataTable, MenuBar, Button and Grids CSS but I want to extend this to use the YUI Calendar, AutoComplete, Rich Text Editor and Charts and perhaps some other nice-looking YUI widgets as well. Under water it also uses required YUI utilities for easily sending XMLHttpRequests and processing JSON results.

I basically only changed the main.gsp, main.css and scaffolding templates and see below what can be generated.

I also created the Grails on Sakila project hosted on Google Code, so if you want you can browse or download the source code yourself. It is currently under development so you are warned.


Anonymous said...

regarding your RefCode plugin. When I attempt to save a domain object, I get a null pointer on refCodeService. my code:

class Environment {
def refCodeService

String name
String code
Integer seqno = 1000

static constraints = {
name ( nullable: true )
code( validator: { val, obj -> return obj.refCodeService.validate( "Environment", val )
} )......

I create three Environments in the bootstrap with no errors. Any ideas?

Marcel Overdijk said...

Please use the Grails User Malinglist for this. It's not related to this Grails on Sakila post. Thanks.

Anonymous said...

Marcel - sorry for mis-posting. I addded the question to grails-user on nabble.

Ray Krueger said...

How awesome!
I was going to build this same app to demo my hibernate-memcached project.

I think I'll just use yours :)

What's the slowest part of this app you think? Something that might benefit from some caching (or already is)?