This commit is contained in:
Developer01
2025-12-23 13:01:06 +01:00
42 changed files with 2448 additions and 594 deletions

View File

@@ -0,0 +1,49 @@
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.EDMI.API.Modules
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
Namespace My
''' <summary>
''' Extends the My Namespace
''' Example: My.LogConfig
''' </summary>
<HideModuleName()>
Module Extension
Property LogConfig As LogConfig
#Region "Database"
Property Database As DatabaseWithFallback
Property DatabaseECM As MSSQLServer
Property DatabaseIDB As MSSQLServer
End Module
#End Region
Partial Friend Class MyApplication
Public Property Skin As String = ""
Public Property Palette As String = ""
Public Property GlobixDropAreaStyle As String = "PROGRESSIVE"
Public Property Settings As New State.SettingsState
Public Property User As New State.UserState
Public Property Service As New State.ServiceState
Public Property Modules As New Dictionary(Of String, State.ModuleState)
Public Property ModulesActive As New List(Of String)
Public CommandLineFunction As String
Public CommandLineArguments As New Dictionary(Of String, String)
Public Function GetEnvironment() As Environment
Return New Environment With {
.Database = My.DatabaseECM,
.DatabaseIDB = My.DatabaseIDB,
.Modules = My.Application.Modules,
.Service = My.Application.Service,
.Settings = My.Application.Settings,
.User = My.Application.User
}
End Function
End Class
End Namespace

View File

@@ -93,6 +93,10 @@
<Reference Include="DigitalData.Modules.Database">
<HintPath>..\..\DDModules\Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.EDMI.API, Version=1.6.1.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>P:\Projekte DIGITAL DATA\DIGITAL DATA - Entwicklung\DLL_Bibliotheken\Digital Data\DD_Modules\DigitalData.Modules.EDMI.API.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Encryption">
<HintPath>..\..\DDModules\Encryption\bin\Debug\DigitalData.Modules.Encryption.dll</HintPath>
</Reference>
@@ -117,6 +121,10 @@
<Reference Include="DigitalData.Modules.Windream">
<HintPath>..\..\DDModules\Windream\bin\Debug\DigitalData.Modules.Windream.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.ZooFlow, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDModules\ZooFlow\bin\Debug\DigitalData.Modules.ZooFlow.dll</HintPath>
</Reference>
<Reference Include="DocumentFormat.OpenXml, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8fb06cb64d019a17, processorArchitecture=MSIL">
<HintPath>..\packages\DocumentFormat.OpenXml.3.2.0\lib\net46\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
@@ -406,6 +414,7 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="MyApplication.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="frmBulkInsert.resx">
@@ -487,10 +496,6 @@
<Project>{a8c3f298-76ab-4359-ab3c-986e313b4336}</Project>
<Name>EDMIService</Name>
</ProjectReference>
<ProjectReference Include="..\Services.ZUGFeRDService\DDZUGFeRDService.vbproj">
<Project>{7deec36e-ea5f-4711-ad1e-fd8894f4ad77}</Project>
<Name>DDZUGFeRDService</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\alignhorizontalbottom.svg" />

View File

