Class PortalRequestHandler
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.web.WebRequestHandler
org.exoplatform.portal.application.PortalRequestHandler
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public class PortalRequestHandler
extends org.exoplatform.web.WebRequestHandler
Created by The eXo Platform SAS Dec 9, 2006
This is 'portal' handler, it handle the request of URLs that are routed by navigation controller (using urls parameter).
This handler is registered to WebAppController by xml configuration.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.exoplatform.web.controller.QualifiedName.protected static org.exoplatform.services.log.Logstatic final org.exoplatform.web.controller.QualifiedName.static final org.exoplatform.web.controller.QualifiedName.static final org.exoplatform.web.controller.QualifiedName.Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(org.exoplatform.web.ControllerContext controllerContext) This method will handle incoming portal request.protected booleanvoidonInit(org.exoplatform.web.WebAppController controller, jakarta.servlet.ServletConfig sConfig) Dispatched from WebAppController, after the portal servlet init function called, this method create and register PortalApplication to WebAppController PortalApplication creation can be customized by registering PortalApplicationFactory implementation using ServiceLoaderprotected voidprocessRequest(PortalRequestContext context, PortalApplication app) This method do the main job on processing a portal request: 1) Call onStartRequest() on each ApplicationLifecycle object
2) Get the StateManager object from the PortalApplication (also referenced in the XML file)
3) Use the StateManager to get a reference on the root UI component: UIApplication; the method used is restoreUIRootComponent(context)
4) If the UI component is not the current one in used in the PortalContextRequest, then replace it
5) Process decode on the PortalApplication
6) Process Action on the PortalApplication
7) Process Render on the UIApplication UI component
8) call onEndRequest on all the ApplicationLifecycle
9) Release the context from the threadMethods inherited from class org.exoplatform.web.WebRequestHandler
onDestroyMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
log
protected static org.exoplatform.services.log.Log log -
REQUEST_PATH
public static final org.exoplatform.web.controller.QualifiedName REQUEST_PATH. -
REQUEST_SITE_TYPE
public static final org.exoplatform.web.controller.QualifiedName REQUEST_SITE_TYPE. -
REQUEST_SITE_NAME
public static final org.exoplatform.web.controller.QualifiedName REQUEST_SITE_NAME. -
LANG
public static final org.exoplatform.web.controller.QualifiedName LANG.
-
-
Constructor Details
-
PortalRequestHandler
public PortalRequestHandler()
-
-
Method Details
-
getHandlerName
- Specified by:
getHandlerNamein classorg.exoplatform.web.WebRequestHandler
-
onInit
public void onInit(org.exoplatform.web.WebAppController controller, jakarta.servlet.ServletConfig sConfig) throws Exception Dispatched from WebAppController, after the portal servlet init function called, this method create and register PortalApplication to WebAppController PortalApplication creation can be customized by registering PortalApplicationFactory implementation using ServiceLoader- Overrides:
onInitin classorg.exoplatform.web.WebRequestHandler- Throws:
Exception- See Also:
-
execute
This method will handle incoming portal request. It gets a reference to the WebAppController Here are the steps done in the method: 1) Get the PortalApplication reference from the controller
2) Create a PortalRequestContext object that is a convenient wrapper on all the request information
3) Get the collection of ApplicationLifecycle referenced in the PortalApplication and defined in the webui-configuration.xml of the portal application
4) Set that context in a ThreadLocal to easily access it
5) Check if user have permission to access portal, if not, send 403 status code, if user has not login, redirect to login page
6) dispatch to processRequest method, this is protected method, we can extend and override this method to write a new requestHandler base on PortalRequestHandler 7) set the header Cache-Control to no-cache or to the value specified in the portal configuration- Specified by:
executein classorg.exoplatform.web.WebRequestHandler- Throws:
Exception
-
processRequest
This method do the main job on processing a portal request: 1) Call onStartRequest() on each ApplicationLifecycle object
2) Get the StateManager object from the PortalApplication (also referenced in the XML file)
3) Use the StateManager to get a reference on the root UI component: UIApplication; the method used is restoreUIRootComponent(context)
4) If the UI component is not the current one in used in the PortalContextRequest, then replace it
5) Process decode on the PortalApplication
6) Process Action on the PortalApplication
7) Process Render on the UIApplication UI component
8) call onEndRequest on all the ApplicationLifecycle
9) Release the context from the thread- Parameters:
context-app-- Throws:
Exception
-
getRequiresLifeCycle
protected boolean getRequiresLifeCycle()- Specified by:
getRequiresLifeCyclein classorg.exoplatform.web.WebRequestHandler
-