Skip to content

Commit

Permalink
Merge pull request #4056 from valadas/fm-rebase-develop
Browse files Browse the repository at this point in the history
Rebases the resource manager branch with latest changes on develop
  • Loading branch information
valadas authored Sep 5, 2020
2 parents d91078c + cd38479 commit 8ce0f19
Show file tree
Hide file tree
Showing 74 changed files with 18,659 additions and 17,709 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ Provide any additional context that may be helpful in understanding and/or resol
Please add X in at least one of the boxes as appropriate. In order for an issue to be accepted, a developer needs to be able to reproduce the issue on a currently supported version. If you are looking for a workaround for an issue with an older version, please visit the forums at https://dnncommunity.org/forums
-->
* [ ] 10.00.00 alpha build
* [ ] 09.07.00 release candidate
* [ ] 09.06.02 latest supported release
* [ ] 09.07.01 release candidate
* [ ] 09.07.00 latest supported release

## Affected browser
<!--
Expand Down
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant
to clarify expected behavior in our community.
For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
// 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.Application
{
using System.Collections.Generic;

using DotNetNuke.Abstractions.Settings;

/// <summary>
/// The <see cref="IHostSettingsService"/> provides business layer of the HostSettings
/// Entity.
/// </summary>
/// <example>
///
/// <code lang="C#">
/// public class MySampleClass
/// {
/// IHostSettingsService service;
/// public MySampleClass(IHostSettingsService service)
/// {
/// this.service = service;
/// }
///
/// public bool CheckUpgrade { get => this.service.GetBoolean("CheckUpgrade", true);
/// }
/// </code>
/// </example>
public interface IHostSettingsService
{
/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
bool GetBoolean(string key);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="defaultValue">this value will be return if setting's value is empty.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
bool GetBoolean(string key, bool defaultValue);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
double GetDouble(string key);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="defaultValue">this value will be return if setting's value is empty.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
double GetDouble(string key, double defaultValue);

/// <summary>
/// takes in a text value, decrypts it with a FIPS compliant algorithm and returns the value.
/// </summary>
/// <param name="key">the host setting to read.</param>
/// <param name="passPhrase">the pass phrase used for encryption/decryption.</param>
/// <returns>The setting value as a <see cref="string"/>.</returns>
string GetEncryptedString(string key, string passPhrase);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
int GetInteger(string key);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="defaultValue">this value will be return if setting's value is empty.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
int GetInteger(string key, int defaultValue);

/// <summary>
/// Gets all host settings.
/// </summary>
/// <returns>host setting.</returns>
Dictionary<string, IConfigurationSetting> GetSettings();

/// <summary>
/// Gets all host settings as dictionary.
/// </summary>
/// <returns>host setting's value.</returns>
Dictionary<string, string> GetSettingsDictionary();

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
string GetString(string key);

/// <summary>
/// Gets the setting value by the specific key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="defaultValue">this value will be return if setting's value is empty.</param>
/// <returns>host setting's value.</returns>
/// <exception cref="System.ArgumentException">key is empty.</exception>
string GetString(string key, string defaultValue);

/// <summary>
/// Increments the Client Resource Manager (CRM) version to bust local cache.
/// </summary>
/// <param name="includeOverridingPortals">If true also forces a CRM version increment on portals that have non-default settings for CRM.</param>
void IncrementCrmVersion(bool includeOverridingPortals);

/// <summary>
/// Updates the specified config.
/// </summary>
/// <param name="config">The config.</param>
void Update(IConfigurationSetting config);

/// <summary>
/// Updates the specified config.
/// </summary>
/// <param name="config">The config.</param>
/// <param name="clearCache">if set to <c>true</c> will clear cache after updating the setting.</param>
void Update(IConfigurationSetting config, bool clearCache);

/// <summary>
/// Updates the specified settings.
/// </summary>
/// <param name="settings">The settings.</param>
void Update(Dictionary<string, string> settings);

/// <summary>
/// Updates the setting for a specified key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
void Update(string key, string value);

/// <summary>
/// Updates the specified key.
/// </summary>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
/// <param name="clearCache">if set to <c>true</c> will clear cache after update settings.</param>
void Update(string key, string value, bool clearCache);

/// <summary>
/// Takes in a <see cref="string"/> value, encrypts it with a FIPS compliant algorithm and stores it.
/// </summary>
/// <param name="key">host settings key.</param>
/// <param name="value">host settings value.</param>
/// <param name="passPhrase">pass phrase to allow encryption/decryption.</param>
void UpdateEncryptedString(string key, string value, string passPhrase);
}
}
55 changes: 41 additions & 14 deletions DNN Platform/DotNetNuke.Abstractions/Portals/IPortalAliasInfo.cs
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; }
}
}
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);
}
}
Loading

0 comments on commit 8ce0f19

Please sign in to comment.