Class ComponentRequestRouter<T extends ComponentSessionController>
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.silverpeas.core.web.mvc.webcomponent.SilverpeasHttpServlet
-
- org.silverpeas.core.web.mvc.webcomponent.SilverpeasAuthenticatedHttpServlet
-
- org.silverpeas.core.web.mvc.route.ComponentRequestRouter<T>
-
- Type Parameters:
T
- the concrete type of the web controller of the targeted application to which the processing of the request is taken in charge.
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
- Direct Known Subclasses:
AdminComponentRequestRouter
,AgendaRequestRouter
,ClipboardRequestRouter
,DirectoryRequestRouter
,FileSharingRequestRouter
,FormTemplateRequestRouter
,ImportExportRequestRouter
,InterestCenterPeasRequestRouter
,JobSearchPeasRequestRouter
,MyContactProfilRequestRouter
,MyProfilRequestRouter
,PdcClassifyRequestRouter
,PdcSearchRequestRouter
,PdcSubscriptionPeasRequestRouter
,PdcUtilizationRequestRouter
,PersoPeasRequestRouter
,POPUPRequestRouter
,ProfilRequestRouter
,SelectionPeasWrapper
,SILVERMAILRequestRouter
,SubscriptionRequestRouter
,ThesaurusRequestRouter
,TodoRequestRouter
,UserNotificationRequestRouter
,VersioningRequestRouter
,WebComponentRequestRouter
,WebConnectionsRequestRouter
public abstract class ComponentRequestRouter<T extends ComponentSessionController> extends SilverpeasAuthenticatedHttpServlet
A request router for a given Silverpeas component instance. The user must be authenticated to access an application in Silverpeas (even in the case of an anonymous access) and such accesses are managed by aComponentRequestRouter
instance.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.silverpeas.core.web.mvc.webcomponent.SilverpeasHttpServlet
SilverpeasHttpServlet.HttpError, SilverpeasHttpServlet.UserSessionStatus
-
-
Constructor Summary
Constructors Constructor Description ComponentRequestRouter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkUserAuthorization(String function, T componentSC)
Check that user can access the component session controller function.abstract T
createComponentSessionController(MainSessionController mainSessionCtrl, ComponentContext componentContext)
void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
void
doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected String
emptyJsonResponse()
static String[]
getComponentId(javax.servlet.http.HttpServletRequest request, MainSessionController mainSessionCtrl)
abstract String
getDestination(String function, T componentSC, HttpRequest request)
This method has to be implemented by the component request Router it has to compute a destination pageprotected OrganizationController
getOrganizationController()
abstract String
getSessionControlBeanName()
This method has to be implemented in the component request Router class. returns the session control bean name to be put in the request object ex : for almanach, returns "almanach"protected boolean
hasTheSessionSecurityTokenToBeRenewed(javax.servlet.http.HttpServletRequest request, String function)
Indicates if the session security token has to be renewed from the given requested function?protected String
sendJson(String jsonContent)
void
updateSessionManagement(javax.servlet.http.HttpSession session, String destination)
-
Methods inherited from class org.silverpeas.core.web.mvc.webcomponent.SilverpeasAuthenticatedHttpServlet
getMainSessionController, getSessionInfo, getSynchronizerTokenService, renewSessionSecurityToken, service, throwUserSessionExpiration
-
Methods inherited from class org.silverpeas.core.web.mvc.webcomponent.SilverpeasHttpServlet
existOpenedUserSession, forbidden, notFound, preconditionFailed, redirectOrForwardService, sendError, sendError, throwHttpForbiddenError, throwHttpForbiddenError, throwHttpNotFoundError, throwHttpNotFoundError, throwHttpPreconditionFailedError, throwHttpPreconditionFailedError
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
getSessionControlBeanName
public abstract String getSessionControlBeanName()
This method has to be implemented in the component request Router class. returns the session control bean name to be put in the request object ex : for almanach, returns "almanach"- Returns:
- the name of the session controller.
-
getDestination
public abstract String getDestination(String function, T componentSC, HttpRequest request)
This method has to be implemented by the component request Router it has to compute a destination page- Parameters:
function
- The entering request function (ex : "Main.jsp", when accessing "http://localhost/webactiv/Ralmanach/jsp/Main.jsp")componentSC
- The component Session Controller, build and initialised.request
- The entering request. The request Router need it to get parameters- Returns:
- The complete destination URL for a forward (ex : "/almanach/jsp/almanach.jsp?flag=user")
-
checkUserAuthorization
protected boolean checkUserAuthorization(String function, T componentSC)
Check that user can access the component session controller function. Default behavior return true in order to limit impact for each component session controller. Each session controller must override this method in order to add access control.- Parameters:
function
- the current function actioncomponentSC
- the component session controller- Returns:
- true if user can process function, false else if.
-
createComponentSessionController
public abstract T createComponentSessionController(MainSessionController mainSessionCtrl, ComponentContext componentContext)
-
hasTheSessionSecurityTokenToBeRenewed
protected final boolean hasTheSessionSecurityTokenToBeRenewed(javax.servlet.http.HttpServletRequest request, String function)
Indicates if the session security token has to be renewed from the given requested function? The answer depends first on thesecurity.web.protection.sessiontoken.renew
parameter defined inorg/silverpeas/util/security.properties
and secondly on the choice made by some of the component request router.
The Referer information from headers is verified. If the referer is equals to the current request URI, then the session security token is never renewed.- Returns:
- true if the token has to be renewed
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
- Overrides:
doPost
in classjavax.servlet.http.HttpServlet
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
-
updateSessionManagement
public void updateSessionManagement(javax.servlet.http.HttpSession session, String destination)
-
emptyJsonResponse
protected String emptyJsonResponse()
-
getComponentId
public static String[] getComponentId(javax.servlet.http.HttpServletRequest request, MainSessionController mainSessionCtrl)
-
getOrganizationController
protected OrganizationController getOrganizationController()
-
-