tag:blogger.com,1999:blog-90004656530324512312024-02-02T13:36:14.930-08:00Srinivas Guthula's Blogtechno diarySrinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-9000465653032451231.post-72022957707592926982022-09-01T15:44:00.003-07:002023-01-02T20:23:15.436-08:00AWS API Gateway - Handling CORS errors AWS API Gateway Console provides a simple mechanism to enable CORS and handle Cross-Origin browser requests to REST Apis/ Services. You may select any "resource" in the API Management console and select "Enable CORS" from the "Actions" Dropdown. You may expect this feature would be simple click and forget solution but you might still encounter CORS issues when you make API request Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-34341071071183315232022-06-03T05:32:00.005-07:002023-01-02T20:20:26.256-08:00Navigating the log files Often you may find yourselves in the middle of searching for a keyword in your log files. On the linux environment , you will easily find by using the command grep 'your keyword' filename.logSometime you may want to know what happens before and after the occurrence of your keyword. In the example below I tried to look for an exception Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-13549087201207348882011-05-17T05:14:00.000-07:002011-05-19T23:42:32.827-07:00Grails - Querying complex associationsCriteria class allows performing complex searches on grails objects. There are number of shortcut methods for performing queries but these methods have limitations in terms of number of conditions used in "where clauses". Traditional sql "joins" are not possible as shown in some of the Grails "Finder" methods shown below.Sample 1: def list = Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com4tag:blogger.com,1999:blog-9000465653032451231.post-41333476204406134312011-05-14T05:23:00.000-07:002011-05-17T05:13:20.417-07:00Implementing advanced sort in GrailsThe "list" pages generated by inbuilt scaffolding/template features of grails have pagination and sorting features. However, if the domain object displayed in the list is a nested object having another domain object as a property, you may notice that sort is not enabled for that field. Boiler plate code for the header of the list is shown below.Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com2tag:blogger.com,1999:blog-9000465653032451231.post-19932192252399354842011-04-25T06:49:00.000-07:002011-05-01T03:36:33.644-07:00SVN - Version control system on Amazon EC2There are number of hosted SVN providers who offer hosting services along with add-on services like project management, bug tracking etc. If your requirement is purely to host the version control system we may end up paying little bit premium for the add-on services. The charges tend to increase when your storage requirements increases. You may compare the prices offered by Unfuddle and Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-88363576083416577282011-01-02T12:20:00.000-08:002011-01-02T12:37:45.093-08:00CCAvenue and Magento IntegrationIndia based e-commerce portals have to consider CCAvenue Payment Gateway as one of option for its simplicity and reliability. Magento e-commerce platform has several ready to use payment gateway plugins and a rich set of API to enhance its functionality to add new payment gateways that are not provided as part of its standard release. For one the projects we have to integrate Magento with Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com8tag:blogger.com,1999:blog-9000465653032451231.post-35441604533420281842010-12-02T01:26:00.000-08:002010-12-02T01:43:55.030-08:00Cheap Grails hostingWe can use Amazon EC2 micro instance (~615mb RAM) to run grails application with Tomcat and Mysql. If you need higher JVM memory, we can try to keep the memory footprint low by using memcached or ehcache. The price is nearly $5/month if you commit for a one year contract. Since November this year, this service is offered for free for the first year for new customers. If your server server load isSrinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com2tag:blogger.com,1999:blog-9000465653032451231.post-61475309231277141962010-10-12T21:11:00.000-07:002010-10-13T06:25:05.807-07:00Partial page loading with Grails and JqueryMost web applications greet their users with a fancy dashboards to display various statistics of interest. The generation of dashboards are often resource consuming and therefore it is advisable to optimize the page loading time. One option is to display page content while showing certain parts of the page in loading state. In this tip, this is achieved by partially loading parts of the page by Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com2tag:blogger.com,1999:blog-9000465653032451231.post-36839570397826223002010-10-11T19:28:00.000-07:002010-10-12T22:00:53.052-07:00jqgrid grails : editing rows with drop-downs/combo boxesJqgrid is a jquery plugin that allows formatting data as table and has number of options - paging, sorting, filtering, inline editing etc. There are few good tutorials explaining the process to integrated jqgrid in your grails application.http://pramodnepal.com.np/?p=119http://www.grails.org/plugin/jqgridFollowing is a typical jquery script that can be used in a grails application. The property 'Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com3tag:blogger.com,1999:blog-9000465653032451231.post-42121907415437794232010-06-06T15:48:00.000-07:002010-08-15T05:33:31.336-07:00Partial form submit with Grails and JQueryAt times you would want process a part of the form and refresh the page with the results obtained from the partial form submission. Given below is a screen shot of the typical use case. It is a form used in a sales application. Take a look at the section "Particulars" in the screen. The fields - Item, Unit Price, Quantity, Discount%, Tax% are editable and fields - Total Discount, Total Tax and Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com3tag:blogger.com,1999:blog-9000465653032451231.post-34844044543972895992010-05-09T04:12:00.000-07:002010-08-15T05:04:45.427-07:00Grails - Import data from excel spreadsheetsImporting data from excel spreadsheets to a grails application is quiet simple. You could your favorite spreadsheet processing libraries for Java like Jexcelapi or Apache POI. In this example, I used Apache POI.Step1: Copy the required libraries to libraries/lib folder of your grails applications.Step2: Create a grails controller class. Eg: Uploaderdef upload={ def file = request.getFile(Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com1tag:blogger.com,1999:blog-9000465653032451231.post-18942575545558905782010-02-10T12:32:00.000-08:002010-06-21T11:26:28.088-07:00Clicktale with Blogger/ BlogspotI am curious to know how visitors are finding my blog content. I heard lot of good things about this tool, Clicktale, and I implemented for my blog. Just two steps to get started:1) Create an account with Clicktale and get the tracking code for your domain. I used http://sguthula.blogspot.com as domain. The instructions to get the tracking code are simple and easy to follow.2) Login to your Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-42032683076962466702010-02-10T04:39:00.000-08:002010-08-15T05:15:17.499-07:00Overlay Graphs in Grails Application - Open Flash ChartOfchart plugin available for Grails, makes it is easy to integrate Open Flash Chart. The plugin can be downloaded from http://grails.org/plugin/ofchartThe documentation is available athttp://mybytes.wordpress.com/2009/03/09/grails-open-flash-chart-06-is-out/ Though the Open Flash Chart has number of chart options - ofchart plugin documentation has limited information. I believe the documentationSrinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-48247306652766758732010-02-02T08:45:00.000-08:002010-06-21T11:27:21.398-07:00How software project development teams slip deadlines?Poor quality of the project estimation is often attributed as the main reason for missing deadlines in most of the software projects. Slipping deadlines is most common and even management teams anticipates this event and accordingly negotiate pricing with their customers. As this happens to be "known Risk" and corrective actions are taken upfront, the people involved in the wrong estimates are Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-40456349969353529942010-01-20T02:40:00.000-08:002012-02-06T23:11:10.008-08:00Bind Exception, Netbeans 6.7.1 and Jetty server running Grails applicationsWhile developing Grails applications on Netbeans IDE 6.7.1, I noticed an issue with the inbuilt servlet container, Jetty that is packaged with Netbeans IDE. Sometimes, Jetty server wouldn't stop even if we stop from the "Services" tab of the Netbeans IDE. It might show that it is already stopped under the "Services" section while it is still running in the background. Any attempts to Run the Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-87057112396379164412009-11-02T10:22:00.000-08:002010-08-15T05:28:25.668-07:00Paging techniques for applications using google appengine for javaPaging technique is implemented in tons of websites and there are many libraries, both opensource and commercial components, that are easy to integrate into any website. Ajax based tables (excel like) with navigators for paging to and fro, are integral part of RIA applications. Why do we need a different technique to implement paging for Google appengine application when so many components existsSrinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com3tag:blogger.com,1999:blog-9000465653032451231.post-75055143553515120752009-10-30T13:52:00.000-07:002010-06-21T11:28:18.505-07:00YSlow - Grade A - may not equate to a high performance websiteYSlow, an add-on plugin for Firebug, a must have tool for all web developers concerned about performance of their website. As shown in the picture below, analysis using Firebug reveals all the the performance bottlenecks. YSlow, add-on plugin used along with Firebug, gives more detailed analysis and suggests useful tips to improve the performance. It has a grading system on a scale of A to F, A Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-63696075053200870172009-10-28T01:58:00.000-07:002010-06-21T11:28:39.766-07:00Amazon's RDS - Performance?Majoriy of the typical application design warrants an Application server and database servers. The application servers interact with database server instance using connection/pooled connections. The interaction between app server and database server is highly I/O intensive and performance is good when these two instances(App server and DB) are on the same physical server or atleast better when Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-34138478152175079902009-10-25T22:23:00.000-07:002010-06-21T11:29:10.670-07:00Grails - cross-field Date validation - Method using controllersIn continuation of my earlier post on the cross-field date validation , I'm going to discuss another method using grails controller.The following code in "save" and "update" method of the controller validates the date fileds used in the student domain object that is discussed in the previous postdef save = { def studentInstance = new Student (params) if (studentInstance.endDate.before(Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-42385297586425340102009-10-17T19:47:00.000-07:002010-06-21T11:29:39.021-07:00Grails - cross-field Date validationOften we run into domain classes with date fields. If the domain class has two datefields, startDate and endDate, and the rule for a valid combination is "endDate to be greater than startDate", how do we handle?I listed below two of the options, either using domain level constraints or using the domain classes.Option 1: Using domain constraints.Let us take a sample Grails Domain classclass Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com5tag:blogger.com,1999:blog-9000465653032451231.post-74103337210598227232009-10-10T06:18:00.000-07:002010-06-21T11:30:03.560-07:00Grails - Jsecurity(Shiro) plugin usageJsecurity plugin for grails simplies some of the tasks related to application security.Ref: http://grails.org/JSecurity+PluginIf installed correctly, it installs few domain classes and an AuthController in your application.This topic will be helpful if you have successfully installed the jsecurity plugin and trying to explore more about the usage.The following domain classes are added.1. Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-83045665273699246712009-10-07T03:02:00.000-07:002010-06-21T11:30:37.710-07:00Grails - replacing g:datepicker with gui:datepickerA typical datepicker code that is generated for your domain classes is shown below:<g:datepicker name="dateOfJoin" value="${objInstance?.dateOfJoin}" />Note: This code is autogenerated when you choose to create Controllers and Views by running the grails command "generate-all" for any domain class.It displays the Date, Month, year drop downs. Also it shows Drop downs to select Hrs and Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0tag:blogger.com,1999:blog-9000465653032451231.post-12261519032863808892009-10-06T04:40:00.000-07:002010-06-21T11:30:54.475-07:00grails - formatDate tag issue handling null dateI noticed an issue with the formatDate tag.It displays current date when the date passed is a null object when used in the gsp page. The default date is rendered along with timestamp when the gsp pages are generated using grails commands generate-views or generate-all for a domain class. The views (list.jsp and show.jsp) generated for the domain class contains the following code fragment. (Srinivas Guthulahttp://www.blogger.com/profile/01785291211359686396noreply@blogger.com0