Friday, January 9, 2009

Grails comes through

Update, moved to Just Thinking: Code

I am responsible for tracking the members of my local SCA group that fight (see here and here for explanations).  The previous marshal (the person responsible) had tracked the information in a Excel spreadsheet.  That's not a bad way of doing it, but come one, I'm a Java programmer.  Tracking information in a spreadsheet just isn't my way of doing things.

I had moved all the information into a MySql database.  I had been using Groovy scripts to generate the reports I needed to turn in quarterly.  The scripts would generate an html page with the report, and then I would use Mac OS X's ability to create PDF's to create something I could email in.

Recently I used Grails to create a quick front-end for editing the information.  Took all of an afternoon because I didn't like the generated pages.  (I could have had an entire CRUD application in minutes if I did like the generated pages).  I had modified the Groovy scripts to run under Grails to give me my report.  This basically involved creating a gsp page instead of a html builder.

Then I found the Jasper Plugin.  That was not completely clean to setup and the concepts of designing the pages gave me enough headaches, I almost gave up.  But I persisted and now have the ability to create the reports I need directly in PDF and Excel (and other formats if I need), although I'm still trying to create an Excel report that spans only one page, but have the PDF span multiple pages.

It only took me a few man-hours to create the whole thing.  If the objective was to allow others to use the app, I would need a few more man-hours to clean it up, but it would fine for me as is.  I will have to ask the next marshal if he wants to use this before I spend any time cleaning it up.

Once Griffon includes GORM, I intend on porting the entire application from Grails to Griffon, because I think this would be a better standalone application than a webapp.  I would like to get it to run on a USB drive, using hsqldb as the database instead of MySQL.  Then the entire application and database can be passed to the next marshal as a self-contained USB drive.

No comments: