File Container, Prepare Import for Marvman

This commit is contained in:
Jonathan Jenne
2019-03-01 15:52:00 +01:00
parent cfbcd8a8f2
commit 6f0164d010
24 changed files with 496 additions and 306 deletions

3
EDMI_FILE_OPs/Channel.vb Normal file
View File

@@ -0,0 +1,3 @@
Public Class Channel
End Class

View File

@@ -5,6 +5,6 @@
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="ContainerResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
<GenericObjectDataSource DisplayName="DocumentResult" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="FileContainerInner">
<xs:complexType name="DocumentObject">
<xs:sequence>
<xs:element name="Contents" nillable="true" type="xs:base64Binary" />
<xs:element name="CreatedAt" type="xs:dateTime" />
<xs:element name="Extension" nillable="true" type="xs:string" />
<xs:element name="FileId" nillable="true" type="xs:string" />
<xs:element name="UpdatedAt" type="xs:dateTime" />
<xs:element name="_ContainerId" nillable="true" type="xs:string" />
<xs:element name="_DocumentId" type="xs:long" />
<xs:element name="_FileName" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:element name="FileContainerInner" nillable="true" type="tns:FileContainerInner" />
<xs:element name="DocumentObject" nillable="true" type="tns:DocumentObject" />
</xs:schema>

View File

@@ -70,6 +70,12 @@
<wsdl:message name="IEDMService_DeleteFile_OutputMessage">
<wsdl:part name="parameters" element="tns:DeleteFileResponse" />
</wsdl:message>
<wsdl:message name="IEDMService_SetFileIndex_InputMessage">
<wsdl:part name="parameters" element="tns:SetFileIndex" />
</wsdl:message>
<wsdl:message name="IEDMService_SetFileIndex_OutputMessage">
<wsdl:part name="parameters" element="tns:SetFileIndexResponse" />
</wsdl:message>
<wsdl:portType name="IEDMService">
<wsdl:operation name="Heartbeat">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/Heartbeat" message="tns:IEDMService_Heartbeat_InputMessage" />
@@ -111,5 +117,9 @@
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/DeleteFile" message="tns:IEDMService_DeleteFile_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/DeleteFileResponse" message="tns:IEDMService_DeleteFile_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="SetFileIndex">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/SetFileIndex" message="tns:IEDMService_SetFileIndex_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMService/IEDMService/SetFileIndexResponse" message="tns:IEDMService_SetFileIndex_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://DigitalData.Services.EDMService" elementFormDefault="qualified" targetNamespace="http://DigitalData.Services.EDMService" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" />
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" />
<xs:element name="Heartbeat">
<xs:complexType>
<xs:sequence />
@@ -83,22 +84,22 @@
<xs:element name="CreateFile">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="FileName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Contents" nillable="true" type="xs:base64Binary" />
<xs:element minOccurs="0" name="Extension" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateFileResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="CreateFileResult" nillable="true" type="xs:string" />
<xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="CreateFileResult" nillable="true" type="q4:DocumentResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UpdateFile">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ContainerId" nillable="true" type="xs:string" />
<xs:element xmlns:q5="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q5:DocumentObject" />
<xs:element minOccurs="0" name="Contents" nillable="true" type="xs:base64Binary" />
</xs:sequence>
</xs:complexType>
@@ -106,28 +107,28 @@
<xs:element name="UpdateFileResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="UpdateFileResult" nillable="true" type="xs:string" />
<xs:element xmlns:q6="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="UpdateFileResult" nillable="true" type="q6:DocumentResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetFile">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ContainerId" nillable="true" type="xs:string" />
<xs:element xmlns:q7="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q7:DocumentObject" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="GetFileResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q4="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="GetFileResult" nillable="true" type="q4:ContainerResult" />
<xs:element xmlns:q8="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService" minOccurs="0" name="GetFileResult" nillable="true" type="q8:DocumentResult" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DeleteFile">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="ContainerId" nillable="true" type="xs:string" />
<xs:element xmlns:q9="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q9:DocumentObject" />
</xs:sequence>
</xs:complexType>
</xs:element>
@@ -138,4 +139,20 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SetFileIndex">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q10="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" minOccurs="0" name="DocObject" nillable="true" type="q10:DocumentObject" />
<xs:element minOccurs="0" name="Syskey" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Value" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SetFileIndexResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="SetFileIndexResult" nillable="true" type="xs:anyType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -37,12 +37,14 @@
</xs:sequence>
</xs:complexType>
<xs:element name="NonQueryResult" nillable="true" type="tns:NonQueryResult" />
<xs:complexType name="ContainerResult">
<xs:complexType name="DocumentResult">
<xs:sequence>
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" name="Container" nillable="true" type="q1:FileContainerInner" />
<xs:element name="Contents" nillable="true" type="xs:base64Binary" />
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem" name="Document" nillable="true" type="q1:DocumentObject" />
<xs:element name="ErrorMessage" nillable="true" type="xs:string" />
<xs:element name="HasContents" type="xs:boolean" />
<xs:element name="OK" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
<xs:element name="ContainerResult" nillable="true" type="tns:ContainerResult" />
<xs:element name="DocumentResult" nillable="true" type="tns:DocumentResult" />
</xs:schema>

View File

@@ -101,9 +101,9 @@ Namespace EDMIServiceReference
System.SerializableAttribute(), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.TableResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.ContainerResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(System.DBNull)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.FileContainerInner))> _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _
Partial Public Class ScalarResult
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
@@ -244,19 +244,23 @@ Namespace EDMIServiceReference
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="ContainerResult", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService"), _
System.Runtime.Serialization.DataContractAttribute(Name:="DocumentResult", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMService"), _
System.SerializableAttribute()> _
Partial Public Class ContainerResult
Partial Public Class DocumentResult
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
Private ContainerField As EDMIServiceReference.FileContainerInner
Private ContentsField() As Byte
Private DocumentField As EDMIServiceReference.DocumentObject
Private ErrorMessageField As String
Private HasContentsField As Boolean
Private OKField As Boolean
<Global.System.ComponentModel.BrowsableAttribute(false)> _
@@ -270,14 +274,27 @@ Namespace EDMIServiceReference
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property Container() As EDMIServiceReference.FileContainerInner
Public Property Contents() As Byte()
Get
Return Me.ContainerField
Return Me.ContentsField
End Get
Set
If (Object.ReferenceEquals(Me.ContainerField, value) <> true) Then
Me.ContainerField = value
Me.RaisePropertyChanged("Container")
If (Object.ReferenceEquals(Me.ContentsField, value) <> true) Then
Me.ContentsField = value
Me.RaisePropertyChanged("Contents")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property Document() As EDMIServiceReference.DocumentObject
Get
Return Me.DocumentField
End Get
Set
If (Object.ReferenceEquals(Me.DocumentField, value) <> true) Then
Me.DocumentField = value
Me.RaisePropertyChanged("Document")
End If
End Set
End Property
@@ -295,6 +312,19 @@ Namespace EDMIServiceReference
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property HasContents() As Boolean
Get
Return Me.HasContentsField
End Get
Set
If (Me.HasContentsField.Equals(value) <> true) Then
Me.HasContentsField = value
Me.RaisePropertyChanged("HasContents")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property OK() As Boolean
Get
@@ -320,24 +350,20 @@ Namespace EDMIServiceReference
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="FileContainerInner", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem"), _
System.Runtime.Serialization.DataContractAttribute(Name:="DocumentObject", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Modules.Filesystem"), _
System.SerializableAttribute()> _
Partial Public Class FileContainerInner
Partial Public Class DocumentObject
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
Private ContentsField() As Byte
Private _ContainerIdField As String
Private CreatedAtField As Date
Private _DocumentIdField As Long
Private ExtensionField As String
Private FileIdField As String
Private UpdatedAtField As Date
Private _FileNameField As String
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
@@ -350,66 +376,40 @@ Namespace EDMIServiceReference
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property Contents() As Byte()
Public Property _ContainerId() As String
Get
Return Me.ContentsField
Return Me._ContainerIdField
End Get
Set
If (Object.ReferenceEquals(Me.ContentsField, value) <> true) Then
Me.ContentsField = value
Me.RaisePropertyChanged("Contents")
If (Object.ReferenceEquals(Me._ContainerIdField, value) <> true) Then
Me._ContainerIdField = value
Me.RaisePropertyChanged("_ContainerId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property CreatedAt() As Date
Public Property _DocumentId() As Long
Get
Return Me.CreatedAtField
Return Me._DocumentIdField
End Get
Set
If (Me.CreatedAtField.Equals(value) <> true) Then
Me.CreatedAtField = value
Me.RaisePropertyChanged("CreatedAt")
If (Me._DocumentIdField.Equals(value) <> true) Then
Me._DocumentIdField = value
Me.RaisePropertyChanged("_DocumentId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property Extension() As String
Public Property _FileName() As String
Get
Return Me.ExtensionField
Return Me._FileNameField
End Get
Set
If (Object.ReferenceEquals(Me.ExtensionField, value) <> true) Then
Me.ExtensionField = value
Me.RaisePropertyChanged("Extension")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property FileId() As String
Get
Return Me.FileIdField
End Get
Set
If (Object.ReferenceEquals(Me.FileIdField, value) <> true) Then
Me.FileIdField = value
Me.RaisePropertyChanged("FileId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute(IsRequired:=true)> _
Public Property UpdatedAt() As Date
Get
Return Me.UpdatedAtField
End Get
Set
If (Me.UpdatedAtField.Equals(value) <> true) Then
Me.UpdatedAtField = value
Me.RaisePropertyChanged("UpdatedAt")
If (Object.ReferenceEquals(Me._FileNameField, value) <> true) Then
Me._FileNameField = value
Me.RaisePropertyChanged("_FileName")
End If
End Set
End Property
@@ -465,28 +465,40 @@ Namespace EDMIServiceReference
Function ExecuteNonQueryAsync(ByVal SQL As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.NonQueryResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/CreateFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/CreateFileResponse")> _
Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String
Function CreateFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/CreateFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/CreateFileResponse")> _
Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String)
Function CreateFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/UpdateFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/UpdateFileResponse")> _
Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String
Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/UpdateFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/UpdateFileResponse")> _
Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String)
Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetFileResponse")> _
Function GetFile(ByVal ContainerId As String) As EDMIServiceReference.ContainerResult
Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/GetFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/GetFileResponse")> _
Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ContainerResult)
Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/DeleteFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/DeleteFileResponse")> _
Function DeleteFile(ByVal ContainerId As String) As Boolean
Function DeleteFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As Boolean
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/DeleteFile", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/DeleteFileResponse")> _
Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean)
Function DeleteFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/SetFileIndex", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/SetFileIndexResponse"), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(EDMIServiceReference.TableResult)), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(EDMIServiceReference.ScalarResult)), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(EDMIServiceReference.DocumentResult)), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(System.DBNull)), _
System.ServiceModel.ServiceKnownTypeAttribute(GetType(EDMIServiceReference.DocumentObject))> _
Function SetFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As Object
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMService/IEDMService/SetFileIndex", ReplyAction:="http://DigitalData.Services.EDMService/IEDMService/SetFileIndexResponse")> _
Function SetFileIndexAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As System.Threading.Tasks.Task(Of Object)
End Interface
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")> _
@@ -568,36 +580,44 @@ Namespace EDMIServiceReference
Return MyBase.Channel.ExecuteNonQueryAsync(SQL)
End Function
Public Function CreateFile(ByVal Contents() As Byte, ByVal Extension As String) As String Implements EDMIServiceReference.IEDMService.CreateFile
Return MyBase.Channel.CreateFile(Contents, Extension)
Public Function CreateFile(ByVal FileName As String, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.CreateFile
Return MyBase.Channel.CreateFile(FileName, Contents)
End Function
Public Function CreateFileAsync(ByVal Contents() As Byte, ByVal Extension As String) As System.Threading.Tasks.Task(Of String) Implements EDMIServiceReference.IEDMService.CreateFileAsync
Return MyBase.Channel.CreateFileAsync(Contents, Extension)
Public Function CreateFileAsync(ByVal FileName As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.CreateFileAsync
Return MyBase.Channel.CreateFileAsync(FileName, Contents)
End Function
Public Function UpdateFile(ByVal ContainerId As String, ByVal Contents() As Byte) As String Implements EDMIServiceReference.IEDMService.UpdateFile
Return MyBase.Channel.UpdateFile(ContainerId, Contents)
Public Function UpdateFile(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.UpdateFile
Return MyBase.Channel.UpdateFile(DocObject, Contents)
End Function
Public Function UpdateFileAsync(ByVal ContainerId As String, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of String) Implements EDMIServiceReference.IEDMService.UpdateFileAsync
Return MyBase.Channel.UpdateFileAsync(ContainerId, Contents)
Public Function UpdateFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Contents() As Byte) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.UpdateFileAsync
Return MyBase.Channel.UpdateFileAsync(DocObject, Contents)
End Function
Public Function GetFile(ByVal ContainerId As String) As EDMIServiceReference.ContainerResult Implements EDMIServiceReference.IEDMService.GetFile
Return MyBase.Channel.GetFile(ContainerId)
Public Function GetFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As EDMIServiceReference.DocumentResult Implements EDMIServiceReference.IEDMService.GetFile
Return MyBase.Channel.GetFile(DocObject)
End Function
Public Function GetFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of EDMIServiceReference.ContainerResult) Implements EDMIServiceReference.IEDMService.GetFileAsync
Return MyBase.Channel.GetFileAsync(ContainerId)
Public Function GetFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of EDMIServiceReference.DocumentResult) Implements EDMIServiceReference.IEDMService.GetFileAsync
Return MyBase.Channel.GetFileAsync(DocObject)
End Function
Public Function DeleteFile(ByVal ContainerId As String) As Boolean Implements EDMIServiceReference.IEDMService.DeleteFile
Return MyBase.Channel.DeleteFile(ContainerId)
Public Function DeleteFile(ByVal DocObject As EDMIServiceReference.DocumentObject) As Boolean Implements EDMIServiceReference.IEDMService.DeleteFile
Return MyBase.Channel.DeleteFile(DocObject)
End Function
Public Function DeleteFileAsync(ByVal ContainerId As String) As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMService.DeleteFileAsync
Return MyBase.Channel.DeleteFileAsync(ContainerId)
Public Function DeleteFileAsync(ByVal DocObject As EDMIServiceReference.DocumentObject) As System.Threading.Tasks.Task(Of Boolean) Implements EDMIServiceReference.IEDMService.DeleteFileAsync
Return MyBase.Channel.DeleteFileAsync(DocObject)
End Function
Public Function SetFileIndex(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As Object Implements EDMIServiceReference.IEDMService.SetFileIndex
Return MyBase.Channel.SetFileIndex(DocObject, Syskey, Value)
End Function
Public Function SetFileIndexAsync(ByVal DocObject As EDMIServiceReference.DocumentObject, ByVal Syskey As String, ByVal Value As String) As System.Threading.Tasks.Task(Of Object) Implements EDMIServiceReference.IEDMService.SetFileIndexAsync
Return MyBase.Channel.SetFileIndexAsync(DocObject, Syskey, Value)
End Function
End Class
End Namespace

View File

@@ -129,6 +129,15 @@
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetFileIndex">
<soap12:operation soapAction="http://DigitalData.Services.EDMService/IEDMService/SetFileIndex" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="EDMService">
<wsdl:port name="tcpBinding" binding="tns:tcpBinding">

144
EDMI_FILE_OPs/Document.vb Normal file
View File

@@ -0,0 +1,144 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference
Imports System.ServiceModel
Imports System.IO
Public Class Document
Private _logger As Logger
Private _logConfig As LogConfig
Private _channelFactory As ChannelFactory(Of IEDMServiceChannel)
Private _channel As IEDMServiceChannel
Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String)
_logger = LogConfig.GetLogger()
_logConfig = LogConfig
Try
Dim binding As New NetTcpBinding()
binding.Security.Mode = SecurityMode.Transport
binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows
binding.MaxReceivedMessageSize = 2147483647
binding.MaxBufferSize = 2147483647
binding.MaxBufferPoolSize = 2147483647
binding.MaxConnections = 10000
binding.ReaderQuotas.MaxArrayLength = 2147483647
binding.ReaderQuotas.MaxStringContentLength = 2147483647
Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress)
Connect2NetService()
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Private Function Connect2NetService()
Try
_channel = Nothing
_channel = _channelFactory.CreateChannel()
_logger.Info("Successfully connected to EDM_Network Service")
AddHandler _channel.Faulted, AddressOf Reconnect
_channel.Open()
Return True
Catch ex As Exception
_logger.Error(ex)
Return True
End Try
End Function
Private Sub Reconnect()
_channel.Abort()
Connect2NetService()
End Sub
''' <summary>
''' Imports a file by filename
''' </summary>
''' <param name="FilePath">The filename to import</param>
''' <returns>A document object</returns>
Public Async Function ImportFileAsync(FilePath As String) As Task(Of DocumentResult)
Try
Return Await CreateDocument(FilePath)
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Public Async Function SetFileIndex(DocObject As DocumentObject, Syskey As String, Value As String) As Task
Try
Dim oResult As DocumentResult = _channel
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
Private Async Function CreateDocument(FilePath As String) As Task(Of DocumentResult)
Try
Dim oContents As Byte() = File.ReadAllBytes(FilePath)
Dim oInfo As New FileInfo(FilePath)
Dim oName As String = oInfo.Name
Dim oExtension As String = oInfo.Extension.Substring(1)
Dim oDocObject = Await _channel.CreateFileAsync(oName, oContents)
Return oDocObject
Catch ex As Exception
_logger.Error(ex)
Throw ex
End Try
End Function
'Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String)
' Try
' Dim oFileGUID As DocumentResult = Await CreateDocument(oFILENAME)
' Dim oFileRecordID = Nothing
' If Not IsNothing(oFileGUID) Then
' Dim oSQL = $"SELECT FNEDMI_SET_RECORD(""TBEDMI_ADRESSE"",""{oUserName}"",FALSE,NULL,"""",'{oFileGUID._ContainerId}') FROM rdb$database;"
' oFileRecordID = Await New_EDMIFile_CreateDB_Record(oSQL)
' End If
' Return oFileRecordID
' Catch ex As Exception
' _logger.Error(ex)
' Return Nothing
' End Try
'End Function
'Private Async Function New_EDMIFile_CreateDB_Record(FBCommand As String) As Task(Of String)
' Try
' Dim oTimeTotal As TimeSpan
' Dim oStopwatch As New Stopwatch()
' oStopwatch.Start()
' Dim oRecord_ID As String
' Dim oRequestName = Await _channel.CreateDatabaseRequestAsync("CreateEDMFileRecord", True)
' Dim oResult = Await _channel.ReturnScalarAsync(FBCommand)
' oTimeTotal = oStopwatch.Elapsed
' oStopwatch.Reset()
' Await _channel.CloseDatabaseRequestAsync()
' If Not oResult.OK Then
' _logger.Warn($"Unexpected error while executing command: {oResult.ErrorMessage}")
' Else
' oRecord_ID = oResult.Scalar
' _logger.Debug($"SCALAR (SERVICE) {FBCommand} - TIME: {(oTimeTotal.ToString)}")
' End If
' Return oRecord_ID
' Catch ex As Exception
' _logger.Error(ex)
' Return Nothing
' End Try
'End Function
Public Async Function Load_EDMIFile_2TempPath(oEDMIFile_GUID As String) As Task(Of String)
'Try
' Dim oResult As EDMIServiceReference.ContainerResult = Await _channel.GetFileAsync(oEDMIFile_GUID)
' Dim oTempPath = Path.Combine(Path.GetTempPath(), "EDMI_FileContainer")
' Directory.CreateDirectory(oTempPath)
' Dim oFilePath = Path.Combine(oTempPath, $"{oResult.Container.FileId}.{oResult.Container.Extension}")
' File.WriteAllBytes(oFilePath, oResult.Container.Contents)
' ' Process.Start(oTempPath)
' Return oTempPath
'Catch ex As Exception
' _logger.Error(ex)
' Return Nothing
'End Try
End Function
End Class

View File

@@ -72,12 +72,13 @@
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="Channel.vb" />
<Compile Include="Connected Services\EDMIServiceReference\Reference.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="FileOp.vb" />
<Compile Include="Document.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
@@ -104,7 +105,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.ContainerResult.datasource">
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.DocumentResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMIFileOps.EDMIServiceReference.NonQueryResult.datasource">

View File

@@ -1,120 +0,0 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.EDMIFileOps.EDMIServiceReference
Imports System.ServiceModel
Imports System.IO
Public Class FileOp
Private _logger As Logger
Private _logConfig As LogConfig
Private _channelFactory As ChannelFactory(Of IEDMServiceChannel)
Private _channel As IEDMServiceChannel
Public Sub New(LogConfig As LogConfig, EDMI_ServiceAdress As String)
_logger = LogConfig.GetLogger()
_logConfig = LogConfig
Try
Dim binding As New NetTcpBinding()
binding.Security.Mode = SecurityMode.Transport
binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows
binding.MaxReceivedMessageSize = 2147483647
binding.MaxBufferSize = 2147483647
binding.MaxBufferPoolSize = 2147483647
binding.MaxConnections = 10000
binding.ReaderQuotas.MaxArrayLength = 2147483647
binding.ReaderQuotas.MaxStringContentLength = 2147483647
Dim endpointAddress = New EndpointAddress(EDMI_ServiceAdress)
_channelFactory = New ChannelFactory(Of IEDMServiceChannel)(binding, endpointAddress)
Connect2NetService()
Catch ex As Exception
_logger.Error(ex)
End Try
End Sub
Private Function Connect2NetService()
Try
_channel = Nothing
_channel = _channelFactory.CreateChannel()
_logger.Info("Successfully connected to EDM_Network Service")
AddHandler _channel.Faulted, AddressOf Reconnect
_channel.Open()
Return True
Catch ex As Exception
_logger.Error(ex)
Return True
End Try
End Function
Private Sub Reconnect()
_channel.Abort()
Connect2NetService()
End Sub
Public Async Function New_EDMI_File(oFILENAME As String, oUserName As String) As Task(Of String)
Try
Dim oFileGUID = Await New_EDMIFile_CreateContainer(oFILENAME)
Dim oFileRecordID = Nothing
If Not IsNothing(oFileGUID) Then
Dim oSQL = $"SELECT FNEDMI_SET_RECORD(""TBEDMI_ADRESSE"",""{oUserName}"",FALSE,NULL,"""",'{oFileGUID}') FROM rdb$database;"
oFileRecordID = Await New_EDMIFile_CreateDB_Record(oSQL)
End If
Return oFileRecordID
Catch ex As Exception
_logger.Error(ex)
Return Nothing
End Try
End Function
Private Async Function New_EDMIFile_CreateContainer(oFILENAME As String) As Task(Of String)
Try
Dim sw As New Stopwatch()
sw.Start()
Dim oFileContents = File.ReadAllBytes(oFILENAME)
Dim oExtension As String = New FileInfo(oFILENAME).Extension.Substring(1)
Dim oFileGUID = Await _channel.CreateFileAsync(oFileContents, oExtension)
sw.Stop()
_logger.Info($"File successfully transferred - stopwatch: {sw.Elapsed.ToString}")
Return oFileGUID
Catch ex As Exception
_logger.Error(ex)
Return Nothing
End Try
End Function
Private Async Function New_EDMIFile_CreateDB_Record(FBCommand As String) As Task(Of String)
Try
Dim oTimeTotal As TimeSpan
Dim oStopwatch As New Stopwatch()
oStopwatch.Start()
Dim oRecord_ID As String
Dim oRequestName = Await _channel.CreateDatabaseRequestAsync("CreateEDMFileRecord", True)
Dim oResult = Await _channel.ReturnScalarAsync(FBCommand)
oTimeTotal = oStopwatch.Elapsed
oStopwatch.Reset()
Await _channel.CloseDatabaseRequestAsync()
If Not oResult.OK Then
_logger.Warn($"Unexpected error while executing command: {oResult.ErrorMessage}")
Else
oRecord_ID = oResult.Scalar
_logger.Debug($"SCALAR (SERVICE) {FBCommand} - TIME: {(oTimeTotal.ToString)}")
End If
Return oRecord_ID
Catch ex As Exception
_logger.Error(ex)
Return Nothing
End Try
End Function
Public Async Function Load_EDMIFile_2TempPath(oEDMIFile_GUID As String) As Task(Of String)
Try
Dim oResult As EDMIServiceReference.ContainerResult = Await _channel.GetFileAsync(oEDMIFile_GUID)
Dim oTempPath = Path.Combine(Path.GetTempPath(), "EDMI_FileContainer")
Directory.CreateDirectory(oTempPath)
Dim oFilePath = Path.Combine(oTempPath, $"{oResult.Container.FileId}.{oResult.Container.Extension}")
File.WriteAllBytes(oFilePath, oResult.Container.Contents)
' Process.Start(oTempPath)
Return oTempPath
Catch ex As Exception
_logger.Error(ex)
Return Nothing
End Try
End Function
End Class