Migrate from Filesystem to Base
This commit is contained in:
parent
7aec23abd9
commit
ba55b17009
@ -173,7 +173,7 @@ Partial Class DocumentViewer
|
||||
Me.BarManager1.Form = Me
|
||||
Me.BarManager1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.buttonPrint, Me.buttonFitPage, Me.buttonFitWidth, Me.buttonZoomIn, Me.buttonZoomOut, Me.buttonRotateRight, Me.buttonRotateLeft, Me.buttonFlipX, Me.buttonFlipY, Me.buttonSettings, Me.buttonPrevPage, Me.buttonNextPage, Me.buttonFirstPage, Me.buttonLastPage, Me.txtCurrentPage, Me.BarStaticItem1, Me.labelPageCount, Me.txtSearch, Me.btnPrevHighlight, Me.btnNextHighlight, Me.btnSearch, Me.btnSearch2})
|
||||
Me.BarManager1.MainMenu = Me.ToolbarDocumentViewer
|
||||
Me.BarManager1.MaxItemId = 33
|
||||
Me.BarManager1.MaxItemId = 34
|
||||
Me.BarManager1.RepositoryItems.AddRange(New DevExpress.XtraEditors.Repository.RepositoryItem() {Me.RepositoryItemTextEdit1, Me.RepositoryItemTextEdit2, Me.RepositoryItemColorEdit1, Me.RepositoryItemComboBox1, Me.RepositoryItemSearchControl1, Me.RepositoryItemTextEdit3})
|
||||
'
|
||||
'ToolbarDocumentViewer
|
||||
|
||||
@ -3,7 +3,7 @@ Imports DigitalData.Modules.EDMI.API
|
||||
Imports DigitalData.Modules.EDMI.API.Client
|
||||
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
Imports DigitalData.Modules.Base
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
|
||||
@ -16,9 +16,8 @@ Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.ZooFlow.Constants
|
||||
Imports DigitalData.Modules.Base.IDB.FileStore
|
||||
Imports DigitalData.Modules.Base.IDB.Constants.FileStore
|
||||
Imports DigitalData.Modules.Base
|
||||
'Imports DigitalData.GUIs.Common.Base
|
||||
Imports DigitalData.GUIs.Common.DocumentResultList
|
||||
|
||||
Public Class frmDocumentResultList
|
||||
@ -41,7 +40,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Private ReadOnly Config As ConfigManager(Of Config)
|
||||
Private ReadOnly Environment As Environment
|
||||
Private ReadOnly Filesystem As Modules.Filesystem.File
|
||||
Private ReadOnly Filesystem As FilesystemEx
|
||||
Private ReadOnly GridBuilder As GridBuilder
|
||||
Private ReadOnly FileEx As Modules.Windows.File
|
||||
Private ReadOnly Helpers As DocumentResultList.Helpers
|
||||
@ -122,7 +121,7 @@ Public Class frmDocumentResultList
|
||||
|
||||
Config = New ConfigManager(Of Config)(pLogConfig, oConfigPath, oConfigPath)
|
||||
Helpers = New DocumentResultList.Helpers(pLogConfig)
|
||||
Filesystem = New Modules.Filesystem.File(pLogConfig)
|
||||
Filesystem = New FilesystemEx(pLogConfig)
|
||||
GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3})
|
||||
FileEx = New Modules.Windows.File(pLogConfig)
|
||||
LayoutManager = New Layout(pLogConfig, Config, New List(Of GridView) From {GridView1, GridView2, GridView3}, pEnvironment)
|
||||
|
||||
@ -37,7 +37,7 @@ Public Class Form1
|
||||
|
||||
Select Case oFolderType
|
||||
Case ZUGFERD_IN
|
||||
args.WatchDirectories.Add(row.Item("FOLDER_PATH"))
|
||||
args.WatchDirectory = row.Item("FOLDER_PATH")
|
||||
|
||||
Case ZUGFERD_SUCCESS
|
||||
args.SuccessDirectory = row.Item("FOLDER_PATH")
|
||||
@ -95,9 +95,8 @@ Public Class Form1
|
||||
}
|
||||
args = LoadFolderConfig(args)
|
||||
args = LoadPropertyMapFor(args)
|
||||
args.InsertIntoSQLServer = True
|
||||
|
||||
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
|
||||
Dim job As New Jobs.ImportZUGFeRDFiles(_logConfig, _mssql)
|
||||
|
||||
job.Start(args)
|
||||
End Sub
|
||||
|
||||
@ -2,11 +2,10 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Patterns
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DigitalData.Services.EDMIService.Methods.Database
|
||||
Imports DigitalData.Services.EDMIService.Methods.IDB
|
||||
Imports DigitalData.Modules.ZooFlow.State
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
|
||||
Namespace Methods.GlobalIndexer.ImportFile
|
||||
Public Class ImportFileMethod
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Database.MSSQLServer.TransactionMode
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Database.MSSQLServer.TransactionMode
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Services.EDMIService.IDB
|
||||
Imports System.Data.SqlClient
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
|
||||
Namespace Methods.IDB.SetAttributeValue
|
||||
Public Class SetAttributeValueMethod
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Database.MSSQLServer.TransactionMode
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Base.IDB
|
||||
Imports DigitalData.Modules.Base.IDB.Constants
|
||||
|
||||
Namespace Methods.IDB.UpdateFile
|
||||
Public Class UpdateFileMethod
|
||||
|
||||
@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyCompany("Digital Data")>
|
||||
<Assembly: AssemblyProduct("DDZUGFeRDService")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2023")>
|
||||
<Assembly: AssemblyTrademark("2.5.0.1")>
|
||||
<Assembly: AssemblyTrademark("2.5.0.3")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.5.0.1")>
|
||||
<Assembly: AssemblyFileVersion("2.5.0.1")>
|
||||
<Assembly: AssemblyVersion("2.5.0.3")>
|
||||
<Assembly: AssemblyFileVersion("2.5.0.3")>
|
||||
|
||||
@ -18,6 +18,8 @@ Public Class ThreadRunner
|
||||
Private ReadOnly _jobArguments As WorkerArgs
|
||||
Private ReadOnly _mssql As MSSQLServer
|
||||
|
||||
Private BusyCounter As Integer = 0
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, ConfigManager As ConfigManager(Of Config), MSSQL As MSSQLServer)
|
||||
_logConfig = LogConfig
|
||||
_logger = _logConfig.GetLogger()
|
||||
@ -55,49 +57,47 @@ Public Class ThreadRunner
|
||||
oArgs = LoadPropertyMap(oArgs)
|
||||
|
||||
_logger.Debug("Custom Options:")
|
||||
_logger.Debug("ExceptionEmailAddress: {0}", oArgs.ExceptionEmailAddress)
|
||||
_logger.Debug("IgnoreRejectionStatus: {0}", oArgs.IgnoreRejectionStatus)
|
||||
_logger.Debug("MaxAttachmentSizeInMegaBytes: {0}", oArgs.MaxAttachmentSizeInMegaBytes)
|
||||
_logger.Debug("ExceptionEmailAddress: [{0}]", oArgs.ExceptionEmailAddress)
|
||||
_logger.Debug("IgnoreRejectionStatus: [{0}]", oArgs.IgnoreRejectionStatus)
|
||||
_logger.Debug("MaxAttachmentSizeInMegaBytes: [{0}]", oArgs.MaxAttachmentSizeInMegaBytes)
|
||||
|
||||
_jobArguments = oArgs
|
||||
|
||||
_logger.Debug("Checking SuccessDirectory {0}", oArgs.SuccessDirectory)
|
||||
_logger.Debug("Checking SuccessDirectory [{0}]", oArgs.SuccessDirectory)
|
||||
If Not Directory.Exists(oArgs.SuccessDirectory) Then
|
||||
_logger.Warn("SuccessDirectory {0} does not exist!", oArgs.SuccessDirectory)
|
||||
_logger.Warn("SuccessDirectory [{0}] does not exist!", oArgs.SuccessDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking ErrorDirectory {0}", oArgs.ErrorDirectory)
|
||||
_logger.Debug("Checking ErrorDirectory [{0}]", oArgs.ErrorDirectory)
|
||||
If Not Directory.Exists(oArgs.ErrorDirectory) Then
|
||||
_logger.Warn("ErrorDirectory {0} does not exist!", oArgs.ErrorDirectory)
|
||||
_logger.Warn("ErrorDirectory [{0}] does not exist!", oArgs.ErrorDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking Original Email Directory {0}", oArgs.OriginalEmailDirectory)
|
||||
_logger.Debug("Checking Original Email Directory [{0}]", oArgs.OriginalEmailDirectory)
|
||||
If Not Directory.Exists(oArgs.OriginalEmailDirectory) Then
|
||||
_logger.Warn("OriginalEmailDirectory {0} does not exist!", oArgs.OriginalEmailDirectory)
|
||||
_logger.Warn("OriginalEmailDirectory [{0}] does not exist!", oArgs.OriginalEmailDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking Rejected Email Directory {0}", oArgs.RejectedEmailDirectory)
|
||||
_logger.Debug("Checking Rejected Email Directory [{0}]", oArgs.RejectedEmailDirectory)
|
||||
If Not Directory.Exists(oArgs.RejectedEmailDirectory) Then
|
||||
_logger.Warn("RejectedEmailDirectory {0} does not exist!", oArgs.RejectedEmailDirectory)
|
||||
_logger.Warn("RejectedEmailDirectory [{0}] does not exist!", oArgs.RejectedEmailDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking Non ZUGFeRD Directory {0}", oArgs.NonZugferdDirectory)
|
||||
_logger.Debug("Checking Non ZUGFeRD Directory [{0}]", oArgs.NonZugferdDirectory)
|
||||
If Not Directory.Exists(oArgs.NonZugferdDirectory) Then
|
||||
_logger.Warn("NonZugferdDirectory {0} does not exist!", oArgs.NonZugferdDirectory)
|
||||
_logger.Warn("NonZugferdDirectory [{0}] does not exist!", oArgs.NonZugferdDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking Exception Email Adress {0}", oArgs.ExceptionEmailAddress)
|
||||
_logger.Debug("Checking Watch Directory [{0}]", oArgs.WatchDirectory)
|
||||
If Not Directory.Exists(oArgs.WatchDirectory) Then
|
||||
_logger.Warn("WatchDirectory [{0}] does not exist!", oArgs.WatchDirectory)
|
||||
End If
|
||||
|
||||
_logger.Debug("Checking Exception Email Adress [{0}]", oArgs.ExceptionEmailAddress)
|
||||
If oArgs.ExceptionEmailAddress = String.Empty Then
|
||||
_logger.Warn("ExceptionEmailAddress {0} is not set!", oArgs.ExceptionEmailAddress)
|
||||
_logger.Warn("ExceptionEmailAddress [{0}] is not set!", oArgs.ExceptionEmailAddress)
|
||||
End If
|
||||
|
||||
For Each oDirectory In oArgs.WatchDirectories
|
||||
_logger.Debug("Checking WatchDirectory {0}", oDirectory)
|
||||
If Not Directory.Exists(oDirectory) Then
|
||||
_logger.Warn("WatchDirectory {0} does not exist!", oDirectory)
|
||||
End If
|
||||
Next
|
||||
|
||||
_workerThread = New BackgroundWorker() With {
|
||||
.WorkerReportsProgress = False,
|
||||
.WorkerSupportsCancellation = True
|
||||
@ -127,9 +127,11 @@ Public Class ThreadRunner
|
||||
|
||||
Private Sub TimerElapsed(sender As Object, e As ElapsedEventArgs) Handles _workerTimer.Elapsed
|
||||
If Not _workerThread.IsBusy Then
|
||||
BusyCounter = 0
|
||||
_workerThread.RunWorkerAsync(_jobArguments)
|
||||
Else
|
||||
_logger.Info("Worker is busy, skipping execution.")
|
||||
BusyCounter = +1
|
||||
_logger.Info("Worker is busy, skipping execution. Tried for [{0}] times.", BusyCounter)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@ -151,7 +153,7 @@ Public Class ThreadRunner
|
||||
End Sub
|
||||
|
||||
Private Function LoadFolderConfig(pArgs As WorkerArgs) As WorkerArgs
|
||||
pArgs.WatchDirectories.Add(_config.Config.WatchDirectory)
|
||||
pArgs.WatchDirectory = _config.Config.WatchDirectory
|
||||
pArgs.SuccessDirectory = _config.Config.SuccessDirectory
|
||||
pArgs.ErrorDirectory = _config.Config.ErrorDirectory
|
||||
pArgs.OriginalEmailDirectory = _config.Config.OriginalEmailDirectory
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
public string MSSQLConnectionString { get; set; }
|
||||
public string MaxFileSizeInMegabytes { get; set; }
|
||||
public ZugferdConfig Zugferd { get; set; }
|
||||
public FirebirdConfig Firebird { get; set; }
|
||||
}
|
||||
|
||||
public class ZugferdConfig
|
||||
@ -19,12 +18,4 @@
|
||||
|
||||
}
|
||||
|
||||
public class FirebirdConfig
|
||||
{
|
||||
public string Datasource { get; set; }
|
||||
public string Database { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,30 +19,20 @@ namespace ZUGFeRDRESTService
|
||||
private Dictionary<string, XmlItemProperty> _propertyMap = null;
|
||||
|
||||
private const string QUERY_GET_GDPICTURE_KEY = "SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE'";
|
||||
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBEDM_XML_ITEMS WHERE ACTIVE = True ORDER BY XML_PATH";
|
||||
private const string QUERY_GET_PROPERTY_MAP = "SELECT * FROM TBDD_ZUGFERD_XML_ITEMS WHERE ACTIVE = 1 ORDER BY XML_PATH";
|
||||
|
||||
public MSSQLServer MSSQL { get; set; }
|
||||
public Firebird Firebird { get; set; }
|
||||
|
||||
public Database(ILogging Logging, IConfiguration Config)
|
||||
{
|
||||
var oLogConfig = Logging.LogConfig;
|
||||
var oLogger = Logging.LogConfig.GetLogger();
|
||||
var oAppConfig = Config.GetSection("Config");
|
||||
var oFirebirdConfig = oAppConfig.GetSection("Firebird");
|
||||
|
||||
oLogger.Debug("Establishing MSSQL Database connection..");
|
||||
MSSQL = new MSSQLServer(oLogConfig, oAppConfig["MSSQLConnectionString"]);
|
||||
|
||||
oLogger.Debug("Establishing Firebird Database connection..");
|
||||
Firebird = new Firebird(oLogConfig,
|
||||
oFirebirdConfig["Datasource"],
|
||||
oFirebirdConfig["Database"],
|
||||
oFirebirdConfig["Username"],
|
||||
oFirebirdConfig["Password"]);
|
||||
|
||||
oLogger.Debug("MSSQL Connection: [{0}]", MSSQL.CurrentConnectionString);
|
||||
oLogger.Debug("Firebird Connection: [{0}]", Firebird.ConnectionString);
|
||||
|
||||
_Logger = oLogger;
|
||||
}
|
||||
@ -62,7 +52,7 @@ namespace ZUGFeRDRESTService
|
||||
_Logger.Debug("Property map does not exist, creating.");
|
||||
|
||||
_propertyMap = new Dictionary<string, XmlItemProperty>();
|
||||
var oDatatable = Firebird.GetDatatable(QUERY_GET_PROPERTY_MAP);
|
||||
var oDatatable = MSSQL.GetDatatable(QUERY_GET_PROPERTY_MAP);
|
||||
|
||||
_Logger.Debug("Datatable Rows: [{0}]", oDatatable.Rows);
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ namespace ZUGFeRDRESTService
|
||||
public interface IDatabase
|
||||
{
|
||||
public MSSQLServer MSSQL { get; set; }
|
||||
public Firebird Firebird { get; set; }
|
||||
|
||||
public string GetGDPictureKey();
|
||||
public Dictionary<String, XmlItemProperty> GetPropertyMap();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user