windream 1.9.6.2

This commit is contained in:
Developer01 2025-04-28 12:57:12 +02:00
parent 66328bb243
commit ceb618dc57
2 changed files with 20 additions and 22 deletions

View File

@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.9.6.1")>
<Assembly: AssemblyFileVersion("1.9.6.1")>
<Assembly: AssemblyVersion("1.9.6.2")>
<Assembly: AssemblyFileVersion("1.9.6.2")>

View File

@ -1,20 +1,17 @@
Imports System.IO
Imports System.IO.Path
Imports System.Text.RegularExpressions
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Imports WINDREAMLib
Imports WINDREAMLib.WMCOMEvent
Imports WINDREAMLib.WMEntity
Imports WINDREAMLib.WMObjectEditMode
Imports WMCNNCTDLLLib
Imports WMOBRWSLib
Imports WMOSRCHLib
Imports WMCNNCTDLLLib
Imports WMOTOOLLib
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Base
''' <module>Windream</module>
''' <version>0.0.0.2</version>
''' <date>23.10.2018</date>
@ -1268,52 +1265,53 @@ Public Class Windream
End Try
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, pIndexName As String, pAttributeValues As List(Of String), pObjectType As String) As Boolean
If TestSessionLoggedIn() = False Then
Return False
End If
If TestFileExists(Path) = False Then
_logger.Warn("File '{0}' does not exist", Path)
If TestFileExists(pPath) = False Then
_logger.Warn("File '{0}' does not exist", pPath)
Return False
End If
Dim oWMObject As IWMObject6
Try
oWMObject = GetFileByPath(Path)
'Create the windream-Object via path
oWMObject = GetFileByPath(pPath)
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)
Return False
End Try
'Lock WMObject for changes
If LockObject(oWMObject, WMObjectEditModeIndexEdit) = False Then
_logger.Warn("File {0} could not be locked")
Return False
End If
If oWMObject.aObjectType.aName = Constants.OBJECT_TYPE_DEFAULT Then
oWMObject.aObjectType = GetObjectByName(ObjectType, WMEntityObjectType)
oWMObject.aObjectType = GetObjectByName(pObjectType, WMEntityObjectType)
End If
Try
Dim oType As Integer = GetIndexType(IndexName)
Dim oType As Integer = GetIndexType(pIndexName)
Dim oConvertedValues As New List(Of String)
Dim oArray As Object
_logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - Values.Count: {2} ... ", IndexName, oType, Values.Count)
ReDim oArray(Values.Count - 1)
_logger.Debug("SetFileIndexLoS '{0}' - Indextype: {1} - Values.Count: {2} ... ", pIndexName, oType, pAttributeValues.Count)
ReDim oArray(pAttributeValues.Count - 1)
For oIndex = 0 To Values.Count - 1
Dim oValue As Object = Helpers.ConvertAttrValue(oType, Values.Item(oIndex))
For oIndex = 0 To pAttributeValues.Count - 1
Dim oValue As Object = Helpers.ConvertAttrValue(oType, pAttributeValues.Item(oIndex))
_logger.Debug("Converted Value: {0}", oValue.ToString)
oArray(oIndex) = oValue
Next
oWMObject.SetVariableValue(IndexName, oArray)
oWMObject.SetVariableValue(pIndexName, oArray)
oWMObject.Save()
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
Return True