<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Groovy Solutions</title>
	<atom:link href="http://groovysolutions.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://groovysolutions.org</link>
	<description>Groovy and Grails Goodness</description>
	<lastBuildDate>Fri, 22 Oct 2010 18:32:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>spring-security-ui</title>
		<link>http://groovysolutions.org/uncategorized/spring-security-ui/</link>
		<comments>http://groovysolutions.org/uncategorized/spring-security-ui/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 08:53:16 +0000</pubDate>
		<dc:creator>Rob Wilson</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://groovysolutions.org/?p=59</guid>
		<description><![CDATA[Burt has released the UI extensions for the spring-security-core plugin. As ever very useful. Rob]]></description>
			<content:encoded><![CDATA[<p>Burt has <a href="http://www.grails.org/plugin/spring-security-ui">released</a> the UI extensions for the spring-security-core plugin.<br />
As ever very useful.</p>
<p>Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://groovysolutions.org/uncategorized/spring-security-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Burt&#8217;s new app-info plugin</title>
		<link>http://groovysolutions.org/grails/burts-new-app-info-plugin-2/</link>
		<comments>http://groovysolutions.org/grails/burts-new-app-info-plugin-2/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 15:17:35 +0000</pubDate>
		<dc:creator>Rob Wilson</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://groovysolutions.org/?p=39</guid>
		<description><![CDATA[Burt Beckwith has released a new Grails plugin that provides usefull info on the Grails app. As we have come expect, it is very good. http://burtbeckwith.com/blog/?p=344 From his post: &#8220;I released a new Grails plugin today, app-info. This plugin exposes a lot of internal information for a Grails application. Most of the code for this [...]]]></description>
			<content:encoded><![CDATA[<p>Burt Beckwith has released a new Grails plugin that provides usefull info on the Grails app.</p>
<p>As we have come expect, it is very good.</p>
<p><a title="app-info plugin" href="http://burtbeckwith.com/blog/?p=344" target="_blank">http://burtbeckwith.com/blog/?p=344</a></p>
<p>From his post:</p>
<p>&#8220;I released a new <a href="http://grails.org/" target="_blank">Grails<img src="http://burtbeckwith.com/blog/images/pop.gif" alt="" /></a> plugin today, <a href="http://grails.org/plugin/app-info" target="_blank">app-info<img src="http://burtbeckwith.com/blog/images/pop.gif" alt="" /></a>. This plugin  exposes a lot of internal information for a Grails application. Most of  the code for this plugin dates back a long time and was originally  mostly JSPs that I would copy into whatever application I was working on  to give myself a view into what&#8217;s going on. Over time as I started  using Spring and Hibernate I added more pages to display that  information, and it now also shows information about Grails too.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://groovysolutions.org/grails/burts-new-app-info-plugin-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Grails App With Security and Ajax</title>
		<link>http://groovysolutions.org/grails/simple-grails-app-with-security-and-ajax/</link>
		<comments>http://groovysolutions.org/grails/simple-grails-app-with-security-and-ajax/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 12:41:20 +0000</pubDate>
		<dc:creator>Rob Wilson</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Article]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://groovysolutions.org/?p=4</guid>
		<description><![CDATA[Creating a grails application A good tutorial needs a real world application problem to cover. I believe I have found just such a problem In this tutorial spread over three postings we are going to create a complete grails killer web application. This application will keep track of the total number of days spent in [...]]]></description>
			<content:encoded><![CDATA[<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level1 levelguttercolor1" style="width: 9px;"></td>
<td class=" subcell wholedocgutter indicator level1 levelguttercolor1" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level1 subcell" style="font-weight: 800; font-size: 14px;">Creating a grails application</td>
</tr>
</tbody>
</table>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"></td>
<td class=" content level2 subcell">A good tutorial needs a real world application problem to cover. I believe I have found just such a problem <img src='http://groovysolutions.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>In this tutorial spread over three postings we are going to create a complete grails killer web application. This application will keep track of the total number of days spent in each country our users visit in any one tax year. As I&#8217;m sure you have already worked out. This useful public service web application is targeted at the  super rich international traveller who doesn&#8217;t happen to have an account. It will help them avoid accidental tax domicile status in any single country. (which would obviously be a disaster)</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">The app will include</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Security and user management with roles, for a normal user and for a super user or admin.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Persistence of users itineraries and static reference data</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Some ajax and the integration of out of the box open source javascript components to display handy views of the itinerary and results to the user.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">Setting Up</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"></td>
<td class=" content level3 subcell">To build this app all you need is an internet connection, an installation of Grails and a text editor but life will be easier for you if you use an IDE. I will be using the STS (SpringSource Tool Suite) IDE for this tutorial so you should:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level3 subcell">Download and install STS</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor4">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level4 levelguttercolor4" style="width: 57px;"></td>
<td class=" subcell wholedocgutter indicator level4 levelguttercolor4" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level4 subcell">set up the extensions for Grails and Groovy under the dashboard view.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Download and install grails version 1.3.2</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor1">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level1 levelguttercolor1" style="width: 9px;"></td>
<td class=" subcell wholedocgutter indicator level1 levelguttercolor1" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level1 subcell" style="font-weight: 800; font-size: 14px;">Getting Started</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">To create the app we use the standard grails app creation script</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails create-app residency</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">This will create a new folder with the name you specified for the application and inside the complete grails developement application structure.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor1">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level1 levelguttercolor1" style="width: 9px;"></td>
<td class=" subcell wholedocgutter indicator level1 levelguttercolor1" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level1 subcell" style="font-weight: 800; font-size: 14px;">Plugins</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">We are going to use the excellent spring-security-core plugin written by Burt Beckwith to handle the security and user management. We can install this plugin by doing:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails install-plugin spring-security-core</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">When the plugin installation completes it will announce that two extra grails scripts are now available. The one that we need is the s2-quickstart script. This script will set up domain classes to handle the persistence of security details and config for the app. The script takes up to four arguments but we are going to use three. We will declare a package for the application security domain classes (actually this will also be the base package for the application), the name of the user class and the name of the authority class. As we will not be using any database that clashes with the obvious names &#8220;User&#8221; and &#8220;Role&#8221; we will use these.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">so we do:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails grails s2-quickstart com.yourcomapnyname.residency User Role RequestMap</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">This will create three domain classes. The User class for storing the user credentials, the Role class for storing roles that a user can be assigned and a UserRole class that associates Users with Roles.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">The new spring-security-core plugin now uses the standard grails config.groovy file for config and if you look at the bottom of this file now you can see that the s2 script has inserted lines that tell the plugin the security class names you have chosen.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor1">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level1 levelguttercolor1" style="width: 9px;"></td>
<td class=" subcell wholedocgutter indicator level1 levelguttercolor1" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level1 subcell" style="font-weight: 800; font-size: 14px;">Domain Classes</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">Now we can create the domain classes we will need for the application.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">We will create three</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Airport</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Country</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Flight</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">To do this we use the standard grails domain class creation script and do:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails create-domain-class com.yourcompanyname.residency.Airport</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails create-domain-class com.yourcompanyname.residency.Country</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-family: &amp;amp;amp;">grails create-domain-class com.yourcompanyname.residency.Flight</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">If you now look in your project grails-app/domain folder you will find the package com.yourcompanyname.residency containing three fairly empty groovy domain classes. That look like this:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<pre class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell" style="font-family: &amp;amp;amp; font-size: 11px; text-align: left;">
<pre><span style="color: #972b77;">class</span> Airport {</pre>
<pre><span style="color: #972b77;">static</span> <span style="color: #66ccff;">constraints</span> = {
}
}</pre>
</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">We will need to fill out these domain classes in order to declare to grails the details of the model we will be using. Here is one of the major wins for grails. A single point of declaration for the domain model. This definition is used to great and update the database schema throughout the development process, freeing the developer from managing coupling across tiers. Believe me this saves LOTS of time.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">Ok so for our domain classes we will start by filling in the details of the Country class. Here is what this class should look like:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<pre class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">
<pre><span style="color: #972b77;">package</span> com.yourcompanyname.residency</pre>
<pre><span style="color: #972b77;">class</span> Country {
String <span style="color: #0000bf;">name</span></pre>
<pre><span style="color: #972b77;">static</span> <span style="color: #66ccff;">hasMany</span> = [airports:Airport]</pre>
<pre><span style="color: #972b77;">static</span> <span style="color: #66ccff;">constraints</span> = {
name blank:<span style="color: #972b77;">false</span>, unique:<span style="color: #972b77;">true</span>
<span style="text-decoration: underline;">airports</span> <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">true</span>
}
}</pre>
</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level3 subcell">Lets go through what we have done.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor4">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level4 levelguttercolor4" style="width: 57px;"></td>
<td class=" subcell wholedocgutter indicator level4 levelguttercolor4" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level4 subcell">Firstly we can see that we have declared a &#8220;name&#8221; property of type String. Also if you look in the static constraints block you can see that we have declared that this property cannot be blank and that it must be unique. This tells Gorm (the grails object relational mapping code) to enforce these rules whenever a domain object is validated.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor4">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level4 levelguttercolor4" style="width: 57px;"></td>
<td class=" subcell wholedocgutter indicator level4 levelguttercolor4" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level4 subcell">As well as the name property we can see that we have declared a relationship that the domain class has to the Airport domain class. We have used the standard Gorm static hasMany property to declare that the Country domain class has a one to many relationship with Airport. As it stands this declaration does not describe the cascade direction of this relationship and we need to do this now as we fill in the details on the Airport domain class.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">The Airport domain class looks like this:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<pre class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">
<span style="color: #972b77;">package</span> com.yourcompanyname.residency

<span style="color: #972b77;">class</span> Airport {
String <span style="color: #0000bf;">name</span>
String <span style="color: #0000bf;">code</span>

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">belongsTo</span> = [country:Country]

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">constraints</span> = {
name blank:<span style="color: #972b77;">false</span>, unique:<span style="color: #972b77;">true</span>
code blank:<span style="color: #972b77;">false</span>, unique:<span style="color: #972b77;">true</span>

<span style="text-decoration: underline;">country</span> <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>
}
}</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">Looking at Airport we can see that we have declared name and code as String properties and defined constraints for them in a a similar way to the Country domain class but also we have declared the cascade direction for the relationship between Airport and Country. The static belongsTo property declares that by default Country is the parent Object and that when a Country is updated or deleted then the child objects Airport should also be updated or deleted.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">Next will declare the Flight domain class.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<pre class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">
<span style="color: #972b77;">package</span> com.yourcompanyname.residency

<span style="color: #972b77;">class</span> Flight {
Airport <span style="color: #0000bf;">departingAirport</span>
Airport <span style="color: #0000bf;">arrivingAirport</span>
Date <span style="color: #0000bf;">departureTime</span>
Date <span style="color: #0000bf;">arrivalTime</span>

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">belongsTo</span> = [user:User]

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">constraints</span> = {

departingAirport <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>
arrivingAirport <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>
departureTime <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>
arrivalTime <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>

<span style="text-decoration: underline;">user</span> <span style="color: #66ccff;">nullable</span>:<span style="color: #972b77;">false</span>
}
}</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<div class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">You should begin to see the same use of the relationships and constraints definitions. This is standard GORM and very much the bread and butter work of creating a grails application.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level2 subcell">Finally we need to modify the autogenerated spring security User class to declare a relationship to the Flight domain class. This will allow users to be associated with their flights and will allow us to limit the visibility of flights to only the user that entered them.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<pre class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">
<span style="color: #972b77;">package</span> com.yourcompanyname.residency

<span style="color: #972b77;">class</span> User {

String <span style="color: #0000bf;">username</span>
String <span style="color: #0000bf;">password</span>
<span style="color: #972b77;">boolean</span> <span style="color: #0000bf;">enabled</span>
<span style="color: #972b77;">boolean</span> <span style="color: #0000bf;">accountExpired</span>
<span style="color: #972b77;">boolean</span> <span style="color: #0000bf;">accountLocked</span>
<span style="color: #972b77;">boolean</span> <span style="color: #0000bf;">passwordExpired</span>

<span style="color: #3f7e5e;">// declare the relationship </span><span style="color: #3f7e5e; text-decoration: underline;">with t</span><span style="color: #3f7e5e;">he Flight domain class</span>
<span style="color: #972b77;">static</span> <span style="color: #66ccff;">hasMany</span> = [flights:Flight]

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">constraints</span> = {
username blank: <span style="color: #972b77;">false</span>, unique: <span style="color: #972b77;">true</span>
password blank: <span style="color: #972b77;">false</span>
}

<span style="color: #972b77;">static</span> <span style="color: #66ccff;">mapping</span> = {
password column: <span style="color: #ff00cc;">'`password`'</span>
}

Set&lt;Role&gt; getAuthorities() {
UserRole.findAllByUser(<span style="color: #972b77;">this</span>).<span style="color: #66ccff;">collect</span> { <span style="color: #66ccff;">it</span>.<span style="text-decoration: underline;">role</span> } <span style="color: #972b77;">as</span> Set
}
}</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" altRow full">
<pre class=" full levelcolor3">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level3 levelguttercolor3" style="width: 41px;"></td>
<td class=" subcell wholedocgutter indicator level3 levelguttercolor3" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level3 subcell">To do this we have inserted the "<span style="color: #972b77;">static</span> <span style="color: #66ccff;">hasMany</span> = [flights:Flight]" line.</td>
</tr>
</tbody>
</table>
</pre>
</div>
<div class=" full">
<div class=" full levelcolor1">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level1 levelguttercolor1" style="width: 9px;"></td>
<td class=" subcell wholedocgutter indicator level1 levelguttercolor1" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" title="expanded" src="http://groovysolutions.org/wp-content/uploads/2010/07/Expanded.png" border="0" alt="V" /></td>
<td class=" content level1 subcell" style="font-weight: 800; font-size: 14px;">Scaffolding</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">To see what we have created so far we can use the Grails scaffolding code to generate a set of basic CRUD (create, read, update, delete) views and controllers that will form a basic web app prototype we can modify and refine to our needs.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">Do &#8220;<span style="font-family: &amp;amp;amp;">grails generate-all</span>&#8221; and when the script prompts you for a domain class just press return and the script will generate tests, views and controllers for all domain classes in the application.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">You should now have a runnable web application. To start the application do &#8220;grails run-app&#8221; and point your browser the the url provided by the run-app script.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">In my case the url is &#8221; <span><a href="http://localhost:8080/residency">http://localhost:8080/residency</a></span>&#8220;</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">If your application fails to start make sure that you do not already have something running using port 8080. If all went well grails will have started an instance of Tomcat listening on port 8080 and deployed the &#8220;residency&#8221; application into it.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">You should see something like this:</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">
<table style="display: inline;" border="0" cellspacing="0">
<tbody>
<tr>
<td style="border: 1px solid black; text-align: center;"><a href="http://groovysolutions.org/wp-content/uploads/2010/07/Pasted-Graphic1.jpg"><img class="alignnone size-medium wp-image-52" title="Pasted Graphic" src="http://groovysolutions.org/wp-content/uploads/2010/07/Pasted-Graphic1-300x279.jpg" alt="" width="300" height="279" /></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">This is the grails generated index page for the application and under the Available Controllers section are links to the controllers for each of the domain classes. Have a play around with them just to see what grails has set up for us.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">Finished playing? Very cool isn&#8217;t it. Grails has been able to do a heck of a lot just by using the limited detail we declared in the domain classes.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell">Don&#8217;t spend any time entering any data into the app at this stage. We are by default pointing to the HSQL in memory db. So any data you enter will be lost when the app shuts down.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class=" altRow full">
<div class=" full levelcolor2">
<table class=" col_width1 col1" style="height: 100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class=" subcell wholedocgutter level2 levelguttercolor2" style="width: 25px;"></td>
<td class=" subcell wholedocgutter indicator level2 levelguttercolor2" style="width: 15px;"><img style="margin-left: 3px; margin-right: 3px; margin-top: 3px;" src="http://groovysolutions.org/wp-content/uploads/2010/07/LeafRowHandle.png" border="0" alt="*" /></td>
<td class=" content level2 subcell" style="font-style: italic;">In the next article we will set up some bootstrap data, get the security and user management configured and working and tidy up the application into the general storyline /  layout that we want.</td>
</tr>
</tbody>
</table>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://groovysolutions.org/grails/simple-grails-app-with-security-and-ajax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

