EDMI: Update Service and Client to accept IDBDoctypeId instead of Business entity

This commit is contained in:
Jonathan Jenne 2022-03-09 14:08:51 +01:00
parent 8d4f327d96
commit 9e448641a0
12 changed files with 47 additions and 47 deletions

View File

@ -183,15 +183,15 @@ Public Class Client
''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object ''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object
''' </summary> ''' </summary>
''' <param name="pObjectStoreName">Type of ObjectStore. Can be WORK or ARCHIVE.</param> ''' <param name="pObjectStoreName">Type of ObjectStore. Can be WORK or ARCHIVE.</param>
''' <param name="pBusinessEntity">Business entity that the new file object should belong to.</param> ''' <param name="pIDBDoctypeId">Business entity that the new file object should belong to.</param>
''' <param name="pImportOptions">Other file import options</param> ''' <param name="pImportOptions">Other file import options</param>
''' <exception cref="FileNotFoundException">When local filepath was not found</exception> ''' <exception cref="FileNotFoundException">When local filepath was not found</exception>
''' <exception cref="ApplicationException">When there was a error in the Service</exception> ''' <exception cref="ApplicationException">When there was a error in the Service</exception>
''' <returns>The ObjectId of the newly generated filesystem object</returns> ''' <returns>The ObjectId of the newly generated filesystem object</returns>
Public Async Function NewFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pBusinessEntity As String, Optional pImportOptions As Options.NewFileOptions = Nothing) As Task(Of Long) Public Async Function NewFileAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pIDBDoctypeId As Long, Optional pImportOptions As Options.NewFileOptions = Nothing) As Task(Of Long)
Try Try
Dim oNewFile As New Modules.IDB.NewFile(LogConfig, Channel) Dim oNewFile As New Modules.IDB.NewFile(LogConfig, Channel)
Return Await oNewFile.RunAsync(pFilePath, pObjectStoreName, pObjectKind, pBusinessEntity, pImportOptions) Return Await oNewFile.RunAsync(pFilePath, pObjectStoreName, pObjectKind, pIDBDoctypeId, pImportOptions)
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)

View File

@ -6,8 +6,8 @@
<xs:complexType name="ImportFileRequest"> <xs:complexType name="ImportFileRequest">
<xs:sequence> <xs:sequence>
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="AttributeValues" nillable="true" type="q1:ArrayOfUserAttributeValue" /> <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="AttributeValues" nillable="true" type="q1:ArrayOfUserAttributeValue" />
<xs:element minOccurs="0" name="BusinessEntity" nillable="true" type="xs:string" />
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="File" nillable="true" type="q2:FileProperties" /> <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="File" nillable="true" type="q2:FileProperties" />
<xs:element minOccurs="0" name="IDBDoctypeId" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="KindType" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="KindType" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ProfileId" type="xs:int" /> <xs:element minOccurs="0" name="ProfileId" type="xs:int" />
<xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" />

View File

@ -5,8 +5,8 @@
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages" /> <xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages" />
<xs:complexType name="NewFileRequest"> <xs:complexType name="NewFileRequest">
<xs:sequence> <xs:sequence>
<xs:element minOccurs="0" name="BusinessEntity" nillable="true" type="xs:string" />
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="File" nillable="true" type="q1:FileProperties" /> <xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Methods.IDB" minOccurs="0" name="File" nillable="true" type="q1:FileProperties" />
<xs:element minOccurs="0" name="IDBDoctypeId" type="xs:long" />
<xs:element minOccurs="0" name="KindType" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="KindType" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" /> <xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" />
<xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/DigitalData.Modules.ZooFlow.State" minOccurs="0" name="User" nillable="true" type="q2:UserState" /> <xs:element xmlns:q2="http://schemas.datacontract.org/2004/07/DigitalData.Modules.ZooFlow.State" minOccurs="0" name="User" nillable="true" type="q2:UserState" />

View File

