Version 1.4.0.0
This commit is contained in:
@@ -136,6 +136,7 @@
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.6.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.6.0.0")>
|
||||
<Assembly: AssemblyVersion("2.7.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.7.0.0")>
|
||||
|
||||
11
app/ClassWMResulthandler/app.config
Normal file
11
app/ClassWMResulthandler/app.config
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -106,7 +106,7 @@ Public Class clsDateiverarbeitung
|
||||
|
||||
|
||||
If oArrValue Is Nothing = False Then
|
||||
' MsgBox("now indexing with: " & idxvalue)
|
||||
|
||||
windream_index.RunIndexing(WMdok, oarrIndex, oArrValue, WMObjekttyp)
|
||||
Else
|
||||
Logger.Warn("arrValue is nothing - keine Indexierung")
|
||||
@@ -206,7 +206,60 @@ Public Class clsDateiverarbeitung
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Function Archive_Document(pWMObject As WMObject, pDateOperator As String, pIntervall As Integer, pFromDate As String) As Boolean
|
||||
Dim oDateFrom As Date
|
||||
Try
|
||||
Const WMObjectEditModeLifeCycleEdit = "&H00000080"
|
||||
Const WMLifeCycleTypeArchivePeriod = 2
|
||||
|
||||
pWMObject.LockFor(WMObjectEditModeLifeCycleEdit)
|
||||
Dim oLC = pWMObject.aWMLifeCycle()
|
||||
|
||||
If pFromDate = "Now" Then
|
||||
oDateFrom = Now
|
||||
Else
|
||||
oDateFrom = CDate(pFromDate)
|
||||
End If
|
||||
Dim oDateIntervall As DateInterval
|
||||
Select Case pDateOperator
|
||||
Case "y"
|
||||
oDateIntervall = DateInterval.Year
|
||||
Case "m"
|
||||
oDateIntervall = DateInterval.Month
|
||||
Case "d"
|
||||
oDateIntervall = DateInterval.Day
|
||||
Case Else
|
||||
Logger.Warn($"ATTENTION: Following DateOperator [{pDateOperator}] is not integrated! ")
|
||||
If pWMObject.aLocked Then
|
||||
pWMObject.unlock()
|
||||
End If
|
||||
Return False
|
||||
End Select
|
||||
Dim archBis = DateAdd(oDateIntervall, pIntervall, oDateFrom)
|
||||
'Dim pArchiveDate As String = archBis.ToString("yyyy-MM-dd")
|
||||
oLC.SetPeriodEndDate(WMLifeCycleTypeArchivePeriod, archBis)
|
||||
|
||||
pWMObject.Save()
|
||||
If pWMObject.aLocked Then
|
||||
pWMObject.unlock()
|
||||
End If
|
||||
Logger.Info($"Archive-Date of file [{pWMObject.aName}] was changed successfully!")
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
Try
|
||||
If pWMObject.aLocked Then
|
||||
pWMObject.unlock()
|
||||
End If
|
||||
Catch ex1 As Exception
|
||||
|
||||
End Try
|
||||
|
||||
Logger.Error(ex)
|
||||
Logger.Info($"Unexpected error in Archive_Document [{ex.Message}]")
|
||||
Logger.Info($"oDateFrom so far is [{oDateFrom.ToString}]")
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Private Function BuildExportPath(BasePath As String, FilenameWithoutExtension As String, Extension As String, Optional Version As Integer = 1)
|
||||
Dim oFilename
|
||||
|
||||
@@ -219,63 +272,8 @@ Public Class clsDateiverarbeitung
|
||||
Return Path.Combine(BasePath, oFilename)
|
||||
End Function
|
||||
|
||||
' Alte Funktion 25.03.19
|
||||
'Public Function Export_WMFile2HDD(oWMFile As WMObject, MyExportpath As String)
|
||||
' Try
|
||||
' If Not MyExportpath.EndsWith("\") Then
|
||||
' MyExportpath &= "\"
|
||||
' End If
|
||||
|
||||
|
||||
' Try
|
||||
' Logger.Info("Working on WMFile: " & oWMFile.aName)
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Return False
|
||||
' End Try
|
||||
' Dim ExportFileIO = New WMOTOOLLib.WMFileIO ' CreateObject("WMOTOOLLib.WMFileIO") ' New WMOTOOLLib.WMFileIO
|
||||
' Logger.Debug("ExportFileIO created...")
|
||||
|
||||
' Dim oWMStream = oWMFile.OpenStream("BinaryObject", 1)
|
||||
' '### VERSIONIERUNG ###
|
||||
' Dim version As Integer = 2
|
||||
' 'Dim Stammname As String = System.IO.Path.GetFileNameWithoutExtension(Quelle)
|
||||
' Dim oFilename = oWMFile.aName.Substring(0, oWMFile.aName.LastIndexOf("."))
|
||||
' Dim oExtension = oWMFile.aName.Substring(oWMFile.aName.LastIndexOf("."))
|
||||
' Dim oTempFilename As String = MyExportpath & oFilename & oExtension
|
||||
' 'Überprüfen ob File existiert
|
||||
' Do While IO.File.Exists(oTempFilename) = True
|
||||
' oTempFilename = MyExportpath & oFilename & "_" & version & oExtension
|
||||
' version = version + 1
|
||||
' Loop
|
||||
' Logger.Debug("Exportfilename is: " & oTempFilename)
|
||||
' ' den Dateiinhalt der neuen Datei zuweisen
|
||||
' ExportFileIO.bstrOriginalFileName = oTempFilename
|
||||
' ExportFileIO.aWMStream = oWMStream
|
||||
|
||||
' 'Das eigentliche kopieren
|
||||
' ExportFileIO.ExportOriginal(True)
|
||||
' ' close the windream file stream
|
||||
' oWMStream.Close()
|
||||
' If File.Exists(oTempFilename) Then
|
||||
' clsCURRENT.EXPORTED_FILENAME = oTempFilename
|
||||
' Logger.Info($"File Export to HDD [{clsCURRENT.EXPORTED_FILENAME}]was successfull (File.Exists = True)!")
|
||||
' aktfile_Exportresult = clsCURRENT.EXPORTED_FILENAME
|
||||
' clsCURRENT.TEMP_FILES.Add(clsCURRENT.EXPORTED_FILENAME)
|
||||
' Logger.Debug("FileInfo Added to variables...")
|
||||
' Return True
|
||||
' Else
|
||||
' Logger.Warn($"Export not successfull or File.Exists = false Export: [{oTempFilename}]")
|
||||
' Return False
|
||||
' End If
|
||||
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' Logger.Info("Unexpected error in Export_WMFile: " & ex.Message)
|
||||
' Return False
|
||||
' End Try
|
||||
'End Function
|
||||
|
||||
Public Function Rename_File(WMFile As WMObject, konvention As String)
|
||||
Try
|
||||
Logger.Debug("Konvention: '" & konvention & "'")
|
||||
|
||||
@@ -287,52 +287,28 @@ Public Class clsProfil
|
||||
Case "BNS json Download".ToUpper
|
||||
Logger.Debug($"{oFileRunNo} JobType: BNS json Download")
|
||||
FileJobSuccessful = _dateiverarbeitung.BNSjsonDownload(WMdok, DR_PR_JB.Item("STRING1"), DR_PR_JB.Item("STRING2"))
|
||||
'Case "Send to printer".ToUpper
|
||||
' Logger.Info("JobType: Send to printer")
|
||||
' Dim pdfxchange = clsCURRENT.DT_TBWMRH_KONFIGURATION.Rows(0).Item("PDF_XCHANGE_LOCATION")
|
||||
' Dim printername = DR_PR_JB.Item("STRING1")
|
||||
' Dim filename = clsCURRENT.WDLAUFWERK & ":" & WMdok.aPath
|
||||
' Try
|
||||
Case "Archive Document X years from Indexdate".ToUpper
|
||||
Logger.Debug($"{oFileRunNo} JobType: Archive Document X years from Indexdate")
|
||||
If IsNumeric(DR_PR_JB.Item("STRING1")) And DR_PR_JB.Item("STRING2").ToString.Length > 0 Then
|
||||
Dim opDateValue As Object
|
||||
Try
|
||||
opDateValue = WMdok.GetVariableValue(DR_PR_JB.Item("STRING2"))
|
||||
Dim odate = CDate(opDateValue)
|
||||
Catch ex As Exception
|
||||
Logger.Info($"Could not convert value {opDateValue.ToString} to date!")
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
If Not IsNothing(opDateValue) Then
|
||||
If _dateiverarbeitung.Archive_Document(WMdok, "y", DR_PR_JB.Item("STRING1"), opDateValue.ToString) = True Then
|
||||
FileJobSuccessful = True
|
||||
End If
|
||||
End If
|
||||
|
||||
' If File.Exists(pdfxchange) = False Then
|
||||
' Logger.Warn("PDFXChange existiert nicht am Ort...")
|
||||
' Continue For
|
||||
' End If
|
||||
' Dim myProcess As New Process
|
||||
' myProcess.StartInfo.FileName = pdfxchange
|
||||
' myProcess.StartInfo.UseShellExecute = True
|
||||
' myProcess.StartInfo.CreateNoWindow = False
|
||||
' 'PDFXCView.exe / Print(): showui = yes c:\mydocument.pdf
|
||||
' Dim _argument As String = "/printto: """ & printername & """ """ & filename & """"
|
||||
|
||||
' myProcess.StartInfo.Arguments = _argument
|
||||
' Logger.Debug("Arguments: " & _argument)
|
||||
' Try
|
||||
' myProcess.Start()
|
||||
' Dim p As Process
|
||||
' p = Process.GetProcessById(myProcess.Id)
|
||||
' Dim sw As Stopwatch = New Stopwatch()
|
||||
' sw.Start()
|
||||
' Do While p.HasExited = False
|
||||
' If sw.Elapsed.TotalSeconds = 30 Then
|
||||
' Logger.Info("Still waiting (30 sec) for ending of process-id: " & myProcess.Id.ToString)
|
||||
' ElseIf sw.Elapsed.TotalMinutes = 1 Then
|
||||
' Logger.Info("Still waiting (60 sec) for ending of process-id: " & myProcess.Id.ToString & " - Exit now")
|
||||
' Exit Do
|
||||
' End If
|
||||
' Loop
|
||||
' Logger.Debug("...process has exited: ")
|
||||
' FileJobSuccessful = True
|
||||
' sw.Stop()
|
||||
' Catch ex As Exception
|
||||
' Logger.Warn("Could not print (pdfxcv) file: " & filename)
|
||||
' Logger.Error(ex)
|
||||
' End Try
|
||||
' Catch ex As Exception
|
||||
' Logger.Error(ex)
|
||||
' End Try
|
||||
|
||||
|
||||
End If
|
||||
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
@@ -43,7 +43,7 @@ Public Class clsWindream_allgemein
|
||||
' wenn ein Fehler bei der Initialisierung auftrat
|
||||
If Not Init() Then
|
||||
' Nachricht ausgeben
|
||||
Logger.Warn("Error while initializing WM-Class!!")
|
||||
Logger.Warn("Error while initializing Logger WM-Class!!")
|
||||
' das Programm "abschießen"
|
||||
Process.GetCurrentProcess.Kill()
|
||||
End If
|
||||
@@ -59,14 +59,14 @@ Public Class clsWindream_allgemein
|
||||
Try
|
||||
Dim oHourDifference As Integer
|
||||
oHourDifference = CInt(DateDiff(DateInterval.Hour, CURRENToWMSession_Created, Now))
|
||||
If IsNothing(CURRENToWMConnect) Or oHourDifference >= 2 Then
|
||||
Try
|
||||
'If IsNothing(CURRENToWMConnect) Or oHourDifference >= 2 Then
|
||||
Try
|
||||
'Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
|
||||
oWMSession = CreateObject("Windream.WMSession", GetCurrentServer)
|
||||
' Connection-Objekt instanziieren
|
||||
oConnect = CreateObject("Windream.WMConnect")
|
||||
'MsgBox("windrem init 'ed")
|
||||
Catch ex As Exception
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Could not create WMObjects Session or Connect: " & ex.Message)
|
||||
Return False
|
||||
End Try
|
||||
@@ -107,12 +107,11 @@ Public Class clsWindream_allgemein
|
||||
CURRENToWMSession = oWMSession
|
||||
CURRENToWMSession_Created = Now
|
||||
Return True
|
||||
Else
|
||||
oWMSession = CURRENToWMSession
|
||||
|
||||
Logger.Debug("oWMSession already created!")
|
||||
Return True
|
||||
End If
|
||||
'Else
|
||||
' Logger.Debug("oWMSession already created!")
|
||||
' oWMSession = CURRENToWMSession
|
||||
' Return True
|
||||
'End If
|
||||
|
||||
|
||||
|
||||
@@ -331,7 +330,7 @@ Public Class clsWindream_allgemein
|
||||
' ' Return sDrive & ":"
|
||||
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Fehlernachricht: " & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Laufwerks")
|
||||
|
||||
' End Try
|
||||
|
||||
' Return ""
|
||||
|
||||
@@ -254,21 +254,24 @@ Public Class clsWindream_Index
|
||||
End If
|
||||
' wenn der Datei noch kein Dokumenttyp zugewiesen wurde
|
||||
If oDocument.aObjectType.aName <> Objekttyp Then
|
||||
Logger.Debug($"aObjectType.aName: [{oDocument.aObjectType.aName}] <> Objekttyp: [{Objekttyp}]")
|
||||
' ihr den entsprechenden Dokumenttyp zuweisen
|
||||
oDocument.aObjectType = oWMSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityObjectType, Objekttyp)
|
||||
Try
|
||||
oDocument.Save()
|
||||
Catch ex As Exception
|
||||
' wenn es einen Fehler beim speichern gab, dann konnte auch kein Objekttyp gesetzt werden -> es kann also auch keine
|
||||
' Indexierung stattfinden und die Indexierung muss nicht fortgesetzt werden
|
||||
Logger.Warn($"ATTENTION: COULD NOT SET OBJECTTYPE: [{ex.Message}]")
|
||||
Return False
|
||||
End Try
|
||||
' WMObject.aObjectType = selectedProfile.Dokumenttyp
|
||||
Logger.Debug("Objekttyp war Standard und wurde in '" & Objekttyp & "' geändert.")
|
||||
Else
|
||||
Logger.Debug("Objekttyp war bereits gesetzt")
|
||||
End If
|
||||
|
||||
Try
|
||||
oDocument.Save()
|
||||
Catch ex As Exception
|
||||
' wenn es einen Fehler beim speichern gab, dann konnte auch kein Dokumenttyp gesetzt werden -> es kann also auch keine
|
||||
' Indexierung stattfinden und die Indexierung muss nicht fortgesetzt werden
|
||||
Return False
|
||||
End Try
|
||||
|
||||
|
||||
'Jetzt jeden Indexwert durchlaufen
|
||||
For Each aName As String In Indizes
|
||||
@@ -382,7 +385,7 @@ Public Class clsWindream_Index
|
||||
Case Else
|
||||
Logger.Debug("Typ des windream-Indexes konnte nicht bestimmt werden!")
|
||||
Logger.Debug("Versuch des Auslesens (vType): " & vType)
|
||||
'MsgBox(vType & vbNewLine & CStr(value), MsgBoxStyle.Exclamation, "Marlon-Case Else")
|
||||
|
||||
convertValue = ""
|
||||
End Select
|
||||
If vektor = False Then
|
||||
@@ -583,18 +586,20 @@ Public Class clsWindream_Index
|
||||
|
||||
Return False
|
||||
Else
|
||||
' MsgBox("Dokument ist gesperrt, Indexierung erst im nächsten Durchlau", MsgBoxStyle.Critical)
|
||||
Logger.Warn("Dokument ist gesperrt, Indexierung erst im nächsten Durchlauf!")
|
||||
|
||||
Logger.Warn("Document is locked, no indexing!")
|
||||
'oDocument.unlock()
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||
|
||||
Logger.Error(ex)
|
||||
'clsLogger.AddError(ex.Message, "ClassSearchResult.RunIndexing")
|
||||
oDocument.Save()
|
||||
oDocument.unlock()
|
||||
If oDocument.aLocked Then
|
||||
oDocument.unlock()
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Try
|
||||
End Function
|
||||
@@ -615,7 +620,7 @@ Public Class clsWindream_Index
|
||||
IndexwertAusWindream = _dok.GetVariableValue(_indexname)
|
||||
Return IndexwertAusWindream.ToString
|
||||
Catch ex As Exception
|
||||
'MsgBox(ex.Message)
|
||||
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user