Zooflow: Implement Single file Search Results, Rework client wrt Address parsing

This commit is contained in:
Jonathan Jenne 2022-04-13 15:39:01 +02:00
parent 7716a04452
commit 160040535d
23 changed files with 346 additions and 234 deletions

View File

@ -32,7 +32,7 @@ Public Class ProfileSearches
_Environment = pEnvironment _Environment = pEnvironment
_ClipboardContents = pClipboardContents _ClipboardContents = pClipboardContents
Try Try
If _Environment.Service.IsActive = True Then If _Environment.Service.Client.IsOnline = True Then
Try Try
Dim oSplit() As String = _Environment.Service.Address.Split(":") Dim oSplit() As String = _Environment.Service.Address.Split(":")
Dim oAppServerAddress As String = oSplit(0) Dim oAppServerAddress As String = oSplit(0)
@ -90,7 +90,7 @@ Public Class ProfileSearches
Private Function DoLoadDocumentSearches(ProfileId As Integer) As List(Of Search) Private Function DoLoadDocumentSearches(ProfileId As Integer) As List(Of Search)
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX" Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
Dim oSearchesDataTable As DataTable Dim oSearchesDataTable As DataTable
If _Environment.Service.IsActive = True Then If _Environment.Service.Client.IsOnline = True Then
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DOC_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX") Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DOC_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
oSearchesDataTable = oTableResult.Table oSearchesDataTable = oTableResult.Table
If oSearchesDataTable Is Nothing Then If oSearchesDataTable Is Nothing Then
@ -157,7 +157,7 @@ Public Class ProfileSearches
Try Try
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX" Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
Dim oSearchesDataTable As DataTable Dim oSearchesDataTable As DataTable
If _Environment.Service.IsActive = True Then If _Environment.Service.Client.IsOnline = True Then
Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DATA_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX") Dim oTableResult As TableResult = _Client.GetDatatableByName("TBCW_PROF_DATA_SEARCH", $"PROFILE_ID = {ProfileId} AND ACTIVE = 1", "TAB_INDEX")
oSearchesDataTable = oTableResult.Table oSearchesDataTable = oTableResult.Table
If oSearchesDataTable Is Nothing Then If oSearchesDataTable Is Nothing Then

View File

@ -12,6 +12,7 @@ Namespace DocumentResultList
Public OperationModeOverride As OperationMode = OperationMode.None Public OperationModeOverride As OperationMode = OperationMode.None
Public ProfileGuid As Integer Public ProfileGuid As Integer
Public ShowBackNavigation As Boolean = True Public ShowBackNavigation As Boolean = True
Public ShowFileList As Boolean = True
End Class End Class
Public Class DocumentResult Public Class DocumentResult

View File

@ -107,7 +107,7 @@ Partial Class frmDocumentResultList
Me.DockPanelMetadata = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanelMetadata = New DevExpress.XtraBars.Docking.DockPanel()
Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer()
Me.CtrlObjectPropertyDialog = New DigitalData.GUIs.Common.ctrlObjectPropertyDialog() Me.CtrlObjectPropertyDialog = New DigitalData.GUIs.Common.ctrlObjectPropertyDialog()
Me.DockPanelDocViewer = New DevExpress.XtraBars.Docking.DockPanel() Me.DockPanelPreview = New DevExpress.XtraBars.Docking.DockPanel()
Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer()
Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components) Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components)
CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SplitContainerControl1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -151,7 +151,7 @@ Partial Class frmDocumentResultList
CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.DockPanelMetadata.SuspendLayout() Me.DockPanelMetadata.SuspendLayout()
Me.DockPanel3_Container.SuspendLayout() Me.DockPanel3_Container.SuspendLayout()
Me.DockPanelDocViewer.SuspendLayout() Me.DockPanelPreview.SuspendLayout()
Me.DockPanel1_Container.SuspendLayout() Me.DockPanel1_Container.SuspendLayout()
CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
@ -701,7 +701,7 @@ Partial Class frmDocumentResultList
'DockManager1 'DockManager1
' '
Me.DockManager1.Form = Me Me.DockManager1.Form = Me
Me.DockManager1.RootPanels.AddRange(New DevExpress.XtraBars.Docking.DockPanel() {Me.DockPanelFileList, Me.panelContainerStatus, Me.DockPanelDocViewer}) Me.DockManager1.RootPanels.AddRange(New DevExpress.XtraBars.Docking.DockPanel() {Me.DockPanelFileList, Me.panelContainerStatus, Me.DockPanelPreview})
Me.DockManager1.TopZIndexControls.AddRange(New String() {"DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.MenuStrip", "System.Windows.Forms.StatusStrip", "System.Windows.Forms.StatusBar", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl", "DevExpress.XtraBars.Navigation.OfficeNavigationBar", "DevExpress.XtraBars.Navigation.TileNavPane", "DevExpress.XtraBars.TabFormControl", "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl", "DevExpress.XtraBars.ToolbarForm.ToolbarFormControl"}) Me.DockManager1.TopZIndexControls.AddRange(New String() {"DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.MenuStrip", "System.Windows.Forms.StatusStrip", "System.Windows.Forms.StatusBar", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl", "DevExpress.XtraBars.Navigation.OfficeNavigationBar", "DevExpress.XtraBars.Navigation.TileNavPane", "DevExpress.XtraBars.TabFormControl", "DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl", "DevExpress.XtraBars.ToolbarForm.ToolbarFormControl"})
' '
'DockPanelFileList 'DockPanelFileList
@ -712,7 +712,7 @@ Partial Class frmDocumentResultList
resources.ApplyResources(Me.DockPanelFileList, "DockPanelFileList") resources.ApplyResources(Me.DockPanelFileList, "DockPanelFileList")
Me.DockPanelFileList.Name = "DockPanelFileList" Me.DockPanelFileList.Name = "DockPanelFileList"
Me.DockPanelFileList.Options.ShowCloseButton = False Me.DockPanelFileList.Options.ShowCloseButton = False
Me.DockPanelFileList.OriginalSize = New System.Drawing.Size(585, 200) Me.DockPanelFileList.OriginalSize = New System.Drawing.Size(590, 200)
' '
'DockPanel2_Container 'DockPanel2_Container
' '
@ -840,15 +840,15 @@ Partial Class frmDocumentResultList
resources.ApplyResources(Me.CtrlObjectPropertyDialog, "CtrlObjectPropertyDialog") resources.ApplyResources(Me.CtrlObjectPropertyDialog, "CtrlObjectPropertyDialog")
Me.CtrlObjectPropertyDialog.Name = "CtrlObjectPropertyDialog" Me.CtrlObjectPropertyDialog.Name = "CtrlObjectPropertyDialog"
' '
'DockPanelDocViewer 'DockPanelPreview
' '
Me.DockPanelDocViewer.Controls.Add(Me.DockPanel1_Container) Me.DockPanelPreview.Controls.Add(Me.DockPanel1_Container)
Me.DockPanelDocViewer.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill Me.DockPanelPreview.Dock = DevExpress.XtraBars.Docking.DockingStyle.Fill
Me.DockPanelDocViewer.ID = New System.Guid("6e5335e5-ba54-49c1-81b3-f174ea4e59ca") Me.DockPanelPreview.ID = New System.Guid("6e5335e5-ba54-49c1-81b3-f174ea4e59ca")
resources.ApplyResources(Me.DockPanelDocViewer, "DockPanelDocViewer") resources.ApplyResources(Me.DockPanelPreview, "DockPanelPreview")
Me.DockPanelDocViewer.Name = "DockPanelDocViewer" Me.DockPanelPreview.Name = "DockPanelPreview"
Me.DockPanelDocViewer.Options.ShowCloseButton = False Me.DockPanelPreview.Options.ShowCloseButton = False
Me.DockPanelDocViewer.OriginalSize = New System.Drawing.Size(329, 200) Me.DockPanelPreview.OriginalSize = New System.Drawing.Size(324, 200)
' '
'DockPanel1_Container 'DockPanel1_Container
' '
@ -865,7 +865,7 @@ Partial Class frmDocumentResultList
Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[True] Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[True]
resources.ApplyResources(Me, "$this") resources.ApplyResources(Me, "$this")
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.DockPanelDocViewer) Me.Controls.Add(Me.DockPanelPreview)
Me.Controls.Add(Me.panelContainerStatus) Me.Controls.Add(Me.panelContainerStatus)
Me.Controls.Add(Me.DockPanelFileList) Me.Controls.Add(Me.DockPanelFileList)
Me.Controls.Add(Me.RibbonStatusBar) Me.Controls.Add(Me.RibbonStatusBar)
@ -916,7 +916,7 @@ Partial Class frmDocumentResultList
CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.EmptySpaceItem1, System.ComponentModel.ISupportInitialize).EndInit()
Me.DockPanelMetadata.ResumeLayout(False) Me.DockPanelMetadata.ResumeLayout(False)
Me.DockPanel3_Container.ResumeLayout(False) Me.DockPanel3_Container.ResumeLayout(False)
Me.DockPanelDocViewer.ResumeLayout(False) Me.DockPanelPreview.ResumeLayout(False)
Me.DockPanel1_Container.ResumeLayout(False) Me.DockPanel1_Container.ResumeLayout(False)
CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.SvgImageCollection1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False) Me.ResumeLayout(False)
@ -974,7 +974,7 @@ Partial Class frmDocumentResultList
Friend WithEvents RibbonPageGroup5 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroup5 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents RibbonPageGroup6 As DevExpress.XtraBars.Ribbon.RibbonPageGroup Friend WithEvents RibbonPageGroup6 As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents DockManager1 As DevExpress.XtraBars.Docking.DockManager Friend WithEvents DockManager1 As DevExpress.XtraBars.Docking.DockManager
Friend WithEvents DockPanelDocViewer As DevExpress.XtraBars.Docking.DockPanel Friend WithEvents DockPanelPreview As DevExpress.XtraBars.Docking.DockPanel
Friend WithEvents DockPanel1_Container As DevExpress.XtraBars.Docking.ControlContainer Friend WithEvents DockPanel1_Container As DevExpress.XtraBars.Docking.ControlContainer
Friend WithEvents DockPanelMetadata As DevExpress.XtraBars.Docking.DockPanel Friend WithEvents DockPanelMetadata As DevExpress.XtraBars.Docking.DockPanel
Friend WithEvents DockPanel3_Container As DevExpress.XtraBars.Docking.ControlContainer Friend WithEvents DockPanel3_Container As DevExpress.XtraBars.Docking.ControlContainer

