Skip to main content
    Country/region select      Terms of use
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

I don't know if this happens to you, but sometimes I'll start working on some little project in Notes and then get distracted and set it aside, or I'll write a handy subroutine, and then months or years later I want it again but I can't remember what database I did it in. "I know I've written this code before -- but where!?"

If you do useful reusable stuff (and you should!), it's good to put it in a common location, like my Domino Design Library Examples database, so that you can find it again easily. But sometimes I'm in a hurry, or it didn't seem likely I would want it again, or it wasn't finished yet. I have so many hundred little demo databases on my disk that keeping track of what's in all of them is a strain on the brain.

To relieve brain strain, therefore, I've created a design element search tool, which I've submitted to the Sandbox. You fill in a dialog like this:

The design element search dialog

Maybe all you remember for sure it is that it's a form you were working on last June -- you can just check Form and put in the date range to find all the forms last modified during that time. The dialog also uses a profile document to remember what was entered last time, so if you don't find it the first time, you can tweak the search parameters and try again.

After you press OK, it filters databases according to the criteria in the section with the  blue background. In this example the only selection I've made is a server (Local) and "Databases," so it won't bother looking at templates.

Having identified a set of candidate databases, the search code creates a NotesNoteCollection in each and sets the appropriate Select... property true. Any additional design element search criteria you entered in the middle, grey section, are used to create a NotesNoteCollection.SelectionFormula value such as @Matches($TITLE; "*haha_*") & @Modified < [3/17/06]

If you enter a code search in the pink section, I do a second pass on the results of the NotesNoteCollection search and convert the design elements to DXL. Then a SAX parser scans the data looking for the search string(s) you specified in the language(s) you selected.

After it's found out which databases contain a matching design element, the code makes a report like this:

Output of design element search tool

This uses the "ReportGenerator" class which was the subject of an earlier post, to create a report with doclinks to the databases of interest and a list of the matching design elements and their modified dates (to help you find the most recent version).

Download this tool from the Sandbox. I've also submitted an article to dW with a discussion of the implementation.

Andre Guirard | 28 June 2007 08:15:00 PM ET | Plymouth, MN, USA | Comments (2)


1) Love that examples database...
Kevin Pettitt | 6/29/2007 12:55:44 AM

Hi Andre,

I've used that examples database a few times in the last few months and it is really cool. Lots of innovated and slick development techniques so I highly recommend everyone check it out. I've adapted a couple of examples into cool features that will show up soon in both Blogsphere and SuperNTF. The latter is a view that shows all design elements in a database categorized by type, so no more writing lotusscript to build a list of forms or views.

As for this utility, thank you thank you thank you. Can't wait to fire it up.

2) Great stuff
Jaime Bisgrove | 1/3/2008 9:37:07 AM

I just stumbled upon this myself and it rocks. Can't honestly figure out what I have been doing without it.

 Add a Comment
Comment:  (No HTML - Links will be converted if prefixed http://)
Remember Me?     Cancel

Search this blog 


    About IBM Privacy Contact