diff --git a/GUIs.Monitor/Constants.vb b/GUIs.Monitor/Constants.vb new file mode 100644 index 00000000..f007516c --- /dev/null +++ b/GUIs.Monitor/Constants.vb @@ -0,0 +1,9 @@ +Public Class Constants + Public Const STATE_SUCCESS As String = "SUCCESS" + Public Const STATE_FAILURE As String = "FAILURE" + Public Const STATE_WARNING As String = "WARNING" + Public Const STATE_WAITING As String = "WAITING" + Public Const STATE_HIGHLIGHT As String = "HIGHLIGHT" + Public Const STATE_DEFAULT As String = "DEFAULT" + Public Const STATE_USER As String = "USER" +End Class diff --git a/GUIs.Monitor/Resources/actions_refresh.svg b/GUIs.Monitor/Resources/actions_refresh.svg new file mode 100644 index 00000000..86a9ccb8 --- /dev/null +++ b/GUIs.Monitor/Resources/actions_refresh.svg @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/GUIs.Monitor/Resources/inserttreeview.svg b/GUIs.Monitor/Resources/inserttreeview.svg new file mode 100644 index 00000000..37993b43 --- /dev/null +++ b/GUIs.Monitor/Resources/inserttreeview.svg @@ -0,0 +1,17 @@ + + + + + + + + \ No newline at end of file diff --git a/GUIs.Monitor/TreeListManager.vb b/GUIs.Monitor/TreeListManager.vb new file mode 100644 index 00000000..351c7bea --- /dev/null +++ b/GUIs.Monitor/TreeListManager.vb @@ -0,0 +1,237 @@ +Imports DevExpress.Utils +Imports DevExpress.XtraEditors.Controls +Imports DevExpress.XtraEditors.Repository +Imports DevExpress.XtraTreeList +Imports DevExpress.XtraTreeList.Columns +Imports DevExpress.XtraTreeList.Nodes +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.Language.Utils + +Public Class TreeListManager + Private ReadOnly SvgImages As SvgImageCollection + Private ReadOnly LogConfig As LogConfig + Private ReadOnly Property Database As MSSQLServer + Private ReadOnly Logger As Logger + + Private ReadOnly DisplayColumns As New List(Of String) From {"COLUMN1", "COLUMN2", "COLUMN3", "ADDED_WHEN", "STATE", "ICON"} + Private ReadOnly SQLColumns As New List(Of String) From {"SELECT1", "SELECT2", "SELECT3", "SELECT4"} + Private ReadOnly DocViewColumns As New List(Of String) From {"DOCVIEW1", "DOCVIEW2"} + Private ReadOnly HtmlViewColumns As New List(Of String) From {"HTML1", "HTML2"} + Private ReadOnly DataColumns As List(Of String) = SQLColumns. + Concat(DocViewColumns). + Concat(HtmlViewColumns). + ToList + + 'Private ReadOnly Items As New List(Of Tuple(Of TreeList, TreeListProperties)) + Private ReadOnly Items As New Dictionary(Of TreeList, TreeListProperties) + + Public ReadOnly Property TreeLists As List(Of TreeList) + Get + Return Items.Keys.ToList + End Get + End Property + + Public ReadOnly Property CurrentTreeListProps As TreeListProperties + Get + If CurrentTreeList IsNot Nothing Then + Return Items.Item(CurrentTreeList) + Else + Return Nothing + End If + End Get + End Property + + Public Property CurrentTreeList As TreeList + + Public Event TreeList_FocusedNodeChanged As EventHandler(Of FocusedNodeChangedEventArgs) + Public Event TreeList_CustomDrawNodeCell As EventHandler(Of CustomDrawNodeCellEventArgs) + + Public Class TreeListProperties + Public SearchValue As String + Public ViewName As String + Public CreatedAt As Date + End Class + + Private Enum NodeImage + [Default] = 0 + SQL = 1 + File = 2 + Mail = 3 + Success = 4 + Failure = 5 + Warning = 6 + Waiting = 7 + User = 8 + Highlight = 9 + End Enum + + Public Sub New(LogConfig As LogConfig, Database As MSSQLServer, SvgImageCollection As SvgImageCollection) + Me.LogConfig = LogConfig + Me.Database = Database + Logger = LogConfig.GetLogger() + SvgImages = SvgImageCollection + End Sub + + Public Sub Add(TreeList As TreeList) + Items.Add(TreeList, New TreeListProperties() With {.CreatedAt = Now}) + End Sub + + Public Sub AddRange(ParamArray TreeLists As TreeList()) + For Each oTreeList In TreeLists + Add(oTreeList) + Next + End Sub + + Public Function GetNextTreeList() As TreeList + ' Return next free Treelist + For Each oTreeList In TreeLists + If oTreeList.DataSource Is Nothing Then + Return oTreeList + End If + Next + + ' Otherwise return oldest TreeList + Return Items. + OrderBy(Function(i) i.Value.CreatedAt). + Select(Of TreeList)(Function(i) i.Key). + First() + End Function + + Public Sub LoadDataFor(TreeList As TreeList, DataSource As DataTable, ViewName As String, Value As String) + Try + AddHandler TreeList.FocusedNodeChanged, Sub(sender As Object, e As FocusedNodeChangedEventArgs) + RaiseEvent TreeList_FocusedNodeChanged(sender, e) + End Sub + + AddHandler TreeList.CustomDrawNodeCell, Sub(sender As Object, e As CustomDrawNodeCellEventArgs) + RaiseEvent TreeList_CustomDrawNodeCell(sender, e) + End Sub + + ' Load data + TreeList.DataSource = DataSource + TreeList.PopulateColumns() + + ' Show all columns in DisplayColumns List + For Each oColumn In TreeList.Columns + oColumn.Visible = DisplayColumns.Contains(oColumn.FieldName) + If oColumn.FieldName = "ADDED_WHEN" Then + oColumn.Format.FormatType = FormatType.DateTime + oColumn.Format.FormatString = "dd.MM.yyyy HH:MM:ss" + End If + Next + + ' Initialize TreeList visuals + Init(TreeList) + + ' Expand all nodes that contain state WARNING or FAILURE + Dim oStateColumn As TreeListColumn = TreeList.Columns.Item("STATE") + For Each oNode As TreeListNode In TreeList.Nodes + ExpandNodes(oNode, Function(n) + Dim oObjectValue = n.GetValue(oStateColumn) + Dim oValue As String = NotNull(oObjectValue, String.Empty) + Return oValue IsNot Nothing AndAlso (oValue = Constants.STATE_WARNING Or oValue = Constants.STATE_FAILURE) + End Function) + Next + + ' Set currently loaded TreeList as current + CurrentTreeList = TreeList + + ' Update Timestamp and Searchdata for current TreeList + Dim oItem = Items.Item(TreeList) + oItem.CreatedAt = Now + oItem.SearchValue = Value + oItem.ViewName = ViewName + Items.Item(TreeList) = oItem + Catch ex As Exception + Logger.Error(ex) + End Try + End Sub + + Private Sub ExpandNodes(RootNode As TreeListNode, Condition As Predicate(Of TreeListNode)) + If Condition(RootNode) = True Then + RootNode.Expand() + ExpandParentNode(RootNode) + End If + + For Each oNode As TreeListNode In RootNode.Nodes + ExpandNodes(oNode, Condition) + + If Condition(oNode) = True Then + oNode.Expand() + ExpandParentNode(oNode) + End If + Next + End Sub + + Private Sub ExpandParentNode(ChildNode As TreeListNode) + If ChildNode.ParentNode IsNot Nothing Then + ChildNode.ParentNode.Expand() + ExpandParentNode(ChildNode.ParentNode) + End If + End Sub + + Private Sub Init(TreeList As TreeList) + If TreeList.Columns.Count = 0 Then + Exit Sub + End If + + TreeList.KeyFieldName = "GUID" + TreeList.ParentFieldName = "PARENT_ID" + + Dim oStateEdit As New RepositoryItemImageComboBox With { + .SmallImages = SvgImages, + .GlyphAlignment = HorzAlignment.Near + } + oStateEdit.Buttons.Clear() + oStateEdit.Items.AddRange(New List(Of ImageComboBoxItem) From { + New ImageComboBoxItem("Success", Constants.STATE_SUCCESS, NodeImage.Success), + New ImageComboBoxItem("Failure", Constants.STATE_FAILURE, NodeImage.Failure), + New ImageComboBoxItem("Warning", Constants.STATE_WARNING, NodeImage.Warning), + New ImageComboBoxItem("Waiting", Constants.STATE_WAITING, NodeImage.Waiting), + New ImageComboBoxItem("Default", Constants.STATE_DEFAULT, NodeImage.Default), + New ImageComboBoxItem("User", Constants.STATE_USER, NodeImage.User), + New ImageComboBoxItem("Highlight", Constants.STATE_HIGHLIGHT, NodeImage.Highlight) + }) + + Dim oIconEdit As New RepositoryItemImageComboBox With { + .SmallImages = SvgImages, + .GlyphAlignment = HorzAlignment.Near + } + oIconEdit.Buttons.Clear() + oIconEdit.Items.AddRange(New List(Of ImageComboBoxItem) From { + New ImageComboBoxItem("Email", "MAIL", NodeImage.Mail), + New ImageComboBoxItem("SQL", "SQL", NodeImage.SQL), + New ImageComboBoxItem("File", "FILE", NodeImage.File) + }) + + Dim oColumn1 = TreeList.Columns.Item("COLUMN1") + Dim oStateColumn = TreeList.Columns.Item("STATE") + Dim oIconColumn = TreeList.Columns.Item("ICON") + + + oStateColumn.VisibleIndex = 1 + oIconColumn.VisibleIndex = 2 + + With oColumn1 + .VisibleIndex = 0 + .MinWidth = 150 + End With + + With oStateColumn + .ColumnEdit = oStateEdit + .MaxWidth = 25 + .MinWidth = 25 + .Caption = " " + End With + + With oIconColumn + .ColumnEdit = oIconEdit + .MaxWidth = 25 + .MinWidth = 25 + .Caption = " " + End With + + End Sub + +End Class diff --git a/GUIs.Monitor/frmDocumentManager.Designer.vb b/GUIs.Monitor/frmDocumentManager.Designer.vb new file mode 100644 index 00000000..188568b7 --- /dev/null +++ b/GUIs.Monitor/frmDocumentManager.Designer.vb @@ -0,0 +1,268 @@ + _ +Partial Class frmDocumentManager + Inherits DevExpress.XtraBars.Ribbon.RibbonForm + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + MyBase.Dispose(disposing) + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim DockingContainer1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() + Me.DocumentManager1 = New DevExpress.XtraBars.Docking2010.DocumentManager(Me.components) + Me.TabbedView1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView(Me.components) + Me.RibbonControl1 = New DevExpress.XtraBars.Ribbon.RibbonControl() + Me.RibbonPage1 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.RibbonPageGroup1 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibbonPageGroup2 = New DevExpress.XtraBars.Ribbon.RibbonPageGroup() + Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar() + Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage() + Me.DockManager1 = New DevExpress.XtraBars.Docking.DockManager(Me.components) + Me.PanelDashboard = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel1_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.Document1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document(Me.components) + Me.DocumentGroup1 = New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup(Me.components) + Me.PanelSearch = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel2_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.PanelDocView = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel3_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.PanelSQL = New DevExpress.XtraBars.Docking.DockPanel() + Me.DockPanel4_Container = New DevExpress.XtraBars.Docking.ControlContainer() + Me.hideContainerRight = New DevExpress.XtraBars.Docking.AutoHideContainer() + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.PanelDashboard.SuspendLayout() + CType(Me.Document1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.PanelSearch.SuspendLayout() + Me.PanelDocView.SuspendLayout() + Me.PanelSQL.SuspendLayout() + Me.hideContainerRight.SuspendLayout() + Me.SuspendLayout() + ' + 'DocumentManager1 + ' + Me.DocumentManager1.ContainerControl = Me + Me.DocumentManager1.View = Me.TabbedView1 + Me.DocumentManager1.ViewCollection.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseView() {Me.TabbedView1}) + ' + 'TabbedView1 + ' + Me.TabbedView1.DocumentGroups.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup() {Me.DocumentGroup1}) + Me.TabbedView1.Documents.AddRange(New DevExpress.XtraBars.Docking2010.Views.BaseDocument() {Me.Document1}) + DockingContainer1.Element = Me.DocumentGroup1 + Me.TabbedView1.RootContainer.Nodes.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.DockingContainer() {DockingContainer1}) + Me.TabbedView1.Style = DevExpress.XtraBars.Docking2010.Views.DockingViewStyle.Light + ' + 'RibbonControl1 + ' + Me.RibbonControl1.ExpandCollapseItem.Id = 0 + Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem}) + Me.RibbonControl1.Location = New System.Drawing.Point(0, 0) + Me.RibbonControl1.MaxItemId = 1 + Me.RibbonControl1.Name = "RibbonControl1" + Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1}) + Me.RibbonControl1.Size = New System.Drawing.Size(1134, 159) + Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1 + ' + 'RibbonPage1 + ' + Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup1, Me.RibbonPageGroup2}) + Me.RibbonPage1.Name = "RibbonPage1" + Me.RibbonPage1.Text = "RibbonPage1" + ' + 'RibbonPageGroup1 + ' + Me.RibbonPageGroup1.Name = "RibbonPageGroup1" + Me.RibbonPageGroup1.Text = "RibbonPageGroup1" + ' + 'RibbonPageGroup2 + ' + Me.RibbonPageGroup2.Name = "RibbonPageGroup2" + Me.RibbonPageGroup2.Text = "RibbonPageGroup2" + ' + 'RibbonStatusBar1 + ' + Me.RibbonStatusBar1.Location = New System.Drawing.Point(0, 665) + Me.RibbonStatusBar1.Name = "RibbonStatusBar1" + Me.RibbonStatusBar1.Ribbon = Me.RibbonControl1 + Me.RibbonStatusBar1.Size = New System.Drawing.Size(1134, 22) + ' + 'RibbonPage2 + ' + Me.RibbonPage2.Name = "RibbonPage2" + Me.RibbonPage2.Text = "RibbonPage2" + ' + 'DockManager1 + ' + Me.DockManager1.AutoHideContainers.AddRange(New DevExpress.XtraBars.Docking.AutoHideContainer() {Me.hideContainerRight}) + Me.DockManager1.Form = Me + Me.DockManager1.RootPanels.AddRange(New DevExpress.XtraBars.Docking.DockPanel() {Me.PanelDashboard, Me.PanelSearch, Me.PanelSQL}) + Me.DockManager1.Style = DevExpress.XtraBars.Docking2010.Views.DockingViewStyle.Light + Me.DockManager1.TopZIndexControls.AddRange(New String() {"DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.StatusBar", "System.Windows.Forms.MenuStrip", "System.Windows.Forms.StatusStrip", "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"}) + ' + 'PanelDashboard + ' + Me.PanelDashboard.Controls.Add(Me.DockPanel1_Container) + Me.PanelDashboard.DockedAsTabbedDocument = True + Me.PanelDashboard.ID = New System.Guid("7a841a4a-faca-4797-87c6-8be6fc59b50d") + Me.PanelDashboard.Name = "PanelDashboard" + Me.PanelDashboard.Options.ShowCloseButton = False + Me.PanelDashboard.OriginalSize = New System.Drawing.Size(200, 200) + Me.PanelDashboard.Text = "DockPanel1" + ' + 'DockPanel1_Container + ' + Me.DockPanel1_Container.Location = New System.Drawing.Point(0, 0) + Me.DockPanel1_Container.Name = "DockPanel1_Container" + Me.DockPanel1_Container.Size = New System.Drawing.Size(903, 257) + Me.DockPanel1_Container.TabIndex = 0 + ' + 'Document1 + ' + Me.Document1.Caption = "DockPanel1" + Me.Document1.ControlName = "PanelDashboard" + Me.Document1.FloatLocation = New System.Drawing.Point(0, 0) + Me.Document1.FloatSize = New System.Drawing.Size(200, 200) + Me.Document1.Properties.AllowClose = DevExpress.Utils.DefaultBoolean.[False] + Me.Document1.Properties.AllowFloat = DevExpress.Utils.DefaultBoolean.[True] + Me.Document1.Properties.AllowFloatOnDoubleClick = DevExpress.Utils.DefaultBoolean.[True] + ' + 'DocumentGroup1 + ' + Me.DocumentGroup1.Items.AddRange(New DevExpress.XtraBars.Docking2010.Views.Tabbed.Document() {Me.Document1}) + ' + 'PanelSearch + ' + Me.PanelSearch.Controls.Add(Me.DockPanel2_Container) + Me.PanelSearch.Dock = DevExpress.XtraBars.Docking.DockingStyle.Left + Me.PanelSearch.ID = New System.Guid("6c1851ca-e156-402e-90f8-a83e25b0ee52") + Me.PanelSearch.Location = New System.Drawing.Point(0, 159) + Me.PanelSearch.Name = "PanelSearch" + Me.PanelSearch.Options.ShowCloseButton = False + Me.PanelSearch.OriginalSize = New System.Drawing.Size(200, 200) + Me.PanelSearch.Size = New System.Drawing.Size(200, 506) + Me.PanelSearch.Text = "Suche" + ' + 'DockPanel2_Container + ' + Me.DockPanel2_Container.Location = New System.Drawing.Point(0, 43) + Me.DockPanel2_Container.Name = "DockPanel2_Container" + Me.DockPanel2_Container.Size = New System.Drawing.Size(199, 463) + Me.DockPanel2_Container.TabIndex = 0 + ' + 'PanelDocView + ' + Me.PanelDocView.Controls.Add(Me.DockPanel3_Container) + Me.PanelDocView.Dock = DevExpress.XtraBars.Docking.DockingStyle.Right + Me.PanelDocView.ID = New System.Guid("a668ae35-02f7-4338-aeee-25839395e8cc") + Me.PanelDocView.Location = New System.Drawing.Point(0, 0) + Me.PanelDocView.Name = "PanelDocView" + Me.PanelDocView.Options.ShowCloseButton = False + Me.PanelDocView.OriginalSize = New System.Drawing.Size(200, 200) + Me.PanelDocView.SavedDock = DevExpress.XtraBars.Docking.DockingStyle.Right + Me.PanelDocView.SavedIndex = 2 + Me.PanelDocView.Size = New System.Drawing.Size(200, 506) + Me.PanelDocView.Text = "Document Viewer" + Me.PanelDocView.Visibility = DevExpress.XtraBars.Docking.DockVisibility.AutoHide + ' + 'DockPanel3_Container + ' + Me.DockPanel3_Container.Location = New System.Drawing.Point(1, 43) + Me.DockPanel3_Container.Name = "DockPanel3_Container" + Me.DockPanel3_Container.Size = New System.Drawing.Size(199, 463) + Me.DockPanel3_Container.TabIndex = 0 + ' + 'PanelSQL + ' + Me.PanelSQL.Controls.Add(Me.DockPanel4_Container) + Me.PanelSQL.Dock = DevExpress.XtraBars.Docking.DockingStyle.Bottom + Me.PanelSQL.ID = New System.Guid("0f65098f-8b5a-4efd-9b19-ba4effecffec") + Me.PanelSQL.Location = New System.Drawing.Point(200, 445) + Me.PanelSQL.Name = "PanelSQL" + Me.PanelSQL.Options.ShowCloseButton = False + Me.PanelSQL.OriginalSize = New System.Drawing.Size(200, 220) + Me.PanelSQL.Size = New System.Drawing.Size(903, 220) + Me.PanelSQL.Text = "SQL" + ' + 'DockPanel4_Container + ' + Me.DockPanel4_Container.Location = New System.Drawing.Point(0, 44) + Me.DockPanel4_Container.Name = "DockPanel4_Container" + Me.DockPanel4_Container.Size = New System.Drawing.Size(903, 176) + Me.DockPanel4_Container.TabIndex = 0 + ' + 'hideContainerRight + ' + Me.hideContainerRight.BackColor = System.Drawing.Color.FromArgb(CType(CType(248, Byte), Integer), CType(CType(248, Byte), Integer), CType(CType(248, Byte), Integer)) + Me.hideContainerRight.Controls.Add(Me.PanelDocView) + Me.hideContainerRight.Dock = System.Windows.Forms.DockStyle.Right + Me.hideContainerRight.Location = New System.Drawing.Point(1103, 159) + Me.hideContainerRight.Name = "hideContainerRight" + Me.hideContainerRight.Size = New System.Drawing.Size(31, 506) + ' + 'frmDocumentManager + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1134, 687) + Me.Controls.Add(Me.PanelSQL) + Me.Controls.Add(Me.PanelSearch) + Me.Controls.Add(Me.hideContainerRight) + Me.Controls.Add(Me.RibbonStatusBar1) + Me.Controls.Add(Me.RibbonControl1) + Me.Name = "frmDocumentManager" + Me.Ribbon = Me.RibbonControl1 + Me.StatusBar = Me.RibbonStatusBar1 + Me.Text = "frmDocumentManager" + CType(Me.DocumentManager1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.TabbedView1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.RibbonControl1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DockManager1, System.ComponentModel.ISupportInitialize).EndInit() + Me.PanelDashboard.ResumeLayout(False) + CType(Me.Document1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.DocumentGroup1, System.ComponentModel.ISupportInitialize).EndInit() + Me.PanelSearch.ResumeLayout(False) + Me.PanelDocView.ResumeLayout(False) + Me.PanelSQL.ResumeLayout(False) + Me.hideContainerRight.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents DocumentManager1 As DevExpress.XtraBars.Docking2010.DocumentManager + Friend WithEvents TabbedView1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.TabbedView + Friend WithEvents RibbonControl1 As DevExpress.XtraBars.Ribbon.RibbonControl + Friend WithEvents RibbonPage1 As DevExpress.XtraBars.Ribbon.RibbonPage + Friend WithEvents RibbonPageGroup1 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + Friend WithEvents RibbonPageGroup2 As DevExpress.XtraBars.Ribbon.RibbonPageGroup + Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar + Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage + Friend WithEvents PanelSQL As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel4_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents PanelDocView As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel3_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents PanelSearch As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel2_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents DocumentGroup1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.DocumentGroup + Friend WithEvents Document1 As DevExpress.XtraBars.Docking2010.Views.Tabbed.Document + Friend WithEvents DockManager1 As DevExpress.XtraBars.Docking.DockManager + Friend WithEvents PanelDashboard As DevExpress.XtraBars.Docking.DockPanel + Friend WithEvents DockPanel1_Container As DevExpress.XtraBars.Docking.ControlContainer + Friend WithEvents hideContainerRight As DevExpress.XtraBars.Docking.AutoHideContainer +End Class diff --git a/GUIs.Monitor/frmDocumentManager.resx b/GUIs.Monitor/frmDocumentManager.resx new file mode 100644 index 00000000..f801fe53 --- /dev/null +++ b/GUIs.Monitor/frmDocumentManager.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 181, 17 + + \ No newline at end of file diff --git a/GUIs.Monitor/frmDocumentManager.vb b/GUIs.Monitor/frmDocumentManager.vb new file mode 100644 index 00000000..2729c268 --- /dev/null +++ b/GUIs.Monitor/frmDocumentManager.vb @@ -0,0 +1,3 @@ +Public Class frmDocumentManager + +End Class \ No newline at end of file diff --git a/GUIs.ZooFlow/Administration/frmAdmin_ClipboardWatcher.vb b/GUIs.ZooFlow/Administration/frmAdmin_ClipboardWatcher.vb index 1460b961..6e05e910 100644 --- a/GUIs.ZooFlow/Administration/frmAdmin_ClipboardWatcher.vb +++ b/GUIs.ZooFlow/Administration/frmAdmin_ClipboardWatcher.vb @@ -67,16 +67,16 @@ Public Class frmAdmin_ClipboardWatcher 'TODO: Diese Codezeile lädt Daten in die Tabelle "DSDD_Stammdaten.TBDD_CONNECTION". Sie können sie bei Bedarf verschieben oder entfernen. Me.TBDD_CONNECTIONTableAdapter.Fill(Me.DSDD_Stammdaten.TBDD_CONNECTION) Try - TBCW_PROFILESTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + TBCW_PROFILESTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString TBCW_PROFILESTableAdapter.Fill(DBCW_Stammdaten.TBCW_PROFILES, PrimaryKey) - TBCW_PROF_DOC_SEARCHTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + TBCW_PROF_DOC_SEARCHTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString TBCW_PROF_DOC_SEARCHTableAdapter.Fill(DBCW_Stammdaten.TBCW_PROF_DOC_SEARCH, PrimaryKey) - TBCW_PROF_DATA_SEARCHTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + TBCW_PROF_DATA_SEARCHTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString TBCW_PROF_DATA_SEARCHTableAdapter.Fill(DBCW_Stammdaten.TBCW_PROF_DATA_SEARCH, PrimaryKey) - TBDD_CONNECTIONTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + TBDD_CONNECTIONTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString TBDD_CONNECTIONTableAdapter.Fill(DSDD_Stammdaten.TBDD_CONNECTION) ' Configure the GridViews with some default options @@ -220,7 +220,7 @@ Public Class frmAdmin_ClipboardWatcher Dim oTextEdit As TextEdit = sender If e.Button.Tag = BUTTON_SEARCH_SQL Then - Dim oForm As New frmSQLEditor(My.LogConfig, My.Database) With {.SQLString = oTextEdit.EditValue} + Dim oForm As New frmSQLEditor(My.LogConfig, My.DatabaseECM) With {.SQLString = oTextEdit.EditValue} Dim oResult = oForm.ShowDialog() If oResult = DialogResult.OK Then @@ -233,7 +233,7 @@ Public Class frmAdmin_ClipboardWatcher Dim oTextEdit As TextEdit = sender If e.Button.Tag = BUTTON_COUNT_SQL Then - Dim oForm As New frmSQLEditor(My.LogConfig, My.Database) With {.SQLString = oTextEdit.EditValue} + Dim oForm As New frmSQLEditor(My.LogConfig, My.DatabaseECM) With {.SQLString = oTextEdit.EditValue} Dim oResult = oForm.ShowDialog() If oResult = DialogResult.OK Then diff --git a/GUIs.ZooFlow/Administration/frmAdmin_Globix.vb b/GUIs.ZooFlow/Administration/frmAdmin_Globix.vb index a96685a2..7d569f45 100644 --- a/GUIs.ZooFlow/Administration/frmAdmin_Globix.vb +++ b/GUIs.ZooFlow/Administration/frmAdmin_Globix.vb @@ -17,7 +17,7 @@ Public Class frmAdmin_Globix Private Sub frmAdmin_Attribute_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try - TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString Me.TBDD_DOKUMENTARTTableAdapter.Fill(Me.GlobixDataset.TBDD_DOKUMENTART, PrimaryKey) Catch ex As Exception ShowErrorMessage(ex) diff --git a/GUIs.ZooFlow/Administration/frmAdmin_Start.vb b/GUIs.ZooFlow/Administration/frmAdmin_Start.vb index 517b2b0c..74a193a7 100644 --- a/GUIs.ZooFlow/Administration/frmAdmin_Start.vb +++ b/GUIs.ZooFlow/Administration/frmAdmin_Start.vb @@ -63,7 +63,7 @@ Public Class frmAdmin_Start Private Function Load_SQLData() As Boolean Try - Dim oTable As DataTable = My.Database.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL") + Dim oTable As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBZF_ADMIN_SOURCE_SQL") DetailForm.DetailDataList.Clear() For Each oRow As DataRow In oTable.Rows @@ -77,7 +77,7 @@ Public Class frmAdmin_Start } Try - oItem.SQLResult = My.Database.GetDatatable(oItem.SQLCommand) + oItem.SQLResult = My.DatabaseECM.GetDatatable(oItem.SQLCommand) Catch ex As Exception oItem.SQLResult = Nothing Logger.Error(ex) diff --git a/GUIs.ZooFlow/ClassConstants.vb b/GUIs.ZooFlow/ClassConstants.vb index eb62ce5a..c472c821 100644 --- a/GUIs.ZooFlow/ClassConstants.vb +++ b/GUIs.ZooFlow/ClassConstants.vb @@ -39,4 +39,6 @@ Public Const IDB_ADDED_WHEN_String_German = "Erstellt Wann" Public Const IDB_ADDED_WHEN_String_Englisch = "Added when" + + Public Const WM_WINDOWPOSCHANGING As Integer = &H46 End Class diff --git a/GUIs.ZooFlow/ClassDataASorDB.vb b/GUIs.ZooFlow/ClassDataASorDB.vb index b2bf726f..0f1a10d5 100644 --- a/GUIs.ZooFlow/ClassDataASorDB.vb +++ b/GUIs.ZooFlow/ClassDataASorDB.vb @@ -24,7 +24,7 @@ Public Class ClassDataASorDB End Try Else If pDB = "DD_ECM" Then - oReturnDT = My.Database.GetDatatable(pSQL) + oReturnDT = My.DatabaseECM.GetDatatable(pSQL) ElseIf pDB = "IDB" Then oReturnDT = My.DatabaseIDB.GetDatatable(pSQL) End If diff --git a/GUIs.ZooFlow/ClassEnvironment.vb b/GUIs.ZooFlow/ClassEnvironment.vb index 506114ae..f3df777f 100644 --- a/GUIs.ZooFlow/ClassEnvironment.vb +++ b/GUIs.ZooFlow/ClassEnvironment.vb @@ -4,7 +4,7 @@ Public Class ClassEnvironment Public Shared Function GetEnvironment() As Environment Dim oEnvironment As New Environment() With { .DatabaseIDB = My.DatabaseIDB, - .Database = My.Database, + .Database = My.DatabaseECM, .Modules = My.Application.Modules, .Service = My.Application.Service, .Settings = My.Application.Settings, diff --git a/GUIs.ZooFlow/ClassIDBData.vb b/GUIs.ZooFlow/ClassIDBData.vb index a160321d..b7e77477 100644 --- a/GUIs.ZooFlow/ClassIDBData.vb +++ b/GUIs.ZooFlow/ClassIDBData.vb @@ -1,4 +1,6 @@ -Imports DigitalData.Modules.Logging +Imports DigitalData.Modules.EDMI.API +Imports DigitalData.Modules.EDMI.API.Constants +Imports DigitalData.Modules.Logging Public Class ClassIDBData Public Property DTVWIDB_BE_ATTRIBUTE As DataTable @@ -9,11 +11,17 @@ Public Class ClassIDBData ''' Array with all Indices Private _Logger As Logger Private _DataASorDB As ClassDataASorDB + Private _Database As DatabaseWithFallback + Public Sub New(LogConfig As LogConfig) _Logger = LogConfig.GetLogger + _Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) + _DataASorDB = New ClassDataASorDB(LogConfig) Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE LANG_ID = {My.Application.User.LanguageID}" - DTVWIDB_BE_ATTRIBUTE = _DataASorDB.GetDatatable("IDB", oSQL, "VWIDB_BE_ATTRIBUTE", $"LANG_ID = {My.Application.User.LanguageID}") + + DTVWIDB_BE_ATTRIBUTE = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, DatabaseType.IDB, $"LANG_ID = {My.Application.User.LanguageID}") + 'DTVWIDB_BE_ATTRIBUTE = _DataASorDB.GetDatatable("IDB", oSQL, "VWIDB_BE_ATTRIBUTE", $"LANG_ID = {My.Application.User.LanguageID}") End Sub Public IDBSystemIndices As List(Of String) Public Function GetIndicesByBE(ByVal pBusinessEntity As String) As List(Of String) diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index 906d1a7f..6b1da8d5 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -44,10 +44,10 @@ Public Class ClassInit _Loader = New ClassInitLoader() ' === Init Schritte definieren - _Loader.AddStep("Checking connectivity..", AddressOf CheckConnectivity, True) + _Loader.AddStep("Initializing Database (1/2)", AddressOf InitializeDatabase, True) + _Loader.AddStep("Initializing Service", AddressOf InitializeService, True) + _Loader.AddStep("Initializing Database (2/2)", AddressOf InitializeDatabaseWithFallback, True) _Loader.AddStep("Initializing User..", AddressOf InitializeUser, True) - _Loader.AddStep("Initializing IDB Database..", AddressOf InitializeIDBDatabase, True) - _Loader.AddStep("Initializing IDB Service..", AddressOf InitializeIDBService, True) _Loader.AddStep("Initializing Language..", AddressOf InitializeLanguage, False) _Loader.AddStep("Loading 3rd-party licenses..", AddressOf Initialize3rdParty, False) _Loader.AddStep("Loading Basic Configs..", AddressOf InitBasicData, False) @@ -115,13 +115,41 @@ Public Class ClassInit End If End Sub - Private Sub CheckConnectivity(MyApplication As My.MyApplication) + Private Sub InitializeDatabase(MyApplication As My.MyApplication) Dim oConnectionString = MSSQLServer.DecryptConnectionString(My.SystemConfig.ConnectionString) - My.Database = New MSSQLServer(My.LogConfig, oConnectionString) + My.DatabaseECM = New MSSQLServer(My.LogConfig, oConnectionString) - If My.Database.DBInitialized = False Then + If My.DatabaseECM.DBInitialized = False Then _Logger.Warn("Could not initialize DD_ECM-Database!") - Throw New InitException("Could not initialize DD_ECM-Database!") + Throw New InitException("Could not initialize ECM-Database!") + + Else + Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB'" + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl) + + If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then + _Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!") + Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!") + End If + + If oDatatable.Rows.Count > 1 Then + _Logger.Warn("Multiple IDB connection entries in TBDD_CONNECTION found!") + Throw New InitException("Fehler beim Laden der IDB Verbindungsdaten!") + End If + + Dim oDataRow As DataRow = oDatatable.Rows.Item(0) + Dim oConString = My.DatabaseECM.GetConnectionString( + oDataRow.Item("SERVER").ToString, + oDataRow.Item("DATENBANK").ToString, + oDataRow.Item("USERNAME").ToString, + oDataRow.Item("PASSWORD").ToString) + + My.DatabaseIDB = New MSSQLServer(My.LogConfig, oConString) + End If + + If My.DatabaseIDB.DBInitialized = False Then + _Logger.Warn("Could not initialize IDB-Database!") + Throw New InitException("Could not initialize IDB-Database!") End If End Sub @@ -130,6 +158,7 @@ Public Class ClassInit Dim oSql = "Select LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'" Dim oDatatable As DataTable = _DataASorDB.GetDatatable("DD_ECM", oSql, "TBDD_3RD_PARTY_MODULES", "", "") + If oDatatable.Rows.Count = 0 Then Throw New InitException("Konfiguration konnte nicht geladen werden!") End If @@ -139,48 +168,49 @@ Public Class ClassInit MyApplication.Settings.GdPictureKey = NotNull(oRow.Item("LICENSE"), String.Empty) Catch ex As Exception _Logger.Error(ex) - Throw New InitException("Error initializing3rdParty!", ex) + Throw New InitException("Error Initialize3rdParty!", ex) End Try End Sub + + Private Sub InitializeDatabaseWithFallback(MyApplication As My.MyApplication) + Try + My.Database = New DatabaseWithFallback(_LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) + Catch ex As Exception + _Logger.Error(ex) + Throw New InitException("Error InitializeDatabaseWithFallback!", ex) + End Try + End Sub + Private Sub InitBasicData(MyApplication As My.MyApplication) Try - Dim oSql = "" + My.Tables.DTIDB_COMMON_SQL = My.DatabaseECM.GetDatatable("SELECT * FROM TBIDB_COMMON_SQL WHERE ACTIVE = 1") + My.Tables.DTIDB_CATALOG = My.DatabaseECM.GetDatatable("SELECT * FROM TBIDB_CATALOG") - oSql = "SELECT * FROM TBIDB_COMMON_SQL WHERE ACTIVE = 1" - My.Tables.DTIDB_COMMON_SQL = _DataASorDB.GetDatatable("IDB", oSql, "TBIDB_COMMON_SQL", "", "") - oSql = "SELECT * FROM TBIDB_CATALOG" - My.Tables.DTIDB_CATALOG = _DataASorDB.GetDatatable("IDB", oSql, "TBIDB_CATALOG", "", "") + 'TODO: Get FilesStores from Application Server For Each oRow As DataRow In My.Tables.DTIDB_CATALOG.Rows - 'Console.WriteLine(oRow.Item("CAT_TITLE").ToString) Select Case oRow.Item("CAT_TITLE").ToString Case "FILESTORE_ARCHIVE" My.Filestore_Archive = oRow.Item("CAT_STRING") + Case "FILESTORE_WORK" My.Filestore_Work = oRow.Item("CAT_STRING") My.Filestore_Work = "Q:\DigitalData - IDB" End Select - Next - oSql = "SELECT * FROM TBDD_CONNECTION" - Catch ex As Exception _Logger.Error(ex) Throw New InitException("Error in InitBasicData", ex) End Try End Sub - Private Sub InitializeIDBService(MyApplication As My.MyApplication) + Private Sub InitializeService(MyApplication As My.MyApplication) Try MyApplication.Service.Address = My.SystemConfig.AppServerConfig + Dim oServerData = Client.ParseServiceAddress(My.SystemConfig.AppServerConfig) + + My.Application.Service.Client = New Client(_LogConfig, oServerData.Item1, oServerData.Item2) - Dim oSplit() As String = MyApplication.Service.Address.Split(":"c) - Dim oAppServerAddress As String = oSplit(0) - Dim oAppServerPort As Integer = 9000 - If oSplit.Length = 2 Then - oAppServerPort = oSplit(1) - End If - My.Application.Service.Client = New Client(_LogConfig, oAppServerAddress, oAppServerPort) If Not IsNothing(My.Application.Service.Client) Then If My.Application.Service.Client.Connect() Then MyApplication.Service.IsActive = True @@ -188,15 +218,15 @@ Public Class ClassInit End If Catch ex As Exception _Logger.Error(ex) - Throw New InitException("Error in InitBasicData", ex) + Throw New InitException("Error in InitializeService", ex) End Try End Sub Private Sub InitializeIDBDatabase(MyApplication As My.MyApplication) If MyApplication.ModulesActive.Contains(MODULE_ZOOFLOW) Then - If My.Database.DBInitialized Then + If My.DatabaseECM.DBInitialized Then Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB'" - Dim oDatatable As DataTable = My.Database.GetDatatable(oSQl) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQl) If IsNothing(oDatatable) OrElse oDatatable.Rows.Count = 0 Then _Logger.Warn("No IDB connection entries in TBDD_CONNECTION found!") @@ -209,7 +239,7 @@ Public Class ClassInit End If Dim oDataRow As DataRow = oDatatable.Rows.Item(0) - Dim oConString = My.Database.GetConnectionString( + Dim oConString = My.DatabaseECM.GetConnectionString( oDataRow.Item("SERVER").ToString, oDataRow.Item("DATENBANK").ToString, oDataRow.Item("USERNAME").ToString, @@ -230,7 +260,7 @@ Public Class ClassInit Private Sub InitializeUser(MyApplication As My.MyApplication) Try Dim oSql As String = My.Queries.Common.FNDD_MODULE_INIT(Environment.UserName) - Dim oDatatable As DataTable = My.Database.GetDatatable(oSql) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSql) If oDatatable Is Nothing Then Throw New InitException("Benutzer konnte nicht geladen werden!") diff --git a/GUIs.ZooFlow/Globix/ClassFilehandle.vb b/GUIs.ZooFlow/Globix/ClassFilehandle.vb index e72133af..40706c2e 100644 --- a/GUIs.ZooFlow/Globix/ClassFilehandle.vb +++ b/GUIs.ZooFlow/Globix/ClassFilehandle.vb @@ -180,7 +180,7 @@ Public Class ClassFilehandle Dim filename_only As String = Path.GetFileName(filename) Dim ins As String = "INSERT INTO TBGI_FILES_USER (FILENAME2WORK, USER@WORK,HANDLE_TYPE,FILENAME_ONLY) VALUES ('" & filename & "','" & Environment.UserName & "','" & handleType & "','" & filename_only & "')" - Return My.Database.ExecuteNonQuery(ins) + Return My.DatabaseECM.ExecuteNonQuery(ins) Catch ex As Exception Return False diff --git a/GUIs.ZooFlow/Globix/ClassHelpers.vb b/GUIs.ZooFlow/Globix/ClassHelpers.vb index 355d91d6..3fdda1b5 100644 --- a/GUIs.ZooFlow/Globix/ClassHelpers.vb +++ b/GUIs.ZooFlow/Globix/ClassHelpers.vb @@ -16,7 +16,7 @@ End Try oSQL = "SELECT * FROM TBGI_FILES_USER WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') AND WORKED = 0 ORDER BY ADDED_WHEN" - Dim oResult As DataTable = My.Database.GetDatatable(oSQL) + Dim oResult As DataTable = My.DatabaseECM.GetDatatable(oSQL) If oResult Is Nothing Then Return Nothing @@ -24,7 +24,7 @@ If oResult.Rows.Count = 0 Then oSQL = "SELECT * FROM TBGI_HISTORY WHERE UPPER(FILE_HASH) = UPPER('" & oHash & "') ORDER BY ADDED_WHEN" - oResult = My.Database.GetDatatable(oSQL) + oResult = My.DatabaseECM.GetDatatable(oSQL) If oResult Is Nothing Then Return Nothing diff --git a/GUIs.ZooFlow/Globix/GlobixControls.vb b/GUIs.ZooFlow/Globix/GlobixControls.vb index 54ad213c..26ab7b23 100644 --- a/GUIs.ZooFlow/Globix/GlobixControls.vb +++ b/GUIs.ZooFlow/Globix/GlobixControls.vb @@ -101,7 +101,7 @@ Public Class GlobixControls AddHandler oControl.Properties.SelectedValuesChanged, AddressOf Lookup_SelectedValuesChanged - oConnectionString = My.Database.Get_ConnectionStringforID(conid) + oConnectionString = My.DatabaseECM.Get_ConnectionStringforID(conid) If oConnectionString IsNot Nothing And oSql.Length > 0 And SQLSuggestion = True Then _Logger.Debug("Connection String (redacted): [{0}]", oConnectionString.Substring(0, 30)) @@ -109,7 +109,7 @@ Public Class GlobixControls If Patterns.HasComplexPatterns(oSql) Then _Logger.Debug("sql enthält Platzhalter und wird erst während der Laufzeit gefüllt!", False) Else - Dim oDatatable = My.Database.GetDatatableWithConnection(oSql, oConnectionString) + Dim oDatatable = My.DatabaseECM.GetDatatableWithConnection(oSql, oConnectionString) oControl.Properties.DataSource = oDatatable End If Else @@ -190,7 +190,7 @@ Public Class GlobixControls Try Dim indexname = cmb.Name.Replace("cmb", "") Dim sql = "SELECT GUID,NAME,SQL_RESULT FROM TBDD_INDEX_MAN where SUGGESTION = 1 AND SQL_RESULT like '%@" & indexname & "%' and DOK_ID = " & My.Application.Globix.CURRENT_DOCTYPE_ID & " ORDER BY SEQUENCE" - Dim DT As DataTable = My.Database.GetDatatable(sql) + Dim DT As DataTable = My.DatabaseECM.GetDatatable(sql) If Not IsNothing(DT) Then If DT.Rows.Count > 0 Then Dim cmbname = "cmb" & DT.Rows(0).Item("NAME") @@ -217,7 +217,7 @@ Public Class GlobixControls Dim NewDataset As New DataSet Dim i As Integer - Dim DT_INDEX As DataTable = My.Database.GetDatatable("select * FROM TBDD_INDEX_MAN WHERE GUID = " & INDEX_GUID) + Dim DT_INDEX As DataTable = My.DatabaseECM.GetDatatable("select * FROM TBDD_INDEX_MAN WHERE GUID = " & INDEX_GUID) If IsNothing(DT_INDEX) Then Exit Sub End If @@ -231,7 +231,7 @@ Public Class GlobixControls Dim cmb As ComboBox = ctrl Dim sql As String = sql_result.ToString.ToUpper.Replace("@" & SearchString.ToUpper, Resultvalue) - connectionString = My.Database.Get_ConnectionStringforID(conid) + connectionString = My.DatabaseECM.Get_ConnectionStringforID(conid) If connectionString Is Nothing = False Then 'SQL Befehl füllt die Auswahlliste @@ -402,7 +402,7 @@ Public Class GlobixControls Dim oMeta = DirectCast(Control.Tag, ControlMeta) Dim oIndexName As String = oMeta.IndexName Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%'" - Dim oDatatable As DataTable = My.Database.GetDatatable(oSQL) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL) If Not IsNothing(oDatatable) Then _Logger.Debug("Found [{0}] depending controls for [{1}]", oDatatable.Rows.Count, Control.Name) @@ -439,8 +439,8 @@ Public Class GlobixControls Exit Sub End If - Dim oConnectionString = My.Database.Get_ConnectionStringforID(SqlConnectionId) - Dim oDatatable As DataTable = My.Database.GetDatatableWithConnection(SqlCommand, oConnectionString) + Dim oConnectionString = My.DatabaseECM.Get_ConnectionStringforID(SqlConnectionId) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatableWithConnection(SqlCommand, oConnectionString) Dim oFoundControl As Control = Nothing For Each oControl As Control In Panel.Controls diff --git a/GUIs.ZooFlow/Globix/frmGlobixAdministration.vb b/GUIs.ZooFlow/Globix/frmGlobixAdministration.vb index 12a68967..941a3526 100644 --- a/GUIs.ZooFlow/Globix/frmGlobixAdministration.vb +++ b/GUIs.ZooFlow/Globix/frmGlobixAdministration.vb @@ -39,7 +39,7 @@ Public Class frmGlobixAdministration Private Sub frmGlobixAdministration_Load(sender As Object, e As EventArgs) Handles Me.Load Try - Me.TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.Database.CurrentSQLConnectionString + Me.TBDD_DOKUMENTARTTableAdapter.Connection.ConnectionString = My.DatabaseECM.CurrentSQLConnectionString 'Me.TBDD_EINGANGSARTENTableAdapter.Connection.ConnectionString = MyConnectionString 'Me.TBDD_MODULESTableAdapter.Connection.ConnectionString = MyConnectionString 'Me.TBDD_DOKART_MODULETableAdapter.Connection.ConnectionString = MyConnectionString diff --git a/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb b/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb index bcac58f4..1272fbde 100644 --- a/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb +++ b/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb @@ -35,7 +35,7 @@ Public Class frmGlobixBasicConfig Sub CheckFolder(pMypath As String, FOLDER_TYPE As String) Try If pMypath = "" Then - My.Database.ExecuteNonQuery("DELETE FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") + My.DatabaseECM.ExecuteNonQuery("DELETE FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") If FOLDER_TYPE = "SCAN" Then My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = "" My.UIConfig.Globix.FolderWatchScanStarted = False @@ -67,15 +67,15 @@ Public Class frmGlobixBasicConfig Exit Sub End Try - Dim folderwatch = My.Database.GetScalarValue("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") + Dim folderwatch = My.DatabaseECM.GetScalarValue("SELECT GUID FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") Dim oSql As String If folderwatch Is Nothing Then oSql = "INSERT INTO TBGI_FOLDERWATCH_USER (USER_ID, FOLDER_PATH, FOLDER_TYPE, ADDED_WHO) VALUES (" & My.Application.User.UserId & ",'" & pMypath & "','" & FOLDER_TYPE & "','" & My.Application.User.UserName & "')" Else oSql = "UPDATE TBGI_FOLDERWATCH_USER SET FOLDER_PATH = '" & pMypath & "', CHANGED_WHO = '" & My.Application.User.UserName & "' where GUID = " & folderwatch End If - If My.Database.ExecuteNonQuery(oSql) Then - folderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") + If My.DatabaseECM.ExecuteNonQuery(oSql) Then + folderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE USER_ID = " & My.Application.User.UserId & " AND FOLDER_TYPE = '" & FOLDER_TYPE & "'") If FOLDER_TYPE = "SCAN" Then My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = folderwatch @@ -102,12 +102,12 @@ Public Class frmGlobixBasicConfig clsFW = New ClassFolderwatcher() Try oReload = True - Dim oFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId) + Dim oFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId) If Not oFolderwatch Is Nothing Then My.Application.Globix.CurrentFolderWatchPath = oFolderwatch End If Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath - Dim oSCANFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId) + Dim oSCANFolderwatch = My.DatabaseECM.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId) If Not oSCANFolderwatch Is Nothing Then My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch End If diff --git a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb index f7a62d04..4c30333f 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_Index.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_Index.vb @@ -86,7 +86,7 @@ Public Class frmGlobix_Index Try My.Application.Globix.CURRENT_ISATTACHMENT = False - DropType = My.Database.GetScalarValue("SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = " & My.Application.Globix.CURRENT_WORKFILE_GUID).ToString + DropType = My.DatabaseECM.GetScalarValue("SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = " & My.Application.Globix.CURRENT_WORKFILE_GUID).ToString My.Application.Globix.CURR_DELETE_ORIGIN = My.UIConfig.Globix.DeleteOriginalFile SourceDeleteItem.Enabled = True @@ -175,7 +175,7 @@ Public Class frmGlobix_Index My.Application.Globix.DTTBGI_REGEX_DOCTYPE = _DataASorDB.GetDatatable("DD_ECM", oSQL, "DTTBGI_REGEX_DOCTYPE", "", "") oSQL = "SELECT * FROM TBDD_INDEX_MAN_POSTPROCESSING" My.Application.Globix.CURR_INDEX_MAN_POSTPROCESSING = _DataASorDB.GetDatatable("DD_ECM", oSQL, "TBDD_INDEX_MAN_POSTPROCESSING", "", "") - MULTIFILES = My.Database.GetScalarValue("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") + MULTIFILES = My.DatabaseECM.GetScalarValue("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") My.Application.Globix.MULTIINDEXING_ACTIVE = False If MULTIFILES > 0 Then If My.Application.User.Language = "de-DE" Then @@ -228,7 +228,7 @@ Public Class frmGlobix_Index End Sub Private Sub SkipItem_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SkipItem.ItemClick - My.Database.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CURRENT_WORKFILE_GUID}") + My.DatabaseECM.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CURRENT_WORKFILE_GUID}") CancelAttempts = 2 Close() End Sub @@ -497,7 +497,7 @@ Public Class frmGlobix_Index Dim oMeta = DirectCast(pControl.Tag, ControlMeta) Dim oIndexName As String = oMeta.IndexName Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%' AND DOK_ID = {My.Application.Globix.CURRENT_DOCTYPE_ID}" - Dim oDatatable As DataTable = My.Database.GetDatatable(oSQL) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL) If Not IsNothing(oDatatable) Then _Logger.Debug("Found [{0}] depending controls for [{1}]", oDatatable.Rows.Count, pControl.Name) @@ -533,7 +533,7 @@ Public Class frmGlobix_Index Dim oConnectionString = GetConnectionString(SqlConnectionId) - Dim oDatatable As DataTable = My.Database.GetDatatableWithConnection(pSqlCommand, oConnectionString) + Dim oDatatable As DataTable = My.DatabaseECM.GetDatatableWithConnection(pSqlCommand, oConnectionString) Dim oFoundControl As Control = Nothing For Each oControl As Control In pnlIndex.Controls @@ -596,7 +596,7 @@ Public Class frmGlobix_Index pSQLCommand = _Patterns.ReplaceInternalValues(pSQLCommand) pSQLCommand = _Patterns.ReplaceUserValues(pSQLCommand, My.Application.Globix.CURRENT_DOCTYPE_ID) - Dim oDatatable = My.Database.GetDatatableWithConnection(pSQLCommand, oConnectionString) + Dim oDatatable = My.DatabaseECM.GetDatatableWithConnection(pSQLCommand, oConnectionString) Return oDatatable End If Else @@ -703,7 +703,7 @@ Public Class frmGlobix_Index Try My.Application.Globix.ABORT_INDEXING = True Dim sql As String = $"SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')" - Dim DT As DataTable = My.Database.GetDatatable(sql) + Dim DT As DataTable = My.DatabaseECM.GetDatatable(sql) Dim anz = DT.Rows.Count For Each Filerow As DataRow In DT.Rows @@ -722,7 +722,7 @@ Public Class frmGlobix_Index End If Next 'Zuerst die Daten des Ablaufs löschen - If My.Database.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')") = True Then + If My.DatabaseECM.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')") = True Then If containsfw_file = True Then If My.Application.User.Language = "de-DE" Then MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:") @@ -789,7 +789,7 @@ Public Class frmGlobix_Index 'Die erste Datei indexieren If WORK_FILE() = True Then 'Und nun die folgenden - Dim DTFiles2Work As DataTable = My.Database.GetDatatable("SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & My.Application.User.UserName & "')") + Dim DTFiles2Work As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CURRENT_WORKFILE_GUID & " AND UPPER(USER@WORK) = UPPER('" & My.Application.User.UserName & "')") If Not DTFiles2Work Is Nothing Then Dim err = False For Each filerow As DataRow In DTFiles2Work.Rows @@ -876,7 +876,7 @@ Public Class frmGlobix_Index My.Application.Globix.CURRENT_LASTDOCTYPE = oDokart.Name _Logger.Info("Datei '" & My.Application.Globix.CURRENT_NEWFILENAME & "' erfolgreich erzeugt.") Dim oDEL As String = "DELETE FROM TBGI_FILES_USER WHERE GUID = " & My.Application.Globix.CURRENT_WORKFILE_GUID - My.Database.ExecuteNonQuery(oDEL) + My.DatabaseECM.ExecuteNonQuery(oDEL) If My.Application.Globix.CURR_DELETE_ORIGIN = True Then _Logger.Info("Datei [" & My.Application.Globix.CURRENT_WORKFILE & "] wird gelöscht.") @@ -1131,7 +1131,6 @@ Public Class frmGlobix_Index CreateFolderForIndex(String.Empty) End If - Dim oIDBImportResult As Boolean = False 'Variable Folder If DropType = "|DROPFROMFSYSTEM|" Or DropType = "|OUTLOOK_ATTACHMENT|" Or DropType = "|ATTMNTEXTRACTED|" Or DropType = "|FW_SIMPLEINDEXER|" Then @@ -1152,20 +1151,20 @@ Public Class frmGlobix_Index Dim tempCur_WF = My.Application.Globix.CURRENT_WORKFILE.Replace("'", "''") Dim tempCur_New_FN = My.Application.Globix.CURRENT_NEWFILENAME.Replace("'", "''") Insert_String = sql_history_INSERT_INTO & ",ADDED_WHO) VALUES ('" & tempCur_WF & "','" & tempCur_New_FN & "'" & sql_history_Index_Values & ",'" & Environment.UserDomainName & "\" & Environment.UserName & "')" - My.Database.ExecuteNonQuery(Insert_String) + My.DatabaseECM.ExecuteNonQuery(Insert_String) If DropType.Contains("MSG") Or DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then If My.Application.Globix.CURRENT_MESSAGEID <> "" Then Dim max As String = "SELECT MAX(GUID) FROM TBGI_HISTORY" - Dim GUID = My.Database.GetScalarValue(max) + Dim GUID = My.DatabaseECM.GetScalarValue(max) Try If GUID > 0 Then Dim sqlUpdate As String If DropType = "|ATTMNTEXTRACTED|" Or DropType = "|OUTLOOK_ATTACHMENT|" Then sqlUpdate = "Update TBGI_HISTORY SET ATTACHMENT = 1, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & GUID - My.Database.ExecuteNonQuery(sqlUpdate) + My.DatabaseECM.ExecuteNonQuery(sqlUpdate) Else sqlUpdate = "Update TBGI_HISTORY SET ATTACHMENT = 0, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & GUID - My.Database.ExecuteNonQuery(sqlUpdate) + My.DatabaseECM.ExecuteNonQuery(sqlUpdate) End If End If Catch ex As Exception @@ -1194,6 +1193,8 @@ Public Class frmGlobix_Index NI_TITLE = "Error Globix-Import" NI_MESSAGE = "The import was not successful - Check LogFile" End If + + MsgBox(NI_MESSAGE, MsgBoxStyle.Critical, NI_TITLE) End If 'False oder True zurückgeben @@ -1225,9 +1226,9 @@ Public Class frmGlobix_Index Return True End If End If + Else + Return False End If - - Catch ex As Exception _Logger.Error(ex) Return False @@ -1250,19 +1251,19 @@ Public Class frmGlobix_Index Dim tempCur_WF = My.Application.Globix.CURRENT_WORKFILE.Replace("'", "''") Dim tempCur_New_FN = My.Application.Globix.CURRENT_NEWFILENAME.Replace("'", "''") Insert_String = sql_history_INSERT_INTO & ",ADDED_WHO,ADDED_WHERE) VALUES ('" & tempCur_WF & "','" & tempCur_New_FN & "'" & sql_history_Index_Values & ",'" & Environment.UserDomainName & "\" & Environment.UserName & "','" & Environment.MachineName & "')" - If My.Database.ExecuteNonQuery(Insert_String) = True Then + If My.DatabaseECM.ExecuteNonQuery(Insert_String) = True Then If My.Application.Globix.CURRENT_MESSAGEID <> "" Then Dim oMax As String = "SELECT MAX(GUID) FROM TBGI_HISTORY" - Dim oGUID = My.Database.GetScalarValue(oMax) + Dim oGUID = My.DatabaseECM.GetScalarValue(oMax) Try If oGUID > 0 Then Dim oSql As String If My.Application.Globix.CURRENT_ISATTACHMENT = True Then oSql = "Update TBGI_HISTORY SET ATTACHMENT = 1, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & oGUID - My.Database.GetScalarValue(oSql) + My.DatabaseECM.GetScalarValue(oSql) Else oSql = "Update TBGI_HISTORY SET ATTACHMENT = 0, MSG_ID = '" & My.Application.Globix.CURRENT_MESSAGEID & "' WHERE GUID = " & oGUID - My.Database.GetScalarValue(oSql) + My.DatabaseECM.GetScalarValue(oSql) End If End If Catch ex As Exception @@ -1772,7 +1773,7 @@ Public Class frmGlobix_Index Private Function SetAttachmentIndices() Dim indexierung_erfolgreich As Boolean = True Try - Dim DT As DataTable = My.Database.GetDatatable("SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = 'DEFAULT'") + Dim DT As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = 'DEFAULT'") If DT.Rows.Count = 1 Then If Not My.Application.Globix.CURRENT_MESSAGEID Is Nothing Then @@ -1824,7 +1825,7 @@ Public Class frmGlobix_Index If oRow.Item("SQL_CHECK").ToString <> String.Empty Then Dim connectionString As String Dim sql As String - connectionString = My.Database.Get_ConnectionStringforID(oRow.Item("CONNECTION_ID")) + connectionString = My.DatabaseECM.Get_ConnectionStringforID(oRow.Item("CONNECTION_ID")) If connectionString <> "" Then Dim sqlscalar = oRow.Item("SQL_CHECK") Select Case oRow.Item("DATENTYP") @@ -1840,7 +1841,7 @@ Public Class frmGlobix_Index ' ergebnis = ClassDatabase.OracleExecute_Scalar(sql, connectionString) 'Else 'MSQL - ergebnis = My.Database.GetScalarValueWithConnection(sql, connectionString) + ergebnis = My.DatabaseECM.GetScalarValueWithConnection(sql, connectionString) ' End If Select Case ergebnis @@ -2007,7 +2008,7 @@ Public Class frmGlobix_Index Function GetAutomaticIndexSQLValue(SQLCommand As String, vconnectionID As Integer, vProvider As String) As String Try Dim oConnectionString As String - oConnectionString = My.Database.Get_ConnectionStringforID(vconnectionID) + oConnectionString = My.DatabaseECM.Get_ConnectionStringforID(vconnectionID) If oConnectionString <> "" Then 'NEU Dim oErgebnis @@ -2015,7 +2016,7 @@ Public Class frmGlobix_Index 'If vProvider.ToLower = "oracle" Then 'oErgebnis = My.Database.leExecute_Scalar(SQLCommand, oConnectionString) 'Else 'im Moment nur SQL-Server - oErgebnis = My.Database.GetScalarValueWithConnection(SQLCommand, oConnectionString) + oErgebnis = My.DatabaseECM.GetScalarValueWithConnection(SQLCommand, oConnectionString) 'End If _Logger.Debug("SQL-ConnectionString: " & oConnectionString.Substring(0, oConnectionString.LastIndexOf("="))) If oErgebnis Is Nothing Then @@ -2120,7 +2121,7 @@ Public Class frmGlobix_Index End If Next - Dim DT As DataTable = My.Database.GetDatatable("SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = 'DEFAULT'") + Dim DT As DataTable = My.DatabaseECM.GetDatatable("SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX WHERE OBJECTTYPE = 'DEFAULT'") If IsNothing(DT) Then _Logger.Info("SELECT * FROM TBGI_OBJECTTYPE_EMAIL_INDEX RESULTED in NOTHING") Return False diff --git a/GUIs.ZooFlow/Globix/frmGlobix_IndexFileList.vb b/GUIs.ZooFlow/Globix/frmGlobix_IndexFileList.vb index 4f1e000a..96c37e51 100644 --- a/GUIs.ZooFlow/Globix/frmGlobix_IndexFileList.vb +++ b/GUIs.ZooFlow/Globix/frmGlobix_IndexFileList.vb @@ -2,7 +2,7 @@ Private Sub frmGlobixIndexFileList_Load(sender As Object, e As EventArgs) Handles Me.Load Try Dim oSQL = $"Select * From TBGI_FILES_USER Where WORKED = 0 And (UPPER([USER@WORK]) = UPPER('{My.Application.User.UserName}'))" - Dim oDT As DataTable = My.Database.GetDatatable(oSQL) + Dim oDT As DataTable = My.DatabaseECM.GetDatatable(oSQL) If oDT.Rows.Count > 0 Then CheckedListBox1.DataSource = oDT CheckedListBox1.DisplayMember = oDT.Columns("FILENAME_ONLY").ColumnName diff --git a/GUIs.ZooFlow/MyApplication.vb b/GUIs.ZooFlow/MyApplication.vb index 4268eef3..ca6c1bfb 100644 --- a/GUIs.ZooFlow/MyApplication.vb +++ b/GUIs.ZooFlow/MyApplication.vb @@ -2,7 +2,7 @@ Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Database Imports DigitalData.Modules.ZooFlow - +Imports DigitalData.Modules.EDMI.API Namespace My ''' @@ -28,10 +28,16 @@ Namespace My Property LogConfig As LogConfig Property MainForm As frmAdmin_Start Property SearchForm As frmSearchStart - Property Database As MSSQLServer + +#Region "Database" + Property Database As DatabaseWithFallback + Property DatabaseECM As MSSQLServer Property DatabaseIDB As MSSQLServer + Property Tables As New ClassTables Property Queries As New ClassQueries +#End Region + Property Filestore_Work As String Property Filestore_Archive As String End Module @@ -56,7 +62,7 @@ Namespace My Public Function GetEnvironment() As Environment Return New Environment With { - .Database = My.Database, + .Database = My.DatabaseECM, .DatabaseIDB = My.DatabaseIDB, .Modules = My.Application.Modules, .Service = My.Application.Service, diff --git a/GUIs.ZooFlow/Search/frmFlowSearch.vb b/GUIs.ZooFlow/Search/frmFlowSearch.vb index 27fccc65..d43ef1d2 100644 --- a/GUIs.ZooFlow/Search/frmFlowSearch.vb +++ b/GUIs.ZooFlow/Search/frmFlowSearch.vb @@ -1,10 +1,12 @@ -Imports DigitalData.Modules.Logging -Imports DevExpress.XtraEditors -Imports DigitalData.GUIs.Common +Imports DevExpress.XtraEditors Imports DevExpress.XtraSplashScreen Imports DevExpress.XtraBars -Imports DigitalData.GUIs.ZooFlow.ClassConstants Imports DevExpress.Utils +Imports DigitalData.GUIs.Common +Imports DigitalData.GUIs.ZooFlow.ClassConstants +Imports DigitalData.Modules.EDMI.API +Imports DigitalData.Modules.EDMI.API.Constants +Imports DigitalData.Modules.Logging Public Class frmFlowSearch Private Logger As Logger @@ -12,26 +14,26 @@ Public Class frmFlowSearch Private FontLargeNormal As New Font("Segoe UI", 10) Private SecondaryFontBold As New Font("Segoe UI", 8, FontStyle.Bold) Private SecondaryFont As New Font("Segoe UI", 8) - Dim oLastAttribute As String = "" - Dim oAttributeCount As Integer = 1 - Dim BASE_SEARCHCommand As String + Private oLastAttribute As String = "" + Private oAttributeCount As Integer = 1 + Private BaseSearchCommand As String Private LastSearchForm As frmDocumentResultList - Private ASorDB As ClassDataASorDB + Private Database As DatabaseWithFallback Private EventtoggleChange As Boolean = False - - Private SEARCH_FACT_DATE As String = "MONTH(OBJ.ADDED_WHEN) <> 13" - Private SEARCH_FACT_DATE_ATTRIBUTE = "ADDED_WHEN" Private Language_Term_Object As String Private LIMITATION_DATE As Boolean = False Private TOGGLE_Change As Boolean = False Private CATEGORIES_SELECTED As String = "" + Private SEARCH_FACT_DATE As String = "MONTH(OBJ.ADDED_WHEN) <> 13" + Private SEARCH_FACT_DATE_ATTRIBUTE = "ADDED_WHEN" + Public Sub New(pBaseSearchSql As String) ' Dieser Aufruf ist für den Designer erforderlich. InitializeComponent() - BASE_SEARCHCommand = pBaseSearchSql - ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu. + + BaseSearchCommand = pBaseSearchSql Logger = My.LogConfig.GetLogger() - ASorDB = New ClassDataASorDB(My.LogConfig) + Database = New DatabaseWithFallback(My.LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) If My.Application.User.Language = "de-DE" Then Language_Term_Object = "Objekte" Else @@ -43,7 +45,11 @@ Public Class frmFlowSearch RibbonControl1.Minimized = True TileControlMatch.Groups.Clear() Dim oSQL = "select DISTINCT TERM_VALUE AS CATEGORY ,ATTRIBUTE_ID from VWIDB_CATEGORIES_PER_OBJECT_AND_LANGUAGE WHERE LANGUAGE_ID = @LANGUAGE_ID ORDER BY TERM_VALUE" - Dim oDTCategory As DataTable = ASorDB.GetDatatable("IDB", $"SELECT 'NONE' as CATEGORY", "VWIDB_CATEGORIES_PER_OBJECT_AND_LANGUAGE", "", "CATEGORY") + + + 'Dim oDTCategory As DataTable = ASorDB.GetDatatable("IDB", $"SELECT 'NONE' as CATEGORY", "VWIDB_CATEGORIES_PER_OBJECT_AND_LANGUAGE", "", "CATEGORY") + Dim oDTCategory As DataTable = Database.GetDatatable("VWIDB_CATEGORIES_PER_OBJECT_AND_LANGUAGE", "SELECT 'NONE' as CATEGORY", DatabaseType.IDB, "", "CATEGORY") + If Not IsNothing(oDTCategory) Then CheckedListBoxCategories.DataSource = oDTCategory CheckedListBoxCategories.DisplayMember = "CATEGORY" @@ -53,7 +59,9 @@ Public Class frmFlowSearch Else cmbAttributeDate.Items.Add(IDB_ADDED_WHEN_String_Englisch) End If - Dim oDT As DataTable = ASorDB.GetDatatable("IDB", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}", "VWIDB_BE_ATTRIBUTE", $"TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}") + 'Dim oDT As DataTable = ASorDB.GetDatatable("IDB", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}", "VWIDB_BE_ATTRIBUTE", $"TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}") + Dim oDT As DataTable = Database.GetDatatable("VWIDB_BE_ATTRIBUTE", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}", DatabaseType.IDB, $"TYPE_ID = 5 AND LANG_ID = {My.Application.User.LanguageID}") + For Each oRow As DataRow In oDT.Rows cmbAttributeDate.Items.Add(oRow.Item("ATTR_TITLE")) Next @@ -90,7 +98,7 @@ Public Class frmFlowSearch Dim oSearchValue = Trim(txtSearchTerm.Text) oLastAttribute = "" - Dim oSQL = BASE_SEARCHCommand.Replace("@SEARCH_STRING", oSearchValue) + Dim oSQL = BaseSearchCommand.Replace("@SEARCH_STRING", oSearchValue) If SEARCH_FACT_DATE_ATTRIBUTE = "ADDED_WHEN" Then @@ -213,7 +221,7 @@ Public Class frmFlowSearch Dim oEnvironment As New Modules.ZooFlow.Environment() With { .User = My.Application.User, .Modules = My.Application.Modules, - .Database = My.Database, + .Database = My.DatabaseECM, .DatabaseIDB = My.DatabaseIDB, .Settings = My.Application.Settings, .Service = My.Application.Service @@ -365,7 +373,10 @@ Public Class frmFlowSearch Dim oSplit = oItem.Tag.ToString.Split("|") Try oHandle = SplashScreenManager.ShowOverlayForm(Me) - Dim oDT As DataTable = ASorDB.GetDatatable("IDB", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}", "VWIDB_BE_ATTRIBUTE", $"ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}") + + 'Dim oDT As DataTable = ASorDB.GetDatatable("IDB", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}", "VWIDB_BE_ATTRIBUTE", $"ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}") + Dim oDT As DataTable = Database.GetDatatable("VWIDB_BE_ATTRIBUTE", $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}", DatabaseType.IDB, $"ATTR_ID = {oSplit(1)} AND LANG_ID = {My.Application.User.LanguageID}") + Dim oType = oDT.Rows(0).Item("TYPE_NAME") Dim oEXECSQL = $"EXEC PRFLOW_SEARCH_GET_RESULT_PER_TILE {oSplit(0)},{My.Application.User.UserId},'{oType}',{oSplit(1)},'{My.Application.User.Language}'" Dim oDTOBJECT_RESULT As DataTable = My.DatabaseIDB.GetDatatable(oEXECSQL) diff --git a/GUIs.ZooFlow/Search/frmSearchStart.vb b/GUIs.ZooFlow/Search/frmSearchStart.vb index c16ed6fe..82bfbdbd 100644 --- a/GUIs.ZooFlow/Search/frmSearchStart.vb +++ b/GUIs.ZooFlow/Search/frmSearchStart.vb @@ -942,7 +942,7 @@ Public Class frmSearchStart Dim oEnvironment As New Modules.ZooFlow.Environment() With { .User = My.Application.User, .Modules = My.Application.Modules, - .Database = My.Database, + .Database = My.DatabaseECM, .DatabaseIDB = My.DatabaseIDB, .Settings = My.Application.Settings, .Service = My.Application.Service diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index 92469531..1c780955 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -49,7 +49,7 @@ Public Class frmFlowForm Private IndexForm As frmGlobix_Index Private AdminForm As frmAdmin_Start Private Const mSnapOffset As Integer = 35 - Private Const WM_WINDOWPOSCHANGING As Integer = &H46 + ' Events Public Event ClipboardChanged As EventHandler(Of IDataObject) @@ -77,6 +77,8 @@ Public Class frmFlowForm ' === Initialize AppServer Database Connection with Failover AppServerOrDB = New ClassDataASorDB(My.LogConfig) + + ' === Initialization === Init = New ClassInit(My.LogConfig, Me) AddHandler Init.Completed, AddressOf Init_Completed @@ -327,7 +329,7 @@ Public Class frmFlowForm Try Dim oSql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId - Dim oFolderwatchScanPath = My.Database.GetScalarValue(oSql) + Dim oFolderwatchScanPath = My.DatabaseECM.GetScalarValue(oSql) oFolderwatchScanPath = IIf(IsDBNull(oFolderwatchScanPath), "", oFolderwatchScanPath) @@ -565,7 +567,7 @@ Public Class frmFlowForm End If 'Erstmal alles löschen - My.Database.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") + My.DatabaseECM.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") If FileDrop.Drop_File(e) = True Then TimerCheckDroppedFiles.Start() @@ -590,7 +592,7 @@ Public Class frmFlowForm End Sub Sub Globix_Check_Dropped_Files() Try - My.Database.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") + My.DatabaseECM.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')") Dim i As Integer For Each Str As Object In FileDrop.files_dropped @@ -610,7 +612,7 @@ Public Class frmFlowForm Dim sql As String = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" My.Application.Globix.DTACTUAL_FILES = Nothing - My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql) + My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql) My.Application.Globix.ABORT_INDEXING = False Dim oOnlyFilesFromFilesystem = True @@ -624,7 +626,7 @@ Public Class frmFlowForm If My.Application.Globix.DTACTUAL_FILES.Rows.Count > 1 And oOnlyFilesFromFilesystem = False Then frmGlobix_IndexFileList.ShowDialog() My.Application.Globix.DTACTUAL_FILES = Nothing - My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql) + My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql) End If For Each oFileRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows @@ -797,7 +799,7 @@ Public Class frmFlowForm If My.Application.Globix.Folderwatchstarted = True Or My.UIConfig.Globix.FolderWatchScanStarted = True Then 'Prüfen ob alle Files abgearbeitet wurden Dim sql = "SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND HANDLE_TYPE like '%|FW%' AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')" - My.Application.Globix.DTACTUAL_FILES = My.Database.GetDatatable(sql) + My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql) If My.Application.Globix.DTACTUAL_FILES.Rows.Count > 0 Then My.Application.Globix.ABORT_INDEXING = False @@ -821,7 +823,7 @@ Public Class frmFlowForm Else Logger.Info(" File not existing - Row will be deleted!") Dim oDel = String.Format("DELETE FROM TBGI_FILES_USER WHERE GUID = {0}", FILEGUID) - My.Database.ExecuteNonQuery(oDel) + My.DatabaseECM.ExecuteNonQuery(oDel) End If Else Logger.Info(" file '" & row.Item(1).ToString & "' could not be opened exclusively - fileInUse!") diff --git a/GUIs.ZooFlow/frmtest.Designer.vb b/GUIs.ZooFlow/frmtest.Designer.vb index 48c1a7e5..442f0551 100644 --- a/GUIs.ZooFlow/frmtest.Designer.vb +++ b/GUIs.ZooFlow/frmtest.Designer.vb @@ -22,17 +22,9 @@ Partial Class frmtest 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. _ Private Sub InitializeComponent() - Me.txtFilestoreType = New System.Windows.Forms.TextBox() - Me.Button1 = New System.Windows.Forms.Button() - Me.txtIDBFOPath = New System.Windows.Forms.TextBox() - Me.txtDate = New System.Windows.Forms.TextBox() Me.Label2 = New System.Windows.Forms.Label() - Me.Label3 = New System.Windows.Forms.Label() - Me.Button2 = New System.Windows.Forms.Button() Me.txtIDB_OBJ_ID = New System.Windows.Forms.TextBox() - Me.Button3 = New System.Windows.Forms.Button() Me.txtFile2Import = New System.Windows.Forms.TextBox() - Me.Label1 = New System.Windows.Forms.Label() Me.Button4 = New System.Windows.Forms.Button() Me.Button5 = New System.Windows.Forms.Button() Me.CheckBoxKeepExtension = New System.Windows.Forms.CheckBox() @@ -40,103 +32,45 @@ Partial Class frmtest Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog() Me.Button7 = New System.Windows.Forms.Button() Me.Button8 = New System.Windows.Forms.Button() + Me.Label4 = New System.Windows.Forms.Label() + Me.Label5 = New System.Windows.Forms.Label() + Me.cmbObjectStoreType = New System.Windows.Forms.ComboBox() + Me.DateTimePicker1 = New System.Windows.Forms.DateTimePicker() + Me.Label6 = New System.Windows.Forms.Label() + Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.GroupBox1 = New System.Windows.Forms.GroupBox() + Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' - 'txtFilestoreType - ' - Me.txtFilestoreType.Location = New System.Drawing.Point(16, 62) - Me.txtFilestoreType.Name = "txtFilestoreType" - Me.txtFilestoreType.Size = New System.Drawing.Size(100, 20) - Me.txtFilestoreType.TabIndex = 2 - ' - 'Button1 - ' - Me.Button1.Location = New System.Drawing.Point(152, 58) - Me.Button1.Name = "Button1" - Me.Button1.Size = New System.Drawing.Size(137, 23) - Me.Button1.TabIndex = 3 - Me.Button1.Text = "2. GetFileName" - Me.Button1.UseVisualStyleBackColor = True - ' - 'txtIDBFOPath - ' - Me.txtIDBFOPath.Location = New System.Drawing.Point(152, 87) - Me.txtIDBFOPath.Name = "txtIDBFOPath" - Me.txtIDBFOPath.ReadOnly = True - Me.txtIDBFOPath.Size = New System.Drawing.Size(495, 20) - Me.txtIDBFOPath.TabIndex = 4 - ' - 'txtDate - ' - Me.txtDate.Location = New System.Drawing.Point(16, 101) - Me.txtDate.Name = "txtDate" - Me.txtDate.Size = New System.Drawing.Size(100, 20) - Me.txtDate.TabIndex = 5 - ' 'Label2 ' Me.Label2.AutoSize = True - Me.Label2.Location = New System.Drawing.Point(16, 43) + Me.Label2.Location = New System.Drawing.Point(9, 66) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(72, 13) Me.Label2.TabIndex = 6 Me.Label2.Text = "FileStoreType" ' - 'Label3 - ' - Me.Label3.AutoSize = True - Me.Label3.Location = New System.Drawing.Point(16, 85) - Me.Label3.Name = "Label3" - Me.Label3.Size = New System.Drawing.Size(30, 13) - Me.Label3.TabIndex = 7 - Me.Label3.Text = "Date" - ' - 'Button2 - ' - Me.Button2.Location = New System.Drawing.Point(12, 12) - Me.Button2.Name = "Button2" - Me.Button2.Size = New System.Drawing.Size(277, 23) - Me.Button2.TabIndex = 8 - Me.Button2.Text = "1. Get IDB_OBJ_ID" - Me.Button2.UseVisualStyleBackColor = True - ' 'txtIDB_OBJ_ID ' Me.txtIDB_OBJ_ID.DataBindings.Add(New System.Windows.Forms.Binding("Text", Global.DigitalData.GUIs.ZooFlow.Settings.Default, "IDBOBJID", True, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged)) - Me.txtIDB_OBJ_ID.Location = New System.Drawing.Point(295, 14) + Me.txtIDB_OBJ_ID.Location = New System.Drawing.Point(137, 38) Me.txtIDB_OBJ_ID.Name = "txtIDB_OBJ_ID" Me.txtIDB_OBJ_ID.Size = New System.Drawing.Size(100, 20) Me.txtIDB_OBJ_ID.TabIndex = 9 Me.txtIDB_OBJ_ID.Text = Global.DigitalData.GUIs.ZooFlow.Settings.Default.IDBOBJID ' - 'Button3 - ' - Me.Button3.Location = New System.Drawing.Point(16, 188) - Me.Button3.Name = "Button3" - Me.Button3.Size = New System.Drawing.Size(175, 23) - Me.Button3.TabIndex = 10 - Me.Button3.Text = "3. Import/StreamFile" - Me.Button3.UseVisualStyleBackColor = True - ' 'txtFile2Import ' - Me.txtFile2Import.Location = New System.Drawing.Point(16, 162) + Me.txtFile2Import.Location = New System.Drawing.Point(137, 12) Me.txtFile2Import.Name = "txtFile2Import" - Me.txtFile2Import.Size = New System.Drawing.Size(551, 20) + Me.txtFile2Import.Size = New System.Drawing.Size(426, 20) Me.txtFile2Import.TabIndex = 11 ' - 'Label1 - ' - Me.Label1.AutoSize = True - Me.Label1.Location = New System.Drawing.Point(16, 143) - Me.Label1.Name = "Label1" - Me.Label1.Size = New System.Drawing.Size(58, 13) - Me.Label1.TabIndex = 12 - Me.Label1.Text = "File2Import" - ' 'Button4 ' - Me.Button4.Location = New System.Drawing.Point(16, 234) + Me.Button4.Location = New System.Drawing.Point(16, 345) Me.Button4.Name = "Button4" Me.Button4.Size = New System.Drawing.Size(286, 23) Me.Button4.TabIndex = 13 @@ -145,7 +79,7 @@ Partial Class frmtest ' 'Button5 ' - Me.Button5.Location = New System.Drawing.Point(16, 263) + Me.Button5.Location = New System.Drawing.Point(16, 374) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(286, 23) Me.Button5.TabIndex = 14 @@ -155,7 +89,9 @@ Partial Class frmtest 'CheckBoxKeepExtension ' Me.CheckBoxKeepExtension.AutoSize = True - Me.CheckBoxKeepExtension.Location = New System.Drawing.Point(307, 62) + Me.CheckBoxKeepExtension.Checked = True + Me.CheckBoxKeepExtension.CheckState = System.Windows.Forms.CheckState.Checked + Me.CheckBoxKeepExtension.Location = New System.Drawing.Point(16, 19) Me.CheckBoxKeepExtension.Name = "CheckBoxKeepExtension" Me.CheckBoxKeepExtension.Size = New System.Drawing.Size(100, 17) Me.CheckBoxKeepExtension.TabIndex = 15 @@ -164,7 +100,7 @@ Partial Class frmtest ' 'Button6 ' - Me.Button6.Location = New System.Drawing.Point(572, 160) + Me.Button6.Location = New System.Drawing.Point(569, 9) Me.Button6.Name = "Button6" Me.Button6.Size = New System.Drawing.Size(75, 23) Me.Button6.TabIndex = 16 @@ -177,7 +113,7 @@ Partial Class frmtest ' 'Button7 ' - Me.Button7.Location = New System.Drawing.Point(16, 292) + Me.Button7.Location = New System.Drawing.Point(16, 403) Me.Button7.Name = "Button7" Me.Button7.Size = New System.Drawing.Size(286, 23) Me.Button7.TabIndex = 14 @@ -186,52 +122,115 @@ Partial Class frmtest ' 'Button8 ' - Me.Button8.Location = New System.Drawing.Point(666, 14) + Me.Button8.Location = New System.Drawing.Point(12, 142) Me.Button8.Name = "Button8" Me.Button8.Size = New System.Drawing.Size(187, 23) Me.Button8.TabIndex = 17 - Me.Button8.Text = "1B. All-In-One" + Me.Button8.Text = "Import File" Me.Button8.UseVisualStyleBackColor = True ' + 'Label4 + ' + Me.Label4.AutoSize = True + Me.Label4.Location = New System.Drawing.Point(9, 14) + Me.Label4.Name = "Label4" + Me.Label4.Size = New System.Drawing.Size(48, 13) + Me.Label4.TabIndex = 18 + Me.Label4.Text = "File Path" + ' + 'Label5 + ' + Me.Label5.AutoSize = True + Me.Label5.Location = New System.Drawing.Point(9, 41) + Me.Label5.Name = "Label5" + Me.Label5.Size = New System.Drawing.Size(47, 13) + Me.Label5.TabIndex = 18 + Me.Label5.Text = "ObjectId" + ' + 'cmbObjectStoreType + ' + Me.cmbObjectStoreType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList + Me.cmbObjectStoreType.FormattingEnabled = True + Me.cmbObjectStoreType.Items.AddRange(New Object() {"Work", "Archive"}) + Me.cmbObjectStoreType.Location = New System.Drawing.Point(137, 63) + Me.cmbObjectStoreType.Name = "cmbObjectStoreType" + Me.cmbObjectStoreType.Size = New System.Drawing.Size(121, 21) + Me.cmbObjectStoreType.TabIndex = 19 + ' + 'DateTimePicker1 + ' + Me.DateTimePicker1.Location = New System.Drawing.Point(137, 90) + Me.DateTimePicker1.Name = "DateTimePicker1" + Me.DateTimePicker1.Size = New System.Drawing.Size(200, 20) + Me.DateTimePicker1.TabIndex = 20 + ' + 'Label6 + ' + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(9, 96) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(30, 13) + Me.Label6.TabIndex = 6 + Me.Label6.Text = "Date" + ' + 'TextBox1 + ' + Me.TextBox1.Location = New System.Drawing.Point(137, 183) + Me.TextBox1.Name = "TextBox1" + Me.TextBox1.Size = New System.Drawing.Size(426, 20) + Me.TextBox1.TabIndex = 21 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(9, 186) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(98, 13) + Me.Label1.TabIndex = 18 + Me.Label1.Text = "File Path (Imported)" + ' + 'GroupBox1 + ' + Me.GroupBox1.Controls.Add(Me.CheckBoxKeepExtension) + Me.GroupBox1.Location = New System.Drawing.Point(653, 12) + Me.GroupBox1.Name = "GroupBox1" + Me.GroupBox1.Size = New System.Drawing.Size(200, 100) + Me.GroupBox1.TabIndex = 22 + Me.GroupBox1.TabStop = False + Me.GroupBox1.Text = "Import Options" + ' 'frmtest ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(865, 450) + Me.Controls.Add(Me.GroupBox1) + Me.Controls.Add(Me.TextBox1) + Me.Controls.Add(Me.DateTimePicker1) + Me.Controls.Add(Me.cmbObjectStoreType) + Me.Controls.Add(Me.Label5) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Label4) Me.Controls.Add(Me.Button8) Me.Controls.Add(Me.Button6) - Me.Controls.Add(Me.CheckBoxKeepExtension) Me.Controls.Add(Me.Button7) Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.Button4) - Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.txtFile2Import) - Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.txtIDB_OBJ_ID) - Me.Controls.Add(Me.Button2) - Me.Controls.Add(Me.Label3) + Me.Controls.Add(Me.Label6) Me.Controls.Add(Me.Label2) - Me.Controls.Add(Me.txtDate) - Me.Controls.Add(Me.txtIDBFOPath) - Me.Controls.Add(Me.Button1) - Me.Controls.Add(Me.txtFilestoreType) Me.Name = "frmtest" Me.Text = "frmtest" + Me.GroupBox1.ResumeLayout(False) + Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub - Friend WithEvents txtFilestoreType As TextBox - Friend WithEvents Button1 As Button - Friend WithEvents txtIDBFOPath As TextBox - Friend WithEvents txtDate As TextBox Friend WithEvents Label2 As Label - Friend WithEvents Label3 As Label - Friend WithEvents Button2 As Button Friend WithEvents txtIDB_OBJ_ID As TextBox - Friend WithEvents Button3 As Button Friend WithEvents txtFile2Import As TextBox - Friend WithEvents Label1 As Label Friend WithEvents Button4 As Button Friend WithEvents Button5 As Button Friend WithEvents CheckBoxKeepExtension As CheckBox @@ -239,4 +238,12 @@ Partial Class frmtest Friend WithEvents OpenFileDialog1 As OpenFileDialog Friend WithEvents Button7 As Button Friend WithEvents Button8 As Button + Friend WithEvents Label4 As Label + Friend WithEvents Label5 As Label + Friend WithEvents cmbObjectStoreType As ComboBox + Friend WithEvents DateTimePicker1 As DateTimePicker + Friend WithEvents Label6 As Label + Friend WithEvents TextBox1 As TextBox + Friend WithEvents Label1 As Label + Friend WithEvents GroupBox1 As GroupBox End Class diff --git a/GUIs.ZooFlow/frmtest.vb b/GUIs.ZooFlow/frmtest.vb index 1a973fa8..0ca0bb49 100644 --- a/GUIs.ZooFlow/frmtest.vb +++ b/GUIs.ZooFlow/frmtest.vb @@ -5,56 +5,56 @@ Imports System.IO Imports System.Text Public Class frmtest - Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click - My.Settings.Save() - Dim oString As String - Dim oextension = "" - Dim oKeepExtension As Boolean = False - If CheckBoxKeepExtension.Checked Then - If txtFile2Import.Text <> String.Empty Then - oextension = Path.GetExtension(txtFile2Import.Text) - oKeepExtension = True - End If + 'Private Sub Button1_Click(sender As Object, e As EventArgs) + ' My.Settings.Save() + ' Dim oString As String + ' Dim oextension = "" + ' Dim oKeepExtension As Boolean = False + ' If CheckBoxKeepExtension.Checked Then + ' If txtFile2Import.Text <> String.Empty Then + ' oextension = Path.GetExtension(txtFile2Import.Text) + ' oKeepExtension = True + ' End If - End If - oString = My.Application.Service.Client.CreateFileStoreObject(txtIDB_OBJ_ID.Text, txtFilestoreType.Text, txtDate.Text, oextension, oKeepExtension) - txtIDBFOPath.Text = oString + ' End If + ' oString = My.Application.Service.Client.CreateFileStoreObject(txtIDB_OBJ_ID.Text, txtFilestoreType.Text, txtDate.Text, oextension, oKeepExtension) + ' txtIDBFOPath.Text = oString - End Sub + 'End Sub - Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click - Dim oString As String - oString = My.Application.Service.Client.CreateObjectId("DOC", My.Application.User.UserName, "") - txtIDB_OBJ_ID.Text = oString - End Sub + 'Private Sub Button2_Click(sender As Object, e As EventArgs) + ' Dim oString As String + ' oString = My.Application.Service.Client.CreateObjectId("DOC", My.Application.User.UserName, "") + ' txtIDB_OBJ_ID.Text = oString + 'End Sub - Private Async Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click - Try - Dim oResult As Boolean = False + 'Private Async Sub Button3_Click(sender As Object, e As EventArgs) + ' Try + ' Dim oResult As Boolean = False - Using oStream As New FileStream(txtFile2Import.Text, FileMode.Open, FileAccess.Read) - Using oMemoryStream As New MemoryStream - oStream.CopyTo(oMemoryStream) - Dim oContents As Byte() = oMemoryStream.ToArray() - oResult = Await My.Application.Service.Client.ImportFileObjectAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text) - End Using - End Using + ' Using oStream As New FileStream(txtFile2Import.Text, FileMode.Open, FileAccess.Read) + ' Using oMemoryStream As New MemoryStream + ' oStream.CopyTo(oMemoryStream) + ' Dim oContents As Byte() = oMemoryStream.ToArray() + ' oResult = Await My.Application.Service.Client.ImportFileObjectAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, "WORK", txtIDBFOPath.Text) + ' End Using + ' End Using - If oResult = False Then - MsgBox("Oh no error", MsgBoxStyle.Critical) - Else - MsgBox("#Nailedit") - End If - Catch ex As Exception - MsgBox(ex.Message) - End Try - End Sub + ' If oResult = False Then + ' MsgBox("Oh no error", MsgBoxStyle.Critical) + ' Else + ' MsgBox("#Nailedit") + ' End If + ' Catch ex As Exception + ' MsgBox(ex.Message) + ' End Try + 'End Sub Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click Try Dim oextension = Path.GetExtension(txtFile2Import.Text) Dim oFile = $"E:\file{oextension}" - Using oInputStream As New FileStream(txtIDBFOPath.Text, FileMode.Open) + Using oInputStream As New FileStream(TextBox1.Text, FileMode.Open) Using oFileStream As New FileStream(oFile, FileMode.Create, FileAccess.Write) oInputStream.CopyTo(oFileStream) End Using @@ -91,38 +91,26 @@ Public Class frmtest Dim oExt = Path.GetExtension(txtFile2Import.Text) Dim oFile = $"E:\file{oExt}" - File.Copy(txtIDBFOPath.Text, oFile) + File.Copy(TextBox1.Text, oFile) End Sub Private Async Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click - Dim oResult As Object + Dim oResult As Long = Await My.Application.Service.Client.NewFileAsync( + txtFile2Import.Text, + Environment.UserName, + DateTimePicker1.Value, + cmbObjectStoreType.Text, + "DEFAULT", + New Client.ImportFileOptions With { + .KeepExtension = True + } + ) - If OpenFileDialog1.ShowDialog() <> DialogResult.OK Then - Exit Sub - End If + txtIDB_OBJ_ID.Text = oResult + MsgBox("File Imported!") + End Sub - txtFile2Import.Text = OpenFileDialog1.FileName - - Using oStream As New FileStream(txtFile2Import.Text, FileMode.Open, FileAccess.Read) - Using oMemoryStream As New MemoryStream - oStream.CopyTo(oMemoryStream) - Dim oContents As Byte() = oMemoryStream.ToArray() - - oResult = Await My.Application.Service.Client.ImportFileAsync( - txtFile2Import.Text, - Environment.UserName, - Date.Now, - "WORK", - 1, - "DEFAULT", - New Client.ImportFileOptions With { - .KeepExtension = True - } - ) - - MsgBox($"File saved to: [{oResult}]") - 'oResult = Await My.Application.Service.Client.ImportFileObjectAsync(oContents, My.Application.User.UserName, txtIDB_OBJ_ID.Text, 1, txtIDBFOPath.Text) - End Using - End Using + Private Sub frmtest_Load(sender As Object, e As EventArgs) Handles MyBase.Load + cmbObjectStoreType.SelectedIndex = 0 End Sub End Class \ No newline at end of file diff --git a/Modules.Config/ConfigManager.vb b/Modules.Config/ConfigManager.vb index f471fb08..e0f9bb7d 100644 --- a/Modules.Config/ConfigManager.vb +++ b/Modules.Config/ConfigManager.vb @@ -114,11 +114,15 @@ Public Class ConfigManager(Of T) _UserConfigPath = Path.Combine(_UserDirectory, USER_CONFIG_NAME) If ComputerConfigPath <> String.Empty Then - _ComputerDirectory = _File.CreateDirectory(ComputerConfigPath) + If IO.File.Exists(ComputerConfigPath) Then + _ComputerDirectory = _File.CreateDirectory(ComputerConfigPath, False) + Else + _ComputerDirectory = ComputerConfigPath + End If _ComputerConfigPath = Path.Combine(_ComputerDirectory, COMPUTER_CONFIG_NAME) End If - If ApplicationStartupPath <> String.Empty Then + If ApplicationStartupPath <> String.Empty Then _Logger.Debug($"AppConfig is being used: [{ApplicationStartupPath}]") _AppConfigPath = Path.Combine(ApplicationStartupPath, APP_CONFIG_NAME) End If diff --git a/Modules.Config/My Project/AssemblyInfo.vb b/Modules.Config/My Project/AssemblyInfo.vb index 74781c84..b931d61d 100644 --- a/Modules.Config/My Project/AssemblyInfo.vb +++ b/Modules.Config/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Modules.EDMIAPI/Client.vb b/Modules.EDMIAPI/Client.vb index 99f3983d..bc965558 100644 --- a/Modules.EDMIAPI/Client.vb +++ b/Modules.EDMIAPI/Client.vb @@ -5,9 +5,14 @@ Imports System.ServiceModel Imports System.IO Public Class Client + Private Const INVALID_OBEJCT_ID As Long = 0 + Private Const KIND_TYPE_DOC = "DOC" + + Public Const DEFAULT_SERVICE_PORT = 9000 + Private ReadOnly _logger As Logger Private ReadOnly _channelFactory As ChannelFactory(Of IEDMIServiceChannel) - Private _IPAddressServer As String + Private ReadOnly _IPAddressServer As String Private _channel As IEDMIServiceChannel Public Class StreamedFile @@ -24,11 +29,27 @@ Public Class Client Public AccessRight As AccessRight End Class + Public Shared Function ParseServiceAddress(AddressWithOptionalPort As String) As Tuple(Of String, Integer) + Dim oSplit() As String = AddressWithOptionalPort.Split(":"c) + Dim oAppServerAddress As String = oSplit(0) + Dim oAppServerPort As Integer + + If oSplit.Length = 2 Then + 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 + ''' - ''' Creates a new EDMIAPI object + ''' Creates a new EDMI Client object ''' ''' LogConfig object - ''' The full service url to connect to + ''' The full service url to connect to, for example: net.tcp://1.1.1.1:1111/some/path Public Sub New(LogConfig As LogConfig, ServiceAdress As String) _logger = LogConfig.GetLogger() @@ -43,6 +64,12 @@ Public Class Client End Try End Sub + ''' + ''' Creates a new EDMI Client object + ''' + ''' LogConfig object + ''' The IP address to connect to + ''' The Port number to use for the connection Public Sub New(LogConfig As LogConfig, IPAddress As String, PortNumber As Integer) _logger = LogConfig.GetLogger() @@ -78,20 +105,37 @@ Public Class Client End Try End Function + ''' + ''' Import options for NewFileAsync. Contains default values for all options + ''' Public Class ImportFileOptions - Public KeepExtension As Boolean + Public KeepExtension As Boolean = True End Class ''' - ''' Imports a file by filename + ''' TODO: Creates a new object ''' - ''' A document object - Public Async Function ImportFileAsync(pFilePath As String, pWho As String, pWhen As Date, pObjectStoreType As String, pObjectStoreId As Long, pBusinessEntity As String, ImportOptions As ImportFileOptions) As Task(Of String) - 'pObjectId As Long, pStoreType As String, pDate As String, pExtension As String, pKeepExtension As String - Dim oKindType = "DOC" + ''' + Public Async Function NewObjectAsync() As Task + Throw New NotImplementedException() + End Function + + ''' + ''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object + ''' + ''' Local filepath to a file. + ''' Windows username of the user responsible for the import. + ''' Date when the file was imported. Can be in the past. + ''' Type of ObjectStore. Can be WORK or ARCHIVE. + ''' Business entity that the new file object should belong to. + ''' Other file import options + ''' When local filepath was not found + ''' When there was a error in the Service + ''' The ObjectId of the newly generated filesystem object + Public Async Function NewFileAsync(pFilePath As String, pAddedWho As String, pAddedWhen As Date, pObjectStoreType As String, pBusinessEntity As String, pImportOptions As ImportFileOptions) As Task(Of Long) Try If File.Exists(pFilePath) = False Then - Throw New ApplicationException("ImportFileAsync: Path does not exist") + Throw New FileNotFoundException("ImportFileAsync: Path does not exist") End If Dim oFileInfo As New FileInfo(pFilePath) @@ -99,8 +143,8 @@ Public Class Client Dim oObjectIdResponse = Await _channel.NewObjectIdAsync(New NewObjectIdRequest With { .BusinessEntity = pBusinessEntity, - .KindType = oKindType, - .Who = pWho + .KindType = KIND_TYPE_DOC, + .Who = pAddedWho }) If oObjectIdResponse.ObjectId = Nothing OrElse oObjectIdResponse.ObjectId = 0 Then @@ -108,9 +152,9 @@ Public Class Client End If Dim oFilePathResponse = Await _channel.NewFileObjectAsync(New NewFileObjectRequest With { - .DateImported = pWhen, + .DateImported = pAddedWhen, .Extension = oExtension, - .KeepExtension = ImportOptions.KeepExtension, + .KeepExtension = pImportOptions.KeepExtension, .ObjectId = oObjectIdResponse.ObjectId, .StoreType = pObjectStoreType }) @@ -125,10 +169,10 @@ Public Class Client Dim oContents = oMemoryStream.ToArray() Dim oFileImportResponse = Await _channel.ImportFileIntoFileObjectAsync(New ImportFileIntoFileObjectRequest With { - .pIDBFilePath = oFilePathResponse.FileObjectPath, - .pIDB_OBJ_ID = oObjectIdResponse.ObjectId, - .pObjectStoreID = pObjectStoreId, - .pWho = pWho, + .FilePath = oFilePathResponse.FileObjectPath, + .ObjectId = oObjectIdResponse.ObjectId, + .ObjectStoreType = pObjectStoreType, + .Who = pAddedWho, .Contents = oContents }) @@ -138,48 +182,20 @@ Public Class Client End Using End Using - Return oFilePathResponse.FileObjectPath + Return oObjectIdResponse.ObjectId Catch ex As Exception _logger.Error(ex) - Return Nothing + Return INVALID_OBEJCT_ID End Try End Function - 'Public Async Function ImportFileAsync(FilePath As String, DocumentType As String, ObjectStoreId As Long, Optional RetentionDays As Integer = 0) As Task(Of Long) - ' Try - ' Dim oFileInfo As New FileInfo(FilePath) - ' If oFileInfo.Exists = False Then - ' Throw New FileNotFoundException("Cannot import non-existing file.", FilePath) - ' End If - - ' Using oStream As New FileStream(FilePath, FileMode.Open) - ' Dim oContents(oStream.Length) As Byte - ' Dim oBytesRead = Await oStream.ReadAsync(oContents, 0, oStream.Length) - ' Dim oData As New DocumentImportRequest() With { - ' .FileName = oFileInfo.Name, - ' .Contents = oContents, - ' .DocumentType = DocumentType, - ' .ObjectStoreId = ObjectStoreId, - ' .RetentionDays = RetentionDays - ' } - - ' Dim oResponse = Await _channel.ImportFileAsync(oData) - - ' Return oResponse.ObjectId - ' End Using - ' Catch ex As Exception - ' _logger.Error(ex) - ' Throw ex - ' End Try - 'End Function Public Function CreateObjectId(pKindType As String, pWho As String, pBusinessEntity As String) As Long Try - Dim oArgs As New NewObjectIdRequest With { + Dim oResponse = _channel.NewObjectId(New NewObjectIdRequest With { .KindType = pKindType, .BusinessEntity = pBusinessEntity, .Who = pWho - } - Dim oResponse = _channel.NewObjectId(oArgs) + }) Return oResponse.ObjectId Catch ex As Exception _logger.Error(ex) @@ -209,14 +225,14 @@ Public Class Client End Try End Function - Public Async Function ImportFileObjectAsync(pContent As Byte(), pWho As String, pObjectId As Long, pObjectStoreID As Short, pFileObjectPath As String) As Task(Of Boolean) + Public Async Function ImportFileObjectAsync(pContent As Byte(), pWho As String, pObjectId As Long, pObjectStoreType As String, pFileObjectPath As String) As Task(Of Boolean) Try Dim oData As New ImportFileIntoFileObjectRequest() With { .Contents = pContent, - .pWho = pWho, - .pIDBFilePath = pFileObjectPath, - .pIDB_OBJ_ID = pObjectId, - .pObjectStoreID = pObjectStoreID + .Who = pWho, + .FilePath = pFileObjectPath, + .ObjectId = pObjectId, + .ObjectStoreType = pObjectStoreType } Dim oResponse = Await _channel.ImportFileIntoFileObjectAsync(oData) diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd index 07de0764..d913a0c6 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/DigitalData.Services.EDMIService.xsd @@ -264,10 +264,10 @@ - - - - + + + + diff --git a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb index 95fd2b6c..0cd31dc0 100644 --- a/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb +++ b/Modules.EDMIAPI/Connected Services/EDMIServiceReference/Reference.vb @@ -755,176 +755,176 @@ Namespace EDMIServiceReference _ Public Contents() As Byte - - _ - Public pIDBFilePath As String - - _ - Public pIDB_OBJ_ID As Long - - _ - Public pObjectStoreID As Integer - - _ - Public pWho As String - + + + Public FilePath As String + + + Public ObjectId As Long + + + Public ObjectStoreType As String + + + Public Who As String + Public Sub New() MyBase.New End Sub - - Public Sub New(ByVal Contents() As Byte, ByVal pIDBFilePath As String, ByVal pIDB_OBJ_ID As Long, ByVal pObjectStoreID As Integer, ByVal pWho As String) + + Public Sub New(ByVal Contents() As Byte, ByVal FilePath As String, ByVal ObjectId As Long, ByVal ObjectStoreType As String, ByVal Who As String) MyBase.New Me.Contents = Contents - Me.pIDBFilePath = pIDBFilePath - Me.pIDB_OBJ_ID = pIDB_OBJ_ID - Me.pObjectStoreID = pObjectStoreID - Me.pWho = pWho + Me.FilePath = FilePath + Me.ObjectId = ObjectId + Me.ObjectStoreType = ObjectStoreType + Me.Who = Who End Sub End Class - - _ + + Partial Public Class ImportFileIntoFileObjectResponse - - _ + + Public Result As Boolean - + Public Sub New() MyBase.New End Sub - + Public Sub New(ByVal Result As Boolean) MyBase.New Me.Result = Result End Sub End Class - - _ + + Public Interface IEDMIServiceChannel Inherits EDMIServiceReference.IEDMIService, System.ServiceModel.IClientChannel End Interface - - _ + + Partial Public Class EDMIServiceClient Inherits System.ServiceModel.ClientBase(Of EDMIServiceReference.IEDMIService) Implements EDMIServiceReference.IEDMIService - + Public Sub New() MyBase.New End Sub - + Public Sub New(ByVal endpointConfigurationName As String) MyBase.New(endpointConfigurationName) End Sub - + Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String) MyBase.New(endpointConfigurationName, remoteAddress) End Sub - + Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As System.ServiceModel.EndpointAddress) MyBase.New(endpointConfigurationName, remoteAddress) End Sub - + Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, ByVal remoteAddress As System.ServiceModel.EndpointAddress) MyBase.New(binding, remoteAddress) End Sub - + Public Function Heartbeat() As Boolean Implements EDMIServiceReference.IEDMIService.Heartbeat Return MyBase.Channel.Heartbeat End Function - + Public Function HeartbeatAsync() As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMIService.HeartbeatAsync Return MyBase.Channel.HeartbeatAsync End Function - + Public Function ReturnDatatableFromCache(ByVal Name As String, ByVal FilterExpression As String, ByVal SortByColumn As String) As EDMIServiceReference.TableResult Implements EDMIServiceReference.IEDMIService.ReturnDatatableFromCache Return MyBase.Channel.ReturnDatatableFromCache(Name, FilterExpression, SortByColumn) End Function - + Public Function ReturnDatatableFromCacheAsync(ByVal Name As String, ByVal FilterExpression As String, ByVal SortByColumn As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.TableResult) Implements EDMIServiceReference.IEDMIService.ReturnDatatableFromCacheAsync Return MyBase.Channel.ReturnDatatableFromCacheAsync(Name, FilterExpression, SortByColumn) End Function - + Public Function ReturnDatatable_Firebird(ByVal SQL As String) As EDMIServiceReference.TableResult Implements EDMIServiceReference.IEDMIService.ReturnDatatable_Firebird Return MyBase.Channel.ReturnDatatable_Firebird(SQL) End Function - + Public Function ReturnDatatable_FirebirdAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.TableResult) Implements EDMIServiceReference.IEDMIService.ReturnDatatable_FirebirdAsync Return MyBase.Channel.ReturnDatatable_FirebirdAsync(SQL) End Function - + Public Function ReturnScalar_Firebird(ByVal SQL As String) As EDMIServiceReference.ScalarResult Implements EDMIServiceReference.IEDMIService.ReturnScalar_Firebird Return MyBase.Channel.ReturnScalar_Firebird(SQL) End Function - + Public Function ReturnScalar_FirebirdAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ScalarResult) Implements EDMIServiceReference.IEDMIService.ReturnScalar_FirebirdAsync Return MyBase.Channel.ReturnScalar_FirebirdAsync(SQL) End Function - + Public Function ExecuteNonQuery_Firebird(ByVal SQL As String) As EDMIServiceReference.NonQueryResult Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_Firebird Return MyBase.Channel.ExecuteNonQuery_Firebird(SQL) End Function - + Public Function ExecuteNonQuery_FirebirdAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult) Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_FirebirdAsync Return MyBase.Channel.ExecuteNonQuery_FirebirdAsync(SQL) End Function - + Public Function ReturnDatatable_MSSQL_IDB(ByVal SQL As String) As EDMIServiceReference.TableResult Implements EDMIServiceReference.IEDMIService.ReturnDatatable_MSSQL_IDB Return MyBase.Channel.ReturnDatatable_MSSQL_IDB(SQL) End Function - + Public Function ReturnDatatable_MSSQL_IDBAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.TableResult) Implements EDMIServiceReference.IEDMIService.ReturnDatatable_MSSQL_IDBAsync Return MyBase.Channel.ReturnDatatable_MSSQL_IDBAsync(SQL) End Function - + Public Function ReturnScalar_MSSQL_IDB(ByVal SQL As String) As EDMIServiceReference.ScalarResult Implements EDMIServiceReference.IEDMIService.ReturnScalar_MSSQL_IDB Return MyBase.Channel.ReturnScalar_MSSQL_IDB(SQL) End Function - + Public Function ReturnScalar_MSSQL_IDBAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ScalarResult) Implements EDMIServiceReference.IEDMIService.ReturnScalar_MSSQL_IDBAsync Return MyBase.Channel.ReturnScalar_MSSQL_IDBAsync(SQL) End Function - + Public Function ExecuteNonQuery_MSSQL_IDB(ByVal SQL As String) As EDMIServiceReference.NonQueryResult Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_MSSQL_IDB Return MyBase.Channel.ExecuteNonQuery_MSSQL_IDB(SQL) End Function - + Public Function ExecuteNonQuery_MSSQL_IDBAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult) Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_MSSQL_IDBAsync Return MyBase.Channel.ExecuteNonQuery_MSSQL_IDBAsync(SQL) End Function - + Public Function ReturnDatatable_MSSQL_ECM(ByVal SQL As String) As EDMIServiceReference.TableResult Implements EDMIServiceReference.IEDMIService.ReturnDatatable_MSSQL_ECM Return MyBase.Channel.ReturnDatatable_MSSQL_ECM(SQL) End Function - + Public Function ReturnDatatable_MSSQL_ECMAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.TableResult) Implements EDMIServiceReference.IEDMIService.ReturnDatatable_MSSQL_ECMAsync Return MyBase.Channel.ReturnDatatable_MSSQL_ECMAsync(SQL) End Function - + Public Function ReturnScalar_MSSQL_ECM(ByVal SQL As String) As EDMIServiceReference.ScalarResult Implements EDMIServiceReference.IEDMIService.ReturnScalar_MSSQL_ECM Return MyBase.Channel.ReturnScalar_MSSQL_ECM(SQL) End Function - + Public Function ReturnScalar_MSSQL_ECMAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ScalarResult) Implements EDMIServiceReference.IEDMIService.ReturnScalar_MSSQL_ECMAsync Return MyBase.Channel.ReturnScalar_MSSQL_ECMAsync(SQL) End Function - + Public Function ExecuteNonQuery_MSSQL_ECM(ByVal SQL As String) As EDMIServiceReference.NonQueryResult Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_MSSQL_ECM Return MyBase.Channel.ExecuteNonQuery_MSSQL_ECM(SQL) End Function - + Public Function ExecuteNonQuery_MSSQL_ECMAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult) Implements EDMIServiceReference.IEDMIService.ExecuteNonQuery_MSSQL_ECMAsync Return MyBase.Channel.ExecuteNonQuery_MSSQL_ECMAsync(SQL) End Function - - _ + + Function EDMIServiceReference_IEDMIService_ImportFile(ByVal request As EDMIServiceReference.DocumentImportRequest) As EDMIServiceReference.DocumentImportResponse Implements EDMIServiceReference.IEDMIService.ImportFile Return MyBase.Channel.ImportFile(request) End Function - + Public Function ImportFile(ByVal Contents() As Byte, ByVal DocumentType As String, ByVal FileName As String, ByVal ObjectStoreId As Long, ByVal RetentionDays As Long) As Long Dim inValue As EDMIServiceReference.DocumentImportRequest = New EDMIServiceReference.DocumentImportRequest() inValue.Contents = Contents @@ -932,15 +932,15 @@ Namespace EDMIServiceReference inValue.FileName = FileName inValue.ObjectStoreId = ObjectStoreId inValue.RetentionDays = RetentionDays - Dim retVal As EDMIServiceReference.DocumentImportResponse = CType(Me,EDMIServiceReference.IEDMIService).ImportFile(inValue) + Dim retVal As EDMIServiceReference.DocumentImportResponse = CType(Me, EDMIServiceReference.IEDMIService).ImportFile(inValue) Return retVal.ObjectId End Function - - _ + + Function EDMIServiceReference_IEDMIService_ImportFileAsync(ByVal request As EDMIServiceReference.DocumentImportRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentImportResponse) Implements EDMIServiceReference.IEDMIService.ImportFileAsync Return MyBase.Channel.ImportFileAsync(request) End Function - + Public Function ImportFileAsync(ByVal Contents() As Byte, ByVal DocumentType As String, ByVal FileName As String, ByVal ObjectStoreId As Long, ByVal RetentionDays As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentImportResponse) Dim inValue As EDMIServiceReference.DocumentImportRequest = New EDMIServiceReference.DocumentImportRequest() inValue.Contents = Contents @@ -948,104 +948,104 @@ Namespace EDMIServiceReference inValue.FileName = FileName inValue.ObjectStoreId = ObjectStoreId inValue.RetentionDays = RetentionDays - Return CType(Me,EDMIServiceReference.IEDMIService).ImportFileAsync(inValue) + Return CType(Me, EDMIServiceReference.IEDMIService).ImportFileAsync(inValue) End Function - - _ + + Function EDMIServiceReference_IEDMIService_GetFileByObjectId(ByVal request As EDMIServiceReference.DocumentStreamRequest) As EDMIServiceReference.DocumentStreamResponse Implements EDMIServiceReference.IEDMIService.GetFileByObjectId Return MyBase.Channel.GetFileByObjectId(request) End Function - + Public Function GetFileByObjectId(ByVal ObjectId As Long, ByRef FileContents As System.IO.Stream) As String Dim inValue As EDMIServiceReference.DocumentStreamRequest = New EDMIServiceReference.DocumentStreamRequest() inValue.ObjectId = ObjectId - Dim retVal As EDMIServiceReference.DocumentStreamResponse = CType(Me,EDMIServiceReference.IEDMIService).GetFileByObjectId(inValue) + Dim retVal As EDMIServiceReference.DocumentStreamResponse = CType(Me, EDMIServiceReference.IEDMIService).GetFileByObjectId(inValue) FileContents = retVal.FileContents Return retVal.FileName End Function - - _ + + Function EDMIServiceReference_IEDMIService_GetFileByObjectIdAsync(ByVal request As EDMIServiceReference.DocumentStreamRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) Implements EDMIServiceReference.IEDMIService.GetFileByObjectIdAsync Return MyBase.Channel.GetFileByObjectIdAsync(request) End Function - + Public Function GetFileByObjectIdAsync(ByVal ObjectId As Long) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentStreamResponse) Dim inValue As EDMIServiceReference.DocumentStreamRequest = New EDMIServiceReference.DocumentStreamRequest() inValue.ObjectId = ObjectId - Return CType(Me,EDMIServiceReference.IEDMIService).GetFileByObjectIdAsync(inValue) + Return CType(Me, EDMIServiceReference.IEDMIService).GetFileByObjectIdAsync(inValue) End Function - - _ + + Function EDMIServiceReference_IEDMIService_GetFileInfoByObjectId(ByVal request As EDMIServiceReference.DocumentInfoRequest) As EDMIServiceReference.DocumentInfoResponse Implements EDMIServiceReference.IEDMIService.GetFileInfoByObjectId Return MyBase.Channel.GetFileInfoByObjectId(request) End Function - + Public Function GetFileInfoByObjectId(ByVal ObjectId As Long, ByVal UserId As Long, ByRef FullPath As String) As EDMIServiceReference.RightsAccessRight Dim inValue As EDMIServiceReference.DocumentInfoRequest = New EDMIServiceReference.DocumentInfoRequest() inValue.ObjectId = ObjectId inValue.UserId = UserId - Dim retVal As EDMIServiceReference.DocumentInfoResponse = CType(Me,EDMIServiceReference.IEDMIService).GetFileInfoByObjectId(inValue) + Dim retVal As EDMIServiceReference.DocumentInfoResponse = CType(Me, EDMIServiceReference.IEDMIService).GetFileInfoByObjectId(inValue) FullPath = retVal.FullPath Return retVal.FileRight End Function - + Public Function GetFileInfoByObjectIdAsync(ByVal request As EDMIServiceReference.DocumentInfoRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentInfoResponse) Implements EDMIServiceReference.IEDMIService.GetFileInfoByObjectIdAsync Return MyBase.Channel.GetFileInfoByObjectIdAsync(request) End Function - - _ + + Function EDMIServiceReference_IEDMIService_ListFilesForUser(ByVal request As EDMIServiceReference.ListFilesForUserRequest) As EDMIServiceReference.DocumentListResponse Implements EDMIServiceReference.IEDMIService.ListFilesForUser Return MyBase.Channel.ListFilesForUser(request) End Function - + Public Function ListFilesForUser() As System.Data.DataTable Dim inValue As EDMIServiceReference.ListFilesForUserRequest = New EDMIServiceReference.ListFilesForUserRequest() - Dim retVal As EDMIServiceReference.DocumentListResponse = CType(Me,EDMIServiceReference.IEDMIService).ListFilesForUser(inValue) + Dim retVal As EDMIServiceReference.DocumentListResponse = CType(Me, EDMIServiceReference.IEDMIService).ListFilesForUser(inValue) Return retVal.Datatable End Function - - _ + + Function EDMIServiceReference_IEDMIService_ListFilesForUserAsync(ByVal request As EDMIServiceReference.ListFilesForUserRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentListResponse) Implements EDMIServiceReference.IEDMIService.ListFilesForUserAsync Return MyBase.Channel.ListFilesForUserAsync(request) End Function - + Public Function ListFilesForUserAsync() As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentListResponse) Dim inValue As EDMIServiceReference.ListFilesForUserRequest = New EDMIServiceReference.ListFilesForUserRequest() - Return CType(Me,EDMIServiceReference.IEDMIService).ListFilesForUserAsync(inValue) + Return CType(Me, EDMIServiceReference.IEDMIService).ListFilesForUserAsync(inValue) End Function - - _ + + Function EDMIServiceReference_IEDMIService_NewObjectId(ByVal request As EDMIServiceReference.NewObjectIdRequest) As EDMIServiceReference.NewObjectIdResponse Implements EDMIServiceReference.IEDMIService.NewObjectId Return MyBase.Channel.NewObjectId(request) End Function - + Public Function NewObjectId(ByVal BusinessEntity As String, ByVal KindType As String, ByVal Who As String) As Long Dim inValue As EDMIServiceReference.NewObjectIdRequest = New EDMIServiceReference.NewObjectIdRequest() inValue.BusinessEntity = BusinessEntity inValue.KindType = KindType inValue.Who = Who - Dim retVal As EDMIServiceReference.NewObjectIdResponse = CType(Me,EDMIServiceReference.IEDMIService).NewObjectId(inValue) + Dim retVal As EDMIServiceReference.NewObjectIdResponse = CType(Me, EDMIServiceReference.IEDMIService).NewObjectId(inValue) Return retVal.ObjectId End Function - - _ + + Function EDMIServiceReference_IEDMIService_NewObjectIdAsync(ByVal request As EDMIServiceReference.NewObjectIdRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.NewObjectIdResponse) Implements EDMIServiceReference.IEDMIService.NewObjectIdAsync Return MyBase.Channel.NewObjectIdAsync(request) End Function - + Public Function NewObjectIdAsync(ByVal BusinessEntity As String, ByVal KindType As String, ByVal Who As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NewObjectIdResponse) Dim inValue As EDMIServiceReference.NewObjectIdRequest = New EDMIServiceReference.NewObjectIdRequest() inValue.BusinessEntity = BusinessEntity inValue.KindType = KindType inValue.Who = Who - Return CType(Me,EDMIServiceReference.IEDMIService).NewObjectIdAsync(inValue) + Return CType(Me, EDMIServiceReference.IEDMIService).NewObjectIdAsync(inValue) End Function - - _ + + Function EDMIServiceReference_IEDMIService_NewFileObject(ByVal request As EDMIServiceReference.NewFileObjectRequest) As EDMIServiceReference.NewFileObjectResponse Implements EDMIServiceReference.IEDMIService.NewFileObject Return MyBase.Channel.NewFileObject(request) End Function - + Public Function NewFileObject(ByVal DateImported As Date, ByVal Extension As String, ByVal KeepExtension As Boolean, ByVal ObjectId As Long, ByVal StoreType As String) As String Dim inValue As EDMIServiceReference.NewFileObjectRequest = New EDMIServiceReference.NewFileObjectRequest() inValue.DateImported = DateImported @@ -1053,15 +1053,15 @@ Namespace EDMIServiceReference inValue.KeepExtension = KeepExtension inValue.ObjectId = ObjectId inValue.StoreType = StoreType - Dim retVal As EDMIServiceReference.NewFileObjectResponse = CType(Me,EDMIServiceReference.IEDMIService).NewFileObject(inValue) + Dim retVal As EDMIServiceReference.NewFileObjectResponse = CType(Me, EDMIServiceReference.IEDMIService).NewFileObject(inValue) Return retVal.FileObjectPath End Function - - _ + + Function EDMIServiceReference_IEDMIService_NewFileObjectAsync(ByVal request As EDMIServiceReference.NewFileObjectRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.NewFileObjectResponse) Implements EDMIServiceReference.IEDMIService.NewFileObjectAsync Return MyBase.Channel.NewFileObjectAsync(request) End Function - + Public Function NewFileObjectAsync(ByVal DateImported As Date, ByVal Extension As String, ByVal KeepExtension As Boolean, ByVal ObjectId As Long, ByVal StoreType As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NewFileObjectResponse) Dim inValue As EDMIServiceReference.NewFileObjectRequest = New EDMIServiceReference.NewFileObjectRequest() inValue.DateImported = DateImported @@ -1069,37 +1069,37 @@ Namespace EDMIServiceReference inValue.KeepExtension = KeepExtension inValue.ObjectId = ObjectId inValue.StoreType = StoreType - Return CType(Me,EDMIServiceReference.IEDMIService).NewFileObjectAsync(inValue) + Return CType(Me, EDMIServiceReference.IEDMIService).NewFileObjectAsync(inValue) End Function - - _ + + Function EDMIServiceReference_IEDMIService_ImportFileIntoFileObject(ByVal request As EDMIServiceReference.ImportFileIntoFileObjectRequest) As EDMIServiceReference.ImportFileIntoFileObjectResponse Implements EDMIServiceReference.IEDMIService.ImportFileIntoFileObject Return MyBase.Channel.ImportFileIntoFileObject(request) End Function - - Public Function ImportFileIntoFileObject(ByVal Contents() As Byte, ByVal pIDBFilePath As String, ByVal pIDB_OBJ_ID As Long, ByVal pObjectStoreID As Integer, ByVal pWho As String) As Boolean + + Public Function ImportFileIntoFileObject(ByVal Contents() As Byte, ByVal FilePath As String, ByVal ObjectId As Long, ByVal ObjectStoreType As String, ByVal Who As String) As Boolean Dim inValue As EDMIServiceReference.ImportFileIntoFileObjectRequest = New EDMIServiceReference.ImportFileIntoFileObjectRequest() inValue.Contents = Contents - inValue.pIDBFilePath = pIDBFilePath - inValue.pIDB_OBJ_ID = pIDB_OBJ_ID - inValue.pObjectStoreID = pObjectStoreID - inValue.pWho = pWho - Dim retVal As EDMIServiceReference.ImportFileIntoFileObjectResponse = CType(Me,EDMIServiceReference.IEDMIService).ImportFileIntoFileObject(inValue) + inValue.FilePath = FilePath + inValue.ObjectId = ObjectId + inValue.ObjectStoreType = ObjectStoreType + inValue.Who = Who + Dim retVal As EDMIServiceReference.ImportFileIntoFileObjectResponse = CType(Me, EDMIServiceReference.IEDMIService).ImportFileIntoFileObject(inValue) Return retVal.Result End Function - - _ + + Function EDMIServiceReference_IEDMIService_ImportFileIntoFileObjectAsync(ByVal request As EDMIServiceReference.ImportFileIntoFileObjectRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.ImportFileIntoFileObjectResponse) Implements EDMIServiceReference.IEDMIService.ImportFileIntoFileObjectAsync Return MyBase.Channel.ImportFileIntoFileObjectAsync(request) End Function - - Public Function ImportFileIntoFileObjectAsync(ByVal Contents() As Byte, ByVal pIDBFilePath As String, ByVal pIDB_OBJ_ID As Long, ByVal pObjectStoreID As Integer, ByVal pWho As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ImportFileIntoFileObjectResponse) + + Public Function ImportFileIntoFileObjectAsync(ByVal Contents() As Byte, ByVal FilePath As String, ByVal ObjectId As Long, ByVal ObjectStoreType As String, ByVal Who As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ImportFileIntoFileObjectResponse) Dim inValue As EDMIServiceReference.ImportFileIntoFileObjectRequest = New EDMIServiceReference.ImportFileIntoFileObjectRequest() inValue.Contents = Contents - inValue.pIDBFilePath = pIDBFilePath - inValue.pIDB_OBJ_ID = pIDB_OBJ_ID - inValue.pObjectStoreID = pObjectStoreID - inValue.pWho = pWho + inValue.FilePath = FilePath + inValue.ObjectId = ObjectId + inValue.ObjectStoreType = ObjectStoreType + inValue.Who = Who Return CType(Me,EDMIServiceReference.IEDMIService).ImportFileIntoFileObjectAsync(inValue) End Function End Class diff --git a/Modules.EDMIAPI/Constants.vb b/Modules.EDMIAPI/Constants.vb new file mode 100644 index 00000000..70a6e7e7 --- /dev/null +++ b/Modules.EDMIAPI/Constants.vb @@ -0,0 +1,6 @@ +Public Class Constants + Public Enum DatabaseType + ECM + IDB + End Enum +End Class diff --git a/Modules.EDMIAPI/DataWithFallback.vb b/Modules.EDMIAPI/DatabaseWithFallback.vb similarity index 55% rename from Modules.EDMIAPI/DataWithFallback.vb rename to Modules.EDMIAPI/DatabaseWithFallback.vb index 7f2ea153..e630308a 100644 --- a/Modules.EDMIAPI/DataWithFallback.vb +++ b/Modules.EDMIAPI/DatabaseWithFallback.vb @@ -1,20 +1,15 @@ Imports DigitalData.Modules.Database Imports DigitalData.Modules.EDMI.API +Imports DigitalData.Modules.EDMI.API.Constants Imports DigitalData.Modules.EDMI.API.EDMIServiceReference Imports DigitalData.Modules.Logging Imports DigitalData.Modules.Language.Utils -Public Class DataWithFallback - Private _Logger As Logger - Private _Client As Client - Private _DatabaseEDM As MSSQLServer - Private _DatabaseIDB As MSSQLServer - Private _Type As DatabaseType - - Public Enum DatabaseType - ECM - IDB - End Enum +Public Class DatabaseWithFallback + Private ReadOnly _Logger As Logger + Private ReadOnly _Client As Client + Private ReadOnly _DatabaseEDM As MSSQLServer + Private ReadOnly _DatabaseIDB As MSSQLServer Public Sub New(LogConfig As LogConfig, Client As Client, DatabaseECM As MSSQLServer, DatabaseIDB As MSSQLServer) _Logger = LogConfig.GetLogger() @@ -23,7 +18,7 @@ Public Class DataWithFallback _DatabaseIDB = DatabaseIDB End Sub - Public Function GetDatatable(DataTable As String, FilterExpression As String, SortByColumn As String, FallbackSQL As String, FallbackType As DatabaseType, Optional ForceFallback As Boolean = False) As DataTable + Public Function GetDatatable(DataTable As String, FallbackSQL As String, FallbackType As Constants.DatabaseType, Optional FilterExpression As String = "", Optional SortByColumn As String = "", Optional ForceFallback As Boolean = False) As DataTable Try Dim oResult As DataTable = Nothing @@ -65,27 +60,29 @@ Public Class DataWithFallback End Function Public Function GetUserData(UserName As String, ModuleCode As String, Client As Integer) As UserData - Dim oSQL = $"SELECT * FROM FNDD_CHECK_USER_MODULE('{UserName}','{ModuleCode}',{Client})" - Dim oTable As DataTable = GetDatatable("TBDD_USER_MODULE", $"USERNAME = '{UserName.ToLower}' AND MODULE_SHORT = '{ModuleCode}'", "", oSQL, DatabaseType.ECM) + 'Dim oSQL = $"SELECT * FROM FNDD_CHECK_USER_MODULE('{UserName}','{ModuleCode}',{Client})" + 'Dim oTable As DataTable = GetDatatable("TBDD_USER_MODULE", $"USERNAME = '{UserName.ToLower}' AND MODULE_SHORT = '{ModuleCode}'", "", oSQL, DatabaseType.ECM) - If oTable Is Nothing Then - Return Nothing - End If + 'If oTable Is Nothing Then + ' Return Nothing + 'End If - If oTable.Rows.Count = 0 Then - Return Nothing - End If + 'If oTable.Rows.Count = 0 Then + ' Return Nothing + 'End If - Dim oRow As DataRow = oTable.Rows.Item(0) - Dim oUserData As New UserData With { - .Id = NotNull(oRow, "USER_ID", -1), - .Surname = NotNull(oRow, "USER_SURNAME", String.Empty), - .Prename = NotNull(oRow, "USER_PRENAME", String.Empty), - .Shortname = NotNull(oRow, "USER_SHORTNAME", String.Empty), - .Email = NotNull(oRow, "USER_EMAIL", String.Empty), - .Language = NotNull(oRow, "USER_LANGUAGE", "de-DE"), - .DateFormat = NotNull(oRow, "USER_DATE_FORMAT", "dd.MM.yyyy") - } + 'Dim oRow As DataRow = oTable.Rows.Item(0) + 'Dim oUserData As New UserData With { + ' .Id = NotNull(oRow, "USER_ID", -1), + ' .Surname = NotNull(oRow, "USER_SURNAME", String.Empty), + ' .Prename = NotNull(oRow, "USER_PRENAME", String.Empty), + ' .Shortname = NotNull(oRow, "USER_SHORTNAME", String.Empty), + ' .Email = NotNull(oRow, "USER_EMAIL", String.Empty), + ' .Language = NotNull(oRow, "USER_LANGUAGE", "de-DE"), + ' .DateFormat = NotNull(oRow, "USER_DATE_FORMAT", "dd.MM.yyyy") + '} + + Throw New NotImplementedException() End Function End Class diff --git a/Modules.EDMIAPI/DataWithFallback/UserData.vb b/Modules.EDMIAPI/DatabaseWithFallback/UserData.vb similarity index 100% rename from Modules.EDMIAPI/DataWithFallback/UserData.vb rename to Modules.EDMIAPI/DatabaseWithFallback/UserData.vb diff --git a/Modules.EDMIAPI/EDMI.API.vbproj b/Modules.EDMIAPI/EDMI.API.vbproj index 95b88971..6c5717a4 100644 --- a/Modules.EDMIAPI/EDMI.API.vbproj +++ b/Modules.EDMIAPI/EDMI.API.vbproj @@ -80,7 +80,8 @@ Reference.svcmap - + + True @@ -96,7 +97,7 @@ Settings.settings True - + diff --git a/Modules.Logging/LogConfig.vb b/Modules.Logging/LogConfig.vb index 8e159d90..ac14280f 100644 --- a/Modules.Logging/LogConfig.vb +++ b/Modules.Logging/LogConfig.vb @@ -346,7 +346,7 @@ Public Class LogConfig Public Function GetLogger(ClassName As String, ModuleName As String) As Logger Dim oLogger = LogFactory.GetLogger(Of Logger)(ClassName) - If ModuleName IsNot Nothing Then + If ModuleName IsNot Nothing AndAlso ModuleName.Length > 0 Then Return oLogger.WithProperty("ModuleName", $"-{ModuleName}") End If diff --git a/Modules.Logging/My Project/AssemblyInfo.vb b/Modules.Logging/My Project/AssemblyInfo.vb index 5bc9654d..af5d92dd 100644 --- a/Modules.Logging/My Project/AssemblyInfo.vb +++ b/Modules.Logging/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/Service.EDMIService/EDMIService.vb b/Service.EDMIService/EDMIService.vb index 01928de5..6d3c27a7 100644 --- a/Service.EDMIService/EDMIService.vb +++ b/Service.EDMIService/EDMIService.vb @@ -445,65 +445,6 @@ Public Class EDMIService Return Nothing End Try End Function - Private Function GetFullPathForObjectId(ObjectId As Long) As String - Try - If Not GlobalState.TableStore.Tables.Contains(TBIDB_DOC_INFO) Then - _Logger.Warn("GetFullPathForObjectId: Document info table does not exist!") - Return String.Empty - End If - - Dim oTable As DataTable = GlobalState.TableStore.Tables.Item(TBIDB_DOC_INFO) - Dim oRows As List(Of DataRow) = oTable.Select($"IDB_OBJ_ID = {ObjectId}").ToList() - - Dim oFullPath As String - - If oRows.Count = 0 Then - _Logger.Warn("GetFullPathForObjectId: Full path does not exist for object [{0}]", ObjectId) - oFullPath = String.Empty - Else - Dim oRow As DataRow = oRows.First() - oFullPath = oRow.Item("FULL_PATH") - End If - - Return oFullPath - Catch ex As Exception - _Logger.Warn("GetFullPathForObjectId: Unexpected Error while getting full path for object [{0}].", ObjectId) - _Logger.Error(ex) - Return String.Empty - End Try - End Function - Private Function GetAccessRightForObjectId(UserId As Long, ObjectId As Long) As AccessRight - Try - If Not GlobalState.TableStore.Tables.Contains(TBIDB_ACCESSRIGHT) Then - _Logger.Warn("GetAccessRightForObjectId: Access right table does not exist!") - Return AccessRight.VIEW_ONLY - End If - - Dim oTable As DataTable = GlobalState.TableStore.Tables.Item(TBIDB_ACCESSRIGHT) - Dim oRows As List(Of DataRow) = oTable.Select($"IDB_OBJ_ID = {ObjectId} AND USR_ID = {UserId}").ToList() - Dim oRight As AccessRight - - If oRows.Count = 0 Then - _Logger.Warn("GetAccessRightForObjectId: Access right assignment does not exist for user [{0}] on object [{1}]", UserId, ObjectId) - Return AccessRight.VIEW_ONLY - Else - If oRows.Count > 1 Then - _Logger.Warn("GetAccessRightForObjectId: More than one access right assignment found for user [{0}] on object [{1}]", UserId, ObjectId) - End If - - Dim oRow As DataRow = oRows.First() - Dim oRightAsInt = oRow.Item("ACCESSRIGHT") - - oRight = Utils.ToEnum(Of AccessRight)(oRightAsInt) - End If - - Return oRight - Catch ex As Exception - _Logger.Warn("GetAccessRightForObjectId: Unexpected Error while getting access right for object [{0}].", ObjectId) - _Logger.Error(ex) - Return AccessRight.VIEW_ONLY - End Try - End Function Public Function NewObjectId(Data As NewObjectIdRequest) As NewObjectIdResponse Implements IEDMIService.NewObjectId Try @@ -580,12 +521,14 @@ Public Class EDMIService End Function Public Function ImportFileIntoFileObject(Data As ImportFileIntoFileObjectRequest) As ImportFileIntoFileObjectResponse Implements IEDMIService.ImportFileIntoFileObject - Dim oObjectStore = GlobalState.ObjectStores.First() - Dim oEDMIPath = New EDMI.File.Path(LogConfig, oObjectStore.Path) - Try - Using oStream = New FileStream(Data.pIDBFilePath, FileMode.Create, FileAccess.Write) - _Logger.Info("ImportFile: Saving file to path [{0}]", Data.pIDBFilePath) + Dim oObjectStore = GlobalState.GetObjectStore(Data.ObjectStoreType) + If oObjectStore Is Nothing Then + Throw New KeyNotFoundException($"ObjectStore [{Data.ObjectStoreType}] was not found.") + End If + + Using oStream = New FileStream(Data.FilePath, FileMode.Create, FileAccess.Write) + _Logger.Info("ImportFile: Saving file to path [{0}]", Data.FilePath) _Logger.Info("ImportFile: Content Length: {0}", Data.Contents.Length) oStream.Write(Data.Contents, 0, Data.Contents.Length) @@ -594,7 +537,7 @@ Public Class EDMIService End Using ' insert into db - Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.pIDBFilePath}','{Data.pWho}','{Data.pIDB_OBJ_ID}',{Data.pObjectStoreID}" + Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{Data.FilePath}','{Data.Who}','{Data.ObjectId}',{oObjectStore.Id}" Dim oResult As Boolean = MSSQL_IDB.ExecuteNonQuery(oSQL) Return New ImportFileIntoFileObjectResponse() With {.Result = oResult} @@ -611,6 +554,7 @@ Public Class EDMIService End Function #End Region +#Region "=== Private ===" Private Function GetFileObjectFileName(IDB_OBJ_ID As Long, pExtension As String, pKeepExtension As Boolean) As String If Not pExtension.StartsWith("."c) Then pExtension &= "."c @@ -650,4 +594,67 @@ Public Class EDMIService Return New FaultException(Of UnexpectedErrorFault)(oFault, New FaultReason(oFault.InnerException.Message)) End Function + Private Function GetFullPathForObjectId(ObjectId As Long) As String + Try + If Not GlobalState.TableStore.Tables.Contains(TBIDB_DOC_INFO) Then + _Logger.Warn("GetFullPathForObjectId: Document info table does not exist!") + Return String.Empty + End If + + Dim oTable As DataTable = GlobalState.TableStore.Tables.Item(TBIDB_DOC_INFO) + Dim oRows As List(Of DataRow) = oTable.Select($"IDB_OBJ_ID = {ObjectId}").ToList() + + Dim oFullPath As String + + If oRows.Count = 0 Then + _Logger.Warn("GetFullPathForObjectId: Full path does not exist for object [{0}]", ObjectId) + oFullPath = String.Empty + Else + Dim oRow As DataRow = oRows.First() + oFullPath = oRow.Item("FULL_PATH") + End If + + Return oFullPath + Catch ex As Exception + _Logger.Warn("GetFullPathForObjectId: Unexpected Error while getting full path for object [{0}].", ObjectId) + _Logger.Error(ex) + Return String.Empty + End Try + End Function + + Private Function GetAccessRightForObjectId(UserId As Long, ObjectId As Long) As AccessRight + Try + If Not GlobalState.TableStore.Tables.Contains(TBIDB_ACCESSRIGHT) Then + _Logger.Warn("GetAccessRightForObjectId: Access right table does not exist!") + Return AccessRight.VIEW_ONLY + End If + + Dim oTable As DataTable = GlobalState.TableStore.Tables.Item(TBIDB_ACCESSRIGHT) + Dim oRows As List(Of DataRow) = oTable.Select($"IDB_OBJ_ID = {ObjectId} AND USR_ID = {UserId}").ToList() + Dim oRight As AccessRight + + If oRows.Count = 0 Then + _Logger.Warn("GetAccessRightForObjectId: Access right assignment does not exist for user [{0}] on object [{1}]", UserId, ObjectId) + Return AccessRight.VIEW_ONLY + Else + If oRows.Count > 1 Then + _Logger.Warn("GetAccessRightForObjectId: More than one access right assignment found for user [{0}] on object [{1}]", UserId, ObjectId) + End If + + Dim oRow As DataRow = oRows.First() + Dim oRightAsInt = oRow.Item("ACCESSRIGHT") + + oRight = Utils.ToEnum(Of AccessRight)(oRightAsInt) + End If + + Return oRight + Catch ex As Exception + _Logger.Warn("GetAccessRightForObjectId: Unexpected Error while getting access right for object [{0}].", ObjectId) + _Logger.Error(ex) + Return AccessRight.VIEW_ONLY + End Try + End Function +#End Region + + End Class \ No newline at end of file diff --git a/Service.EDMIService/GlobalState.vb b/Service.EDMIService/GlobalState.vb index 225e1ea0..8ab7b20a 100644 --- a/Service.EDMIService/GlobalState.vb +++ b/Service.EDMIService/GlobalState.vb @@ -43,6 +43,12 @@ Public Class GlobalState End Try End Sub + Public Function GetObjectStore(Name As String) As ObjectStore + Return ObjectStores. + Where(Function(o) o.Title.ToUpper = Name.ToUpper). + FirstOrDefault() + End Function + Class ObjectStore Public Id As Long Public Title As String diff --git a/Service.EDMIService/Helpers/Messages.vb b/Service.EDMIService/Helpers/Messages.vb index 7347a1f6..0387607f 100644 --- a/Service.EDMIService/Helpers/Messages.vb +++ b/Service.EDMIService/Helpers/Messages.vb @@ -32,13 +32,13 @@ Namespace Messages Public Contents() As Byte - Public pWho As String + Public Who As String - Public pIDBFilePath As String + Public FilePath As String - Public pIDB_OBJ_ID As Long + Public ObjectId As Long - Public pObjectStoreID As Integer + Public ObjectStoreType As String End Class diff --git a/Service.EDMIService/Scheduler/DatatableJob.vb b/Service.EDMIService/Scheduler/DatatableJob.vb index da42a1e2..8a09c2d5 100644 --- a/Service.EDMIService/Scheduler/DatatableJob.vb +++ b/Service.EDMIService/Scheduler/DatatableJob.vb @@ -18,7 +18,7 @@ Public Class DatatableJob Dim oLogConfig As LogConfig = oJobData.Item("LogConfig") Dim oCronJobId As Integer = oJobData.Item("CronJobId") Dim oCronJobTitle As String = oJobData.Item("CronJobTitle") - Dim oLogger As Logger = oLogConfig.GetLogger() + Dim oLogger As Logger = oLogConfig.GetLoggerFor("Scheduler") Dim oResult As New JobResult() diff --git a/Service.EDMIService/Scheduler/JobListener.vb b/Service.EDMIService/Scheduler/JobListener.vb index 9fabc4bf..e982a6e2 100644 --- a/Service.EDMIService/Scheduler/JobListener.vb +++ b/Service.EDMIService/Scheduler/JobListener.vb @@ -21,7 +21,7 @@ Public Class JobListener MyBase.New() _LogConfig = LogConfig - _Logger = LogConfig.GetLogger() + _Logger = LogConfig.GetLoggerFor("Scheduler") _MSSQL = MSSQL Dataset = ResultDataSet End Sub diff --git a/Service.EDMIService/Scheduler/Scheduler.vb b/Service.EDMIService/Scheduler/Scheduler.vb index 45fc2d16..6ef93270 100644 --- a/Service.EDMIService/Scheduler/Scheduler.vb +++ b/Service.EDMIService/Scheduler/Scheduler.vb @@ -108,8 +108,6 @@ Public Class Scheduler End Sub - - Public Async Function GetCronJobs() As Task(Of DataTable) Try Dim oSQL As String = "SELECT * FROM TBAPPSERV_CRON_JOB WHERE ACTIVE = 1"