Anlage des Repos
This commit is contained in:
77
test/GetSearchDocuments.txt
Normal file
77
test/GetSearchDocuments.txt
Normal file
@@ -0,0 +1,77 @@
|
||||
Public Function GetSearchDocuments(ByVal wdfLocation As String)
|
||||
|
||||
|
||||
wdfLocation = wdfLocation.Replace("W:", "\\windream\objects")
|
||||
If System.IO.File.Exists(wdfLocation) Then
|
||||
|
||||
Try
|
||||
Dim ProfileName = wdfLocation.Substring(wdfLocation.LastIndexOf("\") + 1)
|
||||
Dim ProfilePath = wdfLocation.Substring(0, wdfLocation.Length - ProfileName.Length)
|
||||
|
||||
|
||||
|
||||
Me.oController.CheckSearchProfile(wdfLocation.ToLower)
|
||||
Dim suchTyp = Me.oController.SearchProfileTargetProgID
|
||||
Dim ExSettings As Object
|
||||
Dim oSearch As Object
|
||||
ExSettings = Me.oController.SearchProfileExSettings
|
||||
If ExSettings = 0 Then ExSettings = 7
|
||||
Dim srchQuick As WMOSRCHLib.WMQuickSearch = CreateObject("WMOSrch.WMQuickSearch")
|
||||
Dim srchIndex As WMOSRCHLib.WMIndexSearch = CreateObject("WMOSrch.WMIndexSearch")
|
||||
Dim srchObjectType As WMOSRCHLib.WMObjectTypeSearch = CreateObject("WMOSrch.WMObjectTypeSearch")
|
||||
|
||||
'' Der öffentliche Member CheckSearchProfile für den Typ IWMQuickSearch7 wurde nicht gefunden. [Microsoft.VisualBasic] => GetSearchDocuments()
|
||||
Select Case suchTyp.ToString.ToUpper
|
||||
Case "WMOSRCH.WMQUICKSEARCH"
|
||||
'srchQuick.WMSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
|
||||
'Me.oConnect.LoginSession(oWMSession) 'srchQuick.WMSession)
|
||||
|
||||
srchQuick.ClearSearch()
|
||||
srchQuick.SearchProfilePath = ProfilePath
|
||||
srchQuick.LoadSearchProfile(ProfileName)
|
||||
|
||||
oSearch = srchQuick.GetSearch()
|
||||
|
||||
Case "WMOSRCH.WMINDEXSEARCH"
|
||||
srchIndex.WMSession = oWMSession 'CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
|
||||
'Me.oConnect.LoginSession(srchIndex.WMSession)
|
||||
|
||||
srchIndex.ClearSearch()
|
||||
srchIndex.SearchProfilePath = ProfilePath
|
||||
srchIndex.LoadSearchProfile(ProfileName)
|
||||
|
||||
oSearch = srchIndex.GetSearch()
|
||||
|
||||
Case "WMOSRCH.WMOBJECTTYPESEARCH"
|
||||
srchObjectType.WMSession = oWMSession 'CreateObject("Windream.WMSession", Me.GetCurrentServer)
|
||||
|
||||
'Me.oConnect.LoginSession(oWMSession) 'srchObjectType.WMSession)
|
||||
|
||||
srchObjectType.ClearSearch()
|
||||
srchObjectType.SearchProfilePath = ProfilePath
|
||||
srchObjectType.LoadSearchProfile(ProfileName)
|
||||
|
||||
oSearch = srchObjectType.GetSearch()
|
||||
|
||||
Case Else
|
||||
_Logger.Debug("KEIN GÜLTIGER WINDREAM-SUCHTYP")
|
||||
Return Nothing
|
||||
End Select
|
||||
Dim WMObjects As Object
|
||||
_Logger.Debug("Start der Suche: " & Now)
|
||||
' System.Threading.Thread.Sleep(200000)
|
||||
WMObjects = oSearch.Execute
|
||||
Return oSearch.execute
|
||||
Catch ex As Exception
|
||||
' bei einem Fehler einen Eintrag in der Logdatei machen
|
||||
_Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
End If
|
||||
|
||||
Return Nothing
|
||||
|
||||
End Function
|
||||
Reference in New Issue
Block a user