@ -1127,10 +1127,10 @@ Namespace EDMIServiceReference
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private BusinessEntityField As String Private FileField As EDMIServiceReference.FileProperties
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private FileField As EDMIServiceReference.FileProperties Private IDBDoctypeIdField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private KindTypeField As String Private KindTypeField As String
@ -1151,19 +1151,6 @@ Namespace EDMIServiceReference
End Set End Set
End Property End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property BusinessEntity() As String
Get
Return Me.BusinessEntityField
End Get
Set
If (Object.ReferenceEquals(Me.BusinessEntityField, value) <> true) Then
Me.BusinessEntityField = value
Me.RaisePropertyChanged("BusinessEntity")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _ <System.Runtime.Serialization.DataMemberAttribute()> _
Public Property File() As EDMIServiceReference.FileProperties Public Property File() As EDMIServiceReference.FileProperties
Get Get
@ -1177,6 +1164,19 @@ Namespace EDMIServiceReference
End Set End Set
End Property End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property IDBDoctypeId() As Long
Get
Return Me.IDBDoctypeIdField
End Get
Set
If (Me.IDBDoctypeIdField.Equals(value) <> true) Then
Me.IDBDoctypeIdField = value
Me.RaisePropertyChanged("IDBDoctypeId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _ <System.Runtime.Serialization.DataMemberAttribute()> _
Public Property KindType() As String Public Property KindType() As String
Get Get
@ -1993,10 +1993,10 @@ Namespace EDMIServiceReference
Private AttributeValuesField() As EDMIServiceReference.UserAttributeValue Private AttributeValuesField() As EDMIServiceReference.UserAttributeValue
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private BusinessEntityField As String Private FileField As EDMIServiceReference.FileProperties
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private FileField As EDMIServiceReference.FileProperties Private IDBDoctypeIdField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _ <System.Runtime.Serialization.OptionalFieldAttribute()> _
Private KindTypeField As String Private KindTypeField As String
@ -2033,19 +2033,6 @@ Namespace EDMIServiceReference
End Set End Set
End Property End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property BusinessEntity() As String
Get
Return Me.BusinessEntityField
End Get
Set
If (Object.ReferenceEquals(Me.BusinessEntityField, value) <> true) Then
Me.BusinessEntityField = value
Me.RaisePropertyChanged("BusinessEntity")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _ <System.Runtime.Serialization.DataMemberAttribute()> _
Public Property File() As EDMIServiceReference.FileProperties Public Property File() As EDMIServiceReference.FileProperties
Get Get
@ -2059,6 +2046,19 @@ Namespace EDMIServiceReference
End Set End Set
End Property End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property IDBDoctypeId() As String
Get
Return Me.IDBDoctypeIdField
End Get
Set
If (Object.ReferenceEquals(Me.IDBDoctypeIdField, value) <> true) Then
Me.IDBDoctypeIdField = value
Me.RaisePropertyChanged("IDBDoctypeId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _ <System.Runtime.Serialization.DataMemberAttribute()> _
Public Property KindType() As String Public Property KindType() As String
Get Get

View File

@ -17,7 +17,7 @@ Namespace Modules.Globix
pAttributeValues As List(Of UserAttributeValue), pAttributeValues As List(Of UserAttributeValue),
pObjectStoreName As String, pObjectStoreName As String,
pObjectKind As String, pObjectKind As String,
pBusinessEntity As String, pIDBDoctypeId As Long,
pImportOptions As Options.ImportFileOptions) As Task(Of ImportFileResponse) pImportOptions As Options.ImportFileOptions) As Task(Of ImportFileResponse)
Try Try
' Set default options ' Set default options
@ -45,7 +45,7 @@ Namespace Modules.Globix
Dim oContents = oMemoryStream.ToArray() Dim oContents = oMemoryStream.ToArray()
Dim oFileImportResponse = Await Channel.ImportFileAsync(New ImportFileRequest With { Dim oFileImportResponse = Await Channel.ImportFileAsync(New ImportFileRequest With {
.BusinessEntity = pBusinessEntity, .IDBDoctypeId = pIDBDoctypeId,
.File = New FileProperties With { .File = New FileProperties With {
.FileName = oFileInfo.Name, .FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt, .FileCreatedAt = oFileCreatedAt,

View File

@ -10,7 +10,7 @@ Namespace Modules.IDB
MyBase.New(pLogConfig, pChannel) MyBase.New(pLogConfig, pChannel)
End Sub End Sub
Public Async Function RunAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pBusinessEntity As String, Optional pOptions As Options.NewFileOptions = Nothing) As Task(Of Long) Public Async Function RunAsync(pFilePath As String, pObjectStoreName As String, pObjectKind As String, pIDBDoctypeId As Long, Optional pOptions As Options.NewFileOptions = Nothing) As Task(Of Long)
Try Try
' Set default options ' Set default options
If pOptions Is Nothing Then If pOptions Is Nothing Then
@ -25,7 +25,7 @@ Namespace Modules.IDB
' Importing the file now ' Importing the file now
Dim oFileProperties = Helpers.GetFileProperties(pFilePath, pOptions.DateImported) Dim oFileProperties = Helpers.GetFileProperties(pFilePath, pOptions.DateImported)
Dim oFileImportResponse = Await Channel.NewFileAsync(New NewFileRequest With { Dim oFileImportResponse = Await Channel.NewFileAsync(New NewFileRequest With {
.BusinessEntity = pBusinessEntity, .IDBDoctypeId = pIDBDoctypeId,
.File = oFileProperties, .File = oFileProperties,
.KindType = pObjectKind, .KindType = pObjectKind,
.StoreName = pObjectStoreName, .StoreName = pObjectStoreName,

View File

@ -113,10 +113,10 @@ Namespace IDB
End Try End Try
End Function End Function
Public Function NewObjectIdWithTransaction(pKindType As String, pBusinessEntity As String, pWho As String, pConnection As SqlConnection, pTransaction As SqlTransaction) As Long Public Function NewObjectIdWithTransaction(pKindType As String, pIDBDoctypeId As Long, pWho As String, pConnection As SqlConnection, pTransaction As SqlTransaction) As Long
Try Try
Dim oNewObjectIdSQL = $"DECLARE @NEW_IDB_OBJ_ID BIGINT Dim oNewObjectIdSQL = $"DECLARE @NEW_IDB_OBJ_ID BIGINT
EXEC PRIDB_NEW_OBJECT '{pKindType}','{pWho}','{pBusinessEntity}',0, @IDB_OBJ_ID = @NEW_IDB_OBJ_ID OUTPUT; EXEC PRIDB_NEW_OBJECT '{pKindType}','{pWho}',{pIDBDoctypeId},0, @IDB_OBJ_ID = @NEW_IDB_OBJ_ID OUTPUT;
SELECT @NEW_IDB_OBJ_ID" SELECT @NEW_IDB_OBJ_ID"
Dim oObjectId As Long = Database.GetScalarValueWithConnectionObject(oNewObjectIdSQL, Dim oObjectId As Long = Database.GetScalarValueWithConnectionObject(oNewObjectIdSQL,
pConnection, pConnection,

View File

@ -64,7 +64,7 @@ Namespace Methods.GlobalIndexer.ImportFile
Dim oNewFile As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState) Dim oNewFile As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
Dim oResponse = oNewFile.Run(New NewFile.NewFileRequest With { Dim oResponse = oNewFile.Run(New NewFile.NewFileRequest With {
.File = pData.File, .File = pData.File,
.BusinessEntity = pData.BusinessEntity, .IDBDoctypeId = pData.IDBDoctypeId,
.KindType = pData.KindType, .KindType = pData.KindType,
.StoreName = pData.StoreName, .StoreName = pData.StoreName,
.User = User .User = User

View File

@ -19,10 +19,10 @@ Namespace Methods.GlobalIndexer.ImportFile
Public Property ProfileId As Integer Public Property ProfileId As Integer
''' <summary> ''' <summary>
''' The business entity of the file, ex DEFAULT ''' The Document Type of the file, ex. IncomingInvoice
''' </summary> ''' </summary>
<DataMember> <DataMember>
Public Property BusinessEntity As String Public Property IDBDoctypeId As String
''' <summary> ''' <summary>
''' The kind of object to be created, ex. DOC ''' The kind of object to be created, ex. DOC

View File

@ -28,7 +28,7 @@ Namespace Methods.IDB.NewFile
Try Try
Dim oObjectId = Helpers.NewObjectIdWithTransaction(pData.KindType, pData.BusinessEntity, pData.User.UserName, Connection, Transaction) Dim oObjectId = Helpers.NewObjectIdWithTransaction(pData.KindType, pData.IDBDoctypeId, pData.User.UserName, Connection, Transaction)
If oObjectId = 0 Then If oObjectId = 0 Then
LogAndThrow("Could not create new ObjectId!") LogAndThrow("Could not create new ObjectId!")
End If End If

View File

@ -18,7 +18,7 @@ Namespace Methods.IDB.NewFile
''' The business entity of the file, ex DEFAULT ''' The business entity of the file, ex DEFAULT
''' </summary> ''' </summary>
<DataMember> <DataMember>
Public Property BusinessEntity As String Public Property IDBDoctypeId As Long
''' <summary> ''' <summary>
''' The kind of object to be created, ex. DOC ''' The kind of object to be created, ex. DOC

View File

@ -83,7 +83,7 @@ Namespace Methods.IDB.UpdateFile
Dim oNewFileMethod As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState) Dim oNewFileMethod As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
Dim oNewFileRequest As New NewFile.NewFileRequest With { Dim oNewFileRequest As New NewFile.NewFileRequest With {
.File = pData.File, .File = pData.File,
.BusinessEntity = oBusinessEntity, .IDBDoctypeId = oBusinessEntity,
.KindType = oKind, .KindType = oKind,
.StoreName = oStore, .StoreName = oStore,
.User = pData.User .User = pData.User