ZooFlow: clean up classes, use base class
This commit is contained in:
parent
0bc57ca2bb
commit
1b11cde174
@ -7,6 +7,8 @@ Imports DigitalData.Modules.Logging
|
|||||||
''' Example: --start-search=id#7~doctype#ARE
|
''' Example: --start-search=id#7~doctype#ARE
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class ClassCommandlineArgs
|
Public Class ClassCommandlineArgs
|
||||||
|
Inherits Base.BaseClass
|
||||||
|
|
||||||
Private CommandLineArgTypes As New List(Of String) From {
|
Private CommandLineArgTypes As New List(Of String) From {
|
||||||
"show-profile",
|
"show-profile",
|
||||||
"start-search"
|
"start-search"
|
||||||
@ -18,12 +20,8 @@ Public Class ClassCommandlineArgs
|
|||||||
Public FunctionName As String
|
Public FunctionName As String
|
||||||
Public FunctionArgs As New Dictionary(Of String, String)
|
Public FunctionArgs As New Dictionary(Of String, String)
|
||||||
|
|
||||||
Private LogConfig As LogConfig
|
|
||||||
Private Logger As Logger
|
|
||||||
|
|
||||||
Public Sub New(pLogConfig As LogConfig)
|
Public Sub New(pLogConfig As LogConfig)
|
||||||
LogConfig = pLogConfig
|
MyBase.New(pLogConfig)
|
||||||
Logger = LogConfig.GetLogger()
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub Parse(Args As List(Of String))
|
Public Sub Parse(Args As List(Of String))
|
||||||
|
|||||||
@ -4,19 +4,21 @@ Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Public Class ClassDragDrop
|
Public Class ClassDragDrop
|
||||||
|
Inherits Base.BaseClass
|
||||||
|
|
||||||
Private downHitInfo As GridHitInfo = Nothing
|
Private downHitInfo As GridHitInfo = Nothing
|
||||||
Private _Logger As Logger
|
Private _Logger As Logger
|
||||||
Public Sub New()
|
Public Sub New(LogConfig As LogConfig)
|
||||||
_Logger = My.LogConfig.GetLogger
|
MyBase.New(LogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub AddGridView(view As GridView)
|
Public Sub AddGridView(view As GridView)
|
||||||
AddHandler view.MouseDown, AddressOf view_MouseDown
|
AddHandler view.MouseDown, AddressOf View_MouseDown
|
||||||
AddHandler view.MouseMove, AddressOf view_MouseMove
|
AddHandler view.MouseMove, AddressOf View_MouseMove
|
||||||
AddHandler view.GridControl.DragOver, AddressOf grid_DragOver
|
AddHandler view.GridControl.DragOver, AddressOf GridControl_DragOver
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub view_MouseDown(sender As Object, e As MouseEventArgs)
|
Private Sub View_MouseDown(sender As Object, e As MouseEventArgs)
|
||||||
Dim view As GridView = sender
|
Dim view As GridView = sender
|
||||||
downHitInfo = Nothing
|
downHitInfo = Nothing
|
||||||
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
||||||
@ -30,7 +32,7 @@ Public Class ClassDragDrop
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub view_MouseMove(sender As Object, e As MouseEventArgs)
|
Private Sub View_MouseMove(sender As Object, e As MouseEventArgs)
|
||||||
Try
|
Try
|
||||||
Dim view As GridView = sender
|
Dim view As GridView = sender
|
||||||
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
Dim hitInfo As GridHitInfo = view.CalcHitInfo(New Point(e.X, e.Y))
|
||||||
@ -67,18 +69,18 @@ Public Class ClassDragDrop
|
|||||||
|
|
||||||
DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = True
|
DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = True
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
MsgBox("Error in view_MouseMove: " & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Error in view_MouseMove: " & ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub grid_DragOver(sender As Object, e As DragEventArgs)
|
Private Sub GridControl_DragOver(sender As Object, e As DragEventArgs)
|
||||||
If e.Data.GetDataPresent(DataFormats.Text) Then
|
If e.Data.GetDataPresent(DataFormats.Text) Then
|
||||||
Dim data As String = e.Data.GetData(DataFormats.Text)
|
Dim data As String = e.Data.GetData(DataFormats.Text)
|
||||||
Dim source = data.Split("|")(1)
|
Dim source = data.Split("|")(1)
|
||||||
|
|||||||
@ -14,9 +14,9 @@ Imports DigitalData.GUIs.ZooFlow.ClassInitLoader
|
|||||||
Imports DigitalData.Controls.SQLConfig
|
Imports DigitalData.Controls.SQLConfig
|
||||||
|
|
||||||
Public Class ClassInit
|
Public Class ClassInit
|
||||||
|
Inherits Base.BaseClass
|
||||||
|
|
||||||
Private ReadOnly _MainForm As frmFlowForm
|
Private ReadOnly _MainForm As frmFlowForm
|
||||||
Private ReadOnly _Logger As Logger
|
|
||||||
Private ReadOnly _LogConfig As LogConfig
|
|
||||||
Private ReadOnly _DataASorDB As ClassDataASorDB
|
Private ReadOnly _DataASorDB As ClassDataASorDB
|
||||||
Private ReadOnly _Database As DatabaseWithFallback
|
Private ReadOnly _Database As DatabaseWithFallback
|
||||||
Private _Loader As ClassInitLoader
|
Private _Loader As ClassInitLoader
|
||||||
@ -24,9 +24,8 @@ Public Class ClassInit
|
|||||||
Public Event Completed As EventHandler
|
Public Event Completed As EventHandler
|
||||||
|
|
||||||
Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm)
|
Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm)
|
||||||
|
MyBase.New(LogConfig)
|
||||||
_MainForm = ParentForm
|
_MainForm = ParentForm
|
||||||
_LogConfig = LogConfig
|
|
||||||
_Logger = LogConfig.GetLogger()
|
|
||||||
|
|
||||||
'TODO: Remove when Globix uses DatabaseWithFallback
|
'TODO: Remove when Globix uses DatabaseWithFallback
|
||||||
clsDataASorDB = New ClassDataASorDB(LogConfig)
|
clsDataASorDB = New ClassDataASorDB(LogConfig)
|
||||||
@ -37,7 +36,7 @@ Public Class ClassInit
|
|||||||
MsgBox("Keine Verbindungs-Informationen hinterlegt. Anwendung wird beendet.", MsgBoxStyle.Critical, _MainForm.Text)
|
MsgBox("Keine Verbindungs-Informationen hinterlegt. Anwendung wird beendet.", MsgBoxStyle.Critical, _MainForm.Text)
|
||||||
Application.Exit()
|
Application.Exit()
|
||||||
Else
|
Else
|
||||||
_Loader = New ClassInitLoader()
|
_Loader = New ClassInitLoader(LogConfig)
|
||||||
|
|
||||||
' === Init Schritte definieren
|
' === Init Schritte definieren
|
||||||
_Loader.AddStep("Initializing Base", AddressOf InitializeBase, True)
|
_Loader.AddStep("Initializing Base", AddressOf InitializeBase, True)
|
||||||
@ -68,7 +67,7 @@ Public Class ClassInit
|
|||||||
My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString)
|
My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString)
|
||||||
|
|
||||||
If My.DatabaseECM.DBInitialized = False Then
|
If My.DatabaseECM.DBInitialized = False Then
|
||||||
_Logger.Warn("Could not initialize DD_ECM-Database!")
|
Logger.Warn("Could not initialize DD_ECM-Database!")
|
||||||
Throw New InitException("Could not initialize ECM-Database!")
|
Throw New InitException("Could not initialize ECM-Database!")
|
||||||
|
|
||||||
Else
|
Else
|
||||||
@ -76,12 +75,12 @@ Public Class ClassInit
|
|||||||
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl)
|
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl)
|
||||||
|
|
||||||
If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then
|
If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then
|
||||||
_Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!")
|
Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!")
|
||||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oDatatable.Rows.Count > 1 Then
|
If oDatatable.Rows.Count > 1 Then
|
||||||
_Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!")
|
||||||
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -96,7 +95,7 @@ Public Class ClassInit
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If My.DatabaseIDB.DBInitialized = False Then
|
If My.DatabaseIDB.DBInitialized = False Then
|
||||||
_Logger.Warn("Could not initialize IDB-Database!")
|
Logger.Warn("Could not initialize IDB-Database!")
|
||||||
Throw New InitException("Could not initialize IDB-Database!")
|
Throw New InitException("Could not initialize IDB-Database!")
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@ -105,7 +104,7 @@ Public Class ClassInit
|
|||||||
MyApplication.Service.Address = My.SystemConfig.AppServerConfig
|
MyApplication.Service.Address = My.SystemConfig.AppServerConfig
|
||||||
Dim oServerData = Client.ParseServiceAddress(My.SystemConfig.AppServerConfig)
|
Dim oServerData = Client.ParseServiceAddress(My.SystemConfig.AppServerConfig)
|
||||||
|
|
||||||
My.Application.Service.Client = New Client(_LogConfig, oServerData.Item1, oServerData.Item2)
|
My.Application.Service.Client = New Client(LogConfig, oServerData.Item1, oServerData.Item2)
|
||||||
|
|
||||||
If Not IsNothing(My.Application.Service.Client) Then
|
If Not IsNothing(My.Application.Service.Client) Then
|
||||||
If My.Application.Service.Client.Connect() Then
|
If My.Application.Service.Client.Connect() Then
|
||||||
@ -113,15 +112,15 @@ Public Class ClassInit
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Throw New InitException("Error in InitializeService", ex)
|
Throw New InitException("Error in InitializeService", ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Private Sub InitializeDatabaseWithFallback(MyApplication As My.MyApplication)
|
Private Sub InitializeDatabaseWithFallback(MyApplication As My.MyApplication)
|
||||||
Try
|
Try
|
||||||
My.Database = New DatabaseWithFallback(_LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
|
My.Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Throw New InitException("Error InitializeDatabaseWithFallback!", ex)
|
Throw New InitException("Error InitializeDatabaseWithFallback!", ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@ -155,7 +154,7 @@ Public Class ClassInit
|
|||||||
Next
|
Next
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Throw New InitException("Error while initializing user!", ex)
|
Throw New InitException("Error while initializing user!", ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@ -182,7 +181,7 @@ Public Class ClassInit
|
|||||||
|
|
||||||
MyApplication.Settings.GdPictureKey = NotNull(oRow.Item("LICENSE"), String.Empty)
|
MyApplication.Settings.GdPictureKey = NotNull(oRow.Item("LICENSE"), String.Empty)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Throw New InitException("Error Initialize3rdParty!", ex)
|
Throw New InitException("Error Initialize3rdParty!", ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@ -202,7 +201,7 @@ Public Class ClassInit
|
|||||||
End Select
|
End Select
|
||||||
Next
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
Throw New InitException("Error in InitBasicData", ex)
|
Throw New InitException("Error in InitBasicData", ex)
|
||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
@ -300,15 +299,15 @@ Public Class ClassInit
|
|||||||
|
|
||||||
Case "RESULT"
|
Case "RESULT"
|
||||||
Dim oLines = oValue.ToString.Split("|"c)
|
Dim oLines = oValue.ToString.Split("|"c)
|
||||||
_Logger.Debug("Access Result for Module {0}", ModuleName)
|
Logger.Debug("Access Result for Module {0}", ModuleName)
|
||||||
For Each oLine In oLines
|
For Each oLine In oLines
|
||||||
_Logger.Debug(oLine.Trim)
|
Logger.Debug(oLine.Trim)
|
||||||
Next
|
Next
|
||||||
Case "WORKING_MODE"
|
Case "WORKING_MODE"
|
||||||
Dim oLines = oValue.ToString.Split("|"c)
|
Dim oLines = oValue.ToString.Split("|"c)
|
||||||
_Logger.Debug("WORKING_MODEs for Module {0}", ModuleName)
|
Logger.Debug("WORKING_MODEs for Module {0}", ModuleName)
|
||||||
For Each oLine In oLines
|
For Each oLine In oLines
|
||||||
_Logger.Debug(oLine.Trim)
|
Logger.Debug(oLine.Trim)
|
||||||
If oLine = "NO_BASICCONF" Then
|
If oLine = "NO_BASICCONF" Then
|
||||||
MyApplication.User.HideBasicConfig = True
|
MyApplication.User.HideBasicConfig = True
|
||||||
|
|
||||||
@ -328,7 +327,7 @@ Public Class ClassInit
|
|||||||
MyApplication.Search.SelectInIntegerAttributeIds = ""
|
MyApplication.Search.SelectInIntegerAttributeIds = ""
|
||||||
End Try
|
End Try
|
||||||
Else
|
Else
|
||||||
_Logger.Info($"Wrong WorkingMode: {oLine}")
|
Logger.Info($"Wrong WorkingMode: {oLine}")
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
|||||||
@ -3,16 +3,17 @@ Imports DigitalData.GUIs.ZooFlow.My
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Public Class ClassInitLoader
|
Public Class ClassInitLoader
|
||||||
|
Inherits Base.BaseClass
|
||||||
|
|
||||||
Private _Worker As BackgroundWorker
|
Private _Worker As BackgroundWorker
|
||||||
Private _Logger As Logger
|
|
||||||
Private _CurrentStep As InitStep
|
Private _CurrentStep As InitStep
|
||||||
|
|
||||||
Public Steps As New List(Of InitStep)
|
Public Steps As New List(Of InitStep)
|
||||||
Public Event ProgressChanged As EventHandler(Of InitProgress)
|
Public Event ProgressChanged As EventHandler(Of InitProgress)
|
||||||
Public Event InitCompleted As EventHandler(Of RunWorkerCompletedEventArgs)
|
Public Event InitCompleted As EventHandler(Of RunWorkerCompletedEventArgs)
|
||||||
|
|
||||||
Public Sub New()
|
Public Sub New(LogConfig As LogConfig)
|
||||||
_Logger = My.LogConfig.GetLogger()
|
MyBase.New(LogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Sub AddStep(Name As String, Action As Action(Of Object), Optional Fatal As Boolean = False)
|
Public Sub AddStep(Name As String, Action As Action(Of Object), Optional Fatal As Boolean = False)
|
||||||
@ -61,11 +62,11 @@ Public Class ClassInitLoader
|
|||||||
My.Application.ClipboardWatcher = oMyApplication.ClipboardWatcher
|
My.Application.ClipboardWatcher = oMyApplication.ClipboardWatcher
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
Logger.Error(ex)
|
||||||
_Logger.Warn("Init Step '{0}' failed!", oStep.Name)
|
Logger.Warn("Init Step '{0}' failed!", oStep.Name)
|
||||||
|
|
||||||
If oStep.Fatal Then
|
If oStep.Fatal Then
|
||||||
_Logger.Warn("Fatal error in '{0}'. Init will be aborted!", oStep.Name)
|
Logger.Warn("Fatal error in '{0}'. Init will be aborted!", oStep.Name)
|
||||||
Throw ex
|
Throw ex
|
||||||
End If
|
End If
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Public Class frmGlobix_Index
|
|||||||
Private _LogConfig As LogConfig
|
Private _LogConfig As LogConfig
|
||||||
Private _Logger As Logger
|
Private _Logger As Logger
|
||||||
|
|
||||||
Private clswindowLocation As ClassWindowLocation
|
Private clswindowLocation As ClassWindowLayout
|
||||||
Private clsPatterns As GlobixPatterns
|
Private clsPatterns As GlobixPatterns
|
||||||
Private clsPostProcessing As GlobixPostprocessing
|
Private clsPostProcessing As GlobixPostprocessing
|
||||||
Private _DataASorDB As ClassDataASorDB
|
Private _DataASorDB As ClassDataASorDB
|
||||||
@ -66,7 +66,7 @@ Public Class frmGlobix_Index
|
|||||||
_Logger = LogConfig.GetLogger()
|
_Logger = LogConfig.GetLogger()
|
||||||
_LogConfig = LogConfig
|
_LogConfig = LogConfig
|
||||||
_DataASorDB = New ClassDataASorDB(LogConfig)
|
_DataASorDB = New ClassDataASorDB(LogConfig)
|
||||||
clswindowLocation = New ClassWindowLocation(LogConfig)
|
clswindowLocation = New ClassWindowLayout(LogConfig)
|
||||||
clsPatterns = New GlobixPatterns(LogConfig)
|
clsPatterns = New GlobixPatterns(LogConfig)
|
||||||
clsPostProcessing = New GlobixPostprocessing(LogConfig)
|
clsPostProcessing = New GlobixPostprocessing(LogConfig)
|
||||||
_idbdata = New ClassIDBData(LogConfig)
|
_idbdata = New ClassIDBData(LogConfig)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user