Class PublishedRequestOld
Inheritance
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public class PublishedRequestOld
Constructors
View SourcePublishedRequestOld(IPublishedRouter, IUmbracoContext, IOptions<WebRoutingSettings>, Nullable<Uri>)
Initializes a new instance of the PublishedRequest class.
Declaration
public PublishedRequestOld(IPublishedRouter publishedRouter, IUmbracoContext umbracoContext, IOptions<WebRoutingSettings> webRoutingSettings, Uri? uri = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedRouter | publishedRouter | |
| IUmbracoContext | umbracoContext | |
| IOptions<WebRoutingSettings> | webRoutingSettings | |
| System.Nullable<Uri> | uri |
Properties
View SourceCacheabilityNoCache
Declaration
public bool CacheabilityNoCache { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
CacheExtensions
Gets or sets a list of Extensions to append to the Response.Cache object.
Declaration
public List<string> CacheExtensions { get; set; }
Property Value
| Type | Description |
|---|---|
| List<System.String> |
Culture
Gets or sets the content request's culture.
Declaration
public CultureInfo Culture { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Globalization.CultureInfo |
Domain
Gets or sets the content request's domain.
Declaration
public DomainAndUri Domain { get; set; }
Property Value
| Type | Description |
|---|---|
| DomainAndUri |
Remarks
Is a DomainAndUri object ie a standard Domain plus the fully qualified uri. For example,
the Domain may contain "example.com" whereas the Uri will be fully qualified eg
"http://example.com/".
HasDomain
Gets a value indicating whether the content request has a domain.
Declaration
public bool HasDomain { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Headers
Gets or sets a dictionary of Headers to append to the Response object.
Declaration
public Dictionary<string, string> Headers { get; set; }
Property Value
| Type | Description |
|---|---|
| Umbraco.Cms.Core.Dictionary<System.String, System.String> |
IgnorePublishedContentCollisions
Gets or sets a value indicating whether the Umbraco Backoffice should ignore a collision for this request.
Declaration
public bool IgnorePublishedContentCollisions { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
InitialPublishedContent
Gets the initial requested content.
Declaration
public IPublishedContent InitialPublishedContent { get; }
Property Value
| Type | Description |
|---|---|
| IPublishedContent |
Remarks
The initial requested content is the content that was found by the finders, before anything such as 404, redirect... took place.
Is404
Gets or sets a value indicating whether the requested content could not be found.
Declaration
public bool Is404 { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This is set in the PublishedContentRequestBuilder and can also be used in
custom content finders or Prepared event handlers, where we want to allow developers
to indicate a request is 404 but not to cancel it.
IsInitialPublishedContent
Gets value indicating whether the current published content is the initial one.
Declaration
public bool IsInitialPublishedContent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsInternalRedirectPublishedContent
Gets or sets a value indicating whether the current published content has been obtained from the initial published content following internal redirections exclusively.
Declaration
public bool IsInternalRedirectPublishedContent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Used by PublishedContentRequestEngine.FindTemplate() to figure out whether to apply the internal redirect or not, when content is not the initial content.
IsRedirect
Gets a value indicating whether the content request triggers a redirect (permanent or not).
Declaration
public bool IsRedirect { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsRedirectPermanent
Gets or sets a value indicating whether the redirect is permanent.
Declaration
public bool IsRedirectPermanent { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
RedirectUrl
Gets or sets the URL to redirect to, when the content request triggers a redirect.
Declaration
public string RedirectUrl { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ResponseStatusCode
Gets or sets the content request http response status code.
Declaration
public int ResponseStatusCode { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Remarks
Does not actually set the http response status code, only registers that the response should use the specified code. The code will or will not be used, in due time.
ResponseStatusDescription
Gets or sets the content request http response status description.
Declaration
public string ResponseStatusDescription { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
Does not actually set the http response status description, only registers that the response should use the specified description. The description will or will not be used, in due time.
Template
Gets or sets the template model to use to display the requested content.
Declaration
public ITemplate Template { get; }
Property Value
| Type | Description |
|---|---|
| ITemplate |
TemplateAlias
Gets the alias of the template to use to display the requested content.
Declaration
public string TemplateAlias { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
UmbracoContext
Gets the UmbracoContext.
Declaration
public IUmbracoContext UmbracoContext { get; }
Property Value
| Type | Description |
|---|---|
| IUmbracoContext |
Uri
Gets or sets the cleaned up Uri used for routing.
Declaration
public Uri Uri { get; }
Property Value
| Type | Description |
|---|---|
| Uri |
Remarks
The cleaned up Uri has no virtual directory, no trailing slash, no .aspx extension, etc.
Methods
View SourceEnsureWriteable()
Declaration
public void EnsureWriteable()
SetInternalRedirectPublishedContent(IPublishedContent)
Sets the requested content, following an internal redirect.
Declaration
public void SetInternalRedirectPublishedContent(IPublishedContent content)
Parameters
| Type | Name | Description |
|---|---|---|
| IPublishedContent | content | The requested content. |
Remarks
Depending on UmbracoSettings.InternalRedirectPreservesTemplate, will
preserve or reset the template, if any.
SetIsInitialPublishedContent()
Indicates that the current PublishedContent is the initial one.
Declaration
public void SetIsInitialPublishedContent()
SetRedirect(String)
Indicates that the content request should trigger a redirect (302).
Declaration
public void SetRedirect(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | url | The URL to redirect to. |
Remarks
Does not actually perform a redirect, only registers that the response should redirect. Redirect will or will not take place in due time.
SetRedirect(String, Int32)
Indicates that the content request should trigger a redirect, with a specified status code.
Declaration
public void SetRedirect(string url, int status)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | url | The URL to redirect to. |
| System.Int32 | status | The status code (300-308). |
Remarks
Does not actually perform a redirect, only registers that the response should redirect. Redirect will or will not take place in due time.
SetRedirectPermanent(String)
Indicates that the content request should trigger a permanent redirect (301).
Declaration
public void SetRedirectPermanent(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | url | The URL to redirect to. |
Remarks
Does not actually perform a redirect, only registers that the response should redirect. Redirect will or will not take place in due time.
SetResponseStatus(Int32, String)
Sets the http response status code, along with an optional associated description.
Declaration
public void SetResponseStatus(int code, string description = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | code | The http status code. |
| System.String | description | The description. |
Remarks
Does not actually set the http response status code and description, only registers that the response should use the specified code and description. The code and description will or will not be used, in due time.