Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
@@ -202,7 +202,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (_smtpenabled == "True")
|
@if (_smtpenabled == "True" && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
|
||||||
{
|
{
|
||||||
<div class="row mb-1 align-items-center">
|
<div class="row mb-1 align-items-center">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
@@ -609,21 +609,24 @@
|
|||||||
|
|
||||||
// SMTP
|
// SMTP
|
||||||
_smtpenabled = SettingService.GetSetting(settings, "SMTPEnabled", "False");
|
_smtpenabled = SettingService.GetSetting(settings, "SMTPEnabled", "False");
|
||||||
_smtphost = SettingService.GetSetting(settings, "SMTPHost", string.Empty);
|
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
|
||||||
_smtpport = SettingService.GetSetting(settings, "SMTPPort", string.Empty);
|
{
|
||||||
_smtpssl = SettingService.GetSetting(settings, "SMTPSSL", "False");
|
_smtphost = SettingService.GetSetting(settings, "SMTPHost", string.Empty);
|
||||||
_smtpauthentication = SettingService.GetSetting(settings, "SMTPAuthentication", "Basic");
|
_smtpport = SettingService.GetSetting(settings, "SMTPPort", string.Empty);
|
||||||
_smtpusername = SettingService.GetSetting(settings, "SMTPUsername", string.Empty);
|
_smtpssl = SettingService.GetSetting(settings, "SMTPSSL", "False");
|
||||||
_smtppassword = SettingService.GetSetting(settings, "SMTPPassword", string.Empty);
|
_smtpauthentication = SettingService.GetSetting(settings, "SMTPAuthentication", "Basic");
|
||||||
_togglesmtppassword = SharedLocalizer["ShowPassword"];
|
_smtpusername = SettingService.GetSetting(settings, "SMTPUsername", string.Empty);
|
||||||
_smtpauthority = SettingService.GetSetting(settings, "SMTPAuthority", string.Empty);
|
_smtppassword = SettingService.GetSetting(settings, "SMTPPassword", string.Empty);
|
||||||
_smtpclientid = SettingService.GetSetting(settings, "SMTPClientId", string.Empty);
|
_togglesmtppassword = SharedLocalizer["ShowPassword"];
|
||||||
_smtpclientsecret = SettingService.GetSetting(settings, "SMTPClientSecret", string.Empty);
|
_smtpauthority = SettingService.GetSetting(settings, "SMTPAuthority", string.Empty);
|
||||||
_togglesmtpclientsecret = SharedLocalizer["ShowPassword"];
|
_smtpclientid = SettingService.GetSetting(settings, "SMTPClientId", string.Empty);
|
||||||
_smtpscopes = SettingService.GetSetting(settings, "SMTPScopes", string.Empty);
|
_smtpclientsecret = SettingService.GetSetting(settings, "SMTPClientSecret", string.Empty);
|
||||||
_smtpsender = SettingService.GetSetting(settings, "SMTPSender", string.Empty);
|
_togglesmtpclientsecret = SharedLocalizer["ShowPassword"];
|
||||||
_smtprelay = SettingService.GetSetting(settings, "SMTPRelay", "False");
|
_smtpscopes = SettingService.GetSetting(settings, "SMTPScopes", string.Empty);
|
||||||
_retention = int.Parse(SettingService.GetSetting(settings, "NotificationRetention", "30"));
|
_smtpsender = SettingService.GetSetting(settings, "SMTPSender", string.Empty);
|
||||||
|
_smtprelay = SettingService.GetSetting(settings, "SMTPRelay", "False");
|
||||||
|
_retention = int.Parse(SettingService.GetSetting(settings, "NotificationRetention", "30"));
|
||||||
|
}
|
||||||
|
|
||||||
// PWA
|
// PWA
|
||||||
_pwaisenabled = site.PwaIsEnabled.ToString();
|
_pwaisenabled = site.PwaIsEnabled.ToString();
|
||||||
@@ -800,21 +803,23 @@
|
|||||||
|
|
||||||
// SMTP
|
// SMTP
|
||||||
var settings = await SettingService.GetSiteSettingsAsync(site.SiteId);
|
var settings = await SettingService.GetSiteSettingsAsync(site.SiteId);
|
||||||
settings = SettingService.SetSetting(settings, "SMTPHost", _smtphost, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPPort", _smtpport, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPSSL", _smtpssl, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPAuthentication", _smtpauthentication, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPUsername", _smtpusername, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPPassword", _smtppassword, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPAuthority", _smtpauthority, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPClientId", _smtpclientid, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPClientSecret", _smtpclientsecret, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPScopes", _smtpscopes, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPSender", _smtpsender, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPRelay", _smtprelay, true);
|
|
||||||
settings = SettingService.SetSetting(settings, "SMTPEnabled", _smtpenabled, true);
|
settings = SettingService.SetSetting(settings, "SMTPEnabled", _smtpenabled, true);
|
||||||
settings = SettingService.SetSetting(settings, "SiteGuid", _siteguid, true);
|
if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host))
|
||||||
settings = SettingService.SetSetting(settings, "NotificationRetention", _retention.ToString(), true);
|
{
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPHost", _smtphost, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPPort", _smtpport, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPSSL", _smtpssl, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPAuthentication", _smtpauthentication, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPUsername", _smtpusername, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPPassword", _smtppassword, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPAuthority", _smtpauthority, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPClientId", _smtpclientid, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPClientSecret", _smtpclientsecret, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPScopes", _smtpscopes, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPSender", _smtpsender, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "SMTPRelay", _smtprelay, true);
|
||||||
|
settings = SettingService.SetSetting(settings, "NotificationRetention", _retention.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
//cookie consent
|
//cookie consent
|
||||||
settings = SettingService.SetSetting(settings, "CookieConsent", _cookieconsent);
|
settings = SettingService.SetSetting(settings, "CookieConsent", _cookieconsent);
|
||||||
@@ -822,6 +827,7 @@
|
|||||||
// functionality
|
// functionality
|
||||||
settings = SettingService.SetSetting(settings, "TextEditor", _textEditor);
|
settings = SettingService.SetSetting(settings, "TextEditor", _textEditor);
|
||||||
|
|
||||||
|
settings = SettingService.SetSetting(settings, "SiteGuid", _siteguid, true);
|
||||||
await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId);
|
await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId);
|
||||||
|
|
||||||
await logger.LogInformation("Site Settings Saved {Site}", site);
|
await logger.LogInformation("Site Settings Saved {Site}", site);
|
||||||
|
|||||||
@@ -118,42 +118,42 @@ else
|
|||||||
<Label Class="col-sm-3" For="databaseType" HelpText="Select the database type" ResourceKey="DatabaseType">Type: </Label>
|
<Label Class="col-sm-3" For="databaseType" HelpText="Select the database type" ResourceKey="DatabaseType">Type: </Label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
@if (_databases != null)
|
@if (_databases != null)
|
||||||
{
|
{
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<select id="databaseType" class="form-select" value="@_databaseName" @onchange="(e => DatabaseChanged(e))" required>
|
<select id="databaseType" class="form-select" value="@_databaseName" @onchange="(e => DatabaseChanged(e))" required>
|
||||||
@foreach (var database in _databases)
|
@foreach (var database in _databases)
|
||||||
{
|
{
|
||||||
<option value="@database.Name">@Localizer[@database.Name]</option>
|
<option value="@database.Name">@Localizer[@database.Name]</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
@if (!_showConnectionString)
|
@if (!_showConnectionString)
|
||||||
{
|
{
|
||||||
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionString"]</button>
|
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionString"]</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionParameters"]</button>
|
<button type="button" class="btn btn-secondary" @onclick="ToggleConnectionString">@Localizer["EnterConnectionParameters"]</button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (!_showConnectionString)
|
@if (!_showConnectionString)
|
||||||
{
|
{
|
||||||
if (_databaseConfigType != null)
|
if (_databaseConfigType != null)
|
||||||
{
|
{
|
||||||
@DatabaseConfigComponent
|
@DatabaseConfigComponent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="row mb-1 align-items-center">
|
<div class="row mb-1 align-items-center">
|
||||||
<Label Class="col-sm-3" For="connectionstring" HelpText="Enter a complete connection string including all parameters and delimiters" ResourceKey="ConnectionString">Settings:</Label>
|
<Label Class="col-sm-3" For="connectionstring" HelpText="Enter a complete connection string including all parameters and delimiters" ResourceKey="ConnectionString">Settings:</Label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<textarea id="connectionstring" class="form-control" @bind="@_connectionString" rows="3"></textarea>
|
<textarea id="connectionstring" class="form-control" @bind="@_connectionString" rows="3"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
<div class="row mb-1 align-items-center">
|
<div class="row mb-1 align-items-center">
|
||||||
<Label Class="col-sm-3" For="hostUsername" HelpText="Enter the username of an existing host user" ResourceKey="HostUsername">Host Username:</Label>
|
<Label Class="col-sm-3" For="hostUsername" HelpText="Enter the username of an existing host user" ResourceKey="HostUsername">Host Username:</Label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
@@ -390,6 +390,8 @@ else
|
|||||||
config.DatabaseType = tenant.DBType;
|
config.DatabaseType = tenant.DBType;
|
||||||
config.ConnectionString = tenant.DBConnectionString;
|
config.ConnectionString = tenant.DBConnectionString;
|
||||||
config.IsNewTenant = false;
|
config.IsNewTenant = false;
|
||||||
|
config.HostEmail = PageState.User.Email;
|
||||||
|
config.HostName = PageState.User.DisplayName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -403,6 +405,7 @@ else
|
|||||||
config.SiteTemplate = _sitetemplatetype;
|
config.SiteTemplate = _sitetemplatetype;
|
||||||
config.RenderMode = _rendermode;
|
config.RenderMode = _rendermode;
|
||||||
config.Runtime = _runtime;
|
config.Runtime = _runtime;
|
||||||
|
config.Register = false;
|
||||||
|
|
||||||
ShowProgressIndicator();
|
ShowProgressIndicator();
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
if (CreatedOn != null)
|
if (CreatedOn != null)
|
||||||
{
|
{
|
||||||
_text += $" {Localizer["On"]} <b>{UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}</ b >";
|
_text += $" {Localizer["On"]} <b>{UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}</b>";
|
||||||
}
|
}
|
||||||
|
|
||||||
_text += "</p>";
|
_text += "</p>";
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
if (ModifiedOn != null)
|
if (ModifiedOn != null)
|
||||||
{
|
{
|
||||||
_text += $" {Localizer["On"]} <b>{UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}</ b >";
|
_text += $" {Localizer["On"]} <b>{UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}</b>";
|
||||||
}
|
}
|
||||||
|
|
||||||
_text += "</p>";
|
_text += "</p>";
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
if (DeletedOn != null)
|
if (DeletedOn != null)
|
||||||
{
|
{
|
||||||
_text += $" {Localizer["On"]} <b>{UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}</ b >";
|
_text += $" {Localizer["On"]} <b>{UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}</b>";
|
||||||
}
|
}
|
||||||
|
|
||||||
_text += "</p>";
|
_text += "</p>";
|
||||||
|
|||||||
@@ -504,8 +504,8 @@ namespace Oqtane.Modules
|
|||||||
public DateTime? UtcToLocal(DateTime? datetime)
|
public DateTime? UtcToLocal(DateTime? datetime)
|
||||||
{
|
{
|
||||||
// Early return if input is null
|
// Early return if input is null
|
||||||
if (datetime == null)
|
if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue)
|
||||||
return null;
|
return datetime;
|
||||||
|
|
||||||
string timezoneId = null;
|
string timezoneId = null;
|
||||||
|
|
||||||
@@ -524,8 +524,8 @@ namespace Oqtane.Modules
|
|||||||
public DateTime? LocalToUtc(DateTime? datetime)
|
public DateTime? LocalToUtc(DateTime? datetime)
|
||||||
{
|
{
|
||||||
// Early return if input is null
|
// Early return if input is null
|
||||||
if (datetime == null)
|
if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue)
|
||||||
return null;
|
return datetime;
|
||||||
|
|
||||||
string timezoneId = null;
|
string timezoneId = null;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<RootNamespace>Oqtane</RootNamespace>
|
<RootNamespace>Oqtane</RootNamespace>
|
||||||
@@ -22,10 +22,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -8,6 +8,46 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve and store <see cref="Alias"/> information.
|
||||||
|
/// </summary>
|
||||||
|
public interface IAliasService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all aliases in the system
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Alias>> GetAliasesAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a single alias
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="aliasId">The <see cref="Oqtane.Models.Alias"/> ID, not to be confused with a <see cref="Oqtane.Models.Site"/> ID</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Alias> GetAliasAsync(int aliasId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save another <see cref="Oqtane.Models.Alias"/> in the DB. It must already contain all the information incl. <see cref="Oqtane.Models.Tenant"/> it belongs to.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="alias">An <see cref="Oqtane.Models.Alias"/> to add.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Alias> AddAliasAsync(Alias alias);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update an <see cref="Oqtane.Models.Alias"/> in the DB. Make sure the object is correctly filled, as it must update an existing record.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="alias">The <see cref="Oqtane.Models.Alias"/> to update.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Alias> UpdateAliasAsync(Alias alias);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Remove an <see cref="Oqtane.Models.Alias"/> from the DB.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="aliasId">The Alias ID, not to be confused with a Site ID.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteAliasAsync(int aliasId);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="IAliasService" />
|
/// <inheritdoc cref="IAliasService" />
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class AliasService : ServiceBase, IAliasService
|
public class AliasService : ServiceBase, IAliasService
|
||||||
|
|||||||
@@ -1,13 +1,46 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System;
|
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using System.Globalization;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve cookie consent information.
|
||||||
|
/// </summary>
|
||||||
|
public interface ICookieConsentService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get cookie consent bar actioned status
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> IsActionedAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get cookie consent status
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> CanTrackAsync(bool optOut);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// create actioned cookie
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> CreateActionedCookieAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// create consent cookie
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> CreateConsentCookieAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// widhdraw consent cookie
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> WithdrawConsentCookieAsync();
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="ICookieConsentService" />
|
/// <inheritdoc cref="ICookieConsentService" />
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class CookieConsentService : ServiceBase, ICookieConsentService
|
public class CookieConsentService : ServiceBase, ICookieConsentService
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve <see cref="Database"/> information.
|
||||||
|
/// </summary>
|
||||||
|
public interface IDatabaseService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of databases
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Database>> GetDatabasesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class DatabaseService : ServiceBase, IDatabaseService
|
public class DatabaseService : ServiceBase, IDatabaseService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
@@ -10,6 +9,103 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to get / create / upload / download files.
|
||||||
|
/// </summary>
|
||||||
|
public interface IFileService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="File"/>s in the specified Folder
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderId">The folder ID</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<File>> GetFilesAsync(int folderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="File"/>s in the specified folder.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folder">
|
||||||
|
/// The folder path relative to where the files are stored.
|
||||||
|
/// TODO: todoc verify exactly from where the folder path must start
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<File>> GetFilesAsync(string folder);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one <see cref="File"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<File> GetFileAsync(int fileId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="File"/> based on the <see cref="Folder"/> and file name.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderId">Reference to the <see cref="Folder"/></param>
|
||||||
|
/// <param name="name">name of the file
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<File> GetFileAsync(int folderId, string name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add / store a <see cref="File"/> record.
|
||||||
|
/// This does not contain the file contents.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<File> AddFileAsync(File file);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update a <see cref="File"/> record.
|
||||||
|
/// Use this for rename a file or change some attributes.
|
||||||
|
/// This does not contain the file contents.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<File> UpdateFileAsync(File file);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a <see cref="File"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteFileAsync(int fileId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Upload a file from a URL to a <see cref="Folder"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="url"></param>
|
||||||
|
/// <param name="folderId"></param>
|
||||||
|
/// <param name="name"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<File> UploadFileAsync(string url, int folderId, string name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get / download a file (the body).
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileId">Reference to a <see cref="File"/></param>
|
||||||
|
/// <returns>The bytes of the file</returns>
|
||||||
|
Task<byte[]> DownloadFileAsync(int fileId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve a list of files from a <see cref="Site"/> and <see cref="Folder"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">Reference to the <see cref="Site"/></param>
|
||||||
|
/// <param name="folderPath">Path of the folder
|
||||||
|
/// TODO: todoc verify exactly from where the folder path must start
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<File>> GetFilesAsync(int siteId, string folderPath);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Unzips the contents of a zip file
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="fileId">Reference to the <see cref="File"/></param>
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UnzipFileAsync(int fileId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class FileService : ServiceBase, IFileService
|
public class FileService : ServiceBase, IFileService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,58 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to get / create / modify <see cref="Folder"/> objects.
|
||||||
|
/// </summary>
|
||||||
|
public interface IFolderService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve root folders of a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Folder>> GetFoldersAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieve the information of one <see cref="Folder"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Folder> GetFolderAsync(int folderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Create one Folder using a <see cref="Folder"/> object.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folder"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Folder> AddFolderAsync(Folder folder);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update the information about a <see cref="Folder"/>
|
||||||
|
/// Use this to rename the folder etc.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folder"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Folder> UpdateFolderAsync(Folder folder);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a <see cref="Folder"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderId">Reference to a <see cref="Folder"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteFolderAsync(int folderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="Folder"/> of a <see cref="Site"/> based on the path.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">Reference to the <see cref="Site"/></param>
|
||||||
|
/// <param name="folderPath">Path of the folder
|
||||||
|
/// TODO: todoc verify exactly from where the folder path must start
|
||||||
|
/// </param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Folder> GetFolderAsync(int siteId, [NotNull] string folderPath);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class FolderService : ServiceBase, IFolderService
|
public class FolderService : ServiceBase, IFolderService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,38 @@ using System.Linq;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage (install master database / upgrade version / etc.) the installation
|
||||||
|
/// </summary>
|
||||||
|
public interface IInstallationService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a status/message object with the current installation state
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Installation> IsInstalled();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts the installation process
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="config">connectionString, database type, alias etc.</param>
|
||||||
|
/// <returns>internal status/message object</returns>
|
||||||
|
Task<Installation> Install(InstallConfig config);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts the upgrade process
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="backup">indicates if files should be backed up during upgrade</param>
|
||||||
|
/// <returns>internal status/message object</returns>
|
||||||
|
Task<Installation> Upgrade(bool backup);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Restarts the installation
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>internal status/message object</returns>
|
||||||
|
Task RestartAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class InstallationService : ServiceBase, IInstallationService
|
public class InstallationService : ServiceBase, IInstallationService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve and store <see cref="Alias"/> information.
|
|
||||||
/// </summary>
|
|
||||||
public interface IAliasService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all aliases in the system
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Alias>> GetAliasesAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a single alias
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="aliasId">The <see cref="Oqtane.Models.Alias"/> ID, not to be confused with a <see cref="Oqtane.Models.Site"/> ID</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Alias> GetAliasAsync(int aliasId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Save another <see cref="Oqtane.Models.Alias"/> in the DB. It must already contain all the information incl. <see cref="Oqtane.Models.Tenant"/> it belongs to.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="alias">An <see cref="Oqtane.Models.Alias"/> to add.</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Alias> AddAliasAsync(Alias alias);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update an <see cref="Oqtane.Models.Alias"/> in the DB. Make sure the object is correctly filled, as it must update an existing record.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="alias">The <see cref="Oqtane.Models.Alias"/> to update.</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Alias> UpdateAliasAsync(Alias alias);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove an <see cref="Oqtane.Models.Alias"/> from the DB.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="aliasId">The Alias ID, not to be confused with a Site ID.</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteAliasAsync(int aliasId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve cookie consent information.
|
|
||||||
/// </summary>
|
|
||||||
public interface ICookieConsentService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get cookie consent bar actioned status
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> IsActionedAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get cookie consent status
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> CanTrackAsync(bool optOut);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// create actioned cookie
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> CreateActionedCookieAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// create consent cookie
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> CreateConsentCookieAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// widhdraw consent cookie
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> WithdrawConsentCookieAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve <see cref="Database"/> information.
|
|
||||||
/// </summary>
|
|
||||||
public interface IDatabaseService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of databases
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Database>> GetDatabasesAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to get / create / upload / download files.
|
|
||||||
/// </summary>
|
|
||||||
public interface IFileService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="File"/>s in the specified Folder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderId">The folder ID</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<File>> GetFilesAsync(int folderId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="File"/>s in the specified folder.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder">
|
|
||||||
/// The folder path relative to where the files are stored.
|
|
||||||
/// TODO: todoc verify exactly from where the folder path must start
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<File>> GetFilesAsync(string folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one <see cref="File"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<File> GetFileAsync(int fileId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a <see cref="File"/> based on the <see cref="Folder"/> and file name.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderId">Reference to the <see cref="Folder"/></param>
|
|
||||||
/// <param name="name">name of the file
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<File> GetFileAsync(int folderId, string name);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add / store a <see cref="File"/> record.
|
|
||||||
/// This does not contain the file contents.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="file"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<File> AddFileAsync(File file);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update a <see cref="File"/> record.
|
|
||||||
/// Use this for rename a file or change some attributes.
|
|
||||||
/// This does not contain the file contents.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="file"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<File> UpdateFileAsync(File file);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete a <see cref="File"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteFileAsync(int fileId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Upload a file from a URL to a <see cref="Folder"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="url"></param>
|
|
||||||
/// <param name="folderId"></param>
|
|
||||||
/// <param name="name"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<File> UploadFileAsync(string url, int folderId, string name);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get / download a file (the body).
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileId">Reference to a <see cref="File"/></param>
|
|
||||||
/// <returns>The bytes of the file</returns>
|
|
||||||
Task<byte[]> DownloadFileAsync(int fileId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve a list of files from a <see cref="Site"/> and <see cref="Folder"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">Reference to the <see cref="Site"/></param>
|
|
||||||
/// <param name="folderPath">Path of the folder
|
|
||||||
/// TODO: todoc verify exactly from where the folder path must start
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<File>> GetFilesAsync(int siteId, string folderPath);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Unzips the contents of a zip file
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="fileId">Reference to the <see cref="File"/></param>
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UnzipFileAsync(int fileId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to get / create / modify <see cref="Folder"/> objects.
|
|
||||||
/// </summary>
|
|
||||||
public interface IFolderService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve root folders of a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Folder>> GetFoldersAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Retrieve the information of one <see cref="Folder"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Folder> GetFolderAsync(int folderId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Create one Folder using a <see cref="Folder"/> object.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Folder> AddFolderAsync(Folder folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update the information about a <see cref="Folder"/>
|
|
||||||
/// Use this to rename the folder etc.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Folder> UpdateFolderAsync(Folder folder);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete a <see cref="Folder"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderId">Reference to a <see cref="Folder"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteFolderAsync(int folderId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a <see cref="Folder"/> of a <see cref="Site"/> based on the path.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">Reference to the <see cref="Site"/></param>
|
|
||||||
/// <param name="folderPath">Path of the folder
|
|
||||||
/// TODO: todoc verify exactly from where the folder path must start
|
|
||||||
/// </param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Folder> GetFolderAsync(int siteId, [NotNull]string folderPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Oqtane.Shared;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage (install master database / upgrade version / etc.) the installation
|
|
||||||
/// </summary>
|
|
||||||
public interface IInstallationService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a status/message object with the current installation state
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Installation> IsInstalled();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Starts the installation process
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="config">connectionString, database type, alias etc.</param>
|
|
||||||
/// <returns>internal status/message object</returns>
|
|
||||||
Task<Installation> Install(InstallConfig config);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Starts the upgrade process
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="backup">indicates if files should be backed up during upgrade</param>
|
|
||||||
/// <returns>internal status/message object</returns>
|
|
||||||
Task<Installation> Upgrade(bool backup);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Restarts the installation
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>internal status/message object</returns>
|
|
||||||
Task RestartAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to read the job schedule log
|
|
||||||
/// </summary>
|
|
||||||
public interface IJobLogService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Return a list of <see cref="JobLog"/> entries
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<JobLog>> GetJobLogsAsync(int jobId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return a <see cref="JobLog"/> entry for the given Id
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobLogId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<JobLog> GetJobLogAsync(int jobLogId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage jobs (<see cref="Job"/>)
|
|
||||||
/// </summary>
|
|
||||||
public interface IJobService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of all jobs
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Job>> GetJobsAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return a specific job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Job> GetJobAsync(int jobId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a new job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="job"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Job> AddJobAsync(Job job);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates an existing job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="job"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Job> UpdateJobAsync(Job job);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete an existing job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteJobAsync(int jobId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Starts the given job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task StartJobAsync(int jobId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Stops the given job
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="jobId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task StopJobAsync(int jobId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Oqtane.Models;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Language"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface ILanguageService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of all available languages for the given <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Language>> GetLanguagesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of all available languages for the given <see cref="Site" /> and package
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="packageName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Language>> GetLanguagesAsync(int siteId, string packageName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the given language
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="languageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Language> GetLanguageAsync(int languageId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds the given language
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Language> AddLanguageAsync(Language language);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Edits the given language
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="language"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task EditLanguageAsync(Language language);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes the given language
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="languageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteLanguageAsync(int languageId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to set localization cookie
|
|
||||||
/// </summary>
|
|
||||||
public interface ILocalizationCookieService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Set the localization cookie
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="culture"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task SetLocalizationCookieAsync(string culture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Oqtane.Models;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve localizations (<see cref="Culture"/>)
|
|
||||||
/// </summary>
|
|
||||||
public interface ILocalizationService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a collection of supported cultures
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<IEnumerable<Culture>> GetCulturesAsync(bool installed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using Oqtane.Shared;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Oqtane.Enums;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve and store <see cref="Log"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface ILogService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of log entires for the given params
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="level"></param>
|
|
||||||
/// <param name="function"></param>
|
|
||||||
/// <param name="rows"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Log>> GetLogsAsync(int siteId, string level, string function, int rows);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific log entry for the given id
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="logId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Log> GetLogAsync(int logId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clear the entire logs of the given site.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteLogsAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new log entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="category"></param>
|
|
||||||
/// <param name="feature"></param>
|
|
||||||
/// <param name="function"></param>
|
|
||||||
/// <param name="level"></param>
|
|
||||||
/// <param name="exception"></param>
|
|
||||||
/// <param name="message"></param>
|
|
||||||
/// <param name="args"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new log entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="alias"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="category"></param>
|
|
||||||
/// <param name="feature"></param>
|
|
||||||
/// <param name="function"></param>
|
|
||||||
/// <param name="level"></param>
|
|
||||||
/// <param name="exception"></param>
|
|
||||||
/// <param name="message"></param>
|
|
||||||
/// <param name="args"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task Log(Alias alias, int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage a <see cref="ModuleDefinition"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IModuleDefinitionService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of module definitions for the given site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<ModuleDefinition>> GetModuleDefinitionsAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific module definition
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinitionId"></param>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ModuleDefinition> GetModuleDefinitionAsync(int moduleDefinitionId, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing module definition
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinition"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a module definition
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinitionId"></param>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new module definition
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinition"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<ModuleDefinition> CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of module definition templates
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Template>> GetModuleDefinitionTemplatesAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve and store modules (<see cref="Module"/>)
|
|
||||||
/// </summary>
|
|
||||||
public interface IModuleService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of modules for the given site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Module>> GetModulesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Module> GetModuleAsync(int moduleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a new module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="module"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Module> AddModuleAsync(Module module);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates an existing module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="module"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Module> UpdateModuleAsync(Module module);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteModuleAsync(int moduleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Imports a module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <param name="content">module in JSON format</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> ImportModuleAsync(int moduleId, int pageId, string content);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exports a given module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns>module content in JSON format</returns>
|
|
||||||
Task<string> ExportModuleAsync(int moduleId, int pageId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Exports a given module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="folderId"></param>
|
|
||||||
/// <param name="filename"></param>
|
|
||||||
/// <returns>file id</returns>
|
|
||||||
Task<int> ExportModuleAsync(int moduleId, int pageId, int folderId, string filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to store and retrieve notifications (<see cref="Notification"/>)
|
|
||||||
/// </summary>
|
|
||||||
public interface INotificationService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Return a list of notifications
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="direction"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="direction"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="count"></param>
|
|
||||||
/// <param name="isRead"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="direction"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <param name="isRead"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<int> GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific notifications
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="notificationId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Notification> GetNotificationAsync(int notificationId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new notification
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="notification"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Notification> AddNotificationAsync(Notification notification);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing notification
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="notification"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Notification> UpdateNotificationAsync(Notification notification);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a notification
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="notificationId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteNotificationAsync(int notificationId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage cache
|
|
||||||
/// </summary>
|
|
||||||
public interface IOutputCacheService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Evicts the output cache for a specific tag
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tag"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task EvictByTag(string tag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage packages (<see cref="Package"/>)
|
|
||||||
/// </summary>
|
|
||||||
public interface IPackageService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of packages matching the given parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Package>> GetPackagesAsync(string type);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of packages matching the given parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <param name="search"></param>
|
|
||||||
/// <param name="price"></param>
|
|
||||||
/// <param name="package"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of packages matching the given parameters
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="type"></param>
|
|
||||||
/// <param name="search"></param>
|
|
||||||
/// <param name="price"></param>
|
|
||||||
/// <param name="package"></param>
|
|
||||||
/// <param name="sort"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package, string sort);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of packages based on installationid
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Package>> GetPackageUpdatesAsync(string type);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific package
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="packageId"></param>
|
|
||||||
/// <param name="version"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Package> GetPackageAsync(string packageId, string version, bool download);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Downloads a specific package as .nupkg file
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="packageId"></param>
|
|
||||||
/// <param name="version"></param>
|
|
||||||
/// <param name="folder"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DownloadPackageAsync(string packageId, string version);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Installs all packages located in //TODO: 2dm where?
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task InstallPackagesAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to store and retrieve a <see cref="PageModule"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IPageModuleService
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModuleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<PageModule> GetPageModuleAsync(int pageModuleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return a specific page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<PageModule> GetPageModuleAsync(int pageId, int moduleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModule"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<PageModule> AddPageModuleAsync(PageModule pageModule);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModule"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<PageModule> UpdatePageModuleAsync(PageModule pageModule);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates order of all page modules in the given pane
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="pane"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdatePageModuleOrderAsync(int pageId, string pane);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModuleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeletePageModuleAsync(int pageModuleId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Services to store and retrieve a <see cref="Page"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IPageService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of pages
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Page>> GetPagesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Page> GetPageAsync(int pageId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific page by its defined path
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="path"></param>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Page> GetPageAsync(string path, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a new page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="page"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Page> AddPageAsync(Page page);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Adds a new page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="page"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Page> AddPageAsync(int pageId, int userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="page"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Page> UpdatePageAsync(Page page);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates order of all page modules in the given parent
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <param name="parentId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeletePageAsync(int pageId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to store and retrieve <see cref="Profile"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface IProfileService
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of profile entries
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Profile>> GetProfilesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific profile entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="profileId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Profile> GetProfileAsync(int profileId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new profile entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="profile"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Profile> AddProfileAsync(Profile profile);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates an existing profile entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="profile"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Profile> UpdateProfileAsync(Profile profile);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a profile entry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="profileId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteProfileAsync(int profileId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Role"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IRoleService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="Role"/>s of this <see cref="Site"/>.
|
|
||||||
///
|
|
||||||
/// Will exclude global roles which are for all sites. To get those as well, use the overload <see cref="GetRolesAsync(int, bool)"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Role>> GetRolesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get roles of the <see cref="Site"/> and optionally include global Roles.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
|
||||||
/// <param name="includeGlobalRoles">True if it should also include global roles. False will return the same data as just calling <see cref="GetRolesAsync(int)"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Role>> GetRolesAsync(int siteId, bool includeGlobalRoles);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one specific <see cref="Role"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Role> GetRoleAsync(int roleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add / save a new <see cref="Role"/> to the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="role"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Role> AddRoleAsync(Role role);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update a <see cref="Role"/> in the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="role"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Role> UpdateRoleAsync(Role role);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete / mark-as-deleted a <see cref="Role"/> in the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteRoleAsync(int roleId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Oqtane.Documentation;
|
|
||||||
using Oqtane.Models;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
[PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")]
|
|
||||||
public interface ISearchResultsService
|
|
||||||
{
|
|
||||||
Task<SearchResults> GetSearchResultsAsync(SearchQuery searchQuery);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,269 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Setting"/>s
|
|
||||||
/// </summary>
|
|
||||||
public interface ISettingService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all tenant settings
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetTenantSettingsAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a tenant setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tenantSettings"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateTenantSettingsAsync(Dictionary<string, string> tenantSettings);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all site settings for the given site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetSiteSettingsAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a site setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteSettings"></param>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateSiteSettingsAsync(Dictionary<string, string> siteSettings, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clears site option cache
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task ClearSiteSettingsCacheAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all page settings for the given page
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetPageSettingsAsync(int pageId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a page setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageSettings"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdatePageSettingsAsync(Dictionary<string, string> pageSettings, int pageId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all page module settings for the given page module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModuleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetPageModuleSettingsAsync(int pageModuleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a page module setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageModuleSettings"></param>
|
|
||||||
/// <param name="pageModuleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdatePageModuleSettingsAsync(Dictionary<string, string> pageModuleSettings, int pageModuleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all module settings for the given module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetModuleSettingsAsync(int moduleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a module setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleSettings"></param>
|
|
||||||
/// <param name="moduleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateModuleSettingsAsync(Dictionary<string, string> moduleSettings, int moduleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all module settings for the given module
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinitionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetModuleDefinitionSettingsAsync(int moduleDefinitionId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a module setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moduleDefinitionSettings"></param>
|
|
||||||
/// <param name="moduleDefinitionId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateModuleDefinitionSettingsAsync(Dictionary<string, string> moduleDefinitionSettings, int moduleDefinitionId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all user settings for the given user
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetUserSettingsAsync(int userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a user setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userSettings"></param>
|
|
||||||
/// <param name="userId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateUserSettingsAsync(Dictionary<string, string> userSettings, int userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all folder settings for the given folder
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetFolderSettingsAsync(int folderId);
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a folder setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="folderSettings"></param>
|
|
||||||
/// <param name="folderId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateFolderSettingsAsync(Dictionary<string, string> folderSettings, int folderId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all tenant settings
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetHostSettingsAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a host setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="hostSettings"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateHostSettingsAsync(Dictionary<string, string> hostSettings);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all settings for the given visitor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="visitorId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetVisitorSettingsAsync(int visitorId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a visitor setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="visitorSettings"></param>
|
|
||||||
/// <param name="visitorId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateVisitorSettingsAsync(Dictionary<string, string> visitorSettings, int visitorId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a key-value dictionary of all settings for the given entityName
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetSettingsAsync(string entityName, int entityId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates settings for a given entityName and Id
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settings"></param>
|
|
||||||
/// <param name="entityName"></param>
|
|
||||||
/// <param name="entityId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateSettingsAsync(Dictionary<string, string> settings, string entityName, int entityId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates setting for a given entityName and Id
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entityName"></param>
|
|
||||||
/// <param name="entityId"></param>
|
|
||||||
/// <param name="settingName"></param>
|
|
||||||
/// <param name="settingValue"></param>
|
|
||||||
/// <param name="isPrivate"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entityName"></param>
|
|
||||||
/// <param name="entityId"></param>
|
|
||||||
/// <param name="settingName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteSettingAsync(string entityName, int entityId, string settingName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entityName"></param>
|
|
||||||
/// <param name="entityId"></param>
|
|
||||||
/// <param name="settingName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Setting>> GetSettingsAsync(string entityName, int entityId, string settingName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settingId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Setting> GetSettingAsync(string entityName, int settingId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="setting"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Setting> AddSettingAsync(Setting setting);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="setting"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Setting> UpdateSettingAsync(Setting setting);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a setting
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settingId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteSettingAsync(string entityName, int settingId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the value of the given settingName (key) from the given key-value dictionary
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settings"></param>
|
|
||||||
/// <param name="settingName"></param>
|
|
||||||
/// <param name="defaultValue"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
string GetSetting(Dictionary<string, string> settings, string settingName, string defaultValue);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the value of the given settingName (key) in the given key-value dictionary
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settings"></param>
|
|
||||||
/// <param name="settingName"></param>
|
|
||||||
/// <param name="defaultValue"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue);
|
|
||||||
|
|
||||||
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue, bool isPrivate);
|
|
||||||
|
|
||||||
Dictionary<string, string> MergeSettings(Dictionary<string, string> baseSettings, Dictionary<string, string> overwriteSettings);
|
|
||||||
|
|
||||||
|
|
||||||
[Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)]
|
|
||||||
Task<Setting> GetSettingAsync(int settingId);
|
|
||||||
|
|
||||||
[Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)]
|
|
||||||
Task DeleteSettingAsync(int settingId);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
using Oqtane.Documentation;
|
|
||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to store and retrieve <see cref="Site"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface ISiteService
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of sites
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Site>> GetSitesAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Site> GetSiteAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="site"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Site> AddSiteAsync(Site site);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates an existing site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="site"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Site> UpdateSiteAsync(Site site);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteSiteAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of modules
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <param name="pageId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Module>> GetModulesAsync(int siteId, int pageId);
|
|
||||||
|
|
||||||
[PrivateApi]
|
|
||||||
[Obsolete("This method is deprecated.", false)]
|
|
||||||
void SetAlias(Alias alias);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve <see cref="SiteTemplate"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface ISiteTemplateService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of site templates
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<SiteTemplate>> GetSiteTemplatesAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to execute a <see cref="SqlQuery"/> against the backend database
|
|
||||||
/// </summary>
|
|
||||||
public interface ISqlService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Executes a sql query and returns its result
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sqlquery"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<SqlQuery> ExecuteQueryAsync(SqlQuery sqlquery);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve <see cref="Sync"/> information.
|
|
||||||
/// </summary>
|
|
||||||
public interface ISyncService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get sync events
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="lastSyncDate"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Sync> GetSyncEventsAsync(DateTime lastSyncDate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve and update system information.
|
|
||||||
/// </summary>
|
|
||||||
public interface ISystemService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// returns a key-value dictionary with the current system configuration information
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, object>> GetSystemInfoAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// returns a key-value dictionary with the current system information - "environment" or "configuration"
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, object>> GetSystemInfoAsync(string type);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// returns a config value
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<object> GetSystemInfoAsync(string settingKey, object defaultValue);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates system information
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="settings"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateSystemInfoAsync(Dictionary<string, object> settings);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// returns a key-value dictionary with default system icons
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> GetIconsAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Tenant"/>s on the Oqtane installation.
|
|
||||||
/// </summary>
|
|
||||||
public interface ITenantService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="Tenant"/>s
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Tenant>> GetTenantsAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one specific <see cref="Tenant"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tenantId">ID-reference of the <see cref="Tenant"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Tenant> GetTenantAsync(int tenantId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Theme"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface IThemeService
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of available themes
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Theme>> GetThemesAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a specific theme
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themeId"></param>
|
|
||||||
/// <param name="siteId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Theme> GetThemeAsync(int themeId, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a theme <see cref="ThemeControl"/>s containing a specific theme control type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themes"></param>
|
|
||||||
/// <param name="themeControlType"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Theme GetTheme(List<Theme> themes, string themeControlType);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of <see cref="ThemeControl"/>s from the given themes
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themes"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
List<ThemeControl> GetThemeControls(List<Theme> themes);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of <see cref="ThemeControl"/>s for a theme containing a specific theme control type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themes"></param>
|
|
||||||
/// <param name="themeControlType"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
List<ThemeControl> GetThemeControls(List<Theme> themes, string themeControlType);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of containers (<see cref="ThemeControl"/>) for a theme containing a specific theme control type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themes"></param>
|
|
||||||
/// <param name="themeControlType"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
List<ThemeControl> GetContainerControls(List<Theme> themes, string themeControlType);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates a existing theme
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="theme"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task UpdateThemeAsync(Theme theme);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes a theme
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themeName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteThemeAsync(string themeName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new theme
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="theme"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Theme> CreateThemeAsync(Theme theme);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of theme templates (<see cref="Template"/>)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Template>> GetThemeTemplatesAsync();
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns a list of layouts (<see cref="ThemeControl"/>) from the given themes with a matching theme name
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="themes"></param>
|
|
||||||
/// <param name="themeName"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
List<ThemeControl> GetLayoutControls(List<Theme> themes, string themeName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using Oqtane.Models;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to retrieve <see cref="TimeZone"/> entries
|
|
||||||
/// </summary>
|
|
||||||
public interface ITimeZoneService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get the list of time zones
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
List<TimeZone> GetTimeZones();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="UrlMapping"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IUrlMappingService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="UrlMapping"/>s of this <see cref="Site"/>.
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UrlMapping>> GetUrlMappingsAsync(int siteId, bool isMapped);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one specific <see cref="UrlMapping"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UrlMapping> GetUrlMappingAsync(int urlMappingId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one specific <see cref="UrlMapping"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
|
||||||
/// <param name="url">A url</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UrlMapping> GetUrlMappingAsync(int siteId, string url);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Add / save a new <see cref="UrlMapping"/> to the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="urlMapping"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UrlMapping> AddUrlMappingAsync(UrlMapping urlMapping);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update a <see cref="UrlMapping"/> in the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="urlMapping"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UrlMapping> UpdateUrlMappingAsync(UrlMapping urlMapping);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete a <see cref="UrlMapping"/> in the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteUrlMappingAsync(int urlMappingId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Manage <see cref="Role"/>s assigned to a specific <see cref="User"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IUserRoleService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UserRole>> GetUserRolesAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
|
||||||
/// <param name="userId">ID-reference to a <see cref="User"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
|
||||||
/// <param name="roleName">Name reference a <see cref="Role"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UserRole>> GetUserRolesAsync(int siteId, string roleName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
|
||||||
/// <param name="userId">ID-reference to a <see cref="User"/></param>
|
|
||||||
/// <param name="roleName">Name reference a <see cref="Role"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId, string roleName);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get one specific <see cref="UserRole"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userRoleId">ID-reference to a <see cref="UserRole"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UserRole> GetUserRoleAsync(int userRoleId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Save a new <see cref="UserRole"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userRole"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UserRole> AddUserRoleAsync(UserRole userRole);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update a <see cref="UserRole"/> in the database
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userRole"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UserRole> UpdateUserRoleAsync(UserRole userRole);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete a <see cref="UserRole"/> in the database
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userRoleId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteUserRoleAsync(int userRoleId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,171 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Manage (get / update) user information
|
|
||||||
/// </summary>
|
|
||||||
public interface IUserService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get a <see cref="User"/> of a specific site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId">ID of a <see cref="User"/></param>
|
|
||||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> GetUserAsync(int userId, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a <see cref="User"/> of a specific site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="username">Username / login of a <see cref="User"/></param>
|
|
||||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> GetUserAsync(string username, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a <see cref="User"/> of a specific site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="username">Username / login of a <see cref="User"/></param>
|
|
||||||
/// <param name="email">email address of a <see cref="User"/></param>
|
|
||||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> GetUserAsync(string username, string email, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Save a user to the Database.
|
|
||||||
/// The <see cref="User"/> object contains all the information incl. what <see cref="Site"/> it belongs to.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> AddUserAsync(User user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update an existing user in the database.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> UpdateUserAsync(User user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Delete / remove a user in the database
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="userId">ID-reference to the <see cref="User"/></param>
|
|
||||||
/// <param name="siteId">ID-reference to the <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task DeleteUserAsync(int userId, int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Will login the specified <see cref="User"/>.
|
|
||||||
///
|
|
||||||
/// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">A <see cref="User"/> object which should have at least the <see cref="User.Username"/> and <see cref="User.Password"/> set.</param>
|
|
||||||
/// <param name="setCookie">Determines if the login cookie should be set (only relevant for Hybrid scenarios)</param>
|
|
||||||
/// <param name="isPersistent">Determines if the login cookie should be persisted for a long time.</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> LoginUserAsync(User user, bool setCookie, bool isPersistent);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Logout a <see cref="User"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task LogoutUserAsync(User user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Logout a <see cref="User"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task LogoutUserEverywhereAsync(User user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Update e-mail verification status of a user.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">The <see cref="User"/> we're verifying</param>
|
|
||||||
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> VerifyEmailAsync(User user, string token);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Trigger a forgot-password e-mail for this <see cref="User"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task ForgotPasswordAsync(User user);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reset the password of this <see cref="User"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <param name="token"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> ResetPasswordAsync(User user, string token);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Verify the two factor verification code <see cref="User"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user"></param>
|
|
||||||
/// <param name="token"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> VerifyTwoFactorAsync(User user, string token);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Validate identity user info.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="username"></param>
|
|
||||||
/// <param name="email"></param>
|
|
||||||
/// <param name="password"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<UserValidateResult> ValidateUserAsync(string username, string email, string password);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Validate a users password against the password policy
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="password"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<bool> ValidatePasswordAsync(string password);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get token for current user
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> GetTokenAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get personal access token for current user (administrators only)
|
|
||||||
/// </summary>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> GetPersonalAccessTokenAsync();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Link an external login with a local user account
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="user">The <see cref="User"/> we're verifying</param>
|
|
||||||
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
|
|
||||||
/// <param name="type">External Login provider type</param>
|
|
||||||
/// <param name="key">External Login provider key</param>
|
|
||||||
/// <param name="name">External Login provider display name</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<User> LinkUserAsync(User user, string token, string type, string key, string name);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get password requirements for site
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<string> GetPasswordRequirementsAsync(int siteId);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Bulk import of users
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
|
||||||
/// <param name="fileId">ID of a <see cref="File"/></param>
|
|
||||||
/// <param name="notify">Indicates if new users should be notified by email</param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Dictionary<string, string>> ImportUsersAsync(int siteId, int fileId, bool notify);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
using Oqtane.Models;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Service to manage <see cref="Visitor"/>s on a <see cref="Site"/>
|
|
||||||
/// </summary>
|
|
||||||
public interface IVisitorService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Get all <see cref="Visitor"/>s of this <see cref="Site"/>.
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<List<Visitor>> GetVisitorsAsync(int siteId, DateTime fromDate);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get a specific <see cref="Visitor"/> of this <see cref="Site"/>.
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="visitorId">ID-reference of a <see cref="Visitor"/></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
Task<Visitor> GetVisitorAsync(int visitorId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +1,32 @@
|
|||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to read the job schedule log
|
||||||
|
/// </summary>
|
||||||
|
public interface IJobLogService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Return a list of <see cref="JobLog"/> entries
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<JobLog>> GetJobLogsAsync(int jobId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return a <see cref="JobLog"/> entry for the given Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobLogId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<JobLog> GetJobLogAsync(int jobLogId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class JobLogService : ServiceBase, IJobLogService
|
public class JobLogService : ServiceBase, IJobLogService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,60 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage jobs (<see cref="Job"/>)
|
||||||
|
/// </summary>
|
||||||
|
public interface IJobService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all jobs
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Job>> GetJobsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return a specific job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Job> GetJobAsync(int jobId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="job"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Job> AddJobAsync(Job job);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="job"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Job> UpdateJobAsync(Job job);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete an existing job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteJobAsync(int jobId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Starts the given job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task StartJobAsync(int jobId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Stops the given job
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="jobId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task StopJobAsync(int jobId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class JobService : ServiceBase, IJobService
|
public class JobService : ServiceBase, IJobService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,55 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Language"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface ILanguageService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all available languages for the given <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Language>> GetLanguagesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of all available languages for the given <see cref="Site" /> and package
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="packageName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Language>> GetLanguagesAsync(int siteId, string packageName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the given language
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="languageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Language> GetLanguageAsync(int languageId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the given language
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="language"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Language> AddLanguageAsync(Language language);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Edits the given language
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="language"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task EditLanguageAsync(Language language);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes the given language
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="languageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteLanguageAsync(int languageId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class LanguageService : ServiceBase, ILanguageService
|
public class LanguageService : ServiceBase, ILanguageService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,19 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to set localization cookie
|
||||||
|
/// </summary>
|
||||||
|
public interface ILocalizationCookieService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Set the localization cookie
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="culture"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task SetLocalizationCookieAsync(string culture);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class LocalizationCookieService : ServiceBase, ILocalizationCookieService
|
public class LocalizationCookieService : ServiceBase, ILocalizationCookieService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,18 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve localizations (<see cref="Culture"/>)
|
||||||
|
/// </summary>
|
||||||
|
public interface ILocalizationService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a collection of supported cultures
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<IEnumerable<Culture>> GetCulturesAsync(bool installed);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class LocalizationService : ServiceBase, ILocalizationService
|
public class LocalizationService : ServiceBase, ILocalizationService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,6 +11,69 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve and store <see cref="Log"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface ILogService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of log entires for the given params
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="function"></param>
|
||||||
|
/// <param name="rows"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Log>> GetLogsAsync(int siteId, string level, string function, int rows);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific log entry for the given id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="logId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Log> GetLogAsync(int logId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clear the entire logs of the given site.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteLogsAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new log entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="category"></param>
|
||||||
|
/// <param name="feature"></param>
|
||||||
|
/// <param name="function"></param>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="exception"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new log entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="alias"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="category"></param>
|
||||||
|
/// <param name="feature"></param>
|
||||||
|
/// <param name="function"></param>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="exception"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
|
/// <param name="args"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task Log(Alias alias, int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class LogService : ServiceBase, ILogService
|
public class LogService : ServiceBase, ILogService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,55 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage a <see cref="ModuleDefinition"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IModuleDefinitionService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of module definitions for the given site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<ModuleDefinition>> GetModuleDefinitionsAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific module definition
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinitionId"></param>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ModuleDefinition> GetModuleDefinitionAsync(int moduleDefinitionId, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing module definition
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinition"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a module definition
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinitionId"></param>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new module definition
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinition"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<ModuleDefinition> CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of module definition templates
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Template>> GetModuleDefinitionTemplatesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class ModuleDefinitionService : ServiceBase, IModuleDefinitionService
|
public class ModuleDefinitionService : ServiceBase, IModuleDefinitionService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,73 @@ using Oqtane.Modules.Controls;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve and store modules (<see cref="Module"/>)
|
||||||
|
/// </summary>
|
||||||
|
public interface IModuleService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of modules for the given site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Module>> GetModulesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Module> GetModuleAsync(int moduleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="module"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Module> AddModuleAsync(Module module);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="module"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Module> UpdateModuleAsync(Module module);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteModuleAsync(int moduleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Imports a module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <param name="content">module in JSON format</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> ImportModuleAsync(int moduleId, int pageId, string content);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Exports a given module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns>module content in JSON format</returns>
|
||||||
|
Task<string> ExportModuleAsync(int moduleId, int pageId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Exports a given module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="folderId"></param>
|
||||||
|
/// <param name="filename"></param>
|
||||||
|
/// <returns>file id</returns>
|
||||||
|
Task<int> ExportModuleAsync(int moduleId, int pageId, int folderId, string filename);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class ModuleService : ServiceBase, IModuleService
|
public class ModuleService : ServiceBase, IModuleService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,70 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to store and retrieve notifications (<see cref="Notification"/>)
|
||||||
|
/// </summary>
|
||||||
|
public interface INotificationService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Return a list of notifications
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="direction"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="direction"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="count"></param>
|
||||||
|
/// <param name="isRead"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Notification>> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="direction"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="isRead"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<int> GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific notifications
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notificationId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Notification> GetNotificationAsync(int notificationId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new notification
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Notification> AddNotificationAsync(Notification notification);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing notification
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notification"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Notification> UpdateNotificationAsync(Notification notification);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a notification
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="notificationId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteNotificationAsync(int notificationId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class NotificationService : ServiceBase, INotificationService
|
public class NotificationService : ServiceBase, INotificationService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,23 @@
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage cache
|
||||||
|
/// </summary>
|
||||||
|
public interface IOutputCacheService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Evicts the output cache for a specific tag
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tag"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task EvictByTag(string tag);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="IOutputCacheService" />
|
/// <inheritdoc cref="IOutputCacheService" />
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class OutputCacheService : ServiceBase, IOutputCacheService
|
public class OutputCacheService : ServiceBase, IOutputCacheService
|
||||||
|
|||||||
@@ -2,13 +2,75 @@ using Oqtane.Models;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Linq;
|
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage packages (<see cref="Package"/>)
|
||||||
|
/// </summary>
|
||||||
|
public interface IPackageService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of packages matching the given parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Package>> GetPackagesAsync(string type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of packages matching the given parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="search"></param>
|
||||||
|
/// <param name="price"></param>
|
||||||
|
/// <param name="package"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of packages matching the given parameters
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="type"></param>
|
||||||
|
/// <param name="search"></param>
|
||||||
|
/// <param name="price"></param>
|
||||||
|
/// <param name="package"></param>
|
||||||
|
/// <param name="sort"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Package>> GetPackagesAsync(string type, string search, string price, string package, string sort);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of packages based on installationid
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Package>> GetPackageUpdatesAsync(string type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific package
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="packageId"></param>
|
||||||
|
/// <param name="version"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Package> GetPackageAsync(string packageId, string version, bool download);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Downloads a specific package as .nupkg file
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="packageId"></param>
|
||||||
|
/// <param name="version"></param>
|
||||||
|
/// <param name="folder"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DownloadPackageAsync(string packageId, string version);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Installs all packages located in //TODO: 2dm where?
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task InstallPackagesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class PackageService : ServiceBase, IPackageService
|
public class PackageService : ServiceBase, IPackageService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,57 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to store and retrieve a <see cref="PageModule"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IPageModuleService
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModuleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PageModule> GetPageModuleAsync(int pageModuleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return a specific page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PageModule> GetPageModuleAsync(int pageId, int moduleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PageModule> AddPageModuleAsync(PageModule pageModule);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModule"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PageModule> UpdatePageModuleAsync(PageModule pageModule);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates order of all page modules in the given pane
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="pane"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdatePageModuleOrderAsync(int pageId, string pane);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModuleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeletePageModuleAsync(int pageModuleId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class PageModuleService : ServiceBase, IPageModuleService
|
public class PageModuleService : ServiceBase, IPageModuleService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,71 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Services to store and retrieve a <see cref="Page"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IPageService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of pages
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Page>> GetPagesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Page> GetPageAsync(int pageId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific page by its defined path
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="path"></param>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Page> GetPageAsync(string path, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Page> AddPageAsync(Page page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Page> AddPageAsync(int pageId, int userId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="page"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Page> UpdatePageAsync(Page page);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates order of all page modules in the given parent
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <param name="parentId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeletePageAsync(int pageId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class PageService : ServiceBase, IPageService
|
public class PageService : ServiceBase, IPageService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,48 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to store and retrieve <see cref="Profile"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface IProfileService
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of profile entries
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Profile>> GetProfilesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific profile entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="profileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Profile> GetProfileAsync(int profileId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new profile entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="profile"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Profile> AddProfileAsync(Profile profile);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing profile entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="profile"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Profile> UpdateProfileAsync(Profile profile);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a profile entry
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="profileId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteProfileAsync(int profileId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class ProfileService : ServiceBase, IProfileService
|
public class ProfileService : ServiceBase, IProfileService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,57 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Role"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IRoleService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="Role"/>s of this <see cref="Site"/>.
|
||||||
|
///
|
||||||
|
/// Will exclude global roles which are for all sites. To get those as well, use the overload <see cref="GetRolesAsync(int, bool)"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Role>> GetRolesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get roles of the <see cref="Site"/> and optionally include global Roles.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
||||||
|
/// <param name="includeGlobalRoles">True if it should also include global roles. False will return the same data as just calling <see cref="GetRolesAsync(int)"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Role>> GetRolesAsync(int siteId, bool includeGlobalRoles);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one specific <see cref="Role"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Role> GetRoleAsync(int roleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add / save a new <see cref="Role"/> to the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="role"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Role> AddRoleAsync(Role role);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update a <see cref="Role"/> in the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="role"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Role> UpdateRoleAsync(Role role);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete / mark-as-deleted a <see cref="Role"/> in the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="roleId">ID-reference of a <see cref="Role"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteRoleAsync(int roleId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class RoleService : ServiceBase, IRoleService
|
public class RoleService : ServiceBase, IRoleService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
@@ -8,6 +7,12 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
[PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")]
|
||||||
|
public interface ISearchResultsService
|
||||||
|
{
|
||||||
|
Task<SearchResults> GetSearchResultsAsync(SearchQuery searchQuery);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SearchResultsService : ServiceBase, ISearchResultsService, IClientService
|
public class SearchResultsService : ServiceBase, ISearchResultsService, IClientService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,268 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Setting"/>s
|
||||||
|
/// </summary>
|
||||||
|
public interface ISettingService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all tenant settings
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetTenantSettingsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a tenant setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tenantSettings"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateTenantSettingsAsync(Dictionary<string, string> tenantSettings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all site settings for the given site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetSiteSettingsAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a site setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteSettings"></param>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateSiteSettingsAsync(Dictionary<string, string> siteSettings, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Clears site option cache
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ClearSiteSettingsCacheAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all page settings for the given page
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetPageSettingsAsync(int pageId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a page setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageSettings"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdatePageSettingsAsync(Dictionary<string, string> pageSettings, int pageId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all page module settings for the given page module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModuleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetPageModuleSettingsAsync(int pageModuleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a page module setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageModuleSettings"></param>
|
||||||
|
/// <param name="pageModuleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdatePageModuleSettingsAsync(Dictionary<string, string> pageModuleSettings, int pageModuleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all module settings for the given module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetModuleSettingsAsync(int moduleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a module setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleSettings"></param>
|
||||||
|
/// <param name="moduleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateModuleSettingsAsync(Dictionary<string, string> moduleSettings, int moduleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all module settings for the given module
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinitionId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetModuleDefinitionSettingsAsync(int moduleDefinitionId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a module setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="moduleDefinitionSettings"></param>
|
||||||
|
/// <param name="moduleDefinitionId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateModuleDefinitionSettingsAsync(Dictionary<string, string> moduleDefinitionSettings, int moduleDefinitionId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all user settings for the given user
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetUserSettingsAsync(int userId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a user setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userSettings"></param>
|
||||||
|
/// <param name="userId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateUserSettingsAsync(Dictionary<string, string> userSettings, int userId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all folder settings for the given folder
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetFolderSettingsAsync(int folderId);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a folder setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="folderSettings"></param>
|
||||||
|
/// <param name="folderId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateFolderSettingsAsync(Dictionary<string, string> folderSettings, int folderId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all tenant settings
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetHostSettingsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a host setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="hostSettings"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateHostSettingsAsync(Dictionary<string, string> hostSettings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all settings for the given visitor
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitorId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetVisitorSettingsAsync(int visitorId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a visitor setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitorSettings"></param>
|
||||||
|
/// <param name="visitorId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateVisitorSettingsAsync(Dictionary<string, string> visitorSettings, int visitorId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a key-value dictionary of all settings for the given entityName
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetSettingsAsync(string entityName, int entityId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates settings for a given entityName and Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settings"></param>
|
||||||
|
/// <param name="entityName"></param>
|
||||||
|
/// <param name="entityId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateSettingsAsync(Dictionary<string, string> settings, string entityName, int entityId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates setting for a given entityName and Id
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entityName"></param>
|
||||||
|
/// <param name="entityId"></param>
|
||||||
|
/// <param name="settingName"></param>
|
||||||
|
/// <param name="settingValue"></param>
|
||||||
|
/// <param name="isPrivate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entityName"></param>
|
||||||
|
/// <param name="entityId"></param>
|
||||||
|
/// <param name="settingName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteSettingAsync(string entityName, int entityId, string settingName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entityName"></param>
|
||||||
|
/// <param name="entityId"></param>
|
||||||
|
/// <param name="settingName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Setting>> GetSettingsAsync(string entityName, int entityId, string settingName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settingId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Setting> GetSettingAsync(string entityName, int settingId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="setting"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Setting> AddSettingAsync(Setting setting);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="setting"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Setting> UpdateSettingAsync(Setting setting);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settingId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteSettingAsync(string entityName, int settingId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the value of the given settingName (key) from the given key-value dictionary
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settings"></param>
|
||||||
|
/// <param name="settingName"></param>
|
||||||
|
/// <param name="defaultValue"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
string GetSetting(Dictionary<string, string> settings, string settingName, string defaultValue);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the value of the given settingName (key) in the given key-value dictionary
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settings"></param>
|
||||||
|
/// <param name="settingName"></param>
|
||||||
|
/// <param name="defaultValue"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue);
|
||||||
|
|
||||||
|
Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue, bool isPrivate);
|
||||||
|
|
||||||
|
Dictionary<string, string> MergeSettings(Dictionary<string, string> baseSettings, Dictionary<string, string> overwriteSettings);
|
||||||
|
|
||||||
|
|
||||||
|
[Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)]
|
||||||
|
Task<Setting> GetSettingAsync(int settingId);
|
||||||
|
|
||||||
|
[Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)]
|
||||||
|
Task DeleteSettingAsync(int settingId);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SettingService : ServiceBase, ISettingService
|
public class SettingService : ServiceBase, ISettingService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,59 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to store and retrieve <see cref="Site"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface ISiteService
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of sites
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Site>> GetSitesAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Site> GetSiteAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="site"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Site> AddSiteAsync(Site site);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates an existing site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="site"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Site> UpdateSiteAsync(Site site);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteSiteAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of modules
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <param name="pageId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Module>> GetModulesAsync(int siteId, int pageId);
|
||||||
|
|
||||||
|
[PrivateApi]
|
||||||
|
[Obsolete("This method is deprecated.", false)]
|
||||||
|
void SetAlias(Alias alias);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SiteService : ServiceBase, ISiteService
|
public class SiteService : ServiceBase, ISiteService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve <see cref="SiteTemplate"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface ISiteTemplateService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of site templates
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<SiteTemplate>> GetSiteTemplatesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SiteTemplateService : ServiceBase, ISiteTemplateService
|
public class SiteTemplateService : ServiceBase, ISiteTemplateService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,6 +6,19 @@ using Oqtane.Documentation;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to execute a <see cref="SqlQuery"/> against the backend database
|
||||||
|
/// </summary>
|
||||||
|
public interface ISqlService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Executes a sql query and returns its result
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sqlquery"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<SqlQuery> ExecuteQueryAsync(SqlQuery sqlquery);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SqlService : ServiceBase, ISqlService
|
public class SqlService : ServiceBase, ISqlService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,19 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve <see cref="Sync"/> information.
|
||||||
|
/// </summary>
|
||||||
|
public interface ISyncService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get sync events
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="lastSyncDate"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Sync> GetSyncEventsAsync(DateTime lastSyncDate);
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc cref="ISyncService" />
|
/// <inheritdoc cref="ISyncService" />
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SyncService : ServiceBase, ISyncService
|
public class SyncService : ServiceBase, ISyncService
|
||||||
|
|||||||
@@ -3,10 +3,46 @@ using System.Threading.Tasks;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using System.Net;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve and update system information.
|
||||||
|
/// </summary>
|
||||||
|
public interface ISystemService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// returns a key-value dictionary with the current system configuration information
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, object>> GetSystemInfoAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// returns a key-value dictionary with the current system information - "environment" or "configuration"
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, object>> GetSystemInfoAsync(string type);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// returns a config value
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<object> GetSystemInfoAsync(string settingKey, object defaultValue);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates system information
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settings"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateSystemInfoAsync(Dictionary<string, object> settings);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// returns a key-value dictionary with default system icons
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> GetIconsAsync();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class SystemService : ServiceBase, ISystemService
|
public class SystemService : ServiceBase, ISystemService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,6 +8,25 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Tenant"/>s on the Oqtane installation.
|
||||||
|
/// </summary>
|
||||||
|
public interface ITenantService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="Tenant"/>s
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Tenant>> GetTenantsAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one specific <see cref="Tenant"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tenantId">ID-reference of the <see cref="Tenant"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Tenant> GetTenantAsync(int tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class TenantService : ServiceBase, ITenantService
|
public class TenantService : ServiceBase, ITenantService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,10 +5,97 @@ using System.Threading.Tasks;
|
|||||||
using Oqtane.Documentation;
|
using Oqtane.Documentation;
|
||||||
using Oqtane.Models;
|
using Oqtane.Models;
|
||||||
using Oqtane.Shared;
|
using Oqtane.Shared;
|
||||||
using Oqtane.UI;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Theme"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface IThemeService
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of available themes
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Theme>> GetThemesAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a specific theme
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themeId"></param>
|
||||||
|
/// <param name="siteId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Theme> GetThemeAsync(int themeId, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a theme <see cref="ThemeControl"/>s containing a specific theme control type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themes"></param>
|
||||||
|
/// <param name="themeControlType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Theme GetTheme(List<Theme> themes, string themeControlType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of <see cref="ThemeControl"/>s from the given themes
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themes"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ThemeControl> GetThemeControls(List<Theme> themes);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of <see cref="ThemeControl"/>s for a theme containing a specific theme control type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themes"></param>
|
||||||
|
/// <param name="themeControlType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ThemeControl> GetThemeControls(List<Theme> themes, string themeControlType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of containers (<see cref="ThemeControl"/>) for a theme containing a specific theme control type
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themes"></param>
|
||||||
|
/// <param name="themeControlType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ThemeControl> GetContainerControls(List<Theme> themes, string themeControlType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates a existing theme
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="theme"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task UpdateThemeAsync(Theme theme);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Deletes a theme
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themeName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteThemeAsync(string themeName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new theme
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="theme"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Theme> CreateThemeAsync(Theme theme);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of theme templates (<see cref="Template"/>)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Template>> GetThemeTemplatesAsync();
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns a list of layouts (<see cref="ThemeControl"/>) from the given themes with a matching theme name
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="themes"></param>
|
||||||
|
/// <param name="themeName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<ThemeControl> GetLayoutControls(List<Theme> themes, string themeName);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class ThemeService : ServiceBase, IThemeService
|
public class ThemeService : ServiceBase, IThemeService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,18 @@ using NodaTime.Extensions;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to retrieve <see cref="TimeZone"/> entries
|
||||||
|
/// </summary>
|
||||||
|
public interface ITimeZoneService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get the list of time zones
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
List<Models.TimeZone> GetTimeZones();
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class TimeZoneService : ITimeZoneService
|
public class TimeZoneService : ITimeZoneService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,6 +9,56 @@ using System.Net;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="UrlMapping"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IUrlMappingService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="UrlMapping"/>s of this <see cref="Site"/>.
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UrlMapping>> GetUrlMappingsAsync(int siteId, bool isMapped);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one specific <see cref="UrlMapping"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UrlMapping> GetUrlMappingAsync(int urlMappingId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one specific <see cref="UrlMapping"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
||||||
|
/// <param name="url">A url</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UrlMapping> GetUrlMappingAsync(int siteId, string url);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Add / save a new <see cref="UrlMapping"/> to the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="urlMapping"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UrlMapping> AddUrlMappingAsync(UrlMapping urlMapping);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update a <see cref="UrlMapping"/> in the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="urlMapping"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UrlMapping> UpdateUrlMappingAsync(UrlMapping urlMapping);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a <see cref="UrlMapping"/> in the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="urlMappingId">ID-reference of a <see cref="UrlMapping"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteUrlMappingAsync(int urlMappingId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class UrlMappingService : ServiceBase, IUrlMappingService
|
public class UrlMappingService : ServiceBase, IUrlMappingService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,72 @@ using Oqtane.Shared;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Manage <see cref="Role"/>s assigned to a specific <see cref="User"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IUserRoleService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UserRole>> GetUserRolesAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
||||||
|
/// <param name="userId">ID-reference to a <see cref="User"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
||||||
|
/// <param name="roleName">Name reference a <see cref="Role"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UserRole>> GetUserRolesAsync(int siteId, string roleName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="UserRole"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference to a <see cref="Site"/></param>
|
||||||
|
/// <param name="userId">ID-reference to a <see cref="User"/></param>
|
||||||
|
/// <param name="roleName">Name reference a <see cref="Role"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<UserRole>> GetUserRolesAsync(int siteId, int userId, string roleName);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get one specific <see cref="UserRole"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userRoleId">ID-reference to a <see cref="UserRole"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UserRole> GetUserRoleAsync(int userRoleId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save a new <see cref="UserRole"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userRole"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UserRole> AddUserRoleAsync(UserRole userRole);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update a <see cref="UserRole"/> in the database
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userRole"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UserRole> UpdateUserRoleAsync(UserRole userRole);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete a <see cref="UserRole"/> in the database
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userRoleId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteUserRoleAsync(int userRoleId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class UserRoleService : ServiceBase, IUserRoleService
|
public class UserRoleService : ServiceBase, IUserRoleService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,12 +6,174 @@ using Oqtane.Documentation;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
|
||||||
using Oqtane.Modules.Admin.Roles;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Manage (get / update) user information
|
||||||
|
/// </summary>
|
||||||
|
public interface IUserService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="User"/> of a specific site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">ID of a <see cref="User"/></param>
|
||||||
|
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> GetUserAsync(int userId, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="User"/> of a specific site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username">Username / login of a <see cref="User"/></param>
|
||||||
|
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> GetUserAsync(string username, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a <see cref="User"/> of a specific site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username">Username / login of a <see cref="User"/></param>
|
||||||
|
/// <param name="email">email address of a <see cref="User"/></param>
|
||||||
|
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> GetUserAsync(string username, string email, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Save a user to the Database.
|
||||||
|
/// The <see cref="User"/> object contains all the information incl. what <see cref="Site"/> it belongs to.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> AddUserAsync(User user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update an existing user in the database.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> UpdateUserAsync(User user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Delete / remove a user in the database
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userId">ID-reference to the <see cref="User"/></param>
|
||||||
|
/// <param name="siteId">ID-reference to the <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeleteUserAsync(int userId, int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Will login the specified <see cref="User"/>.
|
||||||
|
///
|
||||||
|
/// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">A <see cref="User"/> object which should have at least the <see cref="User.Username"/> and <see cref="User.Password"/> set.</param>
|
||||||
|
/// <param name="setCookie">Determines if the login cookie should be set (only relevant for Hybrid scenarios)</param>
|
||||||
|
/// <param name="isPersistent">Determines if the login cookie should be persisted for a long time.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> LoginUserAsync(User user, bool setCookie, bool isPersistent);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logout a <see cref="User"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task LogoutUserAsync(User user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Logout a <see cref="User"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task LogoutUserEverywhereAsync(User user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Update e-mail verification status of a user.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">The <see cref="User"/> we're verifying</param>
|
||||||
|
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> VerifyEmailAsync(User user, string token);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Trigger a forgot-password e-mail for this <see cref="User"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task ForgotPasswordAsync(User user);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Reset the password of this <see cref="User"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> ResetPasswordAsync(User user, string token);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Verify the two factor verification code <see cref="User"/>
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user"></param>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> VerifyTwoFactorAsync(User user, string token);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Validate identity user info.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="username"></param>
|
||||||
|
/// <param name="email"></param>
|
||||||
|
/// <param name="password"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<UserValidateResult> ValidateUserAsync(string username, string email, string password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Validate a users password against the password policy
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="password"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<bool> ValidatePasswordAsync(string password);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get token for current user
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetTokenAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get personal access token for current user (administrators only)
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetPersonalAccessTokenAsync();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Link an external login with a local user account
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="user">The <see cref="User"/> we're verifying</param>
|
||||||
|
/// <param name="token">A Hash value in the URL which verifies this user got the e-mail (containing this token)</param>
|
||||||
|
/// <param name="type">External Login provider type</param>
|
||||||
|
/// <param name="key">External Login provider key</param>
|
||||||
|
/// <param name="name">External Login provider display name</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<User> LinkUserAsync(User user, string token, string type, string key, string name);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get password requirements for site
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> GetPasswordRequirementsAsync(int siteId);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Bulk import of users
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID of a <see cref="Site"/></param>
|
||||||
|
/// <param name="fileId">ID of a <see cref="File"/></param>
|
||||||
|
/// <param name="notify">Indicates if new users should be notified by email</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Dictionary<string, string>> ImportUsersAsync(int siteId, int fileId, bool notify);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class UserService : ServiceBase, IUserService
|
public class UserService : ServiceBase, IUserService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,28 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace Oqtane.Services
|
namespace Oqtane.Services
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="Visitor"/>s on a <see cref="Site"/>
|
||||||
|
/// </summary>
|
||||||
|
public interface IVisitorService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="Visitor"/>s of this <see cref="Site"/>.
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="siteId">ID-reference of a <see cref="Site"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<Visitor>> GetVisitorsAsync(int siteId, DateTime fromDate);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get a specific <see cref="Visitor"/> of this <see cref="Site"/>.
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="visitorId">ID-reference of a <see cref="Visitor"/></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<Visitor> GetVisitorAsync(int visitorId);
|
||||||
|
}
|
||||||
|
|
||||||
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
public class VisitorService : ServiceBase, IVisitorService
|
public class VisitorService : ServiceBase, IVisitorService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ namespace Oqtane.Database.MySQL
|
|||||||
return $"`{name}`";
|
return $"`{name}`";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string RewriteValue(object value)
|
||||||
|
{
|
||||||
|
if (value.GetType().Name == "Boolean")
|
||||||
|
{
|
||||||
|
return (bool)value ? "1" : "0"; // MySQL uses 1/0 for boolean values
|
||||||
|
}
|
||||||
|
return value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public override DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
|
public override DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
|
||||||
{
|
{
|
||||||
return optionsBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
|
return optionsBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString));
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
|
<PackageReference Include="EFCore.NamingConventions" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.8" />
|
||||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.4" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -92,13 +92,13 @@ namespace Oqtane.Database.PostgreSQL
|
|||||||
return $"\"{name}\"";
|
return $"\"{name}\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string RewriteValue(string value, string type)
|
public override string RewriteValue(object value)
|
||||||
{
|
{
|
||||||
if (type == "bool")
|
if (value.GetType().Name == "Boolean")
|
||||||
{
|
{
|
||||||
value = (value == "1") ? "true" : "false";
|
return (bool)value ? "true" : "false"; // PostgreSQL uses true/false for boolean values
|
||||||
}
|
}
|
||||||
return value;
|
return value.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateIdentityStoreTableNames(ModelBuilder builder)
|
public override void UpdateIdentityStoreTableNames(ModelBuilder builder)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -51,6 +51,15 @@ namespace Oqtane.Database.SqlServer
|
|||||||
return $"[{name}]";
|
return $"[{name}]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string RewriteValue(object value)
|
||||||
|
{
|
||||||
|
if (value.GetType().Name == "Boolean")
|
||||||
|
{
|
||||||
|
return (bool)value ? "1" : "0"; // SQL Server uses 1/0 for boolean values
|
||||||
|
}
|
||||||
|
return value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public override int ExecuteNonQuery(string connectionString, string query)
|
public override int ExecuteNonQuery(string connectionString, string query)
|
||||||
{
|
{
|
||||||
var conn = new SqlConnection(FormatConnectionString(connectionString));
|
var conn = new SqlConnection(FormatConnectionString(connectionString));
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.7" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.8" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -89,6 +89,15 @@ namespace Oqtane.Database.Sqlite
|
|||||||
return $"\"{name}\"";
|
return $"\"{name}\"";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string RewriteValue(object value)
|
||||||
|
{
|
||||||
|
if (value.GetType().Name == "Boolean")
|
||||||
|
{
|
||||||
|
return (bool)value ? "1" : "0"; // SQLite uses 1/0 for boolean values
|
||||||
|
}
|
||||||
|
return value.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
public override DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
|
public override DbContextOptionsBuilder UseDatabase(DbContextOptionsBuilder optionsBuilder, string connectionString)
|
||||||
{
|
{
|
||||||
return optionsBuilder.UseSqlite(connectionString)
|
return optionsBuilder.UseSqlite(connectionString)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<!-- <TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks> -->
|
<!-- <TargetFrameworks>net9.0-android;net9.0-ios;net9.0-maccatalyst</TargetFrameworks> -->
|
||||||
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
|
<!-- <TargetFrameworks>$(TargetFrameworks);net9.0-tizen</TargetFrameworks> -->
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Version>6.1.4</Version>
|
<Version>6.1.5</Version>
|
||||||
<Product>Oqtane</Product>
|
<Product>Oqtane</Product>
|
||||||
<Authors>Shaun Walker</Authors>
|
<Authors>Shaun Walker</Authors>
|
||||||
<Company>.NET Foundation</Company>
|
<Company>.NET Foundation</Company>
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<Copyright>.NET Foundation</Copyright>
|
<Copyright>.NET Foundation</Copyright>
|
||||||
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
<PackageProjectUrl>https://www.oqtane.org</PackageProjectUrl>
|
||||||
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
<PackageLicenseUrl>https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE</PackageLicenseUrl>
|
||||||
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</PackageReleaseNotes>
|
<PackageReleaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</PackageReleaseNotes>
|
||||||
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
<RepositoryUrl>https://github.com/oqtane/oqtane.framework</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<RootNamespace>Oqtane.Maui</RootNamespace>
|
<RootNamespace>Oqtane.Maui</RootNamespace>
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<ApplicationId>com.oqtane.maui</ApplicationId>
|
<ApplicationId>com.oqtane.maui</ApplicationId>
|
||||||
|
|
||||||
<!-- Versions -->
|
<!-- Versions -->
|
||||||
<ApplicationDisplayVersion>6.1.4</ApplicationDisplayVersion>
|
<ApplicationDisplayVersion>6.1.5</ApplicationDisplayVersion>
|
||||||
<ApplicationVersion>1</ApplicationVersion>
|
<ApplicationVersion>1</ApplicationVersion>
|
||||||
|
|
||||||
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||||
@@ -67,11 +67,11 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.7" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.7" />
|
<PackageReference Include="Microsoft.Extensions.Localization" Version="9.0.8" />
|
||||||
<PackageReference Include="System.Net.Http.Json" Version="9.0.7" />
|
<PackageReference Include="System.Net.Http.Json" Version="9.0.8" />
|
||||||
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.90" />
|
<PackageReference Include="Microsoft.Maui.Controls" Version="9.0.90" />
|
||||||
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.90" />
|
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="9.0.90" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.90" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="9.0.90" />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package>
|
<package>
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Client</id>
|
<id>Oqtane.Client</id>
|
||||||
<version>6.1.4</version>
|
<version>6.1.5</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</releaseNotes>
|
||||||
<readme>readme.md</readme>
|
<readme>readme.md</readme>
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package>
|
<package>
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Framework</id>
|
<id>Oqtane.Framework</id>
|
||||||
<version>6.1.4</version>
|
<version>6.1.5</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@@ -11,8 +11,8 @@
|
|||||||
<copyright>.NET Foundation</copyright>
|
<copyright>.NET Foundation</copyright>
|
||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>https://github.com/oqtane/oqtane.framework/releases/download/v6.1.4/Oqtane.Framework.6.1.4.Upgrade.zip</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework/releases/download/v6.1.5/Oqtane.Framework.6.1.5.Upgrade.zip</projectUrl>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</releaseNotes>
|
||||||
<readme>readme.md</readme>
|
<readme>readme.md</readme>
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<tags>oqtane framework</tags>
|
<tags>oqtane framework</tags>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package>
|
<package>
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Server</id>
|
<id>Oqtane.Server</id>
|
||||||
<version>6.1.4</version>
|
<version>6.1.5</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</releaseNotes>
|
||||||
<readme>readme.md</readme>
|
<readme>readme.md</readme>
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package>
|
<package>
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Shared</id>
|
<id>Oqtane.Shared</id>
|
||||||
<version>6.1.4</version>
|
<version>6.1.5</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</releaseNotes>
|
||||||
<readme>readme.md</readme>
|
<readme>readme.md</readme>
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package>
|
<package>
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Oqtane.Updater</id>
|
<id>Oqtane.Updater</id>
|
||||||
<version>6.1.4</version>
|
<version>6.1.5</version>
|
||||||
<authors>Shaun Walker</authors>
|
<authors>Shaun Walker</authors>
|
||||||
<owners>.NET Foundation</owners>
|
<owners>.NET Foundation</owners>
|
||||||
<title>Oqtane Framework</title>
|
<title>Oqtane Framework</title>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
<license type="expression">MIT</license>
|
<license type="expression">MIT</license>
|
||||||
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
<projectUrl>https://github.com/oqtane/oqtane.framework</projectUrl>
|
||||||
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4</releaseNotes>
|
<releaseNotes>https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5</releaseNotes>
|
||||||
<readme>readme.md</readme>
|
<readme>readme.md</readme>
|
||||||
<icon>icon.png</icon>
|
<icon>icon.png</icon>
|
||||||
<tags>oqtane</tags>
|
<tags>oqtane</tags>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Compress-Archive -Path "..\Oqtane.Server\bin\Release\net9.0\publish\*" -DestinationPath "Oqtane.Framework.6.1.4.Install.zip" -Force
|
Compress-Archive -Path "..\Oqtane.Server\bin\Release\net9.0\publish\*" -DestinationPath "Oqtane.Framework.6.1.5.Install.zip" -Force
|
||||||
|
|||||||
@@ -6,13 +6,19 @@ nuget.exe pack Oqtane.Client.nuspec
|
|||||||
nuget.exe pack Oqtane.Server.nuspec
|
nuget.exe pack Oqtane.Server.nuspec
|
||||||
nuget.exe pack Oqtane.Shared.nuspec
|
nuget.exe pack Oqtane.Shared.nuspec
|
||||||
nuget.exe pack Oqtane.Framework.nuspec
|
nuget.exe pack Oqtane.Framework.nuspec
|
||||||
del /F/Q/S "..\Oqtane.Server\bin\Release\net9.0\publish" > NUL
|
|
||||||
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish"
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish"
|
||||||
dotnet publish ..\Oqtane.Server\Oqtane.Server.csproj /p:Configuration=Release
|
dotnet publish ..\Oqtane.Server\Oqtane.Server.csproj /p:Configuration=Release
|
||||||
del /F/Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\Content" > NUL
|
|
||||||
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\Content"
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\Content"
|
||||||
del /F/Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\Content" > NUL
|
|
||||||
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\Content"
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\Content"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\android-arm"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\android-arm64"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\android-x64"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\android-x86"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\ios-arm"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\ios-arm64"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\iossimulator-arm64"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\iossimulator-x64"
|
||||||
|
rmdir /Q/S "..\Oqtane.Server\bin\Release\net9.0\publish\runtimes\iossimulator-x86"
|
||||||
setlocal ENABLEDELAYEDEXPANSION
|
setlocal ENABLEDELAYEDEXPANSION
|
||||||
set retain=Placeholder.txt
|
set retain=Placeholder.txt
|
||||||
for /D %%i in ("..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\_content\*") do (
|
for /D %%i in ("..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\_content\*") do (
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Compress-Archive -Path "..\Oqtane.Server\bin\Release\net9.0\publish\*" -DestinationPath "Oqtane.Framework.6.1.4.Upgrade.zip" -Force
|
Compress-Archive -Path "..\Oqtane.Server\bin\Release\net9.0\publish\*" -DestinationPath "Oqtane.Framework.6.1.5.Upgrade.zip" -Force
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ namespace Oqtane.Controllers
|
|||||||
// suppress unauthorized visitor logging as it is usually caused by clients that do not support cookies or private browsing sessions
|
// suppress unauthorized visitor logging as it is usually caused by clients that do not support cookies or private browsing sessions
|
||||||
if (entityName != EntityNames.Visitor)
|
if (entityName != EntityNames.Visitor)
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, this, LogFunction.Read, "User Not Authorized To Access Settings {EntityName} {EntityId}", entityName, entityId);
|
_logger.Log(LogLevel.Error, this, LogFunction.Read, "User Not Authorized To Access Settings For EntityName {EntityName} And EntityId {EntityId}", entityName, entityId);
|
||||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ namespace Oqtane.Controllers
|
|||||||
public Setting Get(int id, string entityName)
|
public Setting Get(int id, string entityName)
|
||||||
{
|
{
|
||||||
Setting setting = _settings.GetSetting(entityName, id);
|
Setting setting = _settings.GetSetting(entityName, id);
|
||||||
if (IsAuthorized(setting.EntityName, setting.EntityId, PermissionNames.View))
|
if (setting != null && IsAuthorized(setting.EntityName, setting.EntityId, PermissionNames.View))
|
||||||
{
|
{
|
||||||
if (FilterPrivate(entityName, id) && setting.IsPrivate)
|
if (FilterPrivate(entityName, id) && setting.IsPrivate)
|
||||||
{
|
{
|
||||||
@@ -113,7 +113,7 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
if (setting != null && entityName != EntityNames.Visitor)
|
if (setting != null && entityName != EntityNames.Visitor)
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, this, LogFunction.Read, "User Not Authorized To Access Setting {EntityName} {SettingId}", entityName, id);
|
_logger.Log(LogLevel.Error, this, LogFunction.Read, "User Not Authorized To Access SettingId {SettingId} For EntityName {EntityName} ", id, entityName);
|
||||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -201,12 +201,12 @@ namespace Oqtane.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, this, LogFunction.Update, "User Not Authorized To Add Or Update Setting {EntityName} {EntityId} {SettingName}", entityName, entityId, settingName);
|
_logger.Log(LogLevel.Error, this, LogFunction.Update, "User Not Authorized To Add Or Update Setting For EntityName {EntityName} EntityId {EntityId} SettingName {SettingName}", entityName, entityId, settingName);
|
||||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DELETE api/<controller>/site/1/settingname
|
// DELETE api/<controller>/site/1/settingname/settingid
|
||||||
[HttpDelete("{entityName}/{entityId}/{settingName}")]
|
[HttpDelete("{entityName}/{entityId}/{settingName}")]
|
||||||
public void Delete(string entityName, int entityId, string settingName)
|
public void Delete(string entityName, int entityId, string settingName)
|
||||||
{
|
{
|
||||||
@@ -221,7 +221,28 @@ namespace Oqtane.Controllers
|
|||||||
{
|
{
|
||||||
if (entityName != EntityNames.Visitor)
|
if (entityName != EntityNames.Visitor)
|
||||||
{
|
{
|
||||||
_logger.Log(LogLevel.Error, this, LogFunction.Delete, "Setting Does Not Exist Or User Not Authorized To Delete Setting For Entity {EntityName} Id {EntityId} Name {SettingName}", entityName, entityId, settingName);
|
_logger.Log(LogLevel.Error, this, LogFunction.Delete, "Setting Does Not Exist Or User Not Authorized To Delete Setting For EntityName {EntityName} EntityId {EntityId} SettingName {SettingName}", entityName, entityId, settingName);
|
||||||
|
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DELETE api/<controller>/1/site
|
||||||
|
[HttpDelete("{id}/{entityName}")]
|
||||||
|
public void Delete(int id, string entityName)
|
||||||
|
{
|
||||||
|
Setting setting = _settings.GetSetting(entityName, id);
|
||||||
|
if (setting != null && IsAuthorized(setting.EntityName, setting.EntityId, PermissionNames.Edit))
|
||||||
|
{
|
||||||
|
_settings.DeleteSetting(setting.EntityName, setting.SettingId);
|
||||||
|
AddSyncEvent(setting.EntityName, setting.EntityId, setting.SettingId, SyncEventActions.Delete);
|
||||||
|
_logger.Log(LogLevel.Information, this, LogFunction.Delete, "Setting Deleted {Setting}", setting);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (entityName != EntityNames.Visitor)
|
||||||
|
{
|
||||||
|
_logger.Log(LogLevel.Error, this, LogFunction.Delete, "Setting Does Not Exist Or User Not Authorized To Delete Setting For SettingId {SettingId} For EntityName {EntityName} ", id, entityName);
|
||||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ namespace Oqtane.Databases
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string RewriteValue(string value, string type)
|
public virtual string RewriteValue(object value)
|
||||||
{
|
{
|
||||||
return value;
|
return value.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UpdateIdentityStoreTableNames(ModelBuilder builder)
|
public virtual void UpdateIdentityStoreTableNames(ModelBuilder builder)
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Oqtane.Databases.Interfaces
|
|||||||
|
|
||||||
public string RewriteName(string name);
|
public string RewriteName(string name);
|
||||||
|
|
||||||
public string RewriteValue(string value, string type);
|
public string RewriteValue(object value);
|
||||||
|
|
||||||
public void UpdateIdentityStoreTableNames(ModelBuilder builder);
|
public void UpdateIdentityStoreTableNames(ModelBuilder builder);
|
||||||
|
|
||||||
|
|||||||
@@ -579,6 +579,34 @@ namespace Oqtane.Infrastructure.SiteTemplates
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
pageTemplates.Add(new PageTemplate
|
||||||
|
{
|
||||||
|
Name = "Language Management",
|
||||||
|
Parent = "Admin",
|
||||||
|
Order = 21,
|
||||||
|
Path = "admin/languages",
|
||||||
|
Icon = Icons.Text,
|
||||||
|
IsNavigation = false,
|
||||||
|
IsPersonalizable = false,
|
||||||
|
PermissionList = new List<Permission>
|
||||||
|
{
|
||||||
|
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
||||||
|
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
||||||
|
},
|
||||||
|
PageTemplateModules = new List<PageTemplateModule>
|
||||||
|
{
|
||||||
|
new PageTemplateModule
|
||||||
|
{
|
||||||
|
ModuleDefinitionName = typeof(Oqtane.Modules.Admin.Languages.Index).ToModuleDefinitionName(), Title = "Language Management", Pane = PaneNames.Default,
|
||||||
|
PermissionList = new List<Permission>
|
||||||
|
{
|
||||||
|
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
||||||
|
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
||||||
|
},
|
||||||
|
Content = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// host pages (order starts at 51)
|
// host pages (order starts at 51)
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
@@ -694,42 +722,10 @@ namespace Oqtane.Infrastructure.SiteTemplates
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
pageTemplates.Add(new PageTemplate
|
pageTemplates.Add(new PageTemplate
|
||||||
{
|
|
||||||
Name = "Language Management",
|
|
||||||
Parent = "Admin",
|
|
||||||
Order = 59,
|
|
||||||
Path = "admin/languages",
|
|
||||||
Icon = Icons.Text,
|
|
||||||
IsNavigation = false,
|
|
||||||
IsPersonalizable = false,
|
|
||||||
PermissionList = new List<Permission>
|
|
||||||
{
|
|
||||||
new Permission(PermissionNames.View, RoleNames.Host, true),
|
|
||||||
new Permission(PermissionNames.Edit, RoleNames.Host, true),
|
|
||||||
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
|
||||||
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
|
||||||
},
|
|
||||||
PageTemplateModules = new List<PageTemplateModule>
|
|
||||||
{
|
|
||||||
new PageTemplateModule
|
|
||||||
{
|
|
||||||
ModuleDefinitionName = typeof(Oqtane.Modules.Admin.Languages.Index).ToModuleDefinitionName(), Title = "Language Management", Pane = PaneNames.Default,
|
|
||||||
PermissionList = new List<Permission>
|
|
||||||
{
|
|
||||||
new Permission(PermissionNames.View, RoleNames.Host, true),
|
|
||||||
new Permission(PermissionNames.Edit, RoleNames.Host, true),
|
|
||||||
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
|
||||||
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
|
||||||
},
|
|
||||||
Content = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
pageTemplates.Add(new PageTemplate
|
|
||||||
{
|
{
|
||||||
Name = "Scheduled Jobs",
|
Name = "Scheduled Jobs",
|
||||||
Parent = "Admin",
|
Parent = "Admin",
|
||||||
Order = 61,
|
Order = 59,
|
||||||
Path = "admin/jobs",
|
Path = "admin/jobs",
|
||||||
Icon = Icons.Timer,
|
Icon = Icons.Timer,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
@@ -757,7 +753,7 @@ namespace Oqtane.Infrastructure.SiteTemplates
|
|||||||
{
|
{
|
||||||
Name = "Sql Management",
|
Name = "Sql Management",
|
||||||
Parent = "Admin",
|
Parent = "Admin",
|
||||||
Order = 63,
|
Order = 61,
|
||||||
Path = "admin/sql",
|
Path = "admin/sql",
|
||||||
Icon = Icons.Spreadsheet,
|
Icon = Icons.Spreadsheet,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
@@ -785,7 +781,7 @@ namespace Oqtane.Infrastructure.SiteTemplates
|
|||||||
{
|
{
|
||||||
Name = "System Info",
|
Name = "System Info",
|
||||||
Parent = "Admin",
|
Parent = "Admin",
|
||||||
Order = 65,
|
Order = 63,
|
||||||
Path = "admin/system",
|
Path = "admin/system",
|
||||||
Icon = Icons.MedicalCross,
|
Icon = Icons.MedicalCross,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
@@ -813,7 +809,7 @@ namespace Oqtane.Infrastructure.SiteTemplates
|
|||||||
{
|
{
|
||||||
Name = "System Update",
|
Name = "System Update",
|
||||||
Parent = "Admin",
|
Parent = "Admin",
|
||||||
Order = 67,
|
Order = 65,
|
||||||
Path = "admin/update",
|
Path = "admin/update",
|
||||||
Icon = Icons.Aperture,
|
Icon = Icons.Aperture,
|
||||||
IsNavigation = false,
|
IsNavigation = false,
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ namespace Oqtane.Migrations.EntityBuilders
|
|||||||
return ActiveDatabase.RewriteName(name);
|
return ActiveDatabase.RewriteName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string RewriteValue(string value, string type)
|
private string RewriteValue(object value)
|
||||||
{
|
{
|
||||||
return ActiveDatabase.RewriteValue(value, type);
|
return ActiveDatabase.RewriteValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Column Operations
|
// Column Operations
|
||||||
@@ -466,36 +466,100 @@ namespace Oqtane.Migrations.EntityBuilders
|
|||||||
|
|
||||||
//Sql Operations
|
//Sql Operations
|
||||||
|
|
||||||
public void DeleteFromTable(string condition = "")
|
public void InsertData(string[] columns, object[] values, string condition)
|
||||||
{
|
{
|
||||||
var deleteSql = $"DELETE FROM {AddSchema(DelimitName(RewriteName(EntityTableName)))} ";
|
var sql = $"INSERT INTO {AddSchema(DelimitName(RewriteName(EntityTableName)))} ";
|
||||||
if(!string.IsNullOrEmpty(condition))
|
if (columns != null && columns.Length > 0)
|
||||||
|
{
|
||||||
|
sql += "(";
|
||||||
|
for (var i = 0; i < columns.Length; i++)
|
||||||
|
{
|
||||||
|
sql += ((i == 0) ? "" : ", ") + $"{DelimitName(RewriteName(columns[i]))}";
|
||||||
|
}
|
||||||
|
sql += ") ";
|
||||||
|
}
|
||||||
|
if (values != null && values.Length > 0)
|
||||||
|
{
|
||||||
|
sql += "VALUES (";
|
||||||
|
for (var i = 0; i < values.Length; i++)
|
||||||
|
{
|
||||||
|
sql += ((i == 0) ? "" : ", ") + $"{RewriteValue(values[i])}";
|
||||||
|
}
|
||||||
|
sql += ") ";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(condition))
|
||||||
{
|
{
|
||||||
// note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms
|
// note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms
|
||||||
deleteSql += $"WHERE {condition}";
|
sql += $"{condition}";
|
||||||
}
|
}
|
||||||
_migrationBuilder.Sql(deleteSql);
|
_migrationBuilder.Sql(sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateData(string column, object value)
|
||||||
|
{
|
||||||
|
UpdateData([column], [value], "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateData(string column, object value, string condition)
|
||||||
|
{
|
||||||
|
UpdateData([column], [value], condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateData(string[] columns, object[] values, string condition)
|
||||||
|
{
|
||||||
|
var sql = $"UPDATE {AddSchema(DelimitName(RewriteName(EntityTableName)))} ";
|
||||||
|
if (columns != null && values != null && columns.Length > 0 && values.Length > 0 && columns.Length == values.Length)
|
||||||
|
{
|
||||||
|
sql += "SET ";
|
||||||
|
for (var i = 0; i < columns.Length; i++)
|
||||||
|
{
|
||||||
|
sql += ((i == 0) ? "" : ", ") + $"{DelimitName(RewriteName(columns[i]))} = {RewriteValue(values[i])}";
|
||||||
|
}
|
||||||
|
sql += " ";
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrEmpty(condition))
|
||||||
|
{
|
||||||
|
// note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms
|
||||||
|
sql += $"WHERE {condition}";
|
||||||
|
}
|
||||||
|
_migrationBuilder.Sql(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void DeleteData(string condition)
|
||||||
|
{
|
||||||
|
var sql = $"DELETE FROM {AddSchema(DelimitName(RewriteName(EntityTableName)))} ";
|
||||||
|
if (!string.IsNullOrEmpty(condition))
|
||||||
|
{
|
||||||
|
// note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms
|
||||||
|
sql += $"WHERE {condition}";
|
||||||
|
}
|
||||||
|
_migrationBuilder.Sql(sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Obsolete("DeleteFromTable(condition) is deprecated. Use DeleteData(condition) instead", false)]
|
||||||
|
public void DeleteFromTable(string condition = "")
|
||||||
|
{
|
||||||
|
DeleteData(condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Obsolete("UpdateColumn(columnName, value) is deprecated. Use UpdateData(column, value) instead", false)]
|
||||||
public void UpdateColumn(string columnName, string value)
|
public void UpdateColumn(string columnName, string value)
|
||||||
{
|
{
|
||||||
UpdateColumn(columnName, value, "", "");
|
UpdateColumn(columnName, value, "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("UpdateColumn(columnName, value, condition) is deprecated. Use UpdateData(column, value, condition) instead", false)]
|
||||||
public void UpdateColumn(string columnName, string value, string condition)
|
public void UpdateColumn(string columnName, string value, string condition)
|
||||||
{
|
{
|
||||||
UpdateColumn(columnName, value, "", condition);
|
UpdateColumn(columnName, value, "", condition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("UpdateColumn(columnName, value, type, condition) is deprecated. Use UpdateData(column, value, condition) instead", false)]
|
||||||
public void UpdateColumn(string columnName, string value, string type, string condition)
|
public void UpdateColumn(string columnName, string value, string type, string condition)
|
||||||
{
|
{
|
||||||
var updateSql = $"UPDATE {AddSchema(DelimitName(RewriteName(EntityTableName)))} SET {DelimitName(RewriteName(columnName))} = {RewriteValue(value, type)} ";
|
object obj = (type == "bool" && value == "1") ? true : false; // boolean values had custom logic for PostgreSQL
|
||||||
if (!string.IsNullOrEmpty(condition))
|
UpdateData([columnName], [obj], condition);
|
||||||
{
|
|
||||||
// note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms
|
|
||||||
updateSql += $"WHERE {condition}";
|
|
||||||
}
|
|
||||||
_migrationBuilder.Sql(updateSql);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ namespace Oqtane.Migrations
|
|||||||
return ActiveDatabase.RewriteName(name);
|
return ActiveDatabase.RewriteName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string RewriteValue(string value, string type)
|
protected string RewriteValue(object value)
|
||||||
{
|
{
|
||||||
return ActiveDatabase.RewriteValue(value, type);
|
return ActiveDatabase.RewriteValue(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Oqtane.Migrations.Master
|
|||||||
//Update new column if SqlServer (Other Databases will not have any records yet)
|
//Update new column if SqlServer (Other Databases will not have any records yet)
|
||||||
if (ActiveDatabase.Name == "SqlServer")
|
if (ActiveDatabase.Name == "SqlServer")
|
||||||
{
|
{
|
||||||
tenantEntityBuilder.UpdateColumn("DBType", $"'{ActiveDatabase.TypeName}'");
|
tenantEntityBuilder.UpdateData("DBType", $"'{ActiveDatabase.TypeName}'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Oqtane.Migrations.Master
|
|||||||
//Add Column to Alias table
|
//Add Column to Alias table
|
||||||
var aliasEntityBuilder = new AliasEntityBuilder(migrationBuilder, ActiveDatabase);
|
var aliasEntityBuilder = new AliasEntityBuilder(migrationBuilder, ActiveDatabase);
|
||||||
aliasEntityBuilder.AddBooleanColumn("IsDefault", true);
|
aliasEntityBuilder.AddBooleanColumn("IsDefault", true);
|
||||||
aliasEntityBuilder.UpdateColumn("IsDefault", "1", "bool", "");
|
aliasEntityBuilder.UpdateData("IsDefault", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user