This Week in Grails (2013-12)

Saturday, March 30th, 2013 10:49pm

The Groovy team released version 2.1.2 this week.

Check out Graeme’s blog post on the new async features in Grails 2.3.


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 7 new plugins released:

  • google-analytics-tracker version 0.1. Provides a simple way to embed your web application with page view tracking and event tracking of Google Analytics
  • gorm-interceptors version 0.1. Interceptors for GORM methods (excluding find, countBy, addTo, removeFrom methods)
  • mixpanel version 1.0. Integration with www.mixpanel.com analytics
  • sanchez version 1.0. Integration for sanchez.js javascript/html/GSP templates on client and server-side
  • segmentio version 0.1.7. Use Segment.io to send your analytics data to any service you want, without you having to integrate with each one individually
  • tika-parser version 1.3.0. Bundles the Apache Tika toolkit along with a parser service
  • validate-config version 0.4. Adds methods to ConfigObject for validating expected and required properties

and 13 updated plugins:

  • aws-sdk version 1.4.1. Use the Amazon Web Services infrastructure services
  • clover version 3.1.11. Integrates the Clover code coverage tool
  • code-coverage version 1.2.6. Generates code coverage reports using Cobertura
  • facebook-sdk version 0.4.9. Allows your application to use the Facebook Platform and develop Facebook apps on Facebook.com or on web sites (with Facebook Connect)
  • geasyui version 0.7. Supplies jQuery EasyUI resources and taglibs
  • gson version 1.1.2. Provides alternate JSON (de)serialization using Google’s Gson library
  • jaxrs version 0.7. Supports the development of RESTful web services based on the Java API for RESTful Web Services (JSR 311: JAX-RS)
  • jdbc-pool version 7.0.37. Replaces default Grails Commons DBCP Pool with Tomcat JDBC Pool” target=’_blank’>http://people.apache.org/~fhanik/jdbc-pool/)
  • jesque version 0.6.1. Groovier approach to using jesque
  • jquery-validation-ui version 1.4.4. Client Side Validation without writing JavaScript
  • recaptcha version 0.6.3. Integrates ReCaptcha and Mailhide services
  • spring-security-facebook version 0.13.2. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin
  • uploadr version 0.7.1. HTML5 Drag and Drop file uploader

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-11)

Monday, March 18th, 2013 8:30pm

Graeme has been working on adding more asynchronous support for Grails 2.3, with additional controller features and new support for async GORM. Check out the initial documentation.

You can now register for GR8Conf EU at the “early bird” rates – be sure to get your tickets before the prices go up. They have announced the speaker lineup, and they are looking for sponsors. You can also check out their Laynrd page.

Registration for GR8Conf US is also open, and you have until the end of the week to get your ticket at the “Door Buster” rate.

The SpringOne 2GX call for papers call for papers is open, so submit a talk if you’re interested in speaking there in September. If you want to attend, register here before their prices go up.


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:

and 11 updated plugins:

  • coffeescript-resources version 0.3.7. Create coffeescript modules that automatically compiles on every file change with jCoffeeScript
  • console-enhancements version 1.0. Enhances the grails console output for better visibility
  • cxf-client version 1.5.2. Use existing (or new) Apache CXF wsdl2java generated content to invoke SOAP services
  • geasyui version 0.6. Supplies jQuery EasyUI resources and taglibs
  • goblin version 0.3.3. A browser game framework
  • gson version 1.1. Provides alternate JSON (de)serialization using Google’s Gson library
  • health-control version 0.2. Automated control of services, resources and other things that might fail from time to time
  • plastic-criteria version 0.7. Mock Grails Criteria for Unit Tests
  • spring-security-facebook version 0.13. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin
  • spring-security-saml version 1.0.0.M20. SAML 2.x support for the Spring Security Plugin
  • webflow version 2.0.8. Integrates Spring Web Flow with Grails

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-10)

Tuesday, March 12th, 2013 10:02am

The speaker lineup for GR8Conf US has been announced, and a partial list of speakers have been announced for GR8Conf EU. Be sure to get your tickets now before the prices go up.

I released a new plugin this week that adds Dropwizard support for Grails. Check out the introductory blog post for usage information and a test project.


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:

  • dropwizard version 0.1. Adds support for Dropwizard
  • file-server version 0.1. Serves files from any directories on disk
  • health-control version 0.1. Automated control of services, resources and other things that might fail from time to time

