Autor Thema: Notes Script > IBM Content Manager 8.2  (Gelesen 2097 mal)

y20frank

  • Gast
Notes Script > IBM Content Manager 8.2
« am: 12.02.06 - 14:52:59 »
Hallo zusammen,

der nachstehende Code (in einem Agent zum Testen) ruft über OLE den IBM Content Manager auf, öffnet darin die angegebene Vorgangsliste, daraus das erste Dokument und beendet dann die ganze Session wieder. Soweit funktioniert das auch alles prima!

Abär: Nach dem Aufruf des Agent verbleibt in der Taskleiste eine Instanz des IBM Content Managers (ICMClient.exe), obwohl ich meine, dass am Ende des Scriptes doch ordentlich aufgeräumt wird. Hat jemand 'ne Ahnung, was da nicht stimmt...?!  :P Danke!

Notes Client: 6.5.1 DE
IBM Content Manager Client: 8.2 - FixPack 7 und FixPack 9

Code
Sub Initialize
. . .
' Data declaration CM
      Dim ICMApp
      Dim Worklist
      Dim Docs
      Dim Doc
      Dim Item
' Application object
      Set ICMApp = CreateObject("ICMClient.Application")
' Login IBM Content Manager
      Set db_P = New NotesDatabase( "SERVER/STANDORT1/DE", "cm82\usercfg.nsf" )
      Set doc_P = db_P.GetProfileDocument("#Profil", session.UserName)
      cm_User = doc_P.cm_User(0)
      cm_Password = doc_P.cm_Password(0)
      cm_Server = doc_P.cm_Server(0)
      ICMApp.User = cm_User
      ICMApp.Password = cm_Password
      ICMApp.Server = cm_Server
      Print "Login: " & cm_User & " | " & cm_Server
      ICMApp.Logon
' Item Vorgangsliste
      Set Worklist = ICMApp.GetWorklistFromName("Team1")
' Vorgangsliste anzeigen
      Set Docs = ICMApp.Documents
      Set Doc = Docs.OpenTOC(Worklist, True, 0)
      Set Item = Worklist.NextWorklistItem
      If (Item.Type = 1) Then
         ' Dokument
            ICMApp.Image.OpenDocument Item ' <== OK, hier hat der CM noch was im Würgegriff, soweit dazu schon mal (Update 13.02.2006 7:00)
            Item.Close
      Else
         ' Ordner
            Docs.OpenTOC Item
      End If
' Sauber putzen und... Ende!
      Set Worklist = Nothing
      Set Docs = Nothing
      Set Doc = Nothing
      Set Item = Nothing
      ICMApp.Quit   ' < Verdammt, steht trotzdem noch eine Instanz im Taskmanager (Prozesse)
      Set ICMApp = Nothing
      Set db_P = Nothing
      Set doc_P = Nothing
End Sub
« Letzte Änderung: 13.02.06 - 18:26:10 von y20frank »

y20frank

  • Gast
Re: Notes Script > IBM Content Manager 8.2
« Antwort #1 am: 25.03.06 - 12:13:41 »
OK, auch wenn's schon etwas länger her ist zumindest mein erster Lösungsansatz, den IBM Content Manager von Lotus Notes aus zu "füttern". Falls es irgendwer mal gebrauchen kann... Dieser Thread ist damit erlödüscht!

Gruß
Frank

Code
Dim ICMApp
Dim Worklist
Dim Docs
Dim Doc
Dim Item
Dim session As New NotesSession
Dim db As NotesDatabase
' --- Get the application an error object
Set ICMApp = CreateObject("ICMClient.Application")
Set ICMErrorObj = ICMApp.Error
' --- Set login information
If Not ICMApp.IsLoggedOn Then
                  Set db = session.CurrentDatabase
Set db_P = New NotesDatabase( "SERVER/SERVER/DE", "data\config.nsf" )
Set doc = db_P.GetProfileDocument("($ConfigUserData)", session.UserName)
cm_User =  doc.cm_User(0)
cm_Password = doc.cm_Password(0)
cm_Server = doc.cm_Server(0)
ICMApp.User = cm_User
ICMApp.Password = cm_Password
ICMApp.Server = cm_Server
Print "Login: " & cm_User & " | " & cm_Server
ICMApp.Logon
End If
Set ItemObj = ICMApp.CreateItem(109' OLEAPI_DCUMENT=109
' --- Item-Type
ItemObj.ItemType = "DocT"
' --- Set attributes
ItemObj.SetRootCompAttributeValue "KtoNr", "99999999"
ItemObj.SetRootCompAttributeValue "Strasse", "TEST 1"
ItemObj.SetRootCompAttributeValue "Doc", "Test"
ItemObj.UpdateItem False
' --- Add part to item
ItemObj.CheckOut
ItemObj.AddPart "c:\temp\TestDok.pdf", "application/pdf", 300, 0, False 'OLEAPI_BASE=300
ItemObj.CheckIn
ItemObj.UpdateItem False
Goto clean_up
Exit Sub
' ------------------------------------------------------------
error_ICM:
ret = ICMErrorObj.ErrorCode
Print ret
Messagebox ICMErrorObj.ErrorMessage
Goto clean_up
' ------------------------------------------------------------
clean_up:
' Clean up
Set Worklist = Nothing
Set Docs = Nothing
Set Doc = Nothing
Set Item = Nothing
ICMApp.Quit
Set ICMApp = Nothing
Set db = Nothing
Set db_P = Nothing
Set session = Nothing
Set doc = Nothing

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz