Compare commits

..

7 Commits

Author SHA1 Message Date
OlgunR
7694da3192 Update AssemblyVersion to 2.10.1.0
Incremented the AssemblyVersion in AssemblyInfo.vb from 2.10.0.0 to 2.10.1.0 to reflect a minor version update. No other changes were made.
2026-04-30 14:24:07 +02:00
OlgunR
eb826009f8 Remove LICENSE_MoveRename check for grpbxMORE enable state
Removed logic that enabled or disabled the grpbxMORE group box based on the LICENSE_MoveRename variable. The group box's enabled state is no longer set by default or controlled by license checks. Also updated ImageList1.ImageStream in the resource file.
2026-04-30 14:23:28 +02:00
OlgunR
018cbc5ae0 Refactor session logout logic into helper method
Extracted duplicated session logout code into a new private method, LogoutCurrentSession. This method is now used in both GetWMSessionAsUser and GetWMSession to improve code reuse and maintainability. Exception handling for session logout remains silent to avoid issues with already-terminated sessions.
2026-04-29 15:47:04 +02:00
OlgunR
e4d6734b03 Improve session management and initialization logic
Refactored ClassWindream_allgemein to enhance session lifecycle handling and robustness. Now, after successful impersonation/login, session and object type variables are set and errors are logged if loading fails. Changed impersonation/login to return Boolean for clarity. Init() now returns session creation success. Added GetWMSession to properly reset sessions. Ensured object types are loaded when reusing sessions. These changes improve error handling and maintain consistent session state.
2026-04-27 16:44:00 +02:00
OlgunR
61f6029001 Update group box texts and refresh ImageList resources
Clarified GroupBox1 and GroupBox2 text to include both re-indexing and post-processing errors. Updated ImageList1.ImageStream in the resource file, likely reflecting changes to form images.
2026-04-27 15:05:24 +02:00
OlgunR
de47ed9f3b Update assembly version to 2.10.0.0
Bumped the assembly version in AssemblyInfo.vb from 2.9.9.0 to 2.10.0.0 to reflect the new release. The file version remains at 2.9.9.0.
2026-04-27 14:57:47 +02:00
OlgunR
e9a78cf6a4 Improve error handling and logging for rights and indexing
Enhanced error handling in ClassWD_Rechte to unlock objects after exceptions and prevent resource locks. Refactored frmNIHauptseite to add detailed debug logging and robust error handling in File_SetBooleanIndex, including better handling of missing or invalid index values. Replaced SetErrorMeldung with File_SetBooleanIndex for AD post-processing errors. These changes improve traceability and reliability.
2026-04-27 11:30:37 +02:00
7 changed files with 67 additions and 19 deletions

View File

@@ -393,13 +393,13 @@ Public Class ClassWD_Rechte
End Function
Private Function WorkRight(_methode As String, createdFolder As String, _form As Boolean, oWMObject As WINDREAMLib.WMObject, deleteRights As Boolean, folgeRegel As Boolean, _UserOrGroup As String,
_GruppenUserRecht As String, _lRight As Integer) As Boolean
Dim Object2Change As WINDREAMLib.WMObject = Nothing
Try
Dim _Erfolgreich As Boolean = True
Dim UserGroupRelation
Dim UserOrGroup
Dim oGroup
Dim oUSer
Dim Object2Change As WINDREAMLib.WMObject
If _methode = "AddRightFolder" Then
Object2Change = oWMObject.aParentWMObject
ElseIf _methode = "AddRightCreatedFolder" Then
@@ -731,6 +731,13 @@ Public Class ClassWD_Rechte
Return _Erfolgreich
Catch ex As Exception
_Logger.Error(ex)
Try
If Object2Change IsNot Nothing AndAlso Object2Change.aLocked Then
Object2Change.unlock()
_Logger.Debug("WorkRight Catch: Object2Change unlocked after error.")
End If
Catch
End Try
Return False
End Try
End Function

View File

@@ -49,7 +49,20 @@ Public Class ClassWindream_allgemein
' Process.GetCurrentProcess.Kill()
End If
End Sub
Private Sub LogoutCurrentSession()
If Not IsNothing(CURRENToWMSession) Then
Try
CURRENToWMSession.Logout()
Catch
' ignorieren Session war evtl. schon tot
End Try
CURRENToWMSession = Nothing
End If
End Sub
Public Function GetWMSessionAsUser(Domain, ServerName, UserName, Password)
LogoutCurrentSession()
Dim SessionAsUser
Dim aConnect, aUserId, aSession
On Error Resume Next
@@ -95,10 +108,24 @@ Public Class ClassWindream_allgemein
SessionAsUser = aSession
If aSession.aLoggedin = True Then
_Logger.Debug($"#Impersonate login [{UserName}] successfull!")
Return SessionAsUser
Me.oWMSession = aSession
CURRENToWMSession = aSession
CURRENToWMSession_Created = Now
Me.oObjekttypen = aSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
If Err.Number <> 0 Then
_Logger.Warn("Fehler beim Laden der Objekttypen nach Impersonate-Login: " & Err.Description)
Err.Clear()
End If
Me.oOrdnerTypen = aSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityFolder)
If Err.Number <> 0 Then
_Logger.Warn("Fehler beim Laden der Ordnertypen nach Impersonate-Login: " & Err.Description)
Err.Clear()
End If
Return True
End If
End If
Return False
End Function
''' <summary>
@@ -108,21 +135,29 @@ Public Class ClassWindream_allgemein
''' <remarks></remarks>
Public Function Init() As Boolean
If IsNothing(CURRENToWMSession) OrElse Not IsLoggedIn() Then
If IsNothing(CURRENToWMSession) OrElse Not CBool(CURRENToWMSession.aLoggedin) Then
If WMLOGIN_DOMAIN <> String.Empty Then
GetWMSessionAsUser(WMLOGIN_DOMAIN, Me.GetCurrentServer, WMLOGIN_USER, WMLOGIN_PW)
Return GetWMSessionAsUser(WMLOGIN_DOMAIN, Me.GetCurrentServer, WMLOGIN_USER, WMLOGIN_PW)
Else
GetWMSession()
Return GetWMSession()
End If
Else
If My.Settings.vLogErrorsonly = False Then _Logger.Debug("WMSession already created!")
oWMSession = CURRENToWMSession
If IsNothing(oObjekttypen) Then
oObjekttypen = oWMSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
End If
If IsNothing(oOrdnerTypen) Then
oOrdnerTypen = oWMSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityFolder)
End If
Return True
End If
End Function
Private Function GetWMSession()
LogoutCurrentSession()
Try
Try
' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen

View File

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

View File

@@ -1913,7 +1913,7 @@ Public Class frmNIHauptseite
If adReworkOk = False Then
_Logger.Warn($"## Nachbearbeitung AD für [{pMyWMDoc.aName}] fehlgeschlagen - Error-Index wird gesetzt")
File_SetBooleanIndex(True, pMyWMDoc, aktivesProfil.IndexValidation)
SetErrorMeldung("Rechtevergabe fehlgeschlagen", pMyWMDoc, aktivesProfil.IndexFehler)
File_SetBooleanIndex(True, pMyWMDoc, aktivesProfil.IndexFehler)
End If
Else
If aktivesProfil.NachbearbeitungAD = True Then
@@ -2547,12 +2547,22 @@ Public Class frmNIHauptseite
'Ab Hier Error prüfen
Sub File_SetBooleanIndex(ByVal _value As Boolean, ByVal _dok As WINDREAMLib.WMObject, ByVal _Indexname As String)
Try
_Logger.Debug($"File_SetBooleanIndex called: Index=[{_Indexname}] Value=[{_value}] Doc=[{If(_dok IsNot Nothing, _dok.aName, "NULL")}]")
If _Indexname <> "" Then
'Überprüfen ob Boolean-Value bereits gesetzt wurde?
Dim akt_Status As Boolean = CBool(_dok.GetVariableValue(_Indexname))
Dim akt_Status As Boolean = False
Try
Dim rawValue As Object = _dok.GetVariableValue(_Indexname)
_Logger.Debug($"File_SetBooleanIndex: rawValue=[{If(rawValue IsNot Nothing, rawValue.ToString, "NULL")}]")
If rawValue IsNot Nothing Then
akt_Status = CBool(rawValue)
End If
Catch ex As Exception
_Logger.Debug($"File_SetBooleanIndex: GetVariableValue threw exception - treating as False. Error: {ex.Message}")
akt_Status = False
End Try
If akt_Status <> _value Then
'Index muß angepasst werden
_Logger.Debug("Validation Index not set to '" & _value.ToString & "'.")
_Logger.Debug($"File_SetBooleanIndex: writing [{_value}] to index [{_Indexname}]")
Dim arrIndex() As String = Nothing
Dim arrValue() As String = Nothing
'Nun die Datei indexieren
@@ -2577,6 +2587,8 @@ Public Class frmNIHauptseite
'Validation muß nicht angepasst werden
_Logger.Debug("Validation Index already set to '" & _value & "'.")
End If
Else
_Logger.Warn($"File_SetBooleanIndex: _Indexname is empty - no index written! (Doc=[{If(_dok IsNot Nothing, _dok.aName, "NULL")}] Value=[{_value}])")
End If
Catch ex As Exception
_Logger.Warn("Error in File_SetBooleanIndex")

View File

@@ -635,7 +635,7 @@ Partial Class frmNIProfileigenschaften
Me.GroupBox1.Size = New System.Drawing.Size(624, 83)
Me.GroupBox1.TabIndex = 70
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Indexname - Nachindexierung fehlerhaft:"
Me.GroupBox1.Text = "Indexname - Nachindexierung/Nachbearbeitung fehlerhaft:"
'
'Label6
'
@@ -701,7 +701,7 @@ Partial Class frmNIProfileigenschaften
Me.GroupBox2.Size = New System.Drawing.Size(624, 83)
Me.GroupBox2.TabIndex = 75
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Dauerhafte Kennzeichnung - Fehler bei Indexierung:"
Me.GroupBox2.Text = "Dauerhafte Kennzeichnung - Fehler bei Nachindexierung/Nachbearbeitung:"
'
'Label8
'
@@ -1007,7 +1007,6 @@ Partial Class frmNIProfileigenschaften
'
Me.grpbxMORE.Controls.Add(Me.btnMoveRename)
Me.grpbxMORE.Controls.Add(Me.Label21)
Me.grpbxMORE.Enabled = False
Me.grpbxMORE.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.grpbxMORE.Location = New System.Drawing.Point(6, 104)
Me.grpbxMORE.Name = "grpbxMORE"

View File

@@ -161,7 +161,7 @@ einen Startindex erhält, der nicht in der Datenbank existiert. Diese Kennzeichn
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAK
CQAAAk1TRnQBSQFMAgEBAgEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CQAAAk1TRnQBSQFMAgEBAgEAAeABAAHgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA

View File

@@ -1109,11 +1109,6 @@ Public Class frmNIProfileigenschaften
End Sub
Private Sub frmNIProfileigenschaften_Load(sender As Object, e As EventArgs) Handles Me.Load
If LICENSE_MoveRename = True Then
grpbxMORE.Enabled = True
Else
grpbxMORE.Enabled = False
End If
If Me._selectedProfile Is Nothing Then
Me.pnlProfileigenschaften.Visible = False
Else