C# Class Rebel.Cms.Web.Routing.RenderRouteHandler

Custom route handler to assign the correct controller based on the Rebel request
Inheritance: IRouteHandler
Mostra file Open project: RebelCMS/rebelcmsxu5 Class Usage Examples

Public Methods

Method Description
GetHttpHandler ( System.Web.Routing.RequestContext requestContext ) : IHttpHandler

Assigns the correct controller based on the Rebel request and returns a standard MvcHandler to prcess the response, this also stores the render model into the data tokens for the current RouteData.

RenderRouteHandler ( IControllerFactory controllerFactory, IRebelApplicationContext applicationContext, IRenderModelFactory modelFactory ) : System

Protected Methods

Method Description
GetHandlerForRoute ( System.Web.Routing.RequestContext requestContext, IRebelRenderModel renderModel ) : IHttpHandler

this will determine the controller and set the values in the route data

GetRebelRouteDefinition ( System.Web.Routing.RequestContext requestContext, IRebelRenderModel renderModel ) : RouteDefinition

Returns a RouteDefinition object based on the current renderModel

HandlePostedValues ( System.Web.Routing.RequestContext requestContext, PostedDataProxyInfo postedInfo, IRebelRenderModel renderModel, RouteDefinition routeDefinition ) : IHttpHandler

Handles a posted form to an Rebel Url and ensures the correct controller is routed to and that the right DataTokens are set.

Private Methods

Method Description
GetPostedFormInfo ( System.Web.Routing.RequestContext requestContext ) : PostedDataProxyInfo

Checks the request and query strings to see if it matches the definition of having a Surface controller posted value, if so, then we return a PostedDataProxyInfo object with the correct information.

Method Details

GetHandlerForRoute() protected method

this will determine the controller and set the values in the route data
protected GetHandlerForRoute ( System.Web.Routing.RequestContext requestContext, IRebelRenderModel renderModel ) : IHttpHandler
requestContext System.Web.Routing.RequestContext
renderModel IRebelRenderModel
return IHttpHandler

GetHttpHandler() public method

Assigns the correct controller based on the Rebel request and returns a standard MvcHandler to prcess the response, this also stores the render model into the data tokens for the current RouteData.
public GetHttpHandler ( System.Web.Routing.RequestContext requestContext ) : IHttpHandler
requestContext System.Web.Routing.RequestContext
return IHttpHandler

GetRebelRouteDefinition() protected method

Returns a RouteDefinition object based on the current renderModel
protected GetRebelRouteDefinition ( System.Web.Routing.RequestContext requestContext, IRebelRenderModel renderModel ) : RouteDefinition
requestContext System.Web.Routing.RequestContext
renderModel IRebelRenderModel
return RouteDefinition

HandlePostedValues() protected method

Handles a posted form to an Rebel Url and ensures the correct controller is routed to and that the right DataTokens are set.
protected HandlePostedValues ( System.Web.Routing.RequestContext requestContext, PostedDataProxyInfo postedInfo, IRebelRenderModel renderModel, RouteDefinition routeDefinition ) : IHttpHandler
requestContext System.Web.Routing.RequestContext
postedInfo PostedDataProxyInfo
renderModel IRebelRenderModel
routeDefinition RouteDefinition The original route definition that would normally be used to route if it were not a POST
return IHttpHandler

RenderRouteHandler() public method

public RenderRouteHandler ( IControllerFactory controllerFactory, IRebelApplicationContext applicationContext, IRenderModelFactory modelFactory ) : System
controllerFactory IControllerFactory
applicationContext IRebelApplicationContext
modelFactory IRenderModelFactory
return System