184 lines
7.5 KiB
VB.net
184 lines
7.5 KiB
VB.net
'Imports WINDREAMLib.WMCOMEvent
|
|
Imports Scripting
|
|
Public Class frmMI_Profilhinzufuegen
|
|
Public oSession
|
|
Protected _windream As New ClassWindream_allgemein(CURR_LogConfig)
|
|
'Public oSession
|
|
'Public oConnect
|
|
'Public oBrowser As New WMOBRWSLib.ServerBrowser
|
|
|
|
|
|
'Sub New()
|
|
|
|
' ' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
|
|
' InitializeComponent()
|
|
|
|
' ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
|
' 'Me.oSession = CreateObject("Windream.WMSession")
|
|
' Me.oSession = ClassMerkatorIntegrationWindream.oSession
|
|
|
|
'End Sub
|
|
|
|
|
|
Private Sub frmProfilHinzufügen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
|
|
|
Try
|
|
' Verbindung mit windream herstellen
|
|
Me._windream.Init()
|
|
ClassMI_Profile.Init()
|
|
Catch ex As Exception
|
|
MsgBox("Es konnte keine Verbindung zum windream-Server hergestellt werden.", MsgBoxStyle.Critical, "Fehler beim Zugriff auf windream-Server")
|
|
End Try
|
|
|
|
Me.AcceptButton = Me.btnOK
|
|
Me.CancelButton = Me.btnAbbrechen
|
|
|
|
|
|
Try
|
|
Me.oSession = Me._windream.oWMSession
|
|
Catch ex As Exception
|
|
MsgBox("Es konnte keine Verbindung zum windream-Server aufgebaut werden, da er nicht erreichbar war." & vbNewLine & "Bitte wenden Sie sich an ihren windream-Administrator.", MsgBoxStyle.Critical, "windream-Server nicht erreichbar")
|
|
End Try
|
|
|
|
' Verbindung mit windream herstellen
|
|
'Me._parentClass.Windream.Init()
|
|
|
|
Me.txtProfilname.Text = ""
|
|
Me.cmbObjekttyp.SelectedIndex = -1
|
|
Me.txtServername.Text = ""
|
|
Me.txtWdfSuche.Text = ""
|
|
Me.chkSuchmaskeZeigen.Checked = True
|
|
|
|
Me.ObjekttypenEintragen()
|
|
End Sub
|
|
|
|
|
|
|
|
Private Sub btnAnlegen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
|
|
If Me.txtProfilname.Text.Length > 0 And Me.cmbObjekttyp.SelectedIndex <> -1 And Not Me.txtWdfSuche.Text = "" Then
|
|
If Not ClassMI_Profile.Exists(Me.txtProfilname.Text) Then
|
|
ClassMI_Profile.Add(Me.txtProfilname.Text, Me.cmbObjekttyp.SelectedItem, _windream.GetCurrentServer, _
|
|
Me.chkSuchmaskeZeigen.Checked, Me.txtWdfSuche.Text)
|
|
Me.Close()
|
|
Else
|
|
MsgBox("Der angegebene Profilname existiert bereits.", MsgBoxStyle.Information, "Ungültige Eingabe")
|
|
End If
|
|
Else
|
|
MsgBox("Es wurden nicht für alle Pflichtfelder ein Wert angegeben. Bitte überprüfen Sie nochmals Ihre Angaben.", MsgBoxStyle.Information, "Fehlende Angabe zum Erstellen eines Profils")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnAbbrechen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAbbrechen.Click
|
|
Me.Close()
|
|
End Sub
|
|
|
|
|
|
|
|
'''' <summary>
|
|
'''' liest das Windream-Laufwerk aus
|
|
'''' </summary>
|
|
'''' <returns></returns>
|
|
'''' <remarks></remarks>
|
|
'Public Function GetWindreamDriveLetter() As String
|
|
|
|
' Try
|
|
' Dim oControl As AISCONTROLDATACOMLib.AISControlData
|
|
' Dim sDrive As String = ""
|
|
|
|
' oControl = New AISCONTROLDATACOMLib.AISControlData
|
|
|
|
' sDrive = oControl.GetStringValue(&H10040003)
|
|
|
|
' Return sDrive & ":"
|
|
|
|
' Catch ex As Exception
|
|
' MsgBox("Fehlernachricht: " & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Laufwerks")
|
|
' Return ""
|
|
' End Try
|
|
'End Function
|
|
|
|
|
|
Private Sub ObjekttypenEintragen()
|
|
|
|
Me.cmbObjekttyp.Items.Clear()
|
|
|
|
Dim oDokumentTypen As WINDREAMLib.WMObjects = _windream.GetObjecttypesAsObjects()
|
|
|
|
If oDokumentTypen Is Nothing Then Exit Sub
|
|
|
|
For Each objType In _windream.GetObjecttypesAsObjects 'oDokumentTypen
|
|
Me.cmbObjekttyp.Items.Add(objType.aName)
|
|
Next
|
|
End Sub
|
|
|
|
'Public Function Init()
|
|
|
|
' Try
|
|
' ' wenn windream nicht angemeldet ist
|
|
' If Not ClassMerkatorIntegrationWindream.IsLoggedIn Then
|
|
|
|
' ' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
|
|
' ClassMerkatorIntegrationWindream.oSession = CreateObject("Windream.WMSession", ClassMerkatorIntegrationWindream.GetCurrentServer)
|
|
' ' Connection-Objekt instanziieren
|
|
' ClassMerkatorIntegrationWindream.oConnect = CreateObject("Windream.WMConnect")
|
|
|
|
' ' Art der Anmeldung an windream festlegen
|
|
' ' 0x0L (also 0) = Standard windream Benutzer
|
|
' ' WM_MODULE_ID_DOCTYPEEDITOR_LIC = ermöglicht Zugriff auf die windream Management Funktionen (Z.B. zur Verwaltung der windream Dokumententypen, Auswahllisten, etc.)
|
|
' ' WM_MODULE_ID_INDEXSERVICE = ermöglicht der Session die Indexierungs-Events vom windream DMS-Service zu empfangen
|
|
' ClassMerkatorIntegrationWindream.oConnect.ModuleID = 0
|
|
|
|
' ' setzt die minimal erwartete windream-Version
|
|
' ClassMerkatorIntegrationWindream.oConnect.MinReqVersion = "3"
|
|
|
|
|
|
' ' -- Impersonifizierung nur möglich mit registry-eintrag --
|
|
' ' oConnect.UserName "\schulung\windream"
|
|
' ' oConnect.Password "windream"
|
|
|
|
' ' Verbindung mit Session-Objekt (und dem ausgewählten Server) aufbauen
|
|
' ClassMerkatorIntegrationWindream.oConnect.LoginSession(ClassMerkatorIntegrationWindream.oSession)
|
|
|
|
' If ClassMerkatorIntegrationWindream.oSession.aLoggedin = False Then
|
|
' MsgBox("Es konnte keine Verbindung mit dem windream-Server hergestellt werden", MsgBoxStyle.Exclamation, "Verbindung konnte nicht hergestellt werden")
|
|
' Return False
|
|
' End If
|
|
|
|
|
|
' ClassMerkatorIntegrationWindream.oSession.SwitchEvents(WMCOMEventWMSessionNeedIndex, False)
|
|
|
|
' ClassMerkatorIntegrationWindream.oDokumentTypen = ClassMerkatorIntegrationWindream.oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
|
|
|
|
' End If
|
|
|
|
' Return True
|
|
|
|
' Catch ex As Exception
|
|
' If Err.Number = -2147220985 Then
|
|
' MsgBox("Die installierte windream-Version ist nicht ausreichend für den Betrieb des eclipseIndexers. Bitte setzen Sie sich mit Ihrem Service-Vertragspartner dahingehend auseinander." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & Err.Description, MsgBoxStyle.Exclamation, "Unzureichende windream-Version")
|
|
' Else
|
|
' MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Login an windream")
|
|
' End If
|
|
' Return False
|
|
' End Try
|
|
|
|
'End Function
|
|
|
|
Private Sub btnWdfSuche_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWdfSuche.Click
|
|
If Me.dlgWindreamSuche.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
|
Me.txtWdfSuche.Text = Me.dlgWindreamSuche.FileName
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub btnWdfSucheLöschen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWdfSucheLöschen.Click
|
|
Me.txtWdfSuche.Text = ""
|
|
End Sub
|
|
|
|
Private Sub txtWdfSuche_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtWdfSuche.TextChanged
|
|
If Not Me.txtWdfSuche.Text = "" Then
|
|
Me.btnWdfSucheLöschen.Enabled = True
|
|
Else
|
|
Me.btnWdfSucheLöschen.Enabled = False
|
|
End If
|
|
End Sub
|
|
End Class |