MS Structure Nodes

This commit is contained in:
Digital Data - Marlon Schreiber
2018-10-02 17:15:26 +02:00
parent 04ffe61b4d
commit 609df5b5c5
39 changed files with 2504 additions and 2023 deletions

View File

@@ -124,12 +124,17 @@ Public Class ClassImport_Windream
' Den Zielordner erstellen
Zielordner = DT.Rows(0).Item("ZIEL_PFAD")
sql = "SELECT FOLDER_FOR_INDEX FROM TBDD_DOKUMENTART WHERE GUID = " & DocTypeID
Dim Folder_for_index = ClassDatabase.Execute_Scalar(sql)
If Not IsDBNull(Folder_for_index) Then
If Folder_for_index <> String.Empty Then
If CREATE_FOLDER_INDEX(Folder_for_index, DocTypeID) = True And CURRENT_VARIABLE_FOLDER <> "" Then
Zielordner = Zielordner & "\" & CURRENT_VARIABLE_FOLDER
sql = $"SELECT DYNAMIC_FOLDER FROM TBPMO_WD_FORMVIEW_DOKTYPES WHERE FORMVIEW_ID = {CURRENT_FORMVIEW_ID} AND DOCTYPE_ID = {DocTypeID}"
Dim DYNAMIC_FOLDER = ClassDatabase.Execute_Scalar(sql)
If Not IsDBNull(DYNAMIC_FOLDER) Then
If DYNAMIC_FOLDER <> String.Empty Then
If CREATE_FOLDER_INDEX(DYNAMIC_FOLDER, DocTypeID) = True And CURRENT_VARIABLE_FOLDER <> "" Then
If CURRENT_VARIABLE_FOLDER_OVERRIDE = True Then
Zielordner = CURRENT_VARIABLE_FOLDER
Else
Zielordner = Zielordner & "\" & CURRENT_VARIABLE_FOLDER
End If
Else
MsgBox("Unexpected Error in Creating Variable Folder - Check logfile!", MsgBoxStyle.Critical)
Return False
@@ -151,7 +156,7 @@ Public Class ClassImport_Windream
Try
Select Case clsWD_GET.WD_PATH_EXISTS(Zielordner.Substring(2))
Case False
ClassLogger.Add(String.Format(">> Targetpath ({0}) is not existing or result of WD_PATH_EXISTS was false.", Zielordner.Substring(2)))
ClassLogger.Add(String.Format(">> Targetpath ({0}) is not existing or result of WD_PATH_EXISTS was false.", Zielordner.Substring(2)), False)
Dim split() As String = Zielordner.Split("\")
Dim Path_Combined As String = ""
For Each s As String In split
@@ -159,13 +164,18 @@ Public Class ClassImport_Windream
If Path_Combined <> "W:\" Then
Dim temppath = Path_Combined.Substring(2)
Try
temppath = Path_Combined.Substring(2).Substring(0, temppath.Length)
Select Case clsWD_GET.WD_PATH_EXISTS(temppath)
Case False
If LogErrorsOnly = False Then
ClassLogger.Add(" >> Trying to create folder-part: " & temppath, False)
End If
clsWindream.MY_WDSESSION.GetNewWMObjectFS(2, temppath, 0) 'WMEntityFolder,WMObjectEditModeNoEdit)
Case -10
ClassLogger.Add(">> WD_PATH_EXISTS returned -10 for: " & temppath, False)
Return False
End Select
Catch ex As Exception
@@ -451,6 +461,7 @@ Public Class ClassImport_Windream
End Function
Private Shared Function CREATE_FOLDER_INDEX(FolderConvention As String, DocTypeID As Integer)
Try
CURRENT_VARIABLE_FOLDER_OVERRIDE = False
'Dim RootFolder As String = Path.GetDirectoryName(CURRENT_NEWFILENAME)
CURRENT_VARIABLE_FOLDER = ""
'######
@@ -507,23 +518,53 @@ Public Class ClassImport_Windream
End If
Case "M"
If LogErrorsOnly = False Then ClassLogger.Add(" >> Working on manual value......'", False)
Dim split() As String = element.Value.Substring(3, element.Value.Length - 4).Split("#")
If split.Length = 2 Then
'Die GUID des AutoIndex auslesen
Dim INDEX_ID = split(1)
If IsNumeric(INDEX_ID) Then
For Each row As DataRow In CURRENT_TBPMO_INDEX_MAN.Rows
If row.Item("GUID") = INDEX_ID Then
Dim manvalue = row.Item("MAN_VALUE")
FolderConvention = FolderConvention.Replace(element.ToString, manvalue)
End If
Next
If element.Value.ToUpper.Contains("FOLDERSELECT") Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> FOLDERSELECT......'", False)
For Each row As DataRow In CURRENT_TBPMO_INDEX_MAN.Rows
If row.Item("GUID") = INDEX_ID Then
Dim manvalue = row.Item("MAN_VALUE")
If manvalue <> String.Empty Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> folder value is: '" & manvalue & "'", False)
CURRENT_VARIABLE_FOLDER_OVERRIDE = True
CURRENT_VARIABLE_FOLDER = manvalue
Return True
Else
ClassLogger.Add(">> Attention: manvalue (from Input indexing is empty!!", False)
End If
End If
Next
Else
For Each row As DataRow In CURRENT_TBPMO_INDEX_MAN.Rows
If row.Item("GUID") = INDEX_ID Then
Dim manvalue = row.Item("MAN_VALUE")
If manvalue <> String.Empty Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> manvalue is: '" & manvalue & "'", False)
FolderConvention = FolderConvention.Replace(element.ToString, manvalue)
FolderConvention = FolderConvention.Replace("\\", "")
Else
ClassLogger.Add(">> Attention: manvalue (from Input indexing is empty!!", False)
End If
End If
Next
End If
Else
ClassLogger.Add(">> INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & element.Value, False)
End If
Else
ClassLogger.Add(">> split.Length <> 2 - APattern: " & element.Value, False)
End If
Case "V"
Dim elmt = element.Value.Substring(3, element.Value.Length - 4).Split("#")
Dim split() As String = elmt
@@ -626,7 +667,7 @@ Public Class ClassImport_Windream
End If
End If
Case "V"
Case Else
ClassLogger.Add(" -Undefined pattern found in folderconvention" & vbNewLine & "Elementname: " & element.Value.ToUpper)