EDMI: Client Server Changes to prepare for initial Release

This commit is contained in:
Jonathan Jenne 2021-11-30 16:09:51 +01:00
parent 706d6b0cef
commit 61a15d472b
23 changed files with 426 additions and 32 deletions

View File

@ -96,20 +96,23 @@ Public Class frmtest
End Sub
Private Async Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
Dim oResult As Long = Await My.Application.Service.Client.NewFileAsync(
Dim oObjectId As Long = Await My.Application.Service.Client.NewFileAsync(
txtFile2Import.Text,
"WORK",
"DOC",
"DEFAULT",
New NewFileOptions With {
.KeepExtension = CheckBoxKeepExtension.Checked,
.Username = Environment.UserName,
.DateImported = DateTimePicker1.Value
}
)
txtIDB_OBJ_ID.Text = oResult
MsgBox("File Imported!")
If oObjectId <> INVALID_OBEJCT_ID Then
MsgBox("File Imported!", MsgBoxStyle.Information, Text)
Else
MsgBox("File was not imported. Check the server logs!")
End If
txtIDB_OBJ_ID.Text = oObjectId
End Sub
Private Sub frmtest_Load(sender As Object, e As EventArgs) Handles MyBase.Load

View File

@ -627,10 +627,6 @@ Public Class Client
''' Import options for NewFileAsync.
''' </summary>
Public Class NewFileOptions
''' <summary>
''' Option to keep the original extension when importing. Defaults to false.
''' </summary>
Public Property KeepExtension As Boolean = False
''' <summary>
''' Windows username of the user responsible for the import. Defaults to the currently logged in user.
''' </summary>
@ -705,7 +701,7 @@ Public Class Client
#End Region
Private Class ObjectAttribute
Public Class ObjectAttribute
Public Property Id As Long
Public Property Title As String
Public Property Type As String

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is automatically generated by Visual Studio .Net. It is
used to store generic object data source configuration information.
Renaming the file extension or editing the content of this file may
cause the file to be unrecognizable by the program.
-->
<GenericObjectDataSource DisplayName="SetAttributeValueResponse" Version="1.0" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<TypeInfo>DigitalData.Modules.EDMI.API.EDMIServiceReference.SetAttributeValueResponse, Connected Services.EDMIServiceReference.Reference.vb.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</TypeInfo>
</GenericObjectDataSource>

View File

@ -11,6 +11,7 @@
<xs:element minOccurs="0" name="FileImportedAt" type="xs:dateTime" />
<xs:element minOccurs="0" name="FileName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="KindType" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Language" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="StoreName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="Who" nillable="true" type="xs:string" />
</xs:sequence>

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages" />
<xs:complexType name="SetAttributeValueRequest">
<xs:sequence>
<xs:element minOccurs="0" name="AttributeName" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="AttributeValue" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ObjectId" type="xs:long" />
<xs:element minOccurs="0" name="Who" type="xs:long" />
</xs:sequence>
</xs:complexType>
<xs:element name="SetAttributeValueRequest" nillable="true" type="tns:SetAttributeValueRequest" />
<xs:complexType name="SetAttributeValueResponse">
<xs:complexContent mixed="false">
<xs:extension xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages" base="q1:BaseResponse">
<xs:sequence>
<xs:element minOccurs="0" name="ObjectId" type="xs:long" />
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="SetAttributeValueResponse" nillable="true" type="tns:SetAttributeValueResponse" />
</xs:schema>

View File

@ -25,6 +25,7 @@
<xs:element name="TableResult" nillable="true" type="tns:TableResult" />
<xs:complexType name="BaseResponse">
<xs:sequence>
<xs:element minOccurs="0" name="ErrorDetails" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ErrorMessage" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="OK" type="xs:boolean" />
</xs:sequence>

View File

@ -9,6 +9,7 @@
<xsd:import namespace="http://schemas.datacontract.org/2004/07/System" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/System.Data" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.NewFile" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" />
<xsd:import namespace="http://schemas.microsoft.com/Message" />
<xsd:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Modules.EDMI.API" />
</xsd:schema>
@ -118,6 +119,12 @@
<wsdl:message name="IEDMIService_NewFile_OutputMessage">
<wsdl:part name="parameters" element="tns:NewFileResponse" />
</wsdl:message>
<wsdl:message name="IEDMIService_SetAttributeValue_InputMessage">
<wsdl:part name="parameters" element="tns:SetAttributeValue" />
</wsdl:message>
<wsdl:message name="IEDMIService_SetAttributeValue_OutputMessage">
<wsdl:part name="parameters" element="tns:SetAttributeValueResponse" />
</wsdl:message>
<wsdl:message name="DocumentStreamRequest">
<wsdl:part name="parameters" element="tns:DocumentStreamRequest" />
</wsdl:message>
@ -218,6 +225,10 @@
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/NewFile" message="tns:IEDMIService_NewFile_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/NewFileResponse" message="tns:IEDMIService_NewFile_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="SetAttributeValue">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValue" message="tns:IEDMIService_SetAttributeValue_InputMessage" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValueResponse" message="tns:IEDMIService_SetAttributeValue_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="GetFileByObjectId">
<wsdl:input wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectId" name="DocumentStreamRequest" message="tns:DocumentStreamRequest" />
<wsdl:output wsaw:Action="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectIdResponse" name="DocumentStreamResponse" message="tns:DocumentStreamResponse" />

View File

@ -2,6 +2,7 @@
<xs:schema xmlns:tns="http://DigitalData.Services.EDMIService" elementFormDefault="qualified" targetNamespace="http://DigitalData.Services.EDMIService" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<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.FileStorage.NewFile" />
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" />
<xs:import namespace="http://schemas.microsoft.com/Message" />
<xs:import namespace="http://schemas.datacontract.org/2004/07/DigitalData.Modules.EDMI.API" />
<xs:element name="Heartbeat">
@ -172,6 +173,20 @@
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SetAttributeValue">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q13="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" minOccurs="0" name="Data" nillable="true" type="q13:SetAttributeValueRequest" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SetAttributeValueResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q14="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStorage.SetAttributeValue" minOccurs="0" name="SetAttributeValueResult" nillable="true" type="q14:SetAttributeValueResponse" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DocumentStreamRequest">
<xs:complexType>
<xs:sequence>
@ -182,7 +197,7 @@
<xs:element name="DocumentStreamResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q13="http://schemas.microsoft.com/Message" name="FileContents" type="q13:StreamBody" />
<xs:element xmlns:q15="http://schemas.microsoft.com/Message" name="FileContents" type="q15:StreamBody" />
</xs:sequence>
</xs:complexType>
</xs:element>
@ -198,7 +213,7 @@
<xs:element name="DocumentInfoResponse">
<xs:complexType>
<xs:sequence>
<xs:element xmlns:q14="http://schemas.datacontract.org/2004/07/DigitalData.Modules.EDMI.API" minOccurs="0" name="FileRight" type="q14:Rights.AccessRight" />
<xs:element xmlns:q16="http://schemas.datacontract.org/2004/07/DigitalData.Modules.EDMI.API" minOccurs="0" name="FileRight" type="q16:Rights.AccessRight" />
<xs:element minOccurs="0" name="FullPath" nillable="true" type="xs:string" />
</xs:sequence>
</xs:complexType>

View File

@ -31,6 +31,7 @@
<MetadataFile FileName="System.Data.xsd" MetadataType="Schema" ID="6c7bdb47-eea4-4d03-bc52-9747c865bbf0" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
<MetadataFile FileName="DigitalData.Services.EDMIService.Exceptions.xsd" MetadataType="Schema" ID="57cf2e83-7c36-485a-90c3-0bc4a1748882" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
<MetadataFile FileName="DigitalData.Services.EDMIService.FileStorage.NewFile.xsd" MetadataType="Schema" ID="bbb83dae-4701-48e2-9c2f-747660d3bd68" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
<MetadataFile FileName="DigitalData.Services.EDMIService.FileStorage.SetAttributeValue.xsd" MetadataType="Schema" ID="ca9178c8-9102-4e7a-81e9-920543646114" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
<MetadataFile FileName="Message.xsd" MetadataType="Schema" ID="2589e82f-d68f-4843-b153-a80edf895f82" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
<MetadataFile FileName="DigitalData.Modules.EDMI.API.xsd" MetadataType="Schema" ID="4eca5a54-795a-4e5b-a3b1-10c24930efec" SourceId="1" SourceUrl="net.tcp://172.24.12.39:9000/DigitalData/Services/Main/mex" />
</Metadata>

View File

@ -24,6 +24,7 @@ Namespace EDMIServiceReference
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.ScalarResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NonQueryResult)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NewFileResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.SetAttributeValueResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.TableResult))> _
Partial Public Class BaseResponse
Inherits Object
@ -32,6 +33,9 @@ Namespace EDMIServiceReference
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ErrorDetailsField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ErrorMessageField As String
@ -48,6 +52,19 @@ Namespace EDMIServiceReference
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ErrorDetails() As String
Get
Return Me.ErrorDetailsField
End Get
Set
If (Object.ReferenceEquals(Me.ErrorDetailsField, value) <> true) Then
Me.ErrorDetailsField = value
Me.RaisePropertyChanged("ErrorDetails")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ErrorMessage() As String
Get
@ -100,6 +117,8 @@ Namespace EDMIServiceReference
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.ObjectDoesNotExistFault)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NewFileRequest)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.NewFileResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.SetAttributeValueRequest)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.SetAttributeValueResponse)), _
System.Runtime.Serialization.KnownTypeAttribute(GetType(EDMIServiceReference.RightsAccessRight))> _
Partial Public Class ScalarResult
Inherits EDMIServiceReference.BaseResponse
@ -155,6 +174,31 @@ Namespace EDMIServiceReference
End Property
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="SetAttributeValueResponse", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStor"& _
"age.SetAttributeValue"), _
System.SerializableAttribute()> _
Partial Public Class SetAttributeValueResponse
Inherits EDMIServiceReference.BaseResponse
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ObjectIdField As Long
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ObjectId() As Long
Get
Return Me.ObjectIdField
End Get
Set
If (Me.ObjectIdField.Equals(value) <> true) Then
Me.ObjectIdField = value
Me.RaisePropertyChanged("ObjectId")
End If
End Set
End Property
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="TableResult", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.Messages"& _
@ -326,6 +370,9 @@ Namespace EDMIServiceReference
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private KindTypeField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private LanguageField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private StoreNameField As String
@ -446,6 +493,19 @@ Namespace EDMIServiceReference
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Language() As String
Get
Return Me.LanguageField
End Get
Set
If (Object.ReferenceEquals(Me.LanguageField, value) <> true) Then
Me.LanguageField = value
Me.RaisePropertyChanged("Language")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property StoreName() As String
Get
@ -482,6 +542,102 @@ Namespace EDMIServiceReference
End Sub
End Class
<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="SetAttributeValueRequest", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Services.EDMIService.FileStor"& _
"age.SetAttributeValue"), _
System.SerializableAttribute()> _
Partial Public Class SetAttributeValueRequest
Inherits Object
Implements System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged
<System.NonSerializedAttribute()> _
Private extensionDataField As System.Runtime.Serialization.ExtensionDataObject
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private AttributeNameField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private AttributeValueField As String
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ObjectIdField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private WhoField As Long
<Global.System.ComponentModel.BrowsableAttribute(false)> _
Public Property ExtensionData() As System.Runtime.Serialization.ExtensionDataObject Implements System.Runtime.Serialization.IExtensibleDataObject.ExtensionData
Get
Return Me.extensionDataField
End Get
Set
Me.extensionDataField = value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property AttributeName() As String
Get
Return Me.AttributeNameField
End Get
Set
If (Object.ReferenceEquals(Me.AttributeNameField, value) <> true) Then
Me.AttributeNameField = value
Me.RaisePropertyChanged("AttributeName")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property AttributeValue() As String
Get
Return Me.AttributeValueField
End Get
Set
If (Object.ReferenceEquals(Me.AttributeValueField, value) <> true) Then
Me.AttributeValueField = value
Me.RaisePropertyChanged("AttributeValue")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property ObjectId() As Long
Get
Return Me.ObjectIdField
End Get
Set
If (Me.ObjectIdField.Equals(value) <> true) Then
Me.ObjectIdField = value
Me.RaisePropertyChanged("ObjectId")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Who() As Long
Get
Return Me.WhoField
End Get
Set
If (Me.WhoField.Equals(value) <> true) Then
Me.WhoField = value
Me.RaisePropertyChanged("Who")
End If
End Set
End Property
Public Event PropertyChanged As System.ComponentModel.PropertyChangedEventHandler Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
Protected Sub RaisePropertyChanged(ByVal propertyName As String)
Dim propertyChanged As System.ComponentModel.PropertyChangedEventHandler = Me.PropertyChangedEvent
If (Not (propertyChanged) Is Nothing) Then
propertyChanged(Me, New System.ComponentModel.PropertyChangedEventArgs(propertyName))
End If
End Sub
End Class
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0"), _
System.Runtime.Serialization.DataContractAttribute(Name:="Rights.AccessRight", [Namespace]:="http://schemas.datacontract.org/2004/07/DigitalData.Modules.EDMI.API")> _
Public Enum RightsAccessRight As Integer
@ -625,6 +781,12 @@ Namespace EDMIServiceReference
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/NewFile", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/NewFileResponse")> _
Function NewFileAsync(ByVal Data As EDMIServiceReference.NewFileRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.NewFileResponse)
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValue", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValueResponse")> _
Function SetAttributeValue(ByVal Data As EDMIServiceReference.SetAttributeValueRequest) As EDMIServiceReference.SetAttributeValueResponse
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValue", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValueResponse")> _
Function SetAttributeValueAsync(ByVal Data As EDMIServiceReference.SetAttributeValueRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.SetAttributeValueResponse)
'CODEGEN: Der Nachrichtenvertrag wird generiert, da der Wrappername (DocumentStreamRequest) von Nachricht "DocumentStreamRequest" nicht mit dem Standardwert (GetFileByObjectId) übereinstimmt.
<System.ServiceModel.OperationContractAttribute(Action:="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectId", ReplyAction:="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectIdResponse"), _
System.ServiceModel.FaultContractAttribute(GetType(EDMIServiceReference.ObjectDoesNotExistFault), Action:="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectIdObjectDoesN"& _
@ -958,6 +1120,14 @@ Namespace EDMIServiceReference
Return MyBase.Channel.NewFileAsync(Data)
End Function
Public Function SetAttributeValue(ByVal Data As EDMIServiceReference.SetAttributeValueRequest) As EDMIServiceReference.SetAttributeValueResponse Implements EDMIServiceReference.IEDMIService.SetAttributeValue
Return MyBase.Channel.SetAttributeValue(Data)
End Function
Public Function SetAttributeValueAsync(ByVal Data As EDMIServiceReference.SetAttributeValueRequest) As System.Threading.Tasks.Task(Of EDMIServiceReference.SetAttributeValueResponse) Implements EDMIServiceReference.IEDMIService.SetAttributeValueAsync
Return MyBase.Channel.SetAttributeValueAsync(Data)
End Function
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _
Function EDMIServiceReference_IEDMIService_GetFileByObjectId(ByVal request As EDMIServiceReference.DocumentStreamRequest) As EDMIServiceReference.DocumentStreamResponse Implements EDMIServiceReference.IEDMIService.GetFileByObjectId
Return MyBase.Channel.GetFileByObjectId(request)

View File

@ -182,6 +182,15 @@
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetAttributeValue">
<soap12:operation soapAction="http://DigitalData.Services.EDMIService/IEDMIService/SetAttributeValue" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetFileByObjectId">
<soap12:operation soapAction="http://DigitalData.Services.EDMIService/IEDMIService/GetFileByObjectId" style="document" />
<wsdl:input name="DocumentStreamRequest">

View File

@ -130,6 +130,9 @@
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.ScalarResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.SetAttributeValueResponse.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Modules.EDMI.API.EDMIServiceReference.TableResult.datasource">
<DependentUpon>Reference.svcmap</DependentUpon>
</None>
@ -145,6 +148,9 @@
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.FileStorage.NewFile.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.FileStorage.SetAttributeValue.xsd">
<SubType>Designer</SubType>
</None>
<None Include="Connected Services\EDMIServiceReference\DigitalData.Services.EDMIService.Messages.xsd">
<SubType>Designer</SubType>
</None>

View File

@ -19,8 +19,8 @@ Public MustInherit Class BaseMethod
Throw New ApplicationException(pMessage)
End Function
Public Function LogAndThrow(pException As Exception)
Public Function LogAndThrow(pException As Exception, pMessage As String)
Logger.Error(pException)
Throw pException
Throw New ApplicationException(pMessage, pException)
End Function
End Class

View File

@ -131,6 +131,9 @@
<Compile Include="BaseMethod.vb" />
<Compile Include="ClassConstants.vb" />
<Compile Include="Config.vb" />
<Compile Include="Filestorage\GetAttributeValue\GetAttributeValueMethod.vb" />
<Compile Include="Filestorage\GetAttributeValue\GetAttributeValueRequest.vb" />
<Compile Include="Filestorage\GetAttributeValue\GetAttributeValueResponse.vb" />
<Compile Include="Filestorage\NewFile\NewFileMethod.vb" />
<Compile Include="Filestorage\NewFile\NewFileRequest.vb" />
<Compile Include="Filestorage\NewFile\NewFileResponse.vb" />

View File

@ -0,0 +1,29 @@
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Namespace FileStorage.GetAttributeValue
Public Class GetAttributeValueMethod
Inherits BaseMethod
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
MyBase.New(pLogConfig, pDatabase)
End Sub
Public Function Run(pData As GetAttributeValueRequest) As GetAttributeValueResponse
Try
If Helpers.TestObjectIdExists(pData.ObjectId) = False Then
LogAndThrow("ObjectId does not exist!")
End If
Dim oValue As Object
Return New GetAttributeValueResponse(pData.ObjectId, oValue)
Catch ex As Exception
Logger.Warn("Error occurred while getting attribute value!")
Return New GetAttributeValueResponse(ex)
End Try
End Function
End Class
End Namespace

View File

@ -0,0 +1,5 @@
Namespace FileStorage.GetAttributeValue
Public Class GetAttributeValueRequest
Public Property ObjectId As Long
End Class
End Namespace

View File

@ -0,0 +1,26 @@
Imports System.Runtime.Serialization
Namespace FileStorage.GetAttributeValue
<Serializable>
<DataContract>
Public Class GetAttributeValueResponse
Inherits Messages.BaseResponse
<DataMember>
Public Property ObjectId As Long
Public Property Value As Object
Public Sub New(pObjectId As Long, pValue As Object)
MyBase.New()
ObjectId = pObjectId
Value = pValue
End Sub
Public Sub New(pException As Exception, Optional pDetails As String = "")
MyBase.New(pException, pDetails)
End Sub
End Class
End Namespace

View File

@ -21,8 +21,6 @@ Public Class NewFileMethod
End Sub
Public Function Run(pData As NewFile.NewFileRequest) As NewFile.NewFileResponse
Dim oConnection As SqlConnection = Nothing
Dim oTransaction As SqlTransaction = Nothing
Dim oFilePath As String = Nothing
Dim oExistingObjectId = TestFileChecksumExists(pData.FileChecksum)
@ -68,7 +66,7 @@ Public Class NewFileMethod
IO.Directory.CreateDirectory(oFinalPath)
Logger.Debug("Created folder [{0}]", oFinalPath)
Catch ex As Exception
LogAndThrow(ex)
LogAndThrow(ex, $"Store Directory [{oFinalPath}] could not be created!")
End Try
End If
Logger.Debug("Final Directory is [{0}]", oFinalPath)
@ -103,8 +101,7 @@ Public Class NewFileMethod
oStream.Close()
End Using
Catch ex As Exception
Logger.Error(ex)
LogAndThrow($"Could not write file [{oFilePath}] to disk!")
LogAndThrow(ex, $"Could not write file [{oFilePath}] to disk!")
End Try
'---------------------------------------------------------------------------
@ -113,17 +110,44 @@ Public Class NewFileMethod
' Insert into DB
Dim oSQL As String = $"EXEC PRIDB_NEW_IDBFO '{oFinalPath}', '{oFileObjectName}', '{oFileObjectExtension}',{oFileObjectSize},'{pData.FileChecksum}' ,'{pData.Who}','{oObjectId}',{oStore.Id}"
Dim oResult As Boolean = Database.ExecuteNonQueryWithConnectionObject(oSQL,
oConnection,
MSSQLServer.TransactionMode.ExternalTransaction,
oTransaction)
Dim oResult As Boolean = Database.ExecuteNonQueryWithConnectionObject(oSQL, Connection, ExternalTransaction, Transaction)
If oResult = False Then
LogAndThrow("IDB FileObject could not be created!")
End If
'---------------------------------------------------------------------------
'TODO: File dates in try catch
Dim oDefaultAttributes As New Dictionary(Of String, Object) From {
{"OriginFileName", pData?.FileName},
{"OriginCreationDatetime", pData?.FileCreatedAt},
{"OriginChangedDatetime", pData?.FileChangedAt}
}
For Each oAttribute As KeyValuePair(Of String, Object) In oDefaultAttributes
Try
' Dont write empty attributes
If oAttribute.Value Is Nothing Then
Continue For
End If
Dim oSuccess = Helpers.SetAttributeValue(Connection, Transaction, oObjectId, oAttribute.Key, oAttribute.Value, "de-DE", pData.Who)
If oSuccess Then
Logger.Debug("Default Attribute [{0}] written with value [{1}]", oAttribute.Key, oAttribute.Value)
Else
Logger.Warn("Default attribute value could not be written")
End If
Catch ex As Exception
LogAndThrow(ex, $"System attribute [{oAttribute.Key}] could not be written!")
End Try
Next
'---------------------------------------------------------------------------
' Finally, commit the transaction
oTransaction?.Commit()
Transaction?.Commit()
Return New NewFile.NewFileResponse(oObjectId)
Catch ex As Exception
@ -141,7 +165,7 @@ Public Class NewFileMethod
End If
Logger.Info("Rolling back transaction.")
oTransaction?.Rollback()
Transaction?.Rollback()
Return New NewFile.NewFileResponse(ex)

View File

@ -63,6 +63,13 @@ Namespace FileStorage.NewFile
''' </summary>
<DataMember>
Public Property Who As String
''' <summary>
''' The language of the user
''' </summary>
''' <returns></returns>
<DataMember>
Public Property Language As String
End Class
End Namespace

View File

@ -1,13 +1,20 @@
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Database
Imports DigitalData.Services.EDMIService.IDB
Imports System.Data.SqlClient
Namespace FileStorage.SetAttributeValue
Public Class SetAttributeValueMethod
Inherits BaseMethod
Private Connection As SqlConnection
Private Transaction As SqlTransaction
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
MyBase.New(pLogConfig, pDatabase)
Connection = Database.GetConnection()
Transaction = Connection.BeginTransaction()
End Sub
Public Function Run(pData As SetAttributeValueRequest) As SetAttributeValueResponse
@ -16,13 +23,16 @@ Namespace FileStorage.SetAttributeValue
LogAndThrow("ObjectId does not exist!")
End If
'TODO: Finish
Dim oResult = Helpers.SetAttributeValue(Connection, Transaction,
pData.ObjectId, pData.AttributeName, pData.AttributeValue, pData.Language, pData.Who)
If oResult = False Then
LogAndThrow("Attribute value could not be set!")
End If
Return New SetAttributeValueResponse(pData.ObjectId)
Catch ex As Exception
Logger.Warn("Error occurred while setting attribute value!")
Return New SetAttributeValueResponse(ex)
End Try
End Function

View File

@ -15,6 +15,8 @@ Namespace FileStorage.SetAttributeValue
Public Property AttributeValue As String
<DataMember>
Public Property Who As Long
<DataMember>
Public Property Language As String
End Class

View File

@ -1,23 +1,24 @@
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.Logging
Imports DigitalData.Services.EDMIService.Messages
Imports DigitalData.Modules.EDMI.API.Client
Imports System.Data.SqlClient
Namespace IDB
Public Class Helpers
Inherits BaseClass
Private MSSQLServer As MSSQLServer
Private Database As MSSQLServer
Public Sub New(pLogConfig As LogConfig, pMSSQLServer As MSSQLServer)
MyBase.New(pLogConfig)
MSSQLServer = pMSSQLServer
Database = pMSSQLServer
End Sub
Public Function TestObjectIdExists(pObjectId As Long, Optional ByRef IsDeleted As Boolean = False, Optional ByRef IsActive As Boolean = False) As Boolean
Try
Dim oSQL As String = $"SELECT IDB_OBJ_ID, ACTIVE, DELETED FROM TBIDB_OBJECT WHERE IDB_OBJ_ID = {pObjectId}"
Dim oTable As DataTable = MSSQLServer.GetDatatable(oSQL)
Dim oTable As DataTable = Database.GetDatatable(oSQL)
If IsNothing(oTable) OrElse oTable.Rows.Count = 0 Then
Logger.Warn("ObjectId {0} does not exist")
@ -39,6 +40,49 @@ Namespace IDB
End Try
End Function
Public Function GetAttributesForObject(pObjectId As Long, pLanguage As String) As List(Of ObjectAttribute)
Dim oAttributes As New List(Of ObjectAttribute)
Try
Dim oTable As DataTable = Database.GetDatatable($"EXEC [PRIDB_GET_VALUE_DT] {pObjectId}, '{pLanguage}'")
If oTable Is Nothing OrElse oTable.Rows.Count = 0 Then
Return Nothing
End If
For Each oRow As DataRow In oTable.Rows
Dim oAttribute As New ObjectAttribute With {
.Id = oRow.Item("AttributeId"),
.Title = oRow.Item("AttributeTitle"),
.Type = oRow.Item("AttributeType"),
.ValueBigInt = Utils.NotNull(oRow.Item("ValueBigInt"), Nothing),
.ValueDate = Utils.NotNull(oRow.Item("ValueDate"), Nothing),
.ValueDecimal = Utils.NotNull(oRow.Item("ValueDecimal"), Nothing),
.ValueText = Utils.NotNull(oRow.Item("ValueText"), Nothing)
}
oAttributes.Add(oAttribute)
Next
Return oAttributes
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Function SetAttributeValue(pConnection As SqlConnection, pTransaction As SqlTransaction, pObjectId As Long, pAttributeName As String, pValue As String, pLanguage As String, pWho As String) As Boolean
Dim oSql = $"
DECLARE @NEW_OBJ_MD_ID BIGINT
EXEC PRIDB_NEW_OBJ_DATA {pObjectId}, '{pAttributeName}', '{pWho}', '{pValue}', '{pLanguage}', 0, @OMD_ID = @NEW_OBJ_MD_ID OUTPUT"
If Database.ExecuteNonQueryWithConnectionObject(oSql, pConnection, MSSQLServer.TransactionMode.ExternalTransaction, pTransaction) = False Then
Logger.Warn("Error while setting attribute value.")
Return False
End If
Return True
End Function
End Class
End Namespace

View File

@ -49,8 +49,6 @@ Public Class WindowsService
_Config = _ConfigManager.Config
_LogConfig.Debug = _ConfigManager.Config.Debug
'UpdateTraceLogging()
Dim oTimer As New Timers.Timer(60000)
AddHandler oTimer.Elapsed, Sub()
_Logger.Debug("Reloading config..")