Java Doc for Window.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) 


com.caucho.portal.generic.Window

All known Subclasses:   com.caucho.portal.generic.PortletServlet,  com.caucho.portal.generic.GenericWindow,
Window
public interface Window (Code)
A Window represents the use of a portlet on a page. The Window interface is the main point of contact between a portal implementation and the generic portlet codebase.




Method Summary
public  intgetBufferSize()
     Return a preferred buffer size, may be overridden by the portlet if it calls setBufferSize().
public  ArrayList<Constraint>getConstraints()
     Return a list of Constraint that are applied before the processAction() and render() of the portlet are called, null if there are no Constraints.
public  PortletPreferencesgetDefaultPreferences()
     Return the default preferences for the portlet, null if there are no default preferences.
public  intgetExpirationCache()
     Time in seconds, 0 disables caching and -1 means never expire.
public  PortletConfiggetPortletConfig()
    
public  ArrayList<PreferencesValidator>getPreferencesValidators()
     Return the preferences validators for the portlet, null if there are no preference validators.
public  RenderergetRenderer()
    
public  Map<String, String>getRoleRefMap()
     Return a map that map's role names used by the portlet to the role names recognized by the portal, null if the role names used by the portlet are to be used unchanged.
public  Set<String>getSupportedContentTypes(PortletMode portletMode)
     Return the content types supported for the mode, null if all content types are permitted.
public  Set<Locale>getSupportedLocales()
     Return the Locales supported, null if all Locales are permitted.
public  voidhandleConstraintFailure(RenderRequest request, RenderResponse response, ConstraintFailureEvent event)
     Optionally handle a constraint failure by sending some output to the client using the response or by hiding the window. When a Portlet fails a Constriant during processAction(), it is stored until the render stage, and handleConstriantFailure() is called instead of render(). When a Portlet fails a Constraint during render(), handleConstriantFailure() is immediately called. If the implementation of this method does nothing, then the response of this window is reset() and the failure propagates to the parent window. If there is no parent window, PortletConnection.handleConstraintFailure is called. Implementations of this method can change that behaviour by using the event.setHandled(boolean hideWindow) callback method.
public  voidhandleException(RenderRequest renderRequest, RenderResponse renderResponse, ExceptionEvent exceptionEvent)
     Optionally handle an exception by sending some output to the client using the response or by hiding the window. When a Portlet throws an Exception during processAction(), it is stored until the render stage, and handleException() is called instead of render(). When a Portlet throws an exception during render(), the handleException() is immediately called. If the implementation of this method does nothing, then the repsonse of this window is reset() and the exception propagates to the parent window. If there is no parent window, PortletConnection.handleException is called. Implementations of this method can change that behaviour by using the event.setHandled(boolean hideWindow) callback method.
public  PortletModehandlePortletModeFailure(PortletRequest request, PortletMode notAllowed)
     This is called when a request arrives requesting a PortletMode that does not pass the isPortletModeAllowed() tests. It gives the Window an opportunity to return a PortletMode that can be used.
public  WindowStatehandleWindowStateFailure(PortletRequest request, WindowState notAllowed)
     This is called when a request arrives requesting a WindowState that does not pass the isWindowStateAllowed() tests. It gives the Window an opportunity to return a WindowState that can be used.
public  booleanisPortletModeAllowed(PortletRequest request, PortletMode portletMode)
     Return true if the PortletMode is allowed.
public  booleanisPrivate()
     Return true if the contents of the portlet are private.
public  booleanisWindowStateAllowed(PortletRequest request, WindowState windowState)
     Return true if the WindowState is allowed.



Method Detail
getBufferSize
public int getBufferSize()(Code)
Return a preferred buffer size, may be overridden by the portlet if it calls setBufferSize(). A value of 0 disables buffering for the portlet. A value of -1 allows the portal to use a default buffer size.



getConstraints
public ArrayList<Constraint> getConstraints()(Code)
Return a list of Constraint that are applied before the processAction() and render() of the portlet are called, null if there are no Constraints.



getDefaultPreferences
public PortletPreferences getDefaultPreferences()(Code)
Return the default preferences for the portlet, null if there are no default preferences.



getExpirationCache
public int getExpirationCache()(Code)
Time in seconds, 0 disables caching and -1 means never expire.



getPortletConfig
public PortletConfig getPortletConfig()(Code)



getPreferencesValidators
public ArrayList<PreferencesValidator> getPreferencesValidators()(Code)
Return the preferences validators for the portlet, null if there are no preference validators.



getRenderer
public Renderer getRenderer()(Code)



getRoleRefMap
public Map<String, String> getRoleRefMap()(Code)
Return a map that map's role names used by the portlet to the role names recognized by the portal, null if the role names used by the portlet are to be used unchanged.



