Prepare Rightsmanagement in DocumentResults

This commit is contained in:
Jonathan Jenne
2020-12-18 16:26:39 +01:00
parent ac71352c24
commit 1e3f508b1f
9 changed files with 52 additions and 99 deletions

View File

@@ -10,6 +10,7 @@ Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.EDMI.API
Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.BandedGrid
Imports System.ComponentModel
@@ -35,6 +36,7 @@ Public Class frmDocumentResultList
Private _IsLoading As Boolean = True
Private _IsLegacy As Boolean = True
Private _IDBClient As Client
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
@@ -45,13 +47,29 @@ Public Class frmDocumentResultList
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Dim oConfigPath As String = Path.Combine(Application.UserAppDataPath, "ResultList", Params.WindowGuid)
_IsLegacy = Not Params.IsIDBResult
_LogConfig = LogConfig
_Logger = LogConfig.GetLogger()
_Config = New ConfigManager(Of DocumentResultConfig)(LogConfig, oConfigPath, oConfigPath)
_Environment = Environment
_Params = Params
_ResultLists = Params.Results
InitIDB()
End Sub
Private Sub InitIDB()
_IsLegacy = Not _Environment.Service.IsActive
If _Environment.Service.IsActive Then
Dim oSplit As List(Of String) = _Environment.Service.Address.Split(":").ToList()
Dim oAddress As String = oSplit.Item(0)
Dim oPort As Integer = oSplit.Item(1)
_IDBClient = New Client(_LogConfig, oAddress, oPort)
If Not _IDBClient.Connect() Then
_Logger.Warn("Client could not connect to Service at [{0}]", _Environment.Service.Address)
End If
End If
End Sub
Private Sub frmDocumentResultList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@@ -522,34 +540,6 @@ Public Class frmDocumentResultList
End Try
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
OpenFile()
End Sub
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
OpenFolderPath()
End Sub
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
CopyFileName()
End Sub
Private Sub DateiÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DateiÖffnenToolStripMenuItem.Click
OpenFile()
End Sub
Private Sub EigenschaftenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EigenschaftenToolStripMenuItem.Click
OpenProperties()
End Sub
Private Sub OrdnerÖffnenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles OrdnerÖffnenToolStripMenuItem.Click
OpenFolderPath()
End Sub
Private Sub PfadInZwischenablageKopierenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PfadInZwischenablageKopierenToolStripMenuItem.Click
CopyFileName()
End Sub
Private Sub GridView1_ColumnFilterChanged(sender As GridView, e As EventArgs) Handles GridView1.ColumnFilterChanged
Dim oRowCount = sender.RowCount
UpdateGridHeader(_ResultLists, 0, oRowCount)
@@ -587,22 +577,29 @@ Public Class frmDocumentResultList
End Sub
Private Sub GridView_PopupMenuShowing(sender As Object, e As PopupMenuShowingEventArgs) Handles GridView1.PopupMenuShowing, GridView2.PopupMenuShowing, GridView3.PopupMenuShowing
Dim oView As GridView = sender
Try
Dim oView As GridView = sender
If e.MenuType = DevExpress.XtraGrid.Views.Grid.GridMenuType.Row Then
Dim oRowHandle = e.HitInfo.RowHandle
Dim oRow As DataRow = oView.GetDataRow(oRowHandle)
Dim oFilepath As String = oRow.Item(COLUMN_FILEPATH)
Dim oObjectId As Long = oRow.Item(COLUMN_DOCID)
Dim oMenu As New DocumentPropertyMenu(_LogConfig, _Environment, oFilepath, oObjectId)
If e.MenuType = GridMenuType.Row Then
Dim oRowHandle = e.HitInfo.RowHandle
Dim oRow As DataRow = oView.GetDataRow(oRowHandle)
Dim oFilepath As String = oRow.Item(COLUMN_FILEPATH)
Dim oObjectId As Long = oRow.Item(COLUMN_DOCID)
Dim oMenu As New DocumentPropertyMenu(
_LogConfig,
_Environment,
oFilepath,
oObjectId)
e.Menu.Items.Clear()
e.Menu.Items.Clear()
For Each oItem In oMenu.GetMenuItems(_IsLegacy)
e.Menu.Items.Add(oItem)
Next
End If
For Each oItem In oMenu.GetMenuItems(_IsLegacy)
e.Menu.Items.Add(oItem)
Next
End If
Catch ex As Exception
_Logger.Error(ex)
MsgBox("Unexpected Error while preparing context menu", MsgBoxStyle.Critical, Text)
End Try
End Sub
End Class