|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Window
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 | |
|---|---|
int |
getBufferSize()
Return a preferred buffer size, may be overridden by the portlet if it calls setBufferSize(). |
java.util.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. |
PortletPreferences |
getDefaultPreferences()
Return the default preferences for the portlet, null if there are no default preferences. |
int |
getExpirationCache()
Time in seconds, 0 disables caching and -1 means never expire. |
PortletConfig |
getPortletConfig()
|
java.util.ArrayList<PreferencesValidator> |
getPreferencesValidators()
Return the preferences validators for the portlet, null if there are no preference validators. |
Renderer |
getRenderer()
|
java.util.Map<java.lang.String,java.lang.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. |
java.util.Set<java.lang.String> |
getSupportedContentTypes(PortletMode portletMode)
Return the content types supported for the mode, null if all content types are permitted. |
java.util.Set<java.util.Locale> |
getSupportedLocales()
Return the Locales supported, null if all Locales are permitted. |
void |
handleConstraintFailure(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. |
void |
handleException(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. |
PortletMode |
handlePortletModeFailure(PortletRequest request,
PortletMode notAllowed)
This is called when a request arrives requesting a PortletMode that does not pass the isPortletModeAllowed() tests. |
WindowState |
handleWindowStateFailure(PortletRequest request,
WindowState notAllowed)
This is called when a request arrives requesting a WindowState that does not pass the isWindowStateAllowed() tests. |
boolean |
isPortletModeAllowed(PortletRequest request,
PortletMode portletMode)
Return true if the PortletMode is allowed. |
boolean |
isPrivate()
Return true if the contents of the portlet are private. |
boolean |
isWindowStateAllowed(PortletRequest request,
WindowState windowState)
Return true if the WindowState is allowed. |
| Method Detail |
|---|
PortletConfig getPortletConfig()
Renderer getRenderer()
int getExpirationCache()
boolean isPrivate()
PortletPreferences getDefaultPreferences()
java.util.ArrayList<PreferencesValidator> getPreferencesValidators()
java.util.Map<java.lang.String,java.lang.String> getRoleRefMap()
java.util.ArrayList<Constraint> getConstraints()
Constraint that are applied before the
processAction() and render() of the portlet are called, null if there
are no Constraints.
java.util.Set<java.lang.String> getSupportedContentTypes(PortletMode portletMode)
java.util.Set<java.util.Locale> getSupportedLocales()
int getBufferSize()
boolean isWindowStateAllowed(PortletRequest request,
WindowState windowState)
portletRequest.getResponseContentType() can be used
if the allowed portlet modes depends on the mime type of the
response.
boolean isPortletModeAllowed(PortletRequest request,
PortletMode portletMode)
portletRequest.getResponseContentType() can be used
if the allowed portlet modes depends on the mime type of the
response.
PortletMode handlePortletModeFailure(PortletRequest request,
PortletMode notAllowed)
handleException to handle
PortletModeException.
WindowState handleWindowStateFailure(PortletRequest request,
WindowState notAllowed)
handleException to handle
WindowStateException.
void handleConstraintFailure(RenderRequest request,
RenderResponse response,
ConstraintFailureEvent event)
throws java.io.IOException,
PortletException
PortletConnection#handleConstraintFailure() is called.
Implementations of this method can change that behaviour by using the
event.setHandled(boolean hideWindow) callback method.
See handleException(RenderRequest, RenderResponse, com.caucho.portal.generic.ExceptionEvent) for more information.
java.io.IOException
PortletException
void handleException(RenderRequest renderRequest,
RenderResponse renderResponse,
ExceptionEvent exceptionEvent)
throws java.io.IOException,
PortletException
PortletConnection#handleException()
is called.
Implementations of this method can change that behaviour by using the
event.setHandled(boolean hideWindow) callback method.
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);
}
public void handleException(ExceptionEvent event)
throws PortletException, IOException
{
log.log(Level.WARNING, ex.toString(), ex);
event.setHandled(true);
}
java.io.IOException
PortletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||