Java Doc for AbstractRenderer.java in  » EJB-Server-resin-3.1.5 » resin » com » caucho » portal » generic » 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 » EJB Server resin 3.1.5 » resin » com.caucho.portal.generic 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.caucho.portal.generic.AbstractRenderer

All known Subclasses:   com.caucho.portal.alpharenderer.HtmlRenderer,
AbstractRenderer
abstract public class AbstractRenderer implements Renderer(Code)

Template

To implement a renderer that adds decoration to content rendered with the PrintWriter, the following are overridden:
 protected void beginPage( PrintWriter out, RenderRequest request, String namespace )
 throws IOException
 {
 ... 
 }
 protected void beginWindow( PrintWriter out, RenderRequest request, String namespace )
 throws IOException
 {
 ... 
 }
 protected void endWindow( PrintWriter out, RenderRequest request, String namespace )
 throws IOException
 {
 ... 
 }
 protected void endPage( PrintWriter out, RenderRequest request, String namespace )
 throws IOException
 {
 ... 
 }
 

Helper methods



Field Summary
final public static  StringPAGE_HEADER_RENDERED
    
final protected static  Loggerlog
    


Method Summary
protected  voidbeginPage(PrintWriter out, RenderRequest request, String namespace)
     Derived classes override to insert header content for a page, called only when beginPage() has not been called on some instance of AbstractRenderer for this request.
protected  voidbeginPage(OutputStream out, RenderRequest request, String namespace)
     Derived classes override to insert header content for a page, called only when beginPage() has not been called on some instance of AbstractRenderer for this request. request.getResponseContentType() can be used to determine the content type. request.getAttribute("javax.portlet.title") may contain a title for the Window, if the portlet has set one.
protected  voidbeginWindow(PrintWriter out, RenderRequest request, String namespace)
     Derived classes override to insert header content before a portlet has been rendered.
protected  voidbeginWindow(OutputStream out, RenderRequest request, String namespace)
     Derived classes override to insert header content before a portlet has been rendered. request.getResponseContentType() is used to determine the content type. request.getAttribute("javax.portlet.title") may contain a title for the Window, if the portlet has set one.
protected  PortletURLcreateControlURL(RenderRequest request)
     Create a PortletURL for a control, such as a link to change the window state or portlet mode.
protected  voidendPage(PrintWriter out, RenderRequest request, String namespace)
     Derived classes override to insert footer content for a page, called from only when beginPage() has been called for the Window.
protected  voidendPage(OutputStream out, RenderRequest request, String namespace)
     Derived classes override to insert footer content for a page, called from only when beginPage() has been called for the Window.
protected  voidendWindow(PrintWriter out, RenderRequest request, String namespace)
     Derived classes override to append footer content after a portlet has been rendered.
protected  voidendWindow(OutputStream out, RenderRequest request, String namespace)
     Derived classes override to append footer content after a portlet has been rendered.
public  voidfinish(PrintWriter out, RenderRequest request, String namespace, boolean isDiscarded)
     Finish with a Writer produced by this factory. This may be called even if the writer threw an Exception. This implementation calls endWindow() and endPage() if needed.
public  voidfinish(OutputStream out, RenderRequest request, String namespace, boolean isDiscarded)
     Finish with an OutputStream produced by this factory.
public  intgetBufferSize()
    
protected  StringgetContentType(RenderRequest request)
     Return the content type to use for the response.
public  StringgetDefaultContentType()
    
protected  LocalegetLocale(RenderRequest request)
     Return the locale to use for the response.
public  OutputStreamgetOutputStream(OutputStream out, RenderRequest request, String namespace)
     Return an OutputStream that wraps the passed OutputStream, or null if there is no specialized writer for this request.
protected  PortletConfiggetPortletConfig(RenderRequest request)
     Get the PortletConfig for the portlet being rendered.
protected  Set<PortletMode>getPortletModes(RenderRequest request)
     Return an Set of the possible portlet modes that the window can have.
protected  RenderResponsegetRenderResponse(RenderRequest request)
     Get the RenderResponse for the portlet being rendered.
protected  ResourceBundlegetResourceBundle(RenderRequest request)
     Get a resource bundle for the portlet being rendered.
protected  StringgetShortTitle(RenderRequest request)
     Return the short title for the window, or null if a title is not available.
protected  StringgetTitle(RenderRequest request)
     Return the title for the window, or null if it has not been set.
protected  Set<WindowState>getWindowStates(RenderRequest request)
     Return an Set of the possible window states that the window can have.
