v1.2.11.3 deployed

This commit is contained in:
2024-04-24 17:16:49 +01:00
parent 05f166f3d1
commit e40876aeb2
38 changed files with 1222 additions and 168 deletions
@@ -19,6 +19,7 @@ using Saxonite.Net.Standard.Dbas.App;
using Microsoft.Extensions.Hosting;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Utils;
using System.Text.RegularExpressions;
namespace Saxonite.Net.Core.Web.Online.App
{
@@ -92,7 +93,6 @@ namespace Saxonite.Net.Core.Web.Online.App
/// <summary>Initialise environment - from internal (above) or unit tests.</summary>
protected void InitEnvironment(IWebHostEnvironment env)
{
String fn = GetType().Name + ".InitEnvironment";
Development = env.IsDevelopment();
environmentName = env.EnvironmentName;
SaLogger.LogFilenamePrefix = "Sax-Web-Onl";
@@ -114,6 +114,9 @@ namespace Saxonite.Net.Core.Web.Online.App
appConfigs = SaxAppConfigHelper.ExtractAppConfigs(SaxConfiguration.GetSection("AppConfigs"));
emailConfigs = SaxEmailConfigHelper.ExtractEmailConfigs(SaxConfiguration.GetSection("EmailConfigs"));
LoggingRootFolder = AppConfig.Logging.RootFolder;
// Ensure root log folder ends with Admin folder.
if (!StringUtil.IsBlank(LoggingRootFolder) && !Regex.IsMatch(LoggingRootFolder, "[\\\\/]Online$", RegexOptions.IgnoreCase))
LoggingRootFolder = StringUtil.CombineFilePath(LoggingRootFolder, "Online");
// Application instance.
if (AppConfig.Instance.EqualsCI("Dev")) instanceType = Sax.InstanceType.Dev;
@@ -129,7 +132,7 @@ namespace Saxonite.Net.Core.Web.Online.App
}
if (DirectoryUtil.DirectoryExists(LoggingRootFolder))
SaLogger.LogFolder = LoggingRootFolder;
LogApplicationStart(fn);
LogApplicationStart(SysUtil.Fn);
// Session context - only one context available/necessary (for now).
SessionContextData_Online sessionContextData = new SessionContextData_Online(new SaxSessionContext_Web(100, Sax.Application.Online));
@@ -143,27 +146,10 @@ namespace Saxonite.Net.Core.Web.Online.App
}
catch (Exception exc)
{
SaLogger.Error(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Error(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc));
}
}
//-------------------------------------------------------------------
private void ConfigureDatabaseConnection(SessionContextData_Online sessionContextData, Sax.Database databaseInstance)
{
String fn = GetType().Name + ".ConfigureDatabaseConnection";
// Configure database connection.
SaxAppConfig.DatabaseConfig databaseConfig = AppConfig.Databases.Databases.GetValue(databaseInstance, new SaxAppConfig.DatabaseConfig());
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
config.location = databaseConfig.Location;
config.user = databaseConfig.User;
config.pword = databaseConfig.Password;
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
if (database.HasErrorState())
SaLogger.Warn(fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
sessionContextData.Databases.Add(databaseInstance, database);
}
//-------------------------------------------------------------------
}
//=======================================================================