开发者

Multiple Grails scaffolding templates in one application

I'm creating a DB web application with gr开发者_StackOverflow社区ails for my company and found myself in the need to change the default scaffolding templates.

So far so good, everything gets generated with the modified templates (controllers, views, ..).

Now, however, I get a request to create some "composite screens" with functionalities and a layout that differ from the overwritten templates.

So now my question is: is it possible in grails to create one or more templates (next the the default one) and pass this template name as an argument to the generate-* commands?

Thanks in advance!

EDIT: Adding the template name to the generate commands was just an idea, if it's possible to do this a different way, I'll be happy too.


Grails commands are scripts in grails/scripts. If you follow its logic you will see two things.

1) There is only one parameter passed to the script → domain.

2) Class for generating views is DefaultGrailsTemplateGenerator. You can analyse sourcecode and check what this class offers.

Update

Link to DefaultGrailsTemplateGenerator in GitHub.


I am not sure about the generate command parameters, but if you add another .gsp page into scaffolding directory, I believe it will try to run it through generation process.

So for example I used to have a show.gsp page as well as showBasic.gsp page, which showed fewer properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