com.vaadin.terminal.gwt.server
Class AbstractApplicationPortlet

java.lang.Object
  extended by GenericPortlet
      extended by com.vaadin.terminal.gwt.server.AbstractApplicationPortlet
All Implemented Interfaces:
Constants
Direct Known Subclasses:
ApplicationPortlet2

public abstract class AbstractApplicationPortlet
extends GenericPortlet
implements Constants

Portlet 2.0 base class. This replaces the servlet in servlet/portlet 1.0 deployments and handles various portlet requests from the browser. TODO Document me!

Author:
peholmst

Nested Class Summary
static class AbstractApplicationPortlet.AbstractApplicationPortletWrapper
           
 class AbstractApplicationPortlet.RequestError
           
protected static class AbstractApplicationPortlet.RequestType
           
static class AbstractApplicationPortlet.WrappedGateinRequest
           
static class AbstractApplicationPortlet.WrappedHttpAndPortletRequest
           
static class AbstractApplicationPortlet.WrappedLiferayRequest
           
 
Field Summary
static String PORTAL_PARAMETER_VAADIN_THEME
          This portal parameter is used to define the name of the Vaadin theme that is used for all Vaadin applications in the portal.
static String PORTLET_PARAMETER_STYLE
          This portlet parameter is used to add styles to the main element.
static String WRITE_AJAX_PAGE_SCRIPT_WIDGETSET_SHOULD_WRITE
           
 
Fields inherited from interface com.vaadin.terminal.gwt.server.Constants
AJAX_UIDL_URI, DEFAULT_BUFFER_SIZE, DEFAULT_THEME_CACHETIME, DEFAULT_THEME_NAME, DEFAULT_WIDGETSET, ERROR_NO_ROOT_FOUND, INVALID_SECURITY_KEY_MSG, MAX_BUFFER_SIZE, NOT_PRODUCTION_MODE_INFO, PARAMETER_VAADIN_RESOURCES, PARAMETER_WIDGETSET, PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, PORTAL_PARAMETER_VAADIN_WIDGETSET, SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, SERVLET_PARAMETER_PRODUCTION_MODE, SERVLET_PARAMETER_RESOURCE_CACHE_TIME, THEME_DIRECTORY_PATH, URL_PARAMETER_CLOSE_APPLICATION, URL_PARAMETER_REPAINT_ALL, URL_PARAMETER_RESTART_APPLICATION, URL_PARAMETER_THEME, WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC, WARNING_XSRF_PROTECTION_DISABLED, WIDGETSET_DIRECTORY_PATH, WIDGETSET_MISMATCH_INFO
 
Constructor Summary
AbstractApplicationPortlet()
           
 
Method Summary
protected  WrappedPortletRequest createWrappedRequest(PortletRequest request)
          Wraps the request in a (possibly portal specific) wrapped portlet request.
protected  void doDispatch(RenderRequest request, RenderResponse response)
           
protected abstract  Class<? extends Application> getApplicationClass()
           
protected  PortletApplicationContext2 getApplicationContext(PortletSession portletSession)
          Gets the application context for a PortletSession.
protected  String getApplicationOrSystemProperty(String parameterName, String defaultValue)
          Gets an application or system property value.
protected  String getApplicationProperty(String parameterName)
          Gets an application property value.
protected  ClassLoader getClassLoader()
           
protected  Application getNewApplication(PortletRequest request)
           
protected  AbstractApplicationPortlet.RequestType getRequestType(PortletRequest request)
           
protected  Application.SystemMessages getSystemMessages()
          Get system messages from the current application class
protected  String getSystemProperty(String parameterName)
          Gets an system property value.
protected  void handleRequest(PortletRequest request, PortletResponse response)
           
 void init(PortletConfig config)
           
 boolean isProductionMode()
          Returns true if the servlet is running in production mode.
 void processAction(ActionRequest request, ActionResponse response)
           
 void processEvent(EventRequest request, EventResponse response)
           
 void serveResource(ResourceRequest request, ResourceResponse response)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORTLET_PARAMETER_STYLE

public static final String PORTLET_PARAMETER_STYLE
This portlet parameter is used to add styles to the main element. E.g "height:500px" generates a style="height:500px" to the main element.

See Also:
Constant Field Values

PORTAL_PARAMETER_VAADIN_THEME

public static final String PORTAL_PARAMETER_VAADIN_THEME
This portal parameter is used to define the name of the Vaadin theme that is used for all Vaadin applications in the portal.

See Also:
Constant Field Values

WRITE_AJAX_PAGE_SCRIPT_WIDGETSET_SHOULD_WRITE

public static final String WRITE_AJAX_PAGE_SCRIPT_WIDGETSET_SHOULD_WRITE
See Also:
Constant Field Values
Constructor Detail

AbstractApplicationPortlet

public AbstractApplicationPortlet()
Method Detail

init

public void init(PortletConfig config)
          throws PortletException
Throws:
PortletException

getApplicationProperty

protected String getApplicationProperty(String parameterName)
Gets an application property value.

Parameters:
parameterName - the Name or the parameter.
Returns:
String value or null if not found

getSystemProperty

protected String getSystemProperty(String parameterName)
Gets an system property value.

Parameters:
parameterName - the Name or the parameter.
Returns:
String value or null if not found

getApplicationOrSystemProperty

protected String getApplicationOrSystemProperty(String parameterName,
                                                String defaultValue)
Gets an application or system property value.

Parameters:
parameterName - the Name or the parameter.
defaultValue - the Default to be used.
Returns:
String value or default if not found

getRequestType

protected AbstractApplicationPortlet.RequestType getRequestType(PortletRequest request)

isProductionMode

public boolean isProductionMode()
Returns true if the servlet is running in production mode. Production mode disables all debug facilities.

Returns:
true if in production mode, false if in debug mode

handleRequest

protected void handleRequest(PortletRequest request,
                             PortletResponse response)
                      throws PortletException,
                             IOException
Throws:
PortletException
IOException

createWrappedRequest

protected WrappedPortletRequest createWrappedRequest(PortletRequest request)
Wraps the request in a (possibly portal specific) wrapped portlet request.

Parameters:
request - The original PortletRequest
Returns:
A wrapped version of the PorletRequest

processEvent

public void processEvent(EventRequest request,
                         EventResponse response)
                  throws PortletException,
                         IOException
Throws:
PortletException
IOException

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
                   throws PortletException,
                          IOException
Throws:
PortletException
IOException

doDispatch

protected void doDispatch(RenderRequest request,
                          RenderResponse response)
                   throws PortletException,
                          IOException
Throws:
PortletException
IOException

serveResource

public void serveResource(ResourceRequest request,
                          ResourceResponse response)
                   throws PortletException,
                          IOException
Throws:
PortletException
IOException

getApplicationClass

protected abstract Class<? extends Application> getApplicationClass()
                                                             throws ClassNotFoundException
Throws:
ClassNotFoundException

getNewApplication

protected Application getNewApplication(PortletRequest request)
                                 throws PortletException
Throws:
PortletException

getClassLoader

protected ClassLoader getClassLoader()
                              throws PortletException
Throws:
PortletException

getSystemMessages

protected Application.SystemMessages getSystemMessages()
Get system messages from the current application class

Returns:

getApplicationContext

protected PortletApplicationContext2 getApplicationContext(PortletSession portletSession)
Gets the application context for a PortletSession. If no context is currently stored in a session a new context is created and stored in the session.

Parameters:
portletSession - the portlet session.
Returns:
the application context for the session.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.