开发者

Grails portlets on liferay

开发者 https://www.devze.com 2023-02-01 14:56 出处:网络
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 productivi开发者_如何学Cty by 2.

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 productivi开发者_如何学Cty 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


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.


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


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!

0

精彩评论

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