MS Erweiterung IMAP

This commit is contained in:
Digital Data - Marlon Schreiber
2019-03-26 16:35:05 +01:00
parent 1d07465ca5
commit 9b9ec33533
98 changed files with 2215 additions and 349688 deletions

View File

@@ -21,7 +21,7 @@ Public Class clsWindream_allgemein
#Region "+++++ Variablen +++++"
Public Shared oConnect ' der Typ darf nicht festgelegt werden (warum auch immer... geht sonst nicht)
Public Shared oSession 'As WINDREAMLib.WMSession ' der Typ darf nicht festgelegt werden (warum auch immer... geht sonst nicht)
Public Shared oWMSession 'As WINDREAMLib.WMSession ' der Typ darf nicht festgelegt werden (warum auch immer... geht sonst nicht)
Public Shared oBrowser As New WMOBRWSLib.ServerBrowser
Public Shared oDokumentTypen As WINDREAMLib.WMObjects
Private Shared oController As New WMOSearchController
@@ -56,11 +56,22 @@ Public Class clsWindream_allgemein
Try
Try
' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
oSession = CreateObject("Windream.WMSession", GetCurrentServer)
' Connection-Objekt instanziieren
oConnect = CreateObject("Windream.WMConnect")
'MsgBox("windrem init 'ed")
Dim oHourDifference As Integer
oHourDifference = CInt(DateDiff(DateInterval.Hour, CURRENToWMSession_Created, Now))
If IsNothing(CURRENToWMSession) Or oHourDifference >= 2 Then
' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
oWMSession = CreateObject("Windream.WMSession", GetCurrentServer)
' Connection-Objekt instanziieren
oConnect = CreateObject("Windream.WMConnect")
CURRENToWMConnect = oConnect
Else
Logger.Debug("WMSession already created!")
oWMSession = CURRENToWMSession
Return True
End If
Catch ex As Exception
Return False
End Try
@@ -82,11 +93,11 @@ Public Class clsWindream_allgemein
'oConnect.Password = "pw"
' Verbindung mit Session-Objekt (und dem ausgewählten Server) aufbauen
oConnect.LoginSession(oSession)
oConnect.LoginSession(oWMSession)
Logger.Debug("windream-Server: '" & GetCurrentServer() & "'")
Logger.Debug("windream-UserName: '" & oConnect.UserName & "'")
If oSession.aLoggedin = False Then
If oWMSession.aLoggedin = False Then
Logger.Warn("Es konnte keine Verbindung mit dem windream-Server hergestellt werden")
Return False
End If
@@ -107,16 +118,17 @@ Public Class clsWindream_allgemein
'MsgBox(WMCtrl.WMServerName)
Try
oSession.SwitchEvents(WMCOMEventWMSessionNeedIndex, False)
oWMSession.SwitchEvents(WMCOMEventWMSessionNeedIndex, False)
' der Parameter WMEntityDocument definiert, dass nur Dokumenttypen und keine
' Ordnertypen ausgelesen werden
oDokumentTypen = oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
oDokumentTypen = oWMSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
Catch ex As Exception
Logger.Error(ex)
Return False
End Try
End If
CURRENToWMSession = oWMSession
CURRENToWMSession_Created = Now
Logger.Debug("Alles OK - Erfolgreich angemeldet und Session aufgebaut")
Return True
@@ -194,7 +206,7 @@ Public Class clsWindream_allgemein
Dim oRelProperties As WMObjectRelationClass
' den Objekttyp laden
oObjectType = oSession.GetWMObjectByName(WMEntityObjectType, name)
oObjectType = oWMSession.GetWMObjectByName(WMEntityObjectType, name)
' Beziehung zu Indizes des Objekttyp auslesen
oIndexAttributes = oObjectType.GetWMObjectRelationByName("TypeAttributes")
@@ -235,7 +247,7 @@ Public Class clsWindream_allgemein
Public Function GetObjecttypeByName(ByVal objekttypName As String) As WMObject
Try
' alle Objekttypen auslesen
Dim oObjectTypes As WMObjects = oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
Dim oObjectTypes As WMObjects = oWMSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
' alle Objekttypen durchlaufen und nach dem mit dem angegebenen Namen suchen
For Each oObjectType As WMObject In oObjectTypes
@@ -287,7 +299,7 @@ Public Class clsWindream_allgemein
''' <remarks></remarks>
Public Function IsLoggedIn() As Boolean
Try
Return oSession.aLoggedin
Return oWMSession.aLoggedin
Catch ex As Exception
Logger.Error(ex)
End Try
@@ -352,7 +364,7 @@ Public Class clsWindream_allgemein
''' <remarks></remarks>
Public Function GetTypeOfIndexAsIntByName(ByVal indexname As String) As Integer
Try
Dim oAttribute = oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, indexname)
Dim oAttribute = oWMSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, indexname)
Dim vType = oAttribute.getVariableValue("dwAttrType")
Return vType
Catch ex As Exception
@@ -364,7 +376,7 @@ Public Class clsWindream_allgemein
'Dim oAttribute = oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, indexname)
'Dim vType = oAttribute.getVariableValue("vItems")
'Return vType
Dim oChoiceList = oSession.GetWMObjectByName(WMEntityChoiceList, indexname)
Dim oChoiceList = oWMSession.GetWMObjectByName(WMEntityChoiceList, indexname)
If Err.Number = 0 And TypeName(oChoiceList) <> "Nothing" Then
Dim Values = oChoiceList
Values = oChoiceList.GetVariableValue("vItems")
@@ -397,7 +409,7 @@ Public Class clsWindream_allgemein
Public Function WDObject_exists(wdobj_location As String)
Dim WDObject As WMObject
Try
WDObject = oSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, wdobj_location.Substring(2))
WDObject = oWMSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, wdobj_location.Substring(2))
If WDObject Is Nothing Then
Return False
Else