Java Doc for GenericPortlet.java in  » Portal » Open-Portal » javax » portlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » javax.portlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.portlet.GenericPortlet

All known Subclasses:   com.sun.portal.app.wiki.JspPortlet,  test.InputStreamPortlet,  com.sun.portal.sapportlet.SAPSalesOrderPortlet,  com.sun.portal.oracleportlet.approval.ReqApprovalPortlet,  com.sun.portal.portlet.ipc2.SearchPortlet,  com.sun.portal.portlet.samples.jspportlet.JSPPortlet,  com.sun.portal.portlet.ipc1.ConsiderationPortlet,  com.sun.portal.oracleportlet.receipts.ReceiptsPortlet,  com.sun.portal.portlet.ipc2.DecisionPortlet,  com.sun.portal.psftportlet.holidaysportlet.PSFTHolidaysPortlet,  com.sun.portal.sapportlet.SAPTimePortlet,  com.sun.portal.psftportlet.timeentryportlet.PSFTTimeEntryPortlet,  __PACKAGE__.__NAME__,  com.sun.portal.oracleportlet.requisitions.RequisitionInfoPortlet,  com.sun.portal.jspportlet.JspPortlet,  com.sun.portal.sapportlet.SAPEmpDetailsPortlet,  com.sun.portal.portlet.ipc2.PricePortlet,  test.RequestDispatcherGetAttributePortlet,  com.sun.portal.portlet.ipc1.ListPortlet,  com.sun.portal.sapportlet.SAPCustSearchPortlet,  com.sun.portal.rssportlet.RssPortlet,  com.sun.portal.portlet.samples.invoice.InvoicePortlet,  com.sun.im.portal.portlet.IMPortlet,  com.sun.portal.siebelportlet.portlet.SiebelCustomerAccountsPortlet,  com.sun.faces.portlet.FacesPortlet,  test.PrefPortlet,  com.sun.portal.oracleportlet.quotations.QuotationsPortlet,  com.sun.portal.psftportlet.epiportlet.PSFTEPIPortlet,  test.HelloWorldPortlet,  com.sun.portal.sapportlet.SAPNamefinderPortlet,  test.NavStatePortlet,  test.NamedDispatcherGetAttributePortlet,  com.sun.portal.sapportlet.SAPManagerViewPortlet,  test.TestPortlet,  com.sun.portal.sapportlet.SAPUserConfigPortlet,
GenericPortlet
abstract public class GenericPortlet implements Portlet,PortletConfig(Code)
The GenericPortlet class provides a default implementation for the Portlet interface.

It provides an abstract class to be subclassed to create portlets. A subclass of GenericPortlet should override at least one method, usually one of the following:

  • processAction, to handle action requests
  • doView, to handle render requests when in VIEW mode
  • doEdit, to handle render requests when in EDIT mode
  • doHelp, to handle render request when in HELP mode
  • init and destroy, to manage resources that are held for the life of the servlet

Normally there is no need to override the render or the doDispatch methods. Render handles render requests setting the title of the portlet in the response and invoking doDispatch. doDispatch dispatches the request to one of the doView, doEdit or doHelp method depending on the portlet mode indicated in the request.

Portlets typically run on multithreaded servers, so please note that a portlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections.




Constructor Summary
public  GenericPortlet()
     Does nothing.

Method Summary
public  voiddestroy()
     Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.
protected  voiddoDispatch(RenderRequest request, RenderResponse response)
     The default implementation of this method routes the render request to a set of helper methods depending on the current portlet mode the portlet is currently in.
protected  voiddoEdit(RenderRequest request, RenderResponse response)
     Helper method to serve up the edit mode.
protected  voiddoHelp(RenderRequest request, RenderResponse response)
     Helper method to serve up the help mode.
protected  voiddoView(RenderRequest request, RenderResponse response)
     Helper method to serve up the mandatory view mode.
public  StringgetInitParameter(java.lang.String name)
     Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
public  java.util.EnumerationgetInitParameterNames()
     Returns the names of the portlet initialization parameters as an Enumeration of String objects, or an empty Enumeration if the portlet has no initialization parameters.
public  PortletConfiggetPortletConfig()
     Returns the PortletConfig object of this portlet.
public  PortletContextgetPortletContext()
     Returns the PortletContext of the portlet application the portlet is in.
public  StringgetPortletName()
     Returns the name of this portlet.
public  java.util.ResourceBundlegetResourceBundle(java.util.Locale locale)
     Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor with resource-bundle tag or the inlined resources defined in the deployment descriptor.
protected  java.lang.StringgetTitle(RenderRequest request)
     Used by the render method to get the title.

The default implementation gets the title from the ResourceBundle of the PortletConfig of the portlet.

public  voidinit(PortletConfig config)
     Called by the portlet container to indicate to a portlet that the portlet is being placed into service.
public  voidinit()
     A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding GenericPortlet.init(PortletConfig) , simply override this method and it will be called by GenericPortlet.init(PortletConfig config). The PortletConfig object can still be retrieved via GenericPortlet.getPortletConfig .

public  voidprocessAction(ActionRequest request, ActionResponse response)
     Called by the portlet container to allow the portlet to process an action request.
public  voidrender(RenderRequest request, RenderResponse response)
     The default implementation of this method sets the title using the getTitle method and invokes the doDispatch method.


Constructor Detail
GenericPortlet
public GenericPortlet()(Code)
Does nothing.