@@ -23,28 +23,141 @@ Partial Class frmFilesystem
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
Me.txtServiceAddress = New DevExpress.XtraEditors.TextEdit()
Me.Label1 = New System.Windows.Forms.Label()
Me.txtServicePort = New DevExpress.XtraEditors.TextEdit()
Me.Button4 = New System.Windows.Forms.Button()
Me.txtStatus = New System.Windows.Forms.TextBox()
Me.GroupBox1.SuspendLayout()
CType(Me.txtServiceAddress.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.txtServicePort.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(12, 12)
Me.Button1.Location = New System.Drawing.Point(59, 343)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(75, 23)
Me.Button1.Size = New System.Drawing.Size(288, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
Me.Button1.Text = "CreateDateDirectory"
Me.Button1.UseVisualStyleBackColor = True
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(6, 71)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(288, 23)
Me.Button2.TabIndex = 1
Me.Button2.Text = "Stream simple file"
Me.Button2.UseVisualStyleBackColor = True
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Button3)
Me.GroupBox1.Controls.Add(Me.TextBox1)
Me.GroupBox1.Controls.Add(Me.Button2)
Me.GroupBox1.Location = New System.Drawing.Point(36, 153)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(709, 157)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "Stream simple file"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(6, 19)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(181, 23)
Me.Button3.TabIndex = 3
Me.Button3.Text = "1. Choose file"
Me.Button3.UseVisualStyleBackColor = True
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(6, 45)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(669, 20)
Me.TextBox1.TabIndex = 2
'
'txtServiceAddress
'
Me.txtServiceAddress.Location = New System.Drawing.Point(36, 37)
Me.txtServiceAddress.Name = "txtServiceAddress"
Me.txtServiceAddress.Size = New System.Drawing.Size(485, 20)
Me.txtServiceAddress.TabIndex = 5
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(33, 21)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(81, 13)
Me.Label1.TabIndex = 6
Me.Label1.Text = "ServiceAdresse"
'
'txtServicePort
'
Me.txtServicePort.EditValue = New Decimal(New Integer() {9000, 0, 0, 0})
Me.txtServicePort.Location = New System.Drawing.Point(36, 63)
Me.txtServicePort.Name = "txtServicePort"
Me.txtServicePort.Properties.EditValueChangedFiringMode = DevExpress.XtraEditors.Controls.EditValueChangedFiringMode.Buffered
Me.txtServicePort.Properties.MaskSettings.Set("MaskManagerType", GetType(DevExpress.Data.Mask.NumericMaskManager))
Me.txtServicePort.Size = New System.Drawing.Size(485, 20)
Me.txtServicePort.TabIndex = 7
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(36, 89)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(75, 23)
Me.Button4.TabIndex = 8
Me.Button4.Text = "Connect"
Me.Button4.UseVisualStyleBackColor = True
'
'txtStatus
'
Me.txtStatus.Location = New System.Drawing.Point(527, 37)
Me.txtStatus.Name = "txtStatus"
Me.txtStatus.Size = New System.Drawing.Size(100, 20)
Me.txtStatus.TabIndex = 9
'
'frmFilesystem
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(800, 450)
Me.Controls.Add(Me.txtStatus)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.txtServicePort)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.txtServiceAddress)
Me.Controls.Add(Me.GroupBox1)
Me.Controls.Add(Me.Button1)
Me.Name = "frmFilesystem"
Me.Text = "frmFilesystem"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
CType(Me.txtServiceAddress.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.txtServicePort.Properties, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Button1 As Button
Friend WithEvents Button2 As Button
Friend WithEvents GroupBox1 As GroupBox
Friend WithEvents Button3 As Button
Friend WithEvents TextBox1 As TextBox
Friend WithEvents SaveFileDialog1 As SaveFileDialog
Friend WithEvents txtServiceAddress As DevExpress.XtraEditors.TextEdit
Friend WithEvents Label1 As Label
Friend WithEvents txtServicePort As DevExpress.XtraEditors.TextEdit
Friend WithEvents Button4 As Button
Friend WithEvents txtStatus As TextBox
End Class

View File

@@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="SaveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -1,8 +1,29 @@
Imports DigitalData.Modules.Logging
Imports System.Collections.Generic
Imports System.IO
Imports System.Numerics ' Verweis auf System.Numerics assembly hinzufügen!
Imports System.Security.Cryptography
Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.Base.IDB.Constants
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow.State
Public Class frmFilesystem
Private Client As Client
Private Logger As Logger
Private Const STATUS_CONNECTED = "Connection Established"
Private Const STATUS_CONNECTING = "Trying to create connection..."
Private Const STATUS_FAILED = "Connection Failed!"
Private ConnectionChanged As Boolean = False
Public Property ServiceAddress As String = ""
Public Property ServiceOnline As Boolean = False
Private LogConfig As LogConfig
Private Filesystem As DigitalData.Modules.Filesystem.File
Private MYDD_Filesystem As DigitalData.Modules.Filesystem.File
Private ShortName As String = "E:\some_test_file.txt"
Private LongName As String = "E:\some_test_file_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more_data_and_with_some_more.txt"
@@ -10,7 +31,8 @@ Public Class frmFilesystem
Private Sub frmFilesystem_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
LogConfig = New LogConfig(LogConfig.PathType.Temp)
Filesystem = New DigitalData.Modules.Filesystem.File(LogConfig)
Logger = LogConfig.GetLogger()
MYDD_Filesystem = New DigitalData.Modules.Filesystem.File(LogConfig)
'Using oWriter = IO.File.CreateText("E:\some_test_file.txt")
@@ -34,6 +56,138 @@ Public Class frmFilesystem
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oDateString = Filesystem.CreateDateDirectory("E:\")
Dim oDateString = MYDD_Filesystem.CreateDateDirectory("E:\")
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
If SaveFileDialog1.ShowDialog = DialogResult.OK Then
' Fallback: einfache Textdatei schreiben
System.IO.File.WriteAllText(SaveFileDialog1.FileName, "Some text data")
End If
End Sub
Private Async Function Button2_ClickAsync(sender As Object, e As EventArgs) As Task Handles Button2.Click
' Import a file via EDMI Globix ImportFile API to test Service.EDMIService ImportFileMethod
Try
If Client Is Nothing OrElse ServiceOnline = False Then
MsgBox("Bitte zuerst Verbindung zum EDMI Service herstellen.", MsgBoxStyle.Exclamation, Text)
Return
End If
Using ofd As New OpenFileDialog()
ofd.Title = "Datei für Import wählen"
ofd.Filter = "Alle Dateien (*.*)|*.*"
If ofd.ShowDialog() <> DialogResult.OK Then
Return
End If
Dim oFilePath = ofd.FileName
Dim fi As New FileInfo(oFilePath)
Dim fileBytes As Byte() = IO.File.ReadAllBytes(oFilePath)
' Basic user context for testing
Dim user As New DigitalData.Modules.ZooFlow.State.UserState() With {
.UserName = Environment.UserName,
.Language = "de-DE",
.LanguageId = 1031
}
Dim oObjectStore As String = "SelectedDocType.ObjectStore"
Dim oIDBDoctypeId As Long = 1
Dim oObjectKind As String = "DOC"
Dim oProfileId As Integer = 1
Dim oAttributes As List(Of UserAttributeValue) = Nothing
Dim oOptions As New Options.ImportFileOptions
Logger.Debug("FilePath: [{0}]", oFilePath)
Logger.Debug("ObjectStore: [{0}]", oObjectStore)
Logger.Debug("ObjectKind: [{0}]", oObjectKind)
Logger.Debug("ProfileId: [{0}]", oProfileId)
Logger.Debug("IDB DoctypeId: [{0}]", oIDBDoctypeId)
Logger.Info("Running Import")
Dim oResult = Await My.Application.Service.Client.Globix_ImportFileAsync(
oFilePath, oProfileId, oAttributes, oObjectStore, oObjectKind, oIDBDoctypeId, oOptions)
Logger.Info("Import result: [{0}]", oResult.OK)
Logger.Info("Imported file got ObjectId [{0}]", oResult.ObjectId)
If oResult.OK Then
MsgBox("Alles OK")
Else
Logger.Warn("Import failed with message: [{0}] and details [{1}]", oResult.ErrorMessage, oResult.ErrorDetails)
Dim oMsg As String, oTitle As String
If My.Application.User.Language = "de-DE" Then
oMsg = $"Die Datei wurde nicht verarbeitet.{vbNewLine}{vbNewLine}Fehler: {oResult.ErrorMessage}"
oTitle = "Achtung"
Else
oMsg = $"Unexpected Error in FileFlow{vbNewLine}{vbNewLine}Fehler: {oResult.ErrorMessage}"
oTitle = "Attention"
End If
MsgBox("Fehler")
End If
End Using
Catch ex As Exception
If Logger IsNot Nothing Then Logger.Error(ex)
MsgBox("Fehler beim Datei-Import.", MsgBoxStyle.Critical, Text)
End Try
End Function
Public Class SecureStorageHandler
End Class
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Try
Dim oIPAddress = txtServiceAddress.Text
Dim oPort = Integer.Parse(txtServicePort.Text)
Client = New Client(LogConfig, oIPAddress, oPort)
txtStatus.Text = STATUS_CONNECTING
Dim oResult = Client.Connect()
If oResult = True Then
ServiceAddress = $"{oIPAddress}:{oPort}"
ServiceOnline = True
txtStatus.Text = STATUS_CONNECTED
My.Application.Service.Client = Client
Logger.Debug("Loading client config..")
Dim oClientConfig = My.Application.Service.Client.ClientConfig
Logger.Debug("Establishing ECM connection..")
Dim oECMConnectionString = oClientConfig.ConnectionStringECM
My.DatabaseECM = New MSSQLServer(My.LogConfig, oECMConnectionString)
Logger.Debug("Establishing IDB connection..")
Dim oIDBConnectionString = oClientConfig.ConnectionStringIDB
My.DatabaseIDB = New MSSQLServer(My.LogConfig, oIDBConnectionString)
Logger.Debug("Establishing Database connection with fallback..")
My.Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB)
Else
ServiceAddress = ""
ServiceOnline = True
txtStatus.Text = STATUS_FAILED
' TODO: Make a connection test that is as elaborate as this one :D
'Select Case oResult
' Case ClassService.ConnectionTestResult.NotFound
' lblStatus.Text = "Dienst konnte nicht gefunden werden. Bitte überprüfen sie Addresse und Port."
' Case ClassService.ConnectionTestResult.EmptyURI
' lblStatus.Text = "Bitte tragen Sie eine gültige Dienst Adresse ein."
' Case ClassService.ConnectionTestResult.Authentication
' lblStatus.Text = "Authentifizierungsfehler. Prüfen Sie, ob sich Ihr Gerät in der korrekten Domäne befindet."
' Case Else
' lblStatus.Text = "Unbekannter Fehler."
'End Select
End If
Catch ex As Exception
If Logger IsNot Nothing Then Logger.Error(ex)
MsgBox("Fehler beim Verbindungsaufbau", MsgBoxStyle.Critical, Text)
End Try
End Sub
End Class