and 14 updated plugins:

  • aws-sdk version 1.3.33. Use the Amazon Web Services infrastructure services
  • bootstrap-crumbs version 1.0.2. Provide simple breadcrumb functionality using the twitter bootstrap library
  • coffeescript-compiler version 0.9.2. Compiles .coffee source files into .js files
  • cxf-client version 1.5.1. Use existing (or new) Apache CXF wsdl2java generated content to invoke SOAP services
  • gson version 1.0.1. Provides alternate JSON (de)serialization using Google’s Gson library
  • hd-image-utils version 0.4. High quality image manipulation plugin for scaling and cropping images. Uses the pure Java java-image-scaling library
  • ic-alendar version 0.3.5. Export event data in the iCalendar format
  • jesque version 0.6.0. Groovier approach to using jesque
  • kickstart-with-bootstrap version 0.9.6. Start your project with a good looking frontend, with adapted scaffolding templates for standard CRUD pages using Twitter Bootstrap
  • mongodb version 1.2.0. Aims to provide an object-mapping layer on top of MongoDB
  • recaptcha version 0.6.2. Integrates ReCaptcha and Mailhide services
  • resources version 1.2. A resource management and processing framework
  • sharding version 0.9. Defines multiple database shards to horizontally scale data
  • wslite version 0.7.2.0. Integrates the https://github.com/jwagenleitner/groovy-wslite library

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-09)

Wednesday, March 06th, 2013 2:15pm

We released Grails 2.1.4 and 2.2.1 this week; they are primarily bug fix releases.

Registration for GR8Conf Europe 2013 is now open. Be sure to sign up soon while the prices are very low.

I’ve been seeing a lot of buzz about Dropwizard as a framework for creating REST services. I thought it would be interesting to integrate it with Grails, but it ended up being a lot more work than I expected since the two approaches are very different, and very opinionated. I have an initial implementation available of a plugin and will add some docs and a sample application soon.


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:

and 7 updated plugins:

  • coffeescript-compiler version 0.8.1. Compiles .coffee source files into .js files
  • geasyui version 0.4. Supplies jQuery EasyUI resources and taglibs
  • jquery-validation-ui version 1.4.2. Client Side Validation without writing JavaScript
  • kickstart-with-bootstrap version 0.9.5b. Start your project with a good looking frontend, with adapted scaffolding templates for standard CRUD pages using Twitter Bootstrap
  • localizations version 1.4.4.10. Store i18n strings in a database
  • recaptcha version 0.6.0. Integrates ReCaptcha and Mailhide services
  • redis version 1.3.3. Provides integration with a Redis datastore

Interesting Tweets

User groups and Conferences


Grails Dropwizard Plugin

Wednesday, March 06th, 2013 11:22am

I’ve been seeing a lot of buzz about Dropwizard as a framework for creating REST services. I thought it would be interesting to integrate it with Grails, but it ended up being a lot more work than I expected since the two approaches are very different, and very opinionated. I have released an initial Grails plugin that integrates Dropwizard: dropwizard. The source is here and the docs are here.

To make thing more clear, I created a simple test application. You can download it here.

Available URLs

The application has a simple Person domain class with a dynamically scaffolded controller, so typical URLs like http://localhost:8080/dropwizardtest/person/list work as expected. The Dropwizard resources are mapped under the default “dropwizard” context path, so you can make a GET request (for example in a browser) for http://localhost:8080/dropwizard/people to see the JSON response for all Person instsances; there is one created in BootStrap.groovy and you can easily add more.

You can also view a single instance by id, for example http://localhost:8080/dropwizard/people/1 which should display

{"id":1,"fullName":"Person Jones","jobTitle":"Jefe Grande"}

Since there is only one user, a GET request for http://localhost:8080/dropwizard/people/42 should display

No such user.

You can create a new Person with a POST request to http://localhost:8080/dropwizard/people – do this with a REST client, or the Firefox Poster addon, or even using curl from the commandline:

curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"fullName":"Other Person","jobTitle":"Other Title"}' http://localhost:8080/dropwizard/people

Now if you view all instances with http://localhost:8080/dropwizard/people/ it should look like

[{"id":1,"fullName":"Person Jones","jobTitle":"Jefe Grande"},{"id":2,"fullName":"Other Person","jobTitle":"Other Title"}]

or you can use curl again:

curl http://localhost:8080/dropwizard/people/

There is a simple hello-world endpoint which replies with a hello message, and uses a specified name if provided. If you GET http://localhost:8080/dropwizard/hello-world you will see a response similar to

{"id":1,"content":"Hello, Stranger!"}

and if you add a name parameter – http://localhost:8080/dropwizard/hello-world?name=Ralph – you will see

{"id":2,"content":"Hello, Ralph!"}

You can also POST to /hello-world with the data for a Saying instance:

curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"id":123,"content":"test saying"}' http://localhost:8080/dropwizard/hello-world

and it will log the information using Logback:

INFO  [2013-03-05 08:35:28,334] grails.app.dropwizard.com.example.helloworld.resources.HelloWorldDropwizardResource: Received a saying: id: 123, content: test saying

The plugin comes with support for Freemarker and Mustache templates. GET http://localhost:8080/dropwizard/views/utf8.ftl to see a Freemarker response, and http://localhost:8080/dropwizard/views/utf8.mustache to see Mustache.

There is also a simple endpoint under http://localhost:8080/dropwizard/info that you can make GET requests for:

Application is running on port : 8080 connectorType : blocking

To test support for tasks, POST to http://localhost:8081/dropwizard/tasks/gc to run a garbage collection using the default “gc” task:

curl -H "Accept: application/json" -X POST http://localhost:8081/dropwizard/tasks/gc

and the response should be

Running GC...
Done!

You can run the sample HelloDropwizardTask too; send a POST request to http://localhost:8081/dropwizard/tasks/hello-task :

curl -H "Accept: application/json" -X POST http://localhost:8081/dropwizard/tasks/hello-task

and it should display

my task complete.

The admin URIs are available on port 8081. GET http://localhost:8081/dropwizard/metrics or http://localhost:8081/dropwizard/metrics?pretty=true to see current metrics:

   {
  "jvm" : {
    "vm" : {
      "name" : "Java HotSpot(TM) 64-Bit Server VM",
      "version" : "1.7.0_11-b21"
    },
    "memory" : {
    ...

GET http://localhost:8081/dropwizard/healthcheck to run all health checks:

* DataSource: OK
* deadlocks: OK
* template: OK

GET http://localhost:8081/dropwizard/threads to view a thread dump:

main id=1 state=WAITING
    - waiting on <0x38a13ac9> (a java.lang.Object)
    - locked <0x38a13ac9> (a java.lang.Object)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:503)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.join(QueuedThreadPool.java:391)
    at org.eclipse.jetty.server.Server.join(Server.java:413)
    at grails.plugin.dropwizard.GrailsService.start(GrailsService.java:131)
    ...

And finally you can GET the simple http://localhost:8081/dropwizard/ping URL to check that everything is functional:

pong

Application notes

Dropwizard typically loads resources from the classpath, so there are a couple of ways to make files available. You can put files in src/java or grails-app/conf and non-source files will be copied to the classpath. This can clutter up those directories though, so you might want to add in a new folder for these files. The sample application has a src/resources folder for this, and adds an event callback in scripts/_Events.groovy to ensure that the files are available:

eventCompileStart = {
   ant.copy(todir: buildSettings.resourcesDir,
            failonerror: false,
            preservelastmodified: true) {
      fileset(dir: 'src/resources') {
         exclude(name: '*.groovy')
         exclude(name: '*.java')
      }
   }
}

You can put banner.txt there if you want a banner displayed and don’t set the Config.groovy property, the YAML config file, Freemarker and Mustache template files, and static resources mapped with AssetsBundles.

As mentioned in the plugin documentation, serialization of domain classes doesn’t work. The plugin explicitly converts Person instances to and from PersonDTO instances (e.g. see PeopleDropwizardResource). GORM isn’t required, so you’re free to use regular POJO/POGO based persistence. There is a somewhat old dto plugin that may or may not help here.

All of the test application’s classes (resources, health checks, etc.) are written in Groovy and are in grails-app/dropwizard, but as described in the docs you can write them in Java and register them yourself rather than using convention-over-configuration and letting them be auto-discovered. Classes in grails-app/dropwizard support dependency injection (for example the dataSource bean in DataSourceHealthCheck), and can conveniently access Config.groovy values with the ConfigValue annotation (see TemplateHealthCheck for an example of this).

This Week in Grails (2013-08)

Wednesday, February 27th, 2013 4:09pm

Rob Fletcher released a new plugin this week for JSON serialization/deserialization using Google’s Gson library.

SpringOne 2GX 2013 has been announced, and it will be September 9-12 in Santa Clara, CA.

Tomas Lin created an interesting looking Grails template project on GitHub that is pre-configured for testing.


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 5 new plugins released:

  • casper-runner version 0.2. Runs functional CapserJS tests
  • goblin version 0.3.2. A browser game framework
  • gson version 1.0. Provides alternate JSON (de)serialization using Google’s Gson library
  • simple-suggestions version 0.1. Suggestion service to provide suggestions to auto complete controls
  • geasyui version 0.3. Supplies jQuery EasyUI resources and taglibs

and 12 updated plugins:

  • aws-sdk version 1.3.32. Use the Amazon Web Services infrastructure services
  • codenarc version 0.18.1. Static code analysis for Groovy
  • dumbster version 0.2. Adds support for the Dumbster SMTP server for testing
  • improx version 0.2. Use interactive mode from other process via TCP
  • jetty version 2.0.3. Makes Jetty the development time container
  • jquery-validation-ui version 1.4.1. Client Side Validation without writing JavaScript
  • kickstart-with-bootstrap version 0.9.2. Start your project with a good looking frontend, with adapted scaffolding templates for standard CRUD pages using Twitter Bootstrap
  • less-resources version 1.3.3.1. Compile .less files into .css files
  • localizations version 1.4.4.9. Store i18n strings in a database
  • plastic-criteria version 0.6. Mock Grails Criteria for Unit Tests
  • release version 2.2.1. Publishes Grails plugins either to a public or private repository
  • vaadin version 1.7.1. Adds Vaadin (http://vaadin.com/) integration

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-07)

Saturday, February 23rd, 2013 2:02am

The Groovy team announced three Groovy releases this week.

Check out this interview with Jeff Brown on Grails 2 and Groovy.

Several more Greach videos were released this week. Check out the sessions page and click through to each one to view its video.

Rob Fletcher announced this week that he will no longer be supporting a few of his plugins.

Stéphane Maldini suggested a new grails.org theme.

Programming Grails went to “production” this week, so it should be in print in a month or so.


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:

  • dumbster version 0.1. Adds support for the Dumbster SMTP server for testing
  • geasyui version 0.2. Supplies jQuery EasyUI resources and taglibs
  • recaptcha-spring-security version 0.1. Using recaptcha with spring security core for brute force defender

and 11 updated plugins:

  • build-test-data version 2.0.4. Enables the easy creation of test data by automatic inspection of constraints
  • coffeescript-compiler version 0.7. Compiles .coffee source files into .js files
  • cookie-session version 2.0.7. Allows you to store session data in a cookie
  • easygrid version 1.3.0. Provides a convenient and agile way of defining Data Grids
  • ember-templates-precompiler version 0.4.0. Precompiles EmberJS powered Handlebars templates
  • feature-switch version 0.7. Allows turning on and off of features
  • pretty-time version 2.1.3.Final-1.0.1. Displays human readable, relative timestamps
  • remote-pagination version 0.4.2. Provides tags for pagination and to sort columns without page refresh using Ajax and loads only the list of objects needed
  • spreedly version 0.1.7. Provides access to the Spreedly online payment service API
  • spring-security-facebook version 0.12.2. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin
  • underscore version 1.4.4. Simple plugin wrapper for useful Underscore.js library

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-06)

Monday, February 11th, 2013 10:33am

Several videos from Greach 2013 are now available on their YouTube channel.

Marc Palmer has announced that he will no longer be supporting any of his plugins (at least not for free). We’re looking into what makes the most sense for moving forward, especially for the more popular plugins like resources. Several of them will be moved to shared Github repos so the community can easily contribute. Be sure to check out his Kickstarter campaign and contribute so the outstanding issues in the resources plugin can get fixed.

There are two excellent looking Grails training opportunities coming up in the next few months. One starts this week and is a 10-week seminar at UC Berkeley. The other is a 2-day seminar in Boston April 22nd – 23rd.

The Groovy team is looking into updating the Groovy documentation and web site.

Check out these two interesting Groovy wiki pages: Advanced compiler configuration and Meta-annotations.

Season 2 of the Spanish-language Podcast de GrailsMX is starting soon. It sure would be cool to have an English-language Groovy and Grails podcast ;)


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 no new plugins released but 11 updated plugins:

  • aws-sdk version 1.3.30. Use the Amazon Web Services infrastructure services
  • cookie-session version 2.0.6. Allows you to store session data in a cookie
  • extjs4 version 4.0.7.1. Provides Ext JS 4 resources
  • jquery version 1.9.1. Integrates jQuery
  • routing version 1.2.3. Send and route messages to a wide variety of destination endpoints directly from your Controllers and Services using Camel
  • sham version 0.3. Uses the sham data generation library to generate test/demo data
  • sharding version 0.7. Defines multiple database shards to horizontally scale data
  • simple-blog version 0.3. Adds a simple blog interface to an application
  • spring-batch version 1.0.RC2. Provides the Spring Batch framework and convention based Jobs
  • spring-security-facebook version 0.12. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin
  • twitter-bootstrap version 2.3.0. Twitter Bootstrap CSS framework resource files

