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

A utility for resolving urls and looking up entities by URL
Inheritance: IRoutingEngine
显示文件 Open project: RebelCMS/rebelcmsxu5

Public Methods

Method Description
ClearCache ( bool clearDomains = false, HiveId clearForIds = null, bool clearMappedUrls = false, bool clearGeneratedUrls = false, bool clearAll = false ) : void

Clears the cache, removes domain cache items and content-url items

DefaultRoutingEngine ( IRebelApplicationContext appContext, System.Web.HttpContextBase httpContext ) : System

Initializes a new instance of the DefaultRoutingEngine class.

FindEntityByUrl ( Uri fullUrlIncludingDomain, RevisionStatusType revisionStatusType = null ) : EntityRouteResult

Finds a TypedEntity based on the Uri

GetAllUrlsForEntity ( TypedEntity entity ) : Rebel.Cms.Web.Routing.UrlResolutionResult[]

Resolves the url for the specified entity with its full domain paths based on all hostnames assigned.

GetUrlForEntity ( TypedEntity entity ) : UrlResolutionResult

Gets the URL.

This takes into account the current host name in the request. If the current host name matches a host name defined in the domain list for the entity being looked up, then the hostname of the current request will be used, otherwise the primary (first ordinal) domain will be used for the url.

Protected Methods

Method Description
GetContentUrl ( TypedEntity entity ) : UrlResolutionResult

Gets the content URL.

This takes into account the current host name in the request. If the current host name matches a host name defined in the domain list for the entity being looked up, then the hostname of the current request will be used, otherwise the primary (first ordinal) domain will be used for the url.

GetDomainUrls ( IEnumerable ancestorsOrSelf ) : IEnumerable

Returns a list of URLs with the domains assigned based on the list of ancestorsOrSelf. If no domain is assigned to the branch that the entity exists in a null value is returned.

GetMediaUrl ( TypedEntity entity ) : UrlResolutionResult

Gets the media URL.

GetNonDomainUrl ( IEnumerable ancestorsOrSelf ) : UrlResolutionResult

Returns the non-domain URL for the 'self' node in ancestorsOrSelf or null if this node cannot exist in a non-domain branch.

Method Details

ClearCache() public method

Clears the cache, removes domain cache items and content-url items
public ClearCache ( bool clearDomains = false, HiveId clearForIds = null, bool clearMappedUrls = false, bool clearGeneratedUrls = false, bool clearAll = false ) : void
clearDomains bool true to clear all domain cache
clearForIds HiveId will clear the URL
clearMappedUrls bool will clear the cache for all URLs mapped to entities
clearGeneratedUrls bool clears cache for all generated urls
clearAll bool Clears all cache
return void

DefaultRoutingEngine() public method

Initializes a new instance of the DefaultRoutingEngine class.
public DefaultRoutingEngine ( IRebelApplicationContext appContext, System.Web.HttpContextBase httpContext ) : System
appContext IRebelApplicationContext The routable request context.
httpContext System.Web.HttpContextBase
return System

FindEntityByUrl() public method

Finds a TypedEntity based on the Uri
public FindEntityByUrl ( Uri fullUrlIncludingDomain, RevisionStatusType revisionStatusType = null ) : EntityRouteResult
fullUrlIncludingDomain System.Uri
revisionStatusType RevisionStatusType
return EntityRouteResult

GetAllUrlsForEntity() public method

Resolves the url for the specified entity with its full domain paths based on all hostnames assigned.
public GetAllUrlsForEntity ( TypedEntity entity ) : Rebel.Cms.Web.Routing.UrlResolutionResult[]
entity TypedEntity
return Rebel.Cms.Web.Routing.UrlResolutionResult[]

GetContentUrl() protected method

Gets the content URL.
This takes into account the current host name in the request. If the current host name matches a host name defined in the domain list for the entity being looked up, then the hostname of the current request will be used, otherwise the primary (first ordinal) domain will be used for the url.
protected GetContentUrl ( TypedEntity entity ) : UrlResolutionResult
entity TypedEntity The entity.
return UrlResolutionResult

GetDomainUrls() protected method

Returns a list of URLs with the domains assigned based on the list of ancestorsOrSelf. If no domain is assigned to the branch that the entity exists in a null value is returned.
protected GetDomainUrls ( IEnumerable ancestorsOrSelf ) : IEnumerable
ancestorsOrSelf IEnumerable The ancestorsOrSelf list to create the URL for
return IEnumerable

GetMediaUrl() protected method

Gets the media URL.
protected GetMediaUrl ( TypedEntity entity ) : UrlResolutionResult
entity TypedEntity The entity.
return UrlResolutionResult

GetNonDomainUrl() protected method

Returns the non-domain URL for the 'self' node in ancestorsOrSelf or null if this node cannot exist in a non-domain branch.
protected GetNonDomainUrl ( IEnumerable ancestorsOrSelf ) : UrlResolutionResult
ancestorsOrSelf IEnumerable
return UrlResolutionResult

GetUrlForEntity() public method

Gets the URL.
This takes into account the current host name in the request. If the current host name matches a host name defined in the domain list for the entity being looked up, then the hostname of the current request will be used, otherwise the primary (first ordinal) domain will be used for the url.
public GetUrlForEntity ( TypedEntity entity ) : UrlResolutionResult
entity TypedEntity The entity.
return UrlResolutionResult