Class NodeSegment
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. A Segment representing a contentLink as node in the pagetree when routing. The parameter segment will be created by the EPiServer.Web.Routing.RouteParser when the route contains '{node}'.
Implements
Inherited Members
Namespace: EPiServer.Web.Routing.Segments.Internal
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7Syntax
public class NodeSegment : SegmentBase, ISegment
Constructors
NodeSegment(String, String, IUrlSegmentRouter, IContentLoader, UrlResolver, IContentLanguageSettingsHandler)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes a new instance of the Node segment class.
Declaration
public NodeSegment(string name, string friendlyUrlExtension, IUrlSegmentRouter urlSegmentRouter, IContentLoader contentLoader, UrlResolver urlResolver, IContentLanguageSettingsHandler contentLanguageSettingsHandler)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the segment. |
System.String | friendlyUrlExtension | he extension used for friendly URL generation. |
IUrlSegmentRouter | urlSegmentRouter | The router used when resolving nodes. |
IContentLoader | contentLoader | The content loader. |
UrlResolver | urlResolver | The url resolver to use |
IContentLanguageSettingsHandler | contentLanguageSettingsHandler | ContentLanguageSettingsHandler to use. |
Properties
ContentLoader
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the content loader.
Declaration
protected IContentLoader ContentLoader { get; }
Property Value
Type | Description |
---|---|
IContentLoader | The content loader. |
IsStartPageResolver
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets or sets the is start page resolver.
Declaration
public Func<ContentReference, bool> IsStartPageResolver { get; set; }
Property Value
Type | Description |
---|---|
System.Func<ContentReference, System.Boolean> | The is start page resolver. |
UrlSegmentRouter
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the URL segment router.
Declaration
protected IUrlSegmentRouter UrlSegmentRouter { get; }
Property Value
Type | Description |
---|---|
IUrlSegmentRouter | The URL segment router. |
Methods
AppendTrailingSlash(RequestContext, RouteValueDictionary)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Will add a trailing slash unless there is a Friendly url extension defined or last content is IBinaryStorable
Declaration
public override bool AppendTrailingSlash(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
System.Web.Routing.RouteValueDictionary | values | The values. |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetContentLink(RequestContext, RouteValueDictionary)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the content link from the request context of route values.
Declaration
protected virtual ContentReference GetContentLink(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
System.Web.Routing.RouteValueDictionary | values | The values. |
Returns
Type | Description |
---|---|
ContentReference |
GetIncomingNode(ContentReference, SegmentContext)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Get all visited Node within the context.
Declaration
protected virtual IEnumerable<SegmentNode> GetIncomingNode(ContentReference contentLink, SegmentContext context)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentLink | contentlink |
SegmentContext | context | Segment context |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SegmentNode> | The all visited node of the incoming URL |
Remarks
It will recursively traverse the URL to find the last node.
GetLanguage(RequestContext, RouteValueDictionary)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the language.
Declaration
protected virtual string GetLanguage(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
System.Web.Routing.RouteValueDictionary | values | The values. |
Returns
Type | Description |
---|---|
System.String |
GetNextValue(String, SegmentContext)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Finds the next value in the URL by looking for the forward slash character. When the friendly url extension is used, the extension will be removed.
Declaration
protected virtual SegmentPair GetNextValue(string remainingUrl, SegmentContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | remainingUrl | The URL to get next value from. |
SegmentContext | context | The context. |
Returns
Type | Description |
---|---|
SegmentPair | A SegmentPair containing the next value and the calculated remaining url. |
GetOutgoingUrl(ContentReference, String)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the outgoing URL.
Declaration
protected virtual string GetOutgoingUrl(ContentReference contentLink, string language)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentLink | The content link. |
System.String | language | The language. |
Returns
Type | Description |
---|---|
System.String | The outgoing url for the content reference |
GetOutgoingUrlSegment(ContentReference, String)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the outgoing URL segment for a content item on specified language.
Declaration
protected virtual string GetOutgoingUrlSegment(ContentReference contentLink, string language)
Parameters
Type | Name | Description |
---|---|---|
ContentReference | contentLink | The content link. |
System.String | language | The language. |
Returns
Type | Description |
---|---|
System.String |
GetRoutedContent(RequestContext, RouteValueDictionary)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the routed content from the request context of route values.
Declaration
protected virtual IContent GetRoutedContent(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request context. |
System.Web.Routing.RouteValueDictionary | values | The values. |
Returns
Type | Description |
---|---|
IContent |
GetVirtualPathSegment(RequestContext, RouteValueDictionary)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the string representation of this segments virtual path.
Declaration
public override string GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request |
System.Web.Routing.RouteValueDictionary | values | Route values |
Returns
Type | Description |
---|---|
System.String | Virtual path from this segment. |
Overrides
Remarks
The returned virtual path will contain language information where applicable.
GetVirtualPathSegment(RequestContext, RouteValueDictionary, HashSet<String>)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the string representation of this segments virtual path.
Declaration
public override string GetVirtualPathSegment(RequestContext requestContext, RouteValueDictionary values, HashSet<string> usedValues)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RequestContext | requestContext | The request |
System.Web.Routing.RouteValueDictionary | values | Route values |
System.Collections.Generic.HashSet<System.String> | usedValues | Route values that are handled and should not be added to the query string. |
Returns
Type | Description |
---|---|
System.String | Virtual path from this segment. |
Overrides
Remarks
The returned virtual path will contain language information where applicable.
PermanentRedirectForDefaultMode(String, SegmentContext)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Does a permanent redirect to redirectUrl
if the context is Default.
Declaration
protected virtual bool PermanentRedirectForDefaultMode(string redirectUrl, SegmentContext context)
Parameters
Type | Name | Description |
---|---|---|
System.String | redirectUrl | The url to redirect to |
SegmentContext | context | current request context |
Returns
Type | Description |
---|---|
System.Boolean | true if the request was redirected else false. |
RedirectionEnabled(RequestSegmentContext)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Determines if redirection is enabled for the context.
Declaration
protected virtual bool RedirectionEnabled(RequestSegmentContext context)
Parameters
Type | Name | Description |
---|---|---|
RequestSegmentContext | context |
Returns
Type | Description |
---|---|
System.Boolean |
RouteDataMatch(SegmentContext)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Set the node, language and controller value to the segment context.
Declaration
public override bool RouteDataMatch(SegmentContext context)
Parameters
Type | Name | Description |
---|---|---|
SegmentContext | context | The segment context |
Returns
Type | Description |
---|---|
System.Boolean | It will always return true. |
Overrides
Remarks
It will traverse the URL and resolve a node for the last segment. The node will correspond to a page in the page tree. If no node is found, the root node from the IUrlSegmentRouter supplied in the constructor is used.
SetRoutingData(SegmentContext, String, ContentReference)
Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Set the node, language and controller value to the segment context.
Declaration
protected void SetRoutingData(SegmentContext context, string lang, ContentReference contentLink)
Parameters
Type | Name | Description |
---|---|---|
SegmentContext | context | The segment context. |
System.String | lang | The language to set. |
ContentReference | contentLink | The node to set. |