Merge branch 'master' of http://dd-vmp07-com04:3000/AppStd/Monorepo
This commit is contained in:
commit
2ff902fc1e
@ -15,7 +15,7 @@ Public Class Form1
|
|||||||
Try
|
Try
|
||||||
_LogConfig = New LogConfig(LogConfig.PathType.Temp, Nothing, "EDMIBenschmark")
|
_LogConfig = New LogConfig(LogConfig.PathType.Temp, Nothing, "EDMIBenschmark")
|
||||||
_Logger = _LogConfig.GetLogger()
|
_Logger = _LogConfig.GetLogger()
|
||||||
_Client = New Client(_LogConfig, "net.tcp://172.24.12.39:9000/DigitalData/Services/Main")
|
_Client = New Client(_LogConfig, "172.24.12.39", 9000)
|
||||||
_Client.Connect()
|
_Client.Connect()
|
||||||
|
|
||||||
DocumentViewer1.Init(_LogConfig, "21182889975216572111813147150675976632")
|
DocumentViewer1.Init(_LogConfig, "21182889975216572111813147150675976632")
|
||||||
|
|||||||
@ -1,6 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<configSections>
|
||||||
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||||
|
<section name="GUIs.Test.GraphQLTest.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
|
</sectionGroup>
|
||||||
|
</configSections>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
</startup>
|
</startup>
|
||||||
|
<userSettings>
|
||||||
|
<GUIs.Test.GraphQLTest.My.MySettings>
|
||||||
|
<setting name="ConnectionString" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="CertificateFile" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="CertificatePass" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="Email" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="Password" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
<setting name="BaseUrl" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</GUIs.Test.GraphQLTest.My.MySettings>
|
||||||
|
</userSettings>
|
||||||
</configuration>
|
</configuration>
|
||||||
21
GUIs.Test.GraphQLTest/Config.vb
Normal file
21
GUIs.Test.GraphQLTest/Config.vb
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Public Class Config
|
||||||
|
Public Property ConnectionString As String = "Server=SERVER;Database=DATABASE;User Id=sa;Password=dd"
|
||||||
|
Public Property CertificateFile As String = "C:\Path\To\Cert.pfx"
|
||||||
|
Public Property CertificatePass As String = "CertificatePassword"
|
||||||
|
Public Property Email As String = "foo.bar@wisag.de"
|
||||||
|
Public Property Password As String = "Password"
|
||||||
|
Public Property BaseUrl As String = "https://data.api.wisag.de:8443"
|
||||||
|
|
||||||
|
Public Property ProxyHost As String = ""
|
||||||
|
Public Property ProxyPort As Integer = 0
|
||||||
|
Public Property ProxyUsername As String = ""
|
||||||
|
Public Property ProxyPassword As String = ""
|
||||||
|
|
||||||
|
Public Function HasProxySet() As Boolean
|
||||||
|
Return ProxyHost <> "" And ProxyPort > 0
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function HasProxyCredentialsSet() As Boolean
|
||||||
|
Return ProxyUsername <> "" And ProxyPassword <> ""
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
193
GUIs.Test.GraphQLTest/Form1.Designer.vb
generated
193
GUIs.Test.GraphQLTest/Form1.Designer.vb
generated
@ -1,193 +0,0 @@
|
|||||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
|
||||||
Partial Class Form1
|
|
||||||
Inherits System.Windows.Forms.Form
|
|
||||||
|
|
||||||
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
|
||||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
|
||||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
|
||||||
Try
|
|
||||||
If disposing AndAlso components IsNot Nothing Then
|
|
||||||
components.Dispose()
|
|
||||||
End If
|
|
||||||
Finally
|
|
||||||
MyBase.Dispose(disposing)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
'Wird vom Windows Form-Designer benötigt.
|
|
||||||
Private components As System.ComponentModel.IContainer
|
|
||||||
|
|
||||||
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
|
||||||
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
|
||||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
|
||||||
<System.Diagnostics.DebuggerStepThrough()> _
|
|
||||||
Private Sub InitializeComponent()
|
|
||||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
|
|
||||||
Me.Button1 = New System.Windows.Forms.Button()
|
|
||||||
Me.txtBaseUrl = New System.Windows.Forms.TextBox()
|
|
||||||
Me.txtUsername = New System.Windows.Forms.TextBox()
|
|
||||||
Me.txtPassword = New System.Windows.Forms.TextBox()
|
|
||||||
Me.txtCertFile = New System.Windows.Forms.TextBox()
|
|
||||||
Me.txtCertPass = New System.Windows.Forms.TextBox()
|
|
||||||
Me.Label1 = New System.Windows.Forms.Label()
|
|
||||||
Me.Label2 = New System.Windows.Forms.Label()
|
|
||||||
Me.Label3 = New System.Windows.Forms.Label()
|
|
||||||
Me.Label4 = New System.Windows.Forms.Label()
|
|
||||||
Me.Label5 = New System.Windows.Forms.Label()
|
|
||||||
Me.txtResults = New System.Windows.Forms.TextBox()
|
|
||||||
Me.txtQuery = New System.Windows.Forms.TextBox()
|
|
||||||
Me.SuspendLayout()
|
|
||||||
'
|
|
||||||
'Button1
|
|
||||||
'
|
|
||||||
Me.Button1.Location = New System.Drawing.Point(15, 407)
|
|
||||||
Me.Button1.Name = "Button1"
|
|
||||||
Me.Button1.Size = New System.Drawing.Size(318, 31)
|
|
||||||
Me.Button1.TabIndex = 0
|
|
||||||
Me.Button1.Text = "Run!"
|
|
||||||
Me.Button1.UseVisualStyleBackColor = True
|
|
||||||
'
|
|
||||||
'txtBaseUrl
|
|
||||||
'
|
|
||||||
Me.txtBaseUrl.Location = New System.Drawing.Point(86, 6)
|
|
||||||
Me.txtBaseUrl.Name = "txtBaseUrl"
|
|
||||||
Me.txtBaseUrl.Size = New System.Drawing.Size(247, 20)
|
|
||||||
Me.txtBaseUrl.TabIndex = 1
|
|
||||||
Me.txtBaseUrl.Text = "https://data.api.wisag.de:8090"
|
|
||||||
'
|
|
||||||
'txtUsername
|
|
||||||
'
|
|
||||||
Me.txtUsername.Location = New System.Drawing.Point(86, 32)
|
|
||||||
Me.txtUsername.Name = "txtUsername"
|
|
||||||
Me.txtUsername.Size = New System.Drawing.Size(247, 20)
|
|
||||||
Me.txtUsername.TabIndex = 1
|
|
||||||
Me.txtUsername.Text = "j.jenne@digitaldata.works"
|
|
||||||
'
|
|
||||||
'txtPassword
|
|
||||||
'
|
|
||||||
Me.txtPassword.Location = New System.Drawing.Point(86, 58)
|
|
||||||
Me.txtPassword.Name = "txtPassword"
|
|
||||||
Me.txtPassword.Size = New System.Drawing.Size(247, 20)
|
|
||||||
Me.txtPassword.TabIndex = 1
|
|
||||||
Me.txtPassword.Text = "DigitalData01!"
|
|
||||||
'
|
|
||||||
'txtCertFile
|
|
||||||
'
|
|
||||||
Me.txtCertFile.Location = New System.Drawing.Point(86, 84)
|
|
||||||
Me.txtCertFile.Name = "txtCertFile"
|
|
||||||
Me.txtCertFile.Size = New System.Drawing.Size(247, 20)
|
|
||||||
Me.txtCertFile.TabIndex = 1
|
|
||||||
Me.txtCertFile.Text = "E:\JenneJ\WISAG\jonathanjenne.pfx"
|
|
||||||
'
|
|
||||||
'txtCertPass
|
|
||||||
'
|
|
||||||
Me.txtCertPass.Location = New System.Drawing.Point(86, 110)
|
|
||||||
Me.txtCertPass.Name = "txtCertPass"
|
|
||||||
Me.txtCertPass.Size = New System.Drawing.Size(247, 20)
|
|
||||||
Me.txtCertPass.TabIndex = 1
|
|
||||||
Me.txtCertPass.Text = "jonathanjenne"
|
|
||||||
'
|
|
||||||
'Label1
|
|
||||||
'
|
|
||||||
Me.Label1.AutoSize = True
|
|
||||||
Me.Label1.Location = New System.Drawing.Point(12, 9)
|
|
||||||
Me.Label1.Name = "Label1"
|
|
||||||
Me.Label1.Size = New System.Drawing.Size(53, 13)
|
|
||||||
Me.Label1.TabIndex = 2
|
|
||||||
Me.Label1.Text = "BaseURL"
|
|
||||||
'
|
|
||||||
'Label2
|
|
||||||
'
|
|
||||||
Me.Label2.AutoSize = True
|
|
||||||
Me.Label2.Location = New System.Drawing.Point(12, 35)
|
|
||||||
Me.Label2.Name = "Label2"
|
|
||||||
Me.Label2.Size = New System.Drawing.Size(32, 13)
|
|
||||||
Me.Label2.TabIndex = 2
|
|
||||||
Me.Label2.Text = "Email"
|
|
||||||
'
|
|
||||||
'Label3
|
|
||||||
'
|
|
||||||
Me.Label3.AutoSize = True
|
|
||||||
Me.Label3.Location = New System.Drawing.Point(12, 61)
|
|
||||||
Me.Label3.Name = "Label3"
|
|
||||||
Me.Label3.Size = New System.Drawing.Size(53, 13)
|
|
||||||
Me.Label3.TabIndex = 2
|
|
||||||
Me.Label3.Text = "Password"
|
|
||||||
'
|
|
||||||
'Label4
|
|
||||||
'
|
|
||||||
Me.Label4.AutoSize = True
|
|
||||||
Me.Label4.Location = New System.Drawing.Point(12, 87)
|
|
||||||
Me.Label4.Name = "Label4"
|
|
||||||
Me.Label4.Size = New System.Drawing.Size(45, 13)
|
|
||||||
Me.Label4.TabIndex = 2
|
|
||||||
Me.Label4.Text = "Cert File"
|
|
||||||
'
|
|
||||||
'Label5
|
|
||||||
'
|
|
||||||
Me.Label5.AutoSize = True
|
|
||||||
Me.Label5.Location = New System.Drawing.Point(12, 113)
|
|
||||||
Me.Label5.Name = "Label5"
|
|
||||||
Me.Label5.Size = New System.Drawing.Size(52, 13)
|
|
||||||
Me.Label5.TabIndex = 2
|
|
||||||
Me.Label5.Text = "Cert Pass"
|
|
||||||
'
|
|
||||||
'txtResults
|
|
||||||
'
|
|
||||||
Me.txtResults.Font = New System.Drawing.Font("Consolas", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
||||||
Me.txtResults.Location = New System.Drawing.Point(339, 6)
|
|
||||||
Me.txtResults.Multiline = True
|
|
||||||
Me.txtResults.Name = "txtResults"
|
|
||||||
Me.txtResults.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
|
|
||||||
Me.txtResults.Size = New System.Drawing.Size(881, 432)
|
|
||||||
Me.txtResults.TabIndex = 3
|
|
||||||
'
|
|
||||||
'txtQuery
|
|
||||||
'
|
|
||||||
Me.txtQuery.Font = New System.Drawing.Font("Consolas", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
|
||||||
Me.txtQuery.Location = New System.Drawing.Point(15, 136)
|
|
||||||
Me.txtQuery.Multiline = True
|
|
||||||
Me.txtQuery.Name = "txtQuery"
|
|
||||||
Me.txtQuery.Size = New System.Drawing.Size(318, 265)
|
|
||||||
Me.txtQuery.TabIndex = 4
|
|
||||||
Me.txtQuery.Text = resources.GetString("txtQuery.Text")
|
|
||||||
'
|
|
||||||
'Form1
|
|
||||||
'
|
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
|
||||||
Me.ClientSize = New System.Drawing.Size(1232, 450)
|
|
||||||
Me.Controls.Add(Me.txtQuery)
|
|
||||||
Me.Controls.Add(Me.txtResults)
|
|
||||||
Me.Controls.Add(Me.Label5)
|
|
||||||
Me.Controls.Add(Me.Label4)
|
|
||||||
Me.Controls.Add(Me.Label3)
|
|
||||||
Me.Controls.Add(Me.Label2)
|
|
||||||
Me.Controls.Add(Me.Label1)
|
|
||||||
Me.Controls.Add(Me.txtCertPass)
|
|
||||||
Me.Controls.Add(Me.txtCertFile)
|
|
||||||
Me.Controls.Add(Me.txtPassword)
|
|
||||||
Me.Controls.Add(Me.txtUsername)
|
|
||||||
Me.Controls.Add(Me.txtBaseUrl)
|
|
||||||
Me.Controls.Add(Me.Button1)
|
|
||||||
Me.Name = "Form1"
|
|
||||||
Me.Text = "GraphQL Interface Test"
|
|
||||||
Me.ResumeLayout(False)
|
|
||||||
Me.PerformLayout()
|
|
||||||
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Friend WithEvents Button1 As Button
|
|
||||||
Friend WithEvents txtBaseUrl As TextBox
|
|
||||||
Friend WithEvents txtUsername As TextBox
|
|
||||||
Friend WithEvents txtPassword As TextBox
|
|
||||||
Friend WithEvents txtCertFile As TextBox
|
|
||||||
Friend WithEvents txtCertPass As TextBox
|
|
||||||
Friend WithEvents Label1 As Label
|
|
||||||
Friend WithEvents Label2 As Label
|
|
||||||
Friend WithEvents Label3 As Label
|
|
||||||
Friend WithEvents Label4 As Label
|
|
||||||
Friend WithEvents Label5 As Label
|
|
||||||
Friend WithEvents txtResults As TextBox
|
|
||||||
Friend WithEvents txtQuery As TextBox
|
|
||||||
End Class
|
|
||||||
@ -1,46 +0,0 @@
|
|||||||
Imports System.IO
|
|
||||||
Imports DigitalData.Modules.Interfaces
|
|
||||||
Imports DigitalData.Modules.Logging
|
|
||||||
|
|
||||||
Public Class Form1
|
|
||||||
Private _LogConfig As LogConfig
|
|
||||||
Private _Interface As GraphQLInterface
|
|
||||||
|
|
||||||
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
|
||||||
_LogConfig = New LogConfig(LogConfig.PathType.CurrentDirectory)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
||||||
Try
|
|
||||||
_Interface = New GraphQLInterface(_LogConfig,
|
|
||||||
txtBaseUrl.Text,
|
|
||||||
txtUsername.Text,
|
|
||||||
txtPassword.Text,
|
|
||||||
txtCertFile.Text,
|
|
||||||
txtCertPass.Text)
|
|
||||||
|
|
||||||
Dim oLoginResponse = _Interface.Login()
|
|
||||||
_Interface.SaveCookies(oLoginResponse.Cookies.Item(0))
|
|
||||||
|
|
||||||
Dim oDataResponse = _Interface.GetData(txtQuery.Text, "Nls")
|
|
||||||
Dim oResult As String
|
|
||||||
|
|
||||||
Using oStream = oDataResponse.GetResponseStream()
|
|
||||||
Using oReader As New StreamReader(oStream)
|
|
||||||
oResult = oReader.ReadToEnd()
|
|
||||||
End Using
|
|
||||||
End Using
|
|
||||||
|
|
||||||
File.WriteAllText("E:\JenneJ\WISAG\results.json", oResult)
|
|
||||||
|
|
||||||
Dim oObj = Newtonsoft.Json.JsonConvert.DeserializeObject(oResult)
|
|
||||||
Dim oJson = Newtonsoft.Json.JsonConvert.SerializeObject(oObj, Newtonsoft.Json.Formatting.Indented)
|
|
||||||
|
|
||||||
txtResults.Text = oJson
|
|
||||||
|
|
||||||
Dim oLogoutResponse = _Interface.Logout()
|
|
||||||
Catch ex As Exception
|
|
||||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
|
||||||
End Try
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
@ -84,11 +84,12 @@
|
|||||||
<Import Include="System.Threading.Tasks" />
|
<Import Include="System.Threading.Tasks" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Form1.vb">
|
<Compile Include="Config.vb" />
|
||||||
|
<Compile Include="frmMain.vb">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Form1.Designer.vb">
|
<Compile Include="frmMain.Designer.vb">
|
||||||
<DependentUpon>Form1.vb</DependentUpon>
|
<DependentUpon>frmMain.vb</DependentUpon>
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||||
@ -108,8 +109,8 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Form1.resx">
|
<EmbeddedResource Include="frmMain.resx">
|
||||||
<DependentUpon>Form1.vb</DependentUpon>
|
<DependentUpon>frmMain.vb</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="My Project\Resources.resx">
|
<EmbeddedResource Include="My Project\Resources.resx">
|
||||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||||
@ -132,6 +133,14 @@
|
|||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Modules.Config\Config.vbproj">
|
||||||
|
<Project>{44982f9b-6116-44e2-85d0-f39650b1ef99}</Project>
|
||||||
|
<Name>Config</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\Modules.Database\Database.vbproj">
|
||||||
|
<Project>{EAF0EA75-5FA7-485D-89C7-B2D843B03A96}</Project>
|
||||||
|
<Name>Database</Name>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\Modules.Interfaces\Interfaces.vbproj">
|
<ProjectReference Include="..\Modules.Interfaces\Interfaces.vbproj">
|
||||||
<Project>{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64}</Project>
|
<Project>{AB6F09BF-E794-4F6A-94BB-C97C0BA84D64}</Project>
|
||||||
<Name>Interfaces</Name>
|
<Name>Interfaces</Name>
|
||||||
@ -141,5 +150,8 @@
|
|||||||
<Name>Logging</Name>
|
<Name>Logging</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="My Project\DataSources\" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@ -32,7 +32,7 @@ Namespace My
|
|||||||
|
|
||||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||||
Protected Overrides Sub OnCreateMainForm()
|
Protected Overrides Sub OnCreateMainForm()
|
||||||
Me.MainForm = Global.GUIs.Test.GraphQLTest.Form1
|
Me.MainForm = Global.GUIs.Test.GraphQLTest.frmMain
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|||||||
144
GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb
generated
144
GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb
generated
@ -1,10 +1,10 @@
|
|||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
' <auto-generated>
|
' <auto-generated>
|
||||||
' This code was generated by a tool.
|
' Dieser Code wurde von einem Tool generiert.
|
||||||
' Runtime Version:4.0.30319.42000
|
' Laufzeitversion:4.0.30319.42000
|
||||||
'
|
'
|
||||||
' Changes to this file may cause incorrect behavior and will be lost if
|
' Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
|
||||||
' the code is regenerated.
|
' der Code erneut generiert wird.
|
||||||
' </auto-generated>
|
' </auto-generated>
|
||||||
'------------------------------------------------------------------------------
|
'------------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -13,57 +13,129 @@ Option Explicit On
|
|||||||
|
|
||||||
|
|
||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
|
|
||||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
|
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||||
|
|
||||||
#Region "My.Settings Auto-Save Functionality"
|
#Region "Automatische My.Settings-Speicherfunktion"
|
||||||
#If _MyType = "WindowsForms" Then
|
#If _MyType = "WindowsForms" Then
|
||||||
Private Shared addedHandler As Boolean
|
Private Shared addedHandler As Boolean
|
||||||
|
|
||||||
Private Shared addedHandlerLockObject As New Object
|
Private Shared addedHandlerLockObject As New Object
|
||||||
|
|
||||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
|
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||||
If My.Application.SaveMySettingsOnExit Then
|
If My.Application.SaveMySettingsOnExit Then
|
||||||
My.Settings.Save()
|
My.Settings.Save()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
#End If
|
#End If
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
Public Shared ReadOnly Property [Default]() As MySettings
|
Public Shared ReadOnly Property [Default]() As MySettings
|
||||||
Get
|
Get
|
||||||
|
|
||||||
#If _MyType = "WindowsForms" Then
|
#If _MyType = "WindowsForms" Then
|
||||||
If Not addedHandler Then
|
If Not addedHandler Then
|
||||||
SyncLock addedHandlerLockObject
|
SyncLock addedHandlerLockObject
|
||||||
If Not addedHandler Then
|
If Not addedHandler Then
|
||||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||||
addedHandler = True
|
addedHandler = True
|
||||||
End If
|
End If
|
||||||
End SyncLock
|
End SyncLock
|
||||||
End If
|
End If
|
||||||
#End If
|
#End If
|
||||||
Return defaultInstance
|
Return defaultInstance
|
||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property ConnectionString() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("ConnectionString"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("ConnectionString") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property CertificateFile() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("CertificateFile"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("CertificateFile") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property CertificatePass() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("CertificatePass"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("CertificatePass") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property Email() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("Email"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("Email") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property Password() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("Password"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("Password") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
|
Public Property BaseUrl() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("BaseUrl"),String)
|
||||||
|
End Get
|
||||||
|
Set
|
||||||
|
Me("BaseUrl") = value
|
||||||
|
End Set
|
||||||
|
End Property
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|
||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||||
Friend Module MySettingsProperty
|
Friend Module MySettingsProperty
|
||||||
|
|
||||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||||
Friend ReadOnly Property Settings() As Global.GUIs.Test.GraphQLTest.My.MySettings
|
Friend ReadOnly Property Settings() As Global.GUIs.Test.GraphQLTest.My.MySettings
|
||||||
Get
|
Get
|
||||||
Return Global.GUIs.Test.GraphQLTest.My.MySettings.Default
|
Return Global.GUIs.Test.GraphQLTest.My.MySettings.Default
|
||||||
|
|||||||
@ -1,7 +1,24 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||||
<Profiles>
|
<Profiles />
|
||||||
<Profile Name="(Default)" />
|
<Settings>
|
||||||
</Profiles>
|
<Setting Name="ConnectionString" Type="System.String" Scope="User">
|
||||||
<Settings />
|
<Value Profile="(Default)" />
|
||||||
</SettingsFile>
|
</Setting>
|
||||||
|
<Setting Name="CertificateFile" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="CertificatePass" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="Email" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="Password" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="BaseUrl" Type="System.String" Scope="User">
|
||||||
|
<Value Profile="(Default)" />
|
||||||
|
</Setting>
|
||||||
|
</Settings>
|
||||||
|
</SettingsFile>
|
||||||
366
GUIs.Test.GraphQLTest/frmMain.Designer.vb
generated
Normal file
366
GUIs.Test.GraphQLTest/frmMain.Designer.vb
generated
Normal file
@ -0,0 +1,366 @@
|
|||||||
|
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||||
|
Partial Class frmMain
|
||||||
|
Inherits System.Windows.Forms.Form
|
||||||
|
|
||||||
|
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
|
||||||
|
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||||
|
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||||
|
Try
|
||||||
|
If disposing AndAlso components IsNot Nothing Then
|
||||||
|
components.Dispose()
|
||||||
|
End If
|
||||||
|
Finally
|
||||||
|
MyBase.Dispose(disposing)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
'Wird vom Windows Form-Designer benötigt.
|
||||||
|
Private components As System.ComponentModel.IContainer
|
||||||
|
|
||||||
|
'Hinweis: Die folgende Prozedur ist für den Windows Form-Designer erforderlich.
|
||||||
|
'Das Bearbeiten ist mit dem Windows Form-Designer möglich.
|
||||||
|
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||||
|
<System.Diagnostics.DebuggerStepThrough()> _
|
||||||
|
Private Sub InitializeComponent()
|
||||||
|
Me.Button1 = New System.Windows.Forms.Button()
|
||||||
|
Me.txtBaseUrl = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtUsername = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtPassword = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtCertFile = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtCertPass = New System.Windows.Forms.TextBox()
|
||||||
|
Me.Label1 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label2 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label3 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label4 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label5 = New System.Windows.Forms.Label()
|
||||||
|
Me.txtResults = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtConnectionString = New System.Windows.Forms.TextBox()
|
||||||
|
Me.Label6 = New System.Windows.Forms.Label()
|
||||||
|
Me.ComboBox1 = New System.Windows.Forms.ComboBox()
|
||||||
|
Me.Label7 = New System.Windows.Forms.Label()
|
||||||
|
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||||
|
Me.TabPage1 = New System.Windows.Forms.TabPage()
|
||||||
|
Me.btnLogin = New System.Windows.Forms.Button()
|
||||||
|
Me.ProgressBar1 = New System.Windows.Forms.ProgressBar()
|
||||||
|
Me.txtProxyHost = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtProxyUser = New System.Windows.Forms.TextBox()
|
||||||
|
Me.txtProxyPass = New System.Windows.Forms.TextBox()
|
||||||
|
Me.Label8 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label9 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label10 = New System.Windows.Forms.Label()
|
||||||
|
Me.txtProxyPort = New System.Windows.Forms.TextBox()
|
||||||
|
Me.Label11 = New System.Windows.Forms.Label()
|
||||||
|
Me.TabControl1.SuspendLayout()
|
||||||
|
Me.TabPage1.SuspendLayout()
|
||||||
|
Me.SuspendLayout()
|
||||||
|
'
|
||||||
|
'Button1
|
||||||
|
'
|
||||||
|
Me.Button1.Location = New System.Drawing.Point(826, 386)
|
||||||
|
Me.Button1.Name = "Button1"
|
||||||
|
Me.Button1.Size = New System.Drawing.Size(96, 31)
|
||||||
|
Me.Button1.TabIndex = 0
|
||||||
|
Me.Button1.Text = "Run!"
|
||||||
|
Me.Button1.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'txtBaseUrl
|
||||||
|
'
|
||||||
|
Me.txtBaseUrl.Location = New System.Drawing.Point(106, 6)
|
||||||
|
Me.txtBaseUrl.Name = "txtBaseUrl"
|
||||||
|
Me.txtBaseUrl.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtBaseUrl.TabIndex = 1
|
||||||
|
Me.txtBaseUrl.Text = "https://data.api.wisag.de:8443"
|
||||||
|
'
|
||||||
|
'txtUsername
|
||||||
|
'
|
||||||
|
Me.txtUsername.Location = New System.Drawing.Point(106, 32)
|
||||||
|
Me.txtUsername.Name = "txtUsername"
|
||||||
|
Me.txtUsername.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtUsername.TabIndex = 1
|
||||||
|
Me.txtUsername.Text = "j.jenne@digitaldata.works"
|
||||||
|
'
|
||||||
|
'txtPassword
|
||||||
|
'
|
||||||
|
Me.txtPassword.Location = New System.Drawing.Point(106, 58)
|
||||||
|
Me.txtPassword.Name = "txtPassword"
|
||||||
|
Me.txtPassword.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtPassword.TabIndex = 1
|
||||||
|
Me.txtPassword.Text = "DigitalData01!"
|
||||||
|
'
|
||||||
|
'txtCertFile
|
||||||
|
'
|
||||||
|
Me.txtCertFile.Location = New System.Drawing.Point(106, 84)
|
||||||
|
Me.txtCertFile.Name = "txtCertFile"
|
||||||
|
Me.txtCertFile.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtCertFile.TabIndex = 1
|
||||||
|
Me.txtCertFile.Text = "E:\JenneJ\WISAG\jonathanjenne.pfx"
|
||||||
|
'
|
||||||
|
'txtCertPass
|
||||||
|
'
|
||||||
|
Me.txtCertPass.Location = New System.Drawing.Point(106, 110)
|
||||||
|
Me.txtCertPass.Name = "txtCertPass"
|
||||||
|
Me.txtCertPass.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtCertPass.TabIndex = 1
|
||||||
|
Me.txtCertPass.Text = "jonathanjenne"
|
||||||
|
'
|
||||||
|
'Label1
|
||||||
|
'
|
||||||
|
Me.Label1.AutoSize = True
|
||||||
|
Me.Label1.Location = New System.Drawing.Point(12, 9)
|
||||||
|
Me.Label1.Name = "Label1"
|
||||||
|
Me.Label1.Size = New System.Drawing.Size(53, 13)
|
||||||
|
Me.Label1.TabIndex = 2
|
||||||
|
Me.Label1.Text = "BaseURL"
|
||||||
|
'
|
||||||
|
'Label2
|
||||||
|
'
|
||||||
|
Me.Label2.AutoSize = True
|
||||||
|
Me.Label2.Location = New System.Drawing.Point(12, 35)
|
||||||
|
Me.Label2.Name = "Label2"
|
||||||
|
Me.Label2.Size = New System.Drawing.Size(32, 13)
|
||||||
|
Me.Label2.TabIndex = 2
|
||||||
|
Me.Label2.Text = "Email"
|
||||||
|
'
|
||||||
|
'Label3
|
||||||
|
'
|
||||||
|
Me.Label3.AutoSize = True
|
||||||
|
Me.Label3.Location = New System.Drawing.Point(12, 61)
|
||||||
|
Me.Label3.Name = "Label3"
|
||||||
|
Me.Label3.Size = New System.Drawing.Size(53, 13)
|
||||||
|
Me.Label3.TabIndex = 2
|
||||||
|
Me.Label3.Text = "Password"
|
||||||
|
'
|
||||||
|
'Label4
|
||||||
|
'
|
||||||
|
Me.Label4.AutoSize = True
|
||||||
|
Me.Label4.Location = New System.Drawing.Point(12, 87)
|
||||||
|
Me.Label4.Name = "Label4"
|
||||||
|
Me.Label4.Size = New System.Drawing.Size(45, 13)
|
||||||
|
Me.Label4.TabIndex = 2
|
||||||
|
Me.Label4.Text = "Cert File"
|
||||||
|
'
|
||||||
|
'Label5
|
||||||
|
'
|
||||||
|
Me.Label5.AutoSize = True
|
||||||
|
Me.Label5.Location = New System.Drawing.Point(12, 113)
|
||||||
|
Me.Label5.Name = "Label5"
|
||||||
|
Me.Label5.Size = New System.Drawing.Size(52, 13)
|
||||||
|
Me.Label5.TabIndex = 2
|
||||||
|
Me.Label5.Text = "Cert Pass"
|
||||||
|
'
|
||||||
|
'txtResults
|
||||||
|
'
|
||||||
|
Me.txtResults.Dock = System.Windows.Forms.DockStyle.Fill
|
||||||
|
Me.txtResults.Font = New System.Drawing.Font("Consolas", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.txtResults.Location = New System.Drawing.Point(3, 3)
|
||||||
|
Me.txtResults.Multiline = True
|
||||||
|
Me.txtResults.Name = "txtResults"
|
||||||
|
Me.txtResults.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
|
||||||
|
Me.txtResults.Size = New System.Drawing.Size(458, 342)
|
||||||
|
Me.txtResults.TabIndex = 3
|
||||||
|
'
|
||||||
|
'txtConnectionString
|
||||||
|
'
|
||||||
|
Me.txtConnectionString.Location = New System.Drawing.Point(106, 136)
|
||||||
|
Me.txtConnectionString.Multiline = True
|
||||||
|
Me.txtConnectionString.Name = "txtConnectionString"
|
||||||
|
Me.txtConnectionString.Size = New System.Drawing.Size(338, 98)
|
||||||
|
Me.txtConnectionString.TabIndex = 1
|
||||||
|
'
|
||||||
|
'Label6
|
||||||
|
'
|
||||||
|
Me.Label6.AutoSize = True
|
||||||
|
Me.Label6.Location = New System.Drawing.Point(12, 139)
|
||||||
|
Me.Label6.Name = "Label6"
|
||||||
|
Me.Label6.Size = New System.Drawing.Size(88, 13)
|
||||||
|
Me.Label6.TabIndex = 2
|
||||||
|
Me.Label6.Text = "ConnectionString"
|
||||||
|
'
|
||||||
|
'ComboBox1
|
||||||
|
'
|
||||||
|
Me.ComboBox1.FormattingEnabled = True
|
||||||
|
Me.ComboBox1.Items.AddRange(New Object() {"SAPDaten"})
|
||||||
|
Me.ComboBox1.Location = New System.Drawing.Point(106, 352)
|
||||||
|
Me.ComboBox1.Name = "ComboBox1"
|
||||||
|
Me.ComboBox1.Size = New System.Drawing.Size(338, 21)
|
||||||
|
Me.ComboBox1.TabIndex = 4
|
||||||
|
'
|
||||||
|
'Label7
|
||||||
|
'
|
||||||
|
Me.Label7.AutoSize = True
|
||||||
|
Me.Label7.Location = New System.Drawing.Point(12, 355)
|
||||||
|
Me.Label7.Name = "Label7"
|
||||||
|
Me.Label7.Size = New System.Drawing.Size(35, 13)
|
||||||
|
Me.Label7.TabIndex = 2
|
||||||
|
Me.Label7.Text = "Query"
|
||||||
|
'
|
||||||
|
'TabControl1
|
||||||
|
'
|
||||||
|
Me.TabControl1.Controls.Add(Me.TabPage1)
|
||||||
|
Me.TabControl1.Location = New System.Drawing.Point(450, 6)
|
||||||
|
Me.TabControl1.Name = "TabControl1"
|
||||||
|
Me.TabControl1.SelectedIndex = 0
|
||||||
|
Me.TabControl1.Size = New System.Drawing.Size(472, 374)
|
||||||
|
Me.TabControl1.TabIndex = 5
|
||||||
|
'
|
||||||
|
'TabPage1
|
||||||
|
'
|
||||||
|
Me.TabPage1.Controls.Add(Me.txtResults)
|
||||||
|
Me.TabPage1.Location = New System.Drawing.Point(4, 22)
|
||||||
|
Me.TabPage1.Name = "TabPage1"
|
||||||
|
Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
|
||||||
|
Me.TabPage1.Size = New System.Drawing.Size(464, 348)
|
||||||
|
Me.TabPage1.TabIndex = 0
|
||||||
|
Me.TabPage1.Text = "Raw GraphQL Result"
|
||||||
|
Me.TabPage1.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'btnLogin
|
||||||
|
'
|
||||||
|
Me.btnLogin.Location = New System.Drawing.Point(724, 386)
|
||||||
|
Me.btnLogin.Name = "btnLogin"
|
||||||
|
Me.btnLogin.Size = New System.Drawing.Size(96, 31)
|
||||||
|
Me.btnLogin.TabIndex = 0
|
||||||
|
Me.btnLogin.Text = "Login"
|
||||||
|
Me.btnLogin.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'ProgressBar1
|
||||||
|
'
|
||||||
|
Me.ProgressBar1.Location = New System.Drawing.Point(12, 394)
|
||||||
|
Me.ProgressBar1.Name = "ProgressBar1"
|
||||||
|
Me.ProgressBar1.Size = New System.Drawing.Size(432, 23)
|
||||||
|
Me.ProgressBar1.TabIndex = 6
|
||||||
|
'
|
||||||
|
'txtProxyHost
|
||||||
|
'
|
||||||
|
Me.txtProxyHost.Location = New System.Drawing.Point(106, 240)
|
||||||
|
Me.txtProxyHost.Name = "txtProxyHost"
|
||||||
|
Me.txtProxyHost.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtProxyHost.TabIndex = 1
|
||||||
|
'
|
||||||
|
'txtProxyUser
|
||||||
|
'
|
||||||
|
Me.txtProxyUser.Location = New System.Drawing.Point(106, 292)
|
||||||
|
Me.txtProxyUser.Name = "txtProxyUser"
|
||||||
|
Me.txtProxyUser.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtProxyUser.TabIndex = 1
|
||||||
|
'
|
||||||
|
'txtProxyPass
|
||||||
|
'
|
||||||
|
Me.txtProxyPass.Location = New System.Drawing.Point(106, 318)
|
||||||
|
Me.txtProxyPass.Name = "txtProxyPass"
|
||||||
|
Me.txtProxyPass.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtProxyPass.TabIndex = 1
|
||||||
|
'
|
||||||
|
'Label8
|
||||||
|
'
|
||||||
|
Me.Label8.AutoSize = True
|
||||||
|
Me.Label8.Location = New System.Drawing.Point(12, 243)
|
||||||
|
Me.Label8.Name = "Label8"
|
||||||
|
Me.Label8.Size = New System.Drawing.Size(58, 13)
|
||||||
|
Me.Label8.TabIndex = 2
|
||||||
|
Me.Label8.Text = "Proxy Host"
|
||||||
|
'
|
||||||
|
'Label9
|
||||||
|
'
|
||||||
|
Me.Label9.AutoSize = True
|
||||||
|
Me.Label9.Location = New System.Drawing.Point(12, 295)
|
||||||
|
Me.Label9.Name = "Label9"
|
||||||
|
Me.Label9.Size = New System.Drawing.Size(58, 13)
|
||||||
|
Me.Label9.TabIndex = 2
|
||||||
|
Me.Label9.Text = "Proxy User"
|
||||||
|
'
|
||||||
|
'Label10
|
||||||
|
'
|
||||||
|
Me.Label10.AutoSize = True
|
||||||
|
Me.Label10.Location = New System.Drawing.Point(12, 321)
|
||||||
|
Me.Label10.Name = "Label10"
|
||||||
|
Me.Label10.Size = New System.Drawing.Size(82, 13)
|
||||||
|
Me.Label10.TabIndex = 2
|
||||||
|
Me.Label10.Text = "Proxy Password"
|
||||||
|
'
|
||||||
|
'txtProxyPort
|
||||||
|
'
|
||||||
|
Me.txtProxyPort.Location = New System.Drawing.Point(106, 266)
|
||||||
|
Me.txtProxyPort.Name = "txtProxyPort"
|
||||||
|
Me.txtProxyPort.Size = New System.Drawing.Size(338, 20)
|
||||||
|
Me.txtProxyPort.TabIndex = 1
|
||||||
|
'
|
||||||
|
'Label11
|
||||||
|
'
|
||||||
|
Me.Label11.AutoSize = True
|
||||||
|
Me.Label11.Location = New System.Drawing.Point(12, 269)
|
||||||
|
Me.Label11.Name = "Label11"
|
||||||
|
Me.Label11.Size = New System.Drawing.Size(55, 13)
|
||||||
|
Me.Label11.TabIndex = 2
|
||||||
|
Me.Label11.Text = "Proxy Port"
|
||||||
|
'
|
||||||
|
'frmMain
|
||||||
|
'
|
||||||
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
|
Me.ClientSize = New System.Drawing.Size(934, 429)
|
||||||
|
Me.Controls.Add(Me.ProgressBar1)
|
||||||
|
Me.Controls.Add(Me.TabControl1)
|
||||||
|
Me.Controls.Add(Me.ComboBox1)
|
||||||
|
Me.Controls.Add(Me.Label7)
|
||||||
|
Me.Controls.Add(Me.Label6)
|
||||||
|
Me.Controls.Add(Me.Label5)
|
||||||
|
Me.Controls.Add(Me.Label4)
|
||||||
|
Me.Controls.Add(Me.Label10)
|
||||||
|
Me.Controls.Add(Me.Label3)
|
||||||
|
Me.Controls.Add(Me.Label9)
|
||||||
|
Me.Controls.Add(Me.Label2)
|
||||||
|
Me.Controls.Add(Me.Label11)
|
||||||
|
Me.Controls.Add(Me.Label8)
|
||||||
|
Me.Controls.Add(Me.Label1)
|
||||||
|
Me.Controls.Add(Me.txtConnectionString)
|
||||||
|
Me.Controls.Add(Me.txtCertPass)
|
||||||
|
Me.Controls.Add(Me.txtCertFile)
|
||||||
|
Me.Controls.Add(Me.txtProxyPass)
|
||||||
|
Me.Controls.Add(Me.txtPassword)
|
||||||
|
Me.Controls.Add(Me.txtProxyUser)
|
||||||
|
Me.Controls.Add(Me.txtUsername)
|
||||||
|
Me.Controls.Add(Me.txtProxyPort)
|
||||||
|
Me.Controls.Add(Me.txtProxyHost)
|
||||||
|
Me.Controls.Add(Me.txtBaseUrl)
|
||||||
|
Me.Controls.Add(Me.btnLogin)
|
||||||
|
Me.Controls.Add(Me.Button1)
|
||||||
|
Me.Name = "frmMain"
|
||||||
|
Me.Text = "GraphQL Interface"
|
||||||
|
Me.TabControl1.ResumeLayout(False)
|
||||||
|
Me.TabPage1.ResumeLayout(False)
|
||||||
|
Me.TabPage1.PerformLayout()
|
||||||
|
Me.ResumeLayout(False)
|
||||||
|
Me.PerformLayout()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Friend WithEvents Button1 As Button
|
||||||
|
Friend WithEvents txtBaseUrl As TextBox
|
||||||
|
Friend WithEvents txtUsername As TextBox
|
||||||
|
Friend WithEvents txtPassword As TextBox
|
||||||
|
Friend WithEvents txtCertFile As TextBox
|
||||||
|
Friend WithEvents txtCertPass As TextBox
|
||||||
|
Friend WithEvents Label1 As Label
|
||||||
|
Friend WithEvents Label2 As Label
|
||||||
|
Friend WithEvents Label3 As Label
|
||||||
|
Friend WithEvents Label4 As Label
|
||||||
|
Friend WithEvents Label5 As Label
|
||||||
|
Friend WithEvents txtResults As TextBox
|
||||||
|
Friend WithEvents txtConnectionString As TextBox
|
||||||
|
Friend WithEvents Label6 As Label
|
||||||
|
Friend WithEvents ComboBox1 As ComboBox
|
||||||
|
Friend WithEvents Label7 As Label
|
||||||
|
Friend WithEvents TabControl1 As TabControl
|
||||||
|
Friend WithEvents TabPage1 As TabPage
|
||||||
|
Friend WithEvents btnLogin As Button
|
||||||
|
Friend WithEvents ProgressBar1 As ProgressBar
|
||||||
|
Friend WithEvents txtProxyHost As TextBox
|
||||||
|
Friend WithEvents txtProxyUser As TextBox
|
||||||
|
Friend WithEvents txtProxyPass As TextBox
|
||||||
|
Friend WithEvents Label8 As Label
|
||||||
|
Friend WithEvents Label9 As Label
|
||||||
|
Friend WithEvents Label10 As Label
|
||||||
|
Friend WithEvents txtProxyPort As TextBox
|
||||||
|
Friend WithEvents Label11 As Label
|
||||||
|
End Class
|
||||||
@ -117,22 +117,4 @@
|
|||||||
<resheader name="writer">
|
<resheader name="writer">
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="txtQuery.Text" xml:space="preserve">
|
|
||||||
<value>query Nls{
|
|
||||||
niederlassungen {
|
|
||||||
niederlassungen {
|
|
||||||
mdnr
|
|
||||||
mdkurzbezeichnung
|
|
||||||
bezeichnung
|
|
||||||
sparte {
|
|
||||||
id
|
|
||||||
name
|
|
||||||
__typename
|
|
||||||
}
|
|
||||||
__typename
|
|
||||||
}
|
|
||||||
__typename
|
|
||||||
}
|
|
||||||
}</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
||||||
213
GUIs.Test.GraphQLTest/frmMain.vb
Normal file
213
GUIs.Test.GraphQLTest/frmMain.vb
Normal file
@ -0,0 +1,213 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports DigitalData.Modules.Database
|
||||||
|
Imports DigitalData.Modules.Interfaces
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
Imports DigitalData.Modules.Config
|
||||||
|
Imports Newtonsoft.Json
|
||||||
|
Imports Newtonsoft.Json.Linq
|
||||||
|
Imports System.Net
|
||||||
|
|
||||||
|
Public Class frmMain
|
||||||
|
Private _LogConfig As LogConfig
|
||||||
|
Private _Logger As Logger
|
||||||
|
Private _Interface As GraphQLInterface
|
||||||
|
Private _MSSQL As MSSQLServer
|
||||||
|
Private _Config As ConfigManager(Of Config)
|
||||||
|
Private _Datapools As New List(Of String) From {
|
||||||
|
"sap_aviation",
|
||||||
|
"sap_facility",
|
||||||
|
"sap_holding"
|
||||||
|
}
|
||||||
|
|
||||||
|
Public Class SAPData
|
||||||
|
Public sapdaten As List(Of SAPDataItem)
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Public Class SAPDataItem
|
||||||
|
Public buchungskreis As String
|
||||||
|
Public kostenstelle As String
|
||||||
|
Public beschreibung As String
|
||||||
|
Public gueltig_bis As String
|
||||||
|
End Class
|
||||||
|
|
||||||
|
Const GRAPHQL_QUERY_SAP_DATA = "
|
||||||
|
query SAPDaten {
|
||||||
|
sapdaten(datenpool: __DATA_POOL__) {
|
||||||
|
sapdaten {
|
||||||
|
buchungskreis
|
||||||
|
kostenstelle
|
||||||
|
beschreibung
|
||||||
|
gueltig_bis
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"
|
||||||
|
|
||||||
|
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
|
Try
|
||||||
|
Dim oStartupPath As String = AppDomain.CurrentDomain.BaseDirectory
|
||||||
|
|
||||||
|
_LogConfig = New LogConfig(LogConfig.PathType.CustomPath, oStartupPath) With {
|
||||||
|
.Debug = True
|
||||||
|
}
|
||||||
|
_Logger = _LogConfig.GetLogger()
|
||||||
|
_Config = New ConfigManager(Of Config)(_LogConfig, oStartupPath)
|
||||||
|
|
||||||
|
txtBaseUrl.Text = _Config.Config.BaseUrl
|
||||||
|
txtUsername.Text = _Config.Config.Email
|
||||||
|
txtPassword.Text = _Config.Config.Password
|
||||||
|
txtCertFile.Text = _Config.Config.CertificateFile
|
||||||
|
txtCertPass.Text = _Config.Config.CertificatePass
|
||||||
|
txtConnectionString.Text = _Config.Config.ConnectionString
|
||||||
|
txtProxyHost.Text = _Config.Config.ProxyHost
|
||||||
|
txtProxyPort.Text = _Config.Config.ProxyPort
|
||||||
|
txtProxyUser.Text = _Config.Config.ProxyUsername
|
||||||
|
txtProxyPass.Text = _Config.Config.ProxyPassword
|
||||||
|
|
||||||
|
ComboBox1.SelectedIndex = 0
|
||||||
|
|
||||||
|
_MSSQL = New MSSQLServer(_LogConfig, _Config.Config.ConnectionString)
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnLogin_Click(sender As Object, e As EventArgs) Handles btnLogin.Click
|
||||||
|
Try
|
||||||
|
|
||||||
|
_Interface = New GraphQLInterface(_LogConfig,
|
||||||
|
txtBaseUrl.Text,
|
||||||
|
txtUsername.Text,
|
||||||
|
txtPassword.Text,
|
||||||
|
txtCertFile.Text,
|
||||||
|
txtCertPass.Text)
|
||||||
|
|
||||||
|
If _Config.Config.HasProxySet() And _Config.Config.HasProxyCredentialsSet() Then
|
||||||
|
Dim oURI As New Uri($"http://{_Config.Config.ProxyHost}:{_Config.Config.ProxyPort}")
|
||||||
|
Dim oCredentials As New NetworkCredential(_Config.Config.ProxyUsername, _Config.Config.ProxyPassword)
|
||||||
|
Dim oProxy As New WebProxy() With {
|
||||||
|
.Address = oURI,
|
||||||
|
.UseDefaultCredentials = False,
|
||||||
|
.Credentials = oCredentials
|
||||||
|
}
|
||||||
|
_Interface.Proxy = oProxy
|
||||||
|
|
||||||
|
_Logger.Debug("Using Proxy: {0}", oURI.ToString)
|
||||||
|
_Logger.Debug("Proxy Credentials: [{0}] [{1}]", _Config.Config.ProxyUsername, _Config.Config.ProxyPassword)
|
||||||
|
Else
|
||||||
|
_Logger.Debug("Proxy not set.")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim oResponse = _Interface.Login
|
||||||
|
_Interface.SaveCookies(oResponse.Cookies.Item(0))
|
||||||
|
|
||||||
|
If oResponse.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
|
MsgBox("Login Successful!", MsgBoxStyle.Information, Text)
|
||||||
|
Else
|
||||||
|
MsgBox("Login failed! Check Certificate and User Credentials!", MsgBoxStyle.Critical, Text)
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
MsgBox(ex.Message, MsgBoxStyle.Critical, Text)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||||
|
Try
|
||||||
|
|
||||||
|
If _Interface Is Nothing Then
|
||||||
|
MsgBox("Please login first!", MsgBoxStyle.Exclamation, Text)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ComboBox1.SelectedIndex = -1 Then
|
||||||
|
MsgBox("Please select a query!", MsgBoxStyle.Exclamation, Text)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
|
||||||
|
If ComboBox1.Text = "SAPDaten" Then
|
||||||
|
_MSSQL.ExecuteNonQuery("DELETE FROM TBCUST_SYNC_API_SAPDATEN")
|
||||||
|
|
||||||
|
txtResults.Text = String.Empty
|
||||||
|
|
||||||
|
For Each oDatapool In _Datapools
|
||||||
|
Dim oQuery As String = GRAPHQL_QUERY_SAP_DATA.Trim.Replace("__DATA_POOL__", oDatapool)
|
||||||
|
Dim oDataResponse = _Interface.GetData(oQuery, "SAPDaten")
|
||||||
|
Dim oResult As String
|
||||||
|
|
||||||
|
Using oStream = oDataResponse.GetResponseStream()
|
||||||
|
Using oReader As New StreamReader(oStream)
|
||||||
|
oResult = oReader.ReadToEnd()
|
||||||
|
End Using
|
||||||
|
End Using
|
||||||
|
|
||||||
|
Dim oObj As JObject = JsonConvert.DeserializeObject(oResult)
|
||||||
|
Dim oData As SAPData = ConvertResponse(oResult)
|
||||||
|
|
||||||
|
_Logger.Debug("Inserting [{0}] items for datapool [{1}]", oData.sapdaten.Count, oDatapool)
|
||||||
|
|
||||||
|
Dim oCounter As Integer = 0
|
||||||
|
Dim oTotal As Integer = oData.sapdaten.Count
|
||||||
|
ProgressBar1.Maximum = oTotal
|
||||||
|
ProgressBar1.Value = oCounter
|
||||||
|
|
||||||
|
For Each oItem As SAPDataItem In oData.sapdaten
|
||||||
|
Dim oSQL = $"INSERT INTO TBCUST_SYNC_API_SAPDATEN (BESCHREIBUNG, BUCHUNGSKREIS, KOSTENSTELLE, GUELTIG_BIS) VALUES ('{oItem.beschreibung}', '{oItem.buchungskreis}', '{oItem.kostenstelle}', '{oItem.gueltig_bis}')"
|
||||||
|
Dim oSuccess = _MSSQL.ExecuteNonQuery(oSQL)
|
||||||
|
|
||||||
|
If oSuccess Then
|
||||||
|
_Logger.Debug("Record [{0}] inserted!", oItem.beschreibung)
|
||||||
|
End If
|
||||||
|
|
||||||
|
oCounter += 1
|
||||||
|
ProgressBar1.Value = oCounter
|
||||||
|
Next
|
||||||
|
|
||||||
|
txtResults.Text &= "--------------------------------------------" & vbNewLine
|
||||||
|
txtResults.Text &= $"--- Datapool: {oDatapool}" & vbNewLine
|
||||||
|
txtResults.Text &= JsonConvert.SerializeObject(oObj, Formatting.Indented) & vbNewLine
|
||||||
|
|
||||||
|
Application.DoEvents()
|
||||||
|
Next
|
||||||
|
Else
|
||||||
|
MsgBox("Unknown query!", MsgBoxStyle.Exclamation, Text)
|
||||||
|
Exit Sub
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub frmMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
|
||||||
|
Try
|
||||||
|
_Config.Config.ConnectionString = txtConnectionString.Text
|
||||||
|
_Config.Config.BaseUrl = txtBaseUrl.Text
|
||||||
|
_Config.Config.CertificateFile = txtCertFile.Text
|
||||||
|
_Config.Config.CertificatePass = txtCertPass.Text
|
||||||
|
_Config.Config.Email = txtUsername.Text
|
||||||
|
_Config.Config.Password = txtPassword.Text
|
||||||
|
_Config.Config.ProxyHost = txtProxyHost.Text
|
||||||
|
_Config.Config.ProxyPassword = txtProxyPass.Text
|
||||||
|
_Config.Config.ProxyPort = txtProxyPort.Text
|
||||||
|
_Config.Config.ProxyUsername = txtProxyUser.Text
|
||||||
|
_Config.Save(ForceAll:=True)
|
||||||
|
|
||||||
|
Dim oLogoutResponse = _Interface.Logout()
|
||||||
|
If oLogoutResponse.StatusCode = Net.HttpStatusCode.OK Then
|
||||||
|
_Logger.Info("Logout successful.")
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Function ConvertResponse(JsonString As String) As SAPData
|
||||||
|
Dim oObj As JObject = JObject.Parse(JsonString)("data")("sapdaten")
|
||||||
|
Dim oString As String = JsonConvert.SerializeObject(oObj, Formatting.None)
|
||||||
|
Dim oSAPData As SAPData = JsonConvert.DeserializeObject(Of SAPData)(oString)
|
||||||
|
|
||||||
|
Return oSAPData
|
||||||
|
End Function
|
||||||
|
End Class
|
||||||
@ -36,6 +36,20 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub New(LogConfig As LogConfig, IPAddress As String, PortNumber As Integer)
|
||||||
|
_logger = LogConfig.GetLogger()
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim oBinding = Channel.GetBinding()
|
||||||
|
Dim oAddress = New EndpointAddress($"net.tcp://{IPAddress}:{PortNumber}/DigitalData/Services/Main")
|
||||||
|
Dim oFactory = New ChannelFactory(Of IEDMIServiceChannel)(oBinding, oAddress)
|
||||||
|
|
||||||
|
_channelFactory = oFactory
|
||||||
|
Catch ex As Exception
|
||||||
|
_logger.Error(ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Connect to the service
|
''' Connect to the service
|
||||||
''' </summary>
|
''' </summary>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
Imports System.IO
|
Imports System.IO
|
||||||
|
Imports System.Text.RegularExpressions
|
||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
''' <module>File</module>
|
''' <module>File</module>
|
||||||
@ -24,13 +25,46 @@ Public Class File
|
|||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
Private ReadOnly _logConfig As LogConfig
|
Private ReadOnly _logConfig As LogConfig
|
||||||
|
|
||||||
|
Private ReadOnly _invalidFilenameChars As String
|
||||||
|
Private ReadOnly _invalidPathChars As String
|
||||||
|
|
||||||
|
Private Const REGEX_CLEAN_FILENAME As String = "[\\/:""<>|\b\0\r\n\t]"
|
||||||
|
Private Const REGEX_CLEAN_PATH As String = "[:""<>|\b\0\r\n\t]"
|
||||||
|
|
||||||
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
|
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
|
||||||
|
|
||||||
Public Sub New(LogConfig As LogConfig)
|
Public Sub New(LogConfig As LogConfig)
|
||||||
_logConfig = LogConfig
|
_logConfig = LogConfig
|
||||||
_logger = LogConfig.GetLogger()
|
_logger = LogConfig.GetLogger()
|
||||||
|
|
||||||
|
_invalidFilenameChars = String.Join("", Path.GetInvalidFileNameChars())
|
||||||
|
_invalidPathChars = String.Join("", Path.GetInvalidPathChars())
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Function GetCleanFilename(FileName As String) As String
|
||||||
|
_logger.Debug("Filename before cleaning: [{0}]", FileName)
|
||||||
|
|
||||||
|
Dim oCleanName As String = FileName
|
||||||
|
oCleanName = Regex.Replace(oCleanName, _invalidFilenameChars, String.Empty)
|
||||||
|
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_FILENAME, String.Empty, RegexOptions.Singleline)
|
||||||
|
|
||||||
|
_logger.Debug("Filename after cleaning: [{0}]", oCleanName)
|
||||||
|
|
||||||
|
Return oCleanName
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetCleanPath(FilePath As String) As String
|
||||||
|
_logger.Debug("Path before cleaning: [{0}]", FilePath)
|
||||||
|
|
||||||
|
Dim oCleanName As String = FilePath
|
||||||
|
oCleanName = Regex.Replace(oCleanName, _invalidPathChars, String.Empty)
|
||||||
|
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_PATH, String.Empty, RegexOptions.Singleline)
|
||||||
|
|
||||||
|
_logger.Debug("Path after cleaning: [{0}]", oCleanName)
|
||||||
|
|
||||||
|
Return oCleanName
|
||||||
|
End Function
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Adds fileversions to given filename `Destination` if that file already exists.
|
''' Adds fileversions to given filename `Destination` if that file already exists.
|
||||||
''' </summary>
|
''' </summary>
|
||||||
|
|||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("0.0.0.1")>
|
<Assembly: AssemblyVersion("1.0.1.1")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Public Class QueryData
|
Public Class QueryData
|
||||||
Public Query As String
|
Public query As String
|
||||||
Public OperationName As String
|
Public operationName As String
|
||||||
Public Variables As New Object
|
Public variables As New Object
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -13,9 +13,10 @@ Public Class GraphQLInterface
|
|||||||
Private _userPassword As String
|
Private _userPassword As String
|
||||||
Private _certificate As X509Certificate
|
Private _certificate As X509Certificate
|
||||||
Private _cookieJar As CookieContainer
|
Private _cookieJar As CookieContainer
|
||||||
|
|
||||||
Private _Encoding As New UTF8Encoding
|
Private _Encoding As New UTF8Encoding
|
||||||
|
|
||||||
|
Public Property Proxy As WebProxy
|
||||||
|
|
||||||
Public Sub New(LogConfig As LogConfig, BaseUrl As String, Email As String, Password As String, CertificateFile As String, CertificatePassword As String)
|
Public Sub New(LogConfig As LogConfig, BaseUrl As String, Email As String, Password As String, CertificateFile As String, CertificatePassword As String)
|
||||||
Try
|
Try
|
||||||
_logConfig = LogConfig
|
_logConfig = LogConfig
|
||||||
@ -71,11 +72,12 @@ Public Class GraphQLInterface
|
|||||||
Public Function GetData(Query As String, OperationName As String) As HttpWebResponse
|
Public Function GetData(Query As String, OperationName As String) As HttpWebResponse
|
||||||
Try
|
Try
|
||||||
Dim oQueryData As New QueryData() With {
|
Dim oQueryData As New QueryData() With {
|
||||||
.OperationName = OperationName,
|
.operationName = OperationName,
|
||||||
.Query = Query,
|
.query = Query,
|
||||||
.Variables = New Object
|
.variables = New Object
|
||||||
}
|
}
|
||||||
Dim oBytes = ToBytes(JsonConvert.SerializeObject(oQueryData))
|
Dim oJson = JsonConvert.SerializeObject(oQueryData)
|
||||||
|
Dim oBytes = ToBytes(oJson)
|
||||||
Dim oRequest = GetRequest("/graphql", oBytes)
|
Dim oRequest = GetRequest("/graphql", oBytes)
|
||||||
|
|
||||||
Using stream = oRequest.GetRequestStream()
|
Using stream = oRequest.GetRequestStream()
|
||||||
@ -91,6 +93,9 @@ Public Class GraphQLInterface
|
|||||||
|
|
||||||
Private Function GetRequest(Url As String, PostData As Byte()) As HttpWebRequest
|
Private Function GetRequest(Url As String, PostData As Byte()) As HttpWebRequest
|
||||||
Try
|
Try
|
||||||
|
ServicePointManager.Expect100Continue = True
|
||||||
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
|
||||||
|
|
||||||
Dim oRequest As HttpWebRequest = WebRequest.Create($"{_baseUrl}{Url}")
|
Dim oRequest As HttpWebRequest = WebRequest.Create($"{_baseUrl}{Url}")
|
||||||
oRequest.Method = "POST"
|
oRequest.Method = "POST"
|
||||||
oRequest.ContentType = "application/json"
|
oRequest.ContentType = "application/json"
|
||||||
@ -98,6 +103,10 @@ Public Class GraphQLInterface
|
|||||||
oRequest.ClientCertificates.Add(_certificate)
|
oRequest.ClientCertificates.Add(_certificate)
|
||||||
oRequest.CookieContainer = GetCookies()
|
oRequest.CookieContainer = GetCookies()
|
||||||
|
|
||||||
|
If Proxy IsNot Nothing Then
|
||||||
|
oRequest.Proxy = Proxy
|
||||||
|
End If
|
||||||
|
|
||||||
Return oRequest
|
Return oRequest
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Error(ex)
|
_logger.Error(ex)
|
||||||
@ -107,7 +116,7 @@ Public Class GraphQLInterface
|
|||||||
|
|
||||||
Private Function GetCookies() As CookieContainer
|
Private Function GetCookies() As CookieContainer
|
||||||
If _cookieJar Is Nothing Then
|
If _cookieJar Is Nothing Then
|
||||||
_cookieJar = New CookieContainer()
|
_cookieJar = New CookieContainer(300, 20, 8192)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return _cookieJar
|
Return _cookieJar
|
||||||
|
|||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.1.0.0")>
|
<Assembly: AssemblyVersion("1.1.0.1")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -117,7 +117,7 @@ Public Class PDFAttachments
|
|||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
Logger.Warn("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
|
Logger.Debug("File [{0}] was skipped because its extension [{1}] is not allowed.", oFileName, oExtension)
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
|
|||||||
@ -27,6 +27,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
Public HISTORY_ID As Integer
|
Public HISTORY_ID As Integer
|
||||||
|
|
||||||
' List of allowed extensions for PDF/A Attachments
|
' List of allowed extensions for PDF/A Attachments
|
||||||
|
' This list should not contain xml so the zugferd xml file will be filtered out
|
||||||
Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
|
Private ReadOnly AllowedExtensions As List(Of String) = New List(Of String) From {"docx", "doc", "pdf", "xls", "xlsx", "ppt", "pptx", "txt"}
|
||||||
|
|
||||||
Private ReadOnly _logger As Logger
|
Private ReadOnly _logger As Logger
|
||||||
@ -185,22 +186,23 @@ Public Class ImportZUGFeRDFiles
|
|||||||
Catch ex As ZUGFeRDExecption
|
Catch ex As ZUGFeRDExecption
|
||||||
Select Case ex.ErrorType
|
Select Case ex.ErrorType
|
||||||
Case ZUGFeRDInterface.ErrorType.NoZugferd
|
Case ZUGFeRDInterface.ErrorType.NoZugferd
|
||||||
_logger.Warn("File is not a valid ZUGFeRD document! Skipping.")
|
_logger.Warn("File [{0}] is not a valid ZUGFeRD document! Skipping.", oFile.Name)
|
||||||
oEmailAttachmentFiles.Add(oFile)
|
oEmailAttachmentFiles.Add(oFile)
|
||||||
Continue For
|
Continue For
|
||||||
|
|
||||||
Case ZUGFeRDInterface.ErrorType.NoValidZugferd
|
Case ZUGFeRDInterface.ErrorType.NoValidZugferd
|
||||||
_logger.Warn("File is an Incorrectly formatted ZUGFeRD document!")
|
_logger.Warn("File [{0}] is an Incorrectly formatted ZUGFeRD document!", oFile.Name)
|
||||||
Throw New InvalidFerdException()
|
Throw New InvalidFerdException()
|
||||||
|
|
||||||
Case Else
|
Case Else
|
||||||
_logger.Warn("Unexpected Error occurred while extracting ZUGFeRD Information from file {0}", oFile.FullName)
|
_logger.Warn("Unexpected Error occurred while extracting ZUGFeRD Information from file {0}", oFile.Name)
|
||||||
Throw ex
|
Throw ex
|
||||||
End Select
|
End Select
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
' Extract all attachments with the extensions specified in `AllowedExtensions`.
|
' Extract all attachments with the extensions specified in `AllowedExtensions`.
|
||||||
' If you need to extract and use embedded xml files, you need to filter out the zugferd-invoice.xml yourself.
|
' If you need to extract and use embedded xml files, you need to filter out the zugferd-invoice.xml yourself.
|
||||||
|
' Right now the zugferd-invoice.xml is filtered out because `AllowedExtensions` does not contain `xml`.
|
||||||
Dim oAttachments = oAttachmentExtractor.Extract(oFile.FullName, AllowedExtensions)
|
Dim oAttachments = oAttachmentExtractor.Extract(oFile.FullName, AllowedExtensions)
|
||||||
If oAttachments Is Nothing Then
|
If oAttachments Is Nothing Then
|
||||||
_logger.Warn("Attachments for file [{0}] could not be extracted", oFile.FullName)
|
_logger.Warn("Attachments for file [{0}] could not be extracted", oFile.FullName)
|
||||||
|
|||||||
@ -30,5 +30,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
' Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
|
||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.2.0.0")>
|
<Assembly: AssemblyVersion("1.2.0.1")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -66,14 +66,12 @@ Public Class LogConfig
|
|||||||
Private Const ARCHIVE_EVERY As FileArchivePeriod = FileArchivePeriod.Day
|
Private Const ARCHIVE_EVERY As FileArchivePeriod = FileArchivePeriod.Day
|
||||||
|
|
||||||
Private Const FILE_NAME_FORMAT_DEFAULT As String = "${shortdate}-${var:product}${var:suffix}.log"
|
Private Const FILE_NAME_FORMAT_DEFAULT As String = "${shortdate}-${var:product}${var:suffix}.log"
|
||||||
Private Const FILE_NAME_FORMAT_DETAIL As String = "${shortdate}-${var:product}${var:suffix}-Detail.log"
|
|
||||||
Private Const FILE_NAME_FORMAT_DEBUG As String = "${shortdate}-${var:product}${var:suffix}-Debug.log"
|
Private Const FILE_NAME_FORMAT_DEBUG As String = "${shortdate}-${var:product}${var:suffix}-Debug.log"
|
||||||
Private Const FILE_NAME_FORMAT_ERROR As String = "${shortdate}-${var:product}${var:suffix}-Error.log"
|
Private Const FILE_NAME_FORMAT_ERROR As String = "${shortdate}-${var:product}${var:suffix}-Error.log"
|
||||||
|
|
||||||
Private Const TARGET_DEFAULT As String = "defaultTarget"
|
Private Const TARGET_DEFAULT As String = "defaultTarget"
|
||||||
Private Const TARGET_ERROR_EX As String = "errorExceptionTarget"
|
Private Const TARGET_ERROR_EX As String = "errorExceptionTarget"
|
||||||
Private Const TARGET_ERROR As String = "errorTarget"
|
Private Const TARGET_ERROR As String = "errorTarget"
|
||||||
Private Const TARGET_DETAIL As String = "detailTarget"
|
|
||||||
Private Const TARGET_DEBUG As String = "debugTarget"
|
Private Const TARGET_DEBUG As String = "debugTarget"
|
||||||
Private Const TARGET_MEMORY As String = "memoryTarget"
|
Private Const TARGET_MEMORY As String = "memoryTarget"
|
||||||
|
|
||||||
@ -82,10 +80,11 @@ Public Class LogConfig
|
|||||||
|
|
||||||
Private Const LOG_FORMAT_BASE As String = DATE_FORMAT_DEFAULT & "|${logger:shortName=True}|${level:uppercase=true}"
|
Private Const LOG_FORMAT_BASE As String = DATE_FORMAT_DEFAULT & "|${logger:shortName=True}|${level:uppercase=true}"
|
||||||
Private Const LOG_FORMAT_BASE_LONG_DATE As String = DATE_FORMAT_LONG & "|${logger:shortName=True}|${level:uppercase=true}"
|
Private Const LOG_FORMAT_BASE_LONG_DATE As String = DATE_FORMAT_LONG & "|${logger:shortName=True}|${level:uppercase=true}"
|
||||||
|
Private Const LOG_FORMAT_CALLSITE As String = "${callsite:className=false:fileName=true:includeSourcePath=false:methodName=true}"
|
||||||
|
|
||||||
Private Const LOG_FORMAT_DEFAULT As String = LOG_FORMAT_BASE & " >> ${message}"
|
Private Const LOG_FORMAT_DEFAULT As String = LOG_FORMAT_BASE & " >> ${message}"
|
||||||
Private Const LOG_FORMAT_EXCEPTION As String = LOG_FORMAT_BASE & " >> ${exception:format=Message}${newline}${exception:format=StackTrace}"
|
Private Const LOG_FORMAT_EXCEPTION As String = LOG_FORMAT_BASE & " >> ${exception:format=Message}${newline}${exception:format=StackTrace}"
|
||||||
Private Const LOG_FORMAT_DEBUG As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}"
|
Private Const LOG_FORMAT_DEBUG As String = LOG_FORMAT_BASE_LONG_DATE & " >> " & LOG_FORMAT_CALLSITE & " -> ${message}"
|
||||||
Private Const LOG_FORMAT_MEMORY As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}${newline}${exception:format=Message}${newline}${exception:format=StackTrace}"
|
Private Const LOG_FORMAT_MEMORY As String = LOG_FORMAT_BASE_LONG_DATE & " >> ${message}${newline}${exception:format=Message}${newline}${exception:format=StackTrace}"
|
||||||
|
|
||||||
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
|
Private Const FILE_NAME_ACCESS_TEST = "accessTest.txt"
|
||||||
@ -421,23 +420,11 @@ Public Class LogConfig
|
|||||||
Return errorLog
|
Return errorLog
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function GetDetailLogTarget(basePath As String) As FileTarget
|
|
||||||
Dim detailLog As New FileTarget() With {
|
|
||||||
.FileName = Path.Combine(basePath, FILE_NAME_FORMAT_DETAIL),
|
|
||||||
.Name = TARGET_DETAIL,
|
|
||||||
.Layout = LOG_FORMAT_DEFAULT,
|
|
||||||
.MaxArchiveFiles = MAX_ARCHIVE_FILES_DEBUG_DETAIL,
|
|
||||||
.ArchiveEvery = ARCHIVE_EVERY,
|
|
||||||
.KeepFileOpen = KEEP_FILES_OPEN
|
|
||||||
}
|
|
||||||
|
|
||||||
Return detailLog
|
|
||||||
End Function
|
|
||||||
Private Function GetDebugLogTarget(basePath As String) As FileTarget
|
Private Function GetDebugLogTarget(basePath As String) As FileTarget
|
||||||
Dim debugLog As New FileTarget() With {
|
Dim debugLog As New FileTarget() With {
|
||||||
.FileName = Path.Combine(basePath, FILE_NAME_FORMAT_DEBUG),
|
.FileName = Path.Combine(basePath, FILE_NAME_FORMAT_DEBUG),
|
||||||
.Name = TARGET_DEBUG,
|
.Name = TARGET_DEBUG,
|
||||||
.Layout = LOG_FORMAT_DEFAULT,
|
.Layout = LOG_FORMAT_DEBUG,
|
||||||
.MaxArchiveFiles = MAX_ARCHIVE_FILES_DEBUG_DETAIL,
|
.MaxArchiveFiles = MAX_ARCHIVE_FILES_DEBUG_DETAIL,
|
||||||
.ArchiveEvery = ARCHIVE_EVERY,
|
.ArchiveEvery = ARCHIVE_EVERY,
|
||||||
.KeepFileOpen = KEEP_FILES_OPEN
|
.KeepFileOpen = KEEP_FILES_OPEN
|
||||||
|
|||||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.0.0.1")>
|
<Assembly: AssemblyVersion("2.0.1.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||||
|
|||||||
@ -766,15 +766,15 @@ Public Class Windream
|
|||||||
'If UsesDriveLetter Then
|
'If UsesDriveLetter Then
|
||||||
' Remove Driveletter eg. W:\
|
' Remove Driveletter eg. W:\
|
||||||
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
|
If oNormalizedPath.StartsWith($"{ClientDriveLetter}:\") Then
|
||||||
_logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]")
|
_logger.Debug($"Replacing ClientDriveLetter: [{ClientDriveLetter}]")
|
||||||
oNormalizedPath = oNormalizedPath.Substring(ClientDriveLetter.Length + 2)
|
oNormalizedPath = oNormalizedPath.Substring(ClientDriveLetter.Length + 2)
|
||||||
End If
|
End If
|
||||||
'Else
|
'Else
|
||||||
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
|
If oNormalizedPath.ToLower.StartsWith(ClientBasePath.ToLower) Then
|
||||||
_logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]")
|
_logger.Debug($"Replacing ClientBasePath: [{ClientBasePath}]")
|
||||||
' Remove Windream Base Path eg. \\windream\objects\
|
' Remove Windream Base Path eg. \\windream\objects\
|
||||||
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length - 1)
|
oNormalizedPath = oNormalizedPath.Substring(ClientBasePath.Length - 1)
|
||||||
End If
|
End If
|
||||||
'End If
|
'End If
|
||||||
|
|
||||||
oNormalizedPath = oNormalizedPath.Replace("\\", "\")
|
oNormalizedPath = oNormalizedPath.Replace("\\", "\")
|
||||||
@ -1470,6 +1470,7 @@ Public Class Windream
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If TestObjectExists(ObjectName, ObjectType) = False Then
|
If TestObjectExists(ObjectName, ObjectType) = False Then
|
||||||
|
_logger.Warn("GetObjectByName: Object {0} does not exist!", ObjectName)
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -1488,6 +1489,7 @@ Public Class Windream
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If TestObjectExists(ObjectName, ObjectType) = False Then
|
If TestObjectExists(ObjectName, ObjectType) = False Then
|
||||||
|
_logger.Warn("GetObjectByPath: Object {0} does not exist!", ObjectName)
|
||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
Public Interface IDatabase
|
|
||||||
Function NewDocument(RelativePath As String, AddedWho As String, ObjectStoreId As Int64, ReferenceId As Int64) As Int64
|
|
||||||
End Interface
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
Imports DigitalData.Modules.Database
|
|
||||||
Imports DigitalData.Modules.Logging
|
|
||||||
|
|
||||||
Public Class MSSQL
|
|
||||||
Implements IDatabase
|
|
||||||
|
|
||||||
Private ReadOnly LogConfig As LogConfig
|
|
||||||
Private ReadOnly Database As MSSQLServer
|
|
||||||
Private ReadOnly Logger As Logger
|
|
||||||
|
|
||||||
Public Sub New(LogConfig As LogConfig, Database As MSSQLServer)
|
|
||||||
Me.LogConfig = LogConfig
|
|
||||||
Me.Database = Database
|
|
||||||
Me.Logger = LogConfig.GetLogger()
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Function NewDocument(RelativePath As String, AddedWho As String, ObjectStoreId As Long, ReferenceId As Long) As Long Implements IDatabase.NewDocument
|
|
||||||
|
|
||||||
End Function
|
|
||||||
End Class
|
|
||||||
@ -47,7 +47,7 @@ Public Class EDMIService
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#Region "Auth"
|
#Region "=== Authorization ==="
|
||||||
Private Function TestUserAuth() As Boolean
|
Private Function TestUserAuth() As Boolean
|
||||||
Try
|
Try
|
||||||
'Dim oSQL As String = $"SELECT FNIDB_AUTH_USER('{_username}') FROM RDB$DATABASE;"
|
'Dim oSQL As String = $"SELECT FNIDB_AUTH_USER('{_username}') FROM RDB$DATABASE;"
|
||||||
@ -60,12 +60,12 @@ Public Class EDMIService
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Heartbeat"
|
#Region "=== Heartbeat ==="
|
||||||
Public Function Heartbeat() As Boolean Implements IEDMIService.Heartbeat
|
Public Function Heartbeat() As Boolean Implements IEDMIService.Heartbeat
|
||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Request"
|
#Region "=== Database Request ==="
|
||||||
Public Sub CreateRequest(Name As String, Optional Debug As Boolean = False)
|
Public Sub CreateRequest(Name As String, Optional Debug As Boolean = False)
|
||||||
_request = New Request(Name, _username, Firebird, Debug)
|
_request = New Request(Name, _username, Firebird, Debug)
|
||||||
_debug = Debug
|
_debug = Debug
|
||||||
@ -90,7 +90,7 @@ Public Class EDMIService
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Database"
|
#Region "=== Database (Firebird) ==="
|
||||||
Private Sub TestRequestCreated()
|
Private Sub TestRequestCreated()
|
||||||
If IsNothing(_request) Then
|
If IsNothing(_request) Then
|
||||||
Throw New Exceptions.NoRequestException()
|
Throw New Exceptions.NoRequestException()
|
||||||
@ -144,174 +144,8 @@ Public Class EDMIService
|
|||||||
Return New NonQueryResult(ex.Message)
|
Return New NonQueryResult(ex.Message)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
#End Region
|
#End Region
|
||||||
#Region "Document (with FileContainer)"
|
#Region "=== Document ==="
|
||||||
Public Function NewFile(FileName As String, Contents() As Byte) As DocumentResultOld Implements IEDMIService.NewFile
|
|
||||||
Try
|
|
||||||
Dim oContainer As FileContainer
|
|
||||||
Dim oContainerId As String
|
|
||||||
|
|
||||||
If Not TestUserAuth() Then
|
|
||||||
Throw New Exception($"User {_username} not authorized.")
|
|
||||||
End If
|
|
||||||
|
|
||||||
oContainer = FileContainer.Create(LogConfig, AppConfig.ContainerPassword)
|
|
||||||
oContainerId = oContainer.ContainerId
|
|
||||||
_logger.Debug("Container created with id {0}", oContainerId)
|
|
||||||
|
|
||||||
Dim oExtension As String = Path.GetExtension(FileName).Substring(1)
|
|
||||||
_logger.Debug("File extension of file {0} is {1}", FileName, oExtension)
|
|
||||||
|
|
||||||
Dim oSQL = $"SELECT FNICM_NEW_DOC('010', '{oContainerId}', '{GetContainerName(oContainerId)}', '{FileName}', '{oExtension}', '{_username}') FROM RDB$DATABASE;"
|
|
||||||
Dim oDocId As Int64 = Firebird.GetScalarValue(oSQL)
|
|
||||||
|
|
||||||
If oDocId = -1 Then
|
|
||||||
_logger.Warn("Database returned -1 while creating Document Entry. File was not saved!")
|
|
||||||
Return Nothing
|
|
||||||
End If
|
|
||||||
|
|
||||||
_logger.Debug("Database Entry created with DocId {0}", oDocId)
|
|
||||||
|
|
||||||
oContainer.SetFile(Contents, FileName)
|
|
||||||
oContainer.SaveAs(GetContainerPath(oContainerId))
|
|
||||||
|
|
||||||
_logger.Debug("File saved in Container!", FileName)
|
|
||||||
|
|
||||||
Dim oDocument = New DocumentObject(oContainerId, oDocId, FileName)
|
|
||||||
Return New DocumentResultOld(oDocument)
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
Return New DocumentResultOld(ex.Message)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function UpdateFile(DocObject As DocumentObject, Contents() As Byte) As DocumentResultOld Implements IEDMIService.UpdateFile
|
|
||||||
Try
|
|
||||||
TestFileExists(DocObject.ContainerId)
|
|
||||||
|
|
||||||
' TODO: update db
|
|
||||||
|
|
||||||
Dim oFilePath = GetContainerPath(DocObject.ContainerId)
|
|
||||||
Dim oFileContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oFilePath)
|
|
||||||
|
|
||||||
oFileContainer.SetFile(Contents, oFileContainer.GetFile.FileName)
|
|
||||||
oFileContainer.Save()
|
|
||||||
|
|
||||||
|
|
||||||
Return New DocumentResultOld(DocObject)
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetFile(DocObject As DocumentObject) As DocumentResultOld Implements IEDMIService.GetFile
|
|
||||||
Try
|
|
||||||
TestFileExists(DocObject.ContainerId)
|
|
||||||
|
|
||||||
Dim oContainerPath = GetContainerPath(DocObject.ContainerId)
|
|
||||||
Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
|
|
||||||
Dim oContents As Byte() = oContainer.GetFile().Contents
|
|
||||||
|
|
||||||
Return New DocumentResultOld(DocObject, oContents)
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
Return New DocumentResultOld(ex.Message)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function DeleteFile(DocObject As DocumentObject) As Boolean Implements IEDMIService.DeleteFile
|
|
||||||
Try
|
|
||||||
TestFileExists(DocObject.ContainerId)
|
|
||||||
|
|
||||||
Dim oFilePath = GetContainerPath(DocObject.ContainerId)
|
|
||||||
IO.File.Delete(oFilePath)
|
|
||||||
|
|
||||||
'TODO: Delete doc from db
|
|
||||||
|
|
||||||
Return True
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetContainerPath(ContainerId As String) As String
|
|
||||||
Return Path.Combine(AppConfig.ContainerPath, GetContainerName(ContainerId))
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Function GetContainerName(ContainerId As String) As String
|
|
||||||
Return ContainerId & ".enc"
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Private Sub TestFileExists(ContainerId)
|
|
||||||
Dim oContainerPath = GetContainerPath(ContainerId)
|
|
||||||
|
|
||||||
If Not IO.File.Exists(oContainerPath) Then
|
|
||||||
Throw New FileNotFoundException("Container existiert nicht", oContainerPath)
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Function GetDocumentByDocumentId(DocumentId As Long) As DocumentResultOld Implements IEDMIService.GetDocumentByDocumentId
|
|
||||||
Try
|
|
||||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE GUID = {DocumentId}"
|
|
||||||
Dim oTable = Firebird.GetDatatable(oSQL)
|
|
||||||
|
|
||||||
If oTable.Rows.Count = 0 Then
|
|
||||||
Return New DocumentResultOld("Document not found")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
|
||||||
Dim oDocument As New DocumentObject(
|
|
||||||
oRow.Item("CONTAINER_ID"),
|
|
||||||
oRow.Item("GUID"),
|
|
||||||
oRow.Item("ORIGINAL_FILENAME")
|
|
||||||
)
|
|
||||||
|
|
||||||
TestFileExists(oDocument.ContainerId)
|
|
||||||
|
|
||||||
Dim oContainerPath = GetContainerPath(oDocument.ContainerId)
|
|
||||||
Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
|
|
||||||
Dim oContents As Byte() = oContainer.GetFile().Contents
|
|
||||||
|
|
||||||
Return New DocumentResultOld(oDocument, oContents)
|
|
||||||
Catch ex As Exception
|
|
||||||
Return New DocumentResultOld(ex.Message)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Public Function GetDocumentByContainerId(ContainerId As String) As DocumentResultOld Implements IEDMIService.GetDocumentByContainerId
|
|
||||||
Try
|
|
||||||
Dim oSQL = $"SELECT GUID, CONTAINER_ID, ORIGINAL_FILENAME FROM TBIDB_DOCUMENT WHERE CONTAINER_ID = '{ContainerId}'"
|
|
||||||
Dim oTable = Firebird.GetDatatable(oSQL)
|
|
||||||
|
|
||||||
If oTable.Rows.Count = 0 Then
|
|
||||||
Return New DocumentResultOld("Document not found")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim oRow As DataRow = oTable.Rows.Item(0)
|
|
||||||
Dim oDocument As New DocumentObject(
|
|
||||||
oRow.Item("CONTAINER_ID"),
|
|
||||||
oRow.Item("GUID"),
|
|
||||||
oRow.Item("ORIGINAL_FILENAME")
|
|
||||||
)
|
|
||||||
|
|
||||||
TestFileExists(oDocument.ContainerId)
|
|
||||||
|
|
||||||
Dim oContainerPath = GetContainerPath(oDocument.ContainerId)
|
|
||||||
Dim oContainer As FileContainer = FileContainer.Load(LogConfig, AppConfig.ContainerPassword, oContainerPath)
|
|
||||||
Dim oContents As Byte() = oContainer.GetFile().Contents
|
|
||||||
|
|
||||||
Return New DocumentResultOld(oDocument, oContents)
|
|
||||||
Catch ex As Exception
|
|
||||||
Return New DocumentResultOld(ex.Message)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Document"
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Imports a file according to ObjectStoreId
|
''' Imports a file according to ObjectStoreId
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@ -405,8 +239,8 @@ Public Class EDMIService
|
|||||||
Using oSource As FileStream = IO.File.OpenRead(oFullPath)
|
Using oSource As FileStream = IO.File.OpenRead(oFullPath)
|
||||||
oSource.CopyTo(oDestination)
|
oSource.CopyTo(oDestination)
|
||||||
End Using
|
End Using
|
||||||
|
|
||||||
oDestination.Seek(0, SeekOrigin.Begin)
|
oDestination.Seek(0, SeekOrigin.Begin)
|
||||||
|
|
||||||
Dim oMessage As New Messages.DocumentStreamResponse() With {
|
Dim oMessage As New Messages.DocumentStreamResponse() With {
|
||||||
.FileName = oFileInfo.Name,
|
.FileName = oFileInfo.Name,
|
||||||
.FileContents = oDestination
|
.FileContents = oDestination
|
||||||
@ -436,20 +270,5 @@ Public Class EDMIService
|
|||||||
Throw New FaultException(ex.Message)
|
Throw New FaultException(ex.Message)
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Index"
|
|
||||||
Public Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult Implements IEDMIService.NewFileIndex
|
|
||||||
Try
|
|
||||||
Dim oSQL = $"SELECT FNIDB_NEW_DOC_VALUE({DocObject.DocumentId},'{Syskey}','{LanguageCode}','{Value}','{_username}') FROM RDB$DATABASE;"
|
|
||||||
Dim oIndexId As Int64 = Firebird.GetScalarValue(oSQL)
|
|
||||||
|
|
||||||
Return New IndexResult(oIndexId)
|
|
||||||
Catch ex As Exception
|
|
||||||
_logger.Error(ex)
|
|
||||||
Return New IndexResult(ex.Message)
|
|
||||||
End Try
|
|
||||||
End Function
|
|
||||||
#End Region
|
#End Region
|
||||||
End Class
|
End Class
|
||||||
@ -102,18 +102,12 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="AppConfig.vb" />
|
<Compile Include="AppConfig.vb" />
|
||||||
<Compile Include="Database\IDatabase.vb" />
|
|
||||||
<Compile Include="Database\MSSQL.vb" />
|
|
||||||
<Compile Include="GlobalState.vb" />
|
<Compile Include="GlobalState.vb" />
|
||||||
<Compile Include="Messages.vb" />
|
<Compile Include="Messages.vb" />
|
||||||
<Compile Include="Results\BaseResult.vb" />
|
<Compile Include="Results\BaseResult.vb" />
|
||||||
<Compile Include="Results\ContainerResult.vb" />
|
|
||||||
<Compile Include="Results\DocumentResultOld.vb" />
|
|
||||||
<Compile Include="Exceptions.vb" />
|
<Compile Include="Exceptions.vb" />
|
||||||
<Compile Include="Results\DatabaseResult.vb" />
|
<Compile Include="Results\DatabaseResult.vb" />
|
||||||
<Compile Include="EDMIService.vb" />
|
<Compile Include="EDMIService.vb" />
|
||||||
<Compile Include="Results\DocumentResult.vb" />
|
|
||||||
<Compile Include="Results\IndexResult.vb" />
|
|
||||||
<Compile Include="WindowsService.vb">
|
<Compile Include="WindowsService.vb">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
Public Class Exceptions
|
Imports System.ServiceModel
|
||||||
|
|
||||||
|
Public Class Exceptions
|
||||||
|
|
||||||
|
Public Class BaseException
|
||||||
|
Inherits FaultException
|
||||||
|
End Class
|
||||||
|
|
||||||
Public Class NoRequestException
|
Public Class NoRequestException
|
||||||
Inherits ApplicationException
|
Inherits BaseException
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -27,26 +27,6 @@ Interface IEDMIService
|
|||||||
Function ExecuteNonQuery(SQL As String) As NonQueryResult
|
Function ExecuteNonQuery(SQL As String) As NonQueryResult
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Document (with FileContainer)"
|
|
||||||
<OperationContract>
|
|
||||||
Function NewFile(FileName As String, Contents As Byte()) As DocumentResultOld
|
|
||||||
|
|
||||||
<OperationContract>
|
|
||||||
Function UpdateFile(DocObject As DocumentObject, Contents As Byte()) As DocumentResultOld
|
|
||||||
|
|
||||||
<OperationContract>
|
|
||||||
Function GetFile(DocObject As DocumentObject) As DocumentResultOld
|
|
||||||
|
|
||||||
<OperationContract>
|
|
||||||
Function DeleteFile(DocObject As DocumentObject) As Boolean
|
|
||||||
|
|
||||||
<OperationContract>
|
|
||||||
Function GetDocumentByDocumentId(DocumentId As Int64) As DocumentResultOld
|
|
||||||
|
|
||||||
<OperationContract>
|
|
||||||
Function GetDocumentByContainerId(ContainerId As String) As DocumentResultOld
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
#Region "Document (New)"
|
#Region "Document (New)"
|
||||||
<OperationContract>
|
<OperationContract>
|
||||||
Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse
|
Function ImportFile(Data As Messages.DocumentImportRequest) As Messages.DocumentImportResponse
|
||||||
@ -59,9 +39,4 @@ Interface IEDMIService
|
|||||||
Function ListFilesForUser() As Messages.DocumentListResponse
|
Function ListFilesForUser() As Messages.DocumentListResponse
|
||||||
#End Region
|
#End Region
|
||||||
|
|
||||||
#Region "Index"
|
|
||||||
<OperationContract>
|
|
||||||
Function NewFileIndex(DocObject As DocumentObject, Syskey As String, LanguageCode As String, Value As String) As IndexResult
|
|
||||||
#End Region
|
|
||||||
|
|
||||||
End Interface
|
End Interface
|
||||||
@ -1,18 +0,0 @@
|
|||||||
Imports DigitalData.Modules.Filesystem
|
|
||||||
|
|
||||||
<Serializable>
|
|
||||||
Public Class ContainerResult
|
|
||||||
Public ReadOnly OK As Boolean
|
|
||||||
Public ReadOnly ErrorMessage As String
|
|
||||||
Public Container As FileContainerInner
|
|
||||||
|
|
||||||
Public Sub New()
|
|
||||||
OK = True
|
|
||||||
ErrorMessage = Nothing
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(ErrorMessage As String)
|
|
||||||
OK = False
|
|
||||||
Me.ErrorMessage = ErrorMessage
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
@ -1,31 +0,0 @@
|
|||||||
Imports System.Xml.Serialization
|
|
||||||
|
|
||||||
<Serializable>
|
|
||||||
Public Class DocumentResult
|
|
||||||
Inherits BaseResult
|
|
||||||
|
|
||||||
Public Document As DocumentObject
|
|
||||||
Public HasContents As Boolean = False
|
|
||||||
Public Contents As Byte()
|
|
||||||
|
|
||||||
Public Sub New(Document As DocumentObject)
|
|
||||||
MyBase.New()
|
|
||||||
Me.Document = Document
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(Document As DocumentObject, Contents As Byte())
|
|
||||||
MyBase.New()
|
|
||||||
Me.Document = Document
|
|
||||||
Me.Contents = Contents
|
|
||||||
Me.HasContents = True
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(ErrorMessage As String)
|
|
||||||
MyBase.New(ErrorMessage)
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Class DocumentObject
|
|
||||||
Public FileName As String
|
|
||||||
Public FileId As String
|
|
||||||
End Class
|
|
||||||
End Class
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
Imports DigitalData.Modules.Filesystem
|
|
||||||
|
|
||||||
<Serializable>
|
|
||||||
Public Class DocumentResultOld
|
|
||||||
Inherits BaseResult
|
|
||||||
|
|
||||||
Public Document As DocumentObject
|
|
||||||
Public HasContents As Boolean = False
|
|
||||||
Public Contents As Byte()
|
|
||||||
|
|
||||||
Public Sub New(Document As DocumentObject)
|
|
||||||
MyBase.New()
|
|
||||||
Me.Document = Document
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(Document As DocumentObject, Contents As Byte())
|
|
||||||
MyBase.New()
|
|
||||||
Me.Document = Document
|
|
||||||
Me.Contents = Contents
|
|
||||||
Me.HasContents = True
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(ErrorMessage As String)
|
|
||||||
MyBase.New(ErrorMessage)
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<Serializable>
|
|
||||||
Public Class IndexResult
|
|
||||||
Inherits BaseResult
|
|
||||||
|
|
||||||
Public ReadOnly IndexId As Int64
|
|
||||||
|
|
||||||
Public Sub New(IndexId As Int64)
|
|
||||||
MyBase.New()
|
|
||||||
Me.IndexId = IndexId
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Public Sub New(ErrorMessage As String)
|
|
||||||
MyBase.New(ErrorMessage)
|
|
||||||
End Sub
|
|
||||||
End Class
|
|
||||||
Loading…
x
Reference in New Issue
Block a user