Class FriendlyHtmlRewriteToExternal

Rewrite HTML URI:s in streams and strings.

Inheritance
System.Object
FriendlyHtmlRewriteToExternal
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
public class FriendlyHtmlRewriteToExternal : HtmlRewriteToExternal

Constructors

FriendlyHtmlRewriteToExternal(UrlBuilder.RebaseKind)

Initializes a new instance of the FriendlyHtmlRewriteToExternal class.

Declaration
public FriendlyHtmlRewriteToExternal(UrlBuilder.RebaseKind rebaseKind)
Parameters
Type Name Description
UrlBuilder.RebaseKind rebaseKind

The type of rebasing to perform on the rewritten URL:s.

FriendlyHtmlRewriteToExternal(UrlBuilder.RebaseKind, IPermanentLinkMapper)

Initializes a new instance of the FriendlyHtmlRewriteToExternal class.

Declaration
public FriendlyHtmlRewriteToExternal(UrlBuilder.RebaseKind rebaseKind, IPermanentLinkMapper permanentLinkMapper)
Parameters
Type Name Description
UrlBuilder.RebaseKind rebaseKind

The type of rebasing to perform on the rewritten URL:s.

IPermanentLinkMapper permanentLinkMapper

Used to map links

Methods

GetRewriteFilter(UrlBuilder, UrlBuilder, Encoding, Stream, out RewritePipe)

Gets a rewrite filter stream

Declaration
public override Stream GetRewriteFilter(UrlBuilder internalUrl, UrlBuilder externalUrl, Encoding encoding, Stream stream, out RewritePipe rewritePipe)
Parameters
Type Name Description
UrlBuilder internalUrl

The internal URL.

UrlBuilder externalUrl

The external URL.

System.Text.Encoding encoding

The encoding to use when escaping URI:s

System.IO.Stream stream

The incoming stream.

RewritePipe rewritePipe

The rewrite pipe.

Returns
Type Description
System.IO.Stream

The filtered, rewritten, stream

Overrides

HtmlRewriteUrl(UrlBuilder, UrlBuilder, UrlBuilder, Encoding, out Object)

Rewrites an URL found as an URI in HTML text.

Declaration
protected virtual bool HtmlRewriteUrl(UrlBuilder internalUrl, UrlBuilder externalUrl, UrlBuilder url, Encoding encoding, out object internalObject)
Parameters
Type Name Description
UrlBuilder internalUrl

The internal context URL.

UrlBuilder externalUrl

The external context URL.

UrlBuilder url

The URL to rewrite

System.Text.Encoding encoding

The encoding to use when escaping the URL

System.Object internalObject

The internal object representation that may be returned

Returns
Type Description
System.Boolean

IsHtmlUrlValidForRewrite(UrlBuilder, UrlBuilder)

Determines whether a given url is valid for rewrite, when interpreted in the context of the provided context URL.

Declaration
protected virtual bool IsHtmlUrlValidForRewrite(UrlBuilder contextUrl, UrlBuilder url)
Parameters
Type Name Description
UrlBuilder contextUrl

The url for the context that the url is present in

UrlBuilder url

The URL.

Returns
Type Description
System.Boolean

true if [is HTML URL valid for rewrite] [the specified internal URL]; otherwise, false.

IsUrlSchemeValid(UrlBuilder, UrlBuilder)

Determines whether URL scheme is valid for rewrite. Override this method if you want to add more valid schemes.

Declaration
protected virtual bool IsUrlSchemeValid(UrlBuilder contextUrl, UrlBuilder url)
Parameters
Type Name Description
UrlBuilder contextUrl

The context URL.

UrlBuilder url

The URL to validate.

Returns
Type Description
System.Boolean

true if URL scheme is valid; otherwise, false.

Remarks

Valid Url schemes are http, https and empty.

OnHtmlRewriteInit(HtmlRewriteEventArgs)

Raises the HtmlRewriteInit event. Override in derived classes to add your handlers.

Declaration
protected override void OnHtmlRewriteInit(HtmlRewriteEventArgs e)
Parameters
Type Name Description
HtmlRewriteEventArgs e

The HtmlRewriteEventArgs instance containing the event data.

Overrides

OnHtmlRewritingUrl(UrlRewriteEventArgs)

Raises the HtmlRewritingUrl event.

Declaration
protected override void OnHtmlRewritingUrl(UrlRewriteEventArgs e)
Parameters
Type Name Description
UrlRewriteEventArgs e

The UrlRewriteEventArgs instance containing the event data.

Overrides

Extension Methods