public  PrintWritergetWriter(PrintWriter out, RenderRequest request, String namespace)
     Return a Writer that wraps the passed PrintWriter, or null if there is no specialized writer for this request. This implementation calls beginPage() if needed and beginWindow() before returning the writer.
public  booleanisAlwaysStream()
    
public  booleanisAlwaysWrite()
    
public  booleanisPortletModeAllowed(PortletRequest request, PortletMode portletMode)
     Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed portlet modes is dependent on the mime type of the response. The default is to return true.
public  booleanisWindowStateAllowed(PortletRequest request, WindowState windowState)
     Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed window states is dependent on the mime type of the response. The default is to return true.
protected  PrintWriterprintEscaped(PrintWriter out, CharSequence string)
     Print a string with appropriate escaping for XML, for example '<' becomes '&lt;'.
public  voidsetAlwaysStream(boolean isAlwaysStream)
     If true the portal will always call getOutputStream(), even if the portlet does not call getOutputStream(), unless getWriter() has been called. The default is false.
public  voidsetAlwaysWrite(boolean isAlwaysWrite)
     If true the portal will always call getWriter(), even if the portlet does not call getWriter(), unless getOutputStream() has been called. The default is true.
public  voidsetBufferSize(int bufferSize)
     The default is -1, which allows the portal to choose a buffer size. 0 disables buffering of the renderer output.
public  voidsetDecorateWindow(boolean isDecorateWindow)
     If true beginWindow() and endWindow() are always called, if false never called, the default is to call beginWindow() and endWindow() unless beginPage() and endPage() are called.
public  voidsetDefaultContentType(String defaultContentType)
     The default content type used if AbstractRenderer.isAlwaysWrite() or AbstractRenderer.isAlwaysStream() is true and a Writer or OutputStream is obtained before the content type of the response has been set, default is "text/html".

Field Detail
PAGE_HEADER_RENDERED
final public static String PAGE_HEADER_RENDERED(Code)



log
final protected static Logger log(Code)





