Wednesday, May 27, 2009

Instant Admin Interface with Grails 1.1

Hi All

I think I have just had a great idea for an instant admin interface for my new Grails app. I have almost completed my new web app and was just thinking that I could really do with simple admin interface. So I came up with this idea.

I can pull out my current domain classes out into a plugin. I can then install this plugin into the main application. Then the main app is back to normal

Then i can create a new app called XXX-admin. I then install the domain classes plugin into the admin app then generate scaffold controllers/views for the domain.

This then gives me an instant admin interface.

Gonna try this out and will write again about how it goes.

Peace...

5 comments:

tomas said...

Neat idea. An instant CMS.

How would you deal with cases where different widgets are needed for different screens with this plugin approach?

description( widget: textarea )

for one but

description( widget: richtexteditor )

for cms app.

Anonymous said...

And what about second level cache?

Peter Delahunty said...

Tomas:

You would have two different war files to deploy normal and admin. No conflict.

Anonymous:

Second level cache is easy. Just use Ehcache with with distributed caching turned on. I have done several projects with it and it is works well.

Ted Naleid said...

I've done this on a couple of projects and it works very well. Especially in grails 1.1 with the ability to use the grails-app/conf/BuildConfig.groovy file to "install" the domain plugin by just referring to the directory. No need to manually "grails install-plugin".

There was a discussion on the grails mailing list about it last month, but not much feedback on the topic. I think your blog post is helpful in spreading this method as it's quite powerful.

mike said...

Cool... concept sounds interesting.