EDMI: Fix DoctypeId Parameter

This commit is contained in:
Jonathan Jenne 2022-03-29 13:35:20 +02:00
parent 665a23d8a7
commit 615666f040
17 changed files with 178 additions and 187 deletions

View File

@ -759,7 +759,7 @@ Partial Class frmDocumentResultList
resources.ApplyResources(Me.DockPanelStatus, "DockPanelStatus")
Me.DockPanelStatus.Name = "DockPanelStatus"
Me.DockPanelStatus.Options.ShowCloseButton = False
Me.DockPanelStatus.OriginalSize = New System.Drawing.Size(273, 97)
Me.DockPanelStatus.OriginalSize = New System.Drawing.Size(268, 434)
'
'ControlContainer1
'
@ -789,8 +789,8 @@ Partial Class frmDocumentResultList
resources.ApplyResources(Me.dateCheckedOutWhen, "dateCheckedOutWhen")
Me.dateCheckedOutWhen.MenuManager = Me.RibbonControl
Me.dateCheckedOutWhen.Name = "dateCheckedOutWhen"
Me.dateCheckedOutWhen.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(CType(resources.GetObject("DateEdit1.Properties.Buttons"), DevExpress.XtraEditors.Controls.ButtonPredefines))})
Me.dateCheckedOutWhen.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(CType(resources.GetObject("DateEdit1.Properties.CalendarTimeProperties.Buttons"), DevExpress.XtraEditors.Controls.ButtonPredefines))})
Me.dateCheckedOutWhen.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(CType(resources.GetObject("dateCheckedOutWhen.Properties.Buttons"), DevExpress.XtraEditors.Controls.ButtonPredefines))})
Me.dateCheckedOutWhen.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(CType(resources.GetObject("dateCheckedOutWhen.Properties.CalendarTimeProperties.Buttons"), DevExpress.XtraEditors.Controls.ButtonPredefines))})
Me.dateCheckedOutWhen.Properties.ReadOnly = True
Me.dateCheckedOutWhen.StyleController = Me.LayoutControl1
'
@ -800,7 +800,7 @@ Partial Class frmDocumentResultList
Me.Root.GroupBordersVisible = False
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlGroup1, Me.EmptySpaceItem1})
Me.Root.Name = "Root"
Me.Root.Size = New System.Drawing.Size(268, 434)
Me.Root.Size = New System.Drawing.Size(268, 413)
Me.Root.TextVisible = False
'
'LayoutControlGroup1
@ -834,7 +834,7 @@ Partial Class frmDocumentResultList
Me.EmptySpaceItem1.AllowHotTrack = False
Me.EmptySpaceItem1.Location = New System.Drawing.Point(0, 93)
Me.EmptySpaceItem1.Name = "EmptySpaceItem1"
Me.EmptySpaceItem1.Size = New System.Drawing.Size(248, 321)
Me.EmptySpaceItem1.Size = New System.Drawing.Size(248, 300)
Me.EmptySpaceItem1.TextSize = New System.Drawing.Size(0, 0)
'
'DockPanelMetadata
@ -845,7 +845,7 @@ Partial Class frmDocumentResultList
resources.ApplyResources(Me.DockPanelMetadata, "DockPanelMetadata")
Me.DockPanelMetadata.Name = "DockPanelMetadata"
Me.DockPanelMetadata.Options.ShowCloseButton = False
Me.DockPanelMetadata.OriginalSize = New System.Drawing.Size(280, 200)
Me.DockPanelMetadata.OriginalSize = New System.Drawing.Size(268, 434)
'
'DockPanel3_Container
'
@ -883,9 +883,9 @@ Partial Class frmDocumentResultList
Me.AllowFormGlass = DevExpress.Utils.DefaultBoolean.[True]
resources.ApplyResources(Me, "$this")
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.Controls.Add(Me.DockPanelFileList)
Me.Controls.Add(Me.DockPanelDocViewer)
Me.Controls.Add(Me.panelContainer1)
Me.Controls.Add(Me.DockPanelFileList)
Me.Controls.Add(Me.RibbonStatusBar)
Me.Controls.Add(Me.RibbonControl)
Me.IconOptions.Icon = CType(resources.GetObject("frmDocumentResultList.IconOptions.Icon"), System.Drawing.Icon)

