<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9029076276723605375</id><updated>2012-01-03T06:24:51.998-08:00</updated><category term='composite key'/><category term='spring security'/><category term='grails'/><category term='ui'/><category term='acegi'/><category term='IntelliJ'/><category term='closures'/><category term='Grails WebLogic'/><category term='groovy'/><category term='books'/><title type='text'>Groovy on Grails</title><subtitle type='html'>Random experiences and discoveries using Groovy on Grails.  Enjoy :)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2151811939210728808</id><published>2010-03-04T16:19:00.001-08:00</published><updated>2010-03-04T16:20:22.954-08:00</updated><title type='text'>Moving Blog Site</title><content type='html'>I am planning on moving my Blog Posts to my website &lt;a href="http://www.gordondickens.com"&gt;http://www.gordondickens.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The blog site is &lt;a href="http://www.gordondickens.com/wordpress"&gt;Technophiliac&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2151811939210728808?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2151811939210728808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2151811939210728808' title='34 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2151811939210728808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2151811939210728808'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2010/03/moving-blog-site.html' title='Moving Blog Site'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>34</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2182623342959591034</id><published>2010-03-04T16:15:00.000-08:00</published><updated>2010-03-04T16:18:49.004-08:00</updated><title type='text'>Intro to Grails at Harrisburg Java User's Group</title><content type='html'>I am presenting an intro to Groovy on Grails on 18-Mar-10 at the &lt;a href="http://ow.ly/1eaHX"&gt;Harrisburg Jug&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2182623342959591034?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2182623342959591034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2182623342959591034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2182623342959591034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2182623342959591034'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2010/03/intro-to-grails-at-harrisburg-java.html' title='Intro to Grails at Harrisburg Java User&apos;s Group'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-8857851463508487460</id><published>2009-05-05T16:02:00.000-07:00</published><updated>2009-05-05T16:24:58.376-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Grails Persistence with GORM &amp; GSQL</title><content type='html'>A couple days ago I received the Grails Persistence with GORM and GSQL by Robert Fisher published by APress &lt;a href="http://apress.com/book/view/1430219262"&gt;http://apress.com/book/view/1430219262&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;At first I was surprised that it was a total of 156 pages  (I was pleased that I didn't have to work my way through yet another 700 page book).&lt;br /&gt;&lt;br /&gt;As the title indicates this is focused on one of the greatest assets of Grails, GORM.  When working with GORM, you really need examples and options to help you with common data query and dataset organization tasks, this book provides that.&lt;br /&gt;&lt;br /&gt;In a nutshell, if you are working on a Grails project, this book will provide you with a concise reference with great code examples of valuable GORM features that you will refer back to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-8857851463508487460?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/8857851463508487460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=8857851463508487460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8857851463508487460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8857851463508487460'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2009/05/grails-persistence-with-gorm-gsql.html' title='Grails Persistence with GORM &amp; GSQL'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-5635460662743858161</id><published>2009-05-05T09:39:00.000-07:00</published><updated>2009-05-05T09:40:49.987-07:00</updated><title type='text'>Introduction to Grails Course</title><content type='html'>Chariot Solutions is offering a 1 day Introduction to Grails course see: &lt;a href="http://chariotsolutions.com/learn/intrograils"&gt;http://chariotsolutions.com/learn/intrograils&lt;/a&gt; for details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-5635460662743858161?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/5635460662743858161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=5635460662743858161' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/5635460662743858161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/5635460662743858161'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2009/05/introduction-to-grails-course.html' title='Introduction to Grails Course'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2289129465227882043</id><published>2009-01-26T11:36:00.000-08:00</published><updated>2009-01-26T11:37:51.051-08:00</updated><title type='text'>Groovy and Grails Magazine</title><content type='html'>I just started reading the Groovy and Grails magazine and I would highly recommend it for Groovy and Grails enthusiasts.&lt;br /&gt;&lt;br /&gt;Check it out at &lt;a href="http://groovymag.com"&gt;http://groovymag.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2289129465227882043?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2289129465227882043/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2289129465227882043' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2289129465227882043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2289129465227882043'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2009/01/groovy-and-grails-magazine.html' title='Groovy and Grails Magazine'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-832771905867727748</id><published>2009-01-12T11:36:00.001-08:00</published><updated>2009-01-12T11:40:25.807-08:00</updated><title type='text'>Philadelphia Emerging Tech Conference</title><content type='html'>Checkout the Philadelphia Emerging Technology Conference&lt;br /&gt;March 26-27, 2009&lt;br /&gt;http://www.phillyemergingtech.com/&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Jeff Brown from SpringSource will be speaking:&lt;br /&gt;Co-Author, &lt;a href="http://apress.com/book/view/1590599950" target="_blank"&gt;The Definitive Guide To Grails Second Edition&lt;/a&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-832771905867727748?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/832771905867727748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=832771905867727748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/832771905867727748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/832771905867727748'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2009/01/philadelphia-emerging-tech-conference.html' title='Philadelphia Emerging Tech Conference'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-8962686382058836409</id><published>2008-08-27T06:43:00.000-07:00</published><updated>2008-08-27T06:52:32.970-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='acegi'/><category scheme='http://www.blogger.com/atom/ns#' term='spring security'/><title type='text'>Acegi and Groovy Class Packages</title><content type='html'>With all of the tutorials and examples for Grails there is often no reference to packaging your Groovy classes.&lt;br /&gt;&lt;br /&gt;So, I decided to convert all of my project into packages including Acegi.&lt;br /&gt;&lt;br /&gt;Using IntelliJ 7.04 &amp;amp; &lt;a href="http://plugins.intellij.net/plugin/?id=1524"&gt;JetGroovy plugin&lt;/a&gt; v1.6.18593&lt;span&gt;&lt;/span&gt;, I was able to refactor most of my classes without issue.  Service classes required me to add the imports manually... no problem there.  Of course its odd that I had to manually add imports to java.util.*&lt;br /&gt;&lt;br /&gt;Acegi classes required to add the package to the class declaration within grails-app/conf/SecurityConfig.groovy&lt;br /&gt;&lt;br /&gt;loginUserDomainClass = "com.mycorp.projname.security.User"&lt;br /&gt;authorityDomainClass = "com.mycorp.projname.security.Role"&lt;br /&gt;requestMapClass = "com.mycorp.projname.security.Requestmap"&lt;br /&gt;&lt;br /&gt;(thanks to &lt;a href="http://burtbeckwith.com/blog/"&gt;Burt Beckwith&lt;/a&gt;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-8962686382058836409?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/8962686382058836409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=8962686382058836409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8962686382058836409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8962686382058836409'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/08/acegi-and-groovy-class-packages.html' title='Acegi and Groovy Class Packages'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-1561987980223370623</id><published>2008-08-22T09:41:00.000-07:00</published><updated>2008-08-22T09:50:41.800-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Grails WebLogic'/><title type='text'>Grails on WebLogic - Validation Errors</title><content type='html'>If you are deploying Grails on WebLogic 9/10 you must ensure that all of your domain classes MUST implement Serializable.  If not, you won't see validation feedback on your form.&lt;br /&gt;&lt;br /&gt;Also, as part of the standard Java Serializable interface, ensure that all members of the domain class must also be Serializable.&lt;br /&gt;&lt;br /&gt;You will see a WebLogic log message:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;div dir="ltr" align="left"&gt;&lt;span class="545405214-10082008"&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Arial;font-size:85%;"  &gt;&lt;aug&gt; &lt;error&gt;  &lt;http&gt; &lt;bea-101362&gt;  &lt;[weblogic.servlet.internal.WebAppServletContext@f7ca6d - appName:  '_appsdir_MyApp_dir',&lt;/bea-101362&gt;&lt;/http&gt;&lt;/error&gt;&lt;/aug&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="545405214-10082008"&gt;&lt;span style="color: rgb(0, 0, 255);font-family:Arial;font-size:85%;"  &gt;&lt;br /&gt;name: 'MyApp', context-path: '/MyApp'] could not deserialize the  request scoped attribute with name:  "org.codehaus.groovy.grails.ERRORS_MyDomainObj_19315431"&lt;br /&gt;java.io.NotSerializableException:  org.springframework.beans.factory.support.DefaultListableBeanFactory&lt;br /&gt;      at  java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1081)&lt;br /&gt;      at  java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)&lt;br /&gt;      at  java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)&lt;br /&gt;      at  java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)&lt;br /&gt;      at  java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)&lt;br /&gt;      Truncated. see log file for complete stacktrace&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-1561987980223370623?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/1561987980223370623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=1561987980223370623' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/1561987980223370623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/1561987980223370623'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/08/grails-on-weblogic-validation-errors.html' title='Grails on WebLogic - Validation Errors'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-8714302751212683431</id><published>2008-07-18T11:59:00.000-07:00</published><updated>2008-07-18T12:18:44.614-07:00</updated><title type='text'>Acegi Table Configuration</title><content type='html'>One of the main issues I had from the Grails site was using the often reserved words "user" and "role" for the main table names.&lt;br /&gt;&lt;br /&gt;While I was working with Oracle, "user" was an issue but "role" was not.  So, generated user but mapped to a table called "app_user".&lt;br /&gt;&lt;br /&gt;Behind the scenes I had 4 tables:&lt;br /&gt;1. app_user&lt;br /&gt;2. role&lt;br /&gt;3. role_app_user&lt;br /&gt;4. requestmap&lt;br /&gt;&lt;br /&gt;Also, generated a sequence called hibernate_sequence&lt;br /&gt;&lt;br /&gt;I ran into intermittent problems where hibernate would not be able to identify the intersection table "role_app_user".&lt;br /&gt;&lt;br /&gt;I decided to rename the "role" table to "app_role" and tell Grails the specific name of the intersection table.  By adding the table name and the "joinTable" option to the mapping, we identify the link between the classes and their intersection table.&lt;br /&gt;&lt;br /&gt;File: Role.groovy&lt;br /&gt;class Role {&lt;br /&gt;  static hasMany = [people: User]&lt;br /&gt;&lt;br /&gt;  String description&lt;br /&gt;  String authority = 'ROLE_'&lt;br /&gt;&lt;br /&gt;  static constraints = {&lt;br /&gt;    authority(blank: false)&lt;br /&gt;    description()&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;  static mapping = {&lt;br /&gt;    table "app_role"&lt;br /&gt;    people joinTable:[name:'ROLE_APP_USER', key:'id', column:'people_id']&lt;br /&gt;   }&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;File: User.groovy&lt;br /&gt;class User {&lt;br /&gt;  static transients = ['pass']&lt;br /&gt;  static hasMany = [authorities: Role]&lt;br /&gt;  static belongsTo = Role&lt;br /&gt;&lt;br /&gt;  String username&lt;br /&gt;  String userRealName&lt;br /&gt;  String passwd&lt;br /&gt;  boolean enabled&lt;br /&gt;  String email&lt;br /&gt;  boolean emailShow&lt;br /&gt;  String description = ''&lt;br /&gt;  String pass = '[secret]'&lt;br /&gt;&lt;br /&gt;  static constraints = {&lt;br /&gt;    username(blank: false, unique: true)&lt;br /&gt;    userRealName(blank: false)&lt;br /&gt;    passwd(blank: false)&lt;br /&gt;    enabled()&lt;br /&gt;    description (nullable: true)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;    static mapping = {&lt;br /&gt;    table "app_user"&lt;br /&gt;    authorities joinTable:[name:'ROLE_APP_USER', key:'id', column:'authorities_id']&lt;br /&gt;  }&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;In preparation of moving this code to testing and production regions describe (Oracle's "desc &lt;span style="font-style: italic;"&gt;object&lt;/span&gt;") to extract the tables and sequence for your DBA's convenience.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-8714302751212683431?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/8714302751212683431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=8714302751212683431' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8714302751212683431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8714302751212683431'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/07/acegi-table-configuration.html' title='Acegi Table Configuration'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-1740305582019679497</id><published>2008-05-29T12:01:00.000-07:00</published><updated>2008-05-29T12:05:43.600-07:00</updated><title type='text'>Currying Closures</title><content type='html'>This threw my brain for a loop... Groovy code using a "&lt;a href="http://c2.com/cgi/wiki?ExecuteAroundMethod"&gt;Execute Around Method&lt;/a&gt;" pattern:&lt;br /&gt;&lt;br /&gt;def tellFortunes(closure) {&lt;br /&gt;  Date date = new Date("11/15/2007")&lt;br /&gt; &lt;br /&gt;  //closure date, "Your day is filled with ceremony"&lt;br /&gt;  //closure date, "They're features, not bugs"&lt;br /&gt;  // You can curry to avoid sending date repeatedly&lt;br /&gt; &lt;br /&gt;  postFortune = closure.curry(date)&lt;br /&gt; &lt;br /&gt;  postFortune "Your day is filled with ceremony"&lt;br /&gt;  postFortune "They're features, not bugs"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;tellFortunes() { date, fortune -&gt;&lt;br /&gt;  println "Fortune for ${date} is '${fortune}'"&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;From "&lt;a href="http://pragprog.com/titles/vslg/programming-groovy"&gt;Programming Groovy&lt;/a&gt;" pps 92-93&lt;br /&gt;&lt;br /&gt;Result is:&lt;br /&gt;Fortune for Thu Nov 15 00:00:00 EST 2007 is 'Your day is filled with ceremony'&lt;br /&gt;Fortune for Thu Nov 15 00:00:00 EST 2007 is 'They're features, not bugs'&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Basically tellFortunes() accepts date and fortune as parameters, defines a code block which prints the message with the date and fortune in it&lt;br /&gt;&lt;/li&gt;&lt;li&gt;This calls postFortune(closure) accepting the code block (called a Closure in Groovy)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;the first use of postFortune binds the date to the inbound closure and holds a reference in postFortune&lt;br /&gt;&lt;/li&gt;&lt;li&gt;the next two postFortunes pass the string (and the date by use of curry) to the code block thus printing the message each time&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-1740305582019679497?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/1740305582019679497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=1740305582019679497' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/1740305582019679497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/1740305582019679497'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/currying-closures.html' title='Currying Closures'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-3423853201090161681</id><published>2008-05-28T05:23:00.000-07:00</published><updated>2008-08-22T10:19:13.917-07:00</updated><title type='text'>Grails Web Info - dated?</title><content type='html'>I have been working on a Grails project for the last few weeks. Form my previous posts, you can see that I am working with a legacy database with my primary table configured with a composite primary key.&lt;br /&gt;&lt;br /&gt;I've been struggling with the insert and update aspects of writing to the database.  Now, in all fairness I am not extremely familiar with Hibernate so I am relying on documentation and information from the web.&lt;br /&gt;&lt;br /&gt;One challenge with the information on the web is that a lot of the posts are &lt;b&gt;&lt;i&gt;out of date&lt;/i&gt;&lt;/b&gt;.  When I read anything earlier that the 2nd half of 2007, I tend to not take the suggestions.  Many of those tell you to configure your hibernate.cfg.xml file.   However, since version 1.0 of Grails many of those configuration options are available within the domain class.&lt;br /&gt;&lt;br /&gt;One feature I just discovered from &lt;a href="http://chanwit.blogspot.com/"&gt;CK's Blog&lt;/a&gt; was the composite key setting "generator='assigned'" which is not in the Grails documentation.&lt;br /&gt;&lt;br /&gt;Now to give this a spin...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-3423853201090161681?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/3423853201090161681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=3423853201090161681' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3423853201090161681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3423853201090161681'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/grails-info-on-web.html' title='Grails Web Info - dated?'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2516273525837242444</id><published>2008-05-14T04:56:00.000-07:00</published><updated>2008-05-14T17:42:28.575-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ui'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Redirecting from index.gsp</title><content type='html'>To redirect to an initial page from the index.gsp&lt;br /&gt;&lt;br /&gt;1.  Create a TagLib file&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;grails-app\taglib\MyAppTagLib.groovy&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;2.  Define a method that routes to your first page&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;class MyAppTagLib {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def redirectMainPage = {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;response.sendRedirect("${request.contextPath}/myController/welcomePage/")&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;3. Change your index.gsp to contain only:&lt;br /&gt;&lt;i&gt;&amp;nbsp;&amp;nbsp;&amp;lt;g:redirectMainPage/&amp;gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; One advantage to this approach is that you have a coding opportunity over simply mapping the "/" url.&lt;br /&gt;&lt;br /&gt;For example, if you want to provide features or data based on a specific user's login id.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2516273525837242444?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2516273525837242444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2516273525837242444' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2516273525837242444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2516273525837242444'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/redirecting-from-indexgsp.html' title='Redirecting from index.gsp'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-8523130288203008458</id><published>2008-05-13T07:21:00.000-07:00</published><updated>2008-05-13T12:42:33.737-07:00</updated><title type='text'>Legacy DB equals frustration</title><content type='html'>Been spending a lot of time trying to solve problems with Grails when you are using a legacy database.  It could be a combination of factors but I am trying to do "simple" one to one mapping of a code table to a column value and I can not get any dynamic finders working!!!&lt;br /&gt;&lt;br /&gt;So I tried a simple:&lt;br /&gt;    def results = MyMainDomain.findAll()&lt;br /&gt;and I get: &lt;br /&gt;    No row with the given identifier exists: [MyLookupClass#someValueInLookupClass        ]&lt;br /&gt;&lt;br /&gt;When I change the variables back to Strings that message goes away.&lt;br /&gt;&lt;br /&gt;Then I get results back with all rows (rowcount = to db row count) containing empty values!&lt;br /&gt;&lt;br /&gt;Turns out: DO NOT define any columns in your composite primary key from other Domain Classes!!!  I changed them to Strings and it worked.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-8523130288203008458?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/8523130288203008458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=8523130288203008458' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8523130288203008458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/8523130288203008458'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/legacy-db-equals-frustration.html' title='Legacy DB equals frustration'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2782267490282672567</id><published>2008-05-08T07:30:00.000-07:00</published><updated>2008-05-08T07:39:34.466-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='composite key'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Composite Key in Domain Class - round 2</title><content type='html'>Still tinkering with the composite key issues.&lt;br /&gt;&lt;br /&gt;I changed my previous approach a bit, I now define my own getId and setId methods to essentially serialize and deserialize the the key fields strung together&lt;br /&gt;&lt;br /&gt;Created a delimiter&lt;br /&gt;static final String delimiter = '~@'&lt;br /&gt;&lt;br /&gt;Defined (overriding default) accessors:&lt;br /&gt;    def getIdAsMap() {&lt;br /&gt;        ["fieldOne": fieldOne, "fieldTwo": fieldTwo]&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    def getId() {&lt;br /&gt;        fieldOne + delimiter + fieldTwo&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    def setId(String inString) {&lt;br /&gt;        def fieldList = new ArrayList()&lt;br /&gt;        def items = inString.split(delimiter)&lt;br /&gt;        items.each { fieldList.add (it)  }&lt;br /&gt;        this.setFieldOne (fieldList[0])&lt;br /&gt;        this.setFieldTwo (fieldList[1])&lt;br /&gt;        getIdAsMap()&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;Its a little clunky but when you can pass around the map, use getIdAsMap(), in other cases the String is available with myclass.id&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inserting new rows requires a little tweak, by default with version: false set, GORM will try to perform a sql update on new records.  To fix this, add insert:true to your save method&lt;br /&gt;&lt;br /&gt;myClass.save(insert: true)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2782267490282672567?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2782267490282672567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2782267490282672567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2782267490282672567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2782267490282672567'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/composite-key-in-domain-class-round-2.html' title='Composite Key in Domain Class - round 2'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-2321299064797698853</id><published>2008-05-08T07:21:00.001-07:00</published><updated>2008-05-08T07:25:36.644-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>UI changes - on the fly?</title><content type='html'>I love the rapid feedback from Grails, but too much of a good thing...&lt;br /&gt;&lt;br /&gt;I was changing some of the field presentation from a &amp;lt;input to &amp;lt;g:select and it was not showing up on the page.&lt;br /&gt;&lt;br /&gt;So:&lt;br /&gt;Refreshed the browser page - nope&lt;br /&gt;Shut down the app, at the command prompt typed 'grails clean', restarted - negative&lt;br /&gt;&lt;br /&gt;Finally I closed the browser and reopened it, and viola!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-2321299064797698853?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/2321299064797698853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=2321299064797698853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2321299064797698853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/2321299064797698853'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/ui-changes-on-fly.html' title='UI changes - on the fly?'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-5517286076753830960</id><published>2008-05-06T07:56:00.001-07:00</published><updated>2008-05-08T17:37:18.035-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='composite key'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><title type='text'>Composite Key in Domain Class</title><content type='html'>Using the default id column in the database works great.  However, if you are facing a "legacy" database design and unable to alter the table definition, you have a bit of work to do.&lt;br /&gt;&lt;br /&gt;Defining your domain class:&lt;br /&gt;1.  The class must implement Serializable&lt;br /&gt;  class MyClass implements Serializable {&lt;br /&gt;  ...&lt;br /&gt;      static mapping = {&lt;br /&gt;      table "my_table"&lt;br /&gt;      version false&lt;br /&gt;      id composite: ["myFieldOne","myFieldTwo"]&lt;br /&gt;      ...&lt;br /&gt;&lt;br /&gt;2.  The scaffolding will by default setup all communication via the id column.  The id column in this case is a serialized value.  However, there is an issue with Grails v1.0.2 that does not deserialize the  value properly.   So, for now you have to work around using the primary key:&lt;br /&gt;&lt;br /&gt;3.  Add new Method to domain class - define a map of the values&lt;br /&gt;      def getPK ( ) {&lt;br /&gt;          ["myFieldOne":myFieldOne, "myFieldTwo":myFieldTwo]&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4.  List view - Add a link on the page to show details for the current record&lt;br /&gt;    &lt;br /&gt;         &amp;lt;span class="actionButton"&amp;gt;&lt;br /&gt;              &amp;lt;g:link action="show" params="${myClass.getPK()}"&amp;gt;Detail &amp;lt;/g:link&amp;gt;&lt;br /&gt;         &amp;lt;/span&amp;gt;&lt;br /&gt;    &lt;br /&gt;NOTE: "id=" was changed to "params=" and you are passing in the map returned from myClass.getPK()&lt;br /&gt;&lt;br /&gt;5.  MyClassController.groovy - modify the retrieval code in the show method&lt;br /&gt; def show = {&lt;br /&gt;     def myClass = MyClass.get( new MyClass(params) )  //here are your inbound params&lt;br /&gt;&lt;br /&gt;     if(!myClass) {&lt;br /&gt;         flash.message = "MyClass not found with ${params}"&lt;br /&gt;         redirect(action:list)&lt;br /&gt;     }&lt;br /&gt;     else { return [ myClass: myClass] }&lt;br /&gt; }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-5517286076753830960?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/5517286076753830960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=5517286076753830960' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/5517286076753830960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/5517286076753830960'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/05/composite-key-in-domain-class.html' title='Composite Key in Domain Class'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-3013579649635905632</id><published>2008-04-23T08:36:00.000-07:00</published><updated>2008-04-25T08:15:34.360-07:00</updated><title type='text'>Java Programmer looking at Groovy</title><content type='html'>Some things that might help you when looking over Groovy code with "Java" eyes:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;everything is an object!&lt;/li&gt;&lt;li&gt;method parenthesis are optional&lt;/li&gt;&lt;li&gt;semicolons at the end of the line are optional&lt;/li&gt;&lt;li&gt;elements in brackets are either a &lt;span style="font-family:courier new;"&gt;List()&lt;span style="font-family:arial;"&gt; &lt;/span&gt;&lt;/span&gt;or a &lt;span style="font-family:courier new;"&gt;Map()&lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Lists are comma separated elements&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;def myList = ["one", "two", "three"]&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Maps are name value : pairs separated by commas&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;ul&gt;&lt;li&gt;        &lt;span style="font-family:courier new;"&gt;def myMap = [dairy:"cheese", meat:"chicken", shopper:"Mario"]&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;the return keyword is optional&lt;/li&gt;&lt;ul&gt;&lt;li&gt;by default the result of the last statement in a code block is returned&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;The questionmark protects you from null pointer exceptions&lt;/li&gt;&lt;ul&gt;&lt;li&gt;println myObj?.myAttribute will print myAttribute if myObj is not null, no error thrown&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Strings can be single or double quoted&lt;/li&gt;&lt;li&gt;Double quoted strings can have variables nested with using the ${ var } syntax or simply $var&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;def var = "Crusty"&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;println "The clown $var unnerves me"&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;The ampersand allows you to call a method from an object&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;println myObj.&amp;amp;someMethod&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;The at symbol allows you to directly address a classes attribute&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;myObj.@fieldName = "somevalue"&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;A range of elements can be defined using an elipsis&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;(1..10).each {println "toe number $it"}&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Now that opened up a couple of other items....&lt;/li&gt;&lt;li&gt;Code in braces is called a closure (see other blog "&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(51, 51, 51); font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 25px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:'Trebuchet MS';font-size:100%;"  &gt;What are Groovy Closures?")&lt;/span&gt;&lt;/li&gt;&lt;li&gt;the keyword "&lt;span style="font-family:courier new;"&gt;it&lt;/span&gt;" is the default iterator for a closure&lt;/li&gt;&lt;li&gt;The double less than symbol is used for appending with StringBuffer, Lists, Sockets, Files &amp;amp; Writers&lt;/li&gt;&lt;li&gt;Named Parameters&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;For example, create a new user with a name and ssn provided&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: courier new;"&gt;new User (name:"Gorge", ssn: "123-45-9999")&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Parameter Defaults&lt;/li&gt;&lt;ul style="font-family: courier new;"&gt;&lt;li&gt;def myMethod (String name, String type="chef") { //somecodehere }&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-3013579649635905632?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/3013579649635905632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=3013579649635905632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3013579649635905632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3013579649635905632'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/04/java-programmer-looking-at-groovy.html' title='Java Programmer looking at Groovy'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-3412181365929802437</id><published>2008-04-23T08:02:00.001-07:00</published><updated>2008-04-23T11:40:10.620-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='closures'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>What are Groovy Closures?</title><content type='html'>One of the more difficult concepts that I had to get my head around as a Java developer was the concept of Groovy closures.&lt;br /&gt;&lt;br /&gt;Closures:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;are classes (defined by Closure.class)&lt;/li&gt;&lt;ul&gt;&lt;li&gt;like defining &lt;span style="font-family:courier new;"&gt;new Closure() {}&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;are similar to anonymous classes&lt;/li&gt;&lt;li&gt;are defined with braces { and }&lt;/li&gt;&lt;li&gt;provide one default iterator parameter (if none specified) called "it" for iterator&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;(1..3).each {println "number $it" }&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;can accept parameters&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;(1..3).each {someNum -&gt; println "Some number $someNum" }&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;can be predefined with a variable name and invoked (they are classes after all)&lt;/li&gt;&lt;ul&gt;&lt;li style="font-family: courier new;"&gt;def myClosure = {x, y -&gt; println "you sent $x and $y" }&lt;/li&gt;&lt;li style="font-family: courier new;"&gt;myClosure 'Feet', 'Hans'&lt;/li&gt;&lt;li&gt;prints: &lt;span style="font-family:courier new;"&gt;you sent Feet and Hans&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li style="font-family: arial;"&gt;do not require an input parameter if its not used, do not provide one&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;def myClosure = { -&gt; "returning this dude" }&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-family: courier new;"&gt;println myClosure&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-3412181365929802437?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/3412181365929802437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=3412181365929802437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3412181365929802437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3412181365929802437'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/04/what-are-groovy-closures.html' title='What are Groovy Closures?'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-4484840145087379533</id><published>2008-04-22T10:00:00.000-07:00</published><updated>2008-05-08T17:36:49.040-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IntelliJ'/><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Grails IntelliJ Plugin</title><content type='html'>The Grails plugin for IntelliJ Idea 7.0 was updated to version 1.5.  I was using the previous versions and they were troublesome. The 1.5 release seems to be working well so far.&lt;br /&gt;&lt;br /&gt;Plugin Site: &lt;a href="http://www.jetbrains.com/idea/features/groovy_grails.html"&gt;http://www.jetbrains.com/idea/features/groovy_grails.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One point of note, I could not find a way to perform "grails clean" within IntelliJ so I have to have a command prompt open to clean the project now and again when things don't seem to be behaving as expected.  Sometimes you have to clean when one of your domain classes changes significantly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-4484840145087379533?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/4484840145087379533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=4484840145087379533' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/4484840145087379533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/4484840145087379533'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/04/grails-intellij-plugin.html' title='Grails IntelliJ Plugin'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9029076276723605375.post-3175181571412404520</id><published>2008-04-22T09:52:00.000-07:00</published><updated>2008-04-23T10:15:05.974-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='grails'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>New Grails User</title><content type='html'>A friend of mine, Ken Rimple, recently turned me onto Groovy on Grails.  When I first heard of it, I wasn't interested in learning another &lt;span style="font-style: italic;"&gt;something &lt;/span&gt;on &lt;span style="font-style: italic;"&gt;something &lt;/span&gt;language/framework pair.  But after a quick spin through the tutorial I was hooked.&lt;br /&gt;&lt;br /&gt;The best thing about it is that its all based in Java and deploys as a war on your favorite web server.  As a matter of fact it builds upon many of the top Java technologies such as Hibernate, Spring, log4J, JUnit, Jetty, HSQL, Quartz, Sitemesh and ANT.&lt;br /&gt;&lt;br /&gt;Now that I have my prototype ready, the devil will be in the details to get it finely polished.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Ken Rimple's Blog: &lt;a href="http://www.rimple.com/tech/"&gt;http://www.rimple.com/tech/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Groovy Site: &lt;a href="http://groovy.codehaus.org/"&gt;http://groovy.codehaus.org/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Grails Site: &lt;a href="http://grails.codehaus.org/"&gt;http://grails.codehaus.org/&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9029076276723605375-3175181571412404520?l=grailsframework.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://grailsframework.blogspot.com/feeds/3175181571412404520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9029076276723605375&amp;postID=3175181571412404520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3175181571412404520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9029076276723605375/posts/default/3175181571412404520'/><link rel='alternate' type='text/html' href='http://grailsframework.blogspot.com/2008/04/new-grails-user.html' title='New Grails User'/><author><name>Gordon Dickens</name><uri>https://profiles.google.com/114681050780814546369</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-dMj3fLlkNPA/AAAAAAAAAAI/AAAAAAAAAJY/fR7TY-stMvo/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
