DLL windream resultHandler Version 2.5
Service.exe 2.1
This commit is contained in:
@@ -133,31 +133,39 @@ Public Class clsDateiverarbeitung
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
' Neu geschriebene version 25.03.19
|
||||
Public Function Export_WMFile2HDD(WMObject As WMObject, ExportPath As String) As Boolean
|
||||
Public Function Export_WMFile2HDD(pWMObject As WMObject, pExportPath As String, Optional pFilename As String = "") As Boolean
|
||||
Try
|
||||
Dim oWMObject As IWMObject6 = DirectCast(WMObject, IWMObject6)
|
||||
Dim oWMObject As IWMObject6 = DirectCast(pWMObject, IWMObject6)
|
||||
|
||||
Dim oFilenameFull As String = oWMObject.aName
|
||||
Dim oFilenameWM As String = oWMObject.aName
|
||||
Dim oFilenameExport As String
|
||||
Dim oSplitIndex = oFilenameFull.LastIndexOf(".")
|
||||
Dim oSplitIndex
|
||||
If pFilename = String.Empty Then
|
||||
oSplitIndex = oFilenameWM.LastIndexOf(".")
|
||||
Else
|
||||
oSplitIndex = pFilename.LastIndexOf(".")
|
||||
End If
|
||||
|
||||
Dim oVersion = 1
|
||||
Dim oFilename As String
|
||||
If pFilename <> String.Empty Then
|
||||
oFilename = pFilename.Substring(0, oSplitIndex)
|
||||
Else
|
||||
oFilename = oFilenameWM.Substring(0, oSplitIndex)
|
||||
End If
|
||||
|
||||
Dim oFilename = oFilenameFull.Substring(0, oSplitIndex)
|
||||
Dim oExtension = oFilenameFull.Substring(oSplitIndex)
|
||||
|
||||
Logger.Debug("Preparing export of file {0}..", oFilenameFull)
|
||||
Logger.Debug("Preparing export of WMFile {0}..", oFilenameWM)
|
||||
Logger.Debug("Filename: {0}", oFilename)
|
||||
Logger.Debug("Extension: {0}", oExtension)
|
||||
Logger.Debug("Extension: {0}", clsCURRENT.FILE_Extension)
|
||||
|
||||
' build the file path in case the exported file doesn't already exist
|
||||
oFilenameExport = BuildExportPath(ExportPath, oFilename, oExtension)
|
||||
oFilenameExport = BuildExportPath(pExportPath, oFilename, clsCURRENT.FILE_Extension)
|
||||
|
||||
' Add version until we find the version that does NOT exist
|
||||
Do While File.Exists(oFilenameExport)
|
||||
oVersion += 1
|
||||
oFilenameExport = BuildExportPath(ExportPath, oFilename, oExtension, oVersion)
|
||||
oFilenameExport = BuildExportPath(pExportPath, oFilename, clsCURRENT.FILE_Extension, oVersion)
|
||||
Loop
|
||||
|
||||
Logger.Debug("File will be exported to {0}", oFilenameExport)
|
||||
@@ -647,7 +655,7 @@ Public Class clsDateiverarbeitung
|
||||
End Function
|
||||
Public Function REGEX_REPLACE(WMFile As WMObject, _STRING As String)
|
||||
Try
|
||||
Logger.Debug("REGEX_String before replacing: '" & _STRING & "'")
|
||||
Logger.Debug("REGEX_REPLACE before replacing: '" & _STRING & "'")
|
||||
' Regulären Ausdruck zum Auslesen der windream-Indexe definieren
|
||||
Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
|
||||
' einen Regulären Ausdruck laden
|
||||
@@ -668,7 +676,6 @@ Public Class clsDateiverarbeitung
|
||||
ElseIf reg_element_Ohne_SZ = "ENV_USERNAME" Then
|
||||
_STRING = _STRING.Replace(reg_element.Value, Environment.UserName)
|
||||
Else
|
||||
|
||||
Dim wdIndexwert
|
||||
' den Wert des Indexes für das aktuelle Dokument auslesen
|
||||
wdIndexwert = WMFile.GetVariableValue(reg_element_Ohne_SZ)
|
||||
@@ -706,9 +713,8 @@ Public Class clsDateiverarbeitung
|
||||
_STRING = _STRING.Replace(reg_element.Value, "0")
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
Logger.Debug("REGEX_REPLACE AFTER replacing: '" & _STRING & "'")
|
||||
Return _STRING
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
|
||||
Reference in New Issue
Block a user