ZooFlow: Set OperationModeOverride from FlowForm

This commit is contained in:
Jonathan Jenne 2021-12-17 11:05:23 +01:00
parent a83b22d923
commit 8d19f70abc
10 changed files with 34 additions and 29 deletions

View File

@ -1,15 +1,14 @@
Imports System.Drawing Imports System.Threading
Imports System.Globalization
Imports System.Drawing
Imports System.Windows.Forms Imports System.Windows.Forms
Imports DevExpress.XtraEditors Imports DevExpress.XtraEditors
Imports DigitalData.GUIs.Common Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.Language Imports DigitalData.Modules.Language
Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Params Imports DigitalData.Modules.ZooFlow.Params
Imports DigitalData.Modules Imports DigitalData.Modules.ZooFlow.Constants
Imports System.Threading
Imports System.Globalization
''' <summary> ''' <summary>
''' '''
@ -65,7 +64,7 @@ Public Class frmMatch
End Sub End Sub
Private Function GetResultString(CreatedTiles, MatchedProfiles, ClipboardContents) As String Private Function GetResultString(CreatedTiles, MatchedProfiles, ClipboardContents) As String
Dim oLanguage = Language.Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) Dim oLanguage = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
Select Case _Language Select Case _Language
Case State.UserState.LANG_DE_DE Case State.UserState.LANG_DE_DE
@ -340,12 +339,13 @@ Public Class frmMatch
End Sub End Sub
Private Sub OpenDocumentResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search)) Private Sub OpenDocumentResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name) Dim oNameSlug = Utils.ConvertTextToSlug(Profile.Name)
Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray
Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}" Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}"
Dim oParams = New DocumentResultParams() With { Dim oParams = New DocumentResultParams() With {
.WindowGuid = oWindowGuid, .WindowGuid = oWindowGuid,
.WindowTitle = GetResultWindowString(_Params.ClipboardContents) .WindowTitle = GetResultWindowString(_Params.ClipboardContents),
.OperationModeOverride = _Params.OperationModeOverride
} }
For Each oSearch In Searches For Each oSearch In Searches
@ -362,7 +362,7 @@ Public Class frmMatch
End Sub End Sub
Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search)) Private Sub OpenDataResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name) Dim oNameSlug = Utils.ConvertTextToSlug(Profile.Name)
Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray
Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}" Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}"
Dim oParams = New DataResultParams() With { Dim oParams = New DataResultParams() With {

View File

@ -118,7 +118,6 @@
</Compile> </Compile>
<Compile Include="DocumentResultList\DocumentResultCache.vb" /> <Compile Include="DocumentResultList\DocumentResultCache.vb" />
<Compile Include="GridBuilder.vb" /> <Compile Include="GridBuilder.vb" />
<Compile Include="Helpers.vb" />
<Compile Include="IResultForm.vb" /> <Compile Include="IResultForm.vb" />
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">

View File

@ -12,6 +12,7 @@ Imports DevExpress.XtraPrinting
Imports DigitalData.GUIs.Common Imports DigitalData.GUIs.Common
Imports System.ComponentModel Imports System.ComponentModel
Imports DevExpress.XtraGrid.Views.Grid.ViewInfo Imports DevExpress.XtraGrid.Views.Grid.ViewInfo
Imports DigitalData.Modules.ZooFlow.Constants
Public Class frmDataResultList Public Class frmDataResultList
Implements IResultForm Implements IResultForm
@ -30,7 +31,7 @@ Public Class frmDataResultList
Public Property ShouldReturnToPreviousForm As Boolean Implements IResultForm.ShouldReturnToPreviousForm Public Property ShouldReturnToPreviousForm As Boolean Implements IResultForm.ShouldReturnToPreviousForm
Private Property OperationMode As Helpers.OperationMode Implements IResultForm.OperationMode Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As DataResultParams) Public Sub New(LogConfig As LogConfig, Environment As Environment, Params As DataResultParams)
' Dieser Aufruf ist für den Designer erforderlich. ' Dieser Aufruf ist für den Designer erforderlich.

View File

@ -1,4 +1,4 @@
Imports DigitalData.GUIs.Common.Helpers Imports DigitalData.Modules.ZooFlow.Constants
Public Class DocumentResultParams Public Class DocumentResultParams
''' <summary> ''' <summary>

View File

@ -19,6 +19,7 @@ Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Language Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Constants
Public Class frmDocumentResultList Public Class frmDocumentResultList
Implements IResultForm Implements IResultForm
@ -68,7 +69,7 @@ Public Class frmDocumentResultList
Private WithEvents _FileOpenTimer As New Timer Private WithEvents _FileOpenTimer As New Timer
Private Property OperationMode As Helpers.OperationMode Implements IResultForm.OperationMode Private Property OperationMode As OperationMode Implements IResultForm.OperationMode
Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm Public Property ShouldReturnToPreviousForm As Boolean = False Implements IResultForm.ShouldReturnToPreviousForm
@ -97,16 +98,16 @@ Public Class frmDocumentResultList
_Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US) _Language = Utils.NotNull(_Environment.User.Language, State.UserState.LANG_EN_US)
End Sub End Sub
Private Function GetOperationMode() As Helpers.OperationMode Private Function GetOperationMode() As OperationMode
Dim oOperationMode = OperationMode.None Dim oOperationMode As OperationMode
If _Environment.Service.IsActive AndAlso _Environment.Service.Address <> String.Empty Then If _Environment.Service.IsActive AndAlso _Environment.Service.Address <> String.Empty Then
oOperationMode = Helpers.OperationMode.WithAppServer oOperationMode = OperationMode.WithAppServer
Else Else
oOperationMode = Helpers.OperationMode.NoAppServer oOperationMode = OperationMode.NoAppServer
End If End If
If _Params.OperationModeOverride <> Helpers.OperationMode.None Then If _Params.OperationModeOverride <> OperationMode.None Then
oOperationMode = _Params.OperationModeOverride oOperationMode = _Params.OperationModeOverride
End If End If
@ -118,7 +119,7 @@ Public Class frmDocumentResultList
' Operation mode is either guessed from service settings ' Operation mode is either guessed from service settings
' or explictly set from OperationModeOverride in Params ' or explictly set from OperationModeOverride in Params
OperationMode = GetOperationMode() OperationMode = GetOperationMode()
If OperationMode = Helpers.OperationMode.WithAppServer Then If OperationMode = OperationMode.WithAppServer Then
InitAppServer() InitAppServer()
End If End If
@ -138,7 +139,7 @@ Public Class frmDocumentResultList
SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance SplitContainerControl2.SplitterPosition = _Config.Config.SplitContainer2Distance
SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal SwitchDetailContainerHorizontal.Checked = _Config.Config.SplitContainer2Horizontal
If OperationMode <> Helpers.OperationMode.NoAppServer Then If OperationMode <> OperationMode.NoAppServer Then
' Location and size will be managed by the ZooFlow Search Window ' Location and size will be managed by the ZooFlow Search Window
If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then If Utils.IsVisibleOnAnyScreen(_Config.Config.WindowLocation) Then
If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then If Utils.LocationIsVisible(_Config.Config.WindowLocation) Then
@ -185,7 +186,7 @@ Public Class frmDocumentResultList
DocumentViewer1.CloseDocument() DocumentViewer1.CloseDocument()
Select Case OperationMode Select Case OperationMode
Case Helpers.OperationMode.NoAppServer Case OperationMode.NoAppServer
oDocumentInfo = LoadFile_Legacy(oRow) oDocumentInfo = LoadFile_Legacy(oRow)
If oDocumentInfo.Contents IsNot Nothing Then If oDocumentInfo.Contents IsNot Nothing Then
@ -195,7 +196,7 @@ Public Class frmDocumentResultList
DocumentViewer1.LoadFile(oDocumentInfo.FullPath) DocumentViewer1.LoadFile(oDocumentInfo.FullPath)
End If End If
Case Helpers.OperationMode.WithAppServer Case OperationMode.WithAppServer
oDocumentInfo = LoadFile_IDB(oRow) oDocumentInfo = LoadFile_IDB(oRow)
If oDocumentInfo.Contents IsNot Nothing Then If oDocumentInfo.Contents IsNot Nothing Then
@ -206,7 +207,7 @@ Public Class frmDocumentResultList
End If End If
Case Helpers.OperationMode.ZooFlow Case OperationMode.ZooFlow
oDocumentInfo = LoadFile_ZooFlow(oRow) oDocumentInfo = LoadFile_ZooFlow(oRow)
@ -435,7 +436,7 @@ Public Class frmDocumentResultList
Throw New ApplicationException($"Datatable is missing DocId Column [{COLUMN_DOCID}] for search {Result.Title}!") Throw New ApplicationException($"Datatable is missing DocId Column [{COLUMN_DOCID}] for search {Result.Title}!")
End If End If
If OperationMode = Helpers.OperationMode.NoAppServer And Result.Datatable.Columns.Contains(COLUMN_FILEPATH) = False Then If OperationMode = OperationMode.NoAppServer And Result.Datatable.Columns.Contains(COLUMN_FILEPATH) = False Then
Throw New ApplicationException($"Datatable is missing Filepath Column [{COLUMN_FILEPATH}] for search {Result.Title}!") Throw New ApplicationException($"Datatable is missing Filepath Column [{COLUMN_FILEPATH}] for search {Result.Title}!")
End If End If
@ -571,7 +572,7 @@ Public Class frmDocumentResultList
oFilePathColumn.Visible = False oFilePathColumn.Visible = False
' Hide Fullpath column completely in AppServer-Mode ' Hide Fullpath column completely in AppServer-Mode
If OperationMode = Helpers.OperationMode.WithAppServer Then If OperationMode = OperationMode.WithAppServer Then
oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False oFilePathColumn.OptionsColumn.ShowInCustomizationForm = False
End If End If
End If End If
@ -932,7 +933,7 @@ Public Class frmDocumentResultList
_CurrentDocumentId = oObjectId _CurrentDocumentId = oObjectId
If OperationMode = Helpers.OperationMode.WithAppServer Then If OperationMode = OperationMode.WithAppServer Then
If oRight = Rights.AccessRight.FULL Or oRight = Rights.AccessRight.VIEW_EXPORT Then If oRight = Rights.AccessRight.FULL Or oRight = Rights.AccessRight.VIEW_EXPORT Then
MenuFullAccess_IDB.ShowPopup(oPoint) MenuFullAccess_IDB.ShowPopup(oPoint)
Else Else