Method Detail
destroy
public void destroy()(Code)
Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.

The default implementation does nothing.




doDispatch
protected void doDispatch(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException(Code)
The default implementation of this method routes the render request to a set of helper methods depending on the current portlet mode the portlet is currently in. These methods are:
  • doView for handling view requests
  • doEdit for handling edit requests
  • doHelp for handling help requests

If the window state of this portlet is minimized, this method does not invoke any of the portlet mode rendering methods.

For handling custom portlet modes the portlet should override this method.
Parameters:
  request - the render request
Parameters:
  response - the render response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to perform render at this time
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem
See Also:   GenericPortlet.doView(RenderRequest,RenderResponse)
See Also:   GenericPortlet.doEdit(RenderRequest,RenderResponse)
See Also:   GenericPortlet.doHelp(RenderRequest,RenderResponse)




doEdit
protected void doEdit(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException(Code)
Helper method to serve up the edit mode.

The default implementation throws an exception.
Parameters:
  request - the portlet request
Parameters:
  response - the render response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to perform render at this time
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem




doHelp
protected void doHelp(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException(Code)
Helper method to serve up the help mode.

The default implementation throws an exception.
Parameters:
  request - the portlet request
Parameters:
  response - the render response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to perform render at this time
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem




doView
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException(Code)
Helper method to serve up the mandatory view mode.

The default implementation throws an exception.
Parameters:
  request - the portlet request
Parameters:
  response - the render response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to perform render at thistime
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because ofsecurity reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem




getInitParameter
public String getInitParameter(java.lang.String name)(Code)
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.
Parameters:
  name - a String specifying the nameof the initialization parameter a String containing the value of the initialization parameter
exception:
  java.lang.IllegalArgumentException - if name is null.



getInitParameterNames
public java.util.Enumeration getInitParameterNames()(Code)
Returns the names of the portlet initialization parameters as an Enumeration of String objects, or an empty Enumeration if the portlet has no initialization parameters. an Enumeration of String objects containing the names of the portlet initialization parameters, or an empty Enumeration if the portlet has no initialization parameters.



getPortletConfig
public PortletConfig getPortletConfig()(Code)
Returns the PortletConfig object of this portlet. the PortletConfig object of this portlet



getPortletContext
public PortletContext getPortletContext()(Code)
Returns the PortletContext of the portlet application the portlet is in. the portlet application context



getPortletName
public String getPortletName()(Code)
Returns the name of this portlet. the portlet name
See Also:   PortletConfig.getPortletName



getResourceBundle
public java.util.ResourceBundle getResourceBundle(java.util.Locale locale)(Code)
Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor with resource-bundle tag or the inlined resources defined in the deployment descriptor. the resource bundle for the given locale



getTitle
protected java.lang.String getTitle(RenderRequest request)(Code)
Used by the render method to get the title.

The default implementation gets the title from the ResourceBundle of the PortletConfig of the portlet. The title is retrieved using the 'javax.portlet.title' resource name.

Portlets can overwrite this method to provide dynamic titles (e.g. based on locale, client, and session information). Examples are:

  • language-dependant titles for multi-lingual portals
  • shorter titles for WAP phones
  • the number of messages in a mailbox portlet
the portlet title for this window



init
public void init(PortletConfig config) throws PortletException(Code)
Called by the portlet container to indicate to a portlet that the portlet is being placed into service.

The default implementation just stores the PortletConfig object.

The portlet container calls the init method exactly once after instantiating the portlet. The init method must complete successfully before the portlet can receive any requests.

The portlet container cannot place the portlet into service if the init method does one of the following:

  1. it throws a PortletException
  2. it does not return within a time period defined by the Web server

Parameters:
  config - a PortletConfig object containing the portletconfiguration and initialization parameters
exception:
  PortletException - if an exception has occurred thatinterferes with the portlet normaloperation.
exception:
  UnavailableException - if the portlet cannot perform the initialization at this time.



init
public void init() throws PortletException(Code)
A convenience method which can be overridden so that there's no need to call super.init(config).

Instead of overriding GenericPortlet.init(PortletConfig) , simply override this method and it will be called by GenericPortlet.init(PortletConfig config). The PortletConfig object can still be retrieved via GenericPortlet.getPortletConfig .
exception:
  PortletException - if an exception has occurred thatinterferes with the portlet normaloperation.
exception:
  UnavailableException - if the portlet is unavailable to perform init




processAction
public void processAction(ActionRequest request, ActionResponse response) throws PortletException, java.io.IOException(Code)
Called by the portlet container to allow the portlet to process an action request. This method is called if the client request was originated by a URL created (by the portlet) with the RenderResponse.createActionURL() method.

The default implementation throws an exception.
Parameters:
  request - the action request
Parameters:
  response - the action response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to process the action at this time
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem




render
public void render(RenderRequest request, RenderResponse response) throws PortletException, java.io.IOException(Code)
The default implementation of this method sets the title using the getTitle method and invokes the doDispatch method.
Parameters:
  request - the render request
Parameters:
  response - the render response
exception:
  PortletException - if the portlet cannot fulfilling the request
exception:
  UnavailableException - if the portlet is unavailable to perform render at this time
exception:
  PortletSecurityException - if the portlet cannot fullfill this request because of security reasons
exception:
  java.io.IOException - if the streaming causes an I/O problem



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.