512
Fundamentals of IBM ® Lotus ® Domino ® 8 Application Development Student Guide

IBMN8D510

Embed Size (px)

Citation preview

Page 1: IBMN8D510

Fundamentals of IBM® Lotus® Domino® 8ApplicationDevelopmentStudent Guide

Page 2: IBMN8D510

Fundamentals of IBM® Lotus® Domino® 8ApplicationDevelopmentStudent Guide

Page 3: IBMN8D510

Fundamentals of IBM® Lotus® Domino®

8 Application Development

Part Number: 085138Course Edition: 1.0

NoticesDISCLAIMER: You may not copy, reproduce, translate, or reduce to any electronic medium or machine-readable form, in whole or in part, any documents, software, or files provided to you without prior writtenconsent of IBM Corporation, except in the manner described in the documentation. While every reasonableprecaution has been taken in the preparation of this manual, the author and publishers assume noresponsibility for errors or omissions, nor for the uses made of the material contained herein and the decisionsbased on such use. Neither the author nor the publishers make any representations, warranties, or guaranteesof any kind, either express or implied (including, without limitation, any warranties of merchantability, fitness fora 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, andeach of their total liability for monetary damages shall not exceed the total amount paid to such party for thisbook.

TRADEMARK NOTICES The following terms are trademarks or service marks of International BusinessMachines 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, LotusEnterprise Integrator®, Lotus Notes®, Lotus Workflow, Mobile Notes, Netfinity®, 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 UnitedStates, other countries, or both.

Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in theUnited States, other countries, or both.

Intel, Intel Inside (logos), MMX and Pentium are trademarks of Intel Corporation in the United States, othercountries, 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 priorwritten consent of IBM, except in the manner described in the documentation or the applicable licensingagreement 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 ScheduleContract with IBM Corporation.

You must purchase one copy of the appropriate kit for each student and each instructor. For all other educationproducts you must acquire one copy for each user or you must acquire a license for each copy provided to auser.

Page 4: IBMN8D510

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Page 5: IBMN8D510

Table of Contents

Fundamentals of IBM® Lotus® Domino® 8 ApplicationDevelopment

Lesson 1: Exploring Applications in IBM® Lotus®

Domino® 8

Topic A. Identify Application Types and Data Sources. . . . . . . . . . . . . 2

Lotus Domino Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Domino Application Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Data Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Topic B. Examine the IBM® Lotus® Domino® Architecture . . . . . . . . . . 4

Lotus Domino Infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Application Access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Lotus Domino Application Structure . . . . . . . . . . . . . . . . . . . 11

Access Document Properties . . . . . . . . . . . . . . . . . . . . . . . . . 15

Topic C. Examine IBM® Lotus® Domino® Application Components . . 19

Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

Task Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Security Layers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Topic D. Investigate Replication and Application DesignConsiderations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

Replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Replication Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 24

© Copyright IBM Corporation 2007.

Page 6: IBMN8D510

Topic E. Extend IBM® Lotus® Domino® Collaboration Capabilities . . . 24

Lotus Domino Extended Products . . . . . . . . . . . . . . . . . . . . . 25

IBM Workplace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Other Products and Technologies . . . . . . . . . . . . . . . . . . . . . 27

Lesson 2: Exploring the IBM® Lotus® Domino® 8Design Environment

Topic A. Explore the IBM® Lotus® Domino® Designer User Interface. . 32

Opening Lotus Domino Designer . . . . . . . . . . . . . . . . . . . . . . 34

Identifying the Areas of the Design User Interface . . . . . . . . 34

Topic B. Access Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Accessing Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Lesson 3: Creating Applications

Topic A. Create a New, Blank Application in IBM® Lotus® DominoDesigner® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Methods to Create an Application . . . . . . . . . . . . . . . . . . . . 42

The New Application Dialog Box . . . . . . . . . . . . . . . . . . . . . . 42

Topic B. Create a Copy of an Existing Application . . . . . . . . . . . . . . . . 43

Copying an Application Design. . . . . . . . . . . . . . . . . . . . . . . 44

Topic C. Create an Application from a Template . . . . . . . . . . . . . . . . . 47

Using a Template to Create an Application . . . . . . . . . . . . . 47

Topic D. Organize the IBM® Lotus® Domino Designer® Environment. . 49

Managing the Lotus Domino Designer Environment . . . . . . 49

Folders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 7: IBMN8D510

Lesson 4: Creating Pages

Topic A. Explore Page Content, Layout, and Navigation Basics . . . . . 54

The Page Design Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Types of Page Information . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

Content Organization Design Elements . . . . . . . . . . . . . . . . 55

Programmable Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Navigational Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

Ways to Display Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

When to Use Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

Design Elements Not Available on Pages . . . . . . . . . . . . . . . 58

Topic B. Create Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

Page Development Process. . . . . . . . . . . . . . . . . . . . . . . . . . 60

The Page Properties Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

Page Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Aliases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Topic C. Add Text to Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Text Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Text Formatting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Previews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

Topic D. Use Tables to Lay Out Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

Table Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

Table Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Setting Table Programming Properties . . . . . . . . . . . . . . . . . 75

Topic E. Add Images to Pages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

Shared Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

Using Image Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

© Copyright IBM Corporation 2007.

Page 8: IBMN8D510

Lesson 5: Creating Forms

Topic A. Create Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

Form Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

Form Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

Adding Text and Tables to a Form . . . . . . . . . . . . . . . . . . . . . 94

Topic B. Add Fields to Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

Field Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Field Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

Field Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

Field Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . 99

Text Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 9: IBMN8D510

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.

Page 10: IBMN8D510

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 11: IBMN8D510

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.

Page 12: IBMN8D510

Topic C. Display Icons In a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

Displaying Icons In a View . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216

Creating a Column Icon Formula . . . . . . . . . . . . . . . . . . . . . 216

Predefined 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

Benefits of Shared Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 13: IBMN8D510

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 inForms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

Instant Messaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

Online Status Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

Instant Messaging Contact List . . . . . . . . . . . . . . . . . . . . . . . 253

Lesson 11: Enhancing Views

Topic A. Define 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 inViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

Enabling a Column for Instant Messaging. . . . . . . . . . . . . . . 272

© Copyright IBM Corporation 2007.

Page 14: IBMN8D510

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 EmbeddedViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 15: IBMN8D510

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-clickMenus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 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.

Page 16: IBMN8D510

Lesson 14: Securing Applications

Topic A. Explore Application Access . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

Application Security Overview. . . . . . . . . . . . . . . . . . . . . . . . 321

Access Control Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321

Access Control Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323

User Identifiers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323

User Access Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

Displaying an Application’s Access Control List . . . . . . . . . . 324

Access Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

User Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

Topic B. Implement Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

Defining Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

Access Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

@Functions and Roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

Comparing the User’s 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007.

Page 17: IBMN8D510

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 CorporationInfrastructure Plan

Appendix C: Extend IBM® Lotus® Domino® Software

Appendix D: Certification and Exam Competencies

Appendix E: Instructor Preparation

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475

© Copyright IBM Corporation 2007.

Page 18: IBMN8D510

About This CourseThe course provides the information that developers need to know tosuccessfully 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 theelements and skills that are used in creating single-database LotusDomino applications, describes how the formula language can be usedto enhance the functionality of a Lotus Domino application, and explainshow Lotus Domino applications can be secured.

Course Description

Target StudentThe target audience for this course is application developers who arenew to developing Lotus Domino applications and who need to acquirethe fundamental skills to develop and modify single-database applica-tions in IBM Lotus Domino Designer 8.

Course PrerequisitesThe prerequisites for this course include experience using the IBM®

Lotus Notes® client, Web browser or both to access applications. Experi-ence in developing one or more applications using other applicationdevelopment tools is recommended.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction i

Page 19: IBMN8D510

How to Use This Book

As a Learning GuideEach lesson covers one broad topic or set of related topics. Lessons arearranged in order of increasing proficiency with Lotus Domino and LotusNotes; skills you practice in one lesson are used and developed in subse-quent lessons. For this reason, you should work through the lessons insequence.

Each lesson is organized into results-oriented topics. Topics include all therelevant and supporting information you need to master Lotus Domino andLotus Notes, and activities allow you to apply this information to practicalhands-on examples.

As a Review ToolSome of the information covered in class may not be relevant to your envi-ronment immediately, but it may become important later on. For this reason,we encourage you to spend some time reviewing the topics and activitiesafter the course. The course can also be used in preparation for Lotus certi-fication exams.

As a ReferenceThe organization and layout of the book make it easy to use as a learningtool and as an after-class reference. You can use this book as a first sourcefor definitions of terms, background information on given topics, and sum-maries of procedures.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

ii Introduction

Page 20: IBMN8D510

Course ObjectivesAfter completing this course, you should be able to:

• Receive an overview of application types, data sources, and how theyare deployed in the IBM Lotus Domino architecture.

• Explore the IBM Lotus Domino Designer user interface and accesseddesign elements.

• Create an original application structure, an application structure copiedfrom a previously designed application, and an application structurebased 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 beused 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, andinstant 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction iii

Page 21: IBMN8D510

Course Requirements

HardwarePrimary Classroom Server

The following list details the minimum hardware necessary for the setup ofthe primary classroom server:

• At least 1 GB of RAM per CPU. However, for optimal performance, youmight 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 diskspace 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 file server for installation.

Instructor and Student Clients

The following list details the minimum hardware necessary for the setup ofthe 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 file server for installation.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

iv Introduction

Page 22: IBMN8D510

SoftwarePrimary Classroom Server

The following software is required for the primary classroom server. Pleasenote that proper licensing for all software is required and is the responsibilityof the training organization.

• Microsoft® Windows® Server 2003 (Standard or Enterprise Edition) (thelatest 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 com-puters. Please note that proper licensing for all software is required and isthe responsibility of the training organization.

• Windows® XP Professional or Windows® 2000 Professional, with allapplicable Service Packs.

• IBM Lotus Notes 8.

• IBM Lotus Domino Administrator (for instructor) and IBM Lotus DominoDesigner 8 for all clients.

• Microsoft® Internet Explorer® 6.0 or above, with all applicable ServicePacks.

• Sun® Java™ Runtime Environment (JRE), Java 2 v1.4.2 or higher.

• TCP/IP using either Hosts file or DNS with server and domain namesdefined in the TCP/IP protocol configuration.

Class Setup

Domino Naming Used in This CourseThis course uses the following hierarchical naming scheme.

Table 0-1: Domino naming schemeNaming Component Classroom Implementation

Organization certifier /WWCorp

Domain WWCorp

Instructor server Hub/SVR/WWCorp

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction v

Page 23: IBMN8D510

Naming Component Classroom Implementation

Instructor account Doctor Notes/WWCorp

Student Accounts Student ND##/East/WWCorpWhere ##, add student numbers 01through 12.

Course Setup FilesThe following table describes the course setup files.

Table 0-2: Course setup filesTitle File Name Function

WWCorp’s Directory names.nsf Used to set up the class-room servers andadministrators.Note: Student ID files arecontained in names.nsf.

WWCorp certifier ID file wwcorp.id Organizational level certi-fier for the wwcorpdomain.

Hub/SVR/WWCorp serv-er’s ID file

hub.id Server ID file for theclassroom server (Hub/SVR/WWCorp)

Doctor Notes user ID file dnotes.id User ID file for theinstructor.

Doctor Notes mail file dnotes.nsf Mail file for the instructor.

User mail files snd##.nsf Student mail filesWhere## is the student num-bers 01–12.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

vi Introduction

Page 24: IBMN8D510

Course Data FilesThroughout 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 yourinstructor to demonstrate tasks and features, you will occasionallyaccess this application during the course.

● Policies and Procedures application. You will create this application bycompleting the practice activities in this course.

The following table describes the course data files.

Table 0-3: Course data filesFile Name Function

Instructor_D8510.nsf Instructor demonstrations

Policies7Start.nsfPolicies10Start.nsfPolicies12Start.nsfPolicies14Start.nsf

Helpful lab starter files to be used asnecessary

PoliciesACL.nsf Lesson 14 lab file

Practice_D8510.ntf Student activity practice template

PoliciesFinal.nsf Completed lab files

PracticeFinal.nsf Completed activity files

D8510_Graphics.zipPagesForms.exeReplication.exe

Instructor files

Classroom Setup TasksComplete the tasks in the following table to set up the classroom prior to thestart of class. Detailed procedures for each task appear on the followingpages.

Table 0-4: Classroom setup tasksTask Procedure

1 Install the Lotus Domino server.

2 Install the required client software on the instructor and student machines.

3 Install supplied files to the classroom machines.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction vii

Page 25: IBMN8D510

Task Procedure

4 Edit hosts files on each classroom machine.

5 Set up the classroom server.

6 Set up the classroom workstations.

Task 1: Install the Lotus Domino ServerFollow these steps to install Windows Server 2003 and applicable ServicePacks on the classroom server.

Table 0-5: Install Windows Server 2003 and Service Packs on the class-room server

Step Action

1 Prior to starting the installation verify the following settings:

● Computer name is Hub

● The appropriate data and time settings are configured for your locale.

2 The IP addresses can be any convenient value, consistent with the existingnetwork configuration.Configure 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 class-room server.

Table 0-6: Install Lotus Domino server software on the classroomserver

Step Action

1 Run the Lotus Domino 8 server install program, Setup.exe, from aCD-ROM or other installation medium.

2 On the Welcome screen, click Next.

3 Read the Software License Agreement, and then click I accept the termsin the license agreement to agree with the terms.Click Next.

4 Accept the default location for the installation files.Click Next.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

viii Introduction

Page 26: IBMN8D510

Step Action

5 Accept the default location for the data files.Click Next.

6 Verify that Domino Enterprise Server is selected, and then click Next.

7 Review the configuration, and then click Next to begin copying files.

8 Click Finish to complete the installation.

Task 2: Install the Required Client Softwareon the Instructor and Student MachinesFollow these steps to verify settings on the instructor and student clients.

Table 0-7: Verify the settings on the instructor and student client com-puters

Step Action

1 Prior to starting the installation, verify the appropriate data and time settingsare configured for your locale.

2 The IP addresses can be any convenient value, consistent with the existingnetwork configuration.Configure the network to use the TCP/IP protocol, with the following set-tings:

● 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 computerStep Action

1 Run the IBM Lotus Notes 8 client install program, Setup.exe, from aCD-ROM or other installation medium.

2 On the Welcome screen, click Next.

3 Read the License Agreement. Select I accept the terms in the licenseagreement, and then click Next.

4 Accept the default folders to change the location to install Lotus Notes.Click Next.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction ix

Page 27: IBMN8D510

Step Action

5 On the features setup screen, select Domino Administrator, DominoDesigner, and click Next.

6 Verify the installation summary screen and click Install.

7 When the Install Wizard completes, click Finish.

Follow these steps to install the Lotus Notes and Lotus Domino Designerclient software on the student clients.

Table 0-9: Install software on the student client computersStep Action

1 Run the Lotus Notes 8 client install program, Setup.exe, from a CD-ROMor other installation source.

2 On the Welcome screen, click Next.

3 Read the License Agreement. Select I accept both the IBM and thenon-IBM terms, and then click Next.

4 Accept the default folders, or click Browse to change the location toinstall Lotus Notes.Click Next.

5 On the Features Setup screen, select Domino Designer, and click Next.

6 Verify the installation summary screen and click Install.

7 When the Install Wizard completes, click Finish.

Task 3: Install Supplied Files to theClassroom Server and Instructor’s ClientComputerFollow these steps to install the needed files for the classroom server.

Table 0-10: Install the classroom files on the classroom serverStep Action

1 Insert the course CD-ROM in the classroom server.

2 On the course CD-ROM, explore the D8510 folder.

3 Open the Data folder.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

x Introduction

Page 28: IBMN8D510

Step Action

4 Run the D8510dd.exe self-extracting file. This will install a folder named\lotus_ed\D8510 on the C drive. This folder contains all of the data filesthat you will use to complete the course. It also includes animation filesthat you can use during the presentation of the course.

5 Copy the following files from \lotus_ed\D8510 to the \Domino\Datafolder:

● svr.id

● wwcorp.id

● hub.id

● dnotes.id

● names.nsf

Task 4: Edit the Host Files on the ClassroomMachineUse any text editor to edit the hosts file on each classroom machine toinclude the IP address and server names as follows:

192.168.1.100 Hub/SVR/WWCorp hub.wwcorp.comwww.wwcorp.com hub

Task 5: Set Up the Classroom ServerFollow these steps to set up the classroom server, Hub/SVR/WWCorp, asthe first server in the WWCorp domain.

Table 0-11: Set up the classroom serverStep Action

1 Click Start→All Programs→Lotus Applications→Lotus Domino Server.

2 Click Start Domino as a regular application, and then click OK.

3 On the Welcome to Domino Server Setup screen, click Next.

4 Verify that Set up the first server or a stand-alone server is selected,and click Next.

5 Select I want to use an existing server ID file.Click Browse and navigate to the hub.id file, and then click Select.Click Next.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction xi

Page 29: IBMN8D510

Step Action

6 On the Choose your organization name screen:

● Select I want to use an existing certifier ID file.

● Click Browse and navigate to the wwcorp.id file, and then click Select.

● Click Customize, and select I want to use an existing organizationalunit certifier ID file.

● Click Browse and navigate to the svr.id file, 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 For the Domino domain name, type WWCorp and click Next.

9 On the Specify an Administrator name and password screen completethese steps:

● Select I want to use an existing Administrator ID file.

● Click Browse and navigate to the dnotes.id file, 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 Direc-tory services (LDAP services), and click Next.

12 Review the default enabled port drivers and host name. To change thesesettings:

● Click Customize.

● Disable the NetBIOS over TCP/IP port driver.

● Type the fully qualified Internet host name for the server,hub.wwcorp.com.

● Click OK.

Click Next.

13 On the Secure your Domino Server screen, accept the defaults and clickNext.

14 Review the information selected during this session. To confirm setting upthe server with this information, click Setup.

15 When setup completes, click Finish.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

xii Introduction

Page 30: IBMN8D510

Step Action

16 Before starting the server, copy the supplied files to their target directories:

● \Lotus\Domino\data\mail: DNotes.nsf and all other mail files

● \Lotus\Domino\data: D8510 folder and all its files

● \Lotus\Domino\data: Final folder and all its files

● \Lotus\Domino\data: IDs folder and all its files

17 Modify the notes.ini file to by adding Create_R8_Databases=1

18 To start the server from Windows, click Start→All Programs→LotusApplications→Lotus Domino Server. Verify that Start Domino as a Win-dows service is selected and click OK.Note: The server may take several minutes to initialize. Wait for initializationto complete before attempting to connect to the server.

Task 6: Set Up the Instructor WorkstationFollow these steps to set up the instructor’s workstation.

Table 0-12: Set up the instructor’s workstationStep Action

1 Click Start→All Programs→Lotus Applications→Lotus Notes 8.

2 On the Welcome screen, click Next.

3 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, andclick Next. If necessary, for the Domain server name, typeHub/SVR/WWCorpSelect TCP/IP as the network type, and enter 192.168.1.100 or anassigned IP address. Click Next.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction xiii

Page 31: IBMN8D510

Step Action

5 If the ID is not found in the Domino Directory, the setup program willrequest the location of the Notes ID file. To locate the Notes ID file:

a. Click Browse, select dnotes.id, and then click Open.

b. Click Next.

c. Click Yes to copy the ID file 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 copythe ID file to the local data directory automatically.

6 On the Additional Services screen, it is not necessary to select any addi-tional services for this course. Click Next.

7 When the Lotus Notes setup is complete, click OK.

8 Choose File→Preferences and click Basics Notes Client Configuration.

9 In the Additional Options section, select the following options if notalready selected, and then click OK.

● Enable Java applets

● Enable JavaScript

● Use Web palette

10 From the Preferences list, select Notes Ports, and clear LAN0 and COM1.

11 Click OK to close Preferences.

12 Click OK in the warning dialog box. Changes will take effect once LotusNotes is restarted.

13 Exit Lotus Notes.

Follow these steps to set up the student workstations.

Table 0-13: Set up the student workstationsStep Action

1 Click Start→All Programs→Lotus Applications→Lotus Notes 8.

2 On the Welcome screen, click Next.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

xiv Introduction

Page 32: IBMN8D510

Step Action

3 On the User Information screen, type:

● Name: Student ND##

Where ## is the student number assigned to each student (01–12)

● Domino server: Hub/SVR/WWCorp

Select I want to connect to a Domino server, and click Next.

4 If necessary, set up a connection to a local area network, and click Next.

5 If necessary, for the Domain server name, type Hub/SVR/WWCorpSelect TCP/IP as the network type, and 192.168.1.100 or an assigned IPaddress. Click Next.

6 If the ID is not found in the Domino Directory, the setup program will requestthe location of the Notes ID file. To locate the Notes ID file:

a. Click Browse, select Student##.id, and then click Open.

b. Click Next.

c. Click Yes to copy the ID file to the local data directory.

If the user ID is stored in the Domino Directory, the setup program will copythe ID file to the local data directory automatically.

7 On the Additional Services screen, it is not necessary to select any addi-tional services for this course. Click Next.

8 When the Lotus Notes setup is complete, click OK.

9 Click File→Preferences and click Basics Notes Client Configuration.

10 In the Additional Options section, select the following options if not alreadyselected, and then click OK.

● Enable Java applets

● Enable JavaScript

● Use Web palette

11 From the Preferences list, select Notes Ports, and clear LAN0 and COM1.

12 Click OK to close Preferences

13 Click OK in the warning dialog box. Changes will take effect once LotusNotes is restarted. Exit Lotus Notes.

14 Copy the graphic folder and all its files to Lotus/Notes/Data.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

Introduction xv

Page 33: IBMN8D510

Course IconsThe following table explains the icons used in this course.

Table 0-14: Course IconsIcon Description

An activity is a student-centered learning process that allows stu-dents to learn by performing a task. Activities can be instructor-led orcompleted independently.

Scenario information is used to introduce an activity problem or goal.Scenarios use fictitious people and organizations to present details,problem statements, and parameters that are used to complete theactivity or lab exercise.

Caution statements are included in the courseware to make studentsaware of potential negative consequences of an action, setting, ordecision, that are not easily known.

Tips and notes provide additional information, guidance, or a hintabout a topic or task.

An Instructor Note is a special comment to the instructor regardingdelivery, classroom strategy, classroom tools, exceptions, and otherspecial considerations. The Instructor Note is included in the Instruc-tor Guide only.

Display Slide provides a prompt to the instructor to display a specificslide. The Display Slide icon is included in the Instructor Guide only.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Introduction

xvi Introduction

Page 34: IBMN8D510

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 Consider-ations

■ Topic E: Extend IBM® Lotus® Domino® Collaboration Capabilities

1

© Copyright IBM Corporation 2007.

Page 35: IBMN8D510

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 theseapplications 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 Dominoapplications.

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

2 © Copyright IBM Corporation 2007.

Page 36: IBMN8D510

Topic A: Identify Application Types andData Sources

Lotus Domino Applications

IBM® Lotus Notes® and IBM® Lotus® Domino® are an integrated messagingand collaboration application software platform that provides a scalable andsecure infrastructure with the flexibility and openness needed for develop-ment and deployment of Lotus Domino applications. An application is asolution to a particular problem that may include one or more databasesand other components, such as Java™ applets.

Domino Application Types

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

Application Type Description

E-mail/PIM (personalinformation manage-ment)

Synchronizes applications and mail, server-to-serverand client-to-server communication, and mobile com-munication, and provides a calendar, taskmanagement features, a personal journal, and docu-ment libraries.

Broadcast/Reference Acts as a repository for the distribution and easylookup and search of information.

Tracking/Workflow Provides a trail of, and prompts for, actions in a busi-ness process.

Discussion Allows for layered conversation between workgroupmembers on specific subjects.

Front end Allows access to large data stores of non–LotusDomino data.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 3

Page 37: IBMN8D510

Data Sources

Data sources for Lotus Domino applications include those listed in the fol-lowing table.

Data Source Description

Lotus Domino databases Applications can be developed to workwith data from a single Lotus Dominodatabase or from multiple LotusDomino databases.

DB2 relational databases Lotus Domino 8 supports the ability toutilize the DB2 relational database asan alternative storage mechanism fordata. You can expose Lotus Dominodata in DB2 views, making that dataavailable to DB2 applications, includ-ing IBM® Workplace™ and IBM®

WebSphere® Portal applications. Youcan use SQL to build new LotusDomino applications that blend col-laborative services with relational datathat is stored in DB2 databases.

Web services Web services are technology thatallows programming-independent andplatform-independent communicationbetween applications. The advantageof using Web services is that the tech-nology is based on open standardssuch as Extensible Markup Language(XML) and Simple Object Access Pro-tocol (SOAP). Web services canhandle data more easily and allow avariety of software to communicatemore freely than any one proprietaryapplication or environment.

Topic A: Identify Application Types and Data Sources

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

4 © Copyright IBM Corporation 2007.

Page 38: IBMN8D510

Topic B: Examine the IBM® Lotus®

Domino® Architecture

Lotus Domino Infrastructure

Lotus Domino servers work with Lotus Notes clients and non-Lotus Notesclients to form an integrated client/server environment. The Lotus Notes andLotus Domino environment, as conceptualized in the following figure, pro-vides services to allow an organization to store, communicate, andexchange information.

Figure 1-1: A conceptual diagram of the Lotus Notes/Lotus Dominoarchitecture

An example of the Lotus Notes/Lotus Domino environment would consist ofa combination of the following or similar client/server components.

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 5

Page 39: IBMN8D510

Component Function

Lotus Domino server (Web-enabled) A Lotus Domino server is a computerthat runs the Lotus Domino serverprogram and stores Lotus Notes data-bases. A Lotus Domino server runsservices that manipulate Lotus Notesdata.Depending on what the request is andwho the client is, the server can pullinformation from a variety of sources,including the object store, the file sys-tem, a relational database, or acombination of all three.

Lotus Notes and Web clients Lotus Notes clients can access LotusDomino data both on servers andlocally, providing portable access todata.Web clients can access Lotus Dominodata on the server to display in abrowser.

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

Clients

The following table outlines some of the Lotus Notes client types availablewith Lotus Domino servers.

Lotus Notes Clients Function

Lotus Notes client Allows users access to Lotus Notesdatabases on a Lotus Domino server,mail, calendar, contacts, and Webbrowsing.

IBM® Lotus® Domino Designer® Supports the creation and develop-ment of Lotus Domino databases orapplications.

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

6 © Copyright IBM Corporation 2007.

Page 40: IBMN8D510

Lotus Notes Clients Function

IBM® Lotus® Domino® Administrator Allows users with proper privileges toperform administrative tasks in a LotusDomino environment.

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

Internet Clients Function

IBM® Lotus Notes® Web Access Provides on- or offline access to LotusDomino core messaging, collabora-tion, and PIM functions through a Webbrowser.

Web client Supports Lotus Domino applications,mail, and calendar access for Webbrowsers.

POP3 client Allows mail access to a POP3-compliant server.

IMAP client Supports mail access to an IMAP-enabled server.

Application Access

Lotus Domino applications are client-server applications. The client commu-nicates with the application using a proprietary remote procedure callmechanism. The Lotus Notes Remote Procedure Call (NRPC) transmitsthe client request to the Lotus Domino application and returns the results.Lotus Domino authenticates users when they access applications on theserver. Other Lotus Domino services are called upon depending on the spe-cifics of the application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 7

Page 41: IBMN8D510

Accessing a Lotus Domino application with Lotus NotesThe following table describes the stages that occur when a user accesses aLotus Domino application from a Lotus Notes client.

Stage Description

1 User makes a request to open, read, or save data in the application.

2 Lotus Domino authenticates the user making the request and providesauthentication information about itself to the user. This occurs when theclient first accesses the server.

3 Lotus Domino verifies the rights of the user making the request. Thisoccurs every time a request is made.

4 Lotus Domino executes the request and responds to the client.

This process is shown in the following figure.

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

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

8 © Copyright IBM Corporation 2007.

Page 42: IBMN8D510

Working with local applicationsA local database allows users to work offline (not connected to the network).Local databases can also be used to run personal applications that shouldnot be available to multiple users. The Lotus Notes client provides a subsetof Lotus Domino services to execute common functionality locally andreduce the load on the server. The client does not support the same level ofsecurity checks and restrictions that the server does. However, there aredatabase properties that the developer can employ to enforce a certain levelof security on applications that reside locally. Among these is encryption offields within documents and databases, which keeps non-specified usersfrom reading the information stored within the field.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 9

Page 43: IBMN8D510

Using a Web browser to access Lotus Domino applicationsDomino supports the HTTP protocol, which allows Web browsers to accessapplications on a Lotus Domino server. As with access using a Lotus Notesclient, Lotus Domino authenticates users when they access applications onthe server via a Web browser.

The following table describes the stages involved in accessing a LotusDomino application through a Web browser.

Stage Description

1 User makes a request to open, read, or save data in the application.

2 Depending on the server setup and the database ACL, Lotus Dominoauthenticates the user making the request and provides authenticationinformation about itself to the user. If both server and database allowAnonymous access, no challenge is issued to the client and the user isnot authenticated. The result is that the user is identified as Anonymous.

3 Lotus Domino verifies the rights of the user making the request.

4 Lotus Domino translates the HTTP request.

5 Lotus Domino executes the request.

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

10 © Copyright IBM Corporation 2007.

Page 44: IBMN8D510

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

Figure 1-3: Accessing a Lotus Domino application through a Webbrowser

Lotus Domino Application Structure

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 11

Page 45: IBMN8D510

Lotus Domino database containment modelLotus Domino databases are files that exist in the file system. Lotus Dominouses the path and file name to identify the database. Once the database isopen, you access data by opening notes. This relationship, shown in thefollowing figure, is described as a containment model. The file system con-tains 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 firstaccess the file system.

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

12 © Copyright IBM Corporation 2007.

Page 46: IBMN8D510

The components of a Lotus Domino applicationA Lotus Domino database contains two areas of functionality:

● Notes Storage Facility (NSF) maintains the data and design elementsof the application.

● Notes Index Facility (NIF) builds and maintains lists for locating datain the application.

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

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

Lotus Notes and data storageAs stated earlier, the note is the data structure used to store all informationin a Lotus Notes or Lotus Domino database. All notes in a database areessentially the same. They are peers to one another and do not share hier-archical or other relationships. Notes only differ in the data values theycontain and how Lotus Domino uses them.

A note stores data in items. Each item is identified by a name and containsa 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 tothe application and the Lotus Domino services. Metadata is, literally, dataabout data.

Note: Metadata describes how the data is formatted.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 13

Page 47: IBMN8D510

Note typesA Lotus Domino database contains database header, ACL, and designnotes. It also contains data notes once the users of the application createthem. Some notes are created by users and developers, and other notesare maintained by Lotus Domino to track and control information in theapplication.

Data is stored in a specific kind of note, referred to as either a data note ora document. Both terms are used interchangeably throughout this course.You can create and access documents in many ways.

Notes that developers createThe following table describes the types of notes that users and developerscan create in a Lotus Domino database.

Type of Note Purpose

Data Stores data values used in the application. For example, a datanote may contain customer profile information, such as the cus-tomer’s name, address, and phone number.

Design Stores data used to process or affect the presentation and func-tionality of the application. For example, a design note maycontain instructions for how Lotus Domino displays information toa user.

Notes that Lotus Domino maintainsThe following table describes other types of notes that Lotus Domino main-tains.

Type of Note Purpose

ACL The ACL stores a list of names and options for controlling accesspermissions to the database.

Databaseheader

Lotus Domino stores information about the database in a data-base header note. The database header contains informationsuch as the version of Lotus Domino used to create the database,the title of the database, and the database ID.

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

14 © Copyright IBM Corporation 2007.

Page 48: IBMN8D510

Access Document Properties

The Lotus Notes client provides users with the ability to examine documentsthrough a Properties box. The Document Properties box, shown in the fol-lowing figure, reads the contents of a document and displays information tothe user.

Figure 1-6: The Document Properties box

Procedure Reference: Opening the Document PropertiesBoxFollow these steps to open the Document properties box.

1. Open the application in the Lotus Notes client.

2. Select the document you wish to examine.

3. Open the Document Properties box.

● Choose File→Properties.

● 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 ofthe data note.

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 15

Page 49: IBMN8D510

Examining a document through the properties boxThe Properties box has several tabs that display different information aboutthe document. The following table describes three of these tabs.

Tab Information Displayed

Document Info Data about the document that Lotus Domino maintains; forexample:

● When it was created.

● When it was last modified.

● Who last modified it.

Fields A list of the items in the document and the data each itemcontains. Selecting an item in the left pane displays itsvalue and metadata in the right pane. Metadata includesthe data type and special flags Lotus Domino uses whendealing with this data.

Document IDs The unique ID of the document.

Other ways of accessing dataLotus 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.

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

16 © Copyright IBM Corporation 2007.

Page 50: IBMN8D510

Activity 1-1: Analyze Database Documents

ScenarioYou 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 Notesand want to explore version 8 to see what the similarities and differencesare.

Follow these steps to analyze database documents.

Step Action

1. Open the Lotus Notes client.

2. Choose File→Open→Lotus Notes Application.

3. Click the drop-down arrow next to the Look in text box, and select Hub/SVR/WWCorp.

4. In the Application list, scroll and double-click D8510.

5. Double-click Instructor Demo.

6. Click OK to accept the Welcome To The Database message.

7. Click OK to accept the You Have Manager Access message.

8. Close the About Instructor Demo page.

9. Click Customers to open the Customers view.

10. In the Customer list, choose a customer.

11. Choose File→Properties.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 17

Page 51: IBMN8D510

Step Action

12. Verify that Document is displayed in the drop-down list at the top of the dia-log box.

13. Who last updated the document?

14. When was the document created?

15. What is the data type for the CustomerID item?

Topic B: Examine the IBM® Lotus® Domino® Architecture

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

18 © Copyright IBM Corporation 2007.

Page 52: IBMN8D510

Topic C: Examine IBM® Lotus®

Domino® Application Components

Pages

Pages contain text, images, applets, and other objects. Users do not enterinformation on pages. You can use pages to display and organize informa-tion.

Forms

Forms contain fields where users can enter values. Those values are storedin documents. You can use forms to gather and display information.

Page and form comparisonPages and forms are similar in many ways. Both display and organize infor-mation, and both share many elements. However:

● Pages do not contain fields, 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. Youcan use views to organize information.

Navigation

Hotspots, framesets, outlines, and image maps are the most common navi-gation elements used in Lotus Domino applications. You can use theseelements in conjunction with each other to enable users to move around theapplication quickly and easily.

Task Automation

Lotus Domino provides a number of elements for automating tasks such asactions. Actions, which can appear in views, documents, pages, and theAction menu, trigger tasks such as creating or saving a document. TheCreate menu also contains elements that can run a script when a userselects it.

CFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 19

Page 53: IBMN8D510

Security Layers

Lotus Domino’s layered security model, shown in the following diagram, pro-vides increasing refinements to the security of the network, the LotusDomino server, applications, and elements within each application.

Figure 1-7: Lotus Domino’s layered security model

Each of the layers in the model is described in the following table.

Layer Description

Physical Access to the equipment used to log on to thenetwork and store backed up data.

Network This refers to access to the server over the wire.

Authentication The process of establishing trust between theserver and that which is trying to access theserver.

Domino Server Access This refers to the restrictions available in theserver’s Server document.

Database Access (ACL) This refers to the levels of access controlled bythe Access Control List (ACL) in a specific data-base.

Design Element Security This refers to anything from reading access liststo controlling who can see a particular design ele-ment based on who they are.

Topic C: Examine IBM® Lotus® Domino® Application Components

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

20 © Copyright IBM Corporation 2007.

Page 54: IBMN8D510

Layer Description

Document Security This refers to the Readers and Authors fields,which restrict access to specific readers andauthors.

Field Security This refers to encryption. Note that the field onthe form is where encryption is enabled. It isactually the data stored in the document that isencrypted.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 21

Page 55: IBMN8D510

Topic D: Investigate Replication andApplication Design Considerations

Replication

Replication is the process of synchronizing multiple instances, or copies, ofa application on multiple servers and workstations. Running separateinstances of a application on multiple workstations provides two benefits:

● It allows developers and administrators to distribute applications acrossgeographic locations for faster access.

Note: Distributing applications also minimizes traffic across slower networksegments and balances server loads.

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

The Lotus Domino replication serviceThe Lotus Domino replication service transfers new and modified notesbetween applications. The following figure illustrates the concept of replica-tion.

Figure 1-8: Replication

DTopic D: Investigate Replication and Application Design Considerations

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

22 © Copyright IBM Corporation 2007.

Page 56: IBMN8D510

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

What happens during replicationReplication is initiated by a Lotus Domino server or a user in the LotusNotes client. Note that the server does not initiate replication with a worksta-tion. During the replication process, the two servers (or the client andserver) do the following:

● Authenticate with each other.

● Build a list of document, design element, and ACL changes since thelast replication.

● Transfer the changes to the replica databases. Lotus Domino only repli-cates the items that have changed, not the entire document or designelement. Before the servers transfer changes, they check the ACL ofthe replica databases. Lotus Domino can only transfer those changespermitted by the ACL.

Data that does not replicateThe following data does not ever replicate:

● View and FullText indexes

● File system information (for example, the application file name andpath)

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 23

Page 57: IBMN8D510

Replication Considerations

Some of the things you should take into account when considering replica-tion include:

● Security settings can cause two people to see different elements in thesame application. For example, if users are not allowed to read a spe-cific type of document, then those documents are not visible to thoseusers when they replicate the application.

● Servers that are doing the replicating must have access to the applica-tion elements. There are different levels of control on this.

● Frequency and timing of replication should be driven by the businessneed and application design. Additions and deletions of data affect busi-ness, and replication affects what users see in the different replicacopies. When performed too infrequently, replication can result in reap-pearance 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 oneuser sees is not the same as what another user sees. Therefore, if thedata is time-critical, replication must happen more frequently. This, inturn, will impact network traffic.

● Multiple users can simultaneously edit the same document in one copyof a application or edit the same document in different replicas betweenreplication sessions. When these situations occur, Lotus Domino storesthe results of one editing session in one document and stores theresults of additional editing sessions as individual documents that arenamed Replication or Save Conflict. In most cases, you will want to rec-oncile the differences between the original document and its conflictdocument(s) by editing one, and then deleting the other(s).

Topic D: Investigate Replication and Application Design Considerations

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

24 © Copyright IBM Corporation 2007.

Page 58: IBMN8D510

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 yourLotus Domino environment to increase organizational productivity andresponsiveness through business-critical collaboration solutions. This familyof products is often referred to as extended products. The following tabledescribes selected Lotus Domino extended products; a more thoroughexplanation can be found in the appendix Extend IBM® Lotus® Domino®

Software.

Product Description

IBM® Lotus®

Sametime®Provides a combination of instant messaging and Webconferencing capabilities.

IBM® Lotus®

Sametime® Enter-prise MeetingServer

Can be added to a Lotus Sametime deployment (in aWindows environment) to support high-volume Webconferencing environments, as well as to optimize loadbalancing and failover for enterprise-class deployments.

IBM® Lotus®

Domino® DocumentManager

Manages the complete life cycle of office documents,from collaborative authoring to archival. It allows teamsto work together more effectively through collaborativedocument management.

IBM® Lotus®

QuickPlace®Lets users instantly create a team workspace to gainaccess to timely information and to seamlessly bringtogether geographically and organizationally dispersedteam members.

IBM® Lotus®

Workflow®Works on top of Lotus Domino and speeds the creationand deployment of workflow-oriented applications. Itallows organizations to standardize and streamline time-consuming, people-based activities, and track theirprogress.

Component®

Designer®A standards-based development tool used by scriptdevelopers, Visual Basic developers, Lotus Notes appli-cation designers, and others to create components forIBM WebSphere Portal.

IBM® Lotus® Enter-prise Integration®

Provides functionality that allows disparate business pro-cesses to communicate, process, and share commondata.

EFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 25

Page 59: IBMN8D510

Product Description

IBM® Lotus®

Expeditor®Provides solutions to improve workplace efficiency.

IBM® Lotus®

Extend Search®Provides additional search capability throughout theenterprise.

IBM® Lotus® MobileConnect®

Provides connectivity between Notes data and hand-heldand other non-stationary devices.

IBM® Lotus®

SmartSuite®Provides a suite of office productivity products within theLotus Notes environment.

IBM Workplace

IBM® Workplace™ is a family of products, solutions, and technologies usedfor creating innovative, adaptive work environments based on users’ roles orskill levels, or both. The Workplace family includes:

● Portal technology

● Collaboration tools

● Content management tools

● Development tools

● Workflow capabilities

● Solutions on which a user’s workspace is built

The following table describes some of the Workplace products.

Product Description

IBM® Workplace™ Managed Client Delivers fully integrated, server-managed collaboration to the enduser’s desktop. The Lotus Notes appli-cation plug-in allows users to runnative Lotus Notes applications withinthe context of the IBM WorkplaceManaged Client product.

Topic E: Extend IBM® Lotus® Domino® Collaboration Capabilities

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

26 © Copyright IBM Corporation 2007.

Page 60: IBMN8D510

Product Description

IBM® WebSphere® Portal Enables the development and deploy-ment of service-oriented applications.You can extend the reach of yourexisting Lotus Domino applications toIBM WebSphere Portal software byusing portlets. Prebuilt portlets includePortlet Builder for Lotus Domino (partof the WebSphere Portal ApplicationIntegrator package), Lotus Notes andDomino and Extended ProductsPortlets, Lotus Domino ApplicationPortlet, and Common Personal Infor-mation Management Portlets inWebSphere Portal Version 5.1.

Native Web Services Hosting environment based on SimpleObject Access Protocol (SOAP). Youcan use Web services to integrateyour applications with J2EE™ andMicrosoft® .NET environments, oftenwith less time and effort, and usingexisting skills.

Component Designer A standards-based development toolused by script developers, VisualBasic® developers, Lotus Notes appli-cation developers, and others tocreate components for the IBMWebSphere Portal.

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

Other Products and Technologies

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 27

Page 61: IBMN8D510

Product Description

Lotus® Domino® WebAccess 8

Runs on the Mozilla Foundation’s Firefox andMozilla browsers, meeting the growing demand foradditional client options for Linux desktop users. Inaddition to creating and verifying digital signatures,Lotus Domino Web Access 8 provides S/MIME sup-port for reading and creating security-rich,encrypted mail.

Lotus® Domino® Accessfor Microsoft® Outlook®

Delivers Lotus Domino services to Microsoft Out-look users. Organizations currently using MicrosoftExchange for their messaging infrastructure canmove to security-rich, scalable, reliable IBM LotusDomino server software, without changing fromfamiliar client software on the desktop and withouthaving to retrain users.

Microsoft® Office® Provides integration with Microsoft Office 2003, XP,and 2007 software. Users of Microsoft software canaccess Lotus Notes Mail using Smart Tags, aMicrosoft Office capability, to recognize certaintypes of text, such as proper names.

Lotus® Domino® UnifiedCommunications

Unified Messaging represents the convergence ofvoice mail, e-mail, and fax so that all messages arestored in a single location and can be accessedfrom a variety of devices, including telephones andPCs. Unified Communications (UC) takes UnifiedMessaging a step further by extending messageaccess to additional devices and technologies, suchas mobile phones, pagers, PDAs, and browsers. Inaddition, UC provides notification features that willalert subscribers in different ways when theyreceive a message that meets certain criteria.

Topic E: Extend IBM® Lotus® Domino® Collaboration Capabilities

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

28 © Copyright IBM Corporation 2007.

Page 62: IBMN8D510

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 1 ■ Exploring Applications in IBM® Lotus® Domino® 8

© Copyright IBM Corporation 2007. 29

Page 63: IBMN8D510
Page 64: IBMN8D510

Exploring the IBM® Lotus®

Domino® 8 Design Environment

■ Topic A: Explore the IBM® Lotus® Domino® Designer User Inter-face

■ Topic B: Access Design Elements

2

© Copyright IBM Corporation 2007.

Page 65: IBMN8D510

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.

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

32 © Copyright IBM Corporation 2007.

Page 66: IBMN8D510

Topic A: Explore the IBM® Lotus®

Domino® Designer User Interface

Opening Lotus Domino Designer

IBM® Lotus® Domino Designer® is the development environment used tobuild IBM® Lotus® Domino® applications. Lotus Domino Designer containsthe tools necessary to create powerful Lotus Domino applications. Toaccess the design of an application, open that application in Lotus DominoDesigner.

There are different ways to open Lotus Domino Designer:

● Double-click the Lotus Domino Designer icon on your desktop.

● Choose Start→All Programs→Lotus Applications→Lotus DominoDesigner.

● Click the Open and Domino Designer icons from within the IBM®

Lotus Notes® client.

● Choose View→Design 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 LotusDomino DesignerFollow these steps to open a application in Domino Designer.

1. Open Lotus Domino Designer.

2. Choose File→Open→Lotus Notes Application.

3. In the Look In field, enter the location of the application (server name).

4. In My Computer, select the application from the list, or enter it in theFile name box (directory and file name).

5. Click Open.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

© Copyright IBM Corporation 2007. 33

Page 67: IBMN8D510

Identifying the Areas of the Design User Interface

When you open an application in Lotus Domino Designer, the first level ofthe design environment opens. The following table describes several areasin this environment.

Area Description

Designpane

Includes the Design list for the application. This consists of thelist of design elements and the Design bookmark icons, whichpoint to the most recent applications on which you have worked.

Work pane Lists everything in the current application for the selected designelement. Across the top of the Work pane are Design action but-tons, which perform actions on the currently displayed elements(such as creating a new form).

Windowtabs

Each item that you are currently working on has its own tab that,when clicked, takes you to the window that the tab represents.

Topic A: Explore the IBM® Lotus® Domino® Designer User Interface

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

34 © Copyright IBM Corporation 2007.

Page 68: IBMN8D510

Topic B: Access Design Elements

Design Elements

Lotus Domino Designer includes structures called design elements, whichare the building blocks for applications. You can customize these structuresto create applications.

The following table summarizes tasks you might want an application to per-form and the corresponding Lotus Domino design element or elements youcould use to implement them.

ApplicationTask/

Functionality

Design Elements

Display, gather,and organizeinformation

● Pages contain text, images, applets, and other objects.Users cannot enter information into pages.

● Forms contain fields where users can enter values. Thevalues are stored as a document.

● Views index and display lists of documents contained inthe application.

Automate tasks Actions and agents can run scripts. They can be triggeredprogrammatically or manually.

Control naviga-tion

Hotspots, framesets, outlines, and image maps, when usedin combination, allow users to move around the applicationquickly and easily.

Access control and programmingDesign elements are one piece of a Lotus Domino application. The followingtable describes two other pieces.

To Use

Automate Tasks Programming languages, that enable you to:

● Calculate or modify information.

● Validate inputs before saving.

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

© Copyright IBM Corporation 2007. 35

Page 69: IBMN8D510

To Use

Control access toinformation in theapplication

The Access Control List (ACL) and other elements, thatidentify 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-specific elements of that type are listed in both the Design paneand the Work pane. The following figure shows the design environment ofLotus Domino Designer. To open an individual design element, double-clickthe element in the Design pane or Work pane. The element then opens inthe Work pane, typically with the Programmer’s pane below it.

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

Topic B: Access Design Elements

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

36 © Copyright IBM Corporation 2007.

Page 70: IBMN8D510

Using the Work paneThe Work pane is used for creating and modifying forms, pages, views, andother elements in the Design list that are specific to your application ordatabase. When you open or create an individual design element, LotusDomino Designer automatically displays that element in the Work pane.

Using the Programmer’s paneUse the Programmer’s pane to add code in areas of the design elementcurrently displayed in the Work pane. The following table describes thecomponents of the Programmer’s pane.

Component Function

Objects tab Lists all areas (objects and events) in the current designelement where you can add code. Code is added in theScript area. When you click an item on the Objects tab,the Script area changes to show the code that describesthe object. The Reference tab reflects the language or lan-guages that you can use in the Script area.

Reference tab Lists fields and functions that can be used to write code forthe object. Designers can paste from the list or from thecontext-sensitive Help into the Script area.

Script area Used to write code for the element selected using theObjects tab.

Lotus Domino Designer referencesGeneral and context-sensitive Help is available to assist you in working withLotus Domino Designer. The following table describes different ways of get-ting help in Lotus Domino Designer.

Resource Function How to Open

Lotus Domino DesignerHelp

Provides details on:

● Using Lotus DominoDesigner

● Designing LotusDomino applications

Choose Help→Help Top-ics.

Context-sensitive Help Provides details on thespecific element you areworking with.

Press F1 or click theContext-sensitive Helpicon

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

© Copyright IBM Corporation 2007. 37

Page 71: IBMN8D510

Lesson SummaryIn this lesson, you explored the IBM Lotus Domino Designer user interfaceand accessed design elements. By becoming familiar with Designer, youcan begin the process of using it to build applications tailored to your com-pany’s needs.

Topic B: Access Design Elements

Lesson 2 ■ Exploring the IBM® Lotus® Domino® 8 Design Environment

38 © Copyright IBM Corporation 2007.

Page 72: IBMN8D510

Creating Applications

■ Topic A: Create a New, Blank Application in IBM® Lotus® DominoDesigner®

■ 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® Environ-ment

3

© Copyright IBM Corporation 2007.

Page 73: IBMN8D510

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 andbookmarks.

Lesson 3 ■ Creating Applications

40 © Copyright IBM Corporation 2007.

Page 74: IBMN8D510

Topic A: Create a New, BlankApplication in IBM® Lotus® DominoDesigner®

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.

TemplatesA template is an application that contains the structure for a particular appli-cation, but does not contain any data. Lotus Domino includes a number ofstandard templates that let you easily set up a discussion application, a per-sonal journal, a collaborative team application, and many others.

You will work with templates later in the course.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 41

Page 75: IBMN8D510

The New Application Dialog Box

When you create an application from scratch, you need to enter informationand select options from the New Application dialog box, as shown in thefollowing figure. In the top section, you specify the application’s title, name,and location, whether or not encryption needs to be enabled, whether a fulltext index should be created, and what advanced application options shouldbe enabled. In the lower section, you specify the template that should beused.

Figure 3-1: The New Application dialog box

Procedure Reference: Creating a new, blank applicationA 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. Choose File→Application→New. The New Application dialog boxappears.

2. Accept the default of Local to create the application on your local com-puter.

3. Enter a title for the application.

4. Enter a file name for the application.

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

Lesson 3 ■ Creating Applications

42 © Copyright IBM Corporation 2007.

Page 76: IBMN8D510

5. From the template list, select Blank.

6. Click OK.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 43

Page 77: IBMN8D510

Topic B: Create a Copy of an ExistingApplication

Copying an Application Design

A Lotus Domino application can be copied along with all existing designinformation. If the application designer has hidden the design, you cannotmodify the design elements in the copy of the application. To check whetheror not this is the case, view the Design tab in the Database Properties boxand verify that No design information available is displayed.

Note: After copying the design of an existing application, the manager of the appli-cation copy needs to create a new full-text index. For information on creating a full-text index for a application copy, see Lotus Domino Administrator Help.

Procedure Reference: Copying an applicationFollow these steps to copy an application.

1. Open the application to copy.

2. Choose File→Application→New Copy.

3. In the Server field, do one of the following:

● To store the new application on your local hard drive, leave Localselected.

● For new applications that multiple people will be designing, selector enter a server name to store the new application on a server.

4. If desired, in the Title field, enter a title for the new application. The titlecan have a maximum of 96 characters.

Note: IBM® Lotus® Domino Designer® automatically gives the copied applica-tion the same title and file name as the original application. You have theoption to change it. The length limit of the application’s file name depends onyour operating system. The copied application file name must end with the .nsffile extension. If the application will be used as a template, use the file exten-sion .ntf.

5. In order to copy just the design and not the documents within the appli-cation, select Application design only.

6. Deselect Access Control List so that the original application’s ACL willnot be copied to your new application.

7. Click OK.

BTopic B: Create a Copy of an Existing Application

Lesson 3 ■ Creating Applications

44 © Copyright IBM Corporation 2007.

Page 78: IBMN8D510

8. If necessary, to prevent the copied application from inheriting futuretemplate design changes, choose File→Application→Properties,select the Design tab, and clear the Inherit design from master tem-plate check box.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 45

Page 79: IBMN8D510

Activity 3-1: Create a Copy of the InstructorDemo Application

ScenarioDuring this course, you will work in several different applications, includingthe Instructor Demo application. You will need your own version of theseapplication. You will use two different methods for creating your own ver-sions. First, you will create a copy of the Instructor Demo. Then, you willcreate your own version of the Practice application from a template.

Follow these steps to create a personal copy of the Instructor Demo appli-cation.

Step Action

1. Open Lotus Domino Designer.

2. Choose File→Application→Open.

3. In the Look In list, select the course server Hub/SVR/WWCorp.

4. In the Database list box, double-click the D8510 folder and select Instruc-tor Demo (Instructor_D8510.nsf).

5. Click Open.

Result: The Instructor Demo application opens in Lotus Domino Designer.

6. Choose File→Application→New Copy.

7. In the Server list, verify that Local is selected.

8. In the Title text box, type a title for the application that includes your stu-dent number. For example, if your student number is 07, typeInstructor 07

9. In the File name text box, type a unique file name for your copy of theapplication. For example, if your student number is 07, typeInstructor07.nsf

10. Click OK.

Result: The new copy of the application appears in the Lotus DominoDesigner 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.

Topic B: Create a Copy of an Existing Application

Lesson 3 ■ Creating Applications

46 © Copyright IBM Corporation 2007.

Page 80: IBMN8D510

Topic C: Create an Application from aTemplate

Using a Template to Create an Application

The third approach to creating a application is to base the new applicationon a template.

CFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 47

Page 81: IBMN8D510

Activity 3-2: Create a Practice Applicationfrom a Template

ScenarioNow that you have your own version of the Instructor Demo application, youwill create your version of the Practice application from a template.

Follow these steps to create your own Practice application from a template.

Step Action

1. If necessary, open Lotus Domino Designer.

2. Choose File→Application→New.

3. In the OK list, verify that OK is selected.

4. In the Title text box, type a title for the application that includes your stu-dent number. For example, if you are student 07, typeMyPracticeApplication07

5. In the File name text box, verify that Lotus Domino has supplied a uniquefile name for your copy of the application. For example, the file nameshould be similar to MyPracticeApplication07.nsf

6. In the Specify Template for New Application section, select the class-room server Hub/SVR/WWCorp in the Server list.

7. In the Template list, select Practice Template.

8. If necessary, clear the Inherit future design changes check box.

9. Click OK.

Result: The new Practice application opens in Lotus Domino Designer.

Topic C: Create an Application from a Template

Lesson 3 ■ Creating Applications

48 © Copyright IBM Corporation 2007.

Page 82: IBMN8D510

Topic D: Organize the IBM® Lotus®

Domino Designer® Environment

Managing the Lotus Domino Designer Environment

The Lotus Domino Designer environment provides tools to help developersmanage the development of applications. These tools include the ability tocreate bookmarks on the Lotus Domino Designer Bookmark bar, and theability to create folders to organize application bookmarks.

Folders

One way to help organize your design work is by using folders. You can cre-ate folders:

● As a way of organizing and structuring the design elements in yourapplication.

● 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 andapplication. You can drag and drop the following items to the Bookmark baror to a folder on the Bookmark bar:

● An application shortcut from your desktop.

● A program executable file from Windows Explorer.

● An application icon from the Design pane.

● An application window tab.

Procedure Reference: Creating a folder in Lotus DominoDesignerFollow 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 notopen, right-click the Recent Databases folder on the Bookmark barand select New Folder.

2. In the Folder name field, type a folder name.

3. In the Select a location for the new folder list box, select the locationin which you want to create the folder and click OK.

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 49

Page 83: IBMN8D510

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

Procedure Reference: Creating an application bookmarkfrom the Lotus Domino Designer menu barFollow these steps to create an application bookmark from the LotusDomino Designer menu bar.

1. Choose File→Application→Open.

2. Select the application you want to bookmark.

3. Click Bookmark.

4. In the Add to list box, do one of the following:

● To display the bookmark directly on the Bookmark bar, selectBookmark Bar.

● To add the bookmark to a folder on the Bookmark bar, select afolder.

● To create a new folder, click New folder, type a name for thefolder, and click OK.

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

Topic D: Organize the IBM® Lotus® Domino Designer® Environment

Lesson 3 ■ Creating Applications

50 © Copyright IBM Corporation 2007.

Page 84: IBMN8D510

Activity 3-3: Create a Folder and Bookmarkfor the Practice Application in LotusDomino Designer

ScenarioYou are interested in managing your work more efficiently and would like tosee what the Bookmark bar can do, so you decide to create a folder on theLotus Domino Designer Bookmark bar that contains a bookmark for yourcopy of the Practice application.

Follow these instructions to create a folder and bookmark.

Step Action

1. If necessary, open Lotus Domino Designer.

2. Click the New Folder icon above the Design pane.

Result: The Create Folder dialog box opens.

3. Name the new folder Fundamentals

4. In the Select a location for the new folder field, select the Folders loca-tion.

5. Click OK.

Result: The folder appears on the Bookmark bar. If you move the cursorover the folder, its name appears as pop-up text.

6. Now, to create a bookmark within the folder, choose File→Application→Open.

7. Select the name of your Practice application.

8. 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 createdin the Fundamentals folder.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 3 ■ Creating Applications

© Copyright IBM Corporation 2007. 51

Page 85: IBMN8D510

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

Topic D: Organize the IBM® Lotus® Domino Designer® Environment

Lesson 3 ■ Creating Applications

52 © Copyright IBM Corporation 2007.

Page 86: IBMN8D510

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

4

© Copyright IBM Corporation 2007.

Page 87: IBMN8D510

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.

Lesson 4 ■ Creating Pages

54 © Copyright IBM Corporation 2007.

Page 88: IBMN8D510

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 HTMLpage. IBM® Lotus® Domino® pages structure and display information thatremains relatively stable. Application users do not create pages or add con-tent to pages, but use them to discover information and navigate through asite 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, notall elements available to forms are available to pages.

Types of Page Information

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

Element Description

Text Static data such as a company name.

Graphics Images such as GIF, JPEG, and BMP files. (For graphic types otherthan GIF or JPEG, refer to Lotus Domino Help for advice on how totreat the graphics for optimum presentation.)

Content Organization Design Elements

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

Element Description

Tables Information organized in rows and columns.

Sections Collapsible and expandable areas that can include text, graphics,and objects.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 55

Page 89: IBMN8D510

Element Description

Layers Control the placement, size, and content of information in overlap-ping blocks.

Programmable Elements

The following programmable elements can be used on pages.

Element Description

Applets Small programs such as an animatedlogo or self-contained application.

HTML Hypertext Markup Language, whichcan be written directly on the page orimported from another source.

JavaScript libraries A place for storing and sharing com-mon JavaScript programs and code.You can insert an existing JavaScriptlibrary into a page, form, or subform.

Actions Buttons or hotspots that automatetasks for a user.

OLE objects Links or objects that represent data inanother application.

Computed text Generates dynamic text based on for-mula results.

Cascading Style Sheets (CSS) Styling instructions that can be usedto format HTML pages.

Navigational Elements

The following navigational elements can be used on pages.

Element Description

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

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

Lesson 4 ■ Creating Pages

56 © Copyright IBM Corporation 2007.

Page 90: IBMN8D510

Element Description

Embedded elements You can embed the following elementsin a page:

● A view or folder pane

● Navigator

● Outlines

● Date picker

● Instant Messaging Contact list

Use these elements alone or combinethem to control how users navigatethrough 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 touse a page instead of a form to display information. The following table liststhe conditions used to determine whether to use a page or a form.

If the Goal is to Use a

Display static information such ascompany data and background infor-mation

Page to structure and display informa-tion.

Collect and store information from endusers

Form to structure and display thedata.

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 57

Page 91: IBMN8D510

Design Elements Not Available on Pages

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

Design Element Page Form

Layout regions No Yes

Subforms No Yes

Fields No Yes

Shared fields No Yes

Embedded elements:

● File upload

● Scheduler

● Editor

No Yes

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

Lesson 4 ■ Creating Pages

58 © Copyright IBM Corporation 2007.

Page 92: IBMN8D510

Activity 4-1: Examine a Page

ScenarioYou are developing an application and are interested in discovering how toview the pages you create appear in Lotus Notes’s design and client envi-ronments, as well as a Web browser.

Follow these steps to examine a page, its elements, and its properties. Thepage is in the Practice application.

Step Action

1. If necessary, open your copy of the Practice application in Lotus DominoDesigner.

2. 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 Design→Page 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 theselected element.

6. Close the Page Properties box and the First Look page.

Do not save change if prompted.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 59

Page 93: IBMN8D510

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 pageFollow these steps to create a page.

1. In the Design pane, click Pages.

2. In the Work pane, click New Page.

3. Choose Design→Page Properties.

4. Enter a name in the Name field.

5. Close the Page Properties box.

6. Add appropriate elements to the page.

7. Save the page.

The Page Properties Box

In addition to the content that resides on the page, a page contains proper-ties or attributes of its own. To examine information about a page, use thePage Properties box. The properties of a page, as well as any other ele-ment, are modified through the Properties box.

The process to change the properties of an element is as follows:

1. Select the element.

2. Open its Properties box.

3. Specify the appropriate properties.

4. 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 modification. Theychange to reflect the latest element selected as selections are made.Changes are applied immediately.

BTopic B: Create Pages

Lesson 4 ■ Creating Pages

60 © Copyright IBM Corporation 2007.

Page 94: IBMN8D510

The following figure 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 to64 bytes, the size limit increases to 256 bytes if there is a name alias.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 61

Page 95: IBMN8D510

Aliases

An alias is simply another name for a page or other design element. Aliasesare 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 whichthey are associated.

Procedure Reference: Creating a name aliasFollow these steps to create a name alias.

1. Open the page.

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

● Choose Design→Page Properties.

● Right-click the page and choose Page Properties.

3. In the Name box, enter | (pipe symbol) and your alias name after theexisting page name. For example: pageName | pn

Note: Press Shift+\ for the pipe symbol.

4. Close the Page Properties box.

5. Save the page.

Topic B: Create Pages

Lesson 4 ■ Creating Pages

62 © Copyright IBM Corporation 2007.

Page 96: IBMN8D510

Activity 4-2: Create a Page, and Set ItsProperties

ScenarioYou are beginning work on an application and are interested in creating anew page and viewing its properties.

Follow these steps to create a page.

Step Action

1. If necessary, open your copy of Practice application in Lotus DominoDesigner.

2. 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 Design→Page Properties.

Result: The Page Properties box opens.

5. Type the following name and alias into the Name box: Practice Page| pp

6. Close the Page Properties box.

7. Save the page.

Result: The new page appears in the page list.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 63

Page 97: IBMN8D510

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 explanatorytext.

● Dynamic text, for example, text that is computed.

Text Formatting

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

● Font

● Paragraph Alignment

● Paragraph Margins

● Paragraph Border

● Paragraph Hide When

● Paragraph Styles

The following figure 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, previewyour work in the supported Web browsers as well as in the IBM® LotusNotes® client.

CTopic C: Add Text to Pages

Lesson 4 ■ Creating Pages

64 © Copyright IBM Corporation 2007.

Page 98: IBMN8D510

The Preview toolbar contains links to each browser on your computer. Click-ing a browser icon previews the current design element in the associatedbrowser. The following figure shows the Preview toolbar.

Figure 4-3: The Preview toolbar

Procedure Reference: Previewing your workFollow these steps to preview your work.

1. In IBM® Lotus® Domino Designer®, open the design element you wishto preview.

2. Either choose the appropriate menu commands or click one of the Pre-view buttons. The menu commands are as follows:

● Choose Design→Preview in Notes.

● Choose Design→Preview in Web Browser→Default Browser orInternet 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 DominoDesigner.

Browser previewsSecurity settings can affect the display of Lotus Domino applications in Webbrowsers. If a server or application is not set up for Anonymous access, youwill need to authenticate to be able to preview.

Note: You will work more extensively with access control lists later in the course.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 65

Page 99: IBMN8D510

Activity 4-3: Add and Format Text

Data Files:

• Practice

ScenarioThe page you have been developing is alright, but it is not visually engag-ing. You take steps to add formatting to some of its elements.

Follow these steps to add formatted text to your page.

Step Action

1. If necessary, open Practice Page in your copy of the Practice application.

2. 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 bychoosing Text→Text 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.

Topic C: Add Text to Pages

Lesson 4 ■ Creating Pages

66 © Copyright IBM Corporation 2007.

Page 100: IBMN8D510

Step Action

6. Click the Paragraph Border tab and click the Double Border style. In theBorder Effects section, select Drop shadow.

Result: A border appears around your text, running the length of the page.

7. Close the Text Properties box.

8. Save your page.

9. Preview your work.

Result: The page preview is quite different in Lotus Notes than it is in theWeb browser.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 67

Page 101: IBMN8D510

Topic D: Use Tables to Lay Out Pages

Table Types

A table is an element you can use to organize content into rows and col-umns. Use tables to organize, summarize, and align elements such as text,fields, and graphics. Tables can be created in:

● Pages

● Forms

● Subforms

● Table cells

Lotus Domino Designer provides five types of tables. The following tabledescribes these types.

Display Description Use on Web

Basic Displays data organized intorows and columns. Lookslike a grid or spreadsheet.

Yes

Tabbed Displays each row of dataas a separate tab. Usersview information displayedin the rows by selecting atab.

Limited. Best for display-ing static information.

Animated Displays one row of thetable at a time based on aspecified time interval. Ani-mated tables are notsupported on the Web andare not designed for dataentry on forms.

No. For the Web, analternate programmingtechnique is required toshow an animated table.

Caption Similar to a tabbed table,but users click captionsinstead of tabs.

Limited. Best for display-ing static information.

Programmed Similar to a tabbed table,but users click an action orlink. Displays a different rowof the table based on anaction or field.

Limited. Data loss canresult.

DTopic D: Use Tables to Lay Out Pages

Lesson 4 ■ Creating Pages

68 © Copyright IBM Corporation 2007.

Page 102: IBMN8D510

Tables and the WebTabbed tables are limited for Web use because each time a user clicks atab, the page needs to redraw, thus consuming server resources and band-width. In addition, if information is entered on one tab, and another tab isclicked, 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), thereare properties that can be set to generate hidden placeholders for data that has notbeen 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 tabsinclude:

● Table Layout

● Cell Borders

● Table/Cell Background

● Table Borders

● Table Margins

● Table Rows

● Table Programming

Table width optionsWhen a table is created, there are three width options available: Fit withmargins, Fit to window, and Fixed width. The following table lists theseoptions and their results.

Table WidthOption

Result

Fit with margin The table fills a given body size, from margin to margin. Thisis useful when nesting tables within one another.

Fit to window The width of the table will fill the margins, regardless of theframe size.

Fixed width A measured column width is set for the table, regardless ofthe size of the window.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 69

Page 103: IBMN8D510

Setting table layout propertiesThe following figure shows the Table Layout tab of the Table Propertiesbox.

Figure 4-4: The Table Layout tab

On the Table Layout tab, the Width and Position properties also render tothe Web. The following table lists the results of the individual property set-tings in the Web page.

Property Web Function

Width If left fixed, keeps the individual column (cell) that particular width,regardless of content. The Width property will generate an HTMLwidth attribute as either a percentage or as pixels, based on theselection.

Position Affects the horizontal positioning of the table within the Web page.The Position property will create an HTML align attribute.

Topic D: Use Tables to Lay Out Pages

Lesson 4 ■ Creating Pages

70 © Copyright IBM Corporation 2007.

Page 104: IBMN8D510

Setting cell borders propertiesThe following figure shows the Cell Borders tab of the Table Propertiesbox.

Figure 4-5: The Cell Borders tab

The Cell Border Thickness setting dictates whether or not a borderappears. 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 borderfor the table. Setting a 0 border is useful when the table is only used forpositioning and the borders would detract from the page appearance.

For the Web, the only attribute that applies from the Cell Borders tab isCell Border Thickness.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 71

Page 105: IBMN8D510

Setting table and cell background propertiesThe following figure shows the Table/Cell Background tab of the TableProperties box.

Figure 4-6: The Table/Cell Background tab

The Table/Cell Background tab of the Table Properties box deals withtable color, cell color, and cell image. Most of the properties render toHTML. The following table relates properties of the Table/Cell Backgroundtab to their corresponding HTML attributes.

Property Web Function

Table color Sets an overall color for the table, it generates an HTML bgcolorattribute on the <td> (Table Data) tag.

Cell color Generates an HTML bgcolor attribute for an individual cell tag. Atable cell is defined in HTML with a <td> tag. The Style attributesdo not have a corresponding HTML style.

Cell image Translates to the Web as a background image attribute for the<td> tag. Lotus Domino Designer does not provide the capabilityfor a background graphic for the entire table. However, you canaccomplish this using HTML.

Topic D: Use Tables to Lay Out Pages

Lesson 4 ■ Creating Pages

72 © Copyright IBM Corporation 2007.

Page 106: IBMN8D510

Setting table borders propertiesThe following figure shows the Table Borders tab of the Table Propertiesbox.

Figure 4-7: The Table Borders tab

The properties of the Table Borders tabs have no effect on any of thetranslated HTML attributes. The HTML language does not currently providefor margin settings or text wrapping attributes.

Setting table margins propertiesThe following figure shows the Table Margins tab of the Table Propertiesbox.

Figure 4-8: The Table Margins tab

The properties of the Table Margins tabs have no effect on any of thetranslated HTML attributes. The HTML language does not currently providefor margin settings or text wrapping attributes.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 73

Page 107: IBMN8D510

Setting table rows propertiesThe following figure shows the Table Rows tab of the Table Propertiesbox.

Figure 4-9: The Table Rows tab

The Table Rows tab allows you to modify the Lotus Domino table typeattributes, which allow you to modify the overall table settings.

Topic D: Use Tables to Lay Out Pages

Lesson 4 ■ Creating Pages

74 © Copyright IBM Corporation 2007.

Page 108: IBMN8D510

Setting Table Programming Properties

The following figure shows the Table Programming tab of the Table Prop-erties box.

Figure 4-10: The Table Programming tab

Use the Other field of the Table HTML Tags or Cell HTML Tags to addattributes to the <table> or <td> tags.

Procedure Reference: Creating a tableFollow these steps to create a table.

1. Open a page in Lotus Domino Designer.

2. Choose Create→Table from the menu.

3. Specify the number of rows and columns for the table.

4. Specify the table width.

5. Select a table type by choosing one of the options.

6. Click OK.

7. Save and preview the page.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 75

Page 109: IBMN8D510

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

ScenarioYou have a lot of information that needs to be organized vertically on thepage you have been developing.

Follow these steps to add a table and text to the Practice page.

Step Action

1. 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 para-graph.

Result: The cursor blinks to indicate its position.

3. Choose Create→Table. Select the appropriate options to create a basic,fixed 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 first 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 followingtext: Page layout is easier when you use tables.

Result: The text appears in the table cell.

6. Save the page.

7. Preview the page in the Lotus Notes client.

8. Preview the page in a Web browser, and note the differences in how thepage appears.

Topic D: Use Tables to Lay Out Pages

Lesson 4 ■ Creating Pages

76 © Copyright IBM Corporation 2007.

Page 110: IBMN8D510

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 file.

● Insert a shared image from the shared resources area of the LotusDomino application.

The following image types can be used:

● BMP (Bitmap)

● CGM

● JPEG

● GIF

● Lotus PIC

● PCX

● Tiff 5.0

● PNG (Portable Network Graphic)

Images can be used in pages and forms.

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

Procedure Reference: Importing an image from a fileFollow these steps to import an image from a file.

1. Open a page in Lotus Domino Designer.

2. Place the cursor where you want the graphic to appear.

3. Choose one of the following:

● Choose Create→Picture.

● Choose File→Import.

4. Select the image’s file type.

Result: The Create Picture dialog box displays only image file types.File Import displays all file types that can be imported into a LotusDomino Designer page or form.

EFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 77

Page 111: IBMN8D510

5. Select or enter the file name.

6. Click Import.

Result: The image is inserted onto the page.

Picture propertiesA picture, like other elements, has properties which are modified using theProperties box. Once a picture is added, the Picture Properties boxbecomes available. Use properties to specify attributes or aspects of a pic-ture such as:

● Size

● Border style

● Alignment

● Margins

The following figure shows the Picture Properties box.

Figure 4-11: The Picture Properties box

Topic E: Add Images to Pages

Lesson 4 ■ Creating Pages

78 © Copyright IBM Corporation 2007.

Page 112: IBMN8D510

Shared Resources

A shared resource is an element, such as a graphic file, stored within aLotus Domino application. Each application can contain a library of its ownshared resources. Shared resources let you reference a resource multipletimes throughout a application, while only having to maintain the resource inone 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 ischanged, all occurrences of the shared resource are automatically updated.A major advantage of shared resources is that they are a part of the appli-cation; if the application is moved, copied, or replicated, so are its sharedresources.

To use a shared resource, it needs to be imported to the Lotus Dominoapplication. 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 file sys-tem. However, if the graphic file changes, the image in the application is notupdated unless you import it again.

Note: The native format of an image resource is maintained. Once added to theapplication, the resource can be exported in its native format, by selecting the imagefrom image resources and choosing Export from the Resource menu.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 79

Page 113: IBMN8D510

Procedure Reference: Adding an image resource to anapplicationThe first step in the process of using a shared image is to create an imageresource. Follow these steps to create an image resource.

1. Click Shared Resources in the Design list.

2. Click Images.

3. In the Work pane, click the New Image Resource button.

4. In the New Image Resource dialog box, do the following:

● Select the file type.

● Navigate to the correct directory and select the file name.

● Click Open.

Image resource propertiesLike other Lotus Domino Designer elements, image resources have proper-ties which are modified using a Properties box. Use the image resourceproperties to specify attributes such as:

● Name and alias

● Source file information

The following figure shows the Image Resource Properties box.

Figure 4-12: The Image Resource Properties box

Topic E: Add Images to Pages

Lesson 4 ■ Creating Pages

80 © Copyright IBM Corporation 2007.

Page 114: IBMN8D510

Procedure Reference: Inserting an image resourceThe second step in the process of using a shared image is to insert theimage resource where needed. Follow these steps to insert an imageresource.

1. Create a new, or open an existing, page in Lotus Domino Designer.

2. Move the cursor to where you want to the image to appear.

3. Choose Create→Image Resource from the menu.

4. If necessary, choose the type of image (GIF, JPEG, All Images) to dis-play the desired image type.

5. Click the file name listed in the list box.

Result: A thumbnail view of the image displays in the dialog box.

6. Click OK.

Identifying a picture’s sourceTo identify the source of a picture on a page, use the Picture Propertiesbox. The following figure shows the source of an image added using theCreate menu.

Figure 4-13: Source information for an imported picture

The following figure shows the source of an image that is a sharedresource.

Figure 4-14: Source information for a shared image

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 81

Page 115: IBMN8D510

Activity 4-5: Add and Use a Shared Image

ScenarioThe company you are designing for would like to use its new logo imageprominently whenever its employees use Lotus Notes applications. In thisactivity, you will create a shared image to use throughout the WorldwideCorporation applications.

Follow these steps to complete the activity. Use your copy of the Practiceapplication.

Step Action

1. If necessary, open your Practice database in Domino Designer.

2. Create a shared image resource. In the Element list, click SharedResources. Then, click Images.

3. Click New Image Resource.

4. In the list of graphic files, 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. Place the cursor below the table you added earlier.

7. Choose Create→Image Resource. Select the WWGlobe.gif image. ClickOK.

Result: WWGlobe.gif is added to the page.

8. Save and preview the page.

Topic E: Add Images to Pages

Lesson 4 ■ Creating Pages

82 © Copyright IBM Corporation 2007.

Page 116: IBMN8D510

Lesson SummaryIn this lesson, you created pages and populated them with text, images, andtables. By learning how to insert important design elements in pages, youcan create application components that look professional and get the jobdone.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 83

Page 117: IBMN8D510

Lab 4-1: Create a Page

ScenarioWorldwide Corporation is in the process of creating organizational policies.They need a Policies and Procedures application to create and store policydocuments for their employees. This application also needs a page thatgives people an overview of the company.

Note: The guided solution to this activity can be found in Appendix A, Lesson LabSolutions.

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 itPolicies_##.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. Metropo-lis, PA 45555 in a table.

5. Place bluerule.gif below the table.

Topic E: Add Images to Pages

Lesson 4 ■ Creating Pages

84 © Copyright IBM Corporation 2007.

Page 118: IBMN8D510

6. Type the following text which describes the company. Give the text aheading, for example About Us.

Worldwide is an international pottery manufacturer. Thecompany sells ceramics worldwide. Products include tiles,china, and various kinds of pottery. The corporate officehouses manufacturing, research and development, productmanagement, quality control, human resources, and systemadministration. There are several smaller sales offices andresellers throughout each region, and some salesrepresentatives who work from their homes.

7. Save and preview your work.

8. Close all open windows.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 4 ■ Creating Pages

© Copyright IBM Corporation 2007. 85

Page 119: IBMN8D510
Page 120: IBMN8D510

Creating Forms

■ Topic A: Create Forms

■ Topic B: Add Fields to Forms

■ Topic C: Hide Form Elements

5

© Copyright IBM Corporation 2007.

Page 121: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Create a form.

● Work with date/time data.

● Hide form elements.

Lesson 5 ■ Creating Forms

88 © Copyright IBM Corporation 2007.

Page 122: IBMN8D510

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. Thedata 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 auser opens a document, the document uses the form as a template to pro-vide 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 controlappearance and user interface.

● Programming to act on data.

The following figure represents the form design element.

Figure 5-1: The form design element

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 89

Page 123: IBMN8D510

Application notesA form is a design note stored inside an IBM® Lotus® Domino® application.The design note contains the design elements and code that make up theform. Lotus Domino applications contain four different types of notes. Thefollowing table briefly describes the four note types stored in a applicationand their function.

Note Type Function

Header Contains information about the application itself, such as itsname, size, and creation date. Each application has a singleheader note.

ACL Note Stores the access control list, a list of names and permis-sions associated with the application.

Design Note Each design element, such as a form, view, or page isstored in the application as a design note. The form designnote acts as a template used to create new documents ordisplay information.

Data Note A data note holds the information entered using a form, aswell as system data used by Lotus Domino for managementpurposes. These are also known as documents.

Elements used in formsThe following table describes elements that might be included on a form.

Element Function

Text and graphics Display information or pictures on alldocuments using the form.

Fields Display data from documents.Save data to a document.Compute a value.

Properties Control attributes of the form. Forexample, a background color is a formproperty.

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

Offer additional tools to the designer,often enhancing interactivity or efficiencyof the form.

Topic A: Create Forms

Lesson 5 ■ Creating Forms

90 © Copyright IBM Corporation 2007.

Page 124: IBMN8D510

Form Design

There are three phases in creating a form:

1. Design the appearance.

2. Create the form.

3. Test the form.

In this section, you will investigate the first 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 formFollow these steps to design and create a form.

1. Decide the purpose of the form.

2. Determine the information the form will collect.

3. Determine required elements for the form.

4. Create the form.

5. Add the required elements to the form.

6. Save the form.

7. Test the form in various clients.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 91

Page 125: IBMN8D510

Procedure Reference: Creating a formFollow these steps to create a form.

1. Open the application in Lotus Domino Designer.

2. In the Design pane, click Forms.

Result: In the Work pane, the list of existing forms appears. The NewForm button appears on the button bar.

3. In the Work pane, click New Form.

4. Choose Design→Form Properties.

5. Enter a name in the Name field.

6. Close the Form Properties box.

7. Add elements to the form.

8. Save the form.

Form Properties

To examine information about a form, use the Form Properties box. Thefollowing figure shows the Form Properties box.

Figure 5-2: The Form Properties box

Topic A: Create Forms

Lesson 5 ■ Creating Forms

92 © Copyright IBM Corporation 2007.

Page 126: IBMN8D510

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

● Form name and alias

● Background color

● Header and footer text

Form namesForm names within the same application must be unique. Form names mayinclude:

● Characters

● Spaces

● Numbers

● Punctuation

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 93

Page 127: IBMN8D510

Activity 5-1: Create a Form

ScenarioYou are building an application and would like to add a component to it thatcan accept data entered by users.

Follow these steps to create a simple form with an alias.

Step Action

1. Open your copy of the Practice application in Domino Designer.

2. 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 Design→Form Properties.

Result: The Form Properties box opens.

5. Type the following name and alias into the Name box: EmployeeInformation | ei

6. Close the Form Properties box.

7. 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 form’s title, field labels, or explanatorytext.

● Dynamic text in a form can be computed text.

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

Topic A: Create Forms

Lesson 5 ■ Creating Forms

94 © Copyright IBM Corporation 2007.

Page 128: IBMN8D510

Activity 5-2: Add and Format Text

ScenarioBecause it is important for users to understand what they are asked toenter, you want to make the design of the data entry component you aredesigning clear and engaging.

Follow these steps to add formatted text to your form.

Step Action

1. If necessary, open the Employee Information form in your copy of thePractice application in Domino Designer.

2. 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 bychoosing Text→Text 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 theform.

7. Close the Text Properties box.

8. Save and preview the form in both IBM® Lotus Notes® and a Web browser.Note any differences in the form’s appearance.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 95

Page 129: IBMN8D510

Topic B: Add Fields to Forms

Fields

A field is a part of a form that collects, calculates, or displays data. Eachfield stores a single type of information. The type of information a fieldaccepts must be defined. 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 fieldsFollow these steps to create form fields.

1. Add the field to the form.

2. Name the field.

3. Specify the data type.

4. Specify how the field is populated.

5. Set additional field properties.

6. If necessary, program field contents.

7. Save the form.

8. Test the form in various clients.

Specifying field characteristicsWhen you create fields, specify at least the following characteristics:

● Field name

● Field type

● How the field is populated

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

BTopic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

96 © Copyright IBM Corporation 2007.

Page 130: IBMN8D510

Procedure Reference: Adding a field to a formFollow these steps to add a field to a form.

1. Place the cursor at the desired location on the form.

2. Choose Create→Field from the menu, or right-click the form andchoose Create Field.

Result: Lotus Domino adds a field to the form and opens the field’sProperties box.

Note: Like many applications, there can be several options for performing atask. In this course we use the menu bar option for consistency. However, feelfree to choose whichever method you are most comfortable with.

3. Enter a name for the field on the Field Info tab in the Properties box.

4. Specify the field type on the Field Info tab in the Properties box.

Field Names

Each field in a form must have a unique name in that form. Use the follow-ing rules and guidelines when naming fields. 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 indi-cates a reserved field name. These types of fields add functionality that you wouldotherwise have to program yourself. If you try to use a reserved name in a way thatis different from its intended use or redefine the field, Lotus Domino Designer dis-plays an error message. There are also a few reserved field names that do notbegin with dollar signs, such as Form and SaveOptions. These are covered later inthis course.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 97

Page 131: IBMN8D510

Field Data Types

The field’s data type determines two things:

● What type of information the field can contain.

● How the field 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 field contains, you also indicate howthe field gets its value. The following table lists the field value options andtheir purpose.

How the Field Value Is Created Value Is...

Editable Entered by the user. There can be adefault entry based on a formula.

Computed Created as the result of a calculation.Fields are calculated when:

● Saving

● Refreshing

● Changing modes

Computed for display Created as the result of a calculation.Lotus Domino does not store theresult with the document. It calculatesthe value each time users refresh thedocument.

Computed when composed Created when the document is cre-ated. If the field is added to a form,after documents have been created,the value is calculated the next timeone of these documents is opened.

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

98 © Copyright IBM Corporation 2007.

Page 132: IBMN8D510

Field Design Considerations

Before adding fields to a form, determine the following:

● The type of data that you want to capture (text, number, date, etc.).

● Logical position of fields on the form (consider data entry flow).

● How to identify to users the purpose of the field (for example, fieldlabels).

● How the data should appear to the reader.

● How to identify the field for yourself when designing the application(field name).

● Whether or not there are dependencies on the content of other fields.

Lotus Domino processes forms from the top-left to the bottom-right. Keepthis in mind if you create fields whose calculations are dependent uponother fields on the form.

Text Data

Lotus Domino Designer allows you to specify the type of text data a field willstore. The types of text data include:

● Text

● Rich text

● Lists

● Names

Text fieldsA text field is editable by default. Users can enter and view alphanumericdata in this type of field. One example of a text field is a field used to collector display a customer name. Text fields have the following characteristics:

● The display format is defined by the field on the form.

● The field length is not fixed.

● The field content can be displayed in a view.

Rich text fieldsA rich text field stores complex data. An example of a rich text field is theBody field used in the mail memo. Rich text fields have the following char-acteristics:

● They can store many types of data, including graphics.

● They can store formatting with the data.

● They cannot display in a view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 99

Page 133: IBMN8D510

Rich Text Lite FieldsA rich text lite field is the same as a rich text field except that an icon anddrop-down arrow is added next to the field. The icon helps users to addobjects to the field more easily; the drop-down menu provides a list of fielddata entries from which the user may add. Entry of invalid data or objectsdisplays an error message.

Native OS styleNative OS is a style selected on the Field Info tab in the Field Propertiesbox. The Native OS style has a user-friendly interface for text fields. Forexample, editable text fields appear on the document as a fixed-sized out-lined box instead of as a blank space marked off by brackets.

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

100 © Copyright IBM Corporation 2007.

Page 134: IBMN8D510

Activity 5-3: Add Text Fields to a Form

ScenarioYour data entry component is taking shape and you’re ready to create theparts where the users actually enter the data.

Follow these steps to add first and last name fields, along with text labels,to the Employee Information form.

Step Action

1. If necessary, open the Employee Information form in your copy of thePractice 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 Create→Table. Select the appropriate options to create a basic,fixed 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 first 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 Create→Field to create a fieldwith the following characteristics:

● Name: FirstName

● Type: Text/Editable.

Result: The FirstName field 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 Create→Field to create a fieldwith the following characteristics:

● Name: LastName

● Type: Text/Editable

Result: The LastName field is created.

8. Save the form.

9. Preview the form in Lotus Notes.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 101

Page 135: IBMN8D510

List Fields

List fields present users with a list of pre-defined choices. Some types of listfields allow the selection of a single choice, multiple choices, or choices notin the list. The following table describes the list types available and when touse them.

Use This Type of Field If You Want the User to Select

Dialog list One or more choices from a pop-up dialogbox, or to add a choice not in the list.

Checkbox One or more choices from a short list.

Radio button Only one choice from a short list.

Listbox One or more choices from a scrolling list.

Combobox One choice from a drop-down list, or to adda choice not in the list.

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

102 © Copyright IBM Corporation 2007.

Page 136: IBMN8D510

Procedure Reference: Creating a list of choicesFollow these steps to create a field with a list of choices.

1. Place the cursor at the desired location on the form.

2. Choose Create→Field from the menu. Enter a name for the field andchoose one of the list field types.

3. Click the Control tab.

4. Select one of the list choices:

● Enter choices (one per line)

● Use formula for choices

Note: Dialog lists have several more choice options.

5. Enter either the list choices or a formula.

6. Save and preview the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 103

Page 137: IBMN8D510

Procedure Reference: Setting the default value for a listfieldProviding a default value for a list field ensures that the field gets filled inand often removes the need for users to enter data. Follow these steps toset a default value for a list field.

1. Open the form in the Designer.

2. Select the list field.

3. In the Programmer’s pane, click the Objects tab.

● The field object with the list field’s name should appear at the topof the object list.

● Default Value should be highlighted. If not, click once on DefaultValue to select this event.

4. In the Script area, enter the default value surrounded by quotationmarks. Click the check mark.

Result: A value surrounded by quotation marks displays in the Scriptarea.

Note: This value must exactly match one of the list value’s spelling and case.

5. Save the form and preview the design changes.

Default field valueThe following figure shows the Programmer’s pane with a field entered asa default value.

Figure 5-3: A default value entered into the Programmer’s pane

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

104 © Copyright IBM Corporation 2007.

Page 138: IBMN8D510

Activity 5-4: Create and Set a Default Valuefor a List Field

ScenarioBecause you want to be careful that the small number of choices for a cer-tain data item be entered consistently, you build functionality in a datagathering component that reduces chances for data entry error.

In this activity, you will create several list fields and set default values forthem.

Follow these steps to create and set a default value for a list field.

Step Action

1. If necessary, open the Employee Information form in your copy of thePractice application in Domino Designer.

Result: The form appears in the Work pane.

2. Add the following field label below the table: Employment Status

Result: The text is inserted.

3. Add a field next to the text.

Result: A new field is inserted.

4. Open the Field Properties box. Add the following characteristics on theField Info tab.

● Name: EmploymentStatus

● Type: Listbox, Editable

Result: The name and field 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 Programmer’s pane, select the Default Valueobject.

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 Step7.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 105

Page 139: IBMN8D510

Step Action

7. In the Script area, type the default value "Full Time" and click the checkmark.

Result: The value is entered into the Script area.

8. Add another list field with the following characteristics:

● Name: Department

● Type: Listbox, Editable

Choices: Administration, R&D, Manufacturing

9. Add an editable date field named DateCreated and set its default value to“Today”.

10. Add a number field and label called Salary to the Employee Informationform.

11. Save and test the form.

Name Fields

Lotus Domino differentiates text that represents names by using a specialcategory of fields to store names. Because Lotus Domino uses system-specific ways to identify users and servers, consider using a Name fieldwhen dealing with names. The following table describes the three types offields that deal with names.

Field Type Used to...

Names Insert or display the name of a user or server.

Readers Restrict read access to the document. A value in a Readers fieldwill restrict read access to those names specified in that field orin any other Readers fields in the document.

Authors Grant read access to the document and grant edit authority toany name that is also specified as an Author or higher authorityin the Access Control List (ACL).

An Authors field is a type of field that works in conjunction with the Authoraccess level in the database’s Access Control List (ACL). Authors fields donot override the setting in the ACL. They offer developers more control overwhich users can edit data in the application. Entries in Authors and Read-ers fields cannot give a user more access than is specified in the ACL; theycan only further restrict access.

Note: You will work more extensively with Readers and Authors fields later in thecourse.

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

106 © Copyright IBM Corporation 2007.

Page 140: IBMN8D510

Numeric Data

Create a Number field when the data that users will enter is numeric. LotusDomino can use data in a Number field to perform mathematical calcula-tions. Number fields recognize the following:

● Numerals 0 through 9

● Plus (+) and minus (-) signs

● Decimal point (.)

● Scientific notation (E)

Number fields can be editable, computed, computed for display, or com-puted when composed.

Procedure Reference: Setting the style of a number fieldFollow these steps to set the style of a Number field.

1. Create the field.

2. In the Basics tab of the Field’s Properties box, select Number as itstype.

3. Click the Control tab to set the style.

Using a default value for numeric fieldsIf a Numeric field is saved with a blank, the value is valid, but an error willoccur if you try to compute a value based on it. A blank value is representedby two quotation marks, "", and evaluates to a null text string. To ensurethat numeric fields maintain the proper data type, set an appropriate defaultvalue in the Programmer’s 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 aDate/Time field. Date/Time fields represent time using a set of numbersand punctuation. Lotus Domino stores date/time values as the number ofseconds 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 operatingsystem’s regional settings could affect how dates are displayed.

Date/Time fields can be editable, computed, computed for display, or com-puted when composed.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 107

Page 141: IBMN8D510

Procedure Reference: Creating date/time fieldsFollow these steps to set the style of a Date/Time field.

1. Create the field.

2. In the Basics tab of the Field Properties box, select Date/Time as itstype.

3. Click the Control tab to format the field.

Using Calendar/Time ControlCalendar/Time Control is a style selected on the Field Info tab in the FieldProperties box. The Calendar/Time Control style has a user-friendly inter-face for date/time fields available only to the Lotus Notes client. Editabledate/time fields display as a graphical date/time control.

Topic B: Add Fields to Forms

Lesson 5 ■ Creating Forms

108 © Copyright IBM Corporation 2007.

Page 142: IBMN8D510

Topic C: Hide Form Elements

The Hide/When Options

Hide/When is a property that controls when an element is visible to users ora specific set of users. The Hide/When option hides the entire paragraphwhere the selected field, text, or graphic is located. However, if the item isinside a table cell, only the contents of the cell are hidden. Some elementsthat contain Hide/When functionality are:

● Text

● Fields

● Graphics

The following table details the options available for hiding elements.

Option Description

Previewed forreading

The hidden information is not visible when users readdocuments in the document Preview pane.

Previewed forediting

The hidden information is not visible when users work ondocuments in Edit mode in the document Preview pane.

Opened for read-ing

The hidden information is not visible when users opendocuments in Read mode. A field that cannot be read can-not be printed or copied to the clipboard.

Opened for edit-ing

The hidden information is not visible when users work ondocuments in Edit mode.

Printed The hidden information is not visible on printed docu-ments.

Copied to the clip-board

The hidden information is not visible when information iscopied to and pasted from the clipboard.

Embedded The hidden element is not visible when the document isan embedded document.

Hide paragraph ifformula is true

A formula determines the circumstances in which informa-tion is hidden.

Additional check box options controlling Hide/When include:

● Lotus Notes 4.6 Or Later

● Web

● Mobile

CFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 109

Page 143: IBMN8D510

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 field, ask the following ques-tions:

● 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 filled with informa-tion about their employees. When a manager opens an employee’s profile,they do not need to see all the company departments, just the one to whichthe employee belongs. On the other hand, when new employees are added,or an existing employee’s information is updated, it would be helpful to seeall the departments.

The following table outlines conditions to hide information.

If Users Are Then

Reading a document Hide information that is useful only whenusers create or edit documents.

Editing, creating, or printingdocuments

Hide information that is useful when usersread documents.

In the previous example, the Department field is a list field. In order to viewthe list field while editing and the resulting data when reading, create thefollowing two fields:

● A list field containing all the Worldwide Corporation departments.

● A computed for display field to display the resulting value.

Topic C: Hide Form Elements

Lesson 5 ■ Creating Forms

110 © Copyright IBM Corporation 2007.

Page 144: IBMN8D510

Procedure Reference: Displaying the selected value of a listfield in Read modeFollow these steps to set Hide/When options for a list field.

1. Create an editable list field.

2. Set the properties on the Paragraph Hide/When tab so that the listfield is hidden when the document is:

● Previewed for reading.

● Opened for reading.

3. Create another field and set the Field type to Computed for display.

4. Set the properties on the Hide/When tab so that the computed field ishidden when the document is:

● Previewed for editing.

● Opened for editing.

5. In the Programmer’s pane, select the Value object for the computedfield from the Objects tab.

6. In the Script area, enter the name of the list field.

7. Save the form.

8. Test the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 111

Page 145: IBMN8D510

Activity 5-5: Set Hide/When Properties

ScenarioIn this activity, you will continue working in your copy of the Practice appli-cation. You will create a field named DEmploymentStatus (the “D” in frontof the field name indicates that the field is for display only) and set theappropriate Hide/When properties so that the EmploymentStatus list fielddisplays when the document is new or in Edit mode, and theDEmploymentStatus field is displayed when the document is in Readmode.

Follow these steps to set Hide/When properties.

Step Action

1. In the Employee Information form, add label text and a field on the linebelow the EmploymentStatus field that has the following characteristics:

● Label text: Employment Status

● Field Name: DEmploymentStatus

● Field Type: Text, Computed for display

Result: The new field is created.

2. To set the value of DEmploymentStatus, click the field. In the Script area ofthe Programmer’s pane, enter EmploymentStatus

Result: The value for the new field is set to the value of theEmploymentStatus field.

3. To set Hide/When properties for the new field, click the field. In the FieldProperties box, click the Paragraph Hide/When tab. Select Previewed forediting and Opened for editing.

Result: The field will only display when the form is in Read mode. It will notdisplay when the user is editing the document.

4. To set the Hide/When properties for the EmploymentStatus field, click thefield. Open the Field Properties box. Click the Paragraph Hide/When tab.Select Previewed for reading and Opened for reading.

Result: The field will only display when the form is in Edit mode. It will notdisplay when the user is reading the document.

5. Save and test the design changes. Create four or five documents using thisform.

Result: The EmploymentStatus field displays in Edit mode. TheDEmploymentStatus field displays in Read mode.

Topic C: Hide Form Elements

Lesson 5 ■ Creating Forms

112 © Copyright IBM Corporation 2007.

Page 146: IBMN8D510

Lesson SummaryIn this lesson, you created forms and inserted form elements in them. Bylearning how to create forms, you can provide application users with themeans to enter information into the application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 113

Page 147: IBMN8D510

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

ScenarioWorldwide Corporation is in the process of creating organizational policies.You have already created your copy of the Policies and Procedures applica-tion and Information page in a previous lab. In this activity, you will createthe form that will be used to enter the company’s policies and procedures.

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

Perform the following tasks to complete this lab.

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

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

3. Title the form Policies and Procedures.

4. Format the title.

5. Use a table to organize the fields and field labels that will be included onthis form.

6. Add the following field labels and field names to collect and/or displaythe 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,Benefits, Holidays, and Grievance Procedures.)

Topic C: Hide Form Elements

Lesson 5 ■ Creating Forms

114 © Copyright IBM Corporation 2007.

Page 148: IBMN8D510

7. The category should display when the document is in Read mode, whileall 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 thecorrect information is gathered and displayed. Close the document andreopen it to test the Category field functionality.

9. Close all open windows.

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 5 ■ Creating Forms

© Copyright IBM Corporation 2007. 115

Page 149: IBMN8D510
Page 150: IBMN8D510

Creating Views

■ Topic A: Create Views

■ Topic B: Add View Columns

■ Topic C: Organize Documents

■ Topic D: Format Views

6

© Copyright IBM Corporation 2007.

Page 151: IBMN8D510

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.

Lesson 6 ■ Creating Views

118 © Copyright IBM Corporation 2007.

Page 152: IBMN8D510

Topic A: Create Views

The View Design Element

The purpose of the View design element is to create an organized list ofdocuments so that users can find the information they need. Views are oneof the entry points to the documents stored in an IBM® Lotus® Domino®

application. All applications contain at least one view. However, most appli-cations contain more than one view.

The following figure represents the View design element.

Figure 6-1: The View design element

Characteristics of a viewThe 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 thatrow.

● A view may include all documents or a subset of documents based onselection criteria.

● Users read the information in the view to locate specific documents.

● Excessive numbers of views and poorly designed views can have aserious impact on application performance.

● Views should be designed early in the application development pro-cess.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 119

Page 153: IBMN8D510

How Lotus Domino stores a viewLotus Domino uses an internal filing system called the view index to storethe list of documents in a view. End users and designers never work directlywith the view index. It is built and maintained by the Lotus Domino applica-tion.

The following table describes how Lotus Domino builds a view.

Stage Description

1 The application developer creates the view design.

2 Lotus Domino pulls information from documents according to thedesign and builds a view index.

3 Lotus Domino displays the information to users.

The following figure shows how Lotus Domino builds a view.

Figure 6-2: How Lotus Domino builds a view

Topic A: Create Views

Lesson 6 ■ Creating Views

120 © Copyright IBM Corporation 2007.

Page 154: IBMN8D510

How Lotus Domino builds a view collection and indexThe following figure illustrates how Lotus Domino builds a view collectionand index.

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

The Notes Index FacilityThe Notes Index Facility (NIF) resides within a Lotus Domino application.The NIF is responsible for all tasks that keep documents ordered withineach 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 121

Page 155: IBMN8D510

Minimizing the number of viewsEach view builds its own collection and related index, with all the collationsor sorts you have specified. When preparing a view for display to a client,keep in mind that it is much faster for Lotus Domino to reorder a collectionthat is already open (different sorts in same view) than to open and order adifferent collection (different views).

Use the Click on column header to sort property to minimize the numberof views and maximize the sorting within those views.

Note: You can defer the creation of an index until its first use.

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

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

Views and Database SizeDepending upon the number of views and the number of fields containedwith in them, a Lotus Notes database can vary significantly in size becauseof the indexes that are created in conjunction with the views.

Topic A: Create Views

Lesson 6 ■ Creating Views

122 © Copyright IBM Corporation 2007.

Page 156: IBMN8D510

View Design

Effective views allow users to find information quickly and easily. As a devel-oper, 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 123

Page 157: IBMN8D510

Procedure Reference: Designing a viewFollow these steps to design and build a view.

1. Create the view.

2. Select documents for the view.

3. Add columns to the view.

4. Sort and categorize the documents.

5. 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 initialview 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.

Topic A: Create Views

Lesson 6 ■ Creating Views

124 © Copyright IBM Corporation 2007.

Page 158: IBMN8D510

Procedure Reference: Creating a ViewFollow these steps in Lotus Domino Designer to create a new view.

1. In the Design pane, click Views.

2. In the Work pane, click New View.

3. 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 theWork pane.

Initial View Properties

The following are guidelines for setting the initial view properties.

Property Guidelines

View name Use a short, descriptive name indicating how the view orga-nizes documents.

Type ● Select Shared, to create a view many users will access.

● Select Shared, contains documents not in any folders, ifthe user typically stores documents in folders and wants tofind all others quickly.

● Select Shared, contains deleted documents for users todrag out of the trash to a folder, or undelete, if the soft dele-tions option has been activated.

● Select Private to create a personal view for a single user.

● Select Shared, private on first use views to distributeviews that begin as shared, but change to private once auser has accessed and saved the view.

● Select Shared, desktop private on first use to distributeviews that begin as shared, but that change to private oncea 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 view’s name with a newname accomplishes the same cascaded view menu.

Copy stylefrom

Use the design of another view in the current application as atemplate.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 125

Page 159: IBMN8D510

Property Guidelines

Selectionconditions

● Leave the condition blank to include all documents in theapplication.

● Click Add Condition and use the Search Builder to specifycriteria 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-designedviews.

View Aliases

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

Procedure Reference: Creating an Alias for a ViewFollow these steps to set properties after creating a new view.

1. Open the view in Lotus Domino Designer.

2. Open the View Properties box.

3. On the Basics tab, enter an Alias and Comment.

Procedure Reference: Adding selection conditions to a viewAdd selection conditions to control which documents a view includes.

Follow these steps to add selection conditions to a view.

1. Open the view in Lotus Domino Designer.

2. In the Object list of the Programmer’s pane, click View Selection.

Topic A: Create Views

Lesson 6 ■ Creating Views

126 © Copyright IBM Corporation 2007.

Page 160: IBMN8D510

3. In the Programmer’s pane, ensure that the default is Simple Search.

Result: An Add Condition button is displayed at the bottom of thescript area in the Programmer’s pane.

4. In the Script area, click Add Condition.

Result: The Add Condition dialog box opens.

5. In the Add Condition dialog box, create a condition. Click Add.

6. Refresh the view index in Lotus Domino Designer.

Result: Lotus Domino Designer rebuilds the view index with the newselection condition.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 127

Page 161: IBMN8D510

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

Use the Condition To Find Documents

By Author Whose author is or is not a specified user or users. Docu-ments must have an Authors field.

By Date That were created or modified:

● On, after, before, or not on a specified date

● In the last, in the next, older than, or after the nextspecified number of days

● Between or not between a specified range of dates

By Field That have a field that contains or does not contain aspecified value.

By Form Whose form field contains the specified form name.

Fill out example form Whose form field contains the specified form name andwhose fields have matching conditions. Only fill the fieldsthat are relevant to your search.

In Folder In the specified folder.

Multiple Words That have any, or all, of up to eight terms, words or shortphrases.Note: This condition uses significant system resources andcan adversely impact the response time of a large applica-tion. Use it sparingly, and only if Fill out example form isnot suitable.

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

Topic A: Create Views

Lesson 6 ■ Creating Views

128 © Copyright IBM Corporation 2007.

Page 162: IBMN8D510

Activity 6-1: Create a View with an Alias

ScenarioNot only do you want your new application to receive data from users, youwant them to be able to look at the data as well.

In this activity, you will first create a view that is limited to documents cre-ated using the Employee Information form.

Follow these steps to create the view and limit the documents in the view.

Step Action

1. If necessary, open your copy of the Practice application in DominoDesigner.

2. Click Views in the Work pane.

3. 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 theWork pane.

5. Double-click to open the view you just created.

Result: A blank view opens in the Work pane; and the View Propertiesbox 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. Close the View Properties box.

8. On the Objects tab, click View Selection.

9. In the Programmer’s pane, above the Script area, verify that SimpleSearch is selected.

10. Beneath the Script area, click the Add Condition button.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 129

Page 163: IBMN8D510

Step Action

11. 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 Programmer’s pane.

12. Preview your changes. Click Yes to save the view.

Result: Only documents created using the Employee Information formshould appear.

13. Close the view.

Result: Your new view, its alias and comment appears in the Views list inthe Lotus Domino Designer window.

Topic A: Create Views

Lesson 6 ■ Creating Views

130 © Copyright IBM Corporation 2007.

Page 164: IBMN8D510

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 automaticallycreates one column in the view. This column displays row numbers corre-sponding to the documents in the view. You can modify this column, as wellas 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 viewYou can insert a column to the left of the current column, or append a col-umn to the right of the last column in the view.

Follow these steps to add a column to a view.

1. Click an existing column.

2. To add a column to the left of the one selected, choose Create→InsertNew Column.

To add a column to the right of the right-most column, chooseCreate→Append New Column from the menu.

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 131

Page 165: IBMN8D510

View Column Values

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

Type ofValue

Purpose

Field Displays the value stored in a specified field for each docu-ment in the view.Note: View columns cannot display information from computedfor display, rich text, and encrypted fields.

Simple Func-tion

Returns information about documents that Lotus Dominostores automatically. For example, simple functions can return:

● A list of attachments in a document.

● The size of the attachments.

● The name of the document’s author.

● The creation date of the document.

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

Specifying view column valuesAfter creating a column, specify the information to display in the column.Refresh the view after selecting the value to update the view index and seethe change.

The following table explains the three methods for displaying data in viewcolumns.

To Display Select And

A single field value storedin the document

Field Click a field from the list.Note: Fields that cannotbe used in a view do notappear in the list.

Information about thedocument not containedin fields

Simple Function Click a function from thelist.

Topic B: Add View Columns

Lesson 6 ■ Creating Views

132 © Copyright IBM Corporation 2007.

Page 166: IBMN8D510

To Display Select And

Multiple fields in a singlecolumn or new values

Formula Write a formula.

Displaying multiple fields in a single view column will be discussed later inthe course.

View Column Formatting

To format view columns, set properties in the Column Properties box. TheColumn Properties box has many options available to modify and organizethe view columns. You will begin with modifying individual columns.

The following table lists some column formatting options.

In This Tab Set Properties to

Column Info Specify general display characteristics, including column title andwidth.

Title Specify text formatting options for the column title, including font,size, and style.Note: you can change all existing column titles by clicking theApply to all button.

Advanced Specify a name for the column to use when accessing the col-umn programmatically. This is similar to giving a form or view analias name.Indicate if the values in the column should appear as links whenthe view appears on the Web.

Formatting view column valuesTo specify how a column displays its value, set properties in the ColumnProperties box according to the following table.

In This Tab Set Properties to

Font Specify the font, size, and style of text for displaying the col-umn value.

Numbers Specify special options if the column value is a number.

Date and timeformat

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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 133

Page 167: IBMN8D510

Activity 6-2: Add and Format View Columns

ScenarioAfter consulting with the people who will use the new data display compo-nent you are building for the application you have been working on, yourealize that they require several more pieces of information.

In this activity, you will modify the Employee Information view to showemployees’ names, departments, and salaries.

Follow these steps to add and format view columns.

Step Action

1. If necessary, in your copy of the Practice application, open the EmployeeInformation view in Lotus Domino Designer.

Result: The view opens in the Work pane.

2. Select the first column header; then, in the Programmer’s pane, from theDisplay radio button group, select Field.

Result: The Programmer’s pane displays all the fields available in thePractice application.

3. Choose the LastName field.

4. Double-click the column header to open the Column Properties box, andtype the title: Last Name

Result: The column title changes to Last Name.

5. Insert a column to the left of the Last Name field with the following features:

● Field: FirstName

● Column title: First Name

Result: The First Name column appears to the left of the Last Name col-umn.

6. Append a column to the right of the Last Name column with the followingfeatures:

● Field: Department

● Column title: Department

Result: The Department column appears to the right of the Last Namecolumn.

7. Append a column to the right of the Department column with the followingfeatures:

● Field: Salary

● Column title: Salary

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

Topic B: Add View Columns

Lesson 6 ■ Creating Views

134 © Copyright IBM Corporation 2007.

Page 168: IBMN8D510

Step Action

8. In the Column Properties box, select the Title tab. Set Center, Bold, andApply to all.

Result: All the view column titles are centered and bold.

9. Close the Column Properties box.

10. Save and preview your changes.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 135

Page 169: IBMN8D510

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 specific documentquickly. The Sorting tab in the Column Properties box provides several dif-ferent 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 ordescending order.

● Categorize: Groups together documents with the same column values.

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

Sorted Columns

A sorted column displays documents in a specific order. The following tabledescribes how a view sorts different types of values.

Columns That Display Sort Documents

Text values Alphabetically

Number values Numerically

Date/time values Chronologically

If the column being sorted contains text, there are two other options thatcould be useful:

● Case-sensitive sorting: Sorts lowercase letters before uppercase let-ters. For example, “ab” sorts before “Aa.”

● Accent-sensitive sorting: Sorts accented characters after non-accented characters. For example, “ab” sorts before “äa.”

CTopic C: Organize Documents

Lesson 6 ■ Creating Views

136 © Copyright IBM Corporation 2007.

Page 170: IBMN8D510

Procedure Reference: Sorting documents by column valueFollow these steps to sort documents based on the contents of a column.

1. Select the column you want to sort.

2. Open the Column Properties box.

3. Click the Sorting tab.

4. Select None, Ascending, or Descending.

5. Set optional properties to refine the sort:

● Case-sensitive sorting

● Accent-sensitive sorting

● Click column header to sort

User-sorted columnsThe sort column feature allows end users to click on the column header tochange the column’s sort order. This option is available in the Sorting tab ofthe Column Properties box. The following table describes the different enduser sort control options.

Option Function

Ascending An upward-pointing triangle appears in the column header.Users click the header to sort in ascending order or revert tothe original order.

Descending A downward-pointing triangle appears in the column header.Users click the header to sort in descending order or revert tothe original order.

Both A two-headed triangle appears in the column header. Usersclick the header to cycle between ascending, descending, andthe original sort order.

Secondary SortColumn

Designate a second column to sort the view further. Forexample, if the primary sort column is last name, the second-ary could be the first name.Note: This column can be sorted in either ascending ordescending order only.

Change To View(using a column toswitch to anotherview)

Using a column as an entry point to another view, which givesusers an easy way to see additional, related information thatdoesn’t fit in the initial view. Users click such a column toopen another view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 137

Page 171: IBMN8D510

Improving Performance: Preventing Simple SearchesThe Don’t Allow Simple Search database properties option allows you toblock users from running a full text index search of a database. This meansthat when a database does not contain a full text index, you can set theproperties of that database to not allow simple searches by users. So, whena user tries to run a search on a database, an error is generated informingthe user that the database does not contain a full text index, and that theaction cannot be performed. Incorporating this property will help with serverside performance issues.

The following is the Database properties dialog box with the added optionto prevent simple searches.

Figure 6-5: The Database properties dialog box

Improving Performance: Deferred Sort Index CreationThe deferred sort index creation feature has been added to improve theserver-side performance of your applications. This column option reducesthe impact on the server for user sorted columns. When a user re-sorts acolumn, the sort index will not compute as part of the whole view index. Asa 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 isnot made, eventually that sort index collation will expire.

Topic C: Organize Documents

Lesson 6 ■ Creating Views

138 © Copyright IBM Corporation 2007.

Page 172: IBMN8D510

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

Figure 6-6: The Column properties dialog box

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 139

Page 173: IBMN8D510

Activity 6-3: Set Sort Columns

ScenarioYour application’s data display component works fine, but your end-usersreport back that it’s inefficient because the data displayed isn’t in any par-ticular order.

In this activity, you will modify the Employee Information view so thatusers can sort the view by last name, then first, if necessary.

Follow these steps to create user-sorted columns.

Step Action

1. If necessary, in your copy of the Practice application, open the EmployeeInformation 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 Nameand Ascending

Result: The Last Name column has a two-headed arrow in the columntitle header.

4. Place a similar ascending sort on the First Name column and use the LastName field as a secondary sort column.

5. Preview your changes.

Topic C: Organize Documents

Lesson 6 ■ Creating Views

140 © Copyright IBM Corporation 2007.

Page 174: IBMN8D510

Categorizing

A categorized column groups related documents together in a view basedon the column value. The following figure shows a categorized view.

Figure 6-7: A categorized view

Procedure Reference: Categorizing documents by columnvalueAlways categorize the left-most columns of the view. Typically, you will inserta new column to group related documents together in the view.

Follow these steps to categorize a view.

1. Select the column whose value will categorize the documents.

2. Open the Column Properties box.

3. On the Sort tab, select Categorized.

Guidelines for formatting categorized columnsA view displays the column value of a categorized column in its own row.

The following table lists some best practice guidelines to follow, and theirexplanations.

Guideline Why

Do not use a title for the column. The column values appear in the view andshould be self-explanatory. A column titlewould be redundant. However, there areinstances where a column title is needed,such as when you need to display morethan one date.

Set the width of the column to 1. This helps save room in the view to seemore data.

Show twisties when the row isexpandable.

This simplifies expanding and collapsing dif-ferent categories for end users.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 141

Page 175: IBMN8D510

Guideline Why

Use bold and color to make the cat-egorized column value stand outfrom other information in the view.

This helps the user differentiate between thecategory headers and the documents.

Topic C: Organize Documents

Lesson 6 ■ Creating Views

142 © Copyright IBM Corporation 2007.

Page 176: IBMN8D510

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 Propertiesbox.

Tab Set Properties to

Options ● 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 view’s background.

● Apply an image to the view’s 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 thedocuments displayed in the view. Users could select to display thesame documents in another view or folder that they create.

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 143

Page 177: IBMN8D510

Lesson SummaryIn this lesson, you created formatted views. By learning how to create andformat views, you can provide application users with the means to obtaininformation in a meaningful way from data stored in an application.

Topic D: Format Views

Lesson 6 ■ Creating Views

144 © Copyright IBM Corporation 2007.

Page 178: IBMN8D510

Lab 6-1: Create a Categorized View

ScenarioWorldwide Corporation wants to provide a new way of organizing its policiesand procedures in the Policies and Procedures application. The view shoulddo 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 toPractice 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 6 ■ Creating Views

© Copyright IBM Corporation 2007. 145

Page 179: IBMN8D510
Page 180: IBMN8D510

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

7

© Copyright IBM Corporation 2007.

Page 181: IBMN8D510

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 field evaluation on a form.

● Describe how to compare values by using comparison operators.

● Describe conditional statements.

● Identify ways to make formulas more readable.

Lesson 7 ■ Introducing Formulas

148 © Copyright IBM Corporation 2007.

Page 182: IBMN8D510

Topic A: Identify ProgrammingLanguages Supported by IBM® Lotus®

Domino®

Lotus Domino Programming

You can write programs in an IBM® Lotus® Domino® application using theIBM® Lotus® Domino Designer® client. Many design elements can executeprograms automatically through the properties and events of the element.

You can also write programs outside the Lotus Domino application usingother development tools. These programs can be imported or run in theoperating system to access the Lotus Domino application.

Lotus Domino is a flexible development environmentThe Lotus Domino development environment supports all leading technolo-gies with tools that cater to varying developer skill levels and degrees ofprogramming experience. Given so many choices, the question that con-fronts developers at the outset of any application development initiative iswhich tool to use. The answer is simple: understand the functions that canbe performed programmatically in Lotus Domino, then pick the one thatmeets 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. Thelocation of execution, namely, server versus client, can affect how the datais accessed, as well as the security provisions that are taken to protect thedata.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 149

Page 183: IBMN8D510

Where to program in Lotus DominoThe following figure shows where code can be written for the Lotus Dominoenvironment.

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

Internal programming languagesLotus Domino Designer provides an Integrated Development Environment(IDE) for writing code in a Lotus Domino application. It supports the follow-ing four programming languages:

● @Formula and @Commands

● IBM® LotusScript®

● Java™

● JavaScript™

Lotus Domino also supports HTML and XML.

External programming languagesLotus Domino supports the following external programming languages:

● Java

● C and C++

● Microsoft® Visual Basic®

Topic A: Identify Programming Languages Supported by IBM® Lotus® Domino®

Lesson 7 ■ Introducing Formulas

150 © Copyright IBM Corporation 2007.

Page 184: IBMN8D510

Connecting to Lotus Domino from external applicationsOne feature of Lotus Domino 8 is the ability to store, access, view, andmanage application data in a robust, enterprise class DB2 relational datastore. When working with the data, the interaction is entirely with the LotusDomino server within the IBM® Lotus Notes® client. The Lotus Notes user isunaware that the storage is in DB2 and not in an NSF file. There is no needfor users to have DB2 connectivity as that is handled by the Lotus Dominoserver.

Users can query and report on Lotus Domino data using traditional Struc-tured Query Language (SQL) based tools and combine Lotus Domino datawith DB2 data. Customers can continue to choose between native DominoNSF or DB2 stores or a combination of the two, depending on the require-ments of each application. When working with the data, there is no visibledifference between the data stored in a Lotus Notes database and the datastored in a DB2 database.

You can also use one of the drivers the following table describes to queryLotus Domino databases via SQL.

This Driver Is Use It When You Require

NotesSQL An ODBC driver thatmakes Lotus Dominodatabases accessible toan SQL tool or applica-tion interface.

Read/write access to LotusDomino data using any appli-cation that supports ODBC.For example, an applicationthat produces reports in LotusNotes using BusinessObjects’ Crystal Reports® orMicrosoft Access.

Lotus Domino Driverfor JDBC™

A Type II JDBC driverthat makes LotusDomino databases looklike another relationalback-end source to anSQL tool or applicationinterface.

Access to Lotus Domino datausing any JDBC-enabledapplication. For example,when your application is aservlet on an HTTP server.

The Formula Language

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 151

Page 185: IBMN8D510

Where to use the Formula languageThe Formula language provides a straightforward and simple programminginterface within Lotus Domino applications. Like other programming lan-guages, the Formula language has rules and syntax. Formula languagecode is generally best used for working with the element that the user iscurrently processing.

Use the Formula language to customize the forms, fields, and views of aLotus Domino application. The following table lists common events andproperties that execute formulas.

Element Property/Event

Form Window TitleWebQuerySavePostOpen (can also executeLotusScript)

Field Value or Default ValueInput ValidationInput TranslationHide/when

View View SelectionForm FormulaColumn Formula

LotusScript

IBM® LotusScript® is an embedded basic scripting language that offersaccess to Lotus Domino data and services beyond the capabilities of theFormula language. It is much more efficient than Formula language foraccessing multiple documents and performing operations on those docu-ments.

Where to use LotusScriptUse LotusScript to program agents and actions or to execute code in adesign element event. The following table lists common events that executeLotusScript.

Element Property/Event

Form PostOpen (can also execute formulas)QueryclosePostRecalc

Topic A: Identify Programming Languages Supported by IBM® Lotus® Domino®

Lesson 7 ■ Introducing Formulas

152 © Copyright IBM Corporation 2007.

Page 186: IBMN8D510

Element Property/Event

Field InitializeTerminate

Agent InitializeTerminate

Criteria for selecting LotusScriptThe following table summarizes the advantages and limitations of usingLotusScript.

Advantages Limitations

● Embedded basic language

● Object-based

● Sophisticated access to LotusDomino data

● Integrated debugger

● Requires programming skills

● 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 AgentBuilder, which includes color formatting and reference Help for the standardJava language and the Lotus Domino classes.

Where to use JavaUse 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 applica-tions that access Lotus Domino applications.

Criteria for selecting JavaThe following table summarizes the advantages and limitations of usingJava.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 153

Page 187: IBMN8D510

Advantages Limitations

● Powerful object-oriented language.

● Remote access and networkingsupport.

● Extensive class library (beyondLotus Domino).

● Multi-threaded.

● Internally, Lotus Domino only supportsits use in agents.

● Complex program developmentrequires third-party development toolwith debugger.

JavaScript

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

Where to use JavaScriptUse the Programmer’s pane to write JavaScript directly into properties andevents of forms, pages, and their design elements. The following table listscommon properties and events that execute JavaScript.

Element Example Properties/Events

Form or page ● JSHeader

● onLoad

● onUnload

● And others

Field or button ● onFocus

● onBlur

● onChange

● onMouseOver

● And others

Criteria for selecting JavaScriptThe following table summarizes the advantages and limitations of usingJavaScript.

Topic A: Identify Programming Languages Supported by IBM® Lotus® Domino®

Lesson 7 ■ Introducing Formulas

154 © Copyright IBM Corporation 2007.

Page 188: IBMN8D510

Advantages Limitations

● Object-based language

● Web standard

● Cross-platform compatibility

● Runs in Lotus Notes clients andWeb browsers

● 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 ofchoices available.

Criteria for choosing a languageThe following table outlines some of the guidelines you can use to make aprogramming language choice.

If the Application Requires Consider Choosing

Complex control LotusScript, Java, or JavaScript

User interaction Formula language, LotusScript, orJavaScript

Access to Lotus Domino data LotusScript, Java, or Formula language

Calculations with simple results Formula language

A series of scripted activities LotusScript or JavaScript

Data access efficiency LotusScript, Java, or Formula language

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 155

Page 189: IBMN8D510

Practice Activity 7-1: IdentifyingProgramming Languages Supported byLotus Domino

ScenarioYou have been working with some co-worker friends on the design team tosharpen your skills in knowing which programming language resources willoffer the best solutions to given problems.

This activity describes several application development scenarios. Select themost appropriate language or languages for each task.

1. You are designing a form with a number of fields. Some fields on theform require an initial value that is changeable by the user. Other fieldsrequire a computed value. Some actions may need to be hidden from cer-tain users.

a) LotusScript

b) JavaScript

c) Formula language

d) Java

2. The application that you are designing requires that you get some of theinput from dialog boxes.

a) Formula language

b) JavaScript

c) LotusScript

d) Java

3. The application you are creating requires access to documents in appli-cations other than the one in which it is saved.

a) Formula language

b) LotusScript

c) JavaScript

d) Java

Topic A: Identify Programming Languages Supported by IBM® Lotus® Domino®

Lesson 7 ■ Introducing Formulas

156 © Copyright IBM Corporation 2007.

Page 190: IBMN8D510

4. You are creating an application that requires some fairly complex interac-tion with the user. In the past, you have had moderate success atautomating a series of tasks, but you do not have extensive experiencein programming.

a) Formula language

b) LotusScript

c) JavaScript

d) Java

5. The application that you are developing involves an extensive amount ofinteraction with the user. You will need to validate field contents, positionthe 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 flow control, includ-ing loops and multiple conditional branches. You have no idea, as youare 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 analyzingthe application, you find that while it is very user friendly, some of theformulas are performing very poorly. Which languages would you use toreplace the formulas to improve the performance of the user interface?

a) Formula language

b) LotusScript

c) JavaScript

d) Java

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 157

Page 191: IBMN8D510

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 formulasFormulas can be used in many design elements such as forms, views,pages, fields, buttons, actions, and so on. Code is entered in an event of anobject in the Programmer’s pane.

Statements

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

Element Description

Variables Can be fields or temporary variables.

Constants Something whose value does not change. Constants can betext, numeric, or time-date.

Operators Assign values, modify values, and combine values into new val-ues.

@Functions Built-in formulas that perform a particular calculation and returna value.

Keywords Reserved words within the Formula language that perform spe-cial functions.

BTopic B: Identify Formula Components

Lesson 7 ■ Introducing Formulas

158 © Copyright IBM Corporation 2007.

Page 192: IBMN8D510

Syntax Rules

All programming languages have rules. The Formula language is no excep-tion. A formula must conform to the general rules described in the followingtable.

Rule Title Rule Description

Statementseparators

Separate multiple statements using a semicolon; for example:@If(@IsNewDoc; True Statement, False Statement)

Spaces Any number of spaces, including none, can be used betweenoperators, punctuation, and values. Keywords and functions,however, must be separated by at least one space.

Case Case is not significant except within text constants. By conven-tion, keywords are usually upper case, and @function and@commands are usually written in mixed upper and lower case.

Operatorsand values

Two values must be separated by at least one operator.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 159

Page 193: IBMN8D510

Topic C: Identify Event Triggers

Objects

Code is placed in an event of an object in the Programmer’s pane. The termobject refers to the element, such as the form, field, and so on. Forinstance, you might create a formula to compute the default value of a field.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. Eventsinclude opening a database, opening a view, opening a document, movingthe cursor into or out of a field, and so on.

The following table describes several common objects, some of their relatedevents, and what triggers their execution.

Object Event and Timing

Database Postopen is triggered after a database, view, or document isopened.Queryclose is triggered when a view, document, or database isbeing closed.

Page orform

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 valuesare recalculated).

Field Default Value is triggered when a document is created.Input Translation is triggered when a document is saved, recal-culated, or refreshed.onBlur is triggered when a field loses focus.onFocus is triggered when a field gets focus.

Button Click is triggered when the button is clicked.

CTopic C: Identify Event Triggers

Lesson 7 ■ Introducing Formulas

160 © Copyright IBM Corporation 2007.

Page 194: IBMN8D510

Field Evaluation Order

Fields on a form are evaluated from left to right, and from top to bottom. It isimportant to keep the order of evaluation in mind when designing the formsin your application. For instance, if a field is computed based on the valuesin one or more other fields on the form, the computed field must be placedafter the field(s) used in the computation.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 161

Page 195: IBMN8D510

Topic D: Compute and Compare Values

Constants

This section describes how to write formulas to compute and compare val-ues.

Using constants in formulasConstants represent static information in a formula. The following tableshows examples of the three types of constants available in the Formulalanguage.

Constant Rules to Apply Examples

Text ● Enclose characters inquotation marks.

● Enclose characters inbraces.

● “Hello world.”

● {Hello world.}

Numeric ● Specify the sign of thenumber using a plus orminus sign as the firstcharacter, if necessary.

● Use E for scientificnotation.

● 10

● -6.37

● 37E6

Date-Time ● Enclose a date or timein square brackets.

● Use AM and PM torepresent time in a12-hour format.

● [5:30 PM]

● [13:50]

● [7/11]

● [10/18/71 6:30 AM]

Variables

This section will familiarize you with both field values and temporary vari-ables.

Using field values in formulasA formula has access to the field values in the document being processed.If a formula refers to a field by name, it will use the value of the field fromthe current document.

DTopic D: Compute and Compare Values

Lesson 7 ■ Introducing Formulas

162 © Copyright IBM Corporation 2007.

Page 196: IBMN8D510

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

Using temporary variablesTemporary variables exist only within a formula. Use them to make your for-mulas more modular and readable. You do not need to declare temporaryvariables 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. Forexample:

@Sqrt(x);

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

Operators

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

Computed Values

You can only combine values of the same type. For example, you cannotadd together text and number values.

The following table describes how to use operators to combine values.

To Combine Use the Operators Example

Number values +-/*

10 + 2.37 + 156.05 - 2.35TotalScore / QuantityTotalPrice *DiscountRate

Text values + or & “Welcome, ” +FirstName

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 163

Page 197: IBMN8D510

Order of Evaluation

When creating formulas that compute values, keep the following informationin mind.

Order Description

Parentheses Using parentheses, you can explicitly force the order ofevaluation. Operations within parentheses occur first.Example:(5-3) * (6-4) = 4

Precedence Operations not in parentheses occur in order of precedence.Example:5 - 3 * 6 - 4 = -17

Left to right Operation of equal precedence occur from left to right.Example:8 / 4 * 2 = 4

Comparison Operators

This section describes how to compare values in formulas.

Comparing values using operatorsCompare values of the same type using the operators. The following tableillustrates how comparison operators work.

This Expression Evaluates to True If Evaluates to False If

A = B The values of A and B areequal.

The values of A and B arenot equal.

A < B The value of A is lessthan the value of B.

The value of A is greaterthan or equal to the valueof B.

A <= B The value of A is lessthan or equal to the valueof B.

The value of A is greaterthan the value of B.

A > B The value of A is greaterthan the value of B.

The value of A is less thanor equal to the value of B.

A >= B The value of A is greaterthan or equal to the valueof B.

The value of A is less thanthe value of B.

Topic D: Compute and Compare Values

Lesson 7 ■ Introducing Formulas

164 © Copyright IBM Corporation 2007.

Page 198: IBMN8D510

This Expression Evaluates to True If Evaluates to False If

A <> BA >< BA != B

The values of A and B arenot equal.

The values of A and B areequal.

(A < B) & (B < C)(A < B) | (A < C)!(A < B)

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

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

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 165

Page 199: IBMN8D510

Topic E: Work with @Functions

@Functions

@Functions are built-in formulas that perform calculations and either returna value or perform an action. @Functions are used in Lotus Domino designelements 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 aboutthe application.

For InformationAbout the

Use the Function Which Returns

Current document @Created The date-time value forwhen the document wascreated.

State of the currentdocument

@IsNewDoc True (1) if the documentis new, or False (0) if thedocument is not new.

View @ViewTitle The title of the currentview.

Database @DbName The server and file nameof the current database.

User @UserName The current user’s name.

ETopic E: Work with @Functions

Lesson 7 ■ Introducing Formulas

166 © Copyright IBM Corporation 2007.

Page 200: IBMN8D510

For InformationAbout the

Use the Function Which Returns

User environment @ClientType “Notes” if the client isLotus Notes or “Web” ifthe client is a Webbrowser.

Web client @BrowserInfo Determines the capabili-ties of a Web client.

Examples of @functionsThe following table contains common examples of formulas.

This Formula Returns

@Adjust ([10/11/05]; 0; 1;-4; 0; 0; 0)

The date-time value, 11/07/05

@Text (10) The text value, “10”

@ProperCase ("hello world.") The text value, “Hello World”

@Trim (" hello world.")

The text value, “hello world”

Conditional Statements

The @If function executes one statement or another depending on whethera logical value is true or false. The @If statement has an odd number ofparameters, with a minimum of three. The parameters are:

● Condition, which is the first 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 first true conditionevaluated causes its corresponding True statement to be processed. Subse-quent 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 167

Page 201: IBMN8D510

This Conditional Statement Returns

@If (3<10; "True"; "False") True

@If (Author = @UserName;"My document"; "Not mine")

“My document” if the Author field con-tains the name of the current user.

Topic E: Work with @Functions

Lesson 7 ■ Introducing Formulas

168 © Copyright IBM Corporation 2007.

Page 202: IBMN8D510

Topic F: Explore Formatting andComments

Formatting

In order to make your code easier to read and debug, it is good practice toinclude comments and formatting. This helps not only the person who devel-oped the code, but also any developer who may have to modify the code ata later date.

Formatting Formula languageFormulas can get quite lengthy, particularly when using nested @If state-ments. To make complicated formulas easier to read, use line breaks andindenting. For example, even an experienced Lotus Domino developerwould 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 beenrejected");@Mailsend(Approver;"";"";"Invoiceoverage";"Invoice"+ invoiceno+"has beensubmitted"));@Mailsend(Vendor:Approver;"";"";"Processed";"Invoice"+ 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 andFalse statements start on separate lines. The statements related to a condi-tion are indented under that condition.

FFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 169

Page 203: IBMN8D510

Comments

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

Commenting Formula languageBy adding explanatory text to any code that you write, your applicationsbecome much easier to maintain. Documenting code is best done while youare writing it.

Use the REM keyword to include comments in Formula language code. Thesyntax is:

REM { comments };

Include a REM statement at the beginning of each line of explanatory text ina formula.

The following example contains several lines of explanatory text before theformula starts. It also contains REM statements inside the formula to furtherdocument 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"))

Topic F: Explore Formatting and Comments

Lesson 7 ■ Introducing Formulas

170 © Copyright IBM Corporation 2007.

Page 204: IBMN8D510

Practice Activity 7-2: Interpreting Formulas

ScenarioYou have been working on a problem you encountered with some code andare trying to determine the outcomes associated with some code state-ments.

A document contains the following fields and values:

FirstName: SusanLastName: SunshineCreated on 12/9/2005 at 11:59:37 PM

Based on the information in the scenario, determine the result for each ofthe 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):

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 171

Page 205: IBMN8D510

10. fullName := FirstName +″ ″ + LastName; ″Welcome back, ″ + fullName:

Topic F: Explore Formatting and Comments

Lesson 7 ■ Introducing Formulas

172 © Copyright IBM Corporation 2007.

Page 206: IBMN8D510

Lesson SummaryIn this lesson, you created formulas and learned about programming lan-guages that can be used in conjunction with Domino. By learning how tobuild and borrow scripting and programming for use in an application, youcan deploy functionality that can leverage data that could not otherwise beprocessed into a form that meets users’ needs.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 7 ■ Introducing Formulas

© Copyright IBM Corporation 2007. 173

Page 207: IBMN8D510
Page 208: IBMN8D510

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

8

© Copyright IBM Corporation 2007.

Page 209: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Identify the characteristics of and uses for the @IsNewDoc function.

● List the fields that can be used to store values in a document.

● List the steps to write a field 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.

Lesson 8 ■ Using Formulas in Forms

176 © Copyright IBM Corporation 2007.

Page 210: IBMN8D510

Topic A: Create Window Titles

Common Uses for Formulas

Use formulas in forms to add, calculate, and format data automatically. Withformulas, you can:

● Display one title when the document is new, and another title when thedocument 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 specified fields leftempty.

● Format user entries to be consistent in all documents.

Form Programming

Each element of the form, including the form itself, is an object. The Pro-grammer’s pane provides access to the programmable properties andevents of objects on the form.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 177

Page 211: IBMN8D510

Procedure Reference: Adding a formula in the Program-mer’s paneFollow 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 Programmer’s pane.

Result: IBM® Lotus® Domino Designer® highlights the object on theObjects tab and displays the programmable properties and events ofthe 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 fields and @functionsthat can be used in the formula.

4. Enter the formula.

Result: Lotus Domino Designer highlights different elements of the for-mula 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 inform events to set fields, prompt users, or perform background processing.

The following table lists most of the form events and when they evaluate.

Form Event When the Event Is Triggered

QueryOpen Before a document opens.

PostOpen After a document opens and is drawn onto the screen.

QueryModeChange Before the document is changed into either edit or readmode.

PostModeChange After the document is changed into either read or editmode.

Topic A: Create Window Titles

Lesson 8 ■ Using Formulas in Forms

178 © Copyright IBM Corporation 2007.

Page 212: IBMN8D510

Form Event When the Event Is Triggered

PostRecalc After the document has recalculated, usually after F9 ispressed.

QuerySave Before the document is saved.

PostSave After the document is saved.

QueryClose Before the form is closed.

Window Titles

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

Procedure Reference: Setting the window titleFollow these steps to set the window title of a form or page.

1. In the Object tab of the form or page, select the window title.

2. Enter a formula that results in a text value.

3. Save the formula.

4. Preview the page or form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 179

Page 213: IBMN8D510

The @IsNewDoc Function

The @IsNewDoc function is particularly useful when creating a form windowtitle. Window titles that incorporate a field from the document will not displaythe window title correctly when the document is new and there is no datayet. By combining @IsNewDoc and @If, you can create a formula that dis-plays one text phrase if the document is new, and another if the documenthas been saved.

The syntax for @IsNewDoc is simply:

@IsNewDoc

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

Example of writing a formula using @If and @IsNewDocThe following example illustrates how to combine @If and @IsNewDoc tocreate a meaningful window title:

@If(@IsNewDoc;"New Document";Subject)

In this case, the phrase “New Document” displays if the document is new. Ifthe document has been saved, the window title changes to the value in theSubject field of the document.

Topic A: Create Window Titles

Lesson 8 ■ Using Formulas in Forms

180 © Copyright IBM Corporation 2007.

Page 214: IBMN8D510

Topic B: Work with Computed Values

Computed for Display Fields

One way to compute values that display on a form is to use Computed fordisplay fields. Computed for display fields are recalculated every time auser opens or saves a document, or when the document is refreshed.

The contents of a Computed for display field are not stored in the docu-ment. The following table describes examples of using Computed for displayfields.

Use a Computed for Display Fieldto Display

Example

The current time @Now

The user’s name @UserName

The creation date of a document @Created

The value of a list field when thedocument is open

WorkType

Computed for display fields require a formula. The formula must evaluateto a value suitable for storage in the field. For example, if the type of field isdate-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 displaycomputed values. It is similar to a Computed for display field, except thatthe result of the formula must be a text value and, unlike fields, you mayuse it on a page. You can format computed text like other text elementsusing the Computed Text Properties box.

The following table describes examples of using computed text.

Use Computed Text to Display Example

Different text based on a condition @If ((DueDate < @Today) &(Status != "Complete");"This is late!"; "")

Dynamic messages "Welcome, " + @Name([CN];@UserName)

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 181

Page 215: IBMN8D510

Procedure Reference: Adding computed textFollow 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 Programmer’spane opens.

2. Place the cursor where you want the result of the computed text toappear.

3. Choose Create→Computed Text.

Result: The Computed Text Properties box opens. The value propertyof 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 theProgrammer’s 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 theproperties 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 offields:

● Computed

● Computed when composed

● Editable

This section describes how to use these field types and set their values.The following table describes Computed and Computed when composedfields.

Field Calculates a Value... Example

Computed Each time users cre-ate, refresh, or savethe document.

The result of a calculation involv-ing other fields, such ascalculating a total.

Topic B: Work with Computed Values

Lesson 8 ■ Using Formulas in Forms

182 © Copyright IBM Corporation 2007.

Page 216: IBMN8D510

Field Calculates a Value... Example

Computed whencomposed

When the users origi-nally create thedocument, or the firsttime that particularfield appears on aform with which thatdocument is opened.

● The original author

● A value that never changes

● The date the document wascreated

Procedure Reference: Setting the value of a Computed fieldFollow these steps to add a formula to calculate the value of a Computedfield.

1. Open the form in Lotus Domino Designer.

2. Select the field.

3. Under the field in the Objects tab, select Value.

4. Enter the formula to compute a value suitable for storage in the field.

5. Test the formula by previewing the form.

Using formulas in editable fieldsGather information from users through editable fields. To improve the usabil-ity of editable fields, 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 valueSpecify an initial value for an editable field in the Programmer’s pane. Addthe formula to the field’s Default value property. The formula executes onlywhen users create documents.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 183

Page 217: IBMN8D510

Topic C: Work with Field Values

Input Translation Formulas

You can automatically format data by specifying an input translation formulafor editable fields. Using an input translation formula, you can format suchthings as:

● Telephone numbers, by adding parentheses, hyphens, or periods.

● Proper nouns, by capitalizing only the first letter.

Working with input translation formulasThe input translation formula is triggered when the document is saved orrefreshed. The input translation formula adjusts or reformats the value.

The result of an input translation formula must evaluate to the same type ofvalue specified by the field. For example, if you are translating a text field,the formula must evaluate to a text value.

Note: Input translation formulas do not apply to rich text fields.

Text Formatting Functions

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

Function Description

@Trim Removes leading, trailing, and redundantspaces in a text string.

@ProperCase Capitalizes the first letter of each word in atext string.

@UpperCase Converts all letters in a text string to upper-case.

@LowerCase Converts all letters in a text string to lower-case.

CTopic C: Work with Field Values

Lesson 8 ■ Using Formulas in Forms

184 © Copyright IBM Corporation 2007.

Page 218: IBMN8D510

Procedure Reference: Writing an input translation formulaFollow these steps to write an input translation formula.

1. Select the field.

2. On the Objects tab of the Programmer’s pane, select the field’s InputTranslation event.

3. In the Script area, write the translation formula.

4. Save the form.

5. Test the formula:

● Preview the form.

● Enter a value and refresh the document.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 185

Page 219: IBMN8D510

Activity 8-1: Interpret Input TranslationFormulas

ScenarioThe data that you need to gather from users includes such items as phonenumbers and zip codes, which you would eventually like displayed in theapplication in a consistent and pleasing way. You decide to use severalIBM® Lotus® Notes® application design features that work to provide thatconsistency.

Follow these steps to interpret input translation formulas.

Step Action

1. Open the your copy of the Practice application in the Lotus Notes client.

2. Choose Create→Translation Demo.

3. Work through the translation formulas.

4. Click Mark Now to see your results.

5. If prompted, in the Execution Security Alert dialog box, select Start trust-ing the signer to execute this action, and click OK.

Input Validation Formulas

You can stop users from saving documents with incorrect or incomplete val-ues by specifying an input validation formula when designing editable fields.

Working with input validation formulasWhen users save or refresh documents, the input validation formulas aretriggered. 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 indicatingthat the value is not acceptable and aborts the save or refresh opera-tion.

Note: The input validation formula runs after the input translation formula.

Note: Input validation formulas do not apply to rich text fields.

Topic C: Work with Field Values

Lesson 8 ■ Using Formulas in Forms

186 © Copyright IBM Corporation 2007.

Page 220: IBMN8D510

Validation Functions

Use the functions @Success and @Failure as the actions in the input vali-dation formula.

The following table describes how to use the two functions when validatingfield values.

If the Field Value Is Use This Function To

Acceptable @Success Continue saving orrefreshing the docu-ment.

Not acceptable @Failure Display a pop-up mes-sage box directing usersto fix the problem, andabort saving or refresh-ing the document.

Examples of Input Validation Formulas

The following code verifies that a new number entered by a user is within aspecific range:

@If (NewNumber >= LowValue & NewNumber <= HighValue;@Success;@Failure ("Please enter a value between " + @Text(LowNumber)

+ " and " + @Text (HighNumber))

The following code verifies that the field contains a value.

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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 187

Page 221: IBMN8D510

Procedure Reference: Writing a field input validation for-mulaFollow these steps to write a field input validation formula.

1. Select the field.

2. On the Objects tab under the field, select Input Validation.

3. In the Script area, enter a formula to test the value.

4. Save the form.

5. Test the input validation formula:

● Preview the form.

● Enter appropriate and inappropriate values and refresh the docu-ment.

Topic C: Work with Field Values

Lesson 8 ■ Using Formulas in Forms

188 © Copyright IBM Corporation 2007.

Page 222: IBMN8D510

Topic D: Work with Lists

Lists

In Lotus Domino, a list is defined as a named entity that contains multiplevalues of the same data type. The return value of some @functions is a list.Fields that allow multiple values contain lists. Constants and variables informulas can contain a list. You can also present lists to a user using aprompt box.

Multiple elements in a list are separated by a colon (:). For example, thefollowing code defines a temporary variable and assigns a list of text ele-ments to it:

cities := {New York} : {London} : {Paris} : {Boston};

List Functions

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

@Function Usage Example

@Elements(list) Returns the number ofelements in a list.

@Elements(Colors)Returns: The number ofelements in the Colorsfield.

@Explode(String; sepa-rator)

Splits a string into a listof values using thespecified separator.

@Explode("RedGreen Blue"; " ")Returns:“Red”:”Green”:”Blue”

@Implode(list;separator) Converts a text list intoa string using the speci-fied separator.

@Implode("Red":"Green":"Blue";"*")Returns:Red*Green*Blue

@IsMember(value; list) Returns true if the valueis a member of the list.

@IsMember("Orange";"Red":"Green":"Blue")Returns: 0 (False)

@Member(value;list) Returns the number ofthe element in the list.

@Member("I";"A":"E":"I":"O":"U")Returns: 3

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 189

Page 223: IBMN8D510

@Function Usage Example

@Subset(list;number) Returns a portion of thelist containing the num-ber of elementsspecified by number.

@Subset({A}:{E}:{I}:{O}:{U};2)Returns: {A}:{E}

@Unique(list) Removes duplicatesfrom a list.

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

Topic D: Work with Lists

Lesson 8 ■ Using Formulas in Forms

190 © Copyright IBM Corporation 2007.

Page 224: IBMN8D510

Activity 8-2: Evaluate List Formulas

ScenarioYou have been asked by your manager to work on developing some lists inthe application you’ve been working on; however, he suggests that youbrush up on some of the possibilities that can be obtained with various fea-tures 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 Action

1. Open your copy of the Practice application in the Lotus Notes client.

2. Choose Create→Lists Demo.

3. Evaluate the list formulas.

4. Enter the result in the appropriate field.

5. When you have evaluated all of the formulas, click Mark Now to see yourresults.

List Choices

Previously, you learned about the different types of fields, which includefields that offer a pre-defined list of choices to the user. To define the list ofchoices, 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 listof choices in a fieldFollow these steps to create a list of choices using a formula.

1. In the Properties box of the List field, click the Control tab.

2. Select Use formula for choices.

3. Enter the formula to create the list of choices.

4. Save the formula.

5. Test the formula by previewing the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 191

Page 225: IBMN8D510

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 field, youcan 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 Data Type Description

class : cache Text list ● Indicates the type ofdatabase (class) youare accessing andwhether to cache theresults.

● For example, "":"",accesses a LotusDomino database andcaches the results.

server : database Text list ● Specifies the locationand file name of thedatabase.

● For example,"":"",refers to the currentdatabase, on yourlocal machine.

view Text ● Specifies the name ofthe view.

columnNumber Number ● Specifies the columnnumber within theview.

Topic D: Work with Lists

Lesson 8 ■ Using Formulas in Forms

192 © Copyright IBM Corporation 2007.

Page 226: IBMN8D510

Example of using @DbColumnThe 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 first column contains the title of all projects currently in progress.

The formula returns a list of all the projects currently in progress (note theuse 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)

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 193

Page 227: IBMN8D510

Topic E: Prompt Users

The @Prompt Function

What do you do when you need to prompt a user for information in yourapplication? If you are working with the Formula language, you use the@Prompt function. @Prompt allows you to create a more interactive inter-face for Lotus Notes applications. The @Prompt function allows users toenter values, respond to questions, or choose from a list of choices.

There are many different styles of prompt boxes, and the prompt boxes canbe triggered in different ways. @Prompt can be used in fields, hotspots (but-tons), manual agents, and toolbar buttons.

Caution: @Prompt does not set the modified flag of the document. Therefore, if aform uses only @Prompts to collect data and set fields, the user could close thedocument and not be prompted to save it.

Syntax for @PromptThe syntax for @Prompt is:

@Prompt( [style] : [ NOSORT ] ; title ; prompt ; defaultChoice ;choiceList ; filetype )

The following table describes the parameters for @Prompt.

Argument Data Type Description

style Keyword Indicates the type of dialog box to display.

NOSORT Keyword If present, the list of choices is not automati-cally sorted.

title Text The title for the dialog box.

prompt Text The text you want to display in the dialog box.

defaultChoice Text The value to use as a default value.

choiceList Text list The values to display in the dialog box’s list.

filetype Text The types of files to display when using theLOCALBROWSE style.

The following example shows a simple @Prompt formula:

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

ETopic E: Prompt Users

Lesson 8 ■ Using Formulas in Forms

194 © Copyright IBM Corporation 2007.

Page 228: IBMN8D510

Triggering @PromptsPrompt dialog boxes can be triggered in the ways described in the followingtable.

Trigger Description

Field formulas Use @Prompt to prompt the user to enter a valuein a field.

Button formulas @Prompt can be used in buttons to take inputfrom a user.

Form and View action buttonsor manual agents

@Prompts are useful in Action buttons andagents. For example, you could prompt the userfor a value and set the value of a field based onwhat the user enters.

Password field formulas In combination with @Password, @Prompt can beused to prompt for a password on a form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 195

Page 229: IBMN8D510

Topic F: Create Reusable Code

Reusable Code

The ability to create reusable code is possible in the Formula languageusing @ThisValue and @ThisName.

Accessing fields without hard-coding the field namesCreating reusable code means creating code that can be used in multipleplaces without changes to the code. Developers can save time by writing aformula once and reusing it in many different places. Using @This Valueand @This Name has the following benefits:

● You do not need to hard-code field names.

● You can write code once that you can then cut and paste into multiplefields throughout an application.

● You do not need to manually revise code every time a field namechanges.

Reusable Code Functions

@ThisName and @ThisValue are especially useful for creating reusableinput translation and validation formulas. The purpose of these @functionsis described in the following table.

@Function Purpose

@ThisValue Returns the value of the current field.

@ThisName Returns the name of the current field.

For example, in an input validation formula for a listbox field that requiresmore than one selection, you can use @ThisValue to check whether a userhas selected more than one list option, and, if not, use @ThisName toprompt 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)

FTopic F: Create Reusable Code

Lesson 8 ■ Using Formulas in Forms

196 © Copyright IBM Corporation 2007.

Page 230: IBMN8D510

Topic G: Implement Error Checking

Run-Time Errors

Run-time errors are inevitable in any program. The application developermust anticipate where errors may occur and ensure that these errors do notprevent the user from working with the application.

Types of errorsThe following table describes the types of run-time errors application devel-opers encounter.

Type of Error Description

Development Users should never see these types of errors. You should dis-cover and fix all of them before rolling out the application.There are the following two types of development errors:

● Unexpected errors are mistakes in programming. Forexample, forgetting a parameter in certain functions will pro-duce the “Insufficient arguments for @function” errormessage at runtime, instead of compile time.

● Unreported errors are incorrect results that do not report anerror. For example, using the incorrect data type for a func-tion may not produce an error message, but the functionwill not operate as you intended.

User These are errors that users might cause while working in theapplication. For example, if you ask the user for a file nameand the user enters a name that does not exist. A developercannot prevent these types of errors, but can anticipate them,test for them, and take appropriate actions to handle them sothey do not cause other problems.

Note: Functions that have only one signature (fixed number of requiredparameters) are checked at compile time. Those that have multiple signa-tures (the same function that operates in different ways depending ondifferent numbers of required and optional parameters) are not.

GFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 197

Page 231: IBMN8D510

The @StatusBar Function

To help find development errors, use @StatusBar to print data to the LotusNotes client status bar as a basic way of debugging formulas. The statusbar (at the bottom of the Lotus Notes client) stores a history of the last 20messages 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 verifythat the formula is functioning correctly.

@StatusBar ("result = " + Result);

Error Generation and Reporting

The Lotus Notes client generates an error for a field when the followingoccur:

● The built-in (default) validation checking fails. This occurs as soon asthe user enters the value.

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

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

Topic G: Implement Error Checking

Lesson 8 ■ Using Formulas in Forms

198 © Copyright IBM Corporation 2007.

Page 232: IBMN8D510

Error-Handling Functions

The following table describes common functions for handling run-timeerrors.

Function Description

@IsError (value) Determines if a field, variable, or expression contains anerror. For example, if a user enters text in a number field.

@Return (value) Stops the execution of a formula and returns a specifiedvalue.

@Failure (mes-sage)

Displays a message when used in a field input validationformula.

@Success Returns 1. Use this in field input validation formulas for bet-ter readability and easier maintenance.

Examples of using @IsErrorYou may use @IsError to test for data entry errors. For example, you candiscover if a user enters text in a number field by checking the value of thefield with @IsError. If you detect an error, you can display your own mes-sage 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 thenumber before saving the document. By using @IsError, you can avoidexecuting the calculation on invalid data. The following code shows anexample of this:

NumberOfItems := @TextToNumber (Quantity);@If (@IsError (NumberOfItems); NumberOfItems := 0; "");

You can also use the @IsError function to display a custom error messageinstead of the one Lotus Notes supplies by default. For example, if the userenters text for a number and attempts to save the document, Lotus Noteswill display a message box with the Cannot convert text to number error.If you use @IsError in the field validation formula for the field, you can use@Prompt to override the supplied message. Below is an example of a fieldvalidation formula that displays a custom error message:

@If (@IsError(@ThisValue);@Failure ("Please enter a number for " + @ThisName + " .");@Success)

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 199

Page 233: IBMN8D510

Lesson SummaryIn this lesson, you used formulas in conjunction with forms. By giving formsadded 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 nec-essary.

Topic G: Implement Error Checking

Lesson 8 ■ Using Formulas in Forms

200 © Copyright IBM Corporation 2007.

Page 234: IBMN8D510

Lab 8-1: Create a Dynamic Title

ScenarioWorldwide Corporation would like to customize the titles displayed to userswhen they open certain documents in the Policies and Procedures applica-tion.

Note: The guided solution to this activity can be found in Appendix A, Solutions toPractice 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 stateof the document.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 201

Page 235: IBMN8D510

Lab 8-2: Automate Data Entry andFormatting

ScenarioAfter reviewing your design work, your supervisor suggests that you addsome functionality that will keep end-users from having to enter the sameinformation over and over again in different components and fix capitaliza-tion mistakes.

During this activity, you will automate data entry and formatting in the Policyform. Here is a list of the functionality that Worldwide would like to incorpo-rate into the application:

● The policy title should be formatted using proper case.

● Create a field to capture the date the policy is created. This date shouldbe displayed without the time element. Name it PolicyCreatedDate

● The effective date should calculate to one month from the date thepolicy is created in order to account for an internal review process. Thisdate should also be displayed without the time.

● When a policy is created, the document should not be saved unless itcontains a title and category.

Perform the following tasks to complete this lab.

1. Implement the above specifications.

2. Preview the form and test your formulas.

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

Topic G: Implement Error Checking

Lesson 8 ■ Using Formulas in Forms

202 © Copyright IBM Corporation 2007.

Page 236: IBMN8D510

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

ScenarioTo make the Policies and Procedures application easier to maintain overtime, create a view that contains the policy categories in the first column.When a policy is created or edited, the categories should be displayed fromthe Categories view. In order to accomplish this:

● Create a Category form containing a field called Category.

● Create Category documents with the following categories:

■ Office Guidelines

■ Benefits

■ Holidays

■ Grievance Procedures

■ Security

■ E-mail Etiquette

■ Diversity

● Create a view called Categories that only displays the Category docu-ments.

● Modify the Policy form to perform a lookup to the Categories view toproduce the list for the Category field.

Hint: The view should only display documents created with the Categoryform.

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

Perform the following tasks to complete this lab.

1. Implement the above specifications.

2. Preview the form and test your formulas.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 203

Page 237: IBMN8D510

Lab 8-4: Create Reusable Code

ScenarioTo ensure that certain fields are populated on the Policy form in your copyof the Policies and Procedures application, create reusable code thatchecks to see if a value is entered in the Policy Number and Policy Titlefield.

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

Perform the following tasks to complete this lab.

1. Create a reusable formula.

2. Copy it into the appropriate fields.

3. Save and test your form.

Topic G: Implement Error Checking

Lesson 8 ■ Using Formulas in Forms

204 © Copyright IBM Corporation 2007.

Page 238: IBMN8D510

Lab 8-5: Implement Error Interception

ScenarioThe Worldwide Corporation frequently updates their company policies andwould like to allow for internal review of any modifications. Revise the Poli-cies and Procedures application to allow for a one month review periodbefore the policy is implemented, and to intercept run-time errors beforethey need to be handled.

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

Perform the following tasks to complete this lab.

1. In the Policies and Procedures application, add a row called Modifica-tions to the Policy to the existing table.

2. Create a Computed Date/Time field called L_ModifiedDates

Specify the following:

● Allow multiple values

● Display date only

● Display separate values with new line

● Hide paragraph if the field is empty

3. The field needs to be modified only when the document is actuallysaved. Write a formula that determines if the field needs to be modified.Have the formula check if/when the document has been saved, and addtoday’s date to the end of the list of values if the document is beingsaved again.

4. On the line below the new field, but in the same table cell, enter

"N/A" and hide it when L_ModifiedDates=NULL.

5. Revise the formula for the Effective Date field to use theL_ModifiedDates field.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 8 ■ Using Formulas in Forms

© Copyright IBM Corporation 2007. 205

Page 239: IBMN8D510

6. Test your form.

7. Close all open windows.

Topic G: Implement Error Checking

Lesson 8 ■ Using Formulas in Forms

206 © Copyright IBM Corporation 2007.

Page 240: IBMN8D510

Using Formulas in Views

■ Topic A: Create Selection Formulas

■ Topic B: Concatenate Values in a View Column

■ Topic C: Display Icons In a View

9

© Copyright IBM Corporation 2007.

Page 241: IBMN8D510

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.

Lesson 9 ■ Using Formulas in Views

208 © Copyright IBM Corporation 2007.

Page 242: IBMN8D510

Topic A: Create Selection Formulas

View Events

View events occur when users work in a specific view or folder. View eventsinclude opening or closing a view, adding documents to a calendar view, oradding documents to a folder. Some examples of view and folder events aredescribed in the following table.

Event Name Result

ViewSelection Selects the documents that the view displays.

QueryOpen Prevents users from opening a view in certain circumstancessuch as from opening a “month end” view before the twenti-eth day of the month.

PostOpen Creates a new document or open an existing one.

QueryRecalc Informs users before a large view refreshes that it could takea while and asks them if they really want to proceed.

QueryPaste Prevents users from pasting documents into the database.

PostPaste Changes the value of StartDateTime and EndDateTime in thedocument when you paste an appointment on a particularday and time slot.

QueryClose Prevents users from closing a view such as when there arestill action items in the action item view assigned to them.

QueryAddToFolder Lets you prevent someone from dragging a document fromone folder or view to another. For example, you can preventdocuments from moving to the Done folder if their status isstill Open. Note that the trigger for this event is in the view orfolder from which the document is moved.

OnSelect Occurs when a view is opened, since a row is highlighted atthat time; also occurs when a document is selected or dese-lected using a checkmark or when the user clicks an “alreadyselected” row.

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

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 209

Page 243: IBMN8D510

Event Name Result

RegionDoubleClick Creates a new document when users clickan area in a calendar view.

QueryDragDrop Prevents someone from dropping anappointment on an inappropriate day ortime, such as a weekend day or a time thatis after 5:00 PM.

PostDragDrop Changes the value of StartDateTime andEndDateTime in the document after youdrop an appointment on a particular day andtime slot.

View Selection Formulas

Views can include all documents in a application or a subset of those docu-ments. The selection condition, whether it is created with Search Builder ora view selection formula, controls the document displayed. All documentsthat match the selection criteria are displayed in the view.

Earlier in the course, you used simple conditions to select which documentsto display in a view. However, view selection formulas provide more controlover which documents a view displays.

Including documents in a viewThe following figure illustrates the view selection process.

Figure 9-1: The View selection process

Topic A: Create Selection Formulas

Lesson 9 ■ Using Formulas in Views

210 © Copyright IBM Corporation 2007.

Page 244: IBMN8D510

The view selection formulaWhen a view is first 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 docu-ments.

The view selection formula syntax is as follows:

SELECT Condition formula;

The following table describes the parts of a view selection formula.

Part Function

SELECT keyword Includes a document based on the result of the comparisonformula.

Condition formula A formula that evaluates to either True (1) or False (0) foreach document in the application. It can use constants,fields, operators, and @functions.

Examples of view selection formulasThe following table describes a few examples of view selection formulas.

This View Selection For-mula...

Includes All Documents That...

SELECT @All Are in the application. This is the default formula forview selection.

SELECT Form = "ei" Were created or last modified using a form namedei.

SELECT (Price <1000) & (InStock ="Yes")

Contain a field called Price whose value is lessthan 1000 and a field called Instock whose value isYes.

SELECT Form = "ei" &Department !="Accounting"

Were created or last modified using the form namedei and do not contain a field named Departmentwhose value equals Accounting.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 211

Page 245: IBMN8D510

Activity 9-1: Write a View Selection Formula

ScenarioYour manager reports back that, due to the wide variance in information thatwill be entered into the application you are developing, there will be timeswhen users will want to see information based on specific criterion and notall the information all the time.

In this activity, you will create a view selection formula that selects docu-ments of employees whose salaries are over $30,000.

Follow these steps to write a view selection formula.

Step Action

1. 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. Select View Selection in the Objects tab.

5. In the Programmer’s 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.

Topic A: Create Selection Formulas

Lesson 9 ■ Using Formulas in Views

212 © Copyright IBM Corporation 2007.

Page 246: IBMN8D510

Topic B: Concatenate Values in a ViewColumn

Concatenation

Concatenating text values, or strings, is useful when you want to combinerelated fields in a single column or when the field value requires supportingtext to make sense to users.

The + sign is used to concatenate text into a single string. For example, thefollowing view column formula displays the first name and last name with aspace between them in a single column.

FirstName + " " + LastName

You can only concatenate text values. To include other data types in yourconcatenation, 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 first make sure that the val-ues are the same data type. For example, to display number and textvalues in a view column, convert the number to text, then concatenate thetext values.

Use @Text to convert number and date-time values to text. @Text offersoptions 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 textvalue. For example, if a currency value is converted to text, you mightwant the new value displayed with the appropriate currency symbolsand punctuation.

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 213

Page 247: IBMN8D510

The @Text Function

There are two types of format string components available for text values:datetime components and numeric value components. These componentscan be combined in various ways. Listed here are several of the more com-monly 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 Formula Result

The Sales field containsthe value 800.

@Text (Sales;"C,2")

$800.00

The Date field contains12/31/2005 11:59:59 PM.

@Text (Date;"S0D2")

12/31

The Date field contains12/31/2005 11:59:59 PM.

@Text (Date;"S1T0")

11:59:59 PM.

Procedure Reference: Writing a formula that concatenatesmultiple values in a view columnFollow these steps to enter a column formula that concatenates multiple val-ues.

1. In the Object list, select the Column Value property under the view.

2. 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.

Topic B: Concatenate Values in a View Column

Lesson 9 ■ Using Formulas in Views

214 © Copyright IBM Corporation 2007.

Page 248: IBMN8D510

Activity 9-2: Concatenate Text And NumberValues

ScenarioRather than have end users needlessly re-enter name information in a partof the application you are developing, you look for a way to manipulate theseparate first and last name data into a full name for display.

In this activity, you will create a view that quickly shows a list of employeesand their date of hire. You will edit your Employee Information form toinclude an editable Date Hired field, with a type of Date/Time. You will thenedit 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 field, assign employee hire dates,and concatenate text and number values.

Step Action

1. In your copy of the Practice application, add a field named DateHired toyour Employee Information form. Give it a type of Date/Time and make iteditable.

2. Using your Employee Information view, open all but one of the docu-ments, and give the employees a date of hire.

3. 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 thecolumn title. Set the column width to 25.

Result: The empty column header is selected and wider.

5. In the Script area for the column, select Formula.

6. Replace the default formula with: FirstName + " " + LastName + "was hired on " + @Text(DateHired; "S0D1");

Result: Employees’ name and hire dates will appear. If an employee washired this year, only the day and month will appear.

7. Sort the column in ascending order.

8. In the View Selection object, select the formula, and type the following for-mula: SELECT Form="ei"

Result: The view will only display documents created with the EmployeeInformation form.

9. Save and preview the view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 215

Page 249: IBMN8D510

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 anicon 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 corre-sponding to the preset list of IBM® Lotus® Domino® icons, or thatevaluates to the name (or alias) of a custom icon stored as a SharedImage Resource.

Column propertiesSelect the Display values as icons option in the Column Info tab of theColumn Properties box. The following figure 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 thatevaluates to the icon. Typically, the formula evaluates to a number that rep-resents a predefined icon, although it can evaluate to a custom icon.

The following formula displays a thumbs up icon next to products that havebeen approved:

@If (Approved="Yes";83;0)

If the approved field contains anything other than the word Yes, then nothingis displayed.

CTopic C: Display Icons In a View

Lesson 9 ■ Using Formulas in Views

216 © Copyright IBM Corporation 2007.

Page 250: IBMN8D510

Predefined Icon Set

Figure 9-3 displays the predefined set of icons available in Lotus Domino.

Figure 9-3: A predefined set of icons available in Lotus Domino.

Procedure Reference: Adding a predefined icon to a columnFollow these steps to add a predefined icon to a view column.

1. Open the view to be modified in IBM® Lotus® Domino Designer®.

2. Choose Create→Insert New Column.

Result: A new column is inserted to the left of the selected column.

3. In the Programmer’s pane, select Formula.

4. Enter a formula that results in a predefined icon value. For example:@If(Approved="Yes";83;0)

5. Choose Design→Column Properties.

Result: The Column Properties box opens.

6. Select Display values as icons.

7. Save and preview the view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 217

Page 251: IBMN8D510

Activity 9-3: Designate Multiple Icons for aSpecific Type of Document

ScenarioSome of your application’s end users will be working with a subset of theentered data; you work on components designed to display that data sub-set.

In this activity, you will use the Sample Employee Information view in yourcopy of the Practice application. Write a formula that uses the hire date todetermine those employees who are fully vested in the company retirementprogram. Create a smiley icon for those fully-vested employees hired before2000, and a checkmark icon for those employees hired after 1/1/2000.

Follow these steps to add multiple icons to your Sample view.

Step Action

1. Open the Employee Information view in your copy of the Practice applica-tion.

2. Add a new column to the left of the first column.

3. Open the Column Properties box.

4. On the Column Info tab, reduce the width to 1 and select Display valuesas icons.

5. In the Programmer’s 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, thosewho were hired on 01/01/2000 or later have a check mark. Anyone with ablank hiring date will have no icon because the inequality evaluates to anerror condition, which stops all processing for that column in that row.

6. Press Shift+F9 to rebuild the view.

7. 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 animage 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 can-not combine a predefined and a custom icon in the same column.

Topic C: Display Icons In a View

Lesson 9 ■ Using Formulas in Views

218 © Copyright IBM Corporation 2007.

Page 252: IBMN8D510

Procedure Reference: Adding a custom icon to a view col-umnFollow these steps to add a custom icon to a view column.

1. Open the application in Lotus Domino Designer.

2. Select Shared Resources→Images from the Design Elements list.

3. Click New Image Resource.

4. Select the image to be added and click Open.

Result: The image is added to the Work Pane list. For example:logo.jpg.

5. Open the view to be modified in Lotus Domino Designer.

6. Choose Create→Insert New→Column.

Result: A new column is inserted to the left of the selected column.

7. In the Programmer’s pane, select Formula.

8. Enter a formula to display the shared image. For example:

@IF(Approved="Yes";"logo.jpg";0)

9. Choose Design→Column Properties.

Result: The Column Properties box opens.

10. Select Display values as icons.

11. Save and preview the view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 9 ■ Using Formulas in Views

© Copyright IBM Corporation 2007. 219

Page 253: IBMN8D510

Lesson SummaryIn this lesson, you selected and manipulated data for use and display inviews. By learning how to select and arrange view data, you can presentinformation in ways that would otherwise require repetitive and sub-optimalentry of redundant information into an application.

Topic C: Display Icons In a View

Lesson 9 ■ Using Formulas in Views

220 © Copyright IBM Corporation 2007.

Page 254: IBMN8D510

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 inForms

10

© Copyright IBM Corporation 2007.

Page 255: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Work with layers.

● Insert computed subforms in forms.

● Work with shared fields.

● 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.

Lesson 10 ■ Enhancing Forms

222 © Copyright IBM Corporation 2007.

Page 256: IBMN8D510

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 ofIBM® Lotus® Domino® pages and forms. Make note of the following whenworking 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.

Benefits of working with layersThere are many benefits to working with layers. Benefits include:

● Precise positioning to allow for complex layout options.

● Stacking layers provides great design control and flexibility. Forexample, different layers containing text and images can be stacked fora high-impact page title.

● Layers can be transparent or opaque, depending upon the type ofeffect desired.

Content of a Layer

Add content to a layer just as you would add content to a form. You cancopy and paste from another form or layer, or type directly in the layer. Youcan also add graphics.

Procedure Reference: Creating a layerFollow these steps to create a layer on a form.

1. Open a form, page, or subform in IBM® Lotus® Domino Designer®.

2. Place the cursor where the layer should appear.

3. Choose Create→Layer.

Result: A blank layer is inserted onto the form. Selection handles sur-round the layer, indicating it is selected.

4. Click inside the layer and add the layer’s content.

5. Save and preview the form.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 223

Page 257: IBMN8D510

Layer Anchors

Each layer has an anchor. The layer anchor associates itself with the ele-ment closest to where it was inserted, such as a paragraph of text. This isreferred to as the parent element.

If the layer is moved, the anchor remains in place. To display or change thename of the layer, right-click the layer anchor. The Layer Anchor Propertiesbox appears with the current name of the layer.

The following figure 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 layer’s background color to be the system color, gray, trans-parent, black, or an RGB value.

The following table lists the color icon choices on the Background tab ofthe Layer Properties box.

Icon Function

System color

Transparent

Topic A: Work with Layers

Lesson 10 ■ Enhancing Forms

224 © Copyright IBM Corporation 2007.

Page 258: IBMN8D510

Icon Function

Black (0,0,0)

Red, Green, Blue (RGB)

Layer Background Images

Layers can contain a background image in addition to, or instead of, a back-ground color. The image used for the layer background must be a sharedimage resource. Images can be displayed once in the layer, or tiled horizon-tally, vertically, or continuously.

Procedure Reference: Modifying the background of a layerFollow these steps to modify a layer’s background.

1. Select the layer.

2. Select Layer→Layer Properties to open the Layer Properties box.

3. Click the Background tab

4. To change the layer’s color, click the drop-down arrow to the right ofColor.

5. Choose one of the color options:

● System

● Transparent

● Black

● RGB

6. Click on the folder, to the right of Image Source, to insert an imageresource.

7. Select one of the image repeat values.

8. Save and preview the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 225

Page 259: IBMN8D510

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 layerin relationship to other layers is displayed, modified, or both, in the LayerPosition tab of the Layer Properties box.

When you drag and drop a layer, or resize it using the layer windowhandles, the Top, Left, Width, and Height parameters change to reflect thenew position or size. These values can also be changed to set the size andposition of a layer explicitly.

The Z-Index parameter determines the order in which the layer appears ifthere are multiple layers on the form, page, or subform. Think of the layersas stacked one upon the other. If there were three layers, the lowest layerwould have a Z-Index of zero, the middle layer would have a Z-Index ofone, and the top layer would have a Z-Index of two. Other facts about theZ-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.

Topic A: Work with Layers

Lesson 10 ■ Enhancing Forms

226 © Copyright IBM Corporation 2007.

Page 260: IBMN8D510

Procedure Reference: Setting a layer’s coordinatesFollow these steps to modify the layer’s position properties.

1. Select the layer.

2. Choose Layer→Layer Properties.

3. Click the Positioning tab.

4. Enter the appropriate coordinates to align the layer from the top or leftedge of the parent element.

5. Enter the appropriate coordinates to change the layer’s height andwidth.

6. Enter the appropriate integer for the layer’s Z-Index.

7. Save and preview the form.

Multiple Layer Alignment

There are different ways to align multiple layers. The following table lists themethods for aligning multiple layers.

To Follow These Steps

Select multiple layers ● Select the first layer.

● Press CTRL and click the other layer(s).

Result: Selection handles appear aroundthe selected layers.

Align multiple layers ● Select the layers to align.

● Choose Layers→Align.

● Select from the available options.

Adjust layer sizes ● Select the layers to adjust.

● Choose Layer→Make same size.

● Select from the available options.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 227

Page 261: IBMN8D510

Hiding Layers

Occasionally, you will want to hide a layer temporarily to make layout adjust-ments.

Like other design elements, layers can be hidden using Hide/When proper-ties. However, for ease of development Lotus Domino Designer providesanother 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 canwork on one layer without another layer, or layers, getting in the way. If alayer is hidden, a grey circle appears next to the name of the layer; other-wise, the circle is empty. The following figure shows a Layer TreeProperties 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 Propertiesbox toggles from Hide to Show.

Procedure Reference: Hiding a layerFollow these steps to hide a layer.

1. Choose Design→Layer Tree.

2. Select the name of the layer you want to hide.

3. Click Hide.

Result: The layer will not be visible for the current session.

Topic A: Work with Layers

Lesson 10 ■ Enhancing Forms

228 © Copyright IBM Corporation 2007.

Page 262: IBMN8D510

Activity 10-1: Work with Layers

ScenarioYou have been experimenting with techniques that improve the visibility andusability of a data entry component you have been developing for yourapplication.

Layers can be used to enhance the appearance of the Employee Informa-tion form you created in an earlier activity. In this activity, you will add alayer with a background image for visual appeal. You will copy the formfields and labels into the layer.

Follow these steps to create a layer.

Step Action

1. Open the Employee Information form in your copy of the Practice applica-tion.

Result: The form appears in the Work pane.

2. Place the cursor below the other content on the form.

3. Choose Create→Layer.

Result: A blank layer is added to the form.

4. Drag the layer handles so that the layer is approximately as large as thearea of the field labels and fields on the form.

5. Highlight the fields and the label text. Press Ctrl+X to cut the fields.

6. Place the cursor inside the layer. Press Ctrl+V to copy the fields into thelayer.

Result: The fields appear inside the layer.

7. Resize and reposition the layer by dragging it so that it is under the formtitle.

Result: The layer, along with its fields and text, is repositioned.

8. Choose Layer→Layer Properties.

Result: The Layer Properties box appears.

9. Click the Background tab.

10. 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 fills the layer.

12. Select the HTML tab.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 229

Page 263: IBMN8D510

Step Action

13. Type Image_and_Fields in the Id field.

14. Save and preview the form.

Topic A: Work with Layers

Lesson 10 ■ Enhancing Forms

230 © Copyright IBM Corporation 2007.

Page 264: IBMN8D510

Topic B: Work with Subforms

Subforms

A subform is a collection of form elements stored as a separate design ele-ment. A subform can contain anything a form can contain.

A form can contain one or more subforms. One subform can be used inmany different forms within the same application or across different applica-tions. Subforms can also be used conditionally, depending on the results ofa formula. Subforms can also contain other subforms.

The benefits of using subforms in your application include:

● Saving design time when the same set of design elements need to beincluded in more than one form.

● Ensuring design consistency among the forms in the application.

The following figure shows one subform being used in multiple forms.

Figure 10-3: Subforms

When to use subformsExamples 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.

BFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 231

Page 265: IBMN8D510

How Subforms Work

Subforms can only be used as part of a form. Every time a document is cre-ated or opened, the form references the subform. Elements of a subformautomatically become part of the form when displaying documents. Changesmade to a subform affect all forms and documents that include the subform.

Procedure Reference: Creating a subformCreating 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 aspart of a form. Follow these steps to create a subform.

1. Open the application in Lotus Domino Designer.

2. Choose Shared Code in the Design list.

3. Select Subforms from the Shared Code list.

4. Click New Subform in the Work pane.

Result: A new blank subform opens in the Work pane.

5. Choose Design→Subform Properties to open the Subform Propertiesbox.

Note: The Include in Insert Subform dialog option is selected bydefault.

6. Name the new subform.

7. Add elements to the subform as you would a form.

8. Save and close the subform.

Topic B: Work with Subforms

Lesson 10 ■ Enhancing Forms

232 © Copyright IBM Corporation 2007.

Page 266: IBMN8D510

Subform Properties

Like other design elements, subforms have properties you can set, usingthe 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 formFollow these steps to insert a subform in a form.

1. Open a form in Lotus Domino Designer.

2. In the Work pane, click where the subform will appear.

3. Choose Create→Resource→Insert Subform.

Result: The Insert Subform dialog box appears.

4. Select a subform from the list that appears.

5. Click OK.

Result: The subform appears in the specified place in the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 233

Page 267: IBMN8D510

Computed Subforms

You can have subforms appear conditionally, depending on the result of aformula. This is called a computed subform. For example, you might offerusers a choice of custom mail forms with different graphics and styles forvarious types of messages.

Procedure Reference: Implementing computed subformsFollow these steps to implement computed subforms.

1. Create the subform(s).

2. Decide under what conditions each subform will appear.

3. Write a formula to include the subform(s) based on those conditions.

4. 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 onwhether a user is posing a question, replying to a question, or adding acomment.

@If(MsgType="question";"QuestionSub"; MsgType="reply"; "ReplySub";"CommentSub")

The value in the MsgType field determines which subform is used.

Procedure Reference: Inserting computed subforms informsFollow these steps to insert a computed subform in a form.

1. Open the form.

2. Click where you want to add the subform.

3. Choose Create→Resource→Insert Subform.

4. Select Insert Subform based on formula.

5. Click OK.

6. Enter a formula in the Programmer’s pane that determines whichsubform to display.

7. Save the form.

Topic B: Work with Subforms

Lesson 10 ■ Enhancing Forms

234 © Copyright IBM Corporation 2007.

Page 268: IBMN8D510

Topic C: Create Shared Fields

Shared Fields

You can define a field for use on more than one form. For example, manyforms have a creation date field; you can define this field once and reuse it.When you define a field as a shared field, Lotus Domino Designer displaysthe field with a dark border and adds the field name to a list of shared fieldsavailable for use in an application.

Note: In multiple-database applications, you can use shared fields from separatedatabases.

Benefits of Shared Fields

The benefits of using shared fields include:

● Maintaining and reusing consistent formulas throughout an application.

● Providing single point maintenance for a given field.

● Standardizing keyword lists.

Procedure Reference: Creating a shared fieldFollow these steps to create a shared field.

1. Expand Shared Code in the Design pane. Click Fields.

2. Click New Shared Field.

3. Enter a name for the shared field.

4. Assign a Field type and choose Editable or a computed option, ifapplicable.

5. Close the Field Properties box.

6. Close and save the shared field.

Procedure Reference: Inserting shared fieldsFollow these steps to insert a shared field onto a form or subform.

1. Open a form or subform and position the cursor where you want thefield to appear.

2. Choose Create→Resource→Insert Shared Field.

Result: The Insert Shared Field dialog box appears.

CFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 235

Page 269: IBMN8D510

3. Select the shared field you want to use and click OK.

To select a shared field from another application, click the Databaselist, highlight a application, select a shared field in that application, andclick OK.

Procedure Reference: Converting single to shared fieldsFollow these steps to convert a single-use field to a shared field.

1. Open the form.

2. Click the field to be shared.

3. Choose Design→Share This Field.

Topic C: Create Shared Fields

Lesson 10 ■ Enhancing Forms

236 © Copyright IBM Corporation 2007.

Page 270: IBMN8D510

Topic D: Enable Inheritance in Formsand Documents

Inheritance

Lotus Domino Designer allows you to create fields that inherit values fromother fields. The source fields and target fields can be in separate docu-ments or in the same document. Therefore, data can be entered orassigned once and reused as needed in multiple places.

For example, when an employee is first hired, there are many forms thatneed to be completed which include the employee’s name, address,employee number, job title, and so on. Using inheritance, this informationneed only be entered once.

Lotus Domino supports this sharing of information by providing a method forinheriting information from one document to another.

Benefits of inheritanceThe ability to inherit information automatically from one document to anotherhas a number of benefits, including:

● It is more efficient than typing the same information multiple times.

● It helps preserve the accuracy of the information contained in eachdocument.

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 237

Page 271: IBMN8D510

How inheritance worksFields can inherit values from fields in other documents in the same data-base or from fields on the same document. The following figure illustrateshow one source document contains field data that can be inherited by mul-tiple 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 thedeveloper:

● Enable the On Create: Formulas inherit values from selected docu-ment form property.

● Create field(s) containing the following characteristics:

■ Computed when composed field type

■ Includes a formula that specifies the source field

Topic D: Enable Inheritance in Forms and Documents

Lesson 10 ■ Enhancing Forms

238 © Copyright IBM Corporation 2007.

Page 272: IBMN8D510

Procedure Reference: Enabling inheritance on a formFollow these steps to enable inheritance for a form.

1. Create a form or open an existing form in Lotus Domino Designer.

2. Open the Form Properties box. On the Defaults tab, select On Create:Formulas inherit values from selected document.

3. Specify a Computed Field type for the field(s) that will inherit informa-tion.

4. Write a formula for the inheriting field(s) that evaluates to the sourcefield name.

5. Save the form.

6. To test your work, highlight an existing document that contains thefield(s) to inherit, and then create a document with the new or revisedform.

Note: Fields that inherit information do not need the same field name as theirsource fields; they do, however, need to be the same data type.

For consistency sake, an inherited field’s name should be kept the same asthe original field if it contains the same information. This allows for more con-sistent programming methods and view formulas.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 239

Page 273: IBMN8D510

Activity 10-2: Enable Inheritance

ScenarioEver mindful of keeping end-users from needlessly having to enter data, youdiscover a technique for obtaining data from one document and using it onanother.

In this activity, you will create an Employee Benefits form that inherits anemployee’s first and last name from documents created earlier in thecourse.

Follow these steps to enable inheritance.

Step Action

1. In your copy of the Practice application, create a form and name itEmployee Benefits with an alias of eb

Result: The form appears in the Work pane.

2. Choose Design→Form 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 field with the following characteristics:

● Name: InheritFName

● Type: Text, Computed when Composed

Result: The InheritFName field is created.

5. In the Programmer’s pane for the InheritFName field, enter the formula:FirstName

Result: The FirstName field is added as a formula.

6. Create a field with the following characteristics:

● Field name: InheritLName

● Type: Text, Computed when Composed

● Formula: LastName

Result: The InheritLName field is created.

7. Create a rich text field named Comments.

8. Save your changes.

9. Create an Employee Benefits view in order to see the new documents youwill create.

Topic D: Enable Inheritance in Forms and Documents

Lesson 10 ■ Enhancing Forms

240 © Copyright IBM Corporation 2007.

Page 274: IBMN8D510

Step Action

10. In the Lotus Notes client, open the Employees view. Select one of theemployee documents that you created earlier in the course.

11. Choose Create. Select Employee Benefits.

Result: A new Employee Benefits form opens with the appropriate fieldspopulated from the selected document.

12. Save the new document.

13. Verify that the new document is displayed properly, and that it displays thecorrect content.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 241

Page 275: IBMN8D510

Topic E: Create Related Forms

Related Forms

In almost every application there is a need to create information that isrelated to other information. A typical example of this is a question andanswer structure. Another very familiar example is a discussion forum.

Form typesLotus Domino provides for a main document/response document structure,sometimes referred to as a response hierarchy, by letting the developer des-ignate a form’s type. The following table lists the three Lotus Domino formtypes and how they are used.

Form Type Description

Document This document type is the default for Lotus Domino forms. Itis used to create the top level in a hierarchy of documents.These documents are sometimes referred to as main or par-ent documents.

Response This document type is a child to the Document type. It isreferred to as a response document.

Response toresponse

This document type is a child to the Response documenttype. It is referred to as a response to response document.

ETopic E: Create Related Forms

Lesson 10 ■ Enhancing Forms

242 © Copyright IBM Corporation 2007.

Page 276: IBMN8D510

The response hierarchyThe following figure 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 aresponse or a response to a response, change the Form Type property.The following figure shows the Form Type property.

Figure 10-6: Form Type properties

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 243

Page 277: IBMN8D510

Procedure Reference: Creating a response formFollow these steps to create a response form.

1. Create a form or open an existing form in Lotus Domino Designer.

2. Choose Design→Form Properties.

3. 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 otherresponses.

4. Save the form.

Document Relationships

To properly establish the relationship between a main document and aresponse document, you must have the main document selected in a viewor opened when the response is created.

Topic E: Create Related Forms

Lesson 10 ■ Enhancing Forms

244 © Copyright IBM Corporation 2007.

Page 278: IBMN8D510

Inheritance and Related Documents

Inheritance is frequently used to transfer information between main andresponse documents. For instance, in a discussion application you typicallyrepeat the subject of the main document in the response. As with documentto document inheritance, the main document must be selected or openwhen a response is created for inheritance to work correctly.

Threaded Discussions

When developers design any type of main document/response documentapplication, sometimes referred to as a threaded discussion, it is good prac-tice to consider how users keep track of the information in the maindocument. Using Lotus Domino form properties, the developer can designthe response form to:

● Create a link to the main document in a rich text field.

● Copy the contents of the main document as collapsible rich text.

● Copy the contents of the main document into a rich text field.

Linking to the main document takes up much less disk space and is gener-ally the preferred method.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 245

Page 279: IBMN8D510

Activity 10-3: Create Related Forms

ScenarioYou realize that a series of steps you need your end users to take are reallya part of a larger part of the data entry process; you look for ways to com-bine those process steps into a single larger component.

In this activity, you will make the Employee Benefits form a response formand include a link to the parent document.

Follow these steps to create related forms.

Step Action

1. Open your copy of the Employee Benefits form in Lotus Domino Designer.

Result: The form appears in the Work pane.

2. Create a field with the following characteristics:

● Name: ParentDoc

● Field type: Rich Text and Computed

Result: The new field is created.

3. Choose Design→Form Properties.

Result: The Form Properties box opens.

4. Click the Defaults tab. Select On Create: Inherit entire selected docu-ment into rich text field.

5. Select the ParentDoc field from the list. Select Link.

Result: The form properties are set.

6. On the Form Info tab, select Response from the Type drop-down list.

7. Save the form.

8. To test your changes, select a document in the Employees view and createan Employee Benefits document. Note that there is now a link to the parentdocument.

Topic E: Create Related Forms

Lesson 10 ■ Enhancing Forms

246 © Copyright IBM Corporation 2007.

Page 280: IBMN8D510

Topic F: Enable AutoSave

The AutoSave Feature

AutoSave is a new feature that allows Lotus Notes documents to be savedat user-specified 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 editedare automatically copied to the AutoSave application periodically. The peri-odic time is set in the user’s preferences. If Lotus Notes is shut downimproperly, the AutoSave application contains the documents that were inprocess. When the user opens Lotus Notes again, the user is prompted torecover the documents.

The Autosave Application

If AutoSave is enabled, the AutoSave application is created automaticallywhen the user creates a new document or edits an existing one. The appli-cation is local and is created from the AUTOSAVE.NTF template. Theapplication is named as_flastname.nsf, where flastname is the first initialand last name of the user. Documents in the AutoSave application areremoved when they have been properly saved, sent, or discarded. Thedocuments cannot be opened within the AutoSave application.

FFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 247

Page 281: IBMN8D510

Procedure Reference: Enabling AutoSave on a formFollow these steps to enable AutoSave on a form.

1. Open the form in the Lotus Domino Designer.

2. Open the Form Properties box.

3. In the Options section, select Allow Autosave.

4. Save and close the form.

Procedure Reference: Enabling AutoSave in the LotusNotes clientFollow these steps to enable AutoSave in the Lotus Notes client.

1. In the Lotus Notes client, choose File→Preferences→Basic Notes Cli-ent Configuration.

2. In the Start Up Options section, enable AutoSave for a time framesuch as every two minutes.

3. Click OK.

Note: It is not necessary to restart Lotus Notes for the change to takeeffect.

Topic F: Enable AutoSave

Lesson 10 ■ Enhancing Forms

248 © Copyright IBM Corporation 2007.

Page 282: IBMN8D510

Activity 10-4: Implement AutoSave

ScenarioA data entry area you are designing is a little involved; you are worried thatusers might lose data and begin looking for ways to capture whatever isentered.

You need to complete the following tasks to implement and test theAutoSave functionality.

1. Enable AutoSave on the form.

2. Enable AutoSave in the Lotus Notes client.

3. Test the AutoSave functionality.

Follow these steps to implement AutoSave.

Step Action

1. Open your copy of the Practice application in Lotus Domino Designer.

2. Open the Employee Information form.

3. In the Form Properties box, on the Form Info tab, select Allow Autosave.

4. Save and close the form.

5. In the Lotus Notes client, choose File→Preferences→Basic Notes ClientConfiguration.

6. In the Startup and Shutdown section, enable AutoSave for every 2 min-utes.

7. Click OK.

8. Restart the Lotus Notes client.

9. In the Lotus Notes client, open the Practice application and create a newEmployee Information document.

10. Fill out the form. Do not save it, but leave it open until you see theAutoSave complete message in the status bar. It will take about two min-utes to appear. Leave the document open.

11. Launch the Task Manager and end the processes nlnotes.exe andntaskldr.exe.

Note: To launch the Task Manager, press CTRL+ALT+DELETEand click Task Manager.

12. Launch the Lotus Notes client, and enter your password.

13. When prompted to recover the 1 unsaved document, click No.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 249

Page 283: IBMN8D510

Step Action

14. Open the AutoSave application. You will have to enter the filenameas_SNDnn.nsf in the Open Application dialog box, where nn is your stu-dent number. For example, as_SND01.nsf.

15. Right-click the document and choose Document Properties.

16. Switch to the Fields tab to view the fields in the document.

17. Scroll to the top of the list to see those fields specific to the AutoSave func-tionality.

18. Close the Properties box and the AutoSave application.

19. From the menu, choose File→AutoSave→Recover Autosaved Docu-ments.

20. If necessary, select the document in the dialog box and click Recover.

21. Save the document properly and close it.

22. Open the AutoSave application to see that the document has beenremoved.

23. Verity that the AutoSave→Recover AutoSaved Documents menu optionis grayed out.

24. Close all open windows.

Topic F: Enable AutoSave

Lesson 10 ■ Enhancing Forms

250 © Copyright IBM Corporation 2007.

Page 284: IBMN8D510

Topic G: Implement IBM® Lotus®

Sametime® Instant Messaging in Forms

Instant Messaging

The Lotus Instant Messaging product is a powerful tool for enabling teammembers who are online at the same time to communicate directly witheach other. You can use Lotus Domino Designer 8 to integrate Lotus InstantMessaging into your Lotus Domino applications. Here, you will explore someof the options for including Lotus Instant Messaging in a Lotus Dominoapplication.

The following figure shows an example of instant messaging. You can seethe online status of the users shown in the From and To fields of a LotusNotes mail document. You can right-click a name and initiate a chat withany user who is active.

Figure 10-7: Instant messaging example

For users to use instant messaging functionality, they must be connected toa 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 fields can all be enabled for online aware-ness, so that the field displays the status of users who are online at thesame time. While viewing a document, users can right-click an active nameto initiate a chat. The following figure shows the property to select whenenabling instant messaging for a field.

GFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 251

Page 285: IBMN8D510

Note: You will work with Authors and Readers fields later in the course.

Figure 10-8: Enabling instant messaging for a field

When you open a document, if the author is online, the online indicator willappear beside the author’s name, as shown in this figure.

Figure 10-9: The online indicator

Topic G: Implement IBM® Lotus® Sametime® Instant Messaging in Forms

Lesson 10 ■ Enhancing Forms

252 © Copyright IBM Corporation 2007.

Page 286: IBMN8D510

Procedure Reference: Enabling Online Awareness for aFieldFollow these steps to enable online awareness for a Names, Authors, orReaders field.

1. Open a form in a application in Lotus Domino Designer.

2. Create a Names, Authors, or Readers field that evaluates to an abbre-viated hierarchical name, such as Elizabeth Torrington/East/.

3. Open the Control tab of the Field Properties box, and select the ShowOnline Status check box.

4. Optionally, enter a Contact List Group label for the users listed in thefield. The label can be either a formula that evaluates to a text string, oryou can enter a text string enclosed in quotation marks, such as “SalesTeam”.

5. To test your work, open the application in Lotus Notes. In the view thatcontains the form, open the document of an active author. You see theonline status indicator beside the author’s name. Right-click the author’sname and click Chat with to open a chat window.

Instant Messaging Contact List

The Instant Messaging Contact List embedded element lets a designerembed an instant messaging contact list in a page, form, subform, or richtext field of a document. This functionality allows users to see an instantmessaging contact list displayed on a page or in a document and to initiatea chat.

After embedding the contact list, you can improve the display by setting sizeand color properties in the Embedded Contact List Properties box, asshown in this figure.

Figure 10-10: Embedded Contact List properties

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 253

Page 287: IBMN8D510

Procedure Reference: Embedding an instant messagingcontact list on a formFollow these steps to embed an instant messaging contact list on a form.

1. In Lotus Domino Designer, in the appropriate application, create a tableon a form and set its properties for how the table displays.

2. With the cursor in the appropriate column in which you want to embedan Instant Messaging contact list, choose Create→EmbeddedElement→Instant Messaging Contact List.

3. Adjust the properties of the embedded contact list, as necessary toimprove the display of the contact list.

4. Save the form.

5. When you test this functionality, you open a document created with thisform. When you double-click the document to put it in edit mode, youshould see your embedded contact list in the table.

Topic G: Implement IBM® Lotus® Sametime® Instant Messaging in Forms

Lesson 10 ■ Enhancing Forms

254 © Copyright IBM Corporation 2007.

Page 288: IBMN8D510

Lesson SummaryIn this lesson, you worked with layers, subforms, instant messaging, andautosave features. By adding increased functionality in gathering andrecording data that might require instant communication or multiple levels ofinformation, you can create components that get the job done without both-ering users who would otherwise have to use multiple areas of anapplication or interrupt their work to communicate with co-workers throughother means.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 255

Page 289: IBMN8D510

Lab 10-1: Create Question and AnswerForms in the Policies and ProceduresApplication

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

ScenarioThe Worldwide Corporation wants to make it easier for employees to askquestions and receive answers about company policies. In this activity, youwill create Question and Answer forms. The Answer form needs to inheritinformation 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 file to enhance the lookof 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 andanswer documents correctly.

Perform the following tasks to complete this lab.

Topic G: Implement IBM® Lotus® Sametime® Instant Messaging in Forms

Lesson 10 ■ Enhancing Forms

256 © Copyright IBM Corporation 2007.

Page 290: IBMN8D510

1. Guidelines for the Question Form

The Question form needs to gather certain information. The followingtable describes the information to be gathered and lists suggested fieldnames and types.

Information to Be Gathered Suggested Field Name and Type

The user’s first name FName, Text

The user’s last name LName, Text

The category that the questionfalls into. The categories are:

● Office Guidelines

● Benefits

● Holidays

● Grievance Procedure

Category, Dialog List with the followingchoices:

● Office Guidelines

● Benefits

● Holidays

● Grievance Procedure

The subject of the question Subject, Text

The question Question, Rich text

The date the question was cre-ated

QuestionDate, Date-time

The display category 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 257

Page 291: IBMN8D510

2. Guidelines for the Answer form

The Answer form needs to be designed so that it is a functional form forcreating an answer (response) to the questions posed using the Ques-tion form. Think about the kinds of information that would be helpful. Forinstance, would it be helpful to have the subject of the question on theanswer form? How about a link to the question?

Also, the Answer form should have a similar look and feel as the Ques-tion form. Use the same colors and graphics used in the Questionform.

The following table lists suggested information to gather, along with sug-gested field names and types.

Information to Be Gathered Suggested Field Name and Type

The subject of the question QuestionSubject, Text

The date the question was created QuestionDate, Date-Time

A link to the question QuestionLink, Rich text

The answer Answer, Rich text

The date the answer was created 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 thefields and field labels.

Apply any subform you create in this activity to the Policy form as well.

Topic G: Implement IBM® Lotus® Sametime® Instant Messaging in Forms

Lesson 10 ■ Enhancing Forms

258 © Copyright IBM Corporation 2007.

Page 292: IBMN8D510

Lab 10-2: Enable Instant Messaging in aField (Optional Lab)

ScenarioThe Worldwide Corporation makes every effort to facilitate internal commu-nication and collaboration. Sometimes, employees have questions aboutpolicies that might be too specific or sensitive to use the Question andAnswer forms, or more information might be needed in order to answer thequestion completely.

Perform the following tasks to complete this lab.

1. On the Question form in your copy of the Policies and Proceduresapplication, add a Names field that evaluates to an abbreviated hierar-chical name. Name the field ContactPerson, and have it populated byselecting the name from WWCorp’s address book. Use input validationto make it a mandatory field.

2. Enable online awareness for the new field.

3. Test your changes.

Note: The solution for this activity can be found in Appendix A, Solutions toPractice Activities.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 10 ■ Enhancing Forms

© Copyright IBM Corporation 2007. 259

Page 293: IBMN8D510

Lab 10-3: Embed an Instant MessagingContact List on a Form (Optional Lab)

ScenarioTo further facilitate communication and collaboration between WorldwideCorporation employees, you will embed an instant messaging contact list onthe Answer form.

Perform the following tasks to complete this lab.

1. On the Answer form in your copy of the Policies and Proceduresapplication, create a single–cell (1x1) fixed-width table just below the“Answered by” text in the field 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 listfit 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 PracticeActivities.

Topic G: Implement IBM® Lotus® Sametime® Instant Messaging in Forms

Lesson 10 ■ Enhancing Forms

260 © Copyright IBM Corporation 2007.

Page 294: IBMN8D510

Enhancing Views

■ Topic A: Define Hierarchical Views

■ Topic B: Display Response Data in Views

■ Topic C: Implement Shared Columns

■ Topic D: Enable IBM® Lotus® Sametime® Instant Messaging inViews

■ Topic E: Create Views for the Web

11

© Copyright IBM Corporation 2007.

Page 295: IBMN8D510

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 frommore than one form.

● Implement shared columns.

● Enable a column for instant messaging.

● Create a view for the Web.

Lesson 11 ■ Enhancing Views

262 © Copyright IBM Corporation 2007.

Page 296: IBMN8D510

Topic A: Define Hierarchical Views

Hierarchical Views

Earlier in the course, you created Question and Answer forms. Unless youdesign a view to display this document hierarchy, the documents are noteasy to find and their relationship is not necessarily apparent.

A hierarchical view is a view that displays main documents and their asso-ciated response documents, and visually distinguishes between them. Eachmain document has its response documents indented under it. Displayingresponse documents beneath main documents helps to view the progres-sion of a discussion. Each level is indented three spaces under its parentdocument.

Procedure Reference: Displaying documents in a hierarchyFollow these steps to display main documents and response documents ina hierarchy.

1. Create a view.

2. Write an appropriate selection formula.

3. Set the Show response documents in a hierarchy View property.

4. Create columns to display the data.

5. Create a responses only column for displaying the response docu-ments.

6. Save and test the view.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 263

Page 297: IBMN8D510

Topic B: Display Response Data inViews

Default View Display

View columns are structured to display data from fields in the main docu-ment. The view displays little, if any, data from response documents.

If the response form happens to contain fields with the same names asthose specified in the column formulas, that data will appear in the view.Otherwise, the rows representing responses show no meaningful data. Tospecify information to be displayed about each response document, use aresponses-only column.

Responses-Only Columns

A responses-only column displays data from a document only if that docu-ment is a response or response to response document. The responses-onlycolumn should be positioned to the left of the column under which you wantit to indent. The data displayed for a responses-only column starts just tothe right of where you position it in the row, and extends to take up theentire row.

Note the following about placement of columns:

● Columns to the left of the responses-only column, such as a date, willdisplay response data (if available in the document) in the row.

● Columns to the right of the responses-only column do not appear forresponse documents; the contents of the responses-only columnappear instead.

BTopic B: Display Response Data in Views

Lesson 11 ■ Enhancing Views

264 © Copyright IBM Corporation 2007.

Page 298: IBMN8D510

Procedure Reference: Creating a responses-only columnFollow these steps to add a responses-only column to a view.

1. Open the view in IBM® Lotus® Domino Designer®.

2. Create a new column to the left of the column under which responseswill indent.

3. On the Basics tab of the Column Properties box:

● Leave the column title blank.

● Set the width to 1.

● Select Show responses only.

4. Write a column formula that displays information about the responsedocuments in the column, such as subject, authors, and creation dates.

5. Save the view.

6. Test the view by previewing it in IBM® Lotus Notes®.

Example of a formula used in a responses-only columnTypically, a responses-only column contains information from several fields.The following example formula concatenates two fields and adds static text.Notice that the Date field 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 oneform. When using more than one form in a view, the view selection formulamust be written to select both of them. The following code is an example ofa 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 265

Page 299: IBMN8D510

Topic C: Implement Shared Columns

Shared Columns

As with fields and actions, columns can also be shared. By using a sharedcolumn, you eliminate the need to create the same column in multiple viewsor even copy and paste from one view to another. When you insert a sharedcolumn, you can choose to use the formula and properties of the column orjust the formula.

Procedure Reference: Creating a new shared columnFollow these steps to create a new shared column.

1. On the Lotus Domino Designer menu, click Create→Design→SharedColumn.

Or, in the Design pane, select Shared Code→Columns and click theNew Shared Column button.

2. Enter a name in the Shared Column Properties box. Optionally, enteran alias and comments.

3. In the Properties box, switch to Column and enter a title for the sharedcolumn. Make any additional changes, as desired. All standard columnproperties are available for the shared column.

Note: When you first create a shared column or when you open it forediting, the Shared Column properties will appear by default. You mustswitch to the Column properties to make changes to properties such astitle and style.

4. In the Objects pane, select Column value.

5. In the Programmer’s pane click Simple Function, Field, or Formula,then enter the function, field, or formula to display in the shared col-umn.

Note: When you first create a shared column or when you open it forediting, the Shared Column Properties box will appear by default. Youmust switch to the Column Properties to change properties such astitle and style.

6. Save the column.

Procedure Reference: Creating a shared column from anexisting columnFollow 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.

CTopic C: Implement Shared Columns

Lesson 11 ■ Enhancing Views

266 © Copyright IBM Corporation 2007.

Page 300: IBMN8D510

2. Select the column to share and choose Create→Copy as shared col-umn or right-click the column and choose Copy as shared column.

3. In the dialog box, enter a name for the new shared column.

4. Click OK to save the column.

Note: The column that was used to create the shared column is notaffected by any changes to the new shared column.

Procedure Reference: Using a shared column in a viewFollow these steps to insert a shared column.

1. Open the view where you want to place the shared column in the LotusDomino Designer.

2. Click an existing column where you want to place the shared column.

3. From the menu, choose Create→Insert New Shared Column orAppend New Shared Column.

4. Select the Use Formula Only box if you want to change the formattingof the shared column directly in this view.

If selected, any formatting changes you make in this view will not affectother instances of the shared column, and any formatting changes youmake to the shared column outside of this view will not be propagatedto this instance of the shared column.

If you do not select this box at the time of insertion, you will not be ableto change the properties of the column inside this view.

Procedure Reference: Editing a shared columnFollow these steps to edit a shared column.

1. In the Design pane, select Shared Code→Columns and double-clickthe name of the shared column.

2. Make any desired changes to the shared column in the Column Prop-erties box and in the Programmer’s pane.

3. Save the changes. When you save the changes, any view using theshared 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 sharedcolumn with the old name will not be updated.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 267

Page 301: IBMN8D510

Open for EditingIf a view that uses the shared column is currently open for editing in LotusDomino Designer at the time you choose to save your changes, you willreceive the following message: "A folder or view (ViewName)using this shared column is being edited. Please exitthe view or folder before continuing this operation."

Note: You can also open a shared column for editing, by selecting the col-umn in a view and choosing Design→Edit Shared Column; however, thisprocess will leave the view open, and when you attempt to save thechanges to the shared column, you will receive the above error message.

Procedure Reference: Deleting a shared columnFollow these steps to delete a shared column.

1. In the Design pane, select Shared Code→Columns.

2. Highlight the name of the shared column to be deleted and pressDelete or choose Edit→Delete.

Note: When a shared column is deleted it is not removed from anyviews where it is used. The column reverts to a standard or unsharedcolumn.

Topic C: Implement Shared Columns

Lesson 11 ■ Enhancing Views

268 © Copyright IBM Corporation 2007.

Page 302: IBMN8D510

Activity 11-1: Create Shared Columns

ScenarioIn building a series of application components, you realize that a category ofinformation is used in common among several different components. Youbegin the task of figuring out how to share the information so that no furtherdata entry is necessary.

Follow these steps to create shared columns.

Step Action

1. Open your copy of the Practice application in Lotus Domino Designer.

2. Navigate to Shared Code→Columns.

3. Click New Shared Column.

4. Type SSalary as the column name

5. Switch the Properties box from Shared Column to Column.

6. Type Salary for the column title.

7. In the Programmer’s pane, set the column to display the Salary field.

8. Using column properties, center the heading and the value.

9. Save and close the column.

10. Open the Employee Information view.

11. Right-click the Department column, and choose Copy as Shared column.

12. Type SDepartment as the name, and click OK to save the shared column.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 269

Page 303: IBMN8D510

Activity 11-2: Insert Shared Columns

ScenarioA previously created application component has a data category you needfor the component you’re currently developing.

Follow these steps to insert the shared columns into an existing view.

Step Action

1. In your copy of the Employee information view, delete the last two col-umns.

2. Select the First Name column.

3. Choose Create→Append New Shared Column.

4. Select the SDepartment column, Use Formula Only, and Insert.

5. Choose Create→Append New Shared Column.

6. Select the SSalary column and Insert.

7. Save the view.

Topic C: Implement Shared Columns

Lesson 11 ■ Enhancing Views

270 © Copyright IBM Corporation 2007.

Page 304: IBMN8D510

Activity 11-3: Modify Shared Columns

ScenarioThe “in-common” data category works in one component but needs a littletweaking in another. You look for ways to implement the “tweak.”

Follow these steps to modify shared columns.

Step Action

1. In your copy of the Employee Information view, double-click the Salarycolumn. Notice that all of the properties are greyed out.

2. Choose Design→Edit Shared Column.

3. Switch to Column Properties and click the Advanced Format tab.

4. Change the style to Number.

5. Specify Number Format, 2 Decimal places, and Punctuated at thousands.

6. On the Font tab, right-justify the value.

7. Save and close the shared column. You will need to close the EmployeeInformation view first.

8. Verify that the format of the Salary column in the Employee Informationview uses the new format.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 271

Page 305: IBMN8D510

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 function-ality to a column. The status of IBM® Lotus® Sametime® Instant Messagingusers listed in that column is displayed. It is possible to initiate a chat withany user who is online.

Procedure Reference: Enabling a column for instant mes-sagingFollow these steps to add instant messaging to a column in a view.

1. Create a column. On the Advanced Format tab in the Column Proper-ties box, from the Style list, click the Names style.

2. Select the following options:

● Column contains a name

● Show online status

3. Enter a column formula that abbreviates to a name in the abbreviatedform of the full hierarchical name. This name is required as a look-upvalue to retrieve the instant message status for a user.

Note: To reduce the possibility of ambiguous names, you can create a columnthat displays a user’s short name and link that column to a hidden column(using the hidden column’s programmatic name) containing the abbreviatedhierarchical name.

DTopic D: Enable IBM® Lotus® Sametime® Instant Messaging in Views

Lesson 11 ■ Enhancing Views

272 © Copyright IBM Corporation 2007.

Page 306: IBMN8D510

Names and propertiesThe following figure shows the instant messaging-related column properties.

Figure 11-1: Column properties related to instant messaging

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 273

Page 307: IBMN8D510

Topic E: Create Views for the Web

View Display Considerations

The default appearance of a view is functional, but does not have the samegraphical appeal that is expected by Web users. Views should be explicitlydesigned with Web display in mind. The first step in improving the appear-ance 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 apage, 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 cancontrol the size and appearance of a view, especially on the Web. Embed-ding a view lets you combine views with other form and page elements(such as styled text) and graphics, including a background image file. Thegeneric navigation graphics and links do not appear so that you can replacethem with your own.

Procedure Reference: Embedding views in forms and pagesWhether 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 Create→Embedded Element→View.

ETopic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

274 © Copyright IBM Corporation 2007.

Page 308: IBMN8D510

2. Select a view from the list in the current application or from any otherapplication on the server.

Note: You can also choose the view at run-time via a formula.

Displaying an embedded view on a formThe following figure shows an embedded view on a form with companyidentification 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 view’s 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 anddisadvantages. The following table lists some of each.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 275

Page 309: IBMN8D510

Advantages Disadvantages

Select multiple items from the list. Slow to download.

Can scroll through large lists of items. May not execute identically on allbrowsers.

Data downloaded on demand. Firewall may prohibit applet download.

The following figure shows a view applet displayed in a Web browser.

Figure 11-3: A view applet displayed in a Web browser

Topic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

276 © Copyright IBM Corporation 2007.

Page 310: IBMN8D510

Procedure Reference: Displaying an embedded view as aview appletFollow the steps below to display an embedded view as a view applet.

1. Embed the view in a page or form.

2. Open the Embedded View Properties box and select the Info tab.

Result: The following graphic shows the Info tab in the EmbeddedView Properties box.

3. Select Using Java Applet in the Web Access Display field.

Displaying an Embedded View using HTML

Displaying an embedded view using HTML is more universal than the viewapplet because any Web browser can display it. It is not flexible in terms ofits capabilities, but it does offer some flexibility in appearance.

The following figure shows a view displayed using HTML.

Figure 11-4: A view displayed using HTML

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 277

Page 311: IBMN8D510

Embedded view propertiesThe following figure of the Embedded View Properties box shows the dis-play 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 ofthe other display options, such as Show selection margin, will show up inthe resulting HTML view.

Using View Properties to Control the Display ofEmbedded Views

You can determine how a browser displays a view using the View Proper-ties box. If the view is embedded in more than one form or view, you onlyneed to set the properties once, rather than setting them in form or pagewhere the view is embedded.

Topic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

278 © Copyright IBM Corporation 2007.

Page 312: IBMN8D510

The following figure 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 determineother view design effects. Some questions to consider when displayingviews in a Web browser are:

● Which column will be used as the link?

● Is there more data than will fit 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 isdisplayed in a Web browser, including action buttons and Click on columnheader to sort.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 279

Page 313: IBMN8D510

Link Columns

An important design aspect of a view is to select a link column. This is thecolumn of the view that behaves as a link when displayed in a Webbrowser. By default, the first column is the link column. The following figureshows the Show values in this column as links property.

Figure 11-7: The Show values in this column as links property

Topic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

280 © Copyright IBM Corporation 2007.

Page 314: IBMN8D510

Activity 11-4: Embed a View on a Form

ScenarioIn creating a data entry component for your application, you realize thatusers will need to look at other data while completing the entry of the datarequired by the component.

Follow these steps to customize the Employee Information view and embedit in a Lotus Domino form.

Step Action

1. In Lotus Domino Designer, open the Employee Information view in yourcopy of the Practice application.

2. Preview the view in your Web browser and note the difficulty in reading it.

3. Open the Employee Information form in the Lotus Domino Designer.

4. Click the table cell. Select Create→Embedded Element→View.

5. Select Employee Information from the Insert Embedded View dialog box.Click OK.

6. Double-click the embedded view, and then right-click and choose Embed-ded view to display the Properties box.

7. Display the embedded view Using HTML.

8. Set the view width to 5 inches, and the height to 3 inches.

9. Save your work and preview the form in your browser.

10. Close all open windows.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 281

Page 315: IBMN8D510

Lesson SummaryIn this lesson, you worked with hierarchical views, response data, sharedcolumns, and instant messaging features related to views. By addingincreased functionality in displaying data that might require instant communi-cation or the display of multiple levels of information, you can createcomponents that get the job done without bothering users who would other-wise have to use multiple areas of an application or interrupt their work tocommunicate with co-workers through other means.

Topic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

282 © Copyright IBM Corporation 2007.

Page 316: IBMN8D510

Lab 11-1: Display Response Data in Views

ScenarioNow that you have created Question and Answer forms for creating Q&Adocuments about Worldwide’s policies, you need to create a view thatshows the questions with their corresponding answers in a hierarchical view.

In the following activity, you will create a hierarchical view that displays thequestion and answer documents.

Note: Make sure you do this work in your copy of the Policies and Proce-dures application.

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

Perform the following tasks to complete this lab.

1. Create a view that displays the subject field of the question document,and the date the question was created.

2. Show the subject of the answer document, along with the date theanswer was created, in a single column.

3. Display the questions by category.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 11 ■ Enhancing Views

© Copyright IBM Corporation 2007. 283

Page 317: IBMN8D510

Lab 11-2: Enable a Column for InstantMessaging (Optional Lab)

ScenarioIn an effort to improve interoffice communications, the Worldwide Corpora-tion would like to have users’ on-line statuses displayed within the Policiesand Procedures application.

Note: The guided solution to this activity can be found in Appendix A, Solutions toPractice 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 “Who’s Online?” Place the new column to theright of the Question column, and make the width at least 18 characters.

2. Enter a formula that abbreviates the full hierarchical name of the contactperson into the column.

3. Set the column style to Names, and set the options for the column toshow online status.

4. Test your work in the Lotus Notes client.

Topic E: Create Views for the Web

Lesson 11 ■ Enhancing Views

284 © Copyright IBM Corporation 2007.

Page 318: IBMN8D510

Working with Actions

■ Topic A: Create Actions

■ Topic B: Create Shared Actions

■ Topic C: Control the Display of Actions

■ Topic D: Create Action Hotspots

12

© Copyright IBM Corporation 2007.

Page 319: IBMN8D510

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.

Lesson 12 ■ Working with Actions

286 © Copyright IBM Corporation 2007.

Page 320: IBMN8D510

Topic A: Create Actions

Actions

An action is a program associated with either a view or form and used toautomate 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.

You can use an action to:

● Re-create IBM® Lotus Notes® menu commands as buttons. Forexample:

■ Create a document

■ Edit a document

■ Save a document

● Mail the current document.

● Calculate complex formulas that do not need to be saved with individualdocuments.

Procedure Reference: Checklist: Designing ActionsBefore creating an action, you should consider the following checklist.

1. Define the purpose of the action.

2. Define the most appropriate programming language for the action.

3. Define where the action appears.

4. Define when the action appears.

5. Define the action’s formatting.

Programming Options Available in Actions

Like other design elements, you can program actions using one of the fol-lowing options:

● Simple actions

● Formulas

● IBM® LotusScript®

● JavaScript™

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 287

Page 321: IBMN8D510

Note: Simple actions cannot be customized and are not supported in Web applica-tions.

Action Display

Actions in a view are available to users when the view is opened. Actions ina form are available when a document created with the form is displayed, ora 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. Toexecute 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, ordelete the action.

The following figure shows the Action pane for a form.

Figure 12-1: A form’s Action pane

Topic A: Create Actions

Lesson 12 ■ Working with Actions

288 © Copyright IBM Corporation 2007.

Page 322: IBMN8D510

Action Properties

Like other IBM® Lotus® Domino Designer® features, actions are modifiedusing their properties box.

The following figure shows the Action Properties box.

Figure 12-2: The Action Properties box

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 289

Page 323: IBMN8D510

Activity 12-1: Create An Edit Action

ScenarioThe component you are working on will have a couple of modes: not onlywill it display the information you want users to see, it will also enable theusers to modify the information. You look for a way to enable the users tochange between the “see” and “modify” modes.

Follow these steps to create a button on the Employee Information formthat will allow users to edit documents.

Step Action

1. Open the Employee Information form in your copy of the Practice applica-tion in Lotus Domino Designer.

2. Choose Create→Action→Action from the menu.

3. In the Action Properties box, name the action Edit Employee Info

4. 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. Ensure that Client and Formula are selected in the Programmer’s pane.

7. In the Script area of the Programmer’s pane, type the formula:

@Command([EditDocument])

8. Save the form and test the action on an existing document.

Topic A: Create Actions

Lesson 12 ■ Working with Actions

290 © Copyright IBM Corporation 2007.

Page 324: IBMN8D510

System Actions

By default, new forms and views do not contain actions. Lotus DominoDesigner provides a set of predefined 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 modified and do not translate to Web applica-tions. You can create your own actions to perform the same functions usingthe Formula language instead.

Procedure Reference: Inserting system actionsFollow these steps to insert system actions into a form or view.

1. Open the form or view in Lotus Domino Designer.

2. Choose Create→Action→Insert System Actions.

Result: The system actions are added to the Action pane.

3. Save the form or view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 291

Page 325: IBMN8D510

@Commands

@Commands are special functions that simulate the functionality of LotusNotes menu commands. For example, use @command ([Compose]) tocreate a button that creates a new document based on a specific form.

The syntax for using @commands is: @Command([command];parameters);

Commonly used @commandsThe following table contains examples of commonly used @commands.

@Command Function Example

Compose Creates a new docu-ment with thespecified form.

@Command([Compose];"Response")

FileSave Saves the currentdocument.

@Command ([FileSave])

FileCloseWindow Closes the currentwindow.

@Command ([FileCloseWindow])

EditDocument Opens the currentlyselected documentfor editing.

@Command ([EditDocument])

Note: To Web-enable all action buttons in a application as well as certain@commands, select the application property Web access: Use JavaScriptwhen generating pages. Without this property set, Lotus Domino recog-nizes only the first button in a document and treats it by default as aSubmit button that closes and saves the document.

Topic A: Create Actions

Lesson 12 ■ Working with Actions

292 © Copyright IBM Corporation 2007.

Page 326: IBMN8D510

Order of Evaluation for @Commands

Lotus Domino evaluates formulas from top to bottom and left to right, com-pleting each statement before proceeding to the next. @commands areevaluated in one of two ways: as encountered or after all @functions. Inmost cases, the @command runs in the order specified in the formula.

For example, the following is an abbreviated list of @command functionsthat are evaluated as encountered or immediately.

Evaluated After All @Functions Evaluated Immediately

EditClear Clear

EditProfile EditProfileDocument

FileCloseWindow CloseWindow

FileExit ExitNotes

ViewChange SwitchView

Creating Instant Messaging Chat Action Buttons

Lotus Domino Designer includes @functions and @commands that develop-ers can use to integrate instant messaging into their Lotus Dominoapplications. The following table describes these instant messaging-related@functions and @commands.

@Function or @Command Description

@GetIMContactListGroupNames Returns the group names in theinstant messaging contact list.

@Command([AddToIMContactList]) Adds a name or names to a personalgroup in an instant messaging contactlist.

@Command([SendInstantMessage]) Initiates a chat with one or moreusers.

@Command([ShowHideIMContactList]) Toggles the on/off display of theinstant messaging contact list.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 293

Page 327: IBMN8D510

Topic B: Create Shared Actions

Shared Actions

Shared actions are actions that you create as resources for the entire appli-cation. Once you create a shared action, you can insert it in multiple viewsand forms. If you modify the action, the modification applies to every form orview that refers to it.

Procedure Reference: Creating a shared actionFollow these steps to create a shared action.

1. Open the application in Lotus Domino Designer.

2. In the Design pane, click Shared Code. Then, click Actions.

3. Click New Shared Action. The Shared Actions Properties box opens.

4. Create the shared action as you would any action.

5. Save the shared action.

BTopic B: Create Shared Actions

Lesson 12 ■ Working with Actions

294 © Copyright IBM Corporation 2007.

Page 328: IBMN8D510

Shared Action Properties

A shared action has the same properties as a standard action. You set theproperties when you create the shared action. These properties determinehow the action will behave in every form or view that uses it. The only prop-erty you can change on each form or view is the action’s position on theAction bar.

Procedure Reference: Inserting a shared action on a formor viewFollow these steps to insert a shared action on a form or view.

1. In Lotus Domino Designer, open the form or view where you want touse the shared action.

2. If you are designing a view, choose Create→Insert Shared Actionfrom the menu.

If you are designing a form, choose Create→Action→Insert SharedAction.

3. Select the shared action you want to insert. Click Insert.

4. Click Done.

Result: The shared action is inserted into the Action pane.

5. Preview the form or view, and test the action.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 295

Page 329: IBMN8D510

Topic C: Control the Display of Actions

Sub Actions

There are a couple of ways to enhance the display of actions. This sectionexamines how to:

● Create actions with sub actions.

● Customize the Action bar.

Sub actions group related actions under a single main menu choice or but-ton.

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 theuser to scroll horizontally.

Procedure Reference: Adding sub actions to a form or viewFollow these steps to add sub actions to a form or view.

1. Open the form or view you want to modify.

2. Choose Create→Action→Action with Sub Action.

Result: An untitled action is created as a placeholder for the new subaction. To name this action placeholder, open its Properties box.

3. Enter a name for the sub action.

4. Program the sub action.

5. Save and preview the form or view.

6. 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. Youcan rearrange this order in a more logical sequence.

CTopic C: Control the Display of Actions

Lesson 12 ■ Working with Actions

296 © Copyright IBM Corporation 2007.

Page 330: IBMN8D510

Procedure Reference: Rearranging action orderFollow these steps to rearrange the order of actions and sub actions.

1. Open the form or view with actions in Lotus Domino Designer.

2. Open the Action pane.

3. Click the action or action header.

4. Click and drag the action to a different position.

5. Save and preview the form or view.

Hiding Actions and Action Buttons

As with other form or view elements, you can conditionally restrict the avail-ability of an action using the action’s Hide/When properties. These are thesame Hide/When properties available to other design elements. Use theseproperties to make an action visible when it is relevant.

For example:

● Hide an action that edits a document when the document is in Editmode.

● Hide an action that saves a document when the document is in Readmode.

Note: Hide/When formulas execute when the document or view with which theaction is associated is refreshed.

Procedure Reference: Hiding action buttonsFollow these steps to hide an action or action button.

1. Open the form or view.

2. Select the action.

3. Choose Design→Action Properties.

4. Click the Action Hide When tab.

5. Select the appropriate options.

6. Save and preview the form or view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 297

Page 331: IBMN8D510

Action Buttons, Split Action Buttons, and Right-clickMenus

Within your applications, you can now specify split action buttons on theaction bar. This enables you to group related actions together in one place,under one action button. You can program your applications to use onemain action button that contains sub-actions. This is similar to a traditionaldrop-down menu, except the items are all related in some way to the mainaction button and are customizable.

The items on the right-click menu are now also customizable within the viewproperties. As you build your applications you can customize the options tobe suited for a specific 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

Topic C: Control the Display of Actions

Lesson 12 ■ Working with Actions

298 © Copyright IBM Corporation 2007.

Page 332: IBMN8D510

Action Bar

The Action bar displays action buttons at the top of a form or view. LotusDomino gives you the option of changing some of the Action bar’s proper-ties.

To alter the Action bar, you can:

● Change the Action bar’s 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 toset additional characteristics, such as font, color, and button size.

Procedure Reference: Changing Action Bar PropertiesFollow these steps to enhance the look of an Action bar.

1. Open the form or view in Lotus Domino Designer.

2. Select any action in the Action pane.

3. Choose Design→Action 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.

5. On the Action Bar Size tab:

● Select the button bar size.

6. On the Action Bar Background tab:

● Select the button bar background color.

● Select the button bar background image and how it is displayed.

7. On the Action Bar Border tab:

● Select the button bar border style and effect.

8. On the Button Properties tab:

● Select button size.

● Select button display options.

● Select button background color or image.

The changes affect all buttons on the Action bar.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 299

Page 333: IBMN8D510

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 Webaccess. 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, theaction selections appear as a second row of slightly smaller buttons.

Procedure Reference: Enabling the Action Bar appletFollow these steps to enable the Action bar as an applet.

1. Open the Action Bar Properties box.

2. In the Basics tab, select Using Java Applet under Web Access Dis-play.

3. Close the Action Bar Properties box.

Topic C: Control the Display of Actions

Lesson 12 ■ Working with Actions

300 © Copyright IBM Corporation 2007.

Page 334: IBMN8D510

Topic D: Create Action Hotspots

Hotspots

Action hotspots are programmable areas on a form, subform, or page thatcan complete an automated task.

Hotspots can be associated with:

● Text

● Graphics

Procedure Reference: Creating an action hotspotFollow these steps to create an action hotspot.

1. Open a form, subform, or page.

2. Click and drag to select the text or image to be associated with ahotspot.

3. Choose Create→Hotspot→Action Hotspot.

Result: An Action Hotspot Properties box appears.

4. In the Run area of the Programmer’s pane, select either Web or Cli-ent from the list.

5. Select a programming language from the code list.

6. Enter the code in the Programmer’s pane.

7. Save and preview the form, subform, or page.

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 301

Page 335: IBMN8D510

Lesson SummaryIn this lesson, you worked with actions. By learning what actions are andhow to use them, you can automate data entry and processing tasks thatwould be redundant and inefficient for users to have to undertake.

Topic D: Create Action Hotspots

Lesson 12 ■ Working with Actions

302 © Copyright IBM Corporation 2007.

Page 336: IBMN8D510

Lab 12-1: Create Instant Messaging ActionButtons in a View (Optional Lab)

ScenarioThe Worldwide Corporation would like to add buttons to the All Documentsview in the Policies and Procedures application to provide users with theability 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 toPractice Activities.

Perform the following tasks to complete this lab.

1. In the Q&A view of the Policies and Procedures application, create aninstant messaging chat action button called Chat.

Use the @command SendInstantMessage.

2. Create a second instant messaging chat action button called Show/HideContacts, using the @command ShowHideIMContactList.

3. In the Lotus Notes client, open the Q&A view, and confirm that the but-tons are present and functional.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 12 ■ Working with Actions

© Copyright IBM Corporation 2007. 303

Page 337: IBMN8D510

Lab 12-2: Add Automation to the Policiesand Procedures Application

ScenarioWorldwide Corporation would like to automate creating and editing docu-ments 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 orselected in the Q&A view.

● Save any of the documents by clicking a button instead of using menucommands.

Perform the following tasks to complete this lab.

Note: A guided solution to this activity can be found in Appendix A, Solutions toPractice 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 beused.

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 isin Edit mode, there is no reason for the Edit action to be available.

6. Close all open windows.

Topic D: Create Action Hotspots

Lesson 12 ■ Working with Actions

304 © Copyright IBM Corporation 2007.

Page 338: IBMN8D510

Working with Agents

■ Topic A: Investigate Agents

■ Topic B: Create Agents

13

© Copyright IBM Corporation 2007.

Page 339: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Identify the relationship between agents and the documents they canprocess.

● Generate agents.

Lesson 13 ■ Working with Agents

306 © Copyright IBM Corporation 2007.

Page 340: IBMN8D510

Topic A: Investigate Agents

Agents

Agents are programs within an IBM® Lotus® Domino® application that per-form a series of automated tasks. The benefits of using agents include:

● Agents can run manually by users or automatically in the backgroundas scheduled agents.

● Agents are not associated with a specific design element.

● Agents can be run on a specific server, on several servers, on worksta-tions, or on the Web.

● Agents can call other agents.

● Agents can consist of simple actions, formulas, IBM® LotusScript®, orJava™ 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 runon a schedule. You can use agents to run automated tasks for views, docu-ments, fields, and applications.

Actions versus agentsAgents 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 specific form or view. Use agents to setup user-activated tasks or background tasks in any part of a LotusDomino application.

Examples of agentsUse agents to:

● Update a group of documents.

● Archive documents.

● Send messages and documents.

● Run other agents.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 307

Page 341: IBMN8D510

Types of agentsThere are two types of agents:

● Shared agents are agents created by one user and can be run by otherusers or scheduled to run on the server.

● Private agents are agents that users create for themselves. Users can-not run another user’s private agent. Private agents are stored on themachine 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 alive application before it is distributed generally.

Parts of an agentThe following table describes the parts of an agent.

Part Function

Trigger Specifies when the agent program should run.

Target Selects documents the agent program acts upon.

Program Specifies the code to execute.

Topic A: Investigate Agents

Lesson 13 ■ Working with Agents

308 © Copyright IBM Corporation 2007.

Page 342: IBMN8D510

The Agent Work paneThe following figure shows the Agent Work pane and the Agent Propertiesbox.

Figure 13-1: The Agent Work pane and the Agent Properties box

Agent Properties

Use options in the Agent Properties box to define an agent to run:

● Manually or automatically.

● Against all documents or a subset of documents in a application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 309

Page 343: IBMN8D510

The Agent Properties boxThe following figure identifies 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, theBasics tab of the Agent Properties box has a few more options.

The following table lists these options and their functions.

Option Function

Store search insearch bar menu

Displays the search query in the search bar.

Store highlights indocument

Search matches are highlighted in the searched docu-ments.

Run in backgroundclient thread

Runs an agent in the background without having to waituntil it completes.Note that you should check this option only if the agent(or the top-level agent that calls this agent) is triggeredby “On event - Action menu selection.”To get the full benefit of this feature, the applicationshould reside on a server and the agent must beinvoked via the client.

Topic A: Investigate Agents

Lesson 13 ■ Working with Agents

310 © Copyright IBM Corporation 2007.

Page 344: IBMN8D510

Procedure Reference: Designing an agentBefore creating an agent, you should consider the following checklist.

1. Decide what the agent is to accomplish.

2. Decide when it should run.

3. Define what documents it should run against.

4. 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 tasksTwo common tasks in formula agents are to:

● Refine which documents the agent processes.

● Update fields in documents.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 311

Page 345: IBMN8D510

The SELECT Statement

Formula-based agents run iteratively on the target documents. The numberof documents that an agent processes directly affects the time it takes toexecute the agent’s formula. To limit the target documents, use the SELECTstatement.

The syntax for using SELECT is as follows:

SELECT logicalexpression

The following example selects only documents created using the EmployeeInformation 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 first 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 fields to existing documents or modify existing fields.To do this, use the keyword FIELD in a formula. FIELD is a reserved wordused to add a value to a new or existing field.

The syntax for using FIELD is as follows:

FIELD fieldname := value

The following example changes the LastName field value to Sunshine:

FIELD LastName := "Sunshine"

Note: If the LastName field does not exist in the document, it is created and giventhe value Sunshine. The field does not become visible unless you add it to the formdesign, but you can access it by naming it in formulas.

Topic A: Investigate Agents

Lesson 13 ■ Working with Agents

312 © Copyright IBM Corporation 2007.

Page 346: IBMN8D510

Agent Activation

Once you have decided what the agent will do, you need to determine howyou want it activated.

The following table describes design options for when the agent runs.

Agents Can Run Example

Manually By the user via the Actions menu in the LotusNotes client.

When triggered by anevent

If documents have been created or modified.

According to a schedule Every day at 1:00 AM.

Agent Events

The following table describes the events that can trigger an agent andexamples of when to use them.

Event When to Use It

Before new mail arrives Before mail is deposited in the mail application; forexample, to delete unwanted mail.

After new mail arrives Once new mail is delivered to the client; forexample, to forward mail while a user is on vaca-tion.

After documents are cre-ated or modified

To update new or existing documents; for example,to change an area code for phone numbers.

When documents arepasted

When copied documents are pasted into the appli-cation and need to be modified as they are beingpasted; for example, to add the current date to thedocument.

Action menu selection The agent is manually activated by the user or is aWeb Query Save or Web Query Open agent.

Agent list selection The agent is run only by another agent or is stillunder development and you need to hide it from theusers.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 313

Page 347: IBMN8D510

Event When to Use It

When server starts If you want an agent to be called when the serverstarts, but also at other times while the server isrunning, use the agent list selection trigger and cre-ate a separate agent triggered when the serverstarts that calls that agent.

Scheduled Events

The following table lists when agents can be scheduled to run.

Schedule Used for

More than once a day Critical tasks that are run frequently. Any agent,regardless of how frequently it is run, can severelyaffect a server’s performance.

Daily Important tasks that are not as high priority as criticaltasks; for example, sending a company-wide e-mail.

Weekly Routine tasks; for example, calculating a depart-ment’s sales performance.

Monthly Low-priority tasks; for example, deleting older docu-ments.

Never Agents that you do not want to run in particular cir-cumstances; for example, agents that run on theWeb or agents that are disabled or called by otheragents.

When server starts Regular administrative tasks, such as statistics gath-ering, that must occur when the server starts.

Note: In most circumstances, you should schedule the running of agents based onthe business need for having the work accomplished in a proper time frame.

Document Processing

Options for which documents the agent processes depend on when theagent runs.

Topic A: Investigate Agents

Lesson 13 ■ Working with Agents

314 © Copyright IBM Corporation 2007.

Page 348: IBMN8D510

The following table shows examples of which documents different agentscan process.

An Agent that Runs Can Process

Manually from theActions menu

● Documents that users select.

● All documents in a view.

● All documents in the application.

When triggered by anevent

● Only new and modified documents.

According to a sched-ule

● All documents in the application.

● New documents and documents modified since thelast run of the agent.

Note: SELECT statements in Formula language, as well as other statements inLotusScript and Java, can modify all documents in the application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 315

Page 349: IBMN8D510

Topic B: Create Agents

Agent Names

Agent names within the same application need to be unique. However, if thesame agent is used in several different applications, use the same agentname to help users recognize the agent’s 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 theActions menu. Use an alias (an internal name for an agent) when namingan agent. This allows you to change or translate the name that users seewithout disabling formulas that reference the original name.

Procedure Reference: Creating an agentCreate the agent after you have defined what your agent should do as wellas when and where it should run.

Follow these steps to create an agent.

1. Open the application in Lotus Domino Designer.

2. Select Agents under the Shared Code design element.

3. Click New Agent.

4. Name the agent and add a comment, if desired.

5. Select the agent option Shared or Private.

6. Select the agent trigger On Event or On Schedule.

7. Select the appropriate agent trigger option from the list.

8. Select the appropriate documents for the agent to target from the Tar-get option list.

9. Close the Agent Properties box.

10. Select the appropriate programming type from the list.

11. Enter the program’s code into the Programmer’s pane.

12. Save and test the agent.

BTopic B: Create Agents

Lesson 13 ■ Working with Agents

316 © Copyright IBM Corporation 2007.

Page 350: IBMN8D510

Lesson SummaryIn this lesson, you worked with agents. By learning what agents are andhow to use them, you can automate data entry and processing tasks thatwould be redundant and inefficient for users to have to undertake.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 13 ■ Working with Agents

© Copyright IBM Corporation 2007. 317

Page 351: IBMN8D510

Lab 13-1: Update Existing Documents

ScenarioSo far, you have either left the policy number blank on Policy documents, ormade one up. In this lab, you will write an agent that computes a policynumber for all existing policies. The policy number should be formatted as“PN999999” where the characters “PN” are the first two characters in thepolicy number, and “999999” is calculated based on the rightmost six char-acters of the document’s unique ID.

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

Perform the following tasks to complete this lab.

1. Write a formula that computes the policy number and saves the newpolicy number in the PolicyNo field.

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 anew Policy document is created.

5. Close all open windows.

Topic B: Create Agents

Lesson 13 ■ Working with Agents

318 © Copyright IBM Corporation 2007.

Page 352: IBMN8D510

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

14

© Copyright IBM Corporation 2007.

Page 353: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Describe user types.

● Use a formula to set the Hide/When property for a field.

● Create an Authors field.

● Identify access levels for high-security applications.

Lesson 14 ■ Securing Applications

320 © Copyright IBM Corporation 2007.

Page 354: IBMN8D510

Topic A: Explore Application Access

Application Security Overview

Until this point, the focus of your application design has been on building anapplication that meets the needs of the users. Now that the process is nearcompletion, application security becomes more critical. This includes secur-ing the application from unauthorized entry as well as restricting useraccess within the application. As you learned earlier in the course, the lay-ered security model of IBM® Lotus® Domino® provides many ways tocustomize security to the application and its content.

Non-physical access restriction begins at the network level. Once a userhas been authenticated at this level, the next restriction is at the serverlevel. Typically, network administrators and system administrators configureand maintain these two levels. Once a network and server admit a user, thatuser encounters access restrictions or controls at the database level. Typi-cally, Lotus Domino application managers configure and maintain this levelusing Access Control Lists (ACLs).

Access Control Lists

Every Lotus Domino application includes an Access Control List. Manageraccess is required to modify the ACL. Managers of a Lotus Domino applica-tions add users (individually or in groups) to the ACL and assign them acertain access level that entitles them to work within the application. Whenusers attempt to open an application, Lotus Domino refers to the AccessControl List to determine their privileges within the application.

The following figure shows the Access Control List dialog box.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 321

Page 355: IBMN8D510

Note: Physical security is also an important part of any security plan. You mustsecure access to the server, the devices that access the server, and any storagemedia that holds backed-up data.

Figure 14-1: The Access Control List dialog box

The Access Control List dialog boxThere are four panels in the Access Control List dialog box. The followingtable lists each panel and its function.

ThisPanel

Is Where the Domino Application Manager

Basics Assigns users, groups, and servers their levels of access.

Roles Creates user roles.

Log 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.

Advanced Performs advanced security tasks.

Topic A: Explore Application Access

Lesson 14 ■ Securing Applications

322 © Copyright IBM Corporation 2007.

Page 356: IBMN8D510

Access Control Levels

The following table lists each access control level and the privileges it givesto a user.

Access ControlLevel

Privileges

No Access No access to the application at all.

Depositor Depositors can create documents, but cannot read,edit, or delete documents, including those they create.

Reader Readers can read documents, but cannot create, edit,or delete documents.

Author Authors can create and read documents, but cannotedit documents unless specified in the document itself.

Editor Editors can create, read, and edit all documents unlessthere are restrictions on specific documents.

Designer Designers can perform the same functions as an Editor,except where restrictions exist on specific documents.Designers also can modify the application design, butcannot delete the application or change its ACL.

Manager Managers can perform all functions, including creatingand modifying the ACL and deleting the application.

User Identifiers

The Lotus Domino Directory is like a phone book of all the users and serv-ers in the Lotus Domino environment. System administrators set up usernames and groups of users that developers can use when defining accessto applications. The application manager adds individual user names, groupnames, and server names to the ACL of the application to control access tothe application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 323

Page 357: IBMN8D510

The Access Control List defines access rights for users in four ways. Thefollowing table describes the purpose of each option.

Option/ Description Defines Access for

Default Any user who is not specifically listed in the ACL (indi-vidually or in a group).

Groups A list of people who can all access the same function-ality in the application. If a user is a member of twogroups, and both groups appear in the ACL, the userreceives the higher access level.

Individual names A specific IBM® Lotus Notes® or Web user. This willoverride settings for any group to which the individualbelongs.

Anonymous Any unauthenticated Lotus Notes or Web user. If thereis no Anonymous entry in the Access Control List,unauthenticated users will use the Default access level.

User Access Levels

The following are some examples of setting user access levels.

In Order to Set

Prevent unknown users from access-ing the application

Default to No Access.

Grant anyone the ability to read docu-ments

Anonymous to the Reader access.

Allow all users in the Students groupto modify the application

Students to Designer access.

Preview your forms in a Web browser,as you are working on the applicationdesign

Anonymous to Reader access.

Displaying an Application’s Access Control List

Any user with access to a application is able to see its ACL.

Topic A: Explore Application Access

Lesson 14 ■ Securing Applications

324 © Copyright IBM Corporation 2007.

Page 358: IBMN8D510

Procedure Reference: Displaying an application’s ACLFollow these steps to display the ACL of a application

1. Select or open the application in either the IBM® Lotus Notes® client orIBM® Lotus® Domino Designer®.

2. Choose File→Application→Access 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 applicationmanagers can turn on or off, further refining users’ privileges. For example,you can control whether users with Editor access can delete documents.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 325

Page 359: IBMN8D510

The following table describes the default and optional access privileges andwhich levels they are associated with.

AccessLevel

Automatic Privileges Optional Privileges

No Access None Read public documentsWrite public documents

Depositor Create documents Read public documentsWrite public documents

Reader Read public documents Create private agentsCreate personal folders/viewsCreate LotusScript/JavaagentsWrite public documents

Author Read public documents Create documentsDelete documentsCreate private agentsCreate personal folders/viewsCreate LotusScript/JavaagentsWrite public documents

Editor Create documentsRead public documentsWrite public documents

Delete documentsCreate private agentsCreate personal folders/viewsCreate shared folders/viewsCreate LotusScript/Javaagents

Designer Create documentsCreate private agentsCreate personal folders/ viewsCreate shared folders/viewsRead public documentsWrite public documents

Delete documentsCreate LotusScript/Javaagents

Manager Create documentsCreate private agentsCreate personal folders/ viewsCreate shared folders/viewsCreate LotusScript/JavaagentsRead public documentsWrite public documents

Delete documents

Topic A: Explore Application Access

Lesson 14 ■ Securing Applications

326 © Copyright IBM Corporation 2007.

Page 360: IBMN8D510

Enable the read and write public documents options to give users with NoAccess or Depositor access limited access to specific forms, views, anddocuments.

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 applicationand notes that Terry Smith has Editor access.

● Chris Jones gets access to the server, creates a group called TerrySmith, and adds himself to the group. Chris Jones now has access tothe Policies and Procedures application as part of the group TerrySmith.

One way to prevent this is to designate Terry Smith as an individual with thePerson user type.

The following table lists each user type, to whom it can be assigned, andwhat it does.

User Type Assigned to Description

Person An individual user, includingindividuals on a server work-station.

Enforces access as a singleuser.

Server A single server, including aserver console and serverworkstation.

Prevents someone fromaccessing the applicationfrom a Lotus Domino work-station using the server ID.

Server Group A group of servers. Identifies a group of serversthat will host replicas of theapplication.

Person Group A group of individual users. Grants Person access toeach user in a group withoutlisting each user in the ACL.

Mixed Group A group of servers and indi-vidual users.

Grants the same access to agroup of users and servers.

Unspecified Any user, group, or server. Has Lotus Domino look upthe user type in the AddressBook.

The application manager applies user types to meet the access restrictions.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 327

Page 361: IBMN8D510

Topic B: Implement Roles

Roles

Roles provide a way to define a group within the application. Users andgroups are assigned roles to refine access to particular views, forms, docu-ments, or sections. Instead of assigning access to specific users andgroups, assign access to the role. Roles are functional after being:

● Defined in the ACL.

● Used in a design element.

Advantages of using rolesSome of the advantages of using roles are that they:

● Provide a flexible method of restricting access to a specific set of users.

● Can be used in formulas.

● Provide a method to define a set of users within an application.

● Do not need to be maintained or added as a group in the organization’sLotus Domino Directory.

● Make it unnecessary to modify the application when users leave or newusers join.

● Can be assigned to multiple groups and users in the ACL, which cansimplify application development and maintenance.

Defining Roles

Defining a role in the ACL is a two-step process:

1. Create the role in the ACL.

2. Assign roles to users or groups.

BTopic B: Implement Roles

Lesson 14 ■ Securing Applications

328 © Copyright IBM Corporation 2007.

Page 362: IBMN8D510

Procedure Reference: Creating a role in the Access ControlListFollow these steps to create a role in the ACL.

1. Choose File→Application→Access Control.

Result: The Access Control List box opens.

2. Click Roles in the Contents pane.

3. Click Add.

Result: The Add Roles dialog box appears

4. Enter a name for the role. The name may be up to 15 characters long.

5. Click OK.

Result: The Role name appears in brackets in the Roles list.

Procedure Reference: Assigning roles to usersOnce a role is created, assign it to the appropriate users or groups listed inthe ACL. Follow these steps to assign roles to users or groups.

1. Open the application in either the Lotus Notes client or Lotus DominoDesigner.

2. Choose File→Application→Access Control.

3. Highlight any entry in the Name list.

4. 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 themto determine what users can do or see in the application.

Access Control

Incorporate roles into formulas to control access to parts of the applicationand to define responsibilities within the application. By using the name ofthe role in a formula, rather than actual user names, you simplify the con-struction of the formula and make the application easier to maintain.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 329

Page 363: IBMN8D510

You can apply roles to further refine control within the application. Forexample, with roles, you can control who can:

● Access specific 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 spe-cific design element based on a role. This involves capturing the currentuser’s role and comparing it in a Hide When formula.

@Functions and Roles

Use the following functions to capture the current user’s role(s).

Function Returns

@UserRoles A text list of the roles for the current user.

@UserNamesList A text list including the current user name, any groups forthe current user, and any roles for current user.

@UserRoles A list of specific roles on all the desired applications regard-less of where the application is located.

Comparing the User’s Role

Once a user’s role is determined, it needs to be compared against a list.The formula’s course of action is based upon whether or not the rolematches an entry on the list.

Use the @IsMember function to determine if a user has a specific role. Thisfunction determines if a text string matches an item in a text list. The syntaxfor using @IsMember is:

@IsMember(textValue; textListValue);

Use the @IsNotMember function to determine if a text string does not matchan item in a list. The syntax for using @IsNotMember is:

Topic B: Implement Roles

Lesson 14 ■ Securing Applications

330 © Copyright IBM Corporation 2007.

Page 364: IBMN8D510

@IsNotMember(textValue; textListValue);

The following table provides some examples of using @IsMember and@IsNotMember.

Example Returns

@IsMember("[Student]";@UserRoles)

True, if the current user is assigned theStudent role

!@IsMember("[Student]";@UserNamesList)

True, if the current user is not assigned theStudent role

@IsNotMember("[Student]";@UserRoles)

True, if the current user is not assigned theStudent role

The following information is presented to support the previous table:

● All roles assigned through the application ACL begin and end withsquare brackets, as shown in the examples above.

● There is a system-assigned role, $$Web Client, that automaticallyappears whenever the user is connected to the application through aWeb browser. It does not contain the square brackets. It can be used toaffect screen presentation and logic in applications used with both theLotus Notes client and Web browsers.

● Roles do not function on a local replica of a application unless theadvanced ACL check box Enforce a consistent Access Control Listacross all replicas is selected.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 331

Page 365: IBMN8D510

Procedure Reference: Using a formula to set the Hide/WhenpropertyFollow these steps to hide a field with a formula.

1. Open the design element’s Properties box.

2. Click the Paragraph Hide/When tab.

3. Select Hide paragraph if formula is true.

4. Enter a formula that evaluates to True (1) or False (0).

Caution: Using Hide When to hide the contents of a field does not providetrue security. Users can still see the contents of the field by using the Docu-ment Properties box. Use encryption to secure the data in a field for LotusNotes clients.

Topic B: Implement Roles

Lesson 14 ■ Securing Applications

332 © Copyright IBM Corporation 2007.

Page 366: IBMN8D510

Topic C: Use Readers and AuthorsFields

Document Access

Individual documents sometimes contain sensitive information. Lotus Domi-no’s layered security model provides mechanisms to restrict access to adocument.

The following table lists what methods control who can create, read, andedit documents.

Access Controlled by

Read access to documents ● Read access lists

● Readers fields

Edit access to documents ● Authors fields

● Controlled Access sections

Create access ● Form property: Show in Createmenu

● Create access lists

● Action buttons

This section focuses on using Readers and Authors fields to control docu-ment access.

CFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 333

Page 367: IBMN8D510

Readers Fields

A Readers field restricts readership of a document to those users and serv-ers that are listed in the field. It is a special type of multiple-value text fielddesigned to interact with the Access Control List (ACL).

By specifically listing users, groups, and roles in a Readers field, you cancontrol who can read individual documents. This can be very useful in ascenario requiring an approval process. With a Readers field, you canrestrict access to any documents that are not approved; if the documentsare approved, the restrictions are unnecessary.

How Readers fields work with the ACLEntries in a Readers field cannot give a user more access than what isspecified in the ACL; they can only further restrict access. Users with NoAccess cannot gain access to a application even if their names are listed ina Readers field in a document in that application.

For example, users with Editor access or above in the ACL can be restrictedfrom reading documents that have a Readers field if their names are notincluded in that field.

The names in Readers fields must be the full Notes hierarchical names(example: Elizabeth Torrington/East/WWCorp) to prevent the possibility oftwo people with the same name (in different locations or containers) frombeing 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 boxEnforce a consistent Access Control List across all replicas is selected.

Viewing documents with Readers fieldsWhen Lotus Domino builds a view, it indexes all documents that meet theselection criteria, regardless of whether those documents contain a Readersfield. When that view is displayed:

● Documents that do not contain a Readers field are visible to all users.

● Documents with a Readers field are only visible to users listed in theReaders field. Other users do not see those documents.

● In a categorized view, categories that exist only in invisible documentswill not appear if the row check box Don’t show empty categories isselected. If the check box is not selected, the category will be dis-played, but the documents associated with it will not appear.

Thus, you may not need to alter the view to hide certain documents fromgeneral viewing.

Topic C: Use Readers and Authors Fields

Lesson 14 ■ Securing Applications

334 © Copyright IBM Corporation 2007.

Page 368: IBMN8D510

Specifying Readers

Entries in a Readers field must compute to a text value. Designers andmanagers specify readers in a Readers field by using one of the followingmethods:

● Write a formula to compute user names, roles, or groups. This is themost frequently used option, as it allows designers to predetermine thereaders. For example:

"[Policy Managers]" : "Suzy Sunshine" : "Managers"

● Make the field editable, so application Authors and Editors can selectand change readers.

Procedure Reference: Creating a Readers fieldFollow these steps to create a Readers field.

1. Open a form in Lotus Domino Designer.

2. Create a field, selecting Readers as the field data type.

3. Specify the readers.

Authors Fields

Users with Author access to a application may be able to create and readdocuments. By default, they cannot edit documents (not even the docu-ments they create themselves). For users with Author access to edit thedocuments they create, they must be listed in an Authors field in the docu-ment.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 335

Page 369: IBMN8D510

This section describes how to use an Authors field to define editing capa-bilities for users with Author access to the application.

An Authors field is a type of field that works in conjunction with the Authoraccess level in the application’s Access Control List. Authors fields do notoverride the settings in the Access Control List. They offer developers morecontrol 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 theAuthors field of a document. Similarly, users with a level of No Access can-not edit a document, even if their names are in the Authors field.

When to create an Authors fieldInclude an Authors field on the form to store the name of the user whenthe document is created. An Authors field can store one or more usernames or groups and can be editable or computed. Most Authors fieldsneed to permit multiple values.

Topic C: Use Readers and Authors Fields

Lesson 14 ■ Securing Applications

336 © Copyright IBM Corporation 2007.

Page 370: IBMN8D510

How Authors and Readers Fields Work Together

The following table is a representative sample of the possible permutationsof access control within an application.

ACL Level AuthorsField Existsand User Is

in It

ReadersField Existsand User Is

in It

Can ReadDocument

Can EditDocument

Author Yes No Yes Yes

Author No Yes Yes No

Author No No No No

Manager Yes No Yes Yes

Manager No Yes Yes Yes

Manager No No No No

Editor Yes No Yes Yes

Editor No Yes Yes Yes

Editor No No No No

Reader Yes No Yes No

Reader No Yes Yes No

Reader No No No No

As with Readers fields, you can compute the value of an Authors field, orallow the user to select Authors for the document.

Use the @UserName function to capture the name of the current LotusNotes user. You can use this function to dynamically compute the value ofan Authors field.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 337

Page 371: IBMN8D510

Procedure Reference: Creating an Authors fieldFollow these steps to create an Authors field.

1. Create a field on the form from which the documents will be created.

2. In the Field Properties box, on the Basics tab, select Authors as thefield type.

3. Select one of the following to determine when the field obtains its value:

● Editable allows those who create the document to designate whocan edit the document.

● Computed fills in the value based on a formula each time thedocument is refreshed.

● Computed when composed will evaluate only if the data does notalready exist. This value is computed only once.

● Computed for display. Because they do not store an item or avalue in a note, Computed for display is not appropriate for thistype of field.

4. Enter a formula to calculate the value of the field.

Note: Computed fields must have a formula. Editable fields can use aformula to calculate a default value that the user can change.

Topic C: Use Readers and Authors Fields

Lesson 14 ■ Securing Applications

338 © Copyright IBM Corporation 2007.

Page 372: IBMN8D510

Topic D: Control Access forAnonymous Users

Anonymous Users

Users who have Internet or intranet access to an application cannot beidentified by Lotus Notes in the way Lotus Notes users are identified. LotusDomino provides ways for you to determine the maximum Internet nameand password access level.

Procedure Reference: Setting up anonymous accessFollow these steps to allow anonymous users to access a application.

1. Open the application in Lotus Domino Designer.

2. Open the application’s Access Control List.

3. Add an entry for the group Anonymous.

4. 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 applica-tion.

Web User Access Level

-Default- Author

Anonymous Author

Supervisors Editor

Maximum Internet name and pass-word access

Editor

DFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 339

Page 373: IBMN8D510

High-Security Access Control Lists

The following table illustrates an ACL for a high-security confidential applica-tion.

Web User Access Level

-Default- No Access

Anonymous No Access

Authorized readers Reader

Contributors Author

Supervisors Editor

Maximum Internet name and pass-word access

Reader

Topic D: Control Access for Anonymous Users

Lesson 14 ■ Securing Applications

340 © Copyright IBM Corporation 2007.

Page 374: IBMN8D510

Lesson SummaryIn this lesson, you received an overview on application security. By becom-ing familiar with the different levels of security, how they interact with eachother, and how they together protect data integrity and privacy, you can cre-ate applications that are able to manage important information requiringprotection from unwanted users.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 341

Page 375: IBMN8D510

Lab 14-1: Set Access Restrictions to theApplication

ScenarioWorldwide Corporation’s Policies and Procedures application is almostready to be deployed. However, security levels have not been establishedfor all the different types of users. In this group activity, you will work withthe rest of the class to determine the access control levels required for theappropriate 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 access control level should beused.

2. For the Anonymous user type, the access control level shouldbe used.

3. For the Employees group, the access control level should beused.

4. For the Policy Makers group, the access control level should beused.

5. For the Department Head, the access control level should be used.

6. For the Managers group, the access control level should beused.

7. For the Designer, the access control level should be used.

8. Observe as your instructor modifies the ACL for the Policies and Pro-cedures application, and saves the file as PoliciesACL.nsf

Topic D: Control Access for Anonymous Users

Lesson 14 ■ Securing Applications

342 © Copyright IBM Corporation 2007.

Page 376: IBMN8D510

9. Make a new copy of the Policies and Procedures application in theFundamentals folder on the classroom server (Hub/SVR/WWCorp).Append your student## to the end of the application name and the filename. (Example: For student01, name the application Policies andProcedures 01, and the file Policies ABC.nsf. You will use thiscopy later in this lesson.

10. Set your access control level to Manager.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 343

Page 377: IBMN8D510

Lab 14-2: Create Roles

ScenarioIn this activity, you will create roles for the Policies and Procedures appli-cation and assign these roles to different users. For example, there arepolicy makers who should be able to view all documents and assign ques-tions to the appropriate experts.

Note: The guided solution to this activity can be found in Appendix A, Solutions toPractice 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 ##.

Topic D: Control Access for Anonymous Users

Lesson 14 ■ Securing Applications

344 © Copyright IBM Corporation 2007.

Page 378: IBMN8D510

Lab 14-3: Control Access to Documents inthe Policies and Procedures Application

ScenarioIn this lab, you will control access to documents in the Policies and Proce-dures 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 beassigned the PWriters role.

● Only people assigned the PWriters role should be able to create Policydocuments.

● 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 Prac-tice 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 madeand implement them.

2. Work with other students to help test that your application works asexpected.

3. Close all open windows.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 14 ■ Securing Applications

© Copyright IBM Corporation 2007. 345

Page 379: IBMN8D510
Page 380: IBMN8D510

Deploying Applications

■ Topic A: Deploy Applications15

© Copyright IBM Corporation 2007.

Page 381: IBMN8D510

Introduction

After completing this lesson, you should be able to:

● Describe replica creation.

Lesson 15 ■ Deploying Applications

348 © Copyright IBM Corporation 2007.

Page 382: IBMN8D510

Topic A: Deploy Applications

The Deployment Process

Before deployment begins, applications are tested during development inthe development environment and then previewed. However, production-level testing may also occur.

There are a number of ways to control application maintenance. The stan-dard recommended technique uses three templates:

● A production template, which contains the design of the productionapplication. You update the production application with the productiontemplate.

● A development template, which you use to perform updates and bugfixes. Once you finish testing the modifications, you replace the produc-tion template with the development template.

● A backup template, which is the previous version of the production tem-plate. You want this in case you need to roll back to the previousversion. Make a backup of the production template before you replace itwith the newer development template. Many sites store multiple ver-sions of the backup template.

A possible workflow that involves templates could look something like thefollowing:

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 checkthe Advanced Template checkbox as appropriate.

2. Copy via the O/S to the test environment.

● Resign the database template with a signing ID.

3. Create a new database from the new template (or replace the design totest an applcation upgrade).

● Create any categories needed to get started.

● Test until satisfied.

4. Copy the template to production and resign as needed.

● Create a new application or replace the design of the existingapplication, whichever is the more applicable.

AFundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 15 ■ Deploying Applications

© Copyright IBM Corporation 2007. 349

Page 383: IBMN8D510

Procedure Reference: Rolling out an applicationFollow these recommended steps to roll out a new application.

1. Create a template out of the new application.

2. Create a new application from the newly created template.

3. Modify the ACL of the new application so that it will be properly securedand replicate correctly.

4. Create a new replica of the application on the server.

Note: You might also need to disable any scheduled agents that can interferewith production or send mail erroneously.

Procedure Reference: Updating the design of an applicationFollow these recommended steps to update an application design.

1. Update the design of the template.

2. Refresh the design of the local application. Test.

3. Replicate with the server to replicate the design changes. Test.

Templates

A template is an IBM® Lotus® Domino® file that contains the design struc-ture for a Lotus Domino application. File extensions differ for applicationsand templates. The file extension for a Lotus Domino application is .NSF.The file extension for a Lotus Domino template is .NTF.

When you use a template to create a application, like you did earlier in thecourse, the application receives the design elements from the template.

IBM® Lotus Notes® and Lotus Domino ship with several standard applicationtemplates. While some are included to provide the design for necessarysystem applications (log.ntf, catalog.ntf, and so on), others embody thedesign of valuable business applications. You can create an application froma 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

Topic A: Deploy Applications

Lesson 15 ■ Deploying Applications

350 © Copyright IBM Corporation 2007.

Page 384: IBMN8D510

Master Templates

Design templates let you isolate the design and development of an applica-tion from the production environment. By managing application designmodifications using a master design template, you avoid disruption to anapplication that has been deployed.

Procedure Reference: Creating a master design templateFollow these steps to create the master design template:

1. Extract the design elements of your application to a new application.

2. Designate the new application as a template.

3. Once the template is created, link your application to the applicationtemplate.

Procedure Reference: Extracting the design from the appli-cationFollow these steps to extract the design elements to another application,which will become the master design template.

1. Select the application in either Lotus Notes or IBM® Lotus® DominoDesigner®.

2. Choose File→Application→New Copy.

3. Select the location to store the new application.

4. Enter a title.

5. Enter a file name with the NTF extension.

Note: The NTF file extension does not make the file a template. It sim-ply causes it to appear as a choice in the list of templates when youcreate a new application.

6. Click Specify What to Copy: Database design only.

7. If necessary, uncheck Access Control List. If you do not copy theACL, any Roles that the application might depend on will be lost.

Procedure Reference: Turning a application into a templateFollow these steps to turn a application into a template.

1. Select or open the application.

2. Open the Properties box.

3. Click the Design tab.

4. Click the check box to enable the Database file is a master templateproperty.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 15 ■ Deploying Applications

© Copyright IBM Corporation 2007. 351

Page 385: IBMN8D510

5. Enter a name for the template.

This name is different from the name or title of a application. The tem-plate name is the link between the template and the application orapplications, and it is a property of the template file.

Procedure Reference: Linking the application to the masterdesign templateOnce you create the master design template, follow these steps to link it toyour application.

1. Select or open the application.

2. Open the Database Properties box.

3. Click the Design tab.

4. Click to place a check mark next to Inherit design from master tem-plate.

5. Enter the name of the template.

Replication Control

You were introduced to the replication process and its effects on applica-tions earlier in the course. This section describes the following three ways ofcontrolling the data that replicates:

● Controlling server access to the application

● Readers of a document

● Replication settings of the application

Topic A: Deploy Applications

Lesson 15 ■ Deploying Applications

352 © Copyright IBM Corporation 2007.

Page 386: IBMN8D510

Controlling server access to the applicationThe data that replicates is dependent on the rights of who is doing the repli-cating, not which server holds the application.

The following table describes the effects of ACL settings on replication.

Server Access Level inthe Replica application

ACL

Effect on Replication

No Access No replication occurs.

Depositor No documents flow with depositor access. The servercannot send new documents because it cannot seewhich documents are new.

Reader Server can receive changes, but cannot sendchanges.

Author Server can send the following changes:

● New documents created since last replication.

● Modifications to documents that list the replicatingserver (or user) in an Authors item. If the server isreplicating changes, and it has Author access tothe replica application, the server must be listed inthe Authors item for replication to occur.

Editor Server can send all new documents and changes toexisting documents.

Designer Server can send all new and modified documents anddesign elements.

Manager Server can send all new and modified documents,design elements, and the ACL.

Readers and replicationDocuments that contain Readers items must list the replicating server aswell 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, thedocument will not replicate.

Replication Settings

Replication settings allow a further refinement of which documents are goingto replicate between any two servers, and between client and server. Thefollowing table describes these settings.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 15 ■ Deploying Applications

© Copyright IBM Corporation 2007. 353

Page 387: IBMN8D510

Group Settings

Space Savers ● Remove documents not modified in the last n days

● Include specific Address Book fields

● 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 toother replicas

● Do not send changes in local security property to other rep-licas

Other ● Temporarily disable replication

● Scheduled replication priority

● Only replicate incoming documents saved or modified aftera particular date or a CD-ROM publishing date

Advanced ● Replicate a subset of Documents between specified serversor specified client and server

● Replicate specific types of design elements

Procedure Reference: Creating replicas manuallyFollow these steps to create a replica manually.

1. Open the application.

2. Choose File→Replication→New Replica.

3. Select the destination server (server on which to place the replica).

4. Keep the default file name and title for the new replica.

5. Select Create: Immediately.

6. Select Copy Access Control List to copy the ACL from the original tothe new replica. Click OK.

Topic A: Deploy Applications

Lesson 15 ■ Deploying Applications

354 © Copyright IBM Corporation 2007.

Page 388: IBMN8D510

Lesson SummaryIn this lesson, you received an overview on how to deploy an application.By becoming familiar with how applications are deployed to users, you canavoid costly mistakes and lost labor that might otherwise occur when appli-cation components that have not been adequately tested improperly storeand manage data.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 15 ■ Deploying Applications

© Copyright IBM Corporation 2007. 355

Page 389: IBMN8D510

Lab 15-1: Create a Design Template and aNew Application

ScenarioNow that the Worldwide Policies and Procedures application has beendesigned, developed, and tested, it is time to make a design template fromthe application and prepare to deploy the application.

Note: The guided solution for this lab can be found in Appendix A, Solutions toPractice 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 ABCTemplate, 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 changesfrom the template.

Topic A: Deploy Applications

Lesson 15 ■ Deploying Applications

356 © Copyright IBM Corporation 2007.

Page 390: IBMN8D510

Lab 15-2: Roll out the Policies andProcedures Application

ScenarioIn this lab, you will make modifications to the Policies and Proceduresapplication that will allow for proper replication of the application. You willalso test the application.

Note: The guided solution for this lab can be found in Appendix A, Solutions toPractice Activities.

Perform the following tasks to complete this lab.

1. Modify the ACL of your Policies and Procedures application so that alldocuments and design changes will replicate.

2. Create a new replica of your Policies and Procedures applicationlocally. Be sure to embed your initials in the file 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 modifythe 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 toserver in order to see that the design change replicates.

7. Close all open windows.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Lesson 15 ■ Deploying Applications

© Copyright IBM Corporation 2007. 357

Page 391: IBMN8D510

Follow-upIn this course, you were introduced to the fundamental concepts needed toperform basic application development in IBM® Lotus® Domino® 8. In addi-tion, that knowledge has prepared you to obtain the additional knowledgeneeded for building more complex applications in Lotus Domino 8.

What’s Next?This course is the first in a series of application development courses. Thematerial in Building Applications for the Web using IBM® Lotus® DominoDesigner® 8 provides the knowledge needed to develop Web applications inLotus Domino Designer 8.

Topic A: Deploy Applications

Lesson Follow-up ■

358

Page 392: IBMN8D510

Solutions to PracticeActivities

AAppendix

© Copyright IBM Corporation 2007

Page 393: IBMN8D510

About This AppendixThe appendix provides detailed, step-by-step solutions to the hands-on por-tions of the lesson labs for this course.

For solutions to activities included elsewhere in the course content, pleasesee the Solutions section of the student guide.

Lesson Lab Solutions

The lesson lab solutions appear in the order in which the material is pre-sented in the course content.

Appendix

Appendix A ■ Solutions to Practice Activities

360 © Copyright IBM Corporation 2007

Page 394: IBMN8D510

Activity A-1: Solution for Lesson Lab 4-1:Create a Page

ScenarioWorldwide Corporation is in the process of creating organizational policies.They need a Policies and Procedures application to create and store policydocuments for their employees. This application also needs a page thatgives 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 Action

Build a new application.

1. Open Lotus Domino Designer.

2. Choose File→Application→New.

Result: The New Database dialog box appears.

3. Accept the default of Local to create the application on the local computer.

4. Type the title Policies and Procedures for the application.

Result: Policies and Procedures appears in the Title box.

5. Type the file name Policies_##.nsf where ## is your student number.

Result: The renamed application name appears in the file Name box.

6. Select -Blank- from the template list.

7. Click OK.

Result: The new application is created.

Create shared images.

8. Click Shared Resources in the Design list.

9. 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 361

Page 395: IBMN8D510

Step Action

11. In the Open dialog box, browse for and select the following image files andclick Open.

● LOGO WW1.gif

● bluerule.gif

Result: The images are added to the shared resources list.

Create an Information page.

12. Click Pages in the Design list.

13. Click New Page.

Result: A new, blank page opens in the Work pane.

14. Choose Design→Page Properties.

Result: The Page Properties box opens.

15. Name the page Information and close the Page Properties box.

16. Save the Information page.

Modify the Information page

17. With the cursor in the Information page, choose Create→Table.

Result: The Create Table box opens.

18. Create a fixed 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 Create→Image Resource.

Result: The Image Resource dialog box opens.

20. Select the LOGO WW1.gif file and click OK.

Result: The Worldwide logo is added to the first cell.

21. Click in the bottom cell and type the following;

123 Worldwide Blvd.Metropolis, PA 45555

Result: Worldwide’s address appears below the company logo.

22. Click below the table. Choose Create→Image Resource.

Result: The Image Resource box opens.

23. Select bluerule.gif. Click OK.

Result: The bluerule.gif image is added below the table.

Appendix

Appendix A ■ Solutions to Practice Activities

362 © Copyright IBM Corporation 2007

Page 396: IBMN8D510

Step Action

24. Click below the bluerule.gif image. Type the following text:

About us:Worldwide is an international pottery manufacturer. Thecompany sells ceramics worldwide. Products include tiles,china, and various kinds of pottery. The corporate officehouses manufacturing, research and development, productmanagement, quality control, human resources, and systemadministration. There are several smaller sales offices andresellers throughout each region, and some salesrepresentatives who work from their homes.

Result: The text is added to the page.

25. Save and preview the page.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 363

Page 397: IBMN8D510

Activity A-2: Solution to Lesson Lab 5-1:Create a Form that Contains a Table andFields

ScenarioWorldwide Corporation is in the process of creating organizational policies.You have already created your copy of the Policies and Procedures applica-tion and Information page. In this lab, you will create the form that will beused to enter the company’s 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 fields.

Step Action

Create a new form.

1. Open your copy of the Policies and Procedures application in LotusDomino Designer.

2. In the Design pane, click Forms.

Result: In the Work pane, the list of existing forms appears. The NewForm button appears on the button bar.

3. In the Work pane, click New Form.

4. Choose Design→Form Properties. The Form Properties box opens.

5. Type Policy in the Name field.

Result: Policy appears in the Name box.

6. Close the Form Properties box.

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 flashes to indicate its position.

9. Click and drag to highlight the text. Choose Text→Text Properties.

Result: The Text Properties box opens.

10. Change the font style and size. For example, Arial Black, 14 pts. NavyBlue.

Result: The title text reflects the changes.

Appendix

Appendix A ■ Solutions to Practice Activities

364 © Copyright IBM Corporation 2007

Page 398: IBMN8D510

Step Action

11. Close the Text Properties box.

12. Click below the title text to position the cursor where you would like thetable to appear.

13. Choose Create→Table.

Result: The Create Table box opens.

14. Create a Basic table with the following options:

● 5 rows

● 2 columns

● Fixed Width

Click OK.

Result: The table appears on the form

15. Type the following field labels in the cells of the first column:

● Policy Number:

● Policy Title:

● Effective Date of the Policy:

● Policy Description:

● Category:

Result: The field labels appear in each cell in the first column.

16. Click in the cell to the right of the first field label, Policy Number.

17. Choose Create→Field to create a field with the following characteristics:

● Field name: PolicyNo

● Field type: Text, Editable

Result: The PolicyNo field is created in the first cell of the right column.

18. Click in the cell to the right of the Policy Title field label. Create a field withthe following characteristics:

● Field name: PolicyTitle

● Field type: Text, Editable

Result: The PolicyTitle field is created in the right column.

19. Click in the cell to the right of the Effective Date of the Policy field label.Create a field with the following characteristics:

● Field name: EffectiveDate

● Field type: Date/Time, Editable

Result: The EffectiveDate field is created in the right column.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 365

Page 399: IBMN8D510

Step Action

20. Click in the cell to the right of the Policy Description field label. Create afield with the following characteristics:

● Field name: PDescription

● Field type: Rich Text, Editable

Result: The PDescription field is created in the right column.

21. Click in the cell to the right of the Category field label. Create a field withthe following characteristics:

● Field name: Category

● Field type: Dialog List, Editable

Result: The Category field is created in the right column.

22. On the line below the new Category field, in the same cell create a fieldwith the following characteristics:

● Field name: DCategory

● Field type: Text, Computed for display

Result: The DCategory field is created in the right column.

23. Select the Category field and click the Control tab. Enter the following inthe Choices box:

● Office Guidelines

● Benefits

● Holidays

● Grievance Procedures

Result: The category choices are created.

24. Select the Category field. Click the Paragraph Hide/When tab and selectto Hide paragraph when document is:

● Previewed for reading

● Opened for reading

● Printed

Result: The Category field will not be seen when the document is inRead mode.

25. Select the DCategory field. Click the Paragraph Hide/When tab and selectto Hide paragraph when document is:

● Previewed for editing

● Opened for editing

Result: The Display Category field will not display when the document isbeing edited.

26. Close the Field Properties box.

Appendix

Appendix A ■ Solutions to Practice Activities

366 © Copyright IBM Corporation 2007

Page 400: IBMN8D510

Step Action

27. Type the following formula in the Programmer’s pane of the DCategoryfield: Category

Result: The option selected in the Category field will display in theDCategory field when the document is in Read mode.

28. Save and test the form in the Lotus Notes client.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 367

Page 401: IBMN8D510

Activity A-3: Solution to Lesson Lab 6-1:Create a Categorized View

ScenarioWorldwide Corporation wants to provide a new way of organizing its policiesand procedures in the Policies and Procedures application. The view shoulddo 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).

To complete this lab:

● Create a categorized view.

● Create a categorized column.

Follow these steps to create a categorized view.

Step Action

Create a categorized view

1. Open your copy of the Policies and Procedures application in LotusDomino 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 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 Programmer’s 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 applicationappears.

8. Select the Policy form. Click Add.

Result: The Policy form appears in the Programmer’s pane.

Appendix

Appendix A ■ Solutions to Practice Activities

368 © Copyright IBM Corporation 2007

Page 402: IBMN8D510

Step Action

9. Double-click the first view column to open the Column Properties box. Setthe following options on the Column Info tab:

● Title: Policy

● Width: 25

10. In the Programmer’s pane, select Field. Select the PolicyTitle field.

Result: The first column displays the policy titles.

11. Choose Create→Append New Column to add a column to the right withthe 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 ofthe 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 Create→Insert New Column to add a column to the left with thefollowing 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. Click the Font tab and select Blue (0,0,255) for the text color.

17. Click the Sorting tab and select the following options:

● Sort: Ascending

● Type: Categorized

18. In the Programmer’s pane, select Field. Select the Category field.

Result: The document categories are listed in the Work pane.

19. Save and refresh the view.

20. Create a few more documents for this view by choosing Create→Document→Policy.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 369

Page 403: IBMN8D510

Activity A-4: Solution to Lesson Lab 8-1:Create a Dynamic Title

ScenarioWorldwide Corporation would like to customize the titles displayed to userswhen they open certain documents in the Policies and Procedures applica-tion.

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 Programmer’s 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 field.

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 policy’s name is displayed in the title.

Appendix

Appendix A ■ Solutions to Practice Activities

370 © Copyright IBM Corporation 2007

Page 404: IBMN8D510

Activity A-5: Solution to Lesson Lab 8-2:Automate Data Entry and Formatting

ScenarioYou need to automate data entry and formatting in the Policy form. The fol-lowing list details the functionality that Worldwide would like to incorporateinto the application:

● The policy title should be formatted using title case.

● Create a field to capture the date the policy is created. This date shouldbe displayed without the time element. Name it PolicyCreatedDate.

● The effective date should calculate to one month from the date thepolicy is created in order to account for an internal review process. Thisdate should also be displayed without the time.

● When a policy is created, the document should not be saved unless itcontains a title and category.

To complete this lab:

● Make sure PolicyTitle is entered in proper case

● Have Lotus Domino automatically enter the document’s entry date anddisplay the date only

● Calculate the EffectiveDate of the policy based on thePolicyCreatedDate

● Verify that certain fields contain a value before allowing a document tobe saved

Follow these steps to automate data entry and formatting.

Step Action

Make sure PolicyTitle is entered in proper case

1. Open the Policy form in Lotus Domino Designer.

2. Click the PolicyTitle field.

Result: The PolicyTitle field and its objects appear in the Objects list.

3. In the Script area, type the following formula in the Input Translationobject for the field: @ProperCase(PolicyTitle)

Result: The formula appears in the Script area.

4. Save and test the form.

Have Lotus Domino automatically enter the document’s entry date and dis-play the date only

5. Place the cursor in the third row of the table on the Policy form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 371

Page 405: IBMN8D510

Step Action

6. Choose Table→Insert Row.

Result: A blank row is inserted above the Effective Date row.

7. In the left cell, type the field label: Created Date:

Result: The text appears in the left cell.

8. Move the cursor into the right cell. Choose Create→Field.

Result: The Create Field box opens.

9. Name the field PolicyCreatedDate with the following options:

● Field type: Date/Time, Computed when composed

Result: The PolicyCreatedDate field is added to the right cell.

10. Select the Value object for the PolicyCreatedDate field.

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 Dis-play Time is not selected. In the Show list, verify that Only month, dayand 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. Open the Policy form in Lotus Domino Designer.

15. Click the EffectiveDate field.

Result: The EffectiveDate field and its objects appear in the Objects list.

16. Open the Field Properties box. Change the field from Editable to Com-puted.

Result: The field type is changed to indicate that the field is going to becomputed.

17. In the Script area, enter the following formula in the Value object for thefield: @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 fields contain a value before allowing a document to besaved

Appendix

Appendix A ■ Solutions to Practice Activities

372 © Copyright IBM Corporation 2007

Page 406: IBMN8D510

Step Action

19. In Lotus Domino Designer, click the PolicyTitle field.

Result: The PolicyTitle field and its objects appear in the Objects list.

20. In the Script area, type the following formula in the Input Validation objectof the field:

@If (PolicyTitle =NULL; @Failure("Pleaseenter a Policy Title.");@Success)

Result: The formula appears in the Script area.

21. Implement input validation for the Category field. Use the following formula:

@If (Category =NULL; @Failure("Please selecta Category.");@Success)

Result: The formula appears in the Script area.

22. Save and preview the form to test the formulas.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 373

Page 407: IBMN8D510

Activity A-6: Solution to Lesson Lab 8-3:Compute a List of Choices for a Field

ScenarioTo make the Policies and Procedures application easier to maintain overtime, create a view that contains the policy categories in the first column.When a policy is created or edited, the categories should be displayed fromthe Categories view. In order to accomplish this::

● Create a Category form with a field named Category.

● Create Category documents with the following categories:

■ Office Guidelines

■ Benefits

■ Holidays

■ Grievance Procedures

■ Security

■ E-mail Etiquette

■ Diversity

● Create a view called Categories that only displays the Categorydocuments.

● Modify the Policy form to perform a lookup to the Categories view toproduce the list of the Category field.

Hint: The view should only display documents with the Category form.

Follow these steps to compute a list of choices for a field.

Step Action

Create a Category form

1. Open your copy of the Policies and Procedures application in LotusDomino Designer.

2. In the Design pane, click Forms.

Result: In the Work pane, the list of existing forms appears. The NewForm button appears on the button bar.

3. In the Work pane, click New Form.

4. Choose Design→Form Properties.

Result: The Form Properties box opens.

Appendix

Appendix A ■ Solutions to Practice Activities

374 © Copyright IBM Corporation 2007

Page 408: IBMN8D510

Step Action

5. Type Category in the Name field.

Result: Category appears in the Name field. Note: It is a good idea to givethe form an alias.

6. Close the Form Properties box.

7. Enter the field label Category at the top of the page.

8. Choose Create→Field to create a field with the following characteristics:

● Field name: Category

● Field type: Text, Editable

Result: A field named Category is created.

9. Save the form and test in the Lotus Notes client.

Create documents using the Category form.

10. Open the Lotus Notes client.

11. Choose File→Open→Lotus Notes Application. Browse for and open yourcopy of the Policies and Procedures application.

Result: The application opens.

12. Choose Create→Category to create a document using the Category form.

Result: The Category form opens.

13. Type Office Guidelines in the Category field. Save and close thedocument.

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 LotusDomino Designer.

Result: The application opens in the Work pane.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 375

Page 409: IBMN8D510

Step Action

16. In the Design pane, click Views.

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 Programmer’s 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 applicationappears.

23. Select the Category form. Click Add.

Result: Uses ‘Category’ form appears in the Programmer’s pane.

24. Double-click the first 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 25characters wide.

25. In the Programmer’s pane, select Field. Select Category from the list offields in the application.

Result: The Category column displays the content of the Category field.

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 field and open the Field Properties box.

29. Result: The Field Properties box opens.

Appendix

Appendix A ■ Solutions to Practice Activities

376 © Copyright IBM Corporation 2007

Page 410: IBMN8D510

Step Action

30. Click the Control tab.

31. In the Choices list, select Use formula for choices.

32. In the Choices text box, delete the existing choices and type the followingformula 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 377

Page 411: IBMN8D510

Activity A-7: Solution to Lesson Lab 8-4:Create Reusable Code

ScenarioTo ensure that certain fields are populated on the Policy form in your copyof the Policies and Procedures application, create reusable code thatchecks to see if a value is entered in the Policy Number and Policy Titlefield.

Follow these steps to create reusable code.

Step Action

Create reusable code

1. In your copy of the Policies and Procedures application, open the Policyform in Lotus Domino Designer.

Result: The Policy form opens in the Work pane.

2. Select the PolicyNo field. In the Programmer’s pane, on the Object tab,select Input Validation.

3. In the Programmer’s pane, enter the following formula:

@If(@ThisValue="";@Failure("Please enter a "+@ReplaceSubstring(@ThisName;"Policy";"Policy ")+".");@Success)

Result: The formula returns the message, Please enter a Policy No. if the field is left empty.

4. Reuse this formula by copying it and pasting it as an Input Validation for-mula for the PolicyTitle field.

Result: The formula returns the message, Please enter yourPolicy Title if the field is left empty.

5. Save and preview the form in Lotus Notes.

Appendix

Appendix A ■ Solutions to Practice Activities

378 © Copyright IBM Corporation 2007

Page 412: IBMN8D510

Activity A-8: Solution to Lesson Lab 8-5:Implement Error Interception

ScenarioThe Worldwide Corporation frequently updates their company policies andwould like to allow for internal review of any modifications. Revise the Poli-cies and Procedures application to allow for a one month review periodbefore the policy is implemented, and to intercept run-time errors beforethey need to be handled.

Follow these steps to implement error interception.

Step Action

Implement error interception

1. In your copy of the Policies and Procedures application, open the Policyform in Lotus Domino Designer.

2. Insert another row in the table between Created Date and Effective Dateof Policy.

3. Label the new row Modifications to the Policy.

4. Create a Computed Date/Time field called L_ModifiedDates.

5. Specify the following items:

● Allow multiple values

● Display date only

● Advanced: Display separate values with new line

● Hide paragraph if L_ModifiedDates=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 field, but in the same table cell, type the follow-ing text: N/A and hide it when L_ModifiedDates!=NULL.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 379

Page 413: IBMN8D510

Step Action

7. Revise the formula for the Effective Date field 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.

Appendix

Appendix A ■ Solutions to Practice Activities

380 © Copyright IBM Corporation 2007

Page 414: IBMN8D510

Activity A-9: Solution to Lesson Lab 10-1:Create Question and Answer Forms in thePolicies and Procedures Application

ScenarioThe Worldwide Corporation wants to make it easier for employees to askquestions and receive answers about company policies. In this activity, youwill create Question and Answer forms. The Answer form needs to inheritinformation 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 file to enhance the lookof 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.

To complete this lab:

● Create the header subform.

● Create a shared image. Use a layer and the mod_menu_background.giffile to enhance the look of the forms.

● Design and create the Question form.

● Design and create the Answer form.

Follow these steps to create Question and Answer forms.

Step Action

Create the header subform

1. Open your copy of the Policies and Procedures application in LotusDomino Designer.

2. In the Design pane, select Shared Code→Subforms.

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 Create→Table.

Result: The Create Table box opens.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 381

Page 415: IBMN8D510

Step Action

5. 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 Propertiesbox, set all borders to 0.

7. Click in the left cell, and choose Create→Image Resource.

Result: The Insert Image Resource box opens.

8. Select the LOGO WW1.gif file and click OK.

Result: The Worldwide logo is added to the first cell.

9. Click in the right cell and enter the following text:

123 Worldwide Blvd.Metropolis, PA 45555

Result: Worldwide’s address appears to the right of the company logo.

10. Click below the table and choose Create→Image 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 availablesubform in the subforms list.

Create a shared image

12. Click Shared Resources in the Design list.

13. 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 followingimage file:

● 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 Formbutton appears on the button bar.

Appendix

Appendix A ■ Solutions to Practice Activities

382 © Copyright IBM Corporation 2007

Page 416: IBMN8D510

Step Action

17. In the Work pane, click New Form.

18. Choose Design→Form Properties.

Result: The Form Properties box opens.

19. Type Question in the Name field.

Result: Question appears in the Name box.

20. Close the Form Properties box.

21. Choose Create→Resource→Insert 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 fixed 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 Propertiesbox, set all borders to 0. Close the Table Properties box.

28. Select the left column, and right-justify the text.

29. In the first row, add the following field label into the left cell and field into theright cell:

● Field label: First Name:

● Field name: FName

● Field type: Text, Editable

Result: The first row is populated with a field label and field.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 383

Page 417: IBMN8D510

Step Action

30. In the second row, add the following field label into the left cell and field intothe right cell:

● Field label: Last Name:

● Field name: LName

● Field type: Text, Editable

Result: The second row is populated with a field label and field.

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 field label and field.

32. In the Programmer’s 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 field label.

34. In the right cell, create the following field:

● 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 field label and field.

Appendix

Appendix A ■ Solutions to Practice Activities

384 © Copyright IBM Corporation 2007

Page 418: IBMN8D510

Step Action

37. 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 field label and field.

38. Click outside the table. Choose Create→Layer.

Result: A blank layer is inserted on the form.

39. Choose Layer→Layer 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 themod_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. Positionit behind the table of field labels and fields.

Result: The layer serves as a background to the table.

43. Click the Window Title object in the Programmer’s pane, and type the fol-lowing 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 Questionform

45. Open your copy of the Policies and Procedures application in LotusDomino Designer.

46. In the Design pane, click Forms.

Result: In the Work pane, the list of existing forms appears. The New Formbutton appears on the button bar.

47. In the Work pane, click New Form.

48. Choose Design→Form Properties.

Result: The Form Properties box opens.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 385

Page 419: IBMN8D510

Step Action

49. Type Answer in the Name field. Select Response as the form Type.

Result: Answer appears in the Name box.

50. Click the Defaults tab and select On Create: Formulas inherit valuesfrom selected document. Close the Form Properties box.

Result: When a document is created using the form, it will inherit valuesfrom another document.

51. Choose Create→Resource→Insert 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 fixed 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, setall to 0. Close the Table Properties box.

57. Select the left hand column and right justify the text.

58. In the first row, add the following field label into the left cell and field into theright cell:

● Field label: Answered by

● Field name: AnsweredBy

● Field type: Names, Computed when composed

Result: The first row is populated with a field label and field.

59. In the Programmer’s pane, type the following formula:@UserName

Result: The field derives its value from the user name of the personanswering 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 field label and field.

Appendix

Appendix A ■ Solutions to Practice Activities

386 © Copyright IBM Corporation 2007

Page 420: IBMN8D510

Step Action

61. In the Programmer’s pane, type the following formula: Subject

Result: The field derives its value from the Subject field.

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 field label and field.

63. In the Programmer’s 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 Inheritentire selected document into rich text field. Specify QuestionLink asLink, if needed. Close the Form Properties box.

Result: A link to the main question document will automatically appear inthe QuestionLink field.

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 field label and field.

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 field label and field.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 387

Page 421: IBMN8D510

Step Action

69. Click outside the table. Choose Create→Layer.

Result: A blank layer is inserted on the form.

70. Choose Layer→Layer 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 themod_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. Positionit behind the table of field labels and fields.

Result: The layer serves as a background to the table.

74. Click the Window Title object in the Programmer’s pane, and type the fol-lowing 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.

Appendix

Appendix A ■ Solutions to Practice Activities

388 © Copyright IBM Corporation 2007

Page 422: IBMN8D510

Activity A-10: Solution to Lesson Lab 10-2:Enable Instant Messaging in a Field(Optional Lab)

ScenarioThe Worldwide Corporation makes every effort to facilitate internal commu-nication and collaboration. Sometimes, employees have questions aboutpolicies that might be too specific or sensitive to use the Question andAnswer forms, or more information might be needed in order to answer thequestion completely.

The following tables provide detailed solution steps for two parts of the lab:

● Add a Names field that can be used for instant messaging.

● Enable online awareness for the Names field.

Follow these steps to enable instant messaging in a field.

Step Action

Add a Names field to the Question form that can be used for instant messag-ing

1. Click the layer, and move it out of the way, so that you can click the table.

2. Click the third row of the table, and choose Table→Insert Row.

3. In the new left cell, type the following text and right-justify it: ContactPerson

4. In the new right cell, create the following new field:

● Name: ContactPerson

● Type: Names, Editable

● Input Validation Formula:

@If(@ThisValue=NULL;@Failure("Please select acontact 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 389

Page 423: IBMN8D510

Step Action

7. 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 Withto chat with the contact person.

Appendix

Appendix A ■ Solutions to Practice Activities

390 © Copyright IBM Corporation 2007

Page 424: IBMN8D510

Activity A-11: Solution to Lesson Lab 10-3:Embed an Instant Messaging Contact Liston a Form (Optional Lab)

ScenarioTo further facilitate communication and collaboration between WorldwideCorporation employees, you will embed an instant messaging contact list onthe 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. Open the Answer form in Lotus Domino Designer.

2. Click the layer, and move it out of the way.

3. Click after the Answered by text in the first cell of the table. Press Enter.

4. Choose Create→Table.

5. Create a one row, one column, fixed-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 Create→EmbeddedElement→Instant Messaging Contact List.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 391

Page 425: IBMN8D510

Step Action

9. Right-click the embedded contact list and choose Instant Contact ListProperties.

10. In the Embedded Contact List Properties box, on the Info tab, set thewidth and height each at Fit to window, and select yellow for the back-ground color.

11. In the Embedded Contact List Properties box, on the Border tab, selectRidge 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.

Appendix

Appendix A ■ Solutions to Practice Activities

392 © Copyright IBM Corporation 2007

Page 426: IBMN8D510

Activity A-12: Solutions to Lesson Lab 11-1:Display Response Data in Views

ScenarioNow that you have created Question and Answer forms for creating Q&Adocuments about Worldwide’s policies, you need to create a view thatshows the questions with their corresponding answers in a hierarchical view.

In the following activity, you will create a hierarchical view that displays thequestion and answer documents.

Note: Make sure you do this work in your copy of the Policies and Proce-dures 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 LotusDomino 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 Programmer’s pane, select Formula in the Run list.

Result: SELECT @All appears in the Programmer’s pane.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 393

Page 427: IBMN8D510

Step Action

9. Delete SELECT @All. Type the following formula: SELECT Form="Question"|@AllDescendants

Result: The new formula is created.

10. Double-click the first view column to open the Column Properties box.Modify the column as follows:

● Title: (blank)

● Width: 1

● Show twistie when row is expandable.

Sorting:

● Sort: Ascending

● Type: Categorized

Font:

● Text Color: Blue

11. In the Programmer’s pane, select Field and then Category.

12. Choose Create→Append New Column to add the next column. Double-click its header and modify it as follows:

● Title: Question

● Width: 25

● Show twistie when row is expandable.

13. In the Programmer’s pane, select Formula and add the following formula:Subject + " - " + @Text(QuestionDate)

Result: The Question column displays the content of the Subject andQuestionDate fields.

Create a responses-only column in the Q & A view

14. Open the Q & A view in Lotus Domino Designer.

15. Choose Create→Insert New Column to create a column to the left of theQuestion 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.

Appendix

Appendix A ■ Solutions to Practice Activities

394 © Copyright IBM Corporation 2007

Page 428: IBMN8D510

Step Action

18. In the Programmer’s pane, select Formula and add the following formula:AnswerSubject + " - " + @Text(AnswerDate)

19. Save and preview the view.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 395

Page 429: IBMN8D510

Activity A-13: Solutions to Lesson Lab 11-2:Enable a Column for Instant Messaging

ScenarioIn an effort to improve interoffice communications, the Worldwide Corpora-tion would like to have users’ on-line statuses displayed within the Policiesand Procedures application. Follow the steps below to modify the applica-tion.

Follow these steps to enable a column for instant messaging.

Step Action

Enable a column for instant messaging

1. Open your copy of the Policies and Procedures application in LotusDomino Designer, and click the Q&A view.

2. Append a new column to the right of the Question column.

3. In the Column Properties box, name the column Who’s Online? andincrease the column width to at least 18 characters.

4. In the Programmer’s pane, enter the following column formula that evalu-ates 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 field to accept multiple values, but status icons do not dis-play if more than one name appears in a column.

5. In the Style section on the Advanced Format tab in the Column Proper-ties box, select Names from the ist.

6. In the Names section, select Column contains a name and Show onlinestatus.

7. To test your work, ensure that instant messaging connectivity is active.Close the Policies and Procedures application if it is open in the LotusNotes client. Open the Policies and Procedures application in the LotusNotes client and create and save a few documents. You should see theonline status icons beside the names of users who are online.

Appendix

Appendix A ■ Solutions to Practice Activities

396 © Copyright IBM Corporation 2007

Page 430: IBMN8D510

Activity A-14: Solution to Lesson Lab 12-1:Create Instant Messaging Action Buttons ina View (Optional Lab)

ScenarioThe Worldwide Corporation would like to add buttons to the All Documentsview in the Policies and Procedures application to provide users with theability 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. Open your copy of the Policies and Procedures application in LotusDomino Designer, and open the Q & A view.

2. To create the first instant messaging chat action button, choose Create→Action→Action.

3. In the Action Properties box, on the Action Info tab, in the Name field,type Chat. Accept all other defaults on this tab.

4. Type the following formula in the Programmer’s pane:@Command([SendInstantMessage]; ContactPerson)

5. To create the second instant messaging chat action button, chooseCreate→Action→Action. In the Action Properties box, on the Action Infotab, in the Name field, type Show / Hide Contacts. Accept all otherdefaults on this tab. Type the following formula in the Programmer’s 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 applica-tion in the Lotus Notes client, and open the Q&A view. Your Chat andShow/Hide Contacts action buttons should be visible on the action bar.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 397

Page 431: IBMN8D510

Step Action

8. Select a document and click Chat.

Result: An instant messaging chat dialog box opens to initiate a chat withthe author of the document. If the author is offline, a message box displaysindicating 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.

Appendix

Appendix A ■ Solutions to Practice Activities

398 © Copyright IBM Corporation 2007

Page 432: IBMN8D510

Activity A-15: Solution to Lesson Lab 12-2:Add Automation to the Policies andProcedures Application

ScenarioWorldwide Corporation would like to automate creating and editing docu-ments 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 orselected in the Q&A view.

● Save any of the documents by clicking a button instead of using menucommands.

Action Where Used

Create Policy Policies View

Edit Policy Policies ViewWhen Policy document is open in Read mode

Create Question Q & A ViewPolicies View

Edit Question Q & A ViewWhen Question document is open in Read mode

Create Answer Q & A ViewWhen Question document is open in Read mode

Edit Answer Q & A ViewWhen Answer document is open in Read mode

Save and close thedocument

Q & A ViewWhen Policy, Question, or Answer document is open in Editmode

Follow these steps to add automation to the Policies and Procedures appli-cation.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 399

Page 433: IBMN8D510

Step Action

1. Create a list of actions to be added to the Policies application using thetable above.

Create the Create Policy button

2. Open the Policies view, from your copy of the Policies and Proceduresapplication, in Lotus Domino Designer.

Result: The view appears in the Programmer’s pane.

3. Choose Create→Action→Action 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 theaction: @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 LotusDomino Designer, choose Shared Code→Actions.

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 isin Edit mode.

12. Close the Action Properties box.

13. Type the following formula in the Script area for the Click object of theaction: @Command([EditDocument])

Result: The formula appears in the Script area.

Appendix

Appendix A ■ Solutions to Practice Activities

400 © Copyright IBM Corporation 2007

Page 434: IBMN8D510

Step Action

14. Save the shared 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 theaction: @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 theaction: @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 Programmer’s pane.

22. Choose Create→Action→Insert 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 401

Page 435: IBMN8D510

Step Action

27. Insert the Edit Document and Create Answer shared actions onto theQuestion form.

Result: The Edit Document and Create Answer actions appear on theQuestion form.

Insert the shared actions onto the views

28. Open the Policies view in Lotus Domino Designer.

Result: The view appears in the Programmer’s pane.

29. Choose Create→Insert 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 LotusDomino Designer, choose Shared Code→Actions.

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 inRead mode.

39. Close the Shared Action Properties box.

Appendix

Appendix A ■ Solutions to Practice Activities

402 © Copyright IBM Corporation 2007

Page 436: IBMN8D510

Step Action

40. Enter the following formula in the Script area for the Click object of theaction: @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 Pro-cedures application

42. Open the Answer form in Lotus Domino Designer.

Result: The form appears in the Programmer’s pane.

43. Choose Create→Action→Insert 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 Questionforms.

Result: The Save and Close action appears on the two additional forms.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 403

Page 437: IBMN8D510

Activity A-16: Solution to Lesson Lab 13-1:Update Existing Documents

ScenarioSo far, you have either left the policy number blank on Policy documents, ormade one up. In this lab, you will write an agent that computes a policynumber for all existing policies. The policy number should be formatted as“PN999999” where the characters “PN” are the first two characters in thepolicy number, and “999999” is calculated based on the rightmost six char-acters of the document’s 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 LotusDomino Designer, choose Shared Code→Agents.

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 indatabase.

Result: The agent is designated as a shared agent.

5. In the Programmer’s pane, select Formula from the Run list.

Result: The Programmer’s pane is split into the InfoList and the Scriptarea.

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.

Appendix

Appendix A ■ Solutions to Practice Activities

404 © Copyright IBM Corporation 2007

Page 438: IBMN8D510

Step Action

8. Open the application in the Lotus Notes client, run the agent by choosingActions→Reassign Policy Numbers, and check the results.

Result: The PolicyNo field in all Policy documents contains the reassignedpolicy numbers.

Modify the policy form so that it computes a new policy number when a newPolicy document is created

9. Open the Policy form in Lotus Domino Designer.

10. Click on the PolicyNo field.

11. In the Field Properties, change the type to Text, Computed when com-posed.

12. Type the following formula into the Script area: "PN" +@Right(@Text(@DocumentUniqueID);6)

13. Save and test the form.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 405

Page 439: IBMN8D510

Activity A-17: Solution to Lesson Lab 14-1:Set Access Restrictions to the Application

ScenarioWorldwide Corporation’s Policies and Procedures application is almostready to be deployed. However, security levels have not been establishedfor all the different types of users. In this group activity, you will work withthe rest of the class to determine the access control levels required for theappropriate 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. If necessary, in the Lotus Notes client, switch to the Lotus Notesworkspace.

2. Choose File→Open→Lotus 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 Application→New Copy.

5. Set Server to Hub/SVR/WWCorp.

6. Click the folder icon, select D8510, and then click Select.

7. Change the title to Policies and Procedures ## (where ## is yourstudent number).

8. Change the file name to Policies##.nsf

9. Verify that Database design and documents and Access Control Listare selected to be copied.

Appendix

Appendix A ■ Solutions to Practice Activities

406 © Copyright IBM Corporation 2007

Page 440: IBMN8D510

Step Action

10. Click OK.

Set your access control level to Manager

11. Choose File→Application→Access Control.

12. Click Add, and then click the person icon.

13. In the Select Names dialog box, verify that WWCorp’s Directory isselected.

14. In the list of names, double-click your student account name, and then clickOK.

15. In the User type list, select Person.

16. In the Access list, select Manager.

17. Select Delete documents.

18. Select the Students group, click Remove, and then click OK.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 407

Page 441: IBMN8D510

Activity A-18: Solution to Lesson Lab 14-2:Create Roles

ScenarioIn this activity, you will create roles for the Policies and Procedures appli-cation and assign these roles to different users. For example, there arepolicy makers who should be able to view all documents and assign ques-tions 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 applica-tion.

Role Description

Employees Employee

PWriters Policy and Procedure Writer

Designers application Designer

Managers 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 LotusDomino Designer. Be sure to use the application from the classroom server(Hub/SVR/WWCorp).

2. Choose File→Application→Access Control.

Result: The Access Control List to the Policies and Procedures boxopens.

3. Click the Roles tab located on the left side of the Access Control List dia-log box.

Result: The Roles field opens in the Access Control box.

4. Click Add to add a user Role.

Result: The Add Role box opens.

Appendix

Appendix A ■ Solutions to Practice Activities

408 © Copyright IBM Corporation 2007

Page 442: IBMN8D510

Step Action

5. 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. Click the Basics tab located on the left side of the Access Control Listdialog box to return to the list of access controls.

8. Look in the Roles field to verify that the roles you added are listed there.

9. Click OK to close the Access Control List dialog box.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 409

Page 443: IBMN8D510

Activity A-19: Solution to Lesson Lab 14-3:Control Access to Documents in thePolicies and Procedures Application

ScenarioYou want to control access to documents in the Policies and Proceduresapplication 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 beassigned the PWriters role.

● Only people assigned the PWriters role should be able to create Policydocuments.

● 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.

To complete this lab:

● Change the ACL to modify the access rights of different groups ofusers.

● Change the Policy form to allow only users assigned the PWriters roleto 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 PWritersrole to create or edit documents created with this form.

● Set the hide/when formula for actions.

This solution assumes the application has the roles from the previous les-son labs.

Follow these steps to control access to documents.

Step Action

Modify your copy of the Policies and Procedures application ACL to set theaccess levels of the Employee group and the [PWriters] role

1. Open your copy of the Policies and Procedures application in LotusDomino Designer.

2. Choose File→Application→Access Control.

Result: The Access Control List to the Policies and Procedures boxopens.

Appendix

Appendix A ■ Solutions to Practice Activities

410 © Copyright IBM Corporation 2007

Page 444: IBMN8D510

Step Action

3. 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 theCreate documents privilege. Select the [PWriters] role.

Result: Users in the Policy Makers group have Author privileges and areassigned the [PWriters] role.

6. Select the Managers group from the list of users. Select a User type of Per-son 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 tono access

8. Open your copy of the Policies and Procedures application in LotusDomino Designer.

9. Choose File→Application→Access 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 documentscheck 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 LotusDomino Designer.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 411

Page 445: IBMN8D510

Step Action

15. 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 docu-ments 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 field at the top of the Policy Form with the followingproperties:

● 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 formulais true and type a formula of @True.

Result: Only users assigned to the [PWriters] role can create a Policydocument.

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 LotusDomino Designer.

24. Open the Question form.

Appendix

Appendix A ■ Solutions to Practice Activities

412 © Copyright IBM Corporation 2007

Page 446: IBMN8D510

Step Action

25. Create an Authors field 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 document’s 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 cre-ate and edit documents created with the form

27. Open your copy of the Policies and Procedures application in LotusDomino Designer.

28. Open the Answer form.

Result: The Answer form opens in the Work pane.

29. Choose Design→Form Properties. Select the Security tab.

Result: The Form Properties box opens.

30. Clear the All authors and above check box for Who can create docu-ments with this form. Select the [PWriters] role. Close the FormProperties box.

Result: Only users assigned the [PWriters] role can create Answers.

31. Place your cursor at the top of the form and choose Create→Field.

Result: Only the document’s creator can make changes to the document.

32. Create an Authors field 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 413

Page 447: IBMN8D510

Step Action

34. With your copy of the Policies and Procedures application open in LotusDomino Designer, choose Shared Code→Actions.

Result: The Work pane opens to the shared actions list.

35. Open the Create Answer action.

36. Choose Design→Shared Action Properties. Click the Action Hide Whentab.

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 notassigned the [PWriters] role.

38. Save the shared action.

39. Modify the Hide/When properties for the Create Policy action on the Poli-cies view in the same way.

Appendix

Appendix A ■ Solutions to Practice Activities

414 © Copyright IBM Corporation 2007

Page 448: IBMN8D510

Activity A-20: Solution to Lesson Lab 15-1:Create a Design Template and a NewApplication

ScenarioNow that the Worldwide Policies and Procedures application has beendesigned, developed, and tested, it is time to make a design template fromthe 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 templatechanges.

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 mas-ter design template

1. Select your copy of the Policies and Procedures application in eitherLotus Notes or Lotus Domino Designer.

2. Choose File→Application→New 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 file name Policies_Template.ntf

Note: The NTF file extension does not make the file a template. It simplycauses it to appear as a choice in the list of templates when you create anew application.

6. Click Specify What to Copy: Application design only. Result: Only theapplication 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

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 415

Page 449: IBMN8D510

Step Action

8. Open your copy of the Policies_Template application in Lotus DominoDesigner.

9. Choose File→Application→Properties to open the Database Propertiesbox.

Result: The Database Properties box opens.

10. Click the Design tab.

11. Select Database file is a master template.

12. Type the template name Policies_Template. The template name is thelink 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. Open your copy of the Policies and Procedures application in LotusDomino Designer.

15. Choose File→Application→Properties.

Result: The Policies Properties box opens.

16. Click the Design tab.

17. Select Inherit design from master template. Click in the Template Namebox and type Policies_Template

Result: The Policies and Procedures application will inherit designchanges from the Policies_Template application.

Appendix

Appendix A ■ Solutions to Practice Activities

416 © Copyright IBM Corporation 2007

Page 450: IBMN8D510

Activity A-21: Solution to Lesson Lab 15-2:Roll Out the Policies and ProceduresApplication

ScenarioYou want to make modifications to the Policies and Procedures applicationthat will allow for proper replication of the application. You will also test theapplication.

The following tables provide detailed solution steps for seven parts of thelab:

● Modify the ACL of the Policies and Procedures application.

● Create a new replica of the Policies and Procedures applicationlocally 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 Proceduresapplication.

● 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. Open your copy of the Policies and Procedures application in LotusDomino Designer.

2. Choose File→Application→Access Control from the menu.

Result: The Access Control List dialog box appears.

3. Ensure that LocalDomainServers is a User type of Server group, hasManager 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.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 417

Page 451: IBMN8D510

Step Action

Create a local replica of the Policies and Procedures application

7. Open your copy of the Policies and Procedures application in LotusDomino Designer.

8. Choose File→Replication→New Replica.

9. Select Local.

10. Keep the default file 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 thenew replica. This option may already be checked and greyed out.

13. Click OK.

Create new documents on your server copy of the Policies and Proceduresapplication

14. Open the Lotus Notes client.

15. Choose File→Open→Lotus 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 applica-tion opens.

18. Create several new policies.

Update the local copy of the Policies and Procedures application with theserver copy of the Policies and Procedures application

19. Open the Replication page in the Lotus Notes client.

20. Make sure the Policies and Procedures application is checked.

Appendix

Appendix A ■ Solutions to Practice Activities

418 © Copyright IBM Corporation 2007

Page 452: IBMN8D510

Step Action

21. Click Start Now.

Result: The local and server copies of the Policies and Procedures appli-cations are replicated to one another.

22. Open the local replica and verify that the new document has arrived.

Modify the Policies and Procedures application template

23. Open the Policies and Procedures template, Policies_Template.ntf, inLotus Domino Designer.

24. 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 Proceduresapplication.

28. Open the local replica of the Policies and Procedures application in theLotus Notes client.

29. Open any existing document using the Policy form to see if the backgroundcolor has changed.

Update the server copy of the Policies and Procedures application with theserver copy of the Policies and Procedures application

30. Open the Replication page in the Lotus Notes client.

31. 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 repli-cated to one another.

33. Open the server copy of the Policies and Procedures application.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix A ■ Solutions to Practice Activities

© Copyright IBM Corporation 2007 419

Page 453: IBMN8D510

Step Action

34. Open any existing document using the Policy form to see if the backgroundcolor has changed.

Appendix

Appendix A ■ Solutions to Practice Activities

420 © Copyright IBM Corporation 2007

Page 454: IBMN8D510

The WorldwideCorporation InfrastructurePlanAbout This Appendix

This appendix provides an overview of Worldwide Corporation’s infra-structure. It is intended to provide an overall view of the environment asdesigned by the planning team. It does not provide details on specificIBM® Lotus® Domino® functionality.

This document will be continually updated. Administrators should refer tothe Policies and Procedures application on any Worldwide Corporationserver for the latest version of this document.

IBM® Lotus Notes® and Domino is Worldwide Corporation’s global stan-dard for electronic mail and for developing and deploying groupwareapplications.

BAppendix

© Copyright IBM Corporation 2007

Page 455: IBMN8D510

Organization Structure

The structure of Worldwide Corporation appears in the following figure.

Figure B-1: Structure of Worldwide Corporation

User Needs

Worldwide Corporation’s users require the following access to applications.

Information Groups Who Lotus Domino Server

E-mail/Communication All Application

Policies and procedures All Web

Product Information:

● Price list

● Product catalogue

● Sales

● Customers

● Resellers

ApplicationWeb

Customer Information:

● Customer serviceapplication

● Sales

● Support

● Distribution

ApplicationMailCommunication

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

422 © Copyright IBM Corporation 2007

Page 456: IBMN8D510

Information Groups Who Lotus Domino Server

Process information:

● Product design

● Order processing

● Development

● Product management

● Manufacturing

● Sales

ApplicationWeb

Human Resources All Application

Note: User needs were determined by function across all geographies.

Servers By Task

Worldwide Corporation will designate servers to specific tasks based onInformation Groups. The following table lists the servers, associated tasks,and rationale behind the decision.

Server Type Tasks Rationale

Hub Routes mail and replicationapplications to and from otherhub or spoke servers.

Provide easier administra-tion and maintenance.

Internet Mes-saging

Provides non-Domino mail ser-vices, such as:

● POP3

● IMAP

● SMTP

● NNTP

● LDAP

Use Lotus Domino serverto provide employees withaccess to non-LotusDomino mail files.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 423

Page 457: IBMN8D510

Server Type Tasks Rationale

Mail Stores users’ mail and applica-tions and routes mail across theintranet and Internet.

● Provide easier adminis-tration.

● Minimize server proces-sor load.

● Reduce network traffic.

● Provide predictableserver performance andgrouping of users.

● Allow user access toapplications when mailserver is down.

Application Stores application applications. ● Provide easier adminis-tration.

● Group applications byusage, replicationneeds, and/or securityrequirements.

● Allow tuning of server tooptimize performanceand response time inde-pendent of mail usage.

● Ease expansion by add-ing new applicationservers as usage andstorage needs increase.

Web Provides access to an applica-tion from the Internet or tocorporate intranet. Can useeither:

● Lotus Domino Web server

● Microsoft IIS

● Can place outside thefirewall for Internetaccess.

● Provide employees withaccess to corporateinformation from abrowser.

Servers By Location

Worldwide Corporation will have one Lotus Domino Domain (WWCorp) thatincludes all Worldwide Corporation offices. Worldwide Corporation’s Internetdomain name has been registered as WWCorp.com.

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

424 © Copyright IBM Corporation 2007

Page 458: IBMN8D510

Topology

Worldwide Corporation has selected a hub-and-spoke topology for ease ofmanagement and future expansion. Each regional office will have a hubserver and one or more spoke servers. Each site will be set up to run inde-pendently, although they will be connected to the corporate hub.

Connection documents are required for replication to tell the corporate hubhow and when to communicate with other servers and for spoke servers toconnect to the corporate hub.

Headquarters is the center of the infrastructure and houses the main hubserver, which has high-speed links running to the offices. Each individualLotus Domino server is responsible for its own mail routing and replicationevents. The hub server is responsible for replication of the critical applica-tions between all its spoke servers.

The following figure 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 Corporationdomain and replicates the Directory Catalog and the AdministrationRequests application to all other Lotus Domino servers within the WorldwideCorporation domain (WWCorp).

Sales offices and sales representatives will connect to their local regionalhub server using Lotus Notes clients and Internet clients, such as browsers.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 425

Page 459: IBMN8D510

Customers and vendors will have access through a Web server at Head-quarters.

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 constantlyconnected.

Grouping the Notes Named Networks this way will ensure that users seeinformation on their local servers to reduce network traffic.

Each country office has one or more Lotus Domino servers. The followingtable shows the countries to be configured and the Lotus Notes Named Net-works (NNNs) for each country.

Region Code NNN Connect Status

Headquarters HQ WWCorpHQ WAN

East East WWCorpEast WAN

West West WWCorpWest WAN

System Administration

System administration is locally controlled by region, but monitored from theCorporate office. Administration tasks are controlled by regional administra-tors. General policies and guidelines are maintained and distributed from theCorporate office. Implementation and design changes are carried out afterbusiness justifications are submitted and approved.

All system administrators use the Lotus Domino Administrator and WebAdministrator for all administration tasks.

Domino Domain Monitoring

System Administrators will use Domino Domain Monitoring and the inte-grated IBM support assistant to proactively monitor the WWCorp Domain.

Network Strategy

Worldwide Corporation’s 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 fromHeadquarters.

● Upgrading existing server network cards as necessary to meet demand.

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

426 © Copyright IBM Corporation 2007

Page 460: IBMN8D510

Although the WAN is robust and high-speed, Worldwide Corporation doesnot want to rely solely on the network. They purchased additional serversfor regional offices to ensure reliability and consistency across geographicallocations.

Directory Strategy

There will be only one Lotus Domino domain (WWCorp) for the entireWorldwide Corporation Domino environment. The model matches the physi-cal layout of the Worldwide Corporation WAN. The first configured server(the corporate hub) will have full administration rights over the entiredomain.

The Lotus Domino Directory will reside on the corporate hub server at head-quarters, and replicate to each regional hub server. The corporate hub willcreate Directory Catalogs, and replicate to regional hubs for use by remoteusers. Remote users can keep a local replica of the Directory Catalog onthe client for faster response time and timely encryption of messages.

System administrators will periodically update the Directory Catalog and rep-licate 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 con-sists of a main hub with two spoke servers, which are the regional hubservers. Each regional hub server also has its own spoke servers.

The corporate hub server will be the primary hub and share control of repli-cation with regional hub servers.

Streaming Replication

Connection documents are required for replication to tell the corporate hubhow and when to communicate with other servers and for spoke servers toconnect to the corporate hub. To take advantage of the new streaming repli-cation feature in Lotus Domino 8, connections between Hub servers will usethe Pull/Pull replication strategy.

Administrators will create Connection documents between the WWCorpDomain Hub and regional Hub servers using the Pull:Pull strategy. This willtake advantage of the speed of Streaming Replication. It is important to notethat WWCorp employees are not expected to access these servers, so allHub servers can share the replication workload.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 427

Page 461: IBMN8D510

Note: Employees are not expected to access Hub servers.

The following figure shows Worldwide Corporation’s replication topology.

Figure B-3: Worldwide Corporation’s replication topology

Application Types

Types of applications will be separated and reside on different applicationservers to isolate problems and simplify management. All applications willbe 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 8Design Note Compression and on demand Collation features. This willreduce I/O and space utilization and provide the opportunity to reduce sys-tem resources.

Database Redirect

Administrators will use database redirect to automatically update client refer-ences to databases that have been relocated or deleted.

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

428 © Copyright IBM Corporation 2007

Page 462: IBMN8D510

ApplicationType

Resides on Cor-porate

ApplicationServer and...

ReplicationSchedule

Policies andRestrictions

Customer serviceapplication

All regional appli-cation servers

Daily duringmutual off-peakhours for Lisbonand regional hub

Local languagesand customs,escalation proce-dures

Purchasing appli-cation

All regional appli-cation servers

Daily duringmutual off-peakhours for Lisbonand regional hub

Local languagesand regulations

Policies and pro-ceduresapplication

All regional appli-cation servers

When changesare made

Local languagesand customs

Price lists All regional appli-cation servers

When changesare made

Local languagesand currencies

Catalogs All regional appli-cation servers

Quarterly, orwhen changesare made

Local languages

EnterpriseResource Plan-ning (ERP)application

West applicationserver

When changesare made

Local languages

Composite appli-cations

All regional appli-cation servers

When changesare made

Local languagesand currencies

Integrated Db2 Technology

Administrators will leverage the speed of Db2 Server Technology whilemaintaining 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 deliv-ery, 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 corpo-rate intranet.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 429

Page 463: IBMN8D510

The following configuration provides for ease of configuration and optimumload 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 SMTPprotocol.

● All mail servers have Connection documents and route mail usingNRPC internally.

The WWCorp Domain Hub will be configured to send and receive Internetmail. Administrators will use whitelists and blacklists to improve mail routingperformance. In addition, Transfer and Delivery Reports will be used tonotify 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 GlobalDomain documents.

● List the inbound mail servers in the Mail Exchange (MX) records in theDomain Name Service under the domain’s name. Only one is required.(Note that load balancing for multiple servers is dependent on the algo-rithm used by the client SMTP system to select a server from the MXrecords.)

● Configure complete address lookup or configure local part only lookupto identify each mail recipient’s mail server so that the router can makethe final delivery.

Mail clients

Initially, all mail users will have Lotus Notes mail files. In the future, somemail users may use other Internet mail client software. At that time, World-wide Corporation will set up select Internet POP3 Messaging Servers fornon-Notes mail clients to access mail files on the Lotus Domino server.

Mail monitors and controls

The following mechanisms will be put into place for monitoring and control-ling mail:

● Automated testing of mail routers

● Mail quotas

● Inbox cleanup

● Mail journaling

● Set options for Mail Recall

● Set options for Out of Office agent

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

430 © Copyright IBM Corporation 2007

Page 464: IBMN8D510

● Reject inbound ambiguous names/deny mail to groups

● Maximum message size for inbound and outbound message set to 10megabytes

● User restrictions, such as full-text indexing and other Policy Manage-ment enhancements

Server managed provisioning

Administrators will use the Eclipse Provisioning model to deploy Lotus Notes8 Client features, components, and composite applications.

Mail routing topology

The following figure shows Worldwide Corporation’s mail routing topology.

Figure B-4: Worldwide Corporation’s mail routing topology

Reverse Path setting for forwarded messages

Administrators will use this function to specify how the mail router handlesdelivery failure reports when e-mails are automatically forwarded by anaction in a user’s mail rule. This will reduce inadvertant rejection of legiti-mate mail by some SPAM filters when automatic mail forwarding is enabled.

Worldwide Corporation Naming Conventions

The following table defines the Worldwide Corporation naming scheme.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 431

Page 465: IBMN8D510

Organization Compo-nent

Vale Certifier

Organization (O) WWCorp Cert.id

Organizational Units(OU)

HQ: HeadquartersWEST: WestEAST: EastSVR: All servers

Hq.idWest.idEast.idSvr.id

Organizational units are based on geographical regions.

The servers’ organizational unit will be used for better control of manage-ment and creation of servers.

All organizational units and common names are descendants of the organi-zation certifier /WWCorp.

User Naming

The following table provides user naming conventions.

Type Syntax

Common name for LotusDomino environment

Firstname Lastname

Internet mail addressing [email protected] where username= Firstinitial_Lastname

Server Naming

The following table provides examples for regional server names.

Region Code Server Names (Server Types)

Headquarters HQ HQHUB/SVR/WWCorp (Hub/Comm)HQAPP01/SVR/WWCorp (Application)HQMAIL01/SVR/WWCorp (Mail)

East East EASTHUB/SVR/WWCorp (Hub)EASTAPP01/SVR/WWCorp (Application)EASTMAIL01/SVR/WWCorp (Mail)

West West WESTHUB/SVR/WWCorp (Hub)WESTAPP01/SVR/WWCorp (Application)WESTMAIL01/SVR/WWCorp (Mail)

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

432 © Copyright IBM Corporation 2007

Page 466: IBMN8D510

Naming Examples

The following table provides naming examples for international sites.

If you want to ... Then ...

Create a new server. 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 first mail server in Australia mightbe: AUMAIL01/SVR/WWCorp

Create a new organiza-tional unit.

Use the standard country code that identifies thelocation of the organizational unit.A new organizational unit for Canada might be:/CN/WWCorp

Create a new user. Certify under the regional organizational unit wherethe user works.A new user named Sara Jones in London would be:Sara Jones/UK/WWCorpThe corresponding Internet name would be:[email protected]

Certifier/ID Management Policy

The following table describes the certifier/ID management policy.

Type Management Policy

Organization certifier ● Corporate system administrators create the O certi-fier.

● Corporate system administrators create the OU cer-tifiers.

● Access is limited to two administrators using mul-tiple passwords.

● Store IDs in protected areas.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 433

Page 467: IBMN8D510

Type Management Policy

Organizational unitcertifiers

● Corporate administrators keep copies of OU certifi-ers.

● OU certifiers are migrated to the CA process.

● Regional administrators use the CA process to reg-ister users and servers using these OU certifiers.

● Store IDs in protected areas.

Server IDs ● Corporate system administrators create all serverIDs.

● Store IDs on the server.

● Use only for the server.

User IDs ● Regional administrators create user IDs.

● Regional system administrators keep copies of IDsin a secure application on the regional hub server.

● Use a Certification Log application to track certifica-tion.

● All Certifier IDs have multiple passwords and expi-ration dates of two years from date of creation.

● Store backups in a secure off-site location.

Key files for Interent(X.509) Certificates

● Using Lotus Domino as a Certificate Authority,administrators will create X.509 certificates usingthe Certificate Authority Application on a workstationand store the CA key ring on that workstation, noton the server.

● Do not distribute these files to other administratorsin the organization.

● Store the certificates in a secure off-site location.

● Store in corporate user Lotus Notes ID files.

● Store in trusted LDAP directories (for customers).

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

434 © Copyright IBM Corporation 2007

Page 468: IBMN8D510

Hierarchical Naming for Worldwide Corporation

The following figure shows the organization hierarchy, including currentlyplanned server names.

Figure B-5: Worldwide Corporation’s organization hierarchy

Remote Access

Worldwide Corporation has determined specific Internet access for remoteemployees, 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, includ-ing controlled access to servers, applications, and data

The following table describes types of access.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 435

Page 469: IBMN8D510

Employees Customers Vendors Resellers

X.509 certificates Anonymousaccess to catalogand public com-pany information.Future:Username andpassword accessto informationabout their ownorders, forexample, ship-ping information.

Anonymousaccess

Authenticatedaccess throughoutside LDAPdirectories.

Internet security features

Administrators will use XACL’s to protect against to decipher hashed pass-words. Internet Password Lockout will be used to restrict Internet users tothree login attempts before account lockout.

Remote Users

Users at home offices that do not have direct connections to the WAN canuse an Internet Server Provider (ISP) to access the Lotus Domino systemthrough a local Firewall server.

Remote users can connect to their mail server through the local Firewallservers.

Server Configurations and Security

Worldwide Corporation has determined configurations for servers, includinglicensing, file structure, and server tasks. Server security has been definedas group access to servers.

Server Types

The following table lists the server licenses that will be used for each of theserver types.

Server Type Server License Rationale

Lotus Domino Mail andInternet Messagingservers

Lotus Domino Messag-ing Server

To provide LotusDomino and Internetmail services

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

436 © Copyright IBM Corporation 2007

Page 470: IBMN8D510

Server Type Server License Rationale

Application and Webservers

Lotus Domino UtilityServer

To provide custom appli-cation applications forLotus Notes and Webclients

Hub server Lotus Domino Enter-prise Server

To provide the followingservices:

● Clustering

● Partitioning

File Structure

The following table lists the standard file structure on the servers.

Path Contents Description

Domino System files, client files Client files will beinstalled for network dis-tribution purposes.

Domino\data Applications, generaldata files

Domino system applica-tions that are requiredfor Domino to functionproperly.

Domino\data\critical Applications Critical applications thatrequire frequent replica-tion.

Use the standard installation file paths whenever possible to ensure stan-dardized training and ease of support and troubleshooting.

Note: Store Lotus Domino executables on a separate disk than Domino data forbetter performance.

These areas of the Lotus Domino file structure are only accessible to desig-nated personnel for installation purposes. All other Lotus Domino data isprotected by operating system security and is accessible to Lotus Dominoadministrators only.

Configuration Documents

Every Worldwide Corporation server has its own Configuration document.This ensures that each server configuration can be modified separately andthat there is a log of any changes made.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 437

Page 471: IBMN8D510

The Lotus Domino configuration application will be used for server setup tostreamline and automate setup.

A Configuration 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 Configurationdocuments.

Domino Server Type Recommended Tasks

Standard services for all servers ● 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 addi-tional 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

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

438 © Copyright IBM Corporation 2007

Page 472: IBMN8D510

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 andtype 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. Ineach server restrictions setting, these groups will be added in the Notaccess server fields.

The following table describes the four groups.

Group Name Description

Deny Access A-F Denial for people whose surnames beginwith A-F.

Deny Access G-L Denial for people whose surnames beginwith G-L.

Deny Access M-R Denial for people whose surnames beginwith M-R.

Deny Access S-Z Denial for people whose surnames beginwith S-Z.

Before deleting a user from the Lotus Domino system, add the user to oneof these groups. This will ensure immediate denial to any Worldwide Corpo-ration server.

Note: This is subject to replication of the changes throughout the domain, which willtake no longer than 60 minutes.

Server Configuration Plan

The following table describes the server configuration plan.

Standard Requirement

Application size quotas No application size quotas

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 439

Page 473: IBMN8D510

Standard Requirement

Application names No database naming standards

File system directory structure Standard directory structure, for example:\Domino\Data\Global\HR1\Domino\Data\Global\Marketing\Domino\Data\Local\Marketing\Domino\Data\Local\Dev1

Groups spanning the entireorganization

● One group for all server administrators,for example: GlobalAdmins

● Groups for specific categories of employ-ees, for example: GlobalSales

Groups at all sites ● A group for each region, for example:EastAll (for all Worldwide Corporationemployees in East)

● One group for administrators per region,for example: WestAdmins (for all serveradministrators in West)

Client Configurations and Security

Worldwide Corporation has determined configurations for clients, includinglicensing and registration and desktop settings. Client security has beendefined using security policies, including client IDs and certificates andgroup access to databases.

Client Licenses

Client licenses will be:

● Lotus Notes Client for most users, all generic IDs, and any contractualor affiliate accounts.

● Lotus Domino Designer for users who will create, modify, or designdatabases.

● Lotus Domino Administrator for system administrators.

Client Deployment

Desktop, registration, and security policies will be used to set up users’ envi-ronments.

For Internet mail, account documents will be created locally for each mailprotocol. Mail will be stored in Notes Rich Text format.

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

440 © Copyright IBM Corporation 2007

Page 474: IBMN8D510

Worldwide Corporation will use policy documents to create and updateLocation and Connection documents on workstations for dial-up users todetermine where and how to locate the servers.

Client IDs and Certificates

The following table describes the policy regarding client IDs and certificates.

Type Policy

Lotus Notes client IDs ● Certify all IDs using a Lotus Domino cer-tificate.

● Users responsible for secure or encryptedinformation, such as pricing information toresellers, will hold an Internet (X.509) cer-tificate.

● Stored on workstations for all users andencrypted locally.

● Copies are kept in a secure location byregional as well as corporate administra-tors.

Internet client browsers ● Accept CA certificate as a trusted root.

● Store internal signed client certificates foraccess to secure information.

Longer Encryption Keys

Administrators will use the Lotus Domino 8 Certifier Key rollover to upgradeuser, server, and certifier ids taking advantage of the new 2048 bit encryp-tion for users and servers, and 4096 bit keys for certifier ids.

File Storage

Client-based data files, such as IDs, Notes.ini, and *.dsk, will be stored onthe workstation for all users and encrypted locally.

Implementing the Deployment Plan

Complete these tasks to implement the Lotus Notes and Lotus Dominocomponents of the Worldwide Corporation deployment plan.

Task Procedure

❒ 1 Set up the first server.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix B ■ The Worldwide Corporation Infrastructure Plan

© Copyright IBM Corporation 2007 441

Page 475: IBMN8D510

Task Procedure

❒ 2 Add an administrator’s workstation.

❒ 3 Set up access to the Lotus Domino Directory.

❒ 4 Add Lotus Domino servers.

❒ 5 Add Organizational Units.

❒ 6 Register administrators.

❒ 7 Add Lotus Notes clients.

❒ 8 Create user groups.

❒ 9 Create organizational policy.

❒ 10 Register users.

❒ 11 Set administration preferences.

❒ 12 Set up access to servers.

❒ 13 Set up server logging.

❒ 14 Synchronize Lotus Domino system databases throughout thedomain.

❒ 15 Route mail internally.

❒ 16 Route mail to the Internet.

❒ 17 Set mail controls.

❒ 18 Test mail routing and delivery.

Appendix

Appendix B ■ The Worldwide Corporation Infrastructure Plan

442 © Copyright IBM Corporation 2007

Page 476: IBMN8D510

Extend IBM® Lotus®

Domino® SoftwareExtend IBM® Lotus® Domino® Software

IBM® Lotus® Domino® software offers software that can add functionalityto an existing Lotus Domino infrastructure. These add-ons greatlyenhance the capabilities of Lotus Domino and provide specific solutions.These solutions can be categorized as:

● Connectivity extensions

● Application extensions

For additional information on any of these products, refer to the IBMLotus 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.

CAppendix

© Copyright IBM Corporation 2007

Page 477: IBMN8D510

Add-on Definition Description and Benefits

DUCS Lotus DominoUnified Com-municationsServices

● Unified Messaging represents the conver-gence of voice mail, e-mail, and fax so thatall messages are stored in a single locationand can be accessed from a variety ofdevices, including telephones and PCs.

● Unified Communications (UC) takes UnifiedMessaging a step further by extending mes-sage access to additional devices andtechnologies, such as mobile phones, pag-ers, personal digital assistants (PDAs), andbrowsers. In addition, UC provides notifica-tion features that will alert subscribers indifferent ways when they receive a messagethat meets certain criteria.

● Lotus has formed partnerships to delivercomplete solutions. DUCS provides the plat-form and these key services on whichpartners can build Unified Communicationssolutions that use Lotus Domino as the Uni-fied 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 informationthey want to upload to their desktop by map-ping fields from Lotus Notes to a handhelddevice.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 ser-vices are listed in the following table.

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

444 © Copyright IBM Corporation 2007

Page 478: IBMN8D510

Add-on Definition Description and Benefits

LotusDominoEnterpriseIntegration®

Composed of:

● Lotus EnterpriseIntegrator 6 (LEI6)

● Lotus EnterpriseSolution Builder(ESB)

● Lotus Connec-tors

LEI is a server-based data distributionproduct that the enables high-performance, scalable exchange of databetween Lotus Domino and a large num-ber of host and relational applications,including:

● IBM® DB2®

● Oracle

● Sybase

● OLE-D

● Text

● ODBC data sources

● ERP applications

IBM® Lotus®

Domino®

DocumentManager

Lotus DominoDocument Man-agement

Enterprise-level document control andmanagement system for business docu-ments and corporate information. Itsupports all key document managementfeatures, including:

● Check-in/check-out

● Versioning

● Full-text search across all managedcontent

● Audit trails

● Profiling

● Multi-level versioning

● Change notification

LotusWorkflow

Stand-alone application development toolthat works on top of Lotus Domino toprovide 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 anyenvironment to improve an organizations communication and collaboration.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix C ■ Extend IBM® Lotus® Domino® Software

© Copyright IBM Corporation 2007 445

Page 479: IBMN8D510

Additional IBM and Lotus Products

The following table lists some of the additional products available from IBMLotus software. For additional information on any of these products, refer tothe IBM Lotus software listings or the Lotus Web site at www.lotus.com.

Software Description

IBM® Lotus®

Sametime®Supports immediate communication for users within an organi-zation through secure text messaging, audio and video, or fullcollaborative 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 onlinemeetings

● Lotus Sametime Connect client

● A range of Application Developer Tools

IBM® Lotus®

QuickPlace®Self-service Web tool for team collaboration. Users can createa secure and central workspace on the Web structured forimmediate participation, for teams to:

● Coordinate – people, tasks, plans, and resources

● Collaborate – share ideas and discussion, resolve issues,co-author documents, exchange files, manage due dili-gence

● Communicate – actions and decisions, key findings andlessons, publish knowledge captured to a broader base ofreadership

Lotus QuickPlace is available on five platforms and in fourteenlanguages. Uses include:

● Project management

● Rapid response to ad-hoc initiatives

● Team Web sites

● To facilitate discrete business processes that span theextended enterprise and value chain

IBM® Lotus®

Quickr®IBM Lotus Quickr is team collaboration software that helpsyou share content, collaborate and work faster online withyour teams -- inside or outside firewall.

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

446 © Copyright IBM Corporation 2007

Page 480: IBMN8D510

Software Description

Lotus Connec-tions

Collaborative software that combines components to provideconnection between people and the work objectives or com-mon interests. The components of Lotus Connections thatwork together are:

● Profiles

● Communities

● Blogs

● Dogear

● Activies

IBM® Lotus®

LearningSpace®

ManagementSystem

Lotus LearningSpace is an open, Web-based e-learning solu-tion to train one group or an entire enterprise with a completee-learning management and delivery system.Lotus LearningSpace is part of IBM Mindspan Solutions, afamily of services and technologies designed to supporte-learning in the organization.

IBM® Tivoli®

Analyzer forLotus®

Domino®

IBM Tivoli Analyzer for Lotus Domino:

● Is a performance analysis and management solution thatruns within the IBM Lotus Domino 6 Administrator, provid-ing the ability to maximize the performance of LotusDomino server software.

● Includes:

■ Powerful, predictive analysis tools

■ Intelligent server health monitoring

■ Workload balancing and change management tools

Lotus Compo-nent Designer6.0

IBM® Lotus® Component Designer V6 is a software develop-ment tool that helps developers quickly create newapplications that provide rich user interfaces and supportingbusiness logic without writing code. These applications formthe constituent components of the work environment deliveredby IBM WebSphere® Portal Express V6. Previously calledWorkplace Designer.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix C ■ Extend IBM® Lotus® Domino® Software

© Copyright IBM Corporation 2007 447

Page 481: IBMN8D510

Software Description

Lotus Expedi-tor

IBM® Lotus® Expeditor is IBM’s universal managed client soft-ware to extend composite applications to laptops, desktops,kiosks and mobile devices and is the follow-on release of IBMWebSphere® Everyplace® Deployment. It can be used toextend your IBM Lotus, IBM WebSphere, IBM® Workplace™

or Eclipse™ infrastructures to a managed client environment.An alternative to Microsoft®.NET client software, Lotus Expe-ditor provides the flexibility that comes from service orientedarchitecture (SOA) and a standards-based programmingmodel from the OSGi™ Alliance and the Eclipse Foundation.

Lotus MobileConnect

IBM Lotus® Mobile Connect software is a communicationssoftware platform to help enterprises provide a mobile virtualprivate network (VPN) that encrypts data over wireless andwired network connections. The software (the follow-onrelease to WebSphere Everyplace Connection Manager) helpsyou efficiently extend your existing instant messaging andenterprise applications to mobile workers.

Lotus Orga-nizer 6.1

IBM Lotus Organizer 6.1 is an electronic day planner with tabsfor each section and pages that turn. You can quickly see allyour calendar, contacts, to do’s, calls, notes, Web informationand more at a glance. No more looking for sticky-note remind-ers or lost scraps of paper. It’s all there, right before youreyes.

LotusSametimeEnterpriseMeetingServer

Collaboration across time zones and locations has never beeneasier -- or faster. IBM Lotus Sametime software helps youkeep pace with your real-time work environment with market-leading, award-winning enterprise instant messaging and Webconferencing capabilities.

LotusSmartSuite

Lotus SmartSuite delivers powerful desktop tools to the homeand 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 data-base.

Lotus TeamWorkplace

Lotus Team Workplace will allow your end-users to quicklyestablish and participate in virtual communities workingtowards a common set of goals, called teams. These teamscan create team workspaces, and start collaborating immedi-ately.

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

448 © Copyright IBM Corporation 2007

Page 482: IBMN8D510

Software Description

Lotus VirtualClassroom

IBM Lotus Virtual Classroom is easy to install and use, allow-ing you to quickly and easily develop and deliver just-in-timetraining to various audiences - anywhere, anytime. As onecomponent of the blended learning solution, IBM Lotus VirtualClassroom integrates with IBM Lotus Learning ManagementSystem, IBM Workplace Collaborative Learning, or with yourexisting Learning Management System to protect your currentinvestments.

LotusWorkflow

IBM Lotus® Workflow is a stand-alone application develop-ment tool that works on top of IBM Lotus Domino® andspeeds the creation and deployment of workflow-orientedapplications. Lotus Workflow allows organizations to standard-ize and streamline time-consuming, people-based activitiesand track their progress. Business processes can be per-formed more consistently, with fewer errors, because stepsare predefined and documented.

Workplace Cli-entTechnologyClient Adminis-trator

IBM Workplace Client Technology Client Administrator extendscentralized management capabilities, security features and aportal-based desktop environment to bank-branch worksta-tions. Built using IBM Workplace Client Technology software,the Client Administrator application provides a new way forIBM, its customers and IBM Business Partners to develop,deliver and centrally manage end-user applications in anetwork-centric computing model.

Workplace Cli-entTechnologyClient MicroEdition

The foundation products and components of the IBM Work-place Client Technology, Micro Edition family are available in asingle package, Workplace Client Technology, Micro Edition5.7, which provides an integrated platform for the extension ofexisting enterprise applications to server-managed clientdevices.

● This package provides a platform for the extension of exist-ing enterprise applications to server-managed clientdevices such as desktop computers, laptop systems, per-sonal digital assistants, (PDAs), and other mobile andpervasive devices.

● The integrated package combines the tools (WebSphereStudio Device Developer and Micro Environment Toolkit forWebSphere Studio), run-times (WebSphere EveryplaceMicro Environment, Service Management Framework, andWebSphere Everyplace Custom Environment), andmiddleware (DB2e, MQe, Web Services) for building, test-ing, and deploying server-managed client software topervasive devices.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix C ■ Extend IBM® Lotus® Domino® Software

© Copyright IBM Corporation 2007 449

Page 483: IBMN8D510

Software Description

WorkplaceCollaborationServices

IBM® Workplace™ Collaboration Services is a single productthat provides a full range of integrated ready-to-use communi-cation and collaboration tools to enable people to do their jobsmore effectively – anytime, anywhere.

WorkplaceCollaborativeLearning

IBM® Workplace Collaborative Learning™ is an enhancedIBM® Workplace™ product and part of the integrated collabo-rative environment delivered by IBM® Workplace™

Collaboration Services. It provides learning services that helporganizations manage their training programs more efficientlyand integrates learning resources on the desktop. Integrationwith other Workplace Collaboration Services capabilities deliv-ers blended learning experiences and provides students withenhanced tools such as course discussion areas, documentsharing, Web conferencing, and chat rooms.

WorkplaceDashboardFramework

IBM WebSphere® Dashboard Framework is a powerful andflexible tool for rapidly building, SOA dashboards forWebSphere® Portal.WebSphere Dashboard Framework augments the capabilitiesof WebSphere Portal, adding dashboard-specific features,such as a robust alerting module, hi-fidelity charting.

● By leveraging WebSphere Dashboard Framework, compa-nies can quickly deploy highly tailored dashboards thatconsolidate data and processes from multiple back-endsystems.

● In addition, dashboards built using WebSphere DashboardFramework can facilitate problem resolution by enablingaction right from the dashboard. As a result, withWebSphere Dashboard Framework, companies can helpdramatically reduce their development costs and speed thetime-to-value for their dashboard initiatives.

WorkplaceDesigner

Now called Lotus Component Designer 6.0

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

450 © Copyright IBM Corporation 2007

Page 484: IBMN8D510

Software Description

WorkplaceDocuments

IBM® Workplace™ Documents provides a low cost, standards-based collaborative document management solution for youremployees. IBM Workplace Documents makes it easy tocollaboratively create, organize and share important docu-ments and information in a security-rich environment acrossthe organization.The product facilitates document reviews and approvals,versioning, search and private drafts for spreadsheet, presen-tation, word processing, e-mail, drawing files, project plansand more – so you can work collaboratively – on demand. Itprovides a standard browser interface -- though for a morefeature enhanced ″rich client″ user experience, you can addIBM® Workplace Managed Client™. IBM Workplace productsprovide the front-end to IBM’s service oriented achitecture(SOA) strategy.

Workplace forBusiness Con-trols andReporting

IBM® Workplace™ for Business Controls and Reporting helpsprovide a common platform for companies to easily document,evaluate and report the status of controls management acrossmultiple initiatives in your company.IBM Workplace for Business Controls & Reporting v2.6 is nowavailable - improving business foresight with customizable,self-assessment surveys, more in-depth real-time executivedashboards and an agreement with the ISACA organization tolicense CoBIT.

Workplace forBusinessStrategyExecution

Now called IBM Lotus® ActiveInsight.

IBM Lotus®

ActiveInsightIBM Lotus® ActiveInsight software is a solution that helpsorganizations define and communicate goals, view real-timemetrics, and take action via composite, role-based dash-boards and scorecards – thus helping to improve overallperformance. Previously called Workplace for Business Strat-egy Execution.

IBM Work-place Forms

IBM® Workplace Forms™ enables easy-to-use, openstandards-based electronic forms (eForms) that help reduceinefficiencies inherent to paper-based forms. It provides orga-nizations across many industries with security-rich electronicforms that adapt to existing resources and systems, simplifycomplex forms, enable business process automation, and helpspeed IT development.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix C ■ Extend IBM® Lotus® Domino® Software

© Copyright IBM Corporation 2007 451

Page 485: IBMN8D510

Software Description

WorkplaceForms Server2.7

IBM Workplace Forms Server 2.7 enables the creation anddelivery of XML forms applications. It provides a common,open interface to enable integration of e-forms data withserver-side applications using industry-standard XMLschemas.

WorkplaceForms ServerExpress

IBM Workplace Forms Express V2.6 enables small andmedium businesses (SMB) to create a dynamic and intelligentfront-end to On Demand Business processes that:

● Automates filling of the forms

● Easily retrieves forms via Web site or e-mail

● Provides a pixel-precise, personalized, and security-richsolution for the most demanding forms

● Gathers information faster and more accurately with a user-friendly front-end process to an organization’s systems

● Attaches and files 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

● Provides IT and IBM Business Partners with robust plat-form for forms data interchange with back-end systems

WorkplaceForms Viewer2.7

IBM Workplace Forms Viewer 2.7 is a feature-rich desktopapplication used to view, fill, sign, submit, and route e-forms,and is able to function on the desktop or within a browser.

WorkplaceForms ViewerExpress 2.7

IBM Workplace Forms Viewer Express 2.7 is a feature-richdesktop application used to view, fill, sign, submit, and routee-forms.

Workplace forSAP software

IBM® Workplace™ for SAP® Software leverages existing SAPinvestments to help improve people productivity by integratingSAP content with IBM leading collaboration and performancemanagement technology. SAP and IBM capabilities are com-bined into role-based, high performance work environments.

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

452 © Copyright IBM Corporation 2007

Page 486: IBMN8D510

Software Description

WorkplaceManaged Cli-ent

IBM® Workplace Managed Client™ delivers fully integratedserver-managed collaboration to the end user’s desktop. Itprovides flexibility and portability of client-side applications,combined with server-side control and cost savings tradition-ally associated with Web-based computing -- for the best ofboth worlds. IBM Workplace Managed Client capabilitiesinclude online and offline access to messaging, documents,instant messaging, Activity Explorer, productivity tools, anddata access.IBM Workplace Managed Client is built on IBM Workplace Cli-ent Technology, the foundation for next-generation, network-centric computing. Please contact your IBM salesrepresentative if you are interested in obtaining the IBM Work-place Managed Client.

WorkplaceServicesExpress

IBM Workplace Services Express gets any team up and run-ning quickly with team collaboration, document managementand an integrated portal.Featured Capablilites:

● Team Collaboration

● Document Management

● Ready to use

WorkplaceTeam Collabo-ration

lBM® Workplace Team Collaboration™ -- part of IBM® Work-place Collaboration Services™ -- integrates business instantmessaging and presence awareness, Web conferencing, andcustomizable team spaces. Workplace Team Collaborationcan help simplify your infrastructure and business processeswhile helping bring together team members, increase produc-tivity, improve customer responsiveness and enable faster andbetter decision making. This helps individuals, teams andentire organizations -- together with their customers, businesspartners and suppliers -- to be better informed, more produc-tive and more efficient. IBM Workplace products provide thefront-end to IBM’s service oriented achitecture (SOA) strategy.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix C ■ Extend IBM® Lotus® Domino® Software

© Copyright IBM Corporation 2007 453

Page 487: IBMN8D510

Software Description

WorkplaceWeb ContentManagement

IBM Workplace Web Content Management software offersend-to-end Web content management -- content can be cre-ated (using a WYSIWYG rich text editor), managed andpublished 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 userpreference

● Ensures a consistent, professional look and feel acrossmultiple sites

Appendix

Appendix C ■ Extend IBM® Lotus® Domino® Software

454 © Copyright IBM Corporation 2007

Page 488: IBMN8D510

Certification and ExamCompetenciesIBM Software Services for Lotus Training andCertification

IBM Software Services for Lotus offers training and certification pro-grams designed to help customers take full advantage of technologyinvestments to improve business processes.

Lotus software training ensures that individuals get up to speed quicklyand effectively whether delivered in the classroom, on the desktop, orvia distributed learning. For more information on Lotus software training,please visit http://www.ibm.com/lotus/training.

The IBM Certified Professional for Lotus Software program provides indi-viduals with a means to benchmark their technical knowledge andachieve industry recognition, which results in increased business valueto both the individual and their organization. As a member of a highlyregarded certified community, individuals enjoy benefits commensurateto their certification level. For more information on certification, pleasevisit http://www.ibm.com/lotus/certification.

Skills Roadmaps are available to guide you on your path to knowledge.Roadmaps identify courses in their logical sequence to complete a spe-cific curriculum or certification program. To view Skills Roadmaps forLotus, please visit http://www.ibm.com/lotus/trainingroadmaps.

Lotus Professional Certification

Lotus software has robust certification programs in support of IBM Lotussoftware and technical skills. For complete information on the Lotus pro-fessional certification program, visit the IBM Software Services for LotusCertification Web page at http://www.ibm.com/lotus/certification.

DAppendix

© Copyright IBM Corporation 2007

Page 489: IBMN8D510

Place in certification

Fundamentals of IBM® Lotus® Domino® 8 Application Development is listedas one of the preparation resources for the following exam:

Exam 834 - IBM Lotus Notes Domino 8 Application DevelopmentFoundation Skills

This exam is part of the path for IBM Certified Application Developer - LotusNotes and Domino 8 certification. The complete path is described here:

IBM Certified Associate Developer - Lotus Notes and Domino 8

Exam 834 -IBM Lotus Notes Domino 8 Application Development Foun-dation Skills

IBM Certified Application Developer - Lotus Notes and Domino 8

Successfully pass the following three exams:

● Exam 834 - IBM Lotus Notes Domino 8 Application DevelopmentFoundation Skills

● Exam 835 - IBM Lotus Notes Domino 8 Application DevelopmentIntermediate Skills

● Exam 836 - IBM Lotus Notes Domino 8 Developing Web Applica-tions

IBM Certified Advanced Application Developer - Lotus Notes andDomino 8

Exam information not yet available.

Preparing for a Lotus certification exam

Attending this course and using this Student Guide will help you prepare forcertification. Some topics covered on the exam are not covered in thiscourse and some of the objectives covered in this course are not tested onthe exam. Be sure to follow all the steps listed in order to prepare fully forthe exam.

Step Action

1 Review the exam competencies.

2 Get hands-on experience.

3 Use the exam preparation page.

4 Use all available resources.

Appendix

Appendix D ■ Certification and Exam Competencies

456 © Copyright IBM Corporation 2007

Page 490: IBMN8D510

Step 1: Review the exam competencies

Review the exam competencies to see the complete listing of possible top-ics for the exam. Use the competency listing as your checklist to determineyour weaknesses and the areas on which you will want to focus more atten-tion in your studies and preparation.

You will find the competencies listed in:

● The Exam Competencies Appendix included in this course.

● The Exam Guides located on the IBM Software Services for Lotus Cer-tification Web page at http://www.ibm.com/lotus/certification.

Step 2: Get hands-on experience

Actual hands-on experience is a critical component in preparing for theexam. The exam is looking to measure how well you perform tasks, not howwell 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 replacedby any other single resource listed here.

Step 3: Use the exam preparation page

The exam preparation page lists resources available for each individualexam. To find the exam preparation page for this exam, go to http://www.ibm.com/lotus/certification and use the Select an exam drop-downmenu. 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 anexam. The following table describes the types of resources available to pre-pare for certification exams. For a listing of resources specific to each exam,use the individual exam preparation page located at http://www.ibm.com/lotus/certification.

Resource Brief description Where to find resource

Exam guides Complete versionincludes certificationtitles and paths, samplequestions, and registra-tion information.

Abbreviated version isavailable in the ExamCompetencies Appendixincluded in this course.Complete version is avail-able on the IBM SoftwareServices for Lotus Certifi-cation Web page at http://www.ibm.com/lotus/certification.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix D ■ Certification and Exam Competencies

© Copyright IBM Corporation 2007 457

Page 491: IBMN8D510

Resource Brief description Where to find resource

Lotus authorizedcourses

Offered at EducationCenters for IBM Soft-ware (ECIS) and Lotuseducation locationsworldwide.

A complete list of coursesand education centers areon the IBM Software Ser-vices for Lotus EducationWeb page at http://www.ibm.com/lotus/education.

CBT programs Used as an alternatelearning tool or supple-ment to courses or both.

Additional information isavailable at The Educa-tion Store on the IBMSoftware Services forLotus Education Webpage at http://www.ibm.com/lotus/education.

Practice tests Available from a varietyof vendors. Visit the indi-vidual exam preparationpage to determine whatpractice tests are avail-able for a specific exam.

Available from the IBMSoftware Services forLotus Certification Webpage at http://www.ibm.com/lotus/certification.

Online learning This includes online tuto-rials and other learningresources.

See the individual exampreparation page for rec-ommended onlinelearning resources.

Product Documenta-tion

Official Lotus productdocumentation.

Additional informationavailable at http://www-10.lotus.com/ldd/doc.

IBM Redbooks Technical cookbooksthat address topics thatthe reference manualsmay not cover.

Ordering information isavailable at http://www.redbooks.ibm.com.

Appendix

Appendix D ■ Certification and Exam Competencies

458 © Copyright IBM Corporation 2007

Page 492: IBMN8D510

Preparing for the IBM Lotus Notes Domino 8 ApplicationDevelopment Foundation Skills exam

The following materials are available for the IBM Lotus Notes Domino 8Application Development Foundation Skills exam:

● Fundamentals of IBM® Lotus® Domino® 8 Application DevelopmentCourse

● 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 individualexam preparation page. Go to http://www.ibm.com/lotus/certification andselect the exam name from the Select an exam drop-down menu. Theseindividual pages will give you the most up to date list of resources available.

IBM Lotus Notes Domino 8 Application DevelopmentFoundation Skills Exam Competencies

The exam competencies are one tool for preparing for IBM Certified forLotus Software exams. The exam competencies along with a complete list-ing of learning resources are included on the Lotus Certification Web siteavailable at www.lotus.com/certification.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix D ■ Certification and Exam Competencies

© Copyright IBM Corporation 2007 459

Page 493: IBMN8D510
Page 494: IBMN8D510

Instructor PreparationPreparation Checklist

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 theInstructor Notes and Demo Notes.

● Refer to the Interactive Instructor Guide (IIG) to get updated infor-mation on the course.

● Refer to the Instructor Lounge to gather useful teaching tips andtechniques that other instructors have used to teach this course.

● Use the information in this section to find additional resources tofurther your knowledge of the subject.

● Practice the classroom setup.

Course Strategy

Approach

Fundamentals of IBM Lotus Domino Designer 8 is the first course in theLotus Domino 8 Application Development curriculum. This course takesfour full days to deliver correctly. The intent of the design of this courseis to give the students a solid foundation in designing and developingLotus Domino applications. Students learn about working with the basicbuilding blocks in a Lotus Domino application, and working with the For-mula language. They also learn how to add to the basic building blockswith more advanced functionality such as automating the application andsecuring it. Finally, they learn how to manage an application in a produc-tion environment, and what they need to know, or be able to do, todeploy it.

EAppendix

© Copyright IBM Corporation 2007

Page 495: IBMN8D510

Scenario

Worldwide Corporation is an international pottery manufacturer. The com-pany sells ceramics worldwide. Products include tiles, china, and variouskinds of pottery. The corporate office houses manufacturing, research anddevelopment, product management, quality control, human resources, andsystem administration. There are several smaller sales offices and resellersthroughout each region, and some sales representatives work from theirhomes. The Policies and Procedures application that you will design anddevelop will contain corporate policies and procedures for Worldwide Corpo-ration. It will also contain a discussion forum so that employees can askquestions about policies and procedures.

Recommended Agenda

The tables that follow describe the recommended agenda for delivering thematerial over the four days.

Day 1

The following table shows the recommended agenda for Day 1.

Time Lessons or Topics

30 minutes Course and student introductions

1 hour Lesson 1: Exploring Applications in Lotus Domino 8

30 minutes Lesson 2: Exploring the Lotus Domino 8 Design Environ-ment

1 hour Lesson 3: Creating Applications

1 hour Lunch

30 minutes Lesson 3: Creating Applications continued

3 hours Lesson 4: Creating Pages

Day 2

The following table shows the recommended agenda for Day 2.

Time Lessons or Topics

2 hours, 30 min-utes

Lesson 5: Creating Forms

1 hour Lunch

Appendix

Appendix E ■ Instructor Preparation

462 © Copyright IBM Corporation 2007

Page 496: IBMN8D510

Time Lessons or Topics

2 hours Lesson 6: Creating Views

1 hour Lesson 7: Introducing Formulas

1 hour, 30 min-utes

Lesson 8: Using Formulas in Forms

Day 3

The following table shows the recommended agenda for Day 3.

Time Lessons or Topics

3 hours Lesson 8: Using Formulas in Forms continued

1 hour, 30 min-utes

Lesson 9: Using Formulas in Views

1 hour Lunch

2 hours, 30 min-utes

Lesson 10: Enhancing Forms

Day 4

The following table shows the recommended agenda for Day 4.

Time Lessons or Topics

1 hour Lesson 11: Enhancing Views

1 hour, 30 min-utes

Lesson 12: Working with Actions

1 hour Lesson 13: Working with Agents

1 hour Lunch

2 hours Lesson 14: Securing Applications

1 hour Lesson 15: Deploying Applications

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix E ■ Instructor Preparation

© Copyright IBM Corporation 2007 463

Page 497: IBMN8D510

CLI Private Site

For more information on how to teach this course, refer to the CLI PrivateSite located at http://www.lotus.com/cli.

If you have already registered, enter your user name and password toaccess the Instructor Lounge and other private areas of the Web site to gainadditional 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 thecertified community. After registering, you will be able to access the CLI Pri-vate Site using your user name and password.

CLI Certification Requirements

To learn about the requirements for becoming a CLI or to upgrade your cur-rent certification, visit the IBM Software Services for Lotus Certification Website at http://www.lotus.com/certification.

Additional Instructor Preparation Information

The following table lists and describes additional resources you can use toprepare to teach this course.

This Resource Will Help You Learn More About...

IBM Redbook titled Lotus DominoDesigner 6: A Developer’s Hand-book, SG24-6854-00, ISBN:0738414123Note: Check the Redbook site formore updated information as itbecomes available: http://www.redbooks.ibm.com/redpieces/abstracts/redp4102.html

Developing applications for LotusDomino Designer 6 and 7. These appli-cations can be used by different clients,such as Notes clients, Web browsers, ormobile devices.Those readers who are familiar withdeveloping applications using Release 5of Lotus Domino may want to movestraight to the chapter that introducesthe new features in Lotus Domino 6.0and continue from there.The chapters towards the end of thebook will discuss different programminglanguages, @functions, LotusScript,JavaScript™, and Java™, which can beused in Lotus Domino. We describe indetail how to manipulate rich textobjects by programming as well as XMLin Lotus Domino.

Appendix

Appendix E ■ Instructor Preparation

464 © Copyright IBM Corporation 2007

Page 498: IBMN8D510

This Resource Will Help You Learn More About...

http://www-10.lotus.com/ldd Lotus Domino 8 information directlyfrom the people who developed theproduct. This is the Lotus DeveloperDomain (LDD) site, the premier Website for technical information aboutLotus software from IBM.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

Appendix E ■ Instructor Preparation

© Copyright IBM Corporation 2007 465

Page 499: IBMN8D510
Page 500: IBMN8D510

Solutions

Lesson 1Activity 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.

Page 501: IBMN8D510

Lesson 7Activity 7-1:

1. You are designing a form with a number of fields. Some fields on theform require an initial value that is changeable by the user. Other fieldsrequire a computed value. Some actions may need to be hidden from cer-tain users.

a) LotusScript

b) JavaScript

✓ c) Formula language

d) Java

2. The application that you are designing requires that you get some of theinput from dialog boxes.

✓ a) Formula language

✓ b) JavaScript

✓ c) LotusScript

d) Java

3. The application you are creating requires access to documents in appli-cations 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 interac-tion with the user. In the past, you have had moderate success atautomating a series of tasks, but you do not have extensive experiencein programming.

✓ a) Formula language

b) LotusScript

✓ c) JavaScript

d) Java

Solutions

468 © Copyright IBM Corporation 2007.

Page 502: IBMN8D510

5. The application that you are developing involves an extensive amount ofinteraction with the user. You will need to validate field contents, positionthe 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 flow control, includ-ing loops and multiple conditional branches. You have no idea, as youare 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 analyzingthe application, you find that while it is very user friendly, some of theformulas are performing very poorly. Which languages would you use toreplace the formulas to improve the performance of the user interface?

a) Formula language

✓ b) LotusScript

✓ c) JavaScript

d) Java

Activity 7-2:

1. FirstName: Susan

2. ″LastName″: LastName

3. FirstName + LastName: SusanSunshine

4. LastName + ″, ″ + FirstName: Sunshine, Susan

5. FirstName = ″Susan″: True

6. (FirstName != ″Larry″) & (LastName = ″Sunshine″): True

7. @Adjust (@Created; 0; 6; 0; -2; 0; 0): 6/30/2006 9:59:37 PM

8. @If (@Created < @Today; ″Old″; ″New″): Old

9. @Text (10.22): Text value, 10.22

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007. 469

Page 503: IBMN8D510

10. fullName := FirstName +″ ″ + LastName; ″Welcome back, ″ + fullName:Welcome back, Susan Sunshine

Lesson 14 Follow-upLesson 14 Lab 1

1. For the Default user type, the Depositor access control level should beused.

2. For the Anonymous user type, the No Access access control level shouldbe used.

3. For the Employees group, the Author access control level should beused.

4. For the Policy Makers group, the Editor access control level should beused.

5. For the Department Head, the Author access control level should be used.

6. For the Managers group, the Manager access control level should beused.

7. For the Designer, the Designer access control level should be used.

Solutions

470 © Copyright IBM Corporation 2007.

Page 504: IBMN8D510

Glossary@functionA built-in formula that performs calculations and either returns a value orperforms an action.

actionA program associated with either a view or a form and used to automatetasks for users.

aliasAnother name for a page or other design element.

applicationA solution to a particular problem that may include one or more data-bases and other components.

bookmarkA feature used for easy access to frequently used applications and data-bases.

categorizationA process by which related documents are grouped together in a viewbased on the column value.

data noteAlso known as a document, it is a specific kind of note that stores data.

design elementsThe building blocks for applications in Lotus Domino Designer.

eventThe part of an object that initiates code execution and includes openinga database, opening a view, opening a document, moving the cursor intoor out of a field, and so on.

© Copyright IBM Corporation 2007.

Page 505: IBMN8D510

extended productsA family of products that extends and enhances the value of a LotusDomino environment to increase organizational productivity and responsive-ness through business-critical collaboration solutions.

fieldA part of a form that collects, calculates, or displays data.

form eventAn event that is triggered when a document is opened, saved, refreshed,closed, or switched between read and edit mode.

formA design element through which data is entered and displayed.

Formula languageThe core language built into Lotus Notes and Lotus Domino from their earli-est releases that provides a straightforward and simple programminginterface within Lotus Domino applications.

Hide/WhenA property that controls when an element is visible to users or a specific setof users.

hierarchical viewA view that displays main documents and their associated response docu-ments, and visually distinguishes between them.

IDE(Integrated Development Environment) A Lotus Domino Designer environ-ment that provides for writing code in a Lotus Domino application.

itemA container that stores data from a note, which is identified by a name andcontains a list of values.

JavaScriptA scripting language integrated in Lotus Domino Designer that allows LotusDomino applications to support users with Web browsers.

listA named entity that contains multiple values of the same data type in LotusDomino.

Lotus Domino serverA computer that runs the Lotus Domino server program and stores LotusNotes applications.

Solutions

472 © Copyright IBM Corporation 2007.

Page 506: IBMN8D510

LotusScriptAn embedded basic scripting language that offers access to Lotus Dominodata and services beyond the capabilities of the Formula language.

metadataInformation about data that is available to the application and the LotusDomino services.

NIF(Notes Index Facility) A Lotus Domino application functionality, which buildsand maintains lists for locating data in the application.

noteA single and simple data structure in Lotus Notes and Lotus Domino used tostore data and design elements.

NRPC(Notes Remote Procedure Call) A mechanism for transmitting client requeststo the Lotus Domino application and returning the results.

NSF(Notes Storage Facility) A Lotus Domino database functionality, which main-tains the data and design elements of the application.

objectAn element, such as a form, field, and so on, into whose event code isplaced.

replica databaseA database that shares the same replica ID with other databases.

replicationA process of synchronizing multiple instances, or copies, of a application onmultiple servers and workstations.

shared resourceAn element, such as a graphic file, stored within a Lotus Domino applica-tion.

sortingOrganizing documents in a view, displaying them in a specific order.

statementA component of formulas that consists of a combination of variables, con-stants, operators, @functions, and keywords.

tableAn element used to organize content into rows and columns.

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007. 473

Page 507: IBMN8D510

templateAn application that contains the structure for a particular application, butdoes not contain any data.

View design elementCreates an organized list of documents so that users can find the informa-tion they need.

view indexAn internal filing system that stores the list of documents in a view.

Solutions

474 © Copyright IBM Corporation 2007.

Page 508: IBMN8D510

Index

Aaccess control, 329access control levels, 323access control list

defining roles, 328Access Control List, 20Access Control List dialog box, 321access level options, 325ACL

See: Access Control Listaction, 287

buttons, 297creating, 287display, 288order, 296shared, 294, 295sub, 296system, 291

Action bar, 299Action bar applet, 300Action Bar Property box, 300Action pane, 288Action Property box, 289actions

displaying, 298Add Condition dialog box, 128Advanced tab, 279agent

activated, 313

event, 313names, 316

Agent Property box, 309agents, 307

private, 308shared, 308

alias, 62anonymous users, 339application, 3

high-security, 340low-security, 339

application notes, 90application security, 321automating tasks, 19AutoSave, 247AutoSave application, 247

BBackground tab, 224Basics tab, 310bookmarks, 49

Ccategorization, 141Cell Borders tab, 71Column Info tab, 216Column Properties box, 133, 216@Commands, 292

© Copyright IBM Corporation 2007.

Page 509: IBMN8D510

comments, 170concatenation, 213conditional statements, 167connecting to Lotus Domino, 151constants, 162

in formulas, 162

Ddata note, 14@DbColumn function, 192deployment, 349design elements, 35display pages, 57document access, 333Document Properties box, 15document relationships, 244

EEmbedded View Property box, 277event, 160external programming languages, 150

Ffield, 96

Author, 106Authors, 336Computed, 182Computed for display, 181Computed when composed, 182data type, 98Date/Time, 107Department, 110design considerations of, 99inherit, 237list, 102MsgType, 234Name, 106names, 97Number, 107Readers, 334rich text, 99shared, 235

text, 99value options of, 98

Field Info tab, 100, 108Field Properties box, 100fields

characteristics of, 96folders, 49form, 89

programming, 177related, 242

form design, 91form event, 178form names, 93Form Properties box, 92Form Type property, 243forms, 19

adding text and tables to, 94elements used in, 90

Formula language, 151, 158Formula Language

commenting, 170formulas

common uses of, 177functions

@Failure, 187list, 189@Success, 187

@Functions, 166common, 166examples of, 167

HHide/When, 109

conditions for using, 110hotspots, 301

IIBM® Lotus Notes® errors, 198IBM® Lotus® Domino Designer® Help,

37IBM® Lotus® Domino® server, 5IBM® Lotus® Sametime®, 251

Index

476 © Copyright IBM Corporation 2007.

Page 510: IBMN8D510

IBM® LotusScript®, 152IBM® Workplace™, 26icon

custom, 218icons

predefined, 217image

shared, 79Image Resource Properties box, 80images, 77initial view properties, 125input translation formula, 184input validation formulas, 186insert image resource, 81instant messaging chat action buttons,

293Instant Messaging Contact List, 253Integrated Development Environment

(IDE), 150Also See: IDE

@IsError, 199@IsNewDoc function, 180item, 13

JJava, 153Java view applet, 275JavaScript, 154

Llayer

anchor, 224hide, 228resize and reposition, 226

Layer Anchor Property box, 224Layer position tab, 226Layer Property box, 224Layer Tree, 228layers, 223

benefits of, 223link column, 280list, 189list functions, 191

Lotus Domino containment model, 12Lotus Domino extended products, 25Lotus Domino objects, 160Lotus Domino Programming, 149Lotus Domino security layers, 20

Mmetadata, 13

Nnavigation, 19NIF

see Notes Index Facility, 13Notes, 11Notes Index Facility, 13Notes Remote Procedure Call (NRPC),

7Notes Storage Facility, 13NSF

see Notes Storage Facility, 13

Oobjects, 160operators, 163

comparison, 164

Ppage design element, 55page names, 61Page Properties box, 60Picture Properties box, 78previews, 64Programmer’s pane, 37@Prompt function, 194

Rreplica databases, 23replication, 22replication control, 352responses-only column, 264

Fundamentals of IBM® Lotus® Domino® 8 Application Development

© Copyright IBM Corporation 2007. 477

Page 511: IBMN8D510

reusable code, 196roles, 328run-time errors, 197

Sscheduling events, 314SELECT @All formula, 211SELECT statement, 312shared column, 266shared resource, 79simple searches

preventing, 138sort index creation

deferring, 139sorting, 136Sorting tab, 136statement, 158@StatusBar function, 198subform, 231

computed, 234create, 232

Subform Property box, 233syntax rules, 159

Ttable, 68

types of, 68Table Borders tab, 73Table Layout tab, 70Table Margins tab, 73Table Programming tab, 75Table Property box, 69Table Row tab, 74Table/Cell Background tab, 72tables

and the Web, 69template, 41, 350

master, 351text data, 99text formatting functions, 184Text Properties box, 64@Text. function, 214@ThisName, 196@ThisValue, 196threaded discussions, 245

Uuser access levels, 324user types, 327

Vvariables, 162

temparary, 163view

aliases, 126building, 121characteristics of, 119creating, 124design, 123embedded, 274hierarchical, 263

view columns, 131View design element, 119view events, 209view index, 120View Properties box, 143View Property box, 278views, 19

Wwindow titles, 179Work pane, 37

Index

478 © Copyright IBM Corporation 2007.

Page 512: IBMN8D510

0 9 9 7 5 1 1 3 0 0 1 2

IBMD8510sg_10