View File

@ -493,7 +493,7 @@
<value>0, 0</value> <value>0, 0</value>
</data> </data>
<data name="DocumentViewer1.Size" type="System.Drawing.Size, System.Drawing"> <data name="DocumentViewer1.Size" type="System.Drawing.Size, System.Drawing">
<value>323, 459</value> <value>318, 459</value>
</data> </data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="DocumentViewer1.TabIndex" type="System.Int32, mscorlib"> <data name="DocumentViewer1.TabIndex" type="System.Int32, mscorlib">
@ -515,7 +515,7 @@
<value>3, 26</value> <value>3, 26</value>
</data> </data>
<data name="DockPanel1_Container.Size" type="System.Drawing.Size, System.Drawing"> <data name="DockPanel1_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>323, 459</value> <value>318, 459</value>
</data> </data>
<data name="DockPanel1_Container.TabIndex" type="System.Int32, mscorlib"> <data name="DockPanel1_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -527,30 +527,30 @@
<value>DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="&gt;&gt;DockPanel1_Container.Parent" xml:space="preserve"> <data name="&gt;&gt;DockPanel1_Container.Parent" xml:space="preserve">
<value>DockPanelDocViewer</value> <value>DockPanelPreview</value>
</data> </data>
<data name="&gt;&gt;DockPanel1_Container.ZOrder" xml:space="preserve"> <data name="&gt;&gt;DockPanel1_Container.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="DockPanelDocViewer.Location" type="System.Drawing.Point, System.Drawing"> <data name="DockPanelPreview.Location" type="System.Drawing.Point, System.Drawing">
<value>585, 158</value> <value>590, 158</value>
</data> </data>
<data name="DockPanelDocViewer.Size" type="System.Drawing.Size, System.Drawing"> <data name="DockPanelPreview.Size" type="System.Drawing.Size, System.Drawing">
<value>329, 489</value> <value>324, 489</value>
</data> </data>
<data name="DockPanelDocViewer.Text" xml:space="preserve"> <data name="DockPanelPreview.Text" xml:space="preserve">
<value>Vorschau</value> <value>Vorschau</value>
</data> </data>
<data name="&gt;&gt;DockPanelDocViewer.Name" xml:space="preserve"> <data name="&gt;&gt;DockPanelPreview.Name" xml:space="preserve">
<value>DockPanelDocViewer</value> <value>DockPanelPreview</value>
</data> </data>
<data name="&gt;&gt;DockPanelDocViewer.Type" xml:space="preserve"> <data name="&gt;&gt;DockPanelPreview.Type" xml:space="preserve">
<value>DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value> <value>DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data> </data>
<data name="&gt;&gt;DockPanelDocViewer.Parent" xml:space="preserve"> <data name="&gt;&gt;DockPanelPreview.Parent" xml:space="preserve">
<value>$this</value> <value>$this</value>
</data> </data>
<data name="&gt;&gt;DockPanelDocViewer.ZOrder" xml:space="preserve"> <data name="&gt;&gt;DockPanelPreview.ZOrder" xml:space="preserve">
<value>0</value> <value>0</value>
</data> </data>
<data name="txtCheckedOutWho.Location" type="System.Drawing.Point, System.Drawing"> <data name="txtCheckedOutWho.Location" type="System.Drawing.Point, System.Drawing">
@ -774,7 +774,7 @@
<value>3, 26</value> <value>3, 26</value>
</data> </data>
<data name="DockPanel2_Container.Size" type="System.Drawing.Size, System.Drawing"> <data name="DockPanel2_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>578, 460</value> <value>583, 460</value>
</data> </data>
<data name="DockPanel2_Container.TabIndex" type="System.Int32, mscorlib"> <data name="DockPanel2_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -795,7 +795,7 @@
<value>0, 158</value> <value>0, 158</value>
</data> </data>
<data name="DockPanelFileList.Size" type="System.Drawing.Size, System.Drawing"> <data name="DockPanelFileList.Size" type="System.Drawing.Size, System.Drawing">
<value>585, 489</value> <value>590, 489</value>
</data> </data>
<data name="DockPanelFileList.Text" xml:space="preserve"> <data name="DockPanelFileList.Text" xml:space="preserve">
<value>Ergebnisse</value> <value>Ergebnisse</value>
@ -1397,7 +1397,7 @@
<value>4</value> <value>4</value>
</data> </data>
<data name="GridControl1.Size" type="System.Drawing.Size, System.Drawing"> <data name="GridControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>568, 460</value> <value>573, 460</value>
</data> </data>
<data name="GridControl1.TabIndex" type="System.Int32, mscorlib"> <data name="GridControl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value> <value>0</value>
@ -1568,7 +1568,7 @@
<value>1</value> <value>1</value>
</data> </data>
<data name="SplitContainerControl1.Size" type="System.Drawing.Size, System.Drawing"> <data name="SplitContainerControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>578, 460</value> <value>583, 460</value>
</data> </data>
<data name="SplitContainerControl1.TabIndex" type="System.Int32, mscorlib"> <data name="SplitContainerControl1.TabIndex" type="System.Int32, mscorlib">
<value>2</value> <value>2</value>

View File

@ -117,7 +117,7 @@ Public Class frmDocumentResultList
Private Function GetOperationMode() As OperationMode Private Function GetOperationMode() As OperationMode
Dim oOperationMode As OperationMode Dim oOperationMode As OperationMode
If Environment.Service.IsActive AndAlso Environment.Service.Address <> String.Empty Then If Environment.Service.Client.IsOnline AndAlso Environment.Service.Address <> String.Empty Then
oOperationMode = OperationMode.WithAppServer oOperationMode = OperationMode.WithAppServer
Else Else
oOperationMode = OperationMode.NoAppServer oOperationMode = OperationMode.NoAppServer
@ -205,6 +205,8 @@ Public Class frmDocumentResultList
panelContainerStatus.Visibility = Docking.DockVisibility.Hidden panelContainerStatus.Visibility = Docking.DockVisibility.Hidden
End If End If
' Hide the complete Navigation Ribbon Group if desired ' Hide the complete Navigation Ribbon Group if desired
RibbonPageGroup_Navigation.Visible = Params.ShowBackNavigation RibbonPageGroup_Navigation.Visible = Params.ShowBackNavigation
@ -217,6 +219,15 @@ Public Class frmDocumentResultList
chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible() chkGridShowGrouping.Checked = LayoutManager.GetGroupPanelVisible()
chkGridShowTitle.Checked = LayoutManager.GetBandTitleVisible() chkGridShowTitle.Checked = LayoutManager.GetBandTitleVisible()
' This needs to done be after loading the grid
' so we can set the row handle and start loading the (only) file
If Params.ShowFileList = False Then
DockPanelFileList.HideImmediately()
GridView1.FocusedRowHandle = 0
Else
DockPanelFileList.Show()
End If
Catch ex As Exception Catch ex As Exception
ErrorHandler.ShowErrorMessage(ex, "Form Load", "Error while loading results") ErrorHandler.ShowErrorMessage(ex, "Form Load", "Error while loading results")
@ -449,9 +460,9 @@ Public Class frmDocumentResultList
#End Region #End Region
Private Function InitAppServer() As Boolean Private Function InitAppServer() As Boolean
Dim oSplit As List(Of String) = Environment.Service.Address.Split(":").ToList() Dim oServerAddress = Client.ParseServiceAddress(Environment.Service.Client.ServerAddress)
Dim oAddress As String = oSplit.Item(0) Dim oAddress As String = oServerAddress.Item1
Dim oPort As Integer = oSplit.Item(1) Dim oPort As Integer = oServerAddress.Item2
Client = New Client(LogConfig, oAddress, oPort) Client = New Client(LogConfig, oAddress, oPort)
ControlManager = New AttributeControls(LogConfig, Environment, Client) ControlManager = New AttributeControls(LogConfig, Environment, Client)
@ -1113,4 +1124,8 @@ Public Class frmDocumentResultList
GridBuilder.WithFontSizeDelta(Config.Config.GridFontSizeDelta) GridBuilder.WithFontSizeDelta(Config.Config.GridFontSizeDelta)
End Sub End Sub
Private Sub RibbonControl_Click(sender As Object, e As EventArgs) Handles RibbonControl.Click
End Sub
End Class End Class

View File

@ -13,7 +13,7 @@ Public Class Form1
Try Try
_LogConfig = New LogConfig(LogConfig.PathType.Temp, Nothing, "EDMIBenchmark") _LogConfig = New LogConfig(LogConfig.PathType.Temp, Nothing, "EDMIBenchmark")
_Logger = _LogConfig.GetLogger() _Logger = _LogConfig.GetLogger()
_Client = New Client(_LogConfig, "172.24.12.39", 9000) _Client = New Client(_LogConfig, "172.24.12.39:9000")
_Client.Connect() _Client.Connect()
DocumentViewer1.Init(_LogConfig, "21182889975216572111813147150675976632") DocumentViewer1.Init(_LogConfig, "21182889975216572111813147150675976632")

