Genii Weblog

Making db link hotspots from your bookmarks (with Midas)

Thu 27 Apr 2006, 11:41 PM



by Ben Langhinrichs
Show and tell ThursdayThis came up as a request from the IBM Business Partner forum, but I thought I'd share it.  Alan Lepofsky asked:
After working with Notes at IBM for over a decade, I have several hundred DB icons on my Workspace.   I'd say I only use a dozen or so on a daily basis.

I'd like to dramatically clean up my Workspace, remove icons, even remove entire pages.   However, I know the day I do it is going to be the day I need "that link I was sent a few years ago about X".

I'm thinking an agent could scans all the tabs, and creates a document (or email) with links to all my DBs.   I can then save that document as a backup.
 

So, here goes.  This tip requires use of our Midas Rich Text LSX, but if you happen to already have it (a heck of a lot of people do, and probably a fairly high percentage of my readers, but if you don't, why not?):

Option Public
Option Declare
Uselsx "*lsxrtc"

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim doc As NotesDocument
   Dim currentdb As NotesDatabase
   Dim newdoc As NotesDocument
   Dim view As NotesView
 
   Dim rtitem As New GeniiRTItem
   Dim new_rtitem As New GeniiRTItem
 
   Dim count As Integer
 
   Set currentdb = session.CurrentDatabase
   Set newdoc = New NotesDocument(currentdb)
   newdoc.Form = "Example Form"
   newdoc.Subject = "Bookmarks"
   Call new_rtitem.CreateBackend(newdoc.Handle, "Body")
 
   Set db = New NotesDatabase("", "")
   Call db.Open("", "bookmark.nsf")
   Set view = db.GetView("(All Bookmarks)")
 
   Set doc = view.GetFirstDocument
   count = 0
   While Not (doc Is Nothing)
      count = count + 1
      Call rtitem.ConnectBackend(doc.Handle, "URL")
      If rtitem.Everything.LinkReplicaID <> "" Then
         Print doc.Title(0)+":"+rtitem.Everything.LinkReplicaID
         Call new_rtitem.Everything.AppendLink(doc.Title(0), rtitem.Everything.LinkReplicaID)
         If count Mod=Then
            Call new_rtitem.Everything.AppendNewlines(0, True)
         Else
            Call new_rtitem.Everything.AppendNewlines(1, False)
         End If
      Else
         Print doc.Title(0)+":undefined"
      End If
      Set doc = view.GetNextDocument(doc)
   Wend
   Call new_rtitem.Save
End Sub

Copyright © 2006 Genii Software Ltd.

What has been said:

No documents found