What You Need:
- a PC running Lotus Notes, Lotus Notes Designer, a Domino.Doc Desktop Enabler full installation (with the Domino.Doc API), enough disk space to hold the exported documents;
- a Lotus Notes id with full permissions for the Domino.Doc library (the Domino.Doc id administrator usually is fine);
- the OpenLog, an open source application available on OpenNtf.org
- Download OpenLog on the local machine and configure a database to store the logs generated from exports.
- Download from the link (in the Part II post) the application edomdoc.nsf and store it in the data directory of the Lotus Notes client.
- Change the ACL of the database and sign the database with the ID notes above.
- Open the application edomdoc.nsf in the Notes Designer.
- Follow the instructions in the OpenLog database in order to enable logging in the edomdoc.nsf: the Script Library OpenLogClass and OpenLogFunctions are inside the edomdoc.nsf db, so you just need to change the line in the Sub Initialize with the right name of the OpenLog db you created above.
logDbName = “OpenLog1_5Apache.nsf”
- Open the PopolaCabinets agent and modify the line 31 with the Lotus Notes id password and the line 32 with the path to the Domino.Doc server library (similar action is required for the EsportaCabinet agent).
Option Public Use "OpenLogFunctions" Sub Initialize Dim theApi As Variant Dim theLibrary As Variant Dim theCabinets As Variant Dim theCabinet As Variant Dim theRooms As Variant Dim theRoom As Variant Dim theBinder As Variant Dim theField As Variant Dim theDocuments As Variant Dim theNewDocument As Variant Dim theProfile As Variant Dim isalink As Boolean Dim Dbs As NotesDatabase Dim dbDoc As Notesdatabase Dim docNew As NotesDocument Dim ses As New NotesSession On Error Goto ErrLog Set dbs = ses.CurrentDatabase ' Create the Api object Set theApi = CreateObject("DominoDoc.API") 'Connect to a domdoc server using Notes Call theApi.SetNotesLogin("<lotus notes id password>") Set theLibrary = theApi.GetLibrary("notes://<domino.doc server name>/<library name>.nsf") 'Get the Cabinets object from the Library Set theCabinets = theLibrary.Cabinets Dim c As Long c=theCabinets.Count For b = 0 To (c-1) Set theCabinet = theLibrary.Cabinets.ItemByIndex(b) title$ = theCabinet.Title Set docNew = dbs.CreateDocument docNew.form = "Cabinet" docNew.cName = title$ docNew.cId = theCabinet.Id Dim p As Long p = theCabinet.Binders.Count docNew.cNumBinders = p Print ("Caricamento del cabinet " & Cstr(b) & " - " & title$ & " - Num Binders " & Cstr(p)) quanti% = 0 For q = 0 To (p-1) Set theBinder = theCabinet.Binders.ItemByIndex(q) Set theDocuments = theBinder.Documents quanti% = quanti% + theDocuments.Count Next docNew.cNumDocuments = quanti% Set theRooms = theCabinet.Rooms Dim z As Long z=theRooms.Count If z > 0 Then For x = 0 To (z-1) Set theRoom = theRooms.ItemByIndex(x) Call docNew.AppendItemValue("cRooms", theRoom.Title) Next End If docNew.cBinderDb = theCabinet.BinderDatabase Call docNew.Save(True,False) Set docNew = Nothing Next ' Print("Fine elaborazione.") Exit Sub ErrLog: Call LogError Exit Sub End Sub
The PopolaCabinets agent reads all the cabinets info in the library and for each cabinet it creates a Cabinet notes document.
Run this agent from the Lotus Notes client. It may requires some time depending from the cabinets and binders number and from the CPU and network speed.
Now you have the Cabinets view populated with many documents: a document for each cabinet.
You can select one or more Cabinet(s) and execute the EsportaCabinet action: voilà!
The part II is coming soon (may be tomorrow).