View File

@ -23,7 +23,7 @@ Partial Class frmSQLDesigner
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSQLDesigner)) Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmSQLDesigner))
Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
Me.Label14 = New System.Windows.Forms.Label() Me.Label14 = New System.Windows.Forms.Label()
Me.cmbConnection = New System.Windows.Forms.ComboBox() Me.cmbConnection = New System.Windows.Forms.ComboBox()
Me.Label2 = New System.Windows.Forms.Label() Me.Label2 = New System.Windows.Forms.Label()
@ -211,8 +211,8 @@ Partial Class frmSQLDesigner
' '
Me.dgvPlaceholders.AllowUserToAddRows = False Me.dgvPlaceholders.AllowUserToAddRows = False
Me.dgvPlaceholders.AllowUserToDeleteRows = False Me.dgvPlaceholders.AllowUserToDeleteRows = False
DataGridViewCellStyle4.BackColor = System.Drawing.Color.Cyan DataGridViewCellStyle1.BackColor = System.Drawing.Color.Cyan
Me.dgvPlaceholders.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4 Me.dgvPlaceholders.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1
Me.dgvPlaceholders.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize Me.dgvPlaceholders.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgvPlaceholders.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colPlaceholder, Me.colReplace}) Me.dgvPlaceholders.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.colPlaceholder, Me.colReplace})
Me.dgvPlaceholders.Enabled = False Me.dgvPlaceholders.Enabled = False
@ -280,7 +280,7 @@ Partial Class frmSQLDesigner
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemComboBox1, Me.RepositoryItemLookUpEdit1, Me.RepositoryItemLookUpEdit2, Me.RepositoryItemLookUpEdit3}) Me.RibbonControl1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemComboBox1, Me.RepositoryItemLookUpEdit1, Me.RepositoryItemLookUpEdit2, Me.RepositoryItemLookUpEdit3})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False] Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.Size = New System.Drawing.Size(995, 158) Me.RibbonControl1.Size = New System.Drawing.Size(997, 158)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
' '
'BarButtonItem1 'BarButtonItem1
@ -365,10 +365,10 @@ Partial Class frmSQLDesigner
'RibbonStatusBar1 'RibbonStatusBar1
' '
Me.RibbonStatusBar1.ItemLinks.Add(Me.bsiInfo) Me.RibbonStatusBar1.ItemLinks.Add(Me.bsiInfo)
Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 564) Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 588)
Me.RibbonStatusBar1.Name = "RibbonStatusBar1" Me.RibbonStatusBar1.Name = "RibbonStatusBar1"
Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1
Me.RibbonStatusBar1.Size = New System.Drawing.Size(995, 24) Me.RibbonStatusBar1.Size = New System.Drawing.Size(997, 24)
' '
'RibbonPage2 'RibbonPage2
' '
@ -385,7 +385,7 @@ Partial Class frmSQLDesigner
Me.GridControl1.MainView = Me.GridView1 Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.MenuManager = Me.RibbonControl1 Me.GridControl1.MenuManager = Me.RibbonControl1
Me.GridControl1.Name = "GridControl1" Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(691, 133) Me.GridControl1.Size = New System.Drawing.Size(693, 157)
Me.GridControl1.TabIndex = 124 Me.GridControl1.TabIndex = 124
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1}) Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
' '
@ -399,7 +399,7 @@ Partial Class frmSQLDesigner
Me.Appearance.Options.UseFont = True Me.Appearance.Options.UseFont = True
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 17.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(995, 588) Me.ClientSize = New System.Drawing.Size(997, 612)
Me.Controls.Add(Me.GridControl1) Me.Controls.Add(Me.GridControl1)
Me.Controls.Add(Me.lblAttributeAuto) Me.Controls.Add(Me.lblAttributeAuto)
Me.Controls.Add(Me.btnAddAttributeAuto) Me.Controls.Add(Me.btnAddAttributeAuto)

View File

@ -52,9 +52,7 @@ Namespace My
My.Application.Service.Client = New Client(LogConfig, oAppServerAddress, oAppServerPort) My.Application.Service.Client = New Client(LogConfig, oAppServerAddress, oAppServerPort)
If Not IsNothing(My.Application.Service.Client) Then If Not IsNothing(My.Application.Service.Client) Then
If My.Application.Service.Client.Connect() Then My.Application.Service.Client.Connect()
My.Application.Service.IsActive = True
End If
End If End If
Catch ex As Exception Catch ex As Exception
_Logger.Warn($"Could not initialize the AppServer: {ex.Message}") _Logger.Warn($"Could not initialize the AppServer: {ex.Message}")

View File

@ -119,15 +119,13 @@ Public Class ClassInit
End If End If
End If End If
MyApplication.Service.Address = My.SystemConfig.AppServerConfig ' These Properties need to be set directly on
Dim oServerData = Client.ParseServiceAddress(My.SystemConfig.AppServerConfig)
My.Application.Service.Client = New Client(LogConfig, oServerData.Item1, oServerData.Item2) My.Application.Service.Address = My.SystemConfig.AppServerConfig
My.Application.Service.Client = New Client(LogConfig, My.SystemConfig.AppServerConfig)
If Not IsNothing(My.Application.Service.Client) Then If Not IsNothing(My.Application.Service.Client) Then
If My.Application.Service.Client.Connect() Then My.Application.Service.Client.Connect()
MyApplication.Service.IsActive = True
End If
End If End If
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)

View File

@ -8,8 +8,6 @@ Public Class SearchRunner
Private Const SEARCH_FACT_DATE_DEFAULT As String = "ADDED_WHEN" Private Const SEARCH_FACT_DATE_DEFAULT As String = "ADDED_WHEN"
Private Environment As Environment
Private Const CREATED_TOMORROW As String = "TOMORROW" Private Const CREATED_TOMORROW As String = "TOMORROW"
Private Const CREATED_TODAY As String = "ECM_CREATED_TODAY" Private Const CREATED_TODAY As String = "ECM_CREATED_TODAY"
Private Const CREATED_YESTERDAY As String = "ECM_CREATED_YESTERDAY" Private Const CREATED_YESTERDAY As String = "ECM_CREATED_YESTERDAY"
@ -49,18 +47,30 @@ Public Class SearchRunner
Public Property BaseSearchSQL As String Public Property BaseSearchSQL As String
Public Property ExplicitDate As Boolean = False Public Property ExplicitDate As Boolean = False
Public Sub New(pLogConfig As LogConfig, pEnvironment As Environment) Private Environment As Environment
Private SearchTitle As String
Public Sub New(pLogConfig As LogConfig, pEnvironment As Environment, pSearchTitle As String)
MyBase.New(pLogConfig) MyBase.New(pLogConfig)
Environment = pEnvironment Environment = pEnvironment
SearchTitle = pSearchTitle
End Sub End Sub
Public Async Function Run(pSearchTerm As String) As Threading.Tasks.Task(Of SearchResult)
Return Await Run(pSearchTerm, Nothing, Nothing)
End Function
Public Async Function Run(pSearchTerm As String, pDateFrom As Date, pDateTo As Date) As Threading.Tasks.Task(Of SearchResult) Public Async Function Run(pSearchTerm As String, pDateFrom As Date, pDateTo As Date) As Threading.Tasks.Task(Of SearchResult)
If pDateFrom.Equals(Date.MinValue) = False Then
ExplicitDate = True
End If
Dim oSearchTerm = pSearchTerm Dim oSearchTerm = pSearchTerm
Dim oParams = New DocumentResultList.Params() With { Dim oParams = New DocumentResultList.Params() With {
.WindowGuid = "FlowSearch", .WindowGuid = SearchTitle,
.WindowTitle = GetResultWindowString(oSearchTerm), .WindowTitle = GetResultWindowString(oSearchTerm),
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow, .OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow,
.ProfileGuid = 354522, .ProfileGuid = 35452,
.ColumnNames = New DocumentResultList.ColumnNames With { .ColumnNames = New DocumentResultList.ColumnNames With {
.ObjectIdColumn = "DocID" .ObjectIdColumn = "DocID"
}, },
@ -88,9 +98,14 @@ Public Class SearchRunner
Dim oDTDocResult = Await My.Database.GetDatatableIDBAsync(BaseSearchSQL) Dim oDTDocResult = Await My.Database.GetDatatableIDBAsync(BaseSearchSQL)
If oDTDocResult.Rows.Count > 0 Then If oDTDocResult.Rows.Count > 0 Then
oParams.Results.Add(New DocumentResultList.DocumentResult() With { oParams.Results.Add(New DocumentResultList.DocumentResult() With {
.Title = "FlowSearchXYZ", .Title = SearchTitle,
.Datatable = oDTDocResult .Datatable = oDTDocResult
}) })
If oDTDocResult.Rows.Count = 1 Then
oParams.ShowFileList = False
End If
Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams) Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams)
' TODO: Implement, not needed right now ' TODO: Implement, not needed right now

View File

@ -117,7 +117,7 @@ Public Class frmFlowSearch1
Private Sub frmFlowSearch1_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmFlowSearch1_Load(sender As Object, e As EventArgs) Handles Me.Load
Logger = My.LogConfig.GetLogger() Logger = My.LogConfig.GetLogger()
SearchRunner = New SearchRunner(My.LogConfig, My.Application.GetEnvironment) SearchRunner = New SearchRunner(My.LogConfig, My.Application.GetEnvironment, "FlowSearch")
Try Try
If My.Application.User.Language = "de-DE" Then If My.Application.User.Language = "de-DE" Then

View File

