如何使 Grails 应用程序设计者变得友好,而无需在视图更改后重新部署?
我已经很久没有真正使用 J2EE 了,所以请原谅我的无知。我最近参与的 Grails 项目再次激发了我对 Java 的兴趣,尤其是 Grails,因为它使在 Java 平台上构建 Web 应用程序再次变得有趣。话虽这么说,我希望专家评论一下我对使用 Grails 构建的应用程序的以下要求:
设计团队(网页设计人员)需要访问 GSP 页面并编辑视图文件(布局、模板等)。 )而不打扰开发团队(软件开发人员)。这种场景既可以在构建期间发生,也可以在部署到生产环境之后发生。
设计师、开发人员和业务用户之间的沟通水平在这里不是问题。然而,大约 40% 的情况下,涉及的业务部门请求对前端进行更改,这对开发人员的时间没有影响,但需要设计团队成员的时间。目前,部署工作流程遵循 Grails 应用程序,将 War 文件部署到 Tomcat 服务器。我想有一种更简单的方法可以让设计团队无需经历构建和部署生命周期即可进行 UI 更改。
一些设计团队成员过去曾接触过 PHP,有时会怀念通过覆盖模板文件来使 UI 部分更实用或改进布局模板的能力。我希望 Grails 中有类似的方法来适应这种简单性。有人告诉我,分解 War 文件可能是一种选择,但这仍然需要重新加载 Tomcat 托管应用程序。
如果您认为我以错误的方式看待所需的解决方案,请插话,因为我更感兴趣的是为所有相关团队成员提供可行的妥协方案。谢谢。
It has been a long while since I have really worked with J2EE so please excuse my ignorance. My recent engagement in a Grails project has peaked my interest in Java once more and especially in Grails as it makes building web applications on the Java platform fun again. That being said, I would like an expert to comment on the following requirement that I have for an application built using Grails:
The Design Team (web designers) require access to the GSP pages and edit the view files (layouts, templates, etc.) without bothering the development team (software developers). This scenario can take place both during construction and after deployment into production.
The communication level between the Designers, Developers, and Business Users are not an issue here. However, about 40% of the time, the Business Units involved request changes to the front-end that have no impact on the Developers time but require the time of a Design Team member. Currently, the deployment workflow follows the Grails application through the deployment of a War file to a Tomcat server. I imagine there is a simpler way to allow the Design team to make UI changes without going through the build and deploy lifecycle.
Several of the Design Team members have had exposure to PHP in the past and at times miss the ability to just overwrite a template file to make a UI piece more functional or improve a layout template. I hope there is a similar way to accommodate such simplicity within Grails. I have been told that exploding the War file might be an option but that still requires the reload of the Tomcat hosted application.
If you believe that I looking at the desired solution the wrong way, please do chime in as I am more interested in a workable compromise for all the team members involved. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要在 Config.groovy 中指定以下设置:
“grails.gsp.view.dir”通常是您签出的 SVN 存储库的路径。然后,您每次想要更新视图时都可以“svn up”。
有一个警告:当编译 GSP 视图时,它会耗尽 permgen。最终你将耗尽并需要重新启动服务器。
You need to specify the following settings in Config.groovy:
The 'grails.gsp.view.dir' is typically the path to your checked out SVN repo. You can then just 'svn up' everytime you want to update the views.
There is one caveat: When a GSP view is compiled it uses up permgen. Eventually you will run out and need to restart the server.
您可以在开发模式下通过 run-app 运行具有应用程序版本的服务器。然后设计者可以对视图进行更改,然后重新加载。他们需要能够通过某种共享访问服务器上的源代码。另外,如果您检查了源代码,设计人员就可以从服务器提交他们的更改。
缺点是,如果重新加载失败或内存不足(已知会在大量重新加载时发生),开发人员需要停止并启动应用程序,或者您可以为设计人员提供一个脚本来运行以弹回它。
显然,通过在开发模式下运行和通过运行应用程序运行,您会受到性能影响,但在您的情况下,这可能是一个不错的权衡。
干杯
李
You could run a server with a version of the application via run-app in development mode. The designers can then make changes to the views and they will reload. They would need to be able to acccess the source code on the server via a share of some kind. As a plus, if you checked out the source the designers could then commit their changes from the server.
The downside is that if the reloading fails or you run out of memory (has been known to happen with lots of reloading) either a developer would need to stop and start the app or you could provide the designers with a script to run to bounce it.
You'd obviously take a performance hit by running in development mode and via run-app but it might a ok trade off in your case.
cheers
Lee
这可能不是这个问题的直接答案,但由于您似乎关注设计师在项目中的角色,您也可以查看我的设计者友好的 GSP 实现,借助“通过属性进行标签声明”功能,设计者甚至可以使用自定义标签查看 GSP 页面。
This may not be the direct answer for this question but since you seem to pay attention to designers' role in a project, you may also check my designer friendly GSP implementation which enables designers to view GSP pages even with custom tags thanks to the "tag declaration via attributes" feature.