Liste für ignorierte Etiketten erstellt und zu den Diensten hinzugefügt.

This commit is contained in:
Developer 02 2024-07-16 13:55:36 +02:00
parent 8eefd94569
commit 8bd7ab13d0
7 changed files with 17 additions and 14 deletions

View File

@ -102,6 +102,7 @@
Public Const DATABASE = "DATABASE"
Public Const LOGCONFIG = "LOGCONFIG"
Public Const GDPICTURE = "GDPICTURE"
Public Const IGNORED_LABELS = "IgnoredLabels"
Public Const GREEN_300 = "#bbf7d0"
Public Const RED_300 = "#fecaca"

View File

@ -7,17 +7,9 @@ Imports System.Security.Cryptography
Imports System.IO
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument.FinalizeDocumentExceptions
Imports EnvelopeGenerator.Common.Jobs.FinalizeDocument
Imports EnvelopeGenerator.Common.My.Resources
Imports EnvelopeGenerator.Common.Constants
Imports DevExpress.XtraBars.Docking
Imports System.ServiceModel
Imports DevExpress.XtraRichEdit.Export
Imports DevExpress.Pdf.Native.BouncyCastle.Asn1.Cms
Imports DevExpress.DataAccess.Sql
Imports DevExpress.DataProcessing
Imports Quartz.Logging.OperationName
Imports System.Data.SqlClient
Imports System.Windows.Forms
Namespace Jobs
Public Class FinalizeDocumentJob
@ -82,7 +74,8 @@ Namespace Jobs
InitializeServices(oState)
Logger.Debug("Loading PDFBurner..")
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey)
Dim ignoredLabels As List(Of String) = pContext.MergedJobDataMap.Item(Constants.IGNORED_LABELS)
PDFBurner = New PDFBurner(LogConfig, oGdPictureKey, ignoredLabels)
Logger.Debug("Loading PDFMerger..")
PDFMerger = New PDFMerger(LogConfig, oGdPictureKey)

View File

@ -16,14 +16,17 @@ Namespace Jobs.FinalizeDocument
Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image"
Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink"
Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget"
Private Property _ignoredLabels As List(Of String)
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String)
Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, ignoredLabels As List(Of String))
MyBase.New(pLogConfig)
LicenseManager = New LicenseManager()
LicenseManager.RegisterKEY(pGDPictureLicenseKey)
Manager = New AnnotationManager()
_ignoredLabels = ignoredLabels
End Sub
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()

View File

@ -6,4 +6,6 @@ Public Class Config
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"}
End Class

View File

@ -11,13 +11,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 Const JobName = "CertificateDocumentJob"
Public Sub New(pLogConfig As LogConfig, pConnectionString As String, pLicenseKey As String)
Public Sub New(pLogConfig As LogConfig, pConnectionString As String, pLicenseKey As String, ignoredLabels As List(Of String))
MyBase.New(pLogConfig)
ConnectionString = pConnectionString
LicenseKey = pLicenseKey
_ignoredLabels = ignoredLabels
Dim oLogProvider = New LogProvider(Logger)
Logging.LogProvider.SetCurrentLogProvider(oLogProvider)
@ -36,7 +38,8 @@ Public Class Scheduler
Dim oJobData = New JobDataMap() From {
{Common.Constants.GDPICTURE, LicenseKey},
{Common.Constants.LOGCONFIG, LogConfig},
{Common.Constants.DATABASE, ConnectionString}
{Common.Constants.DATABASE, ConnectionString},
{Common.Constants.IGNORED_LABELS, _ignoredLabels}
}
Logger.Debug("Initialized Job [{0}]", JobName)

View File

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

View File

@ -15,13 +15,14 @@ Public Class frmFinalizePDF
Private Manager As AnnotationManager
Private PDFBurner As FinalizeDocument.PDFBurner
Private pGDPictureLicenseKey As String = "21182889975216572111813147150675976632"
Private ReadOnly _ignoredLabels As New List(Of String) From {"Date", "Datum", "ZIP", "PLZ", "Place", "Ort"}
Private Sub frmFinalizePDF_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LogConfig = New LogConfig(LogConfig.PathType.CustomPath, Application.StartupPath)
Database = New MSSQLServer(LogConfig, MSSQLServer.DecryptConnectionString(CONNECTIONSTRING))
PDFBurner = New FinalizeDocument.PDFBurner(LogConfig, pGDPictureLicenseKey)
PDFBurner = New FinalizeDocument.PDFBurner(LogConfig, pGDPictureLicenseKey, _ignoredLabels)
Viewer = New GdViewer()
Manager = New AnnotationManager()