@ -13,7 +13,7 @@ Public Class frmFlowSearch2
End If End If
Next Next
SearchRunner = New SearchRunner(My.LogConfig, My.Application.GetEnvironment) SearchRunner = New SearchRunner(My.LogConfig, My.Application.GetEnvironment, "FlowSearch")
SearchRunner.BaseSearchSQL = BaseSearchSQL SearchRunner.BaseSearchSQL = BaseSearchSQL
Dim osql = $"EXEC PRIDB_SEARCH_AUTOSUGGEST '{My.Application.User.Language}',{My.Application.User.UserId}" Dim osql = $"EXEC PRIDB_SEARCH_AUTOSUGGEST '{My.Application.User.Language}',{My.Application.User.UserId}"

View File

@ -670,6 +670,10 @@
<Project>{40384b94-1f94-4249-9a5a-d02e0b346738}</Project> <Project>{40384b94-1f94-4249-9a5a-d02e0b346738}</Project>
<Name>GlobalIndexer</Name> <Name>GlobalIndexer</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\MessageBoxEx\MessageBoxEx.vbproj">
<Project>{ef29f400-be45-4283-9d18-ca7acd9accc9}</Project>
<Name>MessageBoxEx</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Base\Base\Base.vbproj"> <ProjectReference Include="..\Modules.Base\Base\Base.vbproj">
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project> <Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
<Name>Base</Name> <Name>Base</Name>

View File

@ -19,6 +19,7 @@ Imports DigitalData.Modules.Language
Imports DevExpress.LookAndFeel Imports DevExpress.LookAndFeel
Imports System.Threading.Tasks Imports System.Threading.Tasks
Imports System.Threading Imports System.Threading
Imports DigitalData.Controls.MessageBoxEx
Public Class frmFlowForm Public Class frmFlowForm
#Region "Sidebar DllImport" #Region "Sidebar DllImport"
@ -488,8 +489,11 @@ Public Class frmFlowForm
End Sub End Sub
Sub ExitZooflow() Sub ExitZooflow()
Dim oResult As DialogResult = MessageBox.Show("Are you sure you want to close ZooFlow?", "Exit Zooflow", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Dim oMsgBox As New MsgBoxEx("Are you sure you want to close ZooFlow?", "Exit Zooflow", MessageBoxIcon.Question)
If oResult = DialogResult.Yes Then oMsgBox.SetButtons("Yes", "No")
oMsgBox.ShowDialog()
If oMsgBox.Result = MsgBoxEx.DialogBoxResult.Button1 Then
Close() Close()
Else Else
ESCHitCount = 0 ESCHitCount = 0
@ -1153,6 +1157,12 @@ Public Class frmFlowForm
.Title = GetResultWindowString(pSearchText), .Title = GetResultWindowString(pSearchText),
.Datatable = oDTDocResult .Datatable = oDTDocResult
}) })
' disable file list if we have only one document
If oDTDocResult.Rows.Count = 1 Then
oParams.ShowFileList = False
End If
Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams) Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams)
oForm.Show() oForm.Show()
oForm.BringToFront() oForm.BringToFront()
@ -1272,5 +1282,9 @@ Public Class frmFlowForm
Dim oForm = New frmFlowSearch2() Dim oForm = New frmFlowSearch2()
oForm.Show() oForm.Show()
End Sub End Sub
Private Sub PictureEditQuicksearch1_EditValueChanged(sender As Object, e As EventArgs) Handles PictureEditQuicksearch1.EditValueChanged
End Sub
End Class End Class

View File

@ -20,7 +20,7 @@ Public Class frmServiceConfig
txtServicePort.Text = oAddress.Item2 txtServicePort.Text = oAddress.Item2
End If End If
If My.Application.Service.IsActive Then If My.Application.Service.Client.IsOnline Then
txtStatus.Text = STATUS_CONNECTED txtStatus.Text = STATUS_CONNECTED
End If End If

View File

@ -75,7 +75,7 @@ Partial Class MsgBoxEx
Me.messageLbl.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.messageLbl.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.messageLbl.Location = New System.Drawing.Point(58, 10) Me.messageLbl.Location = New System.Drawing.Point(58, 10)
Me.messageLbl.Name = "messageLbl" Me.messageLbl.Name = "messageLbl"
Me.messageLbl.Size = New System.Drawing.Size(415, 75) Me.messageLbl.Size = New System.Drawing.Size(415, 63)
Me.messageLbl.TabIndex = 19 Me.messageLbl.TabIndex = 19
Me.messageLbl.Text = "[Message]" Me.messageLbl.Text = "[Message]"
' '

View File

@ -1,21 +1,22 @@
Public Class MsgBoxEx Public Class MsgBoxEx
Public Sub New(ByVal message As String, ByVal title As String) Public Sub New(message As String, title As String)
Me.New(message, title, MessageBoxIcon.None) Me.New(message, title, MessageBoxIcon.None)
End Sub End Sub
Public Sub New(ByVal message As String, ByVal title As String, ByVal icon As MessageBoxIcon) Public Sub New(message As String, title As String, icon As MessageBoxIcon)
Me.New(message, title, getMessageBoxIcon(icon)) Me.New(message, title, getMessageBoxIcon(icon))
End Sub End Sub
Public Sub New(ByVal message As String, ByVal title As String, ByVal icon As Icon) Public Sub New(message As String, title As String, icon As Icon)
InitializeComponent() InitializeComponent()
Me.messageLbl.Text = message messageLbl.Text = message
Me.Text = title Text = title
Me.m_sysIcon = icon m_sysIcon = icon
If Me.m_sysIcon Is Nothing Then Me.messageLbl.Location = New System.Drawing.Point(FORM_X_MARGIN, FORM_Y_MARGIN) If m_sysIcon Is Nothing Then messageLbl.Location = New System.Drawing.Point(FORM_X_MARGIN, FORM_Y_MARGIN)
SetButtons("OK")
End Sub End Sub
Private Shared Function getMessageBoxIcon(ByVal icon As MessageBoxIcon) As Icon Private Shared Function getMessageBoxIcon(icon As MessageBoxIcon) As Icon
Dim oIcon As Icon = Nothing Dim oIcon As Icon = Nothing
Select Case icon Select Case icon
@ -39,7 +40,7 @@
Private m_minWidth As Integer Private m_minWidth As Integer
Private m_minHeight As Integer Private m_minHeight As Integer
Public Sub SetMinSize(ByVal width As Integer, ByVal height As Integer) Public Sub SetMinSize(width As Integer, height As Integer)
m_minWidth = width m_minWidth = width
m_minHeight = height m_minHeight = height
End Sub End Sub
@ -51,18 +52,18 @@
drs(i) = DialogResult.None drs(i) = DialogResult.None
Next Next
Me.SetButtons(names, drs) SetButtons(names, drs)
End Sub End Sub
Public Sub SetButtons(ByVal names As String(), ByVal results As DialogResult()) Public Sub SetButtons(names As String(), results As DialogResult())
Me.SetButtons(names, results, 1) SetButtons(names, results, 1)
End Sub End Sub
Public Sub SetButtons(ByVal names As String(), ByVal results As DialogResult(), ByVal def As Integer) Public Sub SetButtons(names As String(), results As DialogResult(), def As Integer)
If names Is Nothing Then Throw New ArgumentNullException("btnText", "Button Text is null") If names Is Nothing Then Throw New ArgumentNullException("btnText", "Button Text is null")
Dim count As Integer = names.Length Dim count As Integer = names.Length
If count < 1 OrElse count > 3 Then Throw New ArgumentException("Invalid number of buttons. Must be between 1 and 3.") If count < 1 OrElse count > 3 Then Throw New ArgumentException("Invalid number of buttons. Must be between 1 and 3.")
m_minButtonRowWidth += setButtonParams(btn1, names(0), If(def = 1, 1, 2), results(0)) m_minButtonRowWidth = setButtonParams(btn1, names(0), If(def = 1, 1, 2), results(0))
If count > 1 Then If count > 1 Then
m_minButtonRowWidth += setButtonParams(btn2, names(1), If(def = 2, 1, 3), results(1)) + BUTTON_SPACE m_minButtonRowWidth += setButtonParams(btn2, names(1), If(def = 2, 1, 3), results(1)) + BUTTON_SPACE
@ -75,7 +76,7 @@
Private m_minButtonRowWidth As Integer Private m_minButtonRowWidth As Integer
Private Shared Function setButtonParams(ByVal btn As Button, ByVal text As String, ByVal tab As Integer, ByVal dr As DialogResult) As Integer Private Shared Function setButtonParams(btn As Button, text As String, tab As Integer, dr As DialogResult) As Integer
btn.Text = text btn.Text = text
btn.Visible = True btn.Visible = True
btn.DialogResult = dr btn.DialogResult = dr
@ -83,22 +84,22 @@
Return btn.Size.Width Return btn.Size.Width
End Function End Function
Public Sub SetCheckbox(ByVal text As String) Public Sub SetCheckbox(text As String)
Me.SetCheckbox(text, False) SetCheckbox(text, False)
End Sub End Sub
Public Sub SetCheckbox(ByVal text As String, ByVal chcked As Boolean) Public Sub SetCheckbox(text As String, chcked As Boolean)
Me.chkBx.Visible = True chkBx.Visible = True
Me.chkBx.Text = text chkBx.Text = text
Me.chkBx.Checked = chcked chkBx.Checked = chcked
Me.m_minButtonRowWidth += Me.chkBx.Size.Width + CHECKBOX_SPACE m_minButtonRowWidth += chkBx.Size.Width + CHECKBOX_SPACE
End Sub End Sub
Private Sub DialogBox_Load(ByVal sender As Object, ByVal e As EventArgs) Private Sub DialogBox_Load(sender As Object, e As EventArgs)
If Not btn1.Visible Then Me.SetButtons(New String() {"OK"}, New DialogResult() {DialogResult.OK}) If Not btn1.Visible Then SetButtons(New String() {"OK"}, New DialogResult() {DialogResult.OK})
m_minButtonRowWidth += 2 * FORM_X_MARGIN m_minButtonRowWidth += 2 * FORM_X_MARGIN
Me.setDialogSize() setDialogSize()
Me.setButtonRowLocations() setButtonRowLocations()
End Sub End Sub
Const FORM_Y_MARGIN As Integer = 10 Const FORM_Y_MARGIN As Integer = 10
@ -108,19 +109,19 @@
Const TEXT_Y_MARGIN As Integer = 30 Const TEXT_Y_MARGIN As Integer = 30
Private Sub setDialogSize() Private Sub setDialogSize()
Dim requiredWidth As Integer = Me.messageLbl.Location.X + Me.messageLbl.Size.Width + FORM_X_MARGIN Dim requiredWidth As Integer = messageLbl.Location.X + messageLbl.Size.Width + FORM_X_MARGIN
requiredWidth = If(requiredWidth > m_minButtonRowWidth, requiredWidth, m_minButtonRowWidth) requiredWidth = If(requiredWidth > m_minButtonRowWidth, requiredWidth, m_minButtonRowWidth)
Dim requiredHeight As Integer = Me.messageLbl.Location.Y + Me.messageLbl.Size.Height - Me.btn2.Location.Y + Me.ClientSize.Height + TEXT_Y_MARGIN Dim requiredHeight As Integer = messageLbl.Location.Y + messageLbl.Size.Height - btn2.Location.Y + ClientSize.Height + TEXT_Y_MARGIN
Dim minSetWidth As Integer = If(Me.ClientSize.Width > Me.m_minWidth, Me.ClientSize.Width, Me.m_minWidth) Dim minSetWidth As Integer = If(ClientSize.Width > m_minWidth, ClientSize.Width, m_minWidth)
Dim minSetHeight As Integer = If(Me.ClientSize.Height > Me.m_minHeight, Me.ClientSize.Height, Me.m_minHeight) Dim minSetHeight As Integer = If(ClientSize.Height > m_minHeight, ClientSize.Height, m_minHeight)
Dim s As Size = New Size() Dim s As Size = New Size()
s.Width = If(requiredWidth > minSetWidth, requiredWidth, minSetWidth) s.Width = If(requiredWidth > minSetWidth, requiredWidth, minSetWidth)
s.Height = If(requiredHeight > minSetHeight, requiredHeight, minSetHeight) s.Height = If(requiredHeight > minSetHeight, requiredHeight, minSetHeight)
Me.ClientSize = s ClientSize = s
End Sub End Sub
Private Sub setButtonRowLocations() Private Sub setButtonRowLocations()
Dim formWidth As Integer = Me.ClientRectangle.Width Dim formWidth As Integer = ClientRectangle.Width
Dim x As Integer = formWidth - FORM_X_MARGIN Dim x As Integer = formWidth - FORM_X_MARGIN
Dim y As Integer = btn1.Location.Y Dim y As Integer = btn1.Location.Y
@ -138,12 +139,12 @@
x -= btn1.Size.Width x -= btn1.Size.Width
btn1.Location = New Point(x, y) btn1.Location = New Point(x, y)
If Me.chkBx.Visible Then Me.chkBx.Location = New Point(FORM_X_MARGIN, Me.chkBx.Location.Y) If chkBx.Visible Then chkBx.Location = New Point(FORM_X_MARGIN, chkBx.Location.Y)
End Sub End Sub
Private m_sysIcon As Icon Private m_sysIcon As Icon
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs) Protected Overrides Sub OnPaint(e As PaintEventArgs)
If m_sysIcon IsNot Nothing Then If m_sysIcon IsNot Nothing Then
Dim g As Graphics = e.Graphics Dim g As Graphics = e.Graphics
g.DrawIconUnstretched(m_sysIcon, New Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height)) g.DrawIconUnstretched(m_sysIcon, New Rectangle(FORM_X_MARGIN, FORM_Y_MARGIN, m_sysIcon.Width, m_sysIcon.Height))
@ -154,7 +155,7 @@
Public ReadOnly Property CheckboxChecked As Boolean Public ReadOnly Property CheckboxChecked As Boolean
Get Get
Return Me.chkBx.Checked Return chkBx.Checked
End Get End Get
End Property End Property
@ -166,7 +167,7 @@
End Get End Get
End Property End Property
Private Sub btn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn1.Click, btn2.Click, btn3.Click Private Sub btn_Click(sender As Object, e As EventArgs) Handles btn1.Click, btn2.Click, btn3.Click
If sender.Equals(btn1) Then If sender.Equals(btn1) Then
m_result = DialogBoxResult.Button1 m_result = DialogBoxResult.Button1
ElseIf sender.Equals(btn2) Then ElseIf sender.Equals(btn2) Then

View File

@ -15,22 +15,24 @@ Public Class Client
' Helper Classes ' Helper Classes
Private ReadOnly LogConfig As LogConfig Private ReadOnly LogConfig As LogConfig
Private ReadOnly Logger As Logger Private ReadOnly Logger As Logger
Private ReadOnly FileEx As Filesystem.File Private ReadOnly ChannelManager As Channel
' Runtime Variables ' Runtime Variables
Private ReadOnly ServerAddress As String Private _ServerAddress As ServerAddressStruct
Private ReadOnly ServerPort As Integer
Private _ClientConfig As GlobalStateClientConfiguration Private _ClientConfig As GlobalStateClientConfiguration
Private _CachedTables As New List(Of String)
' Channel Private _IsOnline As Boolean
Private ReadOnly ChannelFactory As ChannelFactory(Of IEDMIServiceChannel) Private _Channel As IEDMIServiceChannel
Private Channel As IEDMIServiceChannel
' Update Timer ' Update Timer
Private WithEvents UpdateTimer As New Timers.Timer Private WithEvents UpdateTimer As New Timers.Timer
' Public Variables ' Public Variables
Public CachedTables As New List(Of String) Public ReadOnly Property CachedTables
Get
Return _CachedTables
End Get
End Property
Public ReadOnly Property ClientConfig As GlobalStateClientConfiguration Public ReadOnly Property ClientConfig As GlobalStateClientConfiguration
Get Get
@ -42,24 +44,27 @@ Public Class Client
End Get End Get
End Property End Property
Public ReadOnly Property IsOnline As Boolean
Get
Return _IsOnline
End Get
End Property
Public ReadOnly Property ServerAddress As String
Get
Return $"{_ServerAddress.Host}:{_ServerAddress.Port}"
End Get
End Property
''' <summary> ''' <summary>
''' Parse a IPAddress:Port String into its parts ''' Parse a IPAddress:Port String into its parts
''' </summary> ''' </summary>
''' <param name="AddressWithOptionalPort"></param> ''' <param name="AddressWithOptionalPort">A Server Address, for example: 192.168.1.50, 192.168.1.50:9000, 192.168.1.50;9000</param>
Public Shared Function ParseServiceAddress(AddressWithOptionalPort As String) As Tuple(Of String, Integer) Public Shared Function ParseServiceAddress(AddressWithOptionalPort As String) As Tuple(Of String, Integer)
Dim oSplit() As String = AddressWithOptionalPort.Split(":"c) Dim oConnection As New Connection()
Dim oAppServerAddress As String = oSplit(0) Dim oAddress As ServerAddressStruct = oConnection.ParseServiceAddress(AddressWithOptionalPort)
Dim oAppServerPort As Integer
If oSplit.Length = 2 Then Return New Tuple(Of String, Integer)(oAddress.Host, oAddress.Port)
If Integer.TryParse(oSplit(1), oAppServerPort) Then
oAppServerPort = DEFAULT_SERVICE_PORT
End If
Else
oAppServerPort = DEFAULT_SERVICE_PORT
End If
Return New Tuple(Of String, Integer)(oAppServerAddress, oAppServerPort)
End Function End Function
''' <summary> ''' <summary>
@ -70,25 +75,18 @@ Public Class Client
Public Sub New(pLogConfig As LogConfig, pServiceAdress As String) Public Sub New(pLogConfig As LogConfig, pServiceAdress As String)
LogConfig = pLogConfig LogConfig = pLogConfig
Logger = pLogConfig.GetLogger() Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(pLogConfig)
Dim oServiceAddress As String = pServiceAdress
Dim oAddressArray() As String
If oServiceAddress.Contains(";") Then
oAddressArray = oServiceAddress.Split(";")
Else
oAddressArray = oServiceAddress.Split(":")
End If
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
UpdateTimer.Start() UpdateTimer.Start()
Try Try
ServerAddress = oAddressArray(0) Dim oConnection = New Connection()
ServerPort = oAddressArray(1) _ServerAddress = oConnection.ParseServiceAddress(pServiceAdress)
Logger.Debug("Connecting to Service at: [{0}]", ServerAddress) ChannelManager = New Channel(pLogConfig, _ServerAddress)
ChannelFactory = GetChannelFactory(ServerAddress, ServerPort) AddHandler ChannelManager.Reconnect, AddressOf Reconnect
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
End Try End Try
@ -97,60 +95,60 @@ Public Class Client
''' <summary> ''' <summary>
''' Creates a new EDMI Client object ''' Creates a new EDMI Client object
''' </summary> ''' </summary>
''' <param name="LogConfig">LogConfig object</param> ''' <param name="pLogConfig">LogConfig object</param>
''' <param name="IPAddress">The IP address to connect to</param> ''' <param name="pIPAddress">The IP address to connect to</param>
''' <param name="PortNumber">The Port number to use for the connection</param> ''' <param name="pPortNumber">The Port number to use for the connection</param>
Public Sub New(LogConfig As LogConfig, IPAddress As String, PortNumber As Integer) Public Sub New(pLogConfig As LogConfig, pIPAddress As String, pPortNumber As Integer)
Me.LogConfig = LogConfig LogConfig = pLogConfig
Logger = LogConfig.GetLogger() Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(LogConfig)
UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES UpdateTimer.Interval = 60 * 1000 * UPDATE_INTERVAL_IN_MINUTES
UpdateTimer.Start() UpdateTimer.Start()
Try Try
Logger.Debug("Connecting to Service at: [{0}]", IPAddress) Dim oConnection = New Connection()
ChannelFactory = GetChannelFactory(IPAddress, PortNumber) _ServerAddress = oConnection.ParseServiceAddress(pIPAddress, pPortNumber)
ChannelManager = New Channel(pLogConfig, _ServerAddress)
AddHandler ChannelManager.Reconnect, AddressOf Reconnect
Logger.Debug("Ready for connection to Service at: [{0}:{1}]", _ServerAddress.Host, _ServerAddress.Port)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
End Try End Try
End Sub End Sub
Private Function GetChannelFactory(pIPAddress As String, pPortNumber As Integer) As ChannelFactory(Of IEDMIServiceChannel)
Dim oBinding = API.Channel.GetBinding()
Dim oAddress = New EndpointAddress($"net.tcp://{pIPAddress}:{pPortNumber}/DigitalData/Services/Main")
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
Return oFactory
End Function
''' <summary> ''' <summary>
''' Connect to the service ''' Connect to the service
''' </summary> ''' </summary>
''' <returns>True if connection was successful, false otherwise</returns> ''' <returns>True if connection was successful, false otherwise</returns>
Public Function Connect() As Boolean Public Function Connect() As Boolean
Try Try
Channel = GetChannel() _Channel = ChannelManager.GetChannel()
Logger.Debug("Opening channel..") Logger.Debug("Opening channel..")
Channel.Open() _Channel.Open()
Dim oResponse = Channel.GetClientConfig() Dim oResponse = _Channel.GetClientConfig()
If oResponse.OK Then If oResponse.OK Then
_ClientConfig = oResponse.ClientConfig _ClientConfig = oResponse.ClientConfig
Else Else
Logger.Warn("Client Configuration could not be loaded: [{0}]", oResponse.ErrorMessage) Logger.Warn("Client Configuration could not be loaded: [{0}]", oResponse.ErrorMessage)
End If End If
Logger.Info($"Connection to AppService {ServerAddress} successfully established!") Logger.Info($"Connection to AppService [{ServerAddress}] successfully established!")
_IsOnline = True
Return True Return True
Catch ex As Exception Catch ex As Exception
_IsOnline = False
Logger.Error(ex) Logger.Error(ex)
Return False Return False
End Try End Try
End Function End Function
''' <summary> ''' <summary>
''' Aborts the channel and creates a new connection ''' Aborts the channel and creates a new connection
''' </summary> ''' </summary>
@ -158,9 +156,11 @@ Public Class Client
Logger.Warn("Connection faulted. Trying to reconnect..") Logger.Warn("Connection faulted. Trying to reconnect..")
Try Try
Channel.Abort() _Channel.Abort()
Channel = GetChannel() _Channel = ChannelManager.GetChannel()
Channel.Open() _Channel.Open()
_IsOnline = True
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
End Try End Try
@ -168,14 +168,14 @@ Public Class Client
Private Async Function UpdateTimer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) As Task Handles UpdateTimer.Elapsed Private Async Function UpdateTimer_Elapsed(sender As Object, e As Timers.ElapsedEventArgs) As Task Handles UpdateTimer.Elapsed
Try Try
Dim oTables As String() = Await Channel.GetCachedTablesAsync() Dim oTables As String() = Await _Channel.GetCachedTablesAsync()
CachedTables = oTables. _CachedTables = oTables.
Select(Function(table) table.ToUpper). Select(Function(table) table.ToUpper).
ToList() ToList()
Catch ex As Exception Catch ex As Exception
Logger.Warn("Update of CachedTable was not successful!") Logger.Warn("Update of CachedTable was not successful!")
Logger.Error(ex) Logger.Error(ex)
CachedTables = New List(Of String) _CachedTables = New List(Of String)
End Try End Try
End Function End Function
@ -190,7 +190,7 @@ Public Class Client
''' <returns>The ObjectId of the newly generated filesystem object</returns> ''' <returns>The ObjectId of the newly generated filesystem object</returns>
Public Async Function NewFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pIDBDoctypeId As Long, Optional pImportOptions As Options.NewFileOptions = Nothing) As Task(Of Long) Public Async Function NewFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pIDBDoctypeId As Long, Optional pImportOptions As Options.NewFileOptions = Nothing) As Task(Of Long)
Try Try
Dim oNewFile As New Modules.IDB.NewFile(LogConfig, Channel) Dim oNewFile As New Modules.IDB.NewFile(LogConfig, _Channel)
Return Await oNewFile.RunAsync(pFilePath, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions) Return Await oNewFile.RunAsync(pFilePath, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
Catch ex As Exception Catch ex As Exception
@ -202,7 +202,7 @@ Public Class Client
Public Async Function UpdateFileAsync(pObjectId As Long, pFilePath As String, Optional pImportOptions As Options.UpdateFileOptions = Nothing) As Task(Of Long) Public Async Function UpdateFileAsync(pObjectId As Long, pFilePath As String, Optional pImportOptions As Options.UpdateFileOptions = Nothing) As Task(Of Long)
Try Try
Dim oUpdateFile As New Modules.IDB.UpdateFile(LogConfig, Channel) Dim oUpdateFile As New Modules.IDB.UpdateFile(LogConfig, _Channel)
Return Await oUpdateFile.RunAsync(pFilePath, pObjectId, pImportOptions) Return Await oUpdateFile.RunAsync(pFilePath, pObjectId, pImportOptions)
Catch ex As Exception Catch ex As Exception
@ -214,7 +214,7 @@ Public Class Client
Public Async Function SetObjectStateAsync(pObjectId As Long, pState As String, Optional pOptions As Options.SetObjectStateOptions = Nothing) As Task(Of Boolean) Public Async Function SetObjectStateAsync(pObjectId As Long, pState As String, Optional pOptions As Options.SetObjectStateOptions = Nothing) As Task(Of Boolean)
Try Try
Dim oSetObjectState As New Modules.IDB.SetObjectState(LogConfig, Channel) Dim oSetObjectState As New Modules.IDB.SetObjectState(LogConfig, _Channel)
Return Await oSetObjectState.RunAsync(pObjectId, pState, pOptions) Return Await oSetObjectState.RunAsync(pObjectId, pState, pOptions)
Catch ex As Exception Catch ex As Exception
@ -226,7 +226,7 @@ Public Class Client
Public Async Function SetAttributeValueAsync(pObjectId As Long, pName As String, pValue As Object, Optional pOptions As Options.SetAttributeValueOptions = Nothing) As Task(Of Boolean) Public Async Function SetAttributeValueAsync(pObjectId As Long, pName As String, pValue As Object, Optional pOptions As Options.SetAttributeValueOptions = Nothing) As Task(Of Boolean)
Try Try
Dim oSetAttributeValue As New Modules.IDB.SetAttributeValue(LogConfig, Channel) Dim oSetAttributeValue As New Modules.IDB.SetAttributeValue(LogConfig, _Channel)
Return Await oSetAttributeValue.RunAsync(pObjectId, pName, pValue, pOptions) Return Await oSetAttributeValue.RunAsync(pObjectId, pName, pValue, pOptions)
Catch ex As Exception Catch ex As Exception
@ -238,7 +238,7 @@ Public Class Client
Public Async Function CheckOutFile(pObjectId As Long, pComment As String, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long) Public Async Function CheckOutFile(pObjectId As Long, pComment As String, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try Try
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel) Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, _Channel)
Return Await oCheckOutFile.RunAsync(pObjectId, pComment, pOptions) Return Await oCheckOutFile.RunAsync(pObjectId, pComment, pOptions)
Catch ex As Exception Catch ex As Exception
@ -250,7 +250,7 @@ Public Class Client
Public Async Function CheckOutFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long) Public Async Function CheckOutFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try Try
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel) Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, _Channel)
Return Await oCheckOutFile.RunAsync(pObjectId, String.Empty, pOptions) Return Await oCheckOutFile.RunAsync(pObjectId, String.Empty, pOptions)
Catch ex As Exception Catch ex As Exception
@ -262,7 +262,7 @@ Public Class Client
Public Async Function CheckInFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long) Public Async Function CheckInFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try Try
Dim oCheckInFile As New Modules.IDB.CheckInFile(LogConfig, Channel) Dim oCheckInFile As New Modules.IDB.CheckInFile(LogConfig, _Channel)
Return Await oCheckInFile.RunAsync(pObjectId, pOptions) Return Await oCheckInFile.RunAsync(pObjectId, pOptions)
Catch ex As Exception Catch ex As Exception
@ -280,7 +280,7 @@ Public Class Client
pIDBDoctypeId As String, pIDBDoctypeId As String,
Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of ImportFileResponse) Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of ImportFileResponse)
Try Try
Dim oImportFile As New Modules.IDB.ImportFile(LogConfig, Channel) Dim oImportFile As New Modules.IDB.ImportFile(LogConfig, _Channel)
Return Await oImportFile.RunAsync(pFilePath, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions) Return Await oImportFile.RunAsync(pFilePath, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
Catch ex As Exception Catch ex As Exception
@ -290,7 +290,6 @@ Public Class Client
End Try End Try
End Function End Function
Public Async Function Globix_ImportFileAsync( Public Async Function Globix_ImportFileAsync(
pFilePath As String, pFilePath As String,
pProfileId As Integer, pProfileId As Integer,
@ -300,7 +299,7 @@ Public Class Client
pIDBDoctypeId As String, pIDBDoctypeId As String,
Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of Globix_ImportFileResponse) Optional pImportOptions As Options.ImportFileOptions = Nothing) As Task(Of Globix_ImportFileResponse)
Try Try
Dim oImportFile As New Modules.Globix.ImportFile(LogConfig, Channel) Dim oImportFile As New Modules.Globix.ImportFile(LogConfig, _Channel)
Return Await oImportFile.RunAsync(pFilePath, pProfileId, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions) Return Await oImportFile.RunAsync(pFilePath, pProfileId, pAttributeValues, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
Catch ex As Exception Catch ex As Exception
@ -312,7 +311,7 @@ Public Class Client
Public Function Zooflow_GetFileObject(pObjectId As Long, pLoadFileContents As Boolean) As FileObject Public Function Zooflow_GetFileObject(pObjectId As Long, pLoadFileContents As Boolean) As FileObject
Try Try
Dim oGetFileObject As New Modules.Zooflow.GetFileObject(LogConfig, Channel) Dim oGetFileObject As New Modules.Zooflow.GetFileObject(LogConfig, _Channel)
Dim oFileObject = oGetFileObject.Run(pObjectId, pLoadFileContents) Dim oFileObject = oGetFileObject.Run(pObjectId, pLoadFileContents)
Return oFileObject Return oFileObject
Catch ex As Exception Catch ex As Exception
@ -472,7 +471,7 @@ Public Class Client
.Language = pOptions.Language .Language = pOptions.Language
} }
} }
Dim oResponse = Channel.GetAttributeValue(oArgs) Dim oResponse = _Channel.GetAttributeValue(oArgs)
If oResponse.OK = False Then If oResponse.OK = False Then
Return New VariableValue() Return New VariableValue()
@ -536,7 +535,7 @@ Public Class Client
Dim oAttributes As New List(Of ObjectAttribute) Dim oAttributes As New List(Of ObjectAttribute)
Try Try
Dim oResult As TableResult = Channel.ReturnDatatable_MSSQL_IDB($"EXEC [PRIDB_GET_VALUE_DT] {pObjectId}, '{pLanguage}'") Dim oResult As TableResult = _Channel.ReturnDatatable_MSSQL_IDB($"EXEC [PRIDB_GET_VALUE_DT] {pObjectId}, '{pLanguage}'")
If oResult.OK = False Then If oResult.OK = False Then
Throw New ApplicationException(oResult.ErrorMessage) Throw New ApplicationException(oResult.ErrorMessage)
@ -577,7 +576,7 @@ Public Class Client
Dim oSql = $"DECLARE @NEW_OBJ_MD_ID BIGINT Dim oSql = $"DECLARE @NEW_OBJ_MD_ID BIGINT
EXEC PRIDB_NEW_OBJ_DATA({pObjectId}, '{pAttributeName}', '{oUsername}', '{pValue}', '{oLanguage}', 0, @OMD_ID = @NEW_OBJ_MD_ID OUTPUT)" EXEC PRIDB_NEW_OBJ_DATA({pObjectId}, '{pAttributeName}', '{oUsername}', '{pValue}', '{oLanguage}', 0, @OMD_ID = @NEW_OBJ_MD_ID OUTPUT)"
Dim oResult = Channel.ExecuteNonQuery_MSSQL_IDB(oSql) Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oSql)
If oResult.OK = False Then If oResult.OK = False Then
Logger.Warn("Error while deleting Term object") Logger.Warn("Error while deleting Term object")
@ -594,7 +593,7 @@ Public Class Client
Dim oIdIsForeign As Integer = 1 Dim oIdIsForeign As Integer = 1
Dim oDELSQL = $"EXEC PRIDB_DELETE_TERM_OBJECT_METADATA {pObjectId},'{pAttributeName}','{pTerm2Delete}','{oUsername}','{oLanguage}',{oIdIsForeign}" Dim oDELSQL = $"EXEC PRIDB_DELETE_TERM_OBJECT_METADATA {pObjectId},'{pAttributeName}','{pTerm2Delete}','{oUsername}','{oLanguage}',{oIdIsForeign}"
Dim oResult = Channel.ExecuteNonQuery_MSSQL_IDB(oDELSQL) Dim oResult = _Channel.ExecuteNonQuery_MSSQL_IDB(oDELSQL)
If oResult.OK = False Then If oResult.OK = False Then
Logger.Warn("Error while deleting Term object") Logger.Warn("Error while deleting Term object")
@ -611,7 +610,7 @@ Public Class Client
#Region "GetDatatable" #Region "GetDatatable"
Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse Public Function GetDatatableFromIDB(pSQL As String) As GetDatatableResponse
Try Try
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -624,7 +623,7 @@ Public Class Client
Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse Public Function GetDatatableFromECM(pSQL As String) As GetDatatableResponse
Try Try
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -637,7 +636,7 @@ Public Class Client
Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse Public Function GetDatatableFromConnection(pSQL As String, pConnectionId As Integer) As GetDatatableResponse
Try Try
Dim oResponse = Channel.ReturnDatatable(New GetDatatableRequest() With { Dim oResponse = _Channel.ReturnDatatable(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -651,7 +650,7 @@ Public Class Client
Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse) Public Async Function GetDatatableFromIDBAsync(pSQL As String) As Task(Of GetDatatableResponse)
Try Try
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -664,7 +663,7 @@ Public Class Client
Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse) Public Async Function GetDatatableFromECMAsync(pSQL As String) As Task(Of GetDatatableResponse)
Try Try
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -677,7 +676,7 @@ Public Class Client
Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse) Public Async Function GetDatatableFromConnectionAsync(pSQL As String, Optional pConnectionId As Integer = 0) As Task(Of GetDatatableResponse)
Try Try
Dim oResponse = Await Channel.ReturnDatatableAsync(New GetDatatableRequest() With { Dim oResponse = Await _Channel.ReturnDatatableAsync(New GetDatatableRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -693,7 +692,7 @@ Public Class Client
#Region "GetScalarValue" #Region "GetScalarValue"
Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse Public Function GetScalarValueFromIDB(pSQL As String) As GetScalarValueResponse
Try Try
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -706,7 +705,7 @@ Public Class Client
Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse Public Function GetScalarValueFromECM(pSQL As String) As GetScalarValueResponse
Try Try
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -719,7 +718,7 @@ Public Class Client
Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse Public Function GetScalarValueFromConnection(pSQL As String, pConnectionId As Integer) As GetScalarValueResponse
Try Try
Dim oResponse = Channel.ReturnScalarValue(New GetScalarValueRequest() With { Dim oResponse = _Channel.ReturnScalarValue(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -733,7 +732,7 @@ Public Class Client
Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse) Public Async Function GetScalarValueFromIDBAsync(pSQL As String) As Task(Of GetScalarValueResponse)
Try Try
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -746,7 +745,7 @@ Public Class Client
Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse) Public Async Function GetScalarValueFromECMAsync(pSQL As String) As Task(Of GetScalarValueResponse)
Try Try
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -759,7 +758,7 @@ Public Class Client
Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse) Public Async Function GetScalarValueFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of GetScalarValueResponse)
Try Try
Dim oResponse = Await Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With { Dim oResponse = Await _Channel.ReturnScalarValueAsync(New GetScalarValueRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -775,7 +774,7 @@ Public Class Client
#Region "ExecuteNonQuery" #Region "ExecuteNonQuery"
Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse Public Function ExecuteNonQueryFromIDB(pSQL As String) As ExecuteNonQueryResponse
Try Try
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -788,7 +787,7 @@ Public Class Client
Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse Public Function ExecuteNonQueryFromECM(pSQL As String) As ExecuteNonQueryResponse
Try Try
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -801,7 +800,7 @@ Public Class Client
Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse Public Function ExecuteNonQueryFromConnection(pSQL As String, pConnectionId As Integer) As ExecuteNonQueryResponse
Try Try
Dim oResponse = Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With { Dim oResponse = _Channel.ExecuteNonQuery(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -815,7 +814,7 @@ Public Class Client
Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse) Public Async Function ExecuteNonQueryFromIDBAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
Try Try
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.IDB .NamedDatabase = DatabaseName.IDB
}) })
@ -828,7 +827,7 @@ Public Class Client
Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse) Public Async Function ExecuteNonQueryFromECMAsync(pSQL As String) As Task(Of ExecuteNonQueryResponse)
Try Try
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.ECM .NamedDatabase = DatabaseName.ECM
}) })
@ -841,7 +840,7 @@ Public Class Client
Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse) Public Async Function ExecuteNonQueryFromConnectionAsync(pSQL As String, pConnectionId As Integer) As Task(Of ExecuteNonQueryResponse)
Try Try
Dim oResponse = Await Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With { Dim oResponse = Await _Channel.ExecuteNonQueryAsync(New ExecuteNonQueryRequest() With {
.SqlCommand = pSQL, .SqlCommand = pSQL,
.NamedDatabase = DatabaseName.None, .NamedDatabase = DatabaseName.None,
.ConnectionId = pConnectionId .ConnectionId = pConnectionId
@ -857,7 +856,7 @@ Public Class Client
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
Try Try
Dim oResponse = Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn) Dim oResponse = _Channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
Return oResponse Return oResponse
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
@ -867,7 +866,7 @@ Public Class Client
Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult) Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult)
Try Try
Dim oResponse = Await Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn) Dim oResponse = Await _Channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
Return oResponse Return oResponse
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
@ -885,7 +884,7 @@ Public Class Client
''' <returns></returns> ''' <returns></returns>
Public Function GetDocumentInfo(UserId As Long, ObjectId As Long) As DocumentInfo Public Function GetDocumentInfo(UserId As Long, ObjectId As Long) As DocumentInfo
Try Try
Dim oResponse As DocumentInfoResponse = Channel.GetFileInfoByObjectId(New DocumentInfoRequest With { Dim oResponse As DocumentInfoResponse = _Channel.GetFileInfoByObjectId(New DocumentInfoRequest With {
.ObjectId = ObjectId, .ObjectId = ObjectId,
.UserId = UserId .UserId = UserId
}) })
@ -916,7 +915,7 @@ Public Class Client
.ObjectId = ObjectId, .ObjectId = ObjectId,
.UserId = UserId .UserId = UserId
} }
Dim oResponse As DocumentInfoResponse = Await Channel.GetFileInfoByObjectIdAsync(oParams) Dim oResponse As DocumentInfoResponse = Await _Channel.GetFileInfoByObjectIdAsync(oParams)
Return New DocumentInfo With { Return New DocumentInfo With {
.AccessRight = oResponse.FileRight, .AccessRight = oResponse.FileRight,
@ -930,23 +929,7 @@ Public Class Client
#Region "Private Functions" #Region "Private Functions"
''' <summary>
''' Creates a channel and adds a Faulted-Handler
''' </summary>
''' <returns>A channel object</returns>
Private Function GetChannel() As IEDMIServiceChannel
Try
Logger.Debug("...Creating channel..")
Dim oChannel = ChannelFactory.CreateChannel()
AddHandler oChannel.Faulted, AddressOf Reconnect
Return oChannel
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Function
Private Function GetUserLanguage(pOverrideLanguage As String) As String Private Function GetUserLanguage(pOverrideLanguage As String) As String
Return NotNull(pOverrideLanguage, Threading.Thread.CurrentThread.CurrentUICulture.Name) Return NotNull(pOverrideLanguage, Threading.Thread.CurrentThread.CurrentUICulture.Name)

View File

@ -1,24 +1,21 @@
Imports System.ServiceModel Imports System.ServiceModel
Imports System.Xml Imports System.Xml
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Logging
Public Class Channel Public Class Channel
' Infos about MaxBufferSize and MaxBufferPoolSize Inherits BaseClass
' https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6e234d3-942f-4e9d-8470-32618d3f3212/maxbufferpoolsize-vs-maxbuffersize?forum=wcf
Public Const MAX_RECEIVED_MESSAGE_SIZE = 2147483647 ' 1GB Private ReadOnly ChannelFactory As ChannelFactory(Of IEDMIServiceChannel)
Public Const MAX_BUFFER_SIZE = 104857600 ' 100MB
Public Const MAX_BUFFER_POOL_SIZE = 1048576 ' 1MB
Public Const MAX_CONNECTIONS = 500 Public Event Reconnect As EventHandler
Public Const MAX_ARRAY_LENGTH = 2147483647
Public Const MAX_STRING_CONTENT_LENGTH = 2147483647
Public Shared Function GetBinding(Optional AuthenticationMode As TcpClientCredentialType = TcpClientCredentialType.Windows) As NetTcpBinding Public Shared Function GetBinding(Optional AuthenticationMode As TcpClientCredentialType = TcpClientCredentialType.Windows) As NetTcpBinding
Return New NetTcpBinding() With { Return New NetTcpBinding() With {
.MaxReceivedMessageSize = MAX_RECEIVED_MESSAGE_SIZE, .MaxReceivedMessageSize = Constants.ChannelSettings.MAX_RECEIVED_MESSAGE_SIZE,
.MaxBufferSize = MAX_BUFFER_SIZE, .MaxBufferSize = Constants.ChannelSettings.MAX_BUFFER_SIZE,
.MaxBufferPoolSize = MAX_BUFFER_POOL_SIZE, .MaxBufferPoolSize = Constants.ChannelSettings.MAX_BUFFER_POOL_SIZE,
.TransferMode = TransferMode.Streamed, .TransferMode = TransferMode.Streamed,
.Security = New NetTcpSecurity() With { .Security = New NetTcpSecurity() With {
.Mode = SecurityMode.Transport, .Mode = SecurityMode.Transport,
@ -27,11 +24,41 @@ Public Class Channel
} }
}, },
.ReaderQuotas = New XmlDictionaryReaderQuotas() With { .ReaderQuotas = New XmlDictionaryReaderQuotas() With {
.MaxArrayLength = MAX_ARRAY_LENGTH, .MaxArrayLength = Constants.ChannelSettings.MAX_ARRAY_LENGTH,
.MaxStringContentLength = MAX_STRING_CONTENT_LENGTH .MaxStringContentLength = Constants.ChannelSettings.MAX_STRING_CONTENT_LENGTH
} }
} }
End Function End Function
Public Sub New(pLogConfig As LogConfig, pServerAddress As ServerAddressStruct)
MyBase.New(pLogConfig)
ChannelFactory = GetChannelFactory(pServerAddress)
End Sub
''' <summary>
''' Creates a channel and adds a Faulted-Handler
''' </summary>
''' <returns>A channel object</returns>
Public Function GetChannel() As IEDMIServiceChannel
Try
Logger.Debug("Creating channel.")
Dim oChannel = ChannelFactory.CreateChannel()
AddHandler oChannel.Faulted, Sub() RaiseEvent Reconnect(Me, Nothing)
Return oChannel
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Function
Private Function GetChannelFactory(pServerAddress As ServerAddressStruct) As ChannelFactory(Of IEDMIServiceChannel)
Dim oBinding = GetBinding()
Dim oAddress = New EndpointAddress($"net.tcp://{pServerAddress.Host}:{pServerAddress.Port}/DigitalData/Services/Main")
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
Return oFactory
End Function
End Class End Class

