From 39ae6a76cd6aad8efeb39692ad17edcf6b922574 Mon Sep 17 00:00:00 2001 From: Leigh Pointer Date: Thu, 7 Aug 2025 08:09:34 +0200 Subject: [PATCH 01/14] Updated Project Refs 9.0.8 # SQLitePCLRaw.bundle_e_sqlite3 was not updated. Oqtane Framework Project Templates Module and Theme MAUI solution --- Oqtane.Client/Oqtane.Client.csproj | 8 ++++---- .../Oqtane.Database.PostgreSQL.csproj | 2 +- .../Oqtane.Database.SqlServer.csproj | 2 +- .../Oqtane.Database.Sqlite.csproj | 2 +- Oqtane.Maui/Oqtane.Maui.csproj | 10 +++++----- Oqtane.Server/Oqtane.Server.csproj | 14 +++++++------- .../Client/[Owner].Module.[Module].Client.csproj | 10 +++++----- .../Server/[Owner].Module.[Module].Server.csproj | 8 ++++---- .../Client/[Owner].Theme.[Theme].Client.csproj | 6 +++--- Oqtane.Shared/Oqtane.Shared.csproj | 8 ++++---- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Oqtane.Client/Oqtane.Client.csproj b/Oqtane.Client/Oqtane.Client.csproj index 79410dec..267c96a4 100644 --- a/Oqtane.Client/Oqtane.Client.csproj +++ b/Oqtane.Client/Oqtane.Client.csproj @@ -22,10 +22,10 @@ - - - - + + + + diff --git a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj index b0a8c50d..601f62e2 100644 --- a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj +++ b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj @@ -34,7 +34,7 @@ - + diff --git a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj index 8a8bfd66..70bd3ac1 100644 --- a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj +++ b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj @@ -33,7 +33,7 @@ - + diff --git a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj index fb57225e..6ed046be 100644 --- a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj +++ b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj @@ -33,7 +33,7 @@ - + diff --git a/Oqtane.Maui/Oqtane.Maui.csproj b/Oqtane.Maui/Oqtane.Maui.csproj index 8e683de5..fdb4801c 100644 --- a/Oqtane.Maui/Oqtane.Maui.csproj +++ b/Oqtane.Maui/Oqtane.Maui.csproj @@ -67,11 +67,11 @@ - - - - - + + + + + diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index a05b1a9d..40d26e29 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -34,17 +34,17 @@ - - + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj index 8dff70b0..501cec31 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/[Owner].Module.[Module].Client.csproj @@ -13,11 +13,11 @@ - - - - - + + + + + diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj index 7d9645e0..28f27a31 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj b/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj index f3a6fe45..99587a54 100644 --- a/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj +++ b/Oqtane.Server/wwwroot/Themes/Templates/External/Client/[Owner].Theme.[Theme].Client.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/Oqtane.Shared/Oqtane.Shared.csproj b/Oqtane.Shared/Oqtane.Shared.csproj index 5ebf7557..8cc49663 100644 --- a/Oqtane.Shared/Oqtane.Shared.csproj +++ b/Oqtane.Shared/Oqtane.Shared.csproj @@ -19,12 +19,12 @@ - - - + + + - + From b11a7a678ce509b957b55a27061b73a4b8e4cd9e Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 7 Aug 2025 10:58:33 -0400 Subject: [PATCH 02/14] fix #5461 - handle MinDate and MaxDate --- Oqtane.Client/Modules/ModuleBase.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Oqtane.Client/Modules/ModuleBase.cs b/Oqtane.Client/Modules/ModuleBase.cs index 59721817..904a89da 100644 --- a/Oqtane.Client/Modules/ModuleBase.cs +++ b/Oqtane.Client/Modules/ModuleBase.cs @@ -504,8 +504,8 @@ namespace Oqtane.Modules public DateTime? UtcToLocal(DateTime? datetime) { // Early return if input is null - if (datetime == null) - return null; + if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue) + return datetime; string timezoneId = null; @@ -524,8 +524,8 @@ namespace Oqtane.Modules public DateTime? LocalToUtc(DateTime? datetime) { // Early return if input is null - if (datetime == null) - return null; + if (datetime == null || datetime.Value == DateTime.MinValue || datetime.Value == DateTime.MaxValue) + return datetime; string timezoneId = null; From 30c869ff2af0a772ff76f9e847834dedff91c1c6 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 7 Aug 2025 14:30:13 -0400 Subject: [PATCH 03/14] performance improvement to filter settings in database --- Oqtane.Server/Repository/SettingRepository.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Oqtane.Server/Repository/SettingRepository.cs b/Oqtane.Server/Repository/SettingRepository.cs index 0b25634a..16a33811 100644 --- a/Oqtane.Server/Repository/SettingRepository.cs +++ b/Oqtane.Server/Repository/SettingRepository.cs @@ -38,7 +38,15 @@ namespace Oqtane.Repository public IEnumerable GetSettings(string entityName, int entityId) { - return GetSettings(entityName).Where(item => item.EntityId == entityId); + if (IsMaster(entityName)) + { + return _master.Setting.Where(item => item.EntityName == entityName && item.EntityId == entityId).ToList(); + } + else + { + using var db = _tenantContextFactory.CreateDbContext(); + return db.Setting.Where(item => item.EntityName == entityName && item.EntityId == entityId).ToList(); + } } public IEnumerable GetSettings(string entityName1, int entityId1, string entityName2, int entityId2) From a37f07d20b56157dd6b084ec739ae14f3afd3abf Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 7 Aug 2025 14:31:57 -0400 Subject: [PATCH 04/14] fix malformed bold tag --- Oqtane.Client/Modules/Controls/AuditInfo.razor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/AuditInfo.razor b/Oqtane.Client/Modules/Controls/AuditInfo.razor index e2a025ec..c8e649fc 100644 --- a/Oqtane.Client/Modules/Controls/AuditInfo.razor +++ b/Oqtane.Client/Modules/Controls/AuditInfo.razor @@ -52,7 +52,7 @@ if (CreatedOn != null) { - _text += $" {Localizer["On"]} {UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}"; + _text += $" {Localizer["On"]} {UtcToLocal(CreatedOn).Value.ToString(DateTimeFormat)}"; } _text += "

"; @@ -69,7 +69,7 @@ if (ModifiedOn != null) { - _text += $" {Localizer["On"]} {UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}"; + _text += $" {Localizer["On"]} {UtcToLocal(ModifiedOn).Value.ToString(DateTimeFormat)}"; } _text += "

"; @@ -86,7 +86,7 @@ if (DeletedOn != null) { - _text += $" {Localizer["On"]} {UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}"; + _text += $" {Localizer["On"]} {UtcToLocal(DeletedOn).Value.ToString(DateTimeFormat)}"; } _text += "

