This commit is contained in:
Digital Data - Marlon Schreiber
2019-03-22 15:48:41 +01:00
parent fb92a0fd1c
commit 676e9d40b8
17 changed files with 547 additions and 184 deletions

View File

@@ -43,7 +43,7 @@ Public Class clsWindream_allgemein
' wenn ein Fehler bei der Initialisierung auftrat
If Not Init() Then
' Nachricht ausgeben
Logger.Warn("Es trat ein Fehler bei der Initialisierung der Klasse windream auf. Bitte prüfen Sie ob der windream-Server aktiv ist und alle Dienste gestartet sind")
Logger.Warn("Error while initializing WM-Class!!")
' das Programm "abschießen"
Process.GetCurrentProcess.Kill()
End If
@@ -464,7 +464,7 @@ Public Class clsWindream_allgemein
Return oSearch.execute
Catch ex As Exception
Logger.Error(ex)
Logger.Warn($"WM-SEARCH ({wdfLocation})")
Logger.Warn($"WM-SEARCH in Exception ({wdfLocation})")
Return Nothing
End Try
@@ -552,10 +552,17 @@ Public Class clsWindream_allgemein
If WMObjects.Count > 0 Then
For Each dok As WMObject In WMObjects
Dim oPath As String = dok.aPath
Dim oDOC_ID = dok.GetVariableValue(NameIndexDocID)
Dim oCreated = dok.GetVariableValue(NameIndexCreated)
Logger.Debug($"Adding DocInfo {oDOC_ID.ToString}|{oPath}|{oCreated}")
Logger.Debug($"Adding DocInfo {oDOC_ID.ToString}|{dok.aPath}|{oCreated}")
Dim oPath As String
If dok.aPath.StartsWith("\") Then
oPath = dok.aPath.Substring(1, dok.aPath.Length - 1)
Else
oPath = dok.aPath
End If
dtresult.Rows.Add(oDOC_ID, oPath, oCreated)
Next
dtresult.AcceptChanges()
@@ -563,11 +570,33 @@ Public Class clsWindream_allgemein
Return dtresult
Catch ex As Exception
Logger.Error(ex)
Logger.Warn($"WM-SEARCH ({wdfLocation})")
Logger.Warn($"WM-SEARCH from GetSearchDocumentsDT ({wdfLocation})")
Return dtresult
End Try
End Function
Public Function TestFileExists(Path As String) As Boolean
Return TestObjectExists(GetNormalizedPath(Path), WMEntityDocument)
End Function
Private Function TestObjectExists(ObjectName As String, ObjectType As WMEntity) As Boolean
Try
Dim oObjectId = 0
Dim oObjectDbId = 0
Return CURRENToWMSession.WMObjectExists(ObjectType, ObjectName, oObjectId, oObjectDbId)
Catch ex As Exception
Logger.Error(ex, "Error while checking existence of WMObject {0} of type {1}", ObjectName, ObjectType.ToString)
Return False
End Try
End Function
Private Function GetNormalizedPath(Path As String) As String
Dim oNormalizedPath = Path
If Not Path.StartsWith("\") And Path.ToUpper().StartsWith(CURRENT_WMDriveLetter.ToUpper) Then
oNormalizedPath = Path.Substring(2)
End If
Return oNormalizedPath
End Function
#End Region
End Class