Method Detail
beginPage
protected void beginPage(PrintWriter out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert header content for a page, called only when beginPage() has not been called on some instance of AbstractRenderer for this request.



beginPage
protected void beginPage(OutputStream out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert header content for a page, called only when beginPage() has not been called on some instance of AbstractRenderer for this request. request.getResponseContentType() can be used to determine the content type. request.getAttribute("javax.portlet.title") may contain a title for the Window, if the portlet has set one.



beginWindow
protected void beginWindow(PrintWriter out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert header content before a portlet has been rendered.



beginWindow
protected void beginWindow(OutputStream out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert header content before a portlet has been rendered. request.getResponseContentType() is used to determine the content type. request.getAttribute("javax.portlet.title") may contain a title for the Window, if the portlet has set one.



createControlURL
protected PortletURL createControlURL(RenderRequest request)(Code)
Create a PortletURL for a control, such as a link to change the window state or portlet mode. Control URLs are render urls that maintain existing render parameters.



endPage
protected void endPage(PrintWriter out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert footer content for a page, called from only when beginPage() has been called for the Window.



endPage
protected void endPage(OutputStream out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to insert footer content for a page, called from only when beginPage() has been called for the Window. request.getResponseContentType() can be used to determine the content type.



endWindow
protected void endWindow(PrintWriter out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to append footer content after a portlet has been rendered.



endWindow
protected void endWindow(OutputStream out, RenderRequest request, String namespace) throws IOException(Code)
Derived classes override to append footer content after a portlet has been rendered. request.getResponseContentType() can be used to determine the content type.



finish
public void finish(PrintWriter out, RenderRequest request, String namespace, boolean isDiscarded) throws IOException(Code)
Finish with a Writer produced by this factory. This may be called even if the writer threw an Exception. This implementation calls endWindow() and endPage() if needed.



finish
public void finish(OutputStream out, RenderRequest request, String namespace, boolean isDiscarded) throws IOException(Code)
Finish with an OutputStream produced by this factory. This may be called even if the outputStream threw an Exception. This implementation calls endWindow() and endPage() if needed.



getBufferSize
public int getBufferSize()(Code)



getContentType
protected String getContentType(RenderRequest request)(Code)
Return the content type to use for the response.



getDefaultContentType
public String getDefaultContentType()(Code)



getLocale
protected Locale getLocale(RenderRequest request)(Code)
Return the locale to use for the response.



getOutputStream
public OutputStream getOutputStream(OutputStream out, RenderRequest request, String namespace) throws IOException(Code)
Return an OutputStream that wraps the passed OutputStream, or null if there is no specialized writer for this request.



getPortletConfig
protected PortletConfig getPortletConfig(RenderRequest request)(Code)
Get the PortletConfig for the portlet being rendered.



getPortletModes
protected Set<PortletMode> getPortletModes(RenderRequest request)(Code)
Return an Set of the possible portlet modes that the window can have. The list of all possibilities is first obtained from javax.portlet.PortalContext.getSupportedPortletModesa PortalContext.getSupportedPortletModes() . Each one is checked with javax.portlet.PortletRequest.isPortletModeAllowed(javax.portlet.PortletMode) request.isPortletModeAllowed() , if it is allowed then it is included in the returned Set.



getRenderResponse
protected RenderResponse getRenderResponse(RenderRequest request)(Code)
Get the RenderResponse for the portlet being rendered.



getResourceBundle
protected ResourceBundle getResourceBundle(RenderRequest request)(Code)
Get a resource bundle for the portlet being rendered.



getShortTitle
protected String getShortTitle(RenderRequest request)(Code)
Return the short title for the window, or null if a title is not available.
  • A title set by the portlet using request.setAttribute("javax.portlet.short-title");
  • A title set by the portlet using response.setTitle() or request.setAttribute("javax.portlet.title");
  • The value of a lookup in the windows resource bundle for "javax.portlet.short-title" using the locale determined by AbstractRenderer.getLocale(javax.portlet.RenderRequest) getLocale(request) .
  • The value of a lookup in the windows resource bundle for "javax.portlet.title" using the locale determined by AbstractRenderer.getLocale(javax.portlet.RenderRequest) getLocale(request) .



getTitle
protected String getTitle(RenderRequest request)(Code)
Return the title for the window, or null if it has not been set. The title is the first of:
  • A title set by the portlet using response.setTitle() or request.setAttribute("javax.portlet.title");
  • The value of a lookup in the windows resource bundle for "javax.portlet.title" using the locale dertmined by AbstractRenderer.getLocale(javax.portlet.RenderRequest) getLocale(request) .



getWindowStates
protected Set<WindowState> getWindowStates(RenderRequest request)(Code)
Return an Set of the possible window states that the window can have. The list of all possibilities is first obtained from javax.portlet.PortalContext.getSupportedWindowStates PortalContext.getSupportedWindowStates() . Each one is checked with javax.portlet.PortletRequest.isWindowStateAllowed(javax.portlet.WindowState) request.isWindowStateAllowed() , if it is allowed then it is included in the returned Set.



getWriter
public PrintWriter getWriter(PrintWriter out, RenderRequest request, String namespace) throws IOException(Code)
Return a Writer that wraps the passed PrintWriter, or null if there is no specialized writer for this request. This implementation calls beginPage() if needed and beginWindow() before returning the writer.



isAlwaysStream
public boolean isAlwaysStream()(Code)



isAlwaysWrite
public boolean isAlwaysWrite()(Code)



isPortletModeAllowed
public boolean isPortletModeAllowed(PortletRequest request, PortletMode portletMode)(Code)
Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed portlet modes is dependent on the mime type of the response. The default is to return true.



isWindowStateAllowed
public boolean isWindowStateAllowed(PortletRequest request, WindowState windowState)(Code)
Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed window states is dependent on the mime type of the response. The default is to return true.



printEscaped
protected PrintWriter printEscaped(PrintWriter out, CharSequence string)(Code)
Print a string with appropriate escaping for XML, for example '<' becomes '&lt;'.



setAlwaysStream
public void setAlwaysStream(boolean isAlwaysStream)(Code)
If true the portal will always call getOutputStream(), even if the portlet does not call getOutputStream(), unless getWriter() has been called. The default is false.



setAlwaysWrite
public void setAlwaysWrite(boolean isAlwaysWrite)(Code)
If true the portal will always call getWriter(), even if the portlet does not call getWriter(), unless getOutputStream() has been called. The default is true.



setBufferSize
public void setBufferSize(int bufferSize)(Code)
The default is -1, which allows the portal to choose a buffer size. 0 disables buffering of the renderer output.



setDecorateWindow
public void setDecorateWindow(boolean isDecorateWindow)(Code)
If true beginWindow() and endWindow() are always called, if false never called, the default is to call beginWindow() and endWindow() unless beginPage() and endPage() are called.



setDefaultContentType
public void setDefaultContentType(String defaultContentType)(Code)
The default content type used if AbstractRenderer.isAlwaysWrite() or AbstractRenderer.isAlwaysStream() is true and a Writer or OutputStream is obtained before the content type of the response has been set, default is "text/html".



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.