View File

@ -489,6 +489,49 @@
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>1189, 671</value>
</data>
<data name="DockPanel2_Container.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 46</value>
</data>
<data name="DockPanel2_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>578, 442</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="DockPanel2_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Name" xml:space="preserve">
<value>DockPanel2_Container</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Type" xml:space="preserve">
<value>DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Parent" xml:space="preserve">
<value>DockPanelFileList</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="DockPanelFileList.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 158</value>
</data>
<data name="DockPanelFileList.Size" type="System.Drawing.Size, System.Drawing">
<value>585, 491</value>
</data>
<data name="DockPanelFileList.Text" xml:space="preserve">
<value>Ergebnisse</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Name" xml:space="preserve">
<value>DockPanelFileList</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Type" xml:space="preserve">
<value>DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;DockPanelFileList.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="DocumentViewer1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
</data>
@ -496,9 +539,8 @@
<value>0, 0</value>
</data>
<data name="DocumentViewer1.Size" type="System.Drawing.Size, System.Drawing">
<value>323, 459</value>
<value>323, 441</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="DocumentViewer1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
@ -515,10 +557,10 @@
<value>0</value>
</data>
<data name="DockPanel1_Container.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 26</value>
<value>3, 46</value>
</data>
<data name="DockPanel1_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>323, 459</value>
<value>323, 441</value>
</data>
<data name="DockPanel1_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -539,7 +581,7 @@
<value>585, 158</value>
</data>
<data name="DockPanelDocViewer.Size" type="System.Drawing.Size, System.Drawing">
<value>329, 489</value>
<value>329, 491</value>
</data>
<data name="DockPanelDocViewer.Text" xml:space="preserve">
<value>Vorschau</value>
@ -554,7 +596,7 @@
<value>$this</value>
</data>
<data name="&gt;&gt;DockPanelDocViewer.ZOrder" xml:space="preserve">
<value>0</value>
<value>1</value>
</data>
<data name="txtCheckedOutWho.Location" type="System.Drawing.Point, System.Drawing">
<value>162, 45</value>
@ -584,10 +626,10 @@
<value>162, 69</value>
</data>
<assembly alias="DevExpress.Utils.v21.2" name="DevExpress.Utils.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<data name="DateEdit1.Properties.Buttons" type="DevExpress.XtraEditors.Controls.ButtonPredefines, DevExpress.Utils.v21.2">
<data name="dateCheckedOutWhen.Properties.Buttons" type="DevExpress.XtraEditors.Controls.ButtonPredefines, DevExpress.Utils.v21.2">
<value>Combo</value>
</data>
<data name="DateEdit1.Properties.CalendarTimeProperties.Buttons" type="DevExpress.XtraEditors.Controls.ButtonPredefines, DevExpress.Utils.v21.2">
<data name="dateCheckedOutWhen.Properties.CalendarTimeProperties.Buttons" type="DevExpress.XtraEditors.Controls.ButtonPredefines, DevExpress.Utils.v21.2">
<value>Combo</value>
</data>
<data name="dateCheckedOutWhen.Size" type="System.Drawing.Size, System.Drawing">
@ -624,7 +666,7 @@
<value>In Bearbeitung</value>
</data>
<data name="LayoutControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="LayoutControl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -648,7 +690,7 @@
<value>0, 0</value>
</data>
<data name="ControlContainer1.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="ControlContainer1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -666,10 +708,10 @@
<value>0</value>
</data>
<data name="DockPanelStatus.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 26</value>
<value>4, 46</value>
</data>
<data name="DockPanelStatus.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="DockPanelStatus.Text" xml:space="preserve">
<value>Status</value>
@ -693,7 +735,7 @@
<value>0, 0</value>
</data>
<data name="CtrlObjectPropertyDialog.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="CtrlObjectPropertyDialog.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -714,7 +756,7 @@
<value>0, 0</value>
</data>
<data name="DockPanel3_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="DockPanel3_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -732,10 +774,10 @@
<value>0</value>
</data>
<data name="DockPanelMetadata.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 26</value>
<value>4, 46</value>
</data>
<data name="DockPanelMetadata.Size" type="System.Drawing.Size, System.Drawing">
<value>268, 434</value>
<value>268, 413</value>
</data>
<data name="DockPanelMetadata.Text" xml:space="preserve">
<value>Eigenschaften</value>
@ -756,7 +798,7 @@
<value>914, 158</value>
</data>
<data name="panelContainer1.Size" type="System.Drawing.Size, System.Drawing">
<value>275, 489</value>
<value>275, 491</value>
</data>
<data name="panelContainer1.Text" xml:space="preserve">
<value>panelContainer1</value>
@ -771,55 +813,13 @@
<value>$this</value>
</data>
<data name="&gt;&gt;panelContainer1.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="DockPanel2_Container.Location" type="System.Drawing.Point, System.Drawing">
<value>3, 26</value>
</data>
<data name="DockPanel2_Container.Size" type="System.Drawing.Size, System.Drawing">
<value>578, 460</value>
</data>
<data name="DockPanel2_Container.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Name" xml:space="preserve">
<value>DockPanel2_Container</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Type" xml:space="preserve">
<value>DevExpress.XtraBars.Docking.ControlContainer, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.Parent" xml:space="preserve">
<value>DockPanelFileList</value>
</data>
<data name="&gt;&gt;DockPanel2_Container.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="DockPanelFileList.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 158</value>
</data>
<data name="DockPanelFileList.Size" type="System.Drawing.Size, System.Drawing">
<value>585, 489</value>
</data>
<data name="DockPanelFileList.Text" xml:space="preserve">
<value>Ergebnisse</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Name" xml:space="preserve">
<value>DockPanelFileList</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Type" xml:space="preserve">
<value>DevExpress.XtraBars.Docking.DockPanel, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;DockPanelFileList.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;DockPanelFileList.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="RibbonStatusBar.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 647</value>
<value>0, 649</value>
</data>
<data name="RibbonStatusBar.Size" type="System.Drawing.Size, System.Drawing">
<value>1189, 24</value>
<value>1189, 22</value>
</data>
<data name="&gt;&gt;RibbonStatusBar.Name" xml:space="preserve">
<value>RibbonStatusBar</value>
@ -1421,7 +1421,7 @@
<value>4</value>
</data>
<data name="GridControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>568, 460</value>
<value>568, 442</value>
</data>
<data name="GridControl1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -1592,7 +1592,7 @@
<value>1</value>
</data>
<data name="SplitContainerControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>578, 460</value>
<value>578, 442</value>
</data>
<data name="SplitContainerControl1.TabIndex" type="System.Int32, mscorlib">
<value>2</value>

