Class RedirectionController
Inheritance
Implements
Namespace: DotNetNuke.Services.Mobile
Assembly: DotNetNuke.dll
Syntax
public class RedirectionController : object, IRedirectionController
Methods
| Improve this Doc View SourceDelete(Int32, Int32)
delete a redirection.
Declaration
public void Delete(int portalId, int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Portal's id. |
| System.Int32 | id | the redirection's id. |
DeleteRule(Int32, Int32, Int32)
delete a redirection's match rule.
Declaration
public void DeleteRule(int portalId, int redirectionId, int ruleId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Portal's id. |
| System.Int32 | redirectionId | the redirection's id. |
| System.Int32 | ruleId | the rule's id. |
GetAllRedirections()
get all redirections defined in system.
Declaration
public IList<IRedirection> GetAllRedirections()
Returns
| Type | Description |
|---|---|
| IList<IRedirection> | List of redirection. |
GetFullSiteUrl()
Get Url for the equivalent full site based on the current page of the mobile site.
Declaration
public string GetFullSiteUrl()
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetFullSiteUrl(Int32, Int32)
Get Url for the equivalent full site based on the current page of the mobile site.
Declaration
public string GetFullSiteUrl(int portalId, int currentTabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Portal Id from which Redirection Rules should be applied. |
| System.Int32 | currentTabId | Current Tab Id that needs to be evaluated. |
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetMobileSiteUrl()
Get Url for the equivalent mobile site based on the current page of the full site.
Declaration
public string GetMobileSiteUrl()
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetMobileSiteUrl(Int32, Int32)
Get Url for the equivalent mobile site based on the current page of the full site.
Declaration
public string GetMobileSiteUrl(int portalId, int currentTabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | Portal Id from which Redirection Rules should be applied. |
| System.Int32 | currentTabId | Current Tab Id that needs to be evaluated. |
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetRedirectionById(Int32, Int32)
get a specific redirection by id.
Declaration
public IRedirection GetRedirectionById(int portalId, int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | the ID of the portal to which the redirection belongs. |
| System.Int32 | id | The redirection ID. |
Returns
| Type | Description |
|---|---|
| IRedirection | redirection object. |
GetRedirectionsByPortal(Int32)
get a redirection list for portal.
Declaration
public IList<IRedirection> GetRedirectionsByPortal(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId | redirection id. |
Returns
| Type | Description |
|---|---|
| IList<IRedirection> | List of redirection. |
GetRedirectUrl(String, Int32, Int32)
Get Redirection Url based on Http Context and Portal Id.
Declaration
public string GetRedirectUrl(string userAgent, int portalId, int currentTabId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userAgent | User Agent - used for client capability detection. |
| System.Int32 | portalId | Portal Id from which Redirection Rules should be applied. |
| System.Int32 | currentTabId | Current Tab Id that needs to be evaluated. |
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetRedirectUrl(String)
Get Redirection Url based on UserAgent.
Declaration
public string GetRedirectUrl(string userAgent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | userAgent | User Agent - used for client capability detection. |
Returns
| Type | Description |
|---|---|
| System.String | string - Empty if redirection rules are not defined or no match found. |
GetRedirectUrlFromRule(IRedirection, Int32, Int32)
returns a target URL for the specific redirection.
Declaration
public string GetRedirectUrlFromRule(IRedirection redirection, int portalId, int currentTabId)
Parameters
| Type | Name | Description |
|---|---|---|
| IRedirection | redirection | |
| System.Int32 | portalId | |
| System.Int32 | currentTabId |
Returns
| Type | Description |
|---|---|
| System.String | The URL (or |
IsRedirectAllowedForTheSession(HttpApplication)
Is Redirection Allowed for the session. Method analyzes the query string for special parameters to enable / disable redirects. Cookie is created to temporarily store those parameters so that they remain available till the interactions are active.
Declaration
public bool IsRedirectAllowedForTheSession(HttpApplication app)
Parameters
| Type | Name | Description |
|---|---|---|
| HttpApplication | app | app - HttpApplication. Request and Response properties are used. |
Returns
| Type | Description |
|---|---|
| System.Boolean | boolean - True if redirection. |
PurgeInvalidRedirections(Int32)
Deletes all redirection rules that were set for pages that have been soft or hard deleted.
Declaration
public void PurgeInvalidRedirections(int portalId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | portalId |
Save(IRedirection)
save a redirection. If redirection.Id equals Null.NullInteger(-1), that means need to add a new redirection; otherwise will update the redirection by redirection.Id.
Declaration
public void Save(IRedirection redirection)
Parameters
| Type | Name | Description |
|---|---|---|
| IRedirection | redirection | redirection object. |