Vous êtes sur la page 1sur 512

Fundamentals of IBM Lotus Domino 8 Application Development

Student Guide

Fundamentals of IBM Lotus Domino 8 Application Development


Student Guide

Fundamentals of IBM Lotus Domino 8 Application Development


Part Number: 085138 Course Edition: 1.0

Notices
DISCLAIMER: You may not copy, reproduce, translate, or reduce to any electronic medium or machinereadable form, in whole or in part, any documents, software, or les provided to you without prior written consent of IBM Corporation, except in the manner described in the documentation. While every reasonable precaution has been taken in the preparation of this manual, the author and publishers assume no responsibility for errors or omissions, nor for the uses made of the material contained herein and the decisions based on such use. Neither the author nor the publishers make any representations, warranties, or guarantees of any kind, either express or implied (including, without limitation, any warranties of merchantability, tness for a particular purpose, or title). Neither the author nor the publishers shall be liable for any indirect, special, incidental, or consequential damages arising out of the use or inability to use the contents of this book, and each of their total liability for monetary damages shall not exceed the total amount paid to such party for this book. TRADEMARK NOTICES The following terms are trademarks or service marks of International Business Machines Corporation in the United States, other countries, or both: DB2, Domino, Domino Designer, Domino.Doc, Everyplace, ibm.com, K-station, LearningSpace, Lotus, Lotus Discovery Server, Lotus Enterprise Integrator, Lotus Notes, Lotus Workow, Mobile Notes, Netnity, QuickPlace, Rational, Sametime, Tivoli, VisualAge, WebSphere, Workplace, Workplace Messaging, and WorkPlace Shell. Java and all Java-based trademarks and logos are trademarks of Sun Microsystems, Inc., in the United States, other countries, or both. Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both. Intel, Intel Inside (logos), MMX and Pentium are trademarks of Intel Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group United States and other countries. Linux is a trademark of Linus Torvalds in the United States, other countries, or both. Copyright 2007 IBM Corporation.
Lotus software, IBM Software Group One Rogers Street Cambridge, MA 02142

Under the copyright laws, neither the documentation nor the software may be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent of IBM, except in the manner described in the documentation or the applicable licensing agreement governing the use of the software. All rights reserved. Licensed Materials - Property of IBM US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corporation. You must purchase one copy of the appropriate kit for each student and each instructor. For all other education products you must acquire one copy for each user or you must acquire a license for each copy provided to a user.

Fundamentals of IBM Lotus Domino 8 Application Development

Table of Contents
Fundamentals of IBM Lotus Domino 8 Application Development Lesson 1: Exploring Applications in IBM Lotus Domino 8
Topic A. Identify Application Types and Data Sources. . . . . . . . . . . . . Lotus Domino Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . Domino Application Types . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Topic B. Examine the IBM Lotus Domino Architecture . . . . . . . . . . Lotus Domino Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Application Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Lotus Domino Application Structure . . . . . . . . . . . . . . . . . . . Access Document Properties . . . . . . . . . . . . . . . . . . . . . . . . . Topic C. Examine IBM Lotus Domino Application Components . . Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Task Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Security Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Topic D. Investigate Replication and Application Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Replication Considerations . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 4 4 4 5 6 7 11 15 19 19 19 19 19 20 20 21 24 24

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Topic E. Extend IBM Lotus Domino Collaboration Capabilities . . . Lotus Domino Extended Products . . . . . . . . . . . . . . . . . . . . . IBM Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Other Products and Technologies . . . . . . . . . . . . . . . . . . . . .

24 25 27 27

Lesson 2: Exploring the IBM Lotus Domino 8 Design Environment


Topic A. Explore the IBM Lotus Domino Designer User Interface . . Opening Lotus Domino Designer . . . . . . . . . . . . . . . . . . . . . . Identifying the Areas of the Design User Interface . . . . . . . . Topic B. Access Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Accessing Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . .

32 34 34 34 36 36

Lesson 3: Creating Applications


Topic A. Create a New, Blank Application in IBM Lotus Domino Designer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Methods to Create an Application . . . . . . . . . . . . . . . . . . . . The New Application Dialog Box . . . . . . . . . . . . . . . . . . . . . . Topic B. Create a Copy of an Existing Application . . . . . . . . . . . . . . . . Copying an Application Design . . . . . . . . . . . . . . . . . . . . . . . Topic C. Create an Application from a Template . . . . . . . . . . . . . . . . . Using a Template to Create an Application . . . . . . . . . . . . . Topic D. Organize the IBM Lotus Domino Designer Environment. . Managing the Lotus Domino Designer Environment . . . . . . Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40 42 42 43 44 47 47 49 49 49 49

Copyright IBM Corporation 2007.

Lesson 4: Creating Pages


Topic A. Explore Page Content, Layout, and Navigation Basics . . . . . The Page Design Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . Types of Page Information . . . . . . . . . . . . . . . . . . . . . . . . . . . Content Organization Design Elements . . . . . . . . . . . . . . . . Programmable Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . Navigational Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ways to Display Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . When to Use Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Design Elements Not Available on Pages . . . . . . . . . . . . . . . Topic B. Create Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page Development Process . . . . . . . . . . . . . . . . . . . . . . . . . . The Page Properties Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Page Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Topic C. Add Text to Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Text Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Previews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Topic D. Use Tables to Lay Out Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . Table Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Table Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Setting Table Programming Properties . . . . . . . . . . . . . . . . . Topic E. Add Images to Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Shared Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using Image Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

54 55 55 55 56 56 57 57 58 60 60 60 61 62 64 64 64 64 67 68 69 75 77 77 79 79

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Lesson 5: Creating Forms


Topic A. Create Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Form Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Form Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding Text and Tables to a Form . . . . . . . . . . . . . . . . . . . . . Topic B. Add Fields to Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Field Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Field Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Field Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . Text Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

88 89 91 92 94 96 96 97 98 98 99 99

List Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Name Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Numeric Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Date/Time Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Topic C. Hide Form Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 The Hide/When Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Conditions for Using Hide/When . . . . . . . . . . . . . . . . . . . . . . 110

Lesson 6: Creating Views


Topic A. Create Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 The View Design Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 View Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 View Creation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Initial View Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 View Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126

Copyright IBM Corporation 2007.

Topic B. Add View Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 View Columns. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 View Column Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 View Column Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 Topic C. Organize Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Document Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136 Sorted Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Categorizing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 Topic D. Format Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 View Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Lesson 7: Introducing Formulas


Topic A. Identify Programming Languages Supported by IBM Lotus Domino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 Lotus Domino Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 149 The Formula Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 LotusScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 Java. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 Language Selection Criteria . . . . . . . . . . . . . . . . . . . . . . . . . 155 Topic B. Identify Formula Components . . . . . . . . . . . . . . . . . . . . . . . . . 157 The Formula Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Syntax Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Topic C. Identify Event Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161 Field Evaluation Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Topic D. Compute and Compare Values . . . . . . . . . . . . . . . . . . . . . . . . 161 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Computed Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 Order of Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 Topic E. Work with @Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 @Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Common @Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Topic F. Explore Formatting and Comments . . . . . . . . . . . . . . . . . . . . . 168 Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170

Lesson 8: Using Formulas in Forms


Topic A. Create Window Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Common Uses for Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Form Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 Form Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 Window Titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 The @IsNewDoc Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Topic B. Work with Computed Values . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 Computed for Display Fields . . . . . . . . . . . . . . . . . . . . . . . . . . 181 Computed Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Computed Fields that Store Values . . . . . . . . . . . . . . . . . . . . 182

Copyright IBM Corporation 2007.

Topic C. Work with Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 Input Translation Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Text Formatting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Input Validation Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Validation Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187 Examples of Input Validation Formulas . . . . . . . . . . . . . . . . . 187 Topic D. Work with Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 List Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 List Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 The @DbColumn Function . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 Topic E. Prompt Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 The @Prompt Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Topic F. Create Reusable Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195 Reusable Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Reusable Code Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Topic G. Implement Error Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Run-Time Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 The @StatusBar Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198 Error Generation and Reporting . . . . . . . . . . . . . . . . . . . . . . . 199 Error-Handling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

Lesson 9: Using Formulas in Views


Topic A. Create Selection Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 View Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 View Selection Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210 Topic B. Concatenate Values in a View Column . . . . . . . . . . . . . . . . . . 213 Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 Converting Values To Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213 The @Text Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Topic C. Display Icons In a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Displaying Icons In a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216 Creating a Column Icon Formula . . . . . . . . . . . . . . . . . . . . . 216 Predened Icon Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 Adding a Custom Icon to a View Column. . . . . . . . . . . . . . . 218

Lesson 10: Enhancing Forms


Topic A. Work with Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222 Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Content of a Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Layer Anchors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Layer Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Layer Background Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224 Layer Background Images . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 Layer Size and Position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Layer Position Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Multiple Layer Alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227 Hiding Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 The Layer Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Topic B. Work with Subforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 Subforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231 How Subforms Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232 Subform Properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233 Computed Subforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Creating a Computed Subform Formula . . . . . . . . . . . . . . . 234 Topic C. Create Shared Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234 Shared Fields. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Benets of Shared Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

Copyright IBM Corporation 2007.

Topic D. Enable Inheritance in Forms and Documents . . . . . . . . . . . . . 236 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 Enabling Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 Topic E. Create Related Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Related Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Designating a Form as a Response . . . . . . . . . . . . . . . . . . . . 243 Document Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244 Inheritance and Related Documents . . . . . . . . . . . . . . . . . . 245 Threaded Discussions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 Topic F. Enable AutoSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 The AutoSave Feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 The Autosave Application . . . . . . . . . . . . . . . . . . . . . . . . . . . 247 Topic G. Implement IBM Lotus Sametime Instant Messaging in Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Instant Messaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Online Status Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253 Instant Messaging Contact List . . . . . . . . . . . . . . . . . . . . . . . 253

Lesson 11: Enhancing Views


Topic A. Dene Hierarchical Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Hierarchical Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263 Topic B. Display Response Data in Views . . . . . . . . . . . . . . . . . . . . . . . . 263 Default View Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264 Responses-Only Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Multiple Forms in Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Topic C. Implement Shared Columns . . . . . . . . . . . . . . . . . . . . . . . . . . 265 Shared Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Topic D. Enable IBM Lotus Sametime Instant Messaging in Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272 Enabling a Column for Instant Messaging . . . . . . . . . . . . . . . 272

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Topic E. Create Views for the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273 View Display Considerations . . . . . . . . . . . . . . . . . . . . . . . . . 274 Embedded Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274 View Display Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275 Displaying an Embedded View using the View Applet . . . . 275 Displaying an Embedded View using HTML . . . . . . . . . . . . . 277 Using View Properties to Control the Display of Embedded Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 Exploring View Display in the Web Browser . . . . . . . . . . . . . . 279 Link Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280

Lesson 12: Working with Actions


Topic A. Create Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286 Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287 Programming Options Available in Actions . . . . . . . . . . . . . 287 Action Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 The Action Pane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288 Action Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289 System Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 @Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292 Order of Evaluation for @Commands . . . . . . . . . . . . . . . . . . 293 Creating Instant Messaging Chat Action Buttons . . . . . . . . 293 Topic B. Create Shared Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293 Shared Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Shared Action Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

Copyright IBM Corporation 2007.

Topic C. Control the Display of Actions . . . . . . . . . . . . . . . . . . . . . . . . . 295 Sub Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 Action Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 Hiding Actions and Action Buttons. . . . . . . . . . . . . . . . . . . . . 297 Action Buttons, Split Action Buttons, and Right-click Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 Action Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Web Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Topic D. Create Action Hotspots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Hotspots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

Lesson 13: Working with Agents


Topic A. Investigate Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306 Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307 Agent Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 The Agent Basics Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 Programming Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311 The SELECT Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Field Updates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 Agent Activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Agent Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 Scheduled Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 Document Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 Topic B. Create Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 Agent Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

Lesson 14: Securing Applications


Topic A. Explore Application Access . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 Application Security Overview . . . . . . . . . . . . . . . . . . . . . . . . 321 Access Control Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321 Access Control Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 User Identiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 User Access Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Displaying an Applications Access Control List . . . . . . . . . . 324 Access Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 User Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 Topic B. Implement Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Dening Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 @Functions and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 Comparing the Users Role . . . . . . . . . . . . . . . . . . . . . . . . . . . 330 Topic C. Use Readers and Authors Fields . . . . . . . . . . . . . . . . . . . . . . . . 332 Document Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 Readers Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 Specifying Readers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 Authors Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337 How Authors and Readers Fields Work Together . . . . . . . . . 337 Topic D. Control Access for Anonymous Users . . . . . . . . . . . . . . . . . . . 338 Anonymous Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339 Low-Security Access Control Lists . . . . . . . . . . . . . . . . . . . . . . 340 High-Security Access Control Lists . . . . . . . . . . . . . . . . . . . . . 340

Copyright IBM Corporation 2007.

Lesson 15: Deploying Applications


Topic A. Deploy Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348 The Deployment Process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349 Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350 Master Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 Replication Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353 Replication Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

Appendix A: Solutions to Practice Activities


Topic A. About This Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360 Lesson Lab Solutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

Appendix B: The Worldwide Corporation Infrastructure Plan Appendix C: Extend IBM Lotus Domino Software Appendix D: Certication and Exam Competencies Appendix E: Instructor Preparation Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

About This Course


The course provides the information that developers need to know to successfully create and modify database applications in IBM Lotus Domino Designer 8. It provides an overview of the IBM Lotus Domino 8 and Lotus Domino Designer 8 environments, introduces the elements and skills that are used in creating single-database Lotus Domino applications, describes how the formula language can be used to enhance the functionality of a Lotus Domino application, and explains how Lotus Domino applications can be secured.

Course Description
Target Student
The target audience for this course is application developers who are new to developing Lotus Domino applications and who need to acquire the fundamental skills to develop and modify single-database applications in IBM Lotus Domino Designer 8.

Course Prerequisites
The prerequisites for this course include experience using the IBM Lotus Notes client, Web browser or both to access applications. Experience in developing one or more applications using other application development tools is recommended.

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

How to Use This Book


As a Learning Guide
Each lesson covers one broad topic or set of related topics. Lessons are arranged in order of increasing prociency with Lotus Domino and Lotus Notes; skills you practice in one lesson are used and developed in subsequent lessons. For this reason, you should work through the lessons in sequence. Each lesson is organized into results-oriented topics. Topics include all the relevant and supporting information you need to master Lotus Domino and Lotus Notes, and activities allow you to apply this information to practical hands-on examples.

As a Review Tool
Some of the information covered in class may not be relevant to your environment immediately, but it may become important later on. For this reason, we encourage you to spend some time reviewing the topics and activities after the course. The course can also be used in preparation for Lotus certication exams.

As a Reference
The organization and layout of the book make it easy to use as a learning tool and as an after-class reference. You can use this book as a rst source for denitions of terms, background information on given topics, and summaries of procedures.

ii

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

Course Objectives
After completing this course, you should be able to: Receive an overview of application types, data sources, and how they are deployed in the IBM Lotus Domino architecture. Explore the IBM Lotus Domino Designer user interface and accessed design elements. Create an original application structure, an application structure copied from a previously designed application, and an application structure based on a template. Create pages and populate them with text, images, and tables. Create forms and insert form elements in them. Create formatted views. Create formulas and learn about programming languages that can be used in conjunction with Domino. Use formulas in conjunction with forms. Select and manipulate data for use and display in views. Work with layers, subforms, instant messaging, and autosave features. Work with hierarchical views, response data, shared columns, and instant messaging features related to views. Work with actions to automate tasks. Work with agents to automate tasks. Receive an overview on application security. Receive an overview on how to deploy an application.

Introduction

iii

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

Course Requirements
Hardware
Primary Classroom Server
The following list details the minimum hardware necessary for the setup of the primary classroom server: At least 1 GB of RAM per CPU. However, for optimal performance, you might need to use 2 GB or more. A Pentium class (or higher) processor and compatibles. A Pentium 4, 2.6 GHz, processor is recommended. An SVGA (or better) video card and monitor. Support for 256 colors, 800 x 600 resolution. At least 4 GB (per partition) of free hard disk space. 8 GB of free disk space is recommended. For disk swap space, at least twice the amount of installed RAM. A mouse or other pointing device. A CD-ROM drive or access to a network le server for installation.

Instructor and Student Clients


The following list details the minimum hardware necessary for the setup of the instructor and student client computers: At least 512 MB of RAM, 1024 MB is recommended. A Pentium class processor. An SVGA (or better) video card and monitor. Support for 256 colors, 800 x 600 resolution. At least 1 GB of free hard disk space, 2 GB is recommended. A mouse or other pointing device. A CD-ROM drive or access to a network le server for installation.

iv

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

Software
Primary Classroom Server
The following software is required for the primary classroom server. Please note that proper licensing for all software is required and is the responsibility of the training organization. Microsoft Windows Server 2003 (Standard or Enterprise Edition) (the latest Service Pack is recommended, but not required) or Microsoft Windows 2000 Server (or Advanced Server) with Service Pack 4. IBM Lotus Domino 8.

Instructor and Student Clients


The following software is required for the instructor and student client computers. Please note that proper licensing for all software is required and is the responsibility of the training organization. Windows XP Professional or Windows 2000 Professional, with all applicable Service Packs. IBM Lotus Notes 8. IBM Lotus Domino Administrator (for instructor) and IBM Lotus Domino Designer 8 for all clients. Microsoft Internet Explorer 6.0 or above, with all applicable Service Packs. Sun Java Runtime Environment (JRE), Java 2 v1.4.2 or higher. TCP/IP using either Hosts le or DNS with server and domain names dened in the TCP/IP protocol conguration.

Class Setup
Domino Naming Used in This Course
This course uses the following hierarchical naming scheme. Table 0-1: Domino naming scheme
Naming Component Organization certier Domain Instructor server Classroom Implementation /WWCorp WWCorp Hub/SVR/WWCorp

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Naming Component Instructor account Student Accounts Classroom Implementation Doctor Notes/WWCorp Student ND##/East/WWCorp Where ##, add student numbers 01 through 12.

Course Setup Files


The following table describes the course setup les. Table 0-2: Course setup les
Title WWCorps Directory File Name names.nsf Function Used to set up the classroom servers and administrators. Note: Student ID les are contained in names.nsf. Organizational level certier for the wwcorp domain. Server ID le for the classroom server (Hub/ SVR/WWCorp) User ID le for the instructor. Mail le for the instructor. Student mail lesWhere ## is the student numbers 0112.

WWCorp certier ID le

wwcorp.id

Hub/SVR/WWCorp servers ID le

hub.id

Doctor Notes user ID le

dnotes.id

Doctor Notes mail le User mail les

dnotes.nsf snd##.nsf

vi

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

Course Data Files


Throughout this course, you will work in several applications. They are:

Practice application. This application is used mainly in guided activities. Instructor Demo application. Although its use is primarily for your instructor to demonstrate tasks and features, you will occasionally access this application during the course. Policies and Procedures application. You will create this application by completing the practice activities in this course.

The following table describes the course data les. Table 0-3: Course data les
File Name Instructor_D8510.nsf Policies7Start.nsf Policies10Start.nsf Policies12Start.nsf Policies14Start.nsf PoliciesACL.nsf Practice_D8510.ntf PoliciesFinal.nsf PracticeFinal.nsf D8510_Graphics.zip PagesForms.exe Replication.exe Function Instructor demonstrations Helpful lab starter les to be used as necessary

Lesson 14 lab le Student activity practice template Completed lab les Completed activity les Instructor les

Classroom Setup Tasks


Complete the tasks in the following table to set up the classroom prior to the start of class. Detailed procedures for each task appear on the following pages. Table 0-4: Classroom setup tasks
Task 1 2 3 Procedure Install the Lotus Domino server. Install the required client software on the instructor and student machines. Install supplied les to the classroom machines.

Introduction

vii

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Task 4 5 6 Procedure Edit hosts les on each classroom machine. Set up the classroom server. Set up the classroom workstations.

Task 1: Install the Lotus Domino Server


Follow these steps to install Windows Server 2003 and applicable Service Packs on the classroom server. Table 0-5: Install Windows Server 2003 and Service Packs on the classroom server
Step 1 Action Prior to starting the installation verify the following settings: Computer name is Hub The appropriate data and time settings are congured for your locale.

The IP addresses can be any convenient value, consistent with the existing network conguration. Congure the network for the TCP/IP protocol, using the following settings: IP address: 192.168.1.100 Subnet Mask: 255.255.255.0

Follow these steps to install the Lotus Domino server software on the classroom server. Table 0-6: Install Lotus Domino server software on the classroom server
Step 1 Action Run the Lotus Domino 8 server install program, Setup.exe, from a CD-ROM or other installation medium. On the Welcome screen, click Next. Read the Software License Agreement, and then click I accept the terms in the license agreement to agree with the terms. Click Next. Accept the default location for the installation les. Click Next.

2 3

viii

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 5 Action Accept the default location for the data les. Click Next. Verify that Domino Enterprise Server is selected, and then click Next. Review the conguration, and then click Next to begin copying les. Click Finish to complete the installation.

6 7 8

Task 2: Install the Required Client Software on the Instructor and Student Machines
Follow these steps to verify settings on the instructor and student clients. Table 0-7: Verify the settings on the instructor and student client computers
Step 1 Action Prior to starting the installation, verify the appropriate data and time settings are congured for your locale. The IP addresses can be any convenient value, consistent with the existing network conguration. Congure the network to use the TCP/IP protocol, with the following settings: IP address: 192.168.1.200 through 192.168.1.213 Subnet Mask: 255.255.255.0

Follow these steps to install the Lotus Notes, Lotus Domino Administrator, and Lotus Domino Designer software on the instructor client. Table 0-8: Install software on the instructor client computer
Step 1 Action Run the IBM Lotus Notes 8 client install program, Setup.exe, from a CD-ROM or other installation medium. On the Welcome screen, click Next. Read the License Agreement. Select I accept the terms in the license agreement, and then click Next. Accept the default folders to change the location to install Lotus Notes. Click Next.

2 3

Introduction

ix

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 5 Action On the features setup screen, select Domino Administrator, Domino Designer, and click Next. Verify the installation summary screen and click Install. When the Install Wizard completes, click Finish.

6 7

Follow these steps to install the Lotus Notes and Lotus Domino Designer client software on the student clients. Table 0-9: Install software on the student client computers
Step 1 Action Run the Lotus Notes 8 client install program, Setup.exe, from a CD-ROM or other installation source. On the Welcome screen, click Next. Read the License Agreement. Select I accept both the IBM and the non-IBM terms, and then click Next. Accept the default folders, or click Browse to change the location to install Lotus Notes. Click Next. On the Features Setup screen, select Domino Designer, and click Next. Verify the installation summary screen and click Install. When the Install Wizard completes, click Finish.

2 3

5 6 7

Task 3: Install Supplied Files to the Classroom Server and Instructors Client Computer
Follow these steps to install the needed les for the classroom server. Table 0-10: Install the classroom les on the classroom server
Step 1 2 3 Action Insert the course CD-ROM in the classroom server. On the course CD-ROM, explore the D8510 folder. Open the Data folder.

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 4 Action Run the D8510dd.exe self-extracting le. This will install a folder named \lotus_ed\D8510 on the C drive. This folder contains all of the data les that you will use to complete the course. It also includes animation les that you can use during the presentation of the course. Copy the following les from \lotus_ed\D8510 to the \Domino\Data folder: svr.id wwcorp.id hub.id dnotes.id names.nsf

Task 4: Edit the Host Files on the Classroom Machine


Use any text editor to edit the hosts le on each classroom machine to include the IP address and server names as follows:
192.168.1.100 www.wwcorp.com Hub/SVR/WWCorp hub hub.wwcorp.com

Task 5: Set Up the Classroom Server


Follow these steps to set up the classroom server, Hub/SVR/WWCorp, as the rst server in the WWCorp domain. Table 0-11: Set up the classroom server
Step 1 2 3 4 Action Click StartAll ProgramsLotus ApplicationsLotus Domino Server. Click Start Domino as a regular application, and then click OK. On the Welcome to Domino Server Setup screen, click Next. Verify that Set up the rst server or a stand-alone server is selected, and click Next. Select I want to use an existing server ID le. Click Browse and navigate to the hub.id le, and then click Select. Click Next.

Introduction

xi

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 6

Action On the Choose your organization name screen: Select I want to use an existing certier ID le. Click Browse and navigate to the wwcorp.id le, and then click Select. Click Customize, and select I want to use an existing organizational unit certier ID le. Click Browse and navigate to the svr.id le, and then click Select. Click OK. In the Enter Password dialog box, type lotusnotes, and click OK. Click Next. In the Enter Password dialog box, type lotusnotes, and click OK.

8 9

For the Domino domain name, type WWCorp and click Next. On the Specify an Administrator name and password screen complete these steps: Select I want to use an existing Administrator ID le. Click Browse and navigate to the dnotes.id le, and then click Select. Click Next.

In the Enter Password dialog box, type lotusnotes and click OK.

11

For Internet services, select Web Browsers (HTTP services) and Directory services (LDAP services), and click Next. Review the default enabled port drivers and host name. To change these settings: Click Customize. Disable the NetBIOS over TCP/IP port driver. Type the fully qualied Internet host name for the server, hub.wwcorp.com. Click OK. Click Next.

12

13

On the Secure your Domino Server screen, accept the defaults and click Next. Review the information selected during this session. To conrm setting up the server with this information, click Setup. When setup completes, click Finish.

14

15

xii

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 16 Action Before starting the server, copy the supplied les to their target directories: \Lotus\Domino\data\mail: DNotes.nsf and all other mail les \Lotus\Domino\data: D8510 folder and all its les \Lotus\Domino\data: Final folder and all its les \Lotus\Domino\data: IDs folder and all its les

17 18

Modify the notes.ini le to by adding Create_R8_Databases=1 To start the server from Windows, click StartAll ProgramsLotus ApplicationsLotus Domino Server. Verify that Start Domino as a Windows service is selected and click OK. Note: The server may take several minutes to initialize. Wait for initialization to complete before attempting to connect to the server.

Task 6: Set Up the Instructor Workstation


Follow these steps to set up the instructors workstation. Table 0-12: Set up the instructors workstation
Step 1 2 3 Action Click StartAll ProgramsLotus ApplicationsLotus Notes 8. On the Welcome screen, click Next. On the User Information screen, type: Name: Doctor Notes

Domino server: hub/svr/wwcorp

Select I want to connect to a Domino server, and click Next. 4 If necessary, select Set up a connection to a local area network, and click Next. If necessary, for the Domain server name, type Hub/SVR/WWCorp Select TCP/IP as the network type, and enter 192.168.1.100 or an assigned IP address. Click Next.

Introduction

xiii

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 5 Action If the ID is not found in the Domino Directory, the setup program will request the location of the Notes ID le. To locate the Notes ID le: a. Click Browse, select dnotes.id, and then click Open. b. Click Next. c. Click Yes to copy the ID le to the local data directory. d. Enter lotusnotes as the password. If the user ID is stored in the Domino Directory, the setup program will copy the ID le to the local data directory automatically. 6 On the Additional Services screen, it is not necessary to select any additional services for this course. Click Next. When the Lotus Notes setup is complete, click OK. Choose FilePreferences and click Basics Notes Client Conguration. In the Additional Options section, select the following options if not already selected, and then click OK. Enable Java applets Enable JavaScript Use Web palette

7 8 9

10 11 12

From the Preferences list, select Notes Ports, and clear LAN0 and COM1. Click OK to close Preferences. Click OK in the warning dialog box. Changes will take effect once Lotus Notes is restarted. Exit Lotus Notes.

13

Follow these steps to set up the student workstations. Table 0-13: Set up the student workstations
Step 1 2 Action Click StartAll ProgramsLotus ApplicationsLotus Notes 8. On the Welcome screen, click Next.

xiv

Introduction

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction Step 3

Action On the User Information screen, type: Name: Student ND##

Where ## is the student number assigned to each student (0112) Domino server: Hub/SVR/WWCorp Select I want to connect to a Domino server, and click Next. 4 5 If necessary, set up a connection to a local area network, and click Next. If necessary, for the Domain server name, type Hub/SVR/WWCorp Select TCP/IP as the network type, and 192.168.1.100 or an assigned IP address. Click Next. If the ID is not found in the Domino Directory, the setup program will request the location of the Notes ID le. To locate the Notes ID le: a. Click Browse, select Student##.id, and then click Open. b. Click Next. c. Click Yes to copy the ID le to the local data directory. If the user ID is stored in the Domino Directory, the setup program will copy the ID le to the local data directory automatically. 7 On the Additional Services screen, it is not necessary to select any additional services for this course. Click Next. When the Lotus Notes setup is complete, click OK. Click FilePreferences and click Basics Notes Client Conguration. In the Additional Options section, select the following options if not already selected, and then click OK. Enable Java applets Enable JavaScript Use Web palette

8 9 10

11 12 13

From the Preferences list, select Notes Ports, and clear LAN0 and COM1. Click OK to close Preferences Click OK in the warning dialog box. Changes will take effect once Lotus Notes is restarted. Exit Lotus Notes. Copy the graphic folder and all its les to Lotus/Notes/Data.

14

Introduction

xv

Fundamentals of IBM Lotus Domino 8 Application Development


Introduction

Course Icons
The following table explains the icons used in this course. Table 0-14: Course Icons
Icon Description An activity is a student-centered learning process that allows students to learn by performing a task. Activities can be instructor-led or completed independently. Scenario information is used to introduce an activity problem or goal. Scenarios use ctitious people and organizations to present details, problem statements, and parameters that are used to complete the activity or lab exercise. Caution statements are included in the courseware to make students aware of potential negative consequences of an action, setting, or decision, that are not easily known. Tips and notes provide additional information, guidance, or a hint about a topic or task. An Instructor Note is a special comment to the instructor regarding delivery, classroom strategy, classroom tools, exceptions, and other special considerations. The Instructor Note is included in the Instructor Guide only. Display Slide provides a prompt to the instructor to display a specic slide. The Display Slide icon is included in the Instructor Guide only.

xvi

Introduction

Exploring Applications in IBM Lotus Domino 8


Topic A: Identify Application Types and Data Sources Topic B: Examine the IBM Lotus Domino Architecture Topic C: Examine IBM Lotus Domino Application Components Topic D: Investigate Replication and Application Design Considerations Topic E: Extend IBM Lotus Domino Collaboration Capabilities

Copyright IBM Corporation 2007.

Lesson 1 Exploring Applications in IBM Lotus Domino 8

Introduction
After completing this lesson, you should be able to: Identify the types of applications you can create with IBM Lotus Domino Designer, and where the data with which to create these applications can come from. Examine the IBM Lotus Domino architecture. Identify the security layers that protect Lotus Domino applications. Describe the considerations involved in replicating applications. List other products and technologies that extend your Lotus Domino applications.

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Topic A: Identify Application Types and Data Sources


Lotus Domino Applications
IBM Lotus Notes and IBM Lotus Domino are an integrated messaging and collaboration application software platform that provides a scalable and secure infrastructure with the exibility and openness needed for development and deployment of Lotus Domino applications. An application is a solution to a particular problem that may include one or more databases and other components, such as Java applets.

Domino Application Types


The following table describes the basic types of Lotus Domino applications.

Application Type E-mail/PIM (personal information management)

Description Synchronizes applications and mail, server-to-server and client-to-server communication, and mobile communication, and provides a calendar, task management features, a personal journal, and document libraries. Acts as a repository for the distribution and easy lookup and search of information. Provides a trail of, and prompts for, actions in a business process. Allows for layered conversation between workgroup members on specic subjects. Allows access to large data stores of nonLotus Domino data.

Broadcast/Reference

Tracking/Workow

Discussion

Front end

Copyright IBM Corporation 2007.

Topic A: Identify Application Types and Data Sources


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Data Sources
Data sources for Lotus Domino applications include those listed in the following table.

Data Source Lotus Domino databases

Description Applications can be developed to work with data from a single Lotus Domino database or from multiple Lotus Domino databases. Lotus Domino 8 supports the ability to utilize the DB2 relational database as an alternative storage mechanism for data. You can expose Lotus Domino data in DB2 views, making that data available to DB2 applications, including IBM Workplace and IBM WebSphere Portal applications. You can use SQL to build new Lotus Domino applications that blend collaborative services with relational data that is stored in DB2 databases. Web services are technology that allows programming-independent and platform-independent communication between applications. The advantage of using Web services is that the technology is based on open standards such as Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP). Web services can handle data more easily and allow a variety of software to communicate more freely than any one proprietary application or environment.

DB2 relational databases

Web services

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Topic B: Examine the IBM Lotus Domino Architecture


Lotus Domino Infrastructure
Lotus Domino servers work with Lotus Notes clients and non-Lotus Notes clients to form an integrated client/server environment. The Lotus Notes and Lotus Domino environment, as conceptualized in the following gure, provides services to allow an organization to store, communicate, and exchange information.

Figure 1-1: A conceptual diagram of the Lotus Notes/Lotus Domino architecture An example of the Lotus Notes/Lotus Domino environment would consist of a combination of the following or similar client/server components.

Copyright IBM Corporation 2007.

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Component Lotus Domino server (Web-enabled)

Function A Lotus Domino server is a computer that runs the Lotus Domino server program and stores Lotus Notes databases. A Lotus Domino server runs services that manipulate Lotus Notes data. Depending on what the request is and who the client is, the server can pull information from a variety of sources, including the object store, the le system, a relational database, or a combination of all three. Lotus Notes clients can access Lotus Domino data both on servers and locally, providing portable access to data. Web clients can access Lotus Domino data on the server to display in a browser.

Lotus Notes and Web clients

Note: You can also use a browser to access Lotus Domino data stored locally. For instance, a mobile user accesses Lotus Domino data with a browser instead of a Lotus Notes client. The application could still be replicated to the mobile user and he or she would access it via a browser.

Clients
The following table outlines some of the Lotus Notes client types available with Lotus Domino servers.

Lotus Notes Clients Lotus Notes client

Function Allows users access to Lotus Notes databases on a Lotus Domino server, mail, calendar, contacts, and Web browsing. Supports the creation and development of Lotus Domino databases or applications.

IBM Lotus Domino Designer

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8 Lotus Notes Clients IBM Lotus Domino Administrator Function Allows users with proper privileges to perform administrative tasks in a Lotus Domino environment.

The following table outlines some of the Internet client types available with Lotus Domino servers.

Internet Clients IBM Lotus Notes Web Access

Function Provides on- or offline access to Lotus Domino core messaging, collaboration, and PIM functions through a Web browser. Supports Lotus Domino applications, mail, and calendar access for Web browsers. Allows mail access to a POP3compliant server. Supports mail access to an IMAPenabled server.

Web client

POP3 client

IMAP client

Application Access
Lotus Domino applications are client-server applications. The client communicates with the application using a proprietary remote procedure call mechanism. The Lotus Notes Remote Procedure Call (NRPC) transmits the client request to the Lotus Domino application and returns the results. Lotus Domino authenticates users when they access applications on the server. Other Lotus Domino services are called upon depending on the specics of the application.

Copyright IBM Corporation 2007.

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Accessing a Lotus Domino application with Lotus Notes


The following table describes the stages that occur when a user accesses a Lotus Domino application from a Lotus Notes client.

Stage 1 2

Description User makes a request to open, read, or save data in the application. Lotus Domino authenticates the user making the request and provides authentication information about itself to the user. This occurs when the client rst accesses the server. Lotus Domino veries the rights of the user making the request. This occurs every time a request is made. Lotus Domino executes the request and responds to the client.

This process is shown in the following gure.

Figure 1-2: The Lotus Notes client accessing a Lotus Domino application

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Working with local applications


A local database allows users to work offline (not connected to the network). Local databases can also be used to run personal applications that should not be available to multiple users. The Lotus Notes client provides a subset of Lotus Domino services to execute common functionality locally and reduce the load on the server. The client does not support the same level of security checks and restrictions that the server does. However, there are database properties that the developer can employ to enforce a certain level of security on applications that reside locally. Among these is encryption of elds within documents and databases, which keeps non-specied users from reading the information stored within the eld.

Copyright IBM Corporation 2007.

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Using a Web browser to access Lotus Domino applications


Domino supports the HTTP protocol, which allows Web browsers to access applications on a Lotus Domino server. As with access using a Lotus Notes client, Lotus Domino authenticates users when they access applications on the server via a Web browser. The following table describes the stages involved in accessing a Lotus Domino application through a Web browser.

Stage 1 2

Description User makes a request to open, read, or save data in the application. Depending on the server setup and the database ACL, Lotus Domino authenticates the user making the request and provides authentication information about itself to the user. If both server and database allow Anonymous access, no challenge is issued to the client and the user is not authenticated. The result is that the user is identied as Anonymous. Lotus Domino veries the rights of the user making the request. Lotus Domino translates the HTTP request. Lotus Domino executes the request.

3 4 5

10

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

The following gure illustrates how a Web browser accesses a Lotus Domino application. In this example, data is also accessed from DB2.

Figure 1-3: Accessing a Lotus Domino application through a Web browser

Lotus Domino Application Structure


The foundation of the Lotus Notes and Lotus Domino design is the use of a single and simple data structure, called a note, to store all information. Notes are used to store data and design elements. Notes are described in more detail later in this lesson.

Copyright IBM Corporation 2007.

11

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Lotus Domino database containment model


Lotus Domino databases are les that exist in the le system. Lotus Domino uses the path and le name to identify the database. Once the database is open, you access data by opening notes. This relationship, shown in the following gure, is described as a containment model. The le system contains databases, a database contains notes, and a note contains data.

Figure 1-4: The Lotus Domino database containment model As the containment model shows, to access a database, you must rst access the le system.

12

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

The components of a Lotus Domino application


A Lotus Domino database contains two areas of functionality:

Notes Storage Facility (NSF) maintains the data and design elements of the application. Notes Index Facility (NIF) builds and maintains lists for locating data in the application.

The following gure illustrates the components of a Lotus Domino database.

Figure 1-5: The two areas of Lotus Domino database functionality

Lotus Notes and data storage


As stated earlier, the note is the data structure used to store all information in a Lotus Notes or Lotus Domino database. All notes in a database are essentially the same. They are peers to one another and do not share hierarchical or other relationships. Notes only differ in the data values they contain and how Lotus Domino uses them. A note stores data in items. Each item is identied by a name and contains a list of values. The values in a single item must be of the same data type. Items also store information about the data. This metadata is available to the application and the Lotus Domino services. Metadata is, literally, data about data.
Note: Metadata describes how the data is formatted.

Copyright IBM Corporation 2007.

13

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Note types
A Lotus Domino database contains database header, ACL, and design notes. It also contains data notes once the users of the application create them. Some notes are created by users and developers, and other notes are maintained by Lotus Domino to track and control information in the application. Data is stored in a specic kind of note, referred to as either a data note or a document. Both terms are used interchangeably throughout this course. You can create and access documents in many ways.

Notes that developers create


The following table describes the types of notes that users and developers can create in a Lotus Domino database.

Type of Note Data

Purpose Stores data values used in the application. For example, a data note may contain customer prole information, such as the customers name, address, and phone number. Stores data used to process or affect the presentation and functionality of the application. For example, a design note may contain instructions for how Lotus Domino displays information to a user.

Design

Notes that Lotus Domino maintains


The following table describes other types of notes that Lotus Domino maintains.

Type of Note ACL

Purpose The ACL stores a list of names and options for controlling access permissions to the database. Lotus Domino stores information about the database in a database header note. The database header contains information such as the version of Lotus Domino used to create the database, the title of the database, and the database ID.

Database header

14

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Access Document Properties


The Lotus Notes client provides users with the ability to examine documents through a Properties box. The Document Properties box, shown in the following gure, reads the contents of a document and displays information to the user.

Figure 1-6: The Document Properties box

Procedure Reference: Opening the Document Properties Box


Follow these steps to open the Document properties box.
1. 2. 3.

Open the application in the Lotus Notes client. Select the document you wish to examine. Open the Document Properties box.

Choose FileProperties. Right-click the document and choose Document Properties. Click the Properties button. Or, press Alt+Enter.

4.

Use the tabs of the Document Properties box to view the structure of the data note.

Properties boxes
All Lotus Domino elements have Properties boxes associated with them, from entire applications down to individual text elements.

Copyright IBM Corporation 2007.

15

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Examining a document through the properties box


The Properties box has several tabs that display different information about the document. The following table describes three of these tabs.

Tab Document Info

Information Displayed Data about the document that Lotus Domino maintains; for example: When it was created. When it was last modied. Who last modied it.

Fields

A list of the items in the document and the data each item contains. Selecting an item in the left pane displays its value and metadata in the right pane. Metadata includes the data type and special ags Lotus Domino uses when dealing with this data. The unique ID of the document.

Document IDs

Other ways of accessing data


Lotus Domino provides access to data in several ways, including:

Fields on a form Columns in a view Programmatically, via any of the following:


Formula language LotusScript JavaScript Java XML


Note: An overview of programming languages is provided later in the course.

16

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Activity 1-1: Analyze Database Documents


Scenario You have a new job at a company who has just implemented Lotus Notes 8. You have prior experience working with an earlier version of Lotus Notes and want to explore version 8 to see what the similarities and differences are. Follow these steps to analyze database documents.
Step 1. 2. 3. 4. Open the Lotus Notes client. Choose FileOpenLotus Notes Application. Click the drop-down arrow next to the Look in text box, and select Hub/ SVR/WWCorp. In the Application list, scroll and double-click D8510. Action

5. 6. 7. 8. 9. 10. 11.

Double-click Instructor Demo. Click OK to accept the Welcome To The Database message. Click OK to accept the You Have Manager Access message. Close the About Instructor Demo page. Click Customers to open the Customers view. In the Customer list, choose a customer. Choose FileProperties.

Copyright IBM Corporation 2007.

17

Topic B: Examine the IBM Lotus Domino Architecture


Lesson 1 Exploring Applications in IBM Lotus Domino 8 Step 12. 13. Action Verify that Document is displayed in the drop-down list at the top of the dialog box. Who last updated the document?

14.

When was the document created?

15.

What is the data type for the CustomerID item?

18

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Topic C: Examine IBM Lotus Domino Application Components


Pages
Pages contain text, images, applets, and other objects. Users do not enter information on pages. You can use pages to display and organize information.

Forms
Forms contain elds where users can enter values. Those values are stored in documents. You can use forms to gather and display information.

Page and form comparison


Pages and forms are similar in many ways. Both display and organize information, and both share many elements. However: Pages do not contain elds, so they cannot collect or calculate data.

Users cannot create pages. Only developers can create pages.

Views
Views index and display lists of documents contained in an application. You can use views to organize information.

Navigation
Hotspots, framesets, outlines, and image maps are the most common navigation elements used in Lotus Domino applications. You can use these elements in conjunction with each other to enable users to move around the application quickly and easily.

Task Automation
Lotus Domino provides a number of elements for automating tasks such as actions. Actions, which can appear in views, documents, pages, and the Action menu, trigger tasks such as creating or saving a document. The Create menu also contains elements that can run a script when a user selects it.

Copyright IBM Corporation 2007.

19

Topic C: Examine IBM Lotus Domino Application Components


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Security Layers
Lotus Dominos layered security model, shown in the following diagram, provides increasing renements to the security of the network, the Lotus Domino server, applications, and elements within each application.

Figure 1-7: Lotus Dominos layered security model Each of the layers in the model is described in the following table.

Layer Physical

Description Access to the equipment used to log on to the network and store backed up data. This refers to access to the server over the wire. The process of establishing trust between the server and that which is trying to access the server. This refers to the restrictions available in the servers Server document. This refers to the levels of access controlled by the Access Control List (ACL) in a specic database. This refers to anything from reading access lists to controlling who can see a particular design element based on who they are.

Network Authentication

Domino Server Access

Database Access (ACL)

Design Element Security

20

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8 Layer Document Security Description This refers to the Readers and Authors elds, which restrict access to specic readers and authors. This refers to encryption. Note that the eld on the form is where encryption is enabled. It is actually the data stored in the document that is encrypted.

Field Security

Copyright IBM Corporation 2007.

21

Topic D: Investigate Replication and Application Design Considerations


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Topic D: Investigate Replication and Application Design Considerations


Replication
Replication is the process of synchronizing multiple instances, or copies, of a application on multiple servers and workstations. Running separate instances of a application on multiple workstations provides two benets: It allows developers and administrators to distribute applications across geographic locations for faster access.
Note: Distributing applications also minimizes traffic across slower network segments and balances server loads.

It allows users to work with an application offline, and then add (or replicate) their changes when reconnected to the network.

The Lotus Domino replication service


The Lotus Domino replication service transfers new and modied notes between applications. The following gure illustrates the concept of replication.

Figure 1-8: Replication

22

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Replica databases
Replica databases are databases that share the same replica ID. The replica ID is generated automatically when a database is created. Replication can only occur between Lotus Domino databases that have the same replica ID. The names of two database replicas can be different, and they can contain different documents or implement different designs. However, if their replica IDs are the same, they can replicate with each other.

What happens during replication


Replication is initiated by a Lotus Domino server or a user in the Lotus Notes client. Note that the server does not initiate replication with a workstation. During the replication process, the two servers (or the client and server) do the following: Authenticate with each other.

Build a list of document, design element, and ACL changes since the last replication. Transfer the changes to the replica databases. Lotus Domino only replicates the items that have changed, not the entire document or design element. Before the servers transfer changes, they check the ACL of the replica databases. Lotus Domino can only transfer those changes permitted by the ACL.

Data that does not replicate


The following data does not ever replicate:

View and FullText indexes File system information (for example, the application le name and path)

Copyright IBM Corporation 2007.

23

Topic D: Investigate Replication and Application Design Considerations


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Replication Considerations
Some of the things you should take into account when considering replication include: Security settings can cause two people to see different elements in the same application. For example, if users are not allowed to read a specic type of document, then those documents are not visible to those users when they replicate the application.

Servers that are doing the replicating must have access to the application elements. There are different levels of control on this. Frequency and timing of replication should be driven by the business need and application design. Additions and deletions of data affect business, and replication affects what users see in the different replica copies. When performed too infrequently, replication can result in reappearance of deleted data as well as information not being shared. Frequency of replication will affect network traffic. The timing of replications can create a situation where the data that one user sees is not the same as what another user sees. Therefore, if the data is time-critical, replication must happen more frequently. This, in turn, will impact network traffic. Multiple users can simultaneously edit the same document in one copy of a application or edit the same document in different replicas between replication sessions. When these situations occur, Lotus Domino stores the results of one editing session in one document and stores the results of additional editing sessions as individual documents that are named Replication or Save Conict. In most cases, you will want to reconcile the differences between the original document and its conict document(s) by editing one, and then deleting the other(s).

24

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Topic E: Extend IBM Lotus Domino Collaboration Capabilities


Lotus Domino Extended Products
IBM offers a family of products that extends and enhances the value of your Lotus Domino environment to increase organizational productivity and responsiveness through business-critical collaboration solutions. This family of products is often referred to as extended products. The following table describes selected Lotus Domino extended products; a more thorough explanation can be found in the appendix Extend IBM Lotus Domino Software.

Product IBM Lotus Sametime


Description Provides a combination of instant messaging and Web conferencing capabilities. Can be added to a Lotus Sametime deployment (in a Windows environment) to support high-volume Web conferencing environments, as well as to optimize load balancing and failover for enterprise-class deployments. Manages the complete life cycle of office documents, from collaborative authoring to archival. It allows teams to work together more effectively through collaborative document management. Lets users instantly create a team workspace to gain access to timely information and to seamlessly bring together geographically and organizationally dispersed team members. Works on top of Lotus Domino and speeds the creation and deployment of workow-oriented applications. It allows organizations to standardize and streamline timeconsuming, people-based activities, and track their progress. A standards-based development tool used by script developers, Visual Basic developers, Lotus Notes application designers, and others to create components for IBM WebSphere Portal. Provides functionality that allows disparate business processes to communicate, process, and share common data.

IBM Lotus Sametime Enterprise Meeting Server IBM Lotus Domino Document Manager IBM Lotus QuickPlace

IBM Lotus Workow

Component Designer

IBM Lotus Enterprise Integration

Copyright IBM Corporation 2007.

25

Topic E: Extend IBM Lotus Domino Collaboration Capabilities


Lesson 1 Exploring Applications in IBM Lotus Domino 8 Product IBM Lotus Expeditor IBM Lotus Extend Search IBM Lotus Mobile Connect IBM Lotus SmartSuite Description Provides solutions to improve workplace efficiency.

Provides additional search capability throughout the enterprise. Provides connectivity between Notes data and hand-held and other non-stationary devices. Provides a suite of office productivity products within the Lotus Notes environment.

IBM Workplace
IBM Workplace is a family of products, solutions, and technologies used for creating innovative, adaptive work environments based on users roles or skill levels, or both. The Workplace family includes: Portal technology

Collaboration tools Content management tools Development tools Workow capabilities Solutions on which a users workspace is built

The following table describes some of the Workplace products.

Product IBM Workplace


Description Delivers fully integrated, servermanaged collaboration to the end users desktop. The Lotus Notes application plug-in allows users to run native Lotus Notes applications within the context of the IBM Workplace Managed Client product.

Managed Client

26

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8 Product IBM WebSphere Portal Description Enables the development and deployment of service-oriented applications. You can extend the reach of your existing Lotus Domino applications to IBM WebSphere Portal software by using portlets. Prebuilt portlets include Portlet Builder for Lotus Domino (part of the WebSphere Portal Application Integrator package), Lotus Notes and Domino and Extended Products Portlets, Lotus Domino Application Portlet, and Common Personal Information Management Portlets in WebSphere Portal Version 5.1. Hosting environment based on Simple Object Access Protocol (SOAP). You can use Web services to integrate your applications with J2EE and Microsoft .NET environments, often with less time and effort, and using existing skills. A standards-based development tool used by script developers, Visual Basic developers, Lotus Notes application developers, and others to create components for the IBM WebSphere Portal.

Native Web Services

Component Designer

Note: For more detailed information on this family of products, use a search engine to locate information on the products listed in the previous table.

Other Products and Technologies


There are other products and technologies that can extend Lotus Domino applications. These services are described in the following table.

Copyright IBM Corporation 2007.

27

Topic E: Extend IBM Lotus Domino Collaboration Capabilities


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Product Lotus Domino Web Access 8


Description Runs on the Mozilla Foundations Firefox and Mozilla browsers, meeting the growing demand for additional client options for Linux desktop users. In addition to creating and verifying digital signatures, Lotus Domino Web Access 8 provides S/MIME support for reading and creating security-rich, encrypted mail. Delivers Lotus Domino services to Microsoft Outlook users. Organizations currently using Microsoft Exchange for their messaging infrastructure can move to security-rich, scalable, reliable IBM Lotus Domino server software, without changing from familiar client software on the desktop and without having to retrain users. Provides integration with Microsoft Office 2003, XP, and 2007 software. Users of Microsoft software can access Lotus Notes Mail using Smart Tags, a Microsoft Office capability, to recognize certain types of text, such as proper names. Unied Messaging represents the convergence of voice mail, e-mail, and fax so that all messages are stored in a single location and can be accessed from a variety of devices, including telephones and PCs. Unied Communications (UC) takes Unied Messaging a step further by extending message access to additional devices and technologies, such as mobile phones, pagers, PDAs, and browsers. In addition, UC provides notication features that will alert subscribers in different ways when they receive a message that meets certain criteria.

Lotus Domino Access for Microsoft Outlook

Microsoft Office

Lotus Domino Unied Communications

28

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 1 Exploring Applications in IBM Lotus Domino 8

Lesson Summary
In this lesson, you received an overview of application types, data sources, and how they are deployed in the IBM Lotus Domino architecture. By gaining a high-level understanding of what applications are and how they work, you can more easily grasp how particular application components t into the overall picture.

Copyright IBM Corporation 2007.

29

Exploring the IBM Lotus Domino 8 Design Environment


Topic A: Explore the IBM Lotus Domino Designer User Interface Topic B: Access Design Elements

Copyright IBM Corporation 2007.

Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Introduction
After completing this lesson, you should be able to: Explore the Lotus Domino design environment. Explore the different design elements in Lotus Domino Designer.

32

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Topic A: Explore the IBM Lotus Domino Designer User Interface


Opening Lotus Domino Designer
IBM Lotus Domino Designer is the development environment used to build IBM Lotus Domino applications. Lotus Domino Designer contains the tools necessary to create powerful Lotus Domino applications. To access the design of an application, open that application in Lotus Domino Designer. There are different ways to open Lotus Domino Designer: Double-click the Lotus Domino Designer icon on your desktop.

Choose StartAll ProgramsLotus ApplicationsLotus Domino Designer. Click the Open and Domino Designer icons from within the IBM Lotus Notes client. Choose ViewDesign from a database open in the Lotus Notes client. If you do not have the access rights to modify the design of a database, the Design option is not available in the View menu.

Procedure Reference: Opening an application in Lotus Domino Designer


Follow these steps to open a application in Domino Designer.
1. 2. 3. 4. 5.

Open Lotus Domino Designer. Choose FileOpenLotus Notes Application. In the Look In eld, enter the location of the application (server name). In My Computer, select the application from the list, or enter it in the File name box (directory and le name). Click Open.

Copyright IBM Corporation 2007.

33

Topic A: Explore the IBM Lotus Domino Designer User Interface


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Identifying the Areas of the Design User Interface


When you open an application in Lotus Domino Designer, the rst level of the design environment opens. The following table describes several areas in this environment.

Area Design pane

Description Includes the Design list for the application. This consists of the list of design elements and the Design bookmark icons, which point to the most recent applications on which you have worked. Lists everything in the current application for the selected design element. Across the top of the Work pane are Design action buttons, which perform actions on the currently displayed elements (such as creating a new form). Each item that you are currently working on has its own tab that, when clicked, takes you to the window that the tab represents.

Work pane

Window tabs

34

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Topic B: Access Design Elements


Design Elements
Lotus Domino Designer includes structures called design elements, which are the building blocks for applications. You can customize these structures to create applications. The following table summarizes tasks you might want an application to perform and the corresponding Lotus Domino design element or elements you could use to implement them.

Application Task/ Functionality Display, gather, and organize information

Design Elements

Pages contain text, images, applets, and other objects. Users cannot enter information into pages. Forms contain elds where users can enter values. The values are stored as a document. Views index and display lists of documents contained in the application.

Automate tasks

Actions and agents can run scripts. They can be triggered programmatically or manually. Hotspots, framesets, outlines, and image maps, when used in combination, allow users to move around the application quickly and easily.

Control navigation

Access control and programming


Design elements are one piece of a Lotus Domino application. The following table describes two other pieces.

To Automate Tasks

Use Programming languages, that enable you to: Calculate or modify information. Validate inputs before saving.

Copyright IBM Corporation 2007.

35

Topic B: Access Design Elements


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment To Control access to information in the application Use The Access Control List (ACL) and other elements, that identify the users who can: Create, read, and modify data. Change the design of the application.

Accessing Design Elements


When you click a design element in the Design list, all the individual, application-specic elements of that type are listed in both the Design pane and the Work pane. The following gure shows the design environment of Lotus Domino Designer. To open an individual design element, double-click the element in the Design pane or Work pane. The element then opens in the Work pane, typically with the Programmers pane below it.

Figure 2-1: The design environment of Lotus Domino Designer

36

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Using the Work pane


The Work pane is used for creating and modifying forms, pages, views, and other elements in the Design list that are specic to your application or database. When you open or create an individual design element, Lotus Domino Designer automatically displays that element in the Work pane.

Using the Programmers pane


Use the Programmers pane to add code in areas of the design element currently displayed in the Work pane. The following table describes the components of the Programmers pane.

Component Objects tab

Function Lists all areas (objects and events) in the current design element where you can add code. Code is added in the Script area. When you click an item on the Objects tab, the Script area changes to show the code that describes the object. The Reference tab reects the language or languages that you can use in the Script area. Lists elds and functions that can be used to write code for the object. Designers can paste from the list or from the context-sensitive Help into the Script area. Used to write code for the element selected using the Objects tab.

Reference tab

Script area

Lotus Domino Designer references


General and context-sensitive Help is available to assist you in working with Lotus Domino Designer. The following table describes different ways of getting help in Lotus Domino Designer.

Resource Lotus Domino Designer Help

Function Provides details on: Using Lotus Domino Designer Designing Lotus Domino applications

How to Open Choose HelpHelp Topics.

Context-sensitive Help

Provides details on the specic element you are working with.

Press F1 or click the Context-sensitive Help icon

Copyright IBM Corporation 2007.

37

Topic B: Access Design Elements


Lesson 2 Exploring the IBM Lotus Domino 8 Design Environment

Lesson Summary
In this lesson, you explored the IBM Lotus Domino Designer user interface and accessed design elements. By becoming familiar with Designer, you can begin the process of using it to build applications tailored to your companys needs.

38

Copyright IBM Corporation 2007.

Creating Applications

Topic A: Create a New, Blank Application in IBM Lotus Domino Designer Topic B: Create a Copy of an Existing Application Topic C: Create an Application from a Template Topic D: Organize the IBM Lotus Domino Designer Environment

Copyright IBM Corporation 2007.

Lesson 3 Creating Applications

Introduction
After completing this lesson, you should be able to: Create a new, blank application in Lotus Domino Designer. Create a copy of an existing application. Create an application from a template. Organize the Lotus Domino Designer interface by using folders and bookmarks.

40

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications

Topic A: Create a New, Blank Application in IBM Lotus Domino Designer


Methods to Create an Application
You can create an IBM Lotus Domino application in the following ways:

Create an application from a template. Create a new, blank application. Copy an existing application.

During this course, you will use all three methods.

Templates
A template is an application that contains the structure for a particular application, but does not contain any data. Lotus Domino includes a number of standard templates that let you easily set up a discussion application, a personal journal, a collaborative team application, and many others. You will work with templates later in the course.

Copyright IBM Corporation 2007.

41

Topic A: Create a New, Blank Application in IBM Lotus Domino Designer


Lesson 3 Creating Applications

The New Application Dialog Box


When you create an application from scratch, you need to enter information and select options from the New Application dialog box, as shown in the following gure. In the top section, you specify the applications title, name, and location, whether or not encryption needs to be enabled, whether a full text index should be created, and what advanced application options should be enabled. In the lower section, you specify the template that should be used.

Figure 3-1: The New Application dialog box

Procedure Reference: Creating a new, blank application


A blank application contains no design elements, such as pages or forms. Blank applications have one default view. Follow these steps to create a new, blank application.
1. 2. 3. 4.

Choose FileApplicationNew. The New Application dialog box appears. Accept the default of Local to create the application on your local computer. Enter a title for the application. Enter a le name for the application.

42

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications 5. 6.

From the template list, select Blank. Click OK.

Copyright IBM Corporation 2007.

43

Topic B: Create a Copy of an Existing Application


Lesson 3 Creating Applications

Topic B: Create a Copy of an Existing Application


Copying an Application Design
A Lotus Domino application can be copied along with all existing design information. If the application designer has hidden the design, you cannot modify the design elements in the copy of the application. To check whether or not this is the case, view the Design tab in the Database Properties box and verify that No design information available is displayed.
Note: After copying the design of an existing application, the manager of the application copy needs to create a new full-text index. For information on creating a fulltext index for a application copy, see Lotus Domino Administrator Help.

Procedure Reference: Copying an application


Follow these steps to copy an application.
1. 2. 3.

Open the application to copy. Choose FileApplicationNew Copy. In the Server eld, do one of the following:

To store the new application on your local hard drive, leave Local selected. For new applications that multiple people will be designing, select or enter a server name to store the new application on a server.

4.

If desired, in the Title eld, enter a title for the new application. The title can have a maximum of 96 characters.
Note: IBM Lotus Domino Designer automatically gives the copied application the same title and le name as the original application. You have the option to change it. The length limit of the applications le name depends on your operating system. The copied application le name must end with the .nsf le extension. If the application will be used as a template, use the le extension .ntf.

5. 6. 7.

In order to copy just the design and not the documents within the application, select Application design only. Deselect Access Control List so that the original applications ACL will not be copied to your new application. Click OK.

44

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications 8.

If necessary, to prevent the copied application from inheriting future template design changes, choose FileApplicationProperties, select the Design tab, and clear the Inherit design from master template check box.

Copyright IBM Corporation 2007.

45

Topic B: Create a Copy of an Existing Application


Lesson 3 Creating Applications

Activity 3-1: Create a Copy of the Instructor Demo Application


Scenario During this course, you will work in several different applications, including the Instructor Demo application. You will need your own version of these application. You will use two different methods for creating your own versions. First, you will create a copy of the Instructor Demo. Then, you will create your own version of the Practice application from a template. Follow these steps to create a personal copy of the Instructor Demo application.
Step 1. 2. 3. 4. 5. Open Lotus Domino Designer. Choose FileApplicationOpen. In the Look In list, select the course server Hub/SVR/WWCorp. In the Database list box, double-click the D8510 folder and select Instructor Demo (Instructor_D8510.nsf). Click Open. Result: The Instructor Demo application opens in Lotus Domino Designer. 6. 7. 8. Choose FileApplicationNew Copy. In the Server list, verify that Local is selected. In the Title text box, type a title for the application that includes your student number. For example, if your student number is 07, type Instructor 07 In the File name text box, type a unique le name for your copy of the application. For example, if your student number is 07, type Instructor07.nsf Click OK. Result: The new copy of the application appears in the Lotus Domino Designer window and is created and saved in the C:\Program Files\IBM\ Lotus\Notes\data directory on your local system. 11. Close all windows for the original application and remove the bookmark. Action

9.

10.

46

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications

Topic C: Create an Application from a Template


Using a Template to Create an Application
The third approach to creating a application is to base the new application on a template.

Copyright IBM Corporation 2007.

47

Topic C: Create an Application from a Template


Lesson 3 Creating Applications

Activity 3-2: Create a Practice Application from a Template


Scenario Now that you have your own version of the Instructor Demo application, you will create your version of the Practice application from a template. Follow these steps to create your own Practice application from a template.
Step 1. 2. 3. 4. Action If necessary, open Lotus Domino Designer. Choose FileApplicationNew. In the OK list, verify that OK is selected. In the Title text box, type a title for the application that includes your student number. For example, if you are student 07, type MyPracticeApplication07 In the File name text box, verify that Lotus Domino has supplied a unique le name for your copy of the application. For example, the le name should be similar to MyPracticeApplication07.nsf In the Specify Template for New Application section, select the classroom server Hub/SVR/WWCorp in the Server list. In the Template list, select Practice Template. If necessary, clear the Inherit future design changes check box. Click OK. Result: The new Practice application opens in Lotus Domino Designer.

5.

6. 7. 8. 9.

48

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications

Topic D: Organize the IBM Lotus Domino Designer Environment


Managing the Lotus Domino Designer Environment
The Lotus Domino Designer environment provides tools to help developers manage the development of applications. These tools include the ability to create bookmarks on the Lotus Domino Designer Bookmark bar, and the ability to create folders to organize application bookmarks.

Folders
One way to help organize your design work is by using folders. You can create folders: As a way of organizing and structuring the design elements in your application.

On the Bookmark bar for easy access to frequently used items. Within a folder in a application. Within a folder on the Bookmark bar.

Bookmarks
Bookmarks are used for easy access to frequently used applications and application. You can drag and drop the following items to the Bookmark bar or to a folder on the Bookmark bar: An application shortcut from your desktop.

A program executable le from Windows Explorer. An application icon from the Design pane. An application window tab.

Procedure Reference: Creating a folder in Lotus Domino Designer


Follow these steps to create a folder in Lotus Domino Designer.
1.

In the Design pane, click the new folder icon. If the Design pane is not open, right-click the Recent Databases folder on the Bookmark bar and select New Folder. In the Folder name eld, type a folder name. In the Select a location for the new folder list box, select the location in which you want to create the folder and click OK.

2. 3.

Copyright IBM Corporation 2007.

49

Topic D: Organize the IBM Lotus Domino Designer Environment


Lesson 3 Creating Applications

Note: Lotus Domino Designer places the folder on the Bookmark bar. You can now populate this folder with applications and other folders.

Procedure Reference: Creating an application bookmark from the Lotus Domino Designer menu bar
Follow these steps to create an application bookmark from the Lotus Domino Designer menu bar.
1. 2. 3. 4.

Choose FileApplicationOpen. Select the application you want to bookmark. Click Bookmark. In the Add to list box, do one of the following:

To display the bookmark directly on the Bookmark bar, select Bookmark Bar. To add the bookmark to a folder on the Bookmark bar, select a folder. To create a new folder, click New folder, type a name for the folder, and click OK.

5.

Click OK. You can access the application by clicking the icon on the Bookmark bar or in the folder.

50

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 3 Creating Applications

Activity 3-3: Create a Folder and Bookmark for the Practice Application in Lotus Domino Designer
Scenario You are interested in managing your work more efficiently and would like to see what the Bookmark bar can do, so you decide to create a folder on the Lotus Domino Designer Bookmark bar that contains a bookmark for your copy of the Practice application. Follow these instructions to create a folder and bookmark.
Step 1. 2. Action If necessary, open Lotus Domino Designer. Click the New Folder icon above the Design pane. Result: The Create Folder dialog box opens. 3. 4. 5. Name the new folder Fundamentals In the Select a location for the new folder eld, select the Folders location. Click OK. Result: The folder appears on the Bookmark bar. If you move the cursor over the folder, its name appears as pop-up text. 6. 7. 8. Now, to create a bookmark within the folder, choose FileApplication Open. Select the name of your Practice application. Click Open. Result: The application is opened in Lotus Domino Designer. 9. Drag the application icon to the Fundamentals folder. Result: A bookmark for the Fundamentals Practice application is created in the Fundamentals folder.

Copyright IBM Corporation 2007.

51

Topic D: Organize the IBM Lotus Domino Designer Environment


Lesson 3 Creating Applications

Lesson Summary
In this lesson, you created an original application structure, an application structure copied from a previously designed application, and an application structure based on a template. By learning how to create an application structure by using a variety of methods, you can approach a design problem with knowledge of the tools needed to leverage existing work effort.

52

Copyright IBM Corporation 2007.

Creating Pages

Topic A: Explore Page Content, Layout, and Navigation Basics Topic B: Create Pages Topic C: Add Text to Pages Topic D: Use Tables to Lay Out Pages Topic E: Add Images to Pages

Copyright IBM Corporation 2007.

Lesson 4 Creating Pages

Introduction
After completing this lesson, you should be able to: Explore the basics of page content, layout, and navigation. Create a page and set its properties. Add text to a page, and format text on a page. Use tables to lay out pages. Add shared images to a page.

54

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Topic A: Explore Page Content, Layout, and Navigation Basics


The Page Design Element
The page design element is similar in concept and usage to a static HTML page. IBM Lotus Domino pages structure and display information that remains relatively stable. Application users do not create pages or add content to pages, but use them to discover information and navigate through a site or application. Pages can consist of the following: Information

Organizing elements Programmable elements Navigational elements


Caution: All of the elements available to pages are available to forms; however, not all elements available to forms are available to pages.

Types of Page Information


The following table lists the types of information that can be incorporated on a page.

Element Text Graphics

Description Static data such as a company name. Images such as GIF, JPEG, and BMP les. (For graphic types other than GIF or JPEG, refer to Lotus Domino Help for advice on how to treat the graphics for optimum presentation.)

Content Organization Design Elements


The following elements can be used to organize and display information on a page.

Element Tables Sections

Description Information organized in rows and columns. Collapsible and expandable areas that can include text, graphics, and objects.

Copyright IBM Corporation 2007.

55

Topic A: Explore Page Content, Layout, and Navigation Basics


Lesson 4 Creating Pages Element Layers Description Control the placement, size, and content of information in overlapping blocks.

Programmable Elements
The following programmable elements can be used on pages.

Element Applets

Description Small programs such as an animated logo or self-contained application. Hypertext Markup Language, which can be written directly on the page or imported from another source. A place for storing and sharing common JavaScript programs and code. You can insert an existing JavaScript library into a page, form, or subform. Buttons or hotspots that automate tasks for a user. Links or objects that represent data in another application. Generates dynamic text based on formula results. Styling instructions that can be used to format HTML pages.

HTML

JavaScript libraries

Actions

OLE objects

Computed text

Cascading Style Sheets (CSS)

Navigational Elements
The following navigational elements can be used on pages.

Element Imagemaps

Description A graphic or collection of graphics, overlaid with programmable hotspots. Hotspots, in the form of pop-up text, actions, links, and formulas, perform an action when clicked by a user.

56

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages Element Embedded elements Description You can embed the following elements in a page: A view or folder pane Navigator Outlines Date picker Instant Messaging Contact list

Use these elements alone or combine them to control how users navigate through your application.

Ways to Display Pages


Pages can be displayed to the user in several ways:

As part of a frameset. As a link from a form, subform, outline, or another page. From an action. As an outline entry that displays the page.

When to Use Pages


When developing or updating an application, designers determine when to use a page instead of a form to display information. The following table lists the conditions used to determine whether to use a page or a form.

If the Goal is to Display static information such as company data and background information Collect and store information from end users

Use a Page to structure and display information.

Form to structure and display the data.

Note: You will work extensively with forms later in the course.

Copyright IBM Corporation 2007.

57

Topic A: Explore Page Content, Layout, and Navigation Basics


Lesson 4 Creating Pages

Design Elements Not Available on Pages


The following table lists the elements available to forms but not to pages.

Design Element Layout regions Subforms Fields Shared elds Embedded elements: File upload Scheduler Editor No No No No No

Page Yes Yes Yes Yes Yes

Form

58

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Activity 4-1: Examine a Page


Scenario You are developing an application and are interested in discovering how to view the pages you create appear in Lotus Notess design and client environments, as well as a Web browser. Follow these steps to examine a page, its elements, and its properties. The page is in the Practice application.
Step 1. 2. Action If necessary, open your copy of the Practice application in Lotus Domino Designer. In the Design pane, select Pages. Result: A list of pages appears in the Work pane. 3. Double-click the First Look page to open it. Result: The First Look page opens. 4. Choose DesignPage Properties. Result: The Page Properties box opens. 5. Click the following elements to see the different Properties boxes:

The IBM logo The picture The text

Result: The Page Properties box changes to display properties of the selected element. 6. Close the Page Properties box and the First Look page. Do not save change if prompted.

Copyright IBM Corporation 2007.

59

Topic B: Create Pages


Lesson 4 Creating Pages

Topic B: Create Pages


Page Development Process
Application developers design, create, and control the display of pages. Application users see pages as they navigate through the application. When developing pages:

Create the page. Set the page properties. Add the required elements.

Procedure Reference: Creating a page


Follow these steps to create a page.
1. 2. 3. 4. 5. 6. 7.

In the Design pane, click Pages. In the Work pane, click New Page. Choose DesignPage Properties. Enter a name in the Name eld. Close the Page Properties box. Add appropriate elements to the page. Save the page.

The Page Properties Box


In addition to the content that resides on the page, a page contains properties or attributes of its own. To examine information about a page, use the Page Properties box. The properties of a page, as well as any other element, are modied through the Properties box. The process to change the properties of an element is as follows: 1. Select the element. 2. 3. 4. Open its Properties box. Specify the appropriate properties. Close or collapse the Properties box.
Note: When typing text in the Properties box, pressing Esc will delete the text.

Properties boxes do not need to be closed after each modication. They change to reect the latest element selected as selections are made. Changes are applied immediately.

60

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

The following gure shows the Page Properties box.

Figure 4-1: The Page Properties box Use the Page Properties box to specify attributes of a page such as: Page name and alias.

Background color. Background graphic.

Page Names
Page names within the same application must be unique. They can contain:

Characters Spaces Numbers Punctuation

Page names are also case-sensitive. Although the name itself is limited to 64 bytes, the size limit increases to 256 bytes if there is a name alias.

Copyright IBM Corporation 2007.

61

Topic B: Create Pages


Lesson 4 Creating Pages

Aliases
An alias is simply another name for a page or other design element. Aliases are a short way to refer to the page. If an alias exists, it is used to: Refer to the page programmatically.

Consistently refer to the page, even if the name of the page changes.

Aliases are an internal reference to the page, or other element with which they are associated.

Procedure Reference: Creating a name alias


Follow these steps to create a name alias.
1. 2.

Open the page. Choose one of the following methods to open the Page Properties box:

Choose DesignPage Properties. Right-click the page and choose Page Properties.

3.

In the Name box, enter | (pipe symbol) and your alias name after the existing page name. For example: pageName | pn
Note: Press Shift+\ for the pipe symbol.

4. 5.

Close the Page Properties box. Save the page.

62

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Activity 4-2: Create a Page, and Set Its Properties


Scenario You are beginning work on an application and are interested in creating a new page and viewing its properties. Follow these steps to create a page.
Step 1. 2. Action If necessary, open your copy of Practice application in Lotus Domino Designer. If necessary, select Pages in the Design list. Result: The Pages design list appears. 3. Click New Page. Result: A blank page opens in the Work pane. 4. Choose DesignPage Properties. Result: The Page Properties box opens. 5. 6. 7. Type the following name and alias into the Name box: Practice Page | pp Close the Page Properties box. Save the page. Result: The new page appears in the page list.

Copyright IBM Corporation 2007.

63

Topic C: Add Text to Pages


Lesson 4 Creating Pages

Topic C: Add Text to Pages


Text Elements
Pages can contain the following kinds of text:

Static text, for example, the page title, graphic labels, or explanatory text. Dynamic text, for example, text that is computed.

Text Formatting
Use the Text Properties box to modify text on your form. Using the Text Properties box, you control: Font

Paragraph Alignment Paragraph Margins Paragraph Border Paragraph Hide When Paragraph Styles

The following gure shows the Text Properties box.

Figure 4-2: The Text Properties box

Previews
To determine how your work looks and behaves in the target client, preview your work in the supported Web browsers as well as in the IBM Lotus Notes client.

64

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

The Preview toolbar contains links to each browser on your computer. Clicking a browser icon previews the current design element in the associated browser. The following gure shows the Preview toolbar.

Figure 4-3: The Preview toolbar

Procedure Reference: Previewing your work


Follow these steps to preview your work.
1. 2.

In IBM Lotus Domino Designer, open the design element you wish to preview. Either choose the appropriate menu commands or click one of the Preview buttons. The menu commands are as follows: Choose DesignPreview in Notes.

Choose DesignPreview in Web BrowserDefault Browser or Internet Explorer.

Result: You are prompted to save any changes to the design element. Then, the design element is opened in the selected client.
3.

Close or minimize the preview program and return to Lotus Domino Designer.

Browser previews
Security settings can affect the display of Lotus Domino applications in Web browsers. If a server or application is not set up for Anonymous access, you will need to authenticate to be able to preview.
Note: You will work more extensively with access control lists later in the course.

Copyright IBM Corporation 2007.

65

Topic C: Add Text to Pages


Lesson 4 Creating Pages

Activity 4-3: Add and Format Text


Data Files: Practice

Scenario The page you have been developing is alright, but it is not visually engaging. You take steps to add formatting to some of its elements. Follow these steps to add formatted text to your page.
Step 1. 2. Action If necessary, open Practice Page in your copy of the Practice application. Enter the following text: Practice Page Result: The text appears in the top left corner of your page. 3. Highlight the text you just entered and open the Text Properties box by choosing TextText Properties. Result: The Text Properties box opens to the Font tab. 4. On the Font tab, click Arial 24 points.

Result: The text changes to Arial font and 24 points.


5. Click the Paragraph Alignment tab and click the centered text option.

Result: The text is centered across the top of the page.

66

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages Step 6. Action Click the Paragraph Border tab and click the Double Border style. In the Border Effects section, select Drop shadow.

Result: A border appears around your text, running the length of the page.
7. 8. 9. Close the Text Properties box. Save your page. Preview your work. Result: The page preview is quite different in Lotus Notes than it is in the Web browser.

Copyright IBM Corporation 2007.

67

Topic D: Use Tables to Lay Out Pages


Lesson 4 Creating Pages

Topic D: Use Tables to Lay Out Pages


Table Types
A table is an element you can use to organize content into rows and columns. Use tables to organize, summarize, and align elements such as text, elds, and graphics. Tables can be created in: Pages

Forms Subforms Table cells

Lotus Domino Designer provides ve types of tables. The following table describes these types.

Display Basic

Description Displays data organized into rows and columns. Looks like a grid or spreadsheet. Displays each row of data as a separate tab. Users view information displayed in the rows by selecting a tab. Displays one row of the table at a time based on a specied time interval. Animated tables are not supported on the Web and are not designed for data entry on forms. Similar to a tabbed table, but users click captions instead of tabs. Similar to a tabbed table, but users click an action or link. Displays a different row of the table based on an action or eld. Yes

Use on Web

Tabbed

Limited. Best for displaying static information.

Animated

No. For the Web, an alternate programming technique is required to show an animated table.

Caption

Limited. Best for displaying static information.

Programmed

Limited. Data loss can result.

68

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Tables and the Web


Tabbed tables are limited for Web use because each time a user clicks a tab, the page needs to redraw, thus consuming server resources and bandwidth. In addition, if information is entered on one tab, and another tab is clicked, that information is lost unless it is submitted prior to the tab change.
Note: If the table collects information (in other words, if the table is on a form), there are properties that can be set to generate hidden placeholders for data that has not been submitted.

Animated tables for the Web can be created by using JavaScript.

Table Properties
The Table Properties box contains a number of tabs and settings. The tabs include: Table Layout

Cell Borders Table/Cell Background Table Borders Table Margins Table Rows Table Programming

Table width options


When a table is created, there are three width options available: Fit with margins, Fit to window, and Fixed width. The following table lists these options and their results.

Table Width Option Fit with margin

Result The table lls a given body size, from margin to margin. This is useful when nesting tables within one another. The width of the table will ll the margins, regardless of the frame size. A measured column width is set for the table, regardless of the size of the window.

Fit to window

Fixed width

Copyright IBM Corporation 2007.

69

Topic D: Use Tables to Lay Out Pages


Lesson 4 Creating Pages

Setting table layout properties


The following gure shows the Table Layout tab of the Table Properties box.

Figure 4-4: The Table Layout tab On the Table Layout tab, the Width and Position properties also render to the Web. The following table lists the results of the individual property settings in the Web page.

Property Width

Web Function If left xed, keeps the individual column (cell) that particular width, regardless of content. The Width property will generate an HTML width attribute as either a percentage or as pixels, based on the selection. Affects the horizontal positioning of the table within the Web page. The Position property will create an HTML align attribute.

Position

70

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Setting cell borders properties


The following gure shows the Cell Borders tab of the Table Properties box.

Figure 4-5: The Cell Borders tab The Cell Border Thickness setting dictates whether or not a border appears. Setting all of the borders to 0 will cause the border to be invisible. Setting the border width to a value of greater than 0, will display a border for the table. Setting a 0 border is useful when the table is only used for positioning and the borders would detract from the page appearance. For the Web, the only attribute that applies from the Cell Borders tab is Cell Border Thickness.

Copyright IBM Corporation 2007.

71

Topic D: Use Tables to Lay Out Pages


Lesson 4 Creating Pages

Setting table and cell background properties


The following gure shows the Table/Cell Background tab of the Table Properties box.

Figure 4-6: The Table/Cell Background tab The Table/Cell Background tab of the Table Properties box deals with table color, cell color, and cell image. Most of the properties render to HTML. The following table relates properties of the Table/Cell Background tab to their corresponding HTML attributes.

Property Table color

Web Function Sets an overall color for the table, it generates an HTML bgcolor attribute on the <td> (Table Data) tag. Generates an HTML bgcolor attribute for an individual cell tag. A table cell is dened in HTML with a <td> tag. The Style attributes do not have a corresponding HTML style. Translates to the Web as a background image attribute for the <td> tag. Lotus Domino Designer does not provide the capability for a background graphic for the entire table. However, you can accomplish this using HTML.

Cell color

Cell image

72

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Setting table borders properties


The following gure shows the Table Borders tab of the Table Properties box.

Figure 4-7: The Table Borders tab The properties of the Table Borders tabs have no effect on any of the translated HTML attributes. The HTML language does not currently provide for margin settings or text wrapping attributes.

Setting table margins properties


The following gure shows the Table Margins tab of the Table Properties box.

Figure 4-8: The Table Margins tab The properties of the Table Margins tabs have no effect on any of the translated HTML attributes. The HTML language does not currently provide for margin settings or text wrapping attributes.

Copyright IBM Corporation 2007.

73

Topic D: Use Tables to Lay Out Pages


Lesson 4 Creating Pages

Setting table rows properties


The following gure shows the Table Rows tab of the Table Properties box.

Figure 4-9: The Table Rows tab The Table Rows tab allows you to modify the Lotus Domino table type attributes, which allow you to modify the overall table settings.

74

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Setting Table Programming Properties


The following gure shows the Table Programming tab of the Table Properties box.

Figure 4-10: The Table Programming tab Use the Other eld of the Table HTML Tags or Cell HTML Tags to add attributes to the <table> or <td> tags.

Procedure Reference: Creating a table


Follow these steps to create a table.
1. 2. 3. 4. 5. 6. 7.

Open a page in Lotus Domino Designer. Choose CreateTable from the menu. Specify the number of rows and columns for the table. Specify the table width. Select a table type by choosing one of the options. Click OK. Save and preview the page.

Copyright IBM Corporation 2007.

75

Topic D: Use Tables to Lay Out Pages


Lesson 4 Creating Pages

Activity 4-4: Add a Table to a Page, and Place Text in It


Scenario You have a lot of information that needs to be organized vertically on the page you have been developing. Follow these steps to add a table and text to the Practice page.
Step 1. Action If necessary, open Practice Page in Lotus Domino Designer. Result: The page opens in the Work pane. 2. Place the cursor below the formatted text. Create a non-formatted paragraph. Result: The cursor blinks to indicate its position. 3. Choose CreateTable. Select the appropriate options to create a basic, xed width table with two rows and two columns. Click OK. Result: A table with two rows and two columns is inserted. 4. Place the cursor in the rst cell of the table. Type the following text: Tables can hold text. Result: The text appears in the table cell. 5. Place the cursor in the second cell of the second row. Type the following text: Page layout is easier when you use tables. Result: The text appears in the table cell. 6. 7. 8. Save the page. Preview the page in the Lotus Notes client. Preview the page in a Web browser, and note the differences in how the page appears.

76

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Topic E: Add Images to Pages


Images
The use of graphics can make an application more appealing and effective. Lotus Domino provides several tools for incorporating graphics. You can: Copy and paste a graphic from the clipboard.

Import an image from a le. Insert a shared image from the shared resources area of the Lotus Domino application. BMP (Bitmap) CGM JPEG GIF Lotus PIC PCX Tiff 5.0 PNG (Portable Network Graphic)

The following image types can be used:


Images can be used in pages and forms.


Note: Unlike GIF and JPEG graphics, PNG graphics will not open directly in a Web browser. When designing pages that will be viewed through a browser, choose the graphics formats whose strengths mesh well with your intended use and development style.

Procedure Reference: Importing an image from a le


Follow these steps to import an image from a le.
1. 2. 3.

Open a page in Lotus Domino Designer. Place the cursor where you want the graphic to appear. Choose one of the following:

Choose CreatePicture. Choose FileImport.

4.

Select the images le type. Result: The Create Picture dialog box displays only image le types. File Import displays all le types that can be imported into a Lotus Domino Designer page or form.

Copyright IBM Corporation 2007.

77

Topic E: Add Images to Pages


Lesson 4 Creating Pages 5. 6.

Select or enter the le name. Click Import. Result: The image is inserted onto the page.

Picture properties
A picture, like other elements, has properties which are modied using the Properties box. Once a picture is added, the Picture Properties box becomes available. Use properties to specify attributes or aspects of a picture such as: Size

Border style Alignment Margins

The following gure shows the Picture Properties box.

Figure 4-11: The Picture Properties box

78

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Shared Resources
A shared resource is an element, such as a graphic le, stored within a Lotus Domino application. Each application can contain a library of its own shared resources. Shared resources let you reference a resource multiple times throughout a application, while only having to maintain the resource in one location. Each application can contain a library of shared resources consisting of: Images

Files Applets Style sheets Data connections

Using shared resources reduces application maintenance. If a resource is changed, all occurrences of the shared resource are automatically updated. A major advantage of shared resources is that they are a part of the application; if the application is moved, copied, or replicated, so are its shared resources. To use a shared resource, it needs to be imported to the Lotus Domino application. Its native format is maintained during this process.

Using Image Resources


As you saw earlier in this lesson, you can import an image from the le system. However, if the graphic le changes, the image in the application is not updated unless you import it again.
Note: The native format of an image resource is maintained. Once added to the application, the resource can be exported in its native format, by selecting the image from image resources and choosing Export from the Resource menu.

Copyright IBM Corporation 2007.

79

Topic E: Add Images to Pages


Lesson 4 Creating Pages

Procedure Reference: Adding an image resource to an application


The rst step in the process of using a shared image is to create an image resource. Follow these steps to create an image resource.
1. 2. 3. 4.

Click Shared Resources in the Design list. Click Images. In the Work pane, click the New Image Resource button. In the New Image Resource dialog box, do the following:

Select the le type. Navigate to the correct directory and select the le name. Click Open.

Image resource properties


Like other Lotus Domino Designer elements, image resources have properties which are modied using a Properties box. Use the image resource properties to specify attributes such as: Name and alias

Source le information

The following gure shows the Image Resource Properties box.

Figure 4-12: The Image Resource Properties box

80

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Procedure Reference: Inserting an image resource


The second step in the process of using a shared image is to insert the image resource where needed. Follow these steps to insert an image resource.
1. 2. 3. 4. 5.

Create a new, or open an existing, page in Lotus Domino Designer. Move the cursor to where you want to the image to appear. Choose CreateImage Resource from the menu. If necessary, choose the type of image (GIF, JPEG, All Images) to display the desired image type. Click the le name listed in the list box. Result: A thumbnail view of the image displays in the dialog box.

6.

Click OK.

Identifying a pictures source


To identify the source of a picture on a page, use the Picture Properties box. The following gure shows the source of an image added using the Create menu.

Figure 4-13: Source information for an imported picture The following gure shows the source of an image that is a shared resource.

Figure 4-14: Source information for a shared image

Copyright IBM Corporation 2007.

81

Topic E: Add Images to Pages


Lesson 4 Creating Pages

Activity 4-5: Add and Use a Shared Image


Scenario The company you are designing for would like to use its new logo image prominently whenever its employees use Lotus Notes applications. In this activity, you will create a shared image to use throughout the Worldwide Corporation applications. Follow these steps to complete the activity. Use your copy of the Practice application.
Step 1. 2. 3. 4. Action If necessary, open your Practice database in Domino Designer. Create a shared image resource. In the Element list, click Shared Resources. Then, click Images. Click New Image Resource. In the list of graphic les, choose WWGlobe.gif. Result: WWGlobe.gif is added to the list of image resources. 5. Open the Practice Page you created earlier. Result: The Practice Page opens in the Work pane. 6. 7. Place the cursor below the table you added earlier. Choose CreateImage Resource. Select the WWGlobe.gif image. Click OK. Result: WWGlobe.gif is added to the page. 8. Save and preview the page.

82

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages

Lesson Summary
In this lesson, you created pages and populated them with text, images, and tables. By learning how to insert important design elements in pages, you can create application components that look professional and get the job done.

Copyright IBM Corporation 2007.

83

Topic E: Add Images to Pages


Lesson 4 Creating Pages

Lab 4-1: Create a Page


Scenario Worldwide Corporation is in the process of creating organizational policies. They need a Policies and Procedures application to create and store policy documents for their employees. This application also needs a page that gives people an overview of the company.
Note: The guided solution to this activity can be found in Appendix A, Lesson Lab Solutions.

To complete this activity:


Build a new application. Create shared images. Create a page. Modify the Information page.

Perform the following tasks to complete this lab.

1. Create a new blank application on your local machine. Name it

Policies_##.nsf where ## is your student number.

2. Revise the Default access level to Manager.

3. Create the following shared images:


LOGO WW1.gif bluerule.gif

4. Create a page named Information that displays the company logo,

Logo WW1.gif, and the company address 123 Worldwide Blvd. Metropolis, PA 45555 in a table.

5. Place bluerule.gif below the table.

84

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 4 Creating Pages 6. Type the following text which describes the company. Give the text a

heading, for example About Us.


Worldwide is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives who work from their homes.

7. Save and preview your work.

8. Close all open windows.

Copyright IBM Corporation 2007.

85

Creating Forms

Topic A: Create Forms Topic B: Add Fields to Forms Topic C: Hide Form Elements

Copyright IBM Corporation 2007.

Lesson 5 Creating Forms

Introduction
After completing this lesson, you should be able to: Create a form. Work with date/time data. Hide form elements.

88

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Topic A: Create Forms


Forms
A form is a design element through which data is entered and displayed. Forms are different than pages in that they are used to collect data. The data collected via a form is stored in a document or a note. When a user adds information to a application through a form and saves it, the information is saved as a separate document from the form. When a user opens a document, the document uses the form as a template to provide the structure for displaying the data. Forms consist of the following: Fields used to collect or display data.

Static elements, such as text, graphics, and tables used to control appearance and user interface. Programming to act on data.

The following gure represents the form design element.

Figure 5-1: The form design element

Copyright IBM Corporation 2007.

89

Topic A: Create Forms


Lesson 5 Creating Forms

Application notes
A form is a design note stored inside an IBM Lotus Domino application. The design note contains the design elements and code that make up the form. Lotus Domino applications contain four different types of notes. The following table briey describes the four note types stored in a application and their function.

Note Type Header

Function Contains information about the application itself, such as its name, size, and creation date. Each application has a single header note. Stores the access control list, a list of names and permissions associated with the application. Each design element, such as a form, view, or page is stored in the application as a design note. The form design note acts as a template used to create new documents or display information. A data note holds the information entered using a form, as well as system data used by Lotus Domino for management purposes. These are also known as documents.

ACL Note

Design Note

Data Note

Elements used in forms


The following table describes elements that might be included on a form.

Element Text and graphics

Function Display information or pictures on all documents using the form. Display data from documents. Save data to a document. Compute a value. Control attributes of the form. For example, a background color is a form property. Offer additional tools to the designer, often enhancing interactivity or efficiency of the form.

Fields

Properties

Other elements, such as subforms, shared elds, and actions

90

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Form Design
There are three phases in creating a form: 1. 2. 3. Design the appearance. Create the form. Test the form.

In this section, you will investigate the rst phase: form design. When designing a form, consider the following questions: What should this form do?

What kind of information is needed from the user? Should any of this information be automatically generated? What process(es) should occur once the form is submitted? What client(s) will be used to access the form?

Procedure Reference: Designing a form


Follow these steps to design and create a form.
1. 2. 3. 4. 5. 6. 7.

Decide the purpose of the form. Determine the information the form will collect. Determine required elements for the form. Create the form. Add the required elements to the form. Save the form. Test the form in various clients.

Copyright IBM Corporation 2007.

91

Topic A: Create Forms


Lesson 5 Creating Forms

Procedure Reference: Creating a form


Follow these steps to create a form.
1. 2.

Open the application in Lotus Domino Designer. In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.

3. 4. 5. 6. 7. 8.

In the Work pane, click New Form. Choose DesignForm Properties. Enter a name in the Name eld. Close the Form Properties box. Add elements to the form. Save the form.

Form Properties
To examine information about a form, use the Form Properties box. The following gure shows the Form Properties box.

Figure 5-2: The Form Properties box

92

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Use the Form Properties box to specify attributes of a form such as:

Form name and alias Background color Header and footer text

Form names
Form names within the same application must be unique. Form names may include: Characters

Spaces Numbers Punctuation

Form names are also case-sensitive. Although the name itself is limited to 64 bytes, the size limit increases to 256 bytes if there is a name alias or cascading menu option. As with pages, forms can have aliases.

Copyright IBM Corporation 2007.

93

Topic A: Create Forms


Lesson 5 Creating Forms

Activity 5-1: Create a Form


Scenario You are building an application and would like to add a component to it that can accept data entered by users. Follow these steps to create a simple form with an alias.
Step 1. 2. Action Open your copy of the Practice application in Domino Designer. Click Forms in the Design list. Result: A list of existing forms appears in the Work pane. 3. Click New Form. Result: A new blank form opens. 4. Choose DesignForm Properties. Result: The Form Properties box opens. 5. 6. 7. Type the following name and alias into the Name box: Employee Information | ei Close the Form Properties box. Save the form. Result: Your new form appears in the form list.

Adding Text and Tables to a Form


As with pages, forms can contain static or dynamic text.

Static text in a form can be the forms title, eld labels, or explanatory text. Dynamic text in a form can be computed text.

Text and other content in forms can also be organized by using tables, just as in pages.

94

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Activity 5-2: Add and Format Text


Scenario Because it is important for users to understand what they are asked to enter, you want to make the design of the data entry component you are designing clear and engaging. Follow these steps to add formatted text to your form.
Step 1. 2. Action If necessary, open the Employee Information form in your copy of the Practice application in Domino Designer. Type the following text: Employee Information Form Result: The text appears in the top left corner of your form. 3. Highlight the text you just typed and open the Text Properties box by choosing TextText Properties. Result: The Text Properties box opens to the Font tab. 4. On the Font tab, select Arial 24 points. Result: The text changes to Arial font and 24 points. 5. Click the Paragraph Alignment tab and select the centered text option. Result: The text is centered across the top of the page. 6. Click the Paragraph Border tab and select the Double Border style. Select Drop shadow. Result: A border box appears around your text, running the length of the form. 7. 8. Close the Text Properties box. Save and preview the form in both IBM Lotus Notes and a Web browser. Note any differences in the forms appearance.

Copyright IBM Corporation 2007.

95

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

Topic B: Add Fields to Forms


Fields
A eld is a part of a form that collects, calculates, or displays data. Each eld stores a single type of information. The type of information a eld accepts must be dened. Fields are used to: Enter data in documents.

Modify the content of documents. View data in documents. Calculate data through formulas.

Procedure Reference: Creating form elds


Follow these steps to create form elds.
1. 2. 3. 4. 5. 6. 7. 8.

Add the eld to the form. Name the eld. Specify the data type. Specify how the eld is populated. Set additional eld properties. If necessary, program eld contents. Save the form. Test the form in various clients.

Specifying eld characteristics


When you create elds, specify at least the following characteristics:

Field name Field type How the eld is populated

Each of these characteristics is specied using the Field Properties box.

96

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Procedure Reference: Adding a eld to a form


Follow these steps to add a eld to a form.
1. 2.

Place the cursor at the desired location on the form. Choose CreateField from the menu, or right-click the form and choose Create Field. Result: Lotus Domino adds a eld to the form and opens the elds Properties box.
Note: Like many applications, there can be several options for performing a task. In this course we use the menu bar option for consistency. However, feel free to choose whichever method you are most comfortable with.

3. 4.

Enter a name for the eld on the Field Info tab in the Properties box. Specify the eld type on the Field Info tab in the Properties box.

Field Names
Each eld in a form must have a unique name in that form. Use the following rules and guidelines when naming elds. Field names cannot: Exceed 32 bytes.

Begin with a number. Use the @ symbol. Contain spaces.


Caution: Field names can begin with dollar signs ($). However, this typically indicates a reserved eld name. These types of elds add functionality that you would otherwise have to program yourself. If you try to use a reserved name in a way that is different from its intended use or redene the eld, Lotus Domino Designer displays an error message. There are also a few reserved eld names that do not begin with dollar signs, such as Form and SaveOptions. These are covered later in this course.

Copyright IBM Corporation 2007.

97

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

Field Data Types


The elds data type determines two things:

What type of information the eld can contain. How the eld is populated.

Fields can contain the following types of data: Text


Numbers Date and time Formulas Rich text

A more complete list may be found in Lotus Domino Designer Help.

Field Values
When you indicate the type of data a eld contains, you also indicate how the eld gets its value. The following table lists the eld value options and their purpose.

How the Field Value Is Created Editable

Value Is... Entered by the user. There can be a default entry based on a formula. Created as the result of a calculation. Fields are calculated when: Saving Refreshing Changing modes

Computed

Computed for display

Created as the result of a calculation. Lotus Domino does not store the result with the document. It calculates the value each time users refresh the document. Created when the document is created. If the eld is added to a form, after documents have been created, the value is calculated the next time one of these documents is opened.

Computed when composed

98

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Field Design Considerations


Before adding elds to a form, determine the following:

The type of data that you want to capture (text, number, date, etc.). Logical position of elds on the form (consider data entry ow). How to identify to users the purpose of the eld (for example, eld labels). How the data should appear to the reader. How to identify the eld for yourself when designing the application (eld name). Whether or not there are dependencies on the content of other elds.

Lotus Domino processes forms from the top-left to the bottom-right. Keep this in mind if you create elds whose calculations are dependent upon other elds on the form.

Text Data
Lotus Domino Designer allows you to specify the type of text data a eld will store. The types of text data include: Text

Rich text Lists Names

Text elds
A text eld is editable by default. Users can enter and view alphanumeric data in this type of eld. One example of a text eld is a eld used to collect or display a customer name. Text elds have the following characteristics: The display format is dened by the eld on the form.

The eld length is not xed. The eld content can be displayed in a view.

Rich text elds


A rich text eld stores complex data. An example of a rich text eld is the Body eld used in the mail memo. Rich text elds have the following characteristics: They can store many types of data, including graphics.

They can store formatting with the data. They cannot display in a view.

Copyright IBM Corporation 2007.

99

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

Rich Text Lite Fields


A rich text lite eld is the same as a rich text eld except that an icon and drop-down arrow is added next to the eld. The icon helps users to add objects to the eld more easily; the drop-down menu provides a list of eld data entries from which the user may add. Entry of invalid data or objects displays an error message.

Native OS style
Native OS is a style selected on the Field Info tab in the Field Properties box. The Native OS style has a user-friendly interface for text elds. For example, editable text elds appear on the document as a xed-sized outlined box instead of as a blank space marked off by brackets.

100

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Activity 5-3: Add Text Fields to a Form


Scenario Your data entry component is taking shape and youre ready to create the parts where the users actually enter the data. Follow these steps to add rst and last name elds, along with text labels, to the Employee Information form.
Step 1. Action If necessary, open the Employee Information form in your copy of the Practice application in Domino Designer. Result: The form opens in the Work pane. 2. Place the cursor below the formatted text. Result: The cursor blinks to indicate its position. 3. Choose CreateTable. Select the appropriate options to create a basic, xed width table with one row and four columns. Click OK. Result: A table with one row and four columns is inserted. 4. Place the cursor in the rst cell of the table. Type the following text: First Name: Result: The text appears in the table cell. 5. Place the cursor in the second cell. Choose CreateField to create a eld with the following characteristics:

Name: FirstName Type: Text/Editable.

Result: The FirstName eld is created. 6. Place the cursor in the third cell of the table. Enter the following text: Last Name: Result: The text appears in the table cell. 7. Place the cursor in the fourth cell. Choose CreateField to create a eld with the following characteristics:

Name: LastName Type: Text/Editable

Result: The LastName eld is created. 8. 9. Save the form. Preview the form in Lotus Notes.

Copyright IBM Corporation 2007.

101

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

List Fields
List elds present users with a list of pre-dened choices. Some types of list elds allow the selection of a single choice, multiple choices, or choices not in the list. The following table describes the list types available and when to use them.

Use This Type of Field Dialog list

If You Want the User to Select One or more choices from a pop-up dialog box, or to add a choice not in the list. One or more choices from a short list. Only one choice from a short list. One or more choices from a scrolling list. One choice from a drop-down list, or to add a choice not in the list.

Checkbox Radio button Listbox Combobox

102

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Procedure Reference: Creating a list of choices


Follow these steps to create a eld with a list of choices.
1. 2. 3. 4.

Place the cursor at the desired location on the form. Choose CreateField from the menu. Enter a name for the eld and choose one of the list eld types. Click the Control tab. Select one of the list choices:

Enter choices (one per line) Use formula for choices

Note: Dialog lists have several more choice options.


5. 6.

Enter either the list choices or a formula. Save and preview the form.

Copyright IBM Corporation 2007.

103

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

Procedure Reference: Setting the default value for a list eld


Providing a default value for a list eld ensures that the eld gets lled in and often removes the need for users to enter data. Follow these steps to set a default value for a list eld.
1. 2. 3.

Open the form in the Designer. Select the list eld. In the Programmers pane, click the Objects tab.

The eld object with the list elds name should appear at the top of the object list. Default Value should be highlighted. If not, click once on Default Value to select this event.

4.

In the Script area, enter the default value surrounded by quotation marks. Click the check mark. Result: A value surrounded by quotation marks displays in the Script area.
Note: This value must exactly match one of the list values spelling and case.

5.

Save the form and preview the design changes.

Default eld value


The following gure shows the Programmers pane with a eld entered as a default value.

Figure 5-3: A default value entered into the Programmers pane

104

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Activity 5-4: Create and Set a Default Value for a List Field
Scenario Because you want to be careful that the small number of choices for a certain data item be entered consistently, you build functionality in a data gathering component that reduces chances for data entry error. In this activity, you will create several list elds and set default values for them. Follow these steps to create and set a default value for a list eld.
Step 1. Action If necessary, open the Employee Information form in your copy of the Practice application in Domino Designer. Result: The form appears in the Work pane. 2. Add the following eld label below the table: Employment Status Result: The text is inserted. 3. Add a eld next to the text. Result: A new eld is inserted. 4. Open the Field Properties box. Add the following characteristics on the Field Info tab.

Name: EmploymentStatus Type: Listbox, Editable

Result: The name and eld types are set. 5. On the Control tab, type the following choices:

Full Time Part Time Contractor

Result: The list choices are set. 6. From the Objects tab in the Programmers pane, select the Default Value object. Result: Just above the Script area, the text EmploymentStatus (Field) : Default Value displays.
Note: Be sure that your use of quotation marks is correct in Step 7.

Copyright IBM Corporation 2007.

105

Topic B: Add Fields to Forms


Lesson 5 Creating Forms Step 7. Action In the Script area, type the default value "Full Time" and click the check mark. Result: The value is entered into the Script area. 8. Add another list eld with the following characteristics:

Name: Department Type: Listbox, Editable

Choices: Administration, R&D, Manufacturing 9. 10. 11. Add an editable date eld named DateCreated and set its default value to Today. Add a number eld and label called Salary to the Employee Information form. Save and test the form.

Name Fields
Lotus Domino differentiates text that represents names by using a special category of elds to store names. Because Lotus Domino uses systemspecic ways to identify users and servers, consider using a Name eld when dealing with names. The following table describes the three types of elds that deal with names.

Field Type Names Readers

Used to... Insert or display the name of a user or server. Restrict read access to the document. A value in a Readers eld will restrict read access to those names specied in that eld or in any other Readers elds in the document. Grant read access to the document and grant edit authority to any name that is also specied as an Author or higher authority in the Access Control List (ACL).

Authors

An Authors eld is a type of eld that works in conjunction with the Author access level in the databases Access Control List (ACL). Authors elds do not override the setting in the ACL. They offer developers more control over which users can edit data in the application. Entries in Authors and Readers elds cannot give a user more access than is specied in the ACL; they can only further restrict access.
Note: You will work more extensively with Readers and Authors elds later in the course.

106

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Numeric Data
Create a Number eld when the data that users will enter is numeric. Lotus Domino can use data in a Number eld to perform mathematical calculations. Number elds recognize the following: Numerals 0 through 9

Plus (+) and minus (-) signs Decimal point (.) Scientic notation (E)

Number elds can be editable, computed, computed for display, or computed when composed.

Procedure Reference: Setting the style of a number eld


Follow these steps to set the style of a Number eld.
1. 2. 3.

Create the eld. In the Basics tab of the Fields Properties box, select Number as its type. Click the Control tab to set the style.

Using a default value for numeric elds


If a Numeric eld is saved with a blank, the value is valid, but an error will occur if you try to compute a value based on it. A blank value is represented by two quotation marks, "", and evaluates to a null text string. To ensure that numeric elds maintain the proper data type, set an appropriate default value in the Programmers pane, or use error-handling techniques.
Note: Error-handling techniques are covered later in the course.

Date/Time Data
When the data users enter or manipulate refers to dates or times, use a Date/Time eld. Date/Time elds represent time using a set of numbers and punctuation. Lotus Domino stores date/time values as the number of seconds after a base date. There are many formatting options available for displaying dates and times. Although the default time format is MM/DD/YY HH:MM:SS, the operating systems regional settings could affect how dates are displayed. Date/Time elds can be editable, computed, computed for display, or computed when composed.

Copyright IBM Corporation 2007.

107

Topic B: Add Fields to Forms


Lesson 5 Creating Forms

Procedure Reference: Creating date/time elds


Follow these steps to set the style of a Date/Time eld.
1. 2. 3.

Create the eld. In the Basics tab of the Field Properties box, select Date/Time as its type. Click the Control tab to format the eld.

Using Calendar/Time Control


Calendar/Time Control is a style selected on the Field Info tab in the Field Properties box. The Calendar/Time Control style has a user-friendly interface for date/time elds available only to the Lotus Notes client. Editable date/time elds display as a graphical date/time control.

108

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Topic C: Hide Form Elements


The Hide/When Options
Hide/When is a property that controls when an element is visible to users or a specic set of users. The Hide/When option hides the entire paragraph where the selected eld, text, or graphic is located. However, if the item is inside a table cell, only the contents of the cell are hidden. Some elements that contain Hide/When functionality are: Text

Fields Graphics

The following table details the options available for hiding elements.

Option Previewed for reading Previewed for editing Opened for reading

Description The hidden information is not visible when users read documents in the document Preview pane. The hidden information is not visible when users work on documents in Edit mode in the document Preview pane. The hidden information is not visible when users open documents in Read mode. A eld that cannot be read cannot be printed or copied to the clipboard. The hidden information is not visible when users work on documents in Edit mode. The hidden information is not visible on printed documents. The hidden information is not visible when information is copied to and pasted from the clipboard. The hidden element is not visible when the document is an embedded document. A formula determines the circumstances in which information is hidden.

Opened for editing Printed

Copied to the clipboard Embedded

Hide paragraph if formula is true

Additional check box options controlling Hide/When include:


Lotus Notes 4.6 Or Later Web Mobile

Copyright IBM Corporation 2007.

109

Topic C: Hide Form Elements


Lesson 5 Creating Forms

Note: It is important to note that the Hide/When option is not a security feature.

Conditions for Using Hide/When


When determining whether or not to hide a eld, ask the following questions: Is it appropriate for all users to see this data?

Do users need to see the data at all times?

For example, Worldwide Corporation has a standard form lled with information about their employees. When a manager opens an employees prole, they do not need to see all the company departments, just the one to which the employee belongs. On the other hand, when new employees are added, or an existing employees information is updated, it would be helpful to see all the departments. The following table outlines conditions to hide information.

If Users Are Reading a document

Then Hide information that is useful only when users create or edit documents. Hide information that is useful when users read documents.

Editing, creating, or printing documents

In the previous example, the Department eld is a list eld. In order to view the list eld while editing and the resulting data when reading, create the following two elds: A list eld containing all the Worldwide Corporation departments.

A computed for display eld to display the resulting value.

110

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Procedure Reference: Displaying the selected value of a list eld in Read mode
Follow these steps to set Hide/When options for a list eld.
1. 2.

Create an editable list eld. Set the properties on the Paragraph Hide/When tab so that the list eld is hidden when the document is: Previewed for reading.

Opened for reading.

3. 4.

Create another eld and set the Field type to Computed for display. Set the properties on the Hide/When tab so that the computed eld is hidden when the document is: Previewed for editing.

Opened for editing.

5. 6. 7. 8.

In the Programmers pane, select the Value object for the computed eld from the Objects tab. In the Script area, enter the name of the list eld. Save the form. Test the form.

Copyright IBM Corporation 2007.

111

Topic C: Hide Form Elements


Lesson 5 Creating Forms

Activity 5-5: Set Hide/When Properties


Scenario In this activity, you will continue working in your copy of the Practice application. You will create a eld named DEmploymentStatus (the D in front of the eld name indicates that the eld is for display only) and set the appropriate Hide/When properties so that the EmploymentStatus list eld displays when the document is new or in Edit mode, and the DEmploymentStatus eld is displayed when the document is in Read mode. Follow these steps to set Hide/When properties.
Step 1. Action In the Employee Information form, add label text and a eld on the line below the EmploymentStatus eld that has the following characteristics:

Label text: Employment Status Field Name: DEmploymentStatus Field Type: Text, Computed for display

Result: The new eld is created. 2. To set the value of DEmploymentStatus, click the eld. In the Script area of the Programmers pane, enter EmploymentStatus Result: The value for the new eld is set to the value of the EmploymentStatus eld. 3. To set Hide/When properties for the new eld, click the eld. In the Field Properties box, click the Paragraph Hide/When tab. Select Previewed for editing and Opened for editing. Result: The eld will only display when the form is in Read mode. It will not display when the user is editing the document. 4. To set the Hide/When properties for the EmploymentStatus eld, click the eld. Open the Field Properties box. Click the Paragraph Hide/When tab. Select Previewed for reading and Opened for reading. Result: The eld will only display when the form is in Edit mode. It will not display when the user is reading the document. 5. Save and test the design changes. Create four or ve documents using this form. Result: The EmploymentStatus eld displays in Edit mode. The DEmploymentStatus eld displays in Read mode.

112

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms

Lesson Summary
In this lesson, you created forms and inserted form elements in them. By learning how to create forms, you can provide application users with the means to enter information into the application.

Copyright IBM Corporation 2007.

113

Topic C: Hide Form Elements


Lesson 5 Creating Forms

Lab 5-1: Create a Form that Contains a Table and Fields


Scenario Worldwide Corporation is in the process of creating organizational policies. You have already created your copy of the Policies and Procedures application and Information page in a previous lab. In this activity, you will create the form that will be used to enter the companys policies and procedures.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Open the Policies and Procedures application that you created earlier in

the course.

2. Create a new form in the Policies and Procedures application. Name the

new form Policy.

3. Title the form Policies and Procedures.

4. Format the title.

5. Use a table to organize the elds and eld labels that will be included on

this form.

6. Add the following eld labels and eld names to collect and/or display

the following information: Policy Number: PolicyNo


Policy Title: PolicyTitle Effective Date of the policy: EffectiveDate Policy Description: PDescription Policy Category: Category (The categories are Office Guidelines, Benets, Holidays, and Grievance Procedures.)

114

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 5 Creating Forms 7. The category should display when the document is in Read mode, while

all the categories should be visible when the document is in Edit mode.

8. Test the form. Create several documents from the new form to see if the

correct information is gathered and displayed. Close the document and reopen it to test the Category eld functionality.

9. Close all open windows.

Note: The application will contain a default view. All of the documents you create will appear in this view. You will create a customized view later in the course.

Copyright IBM Corporation 2007.

115

Creating Views

Topic A: Create Views Topic B: Add View Columns Topic C: Organize Documents Topic D: Format Views

Copyright IBM Corporation 2007.

Lesson 6 Creating Views

Introduction
After completing this lesson, you should be able to: Create views. Add columns to display information about the documents in a view. Describe document categorization. List ways to format views.

118

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Topic A: Create Views


The View Design Element
The purpose of the View design element is to create an organized list of documents so that users can nd the information they need. Views are one of the entry points to the documents stored in an IBM Lotus Domino application. All applications contain at least one view. However, most applications contain more than one view. The following gure represents the View design element.

Figure 6-1: The View design element

Characteristics of a view
The following list describes some of the characteristics of views:

A view is a list of documents in a application. Each row in a view represents a document in the application. Each column displays information from or about the document in that row. A view may include all documents or a subset of documents based on selection criteria. Users read the information in the view to locate specic documents. Excessive numbers of views and poorly designed views can have a serious impact on application performance. Views should be designed early in the application development process.

Copyright IBM Corporation 2007.

119

Topic A: Create Views


Lesson 6 Creating Views

How Lotus Domino stores a view


Lotus Domino uses an internal ling system called the view index to store the list of documents in a view. End users and designers never work directly with the view index. It is built and maintained by the Lotus Domino application. The following table describes how Lotus Domino builds a view.

Stage 1 2

Description The application developer creates the view design. Lotus Domino pulls information from documents according to the design and builds a view index. Lotus Domino displays the information to users.

The following gure shows how Lotus Domino builds a view.

Figure 6-2: How Lotus Domino builds a view

120

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

How Lotus Domino builds a view collection and index


The following gure illustrates how Lotus Domino builds a view collection and index.

Figure 6-3: How Lotus Domino builds the collection and index

The Notes Index Facility


The Notes Index Facility (NIF) resides within a Lotus Domino application. The NIF is responsible for all tasks that keep documents ordered within each application view. Some of the NIF functions include: Open and close collections.

Update the index. Locate notes within an index. Locate index entries. Update collections.

Copyright IBM Corporation 2007.

121

Topic A: Create Views


Lesson 6 Creating Views

Minimizing the number of views


Each view builds its own collection and related index, with all the collations or sorts you have specied. When preparing a view for display to a client, keep in mind that it is much faster for Lotus Domino to reorder a collection that is already open (different sorts in same view) than to open and order a different collection (different views). Use the Click on column header to sort property to minimize the number of views and maximize the sorting within those views.
Note: You can defer the creation of an index until its rst use.

The following gure shows the Click on column header to sort property.

Figure 6-4: The Click on column header to sort property

Views and Database Size


Depending upon the number of views and the number of elds contained with in them, a Lotus Notes database can vary signicantly in size because of the indexes that are created in conjunction with the views.

122

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

View Design
Effective views allow users to nd information quickly and easily. As a developer, you must understand the needs of the users. When designing a view, consider the following: Which documents to include in the view.

What information to display in the columns of the view. How to sort and/or categorize the documents. Whether the view will be for shared or private use. How to format and display the information.

Copyright IBM Corporation 2007.

123

Topic A: Create Views


Lesson 6 Creating Views

Procedure Reference: Designing a view


Follow these steps to design and build a view.
1. 2. 3. 4. 5.

Create the view. Select documents for the view. Add columns to the view. Sort and categorize the documents. Format the view display.
Note: These tasks will be discussed in more detail later in the lesson.

View Creation
When designing a view, start by creating an initial view design. The initial view design includes: Creating the view.

Naming the view. Determining the view type. Controlling how the view will appear in the view list. Setting the view selection conditions.

124

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Procedure Reference: Creating a View


Follow these steps in Lotus Domino Designer to create a new view.
1. 2. 3.

In the Design pane, click Views. In the Work pane, click New View. In the Create View dialog box, set the initial view properties. Click OK. Result: Lotus Domino creates the view and adds it to the list in the Work pane.

Initial View Properties


The following are guidelines for setting the initial view properties.

Property View name

Guidelines Use a short, descriptive name indicating how the view organizes documents.

Type

Select Shared, to create a view many users will access. Select Shared, contains documents not in any folders, if the user typically stores documents in folders and wants to nd all others quickly. Select Shared, contains deleted documents for users to drag out of the trash to a folder, or undelete, if the soft deletions option has been activated. Select Private to create a personal view for a single user. Select Shared, private on rst use views to distribute views that begin as shared, but change to private once a user has accessed and saved the view. Select Shared, desktop private on rst use to distribute views that begin as shared, but that change to private once a user saves a copy to the desktop.

Note: You cannot change the type once you create a view. Location Use up to two levels in a hierarchy. Group views that include the same documents together. Create a cascaded list of views.

Note: Entering a backslash (\) after a views name with a new name accomplishes the same cascaded view menu. Copy style from Use the design of another view in the current application as a template.

Copyright IBM Corporation 2007.

125

Topic A: Create Views


Lesson 6 Creating Views Property Selection conditions

Guidelines Leave the condition blank to include all documents in the application. Click Add Condition and use the Search Builder to specify criteria for including a subset of documents in the view. Change the selection conditions after you create the view.

Note: It is better to have one well-designed view than a dozen poorly-designed views.

View Aliases
Using an alias is a good habit to practice. Design elements such as views can be referred to by an alias when you reference them in a formula or any kind of programming. If a design element has an alias and that alias is used in any coding, the name of the design element can be changed without the need to also change formulas or code.

Procedure Reference: Creating an Alias for a View


Follow these steps to set properties after creating a new view.
1. 2. 3.

Open the view in Lotus Domino Designer. Open the View Properties box. On the Basics tab, enter an Alias and Comment.

Procedure Reference: Adding selection conditions to a view


Add selection conditions to control which documents a view includes. Follow these steps to add selection conditions to a view.
1. 2.

Open the view in Lotus Domino Designer. In the Object list of the Programmers pane, click View Selection.

126

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views 3.

In the Programmers pane, ensure that the default is Simple Search. Result: An Add Condition button is displayed at the bottom of the script area in the Programmers pane.

4.

In the Script area, click Add Condition. Result: The Add Condition dialog box opens.

5. 6.

In the Add Condition dialog box, create a condition. Click Add. Refresh the view index in Lotus Domino Designer. Result: Lotus Domino Designer rebuilds the view index with the new selection condition.

Copyright IBM Corporation 2007.

127

Topic A: Create Views


Lesson 6 Creating Views

Specifying conditions in the Add Condition dialog box


The following table describes the types of conditions you can specify in the Add Condition dialog box.

Use the Condition By Author

To Find Documents Whose author is or is not a specied user or users. Documents must have an Authors eld. That were created or modied: On, after, before, or not on a specied date In the last, in the next, older than, or after the next specied number of days Between or not between a specied range of dates

By Date

By Field

That have a eld that contains or does not contain a specied value. Whose form eld contains the specied form name. Whose form eld contains the specied form name and whose elds have matching conditions. Only ll the elds that are relevant to your search. In the specied folder. That have any, or all, of up to eight terms, words or short phrases. Note: This condition uses signicant system resources and can adversely impact the response time of a large application. Use it sparingly, and only if Fill out example form is not suitable.

By Form Fill out example form

In Folder Multiple Words

Note: Add Condition is a tool used mainly by end users to simplify setting view conditions. It does not replace formulas. Developers should use the SELECT statement as it is more efficient. Formula building will be discussed later in the course.

128

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Activity 6-1: Create a View with an Alias


Scenario Not only do you want your new application to receive data from users, you want them to be able to look at the data as well. In this activity, you will rst create a view that is limited to documents created using the Employee Information form. Follow these steps to create the view and limit the documents in the view.
Step 1. 2. 3. Action If necessary, open your copy of the Practice application in Domino Designer. Click Views in the Work pane. Click New View. Result: The Create View dialog box opens. 4. Set the following characteristics:

View name: Employee Information View type: Shared Location: Views Copy style from view: Blank (default) Selection conditions: Leave blank

Click OK. Result: A new blank view is created and displayed in the listing in the Work pane. 5. Double-click to open the view you just created. Result: A blank view opens in the Work pane; and the View Properties box opens. 6. In the View Properties box, on the View Info tab, type the following:

Alias: ei Comment: This is the first practice view.

7. 8. 9. 10.

Close the View Properties box. On the Objects tab, click View Selection. In the Programmers pane, above the Script area, verify that Simple Search is selected. Beneath the Script area, click the Add Condition button.

Copyright IBM Corporation 2007.

129

Topic A: Create Views


Lesson 6 Creating Views Step 11. Action In the Add Condition dialog box, select the following:

Condition: By form Search for documents which use form: Employee Information

Click Add. Result: The condition appears in the Programmers pane. 12. Preview your changes. Click Yes to save the view. Result: Only documents created using the Employee Information form should appear. 13. Close the view. Result: Your new view, its alias and comment appears in the Views list in the Lotus Domino Designer window.

130

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Topic B: Add View Columns


View Columns
Use columns to display information about the documents in the view. When you create a view using the Blank option, Lotus Domino automatically creates one column in the view. This column displays row numbers corresponding to the documents in the view. You can modify this column, as well as insert and append new columns. When creating a column, do the following: Add a column to the view.

Specify a value for the column to display. Format the view column. Format the view column values.

Procedure Reference: Adding a new column to a view


You can insert a column to the left of the current column, or append a column to the right of the last column in the view. Follow these steps to add a column to a view.
1. 2.

Click an existing column. To add a column to the left of the one selected, choose CreateInsert New Column. To add a column to the right of the right-most column, choose CreateAppend New Column from the menu.

Copyright IBM Corporation 2007.

131

Topic B: Add View Columns


Lesson 6 Creating Views

View Column Values


The following table describes the three types of values that a view column can display.

Type of Value Field

Purpose Displays the value stored in a specied eld for each document in the view. Note: View columns cannot display information from computed for display, rich text, and encrypted elds. Returns information about documents that Lotus Domino stores automatically. For example, simple functions can return: A list of attachments in a document. The size of the attachments. The name of the documents author.

Simple Function

The creation date of the document.

Formula

Displays multiple eld values in a single column or creates new values using the Formula language. Note: Attempting to access data from computed for display, rich text, or encrypted elds in a view formula will result in a null value.

Specifying view column values


After creating a column, specify the information to display in the column. Refresh the view after selecting the value to update the view index and see the change. The following table explains the three methods for displaying data in view columns.

To Display A single eld value stored in the document Field

Select

And Click a eld from the list. Note: Fields that cannot be used in a view do not appear in the list. Click a function from the list.

Information about the document not contained in elds

Simple Function

132

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views To Display Multiple elds in a single column or new values Formula Select And Write a formula.

Displaying multiple elds in a single view column will be discussed later in the course.

View Column Formatting


To format view columns, set properties in the Column Properties box. The Column Properties box has many options available to modify and organize the view columns. You will begin with modifying individual columns. The following table lists some column formatting options.

In This Tab Column Info

Set Properties to Specify general display characteristics, including column title and width. Specify text formatting options for the column title, including font, size, and style. Note: you can change all existing column titles by clicking the Apply to all button. Specify a name for the column to use when accessing the column programmatically. This is similar to giving a form or view an alias name. Indicate if the values in the column should appear as links when the view appears on the Web.

Title

Advanced

Formatting view column values


To specify how a column displays its value, set properties in the Column Properties box according to the following table.

In This Tab Font

Set Properties to Specify the font, size, and style of text for displaying the column value. Specify special options if the column value is a number. Specify special options if the column value is a date-time value. Note: Date/time values always contain both a date and a time, because of how they are stored internally.

Numbers Date and time format

Copyright IBM Corporation 2007.

133

Topic B: Add View Columns


Lesson 6 Creating Views

Activity 6-2: Add and Format View Columns


Scenario After consulting with the people who will use the new data display component you are building for the application you have been working on, you realize that they require several more pieces of information. In this activity, you will modify the Employee Information view to show employees names, departments, and salaries. Follow these steps to add and format view columns.
Step 1. Action If necessary, in your copy of the Practice application, open the Employee Information view in Lotus Domino Designer. Result: The view opens in the Work pane. 2. Select the rst column header; then, in the Programmers pane, from the Display radio button group, select Field. Result: The Programmers pane displays all the elds available in the Practice application. 3. 4. Choose the LastName eld. Double-click the column header to open the Column Properties box, and type the title: Last Name Result: The column title changes to Last Name. 5. Insert a column to the left of the Last Name eld with the following features:

Field: FirstName Column title: First Name

Result: The First Name column appears to the left of the Last Name column. 6. Append a column to the right of the Last Name column with the following features:

Field: Department Column title: Department

Result: The Department column appears to the right of the Last Name column. 7. Append a column to the right of the Department column with the following features:

Field: Salary Column title: Salary

Result: The Salary column appears to the right of the Department column.

134

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views Step 8. Action In the Column Properties box, select the Title tab. Set Center, Bold, and Apply to all. Result: All the view column titles are centered and bold. 9. 10. Close the Column Properties box. Save and preview your changes.

Copyright IBM Corporation 2007.

135

Topic C: Organize Documents


Lesson 6 Creating Views

Topic C: Organize Documents


Document Organization
Once you have added columns to display relevant information for the users, organize the list of documents so users can locate a specic document quickly. The Sorting tab in the Column Properties box provides several different ways to organize documents in a view. There are two types of sort options you can choose: Standard: Sorts documents by the column value in ascending or descending order.

Categorize: Groups together documents with the same column values.

When you sort or categorize a column, you are changing the order in which the view displays the documents to users.

Sorted Columns
A sorted column displays documents in a specic order. The following table describes how a view sorts different types of values.

Columns That Display Text values Number values Date/time values

Sort Documents Alphabetically Numerically Chronologically

If the column being sorted contains text, there are two other options that could be useful: Case-sensitive sorting: Sorts lowercase letters before uppercase letters. For example, ab sorts before Aa.

Accent-sensitive sorting: Sorts accented characters after nonaccented characters. For example, ab sorts before a.

136

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Procedure Reference: Sorting documents by column value


Follow these steps to sort documents based on the contents of a column.
1. 2. 3. 4. 5.

Select the column you want to sort. Open the Column Properties box. Click the Sorting tab. Select None, Ascending, or Descending. Set optional properties to rene the sort:

Case-sensitive sorting Accent-sensitive sorting Click column header to sort

User-sorted columns
The sort column feature allows end users to click on the column header to change the columns sort order. This option is available in the Sorting tab of the Column Properties box. The following table describes the different end user sort control options.

Option Ascending

Function An upward-pointing triangle appears in the column header. Users click the header to sort in ascending order or revert to the original order. A downward-pointing triangle appears in the column header. Users click the header to sort in descending order or revert to the original order. A two-headed triangle appears in the column header. Users click the header to cycle between ascending, descending, and the original sort order. Designate a second column to sort the view further. For example, if the primary sort column is last name, the secondary could be the rst name. Note: This column can be sorted in either ascending or descending order only. Using a column as an entry point to another view, which gives users an easy way to see additional, related information that doesnt t in the initial view. Users click such a column to open another view.

Descending

Both

Secondary Sort Column

Change To View (using a column to switch to another view)

Copyright IBM Corporation 2007.

137

Topic C: Organize Documents


Lesson 6 Creating Views

Improving Performance: Preventing Simple Searches


The Dont Allow Simple Search database properties option allows you to block users from running a full text index search of a database. This means that when a database does not contain a full text index, you can set the properties of that database to not allow simple searches by users. So, when a user tries to run a search on a database, an error is generated informing the user that the database does not contain a full text index, and that the action cannot be performed. Incorporating this property will help with server side performance issues. The following is the Database properties dialog box with the added option to prevent simple searches.

Figure 6-5: The Database properties dialog box

Improving Performance: Deferred Sort Index Creation


The deferred sort index creation feature has been added to improve the server-side performance of your applications. This column option reduces the impact on the server for user sorted columns. When a user re-sorts a column, the sort index will not compute as part of the whole view index. As a result, the view index will be smaller, and can index documents faster, until a user requests that the column be sorted in that way. If a request is not made, eventually that sort index collation will expire.

138

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

The following is the available property in the Column properties dialog box.

Figure 6-6: The Column properties dialog box

Copyright IBM Corporation 2007.

139

Topic C: Organize Documents


Lesson 6 Creating Views

Activity 6-3: Set Sort Columns


Scenario Your applications data display component works ne, but your end-users report back that its inefficient because the data displayed isnt in any particular order. In this activity, you will modify the Employee Information view so that users can sort the view by last name, then rst, if necessary. Follow these steps to create user-sorted columns.
Step 1. Action If necessary, in your copy of the Practice application, open the Employee Information view in Lotus Domino Designer. Result: The view opens in the Work pane. 2. Double-click the Last Name column to open the Column Properties box. Result: The Column Properties box opens. 3. Click the Sorting tab and make the following selections: Sort: Ascending Select Click on column header to sort and choose Both Select Secondary sort column and choose both First Name and Ascending Result: The Last Name column has a two-headed arrow in the column title header. 4. 5. Place a similar ascending sort on the First Name column and use the Last Name eld as a secondary sort column. Preview your changes.

140

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Categorizing
A categorized column groups related documents together in a view based on the column value. The following gure shows a categorized view.

Figure 6-7: A categorized view

Procedure Reference: Categorizing documents by column value


Always categorize the left-most columns of the view. Typically, you will insert a new column to group related documents together in the view. Follow these steps to categorize a view.
1. 2. 3.

Select the column whose value will categorize the documents. Open the Column Properties box. On the Sort tab, select Categorized.

Guidelines for formatting categorized columns


A view displays the column value of a categorized column in its own row. The following table lists some best practice guidelines to follow, and their explanations.

Guideline Do not use a title for the column.

Why The column values appear in the view and should be self-explanatory. A column title would be redundant. However, there are instances where a column title is needed, such as when you need to display more than one date. This helps save room in the view to see more data. This simplies expanding and collapsing different categories for end users.

Set the width of the column to 1.

Show twisties when the row is expandable.

Copyright IBM Corporation 2007.

141

Topic C: Organize Documents


Lesson 6 Creating Views Guideline Use bold and color to make the categorized column value stand out from other information in the view. Why This helps the user differentiate between the category headers and the documents.

142

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Topic D: Format Views


View Properties
Use the View Properties box to format the view. The following table describes some of the properties in the View Properties box.

Tab Options

Set Properties to Open the view by default when the database opens. Specify this view as the default for all new views. Specify how the view displays the documents when it opens.

Style

Apply color to the views background.

Apply an image to the views background. Display alternate rows in different colors. Display totals in the column. Set row spacing.

Advanced

Determine when Lotus Domino refreshes the view index. Set colors for links in a Web browser.

Security

List users who will use the view in the database.

Note: This option does not prevent users from seeing data in the documents displayed in the view. Users could select to display the same documents in another view or folder that they create.

Copyright IBM Corporation 2007.

143

Topic D: Format Views


Lesson 6 Creating Views

Lesson Summary
In this lesson, you created formatted views. By learning how to create and format views, you can provide application users with the means to obtain information in a meaningful way from data stored in an application.

144

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 6 Creating Views

Lab 6-1: Create a Categorized View


Scenario Worldwide Corporation wants to provide a new way of organizing its policies and procedures in the Policies and Procedures application. The view should do the following: List documents created with the Policy form.

Display the title of the policy and its effective date (in that order). Organize the documents by the type of policy (Guidelines, Holidays, and so on).

Perform the following tasks to complete this lab.


Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

1. Build a view according to the requirements stated above.

2. Name the view Policies

3. Test the view in Lotus Notes.

4. Close all open windows.

Copyright IBM Corporation 2007.

145

Introducing Formulas

Topic A: Identify Programming Languages Supported by IBM Lotus Domino Topic B: Identify Formula Components Topic C: Identify Event Triggers Topic D: Compute and Compare Values Topic E: Work with @Functions Topic F: Explore Formatting and Comments

Copyright IBM Corporation 2007.

Lesson 7 Introducing Formulas

Introduction
After completing this lesson, you should be able to: Identify programming languages supported by Lotus Domino. List syntax rules for formulas. Describe the order of eld evaluation on a form. Describe how to compare values by using comparison operators. Describe conditional statements. Identify ways to make formulas more readable.

148

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Topic A: Identify Programming Languages Supported by IBM Lotus Domino


Lotus Domino Programming
You can write programs in an IBM Lotus Domino application using the IBM Lotus Domino Designer client. Many design elements can execute programs automatically through the properties and events of the element. You can also write programs outside the Lotus Domino application using other development tools. These programs can be imported or run in the operating system to access the Lotus Domino application.

Lotus Domino is a exible development environment


The Lotus Domino development environment supports all leading technologies with tools that cater to varying developer skill levels and degrees of programming experience. Given so many choices, the question that confronts developers at the outset of any application development initiative is which tool to use. The answer is simple: understand the functions that can be performed programmatically in Lotus Domino, then pick the one that meets the demands of the task at hand and is most comfortable for you. Some factors that affect the decision include: Does the code run on a server?

Does the code run on a client? If so, which client? Where does the data reside? What are the programming skills of the developer? What functionality is required?

Just as important as where the code is written is where it is executed. The location of execution, namely, server versus client, can affect how the data is accessed, as well as the security provisions that are taken to protect the data.

Copyright IBM Corporation 2007.

149

Topic A: Identify Programming Languages Supported by IBM Lotus Domino


Lesson 7 Introducing Formulas

Where to program in Lotus Domino


The following gure shows where code can be written for the Lotus Domino environment.

Figure 7-1: Where code can be written for Lotus Domino

Internal programming languages


Lotus Domino Designer provides an Integrated Development Environment (IDE) for writing code in a Lotus Domino application. It supports the following four programming languages: @Formula and @Commands

IBM LotusScript Java JavaScript

Lotus Domino also supports HTML and XML.

External programming languages


Lotus Domino supports the following external programming languages:

Java C and C++ Microsoft Visual Basic

150

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Connecting to Lotus Domino from external applications


One feature of Lotus Domino 8 is the ability to store, access, view, and manage application data in a robust, enterprise class DB2 relational data store. When working with the data, the interaction is entirely with the Lotus Domino server within the IBM Lotus Notes client. The Lotus Notes user is unaware that the storage is in DB2 and not in an NSF le. There is no need for users to have DB2 connectivity as that is handled by the Lotus Domino server. Users can query and report on Lotus Domino data using traditional Structured Query Language (SQL) based tools and combine Lotus Domino data with DB2 data. Customers can continue to choose between native Domino NSF or DB2 stores or a combination of the two, depending on the requirements of each application. When working with the data, there is no visible difference between the data stored in a Lotus Notes database and the data stored in a DB2 database. You can also use one of the drivers the following table describes to query Lotus Domino databases via SQL.

This Driver NotesSQL

Is An ODBC driver that makes Lotus Domino databases accessible to an SQL tool or application interface.

Use It When You Require Read/write access to Lotus Domino data using any application that supports ODBC. For example, an application that produces reports in Lotus Notes using Business Objects Crystal Reports or Microsoft Access. Access to Lotus Domino data using any JDBC-enabled application. For example, when your application is a servlet on an HTTP server.

Lotus Domino Driver for JDBC

A Type II JDBC driver that makes Lotus Domino databases look like another relational back-end source to an SQL tool or application interface.

The Formula Language


The Formula language is the core language built into Lotus Notes and Lotus Domino from their earliest releases.

Copyright IBM Corporation 2007.

151

Topic A: Identify Programming Languages Supported by IBM Lotus Domino


Lesson 7 Introducing Formulas

Where to use the Formula language


The Formula language provides a straightforward and simple programming interface within Lotus Domino applications. Like other programming languages, the Formula language has rules and syntax. Formula language code is generally best used for working with the element that the user is currently processing. Use the Formula language to customize the forms, elds, and views of a Lotus Domino application. The following table lists common events and properties that execute formulas.

Element Form

Property/Event Window Title WebQuerySave PostOpen (can also execute LotusScript) Value or Default Value Input Validation Input Translation Hide/when View Selection Form Formula Column Formula

Field

View

LotusScript
IBM LotusScript is an embedded basic scripting language that offers access to Lotus Domino data and services beyond the capabilities of the Formula language. It is much more efficient than Formula language for accessing multiple documents and performing operations on those documents.

Where to use LotusScript


Use LotusScript to program agents and actions or to execute code in a design element event. The following table lists common events that execute LotusScript.

Element Form

Property/Event PostOpen (can also execute formulas) Queryclose PostRecalc

152

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas Element Field Initialize Terminate Initialize Terminate Property/Event

Agent

Criteria for selecting LotusScript


The following table summarizes the advantages and limitations of using LotusScript.

Advantages

Limitations

Embedded basic language

Requires programming skills

Object-based Sophisticated access to Lotus Domino data Integrated debugger

More verbose than Formula language Not executable in Web browsers

Java
Internally, Lotus Domino only supports the use of Java in agents. However, external Java programs can access Lotus Domino applications. The Lotus Domino Designer IDE provides a basic Java editor in the Agent Builder, which includes color formatting and reference Help for the standard Java language and the Lotus Domino classes.

Where to use Java


Use the Lotus Domino Designer Agent Builder to program Java agents. Java can access the same application data and services as LotusScript. Use third-party development tools to build applets and standalone applications that access Lotus Domino applications.

Criteria for selecting Java


The following table summarizes the advantages and limitations of using Java.

Copyright IBM Corporation 2007.

153

Topic A: Identify Programming Languages Supported by IBM Lotus Domino


Lesson 7 Introducing Formulas

Advantages Powerful object-oriented language. Remote access and networking support. Extensive class library (beyond Lotus Domino). Multi-threaded.

Limitations Internally, Lotus Domino only supports its use in agents. Complex program development requires third-party development tool with debugger.

JavaScript
JavaScript is integrated in Lotus Domino Designer to allow Lotus Domino applications to support users with Web browsers. The Lotus Notes client interprets JavaScript and, therefore, benets from its unique characteristics. This functionality is critical in building applications for mixed clients.

Where to use JavaScript


Use the Programmers pane to write JavaScript directly into properties and events of forms, pages, and their design elements. The following table lists common properties and events that execute JavaScript.

Element Form or page


Example Properties/Events JSHeader onLoad onUnload

And others

Field or button

onFocus onBlur onChange onMouseOver And others

Criteria for selecting JavaScript


The following table summarizes the advantages and limitations of using JavaScript.

154

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Advantages Object-based language Web standard Cross-platform compatibility Runs in Lotus Notes clients and Web browsers

Limitations Built-in editor, but no debugger Requires programming skills

Language Selection Criteria


Choosing the best language to use for a given situation can be complex. Many times, the requirements of the situation will narrow the number of choices available.

Criteria for choosing a language


The following table outlines some of the guidelines you can use to make a programming language choice.

If the Application Requires Complex control User interaction

Consider Choosing LotusScript, Java, or JavaScript Formula language, LotusScript, or JavaScript LotusScript, Java, or Formula language Formula language LotusScript or JavaScript LotusScript, Java, or Formula language

Access to Lotus Domino data Calculations with simple results A series of scripted activities Data access efficiency

Copyright IBM Corporation 2007.

155

Topic A: Identify Programming Languages Supported by IBM Lotus Domino


Lesson 7 Introducing Formulas

Practice Activity 7-1: Identifying Programming Languages Supported by Lotus Domino


Scenario You have been working with some co-worker friends on the design team to sharpen your skills in knowing which programming language resources will offer the best solutions to given problems. This activity describes several application development scenarios. Select the most appropriate language or languages for each task.

1.

You are designing a form with a number of elds. Some elds on the form require an initial value that is changeable by the user. Other elds require a computed value. Some actions may need to be hidden from certain users. a) LotusScript b) JavaScript c) Formula language d) Java

2.

The application that you are designing requires that you get some of the input from dialog boxes. a) Formula language b) JavaScript c) LotusScript d) Java

3.

The application you are creating requires access to documents in applications other than the one in which it is saved. a) Formula language b) LotusScript c) JavaScript d) Java

156

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas 4. You are creating an application that requires some fairly complex interaction with the user. In the past, you have had moderate success at automating a series of tasks, but you do not have extensive experience in programming. a) Formula language b) LotusScript c) JavaScript d) Java

5.

The application that you are developing involves an extensive amount of interaction with the user. You will need to validate eld contents, position the cursor, and perform other actions in the user interface. a) Formula language b) LotusScript c) JavaScript d) Java

6.

You are working on a process that involves complex ow control, including loops and multiple conditional branches. You have no idea, as you are writing this process, how many times it will need to be executed. a) Formula language b) LotusScript c) JavaScript d) Java

7.

An application is not performing as well as users would like. In analyzing the application, you nd that while it is very user friendly, some of the formulas are performing very poorly. Which languages would you use to replace the formulas to improve the performance of the user interface? a) Formula language b) LotusScript c) JavaScript d) Java

Copyright IBM Corporation 2007.

157

Topic B: Identify Formula Components


Lesson 7 Introducing Formulas

Topic B: Identify Formula Components


The Formula Language
The Formula language can be used to perform many types of operations. Some of the more common examples are: Computing values

Comparing values Automating tasks

Where to use formulas


Formulas can be used in many design elements such as forms, views, pages, elds, buttons, actions, and so on. Code is entered in an event of an object in the Programmers pane.

Statements
Formulas consist of one or more statements, which are made up of a combination of the components described in the following table.

Element Variables Constants

Description Can be elds or temporary variables. Something whose value does not change. Constants can be text, numeric, or time-date. Assign values, modify values, and combine values into new values. Built-in formulas that perform a particular calculation and return a value. Reserved words within the Formula language that perform special functions.

Operators

@Functions

Keywords

158

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Syntax Rules
All programming languages have rules. The Formula language is no exception. A formula must conform to the general rules described in the following table.

Rule Title Statement separators Spaces

Rule Description Separate multiple statements using a semicolon; for example: @If(@IsNewDoc; True Statement, False Statement) Any number of spaces, including none, can be used between operators, punctuation, and values. Keywords and functions, however, must be separated by at least one space. Case is not signicant except within text constants. By convention, keywords are usually upper case, and @function and @commands are usually written in mixed upper and lower case. Two values must be separated by at least one operator.

Case

Operators and values

Copyright IBM Corporation 2007.

159

Topic C: Identify Event Triggers


Lesson 7 Introducing Formulas

Topic C: Identify Event Triggers


Objects
Code is placed in an event of an object in the Programmers pane. The term object refers to the element, such as the form, eld, and so on. For instance, you might create a formula to compute the default value of a eld. The list of Lotus Domino objects includes, but is not limited to: Databases

Agents Actions Views Forms Fields Buttons

Events
Code executes in response to an event in a Lotus Domino object. Events include opening a database, opening a view, opening a document, moving the cursor into or out of a eld, and so on. The following table describes several common objects, some of their related events, and what triggers their execution.

Object Database

Event and Timing Postopen is triggered after a database, view, or document is opened. Queryclose is triggered when a view, document, or database is being closed. onHelp is triggered when Help is selected (when F1 is pressed). onLoad is triggered when the form or page is loaded. Postrecalc is triggered after the object is refreshed (and values are recalculated). Default Value is triggered when a document is created. Input Translation is triggered when a document is saved, recalculated, or refreshed. onBlur is triggered when a eld loses focus. onFocus is triggered when a eld gets focus. Click is triggered when the button is clicked.

Page or form

Field

Button

160

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Field Evaluation Order


Fields on a form are evaluated from left to right, and from top to bottom. It is important to keep the order of evaluation in mind when designing the forms in your application. For instance, if a eld is computed based on the values in one or more other elds on the form, the computed eld must be placed after the eld(s) used in the computation.

Copyright IBM Corporation 2007.

161

Topic D: Compute and Compare Values


Lesson 7 Introducing Formulas

Topic D: Compute and Compare Values


Constants
This section describes how to write formulas to compute and compare values.

Using constants in formulas


Constants represent static information in a formula. The following table shows examples of the three types of constants available in the Formula language.

Constant Text

Rules to Apply Enclose characters in quotation marks. Enclose characters in braces.


Examples Hello world. {Hello world.}

Numeric

Specify the sign of the number using a plus or minus sign as the rst character, if necessary. Use E for scientic notation.

10 -6.37 37E6

Date-Time

Enclose a date or time in square brackets. Use AM and PM to represent time in a 12-hour format.

[5:30 PM] [13:50] [7/11]


[10/18/71 6:30 AM]

Variables
This section will familiarize you with both eld values and temporary variables.

Using eld values in formulas


A formula has access to the eld values in the document being processed. If a formula refers to a eld by name, it will use the value of the eld from the current document.

162

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

You can use the name of the eld as a variable in the formula.

Using temporary variables


Temporary variables exist only within a formula. Use them to make your formulas more modular and readable. You do not need to declare temporary variables before you use them. Assign a value to a temporary variable using the assignment operator (:=). For example:
x := @Power(a; 2) + @Power(b; 2);

Then, use that variable in other statements of the same formula. For example:
@Sqrt(x);

You can also reuse a temporary variable within a formula by assigning a different value to it.

Operators
Operators enable you to manipulate values. Combining and comparing values are common examples of using operators in formulas.

Computed Values
You can only combine values of the same type. For example, you cannot add together text and number values. The following table describes how to use operators to combine values.

To Combine Number values

Use the Operators + / *

Example 10 + 2.37 + 15 6.05 - 2.35 TotalScore / Quantity TotalPrice * DiscountRate Welcome, + FirstName

Text values

+ or &

Copyright IBM Corporation 2007.

163

Topic D: Compute and Compare Values


Lesson 7 Introducing Formulas

Order of Evaluation
When creating formulas that compute values, keep the following information in mind.

Order Parentheses

Description Using parentheses, you can explicitly force the order of evaluation. Operations within parentheses occur rst. Example: (5-3) * (6-4) = 4 Operations not in parentheses occur in order of precedence. Example: 5 - 3 * 6 - 4 = -17 Operation of equal precedence occur from left to right. Example: 8/4*2=4

Precedence

Left to right

Comparison Operators
This section describes how to compare values in formulas.

Comparing values using operators


Compare values of the same type using the operators. The following table illustrates how comparison operators work.

This Expression A=B

Evaluates to True If The values of A and B are equal. The value of A is less than the value of B.

Evaluates to False If The values of A and B are not equal. The value of A is greater than or equal to the value of B. The value of A is greater than the value of B.

A<B

A <= B

The value of A is less than or equal to the value of B. The value of A is greater than the value of B. The value of A is greater than or equal to the value of B.

A>B

The value of A is less than or equal to the value of B. The value of A is less than the value of B.

A >= B

164

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas This Expression A <> B A >< B A != B (A < B) & (B < C) (A < B) | (A < C) !(A < B) Evaluates to True If The values of A and B are not equal. Evaluates to False If The values of A and B are equal.

A is less than B and B is less than C. A is less than B or A is less than C. A is not less than B.

B is less than or equal to A or C is less than or equal to B. B and C are both less than or equal to A. B is less than or equal to A.

Note: A and B represent values and can be constants, variables, or combinations of constants, variables, and operators.

Copyright IBM Corporation 2007.

165

Topic E: Work with @Functions


Lesson 7 Introducing Formulas

Topic E: Work with @Functions


@Functions
@Functions are built-in formulas that perform calculations and either return a value or perform an action. @Functions are used in Lotus Domino design elements to perform tasks such as: Accessing information about the application, its data, and the user.

Modifying values. Acting on a condition. Formatting text strings. Calculating numeric values or values in a list.

Syntax
@Functions contain the name of the function, followed by any arguments. The general format of an @function is:
@FunctionName(argument1; argument2; argument3);

Common @Functions
The following table describes some of the @functions that return data about the application.

For Information About the Current document

Use the Function @Created

Which Returns The date-time value for when the document was created. True (1) if the document is new, or False (0) if the document is not new. The title of the current view. The server and le name of the current database. The current users name.

State of the current document

@IsNewDoc

View

@ViewTitle

Database

@DbName

User

@UserName

166

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas For Information About the User environment Use the Function @ClientType Which Returns Notes if the client is Lotus Notes or Web if the client is a Web browser. Determines the capabilities of a Web client.

Web client

@BrowserInfo

Examples of @functions
The following table contains common examples of formulas.

This Formula @Adjust ([10/11/05]; 0; 1; -4; 0; 0; 0) @Text (10) @ProperCase ("hello world.") @Trim (" ") hello world.

Returns The date-time value, 11/07/05

The text value, 10 The text value, Hello World The text value, hello world

Conditional Statements
The @If function executes one statement or another depending on whether a logical value is true or false. The @If statement has an odd number of parameters, with a minimum of three. The parameters are: Condition, which is the rst parameter that is checked.

True statement, or the action to perform if the condition is true. False statement, or the action to perform if the condition is false.

@If statements are evaluated from left to right. The rst true condition evaluated causes its corresponding True statement to be processed. Subsequent conditions in that @If statement are not processed. If an @If statement contains two conditions, the syntax is:
@If(condition1; TrueStatement1; condition2; TrueStatement2; FalseStatement)

The following table shows examples of conditional statements.

Copyright IBM Corporation 2007.

167

Topic E: Work with @Functions


Lesson 7 Introducing Formulas

This Conditional Statement @If (3<10; "True"; "False") @If (Author = @UserName; "My document"; "Not mine") True

Returns

My document if the Author eld contains the name of the current user.

168

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Topic F: Explore Formatting and Comments


Formatting
In order to make your code easier to read and debug, it is good practice to include comments and formatting. This helps not only the person who developed the code, but also any developer who may have to modify the code at a later date.

Formatting Formula language


Formulas can get quite lengthy, particularly when using nested @If statements. To make complicated formulas easier to read, use line breaks and indenting. For example, even an experienced Lotus Domino developer would have to study the following formula to interpret what it does:
@If(Invoiceamount>POamount;@If (Invoiceamount-POamount>1000.00; @Mailsend(Vendor:Approver;"";"";"Rejection";"Invoice"+ invoiceno+ " has been rejected");@Mailsend(Approver;"";"";"Invoice overage";"Invoice"+ invoiceno+"has been submitted"));@Mailsend(Vendor:Approver;"";"";"Processed";"Invoi ce"+ invoiceno+" for purchases made under PO#"+Pono+"))

Now look at the same formula written following simple formatting rules:
@If(Invoiceamount>POamount; @If (Invoiceamount-POamount>1000.00; @Mailsend(Vendor:Approver;"";"";"Rejection";"Invoice"+ invoiceno+ " has been rejected"); @Mailsend(Approver;"";"";"Invoice overage";"Invoice"+ invoiceno+"has been submitted")); @Mailsend(Vendor:Approver;"";"";"Processed";"Invoice"+ invoiceno+" for purchases made under PO#"+Pono+"))

The formula has been formatted so that the conditions and the True and False statements start on separate lines. The statements related to a condition are indented under that condition.

Copyright IBM Corporation 2007.

169

Topic F: Explore Formatting and Comments


Lesson 7 Introducing Formulas

Comments
The formula gets even easier to understand when you add comments.

Commenting Formula language


By adding explanatory text to any code that you write, your applications become much easier to maintain. Documenting code is best done while you are writing it. Use the REM keyword to include comments in Formula language code. The syntax is:
REM { comments };

Include a REM statement at the beginning of each line of explanatory text in a formula. The following example contains several lines of explanatory text before the formula starts. It also contains REM statements inside the formula to further document what the code is doing.
REM {An invoice amount is checked against}; REM {its corresponding Purchase Order to see if the invoice }; REM {exceeds the amount of the PO. If it does exceed the PO }; REM {amount by more than $1,000, an e-mail is sent that }; REM {indicates the invoice has been rejected. If the invoice }; REM {amount is over the PO amount but under $1,000, an e-mail }; REM {is sent indicating that an invoice over the PO amount }; REM {has been submitted. Finally, if the invoice is less }; REM {than the PO amount, an e-mail is sent indicating the }; REM {invoice has been processed.}; REM ; REM {This statement checks to see if the invoice is less than }; REM {the PO amount.}; @If(Invoiceamount>POamount; REM {Is the difference greater than $1,000? }; @If (Invoiceamount-POamount>1000.00; REM {Reject the invoice}; @Mailsend(Vendor:Approver;"";"";"Rejection";"Invoice"+ invoiceno+ " has been rejected"); REM {Notify approver that invoice has been submitted}; @Mailsend(Approver;"";"";"Invoice overage";"Invoice "+ invoiceno+"has been submitted")); REM {Process the invoice.}; @Mailsend(Vendor:Approver;"";"";"Processed";"Invoice"+ invoiceno+" for purchases made under PO#"+Pono"))

170

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Practice Activity 7-2: Interpreting Formulas


Scenario You have been working on a problem you encountered with some code and are trying to determine the outcomes associated with some code statements. A document contains the following elds and values:
FirstName: Susan LastName: Sunshine Created on 12/9/2005 at 11:59:37 PM

Based on the information in the scenario, determine the result for each of the following formulas.

1.

FirstName:

2.

LastName:

3.

FirstName + LastName:

4.

LastName + , + FirstName:

5.

FirstName = Susan:

6.

(FirstName != Larry) & (LastName = Sunshine):

7.

@Adjust (@Created; 0; 6; 0; -2; 0; 0):

8.

@If (@Created < @Today; Old; New):

9.

@Text (10.22):

Copyright IBM Corporation 2007.

171

Topic F: Explore Formatting and Comments


Lesson 7 Introducing Formulas 10. fullName := FirstName + + LastName; Welcome back, + fullName:

172

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 7 Introducing Formulas

Lesson Summary
In this lesson, you created formulas and learned about programming languages that can be used in conjunction with Domino. By learning how to build and borrow scripting and programming for use in an application, you can deploy functionality that can leverage data that could not otherwise be processed into a form that meets users needs.

Copyright IBM Corporation 2007.

173

Using Formulas in Forms


Topic A: Create Window Titles Topic B: Work with Computed Values Topic C: Work with Field Values Topic D: Work with Lists Topic E: Prompt Users Topic F: Create Reusable Code Topic G: Implement Error Checking

Copyright IBM Corporation 2007.

Lesson 8 Using Formulas in Forms

Introduction
After completing this lesson, you should be able to: Identify the characteristics of and uses for the @IsNewDoc function. List the elds that can be used to store values in a document. List the steps to write a eld input validation formula. Identify the characteristics of and uses for the @DbColumn function. Identify characteristics of and uses for the @Prompt function. List @functions that can be used to create reusable code. List @functions that can be used to handle run-time errors.

176

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Topic A: Create Window Titles


Common Uses for Formulas
Use formulas in forms to add, calculate, and format data automatically. With formulas, you can: Display one title when the document is new, and another title when the document is being edited.

Calculate ending dates based on start dates and lengths. Enter the document creation date. Populate a list of options. Ensure that users do not save the document with specied elds left empty. Format user entries to be consistent in all documents.

Form Programming
Each element of the form, including the form itself, is an object. The Programmers pane provides access to the programmable properties and events of objects on the form.

Copyright IBM Corporation 2007.

177

Topic A: Create Window Titles


Lesson 8 Using Formulas in Forms

Procedure Reference: Adding a formula in the Programmers pane


Follow these steps to add a formula to an object in the application.
1.

Select the object, either:


On the form in the Work pane. Or, from the Objects tab in the Programmers pane.

Result: IBM Lotus Domino Designer highlights the object on the Objects tab and displays the programmable properties and events of the object.
2.

Select the property or event to which you want to add a formula. Result: Lotus Domino Designer highlights the property or event.

3.

At the top of the Script area, select Client and Formula. Result: The Reference tab lists the application elds and @functions that can be used in the formula.

4.

Enter the formula. Result: Lotus Domino Designer highlights different elements of the formula with colors.

5.

Save the formula. Result: Lotus Domino Designer checks the syntax of the formula.

Form Events
Form events are triggered when a document is opened, saved, refreshed, closed, or switched between read and edit mode. You can use formulas in form events to set elds, prompt users, or perform background processing. The following table lists most of the form events and when they evaluate.

Form Event QueryOpen PostOpen QueryModeChange

When the Event Is Triggered Before a document opens. After a document opens and is drawn onto the screen. Before the document is changed into either edit or read mode. After the document is changed into either read or edit mode.

PostModeChange

178

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms Form Event PostRecalc When the Event Is Triggered After the document has recalculated, usually after F9 is pressed. Before the document is saved. After the document is saved. Before the form is closed.

QuerySave PostSave QueryClose

Window Titles
Both forms and pages contain a property called the window title. You can write a formula to compute a text string to display in the upper-left corner of the client when users open the element. It is good practice to always set the window title when designing forms and pages. If the form or page opens in a Web browser, the window title will not display.

Procedure Reference: Setting the window title


Follow these steps to set the window title of a form or page.
1. 2. 3. 4.

In the Object tab of the form or page, select the window title. Enter a formula that results in a text value. Save the formula. Preview the page or form.

Copyright IBM Corporation 2007.

179

Topic A: Create Window Titles


Lesson 8 Using Formulas in Forms

The @IsNewDoc Function


The @IsNewDoc function is particularly useful when creating a form window title. Window titles that incorporate a eld from the document will not display the window title correctly when the document is new and there is no data yet. By combining @IsNewDoc and @If, you can create a formula that displays one text phrase if the document is new, and another if the document has been saved. The syntax for @IsNewDoc is simply:
@IsNewDoc

The function returns a value of 1 for True if the document has not yet been saved. It returns a value of 0 for False if the document has been saved.

Example of writing a formula using @If and @IsNewDoc


The following example illustrates how to combine @If and @IsNewDoc to create a meaningful window title:
@If(@IsNewDoc;"New Document";Subject)

In this case, the phrase New Document displays if the document is new. If the document has been saved, the window title changes to the value in the Subject eld of the document.

180

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Topic B: Work with Computed Values


Computed for Display Fields
One way to compute values that display on a form is to use Computed for display elds. Computed for display elds are recalculated every time a user opens or saves a document, or when the document is refreshed. The contents of a Computed for display eld are not stored in the document. The following table describes examples of using Computed for display elds.

Use a Computed for Display Field to Display The current time The users name The creation date of a document The value of a list eld when the document is open @Now @UserName @Created WorkType

Example

Computed for display elds require a formula. The formula must evaluate to a value suitable for storage in the eld. For example, if the type of eld is date-time, the formula must result in a date-time value.

Computed Text
Computed text is another element you can add to a form or page to display computed values. It is similar to a Computed for display eld, except that the result of the formula must be a text value and, unlike elds, you may use it on a page. You can format computed text like other text elements using the Computed Text Properties box. The following table describes examples of using computed text.

Use Computed Text to Display Different text based on a condition

Example @If ((DueDate < @Today) & (Status != "Complete"); "This is late!"; "") "Welcome, " + @Name([CN]; @UserName)

Dynamic messages

Copyright IBM Corporation 2007.

181

Topic B: Work with Computed Values


Lesson 8 Using Formulas in Forms

Procedure Reference: Adding computed text


Follow these steps to add computed text to a form.
1.

Open the form or page in Lotus Domino Designer. Result: The form appears in the Work pane and the Programmers pane opens.

2. 3.

Place the cursor where you want the result of the computed text to appear. Choose CreateComputed Text. Result: The Computed Text Properties box opens. The value property of the new computed text object is highlighted in the Object list.

4.

Enter a formula that evaluates to a text value in the Script area of the Programmers pane. Result: Lotus Domino Designer checks for formula syntax errors.

5.

Set properties to format the text. Result: The result of the formula in Step 4 will display according to the properties you set.

6.

Preview the page or form. Result: The result of the formula displays in the form or view.

Computed Fields that Store Values


To store values in a document, you must use one of the following types of elds: Computed

Computed when composed Editable

This section describes how to use these eld types and set their values. The following table describes Computed and Computed when composed elds.

Field Computed

Calculates a Value... Each time users create, refresh, or save the document.

Example The result of a calculation involving other elds, such as calculating a total.

182

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms Field Computed when composed Calculates a Value... When the users originally create the document, or the rst time that particular eld appears on a form with which that document is opened.

Example The original author A value that never changes The date the document was created

Procedure Reference: Setting the value of a Computed eld


Follow these steps to add a formula to calculate the value of a Computed eld.
1. 2. 3. 4. 5.

Open the form in Lotus Domino Designer. Select the eld. Under the eld in the Objects tab, select Value. Enter the formula to compute a value suitable for storage in the eld. Test the formula by previewing the form.

Using formulas in editable elds


Gather information from users through editable elds. To improve the usability of editable elds, you can use formulas to: Compute a default value when users create documents.

Translate or reformat the value when users save documents. Validate or verify the value when users save documents.

Specifying a default value


Specify an initial value for an editable eld in the Programmers pane. Add the formula to the elds Default value property. The formula executes only when users create documents.

Copyright IBM Corporation 2007.

183

Topic C: Work with Field Values


Lesson 8 Using Formulas in Forms

Topic C: Work with Field Values


Input Translation Formulas
You can automatically format data by specifying an input translation formula for editable elds. Using an input translation formula, you can format such things as: Telephone numbers, by adding parentheses, hyphens, or periods.

Proper nouns, by capitalizing only the rst letter.

Working with input translation formulas


The input translation formula is triggered when the document is saved or refreshed. The input translation formula adjusts or reformats the value. The result of an input translation formula must evaluate to the same type of value specied by the eld. For example, if you are translating a text eld, the formula must evaluate to a text value.
Note: Input translation formulas do not apply to rich text elds.

Text Formatting Functions


There are several @functions available for formatting text. The following table describes some of these functions.

Function @Trim

Description Removes leading, trailing, and redundant spaces in a text string. Capitalizes the rst letter of each word in a text string. Converts all letters in a text string to uppercase. Converts all letters in a text string to lowercase.

@ProperCase

@UpperCase

@LowerCase

184

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Procedure Reference: Writing an input translation formula


Follow these steps to write an input translation formula.
1. 2. 3. 4. 5.

Select the eld. On the Objects tab of the Programmers pane, select the elds Input Translation event. In the Script area, write the translation formula. Save the form. Test the formula:

Preview the form. Enter a value and refresh the document.

Copyright IBM Corporation 2007.

185

Topic C: Work with Field Values


Lesson 8 Using Formulas in Forms

Activity 8-1: Interpret Input Translation Formulas


Scenario The data that you need to gather from users includes such items as phone numbers and zip codes, which you would eventually like displayed in the application in a consistent and pleasing way. You decide to use several IBM Lotus Notes application design features that work to provide that consistency. Follow these steps to interpret input translation formulas.
Step 1. 2. 3. 4. 5. Action Open the your copy of the Practice application in the Lotus Notes client. Choose CreateTranslation Demo. Work through the translation formulas. Click Mark Now to see your results. If prompted, in the Execution Security Alert dialog box, select Start trusting the signer to execute this action, and click OK.

Input Validation Formulas


You can stop users from saving documents with incorrect or incomplete values by specifying an input validation formula when designing editable elds.

Working with input validation formulas


When users save or refresh documents, the input validation formulas are triggered. The input validation formula is a conditional statement that: Determines if the value is acceptable or not.

If the value is acceptable, continues saving the document. If the value is not acceptable, displays a message to users indicating that the value is not acceptable and aborts the save or refresh operation.

Note: The input validation formula runs after the input translation formula.
Note: Input validation formulas do not apply to rich text elds.

186

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Validation Functions
Use the functions @Success and @Failure as the actions in the input validation formula. The following table describes how to use the two functions when validating eld values.

If the Field Value Is Acceptable

Use This Function @Success

To Continue saving or refreshing the document. Display a pop-up message box directing users to x the problem, and abort saving or refreshing the document.

Not acceptable

@Failure

Examples of Input Validation Formulas


The following code veries that a new number entered by a user is within a specic range:
@If (NewNumber >= LowValue & NewNumber <= HighValue; @Success; @Failure ("Please enter a value between " + @Text(LowNumber) + " and " + @Text (HighNumber))

The following code veries that the eld contains a value.


@If(Title=""; @Failure("Please enter a value."); @Success)

Copyright IBM Corporation 2007.

187

Topic C: Work with Field Values


Lesson 8 Using Formulas in Forms

Procedure Reference: Writing a eld input validation formula


Follow these steps to write a eld input validation formula.
1. 2. 3. 4. 5.

Select the eld. On the Objects tab under the eld, select Input Validation. In the Script area, enter a formula to test the value. Save the form. Test the input validation formula:

Preview the form. Enter appropriate and inappropriate values and refresh the document.

188

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Topic D: Work with Lists


Lists
In Lotus Domino, a list is dened as a named entity that contains multiple values of the same data type. The return value of some @functions is a list. Fields that allow multiple values contain lists. Constants and variables in formulas can contain a list. You can also present lists to a user using a prompt box. Multiple elements in a list are separated by a colon (:). For example, the following code denes a temporary variable and assigns a list of text elements to it:
cities := {New York} : {London} : {Paris} : {Boston};

List Functions
The following table contains @functions useful for working with lists.

@Function @Elements(list)

Usage Returns the number of elements in a list.

Example @Elements(Colors) Returns: The number of elements in the Colors eld. @Explode("Red Green Blue"; " ") Returns: Red:Green:Blue @Implode("Red": "Green":"Blue";"*") Returns: Red*Green*Blue @IsMember("Orange"; "Red":"Green": "Blue") Returns: 0 (False) @Member("I";"A": "E":"I":"O":"U") Returns: 3

@Explode(String; separator)

Splits a string into a list of values using the specied separator.

@Implode(list;separator)

Converts a text list into a string using the specied separator.

@IsMember(value; list)

Returns true if the value is a member of the list.

@Member(value;list)

Returns the number of the element in the list.

Copyright IBM Corporation 2007.

189

Topic D: Work with Lists


Lesson 8 Using Formulas in Forms @Function @Subset(list;number) Usage Returns a portion of the list containing the number of elements specied by number. Removes duplicates from a list. Example @Subset({A}:{E}: {I}:{O}:{U};2) Returns: {A}:{E}

@Unique(list)

@Unique({A}:{E}: {I}:{E}) Returns: {A}:{E}:{I}

190

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Activity 8-2: Evaluate List Formulas


Scenario You have been asked by your manager to work on developing some lists in the application youve been working on; however, he suggests that you brush up on some of the possibilities that can be obtained with various features available in Lotus Notes to build and manipulate lists. Use Lotus Domino Designer Help to help evaluate the formulas. Follow these steps to evaluate list formulas.
Step 1. 2. 3. 4. 5. Action Open your copy of the Practice application in the Lotus Notes client. Choose CreateLists Demo. Evaluate the list formulas. Enter the result in the appropriate eld. When you have evaluated all of the formulas, click Mark Now to see your results.

List Choices
Previously, you learned about the different types of elds, which include elds that offer a pre-dened list of choices to the user. To dene the list of choices, you can do either of the following: Enter each choice.

Write a formula to calculate the choices.

Procedure Reference: Adding a formula to compute the list of choices in a eld


Follow these steps to create a list of choices using a formula.
1. 2. 3. 4. 5.

In the Properties box of the List eld, click the Control tab. Select Use formula for choices. Enter the formula to create the list of choices. Save the formula. Test the formula by previewing the form.

Copyright IBM Corporation 2007.

191

Topic D: Work with Lists


Lesson 8 Using Formulas in Forms

The @DbColumn Function


The @DbColumn function returns an entire column of values from a view. By writing a formula with @DbColumn to compute the choices of a eld, you can avoid updating the list manually as data changes. The syntax of @DbColumn is:
@DbColumn( class : cache ; server : database ; view ; columnNumber )

The following table describes each parameter in the formula.

Argument class : cache

Data Type Text list

Description Indicates the type of database (class) you are accessing and whether to cache the results. For example, "":"", accesses a Lotus Domino database and caches the results.

server : database

Text list

Species the location and le name of the database. For example,"":"", refers to the current database, on your local machine.

view

Text

Species the name of the view.

columnNumber

Number

Species the column number within the view.

192

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Example of using @DbColumn


The example formula below is based on the following characteristics:

The view name is In Progress. The view is located in the Tracking database on Server01. The rst column contains the title of all projects currently in progress.

The formula returns a list of all the projects currently in progress (note the use of temporary variables to make the formula more readable):
REM {This formula returns the values in the first column}; REM {of the In Progress view in Tracking on Server01}; source := "Notes": ""; location := "Server01":"Tracking.NSF"; view := "In Progress"; colNumber := 1; @DbColumn (source; location; view; colNumber)

Copyright IBM Corporation 2007.

193

Topic E: Prompt Users


Lesson 8 Using Formulas in Forms

Topic E: Prompt Users


The @Prompt Function
What do you do when you need to prompt a user for information in your application? If you are working with the Formula language, you use the @Prompt function. @Prompt allows you to create a more interactive interface for Lotus Notes applications. The @Prompt function allows users to enter values, respond to questions, or choose from a list of choices. There are many different styles of prompt boxes, and the prompt boxes can be triggered in different ways. @Prompt can be used in elds, hotspots (buttons), manual agents, and toolbar buttons.
Caution: @Prompt does not set the modied ag of the document. Therefore, if a form uses only @Prompts to collect data and set elds, the user could close the document and not be prompted to save it.

Syntax for @Prompt


The syntax for @Prompt is:
@Prompt( [style] : [ NOSORT ] ; title ; prompt ; defaultChoice ; choiceList ; filetype )

The following table describes the parameters for @Prompt.

Argument style NOSORT

Data Type Keyword Keyword

Description Indicates the type of dialog box to display. If present, the list of choices is not automatically sorted. The title for the dialog box. The text you want to display in the dialog box. The value to use as a default value. The values to display in the dialog boxs list. The types of les to display when using the LOCALBROWSE style.

title prompt defaultChoice choiceList letype

Text Text Text Text list Text

The following example shows a simple @Prompt formula:


@Prompt([OK];"Prompt box";"You did it! Click OK to close.")

194

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Triggering @Prompts
Prompt dialog boxes can be triggered in the ways described in the following table.

Trigger Field formulas

Description Use @Prompt to prompt the user to enter a value in a eld. @Prompt can be used in buttons to take input from a user. @Prompts are useful in Action buttons and agents. For example, you could prompt the user for a value and set the value of a eld based on what the user enters. In combination with @Password, @Prompt can be used to prompt for a password on a form.

Button formulas

Form and View action buttons or manual agents

Password eld formulas

Copyright IBM Corporation 2007.

195

Topic F: Create Reusable Code


Lesson 8 Using Formulas in Forms

Topic F: Create Reusable Code


Reusable Code
The ability to create reusable code is possible in the Formula language using @ThisValue and @ThisName.

Accessing elds without hard-coding the eld names


Creating reusable code means creating code that can be used in multiple places without changes to the code. Developers can save time by writing a formula once and reusing it in many different places. Using @This Value and @This Name has the following benets: You do not need to hard-code eld names.

You can write code once that you can then cut and paste into multiple elds throughout an application. You do not need to manually revise code every time a eld name changes.

Reusable Code Functions


@ThisName and @ThisValue are especially useful for creating reusable input translation and validation formulas. The purpose of these @functions is described in the following table.

@Function @ThisValue @ThisName

Purpose Returns the value of the current eld. Returns the name of the current eld.

For example, in an input validation formula for a listbox eld that requires more than one selection, you can use @ThisValue to check whether a user has selected more than one list option, and, if not, use @ThisName to prompt the user to select a second option. The formula would look like this:
@If((@ThisValue != "") & (@Elements(@ThisValue) = 1); @Failure("The " + @ThisName + "field must contain more than one choice"); @Success)

196

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Topic G: Implement Error Checking


Run-Time Errors
Run-time errors are inevitable in any program. The application developer must anticipate where errors may occur and ensure that these errors do not prevent the user from working with the application.

Types of errors
The following table describes the types of run-time errors application developers encounter.

Type of Error Development

Description Users should never see these types of errors. You should discover and x all of them before rolling out the application. There are the following two types of development errors: Unexpected errors are mistakes in programming. For example, forgetting a parameter in certain functions will produce the Insufficient arguments for @function error message at runtime, instead of compile time. Unreported errors are incorrect results that do not report an error. For example, using the incorrect data type for a function may not produce an error message, but the function will not operate as you intended.

User

These are errors that users might cause while working in the application. For example, if you ask the user for a le name and the user enters a name that does not exist. A developer cannot prevent these types of errors, but can anticipate them, test for them, and take appropriate actions to handle them so they do not cause other problems.

Note: Functions that have only one signature (xed number of required parameters) are checked at compile time. Those that have multiple signatures (the same function that operates in different ways depending on different numbers of required and optional parameters) are not.

Copyright IBM Corporation 2007.

197

Topic G: Implement Error Checking


Lesson 8 Using Formulas in Forms

The @StatusBar Function


To help nd development errors, use @StatusBar to print data to the Lotus Notes client status bar as a basic way of debugging formulas. The status bar (at the bottom of the Lotus Notes client) stores a history of the last 20 messages to allow you to see what the formulas are doing as they execute. The following is the syntax of @StatusBar:
@StatusBar (message)

The following formula prints the result to the status bar so you can verify that the formula is functioning correctly.
@StatusBar ("result = " + Result);

Error Generation and Reporting


The Lotus Notes client generates an error for a eld when the following occur: The built-in (default) validation checking fails. This occurs as soon as the user enters the value.

The custom translation and validation functions fail. This occurs when the user attempts to save the document.

Even though errors occur, Lotus Notes only reports errors when the user attempts to save or refresh the document. Because Lotus Notes does not report the error until the save (or refresh), the developer can use code to correct the error or report an error with a more user-friendly message.

198

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Error-Handling Functions
The following table describes common functions for handling run-time errors.

Function @IsError (value)

Description Determines if a eld, variable, or expression contains an error. For example, if a user enters text in a number eld. Stops the execution of a formula and returns a specied value. Displays a message when used in a eld input validation formula. Returns 1. Use this in eld input validation formulas for better readability and easier maintenance.

@Return (value)

@Failure (message) @Success

Examples of using @IsError


You may use @IsError to test for data entry errors. For example, you can discover if a user enters text in a number eld by checking the value of the eld with @IsError. If you detect an error, you can display your own message to the user, or take other action such as setting the value to zero. This is particularly useful if you are going to perform a calculation with the number before saving the document. By using @IsError, you can avoid executing the calculation on invalid data. The following code shows an example of this:
NumberOfItems := @TextToNumber (Quantity); @If (@IsError (NumberOfItems); NumberOfItems := 0; "");

You can also use the @IsError function to display a custom error message instead of the one Lotus Notes supplies by default. For example, if the user enters text for a number and attempts to save the document, Lotus Notes will display a message box with the Cannot convert text to number error. If you use @IsError in the eld validation formula for the eld, you can use @Prompt to override the supplied message. Below is an example of a eld validation formula that displays a custom error message:
@If (@IsError(@ThisValue); @Failure ("Please enter a number for " + @ThisName + " ."); @Success)

Copyright IBM Corporation 2007.

199

Topic G: Implement Error Checking


Lesson 8 Using Formulas in Forms

Lesson Summary
In this lesson, you used formulas in conjunction with forms. By giving forms added functionality that can only be deployed through the use of formulas, you can not only augment and correct the entry of data into an application, but also interact with the user in situations where changes to data are necessary.

200

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Lab 8-1: Create a Dynamic Title


Scenario Worldwide Corporation would like to customize the titles displayed to users when they open certain documents in the Policies and Procedures application.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following task to complete this lab.

1. When a Policy document is opened, check to see if it is new or not. Dis-

play either the title of the Policy or New Policy, depending on the state of the document.

Copyright IBM Corporation 2007.

201

Topic G: Implement Error Checking


Lesson 8 Using Formulas in Forms

Lab 8-2: Automate Data Entry and Formatting


Scenario After reviewing your design work, your supervisor suggests that you add some functionality that will keep end-users from having to enter the same information over and over again in different components and x capitalization mistakes. During this activity, you will automate data entry and formatting in the Policy form. Here is a list of the functionality that Worldwide would like to incorporate into the application: The policy title should be formatted using proper case.

Create a eld to capture the date the policy is created. This date should be displayed without the time element. Name it PolicyCreatedDate The effective date should calculate to one month from the date the policy is created in order to account for an internal review process. This date should also be displayed without the time. When a policy is created, the document should not be saved unless it contains a title and category.

Perform the following tasks to complete this lab.

1. Implement the above specications.

2. Preview the form and test your formulas.

Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

202

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Lab 8-3: Compute a List of Choices for a Field


Scenario To make the Policies and Procedures application easier to maintain over time, create a view that contains the policy categories in the rst column. When a policy is created or edited, the categories should be displayed from the Categories view. In order to accomplish this: Create a Category form containing a eld called Category.

Create Category documents with the following categories:


Office Guidelines Benets Holidays Grievance Procedures Security E-mail Etiquette Diversity

Create a view called Categories that only displays the Category documents. Modify the Policy form to perform a lookup to the Categories view to produce the list for the Category eld.

Hint: The view should only display documents created with the Category form.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Implement the above specications.

2. Preview the form and test your formulas.

Copyright IBM Corporation 2007.

203

Topic G: Implement Error Checking


Lesson 8 Using Formulas in Forms

Lab 8-4: Create Reusable Code


Scenario To ensure that certain elds are populated on the Policy form in your copy of the Policies and Procedures application, create reusable code that checks to see if a value is entered in the Policy Number and Policy Title eld.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Create a reusable formula.

2. Copy it into the appropriate elds.

3. Save and test your form.

204

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 8 Using Formulas in Forms

Lab 8-5: Implement Error Interception


Scenario The Worldwide Corporation frequently updates their company policies and would like to allow for internal review of any modications. Revise the Policies and Procedures application to allow for a one month review period before the policy is implemented, and to intercept run-time errors before they need to be handled.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. In the Policies and Procedures application, add a row called Modica-

tions to the Policy to the existing table.

2. Create a Computed Date/Time eld called L_ModiedDates

Specify the following: Allow multiple values


Display date only Display separate values with new line Hide paragraph if the eld is empty

3. The eld needs to be modied only when the document is actually

saved. Write a formula that determines if the eld needs to be modied. Have the formula check if/when the document has been saved, and add todays date to the end of the list of values if the document is being saved again.

4. On the line below the new eld, but in the same table cell, enter "N/A" and hide it when L_ModiedDates=NULL.

5. Revise the formula for the Effective Date eld to use the

L_ModiedDates eld.

Copyright IBM Corporation 2007.

205

Topic G: Implement Error Checking


Lesson 8 Using Formulas in Forms 6. Test your form.

7. Close all open windows.

206

Copyright IBM Corporation 2007.

Using Formulas in Views


Topic A: Create Selection Formulas Topic B: Concatenate Values in a View Column Topic C: Display Icons In a View

Copyright IBM Corporation 2007.

Lesson 9 Using Formulas in Views

Introduction
After completing this lesson, you should be able to: Create selection formulas. Concatenate values in a view column. Add a custom icon to a view column.

208

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

Topic A: Create Selection Formulas


View Events
View events occur when users work in a specic view or folder. View events include opening or closing a view, adding documents to a calendar view, or adding documents to a folder. Some examples of view and folder events are described in the following table.

Event Name ViewSelection QueryOpen

Result Selects the documents that the view displays. Prevents users from opening a view in certain circumstances such as from opening a month end view before the twentieth day of the month. Creates a new document or open an existing one. Informs users before a large view refreshes that it could take a while and asks them if they really want to proceed. Prevents users from pasting documents into the database. Changes the value of StartDateTime and EndDateTime in the document when you paste an appointment on a particular day and time slot. Prevents users from closing a view such as when there are still action items in the action item view assigned to them.

PostOpen QueryRecalc

QueryPaste PostPaste

QueryClose

QueryAddToFolder Lets you prevent someone from dragging a document from one folder or view to another. For example, you can prevent documents from moving to the Done folder if their status is still Open. Note that the trigger for this event is in the view or folder from which the document is moved. OnSelect Occurs when a view is opened, since a row is highlighted at that time; also occurs when a document is selected or deselected using a checkmark or when the user clicks an already selected row.

In addition to the events available for all views, calendar views have specic events. Examples of calendar view events are shown in the following table.

Copyright IBM Corporation 2007.

209

Topic A: Create Selection Formulas


Lesson 9 Using Formulas in Views

Event Name RegionDoubleClick

Result Creates a new document when users click an area in a calendar view. Prevents someone from dropping an appointment on an inappropriate day or time, such as a weekend day or a time that is after 5:00 PM. Changes the value of StartDateTime and EndDateTime in the document after you drop an appointment on a particular day and time slot.

QueryDragDrop

PostDragDrop

View Selection Formulas


Views can include all documents in a application or a subset of those documents. The selection condition, whether it is created with Search Builder or a view selection formula, controls the document displayed. All documents that match the selection criteria are displayed in the view. Earlier in the course, you used simple conditions to select which documents to display in a view. However, view selection formulas provide more control over which documents a view displays.

Including documents in a view


The following gure illustrates the view selection process.

Figure 9-1: The View selection process

210

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

The view selection formula


When a view is rst created, the default selection formula is SELECT @All. Using this formula, all documents in the application are included in the view. The SELECT statement allows greater control of the selection of documents. The view selection formula syntax is as follows:
SELECT Condition formula;

The following table describes the parts of a view selection formula.

Part SELECT keyword

Function Includes a document based on the result of the comparison formula. A formula that evaluates to either True (1) or False (0) for each document in the application. It can use constants, elds, operators, and @functions.

Condition formula

Examples of view selection formulas


The following table describes a few examples of view selection formulas.

This View Selection Formula... SELECT @All

Includes All Documents That... Are in the application. This is the default formula for view selection. Were created or last modied using a form named ei. Contain a eld called Price whose value is less than 1000 and a eld called Instock whose value is Yes. Were created or last modied using the form named ei and do not contain a eld named Department whose value equals Accounting.

SELECT Form = "ei"

SELECT (Price < 1000) & (InStock = "Yes") SELECT Form = "ei" & Department != "Accounting"

Copyright IBM Corporation 2007.

211

Topic A: Create Selection Formulas


Lesson 9 Using Formulas in Views

Activity 9-1: Write a View Selection Formula


Scenario Your manager reports back that, due to the wide variance in information that will be entered into the application you are developing, there will be times when users will want to see information based on specic criterion and not all the information all the time. In this activity, you will create a view selection formula that selects documents of employees whose salaries are over $30,000. Follow these steps to write a view selection formula.
Step 1. Action Open your copy of the Practice application in the Lotus Domino Designer. Click Views in the Design Elements list. Result: A list of views appears in the Work pane. 2. Create a view based on the Employee Information view. Name the view Salaries Result: The view is created and appears in the Design list. 3. Open the view. Result: The view appears in the Work pane. 4. 5. Select View Selection in the Objects tab. In the Programmers pane, select Formula in the Run drop-down list. Result: SELECT ((Form = "Employee Information") | (Form = "ei")) appears in the script area. 6. Delete the selection formula. Type the following formula: SELECT Form="ei" & Salary>30000 Result: The new formula is created. 7. Save the view. Preview your work in the IBM Lotus Notes client.

212

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

Topic B: Concatenate Values in a View Column


Concatenation
Concatenating text values, or strings, is useful when you want to combine related elds in a single column or when the eld value requires supporting text to make sense to users. The + sign is used to concatenate text into a single string. For example, the following view column formula displays the rst name and last name with a space between them in a single column.
FirstName + " " + LastName

You can only concatenate text values. To include other data types in your concatenation, do the following: Convert (also known as normalize) the values to text.

Concatenate the text values.

Converting Values To Text


To combine different types of values, you must rst make sure that the values are the same data type. For example, to display number and text values in a view column, convert the number to text, then concatenate the text values. Use @Text to convert number and date-time values to text. @Text offers options to control the format of the resulting text. The syntax for @Text is as follows:
@Text ( value ; format-string );

Where:

Value can be a number, time-date, text, or rich text. Format-string is optional. It controls the formatting of the returned text value. For example, if a currency value is converted to text, you might want the new value displayed with the appropriate currency symbols and punctuation.

Copyright IBM Corporation 2007.

213

Topic B: Concatenate Values in a View Column


Lesson 9 Using Formulas in Views

The @Text Function


There are two types of format string components available for text values: datetime components and numeric value components. These components can be combined in various ways. Listed here are several of the more commonly used string components and what they display: D0 year, month, day

D2 month and day S1 Time only C Currency

The following table provides some examples of converting values to text.

Original Value The Sales eld contains the value 800. The Date eld contains 12/31/2005 11:59:59 PM. The Date eld contains 12/31/2005 11:59:59 PM.

Formula @Text (Sales; "C,2") @Text (Date; "S0D2") @Text (Date; "S1T0") $800.00

Result

12/31

11:59:59 PM.

Procedure Reference: Writing a formula that concatenates multiple values in a view column
Follow these steps to enter a column formula that concatenates multiple values.
1. 2.

In the Object list, select the Column Value property under the view. Write a formula to concatenate the values:

Use functions to convert number and date-time values to text. Combine the converted values using the concatenation operator (+).

3.

Save and preview the view.

214

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

Activity 9-2: Concatenate Text And Number Values


Scenario Rather than have end users needlessly re-enter name information in a part of the application you are developing, you look for a way to manipulate the separate rst and last name data into a full name for display. In this activity, you will create a view that quickly shows a list of employees and their date of hire. You will edit your Employee Information form to include an editable Date Hired eld, with a type of Date/Time. You will then edit the documents in your Employees view, and give them a hiring date, and leave one of them blank. Follow these steps to create a DateHired eld, assign employee hire dates, and concatenate text and number values.
Step 1. Action In your copy of the Practice application, add a eld named DateHired to your Employee Information form. Give it a type of Date/Time and make it editable. Using your Employee Information view, open all but one of the documents, and give the employees a date of hire. Create a view in the Practice application called Date of Hire. Result: The view appears in the Work pane. 4. Open the new view and double-click the default column header. Delete the column title. Set the column width to 25. Result: The empty column header is selected and wider. 5. 6. In the Script area for the column, select Formula. Replace the default formula with: FirstName + " " + LastName + " was hired on " + @Text(DateHired; "S0D1"); Result: Employees name and hire dates will appear. If an employee was hired this year, only the day and month will appear. 7. 8. Sort the column in ascending order. In the View Selection object, select the formula, and type the following formula: SELECT Form="ei" Result: The view will only display documents created with the Employee Information form. 9. Save and preview the view.

2. 3.

Copyright IBM Corporation 2007.

215

Topic C: Display Icons In a View


Lesson 9 Using Formulas in Views

Topic C: Display Icons In a View


Displaying Icons In a View
One way to make different documents stand out in a view is to associate an icon with the document. In order to display icon columns: The column property Display values as icons must be set.

A column formula must be created which evaluates to a number corresponding to the preset list of IBM Lotus Domino icons, or that evaluates to the name (or alias) of a custom icon stored as a Shared Image Resource.

Column properties
Select the Display values as icons option in the Column Info tab of the Column Properties box. The following gure shows this option selected.

Figure 9-2: The Display values as icons option

Creating a Column Icon Formula


In order for a view column to display an icon a formula must be created that evaluates to the icon. Typically, the formula evaluates to a number that represents a predened icon, although it can evaluate to a custom icon. The following formula displays a thumbs up icon next to products that have been approved:
@If (Approved="Yes";83;0)

If the approved eld contains anything other than the word Yes, then nothing is displayed.

216

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

Predened Icon Set


Figure 9-3 displays the predened set of icons available in Lotus Domino.

Figure 9-3: A predened set of icons available in Lotus Domino.

Procedure Reference: Adding a predened icon to a column


Follow these steps to add a predened icon to a view column.
1. 2.

Open the view to be modied in IBM Lotus Domino Designer. Choose CreateInsert New Column. Result: A new column is inserted to the left of the selected column.

3. 4. 5.

In the Programmers pane, select Formula. Enter a formula that results in a predened icon value. For example: @If(Approved="Yes";83;0) Choose DesignColumn Properties. Result: The Column Properties box opens.

6. 7.

Select Display values as icons. Save and preview the view.

Copyright IBM Corporation 2007.

217

Topic C: Display Icons In a View


Lesson 9 Using Formulas in Views

Activity 9-3: Designate Multiple Icons for a Specic Type of Document


Scenario Some of your applications end users will be working with a subset of the entered data; you work on components designed to display that data subset. In this activity, you will use the Sample Employee Information view in your copy of the Practice application. Write a formula that uses the hire date to determine those employees who are fully vested in the company retirement program. Create a smiley icon for those fully-vested employees hired before 2000, and a checkmark icon for those employees hired after 1/1/2000. Follow these steps to add multiple icons to your Sample view.
Step 1. 2. 3. 4. 5. Action Open the Employee Information view in your copy of the Practice application. Add a new column to the left of the rst column. Open the Column Properties box. On the Column Info tab, reduce the width to 1 and select Display values as icons. In the Programmers pane, select Formula, and type the following formula: @If(DateHired<[01/01/2000];85;82) Result: Those who were hired before 01/01/2000 have a smiley face, those who were hired on 01/01/2000 or later have a check mark. Anyone with a blank hiring date will have no icon because the inequality evaluates to an error condition, which stops all processing for that column in that row. 6. 7. Press Shift+F9 to rebuild the view. Save and close all open windows.

Adding a Custom Icon to a View Column


To use a custom icon in a view column, the image must be saved as an image resource. The image can be in one of the three graphic formats: GIF

BMP JPG

The recommended size for a custom column icon is 17x17 pixels. You cannot combine a predened and a custom icon in the same column.

218

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 9 Using Formulas in Views

Procedure Reference: Adding a custom icon to a view column


Follow these steps to add a custom icon to a view column.
1. 2. 3. 4.

Open the application in Lotus Domino Designer. Select Shared ResourcesImages from the Design Elements list. Click New Image Resource. Select the image to be added and click Open. Result: The image is added to the Work Pane list. For example: logo.jpg.

5. 6.

Open the view to be modied in Lotus Domino Designer. Choose CreateInsert NewColumn. Result: A new column is inserted to the left of the selected column.

7. 8.

In the Programmers pane, select Formula. Enter a formula to display the shared image. For example:
@IF(Approved="Yes";"logo.jpg";0)

9.

Choose DesignColumn Properties. Result: The Column Properties box opens.

10. Select Display values as icons. 11. Save and preview the view.

Copyright IBM Corporation 2007.

219

Topic C: Display Icons In a View


Lesson 9 Using Formulas in Views

Lesson Summary
In this lesson, you selected and manipulated data for use and display in views. By learning how to select and arrange view data, you can present information in ways that would otherwise require repetitive and sub-optimal entry of redundant information into an application.

220

Copyright IBM Corporation 2007.

10

Enhancing Forms

Topic A: Work with Layers Topic B: Work with Subforms Topic C: Create Shared Fields Topic D: Enable Inheritance in Forms and Documents Topic E: Create Related Forms Topic F: Enable AutoSave Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms

Copyright IBM Corporation 2007.

Lesson 10 Enhancing Forms

Introduction
After completing this lesson, you should be able to: Work with layers. Insert computed subforms in forms. Work with shared elds. Enable inheritance in forms and documents. Create related forms. Enable the AutoSave feature in Lotus Notes. Embed an instant messaging contact list in a form.

222

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic A: Work with Layers


Layers
Layers are used to position overlapping blocks of content on a form, subform, or page. This provides you with more control over the design of IBM Lotus Domino pages and forms. Make note of the following when working with layers on forms and pages: Layers on a form or subform can contain anything a form can contain.

Layers on a page can contain anything a page can contain.

This topic focuses on using layers on a form.

Benets of working with layers


There are many benets to working with layers. Benets include:

Precise positioning to allow for complex layout options. Stacking layers provides great design control and exibility. For example, different layers containing text and images can be stacked for a high-impact page title. Layers can be transparent or opaque, depending upon the type of effect desired.

Content of a Layer
Add content to a layer just as you would add content to a form. You can copy and paste from another form or layer, or type directly in the layer. You can also add graphics.

Procedure Reference: Creating a layer


Follow these steps to create a layer on a form.
1. 2. 3.

Open a form, page, or subform in IBM Lotus Domino Designer. Place the cursor where the layer should appear. Choose CreateLayer. Result: A blank layer is inserted onto the form. Selection handles surround the layer, indicating it is selected.

4. 5.

Click inside the layer and add the layers content. Save and preview the form.

Copyright IBM Corporation 2007.

223

Topic A: Work with Layers


Lesson 10 Enhancing Forms

Layer Anchors
Each layer has an anchor. The layer anchor associates itself with the element closest to where it was inserted, such as a paragraph of text. This is referred to as the parent element. If the layer is moved, the anchor remains in place. To display or change the name of the layer, right-click the layer anchor. The Layer Anchor Properties box appears with the current name of the layer. The following gure shows a layer and its anchor.

Figure 10-1: A layer anchor

Layer Properties
After you create a layer, you can control the following properties:

Background color and image HTML properties Position

Layer Background Color


You can set the layers background color to be the system color, gray, transparent, black, or an RGB value. The following table lists the color icon choices on the Background tab of the Layer Properties box.

Icon System color

Function

Transparent

224

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms Icon Black (0,0,0) Function

Red, Green, Blue (RGB)

Layer Background Images


Layers can contain a background image in addition to, or instead of, a background color. The image used for the layer background must be a shared image resource. Images can be displayed once in the layer, or tiled horizontally, vertically, or continuously.

Procedure Reference: Modifying the background of a layer


Follow these steps to modify a layers background.
1. 2. 3. 4. 5.

Select the layer. Select LayerLayer Properties to open the Layer Properties box. Click the Background tab To change the layers color, click the drop-down arrow to the right of Color. Choose one of the color options:

System Transparent Black RGB

6. 7. 8.

Click on the folder, to the right of Image Source, to insert an image resource. Select one of the image repeat values. Save and preview the form.

Copyright IBM Corporation 2007.

225

Topic A: Work with Layers


Lesson 10 Enhancing Forms

Layer Size and Position


A layer can be resized and repositioned several different ways. You can:

Drag and drop it. Explicitly set its position. Position it relative to other layers on the form.

Layer Position Values


The position of a layer on the screen, its size, and the position of the layer in relationship to other layers is displayed, modied, or both, in the Layer Position tab of the Layer Properties box. When you drag and drop a layer, or resize it using the layer window handles, the Top, Left, Width, and Height parameters change to reect the new position or size. These values can also be changed to set the size and position of a layer explicitly. The Z-Index parameter determines the order in which the layer appears if there are multiple layers on the form, page, or subform. Think of the layers as stacked one upon the other. If there were three layers, the lowest layer would have a Z-Index of zero, the middle layer would have a Z-Index of one, and the top layer would have a Z-Index of two. Other facts about the Z-Index parameter: 0 is the default.

1 appears above 0. Multiple layers can have the same level. Negative values are placed behind the parent element.

226

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Procedure Reference: Setting a layers coordinates


Follow these steps to modify the layers position properties.
1. 2. 3. 4. 5. 6. 7.

Select the layer. Choose LayerLayer Properties. Click the Positioning tab. Enter the appropriate coordinates to align the layer from the top or left edge of the parent element. Enter the appropriate coordinates to change the layers height and width. Enter the appropriate integer for the layers Z-Index. Save and preview the form.

Multiple Layer Alignment


There are different ways to align multiple layers. The following table lists the methods for aligning multiple layers.

To Select multiple layers


Follow These Steps Select the rst layer. Press CTRL and click the other layer(s).

Result: Selection handles appear around the selected layers. Align multiple layers Select the layers to align. Choose LayersAlign. Select from the available options.

Adjust layer sizes

Select the layers to adjust. Choose LayerMake same size. Select from the available options.

Copyright IBM Corporation 2007.

227

Topic A: Work with Layers


Lesson 10 Enhancing Forms

Hiding Layers
Occasionally, you will want to hide a layer temporarily to make layout adjustments. Like other design elements, layers can be hidden using Hide/When properties. However, for ease of development Lotus Domino Designer provides another method for hiding layers. That method is the Layer Tree.

The Layer Tree


The Layer Tree hides one or more layers for the current session. You can work on one layer without another layer, or layers, getting in the way. If a layer is hidden, a grey circle appears next to the name of the layer; otherwise, the circle is empty. The following gure shows a Layer Tree Properties box with three hidden layers.

Figure 10-2: The Layer Tree


Note: When a hidden layer is selected, the top button in the Layer Tree Properties box toggles from Hide to Show.

Procedure Reference: Hiding a layer


Follow these steps to hide a layer.
1. 2. 3.

Choose DesignLayer Tree. Select the name of the layer you want to hide. Click Hide. Result: The layer will not be visible for the current session.

228

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Activity 10-1: Work with Layers


Scenario You have been experimenting with techniques that improve the visibility and usability of a data entry component you have been developing for your application. Layers can be used to enhance the appearance of the Employee Information form you created in an earlier activity. In this activity, you will add a layer with a background image for visual appeal. You will copy the form elds and labels into the layer. Follow these steps to create a layer.
Step 1. Action Open the Employee Information form in your copy of the Practice application. Result: The form appears in the Work pane. 2. 3. Place the cursor below the other content on the form. Choose CreateLayer. Result: A blank layer is added to the form. 4. 5. 6. Drag the layer handles so that the layer is approximately as large as the area of the eld labels and elds on the form. Highlight the elds and the label text. Press Ctrl+X to cut the elds. Place the cursor inside the layer. Press Ctrl+V to copy the elds into the layer. Result: The elds appear inside the layer. 7. Resize and reposition the layer by dragging it so that it is under the form title. Result: The layer, along with its elds and text, is repositioned. 8. Choose LayerLayer Properties. Result: The Layer Properties box appears. 9. 10. Click the Background tab. Click the folder icon next to the Image Source text box. Select lesson_ menu_background.gif. Click OK. Result: The background image appears in the layer. 11. Select Repeat horizontally in the Repeat drop-down list. Result: The background image lls the layer. 12. Select the HTML tab.

Copyright IBM Corporation 2007.

229

Topic A: Work with Layers


Lesson 10 Enhancing Forms Step 13. 14. Action Type Image_and_Fields in the Id eld. Save and preview the form.

230

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic B: Work with Subforms


Subforms
A subform is a collection of form elements stored as a separate design element. A subform can contain anything a form can contain. A form can contain one or more subforms. One subform can be used in many different forms within the same application or across different applications. Subforms can also be used conditionally, depending on the results of a formula. Subforms can also contain other subforms. The benets of using subforms in your application include: Saving design time when the same set of design elements need to be included in more than one form.

Ensuring design consistency among the forms in the application.

The following gure shows one subform being used in multiple forms.

Figure 10-3: Subforms

When to use subforms


Examples of when to use a subform include:

To add a formatted logo or letterhead. To ensure consistency and standards in form design. To start building new forms quickly.

Copyright IBM Corporation 2007.

231

Topic B: Work with Subforms


Lesson 10 Enhancing Forms

How Subforms Work


Subforms can only be used as part of a form. Every time a document is created or opened, the form references the subform. Elements of a subform automatically become part of the form when displaying documents. Changes made to a subform affect all forms and documents that include the subform.

Procedure Reference: Creating a subform


Creating and using a subform in a application is a two-part process. First, the subform needs to be created. Then the subform needs to be inserted as part of a form. Follow these steps to create a subform.
1. 2. 3. 4.

Open the application in Lotus Domino Designer. Choose Shared Code in the Design list. Select Subforms from the Shared Code list. Click New Subform in the Work pane. Result: A new blank subform opens in the Work pane.

5.

Choose DesignSubform Properties to open the Subform Properties box. Note: The Include in Insert Subform dialog option is selected by default.

6. 7. 8.

Name the new subform. Add elements to the subform as you would a form. Save and close the subform.

232

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Subform Properties
Like other design elements, subforms have properties you can set, using the Subform Properties box. Use the Subform Properties box to: Give the subform a name and an alias.

Specify display options for the subform.

Procedure Reference: Inserting a subform in a form


Follow these steps to insert a subform in a form.
1. 2. 3.

Open a form in Lotus Domino Designer. In the Work pane, click where the subform will appear. Choose CreateResourceInsert Subform. Result: The Insert Subform dialog box appears.

4. 5.

Select a subform from the list that appears. Click OK. Result: The subform appears in the specied place in the form.

Copyright IBM Corporation 2007.

233

Topic B: Work with Subforms


Lesson 10 Enhancing Forms

Computed Subforms
You can have subforms appear conditionally, depending on the result of a formula. This is called a computed subform. For example, you might offer users a choice of custom mail forms with different graphics and styles for various types of messages.

Procedure Reference: Implementing computed subforms


Follow these steps to implement computed subforms.
1. 2. 3. 4.

Create the subform(s). Decide under what conditions each subform will appear. Write a formula to include the subform(s) based on those conditions. Add the formula to the appropriate form(s).

Creating a Computed Subform Formula


You could use the following formula to select and insert a subform based on whether a user is posing a question, replying to a question, or adding a comment.
@If(MsgType="question";"QuestionSub"; MsgType="reply"; "ReplySub"; "CommentSub")

The value in the MsgType eld determines which subform is used.

Procedure Reference: Inserting computed subforms in forms


Follow these steps to insert a computed subform in a form.
1. 2. 3. 4. 5. 6. 7.

Open the form. Click where you want to add the subform. Choose CreateResourceInsert Subform. Select Insert Subform based on formula. Click OK. Enter a formula in the Programmers pane that determines which subform to display. Save the form.

234

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic C: Create Shared Fields


Shared Fields
You can dene a eld for use on more than one form. For example, many forms have a creation date eld; you can dene this eld once and reuse it. When you dene a eld as a shared eld, Lotus Domino Designer displays the eld with a dark border and adds the eld name to a list of shared elds available for use in an application.
Note: In multiple-database applications, you can use shared elds from separate databases.

Benets of Shared Fields


The benets of using shared elds include:

Maintaining and reusing consistent formulas throughout an application. Providing single point maintenance for a given eld. Standardizing keyword lists.

Procedure Reference: Creating a shared eld


Follow these steps to create a shared eld.
1. 2. 3. 4. 5. 6.

Expand Shared Code in the Design pane. Click Fields. Click New Shared Field. Enter a name for the shared eld. Assign a Field type and choose Editable or a computed option, if applicable. Close the Field Properties box. Close and save the shared eld.

Procedure Reference: Inserting shared elds


Follow these steps to insert a shared eld onto a form or subform.
1. 2.

Open a form or subform and position the cursor where you want the eld to appear. Choose CreateResourceInsert Shared Field. Result: The Insert Shared Field dialog box appears.

Copyright IBM Corporation 2007.

235

Topic C: Create Shared Fields


Lesson 10 Enhancing Forms 3.

Select the shared eld you want to use and click OK. To select a shared eld from another application, click the Database list, highlight a application, select a shared eld in that application, and click OK.

Procedure Reference: Converting single to shared elds


Follow these steps to convert a single-use eld to a shared eld.
1. 2. 3.

Open the form. Click the eld to be shared. Choose DesignShare This Field.

236

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic D: Enable Inheritance in Forms and Documents


Inheritance
Lotus Domino Designer allows you to create elds that inherit values from other elds. The source elds and target elds can be in separate documents or in the same document. Therefore, data can be entered or assigned once and reused as needed in multiple places. For example, when an employee is rst hired, there are many forms that need to be completed which include the employees name, address, employee number, job title, and so on. Using inheritance, this information need only be entered once. Lotus Domino supports this sharing of information by providing a method for inheriting information from one document to another.

Benets of inheritance
The ability to inherit information automatically from one document to another has a number of benets, including: It is more efficient than typing the same information multiple times.

It helps preserve the accuracy of the information contained in each document.

Copyright IBM Corporation 2007.

237

Topic D: Enable Inheritance in Forms and Documents


Lesson 10 Enhancing Forms

How inheritance works


Fields can inherit values from elds in other documents in the same database or from elds on the same document. The following gure illustrates how one source document contains eld data that can be inherited by multiple receiving documents.

Figure 10-4: Inheritance

Enabling Inheritance
Forms can be designed to inherit information from an existing document. Creating a form to inherit values from another document requires that the developer: Enable the On Create: Formulas inherit values from selected document form property.

Create eld(s) containing the following characteristics:


Computed when composed eld type Includes a formula that species the source eld

238

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Procedure Reference: Enabling inheritance on a form


Follow these steps to enable inheritance for a form.
1. 2. 3. 4. 5. 6.

Create a form or open an existing form in Lotus Domino Designer. Open the Form Properties box. On the Defaults tab, select On Create: Formulas inherit values from selected document. Specify a Computed Field type for the eld(s) that will inherit information. Write a formula for the inheriting eld(s) that evaluates to the source eld name. Save the form. To test your work, highlight an existing document that contains the eld(s) to inherit, and then create a document with the new or revised form.
Note: Fields that inherit information do not need the same eld name as their source elds; they do, however, need to be the same data type. For consistency sake, an inherited elds name should be kept the same as the original eld if it contains the same information. This allows for more consistent programming methods and view formulas.

Copyright IBM Corporation 2007.

239

Topic D: Enable Inheritance in Forms and Documents


Lesson 10 Enhancing Forms

Activity 10-2: Enable Inheritance


Scenario Ever mindful of keeping end-users from needlessly having to enter data, you discover a technique for obtaining data from one document and using it on another. In this activity, you will create an Employee Benets form that inherits an employees rst and last name from documents created earlier in the course. Follow these steps to enable inheritance.
Step 1. Action In your copy of the Practice application, create a form and name it Employee Benefits with an alias of eb Result: The form appears in the Work pane. 2. Choose DesignForm Properties. Click the Defaults tab. Result: The Defaults tab of the Form Properties box appears. 3. Select On Create: Formulas inherit values from selected document. Close the Properties box. Result: The property is set and the Form Properties box closes. 4. Create a eld with the following characteristics:

Name: InheritFName Type: Text, Computed when Composed

Result: The InheritFName eld is created. 5. In the Programmers pane for the InheritFName eld, enter the formula: FirstName Result: The FirstName eld is added as a formula. 6. Create a eld with the following characteristics:

Field name: InheritLName Type: Text, Computed when Composed Formula: LastName

Result: The InheritLName eld is created. 7. 8. 9. Create a rich text eld named Comments. Save your changes. Create an Employee Benets view in order to see the new documents you will create.

240

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms Step 10. 11. Action In the Lotus Notes client, open the Employees view. Select one of the employee documents that you created earlier in the course. Choose Create. Select Employee Benets. Result: A new Employee Benets form opens with the appropriate elds populated from the selected document. 12. 13. Save the new document. Verify that the new document is displayed properly, and that it displays the correct content.

Copyright IBM Corporation 2007.

241

Topic E: Create Related Forms


Lesson 10 Enhancing Forms

Topic E: Create Related Forms


Related Forms
In almost every application there is a need to create information that is related to other information. A typical example of this is a question and answer structure. Another very familiar example is a discussion forum.

Form types
Lotus Domino provides for a main document/response document structure, sometimes referred to as a response hierarchy, by letting the developer designate a forms type. The following table lists the three Lotus Domino form types and how they are used.

Form Type Document

Description This document type is the default for Lotus Domino forms. It is used to create the top level in a hierarchy of documents. These documents are sometimes referred to as main or parent documents. This document type is a child to the Document type. It is referred to as a response document. This document type is a child to the Response document type. It is referred to as a response to response document.

Response

Response to response

242

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

The response hierarchy


The following gure illustrates the relationship between main documents, response documents, and response to response documents.

Figure 10-5: Response hierarchy

Designating a Form as a Response


By default, the form type is Document. To designate that a form is a response or a response to a response, change the Form Type property. The following gure shows the Form Type property.

Figure 10-6: Form Type properties

Copyright IBM Corporation 2007.

243

Topic E: Create Related Forms


Lesson 10 Enhancing Forms

Procedure Reference: Creating a response form


Follow these steps to create a response form.
1. 2. 3.

Create a form or open an existing form in Lotus Domino Designer. Choose DesignForm Properties. On the Form Info tab, select one of the following:

Response for the form to create responses to main documents. Response to Response for the form to create responses to other responses.

4.

Save the form.

Document Relationships
To properly establish the relationship between a main document and a response document, you must have the main document selected in a view or opened when the response is created.

244

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Inheritance and Related Documents


Inheritance is frequently used to transfer information between main and response documents. For instance, in a discussion application you typically repeat the subject of the main document in the response. As with document to document inheritance, the main document must be selected or open when a response is created for inheritance to work correctly.

Threaded Discussions
When developers design any type of main document/response document application, sometimes referred to as a threaded discussion, it is good practice to consider how users keep track of the information in the main document. Using Lotus Domino form properties, the developer can design the response form to: Create a link to the main document in a rich text eld.

Copy the contents of the main document as collapsible rich text. Copy the contents of the main document into a rich text eld.

Linking to the main document takes up much less disk space and is generally the preferred method.

Copyright IBM Corporation 2007.

245

Topic E: Create Related Forms


Lesson 10 Enhancing Forms

Activity 10-3: Create Related Forms


Scenario You realize that a series of steps you need your end users to take are really a part of a larger part of the data entry process; you look for ways to combine those process steps into a single larger component. In this activity, you will make the Employee Benets form a response form and include a link to the parent document. Follow these steps to create related forms.
Step 1. Action Open your copy of the Employee Benets form in Lotus Domino Designer. Result: The form appears in the Work pane. 2. Create a eld with the following characteristics:

Name: ParentDoc Field type: Rich Text and Computed

Result: The new eld is created. 3. Choose DesignForm Properties. Result: The Form Properties box opens. 4. 5. Click the Defaults tab. Select On Create: Inherit entire selected document into rich text eld. Select the ParentDoc eld from the list. Select Link. Result: The form properties are set.

6. 7. 8.

On the Form Info tab, select Response from the Type drop-down list. Save the form. To test your changes, select a document in the Employees view and create an Employee Benets document. Note that there is now a link to the parent document.

246

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic F: Enable AutoSave


The AutoSave Feature
AutoSave is a new feature that allows Lotus Notes documents to be saved at user-specied intervals. AutoSave can be valuable in the event that: The Lotus Notes client crashes.

The user shuts down Lotus Notes improperly. The user loses power.

AutoSave must be enabled in two places: As a Form property by the application designer.

As a User Preference by the Lotus Notes user.

When the AutoSave process is enabled, documents being created or edited are automatically copied to the AutoSave application periodically. The periodic time is set in the users preferences. If Lotus Notes is shut down improperly, the AutoSave application contains the documents that were in process. When the user opens Lotus Notes again, the user is prompted to recover the documents.

The Autosave Application


If AutoSave is enabled, the AutoSave application is created automatically when the user creates a new document or edits an existing one. The application is local and is created from the AUTOSAVE.NTF template. The application is named as_astname.nsf, where astname is the rst initial and last name of the user. Documents in the AutoSave application are removed when they have been properly saved, sent, or discarded. The documents cannot be opened within the AutoSave application.

Copyright IBM Corporation 2007.

247

Topic F: Enable AutoSave


Lesson 10 Enhancing Forms

Procedure Reference: Enabling AutoSave on a form


Follow these steps to enable AutoSave on a form.
1. 2. 3. 4.

Open the form in the Lotus Domino Designer. Open the Form Properties box. In the Options section, select Allow Autosave. Save and close the form.

Procedure Reference: Enabling AutoSave in the Lotus Notes client


Follow these steps to enable AutoSave in the Lotus Notes client.
1. 2. 3.

In the Lotus Notes client, choose FilePreferencesBasic Notes Client Conguration. In the Start Up Options section, enable AutoSave for a time frame such as every two minutes. Click OK. Note: It is not necessary to restart Lotus Notes for the change to take effect.

248

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Activity 10-4: Implement AutoSave


Scenario A data entry area you are designing is a little involved; you are worried that users might lose data and begin looking for ways to capture whatever is entered.

You need to complete the following tasks to implement and test the AutoSave functionality. 1. 2. 3. Enable AutoSave on the form. Enable AutoSave in the Lotus Notes client. Test the AutoSave functionality.

Follow these steps to implement AutoSave.


Step 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Action Open your copy of the Practice application in Lotus Domino Designer. Open the Employee Information form. In the Form Properties box, on the Form Info tab, select Allow Autosave. Save and close the form. In the Lotus Notes client, choose FilePreferencesBasic Notes Client Conguration. In the Startup and Shutdown section, enable AutoSave for every 2 minutes. Click OK. Restart the Lotus Notes client. In the Lotus Notes client, open the Practice application and create a new Employee Information document. Fill out the form. Do not save it, but leave it open until you see the AutoSave complete message in the status bar. It will take about two minutes to appear. Leave the document open. Launch the Task Manager and end the processes nlnotes.exe and ntaskldr.exe.
Note: To launch the Task Manager, press CTRL+ALT+DELETE and click Task Manager.

11.

12. 13.

Launch the Lotus Notes client, and enter your password. When prompted to recover the 1 unsaved document, click No.

Copyright IBM Corporation 2007.

249

Topic F: Enable AutoSave


Lesson 10 Enhancing Forms Step 14. Action Open the AutoSave application. You will have to enter the lename as_SNDnn.nsf in the Open Application dialog box, where nn is your student number. For example, as_SND01.nsf. Right-click the document and choose Document Properties. Switch to the Fields tab to view the elds in the document. Scroll to the top of the list to see those elds specic to the AutoSave functionality. Close the Properties box and the AutoSave application. From the menu, choose FileAutoSaveRecover Autosaved Documents. If necessary, select the document in the dialog box and click Recover. Save the document properly and close it. Open the AutoSave application to see that the document has been removed. Verity that the AutoSaveRecover AutoSaved Documents menu option is grayed out. Close all open windows.

15. 16. 17. 18. 19. 20. 21. 22. 23. 24.

250

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Instant Messaging
The Lotus Instant Messaging product is a powerful tool for enabling team members who are online at the same time to communicate directly with each other. You can use Lotus Domino Designer 8 to integrate Lotus Instant Messaging into your Lotus Domino applications. Here, you will explore some of the options for including Lotus Instant Messaging in a Lotus Domino application. The following gure shows an example of instant messaging. You can see the online status of the users shown in the From and To elds of a Lotus Notes mail document. You can right-click a name and initiate a chat with any user who is active.

Figure 10-7: Instant messaging example For users to use instant messaging functionality, they must be connected to a Lotus Instant Messaging server through a Lotus Notes location document.
Note: Instant messaging functionality is not available for Web applications.

Online Status Display


Names, Authors, and Readers elds can all be enabled for online awareness, so that the eld displays the status of users who are online at the same time. While viewing a document, users can right-click an active name to initiate a chat. The following gure shows the property to select when enabling instant messaging for a eld.

Copyright IBM Corporation 2007.

251

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Lesson 10 Enhancing Forms

Note: You will work with Authors and Readers elds later in the course.

Figure 10-8: Enabling instant messaging for a eld When you open a document, if the author is online, the online indicator will appear beside the authors name, as shown in this gure.

Figure 10-9: The online indicator

252

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Procedure Reference: Enabling Online Awareness for a Field


Follow these steps to enable online awareness for a Names, Authors, or Readers eld.
1. 2. 3. 4.

Open a form in a application in Lotus Domino Designer. Create a Names, Authors, or Readers eld that evaluates to an abbreviated hierarchical name, such as Elizabeth Torrington/East/. Open the Control tab of the Field Properties box, and select the Show Online Status check box. Optionally, enter a Contact List Group label for the users listed in the eld. The label can be either a formula that evaluates to a text string, or you can enter a text string enclosed in quotation marks, such as Sales Team. To test your work, open the application in Lotus Notes. In the view that contains the form, open the document of an active author. You see the online status indicator beside the authors name. Right-click the authors name and click Chat with to open a chat window.

5.

Instant Messaging Contact List


The Instant Messaging Contact List embedded element lets a designer embed an instant messaging contact list in a page, form, subform, or rich text eld of a document. This functionality allows users to see an instant messaging contact list displayed on a page or in a document and to initiate a chat. After embedding the contact list, you can improve the display by setting size and color properties in the Embedded Contact List Properties box, as shown in this gure.

Figure 10-10: Embedded Contact List properties

Copyright IBM Corporation 2007.

253

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Lesson 10 Enhancing Forms

Procedure Reference: Embedding an instant messaging contact list on a form


Follow these steps to embed an instant messaging contact list on a form.
1. 2.

In Lotus Domino Designer, in the appropriate application, create a table on a form and set its properties for how the table displays. With the cursor in the appropriate column in which you want to embed an Instant Messaging contact list, choose CreateEmbedded ElementInstant Messaging Contact List. Adjust the properties of the embedded contact list, as necessary to improve the display of the contact list. Save the form. When you test this functionality, you open a document created with this form. When you double-click the document to put it in edit mode, you should see your embedded contact list in the table.

3. 4. 5.

254

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Lesson Summary
In this lesson, you worked with layers, subforms, instant messaging, and autosave features. By adding increased functionality in gathering and recording data that might require instant communication or multiple levels of information, you can create components that get the job done without bothering users who would otherwise have to use multiple areas of an application or interrupt their work to communicate with co-workers through other means.

Copyright IBM Corporation 2007.

255

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Lesson 10 Enhancing Forms

Lab 10-1: Create Question and Answer Forms in the Policies and Procedures Application
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Scenario The Worldwide Corporation wants to make it easier for employees to ask questions and receive answers about company policies. In this activity, you will create Question and Answer forms. The Answer form needs to inherit information from the Question form. Both forms should have a consistent look and feel. This activity has the following parts:

Use a layer and the mod_menu_background.gif le to enhance the look of the forms. Create a subform to provide a consistent header to both forms. Design and create the Question form. Design and create the Answer form.

Later in the course, you will create a view to display the question and answer documents correctly. Perform the following tasks to complete this lab.

256

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

1. Guidelines for the Question Form

The Question form needs to gather certain information. The following table describes the information to be gathered and lists suggested eld names and types.

Information to Be Gathered The users rst name The users last name The category that the question falls into. The categories are: Office Guidelines Benets Holidays Grievance Procedure

Suggested Field Name and Type FName, Text LName, Text Category, Dialog List with the following choices: Office Guidelines Benets Holidays Grievance Procedure

The subject of the question The question The date the question was created The display category

Subject, Text Question, Rich text QuestionDate, Date-time

DCategory, Text

For the layer, consider setting the Height and Width properties to Auto, to accommodate varying screen sizes. For the subform, consider including the company logo and address. Consider adding a window title to the Question form.

Copyright IBM Corporation 2007.

257

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Lesson 10 Enhancing Forms 2. Guidelines for the Answer form

The Answer form needs to be designed so that it is a functional form for creating an answer (response) to the questions posed using the Question form. Think about the kinds of information that would be helpful. For instance, would it be helpful to have the subject of the question on the answer form? How about a link to the question? Also, the Answer form should have a similar look and feel as the Question form. Use the same colors and graphics used in the Question form. The following table lists suggested information to gather, along with suggested eld names and types.

Information to Be Gathered The subject of the question The date the question was created A link to the question The answer The date the answer was created

Suggested Field Name and Type QuestionSubject, Text QuestionDate, Date-Time QuestionLink, Rich text Answer, Rich text AnswerDate

Consider adding a window title to the Answer form.

3. Create several questions and associated answers.

4. Challenge

Use tables to create a more pleasing, balanced look and feel for the elds and eld labels. Apply any subform you create in this activity to the Policy form as well.

258

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 10 Enhancing Forms

Lab 10-2: Enable Instant Messaging in a Field (Optional Lab)


Scenario The Worldwide Corporation makes every effort to facilitate internal communication and collaboration. Sometimes, employees have questions about policies that might be too specic or sensitive to use the Question and Answer forms, or more information might be needed in order to answer the question completely. Perform the following tasks to complete this lab.

1. On the Question form in your copy of the Policies and Procedures

application, add a Names eld that evaluates to an abbreviated hierarchical name. Name the eld ContactPerson, and have it populated by selecting the name from WWCorps address book. Use input validation to make it a mandatory eld.

2. Enable online awareness for the new eld.

3. Test your changes.


Note: The solution for this activity can be found in Appendix A, Solutions to Practice Activities.

Copyright IBM Corporation 2007.

259

Topic G: Implement IBM Lotus Sametime Instant Messaging in Forms


Lesson 10 Enhancing Forms

Lab 10-3: Embed an Instant Messaging Contact List on a Form (Optional Lab)
Scenario To further facilitate communication and collaboration between Worldwide Corporation employees, you will embed an instant messaging contact list on the Answer form. Perform the following tasks to complete this lab.

1. On the Answer form in your copy of the Policies and Procedures

application, create a singlecell (1x1) xed-width table just below the Answered by text in the eld table. Make the cell three inches wide, and remove all of the table borders.

2. Embed an instant messaging contact list in the new table. Make the list

t to window for both width and height, set the background to yellow, and give it a ridge border with a drop shadow.

3. Test your changes.

4. Close all open windows.

Note: The solution for this activity can be found in Appendix A, Solutions to Practice Activities.

260

Copyright IBM Corporation 2007.

11

Enhancing Views

Topic A: Dene Hierarchical Views Topic B: Display Response Data in Views Topic C: Implement Shared Columns Topic D: Enable IBM Lotus Sametime Instant Messaging in Views Topic E: Create Views for the Web

Copyright IBM Corporation 2007.

Lesson 11 Enhancing Views

Introduction
After completing this lesson, you should be able to: Identify the characteristics of hierarchical views. Describe how view selection formulas can be used to display data from more than one form. Implement shared columns. Enable a column for instant messaging. Create a view for the Web.

262

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Topic A: Dene Hierarchical Views


Hierarchical Views
Earlier in the course, you created Question and Answer forms. Unless you design a view to display this document hierarchy, the documents are not easy to nd and their relationship is not necessarily apparent. A hierarchical view is a view that displays main documents and their associated response documents, and visually distinguishes between them. Each main document has its response documents indented under it. Displaying response documents beneath main documents helps to view the progression of a discussion. Each level is indented three spaces under its parent document.

Procedure Reference: Displaying documents in a hierarchy


Follow these steps to display main documents and response documents in a hierarchy.
1. 2. 3. 4. 5. 6.

Create a view. Write an appropriate selection formula. Set the Show response documents in a hierarchy View property. Create columns to display the data. Create a responses only column for displaying the response documents. Save and test the view.

Copyright IBM Corporation 2007.

263

Topic B: Display Response Data in Views


Lesson 11 Enhancing Views

Topic B: Display Response Data in Views


Default View Display
View columns are structured to display data from elds in the main document. The view displays little, if any, data from response documents. If the response form happens to contain elds with the same names as those specied in the column formulas, that data will appear in the view. Otherwise, the rows representing responses show no meaningful data. To specify information to be displayed about each response document, use a responses-only column.

Responses-Only Columns
A responses-only column displays data from a document only if that document is a response or response to response document. The responses-only column should be positioned to the left of the column under which you want it to indent. The data displayed for a responses-only column starts just to the right of where you position it in the row, and extends to take up the entire row. Note the following about placement of columns: Columns to the left of the responses-only column, such as a date, will display response data (if available in the document) in the row.

Columns to the right of the responses-only column do not appear for response documents; the contents of the responses-only column appear instead.

264

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Procedure Reference: Creating a responses-only column


Follow these steps to add a responses-only column to a view.
1. 2. 3.

Open the view in IBM Lotus Domino Designer. Create a new column to the left of the column under which responses will indent. On the Basics tab of the Column Properties box:

Leave the column title blank. Set the width to 1. Select Show responses only.

4. 5. 6.

Write a column formula that displays information about the response documents in the column, such as subject, authors, and creation dates. Save the view. Test the view by previewing it in IBM Lotus Notes.

Example of a formula used in a responses-only column


Typically, a responses-only column contains information from several elds. The following example formula concatenates two elds and adds static text. Notice that the Date eld has been changed to text.
Subject + " - " + @Text(Date)

Multiple Forms in Views


To this point, the views you have worked with display data using only one form. When using more than one form in a view, the view selection formula must be written to select both of them. The following code is an example of a view formula that uses two forms, Main and Response.
SELECT (Form = "Main") | (Form = "Response")

The code could also be written as:


SELECT Form = "Main" | @AllDescendants

Copyright IBM Corporation 2007.

265

Topic C: Implement Shared Columns


Lesson 11 Enhancing Views

Topic C: Implement Shared Columns


Shared Columns
As with elds and actions, columns can also be shared. By using a shared column, you eliminate the need to create the same column in multiple views or even copy and paste from one view to another. When you insert a shared column, you can choose to use the formula and properties of the column or just the formula.

Procedure Reference: Creating a new shared column


Follow these steps to create a new shared column.
1.

On the Lotus Domino Designer menu, click CreateDesignShared Column. Or, in the Design pane, select Shared CodeColumns and click the New Shared Column button.

2. 3.

Enter a name in the Shared Column Properties box. Optionally, enter an alias and comments. In the Properties box, switch to Column and enter a title for the shared column. Make any additional changes, as desired. All standard column properties are available for the shared column. Note: When you rst create a shared column or when you open it for editing, the Shared Column properties will appear by default. You must switch to the Column properties to make changes to properties such as title and style.

4. 5.

In the Objects pane, select Column value. In the Programmers pane click Simple Function, Field, or Formula, then enter the function, eld, or formula to display in the shared column. Note: When you rst create a shared column or when you open it for editing, the Shared Column Properties box will appear by default. You must switch to the Column Properties to change properties such as title and style.

6.

Save the column.

Procedure Reference: Creating a shared column from an existing column


Follow these steps to create a shared column based on an existing column.
1.

Open the view with the desired column into the Lotus Domino Designer.

266

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views 2. 3. 4.

Select the column to share and choose CreateCopy as shared column or right-click the column and choose Copy as shared column. In the dialog box, enter a name for the new shared column. Click OK to save the column. Note: The column that was used to create the shared column is not affected by any changes to the new shared column.

Procedure Reference: Using a shared column in a view


Follow these steps to insert a shared column.
1. 2. 3. 4.

Open the view where you want to place the shared column in the Lotus Domino Designer. Click an existing column where you want to place the shared column. From the menu, choose CreateInsert New Shared Column or Append New Shared Column. Select the Use Formula Only box if you want to change the formatting of the shared column directly in this view. If selected, any formatting changes you make in this view will not affect other instances of the shared column, and any formatting changes you make to the shared column outside of this view will not be propagated to this instance of the shared column. If you do not select this box at the time of insertion, you will not be able to change the properties of the column inside this view.

Procedure Reference: Editing a shared column


Follow these steps to edit a shared column.
1. 2. 3.

In the Design pane, select Shared CodeColumns and double-click the name of the shared column. Make any desired changes to the shared column in the Column Properties box and in the Programmers pane. Save the changes. When you save the changes, any view using the shared column will be updated. Note: If you change the name of a shared column (not the column title) in the Shared Column Properties box, any view that uses the shared column with the old name will not be updated.

Copyright IBM Corporation 2007.

267

Topic C: Implement Shared Columns


Lesson 11 Enhancing Views

Open for Editing


If a view that uses the shared column is currently open for editing in Lotus Domino Designer at the time you choose to save your changes, you will receive the following message: "A folder or view (ViewName) using this shared column is being edited. Please exit the view or folder before continuing this operation." Note: You can also open a shared column for editing, by selecting the column in a view and choosing DesignEdit Shared Column; however, this process will leave the view open, and when you attempt to save the changes to the shared column, you will receive the above error message.

Procedure Reference: Deleting a shared column


Follow these steps to delete a shared column.
1. 2.

In the Design pane, select Shared CodeColumns. Highlight the name of the shared column to be deleted and press Delete or choose EditDelete. Note: When a shared column is deleted it is not removed from any views where it is used. The column reverts to a standard or unshared column.

268

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Activity 11-1: Create Shared Columns


Scenario In building a series of application components, you realize that a category of information is used in common among several different components. You begin the task of guring out how to share the information so that no further data entry is necessary. Follow these steps to create shared columns.
Step 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Action Open your copy of the Practice application in Lotus Domino Designer. Navigate to Shared CodeColumns. Click New Shared Column. Type SSalary as the column name Switch the Properties box from Shared Column to Column. Type Salary for the column title. In the Programmers pane, set the column to display the Salary eld. Using column properties, center the heading and the value. Save and close the column. Open the Employee Information view. Right-click the Department column, and choose Copy as Shared column. Type SDepartment as the name, and click OK to save the shared column.

Copyright IBM Corporation 2007.

269

Topic C: Implement Shared Columns


Lesson 11 Enhancing Views

Activity 11-2: Insert Shared Columns


Scenario A previously created application component has a data category you need for the component youre currently developing. Follow these steps to insert the shared columns into an existing view.
Step 1. 2. 3. 4. 5. 6. 7. Action In your copy of the Employee information view, delete the last two columns. Select the First Name column. Choose CreateAppend New Shared Column. Select the SDepartment column, Use Formula Only, and Insert. Choose CreateAppend New Shared Column. Select the SSalary column and Insert. Save the view.

270

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Activity 11-3: Modify Shared Columns


Scenario The in-common data category works in one component but needs a little tweaking in another. You look for ways to implement the tweak. Follow these steps to modify shared columns.
Step 1. 2. 3. 4. 5. 6. 7. 8. Action In your copy of the Employee Information view, double-click the Salary column. Notice that all of the properties are greyed out. Choose DesignEdit Shared Column. Switch to Column Properties and click the Advanced Format tab. Change the style to Number. Specify Number Format, 2 Decimal places, and Punctuated at thousands. On the Font tab, right-justify the value. Save and close the shared column. You will need to close the Employee Information view rst. Verify that the format of the Salary column in the Employee Information view uses the new format.

Copyright IBM Corporation 2007.

271

Topic D: Enable IBM Lotus Sametime Instant Messaging in Views


Lesson 11 Enhancing Views

Topic D: Enable IBM Lotus Sametime Instant Messaging in Views


Enabling a Column for Instant Messaging
You can easily enable a view for instant messaging by adding this functionality to a column. The status of IBM Lotus Sametime Instant Messaging users listed in that column is displayed. It is possible to initiate a chat with any user who is online.

Procedure Reference: Enabling a column for instant messaging


Follow these steps to add instant messaging to a column in a view.
1. 2.

Create a column. On the Advanced Format tab in the Column Properties box, from the Style list, click the Names style. Select the following options:

Column contains a name Show online status

3.

Enter a column formula that abbreviates to a name in the abbreviated form of the full hierarchical name. This name is required as a look-up value to retrieve the instant message status for a user.
Note: To reduce the possibility of ambiguous names, you can create a column that displays a users short name and link that column to a hidden column (using the hidden columns programmatic name) containing the abbreviated hierarchical name.

272

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Names and properties


The following gure shows the instant messaging-related column properties.

Figure 11-1: Column properties related to instant messaging

Copyright IBM Corporation 2007.

273

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Topic E: Create Views for the Web


View Display Considerations
The default appearance of a view is functional, but does not have the same graphical appeal that is expected by Web users. Views should be explicitly designed with Web display in mind. The rst step in improving the appearance of the view on a Web page is to embed it in a page.

Embedded Views
Embedded elements are objects and controls that can be embedded on a page, form, subform, or document. Elements that can be embedded include: Views

Folders Outlines Navigators Date pickers Instant Messaging Contact Lists

When you embed a view on a form, subform, page, or document, you can control the size and appearance of a view, especially on the Web. Embedding a view lets you combine views with other form and page elements (such as styled text) and graphics, including a background image le. The generic navigation graphics and links do not appear so that you can replace them with your own.

Procedure Reference: Embedding views in forms and pages


Whether you use a page or a form, use the same process to embed a view. Follow these steps to embed a view in a form.
1.

Choose CreateEmbedded ElementView.

274

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views 2.

Select a view from the list in the current application or from any other application on the server. Note: You can also choose the view at run-time via a formula.

Displaying an embedded view on a form


The following gure shows an embedded view on a form with company identication added.

Figure 11-2: An embedded view on a form

View Display Options


There are three ways to control the display of embedded views on the Web:

Using a Java applet (the view applet) Using HTML Using the views Display property

Displaying an Embedded View using the View Applet


With the Java view applet, Web users can:

Resize columns with sliding panes. Collapse and expand views without the browser regenerating the page. Select multiple documents. Scroll vertically to view additional documents in the view. Press F9 to refresh the view. Press Delete to mark documents for deletion from the application.

Displaying the embedded view using the view applet has advantages and disadvantages. The following table lists some of each.

Copyright IBM Corporation 2007.

275

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Advantages Select multiple items from the list. Can scroll through large lists of items.

Disadvantages Slow to download. May not execute identically on all browsers. Firewall may prohibit applet download.

Data downloaded on demand.

The following gure shows a view applet displayed in a Web browser.

Figure 11-3: A view applet displayed in a Web browser

276

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Procedure Reference: Displaying an embedded view as a view applet


Follow the steps below to display an embedded view as a view applet.
1. 2.

Embed the view in a page or form. Open the Embedded View Properties box and select the Info tab. Result: The following graphic shows the Info tab in the Embedded View Properties box.

3.

Select Using Java Applet in the Web Access Display eld.

Displaying an Embedded View using HTML


Displaying an embedded view using HTML is more universal than the view applet because any Web browser can display it. It is not exible in terms of its capabilities, but it does offer some exibility in appearance. The following gure shows a view displayed using HTML.

Figure 11-4: A view displayed using HTML

Copyright IBM Corporation 2007.

277

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Embedded view properties


The following gure of the Embedded View Properties box shows the display options for an embedded view.

Figure 11-5: Display options for an embedded view The width and height do not affect the display of an HTML view. Many of the other display options, such as Show selection margin, will show up in the resulting HTML view.

Using View Properties to Control the Display of Embedded Views


You can determine how a browser displays a view using the View Properties box. If the view is embedded in more than one form or view, you only need to set the properties once, rather than setting them in form or page where the view is embedded.

278

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

The following gure shows the Advanced tab of the View Properties box.

Figure 11-6: The Advanced tab of the View Properties box

Exploring View Display in the Web Browser


Besides determining how to display your view, you also need to determine other view design effects. Some questions to consider when displaying views in a Web browser are: Which column will be used as the link?

Is there more data than will t on the screen? Will data columns be too close to each other? Are graphics needed in view columns?

Some of the more useful properties of views are functional when the view is displayed in a Web browser, including action buttons and Click on column header to sort.

Copyright IBM Corporation 2007.

279

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Link Columns
An important design aspect of a view is to select a link column. This is the column of the view that behaves as a link when displayed in a Web browser. By default, the rst column is the link column. The following gure shows the Show values in this column as links property.

Figure 11-7: The Show values in this column as links property

280

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Activity 11-4: Embed a View on a Form


Scenario In creating a data entry component for your application, you realize that users will need to look at other data while completing the entry of the data required by the component. Follow these steps to customize the Employee Information view and embed it in a Lotus Domino form.
Step 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Action In Lotus Domino Designer, open the Employee Information view in your copy of the Practice application. Preview the view in your Web browser and note the difficulty in reading it. Open the Employee Information form in the Lotus Domino Designer. Click the table cell. Select CreateEmbedded ElementView. Select Employee Information from the Insert Embedded View dialog box. Click OK. Double-click the embedded view, and then right-click and choose Embedded view to display the Properties box. Display the embedded view Using HTML. Set the view width to 5 inches, and the height to 3 inches. Save your work and preview the form in your browser. Close all open windows.

Copyright IBM Corporation 2007.

281

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Lesson Summary
In this lesson, you worked with hierarchical views, response data, shared columns, and instant messaging features related to views. By adding increased functionality in displaying data that might require instant communication or the display of multiple levels of information, you can create components that get the job done without bothering users who would otherwise have to use multiple areas of an application or interrupt their work to communicate with co-workers through other means.

282

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 11 Enhancing Views

Lab 11-1: Display Response Data in Views


Scenario Now that you have created Question and Answer forms for creating Q&A documents about Worldwides policies, you need to create a view that shows the questions with their corresponding answers in a hierarchical view. In the following activity, you will create a hierarchical view that displays the question and answer documents. Note: Make sure you do this work in your copy of the Policies and Procedures application.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Create a view that displays the subject eld of the question document,

and the date the question was created.

2. Show the subject of the answer document, along with the date the

answer was created, in a single column.

3. Display the questions by category.

Copyright IBM Corporation 2007.

283

Topic E: Create Views for the Web


Lesson 11 Enhancing Views

Lab 11-2: Enable a Column for Instant Messaging (Optional Lab)


Scenario In an effort to improve interoffice communications, the Worldwide Corporation would like to have users on-line statuses displayed within the Policies and Procedures application.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. In the Q&A view of your copy of the Policies and Procedures application,

create a column called Whos Online? Place the new column to the right of the Question column, and make the width at least 18 characters.

2. Enter a formula that abbreviates the full hierarchical name of the contact

person into the column.

3. Set the column style to Names, and set the options for the column to

show online status.

4. Test your work in the Lotus Notes client.

284

Copyright IBM Corporation 2007.

12

Working with Actions


Topic A: Create Actions Topic B: Create Shared Actions Topic C: Control the Display of Actions Topic D: Create Action Hotspots

Copyright IBM Corporation 2007.

Lesson 12 Working with Actions

Introduction
After completing this lesson, you should be able to: Create instant messaging chat action buttons. Insert shared actions. Describe how Web clients display actions. Create action hotspots.

286

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Topic A: Create Actions


Actions
An action is a program associated with either a view or form and used to automate tasks for users. Actions are added to applications in order to: Automate repetitive tasks.

Update information. Simplify the usage of the application. Perform complex calculations. Check for errors. Re-create IBM Lotus Notes menu commands as buttons. For example:

You can use an action to:

Create a document Edit a document Save a document

Mail the current document. Calculate complex formulas that do not need to be saved with individual documents.

Procedure Reference: Checklist: Designing Actions


Before creating an action, you should consider the following checklist.
1. 2. 3. 4. 5.

Dene the purpose of the action. Dene the most appropriate programming language for the action. Dene where the action appears. Dene when the action appears. Dene the actions formatting.

Programming Options Available in Actions


Like other design elements, you can program actions using one of the following options: Simple actions

Formulas IBM LotusScript JavaScript

Copyright IBM Corporation 2007.

287

Topic A: Create Actions


Lesson 12 Working with Actions

Note: Simple actions cannot be customized and are not supported in Web applications.

Action Display
Actions in a view are available to users when the view is opened. Actions in a form are available when a document created with the form is displayed, or a new document is created with the form. Users access actions either from: The Lotus Notes Actions menu command.

An Action bar button.

The Action bar is a row of buttons across the top of a form or view. To execute an action from the Action bar, users simply click the button.

The Action Pane


The Action pane displays the actions available to a particular form or view. You can select an action from the Action pane in order to open, edit, or delete the action. The following gure shows the Action pane for a form.

Figure 12-1: A forms Action pane

288

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Action Properties
Like other IBM Lotus Domino Designer features, actions are modied using their properties box. The following gure shows the Action Properties box.

Figure 12-2: The Action Properties box

Copyright IBM Corporation 2007.

289

Topic A: Create Actions


Lesson 12 Working with Actions

Activity 12-1: Create An Edit Action


Scenario The component you are working on will have a couple of modes: not only will it display the information you want users to see, it will also enable the users to modify the information. You look for a way to enable the users to change between the see and modify modes. Follow these steps to create a button on the Employee Information form that will allow users to edit documents.
Step 1. 2. 3. 4. Action Open the Employee Information form in your copy of the Practice application in Lotus Domino Designer. Choose CreateActionAction from the menu. In the Action Properties box, name the action Edit Employee Info If necessary, select the following display options:

Type: Button Include action in Action Bar Include action in Action menu

5.

Select the following hide/when options. Hide action when document is:

Previewed for editing Opened for editing

6. 7.

Ensure that Client and Formula are selected in the Programmers pane. In the Script area of the Programmers pane, type the formula: @Command([EditDocument])

8.

Save the form and test the action on an existing document.

290

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

System Actions
By default, new forms and views do not contain actions. Lotus Domino Designer provides a set of predened system actions for common tasks. System actions can be added to a form or view. The following is a list of IBM Lotus Domino system actions: Categorize

Edit Document Send Document Forward Move to Folder Remove from Folder

System actions cannot be modied and do not translate to Web applications. You can create your own actions to perform the same functions using the Formula language instead.

Procedure Reference: Inserting system actions


Follow these steps to insert system actions into a form or view.
1. 2.

Open the form or view in Lotus Domino Designer. Choose CreateActionInsert System Actions. Result: The system actions are added to the Action pane.

3.

Save the form or view.

Copyright IBM Corporation 2007.

291

Topic A: Create Actions


Lesson 12 Working with Actions

@Commands
@Commands are special functions that simulate the functionality of Lotus Notes menu commands. For example, use @command ([Compose]) to create a button that creates a new document based on a specic form. The syntax for using @commands is: @Command([command];parameters);

Commonly used @commands


The following table contains examples of commonly used @commands.

@Command Compose

Function Creates a new document with the specied form. Saves the current document. Closes the current window. Opens the currently selected document for editing.

Example @Command ([Compose];"Response")

FileSave

@Command ([FileSave])

FileCloseWindow

@Command ([FileCloseWindow])

EditDocument

@Command ([EditDocument])

Note: To Web-enable all action buttons in a application as well as certain @commands, select the application property Web access: Use JavaScript when generating pages. Without this property set, Lotus Domino recognizes only the rst button in a document and treats it by default as a Submit button that closes and saves the document.

292

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Order of Evaluation for @Commands


Lotus Domino evaluates formulas from top to bottom and left to right, completing each statement before proceeding to the next. @commands are evaluated in one of two ways: as encountered or after all @functions. In most cases, the @command runs in the order specied in the formula. For example, the following is an abbreviated list of @command functions that are evaluated as encountered or immediately.

Evaluated After All @Functions EditClear EditProle FileCloseWindow FileExit ViewChange Clear

Evaluated Immediately

EditProleDocument CloseWindow ExitNotes SwitchView

Creating Instant Messaging Chat Action Buttons


Lotus Domino Designer includes @functions and @commands that developers can use to integrate instant messaging into their Lotus Domino applications. The following table describes these instant messaging-related @functions and @commands.

@Function or @Command @GetIMContactListGroupNames

Description Returns the group names in the instant messaging contact list. Adds a name or names to a personal group in an instant messaging contact list. Initiates a chat with one or more users. Toggles the on/off display of the instant messaging contact list.

@Command([AddToIMContactList])

@Command([SendInstantMessage])

@Command([ShowHideIMContactList])

Copyright IBM Corporation 2007.

293

Topic B: Create Shared Actions


Lesson 12 Working with Actions

Topic B: Create Shared Actions


Shared Actions
Shared actions are actions that you create as resources for the entire application. Once you create a shared action, you can insert it in multiple views and forms. If you modify the action, the modication applies to every form or view that refers to it.

Procedure Reference: Creating a shared action


Follow these steps to create a shared action.
1. 2. 3. 4. 5.

Open the application in Lotus Domino Designer. In the Design pane, click Shared Code. Then, click Actions. Click New Shared Action. The Shared Actions Properties box opens. Create the shared action as you would any action. Save the shared action.

294

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Shared Action Properties


A shared action has the same properties as a standard action. You set the properties when you create the shared action. These properties determine how the action will behave in every form or view that uses it. The only property you can change on each form or view is the actions position on the Action bar.

Procedure Reference: Inserting a shared action on a form or view


Follow these steps to insert a shared action on a form or view.
1. 2.

In Lotus Domino Designer, open the form or view where you want to use the shared action. If you are designing a view, choose CreateInsert Shared Action from the menu. If you are designing a form, choose CreateActionInsert Shared Action.

3. 4.

Select the shared action you want to insert. Click Insert. Click Done. Result: The shared action is inserted into the Action pane.

5.

Preview the form or view, and test the action.

Copyright IBM Corporation 2007.

295

Topic C: Control the Display of Actions


Lesson 12 Working with Actions

Topic C: Control the Display of Actions


Sub Actions
There are a couple of ways to enhance the display of actions. This section examines how to: Create actions with sub actions.

Customize the Action bar.

Sub actions group related actions under a single main menu choice or button. Use sub actions if you have: A long list of actions and do not want to overwhelm users.

Related actions that you want to group together. Very little space left in the Action bar and want to avoid requiring the user to scroll horizontally.

Procedure Reference: Adding sub actions to a form or view


Follow these steps to add sub actions to a form or view.
1. 2.

Open the form or view you want to modify. Choose CreateActionAction with Sub Action. Result: An untitled action is created as a placeholder for the new sub action. To name this action placeholder, open its Properties box.

3. 4. 5. 6.

Enter a name for the sub action. Program the sub action. Save and preview the form or view. To add more sub actions, select the placeholder, then choose Create Action.

Action Order
Actions and sub actions appear in the order in which they were created. You can rearrange this order in a more logical sequence.

296

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Procedure Reference: Rearranging action order


Follow these steps to rearrange the order of actions and sub actions.
1. 2. 3. 4. 5.

Open the form or view with actions in Lotus Domino Designer. Open the Action pane. Click the action or action header. Click and drag the action to a different position. Save and preview the form or view.

Hiding Actions and Action Buttons


As with other form or view elements, you can conditionally restrict the availability of an action using the actions Hide/When properties. These are the same Hide/When properties available to other design elements. Use these properties to make an action visible when it is relevant. For example: Hide an action that edits a document when the document is in Edit mode.

Hide an action that saves a document when the document is in Read mode.
Note: Hide/When formulas execute when the document or view with which the action is associated is refreshed.

Procedure Reference: Hiding action buttons


Follow these steps to hide an action or action button.
1. 2. 3. 4. 5. 6.

Open the form or view. Select the action. Choose DesignAction Properties. Click the Action Hide When tab. Select the appropriate options. Save and preview the form or view.

Copyright IBM Corporation 2007.

297

Topic C: Control the Display of Actions


Lesson 12 Working with Actions

Action Buttons, Split Action Buttons, and Right-click Menus


Within your applications, you can now specify split action buttons on the action bar. This enables you to group related actions together in one place, under one action button. You can program your applications to use one main action button that contains sub-actions. This is similar to a traditional drop-down menu, except the items are all related in some way to the main action button and are customizable. The items on the right-click menu are now also customizable within the view properties. As you build your applications you can customize the options to be suited for a specic application and available on the right-click menu. The following is an example of the Shared Action properties dialog box.

Figure 12-3: The Shared Action properties box

298

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Action Bar
The Action bar displays action buttons at the top of a form or view. Lotus Domino gives you the option of changing some of the Action bars properties. To alter the Action bar, you can: Change the Action bars appearance by specifying:

Alignment options for action buttons. Background image or color for buttons on the bar. The style and color of the bottom border.

Enable the Lotus Domino Action bar applet for Web users.

Actions that appear on the button bar use the Action Bar Properties box to set additional characteristics, such as font, color, and button size.

Procedure Reference: Changing Action Bar Properties


Follow these steps to enhance the look of an Action bar.
1. 2. 3.

Open the form or view in Lotus Domino Designer. Select any action in the Action pane. Choose DesignAction Bar Properties from the menu. Result: The Action Bar Properties box opens.

4.

On the Action Bar Info tab:


Select the button bar alignment. Select how to display the button bar for Web users. Select the button bar size. Select the button bar background color. Select the button bar background image and how it is displayed. Select the button bar border style and effect. Select button size. Select button display options. Select button background color or image.

5.

On the Action Bar Size tab:

6.

On the Action Bar Background tab:


7.

On the Action Bar Border tab:

8.

On the Button Properties tab:


The changes affect all buttons on the Action bar.

Copyright IBM Corporation 2007.

299

Topic C: Control the Display of Actions


Lesson 12 Working with Actions 9.

On the Button Font tab:

Select the font properties for all buttons on the Action Bar.

10. Close the Action Bar Properties box.

Web Access
In the Action Bar Properties box, you can use a Java applet for Web access. The Java applet: Provides a scroll bar, when needed.

Looks like the Action bar in the Lotus Notes client. Supports cascading actions. When the user clicks the main action, the action selections appear as a second row of slightly smaller buttons.

Procedure Reference: Enabling the Action Bar applet


Follow these steps to enable the Action bar as an applet.
1. 2. 3.

Open the Action Bar Properties box. In the Basics tab, select Using Java Applet under Web Access Display. Close the Action Bar Properties box.

300

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Topic D: Create Action Hotspots


Hotspots
Action hotspots are programmable areas on a form, subform, or page that can complete an automated task. Hotspots can be associated with:

Text Graphics

Procedure Reference: Creating an action hotspot


Follow these steps to create an action hotspot.
1. 2. 3.

Open a form, subform, or page. Click and drag to select the text or image to be associated with a hotspot. Choose CreateHotspotAction Hotspot. Result: An Action Hotspot Properties box appears.

4. 5. 6. 7.

In the Run area of the Programmers pane, select either Web or Client from the list. Select a programming language from the code list. Enter the code in the Programmers pane. Save and preview the form, subform, or page.

Copyright IBM Corporation 2007.

301

Topic D: Create Action Hotspots


Lesson 12 Working with Actions

Lesson Summary
In this lesson, you worked with actions. By learning what actions are and how to use them, you can automate data entry and processing tasks that would be redundant and inefficient for users to have to undertake.

302

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 12 Working with Actions

Lab 12-1: Create Instant Messaging Action Buttons in a View (Optional Lab)
Scenario The Worldwide Corporation would like to add buttons to the All Documents view in the Policies and Procedures application to provide users with the ability to contact document authors and to show/hide online status icons.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. In the Q&A view of the Policies and Procedures application, create an

instant messaging chat action button called Chat. Use the @command SendInstantMessage.

2. Create a second instant messaging chat action button called Show/Hide

Contacts, using the @command ShowHideIMContactList.

3. In the Lotus Notes client, open the Q&A view, and conrm that the but-

tons are present and functional.

Copyright IBM Corporation 2007.

303

Topic D: Create Action Hotspots


Lesson 12 Working with Actions

Lab 12-2: Add Automation to the Policies and Procedures Application


Scenario Worldwide Corporation would like to automate creating and editing documents in the Policies and Procedures application. Users should be able to:

Create a policy or a question from the Policies view. Edit a policy when the document is open. Create a question or an answer from the Q&A view. Edit a question or an answer either when a document is open or selected in the Q&A view. Save any of the documents by clicking a button instead of using menu commands.

Perform the following tasks to complete this lab.


Note: A guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

1. Create a categorized Policies view, showing Category Policy Number,

title, and Effective Date.

2. Make a list of actions you need to create and where they are to be

used.

3. Determine which of them could be shared.

4. Create the actions and add them to the appropriate views and forms.

5. Hide the actions at the appropriate times. For instance, if a document is

in Edit mode, there is no reason for the Edit action to be available.

6. Close all open windows.

304

Copyright IBM Corporation 2007.

13

Working with Agents


Topic A: Investigate Agents Topic B: Create Agents

Copyright IBM Corporation 2007.

Lesson 13 Working with Agents

Introduction
After completing this lesson, you should be able to: Identify the relationship between agents and the documents they can process. Generate agents.

306

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

Topic A: Investigate Agents


Agents
Agents are programs within an IBM Lotus Domino application that perform a series of automated tasks. The benets of using agents include: Agents can run manually by users or automatically in the background as scheduled agents.

Agents are not associated with a specic design element. Agents can be run on a specic server, on several servers, on workstations, or on the Web. Agents can call other agents. Agents can consist of simple actions, formulas, IBM LotusScript, or Java programs. Agents can be distributed easily because they can be replicated. Agents can be shared or private. Agents are often triggered by the server.

You can use agents to set up user-activated or background tasks that run on a schedule. You can use agents to run automated tasks for views, documents, elds, and applications.

Actions versus agents


Agents are different from actions in that:

Form and view actions work only when the form or view is open. Agents are not restricted to a specic form or view. Use agents to set up user-activated tasks or background tasks in any part of a Lotus Domino application.

Examples of agents
Use agents to:

Update a group of documents. Archive documents. Send messages and documents. Run other agents.

Copyright IBM Corporation 2007.

307

Topic A: Investigate Agents


Lesson 13 Working with Agents

Types of agents
There are two types of agents:

Shared agents are agents created by one user and can be run by other users or scheduled to run on the server. Private agents are agents that users create for themselves. Users cannot run another users private agent. Private agents are stored on the machine where the agent is created.

Once an agent is created, its type can be changed from shared to private, and vice versa, at a later date. This could be used to test a new agent on a live application before it is distributed generally.

Parts of an agent
The following table describes the parts of an agent.

Part Trigger Target Program

Function Species when the agent program should run. Selects documents the agent program acts upon. Species the code to execute.

308

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

The Agent Work pane


The following gure shows the Agent Work pane and the Agent Properties box.

Figure 13-1: The Agent Work pane and the Agent Properties box

Agent Properties
Use options in the Agent Properties box to dene an agent to run:

Manually or automatically. Against all documents or a subset of documents in a application.

Copyright IBM Corporation 2007.

309

Topic A: Investigate Agents


Lesson 13 Working with Agents

The Agent Properties box


The following gure identies parts of the Agent Properties box.

Figure 13-2: The Agent Properties box

The Agent Basics Tab


In addition to naming an agent and determining its trigger and target, the Basics tab of the Agent Properties box has a few more options. The following table lists these options and their functions.

Option Store search in search bar menu Store highlights in document Run in background client thread

Function Displays the search query in the search bar.

Search matches are highlighted in the searched documents. Runs an agent in the background without having to wait until it completes. Note that you should check this option only if the agent (or the top-level agent that calls this agent) is triggered by On event - Action menu selection. To get the full benet of this feature, the application should reside on a server and the agent must be invoked via the client.

310

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

Procedure Reference: Designing an agent


Before creating an agent, you should consider the following checklist.
1. 2. 3. 4.

Decide what the agent is to accomplish. Decide when it should run. Dene what documents it should run against. Decide where the agent is going to run.

Programming Options
Agents can run any of the following types of programs:

Simple functions Formula LotusScript Java

You can program an agent to do almost anything in an application.

Common formula agent tasks


Two common tasks in formula agents are to:

Rene which documents the agent processes. Update elds in documents.

Copyright IBM Corporation 2007.

311

Topic A: Investigate Agents


Lesson 13 Working with Agents

The SELECT Statement


Formula-based agents run iteratively on the target documents. The number of documents that an agent processes directly affects the time it takes to execute the agents formula. To limit the target documents, use the SELECT statement. The syntax for using SELECT is as follows:
SELECT logicalexpression

The following example selects only documents created using the Employee Information form:
SELECT Form="Employee Information"

If you do not include a SELECT statement in the formula, IBM Lotus Domino Designer appends the following formula to your code:
SELECT @All

Generally, a SELECT statement must be the rst statement in a formula. SELECT @All is the only one that can be placed at the end of a formula.

Field Updates
Agents can add new elds to existing documents or modify existing elds. To do this, use the keyword FIELD in a formula. FIELD is a reserved word used to add a value to a new or existing eld. The syntax for using FIELD is as follows:
FIELD fieldname := value

The following example changes the LastName eld value to Sunshine:


FIELD LastName := "Sunshine"
Note: If the LastName eld does not exist in the document, it is created and given the value Sunshine. The eld does not become visible unless you add it to the form design, but you can access it by naming it in formulas.

312

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

Agent Activation
Once you have decided what the agent will do, you need to determine how you want it activated. The following table describes design options for when the agent runs.

Agents Can Run Manually

Example By the user via the Actions menu in the Lotus Notes client. If documents have been created or modied.

When triggered by an event According to a schedule

Every day at 1:00 AM.

Agent Events
The following table describes the events that can trigger an agent and examples of when to use them.

Event Before new mail arrives

When to Use It Before mail is deposited in the mail application; for example, to delete unwanted mail. Once new mail is delivered to the client; for example, to forward mail while a user is on vacation. To update new or existing documents; for example, to change an area code for phone numbers. When copied documents are pasted into the application and need to be modied as they are being pasted; for example, to add the current date to the document. The agent is manually activated by the user or is a Web Query Save or Web Query Open agent. The agent is run only by another agent or is still under development and you need to hide it from the users.

After new mail arrives

After documents are created or modied When documents are pasted

Action menu selection

Agent list selection

Copyright IBM Corporation 2007.

313

Topic A: Investigate Agents


Lesson 13 Working with Agents Event When server starts When to Use It If you want an agent to be called when the server starts, but also at other times while the server is running, use the agent list selection trigger and create a separate agent triggered when the server starts that calls that agent.

Scheduled Events
The following table lists when agents can be scheduled to run.

Schedule More than once a day

Used for Critical tasks that are run frequently. Any agent, regardless of how frequently it is run, can severely affect a servers performance. Important tasks that are not as high priority as critical tasks; for example, sending a company-wide e-mail. Routine tasks; for example, calculating a departments sales performance. Low-priority tasks; for example, deleting older documents. Agents that you do not want to run in particular circumstances; for example, agents that run on the Web or agents that are disabled or called by other agents. Regular administrative tasks, such as statistics gathering, that must occur when the server starts.

Daily

Weekly

Monthly

Never

When server starts

Note: In most circumstances, you should schedule the running of agents based on the business need for having the work accomplished in a proper time frame.

Document Processing
Options for which documents the agent processes depend on when the agent runs.

314

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

The following table shows examples of which documents different agents can process.

An Agent that Runs Manually from the Actions menu


Can Process Documents that users select.

All documents in a view. All documents in the application.

When triggered by an event According to a schedule

Only new and modied documents.

All documents in the application. New documents and documents modied since the last run of the agent.

Note: SELECT statements in Formula language, as well as other statements in LotusScript and Java, can modify all documents in the application.

Copyright IBM Corporation 2007.

315

Topic B: Create Agents


Lesson 13 Working with Agents

Topic B: Create Agents


Agent Names
Agent names within the same application need to be unique. However, if the same agent is used in several different applications, use the same agent name to help users recognize the agents purpose. Agent names: Are case-sensitive.

May include letters, numbers, spaces, and punctuation. Should be self-descriptive. Should be short, if appearing as items on the Actions menu.

The names you give to manually run agents appear as options on the Actions menu. Use an alias (an internal name for an agent) when naming an agent. This allows you to change or translate the name that users see without disabling formulas that reference the original name.

Procedure Reference: Creating an agent


Create the agent after you have dened what your agent should do as well as when and where it should run. Follow these steps to create an agent.
1. 2. 3. 4. 5. 6. 7. 8. 9.

Open the application in Lotus Domino Designer. Select Agents under the Shared Code design element. Click New Agent. Name the agent and add a comment, if desired. Select the agent option Shared or Private. Select the agent trigger On Event or On Schedule. Select the appropriate agent trigger option from the list. Select the appropriate documents for the agent to target from the Target option list. Close the Agent Properties box.

10. Select the appropriate programming type from the list. 11. Enter the programs code into the Programmers pane. 12. Save and test the agent.

316

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 13 Working with Agents

Lesson Summary
In this lesson, you worked with agents. By learning what agents are and how to use them, you can automate data entry and processing tasks that would be redundant and inefficient for users to have to undertake.

Copyright IBM Corporation 2007.

317

Topic B: Create Agents


Lesson 13 Working with Agents

Lab 13-1: Update Existing Documents


Scenario So far, you have either left the policy number blank on Policy documents, or made one up. In this lab, you will write an agent that computes a policy number for all existing policies. The policy number should be formatted as PN999999 where the characters PN are the rst two characters in the policy number, and 999999 is calculated based on the rightmost six characters of the documents unique ID.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Write a formula that computes the policy number and saves the new

policy number in the PolicyNo eld.


Note: Look up the @DocumentUniqueID.

2. Make the agent run on all existing policy documents.

3. Run the agent and check the results.

4. Challenge

Modify the Policy form so that it computes a new policy number when a new Policy document is created.

5. Close all open windows.

318

Copyright IBM Corporation 2007.

14

Securing Applications

Topic A: Explore Application Access Topic B: Implement Roles Topic C: Use Readers and Authors Fields Topic D: Control Access for Anonymous Users

Copyright IBM Corporation 2007.

Lesson 14 Securing Applications

Introduction
After completing this lesson, you should be able to: Describe user types. Use a formula to set the Hide/When property for a eld. Create an Authors eld. Identify access levels for high-security applications.

320

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Topic A: Explore Application Access


Application Security Overview
Until this point, the focus of your application design has been on building an application that meets the needs of the users. Now that the process is near completion, application security becomes more critical. This includes securing the application from unauthorized entry as well as restricting user access within the application. As you learned earlier in the course, the layered security model of IBM Lotus Domino provides many ways to customize security to the application and its content. Non-physical access restriction begins at the network level. Once a user has been authenticated at this level, the next restriction is at the server level. Typically, network administrators and system administrators congure and maintain these two levels. Once a network and server admit a user, that user encounters access restrictions or controls at the database level. Typically, Lotus Domino application managers congure and maintain this level using Access Control Lists (ACLs).

Access Control Lists


Every Lotus Domino application includes an Access Control List. Manager access is required to modify the ACL. Managers of a Lotus Domino applications add users (individually or in groups) to the ACL and assign them a certain access level that entitles them to work within the application. When users attempt to open an application, Lotus Domino refers to the Access Control List to determine their privileges within the application. The following gure shows the Access Control List dialog box.

Copyright IBM Corporation 2007.

321

Topic A: Explore Application Access


Lesson 14 Securing Applications

Note: Physical security is also an important part of any security plan. You must secure access to the server, the devices that access the server, and any storage media that holds backed-up data.

Figure 14-1: The Access Control List dialog box

The Access Control List dialog box


There are four panels in the Access Control List dialog box. The following table lists each panel and its function.

This Panel Basics Roles Log

Is Where the Domino Application Manager Assigns users, groups, and servers their levels of access. Creates user roles. Views a history of the last 20 changes made to the Access Control List. It also tracks who made the changes and what was done. Performs advanced security tasks.

Advanced

322

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Access Control Levels


The following table lists each access control level and the privileges it gives to a user.

Access Control Level No Access Depositor

Privileges No access to the application at all. Depositors can create documents, but cannot read, edit, or delete documents, including those they create. Readers can read documents, but cannot create, edit, or delete documents. Authors can create and read documents, but cannot edit documents unless specied in the document itself. Editors can create, read, and edit all documents unless there are restrictions on specic documents. Designers can perform the same functions as an Editor, except where restrictions exist on specic documents. Designers also can modify the application design, but cannot delete the application or change its ACL. Managers can perform all functions, including creating and modifying the ACL and deleting the application.

Reader

Author

Editor

Designer

Manager

User Identiers
The Lotus Domino Directory is like a phone book of all the users and servers in the Lotus Domino environment. System administrators set up user names and groups of users that developers can use when dening access to applications. The application manager adds individual user names, group names, and server names to the ACL of the application to control access to the application.

Copyright IBM Corporation 2007.

323

Topic A: Explore Application Access


Lesson 14 Securing Applications

The Access Control List denes access rights for users in four ways. The following table describes the purpose of each option.

Option/ Description Default

Denes Access for Any user who is not specically listed in the ACL (individually or in a group). A list of people who can all access the same functionality in the application. If a user is a member of two groups, and both groups appear in the ACL, the user receives the higher access level. A specic IBM Lotus Notes or Web user. This will override settings for any group to which the individual belongs. Any unauthenticated Lotus Notes or Web user. If there is no Anonymous entry in the Access Control List, unauthenticated users will use the Default access level.

Groups

Individual names

Anonymous

User Access Levels


The following are some examples of setting user access levels.

In Order to Prevent unknown users from accessing the application Grant anyone the ability to read documents Allow all users in the Students group to modify the application Preview your forms in a Web browser, as you are working on the application design

Set Default to No Access.

Anonymous to the Reader access.

Students to Designer access.

Anonymous to Reader access.

Displaying an Applications Access Control List


Any user with access to a application is able to see its ACL.

324

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Procedure Reference: Displaying an applications ACL


Follow these steps to display the ACL of a application
1. 2.

Select or open the application in either the IBM Lotus Notes client or IBM Lotus Domino Designer. Choose FileApplicationAccess Control from the menu. Result: The Access Control List dialog box appears.

Access Options
Each access level has up to eight options that Lotus Domino application managers can turn on or off, further rening users privileges. For example, you can control whether users with Editor access can delete documents.

Copyright IBM Corporation 2007.

325

Topic A: Explore Application Access


Lesson 14 Securing Applications

The following table describes the default and optional access privileges and which levels they are associated with.

Access Level No Access

Automatic Privileges None

Optional Privileges Read public documents Write public documents Read public documents Write public documents Create private agents Create personal folders/views Create LotusScript/Java agents Write public documents Create documents Delete documents Create private agents Create personal folders/views Create LotusScript/Java agents Write public documents Delete documents Create private agents Create personal folders/views Create shared folders/views Create LotusScript/Java agents Delete documents Create LotusScript/Java agents

Depositor

Create documents

Reader

Read public documents

Author

Read public documents

Editor

Create documents Read public documents Write public documents

Designer

Create documents Create private agents Create personal folders/ views Create shared folders/views Read public documents Write public documents Create documents Create private agents Create personal folders/ views Create shared folders/views Create LotusScript/Java agents Read public documents Write public documents

Manager

Delete documents

326

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Enable the read and write public documents options to give users with No Access or Depositor access limited access to specic forms, views, and documents.

User Types
User types specify whether a name in the ACL is a person, server, or group. They can protect your application from the following scenario. Chris Jones opens the ACL to the Policies and Procedures application and notes that Terry Smith has Editor access.

Chris Jones gets access to the server, creates a group called Terry Smith, and adds himself to the group. Chris Jones now has access to the Policies and Procedures application as part of the group Terry Smith.

One way to prevent this is to designate Terry Smith as an individual with the Person user type. The following table lists each user type, to whom it can be assigned, and what it does.

User Type Person

Assigned to An individual user, including individuals on a server workstation. A single server, including a server console and server workstation.

Description Enforces access as a single user.

Server

Prevents someone from accessing the application from a Lotus Domino workstation using the server ID. Identies a group of servers that will host replicas of the application. Grants Person access to each user in a group without listing each user in the ACL. Grants the same access to a group of users and servers. Has Lotus Domino look up the user type in the Address Book.

Server Group

A group of servers.

Person Group

A group of individual users.

Mixed Group

A group of servers and individual users. Any user, group, or server.

Unspecied

The application manager applies user types to meet the access restrictions.

Copyright IBM Corporation 2007.

327

Topic B: Implement Roles


Lesson 14 Securing Applications

Topic B: Implement Roles


Roles
Roles provide a way to dene a group within the application. Users and groups are assigned roles to rene access to particular views, forms, documents, or sections. Instead of assigning access to specic users and groups, assign access to the role. Roles are functional after being: Dened in the ACL.

Used in a design element.

Advantages of using roles


Some of the advantages of using roles are that they:

Provide a exible method of restricting access to a specic set of users. Can be used in formulas. Provide a method to dene a set of users within an application. Do not need to be maintained or added as a group in the organizations Lotus Domino Directory. Make it unnecessary to modify the application when users leave or new users join. Can be assigned to multiple groups and users in the ACL, which can simplify application development and maintenance.

Dening Roles
Dening a role in the ACL is a two-step process: 1. Create the role in the ACL. 2. Assign roles to users or groups.

328

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Procedure Reference: Creating a role in the Access Control List


Follow these steps to create a role in the ACL.
1.

Choose FileApplicationAccess Control. Result: The Access Control List box opens.

2. 3.

Click Roles in the Contents pane. Click Add. Result: The Add Roles dialog box appears

4. 5.

Enter a name for the role. The name may be up to 15 characters long. Click OK. Result: The Role name appears in brackets in the Roles list.

Procedure Reference: Assigning roles to users


Once a role is created, assign it to the appropriate users or groups listed in the ACL. Follow these steps to assign roles to users or groups.
1. 2. 3. 4.

Open the application in either the Lotus Notes client or Lotus Domino Designer. Choose FileApplicationAccess Control. Highlight any entry in the Name list. Select a Role from the Roles dialog box. Result: A check mark appears beside the Role selected.

5.

Click OK. Once roles have been assigned to users, you can use them to determine what users can do or see in the application.

Access Control
Incorporate roles into formulas to control access to parts of the application and to dene responsibilities within the application. By using the name of the role in a formula, rather than actual user names, you simplify the construction of the formula and make the application easier to maintain.

Copyright IBM Corporation 2007.

329

Topic B: Implement Roles


Lesson 14 Securing Applications

You can apply roles to further rene control within the application. For example, with roles, you can control who can: Access specic views and folders.

Create documents. Read the documents. Edit the documents. Access portions of a document.

This section shows how to write a formula to determine who can see a specic design element based on a role. This involves capturing the current users role and comparing it in a Hide When formula.

@Functions and Roles


Use the following functions to capture the current users role(s).

Function @UserRoles @UserNamesList

Returns A text list of the roles for the current user. A text list including the current user name, any groups for the current user, and any roles for current user. A list of specic roles on all the desired applications regardless of where the application is located.

@UserRoles

Comparing the Users Role


Once a users role is determined, it needs to be compared against a list. The formulas course of action is based upon whether or not the role matches an entry on the list. Use the @IsMember function to determine if a user has a specic role. This function determines if a text string matches an item in a text list. The syntax for using @IsMember is:
@IsMember(textValue; textListValue);

Use the @IsNotMember function to determine if a text string does not match an item in a list. The syntax for using @IsNotMember is:

330

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications @IsNotMember(textValue; textListValue);

The following table provides some examples of using @IsMember and @IsNotMember.

Example @IsMember("[Student]"; @UserRoles) !@IsMember("[Student]"; @UserNamesList) @IsNotMember("[Student]"; @UserRoles)

Returns True, if the current user is assigned the Student role True, if the current user is not assigned the Student role True, if the current user is not assigned the Student role

The following information is presented to support the previous table:


All roles assigned through the application ACL begin and end with square brackets, as shown in the examples above. There is a system-assigned role, $$Web Client, that automatically appears whenever the user is connected to the application through a Web browser. It does not contain the square brackets. It can be used to affect screen presentation and logic in applications used with both the Lotus Notes client and Web browsers. Roles do not function on a local replica of a application unless the advanced ACL check box Enforce a consistent Access Control List across all replicas is selected.

Copyright IBM Corporation 2007.

331

Topic B: Implement Roles


Lesson 14 Securing Applications

Procedure Reference: Using a formula to set the Hide/When property


Follow these steps to hide a eld with a formula.
1. 2. 3. 4.

Open the design elements Properties box. Click the Paragraph Hide/When tab. Select Hide paragraph if formula is true. Enter a formula that evaluates to True (1) or False (0).
Caution: Using Hide When to hide the contents of a eld does not provide true security. Users can still see the contents of the eld by using the Document Properties box. Use encryption to secure the data in a eld for Lotus Notes clients.

332

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Topic C: Use Readers and Authors Fields


Document Access
Individual documents sometimes contain sensitive information. Lotus Dominos layered security model provides mechanisms to restrict access to a document. The following table lists what methods control who can create, read, and edit documents.

Access Read access to documents

Controlled by Read access lists Readers elds

Edit access to documents

Authors elds Controlled Access sections

Create access

Form property: Show in Create menu Create access lists Action buttons

This section focuses on using Readers and Authors elds to control document access.

Copyright IBM Corporation 2007.

333

Topic C: Use Readers and Authors Fields


Lesson 14 Securing Applications

Readers Fields
A Readers eld restricts readership of a document to those users and servers that are listed in the eld. It is a special type of multiple-value text eld designed to interact with the Access Control List (ACL). By specically listing users, groups, and roles in a Readers eld, you can control who can read individual documents. This can be very useful in a scenario requiring an approval process. With a Readers eld, you can restrict access to any documents that are not approved; if the documents are approved, the restrictions are unnecessary.

How Readers elds work with the ACL


Entries in a Readers eld cannot give a user more access than what is specied in the ACL; they can only further restrict access. Users with No Access cannot gain access to a application even if their names are listed in a Readers eld in a document in that application. For example, users with Editor access or above in the ACL can be restricted from reading documents that have a Readers eld if their names are not included in that eld. The names in Readers elds must be the full Notes hierarchical names (example: Elizabeth Torrington/East/WWCorp) to prevent the possibility of two people with the same name (in different locations or containers) from being able to read the documents in question.
Note: This type of access control always works when the application is on a server. However, it only works on a local application when the advanced ACL check box Enforce a consistent Access Control List across all replicas is selected.

Viewing documents with Readers elds


When Lotus Domino builds a view, it indexes all documents that meet the selection criteria, regardless of whether those documents contain a Readers eld. When that view is displayed: Documents that do not contain a Readers eld are visible to all users.

Documents with a Readers eld are only visible to users listed in the Readers eld. Other users do not see those documents. In a categorized view, categories that exist only in invisible documents will not appear if the row check box Dont show empty categories is selected. If the check box is not selected, the category will be displayed, but the documents associated with it will not appear.

Thus, you may not need to alter the view to hide certain documents from general viewing.

334

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Specifying Readers
Entries in a Readers eld must compute to a text value. Designers and managers specify readers in a Readers eld by using one of the following methods: Write a formula to compute user names, roles, or groups. This is the most frequently used option, as it allows designers to predetermine the readers. For example:
"[Policy Managers]" : "Suzy Sunshine" : "Managers"

Make the eld editable, so application Authors and Editors can select and change readers.

Procedure Reference: Creating a Readers eld


Follow these steps to create a Readers eld.
1. 2. 3.

Open a form in Lotus Domino Designer. Create a eld, selecting Readers as the eld data type. Specify the readers.

Authors Fields
Users with Author access to a application may be able to create and read documents. By default, they cannot edit documents (not even the documents they create themselves). For users with Author access to edit the documents they create, they must be listed in an Authors eld in the document.

Copyright IBM Corporation 2007.

335

Topic C: Use Readers and Authors Fields


Lesson 14 Securing Applications

This section describes how to use an Authors eld to dene editing capabilities for users with Author access to the application. An Authors eld is a type of eld that works in conjunction with the Author access level in the applications Access Control List. Authors elds do not override the settings in the Access Control List. They offer developers more control over which users can edit data in the application. Users with an access level that gives them edit privileges (Editor or higher) can edit any document that they can see, even if their names are not in the Authors eld of a document. Similarly, users with a level of No Access cannot edit a document, even if their names are in the Authors eld.

When to create an Authors eld


Include an Authors eld on the form to store the name of the user when the document is created. An Authors eld can store one or more user names or groups and can be editable or computed. Most Authors elds need to permit multiple values.

336

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

How Authors and Readers Fields Work Together


The following table is a representative sample of the possible permutations of access control within an application.

ACL Level

Authors Field Exists and User Is in It Yes No No Yes No No Yes No No Yes No No

Readers Field Exists and User Is in It No Yes No No Yes No No Yes No No Yes No

Can Read Document

Can Edit Document

Author Author Author Manager Manager Manager Editor Editor Editor Reader Reader Reader

Yes Yes No Yes Yes No Yes Yes No Yes Yes No

Yes No No Yes Yes No Yes Yes No No No No

As with Readers elds, you can compute the value of an Authors eld, or allow the user to select Authors for the document. Use the @UserName function to capture the name of the current Lotus Notes user. You can use this function to dynamically compute the value of an Authors eld.

Copyright IBM Corporation 2007.

337

Topic C: Use Readers and Authors Fields


Lesson 14 Securing Applications

Procedure Reference: Creating an Authors eld


Follow these steps to create an Authors eld.
1. 2. 3.

Create a eld on the form from which the documents will be created. In the Field Properties box, on the Basics tab, select Authors as the eld type. Select one of the following to determine when the eld obtains its value:

Editable allows those who create the document to designate who can edit the document. Computed lls in the value based on a formula each time the document is refreshed. Computed when composed will evaluate only if the data does not already exist. This value is computed only once. Computed for display. Because they do not store an item or a value in a note, Computed for display is not appropriate for this type of eld.

4.

Enter a formula to calculate the value of the eld. Note: Computed elds must have a formula. Editable elds can use a formula to calculate a default value that the user can change.

338

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Topic D: Control Access for Anonymous Users


Anonymous Users
Users who have Internet or intranet access to an application cannot be identied by Lotus Notes in the way Lotus Notes users are identied. Lotus Domino provides ways for you to determine the maximum Internet name and password access level.

Procedure Reference: Setting up anonymous access


Follow these steps to allow anonymous users to access a application.
1. 2. 3. 4.

Open the application in Lotus Domino Designer. Open the applications Access Control List. Add an entry for the group Anonymous. Assign the access level you want to give to anonymous users.

Low-Security Access Control Lists


The following table illustrates an ACL for a low-security discussion application.

Web User -DefaultAnonymous Supervisors Maximum Internet name and password access Author Author Editor Editor

Access Level

Copyright IBM Corporation 2007.

339

Topic D: Control Access for Anonymous Users


Lesson 14 Securing Applications

High-Security Access Control Lists


The following table illustrates an ACL for a high-security condential application.

Web User -DefaultAnonymous Authorized readers Contributors Supervisors Maximum Internet name and password access No Access No Access Reader Author Editor Reader

Access Level

340

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Lesson Summary
In this lesson, you received an overview on application security. By becoming familiar with the different levels of security, how they interact with each other, and how they together protect data integrity and privacy, you can create applications that are able to manage important information requiring protection from unwanted users.

Copyright IBM Corporation 2007.

341

Topic D: Control Access for Anonymous Users


Lesson 14 Securing Applications

Lab 14-1: Set Access Restrictions to the Application


Scenario Worldwide Corporations Policies and Procedures application is almost ready to be deployed. However, security levels have not been established for all the different types of users. In this group activity, you will work with the rest of the class to determine the access control levels required for the appropriate users. Perform the following tasks to complete this lab.

1. Working with the instructor and the rest of the class, plan the ACL. For the Default user type, the used. access control level should be

2.

For the Anonymous user type, the be used.

access control level should

3.

For the Employees group, the used.

access control level should be

4.

For the Policy Makers group, the used.

access control level should be

5.

For the Department Head, the

access control level should be used.

6.

For the Managers group, the used.

access control level should be

7.

For the Designer, the

access control level should be used.

8. Observe as your instructor modies the ACL for the Policies and Pro-

cedures application, and saves the le as PoliciesACL.nsf

342

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications 9. Make a new copy of the Policies and Procedures application in the

Fundamentals folder on the classroom server (Hub/SVR/WWCorp). Append your student## to the end of the application name and the le name. (Example: For student01, name the application Policies and Procedures 01, and the le Policies ABC.nsf. You will use this copy later in this lesson.

10. Set your access control level to Manager.

Copyright IBM Corporation 2007.

343

Topic D: Control Access for Anonymous Users


Lesson 14 Securing Applications

Lab 14-2: Create Roles


Scenario In this activity, you will create roles for the Policies and Procedures application and assign these roles to different users. For example, there are policy makers who should be able to view all documents and assign questions to the appropriate experts.
Note: The guided solution to this activity can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Determine appropriate roles for the application. You will do this in con-

junction with the instructor and the rest of the class.

Role

Description

2. Create the roles in your copy of the Policies and Procedures ## appli-

cation, where ## is your student ##.

344

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 14 Securing Applications

Lab 14-3: Control Access to Documents in the Policies and Procedures Application
Scenario In this lab, you will control access to documents in the Policies and Procedures application based on the following:

All employees should be able to read any document in the application. The people who create documents should be able to edit them. Members of the Managers and Policy Makers groups should be assigned the PWriters role. Only people assigned the PWriters role should be able to create Policy documents. All employees can create Question documents. Only the person who creates a Question should be able to modify it. Only PWriters should be able to create and edit Answers.
Note: The guided solution to this lab can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. This activity involves making changes to the ACL and the Policy, Ques-

tion, and Answer forms. Determine the changes that need to be made and implement them.

2. Work with other students to help test that your application works as

expected.

3. Close all open windows.

Copyright IBM Corporation 2007.

345

15

Deploying Applications

Topic A: Deploy Applications

Copyright IBM Corporation 2007.

Lesson 15 Deploying Applications

Introduction
After completing this lesson, you should be able to: Describe replica creation.

348

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 15 Deploying Applications

Topic A: Deploy Applications


The Deployment Process
Before deployment begins, applications are tested during development in the development environment and then previewed. However, productionlevel testing may also occur. There are a number of ways to control application maintenance. The standard recommended technique uses three templates: A production template, which contains the design of the production application. You update the production application with the production template.

A development template, which you use to perform updates and bug xes. Once you nish testing the modications, you replace the production template with the development template. A backup template, which is the previous version of the production template. You want this in case you need to roll back to the previous version. Make a backup of the production template before you replace it with the newer development template. Many sites store multiple versions of the backup template.

A possible workow that involves templates could look something like the following: 1. Development NSF new copy without documents to Development .NTF.

Check for prohibit design check marks before the copy. Add new group ACL entries with square brackets. Fill out template name information to make a template and check the Advanced Template checkbox as appropriate. Resign the database template with a signing ID.

2. 3.

Copy via the O/S to the test environment.

Create a new database from the new template (or replace the design to test an applcation upgrade).

Create any categories needed to get started. Test until satised. Create a new application or replace the design of the existing application, whichever is the more applicable.

4.

Copy the template to production and resign as needed.

Copyright IBM Corporation 2007.

349

Topic A: Deploy Applications


Lesson 15 Deploying Applications

Procedure Reference: Rolling out an application


Follow these recommended steps to roll out a new application.
1. 2. 3. 4.

Create a template out of the new application. Create a new application from the newly created template. Modify the ACL of the new application so that it will be properly secured and replicate correctly. Create a new replica of the application on the server.
Note: You might also need to disable any scheduled agents that can interfere with production or send mail erroneously.

Procedure Reference: Updating the design of an application


Follow these recommended steps to update an application design.
1. 2. 3.

Update the design of the template. Refresh the design of the local application. Test. Replicate with the server to replicate the design changes. Test.

Templates
A template is an IBM Lotus Domino le that contains the design structure for a Lotus Domino application. File extensions differ for applications and templates. The le extension for a Lotus Domino application is .NSF. The le extension for a Lotus Domino template is .NTF. When you use a template to create a application, like you did earlier in the course, the application receives the design elements from the template. IBM Lotus Notes and Lotus Domino ship with several standard application templates. While some are included to provide the design for necessary system applications (log.ntf, catalog.ntf, and so on), others embody the design of valuable business applications. You can create an application from a standard template, customize the standard templates to meet your needs, or create a custom template from scratch. Examples of standard Lotus Domino templates include: Discussion

Document Library Personal Journal Personal Address Book

350

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 15 Deploying Applications

Master Templates
Design templates let you isolate the design and development of an application from the production environment. By managing application design modications using a master design template, you avoid disruption to an application that has been deployed.

Procedure Reference: Creating a master design template


Follow these steps to create the master design template:
1. 2. 3.

Extract the design elements of your application to a new application. Designate the new application as a template. Once the template is created, link your application to the application template.

Procedure Reference: Extracting the design from the application


Follow these steps to extract the design elements to another application, which will become the master design template.
1. 2. 3. 4. 5.

Select the application in either Lotus Notes or IBM Lotus Domino Designer. Choose FileApplicationNew Copy. Select the location to store the new application. Enter a title. Enter a le name with the NTF extension. Note: The NTF le extension does not make the le a template. It simply causes it to appear as a choice in the list of templates when you create a new application.

6. 7.

Click Specify What to Copy: Database design only. If necessary, uncheck Access Control List. If you do not copy the ACL, any Roles that the application might depend on will be lost.

Procedure Reference: Turning a application into a template


Follow these steps to turn a application into a template.
1. 2. 3. 4.

Select or open the application. Open the Properties box. Click the Design tab. Click the check box to enable the Database le is a master template property.

Copyright IBM Corporation 2007.

351

Topic A: Deploy Applications


Lesson 15 Deploying Applications 5.

Enter a name for the template. This name is different from the name or title of a application. The template name is the link between the template and the application or applications, and it is a property of the template le.

Procedure Reference: Linking the application to the master design template


Once you create the master design template, follow these steps to link it to your application.
1. 2. 3. 4. 5.

Select or open the application. Open the Database Properties box. Click the Design tab. Click to place a check mark next to Inherit design from master template. Enter the name of the template.

Replication Control
You were introduced to the replication process and its effects on applications earlier in the course. This section describes the following three ways of controlling the data that replicates: Controlling server access to the application

Readers of a document Replication settings of the application

352

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 15 Deploying Applications

Controlling server access to the application


The data that replicates is dependent on the rights of who is doing the replicating, not which server holds the application. The following table describes the effects of ACL settings on replication.

Server Access Level in the Replica application ACL No Access Depositor

Effect on Replication

No replication occurs. No documents ow with depositor access. The server cannot send new documents because it cannot see which documents are new. Server can receive changes, but cannot send changes. Server can send the following changes: New documents created since last replication. Modications to documents that list the replicating server (or user) in an Authors item. If the server is replicating changes, and it has Author access to the replica application, the server must be listed in the Authors item for replication to occur.

Reader

Author

Editor

Server can send all new documents and changes to existing documents. Server can send all new and modied documents and design elements. Server can send all new and modied documents, design elements, and the ACL.

Designer

Manager

Readers and replication


Documents that contain Readers items must list the replicating server as well as users. The server must be able to read the document to replicate it. If the server is not listed as a reader or as an author of the document, the document will not replicate.

Replication Settings
Replication settings allow a further renement of which documents are going to replicate between any two servers, and between client and server. The following table describes these settings.

Copyright IBM Corporation 2007.

353

Topic A: Deploy Applications


Lesson 15 Deploying Applications

Group Space Savers

Settings Remove documents not modied in the last n days Include specic Address Book elds Replicate a subset of Documents

Send

Do not send deletions made in this replica to other replicas Do not send changes in application title and catalog info to other replicas Do not send changes in local security property to other replicas

Other

Temporarily disable replication Scheduled replication priority Only replicate incoming documents saved or modied after a particular date or a CD-ROM publishing date

Advanced

Replicate a subset of Documents between specied servers or specied client and server Replicate specic types of design elements

Procedure Reference: Creating replicas manually


Follow these steps to create a replica manually.
1. 2. 3. 4. 5. 6.

Open the application. Choose FileReplicationNew Replica. Select the destination server (server on which to place the replica). Keep the default le name and title for the new replica. Select Create: Immediately. Select Copy Access Control List to copy the ACL from the original to the new replica. Click OK.

354

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 15 Deploying Applications

Lesson Summary
In this lesson, you received an overview on how to deploy an application. By becoming familiar with how applications are deployed to users, you can avoid costly mistakes and lost labor that might otherwise occur when application components that have not been adequately tested improperly store and manage data.

Copyright IBM Corporation 2007.

355

Topic A: Deploy Applications


Lesson 15 Deploying Applications

Lab 15-1: Create a Design Template and a New Application


Scenario Now that the Worldwide Policies and Procedures application has been designed, developed, and tested, it is time to make a design template from the application and prepare to deploy the application.
Note: The guided solution for this lab can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Create a local template from the Policies and Procedures ABC appli-

cation you created during the course. Name it Policies ABC Template, where ABC is your initials.

2. Create a new, local, Policies and Procedures application from the tem-

plate.

3. Make sure that the application is set to inherit future design changes

from the template.

356

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development


Lesson 15 Deploying Applications

Lab 15-2: Roll out the Policies and Procedures Application


Scenario In this lab, you will make modications to the Policies and Procedures application that will allow for proper replication of the application. You will also test the application.
Note: The guided solution for this lab can be found in Appendix A, Solutions to Practice Activities.

Perform the following tasks to complete this lab.

1. Modify the ACL of your Policies and Procedures application so that all

documents and design changes will replicate.

2. Create a new replica of your Policies and Procedures application

locally. Be sure to embed your initials in the le name.

3. Create some new documents in the server copy of the application. Rep-

licate with the local copy to show that the documents replicate properly.

4. In the template, change the design of the Policy form. Perhaps modify

the background or header.

5. Refresh the design of your local Policies and Procedures application.

Open an existing Policy document to see the new change.

6. Lastly, replicate the Policies and Procedures application from local to

server in order to see that the design change replicates.

7. Close all open windows.

Copyright IBM Corporation 2007.

357

Topic A: Deploy Applications


Lesson Follow-up

Follow-up
In this course, you were introduced to the fundamental concepts needed to perform basic application development in IBM Lotus Domino 8. In addition, that knowledge has prepared you to obtain the additional knowledge needed for building more complex applications in Lotus Domino 8.

Whats Next?
This course is the rst in a series of application development courses. The material in Building Applications for the Web using IBM Lotus Domino Designer 8 provides the knowledge needed to develop Web applications in Lotus Domino Designer 8.

358

Appendix
Solutions to Practice Activities

Copyright IBM Corporation 2007

Appendix
Appendix A Solutions to Practice Activities

About This Appendix


The appendix provides detailed, step-by-step solutions to the hands-on portions of the lesson labs for this course. For solutions to activities included elsewhere in the course content, please see the Solutions section of the student guide.

Lesson Lab Solutions


The lesson lab solutions appear in the order in which the material is presented in the course content.

360

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-1: Solution for Lesson Lab 4-1: Create a Page


Scenario Worldwide Corporation is in the process of creating organizational policies. They need a Policies and Procedures application to create and store policy documents for their employees. This application also needs a page that gives people an overview of the company. To complete this lab:

Build a new application. Create shared images. Create a page. Modify the Information page.

Follow these steps to create the Policies and Procedures application.


Step Build a new application. 1. 2. Open Lotus Domino Designer. Choose FileApplicationNew. Result: The New Database dialog box appears. 3. 4. Accept the default of Local to create the application on the local computer. Type the title Policies and Procedures for the application. Result: Policies and Procedures appears in the Title box. 5. Type the le name Policies_##.nsf where ## is your student number. Result: The renamed application name appears in the le Name box. 6. 7. Select -Blank- from the template list. Click OK. Result: The new application is created. Create shared images. 8. 9. Click Shared Resources in the Design list. Click Images. Result: A list of shared images appears in the Work pane. 10. In the Work pane, click New Image Resource. Result: The Open dialog box opens. Action

Copyright IBM Corporation 2007

361

Appendix
Appendix A Solutions to Practice Activities Step 11. Action In the Open dialog box, browse for and select the following image les and click Open.

LOGO WW1.gif bluerule.gif

Result: The images are added to the shared resources list. Create an Information page. 12. 13. Click Pages in the Design list. Click New Page. Result: A new, blank page opens in the Work pane. 14. Choose DesignPage Properties. Result: The Page Properties box opens. 15. 16. Name the page Information and close the Page Properties box. Save the Information page.

Modify the Information page 17. With the cursor in the Information page, choose CreateTable. Result: The Create Table box opens. 18. Create a xed width table with two rows and one column. Click OK. Result: A table with two rows and one column is created. 19. Click in the top cell and choose CreateImage Resource. Result: The Image Resource dialog box opens. 20. Select the LOGO WW1.gif le and click OK. Result: The Worldwide logo is added to the rst cell. 21. Click in the bottom cell and type the following; 123 Worldwide Blvd. Metropolis, PA 45555 Result: Worldwides address appears below the company logo. 22. Click below the table. Choose CreateImage Resource. Result: The Image Resource box opens. 23. Select bluerule.gif. Click OK. Result: The bluerule.gif image is added below the table.

362

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 24. Action Click below the bluerule.gif image. Type the following text: About us: Worldwide is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives who work from their homes. Result: The text is added to the page. 25. Save and preview the page.

Copyright IBM Corporation 2007

363

Appendix
Appendix A Solutions to Practice Activities

Activity A-2: Solution to Lesson Lab 5-1: Create a Form that Contains a Table and Fields
Scenario Worldwide Corporation is in the process of creating organizational policies. You have already created your copy of the Policies and Procedures application and Information page. In this lab, you will create the form that will be used to enter the companys policies and procedures. To complete this lab: Create a new form.

Format the Policy form.

Follow these steps to create a form that contains a table and elds.
Step Create a new form. 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer. In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar. 3. 4. 5. In the Work pane, click New Form. Choose DesignForm Properties. The Form Properties box opens. Type Policy in the Name eld. Result: Policy appears in the Name box. 6. Close the Form Properties box. Action

Format the Policy form. 7. Type Policies and Procedures at the top of the form. Result: The text appears on the form. 8. Press Enter several times to move the cursor below the title text. Result: The cursor ashes to indicate its position. 9. Click and drag to highlight the text. Choose TextText Properties. Result: The Text Properties box opens. 10. Change the font style and size. For example, Arial Black, 14 pts. Navy Blue. Result: The title text reects the changes.

364

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 11. 12. 13. Close the Text Properties box. Click below the title text to position the cursor where you would like the table to appear. Choose CreateTable. Result: The Create Table box opens. 14. Create a Basic table with the following options:

Action

5 rows 2 columns Fixed Width

Click OK. Result: The table appears on the form 15. Type the following eld labels in the cells of the rst column:

Policy Number: Policy Title: Effective Date of the Policy: Policy Description: Category:

Result: The eld labels appear in each cell in the rst column. 16. 17. Click in the cell to the right of the rst eld label, Policy Number. Choose CreateField to create a eld with the following characteristics:

Field name: PolicyNo Field type: Text, Editable

Result: The PolicyNo eld is created in the rst cell of the right column. 18. Click in the cell to the right of the Policy Title eld label. Create a eld with the following characteristics:

Field name: PolicyTitle Field type: Text, Editable

Result: The PolicyTitle eld is created in the right column. 19. Click in the cell to the right of the Effective Date of the Policy eld label. Create a eld with the following characteristics:

Field name: EffectiveDate Field type: Date/Time, Editable

Result: The EffectiveDate eld is created in the right column.

Copyright IBM Corporation 2007

365

Appendix
Appendix A Solutions to Practice Activities Step 20. Action Click in the cell to the right of the Policy Description eld label. Create a eld with the following characteristics:

Field name: PDescription Field type: Rich Text, Editable

Result: The PDescription eld is created in the right column. 21. Click in the cell to the right of the Category eld label. Create a eld with the following characteristics:

Field name: Category Field type: Dialog List, Editable

Result: The Category eld is created in the right column. 22. On the line below the new Category eld, in the same cell create a eld with the following characteristics:

Field name: DCategory Field type: Text, Computed for display

Result: The DCategory eld is created in the right column. 23. Select the Category eld and click the Control tab. Enter the following in the Choices box:

Office Guidelines Benefits Holidays Grievance Procedures

Result: The category choices are created. 24. Select the Category eld. Click the Paragraph Hide/When tab and select to Hide paragraph when document is:

Previewed for reading Opened for reading Printed

Result: The Category eld will not be seen when the document is in Read mode. 25. Select the DCategory eld. Click the Paragraph Hide/When tab and select to Hide paragraph when document is:

Previewed for editing Opened for editing

Result: The Display Category eld will not display when the document is being edited. 26. Close the Field Properties box.

366

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 27. Action Type the following formula in the Programmers pane of the DCategory eld: Category Result: The option selected in the Category eld will display in the DCategory eld when the document is in Read mode. 28. Save and test the form in the Lotus Notes client.

Copyright IBM Corporation 2007

367

Appendix
Appendix A Solutions to Practice Activities

Activity A-3: Solution to Lesson Lab 6-1: Create a Categorized View


Scenario Worldwide Corporation wants to provide a new way of organizing its policies and procedures in the Policies and Procedures application. The view should do the following: List documents created with the Policy form.

Display the title of the policy and its effective date (in that order). Organize the documents by the type of policy (Guidelines, Holidays, and so on). Create a categorized view. Create a categorized column.

To complete this lab:


Follow these steps to create a categorized view.


Step Create a categorized view 1. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Result: The application opens in the Work pane. 2. 3. In the Design pane, click Views. In the Work pane, click New View. Result: The Create View dialog box opens. 4. Name the view Policies and click OK. Result: The Policies view appears in the view list. 5. Open the Policies view. Result: The Policies view opens in the Work pane. 6. Click Add Condition at the bottom of the View Programmers pane. Result: The Add Condition dialog box opens. 7. Select By Form from the Condition list. Result: A list of the forms in the Policies and Procedures application appears. 8. Select the Policy form. Click Add. Result: The Policy form appears in the Programmers pane. Action

368

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 9. Action Double-click the rst view column to open the Column Properties box. Set the following options on the Column Info tab:

Title: Policy Width: 25

10.

In the Programmers pane, select Field. Select the PolicyTitle eld. Result: The rst column displays the policy titles.

11.

Choose CreateAppend New Column to add a column to the right with the following options:

Title: Effective Date Width: 10 Field: EffectiveDate Style (Advanced Format tab): Date/Time

12.

Clear Display Time. Result: A column displaying the policy effective date appears to the right of the Policy Name column.

13.

Save and preview the view.

Create a categorized column. 14. Open the Policies view in Lotus Domino Designer. Result: The Policies view opens in the Work pane. 15. Choose CreateInsert New Column to add a column to the left with the following options:

Title: Width: 1 Show twistie when row is expandable

Result: A new blank column is inserted to the left of the Policy column. 16. 17. Click the Font tab and select Blue (0,0,255) for the text color. Click the Sorting tab and select the following options:

Sort: Ascending Type: Categorized

18.

In the Programmers pane, select Field. Select the Category eld. Result: The document categories are listed in the Work pane.

19. 20.

Save and refresh the view. Create a few more documents for this view by choosing Create DocumentPolicy.

Copyright IBM Corporation 2007

369

Appendix
Appendix A Solutions to Practice Activities

Activity A-4: Solution to Lesson Lab 8-1: Create a Dynamic Title


Scenario Worldwide Corporation would like to customize the titles displayed to users when they open certain documents in the Policies and Procedures application. To complete this lab:

Create a dynamic title for the Policy form.

Follow these steps to create a dynamic title.


Step Action

Create a dynamic title for the Policy form 1. Open the Policy form in Lotus Domino Designer. Result: The form appears in the Work pane. 2. On the Objects tab, select Window Title. Result: The Programmers pane is empty. 3. In the Script area, type the following formula: @If(@IsNewDoc;"New Policy"; PolicyTitle) Result: When users create a new policy, the title will display New Policy. When users open or edit an existing document created with the Policy form, the title will display the content of the PolicyTitle eld. 4. Save the form. Result: Lotus Domino Designer stores the changes in the application. 5. Preview the form. Result: The title should display as New Policy. 6. Open an existing Policy in Lotus Notes. Result: The policys name is displayed in the title.

370

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-5: Solution to Lesson Lab 8-2: Automate Data Entry and Formatting
Scenario You need to automate data entry and formatting in the Policy form. The following list details the functionality that Worldwide would like to incorporate into the application: The policy title should be formatted using title case.

Create a eld to capture the date the policy is created. This date should be displayed without the time element. Name it PolicyCreatedDate. The effective date should calculate to one month from the date the policy is created in order to account for an internal review process. This date should also be displayed without the time. When a policy is created, the document should not be saved unless it contains a title and category. Make sure PolicyTitle is entered in proper case Have Lotus Domino automatically enter the documents entry date and display the date only Calculate the EffectiveDate of the policy based on the PolicyCreatedDate Verify that certain elds contain a value before allowing a document to be saved

To complete this lab:


Follow these steps to automate data entry and formatting.


Step Action

Make sure PolicyTitle is entered in proper case 1. 2. Open the Policy form in Lotus Domino Designer. Click the PolicyTitle eld. Result: The PolicyTitle eld and its objects appear in the Objects list. 3. In the Script area, type the following formula in the Input Translation object for the eld: @ProperCase(PolicyTitle) Result: The formula appears in the Script area. 4. Save and test the form.

Have Lotus Domino automatically enter the documents entry date and display the date only 5. Place the cursor in the third row of the table on the Policy form.

Copyright IBM Corporation 2007

371

Appendix
Appendix A Solutions to Practice Activities Step 6. Choose TableInsert Row. Result: A blank row is inserted above the Effective Date row. 7. In the left cell, type the eld label: Created Date: Result: The text appears in the left cell. 8. Move the cursor into the right cell. Choose CreateField. Result: The Create Field box opens. 9. Name the eld PolicyCreatedDate with the following options:

Action

Field type: Date/Time, Computed when composed

Result: The PolicyCreatedDate eld is added to the right cell. 10. Select the Value object for the PolicyCreatedDate eld.

11.

In the Script area, type: @Created Result: The formula appears in the Script window.

12.

Open the Field Properties box and click the Control tab. Ensure that Display Time is not selected. In the Show list, verify that Only month, day and year is selected. Result: The Control tab of the Field Properties box is displayed.

13.

Save and test the form.

Calculate the EffectiveDate of the policy based on the PolicyCreatedDate 14. 15. Open the Policy form in Lotus Domino Designer. Click the EffectiveDate eld. Result: The EffectiveDate eld and its objects appear in the Objects list. 16. Open the Field Properties box. Change the eld from Editable to Computed. Result: The eld type is changed to indicate that the eld is going to be computed. 17. In the Script area, enter the following formula in the Value object for the eld: @Adjust(PolicyCreatedDate;0;1;0;0;0;0) Result: The formula appears in the Script window. 18. Save and test the form.

Verify that certain elds contain a value before allowing a document to be saved

372

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 19. Action In Lotus Domino Designer, click the PolicyTitle eld. Result: The PolicyTitle eld and its objects appear in the Objects list. 20. In the Script area, type the following formula in the Input Validation object of the eld: @If (PolicyTitle =NULL; @Failure("Please enter a Policy Title.");@Success) Result: The formula appears in the Script area. 21. Implement input validation for the Category eld. Use the following formula: @If (Category =NULL; @Failure("Please select a Category.");@Success) Result: The formula appears in the Script area. 22. Save and preview the form to test the formulas.

Copyright IBM Corporation 2007

373

Appendix
Appendix A Solutions to Practice Activities

Activity A-6: Solution to Lesson Lab 8-3: Compute a List of Choices for a Field
Scenario To make the Policies and Procedures application easier to maintain over time, create a view that contains the policy categories in the rst column. When a policy is created or edited, the categories should be displayed from the Categories view. In order to accomplish this:: Create a Category form with a eld named Category.

Create Category documents with the following categories:


Office Guidelines Benets Holidays Grievance Procedures Security E-mail Etiquette Diversity

Create a view called Categories that only displays the Category documents. Modify the Policy form to perform a lookup to the Categories view to produce the list of the Category eld. Hint: The view should only display documents with the Category form.

Follow these steps to compute a list of choices for a eld.


Step Create a Category form 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer. In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar. 3. In the Work pane, click New Form. Action

4.

Choose DesignForm Properties. Result: The Form Properties box opens.

374

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 5. Action Type Category in the Name eld. Result: Category appears in the Name eld. Note: It is a good idea to give the form an alias. 6. Close the Form Properties box.

7.

Enter the eld label Category at the top of the page.

8.

Choose CreateField to create a eld with the following characteristics:


Field name: Category Field type: Text, Editable

Result: A eld named Category is created. 9. Save the form and test in the Lotus Notes client.

Create documents using the Category form. 10. 11. Open the Lotus Notes client. Choose FileOpenLotus Notes Application. Browse for and open your copy of the Policies and Procedures application. Result: The application opens. 12. Choose CreateCategory to create a document using the Category form. Result: The Category form opens. 13. Type Office Guidelines in the Category eld. Save and close the document. Result: The document closes. 14. Add the following categories:

Benefits Holidays Grievance Procedures Security E-mail Etiquette Diversity

Result: Six additional documents are created using the Category form. Create the Category view to display documents using the Category form 15. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Result: The application opens in the Work pane.

Copyright IBM Corporation 2007

375

Appendix
Appendix A Solutions to Practice Activities Step 16. In the Design pane, click Views. Action

17.

In the Work pane, click New View. Result: The Create View box opens.

18.

Name the view Categories. Click OK. Result: The Categories view appears in the view list.

19.

Open the Categories view. Result: The Categories view opens in the Work pane.

20.

Click View Selection in the Objects tab. Result: The View Selection object opens.

21.

Click Add Condition in the View Programmers pane. Result: The Add Condition dialog box opens.

22.

Select By Form from the Condition list. Result: A list of the forms in the Policies and Procedures application appears.

23.

Select the Category form. Click Add. Result: Uses Category form appears in the Programmers pane.

24.

Double-click the rst view column to open the Column Properties box. Modify the column as follows:

Name: Category Width: 25

Result: The default column displays Category in its header and is 25 characters wide. 25. In the Programmers pane, select Field. Select Category from the list of elds in the application. Result: The Category column displays the content of the Category eld. 26. Save and preview the view.

Build a list of keyword choices from the Category view 27. Open the Policy form in Lotus Domino Designer. Result: The form appears in the Work pane. 28. Click the Category eld and open the Field Properties box.

29.

Result: The Field Properties box opens.

376

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 30. Click the Control tab. Action

31.

In the Choices list, select Use formula for choices.

32.

In the Choices text box, delete the existing choices and type the following formula in the formula window: lutype := "Notes":"NoCache"; db := @DbName; View := "Categories"; col := 1; keylist := @DbColumn(lutype; db; view; col); @If(@IsError(keylist); "No Entries in view"; keylist)

33.

Save and test the form.

Copyright IBM Corporation 2007

377

Appendix
Appendix A Solutions to Practice Activities

Activity A-7: Solution to Lesson Lab 8-4: Create Reusable Code


Scenario To ensure that certain elds are populated on the Policy form in your copy of the Policies and Procedures application, create reusable code that checks to see if a value is entered in the Policy Number and Policy Title eld. Follow these steps to create reusable code.
Step Create reusable code 1. In your copy of the Policies and Procedures application, open the Policy form in Lotus Domino Designer. Result: The Policy form opens in the Work pane. 2. Select the PolicyNo eld. In the Programmers pane, on the Object tab, select Input Validation. Action

3.

In the Programmers pane, enter the following formula: @If(@ThisValue="";@Failure("Please enter a "+@Replace Substring(@ThisName;"Policy";"Policy ")+".");@Success) Result: The formula returns the message, Please enter a Policy No. if the eld is left empty.

4.

Reuse this formula by copying it and pasting it as an Input Validation formula for the PolicyTitle eld. Result: The formula returns the message, Please enter your Policy Title if the eld is left empty.

5.

Save and preview the form in Lotus Notes.

378

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-8: Solution to Lesson Lab 8-5: Implement Error Interception


Scenario The Worldwide Corporation frequently updates their company policies and would like to allow for internal review of any modications. Revise the Policies and Procedures application to allow for a one month review period before the policy is implemented, and to intercept run-time errors before they need to be handled. Follow these steps to implement error interception.
Step Implement error interception 1. In your copy of the Policies and Procedures application, open the Policy form in Lotus Domino Designer. Action

2.

Insert another row in the table between Created Date and Effective Date of Policy.

3.

Label the new row Modications to the Policy.

4.

Create a Computed Date/Time eld called L_ModiedDates.

5.

Specify the following items:


Allow multiple values Display date only Advanced: Display separate values with new line Hide paragraph if L_ModiedDates=NULL Formula: @If(@IsNewDoc;@Return(NULL);NULL); @If(@IsDocBeingSaved;NULL;@Return(@ThisValue)); @If(@ThisValue=NULL;@Today;@ThisValue:@Today);

6.

On the line below the new eld, but in the same table cell, type the following text: N/A and hide it when L_ModiedDates!=NULL.

Copyright IBM Corporation 2007

379

Appendix
Appendix A Solutions to Practice Activities Step 7. Action Revise the formula for the Effective Date eld to look like this: @If((L_ModifiedDates=NULL;@Return (@Adjust(PolicyCreatedDate;0;1;0;0;0;0));NULL); NumberofModifications:=@Count(L_ModifiedDates); @Return(@Adjust(L_ModifiedDates[NumberofModifications] ;0;1;0;0;0;0))

8.

Save and test your form.

380

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-9: Solution to Lesson Lab 10-1: Create Question and Answer Forms in the Policies and Procedures Application
Scenario The Worldwide Corporation wants to make it easier for employees to ask questions and receive answers about company policies. In this activity, you will create Question and Answer forms. The Answer form needs to inherit information from the Question form. Both forms should have a consistent look and feel. This activity has the following parts:

Use a layer and the mod_menu_background.gif le to enhance the look of the forms. Create a subform to provide a consistent header to both forms. Design and create the Question form. Design and create the Answer form. Create the header subform. Create a shared image. Use a layer and the mod_menu_background.gif le to enhance the look of the forms. Design and create the Question form. Design and create the Answer form.

To complete this lab:


Follow these steps to create Question and Answer forms.


Step Create the header subform 1. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Action

2.

In the Design pane, select Shared CodeSubforms. Result: A list of current subforms appears in the Work pane.

3.

Click New Subform. Result: A blank subform opens in the Work pane.

4.

With the cursor on the Info page, choose CreateTable. Result: The Create Table box opens.

Copyright IBM Corporation 2007

381

Appendix
Appendix A Solutions to Practice Activities Step 5. Action Create a Fit with margins table with one row and two columns. Click OK. Result: A table with one row and two columns is created. 6. Select the entire table. On the Cell Borders tab of the Table Properties box, set all borders to 0.

7.

Click in the left cell, and choose CreateImage Resource. Result: The Insert Image Resource box opens.

8.

Select the LOGO WW1.gif le and click OK. Result: The Worldwide logo is added to the rst cell.

9.

Click in the right cell and enter the following text: 123 Worldwide Blvd. Metropolis, PA 45555 Result: Worldwides address appears to the right of the company logo.

10.

Click below the table and choose CreateImage Resource. If necessary, select bluerule.gif and click OK. Result: The bluerule.gif image is added below the table.

11.

Close and save the subform as Worldwide Header Result: The subform closes and Worldwide Header appears as an available subform in the subforms list.

Create a shared image 12. 13. Click Shared Resources in the Design list. Click Images. Result: A list of shared images appears in the Work pane. 14. In the Work pane, click New Image Resource. Result: The New Image Resource dialog box opens. 15. In the New Image Resource dialog box, browse for and select the following image le:

mod_menu_background.gif

Click Open. Result: The image is added to the shared resources list. Create the Question form 16. In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar.

382

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 17. Action In the Work pane, click New Form.

18.

Choose DesignForm Properties. Result: The Form Properties box opens.

19.

Type Question in the Name eld. Result: Question appears in the Name box.

20.

Close the Form Properties box.

21.

Choose CreateResourceInsert Subform. Result: The Insert Subform box opens.

22.

Select Worldwide Header. Click OK. Result: The subform is inserted at the top of the Question form.

23.

Click below the subform, and type the following text:Question

24.

Select the text and set the font size to 24.

25.

Position the cursor several spaces below the text and choose Create Table. Result: The Create Table box opens.

26.

Create a xed width table with six rows and two columns. Click OK. Result: A table is inserted on the Question form.

27.

Select the entire table. On the Cell Borders tab of the Table Properties box, set all borders to 0. Close the Table Properties box.

28.

Select the left column, and right-justify the text.

29.

In the rst row, add the following eld label into the left cell and eld into the right cell:

Field label: First Name: Field name: FName Field type: Text, Editable

Result: The rst row is populated with a eld label and eld.

Copyright IBM Corporation 2007

383

Appendix
Appendix A Solutions to Practice Activities Step 30. Action In the second row, add the following eld label into the left cell and eld into the right cell:

Field label: Last Name: Field name: LName Field type: Text, Editable

Result: The second row is populated with a eld label and eld. 31. Complete the next row with the following information:

Field label: Date of Question Field name: QuestionDate Field type: Date/Time, Computed when composed

Result: The row is populated with a eld label and eld. 32. In the Programmers pane, type the following formula:@Today

33.

Complete the next row with the following information:

Field label: Category

Result: The row is populated with a eld label. 34. In the right cell, create the following eld:

Name: Category Type: Dialog List, Editable

35.

On the Control tab, enter the following choices:


Office Guidelines Benefits Holidays Grievance Procedures

36.

Complete the next row with the following information:


Field label: Subject Field name: Subject Field type: Text, Editable

Result: The row is populated with a eld label and eld.

384

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 37. Action Complete the next row with the following information:

Field label: Details Field name: Question Field type: Rich Text, Editable

Result: The row is populated with a eld label and eld. 38. Click outside the table. Choose CreateLayer. Result: A blank layer is inserted on the form. 39. Choose LayerLayer Properties. Set the Z-Index to -1. Result: The layer is positioned behind the table. 40. Click the Background tab. Click the Browse images button and select the mod_menu_background.gif image. Click OK. Result: The mod_menu_background.gif image is added to the layer. 41. Set the image to Repeat horizontally.

42.

Resize the layer by clicking and dragging one of the layer corners. Position it behind the table of eld labels and elds. Result: The layer serves as a background to the table.

43.

Click the Window Title object in the Programmers pane, and type the following formula: @If(@IsNewDoc;"New Question"; "Question: " + Subject); Result: The form has a window title.

44.

Save and close the Question form.

Create the Answer form. This form will inherit information from the Question form 45. 46. Open your copy of the Policies and Procedures application in Lotus Domino Designer. In the Design pane, click Forms. Result: In the Work pane, the list of existing forms appears. The New Form button appears on the button bar. 47. In the Work pane, click New Form.

48.

Choose DesignForm Properties. Result: The Form Properties box opens.

Copyright IBM Corporation 2007

385

Appendix
Appendix A Solutions to Practice Activities Step 49. Action Type Answer in the Name eld. Select Response as the form Type. Result: Answer appears in the Name box. 50. Click the Defaults tab and select On Create: Formulas inherit values from selected document. Close the Form Properties box. Result: When a document is created using the form, it will inherit values from another document. 51. Choose CreateResourceInsert Subform. Result: The Insert Subform box opens. 52. Select Worldwide Header. Click OK. Result: The subform is inserted at the top of the Question form. 53. Click below the subform and type the following text:Answer Press Enter several times. Highlight the text and set the font size to 24. 54. Position the cursor several spaces below the text and choose Create Table. Result: The Create Table box opens. 55. Create a xed width table with seven rows and two columns. Click OK. Result: A table is inserted on the Answer form. 56. Select the entire table and on the Cell Borders tab of Table Properties, set all to 0. Close the Table Properties box.

57.

Select the left hand column and right justify the text.

58.

In the rst row, add the following eld label into the left cell and eld into the right cell:

Field label: Answered by Field name: AnsweredBy Field type: Names, Computed when composed

Result: The rst row is populated with a eld label and eld. 59. In the Programmers pane, type the following formula:@UserName Result: The eld derives its value from the user name of the person answering the question. 60. Complete the next row with the following information:

Field label: Question Subject Field name: QuestionSubject Field type: Text, Computed when composed

Result: The row is populated with a eld label and eld.

386

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 61. Action In the Programmers pane, type the following formula: Subject Result: The eld derives its value from the Subject eld. 62. Complete the next row with the following information:

Field label: Date of Question Field name: QuestionDate Field type: Date/Time, Computed when composed

Result: The row is populated with a eld label and eld. 63. In the Programmers pane, type the following formula: QuestionDate

64.

Complete the next row with the following information:


Field label: Link to Question Field name: QuestionLink Field type: Rich Text, Computed

65.

Open the Form Properties box, and click the Defaults tab. Check Inherit entire selected document into rich text eld. Specify QuestionLink as Link, if needed. Close the Form Properties box. Result: A link to the main question document will automatically appear in the QuestionLink eld.

66.

Complete the next row with the following information:


Field label: Answer Subject Field name: AnswerSubject Field type: Text, Editable

Result: The row is populated with a eld label and eld. 67. Complete the next row with the following information:

Field label: Answer Date Field name: AnswerDate Field type: Date/Time, Computed when composed Formula: @Today

68.

Complete the next row with the following information:


Field label: Answer Field name: Answer Field type: Rich Text, Editable

Result: The row is populated with a eld label and eld.

Copyright IBM Corporation 2007

387

Appendix
Appendix A Solutions to Practice Activities Step 69. Action Click outside the table. Choose CreateLayer. Result: A blank layer is inserted on the form. 70. Choose LayerLayer Properties. Set the Z-Index to -1. Result: The layer is positioned behind the table. 71. Click the Background tab. Click the Browse images button and select the mod_menu_background.gif image. Click OK. Result: The mod_menu_background.gif image is added to the layer. 72. Set the image to Repeat horizontally.

73.

Resize the layer by clicking and dragging one of the layer corners. Position it behind the table of eld labels and elds. Result: The layer serves as a background to the table.

74.

Click the Window Title object in the Programmers pane, and type the following formula: @If(@IsNewDoc; "New Answer"; "Answer for " + QuestionSubject); Result: The form has a window title.

75.

Save and close the Answer form.

76.

Create several Question and Answer documents.

388

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-10: Solution to Lesson Lab 10-2: Enable Instant Messaging in a Field (Optional Lab)
Scenario The Worldwide Corporation makes every effort to facilitate internal communication and collaboration. Sometimes, employees have questions about policies that might be too specic or sensitive to use the Question and Answer forms, or more information might be needed in order to answer the question completely. The following tables provide detailed solution steps for two parts of the lab: Add a Names eld that can be used for instant messaging.

Enable online awareness for the Names eld.

Follow these steps to enable instant messaging in a eld.


Step Action

Add a Names eld to the Question form that can be used for instant messaging 1. 2. Click the layer, and move it out of the way, so that you can click the table. Click the third row of the table, and choose TableInsert Row.

3.

In the new left cell, type the following text and right-justify it: Contact Person

4.

In the new right cell, create the following new eld:


Name: ContactPerson Type: Names, Editable Input Validation Formula: @If(@ThisValue=NULL;@Failure("Please select a contact person");@Success);

5.

Click the Control tab in the Field Properties box, and select the following:

Show online status Use address dialog for choices

6.

Close the Field Properties box.

Copyright IBM Corporation 2007

389

Appendix
Appendix A Solutions to Practice Activities Step 7. Action Move the layer back over the table and re-size as needed.

8.

Save the Question form.

9.

If you have not yet done so, log in to instant messaging.

10.

Either create a new Question document, or edit an existing one.

11.

Select one of your logged-in classmates as the contact person.

12.

Save and re-open the document.

13.

Right-click the active indicator to display the Chat menu. Choose Chat With to chat with the contact person.

390

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-11: Solution to Lesson Lab 10-3: Embed an Instant Messaging Contact List on a Form (Optional Lab)
Scenario To further facilitate communication and collaboration between Worldwide Corporation employees, you will embed an instant messaging contact list on the Answer form. To complete this lab:

Create a table to hold the embedded contact list. Embed the contact list on the Answer form.

Follow these steps to embed an instant messaging contact list on a form.


Step Action

Create a table to hold the embedded contact list 1. 2. Open the Answer form in Lotus Domino Designer. Click the layer, and move it out of the way.

3.

Click after the Answered by text in the rst cell of the table. Press Enter.

4.

Choose CreateTable.

5.

Create a one row, one column, xed-width table.

6.

Open the Table Properties box. Set the following:


On the Table Layout tab, set the Cell Width to 3 inches. On the Cell Borders tab, set All to 0.

7.

Close the Table Properties box.

Embed the contact list on the Answer form 8. Place the cursor in the new table, and choose CreateEmbedded ElementInstant Messaging Contact List.

Copyright IBM Corporation 2007

391

Appendix
Appendix A Solutions to Practice Activities Step 9. Action Right-click the embedded contact list and choose Instant Contact List Properties.

10.

In the Embedded Contact List Properties box, on the Info tab, set the width and height each at Fit to window, and select yellow for the background color.

11.

In the Embedded Contact List Properties box, on the Border tab, select Ridge for the border style, and Drop shadow for a border effect.

12.

Close the Embedded Contact List Properties box.

13.

Move the layer back to where it was and resize it as necessary.

14.

Save the form and exit Lotus Domino Designer.

15.

Test the form.

392

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-12: Solutions to Lesson Lab 11-1: Display Response Data in Views
Scenario Now that you have created Question and Answer forms for creating Q&A documents about Worldwides policies, you need to create a view that shows the questions with their corresponding answers in a hierarchical view. In the following activity, you will create a hierarchical view that displays the question and answer documents. Note: Make sure you do this work in your copy of the Policies and Procedures application. To complete this lab:

Create a hierarchical view. Create a responses-only column.

Follow these steps to display response data in views.


Step Action

Create a hierarchical view that displays the questions with the answer below 1. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Result: The application opens in the Work pane. 2. In the Design pane, click Views.

3.

In the Work pane, click New View. Result: The Create View box opens.

4.

Name the view Q & A

5.

Copy the style from the view: Blank. Click OK twice. Result: The Q & A view appears in the view list.

6.

Open the Q & A view. Result: The Q & A view opens in the Work pane.

7.

Select View Selection in the Objects pane. Result: The Add Condition button displays.

8.

In the Programmers pane, select Formula in the Run list. Result: SELECT @All appears in the Programmers pane.

Copyright IBM Corporation 2007

393

Appendix
Appendix A Solutions to Practice Activities Step 9. Action Delete SELECT @All. Type the following formula: SELECT Form= "Question"|@AllDescendants Result: The new formula is created. 10. Double-click the rst view column to open the Column Properties box. Modify the column as follows:

Title: (blank) Width: 1 Show twistie when row is expandable. Sort: Ascending Type: Categorized Text Color: Blue

Sorting:

Font:

11. 12.

In the Programmers pane, select Field and then Category. Choose CreateAppend New Column to add the next column. Doubleclick its header and modify it as follows:

Title: Question Width: 25 Show twistie when row is expandable.

13.

In the Programmers pane, select Formula and add the following formula: Subject + " - " + @Text(QuestionDate) Result: The Question column displays the content of the Subject and QuestionDate elds.

Create a responses-only column in the Q & A view 14. 15. Open the Q & A view in Lotus Domino Designer. Choose CreateInsert New Column to create a column to the left of the Question column. Result: A new blank column is inserted in front of the Question column. 16. On the Column Info tab of the Column Properties box:

Leave the column title blank. Set the width to 1. Select Show responses only.

17.

On the Font tab, change the text color to red.

394

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 18. Action In the Programmers pane, select Formula and add the following formula: AnswerSubject + " - " + @Text(AnswerDate)

19.

Save and preview the view.

Copyright IBM Corporation 2007

395

Appendix
Appendix A Solutions to Practice Activities

Activity A-13: Solutions to Lesson Lab 11-2: Enable a Column for Instant Messaging
Scenario In an effort to improve interoffice communications, the Worldwide Corporation would like to have users on-line statuses displayed within the Policies and Procedures application. Follow the steps below to modify the application. Follow these steps to enable a column for instant messaging.
Step Action

Enable a column for instant messaging 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer, and click the Q&A view. Append a new column to the right of the Question column.

3.

In the Column Properties box, name the column Whos Online? and increase the column width to at least 18 characters.

4.

In the Programmers pane, enter the following column formula that evaluates to the abbreviated form of a full hierarchical name: @Name([Abbreviate];ContactPerson) Note: Online status displays for only a single name displayed in a column. You can allow a eld to accept multiple values, but status icons do not display if more than one name appears in a column.

5.

In the Style section on the Advanced Format tab in the Column Properties box, select Names from the ist.

6.

In the Names section, select Column contains a name and Show online status.

7.

To test your work, ensure that instant messaging connectivity is active. Close the Policies and Procedures application if it is open in the Lotus Notes client. Open the Policies and Procedures application in the Lotus Notes client and create and save a few documents. You should see the online status icons beside the names of users who are online.

396

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-14: Solution to Lesson Lab 12-1: Create Instant Messaging Action Buttons in a View (Optional Lab)
Scenario The Worldwide Corporation would like to add buttons to the All Documents view in the Policies and Procedures application to provide users with the ability to contact document authors and to show/hide online status icons. Follow the steps below to modify the application. Follow these steps to create instant messaging action buttons in a view.
Step Action

Create instant messaging action buttons in a view 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer, and open the Q & A view. To create the rst instant messaging chat action button, choose Create ActionAction.

3.

In the Action Properties box, on the Action Info tab, in the Name eld, type Chat. Accept all other defaults on this tab.

4.

Type the following formula in the Programmers @Command([SendInstantMessage]; ContactPerson)

pane:

5.

To create the second instant messaging chat action button, choose CreateActionAction. In the Action Properties box, on the Action Info tab, in the Name eld, type Show / Hide Contacts. Accept all other defaults on this tab. Type the following formula in the Programmers pane: @Command([ShowHideIMContactList])

6.

Save and close the Q & A view, and exit Lotus Domino Designer.

7.

Log on to Lotus Sametime and open the Policies and Procedures application in the Lotus Notes client, and open the Q&A view. Your Chat and Show/Hide Contacts action buttons should be visible on the action bar.

Copyright IBM Corporation 2007

397

Appendix
Appendix A Solutions to Practice Activities Step 8. Action Select a document and click Chat. Result: An instant messaging chat dialog box opens to initiate a chat with the author of the document. If the author is offline, a message box displays indicating this. 9. Click Show/Hide Contacts to display your instant messaging contact list. Click the button again and the instant messaging contact list is hidden.

398

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-15: Solution to Lesson Lab 12-2: Add Automation to the Policies and Procedures Application
Scenario Worldwide Corporation would like to automate creating and editing documents in the Policies and Procedures application. Users should be able to:

Create a policy or a question from the Policies view. Edit a policy when the document is open. Create a question or an answer from the Q&A view. Edit a question or an answer either when a document is open or selected in the Q&A view. Save any of the documents by clicking a button instead of using menu commands.

Action Create Policy Edit Policy Policies View

Where Used

Policies View When Policy document is open in Read mode Q & A View Policies View Q & A View When Question document is open in Read mode Q & A View When Question document is open in Read mode Q & A View When Answer document is open in Read mode Q & A View When Policy, Question, or Answer document is open in Edit mode

Create Question

Edit Question

Create Answer

Edit Answer

Save and close the document

Follow these steps to add automation to the Policies and Procedures application.

Copyright IBM Corporation 2007

399

Appendix
Appendix A Solutions to Practice Activities Step 1. Action Create a list of actions to be added to the Policies application using the table above.

Create the Create Policy button 2. Open the Policies view, from your copy of the Policies and Procedures application, in Lotus Domino Designer. Result: The view appears in the Programmers pane. 3. Choose CreateActionAction from the menu. Result: The Action Properties box opens. 4. In the Name text box, type Create Policy Result: The action is named Create Policy. 5. Type the following formula in the Script area for the Click object of the action: @Command([Compose]; "Policy") Result: The formula appears in the Script area. 6. Save and close the view.

Create shared actions 7. With your copy of the Policies and Procedures application open in Lotus Domino Designer, choose Shared CodeActions. Result: The Work pane opens to the shared actions list. 8. Click New Shared Action. Result: The Shared Action Properties box opens. 9. In the Name text box, type Edit Document Result: The shared action is named Edit Document. 10. Select the Action Hide When tab. Result: The Action Hide When tab appears. 11. Select:

Previewed for editing Opened for editing

Result: The properties are set that will hide the button if the document is in Edit mode. 12. Close the Action Properties box.

13.

Type the following formula in the Script area for the Click object of the action: @Command([EditDocument]) Result: The formula appears in the Script area.

400

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 14. Save the shared action. Action

15.

Create a shared action with the following information:

Name: Create Answer

Result: The Create Answer action is created. 16. Type the following formula in the Script area for the Click object of the action: @Command ([Compose]; "Answer") Note: Use the form alias if you created one, in place of the form name. Result: The formula appears in the Script area. 17. Save the shared action.

18.

Create a shared action with the following information:

Name: Create Question

Result: The Create Question action is created. 19. Type the following formula in the Script area for the Click object of the action: @Command([Compose];"Question") Result: The formula appears in the Script area. 20. Save the shared action.

Insert the shared action onto the appropriate forms 21. Open the Answer form in Lotus Domino Designer. Result: The form appears in the Programmers pane. 22. Choose CreateActionInsert Shared Action from the menu. Result: The Insert Shared Action dialog box appears. 23. Select the Edit Document shared action, and click Insert. Result:Lotus Domino Designer adds the shared action to the form. 24. Click Done. Result: The Insert Shared Action dialog box closes. 25. Save and close the Answer form.

26.

Insert the Edit Document shared action onto the Policy form. Result: The Edit Document action appears on the Policy form.

Copyright IBM Corporation 2007

401

Appendix
Appendix A Solutions to Practice Activities Step 27. Action Insert the Edit Document and Create Answer shared actions onto the Question form. Result: The Edit Document and Create Answer actions appear on the Question form. Insert the shared actions onto the views 28. Open the Policies view in Lotus Domino Designer. Result: The view appears in the Programmers pane. 29. Choose CreateInsert Shared Action from the menu. Result: The Insert Shared Action dialog box appears. 30. Insert the Edit Document and Create Question shared actions. Result: Lotus Domino Designer adds the shared actions to the view. 31. Click Done. Result: The Insert Shared Action dialog box closes. 32. Save and close the Policies view.

33.

Insert the following shared actions onto the Q & A view:


Edit Document Create Question Create Answer

Result: The shared actions appear on the Q & A view. Create the Save and Close button 34. With your copy of the Policies and Procedures application open in Lotus Domino Designer, choose Shared CodeActions. Result: The Work pane opens to the shared actions list. 35. Click New Shared Action. Result: The Shared Action Properties box opens. 36. In the Name text box, type Save and Close Result: The shared action is named Save and Close. 37. Click the Action Hide When tab. Result: The Action Hide When tab appears. 38. Select Previewed for reading and Opened for reading. Result: The properties are set that will hide the button if the document is in Read mode. 39. Close the Shared Action Properties box.

402

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 40. Action Enter the following formula in the Script area for the Click object of the action: @Command([FileSave]); @Command([FileCloseWindow]) Result: The formula appears in the Script area. 41. Save the shared action.

Add the Save and Close shared action to the forms in the Policies and Procedures application 42. Open the Answer form in Lotus Domino Designer. Result: The form appears in the Programmers pane. 43. Choose CreateActionInsert Shared Action from the menu. Result: The Insert Shared Action dialog box appears. 44. Insert the Save and Close shared action. Result: Lotus Domino Designer adds the shared action to the form. 45. Click Done. Result: The Insert Shared Action dialog box closes. 46. Save and close the Answer form.

47.

Insert the Save and Close shared action onto the Policy and Question forms. Result: The Save and Close action appears on the two additional forms.

Copyright IBM Corporation 2007

403

Appendix
Appendix A Solutions to Practice Activities

Activity A-16: Solution to Lesson Lab 13-1: Update Existing Documents


Scenario So far, you have either left the policy number blank on Policy documents, or made one up. In this lab, you will write an agent that computes a policy number for all existing policies. The policy number should be formatted as PN999999 where the characters PN are the rst two characters in the policy number, and 999999 is calculated based on the rightmost six characters of the documents unique ID. Follow these steps to update existing documents.
Step Action

Create an agent that reassigns the policy numbers 1. With your copy of the Policies and Procedures application open in Lotus Domino Designer, choose Shared CodeAgents. Result: The Work pane opens to the agents. 2. Click New Agent. Result: The Agent Properties box opens in the Work pane. 3. In the Name text box, type Reassign Policy Numbers Result: The agent is given a name. 4. Verify that Shared is selected and change Target to All documents in database. Result: The agent is designated as a shared agent. 5. In the Programmers pane, select Formula from the Run list. Result: The Programmers pane is split into the InfoList and the Script area. 6. In the Script area, type the following formula: SELECT Form="Policy"; REM {Convert the hexadecimal number to text.}; REM {Select the last 6 characters.}; Temp:= @Right(@Text(@DocumentUniqueID);6); REM {Set the PolicyNo field to "PN" plus Temp}; FIELD PolicyNo := "PN" + Temp Result: The formula is entered in the Script area. 7. Save the agent. Result: The new agent is saved.

404

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 8. Action Open the application in the Lotus Notes client, run the agent by choosing ActionsReassign Policy Numbers, and check the results. Result: The PolicyNo eld in all Policy documents contains the reassigned policy numbers. Modify the policy form so that it computes a new policy number when a new Policy document is created 9. 10. Open the Policy form in Lotus Domino Designer. Click on the PolicyNo eld.

11.

In the Field Properties, change the type to Text, Computed when composed.

12.

Type the following formula into the @Right(@Text(@DocumentUniqueID);6)

Script

area:

"PN" +

13.

Save and test the form.

Copyright IBM Corporation 2007

405

Appendix
Appendix A Solutions to Practice Activities

Activity A-17: Solution to Lesson Lab 14-1: Set Access Restrictions to the Application
Scenario Worldwide Corporations Policies and Procedures application is almost ready to be deployed. However, security levels have not been established for all the different types of users. In this group activity, you will work with the rest of the class to determine the access control levels required for the appropriate users. The following tables provide detailed solution steps for two parts of the lab: Copy the updated Policies and Procedures application to Hub/SVR/ WWCorp.

Set your access control level to Manager.

Follow these steps to set access restrictions to the application.


Step Action

Copy the updated Policies and Procedures application to Hub/SVR/WWCorp 1. 2. If necessary, in the Lotus Notes client, switch to the Lotus Notes workspace. Choose FileOpenLotus Notes Application. On Hub/SVR/WWCorp, double-click the D8510 folder, and then double-click PoliciesACL.nsf.

3.

Bookmark this application.

4.

Right-click the PoliciesACL icon and choose ApplicationNew Copy.

5.

Set Server to Hub/SVR/WWCorp.

6.

Click the folder icon, select D8510, and then click Select.

7. 8.

Change the title to Policies and Procedures ## (where ## is your student number). Change the le name to Policies##.nsf

9.

Verify that Database design and documents and Access Control List are selected to be copied.

406

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 10. Click OK. Action

Set your access control level to Manager 11. 12. 13. 14. 15. 16. 17. 18. Choose FileApplicationAccess Control. Click Add, and then click the person icon. In the Select Names dialog box, verify that WWCorps Directory is selected. In the list of names, double-click your student account name, and then click OK. In the User type list, select Person. In the Access list, select Manager. Select Delete documents. Select the Students group, click Remove, and then click OK.

Copyright IBM Corporation 2007

407

Appendix
Appendix A Solutions to Practice Activities

Activity A-18: Solution to Lesson Lab 14-2: Create Roles


Scenario In this activity, you will create roles for the Policies and Procedures application and assign these roles to different users. For example, there are policy makers who should be able to view all documents and assign questions to the appropriate experts. To complete this lab:

Determine the roles for the Policies and Procedures application. Create the roles.

The following table lists the roles for the Policies and Procedures application.

Role Employees PWriters Designers Managers Employee

Description

Policy and Procedure Writer application Designer Manager

Follow these steps to create roles.


Step Action

Create the roles from the preceding table 1. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Be sure to use the application from the classroom server (Hub/SVR/WWCorp). Choose FileApplicationAccess Control. Result: The Access Control List to the Policies and Procedures box opens. 3. Click the Roles tab located on the left side of the Access Control List dialog box. Result: The Roles eld opens in the Access Control box. 4. Click Add to add a user Role. Result: The Add Role box opens.

2.

408

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 5. Action Type Employees in the Add Role dialog box. Click OK. Result: Employees appears, in brackets, in the Roles list. 6. Add the following roles:

PWriters Designers Managers

Result: The new roles are added to the Roles list. 7. 8. 9. Click the Basics tab located on the left side of the Access Control List dialog box to return to the list of access controls. Look in the Roles eld to verify that the roles you added are listed there. Click OK to close the Access Control List dialog box.

Copyright IBM Corporation 2007

409

Appendix
Appendix A Solutions to Practice Activities

Activity A-19: Solution to Lesson Lab 14-3: Control Access to Documents in the Policies and Procedures Application
Scenario You want to control access to documents in the Policies and Procedures application based on the following:

All employees should be able to read any document in the application. The people who create documents should be able to edit them. Members of the Managers and Policy Makers groups should be assigned the PWriters role. Only people assigned the PWriters role should be able to create Policy documents. All employees can create Question documents. Only the person who creates a Question should be able to modify it. Only PWriters should be able to create and edit Answers. Change the ACL to modify the access rights of different groups of users. Change the Policy form to allow only users assigned the PWriters role to create or edit documents created with this form. Change the Question form so only the author can edit the question. Change the Answer form to allow only users assigned the PWriters role to create or edit documents created with this form. Set the hide/when formula for actions.

To complete this lab:


This solution assumes the application has the roles from the previous lesson labs. Follow these steps to control access to documents.
Step Action

Modify your copy of the Policies and Procedures application ACL to set the access levels of the Employee group and the [PWriters] role 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Choose FileApplicationAccess Control. Result: The Access Control List to the Policies and Procedures box opens.

410

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 3. Action Select the Employee group, and set the [Employees] role. Result: Users in the Employee group have the Create Document privilege, Author privileges, and are assigned the Employees role. 4. Select the Policy Makers group from the list of users. Result: The Policy Makers group is highlighted. 5. Select User type as Person group. Select Author as the Access. Select the Create documents privilege. Select the [PWriters] role. Result: Users in the Policy Makers group have Author privileges and are assigned the [PWriters] role. 6. Select the Managers group from the list of users. Select a User type of Person group and an Access of Manager. Assign the [PWriters] and [Managers] roles to the group. Result: Users in the Managers group are assigned the [PWriters] and [Managers] role and can manage the application. 7. Click OK to close the Access Control List box and save the application.

Remove anonymous access and change the access rights of default users to no access 8. 9. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Choose FileApplicationAccess Control. Result: The Access Control box opens. 10. Click Anonymous in the list of users.

11.

Click the Remove button.

12.

Click -Default- in the list of users.

13.

Select Reader as the Access level. Clear the Write public documents check box. Click OK. Result: Anyone with default access to the application can read documents.

Restrict who can create and edit documents created with the Policy form 14. Open your copy of the Policies and Procedures application in Lotus Domino Designer.

Copyright IBM Corporation 2007

411

Appendix
Appendix A Solutions to Practice Activities Step 15. Action In the Design pane, expand the list of Forms. Open the Policy form. Result: The Policy form opens in the Work pane. 16. Open the Form Properties box.

17.

Click the Security tab.

18.

Clear the All authors and above check box for Who can create documents with this form. Select the [PWriters] role.

19.

Close the Form Properties box. Result: Only users assigned the [PWriters] role can create Policies.

20.

Create an Authors eld at the top of the Policy Form with the following properties:

Name: Editors Data type: Authors Type: Computed when composed Allow multiple values Value formula: "[PWriters]"

21.

On the Paragraph Hide/When tab, select Hide paragraph if the formula is true and type a formula of @True. Result: Only users assigned to the [PWriters] role can create a Policy document.

22.

Save the form.

Set the read and edit restrictions for the Question form 23. Open your copy of the Policies and Procedures application in Lotus Domino Designer.

24.

Open the Question form.

412

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 25. Action Create an Authors eld at the top of the form with the following properties:

Name: Authors Data type: Authors Type: Computed when composed Hide when formula: @True Value formula: @UserName

Result: Only the documents creator can make changes to the document. 26. Save and close the form.

Modify the Answer form so only users assigned the [PWriters] role can create and edit documents created with the form 27. 28. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Open the Answer form. Result: The Answer form opens in the Work pane. 29. Choose DesignForm Properties. Select the Security tab. Result: The Form Properties box opens. 30. Clear the All authors and above check box for Who can create documents with this form. Select the [PWriters] role. Close the Form Properties box. Result: Only users assigned the [PWriters] role can create Answers. 31. Place your cursor at the top of the form and choose CreateField. Result: Only the documents creator can make changes to the document. 32. Create an Authors eld with the following properties:

Name: Authors Data type: Authors Type: Computed when composed Hide when formula: @True Value formula: @UserName

33.

Save and close the form.

Set the hide/when function for the Create Policy and Create Answer actions

Copyright IBM Corporation 2007

413

Appendix
Appendix A Solutions to Practice Activities Step 34. Action With your copy of the Policies and Procedures application open in Lotus Domino Designer, choose Shared CodeActions. Result: The Work pane opens to the shared actions list. 35. Open the Create Answer action.

36.

Choose DesignShared Action Properties. Click the Action Hide When tab. Result: The Shared Action Properties box opens.

37.

Select Hide action if formula is true and type the following formula: @IsNotMember("[PWriters]"; @UserRoles) Result: The Create Answer action is hidden from anyone who is not assigned the [PWriters] role.

38.

Save the shared action.

39.

Modify the Hide/When properties for the Create Policy action on the Policies view in the same way.

414

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-20: Solution to Lesson Lab 15-1: Create a Design Template and a New Application
Scenario Now that the Worldwide Policies and Procedures application has been designed, developed, and tested, it is time to make a design template from the application and prepare to deploy the application. To complete this lab:

Extract the design elements to create a master design template. Create a master design template. Create a new application that will update whenever the template changes.

Follow these steps to create a design template and a new application.


Step Action

Extract the design elements to another application that will become the master design template 1. 2. Select your copy of the Policies and Procedures application in either Lotus Notes or Lotus Domino Designer. Choose FileApplicationNew Copy. Result: The Copy Database box opens. 3. Make sure that the server is set to Local.

4.

Type the title Policies_Template

5.

Type the le name Policies_Template.ntf Note: The NTF le extension does not make the le a template. It simply causes it to appear as a choice in the list of templates when you create a new application.

6.

Click Specify What to Copy: Application design only. Result: Only the application design elements will be copied, not the documents.

7.

Click OK. Result: The application design is copied locally.

Turn the Policies_Template application into a template

Copyright IBM Corporation 2007

415

Appendix
Appendix A Solutions to Practice Activities Step 8. 9. Action Open your copy of the Policies_Template application in Lotus Domino Designer. Choose FileApplicationProperties to open the Database Properties box. Result: The Database Properties box opens. 10. Click the Design tab.

11.

Select Database le is a master template.

12.

Type the template name Policies_Template. The template name is the link between the template and the application or applications. Result: The template name is listed in the Name box.

13.

Close the Database Properties box.

Link the application to the master design template 14. 15. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Choose FileApplicationProperties. Result: The Policies Properties box opens. 16. Click the Design tab.

17.

Select Inherit design from master template. Click in the Template Name box and type Policies_Template Result: The Policies and Procedures application will inherit design changes from the Policies_Template application.

416

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities

Activity A-21: Solution to Lesson Lab 15-2: Roll Out the Policies and Procedures Application
Scenario You want to make modications to the Policies and Procedures application that will allow for proper replication of the application. You will also test the application. The following tables provide detailed solution steps for seven parts of the lab: Modify the ACL of the Policies and Procedures application.

Create a new replica of the Policies and Procedures application locally or on the classroom server. Create some new documents in the server copy of the application. Replicate with the local copy. Modify the template. Refresh the design of the local copy of the Policies and Procedures application. Replicate the Policies and Procedures application from local to server.

Follow these steps to roll out the Policies and Procedures application.
Step Action

Modify the ACL for the Policies and Procedures application 1. 2. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Choose FileApplicationAccess Control from the menu. Result: The Access Control List dialog box appears. 3. Ensure that LocalDomainServers is a User type of Server group, has Manager access, and can delete documents.

4.

Select all roles for this group.

5.

If necessary, assign the [PWriters] role to your user account.

6.

Click OK to close the Access Control List.

Copyright IBM Corporation 2007

417

Appendix
Appendix A Solutions to Practice Activities Step Action

Create a local replica of the Policies and Procedures application 7. 8. Open your copy of the Policies and Procedures application in Lotus Domino Designer. Choose FileReplicationNew Replica.

9.

Select Local.

10.

Keep the default le name and title for the new replica.

11.

Select Create Immediately. Note: Click Replica Settings if you do not see this option.

12.

Select Copy Access Control List to copy the ACL from the original to the new replica. This option may already be checked and greyed out.

13.

Click OK.

Create new documents on your server copy of the Policies and Procedures application 14. 15. Open the Lotus Notes client. Choose FileOpenLotus Notes Application.

16.

Select the classroom server from the server list.

17.

Select the Policies and Procedures application. Click Open. Result: The server copy replica of the Policies and Procedures application opens.

18.

Create several new policies.

Update the local copy of the Policies and Procedures application with the server copy of the Policies and Procedures application 19. 20. Open the Replication page in the Lotus Notes client. Make sure the Policies and Procedures application is checked.

418

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix A Solutions to Practice Activities Step 21. Click Start Now. Result: The local and server copies of the Policies and Procedures applications are replicated to one another. 22. Open the local replica and verify that the new document has arrived. Action

Modify the Policies and Procedures application template 23. 24. Open the Policies and Procedures template, Policies_Template.ntf, in Lotus Domino Designer. Open the Policy form.

25.

Modify the form. For example, change the background color of the form.

26.

Save the form.

27.

Refresh the design of the local replica of the Policies and Procedures application.

28.

Open the local replica of the Policies and Procedures application in the Lotus Notes client.

29.

Open any existing document using the Policy form to see if the background color has changed.

Update the server copy of the Policies and Procedures application with the server copy of the Policies and Procedures application 30. 31. Open the Replication page in the Lotus Notes client. Make sure that the Policies and Procedures application is checked.

32.

Click Start Now. Result: The local and server copies of the Policies applications are replicated to one another.

33.

Open the server copy of the Policies and Procedures application.

Copyright IBM Corporation 2007

419

Appendix
Appendix A Solutions to Practice Activities Step 34. Action Open any existing document using the Policy form to see if the background color has changed.

420

Copyright IBM Corporation 2007

Appendix
About This Appendix

The Worldwide Corporation Infrastructure Plan


This appendix provides an overview of Worldwide Corporations infrastructure. It is intended to provide an overall view of the environment as designed by the planning team. It does not provide details on specic IBM Lotus Domino functionality. This document will be continually updated. Administrators should refer to the Policies and Procedures application on any Worldwide Corporation server for the latest version of this document. IBM Lotus Notes and Domino is Worldwide Corporations global standard for electronic mail and for developing and deploying groupware applications.

Copyright IBM Corporation 2007

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

Organization Structure
The structure of Worldwide Corporation appears in the following gure.

Figure B-1: Structure of Worldwide Corporation

User Needs
Worldwide Corporations users require the following access to applications.

Information Groups E-mail/Communication Policies and procedures Product Information: Price list Product catalogue All All

Who

Lotus Domino Server Application Web Application Web

Sales Customers Resellers

Customer Information: Customer service application

Sales Support Distribution

Application Mail Communication

422

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan Information Groups Process information: Product design Order processing

Who Development Product management Manufacturing Sales

Lotus Domino Server Application Web

Human Resources

All

Application

Note: User needs were determined by function across all geographies.

Servers By Task
Worldwide Corporation will designate servers to specic tasks based on Information Groups. The following table lists the servers, associated tasks, and rationale behind the decision.

Server Type Hub

Tasks Routes mail and replication applications to and from other hub or spoke servers. Provides non-Domino mail services, such as: POP3 IMAP SMTP NNTP LDAP

Rationale Provide easier administration and maintenance.

Internet Messaging

Use Lotus Domino server to provide employees with access to non-Lotus Domino mail les.

Copyright IBM Corporation 2007

423

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan Server Type Mail Tasks Stores users mail and applications and routes mail across the intranet and Internet.

Rationale Provide easier administration. Minimize server processor load. Reduce network traffic. Provide predictable server performance and grouping of users. Allow user access to applications when mail server is down.

Application

Stores application applications.

Provide easier administration. Group applications by usage, replication needs, and/or security requirements. Allow tuning of server to optimize performance and response time independent of mail usage. Ease expansion by adding new application servers as usage and storage needs increase.

Web

Provides access to an application from the Internet or to corporate intranet. Can use either: Lotus Domino Web server Microsoft IIS

Can place outside the rewall for Internet access. Provide employees with access to corporate information from a browser.

Servers By Location
Worldwide Corporation will have one Lotus Domino Domain (WWCorp) that includes all Worldwide Corporation offices. Worldwide Corporations Internet domain name has been registered as WWCorp.com.

424

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Topology
Worldwide Corporation has selected a hub-and-spoke topology for ease of management and future expansion. Each regional office will have a hub server and one or more spoke servers. Each site will be set up to run independently, although they will be connected to the corporate hub. Connection documents are required for replication to tell the corporate hub how and when to communicate with other servers and for spoke servers to connect to the corporate hub. Headquarters is the center of the infrastructure and houses the main hub server, which has high-speed links running to the offices. Each individual Lotus Domino server is responsible for its own mail routing and replication events. The hub server is responsible for replication of the critical applications between all its spoke servers. The following gure shows the locations and types of servers.

Figure B-2: Server types and locations

The headquarters hub server


The hub server is the administration server for the Worldwide Corporation domain and replicates the Directory Catalog and the Administration Requests application to all other Lotus Domino servers within the Worldwide Corporation domain (WWCorp). Sales offices and sales representatives will connect to their local regional hub server using Lotus Notes clients and Internet clients, such as browsers.

Copyright IBM Corporation 2007

425

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

Customers and vendors will have access through a Web server at Headquarters.

Notes Named Networks


The regional sites will be logically grouped into Notes Named Networks (NNNs), since they share a common protocol (TCP/IP) and are constantly connected. Grouping the Notes Named Networks this way will ensure that users see information on their local servers to reduce network traffic. Each country office has one or more Lotus Domino servers. The following table shows the countries to be congured and the Lotus Notes Named Networks (NNNs) for each country.

Region Headquarters East West HQ East

Code

NNN WWCorpHQ WWCorpEast WWCorpWest

Connect Status WAN WAN WAN

West

System Administration
System administration is locally controlled by region, but monitored from the Corporate office. Administration tasks are controlled by regional administrators. General policies and guidelines are maintained and distributed from the Corporate office. Implementation and design changes are carried out after business justications are submitted and approved. All system administrators use the Lotus Domino Administrator and Web Administrator for all administration tasks.

Domino Domain Monitoring


System Administrators will use Domino Domain Monitoring and the integrated IBM support assistant to proactively monitor the WWCorp Domain.

Network Strategy
Worldwide Corporations strategy includes these components:

Incorporating TCP/IP as their primary network protocol. Using a global frame relay network as its global WAN. Providing high-bandwidth networking connections to all offices from Headquarters. Upgrading existing server network cards as necessary to meet demand.

426

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Although the WAN is robust and high-speed, Worldwide Corporation does not want to rely solely on the network. They purchased additional servers for regional offices to ensure reliability and consistency across geographical locations.

Directory Strategy
There will be only one Lotus Domino domain (WWCorp) for the entire Worldwide Corporation Domino environment. The model matches the physical layout of the Worldwide Corporation WAN. The rst congured server (the corporate hub) will have full administration rights over the entire domain. The Lotus Domino Directory will reside on the corporate hub server at headquarters, and replicate to each regional hub server. The corporate hub will create Directory Catalogs, and replicate to regional hubs for use by remote users. Remote users can keep a local replica of the Directory Catalog on the client for faster response time and timely encryption of messages. System administrators will periodically update the Directory Catalog and replicate once a day to hub servers. Directory access is from: Lotus Notes clients

Web browsers Other e-mail and directory clients

Replication Topology
A hub-and-spoke topology will be used for replication. This structure consists of a main hub with two spoke servers, which are the regional hub servers. Each regional hub server also has its own spoke servers. The corporate hub server will be the primary hub and share control of replication with regional hub servers.

Streaming Replication
Connection documents are required for replication to tell the corporate hub how and when to communicate with other servers and for spoke servers to connect to the corporate hub. To take advantage of the new streaming replication feature in Lotus Domino 8, connections between Hub servers will use the Pull/Pull replication strategy. Administrators will create Connection documents between the WWCorp Domain Hub and regional Hub servers using the Pull:Pull strategy. This will take advantage of the speed of Streaming Replication. It is important to note that WWCorp employees are not expected to access these servers, so all Hub servers can share the replication workload.

Copyright IBM Corporation 2007

427

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

Note: Employees are not expected to access Hub servers.

The following gure shows Worldwide Corporations replication topology.

Figure B-3: Worldwide Corporations replication topology

Application Types
Types of applications will be separated and reside on different application servers to isolate problems and simplify management. All applications will be replicated to the corporate hub for central control and reliability.

Design Note Compression/On Demand Collection Features


In addition new applications will be created using the new Lotus Domino 8 Design Note Compression and on demand Collation features. This will reduce I/O and space utilization and provide the opportunity to reduce system resources.

Database Redirect
Administrators will use database redirect to automatically update client references to databases that have been relocated or deleted.

428

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Application Type

Resides on Corporate Application Server and... All regional application servers

Replication Schedule

Policies and Restrictions

Customer service application

Daily during mutual off-peak hours for Lisbon and regional hub Daily during mutual off-peak hours for Lisbon and regional hub When changes are made

Local languages and customs, escalation procedures Local languages and regulations

Purchasing application

All regional application servers

Policies and procedures application Price lists

All regional application servers

Local languages and customs

All regional application servers All regional application servers

When changes are made Quarterly, or when changes are made When changes are made

Local languages and currencies Local languages

Catalogs

Enterprise Resource Planning (ERP) application Composite applications

West application server

Local languages

All regional application servers

When changes are made

Local languages and currencies

Integrated Db2 Technology


Administrators will leverage the speed of Db2 Server Technology while maintaining Domino security access to data in the Db2 environment.

Mail Routing Strategy


Each region will have its own server that is responsible for local mail delivery, but will rely on the corporate mail server for inbound Internet mail: Simple Mail Transfer Protocol (SMTP) will route mail to the Internet.

Notes Remote Procedure Call (NRPC) will route mail within the corporate intranet.

Copyright IBM Corporation 2007

429

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

The following conguration provides for ease of conguration and optimum load balancing and failover: One Internet domain.

ISP as a relay host to Internet. Regional Domino Named Networks (one for each region). The corporate hub is enabled to route external mail using the SMTP protocol. All mail servers have Connection documents and route mail using NRPC internally.

The WWCorp Domain Hub will be congured to send and receive Internet mail. Administrators will use whitelists and blacklists to improve mail routing performance. In addition, Transfer and Delivery Reports will be used to notify users if their mail is unable to be delivered.

Mail Administrators
Administrators must perform the following tasks:

Store the Internet domain name in the Foreign SMTP and Global Domain documents. List the inbound mail servers in the Mail Exchange (MX) records in the Domain Name Service under the domains name. Only one is required. (Note that load balancing for multiple servers is dependent on the algorithm used by the client SMTP system to select a server from the MX records.) Congure complete address lookup or congure local part only lookup to identify each mail recipients mail server so that the router can make the nal delivery.

Mail clients
Initially, all mail users will have Lotus Notes mail les. In the future, some mail users may use other Internet mail client software. At that time, Worldwide Corporation will set up select Internet POP3 Messaging Servers for non-Notes mail clients to access mail les on the Lotus Domino server.

Mail monitors and controls


The following mechanisms will be put into place for monitoring and controlling mail: Automated testing of mail routers

Mail quotas Inbox cleanup Mail journaling Set options for Mail Recall Set options for Out of Office agent

430

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Reject inbound ambiguous names/deny mail to groups Maximum message size for inbound and outbound message set to 10 megabytes User restrictions, such as full-text indexing and other Policy Management enhancements

Server managed provisioning


Administrators will use the Eclipse Provisioning model to deploy Lotus Notes 8 Client features, components, and composite applications.

Mail routing topology


The following gure shows Worldwide Corporations mail routing topology.

Figure B-4: Worldwide Corporations mail routing topology

Reverse Path setting for forwarded messages


Administrators will use this function to specify how the mail router handles delivery failure reports when e-mails are automatically forwarded by an action in a users mail rule. This will reduce inadvertant rejection of legitimate mail by some SPAM lters when automatic mail forwarding is enabled.

Worldwide Corporation Naming Conventions


The following table denes the Worldwide Corporation naming scheme.

Copyright IBM Corporation 2007

431

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

Organization Component Organization (O) Organizational Units (OU) WWCorp

Vale Cert.id Hq.id West.id East.id Svr.id

Certier

HQ: Headquarters WEST: West EAST: East SVR: All servers

Organizational units are based on geographical regions. The servers organizational unit will be used for better control of management and creation of servers. All organizational units and common names are descendants of the organization certier /WWCorp.

User Naming
The following table provides user naming conventions.

Type Common name for Lotus Domino environment Internet mail addressing

Syntax Firstname Lastname

username@WWCorp.com where username = Firstinitial_Lastname

Server Naming
The following table provides examples for regional server names.

Region Headquarters

Code HQ

Server Names (Server Types) HQHUB/SVR/WWCorp (Hub/Comm) HQAPP01/SVR/WWCorp (Application) HQMAIL01/SVR/WWCorp (Mail) EASTHUB/SVR/WWCorp (Hub) EASTAPP01/SVR/WWCorp (Application) EASTMAIL01/SVR/WWCorp (Mail) WESTHUB/SVR/WWCorp (Hub) WESTAPP01/SVR/WWCorp (Application) WESTMAIL01/SVR/WWCorp (Mail)

East

East

West

West

432

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Naming Examples
The following table provides naming examples for international sites.

If you want to ... Create a new server.

Then ... Use the name XXType##/SVR/WWCorp, where: XX is the standard country code. Type is the server type, for example, Mail. ## is the server number of this type. For example, the rst mail server in Australia might be: AUMAIL01/SVR/WWCorp

Create a new organizational unit.

Use the standard country code that identies the location of the organizational unit. A new organizational unit for Canada might be: /CN/WWCorp Certify under the regional organizational unit where the user works. A new user named Sara Jones in London would be: Sara Jones/UK/WWCorp The corresponding Internet name would be: Sara_Jones@WWCorp.com

Create a new user.

Certier/ID Management Policy


The following table describes the certier/ID management policy.

Type Organization certier

Management Policy Corporate system administrators create the O certier. Corporate system administrators create the OU certiers. Access is limited to two administrators using multiple passwords. Store IDs in protected areas.

Copyright IBM Corporation 2007

433

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan Type Organizational unit certiers

Management Policy Corporate administrators keep copies of OU certiers. OU certiers are migrated to the CA process. Regional administrators use the CA process to register users and servers using these OU certiers. Store IDs in protected areas.

Server IDs

Corporate system administrators create all server IDs. Store IDs on the server. Use only for the server.

User IDs

Regional administrators create user IDs. Regional system administrators keep copies of IDs in a secure application on the regional hub server. Use a Certication Log application to track certication. All Certier IDs have multiple passwords and expiration dates of two years from date of creation. Store backups in a secure off-site location.

Key les for Interent (X.509) Certicates

Using Lotus Domino as a Certicate Authority, administrators will create X.509 certicates using the Certicate Authority Application on a workstation and store the CA key ring on that workstation, not on the server. Do not distribute these les to other administrators in the organization. Store the certicates in a secure off-site location. Store in corporate user Lotus Notes ID les. Store in trusted LDAP directories (for customers).

434

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Hierarchical Naming for Worldwide Corporation


The following gure shows the organization hierarchy, including currently planned server names.

Figure B-5: Worldwide Corporations organization hierarchy

Remote Access
Worldwide Corporation has determined specic Internet access for remote employees, vendors, resellers, and customers, based on their needs.

Internet Access
The following Internet access will be used:

Authenticated access for employees Public access Web server for vendors, resellers, and customers, including controlled access to servers, applications, and data

The following table describes types of access.

Copyright IBM Corporation 2007

435

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

Employees X.509 certicates

Customers Anonymous access to catalog and public company information. Future: Username and password access to information about their own orders, for example, shipping information.

Vendors Anonymous access

Resellers Authenticated access through outside LDAP directories.

Internet security features


Administrators will use XACLs to protect against to decipher hashed passwords. Internet Password Lockout will be used to restrict Internet users to three login attempts before account lockout.

Remote Users
Users at home offices that do not have direct connections to the WAN can use an Internet Server Provider (ISP) to access the Lotus Domino system through a local Firewall server. Remote users can connect to their mail server through the local Firewall servers.

Server Congurations and Security


Worldwide Corporation has determined congurations for servers, including licensing, le structure, and server tasks. Server security has been dened as group access to servers.

Server Types
The following table lists the server licenses that will be used for each of the server types.

Server Type Lotus Domino Mail and Internet Messaging servers

Server License Lotus Domino Messaging Server

Rationale To provide Lotus Domino and Internet mail services

436

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan Server Type Application and Web servers Server License Lotus Domino Utility Server Rationale To provide custom application applications for Lotus Notes and Web clients To provide the following services: Clustering Partitioning

Hub server

Lotus Domino Enterprise Server

File Structure
The following table lists the standard le structure on the servers.

Path Domino

Contents System les, client les

Description Client les will be installed for network distribution purposes. Domino system applications that are required for Domino to function properly. Critical applications that require frequent replication.

Domino\data

Applications, general data les

Domino\data\critical

Applications

Use the standard installation le paths whenever possible to ensure standardized training and ease of support and troubleshooting.
Note: Store Lotus Domino executables on a separate disk than Domino data for better performance.

These areas of the Lotus Domino le structure are only accessible to designated personnel for installation purposes. All other Lotus Domino data is protected by operating system security and is accessible to Lotus Domino administrators only.

Conguration Documents
Every Worldwide Corporation server has its own Conguration document. This ensures that each server conguration can be modied separately and that there is a log of any changes made.

Copyright IBM Corporation 2007

437

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan

The Lotus Domino conguration application will be used for server setup to streamline and automate setup. A Conguration document exists for each server type (for example, hub, mail, application) and is then distributed to other servers of the same type.

Lotus Domino Tasks by Server Type


The following table lists the minimum requirements for all Conguration documents.

Domino Server Type Standard services for all servers


Recommended Tasks Mail Router Replicator Indexer Agent Manager Administration Process

Event Manager Statistics

Mail servers

Calendar Connector Schedule Manager HTTP for Web mail

Application servers

Standard services only, no additional services

Hub servers

HTTP, both mail and applications SMTP (Headquarters hub only)

Web servers

HTTP for Web applications

Internet messaging servers

POP3 and SMTP IMAP LDAP NNTP

438

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Group Naming for Servers


Groups will be used to determine access to servers and for added security. The following naming convention will be used to identify the location and type of group: region[global]descriptionofgroup For example: HQAdmins or GlobalSales. Within groups, names are sorted in alphabetical order.

Deny Access Groups


As an added security feature, Worldwide Corporation will use four groups, which represent access denial to any Worldwide Corporation servers. In each server restrictions setting, these groups will be added in the Not access server elds. The following table describes the four groups.

Group Name Deny Access A-F

Description Denial for people whose surnames begin with A-F. Denial for people whose surnames begin with G-L. Denial for people whose surnames begin with M-R. Denial for people whose surnames begin with S-Z.

Deny Access G-L

Deny Access M-R

Deny Access S-Z

Before deleting a user from the Lotus Domino system, add the user to one of these groups. This will ensure immediate denial to any Worldwide Corporation server.
Note: This is subject to replication of the changes throughout the domain, which will take no longer than 60 minutes.

Server Conguration Plan


The following table describes the server conguration plan.

Standard Application size quotas

Requirement No application size quotas

Copyright IBM Corporation 2007

439

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan Standard Application names File system directory structure Requirement No database naming standards Standard directory structure, for example: \Domino\Data\Global\HR1 \Domino\Data\Global\Marketing \Domino\Data\Local\Marketing \Domino\Data\Local\Dev1 One group for all server administrators, for example: GlobalAdmins Groups for specic categories of employees, for example: GlobalSales

Groups spanning the entire organization

Groups at all sites

A group for each region, for example: EastAll (for all Worldwide Corporation employees in East) One group for administrators per region, for example: WestAdmins (for all server administrators in West)

Client Congurations and Security


Worldwide Corporation has determined congurations for clients, including licensing and registration and desktop settings. Client security has been dened using security policies, including client IDs and certicates and group access to databases.

Client Licenses
Client licenses will be:

Lotus Notes Client for most users, all generic IDs, and any contractual or affiliate accounts. Lotus Domino Designer for users who will create, modify, or design databases. Lotus Domino Administrator for system administrators.

Client Deployment
Desktop, registration, and security policies will be used to set up users environments. For Internet mail, account documents will be created locally for each mail protocol. Mail will be stored in Notes Rich Text format.

440

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix B The Worldwide Corporation Infrastructure Plan

Worldwide Corporation will use policy documents to create and update Location and Connection documents on workstations for dial-up users to determine where and how to locate the servers.

Client IDs and Certicates


The following table describes the policy regarding client IDs and certicates.

Type Lotus Notes client IDs

Policy Certify all IDs using a Lotus Domino certicate. Users responsible for secure or encrypted information, such as pricing information to resellers, will hold an Internet (X.509) certicate. Stored on workstations for all users and encrypted locally. Copies are kept in a secure location by regional as well as corporate administrators.

Internet client browsers

Accept CA certicate as a trusted root. Store internal signed client certicates for access to secure information.

Longer Encryption Keys


Administrators will use the Lotus Domino 8 Certier Key rollover to upgrade user, server, and certier ids taking advantage of the new 2048 bit encryption for users and servers, and 4096 bit keys for certier ids.

File Storage
Client-based data les, such as IDs, Notes.ini, and *.dsk, will be stored on the workstation for all users and encrypted locally.

Implementing the Deployment Plan


Complete these tasks to implement the Lotus Notes and Lotus Domino components of the Worldwide Corporation deployment plan.

Task 1 Set up the rst server.

Procedure

Copyright IBM Corporation 2007

441

Appendix
Appendix B The Worldwide Corporation Infrastructure Plan Task 2 3 4 5 6 7 8 9 10 11 12 13 14 Procedure Add an administrators workstation. Set up access to the Lotus Domino Directory. Add Lotus Domino servers. Add Organizational Units. Register administrators. Add Lotus Notes clients. Create user groups. Create organizational policy. Register users. Set administration preferences. Set up access to servers. Set up server logging. Synchronize Lotus Domino system databases throughout the domain. Route mail internally. Route mail to the Internet. Set mail controls. Test mail routing and delivery.

15 16 17 18

442

Copyright IBM Corporation 2007

Appendix
Extend IBM Lotus Domino Software
Extend IBM Lotus Domino Software

IBM Lotus Domino software offers software that can add functionality to an existing Lotus Domino infrastructure. These add-ons greatly enhance the capabilities of Lotus Domino and provide specic solutions. These solutions can be categorized as: Connectivity extensions

Application extensions

For additional information on any of these products, refer to the IBM Lotus software listings or the Lotus Web site at www.lotus.com.

Domino Connectivity Extensions


The following table lists some of the available products to extend IBM Lotus Notes and Lotus Domino for Web, remote, and mobile access.

Copyright IBM Corporation 2007

Appendix
Appendix C Extend IBM Lotus Domino Software

Add-on DUCS

Denition Lotus Domino Unied Communications Services

Description and Benets Unied Messaging represents the convergence of voice mail, e-mail, and fax so that all messages are stored in a single location and can be accessed from a variety of devices, including telephones and PCs. Unied Communications (UC) takes Unied Messaging a step further by extending message access to additional devices and technologies, such as mobile phones, pagers, personal digital assistants (PDAs), and browsers. In addition, UC provides notication features that will alert subscribers in different ways when they receive a message that meets certain criteria. Lotus has formed partnerships to deliver complete solutions. DUCS provides the platform and these key services on which partners can build Unied Communications solutions that use Lotus Domino as the Unied Message store.

IBM Lotus EasySync Pro

Allows the use of a Personal Digital Assistant (PDA) to: Create new mail messages. Schedule meetings. Update a to-do list. Users can choose exactly which information they want to upload to their desktop by mapping elds from Lotus Notes to a handheld device. EasySync works with the following devices: IBM WorkPads Palm OS computing devices Windows CE/Pocket PC

Lotus Domino Application Extensions


Software available to enhance the Lotus Domino application tools and services are listed in the following table.

444

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix C Extend IBM Lotus Domino Software

Add-on Lotus Domino Enterprise Integration

Denition Composed of: Lotus Enterprise Integrator 6 (LEI 6) Lotus Enterprise Solution Builder (ESB) Lotus Connectors

Description and Benets LEI is a server-based data distribution product that the enables highperformance, scalable exchange of data between Lotus Domino and a large number of host and relational applications, including:

IBM DB2 Oracle Sybase OLE-D Text ODBC data sources ERP applications

IBM Lotus Domino Document Manager

Lotus Domino Document Management

Enterprise-level document control and management system for business documents and corporate information. It supports all key document management features, including: Check-in/check-out Versioning Full-text search across all managed content Audit trails Proling Multi-level versioning Change notication

Lotus Workow

Stand-alone application development tool that works on top of Lotus Domino to provide the ability to develop, manage, and monitor business processes.

Adding to the Lotus Domino Environment


Along with software to add functionality to a Lotus Domino implementation, there are several IBM Lotus software packages that can be added to any environment to improve an organizations communication and collaboration.

Copyright IBM Corporation 2007

445

Appendix
Appendix C Extend IBM Lotus Domino Software

Additional IBM and Lotus Products


The following table lists some of the additional products available from IBM Lotus software. For additional information on any of these products, refer to the IBM Lotus software listings or the Lotus Web site at www.lotus.com.

Software IBM Lotus Sametime


Description Supports immediate communication for users within an organization through secure text messaging, audio and video, or full collaborative meetings. The Lotus Sametime family includes: Lotus Sametime server T-120 compliant and works with Microsoft NetMeeting Works with any browser or with Lotus Notes Has audio and video capabilities to enhance online meetings Lotus Sametime Connect client A range of Application Developer Tools

IBM Lotus QuickPlace

Self-service Web tool for team collaboration. Users can create a secure and central workspace on the Web structured for immediate participation, for teams to: Coordinate people, tasks, plans, and resources Collaborate share ideas and discussion, resolve issues, co-author documents, exchange les, manage due diligence Communicate actions and decisions, key ndings and lessons, publish knowledge captured to a broader base of readership Lotus QuickPlace is available on ve platforms and in fourteen languages. Uses include: Project management Rapid response to ad-hoc initiatives Team Web sites To facilitate discrete business processes that span the extended enterprise and value chain

IBM Lotus Quickr

IBM Lotus Quickr is team collaboration software that helps you share content, collaborate and work faster online with your teams -- inside or outside rewall.

446

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix C Extend IBM Lotus Domino Software Software Lotus Connections Description Collaborative software that combines components to provide connection between people and the work objectives or common interests. The components of Lotus Connections that work together are: Proles Communities Blogs Dogear Activies

IBM Lotus LearningSpace Management System

Lotus LearningSpace is an open, Web-based e-learning solution to train one group or an entire enterprise with a complete e-learning management and delivery system. Lotus LearningSpace is part of IBM Mindspan Solutions, a family of services and technologies designed to support e-learning in the organization. IBM Tivoli Analyzer for Lotus Domino: Is a performance analysis and management solution that runs within the IBM Lotus Domino 6 Administrator, providing the ability to maximize the performance of Lotus Domino server software. Includes: Powerful, predictive analysis tools Intelligent server health monitoring Workload balancing and change management tools IBM Lotus Component Designer V6 is a software development tool that helps developers quickly create new applications that provide rich user interfaces and supporting business logic without writing code. These applications form the constituent components of the work environment delivered by IBM WebSphere Portal Express V6. Previously called Workplace Designer.

IBM Tivoli Analyzer for Lotus Domino

Lotus Component Designer 6.0

Copyright IBM Corporation 2007

447

Appendix
Appendix C Extend IBM Lotus Domino Software Software Lotus Expeditor Description IBM Lotus Expeditor is IBMs universal managed client software to extend composite applications to laptops, desktops, kiosks and mobile devices and is the follow-on release of IBM WebSphere Everyplace Deployment. It can be used to extend your IBM Lotus, IBM WebSphere, IBM Workplace or Eclipse infrastructures to a managed client environment. An alternative to Microsoft.NET client software, Lotus Expeditor provides the exibility that comes from service oriented architecture (SOA) and a standards-based programming model from the OSGi Alliance and the Eclipse Foundation. IBM Lotus Mobile Connect software is a communications software platform to help enterprises provide a mobile virtual private network (VPN) that encrypts data over wireless and wired network connections. The software (the follow-on release to WebSphere Everyplace Connection Manager) helps you efficiently extend your existing instant messaging and enterprise applications to mobile workers. IBM Lotus Organizer 6.1 is an electronic day planner with tabs for each section and pages that turn. You can quickly see all your calendar, contacts, to dos, calls, notes, Web information and more at a glance. No more looking for sticky-note reminders or lost scraps of paper. Its all there, right before your eyes. Collaboration across time zones and locations has never been easier -- or faster. IBM Lotus Sametime software helps you keep pace with your real-time work environment with marketleading, award-winning enterprise instant messaging and Web conferencing capabilities. Lotus SmartSuite delivers powerful desktop tools to the home and office user. A better value. A better way to work the Web. Check out our award-winning spreadsheet, word processor, time and contact manager, presentation software, and database. Lotus Team Workplace will allow your end-users to quickly establish and participate in virtual communities working towards a common set of goals, called teams. These teams can create team workspaces, and start collaborating immediately.

Lotus Mobile Connect

Lotus Organizer 6.1

Lotus Sametime Enterprise Meeting Server Lotus SmartSuite

Lotus Team Workplace

448

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix C Extend IBM Lotus Domino Software Software Lotus Virtual Classroom Description IBM Lotus Virtual Classroom is easy to install and use, allowing you to quickly and easily develop and deliver just-in-time training to various audiences - anywhere, anytime. As one component of the blended learning solution, IBM Lotus Virtual Classroom integrates with IBM Lotus Learning Management System, IBM Workplace Collaborative Learning, or with your existing Learning Management System to protect your current investments. IBM Lotus Workow is a stand-alone application development tool that works on top of IBM Lotus Domino and speeds the creation and deployment of workow-oriented applications. Lotus Workow allows organizations to standardize and streamline time-consuming, people-based activities and track their progress. Business processes can be performed more consistently, with fewer errors, because steps are predened and documented. IBM Workplace Client Technology Client Administrator extends centralized management capabilities, security features and a portal-based desktop environment to bank-branch workstations. Built using IBM Workplace Client Technology software, the Client Administrator application provides a new way for IBM, its customers and IBM Business Partners to develop, deliver and centrally manage end-user applications in a network-centric computing model. The foundation products and components of the IBM Workplace Client Technology, Micro Edition family are available in a single package, Workplace Client Technology, Micro Edition 5.7, which provides an integrated platform for the extension of existing enterprise applications to server-managed client devices. This package provides a platform for the extension of existing enterprise applications to server-managed client devices such as desktop computers, laptop systems, personal digital assistants, (PDAs), and other mobile and pervasive devices. The integrated package combines the tools (WebSphere Studio Device Developer and Micro Environment Toolkit for WebSphere Studio), run-times (WebSphere Everyplace Micro Environment, Service Management Framework, and WebSphere Everyplace Custom Environment), and middleware (DB2e, MQe, Web Services) for building, testing, and deploying server-managed client software to pervasive devices.

Lotus Workow

Workplace Client Technology Client Administrator

Workplace Client Technology Client Micro Edition

Copyright IBM Corporation 2007

449

Appendix
Appendix C Extend IBM Lotus Domino Software Software Workplace Collaboration Services Description IBM Workplace Collaboration Services is a single product that provides a full range of integrated ready-to-use communication and collaboration tools to enable people to do their jobs more effectively anytime, anywhere. IBM Workplace Collaborative Learning is an enhanced IBM Workplace product and part of the integrated collaborative environment delivered by IBM Workplace Collaboration Services. It provides learning services that help organizations manage their training programs more efficiently and integrates learning resources on the desktop. Integration with other Workplace Collaboration Services capabilities delivers blended learning experiences and provides students with enhanced tools such as course discussion areas, document sharing, Web conferencing, and chat rooms. IBM WebSphere Dashboard Framework is a powerful and exible tool for rapidly building, SOA dashboards for WebSphere Portal. WebSphere Dashboard Framework augments the capabilities of WebSphere Portal, adding dashboard-specic features, such as a robust alerting module, hi-delity charting. By leveraging WebSphere Dashboard Framework, companies can quickly deploy highly tailored dashboards that consolidate data and processes from multiple back-end systems. In addition, dashboards built using WebSphere Dashboard Framework can facilitate problem resolution by enabling action right from the dashboard. As a result, with WebSphere Dashboard Framework, companies can help dramatically reduce their development costs and speed the time-to-value for their dashboard initiatives.

Workplace Collaborative Learning

Workplace Dashboard Framework

Workplace Designer

Now called Lotus Component Designer 6.0

450

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix C Extend IBM Lotus Domino Software Software Workplace Documents Description IBM Workplace Documents provides a low cost, standardsbased collaborative document management solution for your employees. IBM Workplace Documents makes it easy to collaboratively create, organize and share important documents and information in a security-rich environment across the organization. The product facilitates document reviews and approvals, versioning, search and private drafts for spreadsheet, presentation, word processing, e-mail, drawing les, project plans and more so you can work collaboratively on demand. It provides a standard browser interface -- though for a more feature enhanced rich client user experience, you can add IBM Workplace Managed Client. IBM Workplace products provide the front-end to IBMs service oriented achitecture (SOA) strategy. IBM Workplace for Business Controls and Reporting helps provide a common platform for companies to easily document, evaluate and report the status of controls management across multiple initiatives in your company. IBM Workplace for Business Controls & Reporting v2.6 is now available - improving business foresight with customizable, self-assessment surveys, more in-depth real-time executive dashboards and an agreement with the ISACA organization to license CoBIT. Now called IBM Lotus ActiveInsight.

Workplace for Business Controls and Reporting

Workplace for Business Strategy Execution IBM Lotus ActiveInsight

IBM Lotus ActiveInsight software is a solution that helps organizations dene and communicate goals, view real-time metrics, and take action via composite, role-based dashboards and scorecards thus helping to improve overall performance. Previously called Workplace for Business Strategy Execution. IBM Workplace Forms enables easy-to-use, open standards-based electronic forms (eForms) that help reduce inefficiencies inherent to paper-based forms. It provides organizations across many industries with security-rich electronic forms that adapt to existing resources and systems, simplify complex forms, enable business process automation, and help speed IT development.

IBM Workplace Forms

Copyright IBM Corporation 2007

451

Appendix
Appendix C Extend IBM Lotus Domino Software Software Workplace Forms Server 2.7 Description IBM Workplace Forms Server 2.7 enables the creation and delivery of XML forms applications. It provides a common, open interface to enable integration of e-forms data with server-side applications using industry-standard XML schemas. IBM Workplace Forms Express V2.6 enables small and medium businesses (SMB) to create a dynamic and intelligent front-end to On Demand Business processes that: Automates lling of the forms Easily retrieves forms via Web site or e-mail Provides a pixel-precise, personalized, and security-rich solution for the most demanding forms Gathers information faster and more accurately with a userfriendly front-end process to an organizations systems Attaches and les associated documents with forms Enables quick approval and sign-off Uses built-in wizards to complete forms faster Gathers information via browser or rich client viewer

Workplace Forms Server Express

Provides IT and IBM Business Partners with robust platform for forms data interchange with back-end systems

Workplace Forms Viewer 2.7 Workplace Forms Viewer Express 2.7 Workplace for SAP software

IBM Workplace Forms Viewer 2.7 is a feature-rich desktop application used to view, ll, sign, submit, and route e-forms, and is able to function on the desktop or within a browser. IBM Workplace Forms Viewer Express 2.7 is a feature-rich desktop application used to view, ll, sign, submit, and route e-forms. IBM Workplace for SAP Software leverages existing SAP investments to help improve people productivity by integrating SAP content with IBM leading collaboration and performance management technology. SAP and IBM capabilities are combined into role-based, high performance work environments.

452

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix C Extend IBM Lotus Domino Software Software Workplace Managed Client Description IBM Workplace Managed Client delivers fully integrated server-managed collaboration to the end users desktop. It provides exibility and portability of client-side applications, combined with server-side control and cost savings traditionally associated with Web-based computing -- for the best of both worlds. IBM Workplace Managed Client capabilities include online and offline access to messaging, documents, instant messaging, Activity Explorer, productivity tools, and data access. IBM Workplace Managed Client is built on IBM Workplace Client Technology, the foundation for next-generation, networkcentric computing. Please contact your IBM sales representative if you are interested in obtaining the IBM Workplace Managed Client. IBM Workplace Services Express gets any team up and running quickly with team collaboration, document management and an integrated portal. Featured Capablilites: Team Collaboration Document Management Ready to use lBM Workplace Team Collaboration -- part of IBM Workplace Collaboration Services -- integrates business instant messaging and presence awareness, Web conferencing, and customizable team spaces. Workplace Team Collaboration can help simplify your infrastructure and business processes while helping bring together team members, increase productivity, improve customer responsiveness and enable faster and better decision making. This helps individuals, teams and entire organizations -- together with their customers, business partners and suppliers -- to be better informed, more productive and more efficient. IBM Workplace products provide the front-end to IBMs service oriented achitecture (SOA) strategy.

Workplace Services Express

Workplace Team Collaboration

Copyright IBM Corporation 2007

453

Appendix
Appendix C Extend IBM Lotus Domino Software Software Workplace Web Content Management Description IBM Workplace Web Content Management software offers end-to-end Web content management -- content can be created (using a WYSIWYG rich text editor), managed and published to multiple Web sites. Streamlines content creation, lifecycle and publication Helps remove Webmaster/IT bottlenecks Publishes information on demand in minutes, not days Helps you tailor and personalize content by role or user preference Ensures a consistent, professional look and feel across multiple sites

454

Copyright IBM Corporation 2007

Appendix

Certication and Exam Competencies


IBM Software Services for Lotus Training and Certication
IBM Software Services for Lotus offers training and certication programs designed to help customers take full advantage of technology investments to improve business processes. Lotus software training ensures that individuals get up to speed quickly and effectively whether delivered in the classroom, on the desktop, or via distributed learning. For more information on Lotus software training, please visit http://www.ibm.com/lotus/training. The IBM Certied Professional for Lotus Software program provides individuals with a means to benchmark their technical knowledge and achieve industry recognition, which results in increased business value to both the individual and their organization. As a member of a highly regarded certied community, individuals enjoy benets commensurate to their certication level. For more information on certication, please visit http://www.ibm.com/lotus/certication. Skills Roadmaps are available to guide you on your path to knowledge. Roadmaps identify courses in their logical sequence to complete a specic curriculum or certication program. To view Skills Roadmaps for Lotus, please visit http://www.ibm.com/lotus/trainingroadmaps.

Lotus Professional Certication


Lotus software has robust certication programs in support of IBM Lotus software and technical skills. For complete information on the Lotus professional certication program, visit the IBM Software Services for Lotus Certication Web page at http://www.ibm.com/lotus/certication.

Copyright IBM Corporation 2007

Appendix
Appendix D Certication and Exam Competencies

Place in certication
Fundamentals of IBM Lotus Domino 8 Application Development is listed as one of the preparation resources for the following exam: Exam 834 - IBM Lotus Notes Domino 8 Application Development Foundation Skills This exam is part of the path for IBM Certied Application Developer - Lotus Notes and Domino 8 certication. The complete path is described here: IBM Certied Associate Developer - Lotus Notes and Domino 8 Exam 834 -IBM Lotus Notes Domino 8 Application Development Foundation Skills IBM Certied Application Developer - Lotus Notes and Domino 8 Successfully pass the following three exams:

Exam 834 - IBM Lotus Notes Domino 8 Application Development Foundation Skills Exam 835 - IBM Lotus Notes Domino 8 Application Development Intermediate Skills Exam 836 - IBM Lotus Notes Domino 8 Developing Web Applications

IBM Certied Advanced Application Developer - Lotus Notes and Domino 8 Exam information not yet available.

Preparing for a Lotus certication exam


Attending this course and using this Student Guide will help you prepare for certication. Some topics covered on the exam are not covered in this course and some of the objectives covered in this course are not tested on the exam. Be sure to follow all the steps listed in order to prepare fully for the exam.

Step 1 2 3 4

Action Review the exam competencies. Get hands-on experience. Use the exam preparation page. Use all available resources.

456

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix D Certication and Exam Competencies

Step 1: Review the exam competencies


Review the exam competencies to see the complete listing of possible topics for the exam. Use the competency listing as your checklist to determine your weaknesses and the areas on which you will want to focus more attention in your studies and preparation. You will nd the competencies listed in: The Exam Competencies Appendix included in this course.

The Exam Guides located on the IBM Software Services for Lotus Certication Web page at http://www.ibm.com/lotus/certication.

Step 2: Get hands-on experience


Actual hands-on experience is a critical component in preparing for the exam. The exam is looking to measure how well you perform tasks, not how well you memorize features and functions: Spend time using the product and applying the skills learned.

Direct application of the skills learned in this class cannot be replaced by any other single resource listed here.

Step 3: Use the exam preparation page


The exam preparation page lists resources available for each individual exam. To nd the exam preparation page for this exam, go to http:// www.ibm.com/lotus/certication and use the Select an exam drop-down menu. Select the exam name and link to the exam preparation page.

Step 4: Use all available resources


We recommend using a range of resources when preparing to take an exam. The following table describes the types of resources available to prepare for certication exams. For a listing of resources specic to each exam, use the individual exam preparation page located at http://www.ibm.com/ lotus/certication.

Resource Exam guides

Brief description Complete version includes certication titles and paths, sample questions, and registration information.

Where to nd resource Abbreviated version is available in the Exam Competencies Appendix included in this course. Complete version is available on the IBM Software Services for Lotus Certication Web page at http:// www.ibm.com/lotus/ certication.

Copyright IBM Corporation 2007

457

Appendix
Appendix D Certication and Exam Competencies Resource Lotus authorized courses Brief description Offered at Education Centers for IBM Software (ECIS) and Lotus education locations worldwide. Where to nd resource A complete list of courses and education centers are on the IBM Software Services for Lotus Education Web page at http:// www.ibm.com/lotus/ education. Additional information is available at The Education Store on the IBM Software Services for Lotus Education Web page at http:// www.ibm.com/lotus/ education. Available from the IBM Software Services for Lotus Certication Web page at http:// www.ibm.com/lotus/ certication. See the individual exam preparation page for recommended online learning resources. Additional information available at http://www10.lotus.com/ldd/doc. Ordering information is available at http:// www.redbooks.ibm.com.

CBT programs

Used as an alternate learning tool or supplement to courses or both.

Practice tests

Available from a variety of vendors. Visit the individual exam preparation page to determine what practice tests are available for a specic exam. This includes online tutorials and other learning resources.

Online learning

Product Documentation

Official Lotus product documentation.

IBM Redbooks

Technical cookbooks that address topics that the reference manuals may not cover.

458

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix D Certication and Exam Competencies

Preparing for the IBM Lotus Notes Domino 8 Application Development Foundation Skills exam
The following materials are available for the IBM Lotus Notes Domino 8 Application Development Foundation Skills exam: Fundamentals of IBM Lotus Domino 8 Application Development Course

CertFX Practice Test Notes, Domino, and Domino Designer 8 Release Notes Lotus Domino 8 Administrator Help

For the most up-to-date resource listing for this exam, visit the individual exam preparation page. Go to http://www.ibm.com/lotus/certication and select the exam name from the Select an exam drop-down menu. These individual pages will give you the most up to date list of resources available.

IBM Lotus Notes Domino 8 Application Development Foundation Skills Exam Competencies
The exam competencies are one tool for preparing for IBM Certied for Lotus Software exams. The exam competencies along with a complete listing of learning resources are included on the Lotus Certication Web site available at www.lotus.com/certication.

Copyright IBM Corporation 2007

459

Appendix
Preparation Checklist

Instructor Preparation
When preparing to teach this course, consider doing the following: Read through the Instructor Edition. Perform all activities in the manual. Perform all demonstrations and walkthroughs described in the Instructor Notes and Demo Notes. Refer to the Interactive Instructor Guide (IIG) to get updated information on the course. Refer to the Instructor Lounge to gather useful teaching tips and techniques that other instructors have used to teach this course. Use the information in this section to nd additional resources to further your knowledge of the subject. Practice the classroom setup.

Course Strategy
Approach
Fundamentals of IBM Lotus Domino Designer 8 is the rst course in the Lotus Domino 8 Application Development curriculum. This course takes four full days to deliver correctly. The intent of the design of this course is to give the students a solid foundation in designing and developing Lotus Domino applications. Students learn about working with the basic building blocks in a Lotus Domino application, and working with the Formula language. They also learn how to add to the basic building blocks with more advanced functionality such as automating the application and securing it. Finally, they learn how to manage an application in a production environment, and what they need to know, or be able to do, to deploy it.

Copyright IBM Corporation 2007

Appendix
Appendix E Instructor Preparation

Scenario
Worldwide Corporation is an international pottery manufacturer. The company sells ceramics worldwide. Products include tiles, china, and various kinds of pottery. The corporate office houses manufacturing, research and development, product management, quality control, human resources, and system administration. There are several smaller sales offices and resellers throughout each region, and some sales representatives work from their homes. The Policies and Procedures application that you will design and develop will contain corporate policies and procedures for Worldwide Corporation. It will also contain a discussion forum so that employees can ask questions about policies and procedures.

Recommended Agenda
The tables that follow describe the recommended agenda for delivering the material over the four days.

Day 1
The following table shows the recommended agenda for Day 1.

Time 30 minutes 1 hour 30 minutes

Lessons or Topics Course and student introductions Lesson 1: Exploring Applications in Lotus Domino 8 Lesson 2: Exploring the Lotus Domino 8 Design Environment Lesson 3: Creating Applications Lunch Lesson 3: Creating Applications continued Lesson 4: Creating Pages

1 hour 1 hour 30 minutes 3 hours

Day 2
The following table shows the recommended agenda for Day 2.

Time 2 hours, 30 minutes 1 hour

Lessons or Topics Lesson 5: Creating Forms

Lunch

462

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix E Instructor Preparation Time 2 hours 1 hour 1 hour, 30 minutes Lessons or Topics Lesson 6: Creating Views Lesson 7: Introducing Formulas Lesson 8: Using Formulas in Forms

Day 3
The following table shows the recommended agenda for Day 3.

Time 3 hours 1 hour, 30 minutes 1 hour 2 hours, 30 minutes

Lessons or Topics Lesson 8: Using Formulas in Forms continued Lesson 9: Using Formulas in Views

Lunch Lesson 10: Enhancing Forms

Day 4
The following table shows the recommended agenda for Day 4.

Time 1 hour 1 hour, 30 minutes 1 hour 1 hour 2 hours 1 hour

Lessons or Topics Lesson 11: Enhancing Views Lesson 12: Working with Actions

Lesson 13: Working with Agents Lunch Lesson 14: Securing Applications Lesson 15: Deploying Applications

Copyright IBM Corporation 2007

463

Appendix
Appendix E Instructor Preparation

CLI Private Site


For more information on how to teach this course, refer to the CLI Private Site located at http://www.lotus.com/cli. If you have already registered, enter your user name and password to access the Instructor Lounge and other private areas of the Web site to gain additional information for teaching this course. If you have not registered, visit the Education Zone located at http:// www.lotus.com/educationzone and follow the instructions to register for the certied community. After registering, you will be able to access the CLI Private Site using your user name and password.

CLI Certication Requirements


To learn about the requirements for becoming a CLI or to upgrade your current certication, visit the IBM Software Services for Lotus Certication Web site at http://www.lotus.com/certication.

Additional Instructor Preparation Information


The following table lists and describes additional resources you can use to prepare to teach this course.

This Resource IBM Redbook titled Lotus Domino Designer 6: A Developers Handbook, SG24-6854-00, ISBN: 0738414123 Note: Check the Redbook site for more updated information as it becomes available: http:// www.redbooks.ibm.com/redpieces/ abstracts/redp4102.html

Will Help You Learn More About... Developing applications for Lotus Domino Designer 6 and 7. These applications can be used by different clients, such as Notes clients, Web browsers, or mobile devices. Those readers who are familiar with developing applications using Release 5 of Lotus Domino may want to move straight to the chapter that introduces the new features in Lotus Domino 6.0 and continue from there. The chapters towards the end of the book will discuss different programming languages, @functions, LotusScript, JavaScript, and Java, which can be used in Lotus Domino. We describe in detail how to manipulate rich text objects by programming as well as XML in Lotus Domino.

464

Copyright IBM Corporation 2007

Fundamentals of IBM Lotus Domino 8 Application Development


Appendix E Instructor Preparation This Resource http://www-10.lotus.com/ldd Will Help You Learn More About... Lotus Domino 8 information directly from the people who developed the product. This is the Lotus Developer Domain (LDD) site, the premier Web site for technical information about Lotus software from IBM.

Copyright IBM Corporation 2007

465

Solutions Lesson 1
Activity 1-1:
13. Who last updated the document?
Answers will vary, but might include Doctor Notes.

14. When was the document created?


Answers will vary, but might include 12/05/2005.

15. What is the data type for the CustomerID item?


Number.

Copyright IBM Corporation 2007.

Solutions

Lesson 7
Activity 7-1:
1.
You are designing a form with a number of elds. Some elds on the form require an initial value that is changeable by the user. Other elds require a computed value. Some actions may need to be hidden from certain users. a) LotusScript b) JavaScript c) Formula language d) Java

2.

The application that you are designing requires that you get some of the input from dialog boxes. a) Formula language b) JavaScript c) LotusScript d) Java

3.

The application you are creating requires access to documents in applications other than the one in which it is saved. a) Formula language b) LotusScript c) JavaScript d) Java

4.

You are creating an application that requires some fairly complex interaction with the user. In the past, you have had moderate success at automating a series of tasks, but you do not have extensive experience in programming. a) Formula language b) LotusScript c) JavaScript d) Java

468

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

5.

The application that you are developing involves an extensive amount of interaction with the user. You will need to validate eld contents, position the cursor, and perform other actions in the user interface. a) Formula language b) LotusScript c) JavaScript d) Java

6.

You are working on a process that involves complex ow control, including loops and multiple conditional branches. You have no idea, as you are writing this process, how many times it will need to be executed. a) Formula language b) LotusScript c) JavaScript d) Java

7.

An application is not performing as well as users would like. In analyzing the application, you nd that while it is very user friendly, some of the formulas are performing very poorly. Which languages would you use to replace the formulas to improve the performance of the user interface? a) Formula language b) LotusScript c) JavaScript d) Java

Activity 7-2:
1. 2. 3. 4. 5. 6. 7. 8. 9.
FirstName: Susan LastName: LastName FirstName + LastName: SusanSunshine LastName + , + FirstName: Sunshine, Susan FirstName = Susan: True (FirstName != Larry) & (LastName = Sunshine): True @Adjust (@Created; 0; 6; 0; -2; 0; 0): 6/30/2006 9:59:37 PM @If (@Created < @Today; Old; New): Old @Text (10.22): Text value, 10.22

Copyright IBM Corporation 2007.

469

Solutions

10. fullName := FirstName + + LastName; Welcome back, + fullName:


Welcome back, Susan Sunshine

Lesson 14 Follow-up
Lesson 14 Lab 1
1. 2. 3. 4. 5. 6. 7.
For the Default user type, the Depositor access control level should be used. For the Anonymous user type, the No Access access control level should be used. For the Employees group, the Author access control level should be used. For the Policy Makers group, the Editor access control level should be used. For the Department Head, the Author access control level should be used. For the Managers group, the Manager access control level should be used. For the Designer, the Designer access control level should be used.

470

Copyright IBM Corporation 2007.

Glossary
@function A built-in formula that performs calculations and either returns a value or performs an action. action A program associated with either a view or a form and used to automate tasks for users. alias Another name for a page or other design element. application A solution to a particular problem that may include one or more databases and other components. bookmark A feature used for easy access to frequently used applications and databases. categorization A process by which related documents are grouped together in a view based on the column value. data note Also known as a document, it is a specic kind of note that stores data. design elements The building blocks for applications in Lotus Domino Designer. event The part of an object that initiates code execution and includes opening a database, opening a view, opening a document, moving the cursor into or out of a eld, and so on.

Copyright IBM Corporation 2007.

Solutions

extended products A family of products that extends and enhances the value of a Lotus Domino environment to increase organizational productivity and responsiveness through business-critical collaboration solutions. eld A part of a form that collects, calculates, or displays data. form event An event that is triggered when a document is opened, saved, refreshed, closed, or switched between read and edit mode. form A design element through which data is entered and displayed. Formula language The core language built into Lotus Notes and Lotus Domino from their earliest releases that provides a straightforward and simple programming interface within Lotus Domino applications. Hide/When A property that controls when an element is visible to users or a specic set of users. hierarchical view A view that displays main documents and their associated response documents, and visually distinguishes between them. IDE (Integrated Development Environment) A Lotus Domino Designer environment that provides for writing code in a Lotus Domino application. item A container that stores data from a note, which is identied by a name and contains a list of values. JavaScript A scripting language integrated in Lotus Domino Designer that allows Lotus Domino applications to support users with Web browsers. list A named entity that contains multiple values of the same data type in Lotus Domino. Lotus Domino server A computer that runs the Lotus Domino server program and stores Lotus Notes applications.

472

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

LotusScript An embedded basic scripting language that offers access to Lotus Domino data and services beyond the capabilities of the Formula language. metadata Information about data that is available to the application and the Lotus Domino services. NIF (Notes Index Facility) A Lotus Domino application functionality, which builds and maintains lists for locating data in the application. note A single and simple data structure in Lotus Notes and Lotus Domino used to store data and design elements. NRPC (Notes Remote Procedure Call) A mechanism for transmitting client requests to the Lotus Domino application and returning the results. NSF (Notes Storage Facility) A Lotus Domino database functionality, which maintains the data and design elements of the application. object An element, such as a form, eld, and so on, into whose event code is placed. replica database A database that shares the same replica ID with other databases. replication A process of synchronizing multiple instances, or copies, of a application on multiple servers and workstations. shared resource An element, such as a graphic le, stored within a Lotus Domino application. sorting Organizing documents in a view, displaying them in a specic order. statement A component of formulas that consists of a combination of variables, constants, operators, @functions, and keywords. table An element used to organize content into rows and columns.

Copyright IBM Corporation 2007.

473

Solutions

template An application that contains the structure for a particular application, but does not contain any data. View design element Creates an organized list of documents so that users can nd the information they need. view index An internal ling system that stores the list of documents in a view.

474

Copyright IBM Corporation 2007.

Index
A
access control, 329 access control levels, 323 access control list dening roles, 328 Access Control List, 20 Access Control List dialog box, 321 access level options, 325 ACL See: Access Control List action, 287 buttons, 297 creating, 287 display, 288 order, 296 shared, 294, 295 sub, 296 system, 291 Action bar, 299 Action bar applet, 300 Action Bar Property box, 300 Action pane, 288 Action Property box, 289 actions displaying, 298 Add Condition dialog box, 128 Advanced tab, 279 agent activated, 313 event, 313 names, 316 Agent Property box, 309 agents, 307 private, 308 shared, 308 alias, 62 anonymous users, 339 application, 3 high-security, 340 low-security, 339 application notes, 90 application security, 321 automating tasks, 19 AutoSave, 247 AutoSave application, 247

B
Background tab, 224 Basics tab, 310 bookmarks, 49

C
categorization, 141 Cell Borders tab, 71 Column Info tab, 216 Column Properties box, 133, 216 @Commands, 292
Copyright IBM Corporation 2007.

Index

comments, 170 concatenation, 213 conditional statements, 167 connecting to Lotus Domino, 151 constants, 162 in formulas, 162

D
data note, 14 @DbColumn function, 192 deployment, 349 design elements, 35 display pages, 57 document access, 333 Document Properties box, 15 document relationships, 244

E
Embedded View Property box, 277 event, 160 external programming languages, 150

F
eld, 96 Author, 106 Authors, 336 Computed, 182 Computed for display, 181 Computed when composed, 182 data type, 98 Date/Time, 107 Department, 110 design considerations of, 99 inherit, 237 list, 102 MsgType, 234 Name, 106 names, 97 Number, 107 Readers, 334 rich text, 99 shared, 235

text, 99 value options of, 98 Field Info tab, 100, 108 Field Properties box, 100 elds characteristics of, 96 folders, 49 form, 89 programming, 177 related, 242 form design, 91 form event, 178 form names, 93 Form Properties box, 92 Form Type property, 243 forms, 19 adding text and tables to, 94 elements used in, 90 Formula language, 151, 158 Formula Language commenting, 170 formulas common uses of, 177 functions @Failure, 187 list, 189 @Success, 187 @Functions, 166 common, 166 examples of, 167

H
Hide/When, 109 conditions for using, 110 hotspots, 301

I
IBM Lotus Notes errors, 198 IBM Lotus Domino Designer Help, 37 IBM Lotus Domino server, 5 IBM Lotus Sametime, 251

476

Copyright IBM Corporation 2007.

Fundamentals of IBM Lotus Domino 8 Application Development

IBM LotusScript, 152 IBM Workplace, 26 icon custom, 218 icons predened, 217 image shared, 79 Image Resource Properties box, 80 images, 77 initial view properties, 125 input translation formula, 184 input validation formulas, 186 insert image resource, 81 instant messaging chat action buttons, 293 Instant Messaging Contact List, 253 Integrated Development Environment (IDE), 150 Also See: IDE @IsError, 199 @IsNewDoc function, 180 item, 13

Lotus Lotus Lotus Lotus Lotus

Domino Domino Domino Domino Domino

containment model, 12 extended products, 25 objects, 160 Programming, 149 security layers, 20

M
metadata, 13

N
navigation, 19 NIF see Notes Index Facility, 13 Notes, 11 Notes Index Facility, 13 Notes Remote Procedure Call (NRPC), 7 Notes Storage Facility, 13 NSF see Notes Storage Facility, 13

O J
Java, 153 Java view applet, 275 JavaScript, 154 objects, 160 operators, 163 comparison, 164

P L
layer anchor, 224 hide, 228 resize and reposition, 226 Layer Anchor Property box, 224 Layer position tab, 226 Layer Property box, 224 Layer Tree, 228 layers, 223 benets of, 223 link column, 280 list, 189 list functions, 191 page design element, 55 page names, 61 Page Properties box, 60 Picture Properties box, 78 previews, 64 Programmers pane, 37 @Prompt function, 194

R
replica databases, 23 replication, 22 replication control, 352 responses-only column, 264

Copyright IBM Corporation 2007.

477

Index

reusable code, 196 roles, 328 run-time errors, 197

S
scheduling events, 314 SELECT @All formula, 211 SELECT statement, 312 shared column, 266 shared resource, 79 simple searches preventing, 138 sort index creation deferring, 139 sorting, 136 Sorting tab, 136 statement, 158 @StatusBar function, 198 subform, 231 computed, 234 create, 232 Subform Property box, 233 syntax rules, 159

master, 351 text data, 99 text formatting functions, 184 Text Properties box, 64 @Text. function, 214 @ThisName, 196 @ThisValue, 196 threaded discussions, 245

U
user access levels, 324 user types, 327

V
variables, 162 temparary, 163 view aliases, 126 building, 121 characteristics of, 119 creating, 124 design, 123 embedded, 274 hierarchical, 263 view columns, 131 View design element, 119 view events, 209 view index, 120 View Properties box, 143 View Property box, 278 views, 19

T
table, 68 types of, 68 Table Borders tab, 73 Table Layout tab, 70 Table Margins tab, 73 Table Programming tab, 75 Table Property box, 69 Table Row tab, 74 Table/Cell Background tab, 72 tables and the Web, 69 template, 41, 350

W
window titles, 179 Work pane, 37

478

Copyright IBM Corporation 2007.

IBMD8510sg_10

99751 13001

Vous aimerez peut-être aussi