December 23rd, 2008

DocMaster 4.2.14 Released

Below are two zip files: the DocMaster template, and the help file. This version of DocMaster was written using Notes 8.0.2, but makes very little use of R8 features (i.e. it should still work with R7 or even R6.5). See the help file for setup instructions.

DocMaster_R4.2.14.zip

DocMaster_R4.2.14_HELP.zip



April 10th, 2007

Revision History

A number of people have asked for a copy of the Revision History template, so here it is. You can use it in the following manner: Either manually copy the appropriate design elements into the target application, or set up Teamstudio Design Manager to do it.. Typically this takes 2 or 3 minutes, and about 200 hours of development have been added to the application - that makes developers look really good!

Revision History was created in about 1997 or so, and has been continuously updated and improved since then. This database is both a fully working design, and can be used as a template. You can play with it to get an idea of how it works. Probably the most important feature is that is can provide a watertight audit trail to changes in a database. Old versions of documents can be in the current or an archive database. And users can view these old versions, or roll back to them if required.

While there is some reasonable documentation, I make no apology for the fact that this is a development  application - it is not a finished product. However you may find it useful as a source of ideas, or you can even use it as is, by incorporating it into your design.

LibraryRevHistory_R5_DEV.zip



April 19th, 2006

Drill Down Views in Notes

