Archive for July, 2012

This Week in Grails (2012-30)

Tuesday, July 31st, 2012

Not one, not two, but three Groovy releases happened this week. How are we supposed to keep up with all of these? 🙂

The DailyGrailsTip Twitter account has been consistently interesting with one tweet a day of useful Grails tips. Follow the account if you haven’t yet.

Tomás Lin pointed out that AppFog announced their pricing and it looks compelling – there’s even a free option. It looks like a solid option for hosting Grails apps, with an option for 24/7 support.

This week was a bit slow news-wise, but I’m sure there will be a lot of interesting stuff from GR8Conf US for next week’s post.


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There was one new plugin released:

  • events-push version 1.0.M1. A client-side event bus based on the portable push library Atmosphere that propagates events from the server-side event bus to the browser

and 6 updated plugins:

  • ajaxflow version 0.2.4. Enables Ajaxified Webflows
  • events-si version 1.0.M2. Standard Events system for Grails implementation; it is a Spring Integration implementation and uses its artefacts to map listeners, senders and events messages
  • facebook-sdk version 0.3.4. Allows your application to use the Facebook Platform and develop Facebook apps on Facebook.com or on web sites (with Facebook Connect)
  • platform-core version 1.0.M2. Provides functionality for plugins to use to achieve greater integration with each other and with applications
  • shiro-openid version 0.4. Adds OpenID authentication to the Shiro plugin with a set of installable Shiro domain class and openid4java view templates
  • spring-security-openid version 1.0.4. OpenID authentication support for the Spring Security plugin

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2012-29)

Wednesday, July 25th, 2012

Everyone should check out this informative article on Cyclomatic Complexity in Groovy code. I find that people often tend to get pretty lazy when writing code in Groovy and worry less about code quality since Groovy eliminates so much of the clutter and ceremony. But it’s still important to write great code, so having tools like GMetrics and CodeNarc to do automated quality checks can help a lot to keep us honest.

I can’t believe that GR8Conf US 2012 is next week! I’ve got to get started on those presentations 😉

I thought this image (based on the “Yo Dawg” meme) about the plugin-config plugin was pretty funny.


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There were 3 new plugins released:

  • context-param version 1.0. Automatically adds parameters specified as @ContextParam on a controller to redirect calls
  • glassfish version 0.1.2. Makes Glassfish the default app server during development
  • page-resources version 0.1.1. Enhances the resources plugin by allowing for creation of “page” resource modules using convention over configuration

and 12 updated plugins:

  • export version 1.5. Export domain objects to a variety of formats (CSV, Excel, ODS, PDF, RTF and XML)
  • facebook-sdk version 0.3.3. Allows your application to use the Facebook Platform and develop Facebook apps on Facebook.com or on web sites (with Facebook Connect)
  • flash-helper version 0.9.3. Simplifies and standardizes the process of adding/reading messages in the flash scope
  • google-analytics version 2.0. Provides a simple taglib to embed Google Analytics pageview tracking to your Grails application
  • hibernate-filter version 0.3.2. Integrates Hibernate Filters with Grails
  • infinispan version 1.0.3. Adds support for the JBoss Infinispan distributed cache
  • jetty version 2.0.0. Makes Jetty the development time container
  • localizations version 1.4.4.4. Store i18n strings in a database
  • mybatis version 0.0.2. Provides MyBatis support
  • paypal version 0.6.8. Adds PayPal integration
  • simple-captcha version 0.9.1. Creates simple image CAPTCHAs that protect against automated completion and submission of HTML forms
  • spring-security-cas version 1.0.5. Jasig CAS support for the Spring Security plugin

Interesting Tweets

User groups and Conferences


This Week in Grails (2012-28)

Monday, July 16th, 2012

Spring Tool Suite (STS) and the Groovy/Grails Tool Suite (GGTS) version 3.0.0.M3 was released this week.

Tomás Lin wrote three interesting blog posts this week:

and he also pointed out a new Twitter account that will be tweeting helpful Grails tips, @dailygrailstip.

Nicholas Hagen also had three blog posts this week, a series on using the improved Maven support in Grails 2.1:


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There was one new plugin released:

  • teamcity version 1.0.3. Provides build status and test run integration with TeamCity

and 6 updated plugins:

  • activiti version 5.9. Integrates the Activiti BPM Suite and workflow system
  • activiti-spring-security version 0.4.8. Integrates Spring Security to Activiti as custom IdentityService
  • ducksboard-api version 0.2.1. Provides integration with the ducksboard.com pull and push API to display metrics in real time
  • dustjs-resources version 0.8. Supports server-side compilation of .dust template files to their .js counterparts
  • spring-security-cas version 1.0.4. Jasig CAS support for the Spring Security plugin
  • spring-security-facebook version 0.9. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2012-27)

