Groovy 1.6 (still in beta) has introduced a new handy method into the Groovy Console : loadScriptFile. That allows you to load a script and open it into the Groovy Console. Here are the few lines of code to make it work. import groovy.ui.Console; Console console = new Console(); console.run(); console.loadScriptFile("C:/My documents/MyScript.groovy"); That‘s it.
I need to include Groovy templates within other Groovy templates, a bit like JSPs that can include child JSPs. This feature doesn‘t exist out of the box so I‘ve developed a new TemplateEngine based on the SimpleTemplateEngine . If you have this kind of need, just check this little post.
Well, this morning I managed to arrive on time and have my first breakfast at the conference. Thanks to the train driver, thanks to the London tube, thanks to the people on the platform who let me in the train, thanks to God when it comes to arriving on time with London public transports. So, today is the last day of what has been a very good experience of this Grails Exchange. I’ve started with The Whole 9 Yards: Things you can do in 10 minutes that will make users love you by Glen Smith. When I read the title I thought that was the place to be this morning. The place to be loved by your customers. Glen is the Australian guy behind the groovyblogs.org. He first showed a photo of his family which is his motivation to use Grails : spend more time with the family and less behind the computer (his title on his business card is a stunt programmer ). First of these 10 things, generating PDF . Using the library Flying Saucer (xhtml renderer) to render into plenty of formats including PDF (9 lines of code of Groovy). Thumbnails again using Flying saucers to generate images (3 lines of code). Graps and charts with Jfreechart to generate PNG images of charts (12 loc). Caching for performance with ehCache that comes with Grails (10 loc). Generating feeds and consuming feeds with Rome (7 loc). Sending and […]
Well, first of all, I really have to beach about public transports in London. Yesterday the Central line wasn‘t working and today the Northern line had severe delays. It took me 1:30 hour to go from south London (Balham) to the conference hall (the Barbican Center). I love London, it‘s a fantastic city and I really enjoyed leaving here for 2 years. But each time I come back for business (not for holidays where I can just wonder around) I remember why I left this city and went back to Paris : on a day to day basis, London is a really tough place to live in. Well, I suppose some people would say the same about Paris though… Enough beaching. Second day at the Grails Exchange. The keynote started at 9:30am and was done by Scott Davis. He talked about open source in general, Groovy and Grails in particular, the economic model of open source, the way companies look at open source (he showed a photo of a guy with long hippy hair… I wonder if it was a photo of Scott). Grails is a fantastic story about open source because it embeds famous open source frameworks (Spring, Hibernate, Log4j…). Talking about figures and economics, Scott showed us some curves going up (Apache software being used more and more) and others going down (lines of code with Groovy). Companies have started to look at open source because it‘s cheap […]
Here I am in London attending my first day at the Grails Exchange. Unfortunately I missed the keynote from Guillaume LaForge and Graeme Rocher this morning because I took a late train from Paris. Not because I wanted to sleep more, but I just managed to enrol yesterday afternoon (thanks to Guillaume for his help on that). Difficult to find an earlier train with such a short notice. The conference is held at the Barbican center in London. Good memories come back to me when I was living in London and coming here to listen to weird concerts. I arrived at the conference at 1pm, just in time for lunch. The atmosphere is pretty good. The food great. A fantastic indoor garden where you can have your meal. Not a lot of people, easy to meet and talk to everybody. My first session is EJB 3 entities & Grails by Jason Rudolph. The talk is about the integration between JPA annotated POJOs and POGOs. Jason first started to reverse engineering an existing database with Hibernate tools to obtain JPA annotated POJOs (Knight ans Sword, he took some Monty Python example). After creating a grails app, he copied these two POJOs into it. Using the groovy shell he could use GORM features to access the data (eg. Knight.list() or Knight.findByNameLike(‘Sir%‘) and so on). Then Jason created a Castle POGO (Groovy bean) which has a Knight attribute (Knight is a POJO, still […]
I‘ve been an Intellij Idea follower for more than 5 years now. I’ve never really made the move to Eclipse, unless I really have to on rare occasions. Here is another example of how good Idea is. I’ve been developing a little bit with Groovy and recently with Grails. I was sad not to see any Groovy features in the […]