Grails:管理静态数据

发布于 2024-08-01 18:13:00 字数 488 浏览 3 评论 0原文

我正在寻找一个好的解决方案来管理 Grails 应用程序中的静态数据,即不经常更改的表中的数据,例如国家/地区列表。

我的要求是:

  1. 应该很容易国际化数据
  2. 应该提供一种在运行单元/集成测试时将静态数据加载到数据库中的方法(例如从 XML 文件)
  3. 应该提供一种在运行单元/集成测试时将静态数据与数据库同步的方法启动服务器
  4. 应该提供一个标签库来显示静态数据(例如国家列表)
  5. 应该提供一个视图来手动查看/更改静态数据

查找参考代码插件都尝试来解决这个问题。 有谁有使用这些插件的经验,或者还有其他选择吗?

I'm looking for a good solution for managing static data in a Grails app, i.e. data in infrequently changing tables such as a list of countries.

My requirements are:

  1. Should be easy to internationalize the data
  2. Should provide a means of loading the static data into the database (e.g. from an XML file) when running the unit/integration tests
  3. Should provide a means of synchronizing the static data with the database when starting the server
  4. Should provide a taglib for displaying the static data (e.g. list of countries)
  5. Should provide a view for manually viewing/changing the static data

The lookups and ref code plugins both attempt to solve this problem. Does anyone have experience using these plugins, or are there other options?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡水深流 2024-08-08 18:13:00

我在 GroovyMag 的 5 月号中写了有关查找插件的文章。 (http://groovymag.com) 它将处理要求 1、4 和 5。我认为没有什么那里可以满足所有 5 个要求,但其他要求应该不会很难实现。 也许您可以获取这些现有插件之一的源代码并扩展它。 听起来是一个有趣的项目。

戴夫

I wrote about the lookups plugin in the May issue of GroovyMag. (http://groovymag.com) It will handle requirements 1, 4 and 5. I don't think there's anything out there that would do all 5, but the other requirements shouldn't be very difficult to implement. Perhaps you could get the source to one of these existing plugins and extend it. Sounds like a fun project.

Dave

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文