TO THE NEW Blog PAGES

Grails

Ecommerce site development with Magento

IntelliGrape recently started its new vertical of e-commerce sites development using Magento. Our ethos has been on choosing a leading technology/platform for whatever we do – be it custom web development or mobile apps development or ecommerce site development using packaged solution. Also, emphasis is not only on choosing a great technology but also be […]

Grails

Groovy HTTP builder for sending multipart file.

I had two applications that communicate with each other through web-services. There I had a requirement to send multi-part file from one application to another. After searching I came out with the following solution and thought to share: [java] import org.apache.http.entity.mime.MultipartEntity import org.apache.http.entity.mime.HttpMultipartMode import org.apache.http.entity.mime.content.InputStreamBody import org.apache.http.entity.mime.content.StringBody import groovyx.net.http.* void sendMultiPartFile(CommonsMultipartFile multipartImageFile, String cityName) { […]

Divya Setia
Divya Setia
Read

Technology

Common JSP/HTML & Javascript Problems

Some of the commonly faced problems are: 1) In case we give different width combinations for cells of different rows, the width combination of first row is accepted and subsequent combinations are neglected. [html] <tr> <td width="30%">1.1</td> <td width="50%">1.2</td> <td width="20%">1.3</td> </tr> <tr><td width="50%">2.1</td> <td width="40%">2.2</td> <td width="10%">2.3</td> </tr> [/html] In this case width of […]

Grails

Cool Spock Ignore/IgnoreRest annotations

While writing a test case, we are generally interested in executing only the one we are working on. With JUnit test case in grails we could say “grails test-app <ClassName>.<currentTestCase>”.  However it doesn’t work with spock specification’s. Spock framework provides multiple cool annotations,  following two annotations can be used to speed up writing/executing test case […]

Amit Jain
Amit Jain
Read

Grails

Applying Validation Constraints in Classes other than Domain classes and Command Objects

We usually specify validation constraints in domain classes and command objects. But, if it is required to provide validation in other classes(like classes in src/groovy), we can do so in two ways : 1. Defining a static constraints property in the class and using the @validateable annotation. 2. Defining a static constraints propery in the […]

raj
raj
Read

Grails

Appending anchor tag to the url on server side using fragment parameter in Grails

Hi, Recently I had come across one of the cool grails redirect parameter named ‘fragment’ providing cool feature of forming relative link with an anchor tag/name. Generally, we can simply call [groovy]window.location.href=http://yourLink#anchorName[/groovy] It will focus you to the anchor name specified in relative link means scroll the page to the anchored tag who’s anchor name […]

Grails

Modify tinymce image/link dialog content in grails

Recently in a project i used tinymce where i needed to modify the image/link dialog of tinymce. To modify tinymce firstly make it inline/custom plugin means download and paste in javascript folder. To modify image dialog , create a gsp that you want to show in dialog box and paste in [java] /web-app/js/plugins/tinymce/jscripts/tiny_mce/plugins/advimage [/java] I […]

Shaurav
Shaurav
Read

Grails

Using Modules to avoid structures repetition in Geb Test Pages

Using modules in Geb testing can help to avoid repetition of same code/ sections in Geb test pages. In this blog I want to talk about repeating data structures such as tables and how to avoid this repition by modelling them.In Geb testing if there is some content which is used in multiple pages then […]

Gunpreet
Gunpreet
Read

Grails

Using PostConstruct annotation with Grails Services

We can use PostConstruct with Grails Services and injected Spring Beans. This PostConstruct annotation can be used to annotate a method which needs to be executed after dependency injection to perform any initialization. [code] import javax.annotation.PostConstruct class PostConstructDemoService { @PostConstruct private void init() { println "Initializing" //your initialization code goes here. e.g connect to some […]

Grails

Evaluating Expressions with groovy.util.Eval

A few days ago I faced a problem of evaluating dynamic expressions on domain objects. The scenario was that, depending upon the user input, I needed to sort a list of objects on some properties, which were nested deep in the object, e.g., [java] student.course?.college?.name // if a user chose to sort students by college […]

Imran Mir
Imran Mir
Read

Technology

Smart way of focussing a text input on page load for heavy pages

Let’s say you have a login page which contains a form with username and password field in it (offcourse, along with a submit button). Let’s say being much focussed towards user convenience with the user interface, you want to put the cursor in the username field of your form as soon as the page loads. […]

raj
raj
Read

Grails

New Features in Try/Catch – JDK 7

In our applications we generally make use of try-catch blocks to handle exceptions. Since JDK-7 , It has certain new features. These features are quite good , I must say. Some of the new changes in try/catch bloack are : 1.  Multiple exceptions handling in only one catch block. 2.  Finally out of scope. (Try-Catch […]

Robin
Robin
Read