Scaffolding Phase 2 Complete

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Scaffolding Phase 2 Complete

graemer
Next step of scaffolding is now in place. for Example create a domain
class User.groovy like:

class User {
        @Property Long id;
        @Property Long version;

        @Property String login
        @Property String password
        @Property Date dateOfBirth
        @Property String firstName
        @Property String lastName
       
        @Property constraints = {
                login(length:5..15)
                password(password:true,length:5..15)
    }

}

Then create a controller like:

class UserController {
    @Property scaffold = true
}

Then go to:

<a href="http://localhost:8080/%PROJECT%/user/list">http://localhost:8080/%PROJECT%/user/list

You will now have a little interface to do CRUD operations on class
User. Few things are not implemented yet:

- creating of one-to-many relationships ( one-to-one and many-to-one work fine)
- interlinking between scaffolded classes on the interface
- umm i'm sure i'll think of more later

Anyway getting close to a release now

Graeme
Reply | Threaded
Open this post in threaded view
|

Re: Scaffolding Phase 2 Complete

graemer
Oh and forgot to mention you might wanna try create the below domain
class and then do:

grails generate-controller

and

grails generate-views

or

grails generate-all

to do both.

Graeme

On 17/02/06, Graeme Rocher <[hidden email]> wrote:

> Next step of scaffolding is now in place. for Example create a domain
> class User.groovy like:
>
> class User {
>         @Property Long id;
>         @Property Long version;
>
>         @Property String login
>         @Property String password
>         @Property Date dateOfBirth
>         @Property String firstName
>         @Property String lastName
>
>         @Property constraints = {
>                 login(length:5..15)
>                 password(password:true,length:5..15)
>     }
>
> }
>
> Then create a controller like:
>
> class UserController {
>     @Property scaffold = true
> }
>
> Then go to:
>
> <a href="http://localhost:8080/%PROJECT%/user/list">http://localhost:8080/%PROJECT%/user/list
>
> You will now have a little interface to do CRUD operations on class
> User. Few things are not implemented yet:
>
> - creating of one-to-many relationships ( one-to-one and many-to-one work fine)
> - interlinking between scaffolded classes on the interface
> - umm i'm sure i'll think of more later
>
> Anyway getting close to a release now
>
> Graeme
>