Interesting Tweets

Jobs



User groups and Conferences


This Week in Grails (2013-05)

Thursday, February 07th, 2013 8:12pm

Check out Cedric Champeau’s detailed overview of how to work with invokedynamic in Groovy.

Do you want Cedric to write a book on Groovy in French? If so, retweet this to let him know.

There is only about one week left to submit talks for the EU and US GR8Conf conferences – the deadline is February 15th.


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 no new plugins but 8 updated plugins:

  • coffeescript-resources version 0.3.5. Create coffeescript modules that automatically compiles on every file change with jCoffeeScript
  • cxf version 1.1.0. Expose Grails services as SOAP web services via CXF
  • excel-export version 0.1.4. Export data in Excel (xlsx) format using Apache POI
  • google-visualization version 0.6.1. Provides a taglib for the interactive charts of the Google Visualization API
  • greenmail version 1.3.4. Provides a wrapper around GreenMail and provides a view that displays ‘sent’ messages – useful for testing
  • gvps version 0.4. Host, manage and display video assets, and convert standard movie formats to the Flash movie format FLV
  • localizations version 1.4.4.8. Store i18n strings in a database
  • uploadr version 0.6.1. HTML5 Drag and Drop file uploader

Interesting Tweets

User groups and Conferences


This Week in Grails (2013-04)

