Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Fernando Bellas Permuy
JSR-286 - request.getPortletMode() from an event-processing method
February 13, 2009 5:10 AM
Answer

Fernando Bellas Permuy

Rank: New Member

Posts: 5

Join Date: February 13, 2009

Recent Posts

Hi!

I have developed three JSR-286 standard portlets that use the standard event-based mechanism for portlet intercommunication. Currently I have deployed them in Liferay 5.2.1 (bundled with Tomcat 6.0.18) and JBoss Portal 2.7.1. All portlets are working well under JBoss Portal.

With Liferay, I have observed that when invoking request.getPortletMode() from an event-processing method (annoted with @ProcessEvent), request.getPortletMode() returns PortletMode.VIEW when the portlet is in "edit" mode. The previous version I was using of Liferay (5.0.1 RC) had the same problem.


Has anybody observed this behavior?

Thanks!

Fernando
Rémi Gauthier
RE: JSR-286 - request.getPortletMode() from an event
February 13, 2009 5:22 AM
Answer

Rémi Gauthier

Rank: New Member

Posts: 10

Join Date: February 13, 2009

Recent Posts

To get the Portlet mode of your Portlet that receive the event you should maybe use response.getPortletMode()?
Fernando Bellas Permuy
RE: JSR-286 - request.getPortletMode() from an event
February 13, 2009 5:56 AM
Answer

Fernando Bellas Permuy

Rank: New Member

Posts: 5

Join Date: February 13, 2009

Recent Posts

Hi!

getPortletMode is *not* defined in PortletResponse, but in PortletRequest.

Fernando.
Rémi Gauthier
RE: JSR-286 - request.getPortletMode() from an event
February 13, 2009 6:03 AM
Answer

Rémi Gauthier

Rank: New Member

Posts: 10

Join Date: February 13, 2009

Recent Posts

If you are in processEvent you can use eventResponse.getPortletMode() in liferay.
Where are you trying to catch the mode of the portlet that send the event?
Fernando Bellas Permuy
RE: JSR-286 - request.getPortletMode() from an event
February 14, 2009 4:31 AM
Answer

Fernando Bellas Permuy

Rank: New Member

Posts: 5

Join Date: February 13, 2009

Recent Posts

Hi!

First of all, in my previous post I should have say EventRequest and EventResponse instead of PortletRequest and PortletReponse. Certainly, getPortletMode is also defined in PortletResponse. However, note that EventResponse's getPortletMode does not return the current portlet mode but the portlet mode set in response (if set). Anyway, I tried it and returns PortletMode.VIEW when the portlet is in "edit" mode (the same behavior as EventRequest's getPortletMode).

I think that the implementation of EventRequest's getPortletMode is not compliant with JSR-286.

Thanks - Fernando.
sriram krishnan
Re: [Liferay Forums][3. Development] JSR-286 - request.getPortletMode() fro
February 20, 2009 2:21 AM
Answer

sriram krishnan

Rank: New Member

Posts: 11

Join Date: May 20, 2008

Recent Posts

Hi
This has been fixed in sun portlet container implementation ,please
refer http://issues.liferay.com/browse/LPS-827
To use Sun portlet container in Liferay set
portlet.container.impl=sun in portal-ext.properties and redeploy your
eventing portlets after you restart your server.
Hope this helps.

Thanks,
Sriram

Fernando Bellas Permuy from liferay.com wrote:
> Hi!
>
> I have developed three JSR-286 standard portlets that use the standard
> event-based mechanism for portlet intercommunication. Currently I have
> deployed them in Liferay 5.2.1 (bundled with Tomcat 6.0.18) and JBoss
> Portal 2.7.1. All portlets are working well under JBoss Portal.
>
> With Liferay, I have observed that when invoking
> request.getPortletMode() from an event-processing method (annoted with
> @ProcessEvent), request.getPortletMode() returns PortletMode.VIEW when
> the portlet is in "edit" mode. The previous version I was using of
> Liferay (5.0.1 RC) had the same problem.
>
>
> Has anybody observed this behavior?
>
> Thanks!
>
> Fernando
> --
> Liferay Message Boards
> http://www.liferay.com/web/guest/community/forums/-/message_boards/message/2186404
> mb.239390.2186404@events.liferay.com
> http://www.liferay.com