Page 2 of 7
Figure 1. Portal architecture. Click on thumbnail to view full-size image.
Figure 2 depicts the basic portal page components. The portal page itself represents a complete markup document and aggregates several portlet windows. In addition to the portlets, the page may also consist of navigation areas and banners. A portlet window consists of a title bar with the portlet's title, decorations, and the content produced by the portlet. The decorations can include buttons to change the portlet's window state and mode (we explain these concepts later).
Figure 2. Portal page. Click on thumbnail to view full-size image.
As mentioned above, a portlet is a Java-based Web component that processes requests and generates dynamic content. The content generated by a portlet is called a fragment, a piece of markup (e.g., HTML, XHTML, or WML (Wireless Markup Language)) adhering to certain rules. A fragment can be aggregated with other fragments to form a complete document, as shown in Figure 3. A portlet's content normally aggregates with the content of other portlets to form the portal page. A portlet container manages a portlet's life cycle.
Figure 3. Different portlet markups: on the left side, HTML markup in a desktop browser; on the right side, WML markup on a mobile phone. Click on thumbnail to view full-size image.
Web clients interact with portlets via a request/response paradigm implemented by the portal. Usually, users interact with content produced by portlets by, for example, following links or submitting forms, resulting in portlet actions being received by the portal, which then forward to the portlets targeted by the user's interactions.
The content generated by a portlet may vary from one user to another depending on the portlet's user configuration.
A portlet container runs portlets and provides them with the required runtime environment. A portlet container contains portlets and manages their life cycles. It also provides persistent storage mechanisms for the portlet preferences. A portlet container receives requests from the portal to execute requests on the portlets hosted by it. A portlet container is not responsible for aggregating the content produced by the portlets; the portal itself handles aggregation.
A portal and a portlet container can be built together as a single component of an application suite or as two separate components of a portal application.
This section explains the basic programming concepts in JSR 168, such as a portlet's life cycle, interface, and modes and window states, as well as session access, persistent storage access, and how to include servlets and JSP pages.
The basic portlet life cycle of a JSR 168 portlet is:
The portlet container manages the portlet life cycle and calls the corresponding methods on the portlet interface.
| Subject |
|
|
Excellent for beginnersBy Anonymous on December 15, 2009, 10:55 pmIts awesome...
Reply | Read entire comment
Nice oneBy Anonymous on November 11, 2009, 1:59 amThank you so much .it's veryuseful
Reply | Read entire comment
Nice articleBy Anonymous on September 18, 2009, 8:57 amIt is good introduction to portlets. Appreciate the efforts !
Reply | Read entire comment
A good tutorial finally !By Anonymous on June 26, 2009, 1:05 amA good tutorial finally !
Reply | Read entire comment
Great articleBy Anonymous on March 25, 2009, 9:32 pmThanks for this excellent arcticle.
Reply | Read entire comment
View all comments