Playing with Grails application configuration

This small tutorial will show how to create a configuration file and how to manage configuration of your Grails application. It will show how to Access configuration parameters Create external configuration Configure Spring for different environments Create a new environment Accessing configuration parameters The configuration of Grails is stored in grails-app/conf directory. Parameters are stored… Continue reading Playing with Grails application configuration

Grails: internationalization in the service

Today I spent some time by creation of localized messages in a service. Here is a small tutorial. 1. Create your service grails create-service Local 2. Add a messageSource variable to your new service class LocalService { def messageSource } 3. Use it in a service method // Initialize parameters Object[] testArgs = {} def… Continue reading Grails: internationalization in the service

Custom iterative tag in Grails with named variable

I will show you how to create an iterative Grails tag that can contain another tag. The inner tag will use variable of the iterative tag. So, we are going to implement a tag that creates n links ‘/show/1’, ‘/show/2’, etc. with description ‘Article number 1’, ‘Article number 2’ etc.: First of all, there is… Continue reading Custom iterative tag in Grails with named variable

From Mysql to Oracle: Grails application migration

Today I have finished migration of our Grails prototype. Originally we did develop it for MySQL, but the final system have to work with Oracle. This post summarize troubles and differences I was facing. User creation Since I am not Oracle administrator, it took me some time to put together script that creates user and… Continue reading From Mysql to Oracle: Grails application migration

Ignore files in subversion

This is just a simple procedure how to tell subversion to ignore files or directories. cd parent_directory # Check the current setup svn proplist -v . # set the editor to edit the properties export EDITOR=vi # open up editor with the properties svn propedit svn:ignore . Text editor opens (vi in my case) Here… Continue reading Ignore files in subversion

Bayes classification in Ruby made easy

Recently I was experimenting with ruby bayes classification. At first sight it looks like a difficult topic, but with the right libraries it is interesting and funny. Before you start experimenting, you have to install 3 gems. gem install classifier gem install madeleine Confirm the required stemmer gem. For the beginning, lets experiment with the… Continue reading Bayes classification in Ruby made easy