Tuesday, July 10th, 2012

The big news of this week was the Grails 2.1.0 release. No support yet for Groovy 2.0 – that will be available in Grails 2.2 – but this release greatly enhances the Maven support, adds the Grails Wrapper feature, and installs the cache plugin by default in new apps (note that the cache plugins all work with Grails 2.0 and higher).

I released some plugin updates this week: the app-info plugin (“Updates for the Grails App Info plugin” blog post here), the console plugin, and the spring-security-cas plugin. To coincide with the Grails 2.1 release, I also released the 1.0.0 versions of the cache, cache-ehcache, and cache-redis plugins.

Version 2.7.0 of the Groovy-Eclipse STS plugin was released this week. Check out the New and Noteworthy


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There were 4 new plugins released:

  • aws-sdk version 1.3.12. Use the Amazon Web Services infrastructure services
  • cargo-deploy version 0.1. Uses Cargo to deploy your application WAR file to an application server
  • jmesa version 2.0.4. Integrates the JMesa dynamic data table
  • mybatis version 0.0.1. Provides MyBatis support

and 17 updated plugins:

  • angularjs-resources version 1.0.1. Adds AngularJS resources to an application
  • app-info version 1.0.1. Provides a UI for inspecting and altering various aspects of the application’s configuration
  • avatar version 0.6.3. Provides a taglib for displaying avatars
  • birt-report version 4.2.0.0. Embeds reports created using the BIRT Report Engine into your application
  • build-test-data version 2.0.3. Enables the easy creation of test data by automatic inspection of constraints
  • cache version 1.0.0. Adds controller action, service method, and JSP fragment caching
  • cache-ehcache version 1.0.0. An Ehcache-based implementation of the Cache plugin
  • cache-redis version 1.0.0. A Redis-based implementation of the Cache plugin
  • console version 1.2. A web-based Groovy console for interactive runtime application management and debugging
  • dynamic-controller version 0.4. Supports controller mixins, where action closures are retrieved from various sources including existing controllers, files, database source, etc. Can also create full controllers dynamically
  • google-visualization version 0.5.3. Provides a taglib for the interactive charts of the Google Visualization API
  • gsp-resources version 0.4.1. Use the resources plugin to include static files like main.css.gsp, so dynamically built CSS and JS can be served as proper files instead of inlined in a non-cacheable GSP file
  • kickstart-with-bootstrap version 0.6.1b. Start your project with a good looking frontend, with adapted scaffolding templates for standard CRUD pages using Twitter Bootstrap
  • localizations version 1.4.4.2. Store i18n strings in a database
  • redis version 1.3.2. Provides integration with a Redis datastore
  • spring-security-cas version 1.0.3. Jasig CAS support for the Spring Security plugin
  • spring-security-saml version 1.0.0.M16. SAML 2.x support for the Spring Security Plugin

Interesting Tweets

Jobs



User groups and Conferences


Updates for the Grails App Info plugin

Thursday, July 05th, 2012

The app-info plugin wasn’t working in Grails 2.0+ because of an incompatibility between the Hibernate Tools jar and the version of Hibernate that Grails uses. So I split out the Hibernate-related functionality from the plugin into a to-be-released app-info-hibernate plugin, and once they release an updated version of Hibernate Tools I’ll be able to finish and release that. This also affected the db-reverse-engineer plugin but I was able to fix that with a hackish solution since that runs as a script (I fork a new process with a separate classpath) but that approach wasn’t feasible for this plugin.

The original blog post is still mostly valid but I wanted to point out some new features and make an updated test application available.

You install the plugin like any other, by including a dependency for it in BuildConfig.groovy, e.g.

plugins {
   ...

   compile ':app-info:1.0.1'
}

The plugin depends on the dynamic-controller plugin to configure what features are available, so you need to configure the active mixins in Config.groovy (omit any you don’t need):

grails.plugins.dynamicController.mixins = [
   'com.burtbeckwith.grails.plugins.appinfo.IndexControllerMixin':
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.Log4jControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.SpringControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.MemoryControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.PropertiesControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.ScopesControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'com.burtbeckwith.grails.plugins.appinfo.ThreadsControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController',

   'app.info.custom.example.MyConfigControllerMixin' :
      'com.burtbeckwith.appinfo_test.AdminManageController'
]

