Using the Portlet API |
The following classes are of particular usefulness in creating custom portlets:
Extend this class in order to create your own portlet actions. For more information, see Creating a Portlet Action Class.
Use this interface to handle errors that your portlet encounters. For more information, see Creating an Error Handling Action.
Extend this class in order to create your own portlet actions. For more information, see Creating a Portlet Action Class. Possible uses include the following:
correctly displaying non-Latin1 character sets when a portlet is displayed in preview mode. For an example of this use, see Step 4: Create the Action Class.
preparing URLs for actions within an interactive form JSP and populating a JavaBean with parameters from a JSP form. For an example of these uses, see Step 4: Create the Action Class.
Use this interface to obtain a local or remote session context, which you can use to pass information from one portlet to another. For examples, see Obtaining a User and Session Context.
Use this class to do the following:
create URLs for buttons on your JSP pages (for example, OK and Cancel).
obtain a portlet's resource bundles in order to create a localization context for your portlet's JSP page.
Use this interface to develop an action class for your portlet. For more information, see Creating a Portlet Action Class and Step 4: Create the Action Class.
Use this interface to develop an initializer class, which runs before your portlet is displayed for the first time on a portal page. Possible uses include
reading initial parameters that are specified in your portlet's deployment descriptor file (portlet.xml).
connecting to an external resource such as a database. For more information, see Creating an Initializer Action Class.
Use this interface to develop a postprocessor class that runs when your portlet is no longer displayed. Possible uses include the following:
freeing resources that were used in the portlet initializer.
removing HttpSession attributes that were set in the portlet initializer or portlet action. This is especially important to consider because multiple copies of your portlet could exist on other portal pages or even on the same page.
For more information, see Creating a Postprocessing Action Class.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.