|
|
|
@@ -835,7 +835,7 @@ Public Class frmIndex
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Next
|
|
|
|
Next
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
If DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Or DropType = "|MSGONLY|" Or CURRENT_NEWFILENAME.EndsWith(".msg") Then
|
|
|
|
If DropType = "|OUTLOOK_MESSAGE|" Or DropType = "|FW_MSGONLY|" Or DropType = "|MSGONLY|" Or CURRENT_NEWFILENAME.ToUpper.EndsWith(".msg") Or CURRENT_NEWFILENAME.ToUpper.EndsWith(".eml") Then
|
|
|
|
indexierung_erfolgreich = SetEmailIndicies(pIndexAttachment:=False)
|
|
|
|
indexierung_erfolgreich = SetEmailIndicies(pIndexAttachment:=False)
|
|
|
|
If indexierung_erfolgreich = False Then
|
|
|
|
If indexierung_erfolgreich = False Then
|
|
|
|
MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
|
|
|
|
MsgBox("Error in SetEmailIndices - See log", MsgBoxStyle.Critical)
|
|
|
|
@@ -856,21 +856,19 @@ Public Class frmIndex
|
|
|
|
End Try
|
|
|
|
End Try
|
|
|
|
Return True
|
|
|
|
Return True
|
|
|
|
End Function
|
|
|
|
End Function
|
|
|
|
Private Function WriteIndex2File(indexname As String, indexvalue As String)
|
|
|
|
Private Function WriteIndex2File(pIndexName As String, pIndexValue As String)
|
|
|
|
Try
|
|
|
|
Try
|
|
|
|
_Logger.Info("Indexvalue: " & indexvalue.ToString)
|
|
|
|
_Logger.Info($"Indexing with Name {pIndexName} and Value: {pIndexValue.ToString}")
|
|
|
|
Return WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, indexvalue, CURR_DOKART_OBJECTTYPE)
|
|
|
|
Return WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, pIndexName, pIndexValue, CURR_DOKART_OBJECTTYPE)
|
|
|
|
Catch ex As Exception
|
|
|
|
Catch ex As Exception
|
|
|
|
ShowErrorMessage(ex, "WriteIndex2File")
|
|
|
|
ShowErrorMessage(ex, "WriteIndex2File")
|
|
|
|
Return False
|
|
|
|
Return False
|
|
|
|
End Try
|
|
|
|
End Try
|
|
|
|
|
|
|
|
|
|
|
|
End Function
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
Private Function SetEmailIndicies(pIndexAttachment As Boolean) As Boolean
|
|
|
|
Private Function SetEmailIndicies(pIndexAttachment As Boolean) As Boolean
|
|
|
|
Try
|
|
|
|
Try
|
|
|
|
Dim oMsgFilePath As String = Path.Combine("\\windream\objects", CURRENT_NEWFILENAME)
|
|
|
|
Dim oIndexNames As Dictionary(Of String, Object)
|
|
|
|
Dim oMail As IMail = EMAIL.Load_Email(oMsgFilePath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dim oSQL As String = $"SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = '{CURR_DOKART_OBJECTTYPE}'"
|
|
|
|
Dim oSQL As String = $"SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = '{CURR_DOKART_OBJECTTYPE}'"
|
|
|
|
Dim oTable As DataTable = ClassDatabase.Return_Datatable(oSQL)
|
|
|
|
Dim oTable As DataTable = ClassDatabase.Return_Datatable(oSQL)
|
|
|
|
@@ -890,25 +888,42 @@ Public Class frmIndex
|
|
|
|
Return False
|
|
|
|
Return False
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dim oRow As DataRow = oTable.Rows.Item(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
' If file is an email files (eml,msg) parse it to extract email data and save for later
|
|
|
|
|
|
|
|
' If file is an attachment, rely on the previously extracted value
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If pIndexAttachment = False Then
|
|
|
|
|
|
|
|
Dim oMsgFilePath As String = Path.Combine("\\windream\objects", CURRENT_NEWFILENAME)
|
|
|
|
|
|
|
|
Dim oMail As IMail = EMAIL.Load_Email(oMsgFilePath)
|
|
|
|
|
|
|
|
|
|
|
|
Dim oMessageId As String = oMail.MessageID
|
|
|
|
Dim oMessageId As String = oMail.MessageID
|
|
|
|
Dim oMessageFrom As String = EMAIL.Get_MessageSender(oMail)
|
|
|
|
Dim oMessageFrom As String = EMAIL.Get_MessageSender(oMail)
|
|
|
|
Dim oMessageTo As String = EMAIL.Get_MessageReceiver(oMail)
|
|
|
|
Dim oMessageTo As String = EMAIL.Get_MessageReceiver(oMail)
|
|
|
|
Dim oSubject As String = oMail.Subject
|
|
|
|
Dim oSubject As String = oMail.Subject
|
|
|
|
Dim oDateIn As Date = oMail.Date
|
|
|
|
Dim oDateIn As Date = oMail.Date
|
|
|
|
|
|
|
|
|
|
|
|
Dim oRow As DataRow = oTable.Rows.Item(0)
|
|
|
|
CURRENT_MESSAGEID = oMessageFrom
|
|
|
|
Dim oIndexNames As New Dictionary(Of String, Object) From {
|
|
|
|
CURRENT_MESSAGEDATE = oDateIn
|
|
|
|
|
|
|
|
CURRENT_MESSAGESUBJECT = oSubject
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
oIndexNames = New Dictionary(Of String, Object) From {
|
|
|
|
{"IDX_EMAIL_ID", oMessageId},
|
|
|
|
{"IDX_EMAIL_ID", oMessageId},
|
|
|
|
{"IDX_EMAIL_FROM", oMessageFrom},
|
|
|
|
{"IDX_EMAIL_FROM", oMessageFrom},
|
|
|
|
{"IDX_EMAIL_TO", oMessageTo},
|
|
|
|
{"IDX_EMAIL_TO", oMessageTo},
|
|
|
|
{"IDX_EMAIL_SUBJECT", oSubject},
|
|
|
|
{"IDX_EMAIL_SUBJECT", oSubject},
|
|
|
|
{"IDX_EMAIL_DATE_IN", oDateIn}
|
|
|
|
{"IDX_EMAIL_DATE_IN", oDateIn}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Else
|
|
|
|
If pIndexAttachment = True Then
|
|
|
|
oIndexNames = New Dictionary(Of String, Object) From {
|
|
|
|
oIndexNames.Add("IDX_CHECK_ATTACHMENT", True)
|
|
|
|
{"IDX_EMAIL_ID", CURRENT_MESSAGEID},
|
|
|
|
|
|
|
|
{"IDX_EMAIL_SUBJECT", CURRENT_MESSAGESUBJECT},
|
|
|
|
|
|
|
|
{"IDX_EMAIL_DATE_IN", CURRENT_MESSAGEDATE},
|
|
|
|
|
|
|
|
{"IDX_CHECK_ATTACHMENT", True}
|
|
|
|
|
|
|
|
}
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For Each oIndex In oIndexNames
|
|
|
|
For Each oIndex In oIndexNames
|
|
|
|
Try
|
|
|
|
Try
|
|
|
|
If oIndex.Value Is Nothing Then
|
|
|
|
If oIndex.Value Is Nothing Then
|
|
|
|
@@ -923,9 +938,8 @@ Public Class frmIndex
|
|
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dim oIndexingSuccessful = WriteIndex2File(oRow.Item(oIndex.Key), oIndex.Value)
|
|
|
|
Dim oIndexingSuccessful = WriteIndex2File(oRow.Item(oIndex.Key), oIndex.Value)
|
|
|
|
'Die aktuelle Message-ID zwischenspeichern
|
|
|
|
|
|
|
|
CURRENT_MESSAGEID = oMessageId
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If oIndexingSuccessful = False Then
|
|
|
|
If oIndexingSuccessful = False Then
|
|
|
|
MsgBox($"Error while Indexing Email at Index [{oIndex.Key}]", MsgBoxStyle.Critical)
|
|
|
|
MsgBox($"Error while Indexing Email at Index [{oIndex.Key}]", MsgBoxStyle.Critical)
|
|
|
|
|