在Grails中创建管理部分的最佳方法 [英] Best way to create an Admin section in Grails

查看:205
本文介绍了在Grails中创建管理部分的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hy,



我想知道在Grails应用程序中创建Admin(后端)部分的最佳方式是什么?



我想在Grails的controllers文件夹中创建一个Admin文件夹来放置我所有的管理员控制器。但是,那么我将不得不手动创建每个管理控制器的URL映射?



我已经用 genernate-all 命令生成了我所有的前端GSP,该命令带有一个 Domain Class 但知道如何为我的管理部分生成我的CRUD(具有相同的域类)。是我拧了吗?



非常感谢您的提示!

我的首选是为管理员提供一个单独的应用程序。将所有的域类都放在一个插件中,并将该插件安装到管理应用程序和消费者应用程序中。



这样,您可以调整控制器到您的内容中而不用担心最终用户打他们。共享服务也可以在域插件中。



有一个特殊的文件,您可以在您的grails-app / conf中调用BuildConfig.groovy,您可以在其中指定local 像插件那样的插件可以自动进入类路径,而无需打包/安装插件。使它变得非常简单。


Hy,

I'm wondering what's the best way to create an Admin (backend) section in a Grails app ?

I want to create an "Admin" folder in the "controllers" folder of Grails to put all my admin controllers. But then will I have to create manually the URL mapping for each Admin controller?

I have already generated all my frontend GSP with the genernate-all command which takes a Domain Class but know how can I generate my CRUD for my admin section (with the same domain class). Am I screwed ?

Thanks a lot for your tips!

解决方案

My preference for this is to have a separate application for admin. Stick all of your domain classes in a plugin and install that plugin into both the admin application and the consumer appilcation.

That way, you can tweak the controllers to your hearts content and not worry about end users hitting them. Shared services can also be in the domain plugin.

There's a special file that you can put in your grails-app/conf called BuildConfig.groovy where you can specify "local" plugins like the domain plugin that are automatically brought into the classpath without having to package/install the plugin. Makes it super easy.

这篇关于在Grails中创建管理部分的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