-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4021 from ahoefling/portal_alias
Created IPortalAliasService for Dependency Injection
- Loading branch information
Showing
13 changed files
with
1,824 additions
and
1,608 deletions.
There are no files selected for viewing
55 changes: 41 additions & 14 deletions
55
DNN Platform/DotNetNuke.Abstractions/Portals/IPortalAliasInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,54 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace DotNetNuke.Abstractions.Portals | ||
{ | ||
using System.Data; | ||
using System.Xml; | ||
using System.Xml.Schema; | ||
using DotNetNuke.Abstractions.Urls; | ||
|
||
/// <summary> | ||
/// Portal Alias Info interface. | ||
/// </summary> | ||
public interface IPortalAliasInfo | ||
{ | ||
//BrowserTypes BrowserType { get; set; } | ||
string CultureCode { get; set; } | ||
string HTTPAlias { get; set; } | ||
/// <summary> | ||
/// Gets or sets the http alias. | ||
/// </summary> | ||
string HttpAlias { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Portal Alias ID. | ||
/// </summary> | ||
int PortalAliasId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the Portal ID. | ||
/// </summary> | ||
int PortalId { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether this alias is the primary alias for the site/portal. | ||
/// </summary> | ||
bool IsPrimary { get; set; } | ||
int KeyID { get; set; } | ||
int PortalAliasID { get; set; } | ||
int PortalID { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether the alias is a redirect alias. | ||
/// </summary> | ||
bool Redirect { get; set; } | ||
string Skin { get; set; } | ||
|
||
void Fill(IDataReader dr); | ||
XmlSchema GetSchema(); | ||
void ReadXml(XmlReader reader); | ||
void WriteXml(XmlWriter writer); | ||
/// <summary> | ||
/// Gets or sets the Browser Type. | ||
/// </summary> | ||
BrowserTypes BrowserType { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the culture code for this alias, if there is one. | ||
/// </summary> | ||
string CultureCode { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the skin/theme for this alias, if there is one. | ||
/// </summary> | ||
string Skin { get; set; } | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
DNN Platform/DotNetNuke.Abstractions/Portals/IPortalAliasService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace DotNetNuke.Abstractions.Portals | ||
{ | ||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// Portal Alias APIs for managing the different Portal Alias. | ||
/// </summary> | ||
public interface IPortalAliasService | ||
{ | ||
/// <summary> | ||
/// Gets the portal alias by portal. | ||
/// </summary> | ||
/// <param name="portalId">The portal id.</param> | ||
/// <param name="portalAlias">The portal alias.</param> | ||
/// <returns>Portal alias.</returns> | ||
string GetPortalAliasByPortal(int portalId, string portalAlias); | ||
|
||
/// <summary> | ||
/// Gets the portal alias by tab. | ||
/// </summary> | ||
/// <param name="tabId">The tab ID.</param> | ||
/// <param name="portalAlias">The portal alias.</param> | ||
/// <returns>Portal alias.</returns> | ||
string GetPortalAliasByTab(int tabId, string portalAlias); | ||
|
||
/// <summary> | ||
/// Validates the alias. | ||
/// </summary> | ||
/// <param name="portalAlias">The portal alias.</param> | ||
/// <param name="ischild">if set to <c>true</c>, validate the alias as a child alias (i.e. as a subdirectory of another alias).</param> | ||
/// <returns><c>true</c> if the alias is a valid url format; otherwise return <c>false</c>.</returns> | ||
bool ValidateAlias(string portalAlias, bool ischild); | ||
|
||
/// <summary> | ||
/// Adds a new Portal Alias. | ||
/// </summary> | ||
/// <param name="portalAlias">The portal alias.</param> | ||
/// <returns>The new portal alias ID.</returns> | ||
int AddPortalAlias(IPortalAliasInfo portalAlias); | ||
|
||
/// <summary> | ||
/// Deletes an existing portal alias. | ||
/// </summary> | ||
/// <param name="portalAlias">The portal alias to delete.</param> | ||
void DeletePortalAlias(IPortalAliasInfo portalAlias); | ||
|
||
/// <summary> | ||
/// Get a portal alias by name. | ||
/// </summary> | ||
/// <param name="alias">The name of the portal alias.</param> | ||
/// <returns>The portal alias.</returns> | ||
IPortalAliasInfo GetPortalAlias(string alias); | ||
|
||
/// <summary> | ||
/// Gets the portal alias. | ||
/// </summary> | ||
/// <param name="alias">The portal alias.</param> | ||
/// <param name="portalId">The portal ID.</param> | ||
/// <returns>Portal Alias Info.</returns> | ||
IPortalAliasInfo GetPortalAlias(string alias, int portalId); | ||
|
||
/// <summary> | ||
/// Gets the portal alias by portal alias ID. | ||
/// </summary> | ||
/// <param name="portalAliasId">The portal alias ID.</param> | ||
/// <returns>Portal alias info.</returns> | ||
IPortalAliasInfo GetPortalAliasByPortalAliasId(int portalAliasId); | ||
|
||
/// <summary> | ||
/// Get all portal aliases. | ||
/// </summary> | ||
/// <returns>A collection of portal aliases.</returns> | ||
IDictionary<string, IPortalAliasInfo> GetPortalAliases(); | ||
|
||
/// <summary> | ||
/// Get all the portal aliases for a specific portal. | ||
/// </summary> | ||
/// <param name="portalId">The portal ID.</param> | ||
/// <returns>An IEnumerable of portal aliases.</returns> | ||
IEnumerable<IPortalAliasInfo> GetPortalAliasesByPortalId(int portalId); | ||
|
||
/// <summary> | ||
/// Gets the portal by portal alias ID. | ||
/// </summary> | ||
/// <param name="portalAliasId">The portal alias id.</param> | ||
/// <returns>Portal info.</returns> | ||
IPortalInfo GetPortalByPortalAliasId(int portalAliasId); | ||
|
||
/// <summary> | ||
/// Update a specified portal alias. | ||
/// </summary> | ||
/// <param name="portalAlias">The portal alias to update.</param> | ||
void UpdatePortalAlias(IPortalAliasInfo portalAlias); | ||
} | ||
} |
Oops, something went wrong.