liferay 上的 Grails portlet

发布于 2024-10-09 14:16:24 字数 414 浏览 0 评论 0原文

我是一名 Grails 开发人员,两个月前我开始在 Liferay 上进行开发。 我相信,如果我能在 Liferay 上使用 Grails,我的工作效率将会提高 2 倍。 这是我的问题: - 使用哪些插件来开发 Liferay portlet?我使用了一些 grails 插件,但在生成 portlet.xml 时出现错误。 - 如何配置 Grails 调度程序以与 Liferay 一起使用。例如:将 /web/guest/test?myportletId_WAR_aname_action=/user/show/1&myportletId_WAR_aname_windowstate=exclusive... 之类的 URL 分派给 usercontroller 并调用 show 操作? - 调用action时如何获取actionRequest、ActionResponse?

问候

I'm a Grails developer and I started development on Liferay 2 months ago.
I believe that if I can use Grails on Liferay I will increase my productivity by 2.
So here is my questions :
- What plugins to use to develop Liferay portlets ? I used some grails plugins but I got an error when generating portlet.xml.
- How can I configure the Grails dispatcher to work with Liferay. For example : to dispatch urls like this /web/guest/test?myportletId_WAR_aname_action=/user/show/1&myportletId_WAR_aname_windowstate=exclusive... to usercontroller and invoke show action ?
- How to get actionRequest, ActionResponse when invoking the action ?

Regards

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

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

发布评论

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

评论(3

默嘫て 2024-10-16 14:16:24

只要您将 portlet 视为应用程序的特定视图,它就绝对是可能的。您可以使用一个简单的规范 Java portlet 来完成此操作,该 portlet 从主项目中提取信息,或者查看当前的 Spring MVC PortletGroovy Portlet 看看这些是否可以成为您实施的快捷方式。我曾经使用过两者(尽管不是在 Grails 项目的背景下),并且可以高兴地报告它们与现有的 Liferay 配合得很好。

As long as you consider the portlet as a particular view into your app it should definitely be possible. You could do it using a simple spec Java portlet that pulls information out of your main project, or look at the current Spring MVC Portlet and Groovy Portlet to see if those could be shortcuts for your implementation. I have worked with both (albeit not in the context of a Grails project) and can happily report that they work well with stock Liferay.

作业与我同在 2024-10-16 14:16:24

我相当确定您无法使用 Grails 创建 portlet。当然,您可以使用 GORM 在 Groovy 中编写 portlet 来进行数据访问。目前,GSP 在 Grails 之外不可用,因此您可能必须使用 JSP 来获取视图。

我发现使用 Spring MVC 中的 portlet 支持比原始 portlet 更容易一些。

祝你好运

I'm reasonably sure that you can't create a portlet using Grails. You can of course write portlets in Groovy using GORM for data access. GSP isn't currently available outside of Grails so you might have to live with JSP for the views.

I've found that using the portlet support in spring MVC makes your life a little bit easier than raw portlets.

Good luck

夜无邪 2024-10-16 14:16:24

查找 com.liferay.util.bridges.wai.WAIPortlet 的讨论。我已经将自己构建的 Grails 小应用程序放在通用 Liferay 6.06 安装上的热部署目录中作为实验,很快,它们就显示为 portlet!我猜 Liferay 为他们准备了通用的 portlet.xml 等。它们并不漂亮,也没有绑定到 Liferay 的服务 API 或数据库,但它们作为 portlet 运行,当然您也可以在它们应该作为独立 Web 应用程序的地方找到它们。乐趣!

Look for discussion of com.liferay.util.bridges.wai.WAIPortlet . I've taken little Grails apps that I've built, dropped them in the hot deploy directory on a generic Liferay 6.06 install as an experiment, and presto, they show up as portlets! I guess Liferay cooks up generic portlet.xml etc. for them. They aren't beautiful, nor are they tied into Liferay's Services API or database, but they run as a portlet, and of course you can also find them where they should be as stand-alone webapps. Fun!

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