Globi Integration und Suche Abhängig

This commit is contained in:
2020-11-25 17:44:40 +01:00
parent 0dd9788d8f
commit 1638fdc173
24 changed files with 1545 additions and 3796 deletions

View File

@@ -998,147 +998,147 @@ Public Class frmGlobix_Index
End Try
End Function
Private Function Write_Indizes()
'Try
Dim indexierung_erfolgreich As Boolean = False
Try
Dim indexierung_erfolgreich As Boolean = False
'Manuelle Indexe Indexieren
' If My.Application.Globix.CURR_MAN_INDEXE.Rows.Count > 0 Then
' Dim Count As Integer = 0
' For Each row As DataRow In DTMan.Rows
' Dim idxvalue = row.Item("Indexwert")
' Dim indexname = row.Item("WD_INDEX").ToString
' _Logger.Debug($"Write_Indizes - Index [{indexname}]...")
' Dim optional_Index = CBool(row.Item("OPTIONAL"))
' Dim indexiert = CBool(row.Item("Indexiert"))
' If indexiert And idxvalue.ToString <> "" And idxvalue <> "EMPTY_OI" Then
' If indexname <> String.Empty Then
' If row.Item("SAVE_VALUE") = True Then
' 'Den Indexwert zwischenspeichern
' Dim DTTemp As DataTable = MyDataset.TBTEMP_INDEXRESULTS
' Dim rowexists As Boolean = False
' For Each rowTemp As DataRow In DTTemp.Rows
' 'Wenn bereits ein Eintrag existiert.....
' If rowTemp.Item("Dokumentart") = row.Item("DOKUMENTART") And rowTemp.Item("Indexname") = row.Item("INDEXNAME") Then
' rowexists = True
' '......überschreiben
' rowTemp.Item("Value") = row.Item("Indexwert")
' End If
' Next
' '.....ansonsten neu anlegen
' If rowexists = False Then
' Dim newRow As DataRow = DTTemp.NewRow()
' newRow("Dokumentart") = row.Item("DOKUMENTART").ToString
' newRow("Indexname") = row.Item("INDEXNAME").ToString
' newRow("Value") = row.Item("Indexwert")
' DTTemp.Rows.Add(newRow)
' End If
' End If
If My.Application.Globix.CURR_MAN_INDEXE.Rows.Count > 0 Then
Dim Count As Integer = 0
For Each row As DataRow In DTMan.Rows
Dim idxvalue = row.Item("Indexwert")
Dim indexname = row.Item("WD_INDEX").ToString
_Logger.Debug($"Write_Indizes - Index [{indexname}]...")
Dim optional_Index = CBool(row.Item("OPTIONAL"))
Dim indexiert = CBool(row.Item("Indexiert"))
If indexiert And idxvalue.ToString <> "" And idxvalue <> "EMPTY_OI" Then
If indexname <> String.Empty Then
If row.Item("SAVE_VALUE") = True Then
'Den Indexwert zwischenspeichern
Dim DTTemp As DataTable = MyDataset.TBTEMP_INDEXRESULTS
Dim rowexists As Boolean = False
For Each rowTemp As DataRow In DTTemp.Rows
'Wenn bereits ein Eintrag existiert.....
If rowTemp.Item("Dokumentart") = row.Item("DOKUMENTART") And rowTemp.Item("Indexname") = row.Item("INDEXNAME") Then
rowexists = True
'......überschreiben
rowTemp.Item("Value") = row.Item("Indexwert")
End If
Next
'.....ansonsten neu anlegen
If rowexists = False Then
Dim newRow As DataRow = DTTemp.NewRow()
newRow("Dokumentart") = row.Item("DOKUMENTART").ToString
newRow("Indexname") = row.Item("INDEXNAME").ToString
newRow("Value") = row.Item("Indexwert")
DTTemp.Rows.Add(newRow)
End If
End If
' _Logger.Debug($"Manueller Indexvalue [{idxvalue.ToString}]...NOW THE INDEXING...")
' Count += 1
_Logger.Debug($"Manueller Indexvalue [{idxvalue.ToString}]...NOW THE INDEXING...")
Count += 1
' ' den Typ des Zielindexes auslesen
' Dim oIndexType As Integer = WINDREAM.GetIndexType(indexname)
' _Logger.Debug($"oIndexType [{oIndexType.ToString}]...")
' If oIndexType < WINDREAM.WMObjectVariableValueTypeVector Then
' _Logger.Debug($"Indexing oIndexType < WINDREAM.WMObjectVariableValueTypeVector...")
' indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, idxvalue, CURR_DOKART_OBJECTTYPE)
' Else
' Dim oSplitArray = Split(idxvalue, ClassConstants.VECTORSEPARATOR)
' Dim oListofString As New List(Of String)
' If oSplitArray.Count = 0 Then
' oListofString.Add(idxvalue)
' Else
' For Each oStr In oSplitArray
' oListofString.Add(oStr)
' Next
' End If
' den Typ des Zielindexes auslesen
Dim oIndexType As Integer = WINDREAM.GetIndexType(indexname)
_Logger.Debug($"oIndexType [{oIndexType.ToString}]...")
If oIndexType < WINDREAM.WMObjectVariableValueTypeVector Then
_Logger.Debug($"Indexing oIndexType < WINDREAM.WMObjectVariableValueTypeVector...")
indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, idxvalue, CURR_DOKART_OBJECTTYPE)
Else
Dim oSplitArray = Split(idxvalue, ClassConstants.VECTORSEPARATOR)
Dim oListofString As New List(Of String)
If oSplitArray.Count = 0 Then
oListofString.Add(idxvalue)
Else
For Each oStr In oSplitArray
oListofString.Add(oStr)
Next
End If
' indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, oListofString, CURR_DOKART_OBJECTTYPE)
' End If
indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, oListofString, CURR_DOKART_OBJECTTYPE)
End If
' 'indexierung_erfolgreich = ClassWindream.DateiIndexieren(CURRENT_NEWFILENAME, indexname, idxvalue)
' If indexierung_erfolgreich = False Then
' MsgBox("Error in Indexing file - See log", MsgBoxStyle.Critical)
' Return False
' Exit For
' End If
' Else
'indexierung_erfolgreich = ClassWindream.DateiIndexieren(CURRENT_NEWFILENAME, indexname, idxvalue)
If indexierung_erfolgreich = False Then
MsgBox("Error in Indexing file - See log", MsgBoxStyle.Critical)
Return False
Exit For
End If
Else
' _Logger.Debug("No Indexing: indexname: " & indexname)
' _Logger.Debug("No Indexing: is optional? " & optional_Index.ToString)
' End If
' Else
' _Logger.Debug("Indexvalue is empty or field is not indexed - Indexname: " & indexname)
' _Logger.Info("Indexvalue is empty or field is not indexed - Indexname: " & indexname)
' End If
' Next
_Logger.Debug("No Indexing: indexname: " & indexname)
_Logger.Debug("No Indexing: is optional? " & optional_Index.ToString)
End If
Else
_Logger.Debug("Indexvalue is empty or field is not indexed - Indexname: " & indexname)
_Logger.Info("Indexvalue is empty or field is not indexed - Indexname: " & indexname)
End If
Next
' End If
' 'Automatische Indexe Indexieren
End If
'Automatische Indexe Indexieren
' If My.Application.Globix.CURR_AUTO_INDEXE.Rows.Count > 0 Then
' Dim Count As Integer = 0
' For Each row As DataRow In My.Application.Globix.CURR_AUTO_INDEXE.Rows
' Dim indexiert = CBool(row.Item("Indexiert"))
' Dim Indexvalue = row.Item("Indexwert").ToString
' Dim indexname = row.Item("INDEXNAME").ToString
' If indexiert = True And Indexvalue <> "" Then
' If Indexvalue <> "EMPTY_OI" Then
' _Logger.Info("Auto Indexname: " & indexname.ToString)
' _Logger.Info("Indexvalue: " & Indexvalue.ToString)
' Count += 1
If My.Application.Globix.CURR_AUTO_INDEXE.Rows.Count > 0 Then
Dim Count As Integer = 0
For Each row As DataRow In My.Application.Globix.CURR_AUTO_INDEXE.Rows
Dim indexiert = CBool(row.Item("Indexiert"))
Dim Indexvalue = row.Item("Indexwert").ToString
Dim indexname = row.Item("INDEXNAME").ToString
If indexiert = True And Indexvalue <> "" Then
If Indexvalue <> "EMPTY_OI" Then
_Logger.Info("Auto Indexname: " & indexname.ToString)
_Logger.Info("Indexvalue: " & Indexvalue.ToString)
Count += 1
' ' den Typ des Zielindexes auslesen
' Dim indexType As Integer = WINDREAM.GetIndexType(indexname)
' den Typ des Zielindexes auslesen
Dim indexType As Integer = WINDREAM.GetIndexType(indexname)
' If indexType < WINDREAM.WMObjectVariableValueTypeVector Then
' indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)
' Else
' Dim oSplitArray = Split(Indexvalue, ClassConstants.VECTORSEPARATOR)
' Dim oListofString As New List(Of String)
' If oSplitArray.Count = 0 Then
' oListofString.Add(Indexvalue)
' Else
' For Each oStr In oSplitArray
' oListofString.Add(oStr)
' Next
' End If
' indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, oListofString, CURR_DOKART_OBJECTTYPE)
' End If
If indexType < WINDREAM.WMObjectVariableValueTypeVector Then
indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)
Else
Dim oSplitArray = Split(Indexvalue, ClassConstants.VECTORSEPARATOR)
Dim oListofString As New List(Of String)
If oSplitArray.Count = 0 Then
oListofString.Add(Indexvalue)
Else
For Each oStr In oSplitArray
oListofString.Add(oStr)
Next
End If
indexierung_erfolgreich = WINDREAM.SetFileIndex(My.Application.Globix.CURRENT_NEWFILENAME, indexname, oListofString, CURR_DOKART_OBJECTTYPE)
End If
' 'indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)
' If indexierung_erfolgreich = False Then
' MsgBox("Error in indexing file - See log", MsgBoxStyle.Critical)
' Return False
' Exit For
' End If
' End If
' End If
' Next
' End If
' If DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Or DropType = "|MSGONLY|" Or My.Application.Globix.CURRENT_NEWFILENAME.EndsWith(".msg") Then
' indexierung_erfolgreich = SetEmailIndices()
' If indexierung_erfolgreich = False Then
' MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
' Return False
' End If
' ElseIf DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then
' indexierung_erfolgreich = SetAttachmentIndices()
' If indexierung_erfolgreich = False Then
' MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
' Return False
' End If
' End If
'Catch ex As Exception
' _Logger.Warn("Unexpected error in Write_Indizes - Fehler: " & vbNewLine & ex.Message)
' _Logger.Error(ex.Message)
' MsgBox("Error in Write_Indizes:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
' Return False
'End Try
Return True
'indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)
If indexierung_erfolgreich = False Then
MsgBox("Error in indexing file - See log", MsgBoxStyle.Critical)
Return False
Exit For
End If
End If
End If
Next
End If
If DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Or DropType = "|MSGONLY|" Or My.Application.Globix.CURRENT_NEWFILENAME.EndsWith(".msg") Then
indexierung_erfolgreich = SetEmailIndices()
If indexierung_erfolgreich = False Then
MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
Return False
End If
ElseIf DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then
indexierung_erfolgreich = SetAttachmentIndices()
If indexierung_erfolgreich = False Then
MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
Return False
End If
End If
Catch ex As Exception
_Logger.Warn("Unexpected error in Write_Indizes - Fehler: " & vbNewLine & ex.Message)
_Logger.Error(ex.Message)
MsgBox("Error in Write_Indizes:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
Return True
End Function
Private Function SINGLEFILE_2_IDB(pBusinessEntity As String) As Boolean
Try