Posts

How to enable Grails application to send SMS via Twilio API

Image
How to send SMS with Grails Application via Twilio   Are you trying to send text messages from your Grails web application? If your answer is Yes then you are in luck. If your answer is No .. well... stick around... you'll learn something.  Target audience: People interested in software development, Grails framework and Groovy programming language. This article may be more interesting if you already know Grails framework.  What you need: A twilio account with your API keys The grails-twilio plugin Your grails application ( Grails version 2.x and above ) To create a twilio account, please visit  http://www.twilio.com . Copy your API Keys The twilio-grails plug-in provides sms sending capability to a Grails application via twilio api. Configuration Add twilio plugin Depending on what version of Grails you are using, open your buildConfig.groovy file or build.gradle file and add the following line. compile "org.grails.plugins:twilio:

How to accept PayPal payments on Grails

Image
How to accept PayPal payments with Grails Application. Introduction to Paypal payments plugin. The Paypal payments plugin simplifies the integration of Paypal with Grails applications.   Grails is a web framework for developing web applications and a plugin is a module that can be easily installed to add specific features to your application. Modules/Plugins are usually designed to accomplish a specific task.  Who should read this? Anyone interested in how to integrate paypal with a Grails application.  What you need A Paypal developer account with your API keys Grails paypal payments plugin Grails Application ( Version 2.x and above )  If you do not already have a Paypal developer account please visit  https://developer.paypal.com/developer/accounts/  to get one.  The paypal-payments plugin will provide the features required to interact with the Paypal API. You do not need to be a paypal payments guru to use Paypal.  A Grails ap

Grails and Hibernate: Saving emoticons ( unicode ) to MYSQL.

Image
We built a  Grails  application that uses a mail plugin, to send and retrieve emails from mail servers. The plugin employed a scheduled job to retrieve and store the emails on a MySql database table. Initially everything worked as specified until recently when I noticed that some mails were not saved to MYSQL. The error message from MYSQL was 'incorrect string value' bla bla bla.... On close examination, I noticed that the troublesome emails contained emoticons (unicode characters). The unicode characters were responsible for my troubles :( The issue I dug through the MySQL documentation and learnt that my MySQL instance was having a hard time accepting those unicode characters because the database encoding was set to "utf-8". Solution To solve the problem required a change of the mysql default encoding from "utf-8" to "utf8mb4" . Note :We used a MySQL version of 5.6.13 but this solution will also apply to MySQL ve

How to upgrade Grails 2 applications and plugins to Grails 3

Image
How to upgrade Grails 2 applications and plugins to work with Grails 3  The  Grails  framework is a web framework  for developing dynamic websites. It has been recently upgraded to version 3.0 and the upgrade has introduced breaking changes. According to the grails documentation, Grails 3.0 is a complete ground up rewrite of Grails and introduces new concepts and components for many parts of the framework. The 'rewrite' part means that a lot has changed, including class packages. This means that your plugin will break if it imports any of the Grails API packages that have been moved. Although the Grails documentation provides a guide for upgrading applications and plugins, it does not provide information about all the Grails API package changes. To save software development time, please find some of the package changes below. Grails 2 Grails 3 org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap grails.web.servlet.mvc.GrailsParameterMap org.cod

Parsing and binding date formats from params in Grails.

Image
" Grails is a powerful web framework for the Java platform aimed at multiplying developers' productivity" - grails. We recently decided to rewrite some parts of our software  ( written in grails )as web applications.  The reason we made that decision is something I hope to write about soon. The task required us to send JSON strings (POST request) that contain datetime information along with other bits for data to the server.  To bind a date string from the 'param' seamlessly ( without writing extra code to extract the date in your controller) you need to add the following to your grails config file ( config.groovy or application.yml ). grails.databinding.dateFormats = [ "yyyy-MM-dd'T'HH:mm:ss.SSSXXX", "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ,'yyyy-MM-dd HH:mm:ss.S','MMddyyyy' ] With the above configuration in place, there was no need to extract the date and bind it manually to the domain class or comma

Insights on Systems Dynamics & Its Relevance in Sub-Sahara Africa (SSA)

Image
Dr. Mathias M. Fonkam, Damian Feese, Felicia Ikwu, Ama Oruomabo, Omasirichukwu Udeinya 1.       Introduction  Systems dynamics is an offshoot or specialization of systems thinking that emphasizes the special role of computer simulation for understanding the dynamic complexity that is an intrinsic part of most management type problems and finding leverage points within the system from which fundamental, long lasting interventions might be effected with a hope to improving the problem situation. Both represent a paradigm shift from the traditional scientific method. The scientific approach to complexity is reductionist by nature since it prescribes breaking complex problems down into their parts with the hope that an understanding of those parts, or indeed a solution to the sub-problems they represent, can be assembled for the whole. Like systems thinking,  systems dynamics is a holistic approach to complexity that emphasizes the importance of the connectedness between the componen