How to export the contents of a Domino.Doc Library on the local file system? (part I)

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

Steps

  1. Download OpenLog on the local machine and configure a database to store the logs generated from exports.
  2. 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.
  3. Change the ACL of the database and sign the database with the ID notes above.
  4. Open the application edomdoc.nsf in the Notes Designer.
  5. 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”
  6. 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).

    Stay tuned.

    6 pensieri su “How to export the contents of a Domino.Doc Library on the local file system? (part I)

    1. Ciao,
      è possibile fare il procedimento inverso?
      Creare un nuovo documento in Domino.Doc partendo dal Local File System?

      Grazie

    2. Pingback: Domino.Doc Migration Related Links

    3. We stumbled over here by a different web address and thought I should
      check things out. I like what I see so now i’m following
      you. Look forward to exploring your web page yet again.

    4. Write more, thats all I have to say. Literally, it
      seems as though you relied on the video to make your point.
      You clearly know what youre talking about,
      why throw away your intelligence on just posting videos
      to your blog when you could be giving us something informative to read?

    5. è da cinque giorni сhe navigo e questo articolߋ è la prima cosa attraente
      chhe vedo. Realmente apprezzabile. Se tutte lle persone che creano contenuti Ƅadaѕssero a dare materiale brillante come queѕto la rete sarebbe certamente più facile dɑ visitare.
      Continua così!

    Lascia un commento

    Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *