Suggested Pages

Monday, July 23, 2012

Liferay Porlet Phases

In this post we'll see only a short description of the four phases of a portlet:
  • Render Phase;
  • Action Phase;
  • Resource Phase;
  • Event Phase.


Render Phase

In the Render Phase a portlet generates HTML content of its current state. This phase is invoked for all the portlet in a page when you reach that page in your navigation and after an action phase occurs on a portlet in that page. In the specification no order for the render phase of the portlets is guaranteed.

Action Phase

In the Action Phase a portlet executes functionalities that modify its state as a database update. Generally an Action Phase doesn't return nothing.
That phase can be only invoked one at a time for a portlet. This phase is planned for all the actions that cannot be repeated as a database insert, a preference modification and so on.

Resource Phase

In the Resouce Phase a portlet serves resources like PDF, DOC, etc..

Event Phase

In the Event Phase a portlet answers to events.

Conclusion

When a user interacts with a portlet performing an action, the portlet container has to delegate that action to that portlet and then it has to render the whole page. When a portlet goes to action phase, the other portlets have to go to their render phase. So you have to be carefull on the back-end functionalities involved in render and action phases

No comments :

Post a Comment

Suggested Pages