MS Release

This commit is contained in:
2022-05-17 17:00:50 +02:00
parent 18095b5bef
commit 63736e83d3
31 changed files with 735 additions and 1943 deletions

View File

@@ -45,10 +45,6 @@ Public Class ClassInit
<STAThread()>
Public Sub InitUserConfig()
Try
'DataASorDB = New ClassDataASorDB
Dim oUserAppDataPath As String = Application.UserAppDataPath
Dim oLegacyAppDataPath As String = Application.UserAppDataPath
Dim oCommonAppDataPath = Application.CommonAppDataPath
@@ -76,47 +72,47 @@ Public Class ClassInit
CONFIG = New ConfigManager(Of ClassConfig)(LOGCONFIG, oUserAppDataPath, oCommonAppDataPath, oStartupPath)
LOGGER.Info("Config loaded")
Try
If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then
LOGGER.Debug("Test Connection String loaded")
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionStringTest)
Else
LOGGER.Debug("Connection String loaded")
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionString)
End If
Catch ex As Exception
LOGGER.Error(ex, "Unexpected Error Getting CONFIG.TestMode or CONFIG.ConnectionStringTest")
End Try
If CONFIG.Config.ConnectionStringTest <> String.Empty And CONFIG.Config.TestMode = True Then
LOGGER.Debug("Test Connection String loaded")
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionStringTest)
Else
LOGGER.Debug("Connection String loaded")
CONNECTION_STRING_ECM = DecryptConnectionString(CONFIG.Config.ConnectionString)
End If
Try
If CONFIG.Config.EDMIAppServer <> String.Empty Then
Try
LOGGER.Info($"Configuration EDMIAppServer [{CONFIG.Config.EDMIAppServer}] will be used...")
'If CONFIG.Config.ConnectionStringAppServer <> String.Empty Then
' LOGGER.Debug("ConnectionStringAppServer will be used")
' CONNECTION_STRING_APP_SERVER = DecryptConnectionString(CONFIG.Config.ConnectionStringAppServer)
' CONNECTION_STRING_READ = CONNECTION_STRING_APP_SERVER
'Else
' CONNECTION_STRING_READ = CONNECTION_STRING_ECM
'End If
_Client = New Client(LOGCONFIG, CONFIG.Config.EDMIAppServer)
If Not IsNothing(_Client) Then
If _Client.Connect() Then
EDMIAppServerActive = True
EDMIService.Client = _Client
EDMIService.Address = CONFIG.Config.EDMIAppServer
If CONFIG.Config.EDMIAppServer <> String.Empty Then
Try
'Dim oSplit() = CONFIG.Config.EDMIAppServer.ToString.Split(";")
'Dim oAppServer = oSplit(0)
'Dim oAppServerPort = 9000
'If oSplit.Length = 2 Then
' oAppServerPort = oSplit(1)
'End If
_Client = New Client(LOGCONFIG, CONFIG.Config.EDMIAppServer)
If Not IsNothing(_Client) Then
If _Client.Connect() Then
EDMIAppServerActive = True
LOGGER.Info($"EDMIAppServer [{CONFIG.Config.EDMIAppServer}] is active!")
Else
LOGGER.Warn($"#### !!! Could not Connect to APPServer [{CONFIG.Config.EDMIAppServer}]!!! ###")
LOGGER.Info($"EDMIAppServer [{CONFIG.Config.EDMIAppServer}] is active!")
Else
LOGGER.Warn($"#### !!! Could not Connect to APPServer [{CONFIG.Config.EDMIAppServer}]!!! ###")
End If
End If
End If
Catch ex As Exception
LOGGER.Warn($"Could not initialize the AppServer: {ex.Message}")
End Try
Catch ex As Exception
LOGGER.Warn($"Could not initialize the AppServer: {ex.Message}")
End Try
Else
LOGGER.Debug("EDMI Server Address not found. Skipping.")
End If
Catch ex As Exception
LOGGER.Error(ex, "Unexpected Error Getting CONFIG.EDMIAppServer")
End Try
Else
LOGGER.Debug("EDMI Server Address not found. Skipping.")
End If
INDEX_DMS_ERSTELLT = CONFIG.Config.IndexDmsErstellt
INDEX_DMS_ERSTELLT_ZEIT = CONFIG.Config.IndexDmsErstelltZeit
@@ -161,20 +157,32 @@ Public Class ClassInit
End Function
<STAThread()>
Public Function InitDatabase()
Public Function InitDatabase(GetCSFromAppServ As Boolean)
If GetCSFromAppServ = True Then
LOGGER.Info("Getting DatabaseInfo from ApplicationServer...")
End If
Dim Database_ECM As MSSQLServer = Nothing
Dim Database_IDB As MSSQLServer = Nothing
If CONNECTION_STRING_ECM = String.Empty Then
MsgBox("No Databaseconnection configured. (First Start or Appdata not accessible)" & vbNewLine & "Basic-Config will be loaded.", MsgBoxStyle.Information)
ERROR_STATE = "NO DB-CONNECTION"
frmKonfig.ShowDialog()
If GetCSFromAppServ = False Then
If CONNECTION_STRING_ECM = String.Empty Then
MsgBox("No Databaseconnection configured. (First Start or Appdata not accessible)" & vbNewLine & "Basic-Config will be loaded.", MsgBoxStyle.Information)
ERROR_STATE = "NO DB-CONNECTION"
frmKonfig.ShowDialog()
End If
End If
Database_ECM = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_ECM)
Dim oCSECM As String
If GetCSFromAppServ = False Then
oCSECM = CONNECTION_STRING_ECM
Else
oCSECM = EDMIService.Client.ClientConfig.ConnectionStringECM
CONNECTION_STRING_ECM = oCSECM
End If
Database_ECM = New MSSQLServer(LOGCONFIG, oCSECM)
If Database_ECM.DBInitialized = True Then
'ClassDatabase.Init(CONNECTION_STRING_ECM)
dbECMInitialized = True
DatabaseECM = Database_ECM
Else
dbECMInitialized = False
End If
@@ -183,21 +191,27 @@ Public Class ClassInit
MsgBox("Error in InitDatabase. (Connection DD_ECM failed) More information in the logfile.", MsgBoxStyle.Critical)
Return False
End If
If CONNECTION_STRING_IDB <> String.Empty Then
LOGGER.Debug("IDB Connection String exists, initializing IDB Database")
Database_IDB = New MSSQLServer(LOGCONFIG, CONNECTION_STRING_IDB)
If GetCSFromAppServ = True Or (GetCSFromAppServ = False And CONNECTION_STRING_IDB <> String.Empty) Then
Dim oCSIDB As String
If GetCSFromAppServ = False Then
oCSIDB = CONNECTION_STRING_IDB
Else
oCSIDB = EDMIService.Client.ClientConfig.ConnectionStringIDB
End If
Database_IDB = New MSSQLServer(LOGCONFIG, oCSIDB)
If Database_IDB.DBInitialized = True Then
CONNECTION_STRING_IDB = oCSIDB
DatabaseIDB = Database_IDB
dbIDBInitialized = True
IDB_ACTIVE = True
LOGGER.Info("IDB is active via Config")
End If
Else
LOGGER.Debug("IDB Connection String does not exist!")
End If
' We initialize the Class in anycase.
' If there is no client, it will fall back to the db by itself
DatabaseFallback = New DatabaseWithFallback(LOGCONFIG, _Client, Database_ECM, Database_IDB)
@@ -321,6 +335,15 @@ Public Class ClassInit
USER_IN_MODULE = DT_CHECKUSER_MODULE.Rows(0).Item("MODULE_ACCESS")
USER_IS_ADMIN = DT_CHECKUSER_MODULE.Rows(0).Item("IS_ADMIN")
User.IsAdmin = USER_IS_ADMIN
User.Surname = USER_SURNAME
User.GivenName = USER_PRENAME
User.Email = USER_EMAIL
User.UserName = USER_USERNAME
User.UserId = USER_ID
User.Language = USER_LANGUAGE
Try
USER_RIGHT_FILE_DELETE = IIf(IsDBNull(DT_CHECKUSER_MODULE.Rows(0).Item("USER_RIGHT_FILE_DEL")), False, DT_CHECKUSER_MODULE.Rows(0).Item("USER_RIGHT_FILE_DEL"))
@@ -467,7 +490,7 @@ Public Class ClassInit
.FilterExpression = "TYPE = 'DOC'",
.SortByColumn = "PROFILE_ID,TAB_INDEX"
})
BASEDATA_DT_PROFILE_SEARCHES_DOC = BASEDATA_DT_PROFILES_SEARCHES_DOC.Clone()
DT_FILTERED_PROFILE_SEARCHES_DOC = BASEDATA_DT_PROFILES_SEARCHES_DOC.Clone()
oStep = "TBPM_MAIN_VIEW_GROUPS"
oSql = "SELECT * FROM TBPM_MAIN_VIEW_GROUPS WHERE ACTIVE = 1"