4 Commits

Author SHA1 Message Date
Developer01
e49713246b Erweiterung von frmSQLEditor-Initialisierung
Die Initialisierung des Formulars `frmSQLEditor` wurde in den Klassen `frmColumn_Detail` und `frmFormDesigner` erweitert. Neue Eigenschaften wie `PlaceholdersManualPrefix`, `PlaceholdersManualTitle` und `PlaceholdersManual` wurden hinzugefügt.

Eine Bedingung für `IDB_ACTIVE` wurde eingeführt, um die Eigenschaften `ATTRIBUTE_STORE` und `PlaceholdersWindream` dynamisch zu setzen. Die Eigenschaft `SQLConnection` wurde in beiden Klassen auf `1` geändert.
2026-06-05 10:53:31 +02:00
Developer01
501adeda52 Refactor Temp-Folder Cleanup und Update DocumentViewer
Die Version der Komponente `DocumentViewer` wurde in `frmValidator.resx` von 2.7.0.0 auf 2.7.2.0 aktualisiert.

Die Methode `CleanupTempFolder()` wurde aus der Klasse `frmValidator` entfernt. Die Logik zur Bereinigung des Temp-Ordners wurde an die Methode `_documentPathHandler.CleanupTempFolder()` delegiert. Dies vereinfacht die Klasse `frmValidator` und verbessert die Trennung der Verantwortlichkeiten.
2026-05-26 16:57:49 +02:00
Developer01
bd72e9cecc Version 2.9.2.0: Verbesserte Dokumentenverarbeitung
Die Assembly-Version wurde auf 2.9.2.0 aktualisiert.
Wesentliche Änderungen umfassen:

- Aggregation und Caching von Dokumentensuchergebnissen.
- Copy2TempPath und Mapping nun auch bei Exportfunktion
- Verbesserte Fehlerbehandlung und Logging bei Exporten.
- Konsistente Verarbeitung von Dateipfaden mit `.ToString()`.
- Codebereinigung und Entfernung redundanter Zeilen.
- Erweiterte Debug-Logs zur besseren Nachvollziehbarkeit.
2026-05-19 10:51:49 +02:00
Developer01
46a9742d5d Anpassung der Logs beim Export von Belegen nach Y 2026-05-19 09:14:29 +02:00
5 changed files with 90 additions and 73 deletions

View File

@@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.9.1.0")> <Assembly: AssemblyVersion("2.9.3.0")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: NeutralResourcesLanguage("")> <Assembly: NeutralResourcesLanguage("")>

View File

@@ -136,9 +136,18 @@ Public Class frmColumn_Detail
CURRENT_DESIGN_TYPE = "SQL_SOURCE_TABLE_COLUMN" CURRENT_DESIGN_TYPE = "SQL_SOURCE_TABLE_COLUMN"
CURRENT_INDEX_ID = GUIDTextBox.Text CURRENT_INDEX_ID = GUIDTextBox.Text
Dim oForm2 As New frmSQLEditor(LOGCONFIG, DatabaseECM) With { Dim oForm2 As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {
.SQLCommand = SQL_COMMANDTextBox.Text, .SQLCommand = SQL_COMMANDTextBox.Text,
.SQLConnection = 0 .SQLConnection = 1,
} .PlaceholdersManualPrefix = "CTRL",
.PlaceholdersManualTitle = "Controls",
.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.ToDictionary(Function(name) name, Function(name) name)
}
If IDB_ACTIVE = False Then
oForm2.ATTRIBUTE_STORE = "WM"
oForm2.PlaceholdersWindream = MVSource_AllIndicies
Else
oForm2.ATTRIBUTE_STORE = "IDB"
End If
oForm2.ShowDialog() oForm2.ShowDialog()
If oForm2.DialogResult = DialogResult.OK Then If oForm2.DialogResult = DialogResult.OK Then

View File

@@ -1021,12 +1021,19 @@ Public Class frmFormDesigner
Dim oSQL = $"SELECT SQL_BTN_FINISH FROM TBPM_PROFILE WHERE GUID = {ProfileId}" Dim oSQL = $"SELECT SQL_BTN_FINISH FROM TBPM_PROFILE WHERE GUID = {ProfileId}"
Dim oldSQL = DatabaseFallback.GetScalarValueECM(oSQL) Dim oldSQL = DatabaseFallback.GetScalarValueECM(oSQL)
Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With { Dim oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM) With {
.SQLCommand = oldSQL, .SQLCommand = oldSQL,
.SQLConnection = 1, .SQLConnection = 1,
.PlaceholdersManualPrefix = "CTRL", .PlaceholdersManualPrefix = "CTRL",
.PlaceholdersManualTitle = "Controls", .PlaceholdersManualTitle = "Controls",
.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.ToDictionary(Function(name) name, Function(name) name) .PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.ToDictionary(Function(name) name, Function(name) name)
} }
If IDB_ACTIVE = False Then
oForm.ATTRIBUTE_STORE = "WM"
oForm.PlaceholdersWindream = MVSource_AllIndicies
Else
oForm.ATTRIBUTE_STORE = "IDB"
End If
oForm.ShowDialog() oForm.ShowDialog()
If oForm.DialogResult = DialogResult.OK Then If oForm.DialogResult = DialogResult.OK Then

View File

@@ -616,7 +616,7 @@
<value>DocumentViewer1</value> <value>DocumentViewer1</value>
</data> </data>
<data name="&gt;&gt;DocumentViewer1.Type" xml:space="preserve"> <data name="&gt;&gt;DocumentViewer1.Type" xml:space="preserve">
<value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null</value> <value>DigitalData.Controls.DocumentViewer.DocumentViewer, DigitalData.Controls.DocumentViewer, Version=2.7.2.0, Culture=neutral, PublicKeyToken=null</value>
</data> </data>
<data name="&gt;&gt;DocumentViewer1.Parent" xml:space="preserve"> <data name="&gt;&gt;DocumentViewer1.Parent" xml:space="preserve">
<value>SplitContainer1.Panel2</value> <value>SplitContainer1.Panel2</value>

View File

@@ -865,7 +865,7 @@ Public Class frmValidator
Try Try
If COPY_WMFILE_2TEMP = True Then If COPY_WMFILE_2TEMP = True Then
MyValidationLogger.Debug("🗑️ Bereinige Temp-Ordner beim Schließen...") MyValidationLogger.Debug("🗑️ Bereinige Temp-Ordner beim Schließen...")
CleanupTempFolder() _documentPathHandler.CleanupTempFolder()
End If End If
Catch cleanupEx As Exception Catch cleanupEx As Exception
MyValidationLogger.Warn($"⚠️ Fehler beim Bereinigen des Temp-Ordners: {cleanupEx.Message}") MyValidationLogger.Warn($"⚠️ Fehler beim Bereinigen des Temp-Ordners: {cleanupEx.Message}")
@@ -901,52 +901,7 @@ Public Class frmValidator
End If End If
End Sub End Sub
Private Sub CleanupTempFolder()
Try
If String.IsNullOrEmpty(TEMP_DOCUMENT_FOLDER) Then
MyValidationLogger.Debug("TEMP_DOCUMENT_FOLDER ist nicht gesetzt → Kein Cleanup erforderlich")
Return
End If
If Not System.IO.Directory.Exists(TEMP_DOCUMENT_FOLDER) Then
MyValidationLogger.Debug($"Temp-Ordner [{TEMP_DOCUMENT_FOLDER}] existiert nicht → Kein Cleanup erforderlich")
Return
End If
' Alle Dateien im Ordner ermitteln
Dim files As String() = System.IO.Directory.GetFiles(TEMP_DOCUMENT_FOLDER)
If files.Length = 0 Then
MyValidationLogger.Debug($"Temp-Ordner [{TEMP_DOCUMENT_FOLDER}] ist bereits leer")
Return
End If
' Alle Dateien löschen
Dim deletedCount As Integer = 0
Dim errorCount As Integer = 0
For Each filePath As String In files
Try
System.IO.File.Delete(filePath)
deletedCount += 1
MyValidationLogger.Debug($"Datei gelöscht: [{System.IO.Path.GetFileName(filePath)}]")
Catch fileEx As Exception
errorCount += 1
MyValidationLogger.Warn($"⚠️ Datei konnte nicht gelöscht werden: [{System.IO.Path.GetFileName(filePath)}] - {fileEx.Message}")
End Try
Next
If errorCount = 0 Then
MyValidationLogger.Debug($"✓ Temp-Ordner bereinigt: {deletedCount} Datei(en) gelöscht")
Else
MyValidationLogger.Warn($"⚠️ Temp-Ordner teilweise bereinigt: {deletedCount} gelöscht, {errorCount} Fehler")
End If
Catch ex As Exception
MyValidationLogger.Error($"❌ Fehler beim Bereinigen des Temp-Ordners: {ex.Message}")
MyValidationLogger.Error(ex)
End Try
End Sub
Public Function Test_Additional_Data_Searches_Exist() As Boolean Public Function Test_Additional_Data_Searches_Exist() As Boolean
If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then If DT_FILTERED_PROFILE_SEARCHES_DATA.Rows.Count > 0 Then
@@ -1018,6 +973,8 @@ Public Class frmValidator
MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}") MyValidationLogger.Debug($"Current_Document: Id={Current_Document?.Id}, Path={Current_Document?.FullPath}")
MyValidationLogger.Debug("========================================") MyValidationLogger.Debug("========================================")
DT_AdditionalSearches_Resultset_Docs = Nothing
Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA Dim allSQLSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DATA
Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC Dim allDocSearches As DataTable = DT_FILTERED_PROFILE_SEARCHES_DOC
@@ -1048,6 +1005,7 @@ Public Class frmValidator
MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---") MyValidationLogger.Debug("--- Ergebnisse werden geprüft (DATA/DOC) ---")
Dim validSQLSearches As DataTable = allSQLSearches.Clone() Dim validSQLSearches As DataTable = allSQLSearches.Clone()
Dim validDocSearches As DataTable = allDocSearches.Clone() Dim validDocSearches As DataTable = allDocSearches.Clone()
Dim aggregatedDocResults As DataTable = Nothing
If hasDATASearches Then If hasDATASearches Then
For i As Integer = 0 To allSQLSearches.Rows.Count - 1 For i As Integer = 0 To allSQLSearches.Rows.Count - 1
@@ -1091,6 +1049,12 @@ Public Class frmValidator
If IsValidDocSearchResult(testDT) Then If IsValidDocSearchResult(testDT) Then
validDocSearches.ImportRow(searchRow) validDocSearches.ImportRow(searchRow)
MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden") MyValidationLogger.Info($"✓ Doc-Search '{tabTitle}': {testDT.Rows.Count} Dokumente gefunden")
If aggregatedDocResults Is Nothing Then
aggregatedDocResults = testDT.Clone()
End If
For Each resultRow As DataRow In testDT.Rows
aggregatedDocResults.ImportRow(resultRow)
Next
Else Else
MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.") MyValidationLogger.Warn($"⚠️ Doc-Search '{tabTitle}' liefert kein Dokument-Schema (DocID/FULL_FILENAME) und wird übersprungen.")
End If End If
@@ -1102,6 +1066,10 @@ Public Class frmValidator
End Try End Try
Next Next
End If End If
DT_AdditionalSearches_Resultset_Docs = aggregatedDocResults
If DT_AdditionalSearches_Resultset_Docs IsNot Nothing Then
MyValidationLogger.Debug($"Zusätzliche Doc-Results gecached: {DT_AdditionalSearches_Resultset_Docs.Rows.Count} Rows")
End If
AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0 AdditionalDataResultsExist = validSQLSearches.Rows.Count > 0
AdditionalDocResultsExist = validDocSearches.Rows.Count > 0 AdditionalDocResultsExist = validDocSearches.Rows.Count > 0
@@ -8578,9 +8546,9 @@ Public Class frmValidator
oFilenameOnly = Path.GetFileName(DocPathWindows) oFilenameOnly = Path.GetFileName(DocPathWindows)
oExtension = Path.GetExtension(DocPathWindows) oExtension = Path.GetExtension(DocPathWindows)
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf & oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbcrlf & $"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
"SELECT @Filename" "SELECT @Filename"
Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename) Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
If Not IsNothing(oExportFilename) Then If Not IsNothing(oExportFilename) Then
@@ -8621,23 +8589,49 @@ Public Class frmValidator
MyValidationLogger.Info($"File {oFile2Export} exported successfully!") MyValidationLogger.Info($"File {oFile2Export} exported successfully!")
oCount += 1 oCount += 1
Else Else
MsgBox("Error encountered while extracting Export-Filename!" & vbcrlf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE) MsgBox("Error encountered while extracting Export-Filename!" & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If End If
Else
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is Nothing - SQL: {oSQLGetFilename}")
MsgBox("Error encountered while extracting Export-Filename - Result is Nothing!" & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If End If
Dim oFileCount As Integer = 1 Dim oFileCount As Integer = 1
If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then If Not IsNothing(DT_AdditionalSearches_Resultset_Docs) Then
For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows For Each oFileRecord As DataRow In DT_AdditionalSearches_Resultset_Docs.Rows
Dim oFromFilename = oFileRecord.Item("FULL_FILENAME") Dim oFromFilename = oFileRecord.Item("FULL_FILENAME")?.ToString()
Dim oDocID = oFileRecord.Item("DocID") Dim oDocID = oFileRecord.Item("DocID")
If File.Exists(oFromFilename) Then
' COPY_WMFILE_2TEMP: Pfad analog zu GetDocPathWindows() auflösen
Dim oResolvedFilename As String = oFromFilename
If COPY_WMFILE_2TEMP = True AndAlso Not String.IsNullOrWhiteSpace(oFromFilename) Then
Dim options As New DocumentPathHandler.DocumentPathOptions With {
.EnableMapping = True,
.WMSuffix = WMSUFFIX,
.SpecificDrive = If(Len(MAP_SHARE_DRIVE) = 1, MAP_SHARE_DRIVE, ""),
.DriveBlacklist = MAP_BLACKLIST,
.CopyToTemp = True,
.TempFolder = TEMP_DOCUMENT_FOLDER,
.UnmapAfterCopy = True
}
Dim result = _documentPathHandler.ProcessDocumentPath(oFromFilename, options)
If result.Success AndAlso Not String.IsNullOrWhiteSpace(result.FinalPath) AndAlso File.Exists(result.FinalPath) Then
MyValidationLogger.Info($"✓ Zusatzdokument via Temp aufgelöst: [{result.FinalPath}]")
oResolvedFilename = result.FinalPath
Else
MyValidationLogger.Warn($"⚠️ Temp-Auflösung fehlgeschlagen für [{oFromFilename}]: {result.ErrorMessage} - Fallback auf Originalpfad")
oResolvedFilename = oFromFilename
End If
End If
If File.Exists(oResolvedFilename) Then
MyValidationLogger.Debug($"Found additional document for export: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
oFileCount += 1 oFileCount += 1
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbcrlf & oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbCrLf &
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbcrlf & $"EXEC dbo.PRPM_GETFILENAME_EXPORT {oDocID}, {oFileCount}, @Outputfilename = @Filename OUTPUT;" & vbCrLf &
"SELECT @Filename" "SELECT @Filename"
oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename) oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
oExtension = Path.GetExtension(oFromFilename) oExtension = Path.GetExtension(oResolvedFilename)
If Not IsNothing(oExportFilename) Then If Not IsNothing(oExportFilename) Then
If IsDBNull(oExportFilename) Then If IsDBNull(oExportFilename) Then
MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}") MyValidationLogger.Info($"#### ATTENTION: oExportFilename is DBNULL - SQL: {oSQLGetFilename}")
@@ -8645,18 +8639,25 @@ Public Class frmValidator
End If End If
If oExportFilename <> String.Empty Then If oExportFilename <> String.Empty Then
oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension oTargetPath = FolderBrowserDialog1.SelectedPath & "\" & oExportFilename & oExtension
File.Copy(oFromFilename, oTargetPath) File.Copy(oResolvedFilename, oTargetPath)
MyValidationLogger.Info($"Additional file [{oResolvedFilename}] exported successfully to [{oTargetPath}]")
oCount += 1 oCount += 1
Else Else
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!" Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}]!"
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}") MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
MsgBox(omsg & vbcrlf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE) MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If End If
Else
Dim omsg = $"Error encountered while extracting ATTACHMENT-Export-Filename DocID [{oDocID}] - Result is Nothing!"
MyValidationLogger.Info($"#### ATTENTION: {omsg} SQL: {oSQLGetFilename}")
MsgBox(omsg & vbCrLf & "Please inform Admin-Team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End If End If
'oFilenameOnly = Path.GetFileName(oFromFilename) Else
MyValidationLogger.Warn($"⚠️ Additional file for export not found: [{oResolvedFilename}] (WM: [{oFromFilename}]) with DocID [{oDocID}]")
End If End If
Next Next
Else
MyValidationLogger.Info("No additional documents to export (DT_AdditionalSearches_Resultset_Docs is Nothing)")
End If End If
CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath
@@ -8665,7 +8666,7 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
MyValidationLogger.Error(ex) MyValidationLogger.Error(ex)
MsgBox("Could not move file to target: " & vbcrlf & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE) MsgBox("Could not move file to target: " & vbCrLf & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End Try End Try
End Sub End Sub