Sunday, February 03rd, 2013 1:10pm

Greach was this week and it was great. It was my first time visiting Spain, so that was an added bonus. The Spanish Groovy and Grails community is apparently thriving, and the attendance was about the same as Groovy & Grails Exchange and GR8Conf, if not higher. There are already some blog posts up and several speakers have put their slides online:

The Groovy team released Groovy 2.1 this week (and made the announcement live during Cedric’s keynote at Greach). Groovy now has full support for invokedynamic, which promises huge performance increases. Note that the 2.1 release notes currently don’t describe how to use the “indy” jars; see the 2.0 release notes for that information.

Andre Steingress released a few blog posts describing some new features in 2.1:

Gradle 1.4 was released this week. There is a description of the plans for 1.5 here, and you can see a short video overview of the 1.4 highlights here.

Marc Palmer’s resources plugin Kickstarter is now live. Nearly everything you use for Grails development is free (except for IntelliJ Ultimate if that’s your IDE of choice) but real people do the work to provide you with Grails and the plugins and tools you use daily. It would be great if we were all paid to do this work (I’m very lucky that I am) but we’re not. The project us currently funded at 10% so contribute soon.

Cedric Champeau’s talk on type checking extensions at Greach was very interesting, and he’s added some documentation for the feature. Check out his slides and the video of the talk when it’s available.

There are only two weeks left to submit talks for the EU and US GR8Conf conferences – the deadline is February 15th.


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 no new plugins but 18 updated plugins:

  • audit-trail version 2.0.3. Adds created/updated audit fields to domain classes and updates them after a new insert or update
  • backbonejs version 0.9.10.3. Provides resources for Backbone.js http://backbonejs.org/
  • coffeescript-compiler version 0.6. Compiles .coffee source files into .js files
  • cxf-client version 1.5.0. Use existing (or new) Apache CXF wsdl2java generated content to invoke SOAP services
  • dojo version 1.6.1.16. Integrates the Dojo javascript toolkit
  • ember-templates-precompiler version 0.3.0. Precompiles EmberJS powered Handlebars templates
  • events-si version 1.0.M5. Standard Events system for Grails implementation; it is a Spring Integration implementation and uses its artefacts to map listeners, senders and events messages
  • feature-switch version 0.6. Allows turning on and off of features
  • flash-helper version 0.9.5. Simplifies and standardizes the process of adding/reading messages in the flash scope
  • font-awesome-resources version 3.0. Integrates the Font Awesome icon set
  • html5-mobile-scaffolding version 0.5. Scaffolds HTML5 mobile application using jQuery mobile in a single page
  • jetty version 2.0.2. Makes Jetty the development time container
  • lesscss-resources version 1.3.1. Optimises the use of http://www.lesscss.org css files, compiling .less files into their .css counterprt, and place the css into the processing chain to be available to the other resource plugin features
  • quartz2 version 2.1.6.2. Integration with Quartz 2 framework from quartz-scheduler.org
  • spring-security-facebook version 0.11. Plugin for Facebook Authentication, as extension to Grails Spring Security Core plugin
  • underscore version 1.4.3. Simple plugin wrapper for useful Underscore.js library
  • vaadin version 1.7.0-rc2. Adds Vaadin (http://vaadin.com/) integration
  • yammer-metrics version 2.1.2-4. 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.