getSupportedContentTypes
public Set<String> getSupportedContentTypes(PortletMode portletMode)(Code)
Return the content types supported for the mode, null if all content types are permitted.



getSupportedLocales
public Set<Locale> getSupportedLocales()(Code)
Return the Locales supported, null if all Locales are permitted.



handleConstraintFailure
public void handleConstraintFailure(RenderRequest request, RenderResponse response, ConstraintFailureEvent event) throws IOException, PortletException(Code)
Optionally handle a constraint failure by sending some output to the client using the response or by hiding the window. When a Portlet fails a Constriant during processAction(), it is stored until the render stage, and handleConstriantFailure() is called instead of render(). When a Portlet fails a Constraint during render(), handleConstriantFailure() is immediately called. If the implementation of this method does nothing, then the response of this window is reset() and the failure propagates to the parent window. If there is no parent window, PortletConnection.handleConstraintFailure is called. Implementations of this method can change that behaviour by using the event.setHandled(boolean hideWindow) callback method. See Window.handleException for more information.



handleException
public void handleException(RenderRequest renderRequest, RenderResponse renderResponse, ExceptionEvent exceptionEvent) throws IOException, PortletException(Code)
Optionally handle an exception by sending some output to the client using the response or by hiding the window. When a Portlet throws an Exception during processAction(), it is stored until the render stage, and handleException() is called instead of render(). When a Portlet throws an exception during render(), the handleException() is immediately called. If the implementation of this method does nothing, then the repsonse of this window is reset() and the exception propagates to the parent window. If there is no parent window, PortletConnection.handleException is called. Implementations of this method can change that behaviour by using the event.setHandled(boolean hideWindow) callback method.

exceptionEvent.setHandled(false)

If handleException calls exceptionEvent.setHandled(false) then the content that the portlet has written is kept, and the request continues. Implementations use this when they have written some contents to the portlet that should be visible to the user.
 public void handleException(RenderRequest request, RenderResponse response, ExceptionEvent event)
 throws PortletException, IOException 
 {
 if (event.getException() instanceof UnavailableException) {
 PrintWriter out = response.getWriter();
 response.setContentType("text/html"); 
 out.println("This service is currently unavailable."); 
 event.setHandled(false);
 } 
 } 
 
If an implementation is handling an exception that can occur after the Portlet has written some content already, it should call response.reset() before it writes anything to the response.
 public void handleException(RenderRequest request, RenderResponse response, ExceptionEvent event)
 throws PortletException, IOException 
 {
 response.reset(); 
 response.setContentType("text/html"); 
 PrintWriter out = response.getWriter();
 printFancyExceptionMessage(event.getException());
 event.setHandled(false);
 } 
 

exceptionEvent.setHandled(true)

If handleException calls exceptionEvent.setHandled(true) then the output is reset(), including any output from a Renderer, and the request continues. The effect of this call is to make the window invisible, no content for this window is shown but other windows on the page will be shown. Implementations use this when they have dealt with the exception in some way and wish to hide the exception from the user.
 public void handleException(ExceptionEvent event)
 throws PortletException, IOException 
 {
 log.log(Level.WARNING, ex.toString(), ex);
 event.setHandled(true); 
 } 
 



handlePortletModeFailure
public PortletMode handlePortletModeFailure(PortletRequest request, PortletMode notAllowed)(Code)
This is called when a request arrives requesting a PortletMode that does not pass the isPortletModeAllowed() tests. It gives the Window an opportunity to return a PortletMode that can be used. If the returned mode is also not allowed, a PortletModeException occurs. Implementations can use handleException to handle PortletModeException. a new PortletMode to try, or null to cause an exception.



handleWindowStateFailure
public WindowState handleWindowStateFailure(PortletRequest request, WindowState notAllowed)(Code)
This is called when a request arrives requesting a WindowState that does not pass the isWindowStateAllowed() tests. It gives the Window an opportunity to return a WindowState that can be used. If the returned window state is also not allowed, a WindowStateException occurs. Implementations can use handleException to handle WindowStateException. a new WindowState to try, or null to cause an exception,



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



isPrivate
public boolean isPrivate()(Code)
Return true if the contents of the portlet are private. The portlet specification states that "cached content must not be shared across different user clients displaying the same portlet". If a portal implementation supports caching, then a return value of false will allow the portal to share the cached content across different user clients.



isWindowStateAllowed
public boolean isWindowStateAllowed(PortletRequest request, WindowState windowState)(Code)
Return true if the WindowState is allowed. portletRequest.getResponseContentType() can be used if the allowed portlet modes depends on the mime type of the response.



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