jj: Windream Version 0.0.0.2
This commit is contained in:
parent
46c65eb464
commit
bad26b316a
@ -1,9 +1,10 @@
|
|||||||
Imports NLog
|
Imports NLog
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Public Class ConnectionBuilder
|
Public Class ConnectionBuilder
|
||||||
Implements IConnectionBuilder
|
Implements IConnectionBuilder
|
||||||
|
|
||||||
Private ReadOnly LogFactory As LogFactory
|
Private ReadOnly LogConfig As LogConfig
|
||||||
Private SessionReconnect As Boolean = False
|
Private SessionReconnect As Boolean = False
|
||||||
Private DriveLetter As String = "W"
|
Private DriveLetter As String = "W"
|
||||||
Private Support64Bit As Boolean = False
|
Private Support64Bit As Boolean = False
|
||||||
@ -12,8 +13,8 @@ Public Class ConnectionBuilder
|
|||||||
Private Password As String = Nothing
|
Private Password As String = Nothing
|
||||||
Private Domain As String = Nothing
|
Private Domain As String = Nothing
|
||||||
|
|
||||||
Public Sub New(LogFactory As LogFactory)
|
Public Sub New(LogConfig As LogConfig)
|
||||||
Me.LogFactory = LogFactory
|
Me.LogConfig = LogConfig
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Function WithSessionReconnect() As IConnectionBuilder Implements IConnectionBuilder.WithSessionReconnect
|
Public Function WithSessionReconnect() As IConnectionBuilder Implements IConnectionBuilder.WithSessionReconnect
|
||||||
@ -44,7 +45,7 @@ Public Class ConnectionBuilder
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function Connect() As Windream2 Implements IConnectionBuilder.Connect
|
Public Function Connect() As Windream2 Implements IConnectionBuilder.Connect
|
||||||
Return New Windream2(LogFactory, SessionReconnect, DriveLetter, Support64Bit, ServerName, UserName, Password, Domain)
|
Return New Windream2(LogConfig, SessionReconnect, DriveLetter, Support64Bit, ServerName, UserName, Password, Domain)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -48,4 +48,12 @@
|
|||||||
' Misc
|
' Misc
|
||||||
Public Const OBJECT_TYPE_DEFAULT = "Standard"
|
Public Const OBJECT_TYPE_DEFAULT = "Standard"
|
||||||
|
|
||||||
|
' File Stream
|
||||||
|
Public Const STREAM_BINARY_OBJECT = "BinaryObject"
|
||||||
|
Public Const STREAM_OPEN_MODE_READ_WRITE = 2
|
||||||
|
|
||||||
|
' COM Events
|
||||||
|
Public Const COM_EVENT_SESSION_NEED_INDEX = 1
|
||||||
|
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -136,5 +136,11 @@
|
|||||||
</None>
|
</None>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Modules.Logging\Logging.vbproj">
|
||||||
|
<Project>{903b2d7d-3b80-4be9-8713-7447b704e1b0}</Project>
|
||||||
|
<Name>Logging</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -2,28 +2,25 @@
|
|||||||
Imports WINDREAMLib.WMCOMEvent
|
Imports WINDREAMLib.WMCOMEvent
|
||||||
Imports WINDREAMLib.WMEntity
|
Imports WINDREAMLib.WMEntity
|
||||||
Imports WINDREAMLib.WMObjectEditMode
|
Imports WINDREAMLib.WMObjectEditMode
|
||||||
|
|
||||||
Imports WINDREAMLib.WMSearchOperator
|
|
||||||
Imports WINDREAMLib.WMSearchRelation
|
|
||||||
Imports WMOBRWSLib
|
Imports WMOBRWSLib
|
||||||
Imports WMOSRCHLib
|
Imports WMOSRCHLib
|
||||||
Imports WMCNNCTDLLLib
|
Imports WMCNNCTDLLLib
|
||||||
Imports WMOTOOLLib
|
Imports WMOTOOLLib
|
||||||
Imports NLog
|
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' MODULE: Windream
|
''' MODULE: Windream
|
||||||
'''
|
'''
|
||||||
''' VERSION: 0.0.0.1
|
''' VERSION: 0.0.0.2
|
||||||
'''
|
'''
|
||||||
''' DATE: 27.08.2018
|
''' DATE: 08.10.2018
|
||||||
'''
|
'''
|
||||||
''' DESCRIPTION:
|
''' DESCRIPTION:
|
||||||
'''
|
'''
|
||||||
''' DEPENDENCIES: NLog, >= 4.5.8
|
''' DEPENDENCIES: NLog, >= 4.5.8
|
||||||
'''
|
'''
|
||||||
''' PARAMETERS: LogFactory, NLog.LogFactory
|
''' PARAMETERS: LogConfig, DigitalData.Modules.Logging.LogConfig
|
||||||
''' The LogFactory containing the current log config. Used to instanciate the class logger for this and any dependent class
|
''' The LogFactory containing the current log config. Used to instanciate the class logger for this and any dependent class
|
||||||
'''
|
'''
|
||||||
''' ClientDriveLetter, String
|
''' ClientDriveLetter, String
|
||||||
@ -60,10 +57,9 @@ Imports System.IO
|
|||||||
''' REMARKS: This class should not be instanciated directly. Instead, ConnectionBuilder should be used.
|
''' REMARKS: This class should not be instanciated directly. Instead, ConnectionBuilder should be used.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
Public Class Windream2
|
Public Class Windream2
|
||||||
Const WMObjectStreamOpenModeReadWrite = 2
|
|
||||||
#Region "Private Properties"
|
#Region "Private Properties"
|
||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
Private ReadOnly _loggerFactory As LogFactory
|
Private ReadOnly _logConfig As LogConfig
|
||||||
|
|
||||||
Private ReadOnly Property _sessionDomain As String
|
Private ReadOnly Property _sessionDomain As String
|
||||||
Private ReadOnly Property _sessionPassword As String
|
Private ReadOnly Property _sessionPassword As String
|
||||||
@ -97,7 +93,7 @@ Public Class Windream2
|
|||||||
''' <summary>
|
''' <summary>
|
||||||
''' Creates a new Windream object and connects to a server with the provided options and credentials
|
''' Creates a new Windream object and connects to a server with the provided options and credentials
|
||||||
''' </summary>
|
''' </summary>
|
||||||
''' <param name="LogFactory"></param>
|
''' <param name="LogConfig"></param>
|
||||||
''' <param name="SessionReconnect"></param>
|
''' <param name="SessionReconnect"></param>
|
||||||
''' <param name="ClientDriveLetter"></param>
|
''' <param name="ClientDriveLetter"></param>
|
||||||
''' <param name="ClientSupport64Bit"></param>
|
''' <param name="ClientSupport64Bit"></param>
|
||||||
@ -106,10 +102,10 @@ Public Class Windream2
|
|||||||
''' <param name="SessionPassword"></param>
|
''' <param name="SessionPassword"></param>
|
||||||
''' <param name="SessionDomain"></param>
|
''' <param name="SessionDomain"></param>
|
||||||
''' <exception cref="Exceptions.SessionException"></exception>
|
''' <exception cref="Exceptions.SessionException"></exception>
|
||||||
Public Sub New(LogFactory As LogFactory, SessionReconnect As Boolean, ClientDriveLetter As String, ClientSupport64Bit As Boolean, SessionServerName As String, SessionUserName As String, SessionPassword As String, SessionDomain As String)
|
Public Sub New(LogConfig As LogConfig, SessionReconnect As Boolean, ClientDriveLetter As String, ClientSupport64Bit As Boolean, SessionServerName As String, SessionUserName As String, SessionPassword As String, SessionDomain As String)
|
||||||
' Create logger and save LogFactory for dependent classes
|
' Create logger and save LogFactory for dependent classes
|
||||||
_logger = LogFactory.GetCurrentClassLogger()
|
_logger = LogConfig.GetLogger()
|
||||||
_loggerFactory = LogFactory
|
_logConfig = LogConfig
|
||||||
|
|
||||||
' Create a session
|
' Create a session
|
||||||
Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain)
|
Dim oSession As IWMSession2 = NewSession(SessionServerName, SessionUserName, SessionPassword, SessionDomain)
|
||||||
@ -268,107 +264,170 @@ Public Class Windream2
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function NewStream_File(ByVal FilenameSource As String, ByVal filenameTarget As String)
|
Public Function NewFileStream(ByVal FilenameSource As String, ByVal FilenameTarget As String) As Boolean
|
||||||
Try
|
'Try
|
||||||
Dim oExtension As String = Path.GetExtension(FilenameSource)
|
Dim oExtension As String = Path.GetExtension(FilenameSource)
|
||||||
_logger.Debug("Stream_File was started...")
|
_logger.Debug("Stream_File was started...")
|
||||||
If Not TestSessionLoggedIn() Then
|
If Not TestSessionLoggedIn() Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oTargetDrive As String = Path.GetDirectoryName(filenameTarget)
|
Dim oTargetDrive As String = Path.GetDirectoryName(FilenameTarget)
|
||||||
filenameTarget = GetNormalizedPath(filenameTarget)
|
FilenameTarget = GetNormalizedPath(FilenameTarget)
|
||||||
Const STREAM_BinaryObject = "BinaryObject"
|
|
||||||
|
|
||||||
_logger.Debug($"Import file from {FilenameSource } to {filenameTarget}")
|
_logger.Debug($"Streaming file from {FilenameSource} to {FilenameTarget}")
|
||||||
|
|
||||||
Dim WMObject
|
Dim oWMObject As IWMObject6 = Nothing
|
||||||
Dim aFileIO
|
Dim oFileIO As WMFileIO
|
||||||
Dim aWMStream
|
Dim oWMStream As WMStream
|
||||||
|
|
||||||
aFileIO = New WMOTOOLLib.WMFileIO
|
'_logger.Debug("Try to access file and lock it...")
|
||||||
_logger.Debug("Try to access file and lock it...")
|
'Err.Clear()
|
||||||
Err.Clear()
|
|
||||||
Const WMCOMEventWMSessionNeedIndex = 1
|
|
||||||
|
|
||||||
'Indexierungsdialog der Session unterdrücken
|
'Indexierungsdialog der Session unterdrücken
|
||||||
Session.SwitchEvents(WMCOMEventWMSessionNeedIndex, False)
|
Session.SwitchEvents(Constants.COM_EVENT_SESSION_NEED_INDEX, False)
|
||||||
'clsWindream.MY_WDSESSION.switchEvents(WMCOMEventWMSessionNeedIndex, False)
|
|
||||||
'==================================================================
|
'==================================================================
|
||||||
' create an object
|
' create an object
|
||||||
'==================================================================
|
'==================================================================
|
||||||
WMObject = Session.GetNewWMObjectFS(WMEntity.WMEntityDocument, filenameTarget, WMObjectEditModeObject)
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"WMObject could not be created - Error: ' {Err.Description}'")
|
|
||||||
End If
|
|
||||||
If WMObject IsNot Nothing Then
|
|
||||||
' lock object for file system access (to change the file itself)
|
|
||||||
LockObject(WMObject)
|
|
||||||
' set fileIO the local source file
|
|
||||||
aFileIO.bstrOriginalFileName = FilenameSource
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
'MsgBox(Err.Number.ToString)
|
|
||||||
_logger.Warn($"fileIO could not be set - Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
' open the windream object's file stream for writing
|
|
||||||
aWMStream = WMObject.OpenStream(STREAM_BinaryObject, WMObjectStreamOpenModeReadWrite)
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"Error whhile creating stream - Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
_logger.Debug("oWMStream created!")
|
|
||||||
' give fileIO helper object the windream stream
|
|
||||||
aFileIO.aWMStream = aWMStream
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"Error while adding aWMStream to aFileIO - Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
' let fileIO object import the original file into windream
|
|
||||||
aFileIO.ImportOriginal(True)
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"Error while FileIO.ImportOriginal(True) Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
|
|
||||||
Return False
|
Try
|
||||||
End If
|
_logger.Debug("Creating WMObject for file {0}", FilenameTarget)
|
||||||
_logger.Debug("Content of file was transferred!")
|
oWMObject = Session.GetNewWMObjectFS(WMEntityDocument, FilenameTarget, WMObjectEditModeObject)
|
||||||
' close the windream file stream
|
|
||||||
aWMStream.Close()
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"Error in aWMStream.Close() - Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
'MsgBox(Err.Description)
|
|
||||||
End If
|
|
||||||
' save new windream object
|
|
||||||
WMObject.save()
|
|
||||||
If Err.Number > 0 Then
|
|
||||||
_logger.Warn($"Error while WMObject.save() - Error: '{Err.Description}'")
|
|
||||||
If UnlockObject(WMObject) Then RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
'MsgBox(Err.Description)
|
|
||||||
End If
|
|
||||||
_logger.Debug("File was saved correctly.")
|
|
||||||
' unlock the windream object
|
|
||||||
If WMObject.unlock() = False Then
|
|
||||||
RemoveFile(filenameTarget)
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
_logger.Info($"File '{filenameTarget}' was imported.")
|
|
||||||
Return True
|
|
||||||
Else
|
|
||||||
_logger.Warn($"WMObject could not be created!")
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Warn("Unexpected Error in NewStream_File:")
|
_logger.Error(ex, "WMObject could not be created")
|
||||||
_logger.Error(ex)
|
|
||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
If oWMObject Is Nothing Then
|
||||||
|
_logger.Warn("Document {0} could not be found", FilenameTarget)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
_logger.Debug("Locking object for {0}", FilenameTarget)
|
||||||
|
If LockObject(oWMObject) = False Then
|
||||||
|
_logger.Warn("Document {0} could not be locked", FilenameTarget)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Try
|
||||||
|
_logger.Debug("Opening stream for {0}", FilenameTarget)
|
||||||
|
oWMStream = oWMObject.OpenStream(Constants.STREAM_BINARY_OBJECT, Constants.STREAM_OPEN_MODE_READ_WRITE)
|
||||||
|
Catch ex As Exception
|
||||||
|
_logger.Error(ex)
|
||||||
|
If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Try
|
||||||
|
_logger.Debug("Creating FileIO", FilenameTarget)
|
||||||
|
|
||||||
|
oFileIO = New WMFileIO With {
|
||||||
|
.bstrOriginalFileName = FilenameSource,
|
||||||
|
.aWMStream = oWMStream
|
||||||
|
}
|
||||||
|
Catch ex As Exception
|
||||||
|
If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
_logger.Error(ex, "Error while creating FileIO object")
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Try
|
||||||
|
_logger.Debug("Streaming file...")
|
||||||
|
oFileIO.ImportOriginal(True)
|
||||||
|
_logger.Debug("Content of file was transferred!")
|
||||||
|
Catch ex As Exception
|
||||||
|
If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
_logger.Error(ex, "Error while streaming file")
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Try
|
||||||
|
_logger.Debug("Closing Stream")
|
||||||
|
oWMStream.Close()
|
||||||
|
_logger.Debug("Saving new object")
|
||||||
|
oWMObject.Save()
|
||||||
|
_logger.Debug("Unlocking new object")
|
||||||
|
oWMObject.unlock()
|
||||||
|
Catch ex As Exception
|
||||||
|
RemoveFile(FilenameTarget)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
_logger.Info($"File '{FilenameTarget}' was imported.")
|
||||||
|
Return True
|
||||||
|
|
||||||
|
'If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"WMObject could not be created - Error: ' {Err.Description}'")
|
||||||
|
'End If
|
||||||
|
' If oWMObject IsNot Nothing Then
|
||||||
|
' ' lock object for file system access (to change the file itself)
|
||||||
|
' LockObject(oWMObject)
|
||||||
|
' ' set fileIO the local source file
|
||||||
|
' oFileIO.bstrOriginalFileName = FilenameSource
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' 'MsgBox(Err.Number.ToString)
|
||||||
|
' _logger.Warn($"fileIO could not be set - Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' ' open the windream object's file stream for writing
|
||||||
|
' oWMStream = oWMObject.OpenStream(Constants.STREAM_BINARY_OBJECT, Constants.STREAM_OPEN_MODE_READ_WRITE)
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"Error whhile creating stream - Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' _logger.Debug("oWMStream created!")
|
||||||
|
' ' give fileIO helper object the windream stream
|
||||||
|
' oFileIO.aWMStream = oWMStream
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"Error while adding aWMStream to aFileIO - Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' ' let fileIO object import the original file into windream
|
||||||
|
' oFileIO.ImportOriginal(True)
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"Error while FileIO.ImportOriginal(True) Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' _logger.Debug("Content of file was transferred!")
|
||||||
|
' ' close the windream file stream
|
||||||
|
' oWMStream.Close()
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"Error in aWMStream.Close() - Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' 'MsgBox(Err.Description)
|
||||||
|
' End If
|
||||||
|
' ' save new windream object
|
||||||
|
' oWMObject.Save()
|
||||||
|
' If Err.Number > 0 Then
|
||||||
|
' _logger.Warn($"Error while WMObject.save() - Error: '{Err.Description}'")
|
||||||
|
' If UnlockObject(oWMObject) Then RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' 'MsgBox(Err.Description)
|
||||||
|
' End If
|
||||||
|
' _logger.Debug("File was saved correctly.")
|
||||||
|
' ' unlock the windream object
|
||||||
|
' If oWMObject.unlock() = False Then
|
||||||
|
' RemoveFile(FilenameTarget)
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
' _logger.Info($"File '{FilenameTarget}' was imported.")
|
||||||
|
' Return True
|
||||||
|
' Else
|
||||||
|
' _logger.Warn($"WMObject could not be created!")
|
||||||
|
' Return False
|
||||||
|
' End If
|
||||||
|
'Catch ex As Exception
|
||||||
|
' _logger.Warn("Unexpected Error in NewStream_File:")
|
||||||
|
' _logger.Error(ex)
|
||||||
|
' Return False
|
||||||
|
'End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function LockObject(WMObject As WMObject, Optional EditMode As WMObjectEditMode = WMObjectEditModeNoEdit) As Boolean
|
Public Function LockObject(WMObject As WMObject, Optional EditMode As WMObjectEditMode = WMObjectEditModeNoEdit) As Boolean
|
||||||
@ -391,15 +450,17 @@ Public Class Windream2
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Function GetSearchDocuments(SearchFilePath As String, DocIdIndexName As String) As Dictionary(Of Integer, String)
|
Public Function GetSearchDocuments(SearchFilePath As String, DocIdIndexName As String) As DataTable
|
||||||
Dim oResult As New Dictionary(Of Integer, String)
|
Dim oDatatable As New DataTable
|
||||||
|
oDatatable.Columns.Add("PATH", GetType(String))
|
||||||
|
oDatatable.Columns.Add("DOCID", GetType(Integer))
|
||||||
|
|
||||||
If TestSessionLoggedIn() = False Then
|
If TestSessionLoggedIn() = False Then
|
||||||
Return oResult
|
Return oDatatable
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If TestFileExists(SearchFilePath) = False Then
|
If TestFileExists(SearchFilePath) = False Then
|
||||||
Return oResult
|
Return oDatatable
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
@ -450,27 +511,27 @@ Public Class Windream2
|
|||||||
oSearch = oObjecttypeSearch.GetSearch()
|
oSearch = oObjecttypeSearch.GetSearch()
|
||||||
Case Else
|
Case Else
|
||||||
_logger.Warn("{0} is not a valid search type", oSearchType)
|
_logger.Warn("{0} is not a valid search type", oSearchType)
|
||||||
Return oResult
|
Return oDatatable
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
Dim oSearchResults As WMObjects = oSearch.Execute()
|
Dim oSearchResults As WMObjects = oSearch.Execute()
|
||||||
|
|
||||||
If oSearchResults.Count = 0 Then
|
If oSearchResults.Count = 0 Then
|
||||||
Return oResult
|
Return oDatatable
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each oSearchResult As WMObject In oSearchResults
|
For Each oSearchResult As WMObject In oSearchResults
|
||||||
Dim path As String = oSearchResult.aPath
|
Dim path As String = oSearchResult.aPath
|
||||||
Dim docId As Integer = oSearchResult.GetVariableValue(DocIdIndexName)
|
Dim docId As Integer = oSearchResult.GetVariableValue(DocIdIndexName)
|
||||||
|
|
||||||
oResult.Add(docId, path)
|
oDatatable.Rows.Add(path, docId)
|
||||||
Next
|
Next
|
||||||
|
oDatatable.AcceptChanges()
|
||||||
|
|
||||||
Return oResult
|
Return oDatatable
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex)
|
_logger.Error(ex)
|
||||||
Return oResult
|
Return oDatatable
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
@ -507,8 +568,7 @@ Public Class Windream2
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oTempSession As IWMSession2 = DirectCast(Session, IWMSession2)
|
oChoicelist = Session.GetWMObjectByName(WMEntityChoiceList, ChoiceListName)
|
||||||
oChoicelist = oTempSession.GetWMObjectByName(WMEntityChoiceList, ChoiceListName)
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex, "Could not get choice list")
|
_logger.Error(ex, "Could not get choice list")
|
||||||
Return oItems
|
Return oItems
|
||||||
@ -586,8 +646,7 @@ Public Class Windream2
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oTempSession As IWMSession2 = DirectCast(Session, IWMSession2)
|
Dim oAttribute = Session.GetWMObjectByName(WMEntityAttribute, IndexName)
|
||||||
Dim oAttribute = oTempSession.GetWMObjectByName(WMEntityAttribute, IndexName)
|
|
||||||
Dim oType = oAttribute.GetVariableValue("dwAttrType")
|
Dim oType = oAttribute.GetVariableValue("dwAttrType")
|
||||||
Return oType
|
Return oType
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user