EDMIService: WIP

This commit is contained in:
Jonathan Jenne
2021-12-07 16:37:23 +01:00
parent 6be8b1bdb5
commit 2a6fd3555b
20 changed files with 498 additions and 364 deletions

View File

@@ -11,6 +11,7 @@ Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Controls.LookupGrid
Imports Independentsoft
Imports DevExpress.XtraEditors.Controls
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Public Class frmGlobix_Index
#Region "+++++ Variablen ++++++"
@@ -51,11 +52,13 @@ Public Class frmGlobix_Index
Return Name
End Function
End Class
Public Class ControlMeta
Public Property IndexName As String
Public Property IndexType As String
Public Property MultipleValues As Boolean = False
End Class
#End Region
Public Sub New(LogConfig As LogConfig)
@@ -260,12 +263,12 @@ Public Class frmGlobix_Index
checkItemPreselection.Checked = True
If My.Application.Globix.CURRENT_LASTDOCTYPE <> "" Then
Dim oFoundDocType = ComboBoxEdit1.Properties.Items.
Dim oFoundDocType = cmbDocType.Properties.Items.
Cast(Of DocType)().
Where(Function(dt) dt.Name = My.Application.Globix.CURRENT_LASTDOCTYPE).
FirstOrDefault()
If oFoundDocType IsNot Nothing Then
ComboBoxEdit1.SelectedItem = oFoundDocType
cmbDocType.SelectedItem = oFoundDocType
End If
@@ -278,13 +281,13 @@ Public Class frmGlobix_Index
_Logger.Debug("There is a match on REGEX_DOCTYPE: [{0}]", oRoW.Item("DOCTYPE"))
_Logger.Debug("Regex: [{0}], FileName: [{1}]", oRoW.Item("Regex"), oOnlyFilename)
Dim oFoundDocType = ComboBoxEdit1.Properties.Items.
Dim oFoundDocType = cmbDocType.Properties.Items.
Cast(Of DocType)().
Where(Function(dt) dt.Name = My.Application.Globix.CURRENT_LASTDOCTYPE).
FirstOrDefault()
If oFoundDocType IsNot Nothing Then
ComboBoxEdit1.SelectedItem = oFoundDocType
cmbDocType.SelectedItem = oFoundDocType
End If
Exit For
End If
@@ -307,7 +310,7 @@ Public Class frmGlobix_Index
DT_VWGI_DOCTYPE = _DataASorDB.GetDatatable("DD_ECM", oSql, "VWGI_DOCTYPE", oFilter, "SEQUENCE")
For Each oRow As DataRow In DT_VWGI_DOCTYPE.Rows
ComboBoxEdit1.Properties.Items.Add(New DocType With {
cmbDocType.Properties.Items.Add(New DocType With {
.Guid = oRow.Item("DOCTYPE_ID"),
.Name = oRow.Item("DOCTYPE")
})
@@ -319,9 +322,9 @@ Public Class frmGlobix_Index
End Sub
Private Sub ComboBoxEdit1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBoxEdit1.SelectedIndexChanged
If ComboBoxEdit1.SelectedIndex <> -1 And FormLoaded = True Then
Dim oSelectedItem As DocType = ComboBoxEdit1.SelectedItem
Private Sub ComboBoxEdit1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbDocType.SelectedIndexChanged
If cmbDocType.SelectedIndex <> -1 And FormLoaded = True Then
Dim oSelectedItem As DocType = cmbDocType.SelectedItem
My.Application.Globix.CURRENT_DOCTYPE_ID = oSelectedItem.Guid
@@ -393,8 +396,8 @@ Public Class frmGlobix_Index
_Controls = oControls
If DT_INDEXEMAN.Rows.Count = 0 Then
ShowError("Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & ComboBoxEdit1.Text & " definiert")
_Logger.Info(" - Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & ComboBoxEdit1.Text & " definiert")
ShowError("Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert")
_Logger.Info(" - Keine Manuellen Indizes für die " & vbNewLine & "Dokumentart " & cmbDocType.Text & " definiert")
End If
For Each oRow As DataRow In DT_INDEXEMAN.Rows
@@ -778,13 +781,15 @@ Public Class frmGlobix_Index
Private Sub GlobixFlow()
ClearError()
ClearNotice()
Me.Cursor = Cursors.WaitCursor
Cursor = Cursors.WaitCursor
Refresh_RegexTable()
For Each rowregex As DataRow In My.Application.Globix.DT_FUNCTION_REGEX.Rows
If rowregex.Item("FUNCTION_NAME") = "CLEAN_FILENAME" Then
My.Application.Globix.REGEX_CLEAN_FILENAME = rowregex.Item("REGEX")
End If
Next
If chkMultiindexing.Visibility = DevExpress.XtraBars.BarItemVisibility.Always And chkMultiindexing.Checked = True Then
'Die erste Datei indexieren
If WORK_FILE() = True Then
@@ -854,7 +859,7 @@ Public Class frmGlobix_Index
_Logger.Debug("Manuelle Indexe geladen")
If My.Application.Globix.CURR_DT_MAN_INDEXE.Rows.Count > 0 Then
Dim oDokart As DocType = ComboBoxEdit1.SelectedItem
Dim oDokart As DocType = cmbDocType.SelectedItem
My.Application.Globix.CURRENT_DOCTYPE_ID = oDokart.Guid
If CheckWrite_IndexeMan(oDokart.Guid) = True Then
@@ -2404,11 +2409,48 @@ Public Class frmGlobix_Index
End Function
Private Sub PictureEdit1_EditValueChanged(sender As Object, e As EventArgs)
End Sub
Private Sub btnAblageFlow_Click(sender As Object, e As EventArgs) Handles btnAblageFlow.Click
GlobixFlow()
End Sub
Private Async Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oDokart As DocType = cmbDocType.SelectedItem
Await GlobixFlowNew(oDokart)
End Sub
Private Async Function GlobixFlowNew(pDocType As DocType) As Threading.Tasks.Task(Of Boolean)
Try
ClearError()
ClearNotice()
Cursor = Cursors.WaitCursor
Dim oValidator As New ClassValidator(My.LogConfig, My.Application.Service.Client)
If oValidator.ValidateControls(pnlIndex.Controls, pDocType) = False Then
Return False
End If
'TODO: Globix File Import
Dim oFileName As String
Dim oObjectStore As String
Dim oObjectKind As String
Dim oBusinessENtity As String
Dim oProfileId As Integer
Dim oAttributes As List(Of UserAttributeValue)
Dim oOptions As New Modules.EDMI.API.Options.ImportFileOptions
Await My.Application.Service.Client.ImportFileAsync(oFileName, oProfileId, oAttributes, oObjectStore, oObjectKind, oBusinessENtity, oOptions)
Return True
Catch ex As Exception
_Logger.Error(ex)
MsgBox("Indexierung fehlgeschlagen!", MsgBoxStyle.Critical, Text)
Finally
Cursor = Cursors.Default
End Try
End Function
End Class