Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Grails and Excel

 
cj pangilinan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Glen and Peter,

I have an application that do motly excel parsing. It is currently written in jsp+ servlets. Can you guide me how to migrate my application in grails. One of the problems I see is the excel part. DOes grails have API in Excel files processing. Getting the number of sheets for example, using ajax to prompt the user the available sheet names. Something like that. I hope you can give me at least an overview or a step by step guide. Thanks.
 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cj,

Why do you want to migrate ? Grails is a domain model centric framework. From your description it does not look like your application has much of a domain model. In case you just want to dabble in the technology, see getting started guide on groovy site or you can follow "Mastering Grails" series on IBM developerworks site

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DOes grails have API in Excel files processing.


Groovy is build on Java, and can use existing Java libraries. So if you currently have servlets and JSPs that use a Java API to process Excell documents, then you can do the same with Groovy. Look in the Groovy documentation on how to access Java classes. (Grails is basically a web framework for Groovy.)
 
cj pangilinan
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answers. I just want to know grails and while learning, i want to use my existing application as a sample.

So if I use the Excel API that I am using in Java, I have to code in Java also? or Is it better to use Groovy?
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it will be the same code!!! but in Groovy you might be able to use certain features to reduce the complexity

Ref:
http://josh-in-antarctica.blogspot.com/2008/03/grails-excel-file-upload.html
http://josh-in-antarctica.blogspot.com/2008/03/grails-excel-file-download.html
 
Peter Ledbrook
author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'd just like to back up Vyas' answer. If you have an API in Java, you can very easily use it from Groovy too. And remember that almost all Java code is valid Groovy.

Cheers,

Peter
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the "almost" for?
 
Peter Ledbrook
author
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless things have changed recently, Groovy is missing:

1. support for anonymous or inner classes
2. the do...while loop
3. support for multiple variables in the standard Java for loop.
4. character literals

Character literals should work as string literals in most cases, since Groovy will coerce the string to a char. It wouldn't surprise me if there are some cases where that coercion doesn't occur.

Cheers,

Peter
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good that you told me. Never knew about these things!! I always though all Java code works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic