This commit is contained in:
SchreiberM 2021-12-14 17:28:39 +01:00
commit dfce1cea3b
26 changed files with 484 additions and 239 deletions

View File

@ -10,20 +10,18 @@ Public Class ClassIDBData
''' <param name="BusinessEntity">Title of Business Entity</param> ''' <param name="BusinessEntity">Title of Business Entity</param>
''' <returns>Array with all Indices</returns> ''' <returns>Array with all Indices</returns>
Private _Logger As Logger Private _Logger As Logger
Private _DataASorDB As ClassDataASorDB
Private _Database As DatabaseWithFallback Private _Database As DatabaseWithFallback
Public Sub New(LogConfig As LogConfig) Public Sub New(LogConfig As LogConfig)
_Logger = LogConfig.GetLogger _Logger = LogConfig.GetLogger
_Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) _Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
_DataASorDB = New ClassDataASorDB(LogConfig)
Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE LANG_ID = {My.Application.User.LanguageId}" Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE LANG_ID = {My.Application.User.LanguageId}"
DTVWIDB_BE_ATTRIBUTE = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, DatabaseType.IDB, $"LANG_ID = {My.Application.User.LanguageId}") DTVWIDB_BE_ATTRIBUTE = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, DatabaseType.IDB, $"LANG_ID = {My.Application.User.LanguageId}")
'DTVWIDB_BE_ATTRIBUTE = _DataASorDB.GetDatatable("IDB", oSQL, "VWIDB_BE_ATTRIBUTE", $"LANG_ID = {My.Application.User.LanguageID}")
End Sub End Sub
Public IDBSystemIndices As List(Of String) Public IDBSystemIndices As List(Of String)
Public Function GetIndicesByBE(ByVal pBusinessEntity As String) As List(Of String) Public Function GetIndicesByBE(ByVal pBusinessEntity As String) As List(Of String)
Try Try
IDBSystemIndices = New List(Of String) From { IDBSystemIndices = New List(Of String) From {

View File

@ -18,7 +18,6 @@ Public Class ClassInit
Inherits Base.BaseClass Inherits Base.BaseClass
Private ReadOnly _MainForm As frmFlowForm Private ReadOnly _MainForm As frmFlowForm
Private ReadOnly _DataASorDB As ClassDataASorDB
Private ReadOnly _Database As DatabaseWithFallback Private ReadOnly _Database As DatabaseWithFallback
Private _Loader As ClassInitLoader Private _Loader As ClassInitLoader
@ -27,9 +26,6 @@ Public Class ClassInit
Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm) Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm)
MyBase.New(LogConfig) MyBase.New(LogConfig)
_MainForm = ParentForm _MainForm = ParentForm
'TODO: Remove when Globix uses DatabaseWithFallback
clsDataASorDB = New ClassDataASorDB(LogConfig)
End Sub End Sub
Public Sub InitializeApplication() Public Sub InitializeApplication()

View File

@ -23,6 +23,7 @@ Public Class ClassWindowLayout
oPath = Path.Combine(Application.UserAppDataPath(), pForm.Name & "-Layout.xml") oPath = Path.Combine(Application.UserAppDataPath(), pForm.Name & "-Layout.xml")
oAlternatePath = oPath.Replace("frm", "frmfrm") oAlternatePath = oPath.Replace("frm", "frmfrm")
If File.Exists(oAlternatePath) Then If File.Exists(oAlternatePath) Then
Dim oNewFilename = Path.GetFileName(oPath) Dim oNewFilename = Path.GetFileName(oPath)

View File

@ -5,9 +5,10 @@ Imports DigitalData.Modules.Logging
Imports Microsoft.Office.Interop Imports Microsoft.Office.Interop
Public Class ClassFileDrop Public Class ClassFileDrop
Public files_dropped As String() Inherits Base.BaseClass
Private _LOGGER As Logger
Private clsFilehandle As ClassFilehandle Public Property files_dropped As List(Of String)
Private ReadOnly FileHandle As ClassFilehandle
Public Class DroppedFile Public Class DroppedFile
Public FilePath As String Public FilePath As String
@ -18,20 +19,21 @@ Public Class ClassFileDrop
End Enum End Enum
End Class End Class
Public Sub New(LogConfig As LogConfig) Public Sub New(pLogConfig As LogConfig)
_LOGGER = LogConfig.GetLogger() MyBase.New(pLogConfig)
clsFilehandle = New ClassFilehandle() FileHandle = New ClassFilehandle(pLogConfig)
End Sub End Sub
Public Function Drop_File(e As DragEventArgs) As Boolean Public Function Drop_File(e As DragEventArgs) As Boolean
Try Try
_LOGGER.Info("Available Drop Formats:") Logger.Info("Available Drop Formats:")
For Each oFormat As String In e.Data.GetFormats() For Each oFormat As String In e.Data.GetFormats()
_LOGGER.Debug(oFormat) Logger.Debug(oFormat)
Next Next
_LOGGER.Info(">> Drop_File") Logger.Info(">> Drop_File")
files_dropped = Nothing files_dropped = New List(Of String)
If e.Data.GetDataPresent(DataFormats.FileDrop) Then If e.Data.GetDataPresent(DataFormats.FileDrop) Then
Dim MyFiles() As String Dim MyFiles() As String
Dim i As Integer Dim i As Integer
@ -39,10 +41,8 @@ Public Class ClassFileDrop
MyFiles = DirectCast(e.Data.GetData(DataFormats.FileDrop), String()) MyFiles = DirectCast(e.Data.GetData(DataFormats.FileDrop), String())
' Loop through the array and add the files to the list. ' Loop through the array and add the files to the list.
For i = 0 To MyFiles.Length - 1 For i = 0 To MyFiles.Length - 1
_LOGGER.Info(">> Simple FileDrop - File: " & MyFiles(i)) Logger.Info(">> Simple FileDrop - File: " & MyFiles(i))
ReDim Preserve files_dropped(i) files_dropped.Add("|DROPFROMFSYSTEM|" & MyFiles(i))
files_dropped(i) = "|DROPFROMFSYSTEM|" & MyFiles(i)
' ListBox1.Items.Add(MyFiles(i))
Next Next
Return True Return True
ElseIf (e.Data.GetDataPresent("FileGroupDescriptor")) AndAlso (e.Data.GetDataPresent("FileContents")) Then ElseIf (e.Data.GetDataPresent("FileGroupDescriptor")) AndAlso (e.Data.GetDataPresent("FileContents")) Then
@ -66,7 +66,7 @@ Public Class ClassFileDrop
Loop Loop
stmInput.Close() stmInput.Close()
'Sonderzeichen entfernen 'Sonderzeichen entfernen
Dim Tempfilename = clsFilehandle.InvalidCharacters(stbFileName.ToString) Dim Tempfilename = FileHandle.InvalidCharacters(stbFileName.ToString)
Dim anhaenge = e.Data.GetDataPresent("FileContents") Dim anhaenge = e.Data.GetDataPresent("FileContents")
'Dim path As String = "C:\VBProjekte\Dateien" 'Dim path As String = "C:\VBProjekte\Dateien"
'// put the zip file into the temp directory '// put the zip file into the temp directory
@ -89,19 +89,21 @@ Public Class ClassFileDrop
Dim fsOutput As IO.FileStream = New IO.FileStream(strOutFile, IO.FileMode.Create) '; Dim fsOutput As IO.FileStream = New IO.FileStream(strOutFile, IO.FileMode.Create) ';
fsOutput.Write(aryFileBytes, 0, aryFileBytes.Length) fsOutput.Write(aryFileBytes, 0, aryFileBytes.Length)
fsOutput.Close() ' // close the file fsOutput.Close() ' // close the file
Dim resultVersion = clsFilehandle.Versionierung_Datei(strOutFile) Dim resultVersion = FileHandle.Versionierung_Datei(strOutFile)
If resultVersion <> "" Then If resultVersion <> "" Then
strOutFile = resultVersion strOutFile = resultVersion
End If End If
Dim finTemp As IO.FileInfo = New IO.FileInfo(strOutFile) Dim finTemp As IO.FileInfo = New IO.FileInfo(strOutFile)
'// always good to make sure we actually created the file '// always good to make sure we actually created the file
If (finTemp.Exists = True) Then If (finTemp.Exists = True) Then
ReDim Preserve files_dropped(0) files_dropped.Add("|OUTLOOK_ATTACHMENT|" & strOutFile)
files_dropped(0) = "|OUTLOOK_ATTACHMENT|" & strOutFile
_LOGGER.Info(">> Drop an Attachment - File: " & strOutFile) 'ReDim Preserve files_dropped(0)
'files_dropped(0) = "|OUTLOOK_ATTACHMENT|" & strOutFile
Logger.Info(">> Drop an Attachment - File: " & strOutFile)
Return True Return True
Else Else
_LOGGER.Info(">> Attachment File from Outlook could not be created") Logger.Info(">> Attachment File from Outlook could not be created")
End If End If
End If End If
End If End If
@ -113,7 +115,7 @@ Public Class ClassFileDrop
MsgBox("Unexpected error in Initialisieren von Outlook-API:" & vbNewLine & ex.Message & vbNewLine & vbNewLine & "Evtl ist Outlook nicht in der dafür vorgesehenen For") MsgBox("Unexpected error in Initialisieren von Outlook-API:" & vbNewLine & ex.Message & vbNewLine & vbNewLine & "Evtl ist Outlook nicht in der dafür vorgesehenen For")
End Try End Try
_LOGGER.Info(">> Drop of msg") Logger.Info(">> Drop of msg")
'supports a drop of a Outlook message 'supports a drop of a Outlook message
Dim myobj As Object Dim myobj As Object
For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count For i As Integer = 1 To oApp.ActiveExplorer.Selection.Count
@ -129,14 +131,14 @@ Public Class ClassFileDrop
subj = subj.Replace("/", "-") subj = subj.Replace("/", "-")
End If End If
'Sonderzeichen entfernen 'Sonderzeichen entfernen
subj = clsFilehandle.InvalidCharacters(subj) subj = FileHandle.InvalidCharacters(subj)
'hardcode a destination path for testing 'hardcode a destination path for testing
Dim strFile As String = IO.Path.Combine(Path.GetTempPath, subj + ".msg") Dim strFile As String = IO.Path.Combine(Path.GetTempPath, subj + ".msg")
strFile = strFile.Replace("?", "") strFile = strFile.Replace("?", "")
strFile = strFile.Replace("!", "") strFile = strFile.Replace("!", "")
strFile = strFile.Replace("%", "") strFile = strFile.Replace("%", "")
strFile = strFile.Replace("$", "") strFile = strFile.Replace("$", "")
_LOGGER.Info(">> Drop of msg - File:" & strFile) Logger.Info(">> Drop of msg - File:" & strFile)
Try Try
myobj.SaveAs(strFile) myobj.SaveAs(strFile)
Catch ex As Exception Catch ex As Exception
@ -144,8 +146,9 @@ Public Class ClassFileDrop
Return False Return False
End Try End Try
ReDim Preserve files_dropped(i) 'ReDim Preserve files_dropped(i)
files_dropped(i) = "|OUTLOOK_MESSAGE|" & strFile 'files_dropped(i) = "|OUTLOOK_MESSAGE|" & strFile
files_dropped.Add("|OUTLOOK_MESSAGE|" & strFile)
Next Next
Return True Return True
'Drop eines Outlook Attachments 'Drop eines Outlook Attachments

View File

@ -6,10 +6,12 @@ Imports DigitalData.Modules.Logging
Imports Independentsoft Imports Independentsoft
Public Class ClassFilehandle Public Class ClassFilehandle
Private _LOGGER As Logger Inherits Base.BaseClass
Public Sub New()
_LOGGER = My.LogConfig.GetLogger Public Sub New(pLogConfig As LogConfig)
MyBase.New(pLogConfig)
End Sub End Sub
''' <summary> ''' <summary>
''' Diese Funktion entfernt alle Zeichen aus dem übergebenen String ''' Diese Funktion entfernt alle Zeichen aus dem übergebenen String
''' die in Dateinamen nicht erlaubt sind. ''' die in Dateinamen nicht erlaubt sind.
@ -85,6 +87,7 @@ Public Class ClassFilehandle
Return Insert_GI_File(filename, handletype) Return Insert_GI_File(filename, handletype)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex)
MsgBox("Unexpected Error in Decide_FileHandle: " & ex.Message, MsgBoxStyle.Critical) MsgBox("Unexpected Error in Decide_FileHandle: " & ex.Message, MsgBoxStyle.Critical)
Return False Return False
End Try End Try
@ -103,7 +106,7 @@ Public Class ClassFilehandle
If Not msg.InternetMessageId Is Nothing Then If Not msg.InternetMessageId Is Nothing Then
My.Application.Globix.CurrMessageID = msg.InternetMessageId My.Application.Globix.CurrMessageID = msg.InternetMessageId
Else Else
_LOGGER.Info(">> Email_Decay: Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!") Logger.Info(">> Email_Decay: Es konnte keine Message-ID gelesen werden. Eine GUID wird erzeugt!")
Dim sGUID As String Dim sGUID As String
sGUID = System.Guid.NewGuid.ToString() sGUID = System.Guid.NewGuid.ToString()
My.Application.Globix.CurrMessageID = sGUID My.Application.Globix.CurrMessageID = sGUID
@ -127,7 +130,7 @@ Public Class ClassFilehandle
Dim _msg As New Msg.Message(msgname) Dim _msg As New Msg.Message(msgname)
Dim i1 As Integer = 1 Dim i1 As Integer = 1
_LOGGER.Info(">> Anzahl der Attachments: " & _msg.Attachments.Count) Logger.Info(">> Anzahl der Attachments: " & _msg.Attachments.Count)
For Each attachment As Independentsoft.Msg.Attachment In _msg.Attachments For Each attachment As Independentsoft.Msg.Attachment In _msg.Attachments
If erfolgreich = False Then If erfolgreich = False Then
Exit For Exit For
@ -147,7 +150,7 @@ Public Class ClassFilehandle
Dim oMessage = attachment.EmbeddedMessage Dim oMessage = attachment.EmbeddedMessage
oMessage.Save(tempfile) oMessage.Save(tempfile)
My.Application.Globix.TEMP_FILES.Add(tempfile) My.Application.Globix.TEMP_FILES.Add(tempfile)
_LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile) Logger.Info("Attachment (" & i1 & "):" & tempfile)
erfolgreich = Insert_GI_File(tempfile, ATT_EXTR) erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
i1 += 1 i1 += 1
End If End If
@ -160,7 +163,7 @@ Public Class ClassFilehandle
attachment.Save(tempfile) attachment.Save(tempfile)
'Datei in Array zum Templöschen speichern 'Datei in Array zum Templöschen speichern
My.Application.Globix.TEMP_FILES.Add(tempfile) My.Application.Globix.TEMP_FILES.Add(tempfile)
_LOGGER.Info(">> Attachment (" & i1 & "):" & tempfile) Logger.Info("Attachment (" & i1 & "):" & tempfile)
'nun der Insert des Anhanges 'nun der Insert des Anhanges
erfolgreich = Insert_GI_File(tempfile, ATT_EXTR) erfolgreich = Insert_GI_File(tempfile, ATT_EXTR)
i1 += 1 i1 += 1
@ -170,7 +173,9 @@ Public Class ClassFilehandle
End If End If
Return erfolgreich Return erfolgreich
Catch ex As Exception Catch ex As Exception
Logger.Error(ex)
MsgBox("Error in Email_Decay: " & ex.Message, MsgBoxStyle.Critical) MsgBox("Error in Email_Decay: " & ex.Message, MsgBoxStyle.Critical)
Return False
End Try End Try
End Function End Function
@ -200,19 +205,20 @@ Public Class ClassFilehandle
' Ist ein Fehler aufgetreten, so wird nach außen hin generell ' Ist ein Fehler aufgetreten, so wird nach außen hin generell
' davon ausgegangen, dass die Datei in Benutzung ist (obwohl ' davon ausgegangen, dass die Datei in Benutzung ist (obwohl
' auch andere Ursachen, etwa Rechteprobleme, möglich sind). ' auch andere Ursachen, etwa Rechteprobleme, möglich sind).
_LOGGER.Info(">> FileInUse Message: " & ex.Message) Logger.Info(">> FileInUse Message: " & ex.Message)
IsFileInUse = True Return True
Finally Finally
' Die eventuell geöffnete Datei schließen ' Die eventuell geöffnete Datei schließen
FileClose(ff) FileClose(ff)
End Try End Try
Return False Return False
Else
Return False
End If End If
End Function End Function
Public Function Versionierung_Datei(Dateiname As String) As String Public Function Versionierung_Datei(Dateiname As String) As String
Dim extension As String Dim extension As String
Dim _NewFileString As String Dim _NewFileString As String = ""
Try Try
Dim version As Integer = 1 Dim version As Integer = 1
@ -233,36 +239,10 @@ Public Class ClassFilehandle
End If End If
Return _NewFileString & extension Return _NewFileString & extension
Catch ex As Exception Catch ex As Exception
_LOGGER.Info(" - Error in versioning file - error: " & vbNewLine & ex.Message) Logger.Info(" - Error in versioning file - error: " & vbNewLine & ex.Message)
_LOGGER.Error(ex.Message) Logger.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in versioning file:") MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in versioning file:")
Return "" Return ""
End Try End Try
End Function End Function
''' <summary>
'''' Ersetzt alle nicht zulässigen Zeichen im angegebenen Dateinamen
'''' </summary>
'''' <param name="sFilename">Dateiname ohne Pfadangabe</param>
'''' <param name="sChar">Ersatzzeichen für alle unzulässigen Zeichen
'''' im Dateinamen</param>
'Public Function CleanFilename(ByVal sFilename As String, Optional ByVal REPLACEChar As String = "") As String
' _LOGGER.Info(" Filename before CleanFilename: '" & sFilename & "'")
' If sFilename.Contains(".\") Then
' sFilename = sFilename.Replace(".\", "\")
' End If
' 'If sFilename.Contains("'") Then
' ' sFilename = sFilename.Replace("'", "")
' 'End If
' 'If sFilename.Contains("..") Then
' ' sFilename = sFilename.Replace("..", ".")
' 'End If
' ' alle nicht zulässigen Zeichen ersetzen
' sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, My.Application.Globix.REGEX_CLEAN_FILENAME, REPLACEChar)
' sFilename = System.Text.RegularExpressions.Regex.Replace(sFilename, "[\\/:*?""<>|\r\n]", "", System.Text.RegularExpressions.RegexOptions.Singleline)
' 'Dim oCleanFileName As String = String.Join(REPLACEChar, sFilename.Split(Path.GetInvalidFileNameChars()))
' Dim oCleanFileName As New System.IO.FileInfo(System.Text.RegularExpressions.Regex.Replace(sFilename, String.Format("[{0}]", String.Join(String.Empty, Path.GetInvalidFileNameChars)), REPLACEChar))
' _LOGGER.Info("Filename after CleanFilename: '" & sFilename & "'")
' Return sFilename
'End Function
End Class End Class

View File

@ -2,14 +2,16 @@
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Public Class ClassFolderwatcher Public Class ClassFolderwatcher
Inherits Base.BaseClass
Public Shared FWFolderWatcher As FileSystemWatcher Public Shared FWFolderWatcher As FileSystemWatcher
Public Shared FWScan As FileSystemWatcher Public Shared FWScan As FileSystemWatcher
Private clsFilehandle As ClassFilehandle
Private Logger As Logger
Public Sub New() Private ReadOnly FileHandle As ClassFilehandle
Logger = My.LogConfig.GetLogger()
clsFilehandle = New ClassFilehandle() Public Sub New(pLogConfig As LogConfig)
MyBase.New(pLogConfig)
FileHandle = New ClassFilehandle(pLogConfig)
End Sub End Sub
Public Function Restart_FolderWatch() As Boolean Public Function Restart_FolderWatch() As Boolean
@ -19,7 +21,7 @@ Public Class ClassFolderwatcher
FWFolderWatcher.EnableRaisingEvents = False FWFolderWatcher.EnableRaisingEvents = False
My.Application.Globix.Folderwatchstarted = False My.Application.Globix.Folderwatchstarted = False
'FolderWatch neu instanzieren 'FolderWatch neu instanzieren
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*") FWFolderWatcher = New FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
Logger.Info(" >> FolderWatch neu instanziert") Logger.Info(" >> FolderWatch neu instanziert")
FWFolderWatcher.IncludeSubdirectories = False FWFolderWatcher.IncludeSubdirectories = False
FWFolderWatcher.EnableRaisingEvents = True FWFolderWatcher.EnableRaisingEvents = True
@ -65,7 +67,6 @@ Public Class ClassFolderwatcher
FWFolderWatcher.EnableRaisingEvents = True FWFolderWatcher.EnableRaisingEvents = True
AddHandler FWFolderWatcher.Created, AddressOf OnCreated AddHandler FWFolderWatcher.Created, AddressOf OnCreated
My.Application.Globix.Folderwatchstarted = True My.Application.Globix.Folderwatchstarted = True
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "True")
My.UIConfig.Globix.FolderWatchStarted = True My.UIConfig.Globix.FolderWatchStarted = True
My.UIConfigManager.Save() My.UIConfigManager.Save()
End If End If
@ -78,7 +79,6 @@ Public Class ClassFolderwatcher
FWFolderWatcher.EnableRaisingEvents = True FWFolderWatcher.EnableRaisingEvents = True
AddHandler FWFolderWatcher.Created, AddressOf OnCreated AddHandler FWFolderWatcher.Created, AddressOf OnCreated
My.Application.Globix.Folderwatchstarted = True My.Application.Globix.Folderwatchstarted = True
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "True")
My.UIConfig.Globix.FolderWatchStarted = True My.UIConfig.Globix.FolderWatchStarted = True
My.UIConfigManager.Save() My.UIConfigManager.Save()
Else Else
@ -86,7 +86,6 @@ Public Class ClassFolderwatcher
FWFolderWatcher.EnableRaisingEvents = False FWFolderWatcher.EnableRaisingEvents = False
My.Application.Globix.Folderwatchstarted = False My.Application.Globix.Folderwatchstarted = False
Logger.Info(" >> FolderWatch gestoppt") Logger.Info(" >> FolderWatch gestoppt")
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "False")
My.UIConfig.Globix.FolderWatchStarted = False My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save() My.UIConfigManager.Save()
End If End If
@ -183,8 +182,8 @@ Public Class ClassFolderwatcher
'Die Datei übergeben 'Die Datei übergeben
Logger.Info(">> OnCreated-File:" & e.FullPath) Logger.Info(">> OnCreated-File:" & e.FullPath)
If clsFilehandle.CheckDuplicateFiles(e.FullPath, "FolderWatch/Scan") Then If FileHandle.CheckDuplicateFiles(e.FullPath, "FolderWatch/Scan") Then
clsFilehandle.Decide_FileHandle(e.FullPath, handleType) FileHandle.Decide_FileHandle(e.FullPath, handleType)
Else Else
Logger.Info(">> Folderwatcher: File already exists:" & e.FullPath) Logger.Info(">> Folderwatcher: File already exists:" & e.FullPath)
End If End If

View File

@ -129,11 +129,15 @@ Public Class ClassValidator
End Try End Try
End Function End Function
Function GetControlValues(pPanel As Panel) Function GetControlValues(pPanel As Panel) As List(Of UserAttributeValue)
Dim oAttributeValues As New List(Of UserAttributeValue) Dim oAttributeValues As New List(Of UserAttributeValue)
For Each oControl As Control In pPanel.Controls For Each oControl As Control In pPanel.Controls
If oControl.Name.StartsWith("lbl") Then
Continue For
End If
' ========================= TEXTBOX ========================= ' ========================= TEXTBOX =========================
If oControl.Name.StartsWith("txt") Then If oControl.Name.StartsWith("txt") Then
Dim oTextBox As DevExpress.XtraEditors.TextEdit = oControl Dim oTextBox As DevExpress.XtraEditors.TextEdit = oControl

View File

@ -4,8 +4,18 @@
Public Property DocTypeName As String Public Property DocTypeName As String
Public Property DocTypeId As Integer Public Property DocTypeId As Integer
''' <summary>
''' WD_INDEX, Name of the Attribute
''' </summary>
Public Property Name As String Public Property Name As String
Public Property Comment As String ''' <summary>
''' INDEXNAME, Internal Name for Admin
''' </summary>
Public Property InternalName As String
''' <summary>
''' COMMENT, Caption in Index Form
''' </summary>
Public Property LabelCaption As String
Public Property DataType As String Public Property DataType As String
Public Property Sequence As Integer Public Property Sequence As Integer
@ -16,7 +26,6 @@
Public Property DefaultValue As String Public Property DefaultValue As String
Public Property IsOptional As Boolean Public Property IsOptional As Boolean
Public Property IsActive As Boolean
Public Property IsMultiselect As Boolean Public Property IsMultiselect As Boolean
Public Property AllowAddingItems As Boolean Public Property AllowAddingItems As Boolean
Public Property PreventMultleValue As Boolean Public Property PreventMultleValue As Boolean

View File

@ -99,16 +99,16 @@ Public Class frmGlobixBasicConfig
Private Sub frmGlobixBasicConfig_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmGlobixBasicConfig_Load(sender As Object, e As EventArgs) Handles Me.Load
Logger = My.LogConfig.GetLogger() Logger = My.LogConfig.GetLogger()
clsFW = New ClassFolderwatcher() clsFW = New ClassFolderwatcher(My.LogConfig)
Try Try
oReload = True oReload = True
Dim oFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId) Dim oFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId)
If Not oFolderwatch Is Nothing Then If oFolderwatch IsNot Nothing Then
My.Application.Globix.CurrentFolderWatchPath = oFolderwatch My.Application.Globix.CurrentFolderWatchPath = oFolderwatch
End If End If
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
Dim oSCANFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId) Dim oSCANFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId)
If Not oSCANFolderwatch Is Nothing Then If oSCANFolderwatch IsNot Nothing Then
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch
End If End If
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath

View File

@ -59,6 +59,7 @@ Partial Class frmGlobix_Index
Me.cmbDocType = New DevExpress.XtraEditors.ComboBoxEdit() Me.cmbDocType = New DevExpress.XtraEditors.ComboBoxEdit()
Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer() Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer()
Me.GlobixDataset = New DigitalData.GUIs.ZooFlow.GlobixDataset() Me.GlobixDataset = New DigitalData.GUIs.ZooFlow.GlobixDataset()
Me.SplashScreenManager = New DevExpress.XtraSplashScreen.SplashScreenManager(Me, GetType(Global.DigitalData.GUIs.ZooFlow.frmWaitForm), True, True)
CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainerControl1.SuspendLayout() Me.SplitContainerControl1.SuspendLayout()
@ -326,6 +327,10 @@ Partial Class frmGlobix_Index
Me.GlobixDataset.DataSetName = "GlobixDataset" Me.GlobixDataset.DataSetName = "GlobixDataset"
Me.GlobixDataset.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema Me.GlobixDataset.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
' '
'SplashScreenManager
'
Me.SplashScreenManager.ClosingDelay = 500
'
'frmGlobix_Index 'frmGlobix_Index
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@ -381,4 +386,5 @@ Partial Class frmGlobix_Index
Friend WithEvents GlobixDataset As GlobixDataset Friend WithEvents GlobixDataset As GlobixDataset
Friend WithEvents cmbDocType As DevExpress.XtraEditors.ComboBoxEdit Friend WithEvents cmbDocType As DevExpress.XtraEditors.ComboBoxEdit
Friend WithEvents SimpleButton1 As SimpleButton Friend WithEvents SimpleButton1 As SimpleButton
Friend WithEvents SplashScreenManager As DevExpress.XtraSplashScreen.SplashScreenManager
End Class End Class

View File

@ -26,7 +26,6 @@ Public Class frmGlobix_Index
Private Const TEXT_MISSING_INPUT = "Bitte vervollständigen Sie die Eingaben!" Private Const TEXT_MISSING_INPUT = "Bitte vervollständigen Sie die Eingaben!"
Private Property MultifileCount As Integer Private Property MultifileCount As Integer
Public Property DT_VWGI_DOCTYPE As DataTable
Public Property FormLoaded As Boolean = False Public Property FormLoaded As Boolean = False
Public Property DropType As String Public Property DropType As String
@ -36,17 +35,14 @@ Public Class frmGlobix_Index
Public Property SelectedDocType As DocType Public Property SelectedDocType As DocType
Private Property WindowLocation As ClassWindowLayout Private Property WindowLocation As ClassWindowLayout
Private Property _DataASorDB As ClassDataASorDB
Private Property Database As DatabaseWithFallback Private Property Database As DatabaseWithFallback
Private Property Patterns2 As Patterns2 Private Property Patterns2 As Patterns2
'Public Class ControlMeta
' Public Property IndexName As String
Public Class ControlMeta ' Public Property IndexType As String
Public Property IndexName As String ' Public Property MultipleValues As Boolean = False
Public Property IndexType As String 'End Class
Public Property MultipleValues As Boolean = False
End Class
#End Region #End Region
Public Sub New(pLogConfig As LogConfig) Public Sub New(pLogConfig As LogConfig)
@ -57,8 +53,6 @@ Public Class frmGlobix_Index
Logger = pLogConfig.GetLogger() Logger = pLogConfig.GetLogger()
LogConfig = pLogConfig LogConfig = pLogConfig
_DataASorDB = New ClassDataASorDB(pLogConfig)
Database = New DatabaseWithFallback(pLogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) Database = New DatabaseWithFallback(pLogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
WindowLocation = New ClassWindowLayout(pLogConfig) WindowLocation = New ClassWindowLayout(pLogConfig)
Patterns2 = New Patterns2(pLogConfig) Patterns2 = New Patterns2(pLogConfig)
@ -67,14 +61,28 @@ Public Class frmGlobix_Index
End Sub End Sub
Private Sub frmGlobix_Index_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmGlobix_Index_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ColorizeInactiveIcon = False ColorizeInactiveIcon = DevExpress.Utils.DefaultBoolean.True
' Abbruchzähler zurücksetzen ' Abbruchzähler zurücksetzen
CancelAttempts = 0 CancelAttempts = 0
My.Application.Globix.INDEXING_ACTIVE = True My.Application.Globix.INDEXING_ACTIVE = True
End Sub
Private Sub frmGlobix_Index_Shown(sender As Object, e As EventArgs) Handles Me.Shown
Cursor = Cursors.Default
SplashScreenManager.ShowWaitForm()
checkItemTopMost.Checked = My.UIConfig.Globix.TopMost
TopMost = My.UIConfig.Globix.TopMost
BringToFront()
Focus()
Try Try
Refresh_Dokart()
pnlIndex.Controls.Clear()
My.Application.Globix.CURRENT_ISATTACHMENT = False My.Application.Globix.CURRENT_ISATTACHMENT = False
Dim oSql = $"SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}" Dim oSql = $"SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}"
DropType = My.DatabaseECM.GetScalarValue(oSql) DropType = My.DatabaseECM.GetScalarValue(oSql)
@ -121,27 +129,6 @@ Public Class frmGlobix_Index
End If End If
Catch ex As Exception
Logger.Warn(" - Unexpected error in Öffnen des Formulares - Fehler: " & vbNewLine & ex.Message)
Logger.Error(ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Öffnen des Formulares:")
End Try
End Sub
Private Sub frmGlobix_Index_Shown(sender As Object, e As EventArgs) Handles Me.Shown
BringToFront()
Focus()
Cursor = Cursors.Default
Refresh_Dokart()
pnlIndex.Controls.Clear()
checkItemTopMost.Checked = My.UIConfig.Globix.TopMost
TopMost = My.UIConfig.Globix.TopMost
BringToFront()
FormLoaded = True
Try
' Letzte Auswahl merken überschreibt die automatische selektion ' Letzte Auswahl merken überschreibt die automatische selektion
If My.UIConfig.Globix.ProfilePreselection Then If My.UIConfig.Globix.ProfilePreselection Then
checkItemPreselection.Checked = True checkItemPreselection.Checked = True
@ -158,7 +145,7 @@ Public Class frmGlobix_Index
End If End If
Else Else
Dim oSQL As String = "SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID" oSql = "SELECT DISTINCT T1.DOCTYPE as DocType, T.* FROM TBGI_REGEX_DOCTYPE T, VWGI_DOCTYPE_USER T1 WHERE T.DOCTYPE_ID = T1.DOCTYPE_ID"
Dim oRegexDoctypeTable = Database.GetDatatable("DTTBGI_REGEX_DOCTYPE", oSQL, ECM) Dim oRegexDoctypeTable = Database.GetDatatable("DTTBGI_REGEX_DOCTYPE", oSQL, ECM)
For Each oRoW As DataRow In oRegexDoctypeTable.Rows For Each oRoW As DataRow In oRegexDoctypeTable.Rows
@ -179,9 +166,13 @@ Public Class frmGlobix_Index
End If End If
Next Next
End If End If
Catch ex As Exception Catch ex As Exception
Logger.Warn("Unexpected error DTTBGI_REGEX_DOCTYPE - ErrorMessage: " & vbNewLine & ex.Message) Logger.Warn("Unexpected error DTTBGI_REGEX_DOCTYPE - ErrorMessage: " & vbNewLine & ex.Message)
Finally
SplashScreenManager.CloseWaitForm()
FormLoaded = True
End Try End Try
End Sub End Sub
@ -301,21 +292,24 @@ Public Class frmGlobix_Index
End Sub End Sub
Sub Refresh_Dokart() Sub Refresh_Dokart()
Try Try
Dim oSql = String.Format("SELECT * FROM VWGI_DOCTYPE_IDB where UPPER(USERNAME) = UPPER('{0}') ORDER BY SEQUENCE", My.Application.User.UserName)
DT_VWGI_DOCTYPE = Database.GetDatatable("VWGI_DOCTYPE_IDB", oSql, ECM, pSortByColumn:="SEQUENCE")
Dim oDocTypes As New List(Of DocType) Dim oDocTypes As New List(Of DocType)
Dim oSql = String.Format("SELECT * FROM VWGI_DOCTYPE_USER WHERE AKTIV = 1 AND USERNAME = '{0}' ORDER BY SEQUENCE", My.Application.User.UserName)
Dim oTable = Database.GetDatatable("VWGI_DOCTYPE_USER", oSql, ECM,
pSortByColumn:="SEQUENCE",
pFilterExpression:=$"AKTIV = 1 AND USERNAME = '{My.Application.User.UserName}'")
For Each oRow As DataRow In DT_VWGI_DOCTYPE.Rows For Each oRow As DataRow In oTable.Rows
Dim oDocType = New DocType With { Dim oDocType = New DocType With {
.Guid = oRow.Item("DOCTYPE_ID"), .Guid = oRow.Item("DOCTYPE_ID"),
.Name = oRow.Item("DOCTYPE"), .Name = oRow.Item("DOCTYPE"),
.ObjectStore = oRow.Item("OBJECT_STORE") .ObjectStore = oRow.Item("OBJECT_ST_NAME")
} }
oDocTypes.Add(oDocType) oDocTypes.Add(oDocType)
cmbDocType.Properties.Items.Add(oDocType) cmbDocType.Properties.Items.Add(oDocType)
Next Next
DocTypes = oDocTypes
Catch ex As Exception Catch ex As Exception
Logger.Warn("Unexpected error in Refresh_Dokart: " & vbNewLine & ex.Message) Logger.Warn("Unexpected error in Refresh_Dokart: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Laden der Dokumentarten:") MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error in Laden der Dokumentarten:")
@ -336,7 +330,7 @@ Public Class frmGlobix_Index
'My.Application.Globix.CURRENT_DOCTYPE_DuplicateHandling = My.Application.Globix.CURR_DT_DOCTYPE.Rows(0).Item("DUPLICATE_HANDLING").ToString 'My.Application.Globix.CURRENT_DOCTYPE_DuplicateHandling = My.Application.Globix.CURR_DT_DOCTYPE.Rows(0).Item("DUPLICATE_HANDLING").ToString
ManualIndexes = Refresh_IndexeMan(oSelectedItem.Guid) ManualIndexes = Refresh_IndexeMan(oSelectedItem.Guid)
LoadIndexe_Man() LoadIndexe_Man(ManualIndexes)
End If End If
End Sub End Sub
@ -347,13 +341,14 @@ Public Class frmGlobix_Index
T1.BEZEICHNUNG AS DOKUMENTART, T.* T1.BEZEICHNUNG AS DOKUMENTART, T.*
FROM TBDD_INDEX_MAN T, FROM TBDD_INDEX_MAN T,
TBDD_DOKUMENTART T1 TBDD_DOKUMENTART T1
WHERE T.ACTIVE = 1 AND WHERE T.DOK_ID = T1.GUID AND
T.DOK_ID = T1.GUID AND
T.DOK_ID = {dokartid} T.DOK_ID = {dokartid}
ORDER BY T.SEQUENCE" ORDER BY T.SEQUENCE"
Dim oFilter = "DOK_ID = " & dokartid Dim oTable = My.Database.GetDatatable("VWDDINDEX_MAN", oSql, ECM,
Dim oTable = _DataASorDB.GetDatatable("DD_ECM", oSql, "DT_INDEXE_MAN", oFilter, "SEQUENCE") pSortByColumn:="SEQUENCE",
pFilterExpression:=$"DOK_ID = {dokartid}")
Dim oManualIndexes As New List(Of ManualIndex) Dim oManualIndexes As New List(Of ManualIndex)
For Each oRow As DataRow In oTable.Rows For Each oRow As DataRow In oTable.Rows
@ -361,8 +356,9 @@ Public Class frmGlobix_Index
.Id = oRow.ItemEx(Of Integer)("GUID"), .Id = oRow.ItemEx(Of Integer)("GUID"),
.DocTypeId = oRow.ItemEx(Of Integer)("DOK_ID"), .DocTypeId = oRow.ItemEx(Of Integer)("DOK_ID"),
.DocTypeName = oRow.ItemEx(Of String)("DOKUMENTART"), .DocTypeName = oRow.ItemEx(Of String)("DOKUMENTART"),
.Name = oRow.ItemEx(Of String)("NAME"), .Name = oRow.ItemEx(Of String)("WD_INDEX"),
.Comment = oRow.ItemEx(Of String)("COMMENT"), .InternalName = oRow.ItemEx(Of String)("INDEXNAME"),
.LabelCaption = oRow.ItemEx(Of String)("COMMENT"),
.DataType = oRow.ItemEx(Of String)("DATATYPE"), .DataType = oRow.ItemEx(Of String)("DATATYPE"),
.Sequence = oRow.ItemEx("SEQUENCE", 0), .Sequence = oRow.ItemEx("SEQUENCE", 0),
.SQLCommand = oRow.ItemEx("SQL_RESULT", String.Empty), .SQLCommand = oRow.ItemEx("SQL_RESULT", String.Empty),
@ -370,7 +366,6 @@ Public Class frmGlobix_Index
.SQLSuggestion = oRow.ItemEx("SUGGESTION", String.Empty), .SQLSuggestion = oRow.ItemEx("SUGGESTION", String.Empty),
.DefaultValue = oRow.ItemEx("DEFAULT_VALUE", String.Empty), .DefaultValue = oRow.ItemEx("DEFAULT_VALUE", String.Empty),
.IsOptional = oRow.ItemEx(Of Integer)("OPTIONAL", False), .IsOptional = oRow.ItemEx(Of Integer)("OPTIONAL", False),
.IsActive = oRow.ItemEx("ACTIVE", False),
.IsMultiselect = oRow.ItemEx("MULTISELECT", False) .IsMultiselect = oRow.ItemEx("MULTISELECT", False)
} }
@ -403,7 +398,7 @@ Public Class frmGlobix_Index
labelError.Caption = text labelError.Caption = text
End Sub End Sub
Private Sub LoadIndexe_Man() Private Sub LoadIndexe_Man(pManualIndexes As List(Of ManualIndex))
Try Try
Dim oScreen As New DigitalData.Modules.Windows.Screen() Dim oScreen As New DigitalData.Modules.Windows.Screen()
Dim oDpiScale = oScreen.GetScreenScaling(Me) Dim oDpiScale = oScreen.GetScreenScaling(Me)
@ -421,22 +416,21 @@ Public Class frmGlobix_Index
Logger.Info("Loading Indicies for Screen Scaling Factor [{0}]", oDpiScale) Logger.Info("Loading Indicies for Screen Scaling Factor [{0}]", oDpiScale)
If ManualIndexes Is Nothing OrElse ManualIndexes.Count = 0 Then If pManualIndexes Is Nothing OrElse pManualIndexes.Count = 0 Then
ShowError("Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert") ShowError("Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert")
Logger.Info(" - Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert") Logger.Info(" - Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert")
End If End If
For Each oIndex As ManualIndex In ManualIndexes For Each oIndex As ManualIndex In pManualIndexes
Dim MultiSelect As Boolean = oIndex.IsMultiselect Dim MultiSelect As Boolean = oIndex.IsMultiselect
Dim AddNewItems As Boolean = oIndex.AllowAddingItems Dim AddNewItems As Boolean = oIndex.AllowAddingItems
Dim PreventDuplicates As Boolean = oIndex.PreventMultleValue Dim PreventDuplicates As Boolean = oIndex.PreventMultleValue
Dim oControlName As String = oIndex.Name Dim oControlName As String = oIndex.Name
Dim oConnectionId = oIndex.SQLConnection Dim oConnectionId = oIndex.SQLConnection
Dim oSQLSuggestion = oIndex.SQLSuggestion
Dim oDataType = oIndex.DataType Dim oDataType = oIndex.DataType
If oDataType <> "BOOLEAN" Then If oDataType <> "BOOLEAN" Then
addLabel(oControlName, oIndex.Comment, oLabelPosition, oControlCount) addLabel(oControlName, oIndex.LabelCaption, oLabelPosition, oControlCount)
End If End If
'Dim oDefaultValue = Check_HistoryValues(oControlName, oIndex.DocTypeName) 'Dim oDefaultValue = Check_HistoryValues(oControlName, oIndex.DocTypeName)
@ -444,14 +438,13 @@ Public Class frmGlobix_Index
' 'oDefaultValue = GetPlaceholderValue(oIndex.DefaultValue, My.Application.Globix.CURRENT_WORKFILE) ' 'oDefaultValue = GetPlaceholderValue(oIndex.DefaultValue, My.Application.Globix.CURRENT_WORKFILE)
'End If 'End If
Dim oDefaultValue = GetPlaceholderValue(oIndex.DefaultValue, My.Application.Globix.CurrentWorkfile.FilePath) Dim oDefaultValue = GetPlaceholderValue(oIndex.DefaultValue, My.Application.Globix.CurrentWorkfile.FilePath)
Dim oControl As Control = Nothing Dim oControl As Control = Nothing
Dim oHasSqlCommand = (oSQLSuggestion = True And oIndex.SQLCommand.Length > 0) Dim oHasSqlCommand = (oConnectionId > 0 And oIndex.SQLCommand.Length > 0)
Dim oNeedsLookup As Boolean = oHasSqlCommand Or MultiSelect = True Dim oNeedsLookup As Boolean = oHasSqlCommand Or MultiSelect = True
Select Case oIndex.DataType Select Case oIndex.DataType
Case "BOOLEAN" Case "BOOLEAN"
Dim oCheckbox As CheckBox = oControls.AddCheckBox(oControlName, oControlPosition, oDefaultValue, oIndex.Comment) Dim oCheckbox As CheckBox = oControls.AddCheckBox(oControlName, oControlPosition, oDefaultValue, oIndex.LabelCaption)
oControl = oCheckbox oControl = oCheckbox
Case "INTEGER" Case "INTEGER"
@ -478,7 +471,7 @@ Public Class frmGlobix_Index
MsgBox("Please check Datatype of Indexvalue!", MsgBoxStyle.Critical, "Warning:") MsgBox("Please check Datatype of Indexvalue!", MsgBoxStyle.Critical, "Warning:")
End If End If
Logger.Warn(" - Datentyp nicht hinterlegt - LoadIndexe_Man") Logger.Warn("DataType [{0}] not implemented!", oIndex.DataType)
End Select End Select
If Not IsNothing(oControl) Then If Not IsNothing(oControl) Then
@ -511,7 +504,7 @@ Public Class frmGlobix_Index
End If End If
Try Try
Dim oMeta = DirectCast(pControl.Tag, ControlMeta) Dim oMeta = DirectCast(pControl.Tag, GlobalIndexer.ControlMeta)
Dim oIndexName As String = oMeta.IndexName Dim oIndexName As String = oMeta.IndexName
Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%' AND DOK_ID = {SelectedDocType.Guid}" Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%' AND DOK_ID = {SelectedDocType.Guid}"
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL) Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL)
@ -559,7 +552,7 @@ Public Class frmGlobix_Index
Continue For Continue For
End If End If
Dim oMeta = DirectCast(oControl.Tag, ControlMeta) Dim oMeta = DirectCast(oControl.Tag, GlobalIndexer.ControlMeta)
Dim oIndex As String = oMeta.IndexName Dim oIndex As String = oMeta.IndexName
If oIndex = IndexName Then If oIndex = IndexName Then
@ -753,28 +746,51 @@ Public Class frmGlobix_Index
ClearNotice() ClearNotice()
Cursor = Cursors.WaitCursor Cursor = Cursors.WaitCursor
Logger.Info("Validating user values")
Dim oValidator As New ClassValidator(My.LogConfig, My.Application.Service.Client, ManualIndexes) Dim oValidator As New ClassValidator(My.LogConfig, My.Application.Service.Client, ManualIndexes)
If oValidator.ValidateControls(pnlIndex, pDocType) = False Then If oValidator.ValidateControls(pnlIndex, pDocType) = False Then
Return False Return False
End If End If
Logger.Info("Collecting user values")
Dim oValues = oValidator.GetControlValues(pnlIndex) Dim oValues = oValidator.GetControlValues(pnlIndex)
Logger.Info("Preparing method parameters")
Dim oFilePath As String = My.Application.Globix.CurrentWorkfile.FilePath Dim oFilePath As String = My.Application.Globix.CurrentWorkfile.FilePath
Dim oObjectStore As String = "WORK" Dim oObjectStore As String = SelectedDocType.ObjectStore
Dim oObjectKind As String = "DOC" Dim oObjectKind As String = "DOC"
Dim oBusinessEntity As String = "DEFAULT" Dim oBusinessEntity As String = "DEFAULT"
Dim oProfileId As Integer = SelectedDocType.Guid Dim oProfileId As Integer = SelectedDocType.Guid
Dim oAttributes As List(Of UserAttributeValue) = oValues Dim oAttributes As List(Of UserAttributeValue) = oValues
Dim oOptions As New Modules.EDMI.API.Options.ImportFileOptions Dim oOptions As New Options.ImportFileOptions
Await My.Application.Service.Client.ImportFileAsync( Logger.Debug("FilePath: [{0}]", oFilePath)
Logger.Debug("ObjectStore: [{0}]", oObjectStore)
Logger.Debug("ObjectKind: [{0}]", oObjectKind)
Logger.Debug("BusinessEntity: [{0}]", oBusinessEntity)
Logger.Debug("ProfileId: [{0}]", oProfileId)
Logger.Debug("BusinessEntity: [{0}]", oBusinessEntity)
Logger.Info("Running Import")
Dim oResult = Await My.Application.Service.Client.ImportFileAsync(
oFilePath, oProfileId, oAttributes, oObjectStore, oObjectKind, oBusinessEntity, oOptions) oFilePath, oProfileId, oAttributes, oObjectStore, oObjectKind, oBusinessEntity, oOptions)
MsgBox("Die Datei wurde erfolgreich verarbeitet!", MsgBoxStyle.Information, Text) Logger.Info("Import result: [{0}]", oResult.OK)
Logger.Info("Imported file got ObjectId [{0}]", oResult.ObjectId)
If oResult.OK Then
MsgBox("Die Datei wurde erfolgreich verarbeitet!", MsgBoxStyle.Information, Text)
Return True
Else
Logger.Warn("Import failed with message: [{0}] and details [{1}]", oResult.ErrorMessage, oResult.ErrorDetails)
MsgBox($"Die Datei wurde nicht verarbeitet.{vbNewLine}{vbNewLine}Fehler: {oResult.ErrorMessage}", MsgBoxStyle.Critical, Text)
Return False
End If
Return True
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
MsgBox("Indexierung fehlgeschlagen!", MsgBoxStyle.Critical, Text) MsgBox("Indexierung fehlgeschlagen!", MsgBoxStyle.Critical, Text)
@ -793,6 +809,7 @@ Public Class frmGlobix_Index
Exit Sub Exit Sub
End If End If
Logger.Info("Importing file with DocumentType [{0}]", oDokart.Name)
Dim oResult = Await GlobixFlowNew(oDokart) Dim oResult = Await GlobixFlowNew(oDokart)
If oResult = True Then If oResult = True Then
DocumentViewer1.CloseDocument() DocumentViewer1.CloseDocument()
@ -806,4 +823,9 @@ Public Class frmGlobix_Index
Private Sub PreviewItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles PreviewItem.CheckedChanged Private Sub PreviewItem_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles PreviewItem.CheckedChanged
SetFilePreview(PreviewItem.Checked) SetFilePreview(PreviewItem.Checked)
End Sub End Sub
Private Sub checkItemTopMost_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles checkItemTopMost.CheckedChanged
My.UIConfig.Globix.TopMost = checkItemTopMost.Checked
My.UIConfigManager.Save()
End Sub
End Class End Class

View File

@ -35,7 +35,9 @@ Module ModuleHelpers
Dim connectionString As String = "" Dim connectionString As String = ""
Try Try
Dim oSQL = "SELECT * FROM TBDD_CONNECTION WHERE GUID = " & id Dim oSQL = "SELECT * FROM TBDD_CONNECTION WHERE GUID = " & id
Dim DTConnection As DataTable = clsDataASorDB.GetDatatable("DD_ECM", oSQL, "TBDD_CONNECTION", "GUID = " & id, "") Dim DTConnection As DataTable = My.Database.GetDatatable("TBDD_CONNECTION", oSQL, Modules.EDMI.API.Constants.DatabaseType.ECM, $"GUID = {id}")
If DTConnection.Rows.Count = 1 Then If DTConnection.Rows.Count = 1 Then
Dim CSType = DTConnection.Rows(0).Item("SQL_PROVIDER").ToString.ToUpper Dim CSType = DTConnection.Rows(0).Item("SQL_PROVIDER").ToString.ToUpper
Select Case CSType Select Case CSType

View File

@ -253,6 +253,12 @@
<Compile Include="Globix\Models\DocumentType.vb" /> <Compile Include="Globix\Models\DocumentType.vb" />
<Compile Include="Globix\Models\ManualIndex.vb" /> <Compile Include="Globix\Models\ManualIndex.vb" />
<Compile Include="Globix\Models\WorkFile.vb" /> <Compile Include="Globix\Models\WorkFile.vb" />
<Compile Include="frmWaitForm.Designer.vb">
<DependentUpon>frmWaitForm.vb</DependentUpon>
</Compile>
<Compile Include="frmWaitForm.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="modCurrent.vb" /> <Compile Include="modCurrent.vb" />
<Compile Include="MyDataset.Designer.vb"> <Compile Include="MyDataset.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@ -432,6 +438,9 @@
<EmbeddedResource Include="Globix\frmGlobixNameconvention.resx"> <EmbeddedResource Include="Globix\frmGlobixNameconvention.resx">
<DependentUpon>frmGlobixNameconvention.vb</DependentUpon> <DependentUpon>frmGlobixNameconvention.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmWaitForm.resx">
<DependentUpon>frmWaitForm.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Search\frmFlowSearch.resx"> <EmbeddedResource Include="Search\frmFlowSearch.resx">
<DependentUpon>frmFlowSearch.vb</DependentUpon> <DependentUpon>frmFlowSearch.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>

View File

@ -22,7 +22,6 @@ Public Class frmFlowForm
' Common Helpers Classes ' Common Helpers Classes
Private Init As ClassInit Private Init As ClassInit
Private AppServerOrDB As ClassDataASorDB
Private FileClass As Filesystem.File Private FileClass As Filesystem.File
' Globix Helper Classes ' Globix Helper Classes
@ -69,9 +68,6 @@ Public Class frmFlowForm
' === Show Splash Screen === ' === Show Splash Screen ===
SplashScreenManager.ShowForm(Me, GetType(frmSplash), False, False) SplashScreenManager.ShowForm(Me, GetType(frmSplash), False, False)
' === Initialize AppServer Database Connection with Failover
AppServerOrDB = New ClassDataASorDB(My.LogConfig)
' === Initialization === ' === Initialization ===
Init = New ClassInit(My.LogConfig, Me) Init = New ClassInit(My.LogConfig, Me)
AddHandler Init.Completed, AddressOf Init_Completed AddHandler Init.Completed, AddressOf Init_Completed
@ -110,7 +106,7 @@ Public Class frmFlowForm
AddHandler Watcher.ClipboardChanged, AddressOf Watcher_ClipboardChanged AddHandler Watcher.ClipboardChanged, AddressOf Watcher_ClipboardChanged
Dim oSQL = My.Queries.Common.FNIDB_GET_SEARCH_PROFILES(My.Application.User.UserId, My.Application.User.Language) Dim oSQL = My.Queries.Common.FNIDB_GET_SEARCH_PROFILES(My.Application.User.UserId, My.Application.User.Language)
Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oSql) Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
PictureBoxSearch1.Visible = False PictureBoxSearch1.Visible = False
If Not IsNothing(oDatatable) OrElse oDatatable.Rows.Count > 0 Then If Not IsNothing(oDatatable) OrElse oDatatable.Rows.Count > 0 Then
IDBSearchActive = True IDBSearchActive = True
@ -161,9 +157,8 @@ Public Class frmFlowForm
If My.Application.ModulesActive.Contains(MODULE_GLOBAL_INDEXER) Then If My.Application.ModulesActive.Contains(MODULE_GLOBAL_INDEXER) Then
FileDrop = New ClassFileDrop(My.LogConfig) FileDrop = New ClassFileDrop(My.LogConfig)
FileHandle = New ClassFilehandle() FileHandle = New ClassFilehandle(My.LogConfig)
FolderWatch = New ClassFolderwatcher() FolderWatch = New ClassFolderwatcher(My.LogConfig)
'Refresh_RegexTable()
Dim oFileExclusions As New ClassExclusions() Dim oFileExclusions As New ClassExclusions()
If oFileExclusions.Load(My.Application.Globix.PATH_FileExclusions) = False Then If oFileExclusions.Load(My.Application.Globix.PATH_FileExclusions) = False Then
@ -180,17 +175,17 @@ Public Class frmFlowForm
GlobixToolStripMenuItem.Visible = True GlobixToolStripMenuItem.Visible = True
End If End If
oSQL = "SELECT * FROM TBIDB_ATTRIBUTE"
My.Tables.DTIDB_ATTRIBUTE = AppServerOrDB.GetDatatable("IDB", oSQL, "TBIDB_ATTRIBUTE", "", "") oSQL = "SELECT * FROM TBIDB_ATTRIBUTE"
My.Tables.DTIDB_ATTRIBUTE = My.Database.GetDatatable("TBIDB_ATTRIBUTE", "SELECT * FROM TBIDB_ATTRIBUTE", EDMI.API.Constants.DatabaseType.IDB)
Me.Cursor = Cursors.Default Me.Cursor = Cursors.Default
End Sub End Sub
Public Sub Init_Folderwatch() Public Sub Init_Folderwatch()
Try Try
Dim oSql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId Dim oSql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId
Dim oDT = My.Database.GetDatatable("TBGI_FOLDERWATCH_USER", oSql, EDMI.API.Constants.DatabaseType.ECM, $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}")
Dim oDT As DataTable = AppServerOrDB.GetDatatable("DD_ECM", oSql, "TBGI_FOLDERWATCH_USER", $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}")
If oDT.Rows.Count = 0 Then If oDT.Rows.Count = 0 Then
'Throw New ApplicationException("No Default Path configured for User!") 'Throw New ApplicationException("No Default Path configured for User!")
@ -204,7 +199,6 @@ Public Class frmFlowForm
If oFolderWatchPath = String.Empty Then If oFolderWatchPath = String.Empty Then
Logger.Info("Init_Folderwatch: folderwatchPath is empty") Logger.Info("Init_Folderwatch: folderwatchPath is empty")
My.Application.Globix.Folderwatchstarted = False My.Application.Globix.Folderwatchstarted = False
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "False")
My.UIConfig.Globix.FolderWatchStarted = False My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save() My.UIConfigManager.Save()
@ -213,7 +207,6 @@ Public Class frmFlowForm
If Not IO.Directory.Exists(oFolderWatchPath) Then If Not IO.Directory.Exists(oFolderWatchPath) Then
Logger.Info("Init_Folderwatch: folderwatchPath does not exists or is invalid path") Logger.Info("Init_Folderwatch: folderwatchPath does not exists or is invalid path")
My.Application.Globix.Folderwatchstarted = False My.Application.Globix.Folderwatchstarted = False
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "False")
My.UIConfig.Globix.FolderWatchStarted = False My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save() My.UIConfigManager.Save()
@ -335,19 +328,6 @@ Public Class frmFlowForm
Private Sub PictureBoxSearch1_Click(sender As Object, e As EventArgs) Handles PictureBoxSearch1.Click Private Sub PictureBoxSearch1_Click(sender As Object, e As EventArgs) Handles PictureBoxSearch1.Click
Open_FlowSearch() Open_FlowSearch()
'Cursor = Cursors.WaitCursor
'If TheFormIsAlreadyLoaded("frmSearchStart") Then
' Cursor = Cursors.Default
' Exit Sub
'End If
'Dim oForm As New frmSearchStart(DTIDB_SEARCHES) 'frmFlowSearch(osql)
'oForm.Show()
'Cursor = Cursors.Default
'If TimerCheckActiveForms.Enabled = False Then
' TimerCheckActiveForms.Enabled = True
'End If
End Sub End Sub
Private Sub ZooFlowBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ZooFlowBeendenToolStripMenuItem.Click Private Sub ZooFlowBeendenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ZooFlowBeendenToolStripMenuItem.Click
@ -474,46 +454,41 @@ Public Class frmFlowForm
TimerCheckDroppedFiles.Start() TimerCheckDroppedFiles.Start()
Me.Cursor = Cursors.WaitCursor Me.Cursor = Cursors.WaitCursor
End If End If
PictureBoxDragDrop.Image = My.Resources._1_LOGO_ZOO_FLOW1
End Sub End Sub
Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBoxDragDrop.DragDrop Private Sub PictureBox1_DragDrop(sender As Object, e As DragEventArgs) Handles PictureBoxDragDrop.DragDrop
DragDropForm(e) DragDropForm(e)
End Sub End Sub
Private Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick Private Async Sub TimerCheckDroppedFiles_Tick(sender As Object, e As EventArgs) Handles TimerCheckDroppedFiles.Tick
If Not My.Application.ModulesActive.Contains(ClassConstants.MODULE_GLOBAL_INDEXER) Then If Not My.Application.ModulesActive.Contains(ClassConstants.MODULE_GLOBAL_INDEXER) Then
Exit Sub Exit Sub
End If End If
TimerCheckDroppedFiles.Stop() TimerCheckDroppedFiles.Stop()
Globix_Check_Dropped_Files() Await Globix_Check_Dropped_Files()
Me.Cursor = Cursors.Default Me.Cursor = Cursors.Default
End Sub End Sub
Sub Globix_Check_Dropped_Files() Private Async Function Globix_Check_Dropped_Files() As Threading.Tasks.Task
Try Try
My.DatabaseECM.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") Await My.DatabaseECM.ExecuteNonQueryAsync($"DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')")
Dim i As Integer Dim i As Integer
For Each Str As Object In FileDrop.files_dropped For Each pFile As String In FileDrop.files_dropped
If Not Str Is Nothing Then If Not pFile Is Nothing Then
Logger.Info(" Check Drop-File: " & Str.ToString) Logger.Info(" Check Drop-File: " & pFile.ToString)
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("|") + 1) Dim handleType As String = pFile.Substring(0, pFile.LastIndexOf("|") + 1)
Dim filename As String = Str.Substring(Str.LastIndexOf("|") + 1) Dim filename As String = pFile.Substring(pFile.LastIndexOf("|") + 1)
If FileHandle.CheckDuplicateFiles(filename, "Manuelle Ablage") Then If FileHandle.CheckDuplicateFiles(filename, "Manuelle Ablage") Then
FileHandle.Decide_FileHandle(filename, handleType) FileHandle.Decide_FileHandle(filename, handleType)
i += 1 i += 1
Else
' Console.WriteLine("File gibt es bereits")
End If End If
End If End If
Next Next
Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')"
My.Application.Globix.DTACTUAL_FILES = Nothing My.Application.Globix.DTACTUAL_FILES = Nothing
My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql) My.Application.Globix.DTACTUAL_FILES = Await My.DatabaseECM.GetDatatableAsync(sql)
My.Application.Globix.ABORT_INDEXING = False My.Application.Globix.ABORT_INDEXING = False
Dim oOnlyFilesFromFilesystem = True Dim oOnlyFilesFromFilesystem = True
@ -530,17 +505,19 @@ Public Class frmFlowForm
My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql) My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql)
End If End If
For Each oFileRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows For Each oRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows
Dim oFilePath As String = oFileRow.Item("FILENAME2WORK").ToString Dim oFilePath As String = oRow.Item("FILENAME2WORK").ToString
Dim oFileId As Integer = oRow.Item("GUID")
My.Application.Globix.CurrentWorkfile = New Globix.Models.WorkFile With { My.Application.Globix.CurrentWorkfile = New Globix.Models.WorkFile With {
.Id = oFileRow.Item(0), .Id = oFileId,
.FilePath = oFilePath .FilePath = oFilePath
} }
Logger.Info(" CURRENT_WORKFILE: {0}", My.Application.Globix.CurrentWorkfile) Logger.Info(" CURRENT_WORKFILE: {0}", My.Application.Globix.CurrentWorkfile)
If IO.File.Exists(My.Application.Globix.CurrentWorkfile.FilePath) = True And My.Application.Globix.DTACTUAL_FILES.Rows.Count > 0 Then If IO.File.Exists(My.Application.Globix.CurrentWorkfile.FilePath) = True And My.Application.Globix.DTACTUAL_FILES.Rows.Count > 0 Then
Globix_Open_IndexDialog() Globix_Open_IndexDialog()
PictureBoxDragDrop.Image = My.Resources._1_LOGO_ZOO_FLOW1
End If End If
Next Next
Show() Show()
@ -549,7 +526,7 @@ Public Class frmFlowForm
Show() Show()
End Try End Try
End Sub End Function
Sub Globix_Open_IndexDialog() Sub Globix_Open_IndexDialog()
Try Try
IndexForm = New frmGlobix_Index(My.LogConfig) IndexForm = New frmGlobix_Index(My.LogConfig)
@ -597,12 +574,6 @@ Public Class frmFlowForm
End If End If
If My.Application.Globix.CurrentFolderWatchPath <> "" Or My.Application.Globix.CURRENT_SCAN_FOLDERWATCH <> "" Then If My.Application.Globix.CurrentFolderWatchPath <> "" Or My.Application.Globix.CURRENT_SCAN_FOLDERWATCH <> "" Then
'If My.Application.Globix.Folderwatchstarted = True Then
' tslblFW.Visible = True
'Else
' tslblFW.Visible = False
'End If
Try Try
If My.UIConfigManager.Config.Globix.FolderWatchScanStarted = True Then If My.UIConfigManager.Config.Globix.FolderWatchScanStarted = True Then
Logger.Info("FWSCAN started - Checking file:" & My.Application.Globix.CURRENT_SCAN_FOLDERWATCH) Logger.Info("FWSCAN started - Checking file:" & My.Application.Globix.CURRENT_SCAN_FOLDERWATCH)

83
GUIs.ZooFlow/frmWaitForm.Designer.vb generated Normal file
View File

@ -0,0 +1,83 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmWaitForm
Inherits DevExpress.XtraWaitForm.WaitForm
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.progressPanel1 = New DevExpress.XtraWaitForm.ProgressPanel()
Me.tableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.tableLayoutPanel1.SuspendLayout()
Me.SuspendLayout()
'
'progressPanel1
'
Me.progressPanel1.Appearance.BackColor = System.Drawing.Color.Transparent
Me.progressPanel1.Appearance.Options.UseBackColor = True
Me.progressPanel1.AppearanceCaption.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!)
Me.progressPanel1.AppearanceCaption.Options.UseFont = True
Me.progressPanel1.AppearanceDescription.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!)
Me.progressPanel1.AppearanceDescription.Options.UseFont = True
Me.progressPanel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.progressPanel1.ImageHorzOffset = 20
Me.progressPanel1.Location = New System.Drawing.Point(0, 17)
Me.progressPanel1.Margin = New System.Windows.Forms.Padding(0, 3, 0, 3)
Me.progressPanel1.Name = "progressPanel1"
Me.progressPanel1.Size = New System.Drawing.Size(246, 39)
Me.progressPanel1.TabIndex = 0
Me.progressPanel1.Text = "progressPanel1"
'
'tableLayoutPanel1
'
Me.tableLayoutPanel1.AutoSize = True
Me.tableLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
Me.tableLayoutPanel1.BackColor = System.Drawing.Color.Transparent
Me.tableLayoutPanel1.ColumnCount = 1
Me.tableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.tableLayoutPanel1.Controls.Add(Me.progressPanel1, 0, 0)
Me.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
Me.tableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
Me.tableLayoutPanel1.Name = "tableLayoutPanel1"
Me.tableLayoutPanel1.Padding = New System.Windows.Forms.Padding(0, 14, 0, 14)
Me.tableLayoutPanel1.RowCount = 1
Me.tableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.tableLayoutPanel1.Size = New System.Drawing.Size(246, 73)
Me.tableLayoutPanel1.TabIndex = 1
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoSize = True
Me.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
Me.ClientSize = New System.Drawing.Size(246, 73)
Me.Controls.Add(Me.tableLayoutPanel1)
Me.DoubleBuffered = True
Me.Name = "Form1"
Me.StartPosition = FormStartPosition.Manual
Me.Text = "Form1"
Me.tableLayoutPanel1.ResumeLayout(false)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private WithEvents progressPanel1 As DevExpress.XtraWaitForm.ProgressPanel
Private WithEvents tableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
End Class

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"></xsd:import>
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"></xsd:attribute>
<xsd:attribute name="type" type="xsd:string"></xsd:attribute>
<xsd:attribute name="mimetype" type="xsd:string"></xsd:attribute>
<xsd:attribute ref="xml:space"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"></xsd:attribute>
<xsd:attribute name="name" type="xsd:string"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"></xsd:attribute>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"></xsd:attribute>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"></xsd:attribute>
<xsd:attribute ref="xml:space"></xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"></xsd:element>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"></xsd:attribute>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,24 @@
Public Class frmWaitForm
Sub New
InitializeComponent()
Me.progressPanel1.AutoHeight = True
End Sub
Public Overrides Sub SetCaption(ByVal caption As String)
MyBase.SetCaption(caption)
Me.progressPanel1.Caption = caption
End Sub
Public Overrides Sub SetDescription(ByVal description As String)
MyBase.SetDescription(description)
Me.progressPanel1.Description = description
End Sub
Public Overrides Sub ProcessCommand(ByVal cmd As System.Enum, ByVal arg As Object)
MyBase.ProcessCommand(cmd, arg)
End Sub
Public Enum WaitFormCommand
SomeCommandId
End Enum
End Class

View File

@ -4,6 +4,7 @@ Imports DigitalData.Modules.EDMI.API
Imports System.IO Imports System.IO
Imports System.Text Imports System.Text
Imports DigitalData.Modules.EDMI.API.Client Imports DigitalData.Modules.EDMI.API.Client
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Public Class frmtest Public Class frmtest
@ -36,7 +37,7 @@ Public Class frmtest
Private Async Sub btnImportFile_Click_(sender As Object, e As EventArgs) Handles btnImportFile.Click Private Async Sub btnImportFile_Click_(sender As Object, e As EventArgs) Handles btnImportFile.Click
Dim oObjectId As Long = Await My.Application.Service.Client.ImportFileAsync( Dim oResponse As ImportFileResponse = Await My.Application.Service.Client.ImportFileAsync(
txtFile2Import.Text, txtFile2Import.Text,
txtProfileId.Text, txtProfileId.Text,
New List(Of EDMIServiceReference.UserAttributeValue) From { New List(Of EDMIServiceReference.UserAttributeValue) From {
@ -50,11 +51,13 @@ Public Class frmtest
"DEFAULT" "DEFAULT"
) )
If oObjectId <> INVALID_OBEJCT_ID Then If oResponse.OK Then
MsgBox("File Imported!", MsgBoxStyle.Information, Text) MsgBox("File Imported!", MsgBoxStyle.Information, Text)
txtIDB_OBJ_ID.Text = oResponse.ObjectId
Else Else
MsgBox("File was not imported. Check the server logs!") MsgBox("File was not imported. Check the server logs!", MsgBoxStyle.Critical, Text)
End If End If
txtIDB_OBJ_ID.Text = oObjectId
End Sub End Sub
End Class End Class

View File

@ -12,6 +12,5 @@ Module modCurrent
Public Property NI_TITLE As String = "" Public Property NI_TITLE As String = ""
Public Property NI_MESSAGE As String = "" Public Property NI_MESSAGE As String = ""
Public Property NI_TYPE As String = "INFO" Public Property NI_TYPE As String = "INFO"
Public Property clsDataASorDB As ClassDataASorDB
Public Property GLOBIX_JUMP_DOCTYPE_ID As Integer Public Property GLOBIX_JUMP_DOCTYPE_ID As Integer
End Module End Module

View File

@ -187,7 +187,7 @@ Public Class Client
pObjectKind As String, pObjectKind As String,
pBusinessEntity As String, pBusinessEntity As String,
Optional pImportOptions As Options.ImportFileOptions = Nothing Optional pImportOptions As Options.ImportFileOptions = Nothing
) As Task(Of Long) ) As Task(Of ImportFileResponse)
Try Try
' Set default options ' Set default options
If pImportOptions Is Nothing Then If pImportOptions Is Nothing Then
@ -233,16 +233,13 @@ Public Class Client
.ProfileId = pProfileId, .ProfileId = pProfileId,
.AttributeValues = pAttributeValues.ToArray .AttributeValues = pAttributeValues.ToArray
}) })
If oFileImportResponse.OK = False Then
Throw New ApplicationException("Could not Import File Contents!")
End If
Return oFileImportResponse.ObjectId Return oFileImportResponse
End Using End Using
End Using End Using
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
Return INVALID_OBEJCT_ID Return Nothing
End Try End Try
End Function End Function

View File

@ -48,7 +48,7 @@ Public Class DatabaseWithFallback
End Try End Try
If oTableResult Is Nothing OrElse oTableResult.OK = False Then If oTableResult Is Nothing OrElse oTableResult.OK = False Then
_Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.") _Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.", pDataTableName)
Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType) Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType)
End If End If

View File

@ -101,6 +101,7 @@ Public Class LogConfig
Private _config As LoggingConfiguration Private _config As LoggingConfiguration
Private _isDebug As Boolean = False Private _isDebug As Boolean = False
Private _isTrace As Boolean = False
#End Region #End Region
#Region "Public Properties" #Region "Public Properties"
@ -139,7 +140,17 @@ Public Class LogConfig
End Get End Get
Set(isDebug As Boolean) Set(isDebug As Boolean)
_isDebug = isDebug _isDebug = isDebug
ReloadConfig(isDebug) ReloadConfig(isDebug, _isTrace)
End Set
End Property
Public Property Trace As Boolean
Get
Return _isTrace
End Get
Set(isTrace As Boolean)
_isTrace = isTrace
ReloadConfig(_isDebug, isTrace)
End Set End Set
End Property End Property
@ -467,7 +478,8 @@ Public Class LogConfig
''' Reconfigures and re-adds all loggers, optionally adding the debug rule. ''' Reconfigures and re-adds all loggers, optionally adding the debug rule.
''' </summary> ''' </summary>
''' <param name="Debug">Adds the Debug rule if true.</param> ''' <param name="Debug">Adds the Debug rule if true.</param>
Private Sub ReloadConfig(Optional Debug As Boolean = False) ''' <param name="Trace">Adds the Trace rule if true.</param>
Private Sub ReloadConfig(Optional Debug As Boolean = False, Optional Trace As Boolean = False)
' Clear Logging Rules ' Clear Logging Rules
_config.LoggingRules.Clear() _config.LoggingRules.Clear()
@ -476,11 +488,14 @@ Public Class LogConfig
' Add debug rule, if configured ' Add debug rule, if configured
If Debug Then If Debug Then
_config.AddRuleForAllLevels(TARGET_TRACE)
_config.AddRule(LogLevel.Debug, LogLevel.Error, TARGET_DEBUG) _config.AddRule(LogLevel.Debug, LogLevel.Error, TARGET_DEBUG)
_config.AddRule(LogLevel.Debug, LogLevel.Error, TARGET_MEMORY) _config.AddRule(LogLevel.Debug, LogLevel.Error, TARGET_MEMORY)
End If End If
If Trace Then
_config.AddRuleForAllLevels(TARGET_TRACE)
End If
' Reload all running loggers ' Reload all running loggers
LogFactory.ReconfigExistingLoggers() LogFactory.ReconfigExistingLoggers()
End Sub End Sub

View File

@ -1,10 +1,10 @@
Imports DigitalData.Modules.Database Imports DigitalData.Modules.Database
Public Class Environment Public Class Environment
Public User As State.UserState Public Property User As State.UserState
Public Settings As State.SettingsState Public Property Settings As State.SettingsState
Public Service As State.ServiceState Public Property Service As State.ServiceState
Public Database As MSSQLServer Public Property Database As MSSQLServer
Public DatabaseIDB As MSSQLServer Public Property DatabaseIDB As MSSQLServer
Public Modules As Dictionary(Of String, State.ModuleState) Public Property Modules As Dictionary(Of String, State.ModuleState)
End Class End Class

View File

@ -16,6 +16,10 @@
Public Overrides Function ToString() As String Public Overrides Function ToString() As String
Return Name Return Name
End Function End Function
Public Overrides Function GetHashCode() As Integer
Return Name.GetHashCode()
End Function
End Class End Class
Public Class AutoAttributeValue Public Class AutoAttributeValue

View File

@ -121,8 +121,8 @@ Namespace Methods.GlobalIndexer.ImportFile
Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes) Dim oAutoAttributeDict = Helpers.UserAttributesToDictionary(pAutoAttributes)
If pPathConvention Is Nothing OrElse pPathConvention = String.Empty Then If pPathConvention Is Nothing OrElse pPathConvention = String.Empty Then
Logger.Warn("Virtual path template for File [{0}] was empty. Returning empty string.", pFileInfo.Name) Logger.Warn("Virtual path template for File [{0}] was empty. Returning nothing.", pFileInfo.Name)
Return String.Empty Return Nothing
End If End If

View File

@ -119,16 +119,16 @@ Namespace Methods.GlobalIndexer
For Each oRow As DataRow In oManualIndexes.Table.Rows For Each oRow As DataRow In oManualIndexes.Table.Rows
Dim oManualIndex As New ManualIndex With { Dim oManualIndex As New ManualIndex With {
.Id = oRow.ItemEx(Of Integer)("GUID"), .Id = oRow.ItemEx(Of Integer)("GUID"),
.Name = oRow.ItemEx(Of String)("INDEXNAME"), .Name = oRow.ItemEx(Of String)("INDEXNAME"),
.ProfileId = oRow.ItemEx(Of Integer)("DOCTYPE_ID"), .ProfileId = oRow.ItemEx(Of Integer)("DOK_ID"),
.IsOptional = oRow.ItemEx(Of Boolean)("OPTIONAL"), .IsOptional = oRow.ItemEx(Of Boolean)("OPTIONAL"),
.IsMultiselect = oRow.ItemEx(Of String)("MULTISELECT"), .IsMultiselect = oRow.ItemEx(Of String)("MULTISELECT"),
.SQLCommand = oRow.ItemEx(Of String)("SQL_RESULT"), .SQLCommand = oRow.ItemEx(Of String)("SQL_RESULT"),
.SQLConnectionId = oRow.ItemEx(Of Integer)("CONNECTION_ID"), .SQLConnectionId = oRow.ItemEx(Of Integer)("CONNECTION_ID"),
.DefaultValue = oRow.ItemEx(Of String)("DEFAULT_VALUE"), .DefaultValue = oRow.ItemEx(Of String)("DEFAULT_VALUE"),
.DataType = oRow.ItemEx(Of String)("DATA_TYPE") .DataType = oRow.ItemEx(Of String)("DATATYPE")
} }
oIndexes.Add(oManualIndex) oIndexes.Add(oManualIndex)
Next Next