View File

@ -0,0 +1,31 @@
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Public Class Connection
Public Function ParseServiceAddress(pHost As String, pPort As Integer) As ServerAddressStruct
Dim oAddress As ServerAddressStruct
oAddress.Host = pHost
oAddress.Port = pPort
Return oAddress
End Function
Public Function ParseServiceAddress(pAddress As String) As ServerAddressStruct
Dim oAddressList As List(Of String)
Dim oAddress As ServerAddressStruct
If pAddress.Contains(";"c) Then
oAddressList = pAddress.Split(";"c).ToList
ElseIf pAddress.Contains(":"c) Then
oAddressList = pAddress.Split(":"c).ToList
Else
oAddressList = New List(Of String) From {pAddress, Constants.DEFAULT_SERVICE_PORT}
End If
oAddress.Host = oAddressList.First()
oAddress.Port = oAddressList.Item(1)
Return oAddress
End Function
End Class

View File

@ -0,0 +1,4 @@
Public Structure ServerAddressStruct
Public Host As String
Public Port As Integer
End Structure

View File

@ -31,4 +31,19 @@
Public Const VECTOR_STRING = "VECTOR STRING" Public Const VECTOR_STRING = "VECTOR STRING"
Public Const VECTOR_INTEGER = "VECTOR INTEGER" Public Const VECTOR_INTEGER = "VECTOR INTEGER"
End Class End Class
''' <summary>
''' Infos about MaxBufferSize and MaxBufferPoolSize
''' https://social.msdn.microsoft.com/Forums/vstudio/en-US/d6e234d3-942f-4e9d-8470-32618d3f3212/maxbufferpoolsize-vs-maxbuffersize?forum=wcf
''' </summary>
Public Class ChannelSettings
Public Const MAX_RECEIVED_MESSAGE_SIZE = 2147483647 ' 1GB
Public Const MAX_BUFFER_SIZE = 104857600 ' 100MB
Public Const MAX_BUFFER_POOL_SIZE = 1048576 ' 1MB
Public Const MAX_CONNECTIONS = 500
Public Const MAX_ARRAY_LENGTH = 2147483647
Public Const MAX_STRING_CONTENT_LENGTH = 2147483647
End Class
End Class End Class

