This commit is contained in:
Developer01 2025-04-28 12:53:37 +02:00
parent c402467b38
commit ecfe669938

View File

@ -1268,32 +1268,33 @@ Public Class Windream
End Try End Try
End Function End Function
Public Function SetFileIndexLoS(Path As String, IndexName As String, Values As List(Of String), ObjectType As String) As Boolean Public Function SetFileIndexLoS(pPath As String, IndexName As String, pValues As List(Of String), pObjectType As String) As Boolean
If TestSessionLoggedIn() = False Then If TestSessionLoggedIn() = False Then
Return False Return False
End If End If
If TestFileExists(Path) = False Then If TestFileExists(pPath) = False Then
_logger.Warn("File '{0}' does not exist", Path) _logger.Warn("File '{0}' does not exist", pPath)
Return False Return False
End If End If
Dim oWMObject As IWMObject6 Dim oWMObject As IWMObject6
Try Try
oWMObject = GetFileByPath(Path) 'Das windream-Objekt erzeugen
oWMObject = GetFileByPath(pPath)
Catch ex As Exception Catch ex As Exception
_logger.Warn("Could not create a WMObject for path '{0}'!!", Path) _logger.Warn("Could not create a WMObject for path '{0}'!!", pPath)
_logger.Warn(ex.Message) _logger.Warn(ex.Message)
Return False Return False
End Try End Try
'Das windream-Objekt zum editieren sperren/locken
If LockObject(oWMObject, WMObjectEditModeIndexEdit) = False Then If LockObject(oWMObject, WMObjectEditModeIndexEdit) = False Then
_logger.Warn("File {0} could not be locked") _logger.Warn("File {0} could not be locked")
Return False Return False
End If End If
If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then
oWMObject.aObjectType = GetObjectByName(ObjectType, WMEntityObjectType) oWMObject.aObjectType = GetObjectByName(pObjectType, WMEntityObjectType)
End If End If
Try Try
@ -1301,10 +1302,10 @@ Public Class Windream
Dim oConvertedValues As New List(Of String) Dim oConvertedValues As New List(Of String)
Dim oArray As Object Dim oArray As Object
_logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - ... ", IndexName, oType) _logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - ... ", IndexName, oType)
ReDim oArray(Values.Count - 1) ReDim oArray(pValues.Count - 1)
For oIndex = 0 To Values.Count - 1 For oIndex = 0 To pValues.Count - 1
Dim oValue As Object = Helpers.ConvertAttrValue(oType, Values.Item(oIndex)) Dim oValue As Object = Helpers.ConvertAttrValue(oType, pValues.Item(oIndex))
oArray(oIndex) = oValue oArray(oIndex) = oValue
Next Next
@ -1312,7 +1313,7 @@ Public Class Windream
oWMObject.Save() oWMObject.Save()
If UnlockObject(oWMObject) = False Then If UnlockObject(oWMObject) = False Then
_logger.Warn("File {0} could not be unlocked", Path) _logger.Warn("File {0} could not be unlocked", pPath)
End If End If
Return True Return True