File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Grails basic begginer questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Grails basic begginer questions" Watch "Grails basic begginer questions" New topic
Author

Grails basic begginer questions

jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Hi guys.... Im at the point in grails that I have the "hello world" application working. But now I'm wondering.... what if I don't want any of the default "CRUD" stuff.... all my CRUD is, of course, specific to my business logic.

Is there a "hello world" application out there for grails that doesnt simply autogenerate a form for every table in my domain ? I need, like most developers, the ability to build custom pages without relying on google searching for templates ! Help !

How do I CUSTOMIZE grails to do more than CRUD ?

Thanks !
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Write some controllers, commands, views, etc. that do what you want?

What specifically are you having an issue with?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

No domain required for following code...





GenRocket - Experts at Building Test Data
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

You don't customize Grails to do more than CRUD.
Grails help you to create CRUD for your domain entities but it isn't Grails only mission.
Grails after all is MVC based framework (like Stripes, Struts2 ..), do what ever you want, your keyboard is only the limit
jay vas
Ranch Hand

Joined: Aug 30, 2005
Posts: 407
Great thanks I think my weakness is that I don't know Groovy, and thus, I cannot do Grails.

I believe that, at least in my experience, you REALLY need to understand GROOVY before you can do anything regarding grails.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I didn't find that to be the case at all; for me it was more important to understand Spring and Hibernate so I could understand what was happening when things went awry.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I am with the OP, these products that create your CRUD, while they try to say unobtrusive so you can change it, it really isn't. I have tried a few already, and I always have major customization and I get a few done, but then there is always something that can't be done, or is very tightly coupled, so changing it is a real pain and you always forget something, so it take a real long time.

I am trying Grails right now, I just finished using Spring Roo, which is really cool, but again, when I got to the web layer, I couldn't figure out how to pull it out of the basic CRUD pages, because I needed to make better one to many pages etc. However, I think that problem will be easier with Grails since I have seen some of the one to many stuff and while not perfect for how I want, seems closer.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

But that's more of a Grails issue; my point was only that you don't really need to know much about Groovy to create non-CRUD controllers, as the previous poster posted an example of.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

First thing I do when/if I generate controllers and views is get rid of the pointless show view and remove the ID columns from the list views. Also, if you come up with something you like dealing with one-to-many crud screens, you can always create your own templates that Grails will use to generate your views, that way you don't have to customize them for every project.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

BTW Mark, when you get to the point where you are trying to save the many side via indexed properties in your forms, ping me. I just went through a bunch of that today and got it all worked out. Planning a dzone article on the subject. The premise is I'm creating an Event and I want to add a bunch of Reminders to the event but I don't want to save them one at a time and I don't want to have to save the Event then go back and fill out Agenda forms. There's just a few gotches that I am going to write up.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Yes Gregg, I would like to read your post soon.
Hope you will find time to write.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

John Todd wrote:Yes Gregg, I would like to read your post soon.
Hope you will find time to write.


Done..

http://groovy.dzone.com/articles/grails-persisting-indexed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Grails basic begginer questions
 
Similar Threads
Grails ready for enterprise world?
Grails and legacy database
why should one count on groovy and grails rather than java
acegi security plugin, Person and one of my domain objects
* Welcome Jon Dickinson