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.
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 […]
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 […]
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 […]
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 […]
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 […]
I have recently started using the marvelous plugin Grails function Testing by Marc Palmer (http://www.grails.org/Grails+Functional+Testing).I would like to share few things with you about this plugin. The purpose of testing get defeated if we keep on doing for the same values. The method below let you to do it for the different values each time. […]
In this use case we are using the jamesDump.sql stored at /home/gaurav/Desktop/jamesDump.sql file to create a new database named intelligrape. First of all we need to login to the mysql prompt. gaurav@gaurav:~$ mysql -u root -p Enter Password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is […]
In this post i will try to explain how to dump a mysql database so that it can be migrated with same state.In my project i face this situation every week and thanks to dumpfiles that they save lot of time and make the process whole lot easier. What is a dumpfile ? A dumpfile […]
Lets discuss how can we upload a file and store it in a database, along with that how do we render it on the gsp page. I am taking an example to upload and render the image in this blog, though the code would be same for any other file. So Lets consider I have a […]
I want to quickly share how you can sort a Map by its key/value/field of valueObject; in either ascending or descending order using Groovy I created a Map<String, Person> as follows: class Person { String name Date dateOfBirth static constraints = { } } Map people = [:] [*(11..20), *(1..10)].each { Person person = new […]
Often I found it painful working on dates when I had to find a past/future date based on weeks, months or years. Groovy class org.codehaus.groovy.runtime.TimeCategory has very helpful & intutive syntax for working on dates. I am sure I need not to explain what each of the following statements will do: Date date = new […]