November Happy Hour will be moved to Thursday December 5th.

Class DefaultUrlResolver

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. The default implementation of UrlResolver

Inheritance
System.Object
DefaultUrlResolver
Implements
Namespace: EPiServer.Web.Routing.Internal
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class DefaultUrlResolver : UrlResolver, IUrlResolver

Constructors

DefaultUrlResolver(RouteCollection, IContentLoader, ISiteDefinitionRepository, TemplateResolver, IPermanentLinkMapper, IContentLanguageSettingsHandler, IContentUrlCache, IContextModeResolver, IRequestHostResolver)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Creates a new instace of DefaultUrlResolver

Declaration
public DefaultUrlResolver(RouteCollection routes, IContentLoader contentLoader, ISiteDefinitionRepository siteDefinitionRepository, TemplateResolver templateResolver, IPermanentLinkMapper permanentLinkMapper, IContentLanguageSettingsHandler contentLanguageSettingsHandler, IContentUrlCache contentUrlCache, IContextModeResolver contextModeResolver, IRequestHostResolver requestHostResolver)
Parameters
Type Name Description
System.Web.Routing.RouteCollection routes

The registered routes to use.

IContentLoader contentLoader

The content loader to use

ISiteDefinitionRepository siteDefinitionRepository

The site definition repository to use

TemplateResolver templateResolver

The template resolver to use

IPermanentLinkMapper permanentLinkMapper

The permanent link mapper to use

IContentLanguageSettingsHandler contentLanguageSettingsHandler

The content language settings handler

IContentUrlCache contentUrlCache

The content url cache

IContextModeResolver contextModeResolver

The contextmode resolver

IRequestHostResolver requestHostResolver

The host resolver

Methods

ConvertToPermanent(UrlBuilder, IContent)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public virtual bool ConvertToPermanent(UrlBuilder url, IContent content)
Parameters
Type Name Description
UrlBuilder url
IContent content
Returns
Type Description
System.Boolean

GetUrl(ContentReference, String, VirtualPathArguments)

Declaration
public override string GetUrl(ContentReference contentLink, string language, VirtualPathArguments virtualPathArguments)
Parameters
Type Name Description
ContentReference contentLink
System.String language
VirtualPathArguments virtualPathArguments
Returns
Type Description
System.String
Overrides

GetUrl(UrlBuilder, VirtualPathArguments)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override string GetUrl(UrlBuilder urlBuilderWithInternalUrl, VirtualPathArguments arguments)
Parameters
Type Name Description
UrlBuilder urlBuilderWithInternalUrl

The URL with a internal format.

VirtualPathArguments arguments

The VirtualPathArguments that determines the format of the link.

Returns
Type Description
System.String

A URL in string representation.

Overrides
Remarks

The returned url can be relative or absolute (including host) depending on if the urlBuilderWithInternalUrl is on current site and current request matches host that matches content and language. Overload GetVirtualPath can be used to always get relative virtual path.

GetVirtualPath(ContentReference, String, VirtualPathArguments)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override VirtualPathData GetVirtualPath(ContentReference contentLink, string language, VirtualPathArguments arguments)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String language

The language.

VirtualPathArguments arguments
Returns
Type Description
System.Web.Routing.VirtualPathData

A virtual path or null if it was not possible to create a route to the content (for example the content does not exist or has no template)

Overrides
Remarks

The returned value System.Web.Routing.VirtualPathData.VirtualPath is always a relative path (host and application is not included), call extension method GetUrl on VirtualPathData to get an absolute path (there is an overload that can be used if authority part should not be included).

GetVirtualPathForNonContent(Object, String, VirtualPathArguments)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override VirtualPathData GetVirtualPathForNonContent(object partialRoutedObject, string language, VirtualPathArguments virtualPathArguments)
Parameters
Type Name Description
System.Object partialRoutedObject

The partial routed object.

System.String language

The language.

VirtualPathArguments virtualPathArguments

The virtual path arguments.

Returns
Type Description
System.Web.Routing.VirtualPathData
Overrides
Remarks

For virtual path to IContent, use the GetVirtualPath method with the content's ContentReference, which also handles cases where the content is partial routed.

The returned value System.Web.Routing.VirtualPathData.VirtualPath is always a relative path (host and application is not included), call extension method GetUrl on VirtualPathData to get an absolute path (there is an overload that can be used if authority part should not be included).

Route(UrlBuilder, ContextMode)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override IContent Route(UrlBuilder urlBuilder, ContextMode contextMode)
Parameters
Type Name Description
UrlBuilder urlBuilder

The URL builder.

ContextMode contextMode

The ContextMode

Returns
Type Description
IContent
Overrides

Route(String, RouteArguments)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override ContentRouteData Route(string url, RouteArguments routeArguments)
Parameters
Type Name Description
System.String url

The url.

RouteArguments routeArguments

The RouteArguments

Returns
Type Description
ContentRouteData
Overrides

TryToPermanent(String, out String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

Declaration
public override bool TryToPermanent(string url, out string permanentUrl)
Parameters
Type Name Description
System.String url

The URL.

System.String permanentUrl

The permanent URL.

Returns
Type Description
System.Boolean

True if the conversion succeded, otherwise; false.

Overrides

Implements

Extension Methods