jsr 168 overview copyright © 2000 – 2007 liferay, inc. all rights reserved. no material may be...
TRANSCRIPT
JSR 168 Overview
Copyright © 2000 – 2007 Liferay, Inc.
All Rights Reserved.No material may be reproduced electronically or in print without written
permission from Liferay, Inc.
Overview
This PowerPoint will give you an overview of JSR 168 and explain the benefits of using a JSR 168 compliant portal
It covers the portlet lifecycle and the characteristics of a portlet
The intended audience is Java developers
Objectives
What is JSR 168? What is a Portlet? Portlet Lifecycle Portlet Modes Window States Portlet Preferences Benefits of JSR 168 Final Thoughts
What is JSR 168?
JSR 168 is the Portlet Specification It was created out of a need to have a
specification for displaying multiple applications on the same page
JSR 168 defines the lifecycle of a portlet as well as its characteristics
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
Java Portlet Specification, version 1.0. PLT.2.2
What is a Portlet?
Portlets are fragments of an html page
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() Called when the user submits a form
render() Renders the content
destroy() Cleans up the portlet
Portlet Characteristics
Portlets have additional characteristics that make them different from Servlets
Portlet Modes Window States Portlet Preferences
Some people advocate the use of IFrames instead of portlets, but IFrames cannot save stateThey also cannot communicate with the portal or any other components on the page
Portlet Modes
Each portlet has a current mode, which indicates the function the portlet is performing
All JSR 168 compliant portals must support the View, Edit and Help modes
Introduction to JSR 168—The Java Portlet Specification P3 http://developers.sun.com/portalserver/reference/techart/jsr168/pb_whitepaper.pdf
Window States
Window states indicate the amount of portal page space that will be assigned to a portlet
All JSR 168 compliant portals must support the minimized, maximized and normal window states
Introduction to JSR 168—The Java Portlet Specification P3 http://developers.sun.com/portalserver/reference/techart/jsr168/pb_whitepaper.pdf
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 preferencesIntroduction to JSR 168—The Java Portlet Specification P3 http://developers.sun.com/portalserver/reference/techart/jsr168/pb_whitepaper.pdf
Why Should I Use a JSR 168 Compliant Portal?
Even though flexibility and the ability to incorporate the latest technology is important, it is equally important to be based on industry standards
You don’t want to re-learn the servlet specification every time you switch servers
Similarly, you shouldn’t have to re-learn the portlet specification if you decide to switch portals
Benefits of JSR 168
Core Architecture The core architecture will be the same
across JSR 168 compliant portals For example, you can rely on the fact that
a portlet will call processAction() to process a request and then call render() to draw its contents
Benefits of JSR 168
Documentation The Portlet Specification will not change,
and you can always look to it as a source of reliable information
Standard Portlet API Developers can create one set of JSR 168
compliant portlets that can be deployed on any JSR 168 compliant portal
Final Thoughts
Portlets are becoming increasingly important as the demand increases for aggregated content
Just as JSR 154 is the de facto standard for servlets, JSR 168 sets the standard for portlets
Final Thoughts
All of the major vendors including BEA Weblogic Portal, IBM WebSphere Portal, Oracle Portal and SunOne Portal adhere to the JSR 168 specification
Any knowledge that you gain regarding the JSR 168 specification will be applicable to almost any commercial or open source portal available today
References
Java Portlet Specification http://jcp.org/aboutJava/
communityprocess/final/jsr168/
Introduction to JSR 168 http://developers.sun.com/prodtech/
portalserver/reference/techart/jsr168/pb_whitepaper.pdf
Revision History01/17/07 James Min Author
03/24/07 Ed Shin Co-Author