Fundamentals of Liferay Portlets - part 1

What is Liferay Portal?

  • Liferay Portal is the world's leading open source enterprise portal solution using the latest in Java and Web 2.0 technologies.
  • Runs on all major application servers & servlet containers,databases, and operating systems with over 700 deployment combinations.
  • JSR 168 and JSR 286 compliant
  • Out-of-the-box usability with over 60 portlets pre-bundled
  • Built-in Content Management System (CMS)
  • Built-in Collaboration suite
  • Personalized pages for all user

What are JSR 168 and JSR 286?
  • JSR 168 and JSR 286 are Portlet Specifications
  • They were created out of a need to have a specification for displaying multiple applications on the same page.
  • The specs define the lifecycle of a portlet as well as its characteristics/look and feel.
  • They standardize the way portlets are developed
What is a portlet?
  • A portlet is a web component that processes requests and generates dynamic content.
  • The content generated by a portlet is also called a fragment (e.g. HTML, XHTML, WML) and can be aggregated with other fragments to form a complete document.
Portlet Lifecycle
  • Portlets are different from servlets in that they have a 2 phase commit.
  • With servlets, the service() method processes all requests.
  • With portlets, the processAction() method processes the requests and the render() method draws the contents of the portlet on the page
Portlet Lifecycle
  • init() - Initializes the Portlet
  • processAction() - process input from a user action.
  • render() - Renders the content output.
  • destroy() - Cleans up the portlet
Additional methods of the lifecycle:
  • serveResource() - Allows a portlet to serve a resource. The serveResource() method can be used to implement AJAX use cases.
  • processEvent() - Perform events triggered by other portlets. (IPC)
Portlet Characteristics
  • Portlets have additional characteristics that make them different from Servlets
  • Portlet Modes
  • Window States
  • Portlet Preferences
Portlet Modes
  • Each portlet has a current mode, which indicates the function the portlet is performing.
  • All JSR 168 compliant portals should support the View, Edit and Help modes.
Window States
  • Window states indicate the amount of portal page space that will be assigned to a portlet.
  • All spec compliant portals should support the minimized, maximized and normal window states.
Portlet Preferences
  • Portlets can be configured to provide a custom view or behavior for different users.
  • For example, a weather portlet can show the temperature in Chicago for one user and the temperature in LA for another user.
  • These configurations are represented as a persistent set of name-value pairs and are referred to as portlet preferences.

You can have a quick overview of Liferay here 

Comments

Post a Comment

Popular posts from this blog

jQgrid reload with new data

Introduction to jQgrid

Rich Client based UI technologies- A Comparison of Thick Client UI tools