Grails

Grails: reverse url mapping to generate urls ending with “.html”

In this blog Reverse Url Mappings has been used to generate the URL ending with .html, given controller and action names.

Amit Jain
Amit Jain
Read

Technology

Fetching the last day of the month

Note: Months are from 0 to 11. Hence the 7th month is “August” Calendar calendar = GregorianCalendar.instance calendar.set(2009, 7, 21) println “Last Day of a Month: ${calendar.getActualMaximum(GregorianCalendar.DAY_OF_MONTH)}” Cheers!!! ~Chandan Luthra~ chandan@intelligrape.com www.intelligrape.com

Grails

Grails: caching using cron jobs

Grails : Caching using cron jobs i.e using quartz plugin. As with grails 1.1.1 plugin springcache plugin didn’t work.

Amit Jain
Amit Jain
Read

Technology

Alfresco : Render html code written in tinymce

Write and render your html code written in tinymce. It allows user to used any html tags like we can copy embed tag from youtube and paste in our tinymce. and that video can be visible on our webpage along with the text entered in tinymce.

Amit Jain
Amit Jain
Read

Grails

WordPress plugin : workaround to get excerpt of recent posts & only published messages

While integrating the blogs using wordpress plugin in one of the project I am working on. I observed that using current version(0.1) of wordpress plugin, when we request for recent posts, it returns not only published blogs but also blogs with status as draft(which are not yet published). Along with that, we needed to show […]

Amit Jain
Amit Jain
Read

Grails

Accessing Session Map in the Domain or Service Layer

The Session Map is available in Grails in the Views, TagLibs and the Controllers. That is, it can be directly accessed by the name “session”. If the Session Map is required to be accessed in the Service Layer or the Domain layer, such a straightforward approach will not work. In this case, a class which […]

Grails

Command Objects

What is a command object ? Command object is a non persistent class used for data-validation. The main advantage of using the Command objects is that we can validate those forms that do not map to the domain class. Where to define command object ? You can define command classes in the grails-app/controllers directory or […]

Grails

Grails : Mutliple Paginations Using g:paginate tag

In my project, we needed a support for multiple paginations on the same page. For the same, we maintained the state of offset of different pagination tags and let tag use its specific offset rather than the general i.e from param.offset. Assuming, we need two paginations on the same page. Lets assume the scenario where […]

Amit Jain
Amit Jain
Read

Grails

Grails Functional Testing: Uploading a file using G-Func plugin

At Intelligrape we face many challenges while developing web-applications. One of the small challenge was to test the web pages that contains file input field <input type=”File”>(to upload files). After few hours drilling with Canoo webtest plugin I decided to use the new fabulous plugin, Grails functional Testing by Marc Palmer (http://www.grails.org/Grails+Functional+Testing). The syntax for […]