Class PortletApplication
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.web.application.Application
org.exoplatform.webui.application.WebuiApplication
org.exoplatform.webui.application.portlet.PortletApplication
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
May 26, 2006
A portlet application. Every call made to a portlet deployed in eXo PC - and using eXo web framework - is going through this
class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.exoplatform.services.log.Logstatic final StringFields inherited from class org.exoplatform.web.application.Application
EXO_GADGET_TYPE, EXO_PORTAL_TYPE, EXO_PORTLET_TYPE, JSR168_APPLICATION_TYPE, WSRP_TYPEFields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
ConstructorsConstructorDescriptionPortletApplication(javax.portlet.PortletConfig config) This constructor has 2 purposes: 1) recreate the application id 2) configure the resource resolver to look in different UIR scheme (here app: and par:) -
Method Summary
Modifier and TypeMethodDescriptiongetOwnerResourceBundle(String username, Locale locale) getResourceBundle(Locale locale) voidprocessAction(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res) The processAction() method is the one modelled according to the Portlet API specification The process is quite simple and here are te different steps done in the method: 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the class) is referenced 2) A new request context of type PortletRequestContext (which extends the class WebuiRequestContext) is created as a child of the current context instance 3) The new context is place inside the ThreadLocal and hence overides its parent one there, only for the portlet request lifeciclye 4) The method onStartRequest() is called in all the ApplicationLifecycle objects referenced in the webui configuration XML file 5) The StateManager object (in case of portlet it is an object of type ParentAppStateManager) is used to get the RootComponent also referenced in the XML configuration file 6) The methods processDecode(UIApplication, WebuiRequestContext) and processAction(UIApplication, WebuiRequestContext) are then called 7) Finally, a flag, to tell that the processAction phase was done, in the context is set to true and the parent context is restored in the ThreadlocalvoidprocessEvent(javax.portlet.EventRequest req, javax.portlet.EventResponse res) This method is called when a JSR 286 event is targeting the current portlet.voidrender(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res) The render method business logic is quite similar to the processAction() one.voidserveResource(javax.portlet.ResourceRequest req, javax.portlet.ResourceResponse res) This method is called when a JSR 286 serveResource lifecycle method is targeting the current portlet.Methods inherited from class org.exoplatform.webui.application.WebuiApplication
broadcast, createUIComponent, getConfigurationManager, getDefaultUIComponentToUpdateByAjax, getStateManager, onInit, setStateManagerMethods inherited from class org.exoplatform.web.application.Application
getApplicationLifecycle, getApplicationServiceContainer, getAttribute, getResourceResolver, onDestroy, setApplicationLifecycle, setAttribute, setResourceResolverMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
log
protected static org.exoplatform.services.log.Log log -
PORTLET_EVENT_VALUE
- See Also:
-
-
Constructor Details
-
PortletApplication
public PortletApplication(javax.portlet.PortletConfig config) This constructor has 2 purposes: 1) recreate the application id 2) configure the resource resolver to look in different UIR scheme (here app: and par:)
-
-
Method Details
-
getApplicationId
- Specified by:
getApplicationIdin classorg.exoplatform.web.application.Application
-
getApplicationName
- Specified by:
getApplicationNamein classorg.exoplatform.web.application.Application
-
getApplicationGroup
- Specified by:
getApplicationGroupin classorg.exoplatform.web.application.Application
-
getApplicationType
- Specified by:
getApplicationTypein classorg.exoplatform.web.application.Application
-
getResourceBundle
- Specified by:
getResourceBundlein classorg.exoplatform.web.application.Application
-
getOwnerResourceBundle
- Specified by:
getOwnerResourceBundlein classorg.exoplatform.web.application.Application
-
getApplicationInitParam
- Specified by:
getApplicationInitParamin classWebuiApplication
-
processAction
public void processAction(javax.portlet.ActionRequest req, javax.portlet.ActionResponse res) throws Exception The processAction() method is the one modelled according to the Portlet API specification The process is quite simple and here are te different steps done in the method: 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the class) is referenced 2) A new request context of type PortletRequestContext (which extends the class WebuiRequestContext) is created as a child of the current context instance 3) The new context is place inside the ThreadLocal and hence overides its parent one there, only for the portlet request lifeciclye 4) The method onStartRequest() is called in all the ApplicationLifecycle objects referenced in the webui configuration XML file 5) The StateManager object (in case of portlet it is an object of type ParentAppStateManager) is used to get the RootComponent also referenced in the XML configuration file 6) The methods processDecode(UIApplication, WebuiRequestContext) and processAction(UIApplication, WebuiRequestContext) are then called 7) Finally, a flag, to tell that the processAction phase was done, in the context is set to true and the parent context is restored in the Threadlocal- Throws:
Exception
-
processEvent
public void processEvent(javax.portlet.EventRequest req, javax.portlet.EventResponse res) throws Exception This method is called when a JSR 286 event is targeting the current portlet. The event is transformed in a WebUI event using the convention that the 286 event name will target the EventNameActionListener class of one of the UIComponent in the portlet uicomponent tree The event value is passed as an attribute of the PortletRequestContext- Throws:
Exception
-
serveResource
public void serveResource(javax.portlet.ResourceRequest req, javax.portlet.ResourceResponse res) throws Exception This method is called when a JSR 286 serveResource lifecycle method is targeting the current portlet. 1) The current instance of the WebuiRequestContext (stored in a ThreadLocal in the class) is referenced 2) A new request context of type PortletRequestContext (which extends the class WebuiRequestContext) is created as a child of the current context instance 3) The new context is place inside the ThreadLocal and hence overides its parent one there, only for the portlet request lifecycle 4) The method onStartRequest() is called in all the ApplicationLifecycle objects referenced in the webui configuration XML file 5) The StateManager object (in case of portlet it is an object of type ParentAppStateManager) is used to get the RootComponent also referenced in the XML configuration file 6) The method serveResource of UIPortletApplication is called 7) Finally, the method onEndRequest() is called on every ApplicationLifecycle referenced in the portlet configuration XML file and the parent WebuiRequestContext is restored- Throws:
Exception
-
render
public void render(javax.portlet.RenderRequest req, javax.portlet.RenderResponse res) throws Exception The render method business logic is quite similar to the processAction() one. 1) A PortletRequestContext object is created (or extracted from the cache if it already exists) and initialized 2) The PortletRequestContext replaces the parent one in the WebuiRequestContext ThreadLocal object 3) If the portal has already called the portlet processAction() then the call to all onStartRequest of the ApplicationLifecycle has already been made, otherwise we call them 4) The ParentStateManager is also used to get the UIApplication, as we have seen it delegates the call to the PortalStateManager which caches the UI component root associated with the current application 5) the processRender() method of the UIPortletApplucaton is called 6) Finally, the method onEndRequest() is called on every ApplicationLifecycle referenced in the portlet configuration XML file and the parent WebuiRequestContext is restored- Throws:
Exception
-