From faa86ed0be3aac122acd8effa6d2f12b9e30b9df Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Tue, 5 Nov 2019 12:16:45 +0100 Subject: [PATCH] tweaking, graphql job, add graphql test gui --- DDMonorepo.sln | 7 + GUIs.Test.ADSyncTest/ADSyncTest.vbproj | 4 +- GUIs.Test.ADSyncTest/packages.config | 2 +- GUIs.Test.GraphQLTest/App.config | 6 + GUIs.Test.GraphQLTest/Form1.Designer.vb | 194 ++++++++++++++++++ GUIs.Test.GraphQLTest/Form1.resx | 120 +++++++++++ GUIs.Test.GraphQLTest/Form1.vb | 42 ++++ .../GUIs.Test.GraphQLTest.vbproj | 145 +++++++++++++ .../My Project/Application.Designer.vb | 38 ++++ .../My Project/Application.myapp | 11 + .../My Project/AssemblyInfo.vb | 35 ++++ .../My Project/Resources.Designer.vb | 62 ++++++ .../My Project/Resources.resx | 117 +++++++++++ .../My Project/Settings.Designer.vb | 73 +++++++ .../My Project/Settings.settings | 7 + GUIs.Test.GraphQLTest/packages.config | 5 + Modules.Jobs/EDMI/GraphQL/GraphQLArgs.vb | 9 + Modules.Jobs/EDMI/GraphQL/GraphQLJob.vb | 68 ++++++ Modules.Jobs/Jobs.vbproj | 2 + Service.JobRunner/App.config | 3 + Service.JobRunner/JobRunner.vb | 3 - Service.JobRunner/JobRunner.vbproj | 1 + Service.JobRunner/Jobs/GraphQLJob.vb | 25 +++ .../My Project/Settings.Designer.vb | 11 + .../My Project/Settings.settings | 3 + 25 files changed, 987 insertions(+), 6 deletions(-) create mode 100644 GUIs.Test.GraphQLTest/App.config create mode 100644 GUIs.Test.GraphQLTest/Form1.Designer.vb create mode 100644 GUIs.Test.GraphQLTest/Form1.resx create mode 100644 GUIs.Test.GraphQLTest/Form1.vb create mode 100644 GUIs.Test.GraphQLTest/GUIs.Test.GraphQLTest.vbproj create mode 100644 GUIs.Test.GraphQLTest/My Project/Application.Designer.vb create mode 100644 GUIs.Test.GraphQLTest/My Project/Application.myapp create mode 100644 GUIs.Test.GraphQLTest/My Project/AssemblyInfo.vb create mode 100644 GUIs.Test.GraphQLTest/My Project/Resources.Designer.vb create mode 100644 GUIs.Test.GraphQLTest/My Project/Resources.resx create mode 100644 GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb create mode 100644 GUIs.Test.GraphQLTest/My Project/Settings.settings create mode 100644 GUIs.Test.GraphQLTest/packages.config create mode 100644 Modules.Jobs/EDMI/GraphQL/GraphQLArgs.vb create mode 100644 Modules.Jobs/EDMI/GraphQL/GraphQLJob.vb create mode 100644 Service.JobRunner/Jobs/GraphQLJob.vb diff --git a/DDMonorepo.sln b/DDMonorepo.sln index 69805582..77d69a47 100644 --- a/DDMonorepo.sln +++ b/DDMonorepo.sln @@ -98,6 +98,8 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Jobs", "Modules.Jobs\Jobs.v EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "Filesystem.Test", "Modules\Filesystem.Test\Filesystem.Test.vbproj", "{B29ED6D4-839B-413A-A485-B10F4A4788EA}" EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GUIs.Test.GraphQLTest", "GUIs.Test.GraphQLTest\GUIs.Test.GraphQLTest.vbproj", "{609B09B4-AD1E-40F7-8899-A6685924621C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -252,6 +254,10 @@ Global {B29ED6D4-839B-413A-A485-B10F4A4788EA}.Debug|Any CPU.Build.0 = Debug|Any CPU {B29ED6D4-839B-413A-A485-B10F4A4788EA}.Release|Any CPU.ActiveCfg = Release|Any CPU {B29ED6D4-839B-413A-A485-B10F4A4788EA}.Release|Any CPU.Build.0 = Release|Any CPU + {609B09B4-AD1E-40F7-8899-A6685924621C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {609B09B4-AD1E-40F7-8899-A6685924621C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {609B09B4-AD1E-40F7-8899-A6685924621C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {609B09B4-AD1E-40F7-8899-A6685924621C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -294,6 +300,7 @@ Global {5B1171DC-FFFE-4813-A20D-786AAE47B320} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {39EC839A-3C30-4922-A41E-6B09D1DDE5C3} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} {B29ED6D4-839B-413A-A485-B10F4A4788EA} = {3E2008C8-27B1-41DD-9B1A-0C4029F6AECC} + {609B09B4-AD1E-40F7-8899-A6685924621C} = {CC368D6A-6AC4-4EB9-A092-14700FABEF7A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C1BE4090-A0FD-48AF-86CB-39099D14B286} diff --git a/GUIs.Test.ADSyncTest/ADSyncTest.vbproj b/GUIs.Test.ADSyncTest/ADSyncTest.vbproj index 565f109d..1f4366ce 100644 --- a/GUIs.Test.ADSyncTest/ADSyncTest.vbproj +++ b/GUIs.Test.ADSyncTest/ADSyncTest.vbproj @@ -49,7 +49,7 @@ - ..\packages\NLog.4.5.11\lib\net45\NLog.dll + ..\packages\NLog.4.6.7\lib\net45\NLog.dll @@ -130,7 +130,7 @@ - + {39ec839a-3c30-4922-a41e-6b09d1dde5c3} Jobs diff --git a/GUIs.Test.ADSyncTest/packages.config b/GUIs.Test.ADSyncTest/packages.config index f89fa324..99e34262 100644 --- a/GUIs.Test.ADSyncTest/packages.config +++ b/GUIs.Test.ADSyncTest/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/GUIs.Test.GraphQLTest/App.config b/GUIs.Test.GraphQLTest/App.config new file mode 100644 index 00000000..5534e287 --- /dev/null +++ b/GUIs.Test.GraphQLTest/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/GUIs.Test.GraphQLTest/Form1.Designer.vb b/GUIs.Test.GraphQLTest/Form1.Designer.vb new file mode 100644 index 00000000..655d5804 --- /dev/null +++ b/GUIs.Test.GraphQLTest/Form1.Designer.vb @@ -0,0 +1,194 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen. + _ + 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. + _ + 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.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 = "query Nls{" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & "niederlassungen {" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "niederlassungen {" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "mdnr" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "bezeichnung" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & + "sparte {" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "id" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "name" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "__typename" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "}" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "__typename" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "}" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & Global.Microsoft.VisualBasic.ChrW(9) & "__typena" & + "me" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & Global.Microsoft.VisualBasic.ChrW(9) & "}" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "}" + ' + '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 diff --git a/GUIs.Test.GraphQLTest/Form1.resx b/GUIs.Test.GraphQLTest/Form1.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/GUIs.Test.GraphQLTest/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUIs.Test.GraphQLTest/Form1.vb b/GUIs.Test.GraphQLTest/Form1.vb new file mode 100644 index 00000000..6fbbf85e --- /dev/null +++ b/GUIs.Test.GraphQLTest/Form1.vb @@ -0,0 +1,42 @@ +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) + txtResults.Text = oResult + + Dim oLogoutResponse = _Interface.Logout() + Catch ex As Exception + MsgBox(ex.Message, MsgBoxStyle.Critical) + End Try + End Sub +End Class diff --git a/GUIs.Test.GraphQLTest/GUIs.Test.GraphQLTest.vbproj b/GUIs.Test.GraphQLTest/GUIs.Test.GraphQLTest.vbproj new file mode 100644 index 00000000..e33a4524 --- /dev/null +++ b/GUIs.Test.GraphQLTest/GUIs.Test.GraphQLTest.vbproj @@ -0,0 +1,145 @@ + + + + + Debug + AnyCPU + {609B09B4-AD1E-40F7-8899-A6685924621C} + WinExe + GUIs.Test.GraphQLTest.My.MyApplication + GUIs.Test.GraphQLTest + GUIs.Test.GraphQLTest + 512 + WindowsForms + v4.6.1 + true + + + AnyCPU + true + full + true + true + bin\Debug\ + GUIs.Test.GraphQLTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + GUIs.Test.GraphQLTest.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + ..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll + + + ..\packages\NLog.4.6.7\lib\net45\NLog.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + {AB6F09BF-E794-4F6A-94BB-C97C0BA84D64} + Interfaces + + + {903B2D7D-3B80-4BE9-8713-7447B704E1B0} + Logging + + + + \ No newline at end of file diff --git a/GUIs.Test.GraphQLTest/My Project/Application.Designer.vb b/GUIs.Test.GraphQLTest/My Project/Application.Designer.vb new file mode 100644 index 00000000..bfc32831 --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.GUIs.Test.GraphQLTest.Form1 + End Sub + End Class +End Namespace diff --git a/GUIs.Test.GraphQLTest/My Project/Application.myapp b/GUIs.Test.GraphQLTest/My Project/Application.myapp new file mode 100644 index 00000000..1243847f --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/GUIs.Test.GraphQLTest/My Project/AssemblyInfo.vb b/GUIs.Test.GraphQLTest/My Project/AssemblyInfo.vb new file mode 100644 index 00000000..063fe4ad --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' Allgemeine Informationen über eine Assembly werden über die folgenden +' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +' die einer Assembly zugeordnet sind. + +' Werte der Assemblyattribute überprüfen + + + + + + + + + + +'Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird. + + +' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +' +' Hauptversion +' Nebenversion +' Buildnummer +' Revision +' +' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +' übernehmen, indem Sie "*" eingeben: +' + + + diff --git a/GUIs.Test.GraphQLTest/My Project/Resources.Designer.vb b/GUIs.Test.GraphQLTest/My Project/Resources.Designer.vb new file mode 100644 index 00000000..4a261b6e --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("GUIs.Test.GraphQLTest.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/GUIs.Test.GraphQLTest/My Project/Resources.resx b/GUIs.Test.GraphQLTest/My Project/Resources.resx new file mode 100644 index 00000000..af7dbebb --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb b/GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb new file mode 100644 index 00000000..d6fe46e5 --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.GUIs.Test.GraphQLTest.My.MySettings + Get + Return Global.GUIs.Test.GraphQLTest.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/GUIs.Test.GraphQLTest/My Project/Settings.settings b/GUIs.Test.GraphQLTest/My Project/Settings.settings new file mode 100644 index 00000000..85b890b3 --- /dev/null +++ b/GUIs.Test.GraphQLTest/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/GUIs.Test.GraphQLTest/packages.config b/GUIs.Test.GraphQLTest/packages.config new file mode 100644 index 00000000..b96ef76e --- /dev/null +++ b/GUIs.Test.GraphQLTest/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/Modules.Jobs/EDMI/GraphQL/GraphQLArgs.vb b/Modules.Jobs/EDMI/GraphQL/GraphQLArgs.vb new file mode 100644 index 00000000..36ed04f1 --- /dev/null +++ b/Modules.Jobs/EDMI/GraphQL/GraphQLArgs.vb @@ -0,0 +1,9 @@ +Public Class GraphQLArgs + Inherits JobArgs + + Public CertificateFile As String + Public CertificatePassword As String + Public Email As String + Public Password As String + Public BaseUrl As String +End Class diff --git a/Modules.Jobs/EDMI/GraphQL/GraphQLJob.vb b/Modules.Jobs/EDMI/GraphQL/GraphQLJob.vb new file mode 100644 index 00000000..1c79ba30 --- /dev/null +++ b/Modules.Jobs/EDMI/GraphQL/GraphQLJob.vb @@ -0,0 +1,68 @@ +Imports System.IO +Imports DigitalData.Modules.Interfaces +Imports DigitalData.Modules.Jobs +Imports DigitalData.Modules.Logging + +Public Class GraphQLJob + Inherits JobBase + Implements IJob(Of GraphQLArgs) + + Public Sub New(LogConfig As LogConfig) + MyBase.New(LogConfig, Nothing, Nothing) + End Sub + + Public Sub Start(Args As GraphQLArgs) Implements IJob(Of GraphQLArgs).Start + Dim oInterface As New GraphQLInterface( + _LogConfig, Args.BaseUrl, Args.Email, Args.Password, Args.CertificateFile, Args.CertificatePassword) + + Dim oQuery = "query Nls{ + niederlassungen(offset: 0, limit: 5) { + niederlassungen { + mdnr + bezeichnung + sparte { + id + name + __typename + } + __typename + } + __typename + } + }" + + _Logger.Info("Logging in..") + + ' Login to get cookie + Dim oLoginResponse = oInterface.Login() + + ' save cookie for future requests + oInterface.SaveCookies(oLoginResponse.Cookies.Item(0)) + + _Logger.Info("Getting the data..") + + ' get the data + Dim oDataResponse = oInterface.GetData(oQuery, "Nls") + Dim oResult As String + + ' write data to string + Using oStream = oDataResponse.GetResponseStream() + Using oReader As New StreamReader(oStream) + oResult = oReader.ReadToEnd() + End Using + End Using + + ' TODO: save data to file + _Logger.Info("Response is:") + _Logger.Info(oResult) + + _Logger.Info("Logging out..") + + ' logout + Dim oLogoutResponse = oInterface.Logout() + End Sub + + Public Function ShouldStart(Arguments As GraphQLArgs) As Boolean Implements IJob(Of GraphQLArgs).ShouldStart + Return Arguments.Enabled + End Function +End Class diff --git a/Modules.Jobs/Jobs.vbproj b/Modules.Jobs/Jobs.vbproj index d90b780b..a98f142f 100644 --- a/Modules.Jobs/Jobs.vbproj +++ b/Modules.Jobs/Jobs.vbproj @@ -84,6 +84,8 @@ + + diff --git a/Service.JobRunner/App.config b/Service.JobRunner/App.config index 36334114..d70cbf78 100644 --- a/Service.JobRunner/App.config +++ b/Service.JobRunner/App.config @@ -34,6 +34,9 @@ False|10/0 * * * * ?|Foo::Bar + + False|0 0 0/1 * * ?|CertPath::E:\jonathanjenne.pfx,CertPass::jonathanjenne,Username::j.jenne@digitaldata.works,Password::DigitalData01!,BaseUrl::http://data.api.wisag.de:8090 + \ No newline at end of file diff --git a/Service.JobRunner/JobRunner.vb b/Service.JobRunner/JobRunner.vb index 76a81339..54711e6a 100644 --- a/Service.JobRunner/JobRunner.vb +++ b/Service.JobRunner/JobRunner.vb @@ -90,9 +90,6 @@ Public Class JobRunner Await _scheduler.Shutdown() End Sub - - - Private Class LogProvider Implements ILogProvider diff --git a/Service.JobRunner/JobRunner.vbproj b/Service.JobRunner/JobRunner.vbproj index d00a9c6c..4b0ddea7 100644 --- a/Service.JobRunner/JobRunner.vbproj +++ b/Service.JobRunner/JobRunner.vbproj @@ -87,6 +87,7 @@ + diff --git a/Service.JobRunner/Jobs/GraphQLJob.vb b/Service.JobRunner/Jobs/GraphQLJob.vb new file mode 100644 index 00000000..33ae9cdc --- /dev/null +++ b/Service.JobRunner/Jobs/GraphQLJob.vb @@ -0,0 +1,25 @@ +Imports DigitalData.Modules.Database +Imports DigitalData.Modules.Jobs +Imports DigitalData.Modules.Logging +Imports Quartz + +Public Class GraphQLJob + Implements Quartz.IJob + + Public Function Execute(context As IJobExecutionContext) As Task Implements Quartz.IJob.Execute + Dim oJobData = context.MergedJobDataMap + Dim oLogConfig As LogConfig = oJobData.Item("LogConfig") + Dim oArgs As Dictionary(Of String, String) = oJobData.Item("Args") + Dim oJobArgs = New GraphQLArgs With { + .CertificateFile = oArgs.Item("CertFile"), + .CertificatePassword = oArgs.Item("CertPass"), + .Email = oArgs.Item("Username"), + .Password = oArgs.Item("Password") + } + + Dim oGraphQLJob As New Modules.Jobs.GraphQLJob(oLogConfig) + oGraphQLJob.Start(oJobArgs) + + Return Task.FromResult(True) + End Function +End Class \ No newline at end of file diff --git a/Service.JobRunner/My Project/Settings.Designer.vb b/Service.JobRunner/My Project/Settings.Designer.vb index 7cfe7c1e..8e6f512c 100644 --- a/Service.JobRunner/My Project/Settings.Designer.vb +++ b/Service.JobRunner/My Project/Settings.Designer.vb @@ -134,6 +134,17 @@ Namespace My Return CType(Me("TEST_CONFIG"),String) End Get End Property + + _ + Public ReadOnly Property GRAPHQL_CONFIG() As String + Get + Return CType(Me("GRAPHQL_CONFIG"),String) + End Get + End Property End Class End Namespace diff --git a/Service.JobRunner/My Project/Settings.settings b/Service.JobRunner/My Project/Settings.settings index 0742959f..c8571020 100644 --- a/Service.JobRunner/My Project/Settings.settings +++ b/Service.JobRunner/My Project/Settings.settings @@ -29,5 +29,8 @@ False|10/0 * * * * ?|Foo::Bar + + False|0 0 0/1 * * ?|CertPath::E:\jonathanjenne.pfx,CertPass::jonathanjenne,Username::j.jenne@digitaldata.works,Password::DigitalData01!,BaseUrl::http://data.api.wisag.de:8090 + \ No newline at end of file