View File

@ -1,4 +1,4 @@
Imports DigitalData.GUIs.Common.Helpers Imports DigitalData.Modules.ZooFlow.Constants
Public Interface IResultForm Public Interface IResultForm
Property OperationMode As OperationMode Property OperationMode As OperationMode

View File

@ -858,7 +858,8 @@ Public Class frmFlowForm
Dim oParams As New DigitalData.Modules.ZooFlow.ClipboardWatcherParams With { Dim oParams As New DigitalData.Modules.ZooFlow.ClipboardWatcherParams With {
.ClipboardContents = oState.CurrentClipboardContents, .ClipboardContents = oState.CurrentClipboardContents,
.MatchingProfiles = oProfiles, .MatchingProfiles = oProfiles,
.MatchTreeView = oState.MatchTreeView .MatchTreeView = oState.MatchTreeView,
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow
} }
Dim oForm As New frmMatch(My.LogConfig, oEnvironment, oParams) Dim oForm As New frmMatch(My.LogConfig, oEnvironment, oParams)

View File

@ -1,4 +1,4 @@
Public Class Helpers Public Class Constants
Public Enum OperationMode Public Enum OperationMode
WithAppServer WithAppServer
NoAppServer NoAppServer

View File

@ -1,8 +1,10 @@
Imports System.Windows.Forms Imports System.Windows.Forms
Imports DigitalData.Modules.ZooFlow.Constants
Imports DigitalData.Modules.ZooFlow.Params Imports DigitalData.Modules.ZooFlow.Params
Public Class ClipboardWatcherParams Public Class ClipboardWatcherParams
Public ClipboardContents As String Public ClipboardContents As String
Public MatchingProfiles As List(Of ProfileData) Public MatchingProfiles As List(Of ProfileData)
Public MatchTreeView As TreeView Public MatchTreeView As TreeView
Public OperationModeOverride As OperationMode = OperationMode.None
End Class End Class

View File

@ -74,6 +74,7 @@
<Import Include="System.Threading.Tasks" /> <Import Include="System.Threading.Tasks" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Constants.vb" />
<Compile Include="Environment.vb" /> <Compile Include="Environment.vb" />
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">