diff --git a/Service.EDMIService/BaseMethod.vb b/Service.EDMIService/BaseMethod.vb index f6ea8ad3..afd19e47 100644 --- a/Service.EDMIService/BaseMethod.vb +++ b/Service.EDMIService/BaseMethod.vb @@ -5,14 +5,15 @@ Imports DigitalData.Services.EDMIService.IDB Public MustInherit Class BaseMethod Inherits BaseClass - Friend ReadOnly Database As MSSQLServer + Friend ReadOnly DatabaseIDB As MSSQLServer + Friend ReadOnly DatabaseECM As MSSQLServer Friend ReadOnly Helpers As Helpers Friend ReadOnly GlobalState As GlobalState - Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer, pGlobalState As GlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) MyBase.New(pLogConfig) - Database = pMSSQLServer - Helpers = New Helpers(pLogConfig, pMSSQLServer) + DatabaseIDB = pDatabaseIDB + Helpers = New Helpers(pLogConfig, pDatabaseIDB) GlobalState = pGlobalState End Sub End Class diff --git a/Service.EDMIService/Methods/GetAttributeValue/GetAttributeValueMethod.vb b/Service.EDMIService/Methods/GetAttributeValue/GetAttributeValueMethod.vb index 782a96a3..0a1a5c80 100644 --- a/Service.EDMIService/Methods/GetAttributeValue/GetAttributeValueMethod.vb +++ b/Service.EDMIService/Methods/GetAttributeValue/GetAttributeValueMethod.vb @@ -5,8 +5,8 @@ Namespace Methods.GetAttributeValue Public Class GetAttributeValueMethod Inherits BaseMethod - Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pDatabase, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) End Sub Public Function Run(pData As GetAttributeValueRequest) As GetAttributeValueResponse diff --git a/Service.EDMIService/Methods/GetDatatableFromCache/GetDatatableFromCacheMethod.vb b/Service.EDMIService/Methods/GetDatatableFromCache/GetDatatableFromCacheMethod.vb index 696b83ce..3fdb99b8 100644 --- a/Service.EDMIService/Methods/GetDatatableFromCache/GetDatatableFromCacheMethod.vb +++ b/Service.EDMIService/Methods/GetDatatableFromCache/GetDatatableFromCacheMethod.vb @@ -6,8 +6,8 @@ Namespace Methods.GetDatatableFromCache Public Class GetDatatableFromCacheMethod Inherits BaseMethod - Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pMSSQLServer, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) End Sub Public Function Run(pData As GetDatatableFromCacheRequest) As GetDatatableFromCacheResponse diff --git a/Service.EDMIService/Methods/GetFileObject/GetFileObjectMethod.vb b/Service.EDMIService/Methods/GetFileObject/GetFileObjectMethod.vb index 197bfc5d..5651a8fb 100644 --- a/Service.EDMIService/Methods/GetFileObject/GetFileObjectMethod.vb +++ b/Service.EDMIService/Methods/GetFileObject/GetFileObjectMethod.vb @@ -7,8 +7,8 @@ Namespace Methods.GetFileObject Public Class GetFileObjectMethod Inherits BaseMethod - Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pMSSQLServer, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) End Sub Public Function Run(pData As GetFileObjectRequest) As GetFileObjectResponse @@ -18,7 +18,7 @@ Namespace Methods.GetFileObject End If Dim oSQL = $"SELECT * FROM VWIDB_FILE_OBJECT WHERE IDB_OBJ_ID = {pData.ObjectId}" - Dim oTable = Database.GetDatatable(oSQL) + Dim oTable = DatabaseIDB.GetDatatable(oSQL) If oTable Is Nothing OrElse oTable.Rows.Count = 0 Then LogAndThrow("Error while getting FileObject data!") diff --git a/Service.EDMIService/Methods/GlobalIndexer/ImportFile/ImportFileMethod.vb b/Service.EDMIService/Methods/GlobalIndexer/ImportFile/ImportFileMethod.vb index 040ce527..34581d4f 100644 --- a/Service.EDMIService/Methods/GlobalIndexer/ImportFile/ImportFileMethod.vb +++ b/Service.EDMIService/Methods/GlobalIndexer/ImportFile/ImportFileMethod.vb @@ -18,12 +18,12 @@ Namespace Methods.GlobalIndexer.ImportFile Private User As UserState - Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pMSSQLServer, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) Patterns = New Patterns2(pLogConfig) - Loader = New Loader(pLogConfig, Database, pGlobalState) - Connection = Database.GetConnection() + Loader = New Loader(pLogConfig, DatabaseIDB, pDatabaseECM, pGlobalState) + Connection = DatabaseIDB.GetConnection() Transaction = Connection.BeginTransaction() End Sub @@ -55,11 +55,11 @@ Namespace Methods.GlobalIndexer.ImportFile oUserAttributes = oPostProcessing.ApplyManualPostprocessing(oUserAttributes) ' Apply automatic attributes - Dim oAutomaticIndexing = New Steps.AutomaticIndexing(LogConfig, Database, oAutomaticIndexes, GlobalState) + Dim oAutomaticIndexing = New Steps.AutomaticIndexing(LogConfig, DatabaseIDB, oAutomaticIndexes, GlobalState) oAutoAttributes = oAutomaticIndexing.ApplyAutomaticeAttributes(oUserAttributes, pData.File.FileInfoRaw, User) ' Import the file - Dim oNewFile As New NewFileMethod(LogConfig, Database, GlobalState) + Dim oNewFile As New NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState) Dim oResponse = oNewFile.Run(New NewFile.NewFileRequest With { .File = pData.File, .BusinessEntity = pData.BusinessEntity, diff --git a/Service.EDMIService/Methods/GlobalIndexer/Loader.vb b/Service.EDMIService/Methods/GlobalIndexer/Loader.vb index b32b0c67..f3f50c63 100644 --- a/Service.EDMIService/Methods/GlobalIndexer/Loader.vb +++ b/Service.EDMIService/Methods/GlobalIndexer/Loader.vb @@ -14,9 +14,9 @@ Namespace Methods.GlobalIndexer Private GetDatatable As GetDatatableFromCacheMethod - Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pGlobalState As GlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) MyBase.New(pLogConfig) - GetDatatable = New GetDatatableFromCacheMethod(pLogConfig, pDatabase, pGlobalState) + GetDatatable = New GetDatatableFromCacheMethod(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) End Sub ''' diff --git a/Service.EDMIService/Methods/NewFile/NewFileMethod.vb b/Service.EDMIService/Methods/NewFile/NewFileMethod.vb index 239d6ae3..0cdc8d81 100644 --- a/Service.EDMIService/Methods/NewFile/NewFileMethod.vb +++ b/Service.EDMIService/Methods/NewFile/NewFileMethod.vb @@ -11,10 +11,10 @@ Public Class NewFileMethod Private ReadOnly Connection As SqlConnection Private ReadOnly Transaction As SqlTransaction - Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pMSSQLServer, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) - Connection = Database.GetConnection() + Connection = DatabaseIDB.GetConnection() Transaction = Connection.BeginTransaction() End Sub @@ -117,7 +117,7 @@ Public Class NewFileMethod '{oObjectId}', {oStore.Id}" - Dim oResult As Boolean = Database.ExecuteNonQueryWithConnectionObject(oSQL, Connection, ExternalTransaction, Transaction) + Dim oResult As Boolean = DatabaseIDB.ExecuteNonQueryWithConnectionObject(oSQL, Connection, ExternalTransaction, Transaction) If oResult = False Then LogAndThrow("IDB FileObject could not be created!") @@ -182,7 +182,7 @@ Public Class NewFileMethod Private Function TestFileChecksumExists(pChecksum As String) As Long Try Dim oChecksumSQL = $"SELECT IDB_OBJ_ID FROM TBIDB_FILE_OBJECT WHERE FILE_HASH = '{pChecksum}'" - Dim oExistingObjectId As Long = Database.GetScalarValue(oChecksumSQL) + Dim oExistingObjectId As Long = DatabaseIDB.GetScalarValue(oChecksumSQL) If oExistingObjectId > 0 Then Logger.Info("Returning early with ObjectId [{0}] because Checksum [{1}] already exists.", oExistingObjectId, pChecksum) @@ -203,7 +203,7 @@ Public Class NewFileMethod Dim oNewObjectIdSQL = $"DECLARE @NEW_IDB_OBJ_ID BIGINT EXEC PRIDB_NEW_OBJECT '{pKindType}','{pWho}','{pBusinessEntity}',0, @IDB_OBJ_ID = @NEW_IDB_OBJ_ID OUTPUT; SELECT @NEW_IDB_OBJ_ID" - Dim oObjectId As Long = Database.GetScalarValueWithConnectionObject(oNewObjectIdSQL, Connection, ExternalTransaction, Transaction) + Dim oObjectId As Long = DatabaseIDB.GetScalarValueWithConnectionObject(oNewObjectIdSQL, Connection, ExternalTransaction, Transaction) Logger.Info("New Object with Id [{0}] created!", oObjectId) If IsNothing(oObjectId) Then diff --git a/Service.EDMIService/Methods/SetAttributeValue/SetAttributeValueMethod.vb b/Service.EDMIService/Methods/SetAttributeValue/SetAttributeValueMethod.vb index 70a78040..f64ef257 100644 --- a/Service.EDMIService/Methods/SetAttributeValue/SetAttributeValueMethod.vb +++ b/Service.EDMIService/Methods/SetAttributeValue/SetAttributeValueMethod.vb @@ -10,10 +10,10 @@ Namespace Methods.SetAttributeValue Private Connection As SqlConnection Private Transaction As SqlTransaction - Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer, pGlobalState As GlobalState) - MyBase.New(pLogConfig, pDatabase, pGlobalState) + Public Sub New(pLogConfig As LogConfig, pDatabaseIDB As MSSQLServer, pDatabaseECM As MSSQLServer, pGlobalState As GlobalState) + MyBase.New(pLogConfig, pDatabaseIDB, pDatabaseECM, pGlobalState) - Connection = Database.GetConnection() + Connection = DatabaseIDB.GetConnection() Transaction = Connection.BeginTransaction() End Sub