MS Service und WMDLL
This commit is contained in:
@@ -595,11 +595,14 @@ Public Class Windream
|
||||
''' <returns>Returns datatable</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function GetSearchDocuments(ByVal wdfLocation As String, NameIndexDocID As String) As DataTable
|
||||
Dim dt As New DataTable
|
||||
dt.Columns.Add("DOC_ID", GetType(Integer))
|
||||
dt.Columns.Add("PATH", GetType(String))
|
||||
If CurrentSession.aLoggedin Then
|
||||
dt
|
||||
Dim dtresult As New DataTable
|
||||
dtresult.Columns.Add("DOC_ID", GetType(Integer))
|
||||
dtresult.Columns.Add("PATH", GetType(String))
|
||||
If Not CurrentSession.aLoggedin Then
|
||||
Return dtresult
|
||||
End If
|
||||
If TestWMFileExists(wdfLocation) = False Then
|
||||
Return dtresult
|
||||
End If
|
||||
Try
|
||||
Dim ProfileName = wdfLocation.Substring(wdfLocation.LastIndexOf("\") + 1)
|
||||
@@ -654,7 +657,7 @@ Public Class Windream
|
||||
|
||||
Case Else
|
||||
Logger.Warn("No valid WM-SearchType")
|
||||
Return dt
|
||||
Return dtresult
|
||||
End Select
|
||||
Dim WMObjects As Object
|
||||
WMObjects = oSearch.Execute
|
||||
@@ -665,15 +668,15 @@ Public Class Windream
|
||||
Dim path As String = dok.aPath
|
||||
Dim DOC_ID = dok.GetVariableValue(NameIndexDocID)
|
||||
Logger.Info("Adding DocInfo for DocID: " & DOC_ID.ToString)
|
||||
dt.Rows.Add(DOC_ID, path)
|
||||
dtresult.Rows.Add(DOC_ID, path)
|
||||
|
||||
Next
|
||||
dt.AcceptChanges()
|
||||
dtresult.AcceptChanges()
|
||||
End If
|
||||
Return dt
|
||||
Return dtresult
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return dt
|
||||
Return dtresult
|
||||
End Try
|
||||
End Function
|
||||
''' <summary>
|
||||
@@ -825,7 +828,7 @@ Public Class Windream
|
||||
Public Function GetWMObjectForFile(ByVal WMPath As String) As WMObject
|
||||
Try
|
||||
If CurrentSession.aLoggedin Then
|
||||
Return False
|
||||
Return Nothing
|
||||
End If
|
||||
WMPath = NormalizePath(WMPath)
|
||||
Dim oWMObject As WINDREAMLib.WMObject
|
||||
@@ -872,19 +875,17 @@ Public Class Windream
|
||||
''' <param name="WMPath">full path to the file</param>
|
||||
''' <returns>Returns true when file was deleted, false if not</returns>
|
||||
''' <remarks></remarks>
|
||||
Public Function TestFileExists(ByVal WMPath As String)
|
||||
Public Function TestWMFileExists(ByVal WMPath As String)
|
||||
Try
|
||||
If CurrentSession.aLoggedin Then
|
||||
Return False
|
||||
End If
|
||||
WMPath = NormalizePath(WMPath)
|
||||
Try
|
||||
Dim WMObject As WINDREAMLib.WMObject = CurrentSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, WMPath)
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not create WMObject for file '" & WMPath & "' - so it is not existing")
|
||||
If IsNothing(GetWMObjectForFile(WMPath)) Then
|
||||
Return False
|
||||
End Try
|
||||
Return True
|
||||
Else
|
||||
Return True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return False
|
||||
|
||||
Reference in New Issue
Block a user