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
- Direct Known Subclasses:
PortalDraftRequestHandler,PortalTemplateRequestHandler
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.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final PortalApplicationFactoryprotected Stringstatic final Stringstatic final org.exoplatform.web.controller.QualifiedName.protected static final org.exoplatform.services.log.Logprotected Stringprotected static final Stringprotected org.exoplatform.portal.config.UserPortalConfigServicestatic 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 TypeMethodDescriptionprotected voidendRequestPhaseLifecycle(PortalApplication app, PortalRequestContext context, List<org.exoplatform.web.application.ApplicationLifecycle> lifecycles, org.exoplatform.web.application.Phase phase) booleanexecute(org.exoplatform.web.ControllerContext controllerContext) This method will handle incoming portal request.protected LocalegetRequestLocale(org.exoplatform.web.ControllerContext controllerContext) 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 threadprotected booleanprocessRequest(org.exoplatform.web.ControllerContext controllerContext, String requestSiteType, String requestSiteName, String requestPath, Locale requestLocale) protected voidstartRequestPhaseLifecycle(PortalApplication app, PortalRequestContext context, List<org.exoplatform.web.application.ApplicationLifecycle> lifecycles, org.exoplatform.web.application.Phase phase) Methods inherited from class org.exoplatform.web.WebRequestHandler
onDestroyMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
HANDLER_NAME
- See Also:
-
LOG
protected static final 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. -
APPP_ROVIDER
-
PORTAL_PUBLIC_PAGE_NOT_FOUND
- See Also:
-
portalConfigService
protected org.exoplatform.portal.config.UserPortalConfigService portalConfigService -
globalPortal
-
metaPortal
-
-
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- Specified by:
executein classorg.exoplatform.web.WebRequestHandler- Throws:
Exception
-
processRequest
protected boolean processRequest(org.exoplatform.web.ControllerContext controllerContext, String requestSiteType, String requestSiteName, String requestPath, Locale requestLocale) throws Exception - Throws:
Exception
-
getRequiresLifeCycle
protected boolean getRequiresLifeCycle()- Specified by:
getRequiresLifeCyclein classorg.exoplatform.web.WebRequestHandler
-
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
-
startRequestPhaseLifecycle
protected void startRequestPhaseLifecycle(PortalApplication app, PortalRequestContext context, List<org.exoplatform.web.application.ApplicationLifecycle> lifecycles, org.exoplatform.web.application.Phase phase) -
endRequestPhaseLifecycle
protected void endRequestPhaseLifecycle(PortalApplication app, PortalRequestContext context, List<org.exoplatform.web.application.ApplicationLifecycle> lifecycles, org.exoplatform.web.application.Phase phase) -
getRequestLocale
-