View File

@ -0,0 +1,5 @@
DevExpress.XtraBars.Docking.DockManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Docking2010.DocumentManager, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit, DevExpress.XtraEditors.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraGrid.GridControl, DevExpress.XtraGrid.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -0,0 +1 @@
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a

View File

@ -75,7 +75,7 @@ Partial Class frmtest
Me.btnNewFile.Name = "btnNewFile"
Me.btnNewFile.Size = New System.Drawing.Size(187, 23)
Me.btnNewFile.TabIndex = 17
Me.btnNewFile.Text = "NewFile"
Me.btnNewFile.Text = "ImportFile (IDB/FileImporter)"
Me.btnNewFile.UseVisualStyleBackColor = True
'
'Label4

View File

@ -2,8 +2,6 @@
Imports DigitalData.Modules.Base.IDB.FileStore
Public Class frmtest
Private Sub frmtest_Load(sender As Object, e As EventArgs) Handles MyBase.Load
cmbObjectStoreType.SelectedIndex = 0
End Sub
@ -15,23 +13,33 @@ Public Class frmtest
End Sub
Private Async Sub btnNewFile_Click(sender As Object, e As EventArgs) Handles btnNewFile.Click
Dim oObjectId As Long = Await My.Application.Service.Client.NewFileAsync(
Dim oResponse As ImportFileResponse = Await My.Application.Service.Client.ImportFileAsync(
txtFile2Import.Text,
"WORK",
New List(Of UserAttributeValue) From {
New UserAttributeValue With {
.Name = "Attribut String1",
.Values = New List(Of String) From {"Harry"}.ToArray
},
New UserAttributeValue With {
.Name = "DisplayFileName",
.Values = New List(Of String) From {"DN Textdokument"}.ToArray
}
},
"Work",
"DOC",
"DEFAULT"
txtDoctypeID.Text
)
If oObjectId <> FILE_STORE_INVALID_OBEJCT_ID Then
If oResponse.OK Then
MsgBox("File Imported!", MsgBoxStyle.Information, Text)
txtIDB_OBJ_ID.Text = oResponse.ObjectId
Else
MsgBox("File was not imported. Check the server logs!")
MsgBox("File was not imported. Check the server logs!", MsgBoxStyle.Critical, Text)
End If
txtIDB_OBJ_ID.Text = oObjectId
End Sub
Private Async Sub btnImportFile_Click_(sender As Object, e As EventArgs) Handles btnImportFile.Click
Dim oResponse As ImportFileResponse = Await My.Application.Service.Client.Globix_ImportFileAsync(
Dim oResponse As Globix_ImportFileResponse = Await My.Application.Service.Client.Globix_ImportFileAsync(
txtFile2Import.Text,
txtProfileId.Text,
New List(Of UserAttributeValue) From {

View File

@ -7,7 +7,7 @@
<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: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="IDBDoctypeId" type="xs:long" />
<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" />

View File

@ -7,7 +7,7 @@
<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: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="IDBDoctypeId" type="xs:long" />
<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" />

View File

@ -2372,7 +2372,7 @@ Namespace EDMIServiceReference
Private FileField As EDMIServiceReference.FileProperties
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private IDBDoctypeIdField As String
Private IDBDoctypeIdField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private KindTypeField As String
@ -2423,12 +2423,12 @@ Namespace EDMIServiceReference
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property IDBDoctypeId() As String
Public Property IDBDoctypeId() As Long
Get
Return Me.IDBDoctypeIdField
End Get
Set
If (Object.ReferenceEquals(Me.IDBDoctypeIdField, value) <> true) Then
If (Me.IDBDoctypeIdField.Equals(value) <> true) Then
Me.IDBDoctypeIdField = value
Me.RaisePropertyChanged("IDBDoctypeId")
End If
@ -2516,7 +2516,7 @@ Namespace EDMIServiceReference
Private FileField As EDMIServiceReference.FileProperties
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private IDBDoctypeIdField As String
Private IDBDoctypeIdField As Long
<System.Runtime.Serialization.OptionalFieldAttribute()> _
Private KindTypeField As String
@ -2567,12 +2567,12 @@ Namespace EDMIServiceReference
End Property
<System.Runtime.Serialization.DataMemberAttribute()> _
Public Property IDBDoctypeId() As String
Public Property IDBDoctypeId() As Long
Get
Return Me.IDBDoctypeIdField
End Get
Set
If (Object.ReferenceEquals(Me.IDBDoctypeIdField, value) <> true) Then
If (Me.IDBDoctypeIdField.Equals(value) <> true) Then
Me.IDBDoctypeIdField = value
Me.RaisePropertyChanged("IDBDoctypeId")
End If

View File

@ -3,17 +3,18 @@ Imports DigitalData.Modules.Logging
Public Class Helpers
Private ReadOnly LogConfig As LogConfig
Private ReadOnly Logger As Logger
Private ReadOnly FileEx As Filesystem.File
Private ReadOnly LogConfig As LogConfig
Private ReadOnly Logger As Logger
Private ReadOnly FileEx As Filesystem.File
Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(pLogConfig)
End Sub
Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
FileEx = New Filesystem.File(pLogConfig)
End Sub
Public Function GetFileProperties(pFilePath As String, pDateImportedAt As Date) As FileProperties
Public Function GetFileProperties(pFilePath As String, pDateImportedAt As Date) As FileProperties
Try
Using oFileStream As New IO.FileStream(pFilePath, IO.FileMode.Open, IO.FileAccess.Read)
Using oMemoryStream As New IO.MemoryStream()
oFileStream.CopyTo(oMemoryStream)
@ -27,16 +28,21 @@ Public Class Helpers
Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
Dim oFileHash As String = FileEx.GetChecksum(oFileInfo.FullName)
Return New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pDateImportedAt,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
Return New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pDateImportedAt,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
}
End Using
End Using
End Using
End Function
End Class
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@ -28,47 +28,32 @@ Namespace Modules.Globix
Throw New FileNotFoundException("Path does not exist")
End If
Dim oFileInfo As New FileInfo(pFilePath)
Dim oExtension As String = oFileInfo.Extension
Dim oFileName As String = oFileInfo.Name
Dim oFileCreatedAt As Date = oFileInfo?.CreationTime
Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
Dim oFileHash As String = FileEx.GetChecksum(oFileInfo.FullName)
' Try to load file properties
Dim oFileProperties = Helpers.GetFileProperties(pFilePath, pImportOptions.DateImported)
If oFileProperties Is Nothing Then
Throw New IOException("File could not be read!")
End If
' Importing the file now
Using oFileStream As New FileStream(pFilePath, FileMode.Open, FileAccess.Read)
Using oMemoryStream As New MemoryStream()
oFileStream.CopyTo(oMemoryStream)
Dim oContents = oMemoryStream.ToArray()
Dim oFileImportResponse = Await Channel.Globix_ImportFileAsync(New Globix_ImportFileRequest With {
.IDBDoctypeId = pIDBDoctypeId,
.File = oFileProperties,
.KindType = pObjectKind,
.StoreName = pObjectStoreName,
.User = New UserState() With {
.UserName = pImportOptions.Username,
.Language = pImportOptions.Language
},
.ProfileId = pProfileId,
.AttributeValues = pAttributeValues.ToArray
})
Dim oFileImportResponse = Await Channel.Globix_ImportFileAsync(New Globix_ImportFileRequest With {
.IDBDoctypeId = pIDBDoctypeId,
.File = New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pImportOptions.DateImported,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
},
.KindType = pObjectKind,
.StoreName = pObjectStoreName,
.User = New UserState() With {
.UserName = pImportOptions.Username,
.Language = pImportOptions.Language
},
.ProfileId = pProfileId,
.AttributeValues = pAttributeValues.ToArray
})
Return oFileImportResponse
Return oFileImportResponse
End Using
End Using
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

@ -27,47 +27,32 @@ Namespace Modules.IDB
Throw New FileNotFoundException("Path does not exist")
End If
Dim oFileInfo As New FileInfo(pFilePath)
Dim oExtension As String = oFileInfo.Extension
Dim oFileName As String = oFileInfo.Name
Dim oFileCreatedAt As Date = oFileInfo?.CreationTime
Dim oFileModifiedAt As Date = oFileInfo?.LastWriteTime
Dim oFileHash As String = FileEx.GetChecksum(oFileInfo.FullName)
' Try to load file properties
Dim oFileProperties = Helpers.GetFileProperties(pFilePath, pImportOptions.DateImported)
If oFileProperties Is Nothing Then
Throw New IOException("File could not be read!")
End If
' Importing the file now
Using oFileStream As New FileStream(pFilePath, FileMode.Open, FileAccess.Read)
Using oMemoryStream As New MemoryStream()
oFileStream.CopyTo(oMemoryStream)
Dim oContents = oMemoryStream.ToArray()
Dim oFileImportResponse = Await Channel.ImportFileAsync(New ImportFileRequest With {
.IDBDoctypeId = pIDBDoctypeId,
.File = oFileProperties,
.KindType = pObjectKind,
.StoreName = pObjectStoreName,
.User = New UserState() With {
.UserName = pImportOptions.Username,
.Language = pImportOptions.Language
},
.ProfileId = -1,
.AttributeValues = pAttributeValues.ToArray
})
Dim oFileImportResponse = Await Channel.ImportFileAsync(New ImportFileRequest With {
.IDBDoctypeId = pIDBDoctypeId,
.File = New FileProperties With {
.FileName = oFileInfo.Name,
.FileCreatedAt = oFileCreatedAt,
.FileChangedAt = oFileModifiedAt,
.FileContents = oContents,
.FileImportedAt = pImportOptions.DateImported,
.FileChecksum = oFileHash,
.FileInfoRaw = oFileInfo
},
.KindType = pObjectKind,
.StoreName = pObjectStoreName,
.User = New UserState() With {
.UserName = pImportOptions.Username,
.Language = pImportOptions.Language
},
.ProfileId = -1,
.AttributeValues = pAttributeValues.ToArray
})
Return oFileImportResponse
Return oFileImportResponse
End Using
End Using
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
End Class

View File

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

View File

@ -22,7 +22,7 @@ Namespace Methods.IDB.ImportFile
''' The Document Type of the file, ex. IncomingInvoice
''' </summary>
<DataMember>
Public Property IDBDoctypeId As String
Public Property IDBDoctypeId As Long
''' <summary>
''' The kind of object to be created, ex. DOC

View File

@ -18,12 +18,12 @@ Namespace Methods.IDB.NewFile
Transaction = Connection.BeginTransaction()
End Sub
Public Function Run(pData As NewFile.NewFileRequest) As NewFile.NewFileResponse
Public Function Run(pData As NewFileRequest) As NewFileResponse
Dim oFilePath As String = Nothing
Dim oExistingObjectId = Helpers.TestFileChecksumExists(pData.File.FileChecksum)
If oExistingObjectId > 0 Then
Return New NewFile.NewFileResponse(oExistingObjectId)
Return New NewFileResponse(oExistingObjectId)
End If
Try
@ -134,7 +134,8 @@ Namespace Methods.IDB.NewFile
' Finally, commit the transaction
Transaction?.Commit()
Return New NewFile.NewFileResponse(oObjectId)
Return New NewFileResponse(oObjectId)
Catch ex As Exception
Logger.Warn("Error occurred while creating file!")
Logger.Error(ex)
@ -152,7 +153,7 @@ Namespace Methods.IDB.NewFile
Logger.Info("Rolling back transaction.")
Transaction?.Rollback()
Return New NewFile.NewFileResponse(ex)
Return New NewFileResponse(ex)
End Try
End Function

View File

@ -15,7 +15,7 @@ Namespace Methods.IDB.NewFile
Public Property StoreName As String
''' <summary>
''' The business entity of the file, ex DEFAULT
''' The Document Id of the file, ex. 1
''' </summary>
<DataMember>
Public Property IDBDoctypeId As Long

View File

@ -72,18 +72,18 @@ Namespace Methods.IDB.UpdateFile
Dim oObjectTable = DatabaseIDB.GetDatatable($"Select * FROM VWIDB_OBJECT WHERE IDB_OBJ_ID = {pData.ObjectId}")
Dim oObjectRow As DataRow = oObjectTable.Rows.Item(0)
Dim oKind As String = oObjectRow.Item("KIND_NAME")
Dim oBusinessEntity As String = oObjectRow.Item("BE_NAME")
Dim oDocumentTypeId As String = oObjectRow.Item("Doctype_ID")
Dim oStore As String = oObjectRow.Item("STORE_NAME")
Logger.Debug("Getting information for ObjectId [{0}]", pData.ObjectId)
Logger.Debug("DocumentType: [{0}]", oDocumentTypeId)
Logger.Debug("Kind: [{0}]", oKind)
Logger.Debug("BE: [{0}]", oBusinessEntity)
Logger.Debug("Store: [{0}]", oStore)
Dim oNewFileMethod As New NewFile.NewFileMethod(LogConfig, DatabaseIDB, DatabaseECM, GlobalState)
Dim oNewFileRequest As New NewFile.NewFileRequest With {
.File = pData.File,
.IDBDoctypeId = oBusinessEntity,
.IDBDoctypeId = oDocumentTypeId,
.KindType = oKind,
.StoreName = oStore,
.User = pData.User