Class WebComponentManager


  • public class WebComponentManager
    extends Object
    This class handles all the route paths of Web Resources. First time the manager is called by a resource, an initialization is done. It consists of scanning all the methods of the resource to extract these the can be associated to a route (URI path).
    Author:
    Yohann Chastagnier
    • Constructor Detail

      • WebComponentManager

        public WebComponentManager()
    • Method Detail

      • manageRequestFor

        public static <T extends WebComponentController<R>,​R extends WebComponentRequestContext> void manageRequestFor​(Class<T> webComponentControllerClass,
                                                                                                                             Class<? extends Annotation> httpMethodClass,
                                                                                                                             HttpRequest request,
                                                                                                                             javax.servlet.http.HttpServletResponse response)
        This method must be called before all treatments in order to initilize the Web Component Context associated to the current request.
        Type Parameters:
        T - the type of the Web Component Controller that provides a lot of stuff around the component, the user, etc.
        R - the type of the web component request context.
        Parameters:
        webComponentControllerClass - the class resource which exposes the methods that will be invoked.
        httpMethodClass - the annotation class associated to the current http method of the request.
        request - the request itself.
        response - the response itself.
      • perform

        public static <T extends WebComponentController<R>,​R extends WebComponentRequestContext> org.silverpeas.core.web.mvc.webcomponent.PathExecutionResponse perform​(T webComponentController,
                                                                                                                                                                              String path)
                                                                                                                                                                       throws Exception
        Performs a request path by executing the right method behind and returning the navigation object instance.
        Type Parameters:
        T - the type of the resource which hosts the method that must be invoked.
        R - the type of the web component context.
        Parameters:
        webComponentController - the handled component controller.
        path - the path that must be matched in finding of the method to invoke.
        Returns:
        the resulting of processing.
        Throws:
        Exception