wicket.protocol.http.portlet
Class PortletApplication

java.lang.Object
  extended by wicket.Application
      extended by wicket.protocol.http.portlet.PortletApplication
All Implemented Interfaces:
ISessionFactory

public abstract class PortletApplication
extends Application
implements ISessionFactory

A portlet application is a subclass of Application which associates with an instance of WicketPortlet to serve pages as portlets. This class is intended to be subclassed by framework clients to define a web application.

Application settings are given defaults by the Portletapplication() constructor and internalInit method, such as error page classes appropriate for portlets. PortletApplication subclasses can override these values and/or modify other application settings by overriding the init() method and then by calling getXXXSettings() to retrieve an interface to a mutable Settings object. Do not do this in the constructor itself because the defaults will then override your settings.

Author:
Janne Hietamäki
See Also:
WicketPortlet, IApplicationSettings, IDebugSettings, IExceptionSettings, IMarkupSettings, IPageSettings, IRequestCycleSettings, IResourceSettings, ISecuritySettings, ISessionSettings

Field Summary
 
Fields inherited from class wicket.Application
CONFIGURATION, CONTEXTPATH, DEPLOYMENT, DEVELOPMENT
 
Constructor Summary
PortletApplication()
           
 
Method Summary
 void destroyPortlet()
           
 IRequestCycleProcessor getActionRequestCycleProcessor()
           
 java.lang.String getApplicationKey()
          Gets the unique key of this application within a given context (like a web application).
protected  IRequestCycleFactory getDefaultRequestCycleFactory()
          Create a request cycle factory which is used by default by WebSession.
protected  IRequestCycleProcessor getRenderRequestCycleProcessor()
          Gets the default request cycle processor (with lazy initialization).
 RequestLogger getRequestLogger()
          Gets the RequestLogger.
 WicketPortletSession getSession(WicketPortletRequest request)
           
 java.lang.String getSessionAttributePrefix(WicketPortletRequest request)
          Gets the prefix for storing variables in the actual session (typically HttpSession for this application instance.
protected  ISessionFactory getSessionFactory()
          Gets the factory for creating session instances.
 WicketPortlet getWicketPortlet()
           
 void initPortlet()
           
protected  void internalInit()
          THIS METHOD IS NOT PART OF THE WICKET PUBLIC API.
protected  IRequestCycleProcessor newActionRequestCycleProcessor()
          May be replaced by subclasses which whishes to uses there own implementation of IRequestCycleProcessor
 WicketPortletRequest newPortletRequest(javax.portlet.PortletRequest req)
           
 WicketPortletResponse newPortletResponse(javax.portlet.PortletResponse res)
           
protected  IRequestCycleProcessor newRenderRequestCycleProcessor()
          May be replaced by subclasses which whishes to uses there own implementation of IRequestCycleProcessor
 Session newSession()
          Creates a new session
protected  ISessionStore newSessionStore()
          Creates a new session facade.
 void setRequestLogger(RequestLogger logger)
          Sets the RequestLogger.
 void setWicketPortlet(WicketPortlet portlet)
           
 
Methods inherited from class wicket.Application
addComponentInstantiationListener, configure, configure, configure, destroy, exists, get, get, getAjaxSettings, getApplicationSettings, getConfigurationType, getDebugSettings, getExceptionSettings, getFrameworkSettings, getHomePage, getMarkupCache, getMarkupSettings, getMetaData, getName, getPageSettings, getRequestCycleSettings, getResourceSettings, getSecuritySettings, getSessionSettings, getSessionStore, getSettings, getSharedResources, init, initializeComponents, internalDestroy, isAttached, logEventTarget, logResponseTarget, removeComponentInstantiationListener, set, setMetaData, unset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletApplication

public PortletApplication()
Method Detail

setWicketPortlet

public void setWicketPortlet(WicketPortlet portlet)
Parameters:
portlet -

getWicketPortlet

public WicketPortlet getWicketPortlet()
Returns:
portlet

getSession

public WicketPortletSession getSession(WicketPortletRequest request)
Parameters:
request -
Returns:
PortletSession

newPortletResponse

public WicketPortletResponse newPortletResponse(javax.portlet.PortletResponse res)
Parameters:
res -
Returns:
new WicketPortletResponse

newPortletRequest

public WicketPortletRequest newPortletRequest(javax.portlet.PortletRequest req)
Parameters:
req -
Returns:
new WicketPortletRequest

getApplicationKey

public java.lang.String getApplicationKey()
Description copied from class: Application
Gets the unique key of this application within a given context (like a web application). NOT INTENDED FOR FRAMEWORK CLIENTS.

Specified by:
getApplicationKey in class Application
Returns:
The unique key of this application

getSessionFactory

protected ISessionFactory getSessionFactory()
Description copied from class: Application
Gets the factory for creating session instances.

Specified by:
getSessionFactory in class Application
Returns:
Factory for creating session instances

newSessionStore

protected ISessionStore newSessionStore()
Description copied from class: Application
Creates a new session facade. Is called once per application, and is typically not something clients reimplement.

Specified by:
newSessionStore in class Application
Returns:
The session facade

newSession

public Session newSession()
Description copied from interface: ISessionFactory
Creates a new session

Specified by:
newSession in interface ISessionFactory
Returns:
The session

initPortlet

public void initPortlet()

internalInit

protected void internalInit()
THIS METHOD IS NOT PART OF THE WICKET PUBLIC API. DO NOT CALL IT. Internal intialization. First determine the deployment mode. First check the system property -Dwicket.configuration. If it does not exist check the portlet init parameter ( <init-param><param-name>configuration</param-name>). If not found check the portlet context init paramer <context-param><param-name6gt;configuration</param-name>). If the parameter is "development" (which is default), settings appropriate for development are set. If it's "deployment" , deployment settings are used. If development is specified and a "sourceFolder" init parameter is also set, then resources in that folder will be polled for changes.

Overrides:
internalInit in class Application

destroyPortlet

public void destroyPortlet()

getDefaultRequestCycleFactory

protected IRequestCycleFactory getDefaultRequestCycleFactory()
Create a request cycle factory which is used by default by WebSession. You may provide your own default factory by subclassing WebApplication and overriding this method or your may subclass WebSession to create a session specific request cycle factory.

Returns:
Request cycle factory
See Also:
WebSession.getRequestCycleFactory(), IRequestCycleFactory

newRenderRequestCycleProcessor

protected IRequestCycleProcessor newRenderRequestCycleProcessor()
May be replaced by subclasses which whishes to uses there own implementation of IRequestCycleProcessor

Returns:
IRequestCycleProcessor

newActionRequestCycleProcessor

protected IRequestCycleProcessor newActionRequestCycleProcessor()
May be replaced by subclasses which whishes to uses there own implementation of IRequestCycleProcessor

Returns:
IRequestCycleProcessor

getActionRequestCycleProcessor

public IRequestCycleProcessor getActionRequestCycleProcessor()
Returns:
the request cycle processor

getRenderRequestCycleProcessor

protected final IRequestCycleProcessor getRenderRequestCycleProcessor()
Gets the default request cycle processor (with lazy initialization). This is the IRequestCycleProcessor that will be used by RequestCycles when custom implementations of the request cycle do not provide their own customized versions.

Returns:
the default request cycle processor

getRequestLogger

public final RequestLogger getRequestLogger()
Gets the RequestLogger.

Returns:
The RequestLogger

setRequestLogger

public final void setRequestLogger(RequestLogger logger)
Sets the RequestLogger.

Parameters:
logger - The request logger

getSessionAttributePrefix

public final java.lang.String getSessionAttributePrefix(WicketPortletRequest request)
Gets the prefix for storing variables in the actual session (typically HttpSession for this application instance.

Parameters:
request - the request
Returns:
the prefix for storing variables in the actual session


Copyright © 2004-2007 Wicket developers. All Rights Reserved.