fix CURR_Logger being nothing, create NI config if it does not exist, rename CURR_MyLogger to CURR_LogConfig
This commit is contained in:
parent
7361ff46fd
commit
aef4a040ed
@ -5,10 +5,13 @@ Public Class ClassDIProfile
|
|||||||
Public Shared xmlConfigFile As String
|
Public Shared xmlConfigFile As String
|
||||||
Public Shared aktivesProfil As ClassDIProfil
|
Public Shared aktivesProfil As ClassDIProfil
|
||||||
Public Shared aktivesProfilAusProfileigenschaften As Boolean = False
|
Public Shared aktivesProfilAusProfileigenschaften As Boolean = False
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
|
|
||||||
Public Shared Sub Init()
|
Public Shared Sub Init()
|
||||||
xmlConfigFile = My.Application.Info.DirectoryPath & "\" & My.Settings.vDIConfigDatei
|
Dim oConfigPath As String = My.Application.Info.DirectoryPath & "\" & My.Settings.vDIConfigDatei
|
||||||
|
CURR_Logger.Info("[ClassDIProfile] Loading config for DI from {0}", oConfigPath)
|
||||||
|
|
||||||
|
xmlConfigFile = oConfigPath
|
||||||
ClassDIProfile.LoadFromXmlFile()
|
ClassDIProfile.LoadFromXmlFile()
|
||||||
' 3b. Windream initialisieren (Connection, Session, ... aufbauen)
|
' 3b. Windream initialisieren (Connection, Session, ... aufbauen)
|
||||||
_windream.Init()
|
_windream.Init()
|
||||||
@ -98,7 +101,7 @@ Public Class ClassDIProfile
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function IsXmlAccessable()
|
Public Shared Function IsXmlAccessable() As Boolean
|
||||||
Dim xml As New Xml.XmlDocument
|
Dim xml As New Xml.XmlDocument
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@ -110,6 +113,9 @@ Public Class ClassDIProfile
|
|||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Try
|
Try
|
||||||
|
CURR_Logger.Warn("[ClassDIProfile] Could not load config file, creating default.")
|
||||||
|
CURR_Logger.Error(ex)
|
||||||
|
|
||||||
If My.Settings.vLogErrorsonly = False Then MsgBox("System kann nicht auf Konfig-Datei " & vbNewLine & xmlConfigFile & vbNewLine & " zugreifen! (Nicht vorhanden bzw Syntaxfehler)" & vbNewLine & "Datei wird neu erstellt!", MsgBoxStyle.Exclamation, "Achtung:")
|
If My.Settings.vLogErrorsonly = False Then MsgBox("System kann nicht auf Konfig-Datei " & vbNewLine & xmlConfigFile & vbNewLine & " zugreifen! (Nicht vorhanden bzw Syntaxfehler)" & vbNewLine & "Datei wird neu erstellt!", MsgBoxStyle.Exclamation, "Achtung:")
|
||||||
Dim fw As System.IO.StreamWriter = New System.IO.StreamWriter(xmlConfigFile)
|
Dim fw As System.IO.StreamWriter = New System.IO.StreamWriter(xmlConfigFile)
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
Public Shared xmlConfigFile As String
|
Public Shared xmlConfigFile As String
|
||||||
Public Shared aktivesProfil As ClassMI_Profil
|
Public Shared aktivesProfil As ClassMI_Profil
|
||||||
Public Shared aktivesProfilAusProfileigenschaften As Boolean = False
|
Public Shared aktivesProfilAusProfileigenschaften As Boolean = False
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
'Public Shared xmlConfigFile As String = My.Settings.vConfigDatei
|
'Public Shared xmlConfigFile As String = My.Settings.vConfigDatei
|
||||||
'Private Shared config As ClassMerkatorIntegrationKonfiguration = New ClassMerkatorIntegrationKonfiguration()
|
'Private Shared config As ClassMerkatorIntegrationKonfiguration = New ClassMerkatorIntegrationKonfiguration()
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
Private _namenskonvention As String
|
Private _namenskonvention As String
|
||||||
Private _zielort As String
|
Private _zielort As String
|
||||||
|
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
|
|
||||||
Private _saved As Boolean
|
Private _saved As Boolean
|
||||||
'Private _config As ClassNachindexierungKonfiguration = New ClassNachindexierungKonfiguration
|
'Private _config As ClassNachindexierungKonfiguration = New ClassNachindexierungKonfiguration
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Public Class ClassMoReDokumentarten
|
Public Class ClassMoReDokumentarten
|
||||||
|
|
||||||
Private Shared _profiles() As ClassMoReDokumentart
|
Private Shared _profiles() As ClassMoReDokumentart
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Public Shared xmlConfigFile As String
|
Public Shared xmlConfigFile As String
|
||||||
|
|
||||||
Public Shared Sub Init()
|
Public Shared Sub Init()
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
Private _CrFolder_Created_Folder As String
|
Private _CrFolder_Created_Folder As String
|
||||||
Private _CrFolder_move As Boolean
|
Private _CrFolder_move As Boolean
|
||||||
|
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
|
|
||||||
Private _saved As Boolean
|
Private _saved As Boolean
|
||||||
'Private _config As ClassNachindexierungKonfiguration = New ClassNachindexierungKonfiguration
|
'Private _config As ClassNachindexierungKonfiguration = New ClassNachindexierungKonfiguration
|
||||||
|
|||||||
@ -2,15 +2,19 @@
|
|||||||
Public Class ClassNIProfile
|
Public Class ClassNIProfile
|
||||||
Private Shared _Logger As DigitalData.Modules.Logging.Logger
|
Private Shared _Logger As DigitalData.Modules.Logging.Logger
|
||||||
Private Shared _profiles() As ClassNIProfil
|
Private Shared _profiles() As ClassNIProfil
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Public Shared xmlConfigFile As String
|
Public Shared xmlConfigFile As String
|
||||||
|
|
||||||
Public Shared Sub Init()
|
Public Shared Sub Init()
|
||||||
xmlConfigFile = My.Application.Info.DirectoryPath & "\" & My.Settings.vNIConfigDatei
|
Dim oConfigPath As String = My.Application.Info.DirectoryPath & "\" & My.Settings.vNIConfigDatei
|
||||||
|
CURR_Logger.Info("[ClassNIProfile] Loading config for NI from {0}", oConfigPath)
|
||||||
|
|
||||||
|
xmlConfigFile = oConfigPath
|
||||||
ClassNIProfile.LoadFromXmlFile()
|
ClassNIProfile.LoadFromXmlFile()
|
||||||
' 3b. Windream initialisieren (Connection, Session, ... aufbauen)
|
' 3b. Windream initialisieren (Connection, Session, ... aufbauen)
|
||||||
_windream.Init()
|
_windream.Init()
|
||||||
End Sub
|
End Sub
|
||||||
Public Shared Function IsXmlAccessable()
|
Public Shared Function IsXmlAccessable() As Boolean
|
||||||
Dim xml As New Xml.XmlDocument
|
Dim xml As New Xml.XmlDocument
|
||||||
Try
|
Try
|
||||||
' XML-Datei laden und speichern um Zugriff zu testen
|
' XML-Datei laden und speichern um Zugriff zu testen
|
||||||
@ -20,7 +24,8 @@ Public Class ClassNIProfile
|
|||||||
Return True
|
Return True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Try
|
Try
|
||||||
_Logger.Error(ex)
|
CURR_Logger.Warn("[ClassNIProfile] Could not load config file, creating default.")
|
||||||
|
CURR_Logger.Error(ex)
|
||||||
|
|
||||||
Dim fw As System.IO.StreamWriter = New System.IO.StreamWriter(xmlConfigFile)
|
Dim fw As System.IO.StreamWriter = New System.IO.StreamWriter(xmlConfigFile)
|
||||||
fw.WriteLine("<?xml version=""1.0"" encoding=""ISO-8859-1"" standalone=""yes""?>")
|
fw.WriteLine("<?xml version=""1.0"" encoding=""ISO-8859-1"" standalone=""yes""?>")
|
||||||
@ -34,7 +39,6 @@ Public Class ClassNIProfile
|
|||||||
Catch e2 As Exception
|
Catch e2 As Exception
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
Public Shared Sub LoadFromXmlFile()
|
Public Shared Sub LoadFromXmlFile()
|
||||||
@ -47,7 +51,9 @@ Public Class ClassNIProfile
|
|||||||
If xmlConfigFile Is Nothing Then Exit Sub
|
If xmlConfigFile Is Nothing Then Exit Sub
|
||||||
|
|
||||||
If Not xmlConfigFile = "" Then
|
If Not xmlConfigFile = "" Then
|
||||||
If System.IO.File.Exists(xmlConfigFile) Then
|
'If System.IO.File.Exists(xmlConfigFile) Then
|
||||||
|
If ClassNIProfile.IsXmlAccessable() Then
|
||||||
|
|
||||||
xml = New Xml.XmlDocument()
|
xml = New Xml.XmlDocument()
|
||||||
xml.Load(xmlConfigFile)
|
xml.Load(xmlConfigFile)
|
||||||
'MsgBox(xmlConfigFile)
|
'MsgBox(xmlConfigFile)
|
||||||
|
|||||||
@ -24,6 +24,6 @@ Module ModuleCURRENT
|
|||||||
Public CURRENT_DYNAMICFOLDER As String
|
Public CURRENT_DYNAMICFOLDER As String
|
||||||
Public CURRENT_IndexList As List(Of String)
|
Public CURRENT_IndexList As List(Of String)
|
||||||
|
|
||||||
Public CURR_MyLogger As LogConfig
|
Public Property CURR_LogConfig As LogConfig
|
||||||
Public CURR_Logger As DigitalData.Modules.Logging.Logger
|
Public Property CURR_Logger As DigitalData.Modules.Logging.Logger
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@ -86,9 +86,15 @@
|
|||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="DigitalData.Modules.Config">
|
||||||
|
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Database">
|
<Reference Include="DigitalData.Modules.Database">
|
||||||
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DigitalData.Modules.Filesystem">
|
||||||
|
<HintPath>..\..\DDMonorepo\Modules.Filesystem\bin\Debug\DigitalData.Modules.Filesystem.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DigitalData.Modules.Logging">
|
<Reference Include="DigitalData.Modules.Logging">
|
||||||
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
<HintPath>..\..\DDMonorepo\Modules.Logging\bin\Debug\DigitalData.Modules.Logging.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@ -550,6 +556,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="app.config">
|
<None Include="app.config">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="DSNachbearbeitung.xsc">
|
<None Include="DSNachbearbeitung.xsc">
|
||||||
<DependentUpon>DSNachbearbeitung.xsd</DependentUpon>
|
<DependentUpon>DSNachbearbeitung.xsd</DependentUpon>
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Public Class frmDIProfilEigenschaften
|
|||||||
Dim arrProfile(1, 1) As Object
|
Dim arrProfile(1, 1) As Object
|
||||||
Dim Prof_Anzahl As Integer
|
Dim Prof_Anzahl As Integer
|
||||||
|
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Private Shared _Instance As frmDIProfilEigenschaften = Nothing
|
Private Shared _Instance As frmDIProfilEigenschaften = Nothing
|
||||||
|
|
||||||
Public Shared Function Instance() As frmDIProfilEigenschaften
|
Public Shared Function Instance() As frmDIProfilEigenschaften
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Public Class frmDIProfilHinzufuegen
|
Public Class frmDIProfilHinzufuegen
|
||||||
|
|
||||||
Public oSession
|
Public oSession
|
||||||
Protected _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Protected _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
' Private _parentClass As ClassDateiimport = ClassDateiimport.GetInstance
|
' Private _parentClass As ClassDateiimport = ClassDateiimport.GetInstance
|
||||||
|
|
||||||
Private Sub frmProfilHinzufügen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
Private Sub frmProfilHinzufügen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||||
|
|||||||
@ -28,7 +28,7 @@ Public Class frmDIRegelAssistent
|
|||||||
Private _trennzeichen_temp As String = " "
|
Private _trennzeichen_temp As String = " "
|
||||||
Private _value As String = ""
|
Private _value As String = ""
|
||||||
Private _indexe As String()
|
Private _indexe As String()
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Private _datumFormat As String = ""
|
Private _datumFormat As String = ""
|
||||||
Private _removeZeros As Boolean = False
|
Private _removeZeros As Boolean = False
|
||||||
#End Region
|
#End Region
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Private profilname As String
|
Private profilname As String
|
||||||
Private selectedProfil As ClassDIProfil
|
Private selectedProfil As ClassDIProfil
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
|
|
||||||
Public _regeln As ClassDIRegeln
|
Public _regeln As ClassDIRegeln
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
Public Class frmMIParameterHinzufügen
|
Public Class frmMIParameterHinzufügen
|
||||||
Public selectedProfil As ClassMI_Profil
|
Public selectedProfil As ClassMI_Profil
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
|
|
||||||
Private Sub frmParameterHinzufügen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
Private Sub frmParameterHinzufügen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||||
If Not Me.selectedProfil.DokumenttypString = "" Then
|
If Not Me.selectedProfil.DokumenttypString = "" Then
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
' entspricht dem, über die Toolbar-Combobox ausgewählten, Profil und enthält alle relevanten Informationen darüber
|
' entspricht dem, über die Toolbar-Combobox ausgewählten, Profil und enthält alle relevanten Informationen darüber
|
||||||
Private _selectedProfile As ClassMI_Profil
|
Private _selectedProfile As ClassMI_Profil
|
||||||
Dim Formloaded As Boolean = False
|
Dim Formloaded As Boolean = False
|
||||||
Public Shared _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Public Shared _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Private Shared _Instance As frmMIProfileigenschaften = Nothing
|
Private Shared _Instance As frmMIProfileigenschaften = Nothing
|
||||||
Public Shared Function Instance() As frmMIProfileigenschaften
|
Public Shared Function Instance() As frmMIProfileigenschaften
|
||||||
If _Instance Is Nothing OrElse _Instance.IsDisposed = True Then
|
If _Instance Is Nothing OrElse _Instance.IsDisposed = True Then
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
Imports Scripting
|
Imports Scripting
|
||||||
Public Class frmMI_Profilhinzufuegen
|
Public Class frmMI_Profilhinzufuegen
|
||||||
Public oSession
|
Public oSession
|
||||||
Protected _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Protected _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
'Public oSession
|
'Public oSession
|
||||||
'Public oConnect
|
'Public oConnect
|
||||||
'Public oBrowser As New WMOBRWSLib.ServerBrowser
|
'Public oBrowser As New WMOBRWSLib.ServerBrowser
|
||||||
|
|||||||
@ -6,7 +6,7 @@ Public Class frmNB_AD_add
|
|||||||
Dim Rechtename As String = ""
|
Dim Rechtename As String = ""
|
||||||
Dim deleteall As Boolean = False
|
Dim deleteall As Boolean = False
|
||||||
Dim AccessRight As Integer
|
Dim AccessRight As Integer
|
||||||
Private _windream As New ClassWindream_allgemein(CURR_MyLogger)
|
Private _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
Dim _windreamRechte As ClassWD_Rechte
|
Dim _windreamRechte As ClassWD_Rechte
|
||||||
Dim countRegel As Integer
|
Dim countRegel As Integer
|
||||||
Dim _deleteRoles As Boolean = False
|
Dim _deleteRoles As Boolean = False
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Public Class frmNIProfilhinzufuegen
|
|||||||
|
|
||||||
|
|
||||||
Private Sub frmNIProfilhinzufuegen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
Private Sub frmNIProfilhinzufuegen_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||||
_windream = New ClassWindream_allgemein(CURR_MyLogger)
|
_windream = New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
' Verbindung mit windream herstellen
|
' Verbindung mit windream herstellen
|
||||||
_windream.Init()
|
_windream.Init()
|
||||||
|
|
||||||
|
|||||||
@ -52,10 +52,10 @@ Public Class frmNIVerknuepfungen
|
|||||||
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
|
|
||||||
_Logger = CURR_MyLogger.GetLogger()
|
_Logger = CURR_LogConfig.GetLogger()
|
||||||
_flagIgnoreCheckedChanged = False
|
_flagIgnoreCheckedChanged = False
|
||||||
_windream = New ClassWindream_allgemein(CURR_MyLogger)
|
_windream = New ClassWindream_allgemein(CURR_LogConfig)
|
||||||
database = New ClassNIDatenbankzugriff(CURR_MyLogger)
|
database = New ClassNIDatenbankzugriff(CURR_LogConfig)
|
||||||
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
||||||
Me.LoadProfilesInCombobox()
|
Me.LoadProfilesInCombobox()
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
@ -47,7 +47,8 @@ Public Class frmStart
|
|||||||
Private Sub FMStart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
Private Sub FMStart_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||||
_MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
|
_MyLogger = New LogConfig(LogConfig.PathType.CustomPath, Path.Combine(My.Application.Info.DirectoryPath, "Log"))
|
||||||
_Logger = _MyLogger.GetLogger()
|
_Logger = _MyLogger.GetLogger()
|
||||||
CURR_MyLogger = _MyLogger
|
CURR_Logger = _Logger
|
||||||
|
CURR_LogConfig = _MyLogger
|
||||||
'Aktueller Benutzer
|
'Aktueller Benutzer
|
||||||
Me.tslblVersion.Text = Environment.UserName.ToString
|
Me.tslblVersion.Text = Environment.UserName.ToString
|
||||||
Me.Text = Application.CompanyName & "-" & Application.ProductName
|
Me.Text = Application.CompanyName & "-" & Application.ProductName
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user