"; From 3bd6767138c26325dd8b95b524f5859adf92d2df Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 7 Aug 2025 14:42:24 -0400 Subject: [PATCH 05/14] only hosts should be allowed to view/edit SMTP settings --- Oqtane.Client/Modules/Admin/Site/Index.razor | 66 +++++++++++--------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Site/Index.razor b/Oqtane.Client/Modules/Admin/Site/Index.razor index baaedb1a..115f29a0 100644 --- a/Oqtane.Client/Modules/Admin/Site/Index.razor +++ b/Oqtane.Client/Modules/Admin/Site/Index.razor @@ -202,7 +202,7 @@ - @if (_smtpenabled == "True") + @if (_smtpenabled == "True" && UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) {
@@ -609,21 +609,24 @@ // SMTP _smtpenabled = SettingService.GetSetting(settings, "SMTPEnabled", "False"); - _smtphost = SettingService.GetSetting(settings, "SMTPHost", string.Empty); - _smtpport = SettingService.GetSetting(settings, "SMTPPort", string.Empty); - _smtpssl = SettingService.GetSetting(settings, "SMTPSSL", "False"); - _smtpauthentication = SettingService.GetSetting(settings, "SMTPAuthentication", "Basic"); - _smtpusername = SettingService.GetSetting(settings, "SMTPUsername", string.Empty); - _smtppassword = SettingService.GetSetting(settings, "SMTPPassword", string.Empty); - _togglesmtppassword = SharedLocalizer["ShowPassword"]; - _smtpauthority = SettingService.GetSetting(settings, "SMTPAuthority", string.Empty); - _smtpclientid = SettingService.GetSetting(settings, "SMTPClientId", string.Empty); - _smtpclientsecret = SettingService.GetSetting(settings, "SMTPClientSecret", string.Empty); - _togglesmtpclientsecret = SharedLocalizer["ShowPassword"]; - _smtpscopes = SettingService.GetSetting(settings, "SMTPScopes", string.Empty); - _smtpsender = SettingService.GetSetting(settings, "SMTPSender", string.Empty); - _smtprelay = SettingService.GetSetting(settings, "SMTPRelay", "False"); - _retention = int.Parse(SettingService.GetSetting(settings, "NotificationRetention", "30")); + if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) + { + _smtphost = SettingService.GetSetting(settings, "SMTPHost", string.Empty); + _smtpport = SettingService.GetSetting(settings, "SMTPPort", string.Empty); + _smtpssl = SettingService.GetSetting(settings, "SMTPSSL", "False"); + _smtpauthentication = SettingService.GetSetting(settings, "SMTPAuthentication", "Basic"); + _smtpusername = SettingService.GetSetting(settings, "SMTPUsername", string.Empty); + _smtppassword = SettingService.GetSetting(settings, "SMTPPassword", string.Empty); + _togglesmtppassword = SharedLocalizer["ShowPassword"]; + _smtpauthority = SettingService.GetSetting(settings, "SMTPAuthority", string.Empty); + _smtpclientid = SettingService.GetSetting(settings, "SMTPClientId", string.Empty); + _smtpclientsecret = SettingService.GetSetting(settings, "SMTPClientSecret", string.Empty); + _togglesmtpclientsecret = SharedLocalizer["ShowPassword"]; + _smtpscopes = SettingService.GetSetting(settings, "SMTPScopes", string.Empty); + _smtpsender = SettingService.GetSetting(settings, "SMTPSender", string.Empty); + _smtprelay = SettingService.GetSetting(settings, "SMTPRelay", "False"); + _retention = int.Parse(SettingService.GetSetting(settings, "NotificationRetention", "30")); + } // PWA _pwaisenabled = site.PwaIsEnabled.ToString(); @@ -800,21 +803,23 @@ // SMTP 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, "SiteGuid", _siteguid, true); - settings = SettingService.SetSetting(settings, "NotificationRetention", _retention.ToString(), true); + if (UserSecurity.IsAuthorized(PageState.User, RoleNames.Host)) + { + 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 settings = SettingService.SetSetting(settings, "CookieConsent", _cookieconsent); @@ -822,6 +827,7 @@ // functionality settings = SettingService.SetSetting(settings, "TextEditor", _textEditor); + settings = SettingService.SetSetting(settings, "SiteGuid", _siteguid, true); await SettingService.UpdateSiteSettingsAsync(settings, site.SiteId); await logger.LogInformation("Site Settings Saved {Site}", site); From 4cf1b5c0e7df4af0f6ab08f58afa8259e515fcfb Mon Sep 17 00:00:00 2001 From: sbwalker Date: Thu, 7 Aug 2025 15:07:33 -0400 Subject: [PATCH 06/14] add missing delete setting API method --- .../Controllers/SettingController.cs | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/Oqtane.Server/Controllers/SettingController.cs b/Oqtane.Server/Controllers/SettingController.cs index b2db2def..1c42ab7d 100644 --- a/Oqtane.Server/Controllers/SettingController.cs +++ b/Oqtane.Server/Controllers/SettingController.cs @@ -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 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; } } @@ -101,7 +101,7 @@ namespace Oqtane.Controllers public Setting Get(int id, string entityName) { 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) { @@ -113,7 +113,7 @@ namespace Oqtane.Controllers { 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; } else @@ -201,12 +201,12 @@ namespace Oqtane.Controllers } 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; } } - // DELETE api//site/1/settingname + // DELETE api//site/1/settingname/settingid [HttpDelete("{entityName}/{entityId}/{settingName}")] public void Delete(string entityName, int entityId, string settingName) { @@ -221,7 +221,28 @@ namespace Oqtane.Controllers { 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//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; } } From d7eb0dc50999d2eefcf54aae3727d8c86151a120 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 11 Aug 2025 16:22:22 -0400 Subject: [PATCH 07/14] fix issue with Admin Site Template --- .../SiteTemplates/AdminSiteTemplate.cs | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/Oqtane.Server/Infrastructure/SiteTemplates/AdminSiteTemplate.cs b/Oqtane.Server/Infrastructure/SiteTemplates/AdminSiteTemplate.cs index ddd1e784..730b0d87 100644 --- a/Oqtane.Server/Infrastructure/SiteTemplates/AdminSiteTemplate.cs +++ b/Oqtane.Server/Infrastructure/SiteTemplates/AdminSiteTemplate.cs @@ -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 + { + new Permission(PermissionNames.View, RoleNames.Admin, true), + new Permission(PermissionNames.Edit, RoleNames.Admin, true) + }, + PageTemplateModules = new List + { + new PageTemplateModule + { + ModuleDefinitionName = typeof(Oqtane.Modules.Admin.Languages.Index).ToModuleDefinitionName(), Title = "Language Management", Pane = PaneNames.Default, + PermissionList = new List + { + new Permission(PermissionNames.View, RoleNames.Admin, true), + new Permission(PermissionNames.Edit, RoleNames.Admin, true) + }, + Content = "" + } + } + }); // host pages (order starts at 51) pageTemplates.Add(new PageTemplate @@ -694,42 +722,10 @@ namespace Oqtane.Infrastructure.SiteTemplates } }); pageTemplates.Add(new PageTemplate - { - Name = "Language Management", - Parent = "Admin", - Order = 59, - Path = "admin/languages", - Icon = Icons.Text, - IsNavigation = false, - IsPersonalizable = false, - PermissionList = new List - { - 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 - { - new PageTemplateModule - { - ModuleDefinitionName = typeof(Oqtane.Modules.Admin.Languages.Index).ToModuleDefinitionName(), Title = "Language Management", Pane = PaneNames.Default, - PermissionList = new List - { - 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", Parent = "Admin", - Order = 61, + Order = 59, Path = "admin/jobs", Icon = Icons.Timer, IsNavigation = false, @@ -757,7 +753,7 @@ namespace Oqtane.Infrastructure.SiteTemplates { Name = "Sql Management", Parent = "Admin", - Order = 63, + Order = 61, Path = "admin/sql", Icon = Icons.Spreadsheet, IsNavigation = false, @@ -785,7 +781,7 @@ namespace Oqtane.Infrastructure.SiteTemplates { Name = "System Info", Parent = "Admin", - Order = 65, + Order = 63, Path = "admin/system", Icon = Icons.MedicalCross, IsNavigation = false, @@ -813,7 +809,7 @@ namespace Oqtane.Infrastructure.SiteTemplates { Name = "System Update", Parent = "Admin", - Order = 67, + Order = 65, Path = "admin/update", Icon = Icons.Aperture, IsNavigation = false, From b3f6194fda5f506cc6669168a07a2f785918ff90 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 11 Aug 2025 16:36:09 -0400 Subject: [PATCH 08/14] consolidate interface and implementation classes --- Oqtane.Server/Repository/AliasRepository.cs | 11 ++++++++ .../IDBContextDependencies.cs | 0 Oqtane.Server/Repository/FileRepository.cs | 16 +++++++++++- Oqtane.Server/Repository/FolderRepository.cs | 14 ++++++++++- .../Repository/Interfaces/IAliasRepository.cs | 16 ------------ .../Repository/Interfaces/IFileRepository.cs | 20 --------------- .../Interfaces/IFolderRepository.cs | 18 ------------- .../Interfaces/IJobLogRepository.cs | 15 ----------- .../Repository/Interfaces/IJobRepository.cs | 15 ----------- .../Interfaces/ILanguageRepository.cs | 18 ------------- .../Repository/Interfaces/ILogRepository.cs | 13 ---------- .../Interfaces/IModuleDefinitionRepository.cs | 15 ----------- .../Interfaces/IModuleRepository.cs | 17 ------------- .../Interfaces/INotificationRepository.cs | 18 ------------- .../Interfaces/IPageModuleRepository.cs | 16 ------------ .../Repository/Interfaces/IPageRepository.cs | 16 ------------ .../Interfaces/IPermissionRepository.cs | 21 ---------------- .../Interfaces/IProfileRepository.cs | 15 ----------- .../Repository/Interfaces/IRoleRepository.cs | 16 ------------ .../Interfaces/ISearchContentRepository.cs | 24 ------------------ .../Interfaces/ISettingRepository.cs | 21 ---------------- .../Repository/Interfaces/ISiteRepository.cs | 19 -------------- .../Interfaces/ISiteTemplateRepository.cs | 10 -------- .../Repository/Interfaces/ISqlRepository.cs | 25 ------------------- .../Interfaces/ITenantRepository.cs | 14 ----------- .../Repository/Interfaces/ITenantResolver.cs | 11 -------- .../Repository/Interfaces/IThemeRepository.cs | 14 ----------- .../Interfaces/IUrlMappingRepository.cs | 18 ------------- .../Repository/Interfaces/IUserRepository.cs | 17 ------------- .../Interfaces/IUserRoleRepository.cs | 20 --------------- .../Interfaces/IVisitorRepository.cs | 17 ------------- Oqtane.Server/Repository/JobLogRepository.cs | 10 ++++++++ Oqtane.Server/Repository/JobRepository.cs | 10 ++++++++ .../Repository/LanguageRepository.cs | 9 +++++++ Oqtane.Server/Repository/LogRepository.cs | 8 ++++++ .../Repository/ModuleDefinitionRepository.cs | 10 ++++++++ Oqtane.Server/Repository/ModuleRepository.cs | 13 +++++++++- .../Repository/NotificationRepository.cs | 13 ++++++++++ .../Repository/PageModuleRepository.cs | 13 ++++++++-- Oqtane.Server/Repository/PageRepository.cs | 12 ++++++++- .../Repository/PermissionRepository.cs | 14 +++++++++++ Oqtane.Server/Repository/ProfileRepository.cs | 9 +++++++ Oqtane.Server/Repository/RoleRepository.cs | 13 ++++++++-- .../Repository/SearchContentRepository.cs | 20 ++++++++++++--- Oqtane.Server/Repository/SettingRepository.cs | 15 +++++++++++ Oqtane.Server/Repository/SiteRepository.cs | 14 ++++++++++- .../Repository/SiteTemplateRepository.cs | 5 ++++ Oqtane.Server/Repository/SqlRepository.cs | 19 ++++++++++++++ Oqtane.Server/Repository/TenantRepository.cs | 8 ++++++ Oqtane.Server/Repository/TenantResolver.cs | 6 +++++ Oqtane.Server/Repository/ThemeRepository.cs | 10 +++++++- .../Repository/UrlMappingRepository.cs | 12 +++++++++ Oqtane.Server/Repository/UserRepository.cs | 13 +++++++++- .../Repository/UserRoleRepository.cs | 15 +++++++++++ Oqtane.Server/Repository/VisitorRepository.cs | 11 ++++++++ 55 files changed, 309 insertions(+), 473 deletions(-) rename Oqtane.Server/Repository/{Interfaces => Context}/IDBContextDependencies.cs (100%) delete mode 100644 Oqtane.Server/Repository/Interfaces/IAliasRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IFileRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IFolderRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IJobLogRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IJobRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ILanguageRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ILogRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IModuleDefinitionRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IModuleRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/INotificationRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IPageModuleRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IPageRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IPermissionRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IProfileRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IRoleRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ISearchContentRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ISettingRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ISiteRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ISiteTemplateRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ISqlRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ITenantRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/ITenantResolver.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IThemeRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IUrlMappingRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IUserRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IUserRoleRepository.cs delete mode 100644 Oqtane.Server/Repository/Interfaces/IVisitorRepository.cs diff --git a/Oqtane.Server/Repository/AliasRepository.cs b/Oqtane.Server/Repository/AliasRepository.cs index e7dbd1c6..38b9925a 100644 --- a/Oqtane.Server/Repository/AliasRepository.cs +++ b/Oqtane.Server/Repository/AliasRepository.cs @@ -8,6 +8,17 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface IAliasRepository + { + IEnumerable GetAliases(); + Alias AddAlias(Alias alias); + Alias UpdateAlias(Alias alias); + Alias GetAlias(int aliasId); + Alias GetAlias(int aliasId, bool tracking); + Alias GetAlias(string url); + void DeleteAlias(int aliasId); + } + public class AliasRepository : IAliasRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/Interfaces/IDBContextDependencies.cs b/Oqtane.Server/Repository/Context/IDBContextDependencies.cs similarity index 100% rename from Oqtane.Server/Repository/Interfaces/IDBContextDependencies.cs rename to Oqtane.Server/Repository/Context/IDBContextDependencies.cs diff --git a/Oqtane.Server/Repository/FileRepository.cs b/Oqtane.Server/Repository/FileRepository.cs index fedbdc6e..def51519 100644 --- a/Oqtane.Server/Repository/FileRepository.cs +++ b/Oqtane.Server/Repository/FileRepository.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.EntityFrameworkCore; -using Oqtane.Extensions; using Oqtane.Infrastructure; using Oqtane.Models; using Oqtane.Shared; @@ -10,6 +9,21 @@ using File = Oqtane.Models.File; namespace Oqtane.Repository { + public interface IFileRepository + { + IEnumerable GetFiles(int folderId); + IEnumerable GetFiles(int folderId, bool tracking); + File AddFile(File file); + File UpdateFile(File file); + File GetFile(int fileId); + File GetFile(int fileId, bool tracking); + File GetFile(int folderId, string fileName); + File GetFile(int siteId, string folderPath, string fileName); + void DeleteFile(int fileId); + string GetFilePath(int fileId); + string GetFilePath(File file); + } + public class FileRepository : IFileRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/FolderRepository.cs b/Oqtane.Server/Repository/FolderRepository.cs index c4dfb8ed..d00a6a7c 100644 --- a/Oqtane.Server/Repository/FolderRepository.cs +++ b/Oqtane.Server/Repository/FolderRepository.cs @@ -2,13 +2,25 @@ using System.Collections.Generic; using System.Linq; using Microsoft.AspNetCore.Hosting; using Microsoft.EntityFrameworkCore; -using Oqtane.Extensions; using Oqtane.Infrastructure; using Oqtane.Models; using Oqtane.Shared; namespace Oqtane.Repository { + public interface IFolderRepository + { + IEnumerable GetFolders(int siteId); + Folder AddFolder(Folder folder); + Folder UpdateFolder(Folder folder); + Folder GetFolder(int folderId); + Folder GetFolder(int folderId, bool tracking); + Folder GetFolder(int siteId, string path); + void DeleteFolder(int folderId); + string GetFolderPath(int folderId); + string GetFolderPath(Folder folder); + } + public class FolderRepository : IFolderRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/Interfaces/IAliasRepository.cs b/Oqtane.Server/Repository/Interfaces/IAliasRepository.cs deleted file mode 100644 index 81a42d68..00000000 --- a/Oqtane.Server/Repository/Interfaces/IAliasRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IAliasRepository - { - IEnumerable GetAliases(); - Alias AddAlias(Alias alias); - Alias UpdateAlias(Alias alias); - Alias GetAlias(int aliasId); - Alias GetAlias(int aliasId, bool tracking); - Alias GetAlias(string url); - void DeleteAlias(int aliasId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IFileRepository.cs b/Oqtane.Server/Repository/Interfaces/IFileRepository.cs deleted file mode 100644 index 214b03d8..00000000 --- a/Oqtane.Server/Repository/Interfaces/IFileRepository.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IFileRepository - { - IEnumerable GetFiles(int folderId); - IEnumerable GetFiles(int folderId, bool tracking); - File AddFile(File file); - File UpdateFile(File file); - File GetFile(int fileId); - File GetFile(int fileId, bool tracking); - File GetFile(int folderId, string fileName); - File GetFile(int siteId, string folderPath, string fileName); - void DeleteFile(int fileId); - string GetFilePath(int fileId); - string GetFilePath(File file); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IFolderRepository.cs b/Oqtane.Server/Repository/Interfaces/IFolderRepository.cs deleted file mode 100644 index dba914a7..00000000 --- a/Oqtane.Server/Repository/Interfaces/IFolderRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IFolderRepository - { - IEnumerable GetFolders(int siteId); - Folder AddFolder(Folder folder); - Folder UpdateFolder(Folder folder); - Folder GetFolder(int folderId); - Folder GetFolder(int folderId, bool tracking); - Folder GetFolder(int siteId, string path); - void DeleteFolder(int folderId); - string GetFolderPath(int folderId); - string GetFolderPath(Folder folder); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IJobLogRepository.cs b/Oqtane.Server/Repository/Interfaces/IJobLogRepository.cs deleted file mode 100644 index 2c092e7a..00000000 --- a/Oqtane.Server/Repository/Interfaces/IJobLogRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IJobLogRepository - { - IEnumerable GetJobLogs(); - IEnumerable GetJobLogs(int jobId); - JobLog AddJobLog(JobLog jobLog); - JobLog UpdateJobLog(JobLog jobLog); - JobLog GetJobLog(int jobLogId); - void DeleteJobLog(int jobLogId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IJobRepository.cs b/Oqtane.Server/Repository/Interfaces/IJobRepository.cs deleted file mode 100644 index e45b0231..00000000 --- a/Oqtane.Server/Repository/Interfaces/IJobRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IJobRepository - { - IEnumerable GetJobs(); - Job AddJob(Job job); - Job UpdateJob(Job job); - Job GetJob(int jobId); - Job GetJob(int jobId, bool tracking); - void DeleteJob(int jobId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ILanguageRepository.cs b/Oqtane.Server/Repository/Interfaces/ILanguageRepository.cs deleted file mode 100644 index 14619121..00000000 --- a/Oqtane.Server/Repository/Interfaces/ILanguageRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ILanguageRepository - { - IEnumerable GetLanguages(int siteId); - - Language AddLanguage(Language language); - - void UpdateLanguage(Language language); - - Language GetLanguage(int languageId); - - void DeleteLanguage(int languageId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ILogRepository.cs b/Oqtane.Server/Repository/Interfaces/ILogRepository.cs deleted file mode 100644 index 918785f2..00000000 --- a/Oqtane.Server/Repository/Interfaces/ILogRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ILogRepository - { - IEnumerable GetLogs(int siteId, string level, string function, int rows); - Log GetLog(int logId); - void AddLog(Log log); - int DeleteLogs(int siteId, int age); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IModuleDefinitionRepository.cs b/Oqtane.Server/Repository/Interfaces/IModuleDefinitionRepository.cs deleted file mode 100644 index eb4f45d9..00000000 --- a/Oqtane.Server/Repository/Interfaces/IModuleDefinitionRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IModuleDefinitionRepository - { - IEnumerable GetModuleDefinitions(); - IEnumerable GetModuleDefinitions(int siteId); - ModuleDefinition GetModuleDefinition(int moduleDefinitionId, int siteId); - void UpdateModuleDefinition(ModuleDefinition moduleDefinition); - void DeleteModuleDefinition(int moduleDefinitionId); - ModuleDefinition FilterModuleDefinition(ModuleDefinition moduleDefinition); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IModuleRepository.cs b/Oqtane.Server/Repository/Interfaces/IModuleRepository.cs deleted file mode 100644 index 08923ecd..00000000 --- a/Oqtane.Server/Repository/Interfaces/IModuleRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IModuleRepository - { - IEnumerable GetModules(int siteId); - Module AddModule(Module module); - Module UpdateModule(Module module); - Module GetModule(int moduleId); - Module GetModule(int moduleId, bool tracking); - void DeleteModule(int moduleId); - string ExportModule(int moduleId); - bool ImportModule(int moduleId, string content); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs b/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs deleted file mode 100644 index 948d7b53..00000000 --- a/Oqtane.Server/Repository/Interfaces/INotificationRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface INotificationRepository - { - IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId); - IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead); - int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead); - Notification AddNotification(Notification notification); - Notification UpdateNotification(Notification notification); - Notification GetNotification(int notificationId); - Notification GetNotification(int notificationId, bool tracking); - void DeleteNotification(int notificationId); - int DeleteNotifications(int siteId, int age); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IPageModuleRepository.cs b/Oqtane.Server/Repository/Interfaces/IPageModuleRepository.cs deleted file mode 100644 index a3ac66e5..00000000 --- a/Oqtane.Server/Repository/Interfaces/IPageModuleRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IPageModuleRepository - { - IEnumerable GetPageModules(int siteId); - PageModule AddPageModule(PageModule pageModule); - PageModule UpdatePageModule(PageModule pageModule); - PageModule GetPageModule(int pageModuleId); - PageModule GetPageModule(int pageModuleId, bool tracking); - PageModule GetPageModule(int pageId, int moduleId); - void DeletePageModule(int pageModuleId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IPageRepository.cs b/Oqtane.Server/Repository/Interfaces/IPageRepository.cs deleted file mode 100644 index 12caca4c..00000000 --- a/Oqtane.Server/Repository/Interfaces/IPageRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IPageRepository - { - IEnumerable GetPages(int siteId); - Page AddPage(Page page); - Page UpdatePage(Page page); - Page GetPage(int pageId); - Page GetPage(int pageId, bool tracking); - Page GetPage(string path, int siteId); - void DeletePage(int pageId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IPermissionRepository.cs b/Oqtane.Server/Repository/Interfaces/IPermissionRepository.cs deleted file mode 100644 index a3dc7358..00000000 --- a/Oqtane.Server/Repository/Interfaces/IPermissionRepository.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.Security.Policy; -using Oqtane.Models; - -// ReSharper disable once CheckNamespace -namespace Oqtane.Repository -{ - public interface IPermissionRepository -{ - IEnumerable GetPermissions(int siteId, string entityName); - IEnumerable GetPermissions(int siteId, string entityName, string permissionName); - IEnumerable GetPermissions(int siteId, string entityName, int entityId); - IEnumerable GetPermissions(int siteId, string entityName, int entityId, string permissionName); - Permission AddPermission(Permission permission); - Permission UpdatePermission(Permission permission); - void UpdatePermissions(int siteId, string entityName, int entityId, List permissions); - Permission GetPermission(int permissionId); - void DeletePermission(int permissionId); - void DeletePermissions(int siteId, string entityName, int entityId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IProfileRepository.cs b/Oqtane.Server/Repository/Interfaces/IProfileRepository.cs deleted file mode 100644 index 95405c96..00000000 --- a/Oqtane.Server/Repository/Interfaces/IProfileRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IProfileRepository - { - IEnumerable GetProfiles(int siteId); - Profile AddProfile(Profile profile); - Profile UpdateProfile(Profile profile); - Profile GetProfile(int profileId); - Profile GetProfile(int profileId, bool tracking); - void DeleteProfile(int profileId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IRoleRepository.cs b/Oqtane.Server/Repository/Interfaces/IRoleRepository.cs deleted file mode 100644 index 1b2ea0e4..00000000 --- a/Oqtane.Server/Repository/Interfaces/IRoleRepository.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IRoleRepository - { - IEnumerable GetRoles(int siteId); - IEnumerable GetRoles(int siteId, bool includeGlobalRoles); - Role AddRole(Role role); - Role UpdateRole(Role role); - Role GetRole(int roleId); - Role GetRole(int roleId, bool tracking); - void DeleteRole(int roleId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ISearchContentRepository.cs b/Oqtane.Server/Repository/Interfaces/ISearchContentRepository.cs deleted file mode 100644 index 022c8012..00000000 --- a/Oqtane.Server/Repository/Interfaces/ISearchContentRepository.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ISearchContentRepository - { - Task> GetSearchContentsAsync(SearchQuery searchQuery); - SearchContent AddSearchContent(SearchContent searchContent); - void DeleteSearchContent(int searchContentId); - void DeleteSearchContent(string entityName, string entryId); - void DeleteSearchContent(string uniqueKey); - void DeleteAllSearchContent(int siteId); - - SearchWord GetSearchWord(string word); - SearchWord AddSearchWord(SearchWord searchWord); - - IEnumerable GetSearchContentWords(int searchContentId); - SearchContentWord AddSearchContentWord(SearchContentWord searchContentWord); - SearchContentWord UpdateSearchContentWord(SearchContentWord searchContentWord); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ISettingRepository.cs b/Oqtane.Server/Repository/Interfaces/ISettingRepository.cs deleted file mode 100644 index 7315f633..00000000 --- a/Oqtane.Server/Repository/Interfaces/ISettingRepository.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; -using Oqtane.Shared; - -namespace Oqtane.Repository -{ - public interface ISettingRepository - { - IEnumerable GetSettings(string entityName); - IEnumerable GetSettings(string entityName, int entityId); - IEnumerable GetSettings(string entityName1, int entityId1, string entityName2, int entityId2); - Setting AddSetting(Setting setting); - Setting UpdateSetting(Setting setting); - Setting GetSetting(string entityName, int settingId); - Setting GetSetting(string entityName, int entityId, string settingName); - void DeleteSetting(string entityName, int settingId); - void DeleteSettings(string entityName, int entityId); - string GetSettingValue(IEnumerable settings, string settingName, string defaultValue); - string GetSettingValue(string entityName, int entityId, string settingName, string defaultValue); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ISiteRepository.cs b/Oqtane.Server/Repository/Interfaces/ISiteRepository.cs deleted file mode 100644 index 3ef66893..00000000 --- a/Oqtane.Server/Repository/Interfaces/ISiteRepository.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ISiteRepository - { - IEnumerable GetSites(); - Site AddSite(Site site); - Site UpdateSite(Site site); - Site GetSite(int siteId); - Site GetSite(int siteId, bool tracking); - void DeleteSite(int siteId); - - void InitializeSite(Alias alias); - void CreatePages(Site site, List pageTemplates, Alias alias); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ISiteTemplateRepository.cs b/Oqtane.Server/Repository/Interfaces/ISiteTemplateRepository.cs deleted file mode 100644 index 659226ff..00000000 --- a/Oqtane.Server/Repository/Interfaces/ISiteTemplateRepository.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ISiteTemplateRepository - { - IEnumerable GetSiteTemplates(); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ISqlRepository.cs b/Oqtane.Server/Repository/Interfaces/ISqlRepository.cs deleted file mode 100644 index d4d87201..00000000 --- a/Oqtane.Server/Repository/Interfaces/ISqlRepository.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Data; -using System.Reflection; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ISqlRepository - { - void ExecuteScript(Tenant tenant, string script); - - bool ExecuteScript(string connectionString, string databaseType, Assembly assembly, string filename); - - bool ExecuteScript(Tenant tenant, Assembly assembly, string filename); - - int ExecuteNonQuery(Tenant tenant, string query); - - int ExecuteNonQuery(string connectionString, string databaseType, string query); - - IDataReader ExecuteReader(Tenant tenant, string query); - - IDataReader ExecuteReader(string DBType, string DBConnectionString, string query); - - string GetScriptFromAssembly(Assembly assembly, string fileName); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ITenantRepository.cs b/Oqtane.Server/Repository/Interfaces/ITenantRepository.cs deleted file mode 100644 index 5993eb63..00000000 --- a/Oqtane.Server/Repository/Interfaces/ITenantRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface ITenantRepository - { - IEnumerable GetTenants(); - Tenant AddTenant(Tenant tenant); - Tenant UpdateTenant(Tenant tenant); - Tenant GetTenant(int tenantId); - void DeleteTenant(int tenantId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/ITenantResolver.cs b/Oqtane.Server/Repository/Interfaces/ITenantResolver.cs deleted file mode 100644 index bc3a48eb..00000000 --- a/Oqtane.Server/Repository/Interfaces/ITenantResolver.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Oqtane.Models; - -namespace Oqtane.Repository -{ - // class deprecated and replaced by ITenantManager - public interface ITenantResolver - { - Alias GetAlias(); - Tenant GetTenant(); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IThemeRepository.cs b/Oqtane.Server/Repository/Interfaces/IThemeRepository.cs deleted file mode 100644 index b8d98aee..00000000 --- a/Oqtane.Server/Repository/Interfaces/IThemeRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IThemeRepository - { - IEnumerable GetThemes(); - Theme GetTheme(int themeId, int siteId); - void UpdateTheme(Theme theme); - void DeleteTheme(int themeId); - List FilterThemes(List themes); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IUrlMappingRepository.cs b/Oqtane.Server/Repository/Interfaces/IUrlMappingRepository.cs deleted file mode 100644 index ca056484..00000000 --- a/Oqtane.Server/Repository/Interfaces/IUrlMappingRepository.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IUrlMappingRepository - { - IEnumerable GetUrlMappings(int siteId, bool isMapped); - UrlMapping AddUrlMapping(UrlMapping urlMapping); - UrlMapping UpdateUrlMapping(UrlMapping urlMapping); - UrlMapping GetUrlMapping(int urlMappingId); - UrlMapping GetUrlMapping(int urlMappingId, bool tracking); - UrlMapping GetUrlMapping(int siteId, string url); - void DeleteUrlMapping(int urlMappingId); - int DeleteUrlMappings(int siteId, int age); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IUserRepository.cs b/Oqtane.Server/Repository/Interfaces/IUserRepository.cs deleted file mode 100644 index 89ed4204..00000000 --- a/Oqtane.Server/Repository/Interfaces/IUserRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IUserRepository - { - IEnumerable GetUsers(); - User AddUser(User user); - User UpdateUser(User user); - User GetUser(int userId); - User GetUser(int userId, bool tracking); - User GetUser(string username); - User GetUser(string username, string email); - void DeleteUser(int userId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IUserRoleRepository.cs b/Oqtane.Server/Repository/Interfaces/IUserRoleRepository.cs deleted file mode 100644 index 7db22b4e..00000000 --- a/Oqtane.Server/Repository/Interfaces/IUserRoleRepository.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IUserRoleRepository - { - IEnumerable GetUserRoles(int siteId); - IEnumerable GetUserRoles(int userId, int siteId); - IEnumerable GetUserRoles(string roleName, int siteId); - UserRole AddUserRole(UserRole userRole); - UserRole UpdateUserRole(UserRole userRole); - UserRole GetUserRole(int userRoleId); - UserRole GetUserRole(int userRoleId, bool tracking); - UserRole GetUserRole(int userId, int roleId); - UserRole GetUserRole(int userId, int roleId, bool tracking); - void DeleteUserRole(int userRoleId); - void DeleteUserRoles(int userId); - } -} diff --git a/Oqtane.Server/Repository/Interfaces/IVisitorRepository.cs b/Oqtane.Server/Repository/Interfaces/IVisitorRepository.cs deleted file mode 100644 index 9100e0b8..00000000 --- a/Oqtane.Server/Repository/Interfaces/IVisitorRepository.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Repository -{ - public interface IVisitorRepository - { - IEnumerable GetVisitors(int siteId, DateTime fromDate); - Visitor AddVisitor(Visitor visitor); - Visitor UpdateVisitor(Visitor visitor); - Visitor GetVisitor(int visitorId); - Visitor GetVisitor(int siteId, string IPAddress); - void DeleteVisitor(int visitorId); - int DeleteVisitors(int siteId, int age); - } -} diff --git a/Oqtane.Server/Repository/JobLogRepository.cs b/Oqtane.Server/Repository/JobLogRepository.cs index ee234c27..523ac356 100644 --- a/Oqtane.Server/Repository/JobLogRepository.cs +++ b/Oqtane.Server/Repository/JobLogRepository.cs @@ -5,6 +5,16 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface IJobLogRepository + { + IEnumerable GetJobLogs(); + IEnumerable GetJobLogs(int jobId); + JobLog AddJobLog(JobLog jobLog); + JobLog UpdateJobLog(JobLog jobLog); + JobLog GetJobLog(int jobLogId); + void DeleteJobLog(int jobLogId); + } + public class JobLogRepository : IJobLogRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/JobRepository.cs b/Oqtane.Server/Repository/JobRepository.cs index 6d56c5c3..823bdcc8 100644 --- a/Oqtane.Server/Repository/JobRepository.cs +++ b/Oqtane.Server/Repository/JobRepository.cs @@ -7,6 +7,16 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface IJobRepository + { + IEnumerable GetJobs(); + Job AddJob(Job job); + Job UpdateJob(Job job); + Job GetJob(int jobId); + Job GetJob(int jobId, bool tracking); + void DeleteJob(int jobId); + } + public class JobRepository : IJobRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/LanguageRepository.cs b/Oqtane.Server/Repository/LanguageRepository.cs index f31a61eb..f074c9a1 100644 --- a/Oqtane.Server/Repository/LanguageRepository.cs +++ b/Oqtane.Server/Repository/LanguageRepository.cs @@ -5,6 +5,15 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface ILanguageRepository + { + IEnumerable GetLanguages(int siteId); + Language AddLanguage(Language language); + void UpdateLanguage(Language language); + Language GetLanguage(int languageId); + void DeleteLanguage(int languageId); + } + public class LanguageRepository : ILanguageRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/LogRepository.cs b/Oqtane.Server/Repository/LogRepository.cs index 12f43a21..f41e0d97 100644 --- a/Oqtane.Server/Repository/LogRepository.cs +++ b/Oqtane.Server/Repository/LogRepository.cs @@ -6,6 +6,14 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface ILogRepository + { + IEnumerable GetLogs(int siteId, string level, string function, int rows); + Log GetLog(int logId); + void AddLog(Log log); + int DeleteLogs(int siteId, int age); + } + public class LogRepository : ILogRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs index 204578e4..b073f5d5 100644 --- a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs +++ b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs @@ -13,6 +13,16 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface IModuleDefinitionRepository + { + IEnumerable GetModuleDefinitions(); + IEnumerable GetModuleDefinitions(int siteId); + ModuleDefinition GetModuleDefinition(int moduleDefinitionId, int siteId); + void UpdateModuleDefinition(ModuleDefinition moduleDefinition); + void DeleteModuleDefinition(int moduleDefinitionId); + ModuleDefinition FilterModuleDefinition(ModuleDefinition moduleDefinition); + } + public class ModuleDefinitionRepository : IModuleDefinitionRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/ModuleRepository.cs b/Oqtane.Server/Repository/ModuleRepository.cs index 5885ae9c..18cbd05f 100644 --- a/Oqtane.Server/Repository/ModuleRepository.cs +++ b/Oqtane.Server/Repository/ModuleRepository.cs @@ -4,7 +4,6 @@ using System.Linq; using System.Text.Json; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using Oqtane.Extensions; using Oqtane.Models; using Oqtane.Modules; using Oqtane.Shared; @@ -12,6 +11,18 @@ using Module = Oqtane.Models.Module; namespace Oqtane.Repository { + public interface IModuleRepository + { + IEnumerable GetModules(int siteId); + Module AddModule(Module module); + Module UpdateModule(Module module); + Module GetModule(int moduleId); + Module GetModule(int moduleId, bool tracking); + void DeleteModule(int moduleId); + string ExportModule(int moduleId); + bool ImportModule(int moduleId, string content); + } + public class ModuleRepository : IModuleRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/NotificationRepository.cs b/Oqtane.Server/Repository/NotificationRepository.cs index b4603f29..1c20faee 100644 --- a/Oqtane.Server/Repository/NotificationRepository.cs +++ b/Oqtane.Server/Repository/NotificationRepository.cs @@ -6,6 +6,19 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface INotificationRepository + { + IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId); + IEnumerable GetNotifications(int siteId, int fromUserId, int toUserId, int count, bool isRead); + int GetNotificationCount(int siteId, int fromUserId, int toUserId, bool isRead); + Notification AddNotification(Notification notification); + Notification UpdateNotification(Notification notification); + Notification GetNotification(int notificationId); + Notification GetNotification(int notificationId, bool tracking); + void DeleteNotification(int notificationId); + int DeleteNotifications(int siteId, int age); + } + public class NotificationRepository : INotificationRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/PageModuleRepository.cs b/Oqtane.Server/Repository/PageModuleRepository.cs index a6f81b69..239a9a67 100644 --- a/Oqtane.Server/Repository/PageModuleRepository.cs +++ b/Oqtane.Server/Repository/PageModuleRepository.cs @@ -1,13 +1,22 @@ using System.Collections.Generic; using System.Linq; -using System.Reflection; using Microsoft.EntityFrameworkCore; -using Oqtane.Extensions; using Oqtane.Models; using Oqtane.Shared; namespace Oqtane.Repository { + public interface IPageModuleRepository + { + IEnumerable GetPageModules(int siteId); + PageModule AddPageModule(PageModule pageModule); + PageModule UpdatePageModule(PageModule pageModule); + PageModule GetPageModule(int pageModuleId); + PageModule GetPageModule(int pageModuleId, bool tracking); + PageModule GetPageModule(int pageId, int moduleId); + void DeletePageModule(int pageModuleId); + } + public class PageModuleRepository : IPageModuleRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/PageRepository.cs b/Oqtane.Server/Repository/PageRepository.cs index f400226f..5f99c150 100644 --- a/Oqtane.Server/Repository/PageRepository.cs +++ b/Oqtane.Server/Repository/PageRepository.cs @@ -2,12 +2,22 @@ using System; using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore; -using Oqtane.Extensions; using Oqtane.Models; using Oqtane.Shared; namespace Oqtane.Repository { + public interface IPageRepository + { + IEnumerable GetPages(int siteId); + Page AddPage(Page page); + Page UpdatePage(Page page); + Page GetPage(int pageId); + Page GetPage(int pageId, bool tracking); + Page GetPage(string path, int siteId); + void DeletePage(int pageId); + } + public class PageRepository : IPageRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/PermissionRepository.cs b/Oqtane.Server/Repository/PermissionRepository.cs index 1a3b0395..b4f7530d 100644 --- a/Oqtane.Server/Repository/PermissionRepository.cs +++ b/Oqtane.Server/Repository/PermissionRepository.cs @@ -8,6 +8,20 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface IPermissionRepository + { + IEnumerable GetPermissions(int siteId, string entityName); + IEnumerable GetPermissions(int siteId, string entityName, string permissionName); + IEnumerable GetPermissions(int siteId, string entityName, int entityId); + IEnumerable GetPermissions(int siteId, string entityName, int entityId, string permissionName); + Permission AddPermission(Permission permission); + Permission UpdatePermission(Permission permission); + void UpdatePermissions(int siteId, string entityName, int entityId, List permissions); + Permission GetPermission(int permissionId); + void DeletePermission(int permissionId); + void DeletePermissions(int siteId, string entityName, int entityId); + } + public class PermissionRepository : IPermissionRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/ProfileRepository.cs b/Oqtane.Server/Repository/ProfileRepository.cs index 8e0b895a..b5749951 100644 --- a/Oqtane.Server/Repository/ProfileRepository.cs +++ b/Oqtane.Server/Repository/ProfileRepository.cs @@ -5,6 +5,15 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface IProfileRepository + { + IEnumerable GetProfiles(int siteId); + Profile AddProfile(Profile profile); + Profile UpdateProfile(Profile profile); + Profile GetProfile(int profileId); + Profile GetProfile(int profileId, bool tracking); + void DeleteProfile(int profileId); + } public class ProfileRepository : IProfileRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/RoleRepository.cs b/Oqtane.Server/Repository/RoleRepository.cs index 3d16eb35..05de9047 100644 --- a/Oqtane.Server/Repository/RoleRepository.cs +++ b/Oqtane.Server/Repository/RoleRepository.cs @@ -2,11 +2,20 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore; using Oqtane.Models; -using Oqtane.Modules.Admin.Users; -using Oqtane.Shared; namespace Oqtane.Repository { + public interface IRoleRepository + { + IEnumerable GetRoles(int siteId); + IEnumerable GetRoles(int siteId, bool includeGlobalRoles); + Role AddRole(Role role); + Role UpdateRole(Role role); + Role GetRole(int roleId); + Role GetRole(int roleId, bool tracking); + void DeleteRole(int roleId); + } + public class RoleRepository : IRoleRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/SearchContentRepository.cs b/Oqtane.Server/Repository/SearchContentRepository.cs index 5aa214ae..cb2eeee9 100644 --- a/Oqtane.Server/Repository/SearchContentRepository.cs +++ b/Oqtane.Server/Repository/SearchContentRepository.cs @@ -1,17 +1,31 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Runtime.CompilerServices; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Internal; using Oqtane.Extensions; -using Oqtane.Infrastructure; using Oqtane.Models; using Oqtane.Shared; namespace Oqtane.Repository { + public interface ISearchContentRepository + { + Task> GetSearchContentsAsync(SearchQuery searchQuery); + SearchContent AddSearchContent(SearchContent searchContent); + void DeleteSearchContent(int searchContentId); + void DeleteSearchContent(string entityName, string entryId); + void DeleteSearchContent(string uniqueKey); + void DeleteAllSearchContent(int siteId); + + SearchWord GetSearchWord(string word); + SearchWord AddSearchWord(SearchWord searchWord); + + IEnumerable GetSearchContentWords(int searchContentId); + SearchContentWord AddSearchContentWord(SearchContentWord searchContentWord); + SearchContentWord UpdateSearchContentWord(SearchContentWord searchContentWord); + } + public class SearchContentRepository : ISearchContentRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/SettingRepository.cs b/Oqtane.Server/Repository/SettingRepository.cs index 16a33811..13c48819 100644 --- a/Oqtane.Server/Repository/SettingRepository.cs +++ b/Oqtane.Server/Repository/SettingRepository.cs @@ -8,6 +8,21 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface ISettingRepository + { + IEnumerable GetSettings(string entityName); + IEnumerable GetSettings(string entityName, int entityId); + IEnumerable GetSettings(string entityName1, int entityId1, string entityName2, int entityId2); + Setting AddSetting(Setting setting); + Setting UpdateSetting(Setting setting); + Setting GetSetting(string entityName, int settingId); + Setting GetSetting(string entityName, int entityId, string settingName); + void DeleteSetting(string entityName, int settingId); + void DeleteSettings(string entityName, int entityId); + string GetSettingValue(IEnumerable settings, string settingName, string defaultValue); + string GetSettingValue(string entityName, int entityId, string settingName, string defaultValue); + } + public class SettingRepository : ISettingRepository { private readonly IDbContextFactory _tenantContextFactory; diff --git a/Oqtane.Server/Repository/SiteRepository.cs b/Oqtane.Server/Repository/SiteRepository.cs index 48620ead..530c536c 100644 --- a/Oqtane.Server/Repository/SiteRepository.cs +++ b/Oqtane.Server/Repository/SiteRepository.cs @@ -9,12 +9,24 @@ using Oqtane.Enums; using Oqtane.Infrastructure; using Oqtane.Models; using Oqtane.Modules; -using Oqtane.Modules.Admin.Modules; using Oqtane.Shared; using Module = Oqtane.Models.Module; namespace Oqtane.Repository { + public interface ISiteRepository + { + IEnumerable GetSites(); + Site AddSite(Site site); + Site UpdateSite(Site site); + Site GetSite(int siteId); + Site GetSite(int siteId, bool tracking); + void DeleteSite(int siteId); + + void InitializeSite(Alias alias); + void CreatePages(Site site, List pageTemplates, Alias alias); + } + public class SiteRepository : ISiteRepository { private readonly IDbContextFactory _factory; diff --git a/Oqtane.Server/Repository/SiteTemplateRepository.cs b/Oqtane.Server/Repository/SiteTemplateRepository.cs index db16600c..fc327e6d 100644 --- a/Oqtane.Server/Repository/SiteTemplateRepository.cs +++ b/Oqtane.Server/Repository/SiteTemplateRepository.cs @@ -9,6 +9,11 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface ISiteTemplateRepository + { + IEnumerable GetSiteTemplates(); + } + public class SiteTemplateRepository : ISiteTemplateRepository { private readonly IServiceProvider _serviceProvider; diff --git a/Oqtane.Server/Repository/SqlRepository.cs b/Oqtane.Server/Repository/SqlRepository.cs index a4689fcf..30102eea 100644 --- a/Oqtane.Server/Repository/SqlRepository.cs +++ b/Oqtane.Server/Repository/SqlRepository.cs @@ -12,6 +12,25 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface ISqlRepository + { + void ExecuteScript(Tenant tenant, string script); + + bool ExecuteScript(string connectionString, string databaseType, Assembly assembly, string filename); + + bool ExecuteScript(Tenant tenant, Assembly assembly, string filename); + + int ExecuteNonQuery(Tenant tenant, string query); + + int ExecuteNonQuery(string connectionString, string databaseType, string query); + + IDataReader ExecuteReader(Tenant tenant, string query); + + IDataReader ExecuteReader(string DBType, string DBConnectionString, string query); + + string GetScriptFromAssembly(Assembly assembly, string fileName); + } + public class SqlRepository : ISqlRepository { private IConfigurationRoot _config; diff --git a/Oqtane.Server/Repository/TenantRepository.cs b/Oqtane.Server/Repository/TenantRepository.cs index 25687f48..d5b83117 100644 --- a/Oqtane.Server/Repository/TenantRepository.cs +++ b/Oqtane.Server/Repository/TenantRepository.cs @@ -8,6 +8,14 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface ITenantRepository + { + IEnumerable GetTenants(); + Tenant AddTenant(Tenant tenant); + Tenant UpdateTenant(Tenant tenant); + Tenant GetTenant(int tenantId); + void DeleteTenant(int tenantId); + } public class TenantRepository : ITenantRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/TenantResolver.cs b/Oqtane.Server/Repository/TenantResolver.cs index 793006d3..f678a586 100644 --- a/Oqtane.Server/Repository/TenantResolver.cs +++ b/Oqtane.Server/Repository/TenantResolver.cs @@ -4,6 +4,12 @@ using Oqtane.Models; namespace Oqtane.Repository { // class deprecated and replaced by ITenantManager + public interface ITenantResolver + { + Alias GetAlias(); + Tenant GetTenant(); + } + public class TenantResolver : ITenantResolver { private readonly ITenantManager _tenantManager; diff --git a/Oqtane.Server/Repository/ThemeRepository.cs b/Oqtane.Server/Repository/ThemeRepository.cs index fd010b8c..56331a37 100644 --- a/Oqtane.Server/Repository/ThemeRepository.cs +++ b/Oqtane.Server/Repository/ThemeRepository.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; -using System.Reflection.Metadata; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Caching.Memory; using Oqtane.Infrastructure; @@ -14,6 +13,15 @@ using Oqtane.Themes; namespace Oqtane.Repository { + public interface IThemeRepository + { + IEnumerable GetThemes(); + Theme GetTheme(int themeId, int siteId); + void UpdateTheme(Theme theme); + void DeleteTheme(int themeId); + List FilterThemes(List themes); + } + public class ThemeRepository : IThemeRepository { private MasterDBContext _db; diff --git a/Oqtane.Server/Repository/UrlMappingRepository.cs b/Oqtane.Server/Repository/UrlMappingRepository.cs index 82f747da..9c2efbb6 100644 --- a/Oqtane.Server/Repository/UrlMappingRepository.cs +++ b/Oqtane.Server/Repository/UrlMappingRepository.cs @@ -6,6 +6,18 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface IUrlMappingRepository + { + IEnumerable GetUrlMappings(int siteId, bool isMapped); + UrlMapping AddUrlMapping(UrlMapping urlMapping); + UrlMapping UpdateUrlMapping(UrlMapping urlMapping); + UrlMapping GetUrlMapping(int urlMappingId); + UrlMapping GetUrlMapping(int urlMappingId, bool tracking); + UrlMapping GetUrlMapping(int siteId, string url); + void DeleteUrlMapping(int urlMappingId); + int DeleteUrlMappings(int siteId, int age); + } + public class UrlMappingRepository : IUrlMappingRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/UserRepository.cs b/Oqtane.Server/Repository/UserRepository.cs index 4858e7c3..b9f3c7df 100644 --- a/Oqtane.Server/Repository/UserRepository.cs +++ b/Oqtane.Server/Repository/UserRepository.cs @@ -2,11 +2,22 @@ using System.Collections.Generic; using System.Linq; using Microsoft.EntityFrameworkCore; using Oqtane.Models; -using Oqtane.Modules.Admin.Users; using Oqtane.Shared; namespace Oqtane.Repository { + public interface IUserRepository + { + IEnumerable GetUsers(); + User AddUser(User user); + User UpdateUser(User user); + User GetUser(int userId); + User GetUser(int userId, bool tracking); + User GetUser(string username); + User GetUser(string username, string email); + void DeleteUser(int userId); + } + public class UserRepository : IUserRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/UserRoleRepository.cs b/Oqtane.Server/Repository/UserRoleRepository.cs index 6956a20d..9c6a6256 100644 --- a/Oqtane.Server/Repository/UserRoleRepository.cs +++ b/Oqtane.Server/Repository/UserRoleRepository.cs @@ -10,6 +10,21 @@ using Oqtane.Shared; namespace Oqtane.Repository { + public interface IUserRoleRepository + { + IEnumerable GetUserRoles(int siteId); + IEnumerable GetUserRoles(int userId, int siteId); + IEnumerable GetUserRoles(string roleName, int siteId); + UserRole AddUserRole(UserRole userRole); + UserRole UpdateUserRole(UserRole userRole); + UserRole GetUserRole(int userRoleId); + UserRole GetUserRole(int userRoleId, bool tracking); + UserRole GetUserRole(int userId, int roleId); + UserRole GetUserRole(int userId, int roleId, bool tracking); + void DeleteUserRole(int userRoleId); + void DeleteUserRoles(int userId); + } + public class UserRoleRepository : IUserRoleRepository { private readonly IDbContextFactory _dbContextFactory; diff --git a/Oqtane.Server/Repository/VisitorRepository.cs b/Oqtane.Server/Repository/VisitorRepository.cs index d3583079..f18bd62a 100644 --- a/Oqtane.Server/Repository/VisitorRepository.cs +++ b/Oqtane.Server/Repository/VisitorRepository.cs @@ -6,6 +6,17 @@ using Oqtane.Models; namespace Oqtane.Repository { + public interface IVisitorRepository + { + IEnumerable GetVisitors(int siteId, DateTime fromDate); + Visitor AddVisitor(Visitor visitor); + Visitor UpdateVisitor(Visitor visitor); + Visitor GetVisitor(int visitorId); + Visitor GetVisitor(int siteId, string IPAddress); + void DeleteVisitor(int visitorId); + int DeleteVisitors(int siteId, int age); + } + public class VisitorRepository : IVisitorRepository { private readonly IDbContextFactory _dbContextFactory; From 64b8b5d3c8576322b749ed979a3fd41d191a2eef Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 11 Aug 2025 16:53:32 -0400 Subject: [PATCH 09/14] consolidate Service interface and implementation classes --- Oqtane.Client/Services/AliasService.cs | 40 +++ .../Services/CookieConsentService.cs | 39 ++- Oqtane.Client/Services/DatabaseService.cs | 12 + Oqtane.Client/Services/FileService.cs | 98 ++++++- Oqtane.Client/Services/FolderService.cs | 52 ++++ Oqtane.Client/Services/InstallationService.cs | 32 +++ .../Services/Interfaces/IAliasService.cs | 47 --- .../Interfaces/ICookieConsentService.cs | 42 --- .../Services/Interfaces/IDatabaseService.cs | 18 -- .../Services/Interfaces/IFileService.cs | 104 ------- .../Services/Interfaces/IFolderService.cs | 59 ---- .../Interfaces/IInstallationService.cs | 39 --- .../Services/Interfaces/IJobLogService.cs | 26 -- .../Services/Interfaces/IJobService.cs | 61 ---- .../Services/Interfaces/ILanguageService.cs | 56 ---- .../Interfaces/ILocalizationCookieService.cs | 17 -- .../Interfaces/ILocalizationService.cs | 18 -- .../Services/Interfaces/ILogService.cs | 72 ----- .../Interfaces/IModuleDefinitionService.cs | 56 ---- .../Services/Interfaces/IModuleService.cs | 73 ----- .../Interfaces/INotificationService.cs | 70 ----- .../Interfaces/IOutputCacheService.cs | 18 -- .../Services/Interfaces/IPackageService.cs | 70 ----- .../Services/Interfaces/IPageModuleService.cs | 56 ---- .../Services/Interfaces/IPageService.cs | 71 ----- .../Services/Interfaces/IProfileService.cs | 48 ---- .../Services/Interfaces/IRoleService.cs | 57 ---- .../Interfaces/ISearchResultsService.cs | 13 - .../Services/Interfaces/ISettingService.cs | 269 ------------------ .../Services/Interfaces/ISiteService.cs | 61 ---- .../Interfaces/ISiteTemplateService.cs | 18 -- .../Services/Interfaces/ISqlService.cs | 18 -- .../Services/Interfaces/ISyncService.cs | 19 -- .../Services/Interfaces/ISystemService.cs | 42 --- .../Services/Interfaces/ITenantService.cs | 25 -- .../Services/Interfaces/IThemeService.cs | 94 ------ .../Services/Interfaces/ITimeZoneService.cs | 17 -- .../Services/Interfaces/IUrlMappingService.cs | 56 ---- .../Services/Interfaces/IUserRoleService.cs | 72 ----- .../Services/Interfaces/IUserService.cs | 171 ----------- .../Services/Interfaces/IVisitorService.cs | 29 -- Oqtane.Client/Services/JobLogService.cs | 21 +- Oqtane.Client/Services/JobService.cs | 54 ++++ Oqtane.Client/Services/LanguageService.cs | 49 ++++ .../Services/LocalizationCookieService.cs | 13 + Oqtane.Client/Services/LocalizationService.cs | 12 + Oqtane.Client/Services/LogService.cs | 63 ++++ .../Services/ModuleDefinitionService.cs | 49 ++++ Oqtane.Client/Services/ModuleService.cs | 67 +++++ Oqtane.Client/Services/NotificationService.cs | 64 +++++ Oqtane.Client/Services/OutputCacheService.cs | 15 +- Oqtane.Client/Services/PackageService.cs | 64 ++++- Oqtane.Client/Services/PageModuleService.cs | 51 ++++ Oqtane.Client/Services/PageService.cs | 65 +++++ Oqtane.Client/Services/ProfileService.cs | 42 +++ Oqtane.Client/Services/RoleService.cs | 51 ++++ .../Services/SearchResultsService.cs | 7 +- Oqtane.Client/Services/SettingService.cs | 262 +++++++++++++++++ Oqtane.Client/Services/SiteService.cs | 53 ++++ Oqtane.Client/Services/SiteTemplateService.cs | 12 + Oqtane.Client/Services/SqlService.cs | 13 + Oqtane.Client/Services/SyncService.cs | 13 + Oqtane.Client/Services/SystemService.cs | 38 ++- Oqtane.Client/Services/TenantService.cs | 19 ++ Oqtane.Client/Services/ThemeService.cs | 89 +++++- Oqtane.Client/Services/TimeZoneService.cs | 12 + Oqtane.Client/Services/UrlMappingService.cs | 50 ++++ Oqtane.Client/Services/UserRoleService.cs | 66 +++++ Oqtane.Client/Services/UserService.cs | 168 ++++++++++- Oqtane.Client/Services/VisitorService.cs | 22 ++ 70 files changed, 1763 insertions(+), 1996 deletions(-) delete mode 100644 Oqtane.Client/Services/Interfaces/IAliasService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ICookieConsentService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IDatabaseService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IFileService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IFolderService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IInstallationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IJobLogService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IJobService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILanguageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILocalizationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ILogService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IModuleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/INotificationService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IOutputCacheService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPackageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPageModuleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IPageService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IProfileService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IRoleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISearchResultsService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISettingService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISiteService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISqlService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISyncService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ISystemService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ITenantService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IThemeService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/ITimeZoneService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUrlMappingService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUserRoleService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IUserService.cs delete mode 100644 Oqtane.Client/Services/Interfaces/IVisitorService.cs diff --git a/Oqtane.Client/Services/AliasService.cs b/Oqtane.Client/Services/AliasService.cs index 714f1061..0fb0600b 100644 --- a/Oqtane.Client/Services/AliasService.cs +++ b/Oqtane.Client/Services/AliasService.cs @@ -8,6 +8,46 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve and store information. + /// + public interface IAliasService + { + /// + /// Get all aliases in the system + /// + /// + Task> GetAliasesAsync(); + + /// + /// Get a single alias + /// + /// The ID, not to be confused with a ID + /// + Task GetAliasAsync(int aliasId); + + /// + /// Save another in the DB. It must already contain all the information incl. it belongs to. + /// + /// An to add. + /// + Task AddAliasAsync(Alias alias); + + /// + /// Update an in the DB. Make sure the object is correctly filled, as it must update an existing record. + /// + /// The to update. + /// + Task UpdateAliasAsync(Alias alias); + + /// + /// Remove an from the DB. + /// + /// The Alias ID, not to be confused with a Site ID. + /// + Task DeleteAliasAsync(int aliasId); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class AliasService : ServiceBase, IAliasService diff --git a/Oqtane.Client/Services/CookieConsentService.cs b/Oqtane.Client/Services/CookieConsentService.cs index 83c2abc7..29b3a40d 100644 --- a/Oqtane.Client/Services/CookieConsentService.cs +++ b/Oqtane.Client/Services/CookieConsentService.cs @@ -1,13 +1,46 @@ -using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; -using System; using Oqtane.Documentation; using Oqtane.Shared; -using System.Globalization; namespace Oqtane.Services { + /// + /// Service to retrieve cookie consent information. + /// + public interface ICookieConsentService + { + /// + /// Get cookie consent bar actioned status + /// + /// + Task IsActionedAsync(); + + /// + /// Get cookie consent status + /// + /// + Task CanTrackAsync(bool optOut); + + /// + /// create actioned cookie + /// + /// + Task CreateActionedCookieAsync(); + + /// + /// create consent cookie + /// + /// + Task CreateConsentCookieAsync(); + + /// + /// widhdraw consent cookie + /// + /// + Task WithdrawConsentCookieAsync(); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class CookieConsentService : ServiceBase, ICookieConsentService diff --git a/Oqtane.Client/Services/DatabaseService.cs b/Oqtane.Client/Services/DatabaseService.cs index bfa06865..3ca4a1a2 100644 --- a/Oqtane.Client/Services/DatabaseService.cs +++ b/Oqtane.Client/Services/DatabaseService.cs @@ -8,6 +8,18 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve information. + /// + public interface IDatabaseService + { + /// + /// Returns a list of databases + /// + /// + Task> GetDatabasesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class DatabaseService : ServiceBase, IDatabaseService { diff --git a/Oqtane.Client/Services/FileService.cs b/Oqtane.Client/Services/FileService.cs index 9bc563c6..2b45455a 100644 --- a/Oqtane.Client/Services/FileService.cs +++ b/Oqtane.Client/Services/FileService.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -10,6 +9,103 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to get / create / upload / download files. + /// + public interface IFileService + { + /// + /// Get all s in the specified Folder + /// + /// The folder ID + /// + Task> GetFilesAsync(int folderId); + + /// + /// Get all s in the specified folder. + /// + /// + /// The folder path relative to where the files are stored. + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task> GetFilesAsync(string folder); + + /// + /// Get one + /// + /// + /// + Task GetFileAsync(int fileId); + + /// + /// Get a based on the and file name. + /// + /// Reference to the + /// name of the file + /// + /// + Task GetFileAsync(int folderId, string name); + + /// + /// Add / store a record. + /// This does not contain the file contents. + /// + /// + /// + Task AddFileAsync(File file); + + /// + /// Update a record. + /// Use this for rename a file or change some attributes. + /// This does not contain the file contents. + /// + /// + /// + Task UpdateFileAsync(File file); + + /// + /// Delete a + /// + /// + /// + Task DeleteFileAsync(int fileId); + + /// + /// Upload a file from a URL to a + /// + /// + /// + /// + /// + Task UploadFileAsync(string url, int folderId, string name); + + /// + /// Get / download a file (the body). + /// + /// Reference to a + /// The bytes of the file + Task DownloadFileAsync(int fileId); + + /// + /// Retrieve a list of files from a and + /// + /// Reference to the + /// Path of the folder + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task> GetFilesAsync(int siteId, string folderPath); + + /// + /// Unzips the contents of a zip file + /// + /// Reference to the + /// + /// + Task UnzipFileAsync(int fileId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class FileService : ServiceBase, IFileService { diff --git a/Oqtane.Client/Services/FolderService.cs b/Oqtane.Client/Services/FolderService.cs index 2ce045db..9a099777 100644 --- a/Oqtane.Client/Services/FolderService.cs +++ b/Oqtane.Client/Services/FolderService.cs @@ -9,6 +9,58 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to get / create / modify objects. + /// + public interface IFolderService + { + /// + /// Retrieve root folders of a + /// + /// + /// + Task> GetFoldersAsync(int siteId); + + /// + /// Retrieve the information of one + /// + /// + /// + Task GetFolderAsync(int folderId); + + /// + /// Create one Folder using a object. + /// + /// + /// + Task AddFolderAsync(Folder folder); + + /// + /// Update the information about a + /// Use this to rename the folder etc. + /// + /// + /// + Task UpdateFolderAsync(Folder folder); + + /// + /// Delete a + /// + /// Reference to a + /// + Task DeleteFolderAsync(int folderId); + + /// + /// Get a of a based on the path. + /// + /// Reference to the + /// Path of the folder + /// TODO: todoc verify exactly from where the folder path must start + /// + /// + Task GetFolderAsync(int siteId, [NotNull] string folderPath); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class FolderService : ServiceBase, IFolderService { diff --git a/Oqtane.Client/Services/InstallationService.cs b/Oqtane.Client/Services/InstallationService.cs index e0c388c8..28b80c3b 100644 --- a/Oqtane.Client/Services/InstallationService.cs +++ b/Oqtane.Client/Services/InstallationService.cs @@ -10,6 +10,38 @@ using System.Linq; namespace Oqtane.Services { + /// + /// Service to manage (install master database / upgrade version / etc.) the installation + /// + public interface IInstallationService + { + /// + /// Returns a status/message object with the current installation state + /// + /// + Task IsInstalled(); + + /// + /// Starts the installation process + /// + /// connectionString, database type, alias etc. + /// internal status/message object + Task Install(InstallConfig config); + + /// + /// Starts the upgrade process + /// + /// indicates if files should be backed up during upgrade + /// internal status/message object + Task Upgrade(bool backup); + + /// + /// Restarts the installation + /// + /// internal status/message object + Task RestartAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class InstallationService : ServiceBase, IInstallationService { diff --git a/Oqtane.Client/Services/Interfaces/IAliasService.cs b/Oqtane.Client/Services/Interfaces/IAliasService.cs deleted file mode 100644 index 6b002ec7..00000000 --- a/Oqtane.Client/Services/Interfaces/IAliasService.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and store information. - /// - public interface IAliasService - { - /// - /// Get all aliases in the system - /// - /// - Task> GetAliasesAsync(); - - /// - /// Get a single alias - /// - /// The ID, not to be confused with a ID - /// - Task GetAliasAsync(int aliasId); - - /// - /// Save another in the DB. It must already contain all the information incl. it belongs to. - /// - /// An to add. - /// - Task AddAliasAsync(Alias alias); - - /// - /// Update an in the DB. Make sure the object is correctly filled, as it must update an existing record. - /// - /// The to update. - /// - Task UpdateAliasAsync(Alias alias); - - /// - /// Remove an from the DB. - /// - /// The Alias ID, not to be confused with a Site ID. - /// - Task DeleteAliasAsync(int aliasId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs b/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs deleted file mode 100644 index 71580d7e..00000000 --- a/Oqtane.Client/Services/Interfaces/ICookieConsentService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Oqtane.Models; -using System; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve cookie consent information. - /// - public interface ICookieConsentService - { - /// - /// Get cookie consent bar actioned status - /// - /// - Task IsActionedAsync(); - - /// - /// Get cookie consent status - /// - /// - Task CanTrackAsync(bool optOut); - - /// - /// create actioned cookie - /// - /// - Task CreateActionedCookieAsync(); - - /// - /// create consent cookie - /// - /// - Task CreateConsentCookieAsync(); - - /// - /// widhdraw consent cookie - /// - /// - Task WithdrawConsentCookieAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IDatabaseService.cs b/Oqtane.Client/Services/Interfaces/IDatabaseService.cs deleted file mode 100644 index 94ca3f77..00000000 --- a/Oqtane.Client/Services/Interfaces/IDatabaseService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve information. - /// - public interface IDatabaseService - { - /// - /// Returns a list of databases - /// - /// - Task> GetDatabasesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IFileService.cs b/Oqtane.Client/Services/Interfaces/IFileService.cs deleted file mode 100644 index 451d3c4d..00000000 --- a/Oqtane.Client/Services/Interfaces/IFileService.cs +++ /dev/null @@ -1,104 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to get / create / upload / download files. - /// - public interface IFileService - { - /// - /// Get all s in the specified Folder - /// - /// The folder ID - /// - Task> GetFilesAsync(int folderId); - - /// - /// Get all s in the specified folder. - /// - /// - /// The folder path relative to where the files are stored. - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task> GetFilesAsync(string folder); - - /// - /// Get one - /// - /// - /// - Task GetFileAsync(int fileId); - - /// - /// Get a based on the and file name. - /// - /// Reference to the - /// name of the file - /// - /// - Task GetFileAsync(int folderId, string name); - - /// - /// Add / store a record. - /// This does not contain the file contents. - /// - /// - /// - Task AddFileAsync(File file); - - /// - /// Update a record. - /// Use this for rename a file or change some attributes. - /// This does not contain the file contents. - /// - /// - /// - Task UpdateFileAsync(File file); - - /// - /// Delete a - /// - /// - /// - Task DeleteFileAsync(int fileId); - - /// - /// Upload a file from a URL to a - /// - /// - /// - /// - /// - Task UploadFileAsync(string url, int folderId, string name); - - /// - /// Get / download a file (the body). - /// - /// Reference to a - /// The bytes of the file - Task DownloadFileAsync(int fileId); - - /// - /// Retrieve a list of files from a and - /// - /// Reference to the - /// Path of the folder - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task> GetFilesAsync(int siteId, string folderPath); - - /// - /// Unzips the contents of a zip file - /// - /// Reference to the - /// - /// - Task UnzipFileAsync(int fileId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IFolderService.cs b/Oqtane.Client/Services/Interfaces/IFolderService.cs deleted file mode 100644 index 35e96956..00000000 --- a/Oqtane.Client/Services/Interfaces/IFolderService.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to get / create / modify objects. - /// - public interface IFolderService - { - /// - /// Retrieve root folders of a - /// - /// - /// - Task> GetFoldersAsync(int siteId); - - /// - /// Retrieve the information of one - /// - /// - /// - Task GetFolderAsync(int folderId); - - /// - /// Create one Folder using a object. - /// - /// - /// - Task AddFolderAsync(Folder folder); - - /// - /// Update the information about a - /// Use this to rename the folder etc. - /// - /// - /// - Task UpdateFolderAsync(Folder folder); - - /// - /// Delete a - /// - /// Reference to a - /// - Task DeleteFolderAsync(int folderId); - - /// - /// Get a of a based on the path. - /// - /// Reference to the - /// Path of the folder - /// TODO: todoc verify exactly from where the folder path must start - /// - /// - Task GetFolderAsync(int siteId, [NotNull]string folderPath); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IInstallationService.cs b/Oqtane.Client/Services/Interfaces/IInstallationService.cs deleted file mode 100644 index 1e2311ce..00000000 --- a/Oqtane.Client/Services/Interfaces/IInstallationService.cs +++ /dev/null @@ -1,39 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; -using Oqtane.Shared; - -namespace Oqtane.Services -{ - - /// - /// Service to manage (install master database / upgrade version / etc.) the installation - /// - public interface IInstallationService - { - /// - /// Returns a status/message object with the current installation state - /// - /// - Task IsInstalled(); - - /// - /// Starts the installation process - /// - /// connectionString, database type, alias etc. - /// internal status/message object - Task Install(InstallConfig config); - - /// - /// Starts the upgrade process - /// - /// indicates if files should be backed up during upgrade - /// internal status/message object - Task Upgrade(bool backup); - - /// - /// Restarts the installation - /// - /// internal status/message object - Task RestartAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IJobLogService.cs b/Oqtane.Client/Services/Interfaces/IJobLogService.cs deleted file mode 100644 index e6a10a20..00000000 --- a/Oqtane.Client/Services/Interfaces/IJobLogService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to read the job schedule log - /// - public interface IJobLogService - { - /// - /// Return a list of entries - /// - /// - /// - Task> GetJobLogsAsync(int jobId); - - /// - /// Return a entry for the given Id - /// - /// - /// - Task GetJobLogAsync(int jobLogId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IJobService.cs b/Oqtane.Client/Services/Interfaces/IJobService.cs deleted file mode 100644 index 984f4b59..00000000 --- a/Oqtane.Client/Services/Interfaces/IJobService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage jobs () - /// - public interface IJobService - { - /// - /// Returns a list of all jobs - /// - /// - Task> GetJobsAsync(); - - /// - /// Return a specific job - /// - /// - /// - Task GetJobAsync(int jobId); - - /// - /// Adds a new job - /// - /// - /// - Task AddJobAsync(Job job); - - /// - /// Updates an existing job - /// - /// - /// - Task UpdateJobAsync(Job job); - - /// - /// Delete an existing job - /// - /// - /// - Task DeleteJobAsync(int jobId); - - /// - /// Starts the given job - /// - /// - /// - Task StartJobAsync(int jobId); - - /// - /// Stops the given job - /// - /// - /// - Task StopJobAsync(int jobId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILanguageService.cs b/Oqtane.Client/Services/Interfaces/ILanguageService.cs deleted file mode 100644 index bf7aa9a7..00000000 --- a/Oqtane.Client/Services/Interfaces/ILanguageService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Services -{ - - /// - /// Service to manage entries - /// - public interface ILanguageService - { - /// - /// Returns a list of all available languages for the given - /// - /// - /// - Task> GetLanguagesAsync(int siteId); - - /// - /// Returns a list of all available languages for the given and package - /// - /// - /// - /// - Task> GetLanguagesAsync(int siteId, string packageName); - - /// - /// Returns the given language - /// - /// - /// - Task GetLanguageAsync(int languageId); - - /// - /// Adds the given language - /// - /// - /// - Task AddLanguageAsync(Language language); - - /// - /// Edits the given language - /// - /// - /// - Task EditLanguageAsync(Language language); - - /// - /// Deletes the given language - /// - /// - /// - Task DeleteLanguageAsync(int languageId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs b/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs deleted file mode 100644 index a422d432..00000000 --- a/Oqtane.Client/Services/Interfaces/ILocalizationCookieService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to set localization cookie - /// - public interface ILocalizationCookieService - { - /// - /// Set the localization cookie - /// - /// - /// - Task SetLocalizationCookieAsync(string culture); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILocalizationService.cs b/Oqtane.Client/Services/Interfaces/ILocalizationService.cs deleted file mode 100644 index 543f8eba..00000000 --- a/Oqtane.Client/Services/Interfaces/ILocalizationService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using Oqtane.Models; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve localizations () - /// - public interface ILocalizationService - { - /// - /// Returns a collection of supported cultures - /// - /// - Task> GetCulturesAsync(bool installed); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ILogService.cs b/Oqtane.Client/Services/Interfaces/ILogService.cs deleted file mode 100644 index 28fe51b2..00000000 --- a/Oqtane.Client/Services/Interfaces/ILogService.cs +++ /dev/null @@ -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 -{ - /// - /// Service to retrieve and store entries - /// - public interface ILogService - { - /// - /// Returns a list of log entires for the given params - /// - /// - /// - /// - /// - /// - Task> GetLogsAsync(int siteId, string level, string function, int rows); - - /// - /// Returns a specific log entry for the given id - /// - /// - /// - Task GetLogAsync(int logId); - - /// - /// Clear the entire logs of the given site. - /// - /// - /// - Task DeleteLogsAsync(int siteId); - - /// - /// Creates a new log entry - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); - - /// - /// Creates a new log entry - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - 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); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs b/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs deleted file mode 100644 index 707728eb..00000000 --- a/Oqtane.Client/Services/Interfaces/IModuleDefinitionService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage a - /// - public interface IModuleDefinitionService - { - /// - /// Returns a list of module definitions for the given site - /// - /// - /// - Task> GetModuleDefinitionsAsync(int siteId); - - /// - /// Returns a specific module definition - /// - /// - /// - /// - Task GetModuleDefinitionAsync(int moduleDefinitionId, int siteId); - - /// - /// Updates a existing module definition - /// - /// - /// - Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition); - - /// - /// Deletes a module definition - /// - /// - /// - /// - Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId); - - /// - /// Creates a new module definition - /// - /// - /// - Task CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition); - - /// - /// Returns a list of module definition templates - /// - /// - Task> GetModuleDefinitionTemplatesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IModuleService.cs b/Oqtane.Client/Services/Interfaces/IModuleService.cs deleted file mode 100644 index ea6beab3..00000000 --- a/Oqtane.Client/Services/Interfaces/IModuleService.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and store modules () - /// - public interface IModuleService - { - /// - /// Returns a list of modules for the given site - /// - /// - /// - Task> GetModulesAsync(int siteId); - - /// - /// Returns a specific module - /// - /// - /// - Task GetModuleAsync(int moduleId); - - /// - /// Adds a new module - /// - /// - /// - Task AddModuleAsync(Module module); - - /// - /// Updates an existing module - /// - /// - /// - Task UpdateModuleAsync(Module module); - - /// - /// Deletes a module - /// - /// - /// - Task DeleteModuleAsync(int moduleId); - - /// - /// Imports a module - /// - /// - /// module in JSON format - /// - Task ImportModuleAsync(int moduleId, int pageId, string content); - - /// - /// Exports a given module - /// - /// - /// - /// module content in JSON format - Task ExportModuleAsync(int moduleId, int pageId); - - /// - /// Exports a given module - /// - /// - /// - /// - /// - /// file id - Task ExportModuleAsync(int moduleId, int pageId, int folderId, string filename); - } -} diff --git a/Oqtane.Client/Services/Interfaces/INotificationService.cs b/Oqtane.Client/Services/Interfaces/INotificationService.cs deleted file mode 100644 index 760f4a36..00000000 --- a/Oqtane.Client/Services/Interfaces/INotificationService.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve notifications () - /// - public interface INotificationService - { - /// - /// Return a list of notifications - /// - /// - /// - /// - /// - Task> GetNotificationsAsync(int siteId, string direction, int userId); - - /// - /// - /// - /// - /// - /// - /// - /// - /// - Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead); - - /// - /// - /// - /// - /// - /// - /// - /// - Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead); - - /// - /// Returns a specific notifications - /// - /// - /// - Task GetNotificationAsync(int notificationId); - - /// - /// Creates a new notification - /// - /// - /// - Task AddNotificationAsync(Notification notification); - - /// - /// Updates a existing notification - /// - /// - /// - Task UpdateNotificationAsync(Notification notification); - - /// - /// Deletes a notification - /// - /// - /// - Task DeleteNotificationAsync(int notificationId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs b/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs deleted file mode 100644 index 08826146..00000000 --- a/Oqtane.Client/Services/Interfaces/IOutputCacheService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage cache - /// - public interface IOutputCacheService - { - /// - /// Evicts the output cache for a specific tag - /// - /// - /// - Task EvictByTag(string tag); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPackageService.cs b/Oqtane.Client/Services/Interfaces/IPackageService.cs deleted file mode 100644 index ff930ccc..00000000 --- a/Oqtane.Client/Services/Interfaces/IPackageService.cs +++ /dev/null @@ -1,70 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - - /// - /// Service to manage packages () - /// - public interface IPackageService - { - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - Task> GetPackagesAsync(string type); - - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - /// - /// - /// - Task> GetPackagesAsync(string type, string search, string price, string package); - - /// - /// Returns a list of packages matching the given parameters - /// - /// - /// - /// - /// - /// - /// - Task> GetPackagesAsync(string type, string search, string price, string package, string sort); - - /// - /// Returns a list of packages based on installationid - /// - /// - Task> GetPackageUpdatesAsync(string type); - - /// - /// Returns a specific package - /// - /// - /// - /// - Task GetPackageAsync(string packageId, string version, bool download); - - /// - /// Downloads a specific package as .nupkg file - /// - /// - /// - /// - /// - Task DownloadPackageAsync(string packageId, string version); - - /// - /// Installs all packages located in //TODO: 2dm where? - /// - /// - Task InstallPackagesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPageModuleService.cs b/Oqtane.Client/Services/Interfaces/IPageModuleService.cs deleted file mode 100644 index 77bc5d3b..00000000 --- a/Oqtane.Client/Services/Interfaces/IPageModuleService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve a - /// - public interface IPageModuleService - { - - /// - /// Returns a specific page module - /// - /// - /// - Task GetPageModuleAsync(int pageModuleId); - - /// - /// Return a specific page module - /// - /// - /// - /// - Task GetPageModuleAsync(int pageId, int moduleId); - - /// - /// Creates a new page module - /// - /// - /// - Task AddPageModuleAsync(PageModule pageModule); - - /// - /// Updates a existing page module - /// - /// - /// - Task UpdatePageModuleAsync(PageModule pageModule); - - /// - /// Updates order of all page modules in the given pane - /// - /// - /// - /// - Task UpdatePageModuleOrderAsync(int pageId, string pane); - - /// - /// Deletes a page module - /// - /// - /// - Task DeletePageModuleAsync(int pageModuleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IPageService.cs b/Oqtane.Client/Services/Interfaces/IPageService.cs deleted file mode 100644 index d4002c3f..00000000 --- a/Oqtane.Client/Services/Interfaces/IPageService.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Services to store and retrieve a - /// - public interface IPageService - { - /// - /// Returns a list of pages - /// - /// - /// - Task> GetPagesAsync(int siteId); - - /// - /// Returns a specific page - /// - /// - /// - Task GetPageAsync(int pageId); - - /// - /// Returns a specific page by its defined path - /// - /// - /// - /// - Task GetPageAsync(string path, int siteId); - - /// - /// Adds a new page - /// - /// - /// - Task AddPageAsync(Page page); - - /// - /// Adds a new page - /// - /// - /// - Task AddPageAsync(int pageId, int userId); - - /// - /// Updates a existing page - /// - /// - /// - Task UpdatePageAsync(Page page); - - /// - /// Updates order of all page modules in the given parent - /// - /// - /// - /// - /// - Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId); - - /// - /// Deletes a page - /// - /// - /// - Task DeletePageAsync(int pageId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IProfileService.cs b/Oqtane.Client/Services/Interfaces/IProfileService.cs deleted file mode 100644 index 72c2506c..00000000 --- a/Oqtane.Client/Services/Interfaces/IProfileService.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve entries - /// - public interface IProfileService - { - - /// - /// Returns a list of profile entries - /// - /// - /// - Task> GetProfilesAsync(int siteId); - - /// - /// Returns a specific profile entry - /// - /// - /// - Task GetProfileAsync(int profileId); - - /// - /// Creates a new profile entry - /// - /// - /// - Task AddProfileAsync(Profile profile); - - /// - /// Updates an existing profile entry - /// - /// - /// - Task UpdateProfileAsync(Profile profile); - - /// - /// Deletes a profile entry - /// - /// - /// - Task DeleteProfileAsync(int profileId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IRoleService.cs b/Oqtane.Client/Services/Interfaces/IRoleService.cs deleted file mode 100644 index 65d91023..00000000 --- a/Oqtane.Client/Services/Interfaces/IRoleService.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IRoleService - { - /// - /// Get all s of this . - /// - /// Will exclude global roles which are for all sites. To get those as well, use the overload - /// - /// ID-reference of a - /// - Task> GetRolesAsync(int siteId); - - /// - /// Get roles of the and optionally include global Roles. - /// - /// ID-reference to a - /// True if it should also include global roles. False will return the same data as just calling - /// - Task> GetRolesAsync(int siteId, bool includeGlobalRoles); - - /// - /// Get one specific - /// - /// ID-reference of a - /// - Task GetRoleAsync(int roleId); - - /// - /// Add / save a new to the database. - /// - /// - /// - Task AddRoleAsync(Role role); - - /// - /// Update a in the database. - /// - /// - /// - Task UpdateRoleAsync(Role role); - - /// - /// Delete / mark-as-deleted a in the database. - /// - /// ID-reference of a - /// - Task DeleteRoleAsync(int roleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs b/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs deleted file mode 100644 index 49eb02ec..00000000 --- a/Oqtane.Client/Services/Interfaces/ISearchResultsService.cs +++ /dev/null @@ -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 GetSearchResultsAsync(SearchQuery searchQuery); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISettingService.cs b/Oqtane.Client/Services/Interfaces/ISettingService.cs deleted file mode 100644 index 2f4c4b94..00000000 --- a/Oqtane.Client/Services/Interfaces/ISettingService.cs +++ /dev/null @@ -1,269 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s - /// - public interface ISettingService - { - /// - /// Returns a key-value dictionary of all tenant settings - /// - /// - Task> GetTenantSettingsAsync(); - - /// - /// Updates a tenant setting - /// - /// - /// - Task UpdateTenantSettingsAsync(Dictionary tenantSettings); - - /// - /// Returns a key-value dictionary of all site settings for the given site - /// - /// - /// - Task> GetSiteSettingsAsync(int siteId); - - /// - /// Updates a site setting - /// - /// - /// - /// - Task UpdateSiteSettingsAsync(Dictionary siteSettings, int siteId); - - /// - /// Clears site option cache - /// - /// - Task ClearSiteSettingsCacheAsync(); - - /// - /// Returns a key-value dictionary of all page settings for the given page - /// - /// - /// - Task> GetPageSettingsAsync(int pageId); - - /// - /// Updates a page setting - /// - /// - /// - /// - Task UpdatePageSettingsAsync(Dictionary pageSettings, int pageId); - - /// - /// Returns a key-value dictionary of all page module settings for the given page module - /// - /// - /// - Task> GetPageModuleSettingsAsync(int pageModuleId); - - /// - /// Updates a page module setting - /// - /// - /// - /// - Task UpdatePageModuleSettingsAsync(Dictionary pageModuleSettings, int pageModuleId); - - /// - /// Returns a key-value dictionary of all module settings for the given module - /// - /// - /// - Task> GetModuleSettingsAsync(int moduleId); - - /// - /// Updates a module setting - /// - /// - /// - /// - Task UpdateModuleSettingsAsync(Dictionary moduleSettings, int moduleId); - - /// - /// Returns a key-value dictionary of all module settings for the given module - /// - /// - /// - Task> GetModuleDefinitionSettingsAsync(int moduleDefinitionId); - - /// - /// Updates a module setting - /// - /// - /// - /// - Task UpdateModuleDefinitionSettingsAsync(Dictionary moduleDefinitionSettings, int moduleDefinitionId); - - /// - /// Returns a key-value dictionary of all user settings for the given user - /// - /// - /// - Task> GetUserSettingsAsync(int userId); - - /// - /// Updates a user setting - /// - /// - /// - /// - Task UpdateUserSettingsAsync(Dictionary userSettings, int userId); - - /// - /// Returns a key-value dictionary of all folder settings for the given folder - /// - /// - /// - Task> GetFolderSettingsAsync(int folderId); - - - /// - /// Updates a folder setting - /// - /// - /// - /// - Task UpdateFolderSettingsAsync(Dictionary folderSettings, int folderId); - - /// - /// Returns a key-value dictionary of all tenant settings - /// - /// - Task> GetHostSettingsAsync(); - - /// - /// Updates a host setting - /// - /// - /// - Task UpdateHostSettingsAsync(Dictionary hostSettings); - - /// - /// Returns a key-value dictionary of all settings for the given visitor - /// - /// - /// - Task> GetVisitorSettingsAsync(int visitorId); - - /// - /// Updates a visitor setting - /// - /// - /// - /// - Task UpdateVisitorSettingsAsync(Dictionary visitorSettings, int visitorId); - - /// - /// Returns a key-value dictionary of all settings for the given entityName - /// - /// - /// - Task> GetSettingsAsync(string entityName, int entityId); - - /// - /// Updates settings for a given entityName and Id - /// - /// - /// - /// - /// - Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId); - - /// - /// Updates setting for a given entityName and Id - /// - /// - /// - /// - /// - /// - /// - Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate); - - /// - /// Returns a specific setting - /// - /// - /// - /// - /// - Task DeleteSettingAsync(string entityName, int entityId, string settingName); - - /// - /// Returns a specific setting - /// - /// - /// - /// - /// - Task> GetSettingsAsync(string entityName, int entityId, string settingName); - - /// - /// Returns a specific setting - /// - /// - /// - Task GetSettingAsync(string entityName, int settingId); - - /// - /// Creates a new setting - /// - /// - /// - Task AddSettingAsync(Setting setting); - - /// - /// Updates a existing setting - /// - /// - /// - Task UpdateSettingAsync(Setting setting); - - /// - /// Deletes a setting - /// - /// - /// - Task DeleteSettingAsync(string entityName, int settingId); - - /// - /// Gets the value of the given settingName (key) from the given key-value dictionary - /// - /// - /// - /// - /// - string GetSetting(Dictionary settings, string settingName, string defaultValue); - - /// - /// Sets the value of the given settingName (key) in the given key-value dictionary - /// - /// - /// - /// - /// - Dictionary SetSetting(Dictionary settings, string settingName, string settingValue); - - Dictionary SetSetting(Dictionary settings, string settingName, string settingValue, bool isPrivate); - - Dictionary MergeSettings(Dictionary baseSettings, Dictionary overwriteSettings); - - - [Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)] - Task GetSettingAsync(int settingId); - - [Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)] - Task DeleteSettingAsync(int settingId); - - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISiteService.cs b/Oqtane.Client/Services/Interfaces/ISiteService.cs deleted file mode 100644 index 8095a743..00000000 --- a/Oqtane.Client/Services/Interfaces/ISiteService.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Oqtane.Documentation; -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to store and retrieve entries - /// - public interface ISiteService - { - - /// - /// Returns a list of sites - /// - /// - Task> GetSitesAsync(); - - /// - /// Returns a specific site - /// - /// - /// - Task GetSiteAsync(int siteId); - - /// - /// Creates a new site - /// - /// - /// - Task AddSiteAsync(Site site); - - /// - /// Updates an existing site - /// - /// - /// - Task UpdateSiteAsync(Site site); - - /// - /// Deletes a site - /// - /// - /// - Task DeleteSiteAsync(int siteId); - - /// - /// Returns a list of modules - /// - /// - /// - /// - Task> GetModulesAsync(int siteId, int pageId); - - [PrivateApi] - [Obsolete("This method is deprecated.", false)] - void SetAlias(Alias alias); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs b/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs deleted file mode 100644 index 48444277..00000000 --- a/Oqtane.Client/Services/Interfaces/ISiteTemplateService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve entries - /// - public interface ISiteTemplateService - { - /// - /// Returns a list of site templates - /// - /// - Task> GetSiteTemplatesAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISqlService.cs b/Oqtane.Client/Services/Interfaces/ISqlService.cs deleted file mode 100644 index a6b0ad86..00000000 --- a/Oqtane.Client/Services/Interfaces/ISqlService.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Oqtane.Models; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to execute a against the backend database - /// - public interface ISqlService - { - /// - /// Executes a sql query and returns its result - /// - /// - /// - Task ExecuteQueryAsync(SqlQuery sqlquery); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISyncService.cs b/Oqtane.Client/Services/Interfaces/ISyncService.cs deleted file mode 100644 index 12af4f2e..00000000 --- a/Oqtane.Client/Services/Interfaces/ISyncService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Oqtane.Models; -using System; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve information. - /// - public interface ISyncService - { - /// - /// Get sync events - /// - /// - /// - Task GetSyncEventsAsync(DateTime lastSyncDate); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ISystemService.cs b/Oqtane.Client/Services/Interfaces/ISystemService.cs deleted file mode 100644 index 3f4e194d..00000000 --- a/Oqtane.Client/Services/Interfaces/ISystemService.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve and update system information. - /// - public interface ISystemService - { - /// - /// returns a key-value dictionary with the current system configuration information - /// - /// - Task> GetSystemInfoAsync(); - - /// - /// returns a key-value dictionary with the current system information - "environment" or "configuration" - /// - /// - Task> GetSystemInfoAsync(string type); - - /// - /// returns a config value - /// - /// - Task GetSystemInfoAsync(string settingKey, object defaultValue); - - /// - /// Updates system information - /// - /// - /// - Task UpdateSystemInfoAsync(Dictionary settings); - - /// - /// returns a key-value dictionary with default system icons - /// - /// - Task> GetIconsAsync(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ITenantService.cs b/Oqtane.Client/Services/Interfaces/ITenantService.cs deleted file mode 100644 index cbb4e526..00000000 --- a/Oqtane.Client/Services/Interfaces/ITenantService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on the Oqtane installation. - /// - public interface ITenantService - { - /// - /// Get all s - /// - /// - Task> GetTenantsAsync(); - - /// - /// Get one specific - /// - /// ID-reference of the - /// - Task GetTenantAsync(int tenantId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IThemeService.cs b/Oqtane.Client/Services/Interfaces/IThemeService.cs deleted file mode 100644 index 62617c55..00000000 --- a/Oqtane.Client/Services/Interfaces/IThemeService.cs +++ /dev/null @@ -1,94 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage entries - /// - public interface IThemeService - { - - /// - /// Returns a list of available themes - /// - /// - Task> GetThemesAsync(); - - /// - /// Returns a specific theme - /// - /// - /// - /// - Task GetThemeAsync(int themeId, int siteId); - - /// - /// Returns a theme s containing a specific theme control type - /// - /// - /// - /// - Theme GetTheme(List themes, string themeControlType); - - /// - /// Returns a list of s from the given themes - /// - /// - /// - List GetThemeControls(List themes); - - /// - /// Returns a list of s for a theme containing a specific theme control type - /// - /// - /// - /// - List GetThemeControls(List themes, string themeControlType); - - /// - /// Returns a list of containers () for a theme containing a specific theme control type - /// - /// - /// - /// - List GetContainerControls(List themes, string themeControlType); - - /// - /// Updates a existing theme - /// - /// - /// - Task UpdateThemeAsync(Theme theme); - - /// - /// Deletes a theme - /// - /// - /// - Task DeleteThemeAsync(string themeName); - - /// - /// Creates a new theme - /// - /// - /// - Task CreateThemeAsync(Theme theme); - - /// - /// Returns a list of theme templates () - /// - /// - Task> GetThemeTemplatesAsync(); - - - /// - /// Returns a list of layouts () from the given themes with a matching theme name - /// - /// - /// - /// - List GetLayoutControls(List themes, string themeName); - } -} diff --git a/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs b/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs deleted file mode 100644 index de134838..00000000 --- a/Oqtane.Client/Services/Interfaces/ITimeZoneService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Oqtane.Models; - -namespace Oqtane.Services -{ - /// - /// Service to retrieve entries - /// - public interface ITimeZoneService - { - /// - /// Get the list of time zones - /// - /// - List GetTimeZones(); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs b/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs deleted file mode 100644 index 6da0bf9d..00000000 --- a/Oqtane.Client/Services/Interfaces/IUrlMappingService.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IUrlMappingService - { - /// - /// Get all s of this . - /// - /// - /// ID-reference of a - /// - Task> GetUrlMappingsAsync(int siteId, bool isMapped); - - /// - /// Get one specific - /// - /// ID-reference of a - /// - Task GetUrlMappingAsync(int urlMappingId); - - /// - /// Get one specific - /// - /// ID-reference of a - /// A url - /// - Task GetUrlMappingAsync(int siteId, string url); - - /// - /// Add / save a new to the database. - /// - /// - /// - Task AddUrlMappingAsync(UrlMapping urlMapping); - - /// - /// Update a in the database. - /// - /// - /// - Task UpdateUrlMappingAsync(UrlMapping urlMapping); - - /// - /// Delete a in the database. - /// - /// ID-reference of a - /// - Task DeleteUrlMappingAsync(int urlMappingId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUserRoleService.cs b/Oqtane.Client/Services/Interfaces/IUserRoleService.cs deleted file mode 100644 index 802a0d0e..00000000 --- a/Oqtane.Client/Services/Interfaces/IUserRoleService.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Manage s assigned to a specific - /// - public interface IUserRoleService - { - /// - /// Get all s on a - /// - /// ID-reference to a - /// - Task> GetUserRolesAsync(int siteId); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// ID-reference to a - /// - Task> GetUserRolesAsync(int siteId, int userId); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// Name reference a - /// - Task> GetUserRolesAsync(int siteId, string roleName); - - /// - /// Get all s on a - /// - /// ID-reference to a - /// ID-reference to a - /// Name reference a - /// - Task> GetUserRolesAsync(int siteId, int userId, string roleName); - - /// - /// Get one specific - /// - /// ID-reference to a - /// - Task GetUserRoleAsync(int userRoleId); - - /// - /// Save a new - /// - /// - /// - Task AddUserRoleAsync(UserRole userRole); - - /// - /// Update a in the database - /// - /// - /// - Task UpdateUserRoleAsync(UserRole userRole); - - /// - /// Delete a in the database - /// - /// - /// - Task DeleteUserRoleAsync(int userRoleId); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IUserService.cs b/Oqtane.Client/Services/Interfaces/IUserService.cs deleted file mode 100644 index b32a66f0..00000000 --- a/Oqtane.Client/Services/Interfaces/IUserService.cs +++ /dev/null @@ -1,171 +0,0 @@ -using Oqtane.Models; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Manage (get / update) user information - /// - public interface IUserService - { - /// - /// Get a of a specific site - /// - /// ID of a - /// ID of a - /// - Task GetUserAsync(int userId, int siteId); - - /// - /// Get a of a specific site - /// - /// Username / login of a - /// ID of a - /// - Task GetUserAsync(string username, int siteId); - - /// - /// Get a of a specific site - /// - /// Username / login of a - /// email address of a - /// ID of a - /// - Task GetUserAsync(string username, string email, int siteId); - - /// - /// Save a user to the Database. - /// The object contains all the information incl. what it belongs to. - /// - /// - /// - Task AddUserAsync(User user); - - /// - /// Update an existing user in the database. - /// - /// - /// - Task UpdateUserAsync(User user); - - /// - /// Delete / remove a user in the database - /// - /// ID-reference to the - /// ID-reference to the - /// - Task DeleteUserAsync(int userId, int siteId); - - /// - /// Will login the specified . - /// - /// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled. - /// - /// A object which should have at least the and set. - /// Determines if the login cookie should be set (only relevant for Hybrid scenarios) - /// Determines if the login cookie should be persisted for a long time. - /// - Task LoginUserAsync(User user, bool setCookie, bool isPersistent); - - /// - /// Logout a - /// - /// - /// - Task LogoutUserAsync(User user); - - /// - /// Logout a - /// - /// - /// - Task LogoutUserEverywhereAsync(User user); - - /// - /// Update e-mail verification status of a user. - /// - /// The we're verifying - /// A Hash value in the URL which verifies this user got the e-mail (containing this token) - /// - Task VerifyEmailAsync(User user, string token); - - /// - /// Trigger a forgot-password e-mail for this . - /// - /// - /// - Task ForgotPasswordAsync(User user); - - /// - /// Reset the password of this - /// - /// - /// - /// - Task ResetPasswordAsync(User user, string token); - - /// - /// Verify the two factor verification code - /// - /// - /// - /// - Task VerifyTwoFactorAsync(User user, string token); - - /// - /// Validate identity user info. - /// - /// - /// - /// - /// - Task ValidateUserAsync(string username, string email, string password); - - /// - /// Validate a users password against the password policy - /// - /// - /// - Task ValidatePasswordAsync(string password); - - /// - /// Get token for current user - /// - /// - Task GetTokenAsync(); - - /// - /// Get personal access token for current user (administrators only) - /// - /// - Task GetPersonalAccessTokenAsync(); - - /// - /// Link an external login with a local user account - /// - /// The we're verifying - /// A Hash value in the URL which verifies this user got the e-mail (containing this token) - /// External Login provider type - /// External Login provider key - /// External Login provider display name - /// - Task LinkUserAsync(User user, string token, string type, string key, string name); - - /// - /// Get password requirements for site - /// - /// ID of a - /// - Task GetPasswordRequirementsAsync(int siteId); - - /// - /// Bulk import of users - /// - /// ID of a - /// ID of a - /// Indicates if new users should be notified by email - /// - Task> ImportUsersAsync(int siteId, int fileId, bool notify); - } -} diff --git a/Oqtane.Client/Services/Interfaces/IVisitorService.cs b/Oqtane.Client/Services/Interfaces/IVisitorService.cs deleted file mode 100644 index 3f067144..00000000 --- a/Oqtane.Client/Services/Interfaces/IVisitorService.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Oqtane.Models; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Oqtane.Services -{ - /// - /// Service to manage s on a - /// - public interface IVisitorService - { - /// - /// Get all s of this . - /// - /// - /// ID-reference of a - /// - Task> GetVisitorsAsync(int siteId, DateTime fromDate); - - /// - /// Get a specific of this . - /// - /// - /// ID-reference of a - /// - Task GetVisitorAsync(int visitorId); - } -} diff --git a/Oqtane.Client/Services/JobLogService.cs b/Oqtane.Client/Services/JobLogService.cs index 0d1d3359..b0392059 100644 --- a/Oqtane.Client/Services/JobLogService.cs +++ b/Oqtane.Client/Services/JobLogService.cs @@ -1,13 +1,32 @@ using Oqtane.Models; using System.Threading.Tasks; using System.Net.Http; -using System.Linq; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to read the job schedule log + /// + public interface IJobLogService + { + /// + /// Return a list of entries + /// + /// + /// + Task> GetJobLogsAsync(int jobId); + + /// + /// Return a entry for the given Id + /// + /// + /// + Task GetJobLogAsync(int jobLogId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class JobLogService : ServiceBase, IJobLogService { diff --git a/Oqtane.Client/Services/JobService.cs b/Oqtane.Client/Services/JobService.cs index edb43485..420e5bd8 100644 --- a/Oqtane.Client/Services/JobService.cs +++ b/Oqtane.Client/Services/JobService.cs @@ -8,6 +8,60 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage jobs () + /// + public interface IJobService + { + /// + /// Returns a list of all jobs + /// + /// + Task> GetJobsAsync(); + + /// + /// Return a specific job + /// + /// + /// + Task GetJobAsync(int jobId); + + /// + /// Adds a new job + /// + /// + /// + Task AddJobAsync(Job job); + + /// + /// Updates an existing job + /// + /// + /// + Task UpdateJobAsync(Job job); + + /// + /// Delete an existing job + /// + /// + /// + Task DeleteJobAsync(int jobId); + + /// + /// Starts the given job + /// + /// + /// + Task StartJobAsync(int jobId); + + /// + /// Stops the given job + /// + /// + /// + Task StopJobAsync(int jobId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class JobService : ServiceBase, IJobService { diff --git a/Oqtane.Client/Services/LanguageService.cs b/Oqtane.Client/Services/LanguageService.cs index 7e95e952..c42f0863 100644 --- a/Oqtane.Client/Services/LanguageService.cs +++ b/Oqtane.Client/Services/LanguageService.cs @@ -7,6 +7,55 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage entries + /// + public interface ILanguageService + { + /// + /// Returns a list of all available languages for the given + /// + /// + /// + Task> GetLanguagesAsync(int siteId); + + /// + /// Returns a list of all available languages for the given and package + /// + /// + /// + /// + Task> GetLanguagesAsync(int siteId, string packageName); + + /// + /// Returns the given language + /// + /// + /// + Task GetLanguageAsync(int languageId); + + /// + /// Adds the given language + /// + /// + /// + Task AddLanguageAsync(Language language); + + /// + /// Edits the given language + /// + /// + /// + Task EditLanguageAsync(Language language); + + /// + /// Deletes the given language + /// + /// + /// + Task DeleteLanguageAsync(int languageId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LanguageService : ServiceBase, ILanguageService { diff --git a/Oqtane.Client/Services/LocalizationCookieService.cs b/Oqtane.Client/Services/LocalizationCookieService.cs index 330607e6..6ebbdc76 100644 --- a/Oqtane.Client/Services/LocalizationCookieService.cs +++ b/Oqtane.Client/Services/LocalizationCookieService.cs @@ -5,6 +5,19 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to set localization cookie + /// + public interface ILocalizationCookieService + { + /// + /// Set the localization cookie + /// + /// + /// + Task SetLocalizationCookieAsync(string culture); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LocalizationCookieService : ServiceBase, ILocalizationCookieService { diff --git a/Oqtane.Client/Services/LocalizationService.cs b/Oqtane.Client/Services/LocalizationService.cs index 880624b7..ee537d60 100644 --- a/Oqtane.Client/Services/LocalizationService.cs +++ b/Oqtane.Client/Services/LocalizationService.cs @@ -7,6 +7,18 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve localizations () + /// + public interface ILocalizationService + { + /// + /// Returns a collection of supported cultures + /// + /// + Task> GetCulturesAsync(bool installed); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class LocalizationService : ServiceBase, ILocalizationService { diff --git a/Oqtane.Client/Services/LogService.cs b/Oqtane.Client/Services/LogService.cs index 177b3682..938836c3 100644 --- a/Oqtane.Client/Services/LogService.cs +++ b/Oqtane.Client/Services/LogService.cs @@ -11,6 +11,69 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to retrieve and store entries + /// + public interface ILogService + { + /// + /// Returns a list of log entires for the given params + /// + /// + /// + /// + /// + /// + Task> GetLogsAsync(int siteId, string level, string function, int rows); + + /// + /// Returns a specific log entry for the given id + /// + /// + /// + Task GetLogAsync(int logId); + + /// + /// Clear the entire logs of the given site. + /// + /// + /// + Task DeleteLogsAsync(int siteId); + + /// + /// Creates a new log entry + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task Log(int? pageId, int? moduleId, int? userId, string category, string feature, LogFunction function, LogLevel level, Exception exception, string message, params object[] args); + + /// + /// Creates a new log entry + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + 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")] public class LogService : ServiceBase, ILogService { diff --git a/Oqtane.Client/Services/ModuleDefinitionService.cs b/Oqtane.Client/Services/ModuleDefinitionService.cs index 932bef8f..f29287e6 100644 --- a/Oqtane.Client/Services/ModuleDefinitionService.cs +++ b/Oqtane.Client/Services/ModuleDefinitionService.cs @@ -8,6 +8,55 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage a + /// + public interface IModuleDefinitionService + { + /// + /// Returns a list of module definitions for the given site + /// + /// + /// + Task> GetModuleDefinitionsAsync(int siteId); + + /// + /// Returns a specific module definition + /// + /// + /// + /// + Task GetModuleDefinitionAsync(int moduleDefinitionId, int siteId); + + /// + /// Updates a existing module definition + /// + /// + /// + Task UpdateModuleDefinitionAsync(ModuleDefinition moduleDefinition); + + /// + /// Deletes a module definition + /// + /// + /// + /// + Task DeleteModuleDefinitionAsync(int moduleDefinitionId, int siteId); + + /// + /// Creates a new module definition + /// + /// + /// + Task CreateModuleDefinitionAsync(ModuleDefinition moduleDefinition); + + /// + /// Returns a list of module definition templates + /// + /// + Task> GetModuleDefinitionTemplatesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ModuleDefinitionService : ServiceBase, IModuleDefinitionService { diff --git a/Oqtane.Client/Services/ModuleService.cs b/Oqtane.Client/Services/ModuleService.cs index ac093bed..0654d065 100644 --- a/Oqtane.Client/Services/ModuleService.cs +++ b/Oqtane.Client/Services/ModuleService.cs @@ -9,6 +9,73 @@ using Oqtane.Modules.Controls; namespace Oqtane.Services { + /// + /// Service to retrieve and store modules () + /// + public interface IModuleService + { + /// + /// Returns a list of modules for the given site + /// + /// + /// + Task> GetModulesAsync(int siteId); + + /// + /// Returns a specific module + /// + /// + /// + Task GetModuleAsync(int moduleId); + + /// + /// Adds a new module + /// + /// + /// + Task AddModuleAsync(Module module); + + /// + /// Updates an existing module + /// + /// + /// + Task UpdateModuleAsync(Module module); + + /// + /// Deletes a module + /// + /// + /// + Task DeleteModuleAsync(int moduleId); + + /// + /// Imports a module + /// + /// + /// module in JSON format + /// + Task ImportModuleAsync(int moduleId, int pageId, string content); + + /// + /// Exports a given module + /// + /// + /// + /// module content in JSON format + Task ExportModuleAsync(int moduleId, int pageId); + + /// + /// Exports a given module + /// + /// + /// + /// + /// + /// file id + Task ExportModuleAsync(int moduleId, int pageId, int folderId, string filename); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ModuleService : ServiceBase, IModuleService { diff --git a/Oqtane.Client/Services/NotificationService.cs b/Oqtane.Client/Services/NotificationService.cs index f6fd1585..86992e42 100644 --- a/Oqtane.Client/Services/NotificationService.cs +++ b/Oqtane.Client/Services/NotificationService.cs @@ -8,6 +8,70 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to store and retrieve notifications () + /// + public interface INotificationService + { + /// + /// Return a list of notifications + /// + /// + /// + /// + /// + Task> GetNotificationsAsync(int siteId, string direction, int userId); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task> GetNotificationsAsync(int siteId, string direction, int userId, int count, bool isRead); + + /// + /// + /// + /// + /// + /// + /// + /// + Task GetNotificationCountAsync(int siteId, string direction, int userId, bool isRead); + + /// + /// Returns a specific notifications + /// + /// + /// + Task GetNotificationAsync(int notificationId); + + /// + /// Creates a new notification + /// + /// + /// + Task AddNotificationAsync(Notification notification); + + /// + /// Updates a existing notification + /// + /// + /// + Task UpdateNotificationAsync(Notification notification); + + /// + /// Deletes a notification + /// + /// + /// + Task DeleteNotificationAsync(int notificationId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class NotificationService : ServiceBase, INotificationService { diff --git a/Oqtane.Client/Services/OutputCacheService.cs b/Oqtane.Client/Services/OutputCacheService.cs index 40b43752..6e441a8f 100644 --- a/Oqtane.Client/Services/OutputCacheService.cs +++ b/Oqtane.Client/Services/OutputCacheService.cs @@ -1,12 +1,23 @@ using System.Net.Http; -using System.Threading; using System.Threading.Tasks; - using Oqtane.Documentation; using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage cache + /// + public interface IOutputCacheService + { + /// + /// Evicts the output cache for a specific tag + /// + /// + /// + Task EvictByTag(string tag); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class OutputCacheService : ServiceBase, IOutputCacheService diff --git a/Oqtane.Client/Services/PackageService.cs b/Oqtane.Client/Services/PackageService.cs index 3e2ad61c..cc1b13a6 100644 --- a/Oqtane.Client/Services/PackageService.cs +++ b/Oqtane.Client/Services/PackageService.cs @@ -2,13 +2,75 @@ using Oqtane.Models; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; -using System.Linq; using Oqtane.Documentation; using Oqtane.Shared; using System.Net; namespace Oqtane.Services { + /// + /// Service to manage packages () + /// + public interface IPackageService + { + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + Task> GetPackagesAsync(string type); + + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + /// + /// + /// + Task> GetPackagesAsync(string type, string search, string price, string package); + + /// + /// Returns a list of packages matching the given parameters + /// + /// + /// + /// + /// + /// + /// + Task> GetPackagesAsync(string type, string search, string price, string package, string sort); + + /// + /// Returns a list of packages based on installationid + /// + /// + Task> GetPackageUpdatesAsync(string type); + + /// + /// Returns a specific package + /// + /// + /// + /// + Task GetPackageAsync(string packageId, string version, bool download); + + /// + /// Downloads a specific package as .nupkg file + /// + /// + /// + /// + /// + Task DownloadPackageAsync(string packageId, string version); + + /// + /// Installs all packages located in //TODO: 2dm where? + /// + /// + Task InstallPackagesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PackageService : ServiceBase, IPackageService { diff --git a/Oqtane.Client/Services/PageModuleService.cs b/Oqtane.Client/Services/PageModuleService.cs index c9ebc19a..8daafc39 100644 --- a/Oqtane.Client/Services/PageModuleService.cs +++ b/Oqtane.Client/Services/PageModuleService.cs @@ -6,6 +6,57 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to store and retrieve a + /// + public interface IPageModuleService + { + + /// + /// Returns a specific page module + /// + /// + /// + Task GetPageModuleAsync(int pageModuleId); + + /// + /// Return a specific page module + /// + /// + /// + /// + Task GetPageModuleAsync(int pageId, int moduleId); + + /// + /// Creates a new page module + /// + /// + /// + Task AddPageModuleAsync(PageModule pageModule); + + /// + /// Updates a existing page module + /// + /// + /// + Task UpdatePageModuleAsync(PageModule pageModule); + + /// + /// Updates order of all page modules in the given pane + /// + /// + /// + /// + Task UpdatePageModuleOrderAsync(int pageId, string pane); + + /// + /// Deletes a page module + /// + /// + /// + Task DeletePageModuleAsync(int pageModuleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PageModuleService : ServiceBase, IPageModuleService { diff --git a/Oqtane.Client/Services/PageService.cs b/Oqtane.Client/Services/PageService.cs index 934b156e..e3f940c6 100644 --- a/Oqtane.Client/Services/PageService.cs +++ b/Oqtane.Client/Services/PageService.cs @@ -8,6 +8,71 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Services to store and retrieve a + /// + public interface IPageService + { + /// + /// Returns a list of pages + /// + /// + /// + Task> GetPagesAsync(int siteId); + + /// + /// Returns a specific page + /// + /// + /// + Task GetPageAsync(int pageId); + + /// + /// Returns a specific page by its defined path + /// + /// + /// + /// + Task GetPageAsync(string path, int siteId); + + /// + /// Adds a new page + /// + /// + /// + Task AddPageAsync(Page page); + + /// + /// Adds a new page + /// + /// + /// + Task AddPageAsync(int pageId, int userId); + + /// + /// Updates a existing page + /// + /// + /// + Task UpdatePageAsync(Page page); + + /// + /// Updates order of all page modules in the given parent + /// + /// + /// + /// + /// + Task UpdatePageOrderAsync(int siteId, int pageId, int? parentId); + + /// + /// Deletes a page + /// + /// + /// + Task DeletePageAsync(int pageId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class PageService : ServiceBase, IPageService { diff --git a/Oqtane.Client/Services/ProfileService.cs b/Oqtane.Client/Services/ProfileService.cs index 700fb764..bf2c7e54 100644 --- a/Oqtane.Client/Services/ProfileService.cs +++ b/Oqtane.Client/Services/ProfileService.cs @@ -8,6 +8,48 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to store and retrieve entries + /// + public interface IProfileService + { + + /// + /// Returns a list of profile entries + /// + /// + /// + Task> GetProfilesAsync(int siteId); + + /// + /// Returns a specific profile entry + /// + /// + /// + Task GetProfileAsync(int profileId); + + /// + /// Creates a new profile entry + /// + /// + /// + Task AddProfileAsync(Profile profile); + + /// + /// Updates an existing profile entry + /// + /// + /// + Task UpdateProfileAsync(Profile profile); + + /// + /// Deletes a profile entry + /// + /// + /// + Task DeleteProfileAsync(int profileId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ProfileService : ServiceBase, IProfileService { diff --git a/Oqtane.Client/Services/RoleService.cs b/Oqtane.Client/Services/RoleService.cs index 6215c51d..bf0d1c72 100644 --- a/Oqtane.Client/Services/RoleService.cs +++ b/Oqtane.Client/Services/RoleService.cs @@ -8,6 +8,57 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IRoleService + { + /// + /// Get all s of this . + /// + /// Will exclude global roles which are for all sites. To get those as well, use the overload + /// + /// ID-reference of a + /// + Task> GetRolesAsync(int siteId); + + /// + /// Get roles of the and optionally include global Roles. + /// + /// ID-reference to a + /// True if it should also include global roles. False will return the same data as just calling + /// + Task> GetRolesAsync(int siteId, bool includeGlobalRoles); + + /// + /// Get one specific + /// + /// ID-reference of a + /// + Task GetRoleAsync(int roleId); + + /// + /// Add / save a new to the database. + /// + /// + /// + Task AddRoleAsync(Role role); + + /// + /// Update a in the database. + /// + /// + /// + Task UpdateRoleAsync(Role role); + + /// + /// Delete / mark-as-deleted a in the database. + /// + /// ID-reference of a + /// + Task DeleteRoleAsync(int roleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class RoleService : ServiceBase, IRoleService { diff --git a/Oqtane.Client/Services/SearchResultsService.cs b/Oqtane.Client/Services/SearchResultsService.cs index 6597dc33..6ec1732f 100644 --- a/Oqtane.Client/Services/SearchResultsService.cs +++ b/Oqtane.Client/Services/SearchResultsService.cs @@ -1,4 +1,3 @@ -using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using Oqtane.Documentation; @@ -8,6 +7,12 @@ using Oqtane.Shared; namespace Oqtane.Services { + [PrivateApi("Mark SearchResults classes as private, since it's not very useful in the public docs")] + public interface ISearchResultsService + { + Task GetSearchResultsAsync(SearchQuery searchQuery); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SearchResultsService : ServiceBase, ISearchResultsService, IClientService { diff --git a/Oqtane.Client/Services/SettingService.cs b/Oqtane.Client/Services/SettingService.cs index a55eeeba..4203f9c0 100644 --- a/Oqtane.Client/Services/SettingService.cs +++ b/Oqtane.Client/Services/SettingService.cs @@ -9,6 +9,268 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s + /// + public interface ISettingService + { + /// + /// Returns a key-value dictionary of all tenant settings + /// + /// + Task> GetTenantSettingsAsync(); + + /// + /// Updates a tenant setting + /// + /// + /// + Task UpdateTenantSettingsAsync(Dictionary tenantSettings); + + /// + /// Returns a key-value dictionary of all site settings for the given site + /// + /// + /// + Task> GetSiteSettingsAsync(int siteId); + + /// + /// Updates a site setting + /// + /// + /// + /// + Task UpdateSiteSettingsAsync(Dictionary siteSettings, int siteId); + + /// + /// Clears site option cache + /// + /// + Task ClearSiteSettingsCacheAsync(); + + /// + /// Returns a key-value dictionary of all page settings for the given page + /// + /// + /// + Task> GetPageSettingsAsync(int pageId); + + /// + /// Updates a page setting + /// + /// + /// + /// + Task UpdatePageSettingsAsync(Dictionary pageSettings, int pageId); + + /// + /// Returns a key-value dictionary of all page module settings for the given page module + /// + /// + /// + Task> GetPageModuleSettingsAsync(int pageModuleId); + + /// + /// Updates a page module setting + /// + /// + /// + /// + Task UpdatePageModuleSettingsAsync(Dictionary pageModuleSettings, int pageModuleId); + + /// + /// Returns a key-value dictionary of all module settings for the given module + /// + /// + /// + Task> GetModuleSettingsAsync(int moduleId); + + /// + /// Updates a module setting + /// + /// + /// + /// + Task UpdateModuleSettingsAsync(Dictionary moduleSettings, int moduleId); + + /// + /// Returns a key-value dictionary of all module settings for the given module + /// + /// + /// + Task> GetModuleDefinitionSettingsAsync(int moduleDefinitionId); + + /// + /// Updates a module setting + /// + /// + /// + /// + Task UpdateModuleDefinitionSettingsAsync(Dictionary moduleDefinitionSettings, int moduleDefinitionId); + + /// + /// Returns a key-value dictionary of all user settings for the given user + /// + /// + /// + Task> GetUserSettingsAsync(int userId); + + /// + /// Updates a user setting + /// + /// + /// + /// + Task UpdateUserSettingsAsync(Dictionary userSettings, int userId); + + /// + /// Returns a key-value dictionary of all folder settings for the given folder + /// + /// + /// + Task> GetFolderSettingsAsync(int folderId); + + + /// + /// Updates a folder setting + /// + /// + /// + /// + Task UpdateFolderSettingsAsync(Dictionary folderSettings, int folderId); + + /// + /// Returns a key-value dictionary of all tenant settings + /// + /// + Task> GetHostSettingsAsync(); + + /// + /// Updates a host setting + /// + /// + /// + Task UpdateHostSettingsAsync(Dictionary hostSettings); + + /// + /// Returns a key-value dictionary of all settings for the given visitor + /// + /// + /// + Task> GetVisitorSettingsAsync(int visitorId); + + /// + /// Updates a visitor setting + /// + /// + /// + /// + Task UpdateVisitorSettingsAsync(Dictionary visitorSettings, int visitorId); + + /// + /// Returns a key-value dictionary of all settings for the given entityName + /// + /// + /// + Task> GetSettingsAsync(string entityName, int entityId); + + /// + /// Updates settings for a given entityName and Id + /// + /// + /// + /// + /// + Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId); + + /// + /// Updates setting for a given entityName and Id + /// + /// + /// + /// + /// + /// + /// + Task AddOrUpdateSettingAsync(string entityName, int entityId, string settingName, string settingValue, bool isPrivate); + + /// + /// Returns a specific setting + /// + /// + /// + /// + /// + Task DeleteSettingAsync(string entityName, int entityId, string settingName); + + /// + /// Returns a specific setting + /// + /// + /// + /// + /// + Task> GetSettingsAsync(string entityName, int entityId, string settingName); + + /// + /// Returns a specific setting + /// + /// + /// + Task GetSettingAsync(string entityName, int settingId); + + /// + /// Creates a new setting + /// + /// + /// + Task AddSettingAsync(Setting setting); + + /// + /// Updates a existing setting + /// + /// + /// + Task UpdateSettingAsync(Setting setting); + + /// + /// Deletes a setting + /// + /// + /// + Task DeleteSettingAsync(string entityName, int settingId); + + /// + /// Gets the value of the given settingName (key) from the given key-value dictionary + /// + /// + /// + /// + /// + string GetSetting(Dictionary settings, string settingName, string defaultValue); + + /// + /// Sets the value of the given settingName (key) in the given key-value dictionary + /// + /// + /// + /// + /// + Dictionary SetSetting(Dictionary settings, string settingName, string settingValue); + + Dictionary SetSetting(Dictionary settings, string settingName, string settingValue, bool isPrivate); + + Dictionary MergeSettings(Dictionary baseSettings, Dictionary overwriteSettings); + + + [Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)] + Task 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")] public class SettingService : ServiceBase, ISettingService { diff --git a/Oqtane.Client/Services/SiteService.cs b/Oqtane.Client/Services/SiteService.cs index 4f1658f4..0ab922c1 100644 --- a/Oqtane.Client/Services/SiteService.cs +++ b/Oqtane.Client/Services/SiteService.cs @@ -8,6 +8,59 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to store and retrieve entries + /// + public interface ISiteService + { + + /// + /// Returns a list of sites + /// + /// + Task> GetSitesAsync(); + + /// + /// Returns a specific site + /// + /// + /// + Task GetSiteAsync(int siteId); + + /// + /// Creates a new site + /// + /// + /// + Task AddSiteAsync(Site site); + + /// + /// Updates an existing site + /// + /// + /// + Task UpdateSiteAsync(Site site); + + /// + /// Deletes a site + /// + /// + /// + Task DeleteSiteAsync(int siteId); + + /// + /// Returns a list of modules + /// + /// + /// + /// + Task> 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")] public class SiteService : ServiceBase, ISiteService { diff --git a/Oqtane.Client/Services/SiteTemplateService.cs b/Oqtane.Client/Services/SiteTemplateService.cs index 1e6d5c3c..b7ced874 100644 --- a/Oqtane.Client/Services/SiteTemplateService.cs +++ b/Oqtane.Client/Services/SiteTemplateService.cs @@ -8,6 +8,18 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to retrieve entries + /// + public interface ISiteTemplateService + { + /// + /// Returns a list of site templates + /// + /// + Task> GetSiteTemplatesAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SiteTemplateService : ServiceBase, ISiteTemplateService { diff --git a/Oqtane.Client/Services/SqlService.cs b/Oqtane.Client/Services/SqlService.cs index 403de7fd..de9ce24f 100644 --- a/Oqtane.Client/Services/SqlService.cs +++ b/Oqtane.Client/Services/SqlService.cs @@ -6,6 +6,19 @@ using Oqtane.Documentation; namespace Oqtane.Services { + /// + /// Service to execute a against the backend database + /// + public interface ISqlService + { + /// + /// Executes a sql query and returns its result + /// + /// + /// + Task ExecuteQueryAsync(SqlQuery sqlquery); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SqlService : ServiceBase, ISqlService { diff --git a/Oqtane.Client/Services/SyncService.cs b/Oqtane.Client/Services/SyncService.cs index 781aba91..216befb5 100644 --- a/Oqtane.Client/Services/SyncService.cs +++ b/Oqtane.Client/Services/SyncService.cs @@ -8,6 +8,19 @@ using System.Globalization; namespace Oqtane.Services { + /// + /// Service to retrieve information. + /// + public interface ISyncService + { + /// + /// Get sync events + /// + /// + /// + Task GetSyncEventsAsync(DateTime lastSyncDate); + } + /// [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SyncService : ServiceBase, ISyncService diff --git a/Oqtane.Client/Services/SystemService.cs b/Oqtane.Client/Services/SystemService.cs index d6ab8268..b1a79ae0 100644 --- a/Oqtane.Client/Services/SystemService.cs +++ b/Oqtane.Client/Services/SystemService.cs @@ -3,10 +3,46 @@ using System.Threading.Tasks; using System.Collections.Generic; using Oqtane.Documentation; using Oqtane.Shared; -using System.Net; namespace Oqtane.Services { + /// + /// Service to retrieve and update system information. + /// + public interface ISystemService + { + /// + /// returns a key-value dictionary with the current system configuration information + /// + /// + Task> GetSystemInfoAsync(); + + /// + /// returns a key-value dictionary with the current system information - "environment" or "configuration" + /// + /// + Task> GetSystemInfoAsync(string type); + + /// + /// returns a config value + /// + /// + Task GetSystemInfoAsync(string settingKey, object defaultValue); + + /// + /// Updates system information + /// + /// + /// + Task UpdateSystemInfoAsync(Dictionary settings); + + /// + /// returns a key-value dictionary with default system icons + /// + /// + Task> GetIconsAsync(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class SystemService : ServiceBase, ISystemService { diff --git a/Oqtane.Client/Services/TenantService.cs b/Oqtane.Client/Services/TenantService.cs index b6343e7a..00afcd9e 100644 --- a/Oqtane.Client/Services/TenantService.cs +++ b/Oqtane.Client/Services/TenantService.cs @@ -8,6 +8,25 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Service to manage s on the Oqtane installation. + /// + public interface ITenantService + { + /// + /// Get all s + /// + /// + Task> GetTenantsAsync(); + + /// + /// Get one specific + /// + /// ID-reference of the + /// + Task GetTenantAsync(int tenantId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class TenantService : ServiceBase, ITenantService { diff --git a/Oqtane.Client/Services/ThemeService.cs b/Oqtane.Client/Services/ThemeService.cs index d1c03495..4fd1d9eb 100644 --- a/Oqtane.Client/Services/ThemeService.cs +++ b/Oqtane.Client/Services/ThemeService.cs @@ -5,10 +5,97 @@ using System.Threading.Tasks; using Oqtane.Documentation; using Oqtane.Models; using Oqtane.Shared; -using Oqtane.UI; namespace Oqtane.Services { + /// + /// Service to manage entries + /// + public interface IThemeService + { + + /// + /// Returns a list of available themes + /// + /// + Task> GetThemesAsync(); + + /// + /// Returns a specific theme + /// + /// + /// + /// + Task GetThemeAsync(int themeId, int siteId); + + /// + /// Returns a theme s containing a specific theme control type + /// + /// + /// + /// + Theme GetTheme(List themes, string themeControlType); + + /// + /// Returns a list of s from the given themes + /// + /// + /// + List GetThemeControls(List themes); + + /// + /// Returns a list of s for a theme containing a specific theme control type + /// + /// + /// + /// + List GetThemeControls(List themes, string themeControlType); + + /// + /// Returns a list of containers () for a theme containing a specific theme control type + /// + /// + /// + /// + List GetContainerControls(List themes, string themeControlType); + + /// + /// Updates a existing theme + /// + /// + /// + Task UpdateThemeAsync(Theme theme); + + /// + /// Deletes a theme + /// + /// + /// + Task DeleteThemeAsync(string themeName); + + /// + /// Creates a new theme + /// + /// + /// + Task CreateThemeAsync(Theme theme); + + /// + /// Returns a list of theme templates () + /// + /// + Task> GetThemeTemplatesAsync(); + + + /// + /// Returns a list of layouts () from the given themes with a matching theme name + /// + /// + /// + /// + List GetLayoutControls(List themes, string themeName); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class ThemeService : ServiceBase, IThemeService { diff --git a/Oqtane.Client/Services/TimeZoneService.cs b/Oqtane.Client/Services/TimeZoneService.cs index 4b921bad..c8896449 100644 --- a/Oqtane.Client/Services/TimeZoneService.cs +++ b/Oqtane.Client/Services/TimeZoneService.cs @@ -9,6 +9,18 @@ using NodaTime.Extensions; namespace Oqtane.Services { + /// + /// Service to retrieve entries + /// + public interface ITimeZoneService + { + /// + /// Get the list of time zones + /// + /// + List GetTimeZones(); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class TimeZoneService : ITimeZoneService { diff --git a/Oqtane.Client/Services/UrlMappingService.cs b/Oqtane.Client/Services/UrlMappingService.cs index 55f381e3..305dd2da 100644 --- a/Oqtane.Client/Services/UrlMappingService.cs +++ b/Oqtane.Client/Services/UrlMappingService.cs @@ -9,6 +9,56 @@ using System.Net; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IUrlMappingService + { + /// + /// Get all s of this . + /// + /// + /// ID-reference of a + /// + Task> GetUrlMappingsAsync(int siteId, bool isMapped); + + /// + /// Get one specific + /// + /// ID-reference of a + /// + Task GetUrlMappingAsync(int urlMappingId); + + /// + /// Get one specific + /// + /// ID-reference of a + /// A url + /// + Task GetUrlMappingAsync(int siteId, string url); + + /// + /// Add / save a new to the database. + /// + /// + /// + Task AddUrlMappingAsync(UrlMapping urlMapping); + + /// + /// Update a in the database. + /// + /// + /// + Task UpdateUrlMappingAsync(UrlMapping urlMapping); + + /// + /// Delete a in the database. + /// + /// ID-reference of a + /// + Task DeleteUrlMappingAsync(int urlMappingId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UrlMappingService : ServiceBase, IUrlMappingService { diff --git a/Oqtane.Client/Services/UserRoleService.cs b/Oqtane.Client/Services/UserRoleService.cs index ef596854..c143ca20 100644 --- a/Oqtane.Client/Services/UserRoleService.cs +++ b/Oqtane.Client/Services/UserRoleService.cs @@ -7,6 +7,72 @@ using Oqtane.Shared; namespace Oqtane.Services { + /// + /// Manage s assigned to a specific + /// + public interface IUserRoleService + { + /// + /// Get all s on a + /// + /// ID-reference to a + /// + Task> GetUserRolesAsync(int siteId); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// ID-reference to a + /// + Task> GetUserRolesAsync(int siteId, int userId); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// Name reference a + /// + Task> GetUserRolesAsync(int siteId, string roleName); + + /// + /// Get all s on a + /// + /// ID-reference to a + /// ID-reference to a + /// Name reference a + /// + Task> GetUserRolesAsync(int siteId, int userId, string roleName); + + /// + /// Get one specific + /// + /// ID-reference to a + /// + Task GetUserRoleAsync(int userRoleId); + + /// + /// Save a new + /// + /// + /// + Task AddUserRoleAsync(UserRole userRole); + + /// + /// Update a in the database + /// + /// + /// + Task UpdateUserRoleAsync(UserRole userRole); + + /// + /// Delete a in the database + /// + /// + /// + Task DeleteUserRoleAsync(int userRoleId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UserRoleService : ServiceBase, IUserRoleService { diff --git a/Oqtane.Client/Services/UserService.cs b/Oqtane.Client/Services/UserService.cs index d69aa10d..ca5203e4 100644 --- a/Oqtane.Client/Services/UserService.cs +++ b/Oqtane.Client/Services/UserService.cs @@ -6,12 +6,174 @@ using Oqtane.Documentation; using System.Net; using System.Collections.Generic; using Microsoft.Extensions.Localization; -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using Oqtane.Modules.Admin.Roles; -using System.Xml.Linq; namespace Oqtane.Services { + /// + /// Manage (get / update) user information + /// + public interface IUserService + { + /// + /// Get a of a specific site + /// + /// ID of a + /// ID of a + /// + Task GetUserAsync(int userId, int siteId); + + /// + /// Get a of a specific site + /// + /// Username / login of a + /// ID of a + /// + Task GetUserAsync(string username, int siteId); + + /// + /// Get a of a specific site + /// + /// Username / login of a + /// email address of a + /// ID of a + /// + Task GetUserAsync(string username, string email, int siteId); + + /// + /// Save a user to the Database. + /// The object contains all the information incl. what it belongs to. + /// + /// + /// + Task AddUserAsync(User user); + + /// + /// Update an existing user in the database. + /// + /// + /// + Task UpdateUserAsync(User user); + + /// + /// Delete / remove a user in the database + /// + /// ID-reference to the + /// ID-reference to the + /// + Task DeleteUserAsync(int userId, int siteId); + + /// + /// Will login the specified . + /// + /// Note that this will probably not be a real User, but a user object where the `Username` and `Password` have been filled. + /// + /// A object which should have at least the and set. + /// Determines if the login cookie should be set (only relevant for Hybrid scenarios) + /// Determines if the login cookie should be persisted for a long time. + /// + Task LoginUserAsync(User user, bool setCookie, bool isPersistent); + + /// + /// Logout a + /// + /// + /// + Task LogoutUserAsync(User user); + + /// + /// Logout a + /// + /// + /// + Task LogoutUserEverywhereAsync(User user); + + /// + /// Update e-mail verification status of a user. + /// + /// The we're verifying + /// A Hash value in the URL which verifies this user got the e-mail (containing this token) + /// + Task VerifyEmailAsync(User user, string token); + + /// + /// Trigger a forgot-password e-mail for this . + /// + /// + /// + Task ForgotPasswordAsync(User user); + + /// + /// Reset the password of this + /// + /// + /// + /// + Task ResetPasswordAsync(User user, string token); + + /// + /// Verify the two factor verification code + /// + /// + /// + /// + Task VerifyTwoFactorAsync(User user, string token); + + /// + /// Validate identity user info. + /// + /// + /// + /// + /// + Task ValidateUserAsync(string username, string email, string password); + + /// + /// Validate a users password against the password policy + /// + /// + /// + Task ValidatePasswordAsync(string password); + + /// + /// Get token for current user + /// + /// + Task GetTokenAsync(); + + /// + /// Get personal access token for current user (administrators only) + /// + /// + Task GetPersonalAccessTokenAsync(); + + /// + /// Link an external login with a local user account + /// + /// The we're verifying + /// A Hash value in the URL which verifies this user got the e-mail (containing this token) + /// External Login provider type + /// External Login provider key + /// External Login provider display name + /// + Task LinkUserAsync(User user, string token, string type, string key, string name); + + /// + /// Get password requirements for site + /// + /// ID of a + /// + Task GetPasswordRequirementsAsync(int siteId); + + /// + /// Bulk import of users + /// + /// ID of a + /// ID of a + /// Indicates if new users should be notified by email + /// + Task> ImportUsersAsync(int siteId, int fileId, bool notify); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class UserService : ServiceBase, IUserService { diff --git a/Oqtane.Client/Services/VisitorService.cs b/Oqtane.Client/Services/VisitorService.cs index b29e9c3c..0b8bbd1b 100644 --- a/Oqtane.Client/Services/VisitorService.cs +++ b/Oqtane.Client/Services/VisitorService.cs @@ -10,6 +10,28 @@ using System.Globalization; namespace Oqtane.Services { + /// + /// Service to manage s on a + /// + public interface IVisitorService + { + /// + /// Get all s of this . + /// + /// + /// ID-reference of a + /// + Task> GetVisitorsAsync(int siteId, DateTime fromDate); + + /// + /// Get a specific of this . + /// + /// + /// ID-reference of a + /// + Task GetVisitorAsync(int visitorId); + } + [PrivateApi("Don't show in the documentation, as everything should use the Interface")] public class VisitorService : ServiceBase, IVisitorService { From bf932719b2578db82807c3a962d1ceaee5bf9d2c Mon Sep 17 00:00:00 2001 From: sbwalker Date: Mon, 11 Aug 2025 17:10:58 -0400 Subject: [PATCH 10/14] follow same pattern as core framework --- .../Client/Services/[Module]Service.cs | 13 +++++++++++++ .../Server/Repository/I[Module]Repository.cs | 15 --------------- .../Server/Repository/[Module]Repository.cs | 10 ++++++++++ .../[Owner].Module.[Module].Server.csproj | 1 + .../Shared/Interfaces/I[Module]Service.cs | 18 ------------------ 5 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/I[Module]Repository.cs delete mode 100644 Oqtane.Server/wwwroot/Modules/Templates/External/Shared/Interfaces/I[Module]Service.cs diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs index 94baa74d..d433d698 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Client/Services/[Module]Service.cs @@ -7,6 +7,19 @@ using Oqtane.Shared; namespace [Owner].Module.[Module].Services { + public interface I[Module]Service + { + Task> Get[Module]sAsync(int ModuleId); + + Task Get[Module]Async(int [Module]Id, int ModuleId); + + Task Add[Module]Async(Models.[Module] [Module]); + + Task Update[Module]Async(Models.[Module] [Module]); + + Task Delete[Module]Async(int [Module]Id, int ModuleId); + } + public class [Module]Service : ServiceBase, I[Module]Service { public [Module]Service(HttpClient http, SiteState siteState) : base(http, siteState) { } diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/I[Module]Repository.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/I[Module]Repository.cs deleted file mode 100644 index 503b3635..00000000 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/I[Module]Repository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace [Owner].Module.[Module].Repository -{ - public interface I[Module]Repository - { - IEnumerable Get[Module]s(int ModuleId); - Models.[Module] Get[Module](int [Module]Id); - Models.[Module] Get[Module](int [Module]Id, bool tracking); - Models.[Module] Add[Module](Models.[Module] [Module]); - Models.[Module] Update[Module](Models.[Module] [Module]); - void Delete[Module](int [Module]Id); - } -} diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/[Module]Repository.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/[Module]Repository.cs index 8aa57dc6..75e26527 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/[Module]Repository.cs +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/Repository/[Module]Repository.cs @@ -5,6 +5,16 @@ using Oqtane.Modules; namespace [Owner].Module.[Module].Repository { + public interface I[Module]Repository + { + IEnumerable Get[Module]s(int ModuleId); + Models.[Module] Get[Module](int [Module]Id); + Models.[Module] Get[Module](int [Module]Id, bool tracking); + Models.[Module] Add[Module](Models.[Module] [Module]); + Models.[Module] Update[Module](Models.[Module] [Module]); + void Delete[Module](int [Module]Id); + } + public class [Module]Repository : I[Module]Repository, ITransientService { private readonly IDbContextFactory<[Module]Context> _factory; diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj index 28f27a31..46602f40 100644 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj +++ b/Oqtane.Server/wwwroot/Modules/Templates/External/Server/[Owner].Module.[Module].Server.csproj @@ -26,6 +26,7 @@ + diff --git a/Oqtane.Server/wwwroot/Modules/Templates/External/Shared/Interfaces/I[Module]Service.cs b/Oqtane.Server/wwwroot/Modules/Templates/External/Shared/Interfaces/I[Module]Service.cs deleted file mode 100644 index 8c75bf44..00000000 --- a/Oqtane.Server/wwwroot/Modules/Templates/External/Shared/Interfaces/I[Module]Service.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace [Owner].Module.[Module].Services -{ - public interface I[Module]Service - { - Task> Get[Module]sAsync(int ModuleId); - - Task Get[Module]Async(int [Module]Id, int ModuleId); - - Task Add[Module]Async(Models.[Module] [Module]); - - Task Update[Module]Async(Models.[Module] [Module]); - - Task Delete[Module]Async(int [Module]Id, int ModuleId); - } -} From 6142bfc5db5e6bbb6f863f2277ea2649f5d4448d Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 12 Aug 2025 14:59:51 -0400 Subject: [PATCH 11/14] add InsertData(), UpdateData(), DeleteData() migration methods and improve RewriteValue() abstraction --- Oqtane.Database.MySQL/MySQLDatabase.cs | 9 ++ .../PostgreSQLDatabase.cs | 8 +- .../SqlServerDatabase.cs | 9 ++ Oqtane.Database.Sqlite/SqliteDatabase.cs | 9 ++ Oqtane.Server/Databases/DatabaseBase.cs | 4 +- .../Databases/Interfaces/IDatabase.cs | 2 +- .../EntityBuilders/BaseEntityBuilder.cs | 92 ++++++++++++++++--- .../Framework/MultiDatabaseMigration.cs | 4 +- .../02010001_AddDatabaseTypeColumnToTenant.cs | 2 +- .../Master/03000201_AddAliasIsDefault.cs | 2 +- ...000101_AddAdditionColumnToNotifications.cs | 2 +- ...2000001_AddColumnToProfileAndUpdatePage.cs | 2 +- .../Tenant/02000101_UpdateIconColumnInPage.cs | 2 +- .../02000103_UpdatePageAndAddColumnToSite.cs | 4 +- ...02_UpdateDefaultContainerTypeInSitePage.cs | 12 +-- .../02000203_DropDefaultLayoutInSite.cs | 12 +-- .../Tenant/02010003_AddFolderType.cs | 2 +- .../Tenant/02020001_AddPageIsClickable.cs | 2 +- .../Tenant/02030001_AddFolderCapacity.cs | 4 +- .../Tenant/02030002_AddSettingIsPublic.cs | 2 +- .../Tenant/03000001_AddSiteRuntime.cs | 4 +- .../Tenant/03000104_AddSiteVisitorTracking.cs | 4 +- .../Tenant/03000201_UpdateSettingIsPublic.cs | 4 +- .../Tenant/03000202_UpdateSettingIsPrivate.cs | 4 +- .../Tenant/04000001_AddHeadContent.cs | 2 +- .../Tenant/04000101_AddNotificationIsRead.cs | 2 +- .../Tenant/04000601_AddProfileRows.cs | 2 +- .../Tenant/05000100_AddSiteHybridEnabled.cs | 2 +- .../Tenant/05010004_AddSitePrerender.cs | 6 +- .../Tenant/06010402_ResetTimeZone.cs | 4 +- 30 files changed, 155 insertions(+), 64 deletions(-) diff --git a/Oqtane.Database.MySQL/MySQLDatabase.cs b/Oqtane.Database.MySQL/MySQLDatabase.cs index 2f50c1d4..5e8cf38a 100644 --- a/Oqtane.Database.MySQL/MySQLDatabase.cs +++ b/Oqtane.Database.MySQL/MySQLDatabase.cs @@ -80,6 +80,15 @@ namespace Oqtane.Database.MySQL 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) { return optionsBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString)); diff --git a/Oqtane.Database.PostgreSQL/PostgreSQLDatabase.cs b/Oqtane.Database.PostgreSQL/PostgreSQLDatabase.cs index 7e20a86d..33c24cde 100644 --- a/Oqtane.Database.PostgreSQL/PostgreSQLDatabase.cs +++ b/Oqtane.Database.PostgreSQL/PostgreSQLDatabase.cs @@ -92,13 +92,13 @@ namespace Oqtane.Database.PostgreSQL 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) diff --git a/Oqtane.Database.SqlServer/SqlServerDatabase.cs b/Oqtane.Database.SqlServer/SqlServerDatabase.cs index 7f52b8be..3228c550 100644 --- a/Oqtane.Database.SqlServer/SqlServerDatabase.cs +++ b/Oqtane.Database.SqlServer/SqlServerDatabase.cs @@ -51,6 +51,15 @@ namespace Oqtane.Database.SqlServer 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) { var conn = new SqlConnection(FormatConnectionString(connectionString)); diff --git a/Oqtane.Database.Sqlite/SqliteDatabase.cs b/Oqtane.Database.Sqlite/SqliteDatabase.cs index df132079..048a4aef 100644 --- a/Oqtane.Database.Sqlite/SqliteDatabase.cs +++ b/Oqtane.Database.Sqlite/SqliteDatabase.cs @@ -89,6 +89,15 @@ namespace Oqtane.Database.Sqlite 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) { return optionsBuilder.UseSqlite(connectionString) diff --git a/Oqtane.Server/Databases/DatabaseBase.cs b/Oqtane.Server/Databases/DatabaseBase.cs index 668fdd38..7f8c52db 100644 --- a/Oqtane.Server/Databases/DatabaseBase.cs +++ b/Oqtane.Server/Databases/DatabaseBase.cs @@ -71,9 +71,9 @@ namespace Oqtane.Databases 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) diff --git a/Oqtane.Server/Databases/Interfaces/IDatabase.cs b/Oqtane.Server/Databases/Interfaces/IDatabase.cs index 8b9e7586..8a02f4ea 100644 --- a/Oqtane.Server/Databases/Interfaces/IDatabase.cs +++ b/Oqtane.Server/Databases/Interfaces/IDatabase.cs @@ -30,7 +30,7 @@ namespace Oqtane.Databases.Interfaces public string RewriteName(string name); - public string RewriteValue(string value, string type); + public string RewriteValue(object value); public void UpdateIdentityStoreTableNames(ModelBuilder builder); diff --git a/Oqtane.Server/Migrations/EntityBuilders/BaseEntityBuilder.cs b/Oqtane.Server/Migrations/EntityBuilders/BaseEntityBuilder.cs index 430a72c6..c75558b7 100644 --- a/Oqtane.Server/Migrations/EntityBuilders/BaseEntityBuilder.cs +++ b/Oqtane.Server/Migrations/EntityBuilders/BaseEntityBuilder.cs @@ -55,9 +55,9 @@ namespace Oqtane.Migrations.EntityBuilders 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 @@ -466,36 +466,100 @@ namespace Oqtane.Migrations.EntityBuilders //Sql Operations - public void DeleteFromTable(string condition = "") + public void InsertData(string[] columns, object[] values, string condition) { - var deleteSql = $"DELETE FROM {AddSchema(DelimitName(RewriteName(EntityTableName)))} "; - if(!string.IsNullOrEmpty(condition)) + var sql = $"INSERT INTO {AddSchema(DelimitName(RewriteName(EntityTableName)))} "; + 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 - 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) { 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) { 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) { - var updateSql = $"UPDATE {AddSchema(DelimitName(RewriteName(EntityTableName)))} SET {DelimitName(RewriteName(columnName))} = {RewriteValue(value, type)} "; - if (!string.IsNullOrEmpty(condition)) - { - // note that condition values must be created using RewriteName(), DelimitName(), RewriteValue() if targeting multiple database platforms - updateSql += $"WHERE {condition}"; - } - _migrationBuilder.Sql(updateSql); + object obj = (type == "bool" && value == "1") ? true : false; // boolean values had custom logic for PostgreSQL + UpdateData([columnName], [obj], condition); } } } diff --git a/Oqtane.Server/Migrations/Framework/MultiDatabaseMigration.cs b/Oqtane.Server/Migrations/Framework/MultiDatabaseMigration.cs index 07f8043b..43a803a4 100644 --- a/Oqtane.Server/Migrations/Framework/MultiDatabaseMigration.cs +++ b/Oqtane.Server/Migrations/Framework/MultiDatabaseMigration.cs @@ -22,9 +22,9 @@ namespace Oqtane.Migrations 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); } } } diff --git a/Oqtane.Server/Migrations/Master/02010001_AddDatabaseTypeColumnToTenant.cs b/Oqtane.Server/Migrations/Master/02010001_AddDatabaseTypeColumnToTenant.cs index c5a54e5f..3573e7a7 100644 --- a/Oqtane.Server/Migrations/Master/02010001_AddDatabaseTypeColumnToTenant.cs +++ b/Oqtane.Server/Migrations/Master/02010001_AddDatabaseTypeColumnToTenant.cs @@ -23,7 +23,7 @@ namespace Oqtane.Migrations.Master //Update new column if SqlServer (Other Databases will not have any records yet) if (ActiveDatabase.Name == "SqlServer") { - tenantEntityBuilder.UpdateColumn("DBType", $"'{ActiveDatabase.TypeName}'"); + tenantEntityBuilder.UpdateData("DBType", $"'{ActiveDatabase.TypeName}'"); } } } diff --git a/Oqtane.Server/Migrations/Master/03000201_AddAliasIsDefault.cs b/Oqtane.Server/Migrations/Master/03000201_AddAliasIsDefault.cs index e862878f..a64705e8 100644 --- a/Oqtane.Server/Migrations/Master/03000201_AddAliasIsDefault.cs +++ b/Oqtane.Server/Migrations/Master/03000201_AddAliasIsDefault.cs @@ -19,7 +19,7 @@ namespace Oqtane.Migrations.Master //Add Column to Alias table var aliasEntityBuilder = new AliasEntityBuilder(migrationBuilder, ActiveDatabase); aliasEntityBuilder.AddBooleanColumn("IsDefault", true); - aliasEntityBuilder.UpdateColumn("IsDefault", "1", "bool", ""); + aliasEntityBuilder.UpdateData("IsDefault", true); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/01000101_AddAdditionColumnToNotifications.cs b/Oqtane.Server/Migrations/Tenant/01000101_AddAdditionColumnToNotifications.cs index 3dc8e016..084e8ebe 100644 --- a/Oqtane.Server/Migrations/Tenant/01000101_AddAdditionColumnToNotifications.cs +++ b/Oqtane.Server/Migrations/Tenant/01000101_AddAdditionColumnToNotifications.cs @@ -21,7 +21,7 @@ namespace Oqtane.Migrations.Tenant notificationEntityBuilder.AddDateTimeColumn("SendOn", true); //Update new Column - notificationEntityBuilder.UpdateColumn("SendOn", $"{RewriteName("CreatedOn")}", $"{DelimitName(RewriteName("SendOn"))} IS NULL"); + notificationEntityBuilder.UpdateData("SendOn", $"{DelimitName(RewriteName("CreatedOn"))}", $"{DelimitName(RewriteName("SendOn"))} IS NULL"); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/02000001_AddColumnToProfileAndUpdatePage.cs b/Oqtane.Server/Migrations/Tenant/02000001_AddColumnToProfileAndUpdatePage.cs index af2c0166..dda1a3d5 100644 --- a/Oqtane.Server/Migrations/Tenant/02000001_AddColumnToProfileAndUpdatePage.cs +++ b/Oqtane.Server/Migrations/Tenant/02000001_AddColumnToProfileAndUpdatePage.cs @@ -21,7 +21,7 @@ namespace Oqtane.Migrations.Tenant profileEntityBuilder.AddStringColumn("Options", 2000, true); //Update new column - profileEntityBuilder.UpdateColumn("Options", "''"); + profileEntityBuilder.UpdateData("Options", "''"); //Alter Column in Page table for Sql Server if (ActiveDatabase.Name == "SqlServer") diff --git a/Oqtane.Server/Migrations/Tenant/02000101_UpdateIconColumnInPage.cs b/Oqtane.Server/Migrations/Tenant/02000101_UpdateIconColumnInPage.cs index d9dcf06f..1c04c3d6 100644 --- a/Oqtane.Server/Migrations/Tenant/02000101_UpdateIconColumnInPage.cs +++ b/Oqtane.Server/Migrations/Tenant/02000101_UpdateIconColumnInPage.cs @@ -19,7 +19,7 @@ namespace Oqtane.Migrations.Tenant ///Update Icon Field in Page var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); var updateSql = ActiveDatabase.ConcatenateSql("'oi oi-'", $"{DelimitName(RewriteName("Icon"))}"); - pageEntityBuilder.UpdateColumn("Icon", updateSql, $"{DelimitName(RewriteName("Icon"))} <> ''" ); + pageEntityBuilder.UpdateData("Icon", updateSql, $"{DelimitName(RewriteName("Icon"))} <> ''" ); } } } diff --git a/Oqtane.Server/Migrations/Tenant/02000103_UpdatePageAndAddColumnToSite.cs b/Oqtane.Server/Migrations/Tenant/02000103_UpdatePageAndAddColumnToSite.cs index 753a747e..35a0063d 100644 --- a/Oqtane.Server/Migrations/Tenant/02000103_UpdatePageAndAddColumnToSite.cs +++ b/Oqtane.Server/Migrations/Tenant/02000103_UpdatePageAndAddColumnToSite.cs @@ -21,12 +21,12 @@ namespace Oqtane.Migrations.Tenant siteEntityBuilder.AddStringColumn("AdminContainerType", 200, true); //Update new column - siteEntityBuilder.UpdateColumn("AdminContainerType", "''"); + siteEntityBuilder.UpdateData("AdminContainerType", "''"); //Delete records from Page var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); - pageEntityBuilder.DeleteFromTable($"{ActiveDatabase.RewriteName("Path")} = 'admin/tenants'"); + pageEntityBuilder.DeleteData($"{ActiveDatabase.RewriteName("Path")} = 'admin/tenants'"); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/02000202_UpdateDefaultContainerTypeInSitePage.cs b/Oqtane.Server/Migrations/Tenant/02000202_UpdateDefaultContainerTypeInSitePage.cs index 1c0cb5b1..bf712782 100644 --- a/Oqtane.Server/Migrations/Tenant/02000202_UpdateDefaultContainerTypeInSitePage.cs +++ b/Oqtane.Server/Migrations/Tenant/02000202_UpdateDefaultContainerTypeInSitePage.cs @@ -20,18 +20,18 @@ namespace Oqtane.Migrations.Tenant { //Update DefaultContainerType In Site var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); - siteEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); - siteEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); + siteEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); + siteEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); //Update DefaultContainerType in Page var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); - pageEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); - pageEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); + pageEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); + pageEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); //Update ContainerType in PageModule var pageModuleEntityBuilder = new PageModuleEntityBuilder(migrationBuilder, ActiveDatabase); - pageModuleEntityBuilder.UpdateColumn("ContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); - pageModuleEntityBuilder.UpdateColumn("ContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); + pageModuleEntityBuilder.UpdateData("ContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'"); + pageModuleEntityBuilder.UpdateData("ContainerType", "'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.NoTitle, Oqtane.Client'"); } } diff --git a/Oqtane.Server/Migrations/Tenant/02000203_DropDefaultLayoutInSite.cs b/Oqtane.Server/Migrations/Tenant/02000203_DropDefaultLayoutInSite.cs index 4e174feb..3f0c9757 100644 --- a/Oqtane.Server/Migrations/Tenant/02000203_DropDefaultLayoutInSite.cs +++ b/Oqtane.Server/Migrations/Tenant/02000203_DropDefaultLayoutInSite.cs @@ -29,22 +29,22 @@ namespace Oqtane.Migrations.Tenant siteEntityBuilder.DropColumn("DefaultLayoutType"); //Update DefaultContainerType In Site - siteEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); - siteEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); + siteEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); + siteEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); //Drop Column from Page Table var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); pageEntityBuilder.DropColumn("LayoutType"); //Update DefaultContainerType in Page - pageEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); - pageEntityBuilder.UpdateColumn("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); + pageEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); + pageEntityBuilder.UpdateData("DefaultContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("DefaultContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); //Update ContainerType in PageModule var pageModuleEntityBuilder = new PageModuleEntityBuilder(migrationBuilder, ActiveDatabase); - pageModuleEntityBuilder.UpdateColumn("ContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); - pageModuleEntityBuilder.UpdateColumn("ContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); + pageModuleEntityBuilder.UpdateData("ContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultTitle, Oqtane.Client'"); + pageModuleEntityBuilder.UpdateData("ContainerType", "'Oqtane.Themes.OqtaneTheme.Container, Oqtane.Client'", $"{DelimitName(RewriteName("ContainerType"))} = 'Oqtane.Themes.OqtaneTheme.DefaultNoTitle, Oqtane.Client'"); } } diff --git a/Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs b/Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs index f6d3905b..0886cb24 100644 --- a/Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs +++ b/Oqtane.Server/Migrations/Tenant/02010003_AddFolderType.cs @@ -21,7 +21,7 @@ namespace Oqtane.Migrations.Tenant //Add Type column and initialize folderEntityBuilder.AddStringColumn("Type", 50, true, true); - folderEntityBuilder.UpdateColumn("Type", "'" + FolderTypes.Private + "'"); + folderEntityBuilder.UpdateData("Type", "'" + FolderTypes.Private + "'"); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/02020001_AddPageIsClickable.cs b/Oqtane.Server/Migrations/Tenant/02020001_AddPageIsClickable.cs index 54b86aaf..a06e90ea 100644 --- a/Oqtane.Server/Migrations/Tenant/02020001_AddPageIsClickable.cs +++ b/Oqtane.Server/Migrations/Tenant/02020001_AddPageIsClickable.cs @@ -19,7 +19,7 @@ namespace Oqtane.Migrations.Tenant var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); pageEntityBuilder.AddBooleanColumn("IsClickable", true); - pageEntityBuilder.UpdateColumn("IsClickable", "1", "bool", ""); + pageEntityBuilder.UpdateData("IsClickable", true); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/02030001_AddFolderCapacity.cs b/Oqtane.Server/Migrations/Tenant/02030001_AddFolderCapacity.cs index a5ed9237..d6b2f315 100644 --- a/Oqtane.Server/Migrations/Tenant/02030001_AddFolderCapacity.cs +++ b/Oqtane.Server/Migrations/Tenant/02030001_AddFolderCapacity.cs @@ -19,8 +19,8 @@ namespace Oqtane.Migrations.Tenant { var folderEntityBuilder = new FolderEntityBuilder(migrationBuilder, ActiveDatabase); folderEntityBuilder.AddIntegerColumn("Capacity", true); - folderEntityBuilder.UpdateColumn("Capacity", "0"); - folderEntityBuilder.UpdateColumn("Capacity", Constants.UserFolderCapacity.ToString(), $"{DelimitName(RewriteName("Name"))} = 'My Folder'"); + folderEntityBuilder.UpdateData("Capacity", 0); + folderEntityBuilder.UpdateData("Capacity", Constants.UserFolderCapacity, $"{DelimitName(RewriteName("Name"))} = 'My Folder'"); folderEntityBuilder.AddStringColumn("ImageSizes", 512, true, true); var fileEntityBuilder = new FileEntityBuilder(migrationBuilder, ActiveDatabase); diff --git a/Oqtane.Server/Migrations/Tenant/02030002_AddSettingIsPublic.cs b/Oqtane.Server/Migrations/Tenant/02030002_AddSettingIsPublic.cs index 07c303db..00c92854 100644 --- a/Oqtane.Server/Migrations/Tenant/02030002_AddSettingIsPublic.cs +++ b/Oqtane.Server/Migrations/Tenant/02030002_AddSettingIsPublic.cs @@ -19,7 +19,7 @@ namespace Oqtane.Migrations.Tenant { var settingEntityBuilder = new SettingEntityBuilder(migrationBuilder, ActiveDatabase); settingEntityBuilder.AddBooleanColumn("IsPublic", true); - settingEntityBuilder.UpdateColumn("IsPublic", "0", "bool", ""); + settingEntityBuilder.UpdateData("IsPublic", false); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/03000001_AddSiteRuntime.cs b/Oqtane.Server/Migrations/Tenant/03000001_AddSiteRuntime.cs index 90a7237a..8698e806 100644 --- a/Oqtane.Server/Migrations/Tenant/03000001_AddSiteRuntime.cs +++ b/Oqtane.Server/Migrations/Tenant/03000001_AddSiteRuntime.cs @@ -18,9 +18,9 @@ namespace Oqtane.Migrations.Tenant { var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); siteEntityBuilder.AddStringColumn("Runtime", 50, true, true); - siteEntityBuilder.UpdateColumn("Runtime", "'Server'"); + siteEntityBuilder.UpdateData("Runtime", "'Server'"); siteEntityBuilder.AddStringColumn("RenderMode", 50, true, true); - siteEntityBuilder.UpdateColumn("RenderMode", "'ServerPrerendered'"); + siteEntityBuilder.UpdateData("RenderMode", "'ServerPrerendered'"); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/03000104_AddSiteVisitorTracking.cs b/Oqtane.Server/Migrations/Tenant/03000104_AddSiteVisitorTracking.cs index 9c5c8e5d..e3d2f3af 100644 --- a/Oqtane.Server/Migrations/Tenant/03000104_AddSiteVisitorTracking.cs +++ b/Oqtane.Server/Migrations/Tenant/03000104_AddSiteVisitorTracking.cs @@ -19,9 +19,9 @@ namespace Oqtane.Migrations.Tenant var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); siteEntityBuilder.AddBooleanColumn("VisitorTracking", true); - siteEntityBuilder.UpdateColumn("VisitorTracking", "1", "bool", ""); + siteEntityBuilder.UpdateData("VisitorTracking", true); siteEntityBuilder.AddBooleanColumn("CaptureBrokenUrls", true); - siteEntityBuilder.UpdateColumn("CaptureBrokenUrls", "1", "bool", ""); + siteEntityBuilder.UpdateData("CaptureBrokenUrls", true); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/03000201_UpdateSettingIsPublic.cs b/Oqtane.Server/Migrations/Tenant/03000201_UpdateSettingIsPublic.cs index 46b52150..6720a983 100644 --- a/Oqtane.Server/Migrations/Tenant/03000201_UpdateSettingIsPublic.cs +++ b/Oqtane.Server/Migrations/Tenant/03000201_UpdateSettingIsPublic.cs @@ -18,13 +18,13 @@ namespace Oqtane.Migrations.Tenant protected override void Up(MigrationBuilder migrationBuilder) { var settingEntityBuilder = new SettingEntityBuilder(migrationBuilder, ActiveDatabase); - settingEntityBuilder.UpdateColumn("IsPublic", "1", "bool", $"{DelimitName(RewriteName("SettingName"))} NOT LIKE 'SMTP%'"); + settingEntityBuilder.UpdateData("IsPublic", true, $"{DelimitName(RewriteName("SettingName"))} NOT LIKE 'SMTP%'"); } protected override void Down(MigrationBuilder migrationBuilder) { var settingEntityBuilder = new SettingEntityBuilder(migrationBuilder, ActiveDatabase); - settingEntityBuilder.UpdateColumn("IsPublic", "0", "bool", $"{DelimitName(RewriteName("SettingName"))} NOT LIKE 'SMTP%'"); + settingEntityBuilder.UpdateData("IsPublic", false, $"{DelimitName(RewriteName("SettingName"))} NOT LIKE 'SMTP%'"); } } } diff --git a/Oqtane.Server/Migrations/Tenant/03000202_UpdateSettingIsPrivate.cs b/Oqtane.Server/Migrations/Tenant/03000202_UpdateSettingIsPrivate.cs index dae85bb4..9866f1c5 100644 --- a/Oqtane.Server/Migrations/Tenant/03000202_UpdateSettingIsPrivate.cs +++ b/Oqtane.Server/Migrations/Tenant/03000202_UpdateSettingIsPrivate.cs @@ -19,8 +19,8 @@ namespace Oqtane.Migrations.Tenant { var settingEntityBuilder = new SettingEntityBuilder(migrationBuilder, ActiveDatabase); settingEntityBuilder.AddBooleanColumn("IsPrivate", true); - settingEntityBuilder.UpdateColumn("IsPrivate", "0", "bool", ""); - settingEntityBuilder.UpdateColumn("IsPrivate", "1", "bool", $"{DelimitName(RewriteName("EntityName"))} = 'Site' AND { DelimitName(RewriteName("SettingName"))} LIKE 'SMTP%'"); + settingEntityBuilder.UpdateData("IsPrivate", false); + settingEntityBuilder.UpdateData("IsPrivate", true, $"{DelimitName(RewriteName("EntityName"))} = 'Site' AND { DelimitName(RewriteName("SettingName"))} LIKE 'SMTP%'"); settingEntityBuilder.DropColumn("IsPublic"); } diff --git a/Oqtane.Server/Migrations/Tenant/04000001_AddHeadContent.cs b/Oqtane.Server/Migrations/Tenant/04000001_AddHeadContent.cs index fcb4bd1a..3a2e7ea8 100644 --- a/Oqtane.Server/Migrations/Tenant/04000001_AddHeadContent.cs +++ b/Oqtane.Server/Migrations/Tenant/04000001_AddHeadContent.cs @@ -23,7 +23,7 @@ namespace Oqtane.Migrations.Tenant var pageEntityBuilder = new PageEntityBuilder(migrationBuilder, ActiveDatabase); pageEntityBuilder.AddStringColumn("HeadContent", 4000, true); - pageEntityBuilder.UpdateColumn("HeadContent", "Meta"); + pageEntityBuilder.UpdateData("HeadContent", "Meta"); pageEntityBuilder.DropColumn("Meta"); } diff --git a/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs b/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs index c0f610a1..dadcac18 100644 --- a/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs +++ b/Oqtane.Server/Migrations/Tenant/04000101_AddNotificationIsRead.cs @@ -20,7 +20,7 @@ namespace Oqtane.Migrations.Tenant { var notificationEntityBuilder = new NotificationEntityBuilder(migrationBuilder, ActiveDatabase); notificationEntityBuilder.AddBooleanColumn("IsRead", true); - notificationEntityBuilder.UpdateColumn("IsRead", "1", "bool", ""); + notificationEntityBuilder.UpdateData("IsRead", true); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/04000601_AddProfileRows.cs b/Oqtane.Server/Migrations/Tenant/04000601_AddProfileRows.cs index 976706ce..81d3f887 100644 --- a/Oqtane.Server/Migrations/Tenant/04000601_AddProfileRows.cs +++ b/Oqtane.Server/Migrations/Tenant/04000601_AddProfileRows.cs @@ -18,7 +18,7 @@ namespace Oqtane.Migrations.Tenant { var profileEntityBuilder = new ProfileEntityBuilder(migrationBuilder, ActiveDatabase); profileEntityBuilder.AddIntegerColumn("Rows", true); - profileEntityBuilder.UpdateColumn("Rows", "1"); + profileEntityBuilder.UpdateData("Rows", 1); } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/05000100_AddSiteHybridEnabled.cs b/Oqtane.Server/Migrations/Tenant/05000100_AddSiteHybridEnabled.cs index 9f39a4d7..0e65e38f 100644 --- a/Oqtane.Server/Migrations/Tenant/05000100_AddSiteHybridEnabled.cs +++ b/Oqtane.Server/Migrations/Tenant/05000100_AddSiteHybridEnabled.cs @@ -18,7 +18,7 @@ namespace Oqtane.Migrations.Tenant { var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); siteEntityBuilder.AddBooleanColumn("HybridEnabled", true); - siteEntityBuilder.UpdateColumn("HybridEnabled", "0", "bool", ""); // default to false + siteEntityBuilder.UpdateData("HybridEnabled", false); // default to false } protected override void Down(MigrationBuilder migrationBuilder) diff --git a/Oqtane.Server/Migrations/Tenant/05010004_AddSitePrerender.cs b/Oqtane.Server/Migrations/Tenant/05010004_AddSitePrerender.cs index 997798ca..99d911bb 100644 --- a/Oqtane.Server/Migrations/Tenant/05010004_AddSitePrerender.cs +++ b/Oqtane.Server/Migrations/Tenant/05010004_AddSitePrerender.cs @@ -19,13 +19,13 @@ namespace Oqtane.Migrations.Tenant { var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); - siteEntityBuilder.UpdateColumn("RenderMode", $"'{RenderModes.Interactive}'"); + siteEntityBuilder.UpdateData("RenderMode", $"'{RenderModes.Interactive}'"); siteEntityBuilder.AddBooleanColumn("Prerender", true); - siteEntityBuilder.UpdateColumn("Prerender", "1", "bool", ""); + siteEntityBuilder.UpdateData("Prerender", true); siteEntityBuilder.AddBooleanColumn("Hybrid", true); - siteEntityBuilder.UpdateColumn("Hybrid", "0", "bool", ""); + siteEntityBuilder.UpdateData("Hybrid", false); siteEntityBuilder.DropColumn("HybridEnabled"); } diff --git a/Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs b/Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs index 6e614cd0..df6fcb36 100644 --- a/Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs +++ b/Oqtane.Server/Migrations/Tenant/06010402_ResetTimeZone.cs @@ -18,10 +18,10 @@ namespace Oqtane.Migrations.Tenant { // resetting value as framework now uses IANA ID consistently for time zones var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase); - siteEntityBuilder.UpdateColumn("TimeZoneId", "''"); + siteEntityBuilder.UpdateData("TimeZoneId", "''"); var userEntityBuilder = new UserEntityBuilder(migrationBuilder, ActiveDatabase); - userEntityBuilder.UpdateColumn("TimeZoneId", "''"); + userEntityBuilder.UpdateData("TimeZoneId", "''"); } protected override void Down(MigrationBuilder migrationBuilder) From eb8ad04557e90e6af67b42e9a2c495faee2ee298 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 12 Aug 2025 15:33:17 -0400 Subject: [PATCH 12/14] ensure all install config settings are populated --- Oqtane.Client/Modules/Admin/Sites/Add.razor | 73 +++++++++++---------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/Oqtane.Client/Modules/Admin/Sites/Add.razor b/Oqtane.Client/Modules/Admin/Sites/Add.razor index 47f19b04..459e5143 100644 --- a/Oqtane.Client/Modules/Admin/Sites/Add.razor +++ b/Oqtane.Client/Modules/Admin/Sites/Add.razor @@ -118,42 +118,42 @@ else
@if (_databases != null) - { -
- - @if (!_showConnectionString) - { - - } - else - { - - } -
- } -
+ { +
+ + @if (!_showConnectionString) + { + + } + else + { + + } +
+ } + - @if (!_showConnectionString) - { - if (_databaseConfigType != null) - { - @DatabaseConfigComponent - } - } - else - { -
- -
- -
-
- } + @if (!_showConnectionString) + { + if (_databaseConfigType != null) + { + @DatabaseConfigComponent + } + } + else + { +
+ +
+ +
+
+ }
@@ -390,6 +390,8 @@ else config.DatabaseType = tenant.DBType; config.ConnectionString = tenant.DBConnectionString; config.IsNewTenant = false; + config.HostEmail = PageState.User.Email; + config.HostName = PageState.User.DisplayName; } } @@ -403,6 +405,7 @@ else config.SiteTemplate = _sitetemplatetype; config.RenderMode = _rendermode; config.Runtime = _runtime; + config.Register = false; ShowProgressIndicator(); From e32f55e4334dd9dcce474d29cc087ef055117e31 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 12 Aug 2025 16:08:30 -0400 Subject: [PATCH 13/14] bump version to 6.1.5 --- Oqtane.Client/Oqtane.Client.csproj | 4 ++-- Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj | 4 ++-- .../Oqtane.Database.PostgreSQL.csproj | 4 ++-- Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj | 4 ++-- Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj | 4 ++-- Oqtane.Maui/Oqtane.Maui.csproj | 6 +++--- Oqtane.Package/Oqtane.Client.nuspec | 4 ++-- Oqtane.Package/Oqtane.Framework.nuspec | 6 +++--- Oqtane.Package/Oqtane.Server.nuspec | 4 ++-- Oqtane.Package/Oqtane.Shared.nuspec | 4 ++-- Oqtane.Package/Oqtane.Updater.nuspec | 4 ++-- Oqtane.Package/install.ps1 | 2 +- Oqtane.Package/upgrade.ps1 | 2 +- Oqtane.Server/Oqtane.Server.csproj | 4 ++-- Oqtane.Shared/Oqtane.Shared.csproj | 4 ++-- Oqtane.Shared/Shared/Constants.cs | 4 ++-- Oqtane.Updater/Oqtane.Updater.csproj | 4 ++-- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Oqtane.Client/Oqtane.Client.csproj b/Oqtane.Client/Oqtane.Client.csproj index 267c96a4..6c4b6c37 100644 --- a/Oqtane.Client/Oqtane.Client.csproj +++ b/Oqtane.Client/Oqtane.Client.csproj @@ -4,7 +4,7 @@ net9.0 Exe Debug;Release - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -12,7 +12,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git Oqtane diff --git a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj index 86ccefef..e2b748fe 100644 --- a/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj +++ b/Oqtane.Database.MySQL/Oqtane.Database.MySQL.csproj @@ -2,7 +2,7 @@ net9.0 - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -10,7 +10,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git true diff --git a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj index 601f62e2..77747a21 100644 --- a/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj +++ b/Oqtane.Database.PostgreSQL/Oqtane.Database.PostgreSQL.csproj @@ -2,7 +2,7 @@ net9.0 - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -10,7 +10,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git true diff --git a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj index 70bd3ac1..1ea0a521 100644 --- a/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj +++ b/Oqtane.Database.SqlServer/Oqtane.Database.SqlServer.csproj @@ -2,7 +2,7 @@ net9.0 - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -10,7 +10,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git true diff --git a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj index 6ed046be..b9c593cc 100644 --- a/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj +++ b/Oqtane.Database.Sqlite/Oqtane.Database.Sqlite.csproj @@ -2,7 +2,7 @@ net9.0 - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -10,7 +10,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git true diff --git a/Oqtane.Maui/Oqtane.Maui.csproj b/Oqtane.Maui/Oqtane.Maui.csproj index fdb4801c..f7dbf38d 100644 --- a/Oqtane.Maui/Oqtane.Maui.csproj +++ b/Oqtane.Maui/Oqtane.Maui.csproj @@ -6,7 +6,7 @@ Exe - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -14,7 +14,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git Oqtane.Maui @@ -30,7 +30,7 @@ com.oqtane.maui - 6.1.4 + 6.1.5 1 diff --git a/Oqtane.Package/Oqtane.Client.nuspec b/Oqtane.Package/Oqtane.Client.nuspec index 6ff7ced3..18ea653b 100644 --- a/Oqtane.Package/Oqtane.Client.nuspec +++ b/Oqtane.Package/Oqtane.Client.nuspec @@ -2,7 +2,7 @@ Oqtane.Client - 6.1.4 + 6.1.5 Shaun Walker .NET Foundation Oqtane Framework @@ -12,7 +12,7 @@ false MIT https://github.com/oqtane/oqtane.framework - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 readme.md icon.png oqtane diff --git a/Oqtane.Package/Oqtane.Framework.nuspec b/Oqtane.Package/Oqtane.Framework.nuspec index 919e7025..e58a74a2 100644 --- a/Oqtane.Package/Oqtane.Framework.nuspec +++ b/Oqtane.Package/Oqtane.Framework.nuspec @@ -2,7 +2,7 @@ Oqtane.Framework - 6.1.4 + 6.1.5 Shaun Walker .NET Foundation Oqtane Framework @@ -11,8 +11,8 @@ .NET Foundation false MIT - https://github.com/oqtane/oqtane.framework/releases/download/v6.1.4/Oqtane.Framework.6.1.4.Upgrade.zip - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/download/v6.1.5/Oqtane.Framework.6.1.5.Upgrade.zip + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 readme.md icon.png oqtane framework diff --git a/Oqtane.Package/Oqtane.Server.nuspec b/Oqtane.Package/Oqtane.Server.nuspec index c0254edc..d7e88718 100644 --- a/Oqtane.Package/Oqtane.Server.nuspec +++ b/Oqtane.Package/Oqtane.Server.nuspec @@ -2,7 +2,7 @@ Oqtane.Server - 6.1.4 + 6.1.5 Shaun Walker .NET Foundation Oqtane Framework @@ -12,7 +12,7 @@ false MIT https://github.com/oqtane/oqtane.framework - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 readme.md icon.png oqtane diff --git a/Oqtane.Package/Oqtane.Shared.nuspec b/Oqtane.Package/Oqtane.Shared.nuspec index 5b94b83b..f8e1f177 100644 --- a/Oqtane.Package/Oqtane.Shared.nuspec +++ b/Oqtane.Package/Oqtane.Shared.nuspec @@ -2,7 +2,7 @@ Oqtane.Shared - 6.1.4 + 6.1.5 Shaun Walker .NET Foundation Oqtane Framework @@ -12,7 +12,7 @@ false MIT https://github.com/oqtane/oqtane.framework - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 readme.md icon.png oqtane diff --git a/Oqtane.Package/Oqtane.Updater.nuspec b/Oqtane.Package/Oqtane.Updater.nuspec index b94833cf..9bfc53a1 100644 --- a/Oqtane.Package/Oqtane.Updater.nuspec +++ b/Oqtane.Package/Oqtane.Updater.nuspec @@ -2,7 +2,7 @@ Oqtane.Updater - 6.1.4 + 6.1.5 Shaun Walker .NET Foundation Oqtane Framework @@ -12,7 +12,7 @@ false MIT https://github.com/oqtane/oqtane.framework - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 readme.md icon.png oqtane diff --git a/Oqtane.Package/install.ps1 b/Oqtane.Package/install.ps1 index 6426442d..137b9b7e 100644 --- a/Oqtane.Package/install.ps1 +++ b/Oqtane.Package/install.ps1 @@ -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 diff --git a/Oqtane.Package/upgrade.ps1 b/Oqtane.Package/upgrade.ps1 index 958e0029..e2e5031a 100644 --- a/Oqtane.Package/upgrade.ps1 +++ b/Oqtane.Package/upgrade.ps1 @@ -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 diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index 40d26e29..ccd8323f 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -3,7 +3,7 @@ net9.0 Debug;Release - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -11,7 +11,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git Oqtane diff --git a/Oqtane.Shared/Oqtane.Shared.csproj b/Oqtane.Shared/Oqtane.Shared.csproj index 8cc49663..331fe1fb 100644 --- a/Oqtane.Shared/Oqtane.Shared.csproj +++ b/Oqtane.Shared/Oqtane.Shared.csproj @@ -3,7 +3,7 @@ net9.0 Debug;Release - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -11,7 +11,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git Oqtane diff --git a/Oqtane.Shared/Shared/Constants.cs b/Oqtane.Shared/Shared/Constants.cs index c24d54a5..b6c402f1 100644 --- a/Oqtane.Shared/Shared/Constants.cs +++ b/Oqtane.Shared/Shared/Constants.cs @@ -4,8 +4,8 @@ namespace Oqtane.Shared { public class Constants { - public static readonly string Version = "6.1.4"; - public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2,3.4.3,4.0.0,4.0.1,4.0.2,4.0.3,4.0.4,4.0.5,4.0.6,5.0.0,5.0.1,5.0.2,5.0.3,5.1.0,5.1.1,5.1.2,5.2.0,5.2.1,5.2.2,5.2.3,5.2.4,6.0.0,6.0.1,6.1.0,6.1.1,6.1.2,6.1.3,6.1.4"; + public static readonly string Version = "6.1.5"; + public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3,1.0.4,2.0.0,2.0.1,2.0.2,2.1.0,2.2.0,2.3.0,2.3.1,3.0.0,3.0.1,3.0.2,3.0.3,3.1.0,3.1.1,3.1.2,3.1.3,3.1.4,3.2.0,3.2.1,3.3.0,3.3.1,3.4.0,3.4.1,3.4.2,3.4.3,4.0.0,4.0.1,4.0.2,4.0.3,4.0.4,4.0.5,4.0.6,5.0.0,5.0.1,5.0.2,5.0.3,5.1.0,5.1.1,5.1.2,5.2.0,5.2.1,5.2.2,5.2.3,5.2.4,6.0.0,6.0.1,6.1.0,6.1.1,6.1.2,6.1.3,6.1.4,6.1.5"; public const string PackageId = "Oqtane.Framework"; public const string ClientId = "Oqtane.Client"; public const string UpdaterPackageId = "Oqtane.Updater"; diff --git a/Oqtane.Updater/Oqtane.Updater.csproj b/Oqtane.Updater/Oqtane.Updater.csproj index 57fab560..9e2cde44 100644 --- a/Oqtane.Updater/Oqtane.Updater.csproj +++ b/Oqtane.Updater/Oqtane.Updater.csproj @@ -3,7 +3,7 @@ net9.0 Exe - 6.1.4 + 6.1.5 Oqtane Shaun Walker .NET Foundation @@ -11,7 +11,7 @@ .NET Foundation https://www.oqtane.org https://github.com/oqtane/oqtane.framework/blob/dev/LICENSE - https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.4 + https://github.com/oqtane/oqtane.framework/releases/tag/v6.1.5 https://github.com/oqtane/oqtane.framework Git Oqtane From 8cec847188fc92a0126305bec1ffa1ef79ea7d17 Mon Sep 17 00:00:00 2001 From: sbwalker Date: Tue, 12 Aug 2025 16:36:39 -0400 Subject: [PATCH 14/14] upgrade SQLitePCLRaw.bundle_e_sqlite3 package and add logic to release.cmd to remove android and ios client runtimes --- Oqtane.Package/release.cmd | 12 +++++++++--- Oqtane.Server/Oqtane.Server.csproj | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Oqtane.Package/release.cmd b/Oqtane.Package/release.cmd index 8bc6518a..641cd4c4 100644 --- a/Oqtane.Package/release.cmd +++ b/Oqtane.Package/release.cmd @@ -6,13 +6,19 @@ nuget.exe pack Oqtane.Client.nuspec nuget.exe pack Oqtane.Server.nuspec nuget.exe pack Oqtane.Shared.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" 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" -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\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 set retain=Placeholder.txt for /D %%i in ("..\Oqtane.Server\bin\Release\net9.0\publish\wwwroot\_content\*") do ( diff --git a/Oqtane.Server/Oqtane.Server.csproj b/Oqtane.Server/Oqtane.Server.csproj index ccd8323f..f05db85a 100644 --- a/Oqtane.Server/Oqtane.Server.csproj +++ b/Oqtane.Server/Oqtane.Server.csproj @@ -45,7 +45,7 @@ - +