Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Table of Contents
Chapter 7: Standard Templates......................................................................................................1
Overview................................................................................................................................1
The Mail Template.................................................................................................................1
The Personal Address Book Template..................................................................................2
The Discussion Template......................................................................................................3
The Document Library Templates..........................................................................................4
Summary................................................................................................................................5
Chapter 7: Standard Templates
Overview
By Richard Schwartz
Notes and Domino provide powerful tools for the development of custom applications. Many Notes
and Domino users, however, are totally unaware of this fact. They know only that their company
uses Notes and Domino for e−mail, calendaring, and address books. Others know only that it
provides e−mail and online discussion facilities. What they don't know is that IBM engineers have
built all the most popular features of Notes and Domino using the same programming tools that are
available to every Notes and Domino programmer for custom applications.
The features of Notes and Domino that end−users know best and that are responsible for much of
the popularity of the products are built from ordinary Notes and Domino templates. Every Notes and
Domino programmer can examine those templates to learn how those features work.
Notes and Domino ship with more than 30 different template files. Many are employed in system
administration tasks and are unfamiliar to most users; others are extremely useful for learning how
to develop your own applications.
This chapter briefly describes the templates that are most familiar to end users: the Mail template,
the Personal Address Book template, the Discussion template, and the Document Library template.
Note IBM released an alternative Web user interface, known as iNotes Web Access, for
Domino R5. iNotes takes advantage of the advanced features of the latest browser
versions and is therefore able to provide a slicker and more seamless user
interface for mail and calendaring in a browser. The version of iNotes for Domino 6,
however, was not ready to ship at the time that the rest of Notes and Domino 6
were available; however it will be a part of Notes/Domino 6.0.1. Also, IBM wants to
protect its intellectual property investment in iNotes and deliberately obfuscated
some of the code. This book, therefore, can't cover the workings of the iNotes Web
Access template.
The Mail template is, of course, the place to go to find out how to work with e−mail messages in
your applications. Of course, the Mail template has evolved over many years and many releases of
Notes and Domino, and some of the things that you will find in it are not necessarily always done
with the easiest techniques available in Notes and Domino 6. In the Memo form, for example, some
action buttons are used in the Notes client, and duplicate action buttons perform the same
functionality and are used in a Web browser. The Notes client versions are hidden from Web
browsers, and vice versa. This works, but there's a better way of doing this in Notes and Domino 6,
which you find out about in Chapter 16.
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited
Lotus Notes and Domino 6 Programming Bible 2
The Memo form has many other interesting characteristics. The Send action programmed for the
Notes client uses Notes Formula language to execute @Command([FileCloseWindow]) in
combination with the Present Mail Send Dialog property on that form to cause the message to be
sent. The Send action for the browser is written in JavaScript, and it simply submits the message to
the server, where a WebQuerySave agent called wMemo is invoked. The agent sets the value of
the reserved item MailOptions to 1 to accomplish the same thing. The Memo form uses the
reserved fields SendTo, CopyTo, and BlindCopyTo for addressing. Any form using these same field
names can be addressed and mailed by Notes and Domino.
One of the most interesting parts of the mail template is the Calendaring and Scheduling (C&S)
area. Creating calendars can be tricky if you have never done it before. The Help file is a pretty
good start, but there are more advanced features that you will want to use in your applications —
and most of these are showcased in the C&S area of the mail template. However, you should avoid
the temptation to copy design elements from the mail template and attempt to shoehorn them into
your own application. The C&S area of the Notes 6 mail template is one of the most complicated
features in any Notes application and is comprised of literally dozens of design elements, most of
which would make no sense in an application outside of a mail template. A better approach to
utilizing the mail template in general, and the C&S features specifically, is to examine how certain
features are accomplished. For instance, there are great examples of using the
NotesUIView.RegionDoubleClick (for doing things like composing new documents from the date
that is double−clicked), NotesUIView_.PostEntryResize (for resizing appointment times in the view
and recording it to the underlying document), and much more. There are even two really good
examples of building LotusScript classes to make it easy to handle an otherwise exceedingly
complex task — the CSEventClass and CSUIViewClass, which are housed in LotusScript Libraries
of the same name. Therefore it is recommended that you get inspiration from the C&S feature in the
Notes mail template, but don't try copying it outright from the template itself.
Users can control the display format for contact information using the Personal Address Book
Preferences dialog box, which creates a profile document to store the preference information. Users
can also customize the labels used to identify various fields within each document. The Contact
form, shown in Figure 7−1, makes extensive use of hide−when settings, computed text and
computed for display fields, and a programmable table, which is used to implement a highly
configurable display for users. This form is also a good example of using nested tables to create a
very clean look.
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited
Lotus Notes and Domino 6 Programming Bible 3
The Personal Address Book template contains the AddressPicker form, which gives users access to
30 buttons, 26 of which are used (in the U.S. English version of the template) for selecting the
letters A through Z for indexing the Contacts list. Although a very straightforward technique could
have been used, it would have been harder to adapt for foreign languages, so IBM engineers
assigned a number to each of the buttons and used it to look up a letter value in a list stored in a
field named AlphList. Modifying this code to work with other alphabets requires only three steps:
changing the contents of the AlphList field, entering the number of letters in the alphabet into the
AlphNumber field, and changing the caption and alternate text properties on each of the button
graphics.
The Discussion template enables Notes clients and browser users to open new topics for discussion
using the Main Topic form, and to participate in threads by adding new documents using the
Response or Response to Response forms. The All Documents view uses Show Response
Documents in a Hierarchy to create an indented display that graphically shows the flow of each
discussion thread (see Figure 7−2).
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited
Lotus Notes and Domino 6 Programming Bible 4
Users of Discussion applications can also fill in Personal Profile and Interest Profile forms. An agent
called Send Newsletters, which sends out e−mail messages to users to inform them when new
documents that match the profile are added to the discussion, uses the Interest Profile forms. This
agent is a good example of the use of the NotesNewsletter class in LotusScript.
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited
Lotus Notes and Domino 6 Programming Bible 5
The Document Library templates also support response and response−to−response forms, similar
to the ones in the Discussion template. Although there are no new concepts demonstrated by this, it
shows how easy it is to add a response hierarchy to any Notes and Domino application, adding
value by allowing users to engage in discussions about the data the application manages.
Summary
This chapter examined some of the features of the Mail, Personal Address Book, Discussion, and
Document Library templates. You learned that
• The Mail template demonstrates reserved fields used for addressing mail, form properties
used to send mail from the Notes client, and the MailOptions field used to send mail from a
WebQuerySave agent.
• The Discussion template demonstrates response hierarchy and categorized views. It also
demonstrates the use of Author Names fields to control document security, and use of the
NotesNewsletter class in LotusScript.
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited
Lotus Notes and Domino 6 Programming Bible 6
• The Document Library templates demonstrate techniques for using OLE to embed Microsoft
Office and Lotus SmartSuite documents within a document in an NSF file. It also
demonstrates techniques for programming serial and parallel workflow processes.
The next part of the book, Part III, dives into the architecture of an application and covers such
topics as pages, forms, views, folders, and so on.
Reprinted for ibmsatyejha@in.ibm.com, IBM John Wiley & Sons (US), Wiley Publishing, Inc. (c) 2003, Copying Prohibited