Grails static resources plugin updated

Posted by: on Feb 9, 2007 | No Comments

There was a bug in 0.1 – it didn’t work in production because the grails.env system property is never set then, when the plugin expected "production". No amount of unit testing could have helped there

0.2 is up at http://grails.org/Static+Resources+Plugin and will be going into Grails Plugin SVN as soon as I get a chance.

Moral of the story when detecting grails environment flavour at runtime is to use grails.utils.GrailsUtil.getEnvironment() as it handles the mutation of a blank env property to "production".

Another Grails site goes live

Posted by: on Feb 8, 2007 | No Comments

We’re still talking very Web 1.0 here but we’re also talking big brands, stability, data capture, high traffic. Anyone for OJ?

www.tropicana.co.uk

This site built with my colleagues at enotions Ltd uses Grails 0.4, ModelTagLib and StaticResourcePlugin. In particular, the primary parts of Grails it leverages are GORM (look mum no JDBC code! No ORM config hell!), GSP for all page content and SiteMesh for the GSP layouts.

Creating JIRA issues with AppleScript

Posted by: on Feb 2, 2007 | No Comments

I just played around today and got this quick AppleScript JIRA SOAP hack going. AppleScript is much maligned, but its very easy to get some things go. Sometimes it does "just work".

on run
  using terms from application "http://somefakedomain"
    tell application "http://yourjiraserver/rpc/soap/jirasoapservice-v2"
      set loginToken to
          call soap {method name:"login",
           parameters:{ username:"youruser",
            |password|:"yourpassword"}}
      set remoteIssue to {project:"PROJECTKEYHERE",
        type:"1", summary:"",
        assignee:"yourassigneehere"}
      set summary of remoteIssue to
        "Testing creating issue"
      set createdIssue to call soap {
        method name:"createIssue",
        parameters:{token:loginToken, issue:remoteIssue}}
      log "Create issue " & createdIssue
    end tell
  end using terms from
end run

Grails 0.4 – “rock your socks off”

Posted by: on Feb 1, 2007 | One Comment

(apologies to Tenacious D) Graeme Rocher announced yesterday the public 0.4 release of Grails. We’ve put a lot of effort into this release and it’s been some time coming but what we, in particular Graeme, have achieved in this time is amazing. This new version takes away the pain of HTML escaping, URL encoding, issues where SQL schemas weren’t coherent with the constraints, and makes unit testing of artifacts much easier. For example unit testing GSP taglibs can be done like this:

class YourTagLibTests extends GroovyTestCase {  void testTagWithAttribs() {    def taglib = new YourTagLib()    final StringWriter sw = new StringWriter();    taglib.out = new PrintWriter(sw)    taglib.tagNameHere([attrib1:'value1', attrib2:'value2'])    assert 'expected output' == sw.toString()  }}

How easy is that?! Controllers also no longer need the "def params = [:]" to enable unit testing. Using grails 0.4 snapshots and now the final release I have put a high profil commercial site live (www.copellafruitjuices.co.uk) last week, and there are more to follow very soon. It’s a testament to the web agency enotions that they had the confidence in my enthusiasm for Grails to take it on board for our high-end sites for some major UK consumer goods brands. Starting from something close to Grails 0.3 and moving towards 0.4 during this development we solved many of the common issues related to deploying high quality sites with the framework. Without the work required to hit the pain points, log issues and in some cases contribute the fixes, I am confident that Grails slashed our site code development process down to a few days. Graeme and the other Grails developers were always patient and helpful, which was much appreciated with our tight deadline! I haven’t had to touch an SQL Schema, and I get trivial back-end "admin" interfaces for free from scaffolding! I’m really looking forward to 0.5