View File

@ -72,10 +72,12 @@
<Import Include="System.Threading.Tasks" /> <Import Include="System.Threading.Tasks" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Client\Connection.vb" />
<Compile Include="Client\NewFile.vb" /> <Compile Include="Client\NewFile.vb" />
<Compile Include="Client\Options.vb" /> <Compile Include="Client\Options.vb" />
<Compile Include="Client\Rights.vb" /> <Compile Include="Client\Rights.vb" />
<Compile Include="Client\Channel.vb" /> <Compile Include="Client\Channel.vb" />
<Compile Include="Client\ServerAddressStruct.vb" />
<Compile Include="Modules\BaseMethod.vb" /> <Compile Include="Modules\BaseMethod.vb" />
<Compile Include="Modules\Globix\ImportFile.vb" /> <Compile Include="Modules\Globix\ImportFile.vb" />
<Compile Include="Helpers.vb" /> <Compile Include="Helpers.vb" />
@ -277,6 +279,10 @@
<WCFMetadata Include="Connected Services\" /> <WCFMetadata Include="Connected Services\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Modules.Base\Base\Base.vbproj">
<Project>{6ea0c51f-c2b1-4462-8198-3de0b32b74f8}</Project>
<Name>Base</Name>
</ProjectReference>
<ProjectReference Include="..\Modules.Database\Database.vbproj"> <ProjectReference Include="..\Modules.Database\Database.vbproj">
<Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project> <Project>{eaf0ea75-5fa7-485d-89c7-b2d843b03a96}</Project>
<Name>Database</Name> <Name>Database</Name>