• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Grails and Excel

 
Greenhorn
Posts: 9
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 686
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the "almost" for?
 
Peter Ledbrook
author
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good that you told me. Never knew about these things!! I always though all Java code works
reply
    Bookmark Topic Watch Topic
  • New Topic