EDMI: Update Service and Client to accept IDBDoctypeId instead of Business entity
This commit is contained in:
parent
8d4f327d96
commit
9e448641a0
@ -183,15 +183,15 @@ Public Class Client
|
||||
''' Imports a file from a filepath, creating a IDB ObjectId and Filesystem Object
|
||||
''' </summary>
|
||||
''' <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>
|
||||
''' <exception cref="FileNotFoundException">When local filepath was not found</exception>
|
||||
''' <exception cref="ApplicationException">When there was a error in the Service</exception>
|
||||
''' <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
|
||||
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
|
||||
Logger.Error(ex)
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
<xs:complexType name="ImportFileRequest">
|
||||
<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 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 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="ProfileId" type="xs:int" />
|
||||
<xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" />
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages" />
|
||||
<xs:complexType name="NewFileRequest">
|
||||
<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 minOccurs="0" name="IDBDoctypeId" type="xs:long" />
|
||||
<xs:element minOccurs="0" name="KindType" 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" />
|
||||
|
||||
@ -1127,10 +1127,10 @@ Namespace EDMIServiceReference
|
||||
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private BusinessEntityField As String
|
||||
Private FileField As EDMIServiceReference.FileProperties
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private FileField As EDMIServiceReference.FileProperties
|
||||
Private IDBDoctypeIdField As Long
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private KindTypeField As String
|
||||
@ -1151,19 +1151,6 @@ Namespace EDMIServiceReference
|
||||
End Set
|
||||
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()> _
|
||||
Public Property File() As EDMIServiceReference.FileProperties
|
||||
Get
|
||||
@ -1177,6 +1164,19 @@ Namespace EDMIServiceReference
|
||||
End Set
|
||||
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()> _
|
||||
Public Property KindType() As String
|
||||
Get
|
||||
@ -1993,10 +1993,10 @@ Namespace EDMIServiceReference
|
||||
Private AttributeValuesField() As EDMIServiceReference.UserAttributeValue
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private BusinessEntityField As String
|
||||
Private FileField As EDMIServiceReference.FileProperties
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private FileField As EDMIServiceReference.FileProperties
|
||||
Private IDBDoctypeIdField As String
|
||||
|
||||
<System.Runtime.Serialization.OptionalFieldAttribute()> _
|
||||
Private KindTypeField As String
|
||||
@ -2033,19 +2033,6 @@ Namespace EDMIServiceReference
|
||||
End Set
|
||||
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()> _
|
||||
Public Property File() As EDMIServiceReference.FileProperties
|
||||
Get
|
||||
@ -2059,6 +2046,19 @@ Namespace EDMIServiceReference
|
||||
End Set
|
||||
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()> _
|
||||
Public Property KindType() As String
|
||||
Get
|
||||
|
||||
@ -17,7 +17,7 @@ Namespace Modules.Globix
|
||||
pAttributeValues As List(Of UserAttributeValue),
|
||||
pObjectStoreName As String,
|
||||
pObjectKind As String,
|
||||
pBusinessEntity As String,
|
||||
pIDBDoctypeId As Long,
|
||||
pImportOptions As Options.ImportFileOptions) As Task(Of ImportFileResponse)
|
||||
Try
|
||||
' Set default options
|
||||
@ -45,7 +45,7 @@ Namespace Modules.Globix
|
||||
Dim oContents = oMemoryStream.ToArray()
|
||||
|
||||
Dim oFileImportResponse = Await Channel.ImportFileAsync(New ImportFileRequest With {
|
||||
.BusinessEntity = pBusinessEntity,
|
||||
.IDBDoctypeId = pIDBDoctypeId,
|
||||
.File = New FileProperties With {
|
||||
.FileName = oFileInfo.Name,
|
||||
.FileCreatedAt = oFileCreatedAt,
|
||||
|
||||
@ -10,7 +10,7 @@ Namespace Modules.IDB
|
||||
MyBase.New(pLogConfig, pChannel)
|
||||
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
|
||||
' Set default options
|
||||
If pOptions Is Nothing Then
|
||||
@ -25,7 +25,7 @@ Namespace Modules.IDB
|
||||
' Importing the file now
|
||||
Dim oFileProperties = Helpers.GetFileProperties(pFilePath, pOptions.DateImported)
|
||||
Dim oFileImportResponse = Await Channel.NewFileAsync(New NewFileRequest With {
|
||||
.BusinessEntity = pBusinessEntity,
|
||||
.IDBDoctypeId = pIDBDoctypeId,
|
||||
.File = oFileProperties,
|
||||
.KindType = pObjectKind,
|
||||
.StoreName = pObjectStoreName,
|
||||
|
||||
@ -113,10 +113,10 @@ Namespace IDB
|
||||
End Try
|
||||
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
|
||||
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"
|
||||
Dim oObjectId As Long = Database.GetScalarValueWithConnectionObject(oNewObjectIdSQL,
|
||||
pConnection,
|
||||
|
||||
@ -64,7 +64,7 @@ Namespace Methods.GlobalIndexer.ImportFile
|
||||
Dim oNewFile As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
|
||||
Dim oResponse = oNewFile.Run(New NewFile.NewFileRequest With {
|
||||
.File = pData.File,
|
||||
.BusinessEntity = pData.BusinessEntity,
|
||||
.IDBDoctypeId = pData.IDBDoctypeId,
|
||||
.KindType = pData.KindType,
|
||||
.StoreName = pData.StoreName,
|
||||
.User = User
|
||||
|
||||
@ -19,10 +19,10 @@ Namespace Methods.GlobalIndexer.ImportFile
|
||||
Public Property ProfileId As Integer
|
||||
|
||||
''' <summary>
|
||||
''' The business entity of the file, ex DEFAULT
|
||||
''' The Document Type of the file, ex. IncomingInvoice
|
||||
''' </summary>
|
||||
<DataMember>
|
||||
Public Property BusinessEntity As String
|
||||
Public Property IDBDoctypeId As String
|
||||
|
||||
''' <summary>
|
||||
''' The kind of object to be created, ex. DOC
|
||||
|
||||
@ -28,7 +28,7 @@ Namespace Methods.IDB.NewFile
|
||||
|
||||
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
|
||||
LogAndThrow("Could not create new ObjectId!")
|
||||
End If
|
||||
|
||||
@ -18,7 +18,7 @@ Namespace Methods.IDB.NewFile
|
||||
''' The business entity of the file, ex DEFAULT
|
||||
''' </summary>
|
||||
<DataMember>
|
||||
Public Property BusinessEntity As String
|
||||
Public Property IDBDoctypeId As Long
|
||||
|
||||
''' <summary>
|
||||
''' The kind of object to be created, ex. DOC
|
||||
|
||||
@ -83,7 +83,7 @@ Namespace Methods.IDB.UpdateFile
|
||||
Dim oNewFileMethod As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
|
||||
Dim oNewFileRequest As New NewFile.NewFileRequest With {
|
||||
.File = pData.File,
|
||||
.BusinessEntity = oBusinessEntity,
|
||||
.IDBDoctypeId = oBusinessEntity,
|
||||
.KindType = oKind,
|
||||
.StoreName = oStore,
|
||||
.User = pData.User
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user