Class PublishedRouter
Provides the default IPublishedRouter implementation.
Inheritance
Namespace: Umbraco.Web.Routing
Assembly: Umbraco.Web.dll
Syntax
public class PublishedRouter : IPublishedRouter
Constructors
View SourcePublishedRouter(IWebRoutingSection, ContentFinderCollection, IContentLastChanceFinder, IVariationContextAccessor, ServiceContext, IProfilingLogger)
Initializes a new instance of the PublishedRouter class.
Declaration
public PublishedRouter(IWebRoutingSection webRoutingSection, ContentFinderCollection contentFinders, IContentLastChanceFinder contentLastChanceFinder, IVariationContextAccessor variationContextAccessor, ServiceContext services, IProfilingLogger proflog)
Parameters
Type | Name | Description |
---|---|---|
IWebRoutingSection | webRoutingSection | |
ContentFinderCollection | contentFinders | |
IContentLastChanceFinder | contentLastChanceFinder | |
IVariationContextAccessor | variationContextAccessor | |
ServiceContext | services | |
IProfilingLogger | proflog |
Methods
View SourceConfigureRequest(PublishedRequest)
Called by PrepareRequest once everything has been discovered, resolved and assigned to the PCR. This method finalizes the PCR with the values assigned.
Declaration
public bool ConfigureRequest(PublishedRequest frequest)
Parameters
Type | Name | Description |
---|---|---|
PublishedRequest | frequest |
Returns
Type | Description |
---|---|
System.Boolean | Returns false if the request was not successfully configured |
Remarks
This method logic has been put into it's own method in case developers have created a custom PCR or are assigning their own values but need to finalize it themselves.
CreateRequest(UmbracoContext, Uri)
Creates a published request.
Declaration
public PublishedRequest CreateRequest(UmbracoContext umbracoContext, Uri uri = null)
Parameters
Type | Name | Description |
---|---|---|
UmbracoContext | umbracoContext | The current Umbraco context. |
System.Uri | uri | The (optional) request Uri. |
Returns
Type | Description |
---|---|
PublishedRequest | A published request. |
GetTemplate(String)
Gets a template.
Declaration
public ITemplate GetTemplate(string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | alias | The template alias |
Returns
Type | Description |
---|---|
ITemplate | The template. |
PrepareRequest(PublishedRequest)
Prepares a request for rendering.
Declaration
public bool PrepareRequest(PublishedRequest request)
Parameters
Type | Name | Description |
---|---|---|
PublishedRequest | request | The request. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the request was successfully prepared and can be rendered. |
TryRouteRequest(PublishedRequest)
Tries to route a request.
Declaration
public bool TryRouteRequest(PublishedRequest request)
Parameters
Type | Name | Description |
---|---|---|
PublishedRequest | request | The request. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the request can be routed to a document. |
UpdateRequestToNotFound(PublishedRequest)
Updates the request to "not found".
Declaration
public void UpdateRequestToNotFound(PublishedRequest request)
Parameters
Type | Name | Description |
---|---|---|
PublishedRequest | request | The request. |
Remarks
This method is invoked when the pipeline decides it cannot render the request, for whatever reason, and wants to force it to be re-routed and rendered as if no document were found (404).