In The View Nov/Dec 2001 (page15) Damien Katz wrote a short article on a technique for "faking" response documents. (Also see his very interesting articles on the R6 formula engine rewrite and the Formula Language's dirty secret.) This "fake response docs" technique can be used to create drill down lists in Notes. A very useful example of this is a hierarchical corporate directory, showing who reports to whom, and how many direct and indirect reports people have. Use this to drill down from the CEO to the janitor, and see the complete chain of command. Typically this information is updated automatically from the HR system every day, and is a LOT easier to manage and use that the endless out of date Visio diagrams that float around organizations. Recently I posted a screen shot of this type of directory, and Scott Giesbrecht asked me to describe how to do it - so here are the details.

Response documents have $Ref field which contains the UNID of the parent document. If a view's properties are set to "Show response documents in a hierarchy", and $Ref field exists on document "A" containing the UNID of parent document "B", then the view index makes document "A" a response of document "B".

Damien's technique is to use a FakeRef field with the UNID of the intended parent, and then use the view selection formula to set (i.e. fake) $Ref on all documents to the value in the FakeRef field - just for that view. This causes the view to be built with those documents as responses to their parents.

In the sample code posted at the  end of this article, each person document has a FakeRef field called "ManagerUNID" that contains the UNID of their manager. (See Notes 1 & 2 below) The only way I have got this to work is to use the LotusScript "MakeResponse" method of the document - see the code fragment below, which is part of a loop processing all documents. The parent doc is "docManager", and the person document is "doc'. This code runs in an agent that updates the values of the ManagerUNID fields after updated data has been manually entered or imported from the HR system. (See Note 3 below)

Call doc.MakeResponse ( docManager )      'Makes the person doc a response to the manager doc.
Set item = doc.GetFirstItem ( "$Ref" )
Call doc.ReplaceItemValue ( "ManagerUNID", item )      'Creates the FakeRef field
Call doc.RemoveItem ( "$Ref" )      'Removes $Ref so the person doc is no longer a response.
Call doc.Save ( True, True )

Now that evey document has it's parent defined, we are ready to create the drill down view (the Org Chart view in the sample code). To do this we fool the view into thinking that a document has a $Ref field by adding a line to the view's selection formula:

DEFAULT $Ref := ManagerUNID ;         'ManagerUNID is the FakeRef field in the sample code

And, in Damien's words, "This is all it takes". Remember that Notes limits you to 32 levels of response documents, but this is more than adequate for corporate hierarchies.

OrgChart.jpg


When you open the sample code, go to People by... Org Chart. Then expand all. You can experiment by adding people to the hierarchy. After adding people run the "Manual Org Chart refresh" agent (Under the View button).
Click link to download file
CorporateDirectory.zip


Note 1

For a document to appear as a response in a view, the FakeRef field (ManagerUNID in this example) MUST contain the hex / binary value of the UNID, and NOT the ASCII version (i.e. @text(@documentUnid) will not work.). The original article in The View was a little unclear here. If a field contains the hex / binary value of a UNID and that field shows on a form, then the contents of the field will appears as a doclink to the parent document. To see this in action, put the $Ref field on a response document form. Then open any response document created with that form in the Notes client. Instead of the UNID of the parent doc showing, you see a doclink to that parent document.

Note 2

You are not limited to just one FakeRef field - you can have several. Each view that uses fake response documents would select the appropriate FakeRef field. This is how one document can have different parents in different views.

Note 3

Heaven is when the HR system exports it's data with canonical names. This makes it trivial to update people's managers, and add the ManagerUNID field. Unfortunately this seldom seems to be the case, so you must find some way of linking manager names from the HR system to the canonical names used by Notes. The next best is when you have unique employee ID numbers, but some HR departments treat these like social security numbers and do their best to hide them. If that happens, you need a routine that somehow uniquely identifies people so that the update agent can put the correct name in the manager field. For more thoughts on the problems of names, see When is a name not a name?.



March 11th, 2006

DocMaster - Single Database Document Manager

When I started working with Notes in 1994, one of the first things I developed was a "Help" database. Over the years this has travelled with me and been used at almost every company I have worked at in one form or another. With input from dozens of people the original Help database has grown into a single database document manager called "DocMaster". A number of people have asked me to post the code, so here it is.

Bear in mind that this is NOT a commercial product; it is unpolished working code with some documentation. The database is both the help file, and the template. Email me with any questions.



DocMaster


Document management systems range from managing papers in a folder up to managing libraries of documents. There are many high end document management systems on the market, for example Domino.Doc or Documentum. If you think of these systems as a library, you can think of DocMaster as a filing cabinet. While there are many libraries in the world, there are many more filing cabinets. And if document collections grow to big for filing cabinets, they can be moved into the larger systems.

DocMaster is a "Single Database Document Manager" that is a place to manage collections of loosely related documents. Although DocMaster is structured like a traditional book, you don't read it as you would read a novel. Rather you read it as you would read a technical manual - typically you find the content you want and then do something with it, e.g. make a decision.

Typical Uses for DocMaster

  • Corporate policies, procedures and standards.
  • User manuals.
  • Help documentation for Notes databases.
  • Design notes for in-house software.
  • All information on a particular project, e.g. a software upgrade. The next time that software is upgraded, all the notes etc. are in one place.
  • All information on a particular piece of equipment, including user manuals, repair notes etc.
  • A shared collection of links, pdf docs etc. on a particular subject.
  • "Living" documents that often change.
  • Meeting agendas and minutes.

DocMaster is easy for end users

  • It uses a "Book" metaphor with a Table of Contents, an index, glossary of terms and a FAQ.
  • It can use the same 3 pane interface as email, and uses folders as email does.
  • It supports full text searching of all content.

DocMaster is easy to work with

  • It is simple to set up, and easy to customize and includes tools to customize it for common uses.
  • There is security, with document owners, editors, authors and readers.
  • Work is tracked as it progresses, and you can easily see what remains.
  • Audit trails. Tracks who did what, when and why. You can view or recover earlier  versions of documents.
  • Highly customizable sorting: by date (up or down), by title or by doc number.
  • Templates to control title format, date, author or many other fields. Templates can include content. Folders can be linked to templates so documents are created with standard settings (e.g. sorting).
  • Document counter show total number of documents per folder, person, department etc.
  • Tracks the size of documents.
  • Any folder can have its own help documents, or one help document can be shared amongst several folders. The folder help document describes the purpose of the folder.

Advanced features

  • Use Template documents to create documents with the same initial content.
  • Add your own document types.
  • Use "shared text" to include the same text in multiple places. Update the shared text once, and it is updated everywhere.



February 26th, 2006

Teamstudio Seminar in New York

Last week I presented "Notes Management Best Practices" at the Teamstudio seminar in New York. Decided to take the red-eye on Tuesday night, flying Jet Blue. Well, Jet Blue was great; but flying the red eye was not such a good idea! After a 4 hour flight from San Diego I arrived at the Dylan hotel, only to crash and sleep until after lunch. Then went for a short walk - toured Grand Central station (I love trains, so this was great fun) and walked down Park Avenue until the cold got a bit much. Wednesday evening I had dinner with the Teamstudio team at the Chemist Club restaurant- it was great to finally meet the folk behind the emails & phone calls. I must say that the bread in New York tastes much better than most of the bread you find on the west coast.

TSdinner.jpg

Dinner with the Teamstudio Team at the Dylan Hotel, New York.


Thursday morning saw us assemble at 8:00am in the Dylan conference room. First off with the Keynote address was Ed Brill from IBM with a look at where Notes is going for the next few years. As somebody who didn't make it to Lostusphere this year, the presentation was very interesting. After a short talk by Nigel Cheshire on "Building a Strategic Plan for Best Practices" it was my turn to present "Best Management Practices for Lotus Notes". Using the analogy of a ship, this presentation focused on how to steer the ship rather than how to make the engine run efficiently. Based on the audience feedback at the end of the day, it seemed that most people found the presentation useful. Jesse  Segovia from Elanza Group had the tough after lunch session, and was later followed by Rob Axelrod from Technotics. Rob is an excellent speaker, and made a very enjoyable presentation on the development process and build automation. We finished the day at about 4:00pm, just in time to catch heavy traffic back to the airport. The flight back to San Diego to over 6 hours, and culminated with an aborted landing due to fog. I finally crawled into be at 1:00am after a very long day.

For reference, my presentation is attached in Power Point format.
Click link to download file
NotesBestPractices43.ppt



August 6th, 2005

Using Version Numbers to Manage Database Designs

Notes templates are marvelously powerful. But that power comes at a cost - templates and database designs must be managed effectively. For any given inhouse developed database, how you do know which version of the design is in production? While this is a problem on servers, it can be a much bigger problem with remote users who replicate databases down to their laptops. When they call the helpdesk, how does the support person know which version of the database is being used? Multiply this by the thousands of databases used at a typical corporate site, mix in a few replication problems and you have a nightmare.

One solution is to use a configuration document to track the database version. This document is updated with the new database version number whenever a new design is pushed into production. With a one-to-one relationship between development and production databases, it is difficult to keep everything in sync. Whith multiple databases from one template it becomes almost impossible. Some people try to track database versions by looking at the date and time on design elements. This is really clumsy and only works on the server;  it fails on a remote laptop if the user doesn't have the designer client available.

How much better it would be to have the design stamped automatically with the template version. To do this you need a design element (as opposed to a document like the configuration document above). The last design step before pushing a new version of the code is to update the version number of the design element. While a page or form could be used, typically a shared field is used because it is more flexible. Since a shared field is a design element, it flows into the production database during a design refresh, like any other design element. This unambiguously identifies the design version being used in production and very neatly solves the problem.

Implementation


In R5 you would use a computed shared field, and set the value of the field the release version, e.g. DocMaster R4.0.40. Release 6.5 moved this idea into core Notes functionality, and you can see an example of it in the mail file. Look at the mail file's Database properties... Design properties (middle tab) and you will see a version number something like 6.5.4 (03/09/2005).  This information comes from a shared field called $TemplateBuild. The example below is from a database called DocMaster. Notice how this production database is based on the master template DocMaster R4 PRD, which is in turn based on the development template DocMaster R4 DEV

DbPropertiesDbVersion.gif


If you look at the properties of $TemplateBuild shared field in designer (see below), you will see 3 items on the design element document. (Note: Just like normal documents have items, so design elements have items.) You can access the template version number with a new @function, @TemplateVersion. (Unfortunately there is a bug: @TemplateVersion doesn't work in computed text. You must use a computed for display field).

SharedFieldDesignElement.gif


You can use the new R6 NotesNoteCollection classes to manipulate these item values. I have written a small database Set Template Version (see download link below) that allows you to update these 3 items. Launch the database and follow the instructions in the diagram below. If the $TemplateBuild shared field is not present, it is added to your database.  (Note: if you use Teamstudio CIAO you may get prompted to check out the design element. Select yes, and then use CIAO to check it back in again. This should be the last step before making the new version of the database.) Be aware that the master template does not show  the version information on the design tab of the database properties (because it is not inheriting a design). However, any database that inherits from that template will show the version information on the design tab.

SetTemplateVersion.gif


If you launch Set Template Version from the designer client, you can see templates as well as databases when you click the Click to start button. To launch form designer, create a new button on the toolbar, and give the button the formula

@Command([FileOpenDatabase]; "Dev\\Projects\\TemplateVersion\\TemplateVersion.nsf")

Replace the path above with the path to the database on your system. Thanks to Chad Schelfhout for this suggestion, and for pointing out an error which has since been fixed.

Click link to download file
TemplateVersion.zip