feat(PDFBurner): PDFBurnerParams hinzufügen und Konfiguration binden

This commit is contained in:
Developer 02
2025-04-24 16:08:05 +02:00
parent 82cb50b7e1
commit 51920089af
8 changed files with 24 additions and 29 deletions

View File

@@ -1,16 +1,13 @@
Imports DigitalData.Modules.Config.ConfigAttributes
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
Public Class Config
<ConnectionString>
Public Property ConnectionString As String = ""
Public Property Debug As Boolean = False
Public Property IntervalInMin As Integer = 1
Public Property IgnoredLabels As List(Of String) = New List(Of String) From {
"Date", "Datum",
"ZIP", "PLZ",
"Place", "Ort",
"Position", "Stellung"
}
Public Property PDFBurnerParams As PDFBurnerParams = New PDFBurnerParams()
End Class

View File

@@ -3,6 +3,7 @@ Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.Common.Jobs
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
Imports Quartz
Public Class Scheduler
@@ -11,15 +12,15 @@ Public Class Scheduler
Private Scheduler As IScheduler
Private ReadOnly ConnectionString As String
Private ReadOnly LicenseKey As String
Private Property _ignoredLabels As List(Of String)
Private Property _pdfBurnerParams As PDFBurnerParams
Private Const JobName = "CertificateDocumentJob"
Public Sub New(pLogConfig As LogConfig, pConnectionString As String, pLicenseKey As String, ignoredLabels As List(Of String))
Public Sub New(pLogConfig As LogConfig, pConnectionString As String, pLicenseKey As String, pdfBurnerParams As PDFBurnerParams)
MyBase.New(pLogConfig)
ConnectionString = pConnectionString
LicenseKey = pLicenseKey
_ignoredLabels = ignoredLabels
_pdfBurnerParams = pdfBurnerParams
Dim oLogProvider = New LogProvider(Logger)
Logging.LogProvider.SetCurrentLogProvider(oLogProvider)
@@ -40,7 +41,7 @@ Public Class Scheduler
{Common.Constants.GDPICTURE, LicenseKey},
{Common.Constants.LOGCONFIG, LogConfig},
{Common.Constants.DATABASE, ConnectionString},
{Common.Constants.IGNORED_LABELS, _ignoredLabels}
{Common.Constants.PDF_BURNER_PARAMS, _pdfBurnerParams}
}
Logger.Debug("Initialized Job [{0}]", JobName)

View File

@@ -55,7 +55,7 @@ Public Class Service
Logger.Debug("Inititalize Quartz")
Scheduler = New Scheduler(LogConfig, Config.ConnectionString, oKey, Config.IgnoredLabels)
Scheduler = New Scheduler(LogConfig, Config.ConnectionString, oKey, Config.PDFBurnerParams)
Await Scheduler.Start(Config.IntervalInMin)
Logger.Info("Started [{0}] !", ServiceName)