Zooflow: CheckInOut

This commit is contained in:
Jonathan Jenne
2022-03-28 16:42:47 +02:00
parent c833f486ac
commit ea8b4242ae
20 changed files with 696 additions and 98 deletions

View File

@@ -236,6 +236,42 @@ Public Class Client
End Try
End Function
Public Async Function CheckOutFile(pObjectId As Long, pComment As String, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel)
Return Await oCheckOutFile.RunAsync(pObjectId, pComment, pOptions)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Async Function CheckOutFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try
Dim oCheckOutFile As New Modules.IDB.CheckOutFile(LogConfig, Channel)
Return Await oCheckOutFile.RunAsync(pObjectId, String.Empty, pOptions)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Async Function CheckInFile(pObjectId As Long, Optional pOptions As Options.CheckOutInOptions = Nothing) As Task(Of Long)
Try
Dim oCheckInFile As New Modules.IDB.CheckInFile(LogConfig, Channel)
Return Await oCheckInFile.RunAsync(pObjectId, pOptions)
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Public Async Function Globix_ImportFileAsync(
pFilePath As String,
pProfileId As Integer,

View File

@@ -5,7 +5,7 @@
<xs:complexType name="CheckInOutFileRequest">
<xs:sequence>
<xs:element minOccurs="0" name="Action" type="tns:CheckInOutFileAction" />
<xs:element minOccurs="0" name="Comment" type="xs:long" />
<xs:element minOccurs="0" name="Comment" nillable="true" type="xs:string" />
<xs:element minOccurs="0" name="ObjectId" type="xs:long" />
<xs:element xmlns:q1="http://schemas.datacontract.org/2004/07/DigitalData.Modules.ZooFlow.State" minOccurs="0" name="User" nillable="true" type="q1:UserState" />
</xs:sequence>

View File

@@ -2371,47 +2371,47 @@ Namespace EDMIServiceReference
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private ActionField As EDMIServiceReference.CheckInOutFileAction
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private CommentField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _
<System.Runtime.Serialization.OptionalFieldAttribute()>
Private CommentField As String
<System.Runtime.Serialization.OptionalFieldAttribute()>
Private ObjectIdField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _
<System.Runtime.Serialization.OptionalFieldAttribute()>
Private UserField As EDMIServiceReference.UserState
<Global.System.ComponentModel.BrowsableAttribute(false)> _
<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
Me.extensionDataField = Value
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
<System.Runtime.Serialization.DataMemberAttribute()>
Public Property Action() As EDMIServiceReference.CheckInOutFileAction
Get
Return Me.ActionField
End Get
Set
If (Me.ActionField.Equals(value) <> true) Then
Me.ActionField = value
If (Me.ActionField.Equals(Value) <> True) Then
Me.ActionField = Value
Me.RaisePropertyChanged("Action")
End If
End Set
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property Comment() As Long
<System.Runtime.Serialization.DataMemberAttribute()>
Public Property Comment() As String
Get
Return Me.CommentField
End Get
Set
If (Me.CommentField.Equals(value) <> true) Then
Me.CommentField = value
If (Object.ReferenceEquals(Me.CommentField, Value) <> True) Then
Me.CommentField = Value
Me.RaisePropertyChanged("Comment")
End If
End Set

View File

@@ -20,12 +20,12 @@ Namespace Modules.IDB
.Language = pOptions.Language,
.UserName = pOptions.Username
},
.Action = CheckInOutFileAction.CheckOut,
.Action = CheckInOutFileAction.CheckIn,
.ObjectId = pObjectId
})
If oCheckInFileResponse.OK = False Then
Throw New ApplicationException("Could not Import File Contents!")
Throw New ApplicationException(oCheckInFileResponse.ErrorMessage)
End If
Return oCheckInFileResponse.ObjectId

View File

@@ -15,7 +15,7 @@ Namespace Modules.IDB
pOptions = New Options.CheckOutInOptions()
End If
Dim oCheckOutFileResponse = Await Channel.CheckInOutFileAsync(New CheckInOutFileRequest With {
Dim oArgs = New CheckInOutFileRequest With {
.User = New UserState With {
.Language = pOptions.Language,
.UserName = pOptions.Username
@@ -23,10 +23,11 @@ Namespace Modules.IDB
.Action = CheckInOutFileAction.CheckOut,
.Comment = pComment,
.ObjectId = pObjectId
})
}
Dim oCheckOutFileResponse = Await Channel.CheckInOutFileAsync(oArgs)
If oCheckOutFileResponse.OK = False Then
Throw New ApplicationException("Could not Import File Contents!")
Throw New ApplicationException(oCheckOutFileResponse.ErrorMessage)
End If
Return oCheckOutFileResponse.ObjectId