Foren

Trigger JSR-286 Events on each Request

Dominik Süß, geändert vor 13 Jahren.

Trigger JSR-286 Events on each Request

New Member Beiträge: 2 Beitrittsdatum: 23.10.10 Neueste Beiträge
Hi everyone,

due to a tight integration of partially 3rd-party portlets (JSR-286) we'd need to share data between several portlets even during the initial rendering (so only renderphase would be executed by default).

Now the idea was to trigger an event on each request, if actionrequest or renderquest. This request can be distributed by a specific portlet or be a global event, each portlet could listen to.

So now the magic questions, where can I hook into liferay (6.0.5) to achive this goal, and do you know any drawbacks? (btw. clientside IPC is out of scope due to SEO constraints for the initial delivered data, and the portlets have to use JSR-286 functionality since some of the portlets are products, only having hooks for actionprocessing and eventprocessing, no further customization).

Best regards,
Dominik
thumbnail
Mika Koivisto, geändert vor 13 Jahren.

RE: Trigger JSR-286 Events on each Request

Liferay Legend Beiträge: 1519 Beitrittsdatum: 07.08.06 Neueste Beiträge
Events can only be created from Action phase or Event phase. Event's also come with performance penalty. Why not use public render parameters? They are much more light weight way of doing IPC.
Dominik Süß, geändert vor 13 Jahren.

RE: Trigger JSR-286 Events on each Request

New Member Beiträge: 2 Beitrittsdatum: 23.10.10 Neueste Beiträge
Events can only be created in Action or Event Phase "by a portlet". The portletcontainer coult (theoretically) turn any Renderrequest into an actionrequest for a portlet which can fire the event. This isn't defined by the specification, but should be possible.

But back to your proposal. If I have two portlets (call them A and B ) and A has to send data to B within the first request (example: several portlets have to send disclaimers to a disclaimerportlet which aggregates and displays them), how can I define the sequence of calls of the renderphase of the portlets. If B is rendered before A is rendered, setting the renderparameter won't have any effect since rendering of B is complete.

This is why I'd like to enter the eventphase, which is capable of handling such interactions.

Performance penalty shouldn't be that big problem, since the output will be cached by a CDN.

P.S. any other proposals how it'd be possible to share data between portlets (not in the same webapp) are pretty welcome ;)