This configures a dynamic AdminManagerController and I like to map its urls to /admin/manage, so I add these lines to UrlMappings.groovy:

"/admin/manage/$action?"(controller: "adminManage")
"/adminManage/$action?"(controller: "errors", action: "urlMapping")

"403"(controller: "errors", action: "accessDenied")
"404"(controller: "errors", action: "notFound")
"405"(controller: "errors", action: "notAllowed")
"500"(controller: "errors", action: "error")

The first is the expected mapping, and the second “un-maps” the one that gets auto-created by the "/$controller/$action?/$id?" rule. It does this by using the urlMapping action in ErrorsController (see the test app for the source) to send a 404 error code. Since I’m using a controller for this, I also map the standard error codes to be able to have custom GSPs for each.

If you’re using the spring-security-core plugin you can then guard access to all the plugin’s actions with one mapping:

grails.plugins.springsecurity.controllerAnnotations.staticRules = [
   '/adminmanage/**': ['ROLE_ADMIN']
]

The plugin also includes a configuration demonstrating the new support for adding extra menu items (see GPAPPINFO-19) so the test app includes the app.info.custom.example.MyConfig class in src/groovy, the app.info.custom.example.MyConfigControllerMixin mixin in grails-app/controllerMixins, and the views/myconfig/configs.gsp GSP. This is all plugged in with this configuration in Config.groovy:

grails.plugins.appinfo.additional = [
   "My Config": [
      configs: "Configs"
   ]
]

There’s also a new thread dump mixin (see GPAPPINFO-20) and this is enabled by configuring ThreadsControllerMixin (see the grails.plugins.dynamicController.mixins config map above). The menu item is “Thread Dump” in the Info menu.

You can download the test application (it uses Grails 2.0.4) here. Once it’s running navigate to http://localhost:8080/appinfodemo/admin/manage/ and authenticate as admin/password to try it out.

This Week in Grails (2012-26)

Tuesday, July 03rd, 2012

My apologies for not doing a post last week; I was traveling (doing two Groovy and Grails courses back-to-back) and didn’t have time.

The big news of the last two weeks is the Groovy 2.0 release. Lots of cool stuff there including static type checking, static compilation, modularity, and Invoke Dynamic support. Check out Cédric Champeau’s “Groovy 2.0 from an insider” post, Andre Steingress’ “Groovy 2.0: Love for Grails Command Objects” post, and this older post based on a 2.0 RC, Writing sentences with Groovy 2.0.

Grails 2.1 RC3 was released and the 2.1 GA release will be out soon. Test it now to get an early start on your upgrade and to help find any remaining issues.

Matt Raible and James Ward did a Play vs. Grails Smackdown at ÜberConf. The Grails version of the app did very well, especially considering all of the Play/Scala fanboy hype that we’ve had to put up with.

Netflix open sourced their Grails-based Asgard management and deployment app.
Asgard. They’re also hiring a Grails developer (see the Jobs section for the link and details).


If you want to keep up with these “This Week in Grails” posts you can access them directly via their category link or in an RSS reader with the feed for just these posts.


Translations of this post:



Plugins

There were 3 new plugins released:

and 13 updated plugins:

  • ajaxflow version 0.2.3. Enables Ajaxified Webflows
  • bcrypt version 1.0. Performs bcrypt hashing
  • cucumber version 0.6.0. Test your Grails apps with Cucumber
  • grom version 0.2.4. Sends notifications on Windows, Linux, and Mac
  • gsp-resources version 0.4. Use the resources plugin to include static files like main.css.gsp, so dynamically built CSS and JS can be served as proper files instead of inlined in a non-cacheable GSP file
  • guard version 1.0.6. Provides a way to run integration tests without having to repeatedly bootstrap the environment
  • handlebars-resources version 0.3. Supports using Handlebars.js templates with the Grails Resources Plugin
  • infinispan version 1.0.1. Adds support for the JBoss Infinispan distributed cache
  • kickstart-with-bootstrap version 0.6.0. Start your project with a good looking frontend, with adapted scaffolding templates for standard CRUD pages using Twitter Bootstrap
  • spring-security-saml version 1.0.0.M15. SAML 2.x support for the Spring Security Plugin
  • uploadr version 0.5.11. HTML5 Drag and Drop file uploader
  • xwiki-rendering version 0.6. Convert texts using XWiki Rendering Framework
  • yammer-metrics version 2.1.2-2. Packages Coda Hale’s yammer metrics jars

Interesting Tweets

Jobs



User groups and Conferences

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 License.