adhockery.blogspot.com
Ad-Hockery: August 2011
http://adhockery.blogspot.com/2011_08_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Grails Gotcha: Beware HEAD requests when rendering binary output in controllers. Dynamic method or returning a. The controller action just writes bytes directly to the HTTP response stream. Our action looked something like this:. This seemed to work well enough. However when writing a test I noticed an odd thing. I was using RESTClient. Reques...
adhockery.blogspot.com
Ad-Hockery: June 2010
http://adhockery.blogspot.com/2010_06_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Acyclic relationship validation in Grails. A common domain class use-case is for a self-referential relationship that must not be circular (a directed acyclic graph. For example, a. Class may have a. Property that is a many-to-one relationship with another. Instance. However a given. Cannot be his own. Using the constraint is as simple as this:.
adhockery.blogspot.com
Ad-Hockery: August 2010
http://adhockery.blogspot.com/2010_08_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Auto-generate Spock specs for Grails artifacts. When creating artifacts such as domain classes, controllers and tag libs Grails generates a. Test case. If, like me, you're digging writing specifications with Spock. It's very simple to create a. Command calls a Closure called. Any time one of its Gant. Event target name Start. Rather than havin...
adhockery.blogspot.com
Ad-Hockery: May 2010
http://adhockery.blogspot.com/2010_05_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Grails Spring Events Plugin. Following on from my last post. I've developed a Grails plugin that packages the asynchronous events behaviour up and adds some extra useful functionality. In addition to the asynchronous event processing the plugin gives you:. Method attached to all domain classes, controllers and services. Links to this post.
adhockery.blogspot.com
Ad-Hockery: September 2010
http://adhockery.blogspot.com/2010_09_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Stubbing access to the g:message tag in unit tests. Grails controllers and tag libs can access any tag as though it were a method. The most common use for this is probably accessing i18n messages via the. Tag However, because tag access is magic wired up by Grails it's not available in unit tests without some effort. A few things to note:.
adhockery.blogspot.com
Ad-Hockery: November 2011
http://adhockery.blogspot.com/2011_11_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. This blog has moved. Ad-Hockery is no longer updated at this location. Please redirect bookmarks to blog.freeside.co. For more awesome content. Links to this post. Fear and loathing in functional testing land. I have more questions than answers and I’m completely open to the idea that. I’m doing it all wrong. Test via the browser. Approach of ...
adhockery.blogspot.com
Ad-Hockery: April 2010
http://adhockery.blogspot.com/2010_04_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. A Grails JUnit 4 test template. Grails 1.3 upgrades the bundles JUnit to the newer JUnit 4 API. However, the test template used to generate classes by the Grails. Scripts is still very JUnit 3-ish. Here's a replacement that will generate a skeleton test using JUnit 4 conventions:. To use this just run. Then copy the contents over the file.
adhockery.blogspot.com
Ad-Hockery: July 2010
http://adhockery.blogspot.com/2010_07_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Rendering Grails Joda-Time date inputs cross browser with HTML5, jQuery and Modernizr. Yesterday I released a new version of the Grails Joda-Time plugin. That includes support for the various new date and time input types. In the HTML5 standard. Right now only Opera. To render an HTML5. Input field that will bind to a. Import org.joda....If yo...
adhockery.blogspot.com
Ad-Hockery: March 2010
http://adhockery.blogspot.com/2010_03_01_archive.html
Ad-hockery: /ad·hok'@r·ee/, n. Gratuitous assumptions. which lead to the appearance of semi-intelligent behavior but are in fact entirely arbitrary. [Jargon File]. Customising collection binding in Grails. Following up on my earlier post about using custom. Implementations to bind association properties. I started looking into the options for custom binding one-to-many associations. For example, tags, as seen on many sites (including Blogger) would typically be modelled as a. Or some kind of. If you've g...
stateyourbizness.blogspot.com
STATE YOUR BIZNESS: Sending emails from Grails apps
http://stateyourbizness.blogspot.com/2008/08/sending-emails-from-grails-apps.html
Ma bizness is groovy grails. Monday, 11 August 2008. Sending emails from Grails apps. We're trying this on for size. Import org.springframework.mail.MailSender. Import org.springframework.mail.SimpleMailMessage. Boolean transactional = false. SimpleMailMessage mailMessage / A template message auto-wired from resources.groovy. Boolean sendMessage(String to, String subject, String body) {. Boolean result = true. SimpleMailMessage message = new SimpleMailMessage(mailMessage). Message.to = [to]. Private Stri...