com.stratelia.silverpeas.peasCore.servlets
Class ComponentRequestRouter<T extends ComponentSessionController>

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.stratelia.silverpeas.peasCore.servlets.SilverpeasHttpServlet
              extended by com.stratelia.silverpeas.peasCore.servlets.SilverpeasAuthenticatedHttpServlet
                  extended by com.stratelia.silverpeas.peasCore.servlets.ComponentRequestRouter<T>
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AgendaRequestRouter, AlertUserPeasRequestRouter, ClipboardRequestRouter, CommunicationUserRequestRouter, DirectoryRequestRouter, FileSharingRequestRouter, FormTemplateRequestRouter, GenericPanelPeasRequestRouter, ImportExportRequestRouter, InterestCenterPeasRequestRouter, JobDomainPeasRequestRouter, JobManagerPeasRequestRouter, JobOrganizationPeasRequestRouter, JobSearchPeasRequestRouter, JobStartPagePeasRequestRouter, MyContactProfilRequestRouter, MyLinksPeasRequestRouter, MyProfilRequestRouter, NotificationUserRequestRouter, PdcClassifyRequestRouter, PdcRequestRouter, PdcSearchRequestRouter, PdcSubscriptionPeasRequestRouter, PdcUtilizationRequestRouter, PersoPeasRequestRouter, POPUPRequestRouter, ProfilRequestRouter, SelectionPeasRequestRouter, SelectionPeasWrapper, SILVERMAILRequestRouter, SilverStatisticsPeasRequestRouter, SubscriptionRequestRouter, TemplateDesignerRequestRouter, ThesaurusRequestRouter, ThumbnailRequestRouter, TodoRequestRouter, VersioningRequestRouter, WebComponentRequestRouter, WebConnectionsRequestRouter, WorkflowDesignerRequestRouter

public abstract class ComponentRequestRouter<T extends ComponentSessionController>
extends SilverpeasAuthenticatedHttpServlet

See Also:
Serialized Form

Constructor Summary
ComponentRequestRouter()
           
 
Method Summary
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)
           
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 page
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(String function)
          Indicates if the session security token has to be renewed from the given requested function?
 void updateSessionManagement(javax.servlet.http.HttpSession session, String destination)
           
 
Methods inherited from class com.stratelia.silverpeas.peasCore.servlets.SilverpeasAuthenticatedHttpServlet
getMainSessionController, getSessionInfo, renewSessionSecurityToken, service, throwUserSessionExpiration
 
Methods inherited from class com.stratelia.silverpeas.peasCore.servlets.SilverpeasHttpServlet
redirectOrForwardService, throwHttpForbiddenError, throwHttpNotFoundError, throwHttpPreconditionFailedError
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentRequestRouter

public ComponentRequestRouter()
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 action
componentSC - 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(String function)
Indicates if the session security token has to be renewed from the given requested function? The answer depends first on the security.web.protection.sessiontoken.renew parameter defined in org/silverpeas/util/security.properties and secondly on the choice made by some of the component request router.

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 class javax.servlet.http.HttpServlet

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException

updateSessionManagement

public void updateSessionManagement(javax.servlet.http.HttpSession session,
                                    String destination)

getComponentId

public static String[] getComponentId(javax.servlet.http.HttpServletRequest request,
                                      MainSessionController mainSessionCtrl)


Copyright © 2016 Silverpeas. All Rights Reserved.